Skip to content

feat(cli): rivet review export — commit-pinned JSON snapshot of a release - #1232

Closed
avrabe wants to merge 2 commits into
mainfrom
feat/issue-1227-review-export
Closed

avrabe wants to merge 2 commits into
mainfrom
feat/issue-1227-review-export

Conversation

@avrabe

@avrabe avrabe commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1227

Adds rivet review export --release vX [--since <ref>] [--format json] (new module rivet-cli/src/cmd/review.rs, requirement REQ-416, satisfied by feature FEAT-141).

Acceptance criteria

  • rivet review export --release vX --format json emits commit, release and every artifact scoped to vX, provenance included. Output is {command, commit, release, since, count, artifacts[]}. commit is the full 40-char git rev-parse HEAD. Scope uses the same predicate as rivet list --release vX, and a test asserts the id sets match. Each artifact carries id, type, title, status, release, description, tags, fields, fields_per_variant, links and provenance. Tested in rivet-cli/tests/review_export.rs. On a clean clone of this repo, --release v0.42.0 exports 12 artifacts, the same 12 that rivet list --release v0.42.0 returns.
  • A dirty tree exits non-zero with a message naming the dirty paths. It checks git status --porcelain --untracked-files=all. Any entry, untracked files included (rivet would load them), exits 1 with empty stdout and lists every dirty path on stderr. Covered by an integration test.
  • --since <sha> reports exactly the added, removed and changed artifacts for vX, with a test covering all three. The project at <sha> is loaded with the existing git archive baseline loader (load_baseline_from_git, now pub(crate), not duplicated). Each artifact gets a change of added, removed or changed, and changed ones also get changed_fields (top-level keys). Moving into or out of vX counts as added or removed. Removed artifacts carry their content as of <sha>. Unchanged artifacts are left out. The integration test covers one artifact of each kind and checks that an unchanged one is absent. There is also a unit test of the delta logic.
  • The JSON shape is documented under rivet docs and covered by a schema or snapshot test.
    • Documentation: a new rivet docs review-export topic, exported to docs/reference/review-export.md.
    • Schema: schemas/json/review-export-output.schema.json, with additionalProperties: false and an enum on change. It is registered in JSON_SCHEMA_REGISTRY, so it appears in rivet schema list-json.
    • Contract test in json_output_contracts.rs: validates real output, both a full export and a --since delta, against the schema, and checks that a bad change value, an extra key and a short commit sha are each rejected.

Design notes for the reviewer

Verification

  • cargo fmt --all -- --check: clean
  • cargo clippy --all-targets -- -D warnings and cargo clippy -p rivet-cli --no-default-features -- -D warnings: clean
  • cargo test -p rivet-cli --test review_export: 4/4 passed
  • --test json_output_contracts: 6/6 passed
  • --test cli_commands: 275/275 passed
  • --test docs_check --test docs_coverage: all passed
  • --bin rivet: 172/172 passed
  • rivet validate: PASS (853 → 855 warnings). The two new warnings are ai-generated-needs-review on REQ-416 and FEAT-141, because provenance.reviewed-by is unset (REQ-415 and FEAT-140 have the same warning).
  • Traceability ratchet against main: 0 new gated findings, after FEAT-141 was added to satisfy REQ-416.
  • rivet docs check: the same 5 pre-existing ChangelogStructure violations as main (no tags in a shallow clone, plus old duplicate headings), and nothing new.
  • CI on 06792e1: all checks passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KEjmjZqkpapN4wvGGZwHUo

…ease

`rivet review export --release vX [--since <ref>] [--format json]` emits
{command, commit, release, since, count, artifacts[]} where each artifact
carries id, type, title, status, release, description, tags, fields,
links and provenance. A dirty working tree (any porcelain entry,
untracked included) exits 1 naming every dirty path. `--since <ref>`
loads the project at <ref> via the existing git-archive baseline loader
and reports only added/removed/changed artifacts for vX, with
changed_fields on changed ones.

Shape is pinned by schemas/json/review-export-output.schema.json, a
contract test in json_output_contracts.rs, and documented as the
`review-export` docs topic.

Closes #1227

Implements: REQ-416
Verifies: REQ-416
Refs: REQ-007

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEjmjZqkpapN4wvGGZwHUo
The traceability ratchet flagged REQ-416 (implemented) as new
requirement-coverage debt: no feature or design decision satisfied it.
FEAT-141 records the review-export feature and closes the gap.

Refs: REQ-416

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEjmjZqkpapN4wvGGZwHUo
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

📐 Rivet artifact delta

Change Count
Added 2
Removed 0
Modified 0
Downstream impacted (depth ≤ 5) 0

Graph

graph LR
  FEAT_141["FEAT-141"]:::added
  REQ_416["REQ-416"]:::added
  classDef added fill:#d4edda,stroke:#28a745,color:#155724
  classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
  classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
  classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Loading
Added
  • FEAT-141
  • REQ-416

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-1232 — download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

avrabe added a commit that referenced this pull request Nov 19, 2026
Cherry-picking #1232's two commits (from another session) onto main
after v0.42.2 put its CHANGELOG entry inside the released [0.42.2]
section and duplicated the [0.42.0] heading; the entry moves to
[Unreleased] / Added. The review-export docs topic's example used
v0.42.0, which docs check refuses now that the workspace is 0.43.0; it
uses v0.43.0, and docs/reference is regenerated. requirements.yaml and
cmd/mod.rs conflicts kept both sides: REQ-416 follows REQ-417/418, and
cmd/mod.rs declares both review and supplier.

Refs: REQ-416

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9
avrabe added a commit that referenced this pull request Nov 19, 2026
v0.43.0 was cut without #1232 (owner decision 2026-11-19: review export
waits for v0.44.0). After rebasing onto the tag, the CHANGELOG entry
landed inside the released [0.43.0] section; it moves to [Unreleased],
and REQ-416 moves from v0.43.0 to v0.44.0.

Refs: REQ-416

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9
@avrabe

avrabe commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1298. This PR's two commits are carried there unchanged, rebased onto main after v0.43.0 (conflicts in requirements.yaml and cmd/mod.rs keep both sides). The owner decided 2026-11-19 that review export ships after v0.43.0, so REQ-416 is scoped to v0.44.0. Closed rather than force-pushed because this branch belongs to another session.

@avrabe avrabe closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rivet review export: a commit-pinned JSON snapshot of a release's artifacts for review

2 participants