Skip to content

fix(review-comments): render gap-ledger cards for records without seam identity (#4524) - #4581

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/gap-ledger-schema-usdllr
Sep 29, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/gap-ledger-schema-usdllr

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

Before: the documented route ripr check --json → ripr reports gap-ledger --check-output → ripr review-comments --gap-ledger never rendered a card. Every --check-output GapRecord has seam_id: None, while its projection_eligibility.pr_comment says eligible, and review-comments suppressed each one as missing_seam_identity. On fixtures/python_boundary_gap it produced 0 cards and 1 suppression.

After: the same route renders the Python repair card (gap:pr:gap:python:src/discount.py:apply_discount:... at src/discount.py:2), and the output validates against the published schema.

A gap-ledger card is keyed by its GapRecord (gap_id, dedupe_key), so the renderer now omits seam_id when the record has none instead of dropping the card. seam_id is still never synthesized from the gap, file or line.

How:

  • crates/ripr/src/output/review_comments.rs: seam_id is optional on gap-record cards. When a seamless record shares a dedupe key with a seam-carrying record that renders, the seam record wins in either ledger order, and the seamless one is suppressed as duplicate_dedupe_fingerprint. A seam record that is itself ineligible (for example waived) claims nothing. Markdown falls back to gap_id where it printed unknown, which also fixes the suppressed list for gap-ledger rows.
  • schemas/ripr/review-comments.schema.json: seam_id moves from the common recommendation.required list to the diff-scoped (else) branch, and the property gains a description.
  • The gate is unchanged. Seamless records still fail closed there as incomplete_repair_route (RIPR-SPEC-0067), and validate_gap_record_seam_identities is untouched.

Alternative considered and rejected: giving --check-output records a seam ID from the finding's probe ID. RIPR-SPEC-0067 forbids substituting another identity for a seam ID. The gate's seam-identity validator would also start rejecting ledgers where several findings share one canonical gap (canonical_gap_group_size > 1).

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Governing issue or accepted claim: #4524 (found by #4523 / #3913)
Spec: RIPR-SPEC-0068 ("seam_id remains the source-locator identity whenever a seam identity exists"); RIPR-SPEC-0067 (gate unchanged)
Acceptance delta (one sentence): a PR-comment-eligible --check-output ledger record renders a schema-valid gap-keyed card.

Candidate Relationships

Candidate branch: claude/gap-ledger-schema-usdllr (restarted from main after #4523 merged). No other open PR for #4524.

Scope Classification

  • One public contract

Production delta: review-comments --gap-ledger renders cards for seamless eligible records.
Non-goals: gate eligibility; adding seam identity to preview-language ledgers; the ledger shape (#4544 owns ledger identity).

Support-tier Impact

  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes: seam_id is no longer required on gap-ledger cards (loosened only for source: gap_decision_ledger); diff-scoped cards still require it.

Proof

cargo test -p ripr --lib review_comments                 # 70 passed
cargo test -p xtask --bin xtask -- gap_ledger review_comments  # 30 passed
cargo xtask precommit                                    # exit 0
  • review_comments_gap_ledger_without_seam_identity_renders_gap_keyed_card: card rendered, seam_id absent, and Markdown names the gap_id.
  • review_comments_seam_carrying_record_wins_a_shared_dedupe_key: both orders tested.
  • review_comments_ineligible_seam_record_does_not_claim_a_shared_dedupe_key.
  • gap_ledger_route_bytes_from_check_goldens_match_published_schema: the Python check golden now yields 1 card and 0 suppressions, and the output validates.
  • review_comments_gap_ledger_card_has_its_own_schema_branch: a seamless gap card is accepted and a seamless diff-scoped card is rejected.
  • Negative experiment (reverted): putting seam_id back into recommendation.required fails both the route test and the schema-branch test.
  • End to end with the built binary on real git repos: python_boundary_gap and python_cli_output_repair_gap now render 1 card each and validate with python jsonschema 4.26.0. typescript_boundary_gap stays suppressed as not_pr_comment_eligible, which the ledger decides. Rust boundary_gap stays empty.

Claim Boundary

May claim: eligible --check-output records (for example Python repair gaps) render gap-keyed PR guidance cards. Must not claim: gate eligibility for these records, or TypeScript cards where the ledger marks them ineligible.

Rollback

Revert the commit; the previous suppression returns.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0068, RIPR-SPEC-0067
  • Tests: crates/ripr/src/output/review_comments.rs, xtask/src/reports/review_comments.rs, xtask/src/verification_contracts.rs
  • Code: crates/ripr/src/output/review_comments.rs
  • Schema/docs: schemas/ripr/review-comments.schema.json, docs/OUTPUT_SCHEMA.md, CHANGELOG.md

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • Public JSON/schema changes are documented.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ESbzJNWsBLH9bijoDkvqXd


Generated by Claude Code

…m identity (#4524)

Every `reports gap-ledger --check-output` record has no seam_id, while
the ledger marks it pr_comment eligible. review-comments suppressed each
one as missing_seam_identity, so the documented check -> gap-ledger ->
review-comments route never produced a card.

A gap-ledger card is keyed by its GapRecord (gap_id, dedupe_key), so it
now omits seam_id when the record has none instead of suppressing the
card; seam_id is still never synthesized from the gap, file or line.
A record with seam identity keeps a shared dedupe key regardless of
ledger order. The schema moves seam_id from the common recommendation
requirement to the diff-scoped branch. Markdown falls back to gap_id.

The gate route is unchanged: seamless records still fail closed there
as incomplete_repair_route per RIPR-SPEC-0067.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESbzJNWsBLH9bijoDkvqXd
@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 self-assigned this Sep 29, 2026
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 29, 2026 01:26
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 31 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: ec2d21c1-01ef-4a97-b298-b78a95a02e12

📥 Commits

Reviewing files that changed from the base of the PR and between 9a4f598 and e8a638c.

📒 Files selected for processing (8)
  • .ripr/traceability.toml
  • CHANGELOG.md
  • crates/ripr/src/output/review_comments.rs
  • docs/OUTPUT_SCHEMA.md
  • schemas/ripr/review-comments.schema.json
  • tests/fixtures/verification/ripr/review-comments.gap-ledger.valid.json
  • xtask/src/reports/review_comments.rs
  • xtask/src/verification_contracts.rs

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

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!

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T01:29:56.762809Z 33e7db5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 docs/OUTPUT_SCHEMA.md Resolved

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33e7db5876

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

EffortlessSteven pushed a commit that referenced this pull request Sep 29, 2026
…tory through 9a4f598

Row 16 and the #3913 bullet now name swarm #4523 (94e0c74) as the
evidence that clears them once synced. Known limitations adds the
check-output review-comments route rendering no cards (#4524, fix #4581).
Inventory adds #4496, #4523, #4502, #4517.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AYyUnjaq9zD4WsBujWEUpk
… that renders (#4524)

Repair-route and verification-command rejections now run before the
dedupe insert, so a rejected record cannot suppress a later valid card
that shares its key. Also corrects the comments[].seam_id entry in
OUTPUT_SCHEMA.md for seamless gap-ledger cards.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESbzJNWsBLH9bijoDkvqXd
…er caps (#4524)

A seam-carrying card that wins a shared dedupe key now takes the ledger
slot of the first seamless record that yielded to it, so the inline and
summary caps cannot drop the key's only card. Suppressions stay in
ledger order. Also replaces the two deleted test names in the
RIPR-SPEC-0067 traceability entry with the current tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESbzJNWsBLH9bijoDkvqXd

Copy link
Copy Markdown
Member Author

Reopened. #4569's squash commit (5232334) mentions this PR as "fix #4581", and GitHub read that as a closing keyword, so it closed this PR when #4569 merged. The #4524 fix is not on main yet, and head e8a638c is unchanged.


Generated by Claude Code

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

Exact-head review of e8a638c: no blocking findings.

What I checked:

  • Producer (crates/ripr/src/output/review_comments.rs): every rejection in gap_record_comment_json (projection, scope, policy, anchor, dedupe, seam-claim, repair route, verification commands) returns before seen_dedupe.insert, and before the causal projection is read. That means the prescan in seam_claimed_dedupe_keys (run without a causal projection) and the main pass accept the same seam records. A seamless record never inserts a claimed key, so the two dedupe sets cannot collide. The winning card inherits the earliest yielded slot before the caps apply, and suppressions are re-sorted by ledger index. seam_id is never synthesized.
  • Schema/docs: seam_id is required only on the diff-scoped else branch. The fixture, docs/OUTPUT_SCHEMA.md (the field entry and the gap-ledger paragraph) and CHANGELOG agree with that.
  • Tests: I checked five tests covering the gap-keyed card, seam-wins in both orders, an ineligible seam record, a rejected record in both seam modes, and the over-cap case in both orders. The over-cap test fails with 0 cards when slot inheritance is disabled. Two more tests cover real route bytes from check goldens plus the schema-branch accept/reject. The RIPR-SPEC-0067 traceability now names these tests, and check-traceability passes.
  • Gate: unchanged. Seamless records still fail closed there as incomplete_repair_route.
  • Exact-head CI: Ripr Rust Small on GitHub Hosted / Rust gates passed (run 36510230005), along with Rust-only feature lane, source-of-truth, cargo-deny, dependency-review, spec-maintenance-digest, GitGuardian and pr-plan. A duplicate Rust gates run started by the reopen is still in progress. Local: cargo xtask precommit exit 0.
  • Review providers: Devin's and Codex's findings are all fixed and resolved. CodeRabbit was rate-limited and Gemini was over quota, so those reviews are missing, not clean.

Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit 9e6d8d2 into main Sep 29, 2026
53 of 54 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/gap-ledger-schema-usdllr branch September 29, 2026 02:36
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