traverse-framework / traverse-framework/registry

Publish small capability: json.pick-keys (first-contributor friendly)

Open
#490 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted no-spec-needed
Dominant language
Rust
Stars
1
Forks
1
Avg merge
1h 17m
Merged PRs (30d)
217

Description

## Why

A lot of agent / pipeline glue is “take this JSON object, keep only these top-level keys.” The registry has validation/formatting utilities but no tiny **json.pick-keys**. Deterministic, no I/O, full publish path — another good first external capability.

## One-PR ask

Publish **`json.pick-keys@1.0.0`** (namespace `json`, matching the `text.*` / `validation.*` utility style already in-tree):

- Input: `{ "object": object, "keys": string[] }`
- `object` must be a JSON object (not array/primitive) — document the error / empty behavior if it is not; prefer a clear contract-level failure over silent coercion
- `keys` is an ordered list of top-level property names to keep
- Output: `{ "object": object, "missing": string[] }`
- output `object` contains **only** the requested keys that were present, in **`keys` order**
- `missing` lists requested keys that were absent, in the same relative order
- values are copied as-is (no deep clone semantics beyond serde round-trip; document that)
- Include `capability-src/` with real Rust tests meeting registry coverage gates (`functions` 100%, lines/regions ≥ 95%)
- Use `traverse-cli capability publish` (or the documented scaffold) so `artifact.digest` / `artifact.url` survive
- Run `bash scripts/ci/pre_pr_check.sh ` before opening

Follow [`CONTRIBUTING.md`](https://github.com/traverse-framework/registry/blob/main/CONTRIBUTING.md) and a small existing utility contract (`validation.*` / `text.*`) for shape (`use_cases` persona/user-story format if required by FR-011). One capability per PR — do not bundle text helpers here.

## Out of scope

- Deep / dotted-path picks (`a.b.c`)
- JSON Path / JMESPath
- Arrays-of-objects map/filter
- Mutating the input in place (this is a pure transform)
- Changing registry CI gates

## Done when

- CI green on the publish PR
- Capability appears in the next index release after merge
- Contract `use_cases` follow the current persona/user-story format if required

## Labels

`help wanted` · `good first issue` · `enhancement` · `no-spec-needed`

Contributor guide

Open the contributing guide

Research direction

Start with CONTRIBUTING.md and inspect a small existing validation.* or text.* utility for contract shape, use_cases, and capability-src/ tests. Use the documented scaffold or traverse-cli capability publish, then run bash scripts/ci/pre_pr_check.sh with the draft PR body. Done means json.pick-keys@1.0.0 is published with coverage-gated tests, preserved artifact.digest and artifact.url, and a green publish PR.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, cli, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.