Repository navigation
Conversation
`validate_explicit_id` required every `--id` to end in an all-digit suffix, but the artifact loader accepts any uppercase-alphanumeric segments. Stores with id conventions like `SWREQ-FALCON-PREARM-P<nn>` (meld, 277 artifacts) or `REQ-README-ROSTER` (pulseengine.eu) load and resolve those ids, yet `rivet add --id` refused them — so the only way to add the next sibling was to hand-write YAML, exactly the workaround `add` is meant to replace. The reporter hit this twice more after filing, both times falling back to hand-written YAML and once ending up with two conventions in one repo. The write-path check now accepts whatever the loader accepts (uppercase-alphanumeric segments separated by single dashes, with at least one dash and at least one uppercase letter somewhere). The `commit-ref-shape` warning emitted by validate still fires on ids whose last segment isn't all-digit, so a project that relies on commit- trailer coverage still gets told its ids can't be grep-matched by a trailer parser — the two checks are now decoupled, as the issue asked. Lands Fix 1 only. Fix 2 (sibling-aware next-id) and Fix 3 (per-project suppression of commit-ref-shape) remain open follow-ups to #1088; Fix 1 alone unblocks the reporter's immediate case. New in-module unit tests cover both the newly-accepted shapes (the two from the body plus a few historical ones) and the shapes still rejected (lowercase, invalid chars, dash-position errors, no uppercase). A new integration test exercises the full `rivet add --id` path for the newly-accepted shapes. The error-message needle for the no-dash case moved from "numeric suffix" to "at least one '-'", so the existing integration-test case updated to match. Fixes: REQ-007 Refs: REQ-330, #1088, #880 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018W8367wHNy5cYzU8yqjAre
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
Playwright E2E was failing on this PR too for the same reason main is red: `ubuntu-latest` now resolves to Ubuntu 26.04, and the pinned Playwright release's `install --with-deps chromium` fails before any test runs with "Playwright does not support chromium on ubuntu26.04-x64". The failure is base-branch state, not this PR's diff (which only touches `rivet-cli/src/main.rs` and `rivet-cli/tests/cli_commands.rs`). Porting the one-line pin from #1114 so the Playwright gate on THIS PR sees the test body instead of the install error. No-ops once #1114 merges. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018W8367wHNy5cYzU8yqjAre
|
Not this PR's diff — this touches Ported #1114 verbatim in Generated by Claude Code |
|
Second CI failure on Not this PR's diff — this touches only Fix: merged Generated by Claude Code |
|
Not this PR's diff — Base-branch confirmation: every scheduled Spending the one re-run allotted on this failure to see whether the Test job on this SHA goes green with a less-saturated runner. If it still fails, keeping the PR watched; the root fix lives on #1112, not this PR's diff. Generated by Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Closes #1088
What changed
validate_explicit_id(rivet-cli/src/main.rs:19206) previously requiredevery
--idto end in an all-digit suffix. The artifact loader acceptsany uppercase-alphanumeric segment, so a store carrying
SWREQ-FALCON-PREARM-P<nn>(meld, 277 artifacts) orREQ-README-ROSTER(pulseengine.eu) could load those ids but
rivet add --idrefused them,forcing the hand-written YAML workaround the issue is about. The check
now accepts whatever the loader accepts.
The
commit-ref-shapewarning invalidate.rs:678-688is unchanged, soprojects that rely on commit-trailer coverage still get told their ids
aren't grep-matchable from a trailer — the two checks are now decoupled
as the issue's third suggestion asked for.
Scope — Fix 1 only
The prior triage comment on #1088 sketched three fix paths. This PR
lands Fix 1 (widen
validate_explicit_idto match the loader) becauseit is the smallest, most contained change that unblocks the reporter's
immediate case. Fix 2 (sibling-aware
next-idsorivet next-id --type sw-reqreturnsSWREQ-FALCON-PREARM-P04instead ofSWREQ-001) andFix 3 (per-project suppression of
commit-ref-shape) remain openfollow-ups on the same issue.
How each ask in #1088 is addressed
P<nn>-style segment in--id, since the loaderalready does." — Done. The suffix no longer has to be all-digit; it
can be any uppercase-alphanumeric segment, matching the loader's
acceptance.
next-idderive from existing IDs." — Deferred to Fix 2(open on rivet add --id rejects, and next-id cannot mint, the ID convention the store already loads (forces hand-written YAML) #1088). This PR is scoped to the write-side
--idshapecheck.
--idacceptance." — Done.validate_explicit_idno longer co-enforces the trailer shape; thecommit-ref-shapewarning atvalidate.rs:680is now the only placethat speaks about trailer discoverability. A project that wants to
suppress those warnings in bulk is the Fix 3 follow-up.
Test plan
cargo test -p rivet-cli --bins validate_explicit_id_tests— thenew in-module unit tests pass; both the accepted shapes
(
SWREQ-FALCON-PREARM-P04,REQ-README-ROSTER,VER-REVIEW-V0-43-0,and historical ones) and the still-rejected shapes (lowercase,
invalid chars, dash-position errors, no uppercase) are covered.
cargo test -p rivet-cli --test cli_commands add_id_flag— allfour end-to-end
rivet add --idtests pass, including the newadd_id_flag_accepts_loader_shapes.cargo test -p rivet-cli --bins— full 168-test bin suite green.cargo fmt --all -- --checkclean.cargo clippy -p rivet-cli --all-targets -- -D warningsclean.rivet validateon this repo: PASS (unchanged, 844 warningsbaseline).
rivet add --type requirement --id SWREQ-FALCON-PREARM-P04 --title Example --status proposedon afresh
rivet initproject succeeds and the file carries the idverbatim. Repeated with
REQ-README-ROSTER. Negative controls(
req-001,1-2) still rejected.Generated by Claude Code