Skip to content

fix(edit-cage): lead the unparseable-test refusal with a fix-the-syntax-error hint (RIPR-SPEC-0289) - #8993

Merged
EffortlessSteven merged 12 commits into
mainfrom
fix/edit-cage-parse-hint
Oct 23, 2026
Merged

EffortlessSteven merged 12 commits into
mainfrom
fix/edit-cage-parse-hint

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #8991
Acceptance delta (one sentence): the OutsideInlineTestRegion parse-error refusal now opens with the plain "the test written for this attempt does not parse — fix the syntax error and start the attempt again" statement before the existing bounded-recovery detail, on every surface that renders the refusal.

What changed

  • crates/ripr/src/cli/commands/agent.rs (repair_after_cage_recovery_lines, the edit-cage refusal renderer): when the after-phase verdict refuses the attempt with an OutsideInlineTestRegion violation whose region-observation detail reports unparseable, the narration's first line is now "the test written for this attempt does not parse — fix the syntax error and start the attempt again." The refused-path listing, terminal-attempt statement, and CRLF-aware undo route below it are unchanged. Because stderr, the recorded last_after_refusal.reason, and the --json refusal/failure envelopes all carry these narration lines, every surface benefits from the one renderer.
  • crates/ripr/src/edit_cage/mod.rs: new refusal_is_unparseable_new_test predicate owned beside the OutsideInlineTestRegion reason producer (evaluate_edit_cage), so the renderer does not string-match on vocabulary owned elsewhere; a module name (a Rust identifier) can never smuggle the marker in.
  • Spec: RIPR-SPEC-0289, registered in docs/specs/README.md, policy/doc-artifacts.toml, and .ripr/traceability.toml.
  • Tests: unparseable_new_test_refusal_leads_with_the_plain_hint pins the exact first line and that the recovery detail (refused-path listing, `mod tests`: unparseable detail, terminal statement, CRLF undo route) still follows; other_inline_region_refusals_do_not_lead_with_the_parse_hint is the negative control for every other refusal reason. Existing pin sites assert substrings (undo the refused changes, --phase before presence/absence), which the added leading line does not disturb; docs/REPAIR_ATTEMPT.md records the new lead line in the terminal-attempt narration contract.
  • Changelog: changelog.d/8991-edit-cage-parse-error-hint.md.

Non-goals


Devin Review

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 134 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: c5bb048e-8413-436f-8b0f-6db27b2376e3
📥 Commits

Reviewing files that changed from the base of the PR and between 8d2dfdd and 14042a7.

📒 Files selected for processing: 12
  • .ripr/traceability.toml
  • changelog.d/8991-edit-cage-parse-error-hint.md
  • crates/ripr/src/cli/commands/agent.rs
  • crates/ripr/src/edit_cage/mod.rs
  • docs/REPAIR_ATTEMPT.md
  • docs/specs/README.md
  • docs/specs/RIPR-SPEC-0289-edit-cage-parse-error-hint.md
  • fixtures/perl-verdict-corpus/spec-coverage.toml
  • fixtures/python-verdict-corpus/spec-coverage.toml
  • fixtures/rust-verdict-corpus/spec-coverage.toml
  • fixtures/typescript-verdict-corpus/spec-coverage.toml
  • policy/doc-artifacts.toml

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: ad924fe6-f3f8-42e5-9edd-325e6ad3e5f6
📥 Commits

Reviewing files that changed from the base of the PR and between 5403d85 and 8d2dfdd.

📒 Files selected for processing: 8
  • .ripr/traceability.toml
  • changelog.d/8991-edit-cage-parse-error-hint.md
  • crates/ripr/src/cli/commands/agent.rs
  • crates/ripr/src/edit_cage/mod.rs
  • docs/REPAIR_ATTEMPT.md
  • docs/specs/README.md
  • docs/specs/RIPR-SPEC-0289-edit-cage-parse-error-hint.md
  • policy/doc-artifacts.toml

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Summary by CodeRabbit

  • Bug Fixes

    • Edit-cage recovery messages now clearly identify when a newly written test contains a syntax error.
    • The syntax-error guidance appears consistently in command-line output, recorded refusal reasons, and JSON status details.
    • Existing refusal explanations and recovery instructions remain unchanged for other types of violations.
  • Documentation

    • Added guidance for fixing unparseable tests and recovering from incomparable clean baselines.
    • Documented the new parse-error refusal behavior and recovery wording.

Walkthrough

When an edit-cage refusal identifies an unparseable newly written test, recovery narration now begins with a syntax-error instruction. Existing refusal details remain after the hint. Tests cover parse-specific and unrelated refusals. Documentation and traceability records describe the behavior.

Changes

Edit-cage parse-error hint

Layer / File(s) Summary
Detection and recovery narration
crates/ripr/src/edit_cage/mod.rs, crates/ripr/src/cli/commands/agent.rs
A predicate identifies unparseable newly written tests. Recovery narration adds a syntax-error instruction before existing details. Tests verify the hint and confirm it is absent for unrelated inline-region refusals.
Behavior documentation and traceability
docs/specs/RIPR-SPEC-0289-edit-cage-parse-error-hint.md, docs/specs/README.md, docs/REPAIR_ATTEMPT.md, changelog.d/8991-edit-cage-parse-error-hint.md, .ripr/traceability.toml, policy/doc-artifacts.toml
The proposed specification, repair guidance, changelog, and policy and traceability records describe the parse-error refusal behavior. The repair guidance also covers incomparable attempts with empty violations.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 8d2df

The parse-error hint works for the current refusal format; no actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the change, scope, tests, specification, and non-goals, but it omits most required template sections, including Swarm / Source Boundary, Source-of-truth Links, Candidate Relat… Complete the missing required template sections. Mark applicable checkboxes, provide proof commands and results, document source links and relationships, define scope and claim boundaries, describe rollback, complete traceability, and recor…
Docstring Coverage Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (6 skipped: 6… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding a syntax-error hint to unparseable edit-cage refusals.
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 change, scope, tests, specification, and non-goals, but it omits most required template sections, including Swarm / Source Boundary, Source-of-truth Links, Candidate Relationships, Scope Classification, Support-tier Impact, Policy Impact, Proof, Claim Boundary, Rollback, Spec-Test-Code Traceability, Static Language Check, CI Economics, Engineering Check, and Gates.

Resolution

Complete the missing required template sections. Mark applicable checkboxes, provide proof commands and results, document source links and relationships, define scope and claim boundaries, describe rollback, complete traceability, and record engineering, policy, CI, and gate status.

Full details: Docstring Coverage

Explanation

Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

I’m a rabbit with syntax to mend,
A clear little hint leads the way.
Fix the test, then begin once again,
While the old refusal details stay.
I hop through the docs, neat and bright,
And leave parse errors less out of sight.

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 a clearer error hint when an agent-repair attempt's newly written test fails to parse, prepending a plain syntax error message to the refusal narration. It also updates the relevant documentation, specifications, and adds corresponding unit tests. Feedback on the changes suggests avoiding fragile substring matching in the violation detection logic to prevent test fragility, though this must be balanced against the need to distinguish parse errors from other inline region violations.

Comment thread crates/ripr/src/edit_cage/mod.rs Resolved

@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 found 2 potential issues.

Devin Review

Comment thread crates/ripr/src/edit_cage/mod.rs Resolved
Comment thread crates/ripr/src/cli/commands/agent.rs Resolved
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 20, 2026 23:36

Copy link
Copy Markdown
Member Author

Bounded independent review/integration coordination (2026-10-20): current head 45411e3 remains with the existing writer. Returned to Draft for the material source-confirmed r4330965451 concern: the unparseable producer parses the entire selected file and also rejects over-budget nesting; it does not identify a newly written test or establish a syntax error. The new first-line attribution can therefore misdiagnose production-only corruption or valid over-budget source. Targeted producer/verdict controls are underway, without a broad before-phase campaign.

Please repair on the existing branch: either carry evidence-backed parse attribution, or use truthful selected-file parse wording and preserve the useful syntax/restart guidance conditionally. Include production-only corruption and valid over-budget controls. Reconcile spec/docs with that actual contract and add focused proof of the shared refusal consumers/recording (r4330965583) before exact-head rereview. Do not apply the Gemini suggestion to treat every OutsideInlineTestRegion as malformed syntax; the production_edit negative case must retain its meaning.

Remote integration subject verified: 7cac39e, parents a816499 and this candidate, tree 95ac4c6843fdae5eb7256044fccefed3369f5a3b. No merge/qualification requested; no competing writer created.

Copy link
Copy Markdown
Member Author

Independent exact-head review: REPAIR_REQUIRED

Reviewed head: 45411e376ec1a54a892b6c6513c1634c93284dfa; diff basis: 5403d85084486d7804a5bb08a08cda9c2d4a5710. Current head re-read unchanged, Draft. Inspected all 12 changed files, the inline-region observer/validator, cage violation producer, shared recovery renderer, stderr narration, refusal recording and JSON envelope consumers.

[P1] Confirmed unsupported attribution in r4330965451. The unparseable observation does not establish that a new test exists, that the failure lies in a test, or even that source has a syntax error. Targeted producer runtime controls compiled the candidate's unchanged observe.rs, analysis/syntax/nesting.rs and facts/cfg_predicates.rs against its ra_ap_syntax dependency. Both controls leave the entire existing cfg-test module byte-identical and add no test: (1) malformed production-only let = 1;, (2) valid production expression with 300 nested blocks (raw SourceFile::parse has zero syntax errors). The real observer returned Unparseable for both. Source then carries that label through validate_inline_test_region_edit/observe_attempt_inline_region into evaluate_edit_cage; the new predicate accepts it and the renderer states that the test written for the attempt has a syntax error. The narrow harness establishes producer behavior, not a full CLI/recorded-refusal execution.

Smallest useful repair, retained with this PR's existing writer: use truthful selected-file/region wording and conditional syntax guidance, including the possibility of an analysis limit; alternatively carry an evidence-backed typed distinction before attributing failure to an added test. Update spec/docs/literal tests together. Retain production-only malformed and valid-over-budget negative controls, and establish the rendered/recorded/JSON consumer path with bounded proof after repair. No broad before-phase qualification campaign is needed for this finding.

Validation observed: standalone producer harness compiled and ran with exit 0; both controls reproduced the false premise. Focused cargo test -p ripr --lib unparseable_new_test_refusal_leads_with_the_plain_hint -- --exact --nocapture did not execute tests: rustc was terminated by SIGKILL, Cargo exit 101. This is unavailable runtime evidence, not an assertion failure or pass. Current-head PR CI/platform/security/coverage runs inspected were skipped; successful source-of-truth/wheel/ub-review runs do not establish required Rust qualification.

The Gemini suggestion to remove reason discrimination was source-refuted separately in r4331480838 and only that thread was resolved after reply/readback; the attribution and missing consumer-proof threads remain open. No candidate code or branch was changed. No readiness or merge clearance is granted.

EffortlessSteven commented Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

Owner / governing claim: #8991 / #8993. The existing writer retains fix/edit-cage-parse-hint at 45411e376ec1a54a892b6c6513c1634c93284dfa, still Draft. This lane owns the published adoption ref repair/8993-adoption, verified remotely at 7b43e86d9d088b4890f34f8821f0e1f5e6dce5bc. Only the adoption ref was pushed; canonical ownership is preserved.

Complete adoption diff — 10 changed files:

  • crates/ripr/src/cli/commands/agent.rs
  • crates/ripr/src/edit_cage/mod.rs
  • crates/ripr/tests/cli_smoke.rs
  • crates/ripr/tests/cli_smoke/selected_file_parse_refusal.rs
  • .ripr/traceability.toml
  • docs/REPAIR_ATTEMPT.md
  • docs/specs/README.md
  • docs/specs/RIPR-SPEC-0289-edit-cage-parse-error-hint.md
  • policy/doc-artifacts.toml
  • changelog.d/8991-edit-cage-parse-error-hint.md

The narration now describes the whole selected-file observation, explicitly includes analysis limits, and makes syntax advice conditional. It no longer infers a newly written test or an established syntax error. Reason discrimination and existing bounded recovery remain intact; spec/docs/changelog/traceability agree.

Fresh exact-head checks all exited 0:

  • Actual consumer test: cargo test --locked -p ripr --test cli_smoke selected_file_parse_refusal_reaches_actual_consumers -- --nocapture; one test executes all five controls across stderr, JSON, sentence-normalized recording and status. Malformed production and valid 300-block over-budget production preserve existing tests byte-identically; raw Rust parsing accepts the latter. Ordinary production_edit gets no parse hint. The positive insertion compiles and passes both fixture tests before a compliant finish.
  • Focused unit tests: unparseable_selected_file_refusal_leads_with_the_plain_hint and other_inline_region_refusals_do_not_lead_with_the_parse_hint; one passed each.
  • cargo xtask check-fast: 16 gates; stable independently verified 14-path PR selector (the original 12 paths plus the integration-test registration/file).
  • cargo xtask ci-policy: passed.

Independent substantive exact-head review found no remaining source/test findings after repairing fixture imports and the stale negative oracle. It covered the producer, predicate, actual consumers, sentence normalization, test stimulus/oracles and contract parity. Review disposition remains REVIEW_INCOMPLETE for hosted merge qualification.

Local integration proof also passed all five controls and both fixture tests at 88e78a30937a3211ecb7a04cd3d2e0d1040907b6, tree a82cc5352ec605d84947316852ea4780b2e72d6e, parents main 6be02b0bff14fe4729fdb6a39072d7ee4e9ee427 and the adoption head. Independent review inspected this composition and intervening main changes. This is scoped local integration evidence; GitHub's actual merge ref/hosted checkout and full required qualification remain to be established after adoption.

Reused evidence: the unchanged observer/budget reasoning and the source-refutation of Gemini's kind-only suggestion. The historical SIGKILL library compilation remains incomplete, never a pass. The old-wording runtime red witness and intermediate oracle/compile failures remain recorded on their original subjects; later exact-head passes do not rewrite them.

Access limits preserved: the all-state #8991 PR search via gh GraphQL and GET classic main protection/required_pull_request_reviews returned Forbidden. Neither was retried nor retrieved through another route. These remain evidence gaps.

Next / owner / resume condition: the canonical writer can adopt this exact descendant after checking no concurrent branch changes, for example by fetching the adoption ref and fast-forwarding the existing candidate from expected 45411e3 to 7b43e86d9d088b4890f34f8821f0e1f5e6dce5bc. Then update the PR claim, verify the current GitHub merge subject and authorized protection evidence, reply to substantive findings with current-head proof before resolving them, and request one valid hosted qualification through the installed merge-ready flow when eligible. Both substantive threads remain open on the unmodified canonical head. Ownership transfer is still pending.

Actual merges: none. No Ready transition or hosted qualification campaign was requested.

Adoption follow-through — 2026-10-21

Fresh checks confirm the canonical PR is still Draft at 45411e376ec1a54a892b6c6513c1634c93284dfa, and the published adoption ref remains 7b43e86d9d088b4890f34f8821f0e1f5e6dce5bc (tree 321f0c20038bd3245d61180283c512a9966ac7f4). The adoption is an exact three-commit descendant, with no divergence. Current main remains the already-tested integration basis 6be02b0bff14fe4729fdb6a39072d7ee4e9ee427; unchanged focused/local integration checks were reused, not rerun. Source inspection confirms the selected-file/analysis-limit wording, five real consumer controls, reason discrimination, and aligned spec.

All PR Conversation comments, submitted reviews and inline threads were read. There is no owner acknowledgment or transfer after this handoff. Attribution thread PRRT_kwDOSiSx0c6ujHOf (r4330965451) and consumer-coverage thread PRRT_kwDOSiSx0c6ujHPv (r4330965583) remain unresolved against the old canonical head. Gemini's kind-only suggestion remains resolved with its source-backed rebuttal. No new substantive finding was observed. The PR body still describes the old attribution and must be corrected with adoption.

Concrete owner action requested: the existing writer of fix/edit-cage-parse-hint (PR author EffortlessSteven) should acknowledge whether it has unpublished work and either adopt the exact descendant above or explicitly transfer canonical integration ownership to this follow-through lane. An unchanged remote branch alone does not establish writer idleness. Until acknowledgment/transfer, this lane preserves that branch and does not resolve repair threads against unapplied source. After adoption: refresh the PR claim; verify the actual merge object/checkout; reply/read back/resolve the two repaired findings; finish exact-head remote review and one applicable hosted qualification request. Existing Forbidden search/protection reads remain unretired evidence gaps. No canonical push, Ready/label request, merge, or duplicate validation was performed by this follow-through.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 22, 2026 07:59

Copy link
Copy Markdown
Member Author

Review of record, head 024ff12 (single-reviewer pass).
Angles: correctness (finding repaired: the lead line names the selected file, not the new test, since the whole file is parsed; non-parse inline-region refusals keep existing narration), tests (renderer tests + a new producer-linked test over the real observation and cage covering new-test error, production-only error, and a parseable production edit control), spec/contract (RIPR-SPEC-0289, REPAIR_ATTEMPT.md, README row, changelog all reworded; id 0289 free on main), integration (main merge had broken .ripr/traceability.toml: unclosed outputs array and dropped metrics; restored).
Local: cargo xtask precommit exit 0 (clippy over lib tests). The new test body could not be executed locally (rustc OOM-killed on the shared box); hosted gates will run it.
All three review threads replied to and resolved. Requesting Ripr Rust Small Result.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NnZhkThzBwCEoDGo2rn4Yo


Generated by Claude Code

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

Verification questions

  • Confirm the renderer remains the single narration owner, so stderr, recorded refusal reason, and JSON envelopes should receive the same leading line without per-surface changes.
  • Confirm the required recorded-refusal and JSON-envelope behavior is not directly proven by the changed tests.
  • Confirm the required shared-surface proof for recorded and JSON refusal narration is specified but not directly evidenced by the added tests.

Refuted

  • The hint is applied to every OutsideInlineTestRegion refusal, making the Gemini suggestion incorrect.; refuted because: The predicate requires the producer-specific unparseable detail, and the negative production_edit control confirms other reasons do not receive it.
  • The hint still misattributes a whole-file parse failure to a newly written test.; refuted because: The current wording and producer-linked test name the selected file and cover production-only syntax corruption, so the earlier attribution objection no longer applies.
  • Using only the OutsideInlineTestRegion kind would add a syntax hint to non-parse refusals.; refuted because: The implementation requires the producer-owned unparseable detail and has a negative control proving production_edit does not receive the hint; prior discussion rejected replacing the distinction with kind-only matching.
  • Checking only the violation kind would add the parse hint to unrelated OutsideInlineTestRegion refusals.; refuted because: The predicate also requires the producer-owned unparseable detail, and the negative control confirms a production_edit refusal does not receive the hint.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • The mapped tests are present in source, but this packet lacks a successful cargo-test receipt; ripr exited 2 and cargo-test was scheduled late, leaving execution as residual verification risk.
  • The available sensor evidence does not yet confirm the mapped Rust tests pass.

@EffortlessSteven
EffortlessSteven merged commit ea70e6e into main Oct 23, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants