Repository navigation
agent CLI: refuse repeated value flags, empty verify --gap-id, normalize status --out, drop std parse text (#10542 PR A) - #10649
EffortlessSteven wants to merge 4 commits into
Conversation
Repeated verify/card/start/receipt/repair/packet value flags now refuse like stub and brief; verify --gap-id rejects empty; status --out is lexically normalized; numeric errors drop std parse text. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 18 minutes. View limit details
Comment |
| fn refuse_repeat<T>(slot: &Option<T>, command: &str, flag: &str) -> Result<(), String> { | ||
| if slot.is_some() { | ||
| return Err(format!("{command} takes {flag} once")); | ||
| } | ||
| Ok(()) | ||
| } |
There was a problem hiding this comment.
🟡 New CLI behavior lacks spec traceability
The new refuse_repeat contract has tests but no spec entry or traceability mapping. The same omission covers status path acceptance and numeric errors, leaving these behavior changes outside the required spec-to-test map.
Learn more
The repository requires a spec-to-test-to-code mapping for behavior changes in CONTRIBUTING.md and SPEC_TEST_CODE.md. This change adds new CLI parsing refusals, permits additional status directory spellings, and changes numeric diagnostics. Its new tests are not registered in a behavior spec or .ripr/traceability.d/ fragment. Existing mappings mention the old command surfaces but do not name these new behaviors or their tests. That leaves the acceptance criteria and proof for the new behavior undiscoverable through the required mapping.
Example: A maintainer tracing the new repeated --seam-id refusal from the spec manifest finds existing agent command tests but no registration for value_flags_refuse_repeats_like_stub_and_brief.
Recommended fix: Add or update the relevant CLI behavior spec with acceptance examples and the new test symbols, then register the mapping in a new .ripr/traceability.d/ fragment. Cover repeated flags, empty verify gap ID, normalized status output paths, and parse diagnostics; run cargo xtask check-traceability.
Was this helpful? React with 👍 or 👎 to provide feedback.
| /// One shared refusal for a value flag given twice, so a repeat is never a | ||
| /// silent last-wins: `<command> takes <flag> once`. | ||
| fn refuse_repeat<T>(slot: &Option<T>, command: &str, flag: &str) -> Result<(), String> { | ||
| if slot.is_some() { | ||
| return Err(format!("{command} takes {flag} once")); | ||
| } | ||
| Ok(()) | ||
| } |
There was a problem hiding this comment.
🔍 Other flags retain last-value parsing
refuse_repeat covers selected flags, while other value flags still keep the last value, including repair trust flags and verify-execute paths. A follow-up can decide whether the once-only rule extends to them.
Was this helpful? React with 👍 or 👎 to provide feedback.
…ty for #10542 PR A Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX
There was a problem hiding this comment.
Verification questions
- Confirm the test matrix omits several repeat-protected flags named in the PR claim, including repair --gap-id/--base/--attempt, packet --gap-ledger/--seam-id, and receipt --attempt/--verify-json/--out.
- Confirm the changelog describes value flags generally, although the implementation and PR body enumerate a narrower set of once-only flags.
- Confirm the once-only rule is applied to only a subset of value flags; seeded review evidence identifies repair trust flags and verify-execute paths as retaining last-value behavior.
Refuted
- The diff changes worker-handoff or JS-backed memory ownership semantics.; refuted because: All four changed files are Rust CLI/parser/path-handling code or Markdown, and the patch contains no JavaScript-backed runtime, worker, asynchronous capture, garbage-collector, detach, or transfer operation. The unsafe-review receipt also reports no new, worsened, or inherited gaps.
- The changed code may mutate a resizable active view or backing store.; refuted because: The diff contains no memory-buffer, typed-array, resize, detach, transfer, or length-snapshot operations; its path helper only compares normalized PathBuf components.
- Lexical normalization could permit a ../ path escape by collapsing parent components.; refuted because: ParentDir is only popped after a Normal component; a leading or root-parent component is retained, and the test explicitly rejects ../target/ripr/workflow.
- The new repeat guards could reject a legitimate second occurrence of the same option.; refuted because: That is the intended contract for the listed value flags, and single-use acceptance is covered by the changed test.
- The duplicate-flag helper could expose or consume sensitive flag values before refusing repetition.; refuted because: refuse_repeat only checks whether the destination Option is already populated and performs no formatting or filesystem access; the repeated value is not read or emitted.
- Lexical normalization could broaden --out acceptance to escaping paths or introduce filesystem-dependent behavior.; refuted because: The implementation never touches the filesystem and keeps a leading ParentDir when no normal component can be popped, while focused tests reject ../target/ripr/workflow.
- The repeat-refusal helper is called before reading a flag value, so it might reject the first use.; refuted because: Each guarded slot is initialized as None and is not assigned until after the helper returns; the helper therefore rejects only a second occurrence.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- The diff's broader policy that all value flags must refuse repeats is not implemented for every agent option; this is outside the stated PR scope but should remain parked rather than silently broadened.
…ent (#10542) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX
|
Integration handoff to the existing #10542 owner: please reconcile this branch against landed #10624 before delivery. Its symlink-before-parent-component refusal must be preserved; a filesystem-blind lexical normalizer alone is not equivalent when a symlink precedes |
|
Closing as a duplicate of already-delivered work, per the integration handoff: items 1-2 landed in #10615, item 3 in #10624 (with its symlink-before-parent refusal, which this branch's filesystem-blind normalizer would not preserve), and item 4 is in #10653. Nothing unique remains here except Generated by Claude Code |
Governing issue or accepted claim: #10542
Acceptance delta (one sentence):
ripr agentvalue flags refuse repeats instead of silently last-winning,agent verify --gap-id ""is refused,agent status --outaccepts lexically equivalent spellings of the default directory (including..pairs), and numeric flag errors no longer leak std ParseIntError text.Behavior items 1-4 of #10542 only. Help text items 5-8 remain for PR B; exit codes were done in #10555.
refuse_repeat/refuse_repeat_ifhelpers incli/agent.rs(messageagent <cmd> takes <flag> once, the existing stub/brief shape;stub --kindnow uses it too) cover every value flag across the agent parsers, including--root, repair authority/store/trust flags,start --out,status --out/--store/--attempt,receipt --test, verify-execute paths andbrief --max-seams.receipt --commandstays repeatable by design (it accumulates).agent verify --gap-idgets the sametrim().is_empty()guard as repair/packet.agent status --out: both sides lexically normalized (no filesystem access);../escapes stay refused. Note:./and trailing-slash spellings were already accepted on main (Path equality folds them); the newly accepted spellings are those containing..pairs.--max-seams,--cancel-after-ms,--at: interpolated std error dropped, leading phrase kept..ripr/traceability.tomlregister the new tests.Proof: focused
cargo test -p ripr --libfor cli::agent, cli::commands::agent, test_stub (198 passed);cargo xtask check-traceabilityandcargo xtask precommitexit 0; status smoke test mutation-checked (reverting the comparison fails it).Generated by Claude Code
<source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review">