Repository navigation
fix(tests): repair main's three red Rust test shards (explain --format json hints, withheld group order) - #12014
EffortlessSteven wants to merge 1 commit into
Conversation
…withheld group order) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzVRdKSJ5BS2kgG3bNK
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm cLI recovery expectations are route-specific: unmatched explain accepts the documented
--format jsonspelling, while context recovery retains--json; both still require the same scoped listing. - Confirm the LSP change only reverses the pinned withheld static_unknown group order and adjusts the explanatory comment; no production ordering logic is changed.
- Confirm the LSP change alters only a test expectation and its explanatory comment; it does not alter production ordering logic.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The PR claims focused tests pass, but the packet records ripr failure and lacks a cargo-test receipt; the broader acceptance claim remains unverified in this review context.
- The available evidence does not prove the claim that these changes turned all Rust shards green, and the ripr sensor failed with exit code 2.
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head cad7409): REVIEW_INCOMPLETE
Inspected:
- Subject: PR #12014, head
cad740904c6cb9040164600e2dc3264a18b58192, basea69bf0214f7bd7e0537a1cdd07e95608e5a366e8(current main tip), 3 paths, one commit, not a draft. Governed by issue #11844. - Contribution was measured as the candidate's own delta:
git merge-base(head, main tip)is exactly the main tipa69bf0214, so this candidate is one commit ahead of main with nothing outstanding from an earlier base. The 3-path file list is far below the silent 300-path cap of the compare API and ofpulls/<n>/files, so nothing was truncated; I confirmed the paths by recursive git diff. - Both source edits sit inside
#[cfg(test)]code:crates/ripr/src/lsp/backend.rs(modulelist_actionable_items_tests) andcrates/ripr/tests/cli_smoke.rs; the third path is a changelog fragment. There is no production change in this PR.
What the candidate changes, and whether it matches its own stated acceptance:
crates/ripr/src/lsp/backend.rs- the expectation forwithheld_unknown_findingsinlist_actionable_items_names_gaps_the_actionable_profile_hideschanges from["probe:pricing:98:predicate", "probe:pricing:94:predicate"]to["probe:pricing:94:predicate", "probe:pricing:98:predicate"].crates/ripr/tests/cli_smoke.rs-check_worktree_drill_in_commands_reach_the_uncommitted_findingis split so the unmatched-explain recovery must name the--format jsonspelling while the selector-less explain/context recoveries must name the--jsonspelling;selector_location_misses_explain_syntax_and_preserve_retry_scopenow accepts either spelling of the scoped listing.- This matches the stated acceptance: the three tests that fail on main pass again.
Resolving the LSP canonical-group ordering question (the open item from the prior pass):
- The production sort owner is
crates/ripr/src/lsp/diagnostics.rs,canonical_group_members(lines 135-230). It buckets findings by canonical-gap key, by overlap signature and by site-missing label into aBTreeMap<usize, Vec<usize>>keyed by a union-find root index, and returnsgrouped.into_values(), that is ascending root index. A bucket's root is its lowest-indexed member, so the group order is the order of each group's lowest-indexed member insnapshot.findings, not a string "canonical-group key" order. crates/ripr/src/lsp/backend.rsconsumes that owner forwithheld_unknown_findings, filtering by primary visibility in the Actionable profile and then byfinding_is_withheld_unknown. In the fixture,probe:pricing:94:predicateis index 3 and stands in its own group (root 3);probe:pricing:98:predicateis a member of the canonical group rooted at index 4 (probe:pricing:96:predicate). Ascending root order therefore places:94before:98.- The old expectation was inverted against the production owner; the production sort is not defective and the test expectation was stale. The old inline comment ("the mixed canonical group sorts before the raw finding's own group") describes a string-keyed
raw:<id>bucket scheme that no longer exists: gap-less findings with no overlap signature are not bucketed at all in the current implementation. - Hosted execution confirms this independently. #12018's
Rust-only feature lane(job 124728408186) ran the Rust tests at head547296003, which is main-based and does not contain this fix. Its log showsleft: ["probe:pricing:94:predicate", "probe:pricing:98:predicate"]againstright: ["probe:pricing:98:predicate", "probe:pricing:94:predicate"]. The candidate's new expectation is the value the production actually emits.
The --format json / --json split is likewise confirmed against production owners, not only against the test: explain's unmatched-selector path uses explain_navigation_list_command -> explain_list_command (crates/ripr/src/app/explain.rs:138-145), which rewrites the trailing " --json" to " --format json", while context's unmatched-selector path uses navigation.list_command() (crates/ripr/src/app/context.rs:157), and crates/ripr/src/app/navigation.rs:461-463 is format!("{} --json", self.list_prefix) - the --json alias, not rewritten. The hosted log for the same #12018 lane shows the explain recovery printing ripr check --root ... --base HEAD --worktree --format json, the mismatch that makes the base test red.
Blocking:
- None attributable to this candidate. The three repaired assertions are stale expectations against unchanged production, the hosted base-side evidence above confirms the production behaviour the new expectations encode, and the red lane on this head is not this PR's doing.
Non-blocking:
- The relaxed selector assertion drops the only pin on the context spelling.
selector_location_misses_explain_syntax_and_preserve_retry_scopeloops overexplainandcontextand now acceptsexpected_listingor its--format jsontwin. The scope (--root/--diff) is still pinned, which is what the test is named for, but no test now asserts that the context unmatched recovery names--jsonspecifically: the drill-in test pins the explain spelling and the selector test accepts both. Branching the assertion oncommandwould keep the per-command discrimination at no extra cost. - The production asymmetry the candidate now pins is itself worth naming. The same command emits two spellings of the same retry invocation depending on whether the selector was unmatched or absent, and
explain_list_commandis applied on the explain path but not on the context path. The candidate encodes that difference as expected behaviour - faithful to the current tree, but #11844's direction ("explain hints name--format json") reads better as "every user-facing hint names--format json", in which case the context path is the unfinished half and this test will change again. - The group order is not a documented contract. The order the candidate pins is a function of each finding's position in
snapshot.findings, so a producer-side reordering of that vector changes the observable order without changing grouping semantics. A comment recording that the order is position-derived would stop the next reader from re-deriving the string-key theory the old comment carried. - Efficiency. I found nothing to flag: this candidate changes test expectations only - no production work, no allocation, no extra pass, no re-parse. Because it has no production change, it also lowers no runtime cost; the per-document clone of the canonical root noted in the sibling review for #11963 remains, out of scope here.
Hosted evidence at this exact head:
- The required status check
Ripr Rust Small Resultis present and red (run 41263263919, job 124722672346, failing at "Summarize routed result"), andRipr Rust Small on GitHub Hosted / Rust gates(job 124720833652) fails at step 16, "Repository policy preflight", reporting that theuse std::process::Commandallowlist entry forcrates/ripr/src/output/first_pr/run_chain.rsis orphaned: itsmax_count=1pattern is not found in any tracked file. - That red is base-attributable. Verified from source: at the main tip
a69bf0214,crates/ripr/src/output/first_pr/run_chain.rscontains nostd::process::Command(git search exits 1), whilepolicy/process_allowlist.d/11720-first-pr-run-chain.txt:2still declares that entry. This candidate touches neither file. The identical preflight failure is present on #12017 and #12018 at the same base. Repair carrier #11975. - Because the preflight fails first, the job's "Required Rust tests" step (step 30) was SKIPPED on this head. The three tests this candidate repairs have therefore never executed at this head. The hosted evidence that main is red on them comes from the main-based head
547296003described above, not from this candidate's own head. - This is therefore not
REVIEW_READY(required check red; the Rust lane that would exercise the repaired assertions was skipped before it could run) and notREPAIR_REQUIRED(no candidate-attributable defect):REVIEW_INCOMPLETE.
Not run:
- The Rust toolchain on this host is not on
PATH:rustc,cargoandrustupare all absent fromPATH. Nothing was built, tested, linted, orcargo xtask-run locally - notprecommit, notcheck-workflows, notcargo fmt --check- and the three repaired tests could not be executed here. Every Rust-level statement above comes from hosted job logs or from source read at the reviewed SHAcad740904. - The candidate's own head has no executed Rust test: the policy preflight fails before the test step, so the repaired assertions are unexecuted here. Their behaviour is inferred from the production source plus the main-based hosted run at
547296003, not observed on this head.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head cad740904c6cb9040164600e2dc3264a18b58192. Not an approval.
|
The fixes this duplicates landed in #11995 (squash 99b2e4d). Closing as superseded. Generated by Claude Code |
Governing issue or accepted claim: #11844 (explain hints now name
--format json); main red on Rust test shards 1, 2 and 4, observed on #11995 run 41257707273.Acceptance delta (one sentence): the three tests
check_worktree_drill_in_commands_reach_the_uncommitted_finding,selector_location_misses_explain_syntax_and_preserve_retry_scopeandlist_actionable_items_names_gaps_the_actionable_profile_hidespass on main again.Scope
Test expectations only; no production change.
cli_smoke.rs: the unmatched-explain recovery names the documented--format jsonspelling (fix(explain): suggest check --format json in selector hints (#11570 item 4) #11844), while thecontextrecovery still names--json. The drill-in test now carries the expected listing per recovery; the selector-recovery test accepts either spelling for the same scoped listing.lsp/backend.rs: the withheld static_unknown group order is:94then:98; the test pinned the reverse. Observed deterministically (same on the hosted shard and locally).Proof
Each test run alone on
origin/main+ this change: pass (cargo test -p ripr --test cli_smoke worktree_drill_in,... selector_location_misses,cargo test -p ripr --lib list_actionable_items: 13 passed). All three failed before.What this does not prove: other shards; hosted exact-head result.
Rollback
Revert this PR.
Generated by Claude Code