Skip to content

test(check): run the valid-root control in its own repository - #4025

Merged
EffortlessSteven merged 2 commits into
mainfrom
claude/onboarding-root-control-hermetic
Sep 25, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
claude/onboarding-root-control-hermetic

Conversation

@claude

@claude claude Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steven · project thread

Summary

check_rejects_missing_and_file_roots_without_leaking_the_git_invocation ended with a valid-root control that ran bare ripr check --root <temp>. Because .cargo/config.toml places temporary directories under target/, that control could inspect the enclosing checkout and fail on the running branch's diff size instead of exercising explicit-root validation.

The valid control now:

  1. initializes the temporary workspace as its own Git repository through the existing fixture helper;
  2. configures a local fixture identity;
  3. commits the fixture;
  4. runs ripr check --root <temp> --base HEAD.

Its result is independent of the enclosing branch's diff. Missing-root and file-root discriminators are unchanged.

Swarm / Source Boundary

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

Source-of-truth Links

The one-file candidate diff remains conflict-free with current main by read-only merge-tree inspection.

Scope Classification

  • Test or proof hardening only

Production delta:

  • None.

Evidence/support delta:

  • The existing valid explicit-root control owns a temporary Git repository and compares HEAD to HEAD.
  • All five Git operations use the existing fixture_git_ok process owner, so no process-policy entry is added.

Single acceptance criterion:

  • The valid-root control passes regardless of the size of the branch running the test, while the missing-root and file-root negatives continue to prove early shared validation and no leaked Git argv.

Non-goals:

Decisions

Support-tier Impact

  • none

Policy Impact

  • none

No production, generated, dependency, process-spawn, schema, or public-output change.

Proof

Exact-head local evidence

Candidate: 6404c810fe25154adb0ddcdc76c8d45db02ad4c6

cargo test -p ripr --test cli_smoke check_rejects_missing_and_file_roots_without_leaking_the_git_invocation  # 1 passed
cargo fmt --check                                                                                       # pass
git diff --check                                                                                        # pass
cargo xtask check-process-policy                                                                        # pass
cargo xtask check-fast                                                                                  # pass
cargo xtask precommit                                                                                   # pass

Retained precommit-v2.json binds head 6404c810..., merge base 7547b700..., one committed changed path, and successful ripr/xtask Clippy. The check-fast selector independently reports one changed file.

Discriminating control

An isolated large-diff clone used the candidate head as the enclosing default base: 244 changed paths, 62 Rust files, and approximately 8,795 changed Rust lines.

  • Hardened valid-root control: passed.
  • Reversibly removed the temporary repository setup and --base HEAD: failed as intended with diff_scope_oversized at 8,793 changed Rust lines.
  • Control clone restored clean.

The original small-branch failure is therefore branch-size dependent; the hardened control is not. The reported 4,580-line #3982 reproduction remains author evidence; the larger 8,795-line control was independently executed for this head.

Claim Boundary

May claim:

  • This valid explicit-root control no longer depends on the size of the branch running it.

Must not claim:

Rollback

Revert PR #4025's published test commit ff64e0daf... or its net one-file patch. No persisted state, schema, configuration, or generated artifact is involved.

Spec-Test-Code Traceability

  • Test: crates/ripr/tests/cli_smoke.rs::check_rejects_missing_and_file_roots_without_leaking_the_git_invocation
  • Existing process owner: crates/ripr/tests/common/fixture_git.rs::fixture_git_ok
  • Temp-root cause: .cargo/config.toml (TEMP, TMP, TMPDIR under target/)
  • Production owner unchanged: crates/ripr/src/cli/commands/check.rs and cli::commands_context::ensure_command_root

Static Language Check

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

CI Economics

n/a

Engineering Check

  • Test-only change.
  • No new process-spawn site.
  • Existing shared Git helper retained.
  • Cleanup remains best-effort through the existing test harness.

_Generated with Claude Code

https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK

check_rejects_missing_and_file_roots_without_leaking_the_git_invocation
(#3882) ends with a control that runs a bare `ripr check --root <tmp>`.
.cargo/config.toml sets TMPDIR to target/, so that temp dir sits inside
the checkout running the tests, and the bare check diffs the enclosing
branch against its default base. On any branch with more than 2000
changed Rust lines the control fails with diff_scope_oversized, which
says nothing about --root validation. Seen on the #3982 stack (4580 lines
across 14 files).

The control now gives the workspace its own repository and an explicit
`--base HEAD`, so it measures only that a valid root is analyzed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
@claude
claude Bot requested a review from EffortlessSteven September 24, 2026 07:52
@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: 77765f46-5643-4f32-931e-05a818da0d44

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.

@EffortlessSteven

Copy link
Copy Markdown
Member

Claimed as canonical test-proof repair

I am taking this stale PR forward as the canonical owner of the hermetic valid-root control. Finding-specific comparison confirms #3987 carries the same patch only as an inherited cherry-pick; #4025 is the focused one-file PR and should land first.

Plan:

  1. Reconcile the one-test candidate with current main and rerun the exact valid-root control, formatting, diff checks, check-fast, and precommit as needed.
  2. Perform a substantive exact-head review of the fixture's Git identity, --base HEAD oracle, process-policy use, and unchanged missing/file-root discriminators.
  3. Merge through protected main if current-head proof is clean, then let fix(init): generated CI prints only runnable next steps #3987's final direct-main diff naturally exclude the already-landed patch; no shared-history rewrite is authorized or needed now.

This is test-proof hardening only. It does not close #3880 or claim that all temp-directory tests are hermetic.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Current published-head review — REVIEW_INCOMPLETE

No actionable source, test-oracle, process-policy, or scope findings remain in the candidate review.

reviewed_head_sha: 6404c810fe25154adb0ddcdc76c8d45db02ad4c6
integration_parent: 7547b700c432b03f83f1a24a5d6f316cd1da5414
current_main_observed: ee067207d0c63e494fbb79f06122c1faa800fc3e
claim_boundary: Test-proof hardening only; this control must be independent of the enclosing branch's diff, without changing production root validation or closing #3880.
changed_surfaces_and_semantic_owners_inspected: cli_smoke valid/missing/file root controls; existing fixture_git_ok process owner; current production ensure_command_root behavior; .cargo temp-root configuration; current-main combined relation.
blocking_findings: none
non_blocking_suggestions: Global commit signing or autocrlf configuration is not neutralized, consistent with surrounding fixtures and outside this focused repair; a real old-rustc process-shim is unrelated here.
refuted_or_stale_findings: enclosing-branch dependence — repaired; blanket-pass positive control — refuted; process-policy expansion — refuted; current-main conflict — refuted by clean merge-tree; #3987 ownership — #4025 is canonical.
proof_and_ci_observed: exact-head focused cli_smoke passed; large-diff control passed hardened and failed as intended after reversible removal with diff_scope_oversized at 8,793 Rust lines; fmt/diff, process policy, check-fast, and precommit pass; retained precommit binds head 6404c810 and one changed path.
proof_or_review_missing: exact-head hosted Rust result and hosted review are still in progress; no review threads exist.
affected_currentness_dimensions: test stimulus, test oracle, process owner, integration basis, candidate identity, hosted CI.
residual_assumptions_and_non_claims: no production change; no repository-wide temp-test audit; no closure of #3880.
disposition: REVIEW_INCOMPLETE — waiting exact-head hosted proof and final read-back.

The published head is mergeable with no failures. Merge remains blocked only while the routed Rust and review jobs are in flight.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 25, 2026 03:49
@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.

@EffortlessSteven

Copy link
Copy Markdown
Member

Review — adopting this stale draft (idle ~12h, gate green)

Surface. One test file (cli_smoke.rs check-mode area), test-only.

What it pins. The valid-root control runs in its own repository: ripr check against a root must exercise the control inside a fixture repo it creates, so the control cannot accidentally pass by reading the caller's checkout state.

Stimulus/oracle. The test builds an isolated fixture repo (own git init, own commit) and asserts the control outcome there; the isolation is the oracle — a control that leaked caller state would fail under a dirty enclosing checkout, which CI also exercises.

Validation. Ripr Rust Small Result: SUCCESS on the current head; base is main and MERGEABLE. Claimed after 12h+ of bot inactivity per the queue-zero sweep rule.

Disposition: REVIEW_READY.

@EffortlessSteven
EffortlessSteven merged commit 88ef9b2 into main Sep 25, 2026
25 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/onboarding-root-control-hermetic branch September 25, 2026 03:54

@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 one verification check before upstream.

Verification questions

  • Confirm artifact-verifier failed (exit 2) on a tests-only diff; low trust impact since no production/artifact surface changes, but gate should record the witness target explanation.

Refuted

  • Hardening expands the process-spawn policy surface.; refuted because: All five git calls go through the existing run_git helper backed by fixture_git_ok; no new process owner is introduced.
  • Tautological positive control that always passes on its own repo regardless of --root validation; refuted because: The control still invokes production ripr check --root <temp> --base HEAD; a broken --root path would fail. Missing-root and file-root negatives in the same test function continue to discriminate early validation and no argv leakage. Reversal test (remove setup + --base HEAD) fails with diff_scope_oversized at 8,793 lines per PR body proof.

Evidence gaps

  • Late-evidence cargo-test receipt for cli_smoke has not yet landed at packet time; treating as scheduled-late rather than missing is consistent with always-on base packet policy.
  • artifact-verifier exited 2; tests-only diff class with no produced artifacts suggests the verifier target is empty or witness missing.
  • artifact-verifier failed with exit code 2 — does this affect trust in a tests-only diff?
  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Exact-head review at 6404c810fe25154adb0ddcdc76c8d45db02ad4c6 (PR state at review time: MERGED, squash 88ef9b2afb169c6083f2e4da4582bd0924fb3392; required check Ripr Rust Small Result = success at this head). This is a post-merge substantive verification of the isolation claim and the surviving discrimination.

Claim verification (checked against head source, not the body)

  1. Test isolation — verified. In crates/ripr/tests/cli_smoke.rs (head, check_rejects_missing_and_file_roots_without_leaking_the_git_invocation, changed block at ~6491-6506), the valid-root control now initializes the temporary workspace as its own repository (run_git(&workspace, ["init"])), configures a local identity, commits the fixture, and runs ripr check --root <tmp> --base HEAD. Because --root is explicit, --base HEAD resolves against the temp repository's own HEAD (the initial commit), so the control's result is independent of the enclosing branch's diff — the claimed isolation holds.

  2. Premise — verified. .cargo/config.toml at this head sets TEMP/TMP/TMPDIR to relative target, so temp workspaces are created inside the enclosing checkout; the previous bare control could indeed diff the enclosing branch against its default base and fail on branch size rather than exercising explicit-root validation.

  3. Process ownership — verified. run_git is the import alias use common::fixture_git::fixture_git_ok as run_git (cli_smoke.rs:18), so all five git operations route through the existing hardened helper (deadline + retry, #3742 Slice 1); no new process-spawn site, matching the PR's check-process-policy claim. Minor wording note (nit, no repair): the body's "through the existing fixture helper" could be misread as init_git_fixture_repo; what landed is five explicit fixture_git_ok calls, which is what the body's process-owner claim actually says.

  4. Discrimination after isolation — verified. The missing-root and file-root negatives are unchanged (assert is not a directory, the offending path named, no core.quotePath / failed to run git leak) and both pass --base HEAD. The valid control still fails if valid explicit roots were rejected, so the "not everything is rejected" discriminator survives. Residual (non-blocking, consistent with the PR's own claim boundary): with --base HEAD the basis is empty, so success proves early shared validation plus the Git-backed loader accept the root — it does not assert nonempty analysis of the root's files. The PR's acceptance criterion is exactly this narrower claim, so no repair required.

  5. Landed identity — verified. Current main carries the isolated control (cli_smoke.rs:6498 test, run_git init at ~6540); no commit after the merge reverted or weakened it; later cli_smoke.rs merges (#4026, #3956) coexist with it.

Findings

No blocking findings. One non-blocking observation recorded above (empty-basis success semantics), already disclosed by the PR's claim boundary.

Merge readiness

Nothing remains — the PR is merged (squash 88ef9b2a, titled with this PR, landing exactly the reviewed one-file change into main). The duplicate-patch risk from inherited cherry-picks is closed: current main contains one correct copy of the control.

Observed: head source at 6404c810 (cli_smoke.rs test + import alias, common/fixture_git.rs, .cargo/config.toml); check runs at head (required Ripr Rust Small Result success); merge commit 88ef9b2a and current origin/main content of the test.
Reported: exact-head local run of the target test (1 passed), fmt/process-policy/check-fast/precommit pass; the isolated large-diff control experiment (244 paths / 8,795 lines passed; reverted setup failed with diff_scope_oversized); #3987 as an inherited cherry-pick carrier.
Not verified: local test executions and the large-diff control experiment were not rerun in this review.

Disposition: REVIEW_READY

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