Skip to content

fix(xtask): gate linked_target test import on unix - #5462

Merged
EffortlessSteven merged 1 commit into
mainfrom
fix/windows-xtask-clippy-import-3
Oct 4, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
fix/windows-xtask-clippy-import-3

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

What

Third instance of #5427: #5447/#5299 added a \linked_target\ import in \xtask/src/reports/dx_scoreboard/tests.rs\ whose only use sits inside the #[cfg(unix)]\ test \�_symlinked_target_is_never_cleared. On Windows \cargo clippy -p xtask --all-targets -- -D warnings\ fails with \unused import\ and \cargo xtask precommit\ cannot go green; the Linux gate stays green.

Fix

Same pattern as #5403/#5426: unconditional group keeps the cross-platform items; \linked_target\ moves to a #[cfg(unix)] use super::measure::...\ line.

Proof

  • Repro: precommit on a branch at main tip fails at xtask clippy with \unused import: linked_target\ (tests.rs:3).
  • Local clippy clean after fix (verified in the 5406 worktree on identical content; re-verified here before merge).
  • Full gate via CI.

Non-goals


Devin Review

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

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

Self-review (exact head): one test-only import move in xtask/src/reports/dx_scoreboard/tests.rs - linked_target to a #[cfg(unix)] line, same pattern as #5403/#5426. Sole use is the #[cfg(unix)] test a_symlinked_target_is_never_cleared, so no behavior change on any platform; rustfmt applied. Disposition: REVIEW_INCOMPLETE pending local clippy re-verify on this tree (proof currently in sibling worktree) + hosted gate (dispatched, in flight). Will REVIEW_READY + merge on green.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a948c108-87db-4ca7-a8e2-24d43ac13915
📥 Commits

Reviewing files that changed from the base of the PR and between 7230425 and aa03737.

📒 Files selected for processing (1)
  • xtask/src/reports/dx_scoreboard/tests.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


Summary by CodeRabbit

  • Tests
    • Kept the Unix-specific linked-target safety test scoped to Unix platforms; test behavior is unchanged.

Walkthrough

The test module now imports linked_target only on Unix platforms. The shared import list no longer includes it.

Changes

Unix-gated test import

Layer / File(s) Summary
Gate the linked_target import
xtask/src/reports/dx_scoreboard/tests.rs
The test imports linked_target under #[cfg(unix)] instead of including it in the shared import list.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to aa037

This change only scopes a test import to Unix, matching the platform-specific symlink test. No merge-blocking behavior or deployment risk is indicated.

Architecture Summary

Architecture risk: 🔵 Low · up to aa037

The change affects 1 system.

Changed systems: xtask

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — xtask (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in xtask/src/reports/dx_scoreboard/tests.rs: Added a Unix-gated import of linked_target; other platforms no longer import it through the shared import list.
  • observed — Modified behavior in xtask/src/reports/dx_scoreboard/tests.rs: Removed linked_target from the unconditional super::measure imports.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the issue, fix, proof, and non-goals. However, it omits many required template sections, including source boundary, source-of-truth links, candidate relationships, scope class… Complete the missing required template sections. For sections that do not apply, state n/a and briefly explain why. In particular, document the source boundary, scope and acceptance criterion, candidate relationships, relevant impact clas…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the Unix-only gating of the linked_target test import, which is the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the issue, fix, proof, and non-goals. However, it omits many required template sections, including source boundary, source-of-truth links, candidate relationships, scope classification, impact notes, claim boundary, rollback, traceability, and engineering gates.

Resolution

Complete the missing required template sections. For sections that do not apply, state n/a and briefly explain why. In particular, document the source boundary, scope and acceptance criterion, candidate relationships, relevant impact classifications, claim boundary, rollback method, traceability, and applicable engineering gates.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checked the imports with care,
Unix gets its link, other systems spare.
The shared list is tidy and small,
No test behavior changed at all.
The rabbit hops off, pleased with the repair.

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.

Decision

  • Needs one verification check before upstream.

Verification questions

  • Confirm self-review admits clippy re-verify was done in a sibling worktree (#5406), not the exact head tree of this PR; the only on-head proof cited is rustfmt and a CI gate still in flight.

Refuted

  • Splitting the use group would violate rustfmt import grouping/sorting; refuted because: Diff only moves one symbol to a cfg-gated line above the group; remaining group preserves original member order; rustfmt is format-only and not behavior-affecting.
  • Another measure:: symbol in the same import group is also only used under cfg(unix) and this PR should have relocated it too; refuted because: Textual scan of remaining super::measure::{PasteVerdict, Probe, builds_ripr_from_source, check_contradictions, classify_replay, contradiction_outcome, extract_commands, parse_test_result, probe_result, repo_exposure_contradictions, rss_sample} shows each is referenced outside cfg(unix) in this file; moving any would break the non-unix build. PR is complete for this diff.
  • A subtler cfg drift (e.g., cfg(unix) on import vs cfg(target_os="linux") on the test) could regress on macOS/BSD CI since Unix != Linux.; refuted because: The diff and existing test both use the same #[cfg(unix)] predicate; on macOS/BSD both branches are active together, so no asymmetry is introduced. This matches the established pattern referenced in the PR body.

Evidence gaps

  • ripr sensor failed (exit 2); cargo-test still scheduled-late. No local clippy/test receipt for this exact tree yet.
  • cargo-test sensor is scheduled-late; no build lease evidence yet for this change, and ripr failed (exit 2) without a captured reason.
  • 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_READY @ aa03737 (exact head, unchanged): required Ripr Rust Small Result pass, Rust gates pass 41m5s, zero threads, MERGEABLE. Local: clippy -p xtask --all-targets zero errors, dx_scoreboard 39/39. droid-review pending is advisory. Merging.

@EffortlessSteven
EffortlessSteven merged commit a9ea661 into main Oct 4, 2026
48 of 49 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/windows-xtask-clippy-import-3 branch October 4, 2026 13:03
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…5462 on main

Main landed a9ea661 (fix(xtask): gate linked_target test import on unix,
#5462) while this branch was in flight, so the merge carried both the
branch's and main's cfg(unix) import and Linux Rust gates failed with E0252.
The file is now byte-identical to main; the inherited Windows-host lint this
branch had repaired is owned by that landed fix. A second Windows-host-only
clippy failure exists on the rebased base (POST_KILL_GROUP_CONFIRM_GRACE
dead code from #5461's cfg(unix)-only call graph); it is inherited, outside
this lane's diff, and the required Linux gates are unaffected.
EffortlessSteven pushed a commit that referenced this pull request Oct 4, 2026
Resolves the import conflict with #5462 (unix-gated linked_target import).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CnL536XyT1SgATFgJk1e5f
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…5462 on main

Main landed a9ea661 (fix(xtask): gate linked_target test import on unix,
#5462) while this branch was in flight, so the merge carried both the
branch's and main's cfg(unix) import and Linux Rust gates failed with E0252.
The file is now byte-identical to main; the inherited Windows-host lint this
branch had repaired is owned by that landed fix. A second Windows-host-only
clippy failure exists on the rebased base (POST_KILL_GROUP_CONFIRM_GRACE
dead code from #5461's cfg(unix)-only call graph); it is inherited, outside
this lane's diff, and the required Linux gates are unaffected.
EffortlessSteven added a commit that referenced this pull request Oct 4, 2026
…empty states (#5474)

* fix(output): bind machine receipts to their subject and split honest empty states

Gate, badge, and gap-ledger machine outputs could each misreport the same
repository state they were derived from:

- gate-decision.json recorded no subject identity (#5263): no base/head SHA,
  no input hash, no analyzer version — a stale receipt was
  byte-indistinguishable from a fresh one. It now carries a subject block
  (additive, schema_version stays 0.1 per the #1510/#1442 precedent): the
  writing binary's build identity, per-input sha256 content hashes, and the
  pr-guidance document's own run_receipt copied verbatim so a pr-ledger's
  asserted --base/--head can be cross-checked. pr-ledger record now warns
  when its asserted identity disagrees with that recorded subject.

- repo-badge-json rendered '0 actionable'/pass while repo-exposure-json
  reported actionable gaps with complete repair routes on the same tree
  (#5261): the badge's canonical_actionable_gap basis consumed the compact
  classified walk, which zeroes the related-test and observed-value payload
  the evidence-record predicate reads and approximates activation for
  several seam kinds. The badge now derives from the same full classified
  inventory repo-exposure uses, joins the full-repo audit-path disclosure
  class it factually becomes (flags, help group, progress, cost line), and
  a cross-format agreement test pins the invariant.

- gap-ledger --check-output reported status 'blocked' for a valid Rust
  check output — the same status malformed input produces (#5264). A clean
  parse with zero derived records is now 'no_records', with a warning naming
  how many findings the Python/TypeScript/Perl-only projections skipped;
  blocked stays reserved for unreadable or malformed input.

Goldens: gate-decision.json fixtures re-blessed with the subject block
(analyzer_version pinned with a shape check, mirroring the generated_at pin
precedent); fixture changelogs carry the reasons. Spec slice:
machine-output-subject-honesty.v1.

Also repairs an inherited Windows-host clippy failure on the exact base
(cfg(unix)-gate the dx-scoreboard linked_target import; verified inherited
by stashing the lane diff).

Fixes #5261, fixes #5263, fixes #5264.

Proof: cargo fmt --check; cargo clippy -p ripr -p xtask --all-targets
--locked -- -D warnings; cargo test -p ripr --lib output::gate (107),
output::gap_decision_ledger (108), output::pr_evidence_ledger (15),
output::format (8), repo_badge agreement tests; cargo xtask goldens check;
cargo xtask dogfood (gate-adoption green; generated-pr-ci-review-workflow
fails identically on the stashed base — generated workflow byte-identical
base vs lane); policy gates: check-no-panic-family, check-process-policy,
check-allow-attributes, check-static-language, check-executable-files,
check-network-policy, check-lint-policy, markdown-links,
check-output-contracts.

* reconcile: drop the duplicated linked_target cfg gate, superseded by #5462 on main

Main landed a9ea661 (fix(xtask): gate linked_target test import on unix,
#5462) while this branch was in flight, so the merge carried both the
branch's and main's cfg(unix) import and Linux Rust gates failed with E0252.
The file is now byte-identical to main; the inherited Windows-host lint this
branch had repaired is owned by that landed fix. A second Windows-host-only
clippy failure exists on the rebased base (POST_KILL_GROUP_CONFIRM_GRACE
dead code from #5461's cfg(unix)-only call graph); it is inherited, outside
this lane's diff, and the required Linux gates are unaffected.

* test(progress): repo-badge-json now discloses audit-path cost it charges

The #5261 fix moved the seam-native repo badge onto the full classified
inventory, which makes it a full-repo audit-path surface. The cli_progress
negative control still pinned the old compact-walk expectation; it now
asserts the disclosure fires with the cache-backed warm-rerun clause, while
the diff-scoped json control keeps pinning absence outside the group.

* fix(first-pr): recover a check-output ledger whose route projected no records

The #5264 status split changed what first-pr's --check-output bridge sees
for a Rust PR: the ledger is now no_records (clean parse, zero derived
records) instead of blocked, so the blocked-ledger recovery that regenerates
repo-exposure evidence stopped firing and the generated CI foreign-cwd
replay lost its next command.

first-pr now recovers the same way when the ledger's status is no_records
AND its inputs.source_kind is check_output: the route projected nothing for
this PR's language, so the regeneration compound runs exactly as for a
blocked ledger, with the ledger's own route-coverage warning in the message.
no_records from any other source stays a genuine empty result.

Discriminating unit test: no_records_check_output_ledger_recovers_through_
regeneration_compound (red with the branch disabled: the selection fell
through to a missing review-cards artifact instead of the recovery).

* fix(output): review round 1 — full input coverage, honest projections, compared identities

Review round on the #5261/#5263/#5264 candidate:

- gate subject covers every CLI-supplied decision-changing input (baseline,
  labels files, calibration, receipts, policy ledgers), adds labels_sha256
  for --labels strings, and hashes the pr-guidance and gap-ledger inputs
  from the exact bytes their readers parsed, so the receipt cannot bind a
  decision to bytes it never evaluated (Devin, CodeRabbit). Causal
  artifacts stay outside the block by boundary: they are workspace-durable
  files that self-identify, not invocation inputs.
- pr-ledger record compares asserted revisions only when both sides are
  SHA-like: origin/main/HEAD (the generated CI spelling) stays silent
  instead of false-positive mismatching, and a degraded recorded value
  cannot prefix-agree an asserted SHA.
- a non-object entry in a check output's findings array is malformed input
  (blocked), not an unprojectable finding (no_records).
- the seam-native repo badge projects limited (run_status limited_seam_cap,
  cap named in limited_reason) when the classified inventory was
  seam-capped, instead of presenting a partial count as a full-scan clean
  badge; repo-badge-plus formats join the full-repo audit-path disclosure
  class because their measured path renders the same walk.
- OUTPUT_SCHEMA documents the read model, the producer_subject emission
  condition, and the plus-format disclosure.

Goldens re-blessed (subject input coverage) with round-2 reasons in both
fixture changelogs.

* fix(gate): hash the bytes each decision-affecting reader parsed

Review round 2: baseline, labels_json, both calibration files, and the
exception policy were parsed by their readers before the subject's fresh
hash read, so a mid-run file change could bind the receipt to bytes the
decision never consumed. Each reader now reads its file once and records
the sha256 of the exact parsed bytes into a ConsumedInputHashes struct the
subject consumes; only the warn-only inputs no reader parses (repo_exposure,
sarif_policy, agent_verify, agent_receipt) keep the fresh subject-build
read, and the output contract states that read model. The exception-policy
loader gains a text-based entry point so the gate can hash-then-parse one
read; the duplicate missing-file test moved behind the gate-level coverage
that already exercises it.
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.

1 participant