Skip to content

fix(gate): pass changed_line_anchored in the repair-route order test - #4018

Closed
EffortlessSteven wants to merge 5 commits into
mainfrom
fix/push-repair-route-arity
Closed

EffortlessSteven wants to merge 5 commits into
mainfrom
fix/push-repair-route-arity

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Closes the inherited main breakage found while landing #3963.

Claim: current main (3d06245) does not compile lib tests.

Exact basis: #3968 (squash 64f3b92, merged 2026-09-24T02:51Z) added the changed_line_anchored: bool parameter to push_repair_route and updated the production call site at presentation.rs:478, but not the two test calls at :630 and :642 that #3936 (squash 55ee3ca) added. Both PRs were green on their own stale base; the combined tree fails cargo check --tests with E0061 (this function takes 3 arguments but 2 arguments were supplied). First observed as the Ripr Rust Small on GitHub Hosted / Rust gates failure on #3963's merge ref b20f039, whose tree is byte-identical to the PR branch for this file — the failure is main's, not #3963's.

Fix: pass true at both test call sites. The fixture route models the changed seam's own repair route (changed_owner/changed_behavior set, the #3906 flow), so the changed-line anchor flag is true; the assertions (Start repair leads Verify; null when absent) are label-independent.

Proof: the failing compile is reproduced from main alone (no PR content involved); this branch changes only those two lines. Hosted Ripr Rust Small Result is the merge gate.

Non-claims: no behavior change; no change to #3968's anchoring semantics.

claude and others added 5 commits September 23, 2026 23:09
…an pass

`ripr pilot` ranks Rust repo seams only. On a TypeScript, JavaScript,
Python or Perl repository with no Rust seams it printed "complete / Top
recommendation: none" and closed with the Rust repo-exposure snapshot
pair, which can only report that no seams moved. It never named the
language, so the empty ranking read as a clean result pilot never
computed.

Pilot now builds one `PilotLanguageRoutes` model from the existing
preview-language discovery (`analysis::workspace_preview_language_files`)
and the effective `[languages] enabled` config. The renderers only
display it.

- State `required` (no Rust seams, other languages present): terminal and
  Markdown say pilot found no Rust seams, list each language with its
  diff-first `ripr check --root <root>` route, and close with that route
  instead of the snapshot pair. TypeScript/JavaScript reuse the existing
  `typescript_diff_first` category and repair-route text. A language this
  binary cannot analyze (Perl in the default build) shows the
  unavailable-adapter notice and no invented command.
- State `supplementary` (Rust seams present, other languages present):
  terminal and Markdown are byte-identical to before; the other languages
  are listed only in pilot-summary.json.
- State `not_detected`: no change beyond the additive JSON field.

The Perl notice lives in one domain owner,
`LanguageId::unavailable_adapter_notice()`. Its lead sentence and rebuild
recovery match the disabled-adapter wording planned in #3954; when that
owner lands, this body becomes a call to it.

pilot-summary.json gains the additive `language_routes` object
({state, routes[]}); documented in docs/OUTPUT_SCHEMA.md and
RIPR-SPEC-0009, with the new tests mapped in .ripr/traceability.toml.

Refs #3906

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
The Python route test asserted the printed command string only. It now
runs that command and requires the report to name src/pricing.py, so a
route that parses but analyzes nothing fails.

Refs #3906

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
The terminal language-route list printed `route:` for Python but
`route (typescript_diff_first):` for TypeScript and JavaScript (re-walk
N10). Every runnable route now prints `route: <command>`. The guidance
category id stays in pilot-summary.json and in the Markdown guidance line;
JSON is unchanged.

A unit test renders TypeScript, JavaScript and Python routes together and
requires the same `    route: ripr check --root .` line under each;
reintroducing the category-specific label fails it for typescript.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
#3968 gave push_repair_route its changed_line_anchored parameter and
updated the production call site, but the #3936 test that pins the
repair-start ordering still called it with two arguments. Each PR was
green on its own stale base; the combined tree did not compile lib
tests. The fixture route models the changed seam's own repair route, so
the anchor flag is true in both calls.

Observed on main 3d06245: cargo check --tests errors E0061 at
crates/ripr/src/output/gate/presentation.rs:630 and :642.
@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.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 018e9232-0ee2-4882-9324-4775e523a11e

📥 Commits

Reviewing files that changed from the base of the PR and between 3d06245 and c63a647.

📒 Files selected for processing (13)
  • .ripr/traceability.toml
  • crates/ripr/src/cli/commands/pilot.rs
  • crates/ripr/src/domain/language.rs
  • crates/ripr/src/output/gate/presentation.rs
  • crates/ripr/src/output/pilot/language_routes.rs
  • crates/ripr/src/output/pilot/mod.rs
  • crates/ripr/src/output/pilot/render/complete.rs
  • crates/ripr/src/output/pilot/tests.rs
  • crates/ripr/src/output/pilot/types.rs
  • crates/ripr/tests/cli_smoke.rs
  • docs/CAPABILITY_MATRIX.md
  • docs/OUTPUT_SCHEMA.md
  • docs/specs/RIPR-SPEC-0009-defaults-first-adoption.md

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces language routing for workspaces containing TypeScript, JavaScript, Python, or Perl files when ripr pilot's Rust seam scan finds no seams, preventing empty rankings from being misinterpreted as clean passes. It adds a new language_routes module, updates pilot summary rendering across JSON, Markdown, and terminal outputs, and includes extensive tests and documentation updates. The review feedback suggests improving test reliability in crates/ripr/src/output/pilot/tests.rs by asserting against literal expected strings rather than dynamically constructing them with implementation helper functions like unavailable_adapter_notice.

assert_eq!(perl.language_status(), "unavailable");
assert_eq!(perl.route(), "unavailable_in_this_binary");
assert_eq!(perl.command, None);
assert_eq!(perl.guidance, LanguageId::Perl.unavailable_adapter_notice());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Avoid using implementation helper functions (such as unavailable_adapter_notice) to dynamically construct expected values in test assertions, as this can make the test self-confirming and weaken the test oracle. Use literal values to pin the contract independently.

        assert_eq!(
            perl.guidance.as_deref(),
            Some("Perl analysis is not available from this ripr binary. Rebuild ripr with Cargo feature `lang-perl` to analyze Perl files.")
        );
References
  1. Avoid using implementation helper functions to dynamically construct expected values in test assertions to prevent self-confirming tests.

Comment on lines +1204 to +1212
if let Some(notice) = LanguageId::Perl.unavailable_adapter_notice() {
assert!(
terminal.contains(&format!(
"perl: 1 file (not available in this build)\n {notice}\n"
)),
"{terminal}"
);
assert!(md.contains(&notice), "{md}");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Avoid using implementation helper functions (such as unavailable_adapter_notice) to dynamically construct expected values in test assertions, as this can make the test self-confirming and weaken the test oracle. Use literal values to pin the contract independently.

Suggested change
if let Some(notice) = LanguageId::Perl.unavailable_adapter_notice() {
assert!(
terminal.contains(&format!(
"perl: 1 file (not available in this build)\n {notice}\n"
)),
"{terminal}"
);
assert!(md.contains(&notice), "{md}");
}
if !LanguageId::Perl.is_available() {
let notice = "Perl analysis is not available from this ripr binary. Rebuild ripr with Cargo feature `lang-perl` to analyze Perl files.";
assert!(
terminal.contains(&format!(
"perl: 1 file (not available in this build)\n {notice}\n"
)),
"{terminal}"
);
assert!(md.contains(notice), "{md}");
}
References
  1. Avoid using implementation helper functions to dynamically construct expected values in test assertions to prevent self-confirming tests.

@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

  • artifact-verifier failed with exit code 2; not a UB-handling defect. Likely a profile/runner policy or malformed fixture file unrelated to memory or async surfaces; defer to compile/gate evidence.
  • pilot_terminal_route_label_has_one_shape_for_every_language only inspects the second line after each language header; if the terminal renderer ever inserts an empty separator line per route, the comparison still passes against route: ripr check --root . for all runnable routes but would silently miss a regression that adds a second route: line per language. Severity is low because N10's stated failure was label divergence (route: vs route (category):), not line-position drift, and the assertion correctly exercises both TypeScript-with-category and Python-without-category paths.
  • The PL CLI smoke test unconditionally invokes run_pilot_language_fixture which runs ripr pilot regardless of cfg!(feature = "lang-perl") and then asserts the unavailable notice under cfg-gated branches. When lang-perl is on, the test passes anyway (preview path); when off, it pins the unavailable notice. Not architectural but worth a future cfg-gate to skip the subprocess when the adapter is unavailable, otherwise the fixture silently runs the unavailable branch and the assertion only holds by cfg.
  • artifact-verifier sensor failed (exit code 2). Sensor receipt status reported in shared context; no diff-side evidence inside this PR shows what artifact was rejected. Defer to compiler lane.
  • crates/ripr/src/output/pilot/tests.rs:1212 — The terminal availability-guard branch builds expected substring via unavailable_adapter_notice(); pin it as a literal so the test fails if the helper changes wording.

Verification questions

  • Confirm gemini-code-assist already flagged that two Perl-unavailable assertions (tests.rs:1062 and :1212) construct expected text via LanguageId::Perl.unavailable_adapter_notice(), making them self-confirming for the literal wording.
  • Confirm language_routes JSON is additive and 'null' only on timeout; required state is mutually exclusive of supplementary across all four rust_seams_present × routes.is_empty() combos.
  • Confirm perl guidance uses unavailable_adapter_notice() literal in tests.rs lines 1062/1212 (per gemini review), which is the implementation helper — a self-confirming test risk that the PR leaves unchanged in this diff.

Refuted

  • PilotLanguageRoute.command = Some(format!(...)) and .guidance = Some(TsFullRepoGuidance::REPAIR_ROUTE.to_string()) are owned String fields, so the &str slices returned by commands() and rendered into JSON/Markdown/terminal cannot reference memory that has been resized or freed.; refuted because: Each render call iterates routes within the same scope that owns the PilotLanguageRoutes stack local in pilot::pilot(); the only borrow into 'static is TsFullRepoGuidance::REPAIR_ROUTE (a &'static str). No resize/detach/transfer is possible on owned String/Vec in safe Rust.
  • Adding language_routes to PilotSummaryContext could create a reference that escapes a worker or async task.; refuted because: Context is built and consumed in the same sync call to render_pilot_*; no task boundary crosses the reference. Borrow checker + clippy::usb_scope already covered.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Closing as superseded by #4022, which repairs both combined-tree breaks on main (this PR covered only collision 1, the E0061 arity; #4022 also regenerates the seven packet-index goldens for the #4011/#3973 drift, with local proof: 5349 lib tests and the xtask dogfood suite pass). One candidate per claim — #4022 is the complete fix.

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