Skip to content

test(xtask): pin README and QUICKSTART to the canonical first run (#8158 item 3) - #8332

Merged
EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-y2z1nx
Oct 17, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-y2z1nx

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Before / After

Before: #8164 made HELP, README and QUICKSTART lead with ripr check, and its issue ticks "automated parity check", but the only test (help_overview_has_one_canonical_first_run) reads the --help text. README and docs/QUICKSTART.md could drift back to ripr doctor/ripr pilot or a hardcoded --base with every gate green.

After: xtask unit tests read the first fenced block after ## The first useful run (README) and ## CLI First Hour (QUICKSTART) and require the first ripr command to be exactly ripr check.

What

Item 3 acceptance verification on current main (796c28d): HELP, README and QUICKSTART all lead with ripr check; doctor is framed as setup diagnosis; pilot is framed as whole-repo exploration; clean-checkout guidance (edit a tracked file, git add -N PATH) appears in all three. The one missing piece was the README/QUICKSTART half of the parity test, added here.

Tests are in xtask/src/policy/product_copy.rs:

  • readme_and_quickstart_lead_with_the_canonical_first_run (positive, real files).
  • first_run_command_rejects_a_drifted_lead_command (negative control: a block that starts with ripr doctor, a hardcoded --base, and a missing heading all fail).

Proof

  • cargo +stable test -p xtask product_copy: 10 passed.
  • cargo +stable fmt --check, check-traceability, check-static-language, check-file-policy, check-no-panic-family: pass.
  • Not run: full cargo xtask precommit. The pinned 1.95 toolchain could not install in this offline session, and stable 1.97 clippy flags 5 existing lints in crates/ripr that this PR does not touch. Hosted CI is the merge proof.

Non-goals / rollback

No product behavior or doc text changes; test-only. Revert the commit to remove.


Generated by Claude Code

)

help.rs pinned only the --help side of the one-first-run contract; README and
docs/QUICKSTART.md could drift back to doctor/pilot or a hardcoded --base
unnoticed. The new product_copy test reads each file's first-run block and
requires 'ripr check', with a negative control for a drifted lead command.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mi78XXkwyN6dJUkM2c6KyW
@EffortlessSteven EffortlessSteven self-assigned this Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 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 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 61 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
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 213714ad-c566-4a44-9388-23d98900c5e4
📥 Commits

Reviewing files that changed from the base of the PR and between e2cb5a9 and b6f9223.

📒 Files selected for processing: 18
  • crates/ripr/tests/cli_smoke.rs
  • fixtures/one_hop_field_projection/expected/CHANGELOG.md
  • fixtures/one_hop_field_projection/expected/human.txt
  • fixtures/one_hop_field_projection_discarded/expected/CHANGELOG.md
  • fixtures/one_hop_field_projection_discarded/expected/human.txt
  • fixtures/one_hop_field_projection_sibling/expected/CHANGELOG.md
  • fixtures/one_hop_field_projection_sibling/expected/human.txt
  • fixtures/one_hop_field_projection_wrong_sink/expected/CHANGELOG.md
  • fixtures/one_hop_field_projection_wrong_sink/expected/human.txt
  • fixtures/rust_map_insert_count_empty/expected/CHANGELOG.md
  • fixtures/rust_map_insert_count_empty/expected/human.txt
  • fixtures/rust_map_overwrite_count/expected/CHANGELOG.md
  • fixtures/rust_map_overwrite_count/expected/human.txt
  • fixtures/seeded_push_after_early_return/expected/CHANGELOG.md
  • fixtures/seeded_push_after_early_return/expected/human.txt
  • fixtures/typescript_mock_payload_iife_impl/expected/CHANGELOG.md
  • fixtures/typescript_mock_payload_iife_impl/expected/human.txt
  • xtask/src/policy/product_copy.rs
  • 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

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

1 similar comment
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Copy Markdown
Member Author

Independent exact-head review (fresh reviewer, not the author), head 6cc2347887e7bd0abf88c6a1e3eb6341d1c7ea79. Disposition: COMMENT, no blocking findings.

  • cargo +stable test -p xtask product_copy: 10 passed, including both new tests.
  • Three mutations were each reverted afterwards. All three made the positive test fail with a message naming the file and the command it found:
    • README led with ripr doctor before ripr check.
    • README's heading was renamed.
    • QUICKSTART used ripr check --base origin/main.
  • The negative-control test discriminates on the helper: a doctor-first block and a --base block both fail to read as ripr check.
  • Nits, left as is: the helper takes the first fence whatever its language tag, and the control does not cover the "no fenced block" error path. A heading rename needs a test edit, which is an intentional loud failure.

Local policy checks run by the author: fmt --check, check-traceability, check-static-language, check-file-policy and check-no-panic-family pass. Full precommit was not run (pinned 1.95 toolchain unavailable offline; stable 1.97 clippy flags existing lints in crates/ripr outside this diff). Hosted CI is the merge proof, so I'm adding merge-ready.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 03:30
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@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

  • Negative-control test does not exercise the 'no fenced block after heading' branch even though first_run_command defines that error; a future regression in helper internals could ship undetected.
  • Helper takes the first fenced block whatever its language tag (rust would still be scanned). For the README/QUICKSTART use this is benign, but a stricter spec is to require bash or skip the fence entirely.

Verification questions

  • Confirm first_run_command picks first fence after the heading regardless of language tag; rust ``` fence would also match.
  • Confirm author's heading-rename mutation passed the test by accident: first_run_command only checks the 'first ripr … line' after the heading, so renaming the heading routes the test to a later block that still starts with ripr check. Existing opaque error makes this hard to notice.
  • Confirm negative control lacks a 'no fenced block after heading' assertion; helper returns Err on that path but the test never exercises it, so a future regression would go uncaught.

Refuted

  • block.split("```").next().unwrap_or_default() could panic on an unterminated fenced block.; refuted because: split returns at least the whole string when no delimiter is present, so next() is always Some(&str); no panic path exists.
  • Sister tests in xtask or crates/* already pin the same canonical-first-run invariant, so this PR is redundant or risks double-asserting; refuted because: ast-grep receipts scanned the product_copy mod tests block; the only prior canonical-first-run test was help_overview_has_one_canonical_first_run. New tests are the README/QUICKSTART half and no sibling helper duplicates the check.
  • The helper should be extracted to a shared xtask test utility to avoid duplication risk.; refuted because: Only one production caller plus one negative control in the same file; existing module-private helpers (e.g., inline in product_copy_baseline_is_clean) follow the same in-file pattern. No duplication, no scope creep signal.

Parked follow-ups

  • Heading rename is not a soft error: first_run_command returns Err("missing heading ...") and the positive test propagates it via Result<(), String>. PR acknowledges this as intentional loud failure.
  • Smallest complete fix boundary: positive test covers both README and QUICKSTART in one loop; negative control covers drift (ripr doctor first), hardcoded --base, and missing heading. Out of scope items (no-fenced-block, multi-fence lang tag) are correctly left as author-acknowledged nits.

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

Confirmed findings

  • Author did not run full cargo xtask precommit; pinned 1.95 toolchain unavailable offline. This is a trust gap (5 clippy lints exist in crates/ripr outside the diff) but not a test-oracle blocker since the new tests are test-only and pass under stable 1.97.
  • xtask/src/policy/product_copy.rs:315 — Negative control covers no-fence case via the literal at line 318-320, but does not assert the specific Err message; a future helper refactor that returns Ok('') on missing fence would still pass this test.

Verification questions

  • Confirm heading rename would not be caught: helper only validates the command after the heading, so renaming '## The first useful run' routes the test to a later block that may still start with ripr check.
  • Confirm helper picks first fenced block after heading regardless of language tag (e.g. rust would match); benign for current README/QUICKSTART but looser than spec.
  • Confirm test-only diff; product_copy.rs adds a helper + positive test + negative control. The helper takes the first fence whatever its language tag, which is acceptable for README/QUICKSTART but undocumented. No product behavior or doc text changed; CI is the merge proof.
  • Confirm heading-rename mutation would route helper past intended block to a later ripr check; control does not cover this path and error message names only file/command, not the heading context that rerouted it.
  • Confirm helper takes the first fenced block regardless of language tag and lacks a no-fenced-block test case exercising the Err(no fenced block ...) path; pre-existing github-actions review summary flags both. Drift to rust or blank heading+text would silently pass.
  • Confirm first_run_command grabs the first fence after the heading regardless of language tag, sorust or ```text fenced blocks also count as the first-run block.

Refuted

  • Helper routes incorrectly on heading rename so the positive test is a no-op for that regression; refuted because: Confirmed by reading split_once semantics: substring match persists; but the same test is intended to pin the lead command, not the heading string, and the existing help-side test plus negative control together bound the failure surface; refute as scoped false-premise, not blocker.
  • Ripr sensor failure invalidates the PR review because build/test/clippy are all skipped and host cargo is offline.; refuted because: Diff is test-only under xtask/src/policy/product_copy.rs; ripr exit was unrelated to the test surface. Author ran cargo +stable test -p xtask product_copy with 10 passed and local fmt/policy checks green; hosted CI is the merge proof.

Evidence gaps

  • Author ran cargo +stable test -p xtask product_copy (10 passed) on head 6cc2347; ripr sensor failed exit 2 but that sensor is independent of these unit tests; hosted CI is the merge proof per PR body.
  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

review-pr (published-head review)

reviewed_head_sha: 5221736607235a1eb05529b018f32206fa137851
integration_basis: origin/main
claim_boundary: test(xtask): pin README and QUICKSTART to the canonical first run (#8158 item 3)
changed_surfaces_and_semantic_owners_inspected:
  tools/xtask/src/policy/product_copy.rs
blocking_findings: none
non_blocking_suggestions: none
refuted_or_stale_findings: none
proof_and_ci_observed:
  Local: cargo test -p xtask product_copy (10 passed); check-policy clean.
  Hosted CI: Rust-only feature lane, Linux x64 wheel, cargo-deny, pip/uv journeys, dependency-review, ub-review, windows-advisory-subset all passed cleanly (0 failures).
  Review threads: 0 unresolved.
proof_or_review_missing: none
affected_currentness_dimensions: exact-head CI/receipts current
residual_assumptions_and_non_claims: test-only policy check; pins README and QUICKSTART first command block to the canonical first-run invocation
disposition: REVIEW_READY

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 04:30
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 04:30
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

…e verdict (#8275)

Main is red on cli_smoke check_python_finding_with_repair_card_points_at_the_card
after #8275 dropped the preview_limited token from the human State line. Same
one-line alignment as #8336; no-ops once either lands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mi78XXkwyN6dJUkM2c6KyW
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 04:55
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 04:55

Copy link
Copy Markdown
Member Author

The earlier required-gate failure was not this PR's: cli_smoke check_python_finding_with_repair_card_points_at_the_card fails on main too (push run for 251ac3b is red) because #8275 dropped the preview_limited token from the human State line while the test still asserts it. This PR is xtask-only.

Fix ported here as 0517a51: the same one-line oracle alignment #8336 carries (State: preview language, advisory only), plus a merge of current main. It no-ops once either lands. Focused run: both check_python_finding* tests pass. Re-admitted via Draft→Ready for the new head.


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@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

  • xtask/src/policy/product_copy.rs:273 — first_run_command picks the first fence regardless of language tag (rust, text, etc.). Document the contract or require a ```bash fence so a future README/QUICKSTART restructure cannot silently bypass the parity check.

Verification questions

  • Confirm first_run_command splits on '' without inspecting the fence language tag, so a stray rust or text block before the intended bash block would be selected as 'first'.
  • Confirm first_run_command only checks the 'first ripr … line' after the heading; renaming the heading routes the test to a later block that still starts with ripr check, masking a heading-rename regression. Existing opaque Err makes it hard to notice.
  • Confirm negative control covers three drift modes (doctor-first, hardcoded --base, missing heading) but omits the 'heading present, no fence' Err path. That error branch in first_run_command is unused by the positive test and unexercised by the negative control; future helper refactor that returns Ok('') on missing fence would silently pass.
  • Confirm no-fence Err path in first_run_command is defined but never asserted by the negative control; future helper refactor returning Ok("") on missing fence would still pass.
  • Confirm author did not run full cargo xtask precommit; pinned 1.95 toolchain unavailable offline. Test-only diff passes focused tests under stable 1.97; hosted CI is the merge proof per author and prior reviewer.

Refuted

  • first_run_command duplicates an existing markdown/fence scanner in product_copy or xtask, creating a second source of truth for fence parsing.; refuted because: product_copy already uses raw line scanning for traceability tests; there is no existing fence parser to duplicate. Helper is a single-purpose, non-pub, test-local function with one owner. Adding it to a shared util would be premature for two call sites.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

Response to the github-actions review on 0517a51:

  • Fence language: stays as is. The helper deliberately takes the first fenced block under the pinned heading, so a stray text block before the command would be a real structure change that the test should surface, and it does fail then (no `ripr check` as the first command). Requiring bash would only add a second, less direct failure message.
  • Heading rename: first_run_command returns missing heading as an Err, and the positive test propagates it, so a rename fails loudly rather than routing to a later block.
  • No-fence path: already covered. first_run_command_rejects_a_drifted_lead_command includes a heading followed by prose with no fence and asserts it is an Err.

Not pushing a change, so the in-flight required Rust gate on this head stays valid.


Generated by Claude Code

@EffortlessSteven

Copy link
Copy Markdown
Member Author

CI Failure Diagnosis on Rust Gates (39004370283 / 117313748774)

The run failed in step Golden output contracts:

xtask: goldens check failed; semantic drift detail in target/ripr/reports/golden-drift.md
drift: fixture `one_hop_field_projection` [human.txt]: formatting_only
drift: fixture `one_hop_field_projection_discarded` [human.txt]: formatting_only
drift: fixture `one_hop_field_projection_sibling` [human.txt]: formatting_only
drift: fixture `one_hop_field_projection_wrong_sink` [human.txt]: formatting_only
drift: fixture `rust_map_insert_count_empty` [human.txt]: formatting_only
drift: fixture `rust_map_overwrite_count` [human.txt]: formatting_only
drift: fixture `seeded_push_after_early_return` [human.txt]: formatting_only
drift: fixture `typescript_mock_payload_iife_impl` [human.txt]: formatting_only

Root Cause

This is an inherited baseline drift from PR #8275 (1187b906b, ux(output): plain-language default verdict (#8165)). When #8275 simplified the verdict format in human.txt, these 8 fixture outputs were not re-blessed on main.

Resolution

This is wholly independent of PR #8332's changes and is tracked for blessing in PR #8351 (test(fixtures): bless 8 goldens missed by plain-language verdict (#8165)). Once #8351 lands on main, rebasing onto main will resolve the golden check drift.

…rdict (#8165)

Ported verbatim from #8351 so this PR's required goldens check is not blocked
by main's drift; no-ops once #8351 lands. Wording-only, check.json and
human-full unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mi78XXkwyN6dJUkM2c6KyW
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 05:46
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 05:47

Copy link
Copy Markdown
Member Author

Second required-gate failure on 0517a51 is also main's, not this PR's: Rust tests now pass, but goldens check fails on 8 fixture human.txt files (one_hop_field_projection*, rust_map_*, seeded_push_after_early_return, typescript_mock_payload_iife_impl) that #8275 re-rendered without re-blessing. The fix exists as draft #8351.

Ported its 8 wording-only re-blesses here as b6f9223 (merged current main too). Locally the drift report shows none of those fixtures; the offline sandbox cannot fetch anyhow for an unrelated fixture, so hosted CI is the full proof. This no-ops once #8351 lands. Re-admitted via Draft→Ready for the new head.


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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

Confirmed findings

  • PR no-ops against #8351 once that lands; benign duplication of 8 fixture re-blessings. Author acknowledged and re-admitted as Draft->Ready. No blocker.

Verification questions

  • Confirm negative control covers doctor-first/hardcoded --base/missing heading/no-fence but does not assert specific Err messages; future helper refactor returning Ok('') on missing fence would still pass.
  • Confirm helper splits on '```' regardless of language tag and the negative control does not cover 'no fenced block' Err assertion.
  • Confirm first_run_command picks the first fenced block regardless of language tag (rust, text, etc.) — undocumented contract, slightly broader than the README/QUICKSTART use requires.
  • Confirm no-fence path is exercised in negative control; future Ok('') refactor would be caught by an explicit Err assertion, not just by structural drift. Author's third sub-case covers it.
  • Confirm first_run_command splits on without inspecting the fence language tag, so a straytext or rust block ahead of the intended bash block would be selected as 'first' and could mask a regression if its first line starts with ripr.
  • Confirm first_run_command splits on '' without inspecting fence language tag, so text/rust/console fences match equally.

Refuted

  • A hardcoded ripr check --base origin/main could pass as the canonical ripr check.; refuted because: Negative control asserts that first_run_command returns something that == "ripr check" is false for ripr check --base origin/main; equality check uses the full trimmed line.
  • Helper accepts any fence language tag (rust/text/bash), so a stray block could defeat parity; refuted because: Helper takes the first fence after the heading. README and QUICKSTART both lead with ```bash containing ripr check on line 1; no current stray block to bypass. Bypass surface is documented and benign for current docs; would surface as the literal first-ripr-line no longer being `ripr check`.
  • Helper duplicates the help_overview_has_one_canonical_first_run assertion surface and will drift independently of HELP parity.; refuted because: Helper is scoped to markdown (heading + first fence + first ripr ... line), while the help test parses argparse output. Different artefacts, no shared state; parallel coverage of the same invariant via two surfaces is the intended design (#8164 item 3).
  • no-fence Err branch is unexercised by negative control; refuted because: Negative control at lines 326-328 explicitly feeds '## CLI First Hour\n\nripr check\n' (heading present, no fence) and asserts is_err(); this exercises the no-fenced-block Err path.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven
EffortlessSteven merged commit 0ddec02 into main Oct 17, 2026
30 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-y2z1nx branch October 17, 2026 06:37
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