Skip to content

agent CLI: refuse repeated value flags, empty verify --gap-id, normalize status --out, drop std parse text (#10542 PR A) - #10649

Closed
EffortlessSteven wants to merge 4 commits into
mainfrom
claude/project-thread-6ofg7v
Closed

EffortlessSteven wants to merge 4 commits into
mainfrom
claude/project-thread-6ofg7v

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #10542
Acceptance delta (one sentence): ripr agent value flags refuse repeats instead of silently last-winning, agent verify --gap-id "" is refused, agent status --out accepts 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_if helpers in cli/agent.rs (message agent <cmd> takes <flag> once, the existing stub/brief shape; stub --kind now 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 and brief --max-seams. receipt --command stays repeatable by design (it accumulates).
  • agent verify --gap-id gets the same trim().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.
  • Spec RIPR-SPEC-0011 acceptance bullets and .ripr/traceability.toml register the new tests.

Proof: focused cargo test -p ripr --lib for cli::agent, cli::commands::agent, test_stub (198 passed); cargo xtask check-traceability and cargo xtask precommit exit 0; status smoke test mutation-checked (reverting the comparison fails it).


Generated by Claude Code


&lt;source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"&gt;&lt;img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"&gt;

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
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 194 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 470a665d-ffc5-43c5-bb46-c333c2f49f71
Commits

Reviewing files that changed from the base of the PR and between 901d9be and da41d3b.

Files selected for processing: 7
  • .ripr/traceability.toml
  • changelog.d/agent-flag-hygiene-10542.md
  • crates/ripr/src/app/test_stub.rs
  • crates/ripr/src/cli/agent.rs
  • crates/ripr/src/cli/commands/agent.rs
  • crates/ripr/tests/cli_smoke.rs
  • docs/specs/RIPR-SPEC-0011-llm-work-loop.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

gemini-code-assist[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment on lines +1316 to +1321
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(())
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +1314 to +1321
/// 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(())
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Devin Review


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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

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 ... Also consume the existing #10663 helper-relocation repair, rather than recreating the strict-Clippy dead-code failure from xtask's path include. This is an identified source/composition risk, not a claimed observed regression on current main. Retain this branch's unique duplicate-value/numeric behavior while reconciling overlapping #10615/#10653 ownership. Freeze and review the resulting exact composition; reuse unchanged positives and execute only the affected symlink/path and overlap discriminators. No competing writer or qualification request is started here.

Copy link
Copy Markdown
Member Author

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 --root repeat refusal, which #10615 deliberately kept last-win. Branch left as is; I'm withdrawing my claim on #10542.


Generated by Claude Code

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.

2 participants