Repository navigation
test(check): pin that a --diff run does not disclose an unanalyzed working tree - #4026
Conversation
…rking tree The RIPR-SPEC-0112 disclosure gate excludes `--diff` because that run analyzes the supplied patch, not committed history, but no test held the exclusion: the existing disclosure tests cover `--base HEAD`, the default base, a clean checkout and `--worktree`. The new cli_smoke test first shows the dirty fixture does trigger the disclosure on a `--base HEAD` run, then asserts neither the JSON field nor the human note appears for `--diff` on the same checkout. Reintroducing the diff case into the gate fails it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Refuted
- Hardcoded human note substring
uncommitted changes to tracked source were not analyzedmay drift if the source wording changes, silently turning this into a no-op.; refuted because: This is a contract test pinning spec wording (RIPR-SPEC-0112); drift is the regression the test is designed to catch, and any drift would be intentional and covered by PR review of the source change. Not a red/green defect.
Evidence gaps
- artifact-verifier exited 2 (not ok). For a tests-only diff with no production artifacts, this is informational and does not weaken the oracle; not blocking.
…condition The review bot noted that the human-note negative would pass silently if the note's wording changed. The precondition now checks the --base run prints that exact note, so a wording change fails the test instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
Main now matches cli_smoke cleanup Results (#4027). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
…_smoke #4027 moved every cli_smoke cleanup to ignore_remove_dir_all instead of let _ =; this test predates it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Hardcoded human note substring 'uncommitted changes to tracked source were not analyzed' may drift if the source wording changes, silently turning this into a no-op.
- crates/ripr/tests/cli_smoke.rs:12676 — Substring check
json.contains("unanalyzed_working_tree")would match the--base HEADJSON or any unrelated field that happens to contain that token, instead of asserting the absence of the disclosure field. Prefer parsing JSON (the binary already emits JSON) or asserting on"unanalyzed_working_tree": trueabsence specifically. The precondition uses the correct form; mirror it in the negative.
Verification questions
- Confirm hardcoded human-note substring
uncommitted changes to tracked source were not analyzedis a contract pin, but no test holds that exact wording on the --base positive path inside this test. - Confirm crates/ripr/tests/cli_smoke.rs:12700 — Preconditions only assert the human note appears, not that
--base HEADfollowed by--diffflips behavior. Consider asserting the JSON diff between the two runs (e.g., parse both--base HEADand--diffJSON and confirm the disclosure key state flips), so a regression where BOTH runs disclose equally is also caught.
Refuted
- artifact-verifier exited 2 weakens oracle for tests-only diff.; refuted because: No production artifacts in a tests-only diff; exit 2 is informational per reviewer summary and does not weaken test-oracle strength.
- Hardcoded human-note substring can silently become a no-op if source wording changes; refuted because: Seeded CodeRabbit review summary already refuted this as a contract test by design; PR scope explicitly excludes wording change and claim boundary forbids over-claiming.
Requested by Steven · project thread
Before: the RIPR-SPEC-0112 disclosure gate in
cli/commands/check.rs(committed_history_diff) leaves--diffruns out, because such a run analyzes the supplied patch rather than committed history. #3892 landed the default-base half of the disclosure, but no test held the--diffexclusion. The existing disclosure tests cover--base HEAD, the default base, a clean checkout and--worktree. If someone dropped the--diffcondition, a user who ranripr check --diff change.patchin a checkout with an uncommitted tracked edit would be told that edit "was not analyzed", which is wrong: the patch was the whole input.After: one cli_smoke test holds the exclusion. It first shows that the dirty fixture does trigger the disclosure on a
--base HEADrun. Then it asserts that a--diffrun on the same checkout emits neitherunanalyzed_working_treein JSON nor the human note.How: test only. No production change.
Summary
Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0112. Related: #3888, #3892.
Scope Classification
Non-goals: no change to when the disclosure fires, and no wording change.
Decisions (overrule on review)
--baserun first.Support-tier Impact
Policy Impact
Proof
Negative control: I changed the gate to ignore the
--diffcase, and the new test failed on the JSON assertion. I then reverted the change.The fixture has its own
git init, so the test does not depend on the checkout running it. #4025 fixes that trap in a neighbouring test.Claim Boundary
May claim: a
--diffrun's exclusion from the unanalyzed-working-tree disclosure is now held by a test. Must not claim: anything about--worktreeor default-base behavior, which keep their existing tests.Rollback
Revert the single commit.
Spec-Test-Code Traceability
crates/ripr/tests/cli_smoke.rs::check_with_a_diff_file_does_not_show_unanalyzed_working_tree_disclosurecrates/ripr/src/cli/commands/check.rs(committed_history_diff)Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo fmt --checkcargo xtask precommit🤖 Generated with Claude Code
https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
Generated by Claude Code