Skip to content

test(check): pin that a --diff run does not disclose an unanalyzed working tree - #4026

Merged
EffortlessSteven merged 5 commits into
mainfrom
claude/onboarding-diff-disclosure-negative
Sep 24, 2026
Merged

EffortlessSteven merged 5 commits into
mainfrom
claude/onboarding-diff-disclosure-negative

Conversation

@claude

@claude claude Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Requested by Steven · project thread

Before: the RIPR-SPEC-0112 disclosure gate in cli/commands/check.rs (committed_history_diff) leaves --diff runs 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 --diff exclusion. The existing disclosure tests cover --base HEAD, the default base, a clean checkout and --worktree. If someone dropped the --diff condition, a user who ran ripr check --diff change.patch in 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 HEAD run. Then it asserts that a --diff run on the same checkout emits neither unanalyzed_working_tree in JSON nor the human note.

How: test only. No production change.

Summary

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Spec: RIPR-SPEC-0112. Related: #3888, #3892.

Scope Classification

  • Test or proof hardening only

Non-goals: no change to when the disclosure fires, and no wording change.

Decisions (overrule on review)

  • Precondition before the negative. A negative test on a checkout that never triggers the disclosure would pass for the wrong reason, so the test proves the fixture is dirty enough to disclose on a --base run first.

Support-tier Impact

  • none

Policy Impact

  • none

Proof

cargo test -p ripr --test cli_smoke -- check_with_a_diff_file_does_not_show_unanalyzed_working_tree_disclosure   # 1 passed
cargo xtask precommit                                                                                             # pass

Negative control: I changed the gate to ignore the --diff case, 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 --diff run's exclusion from the unanalyzed-working-tree disclosure is now held by a test. Must not claim: anything about --worktree or default-base behavior, which keep their existing tests.

Rollback

Revert the single commit.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0112
  • Test: crates/ripr/tests/cli_smoke.rs::check_with_a_diff_file_does_not_show_unanalyzed_working_tree_disclosure
  • Code under test: crates/ripr/src/cli/commands/check.rs (committed_history_diff)

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • Public JSON/schema changes are documented. (None.)

Gates

  • cargo fmt --check
  • cargo xtask precommit

🤖 Generated with Claude Code

https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK


Generated by Claude Code

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

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a266f496-4c7f-4a01-a772-375287e47291

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

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

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

Refuted

  • 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.; 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.

claude and others added 4 commits September 24, 2026 08:23
…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
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 24, 2026 20:33
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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

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 HEAD JSON 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": true absence 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 analyzed is 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 HEAD followed by --diff flips behavior. Consider asserting the JSON diff between the two runs (e.g., parse both --base HEAD and --diff JSON 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.

@EffortlessSteven
EffortlessSteven merged commit f4d3d10 into main Sep 24, 2026
22 of 23 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/onboarding-diff-disclosure-negative branch September 24, 2026 21:06
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