Skip to content

fix(review): reconcile public claim surfaces - #825

Merged
EffortlessSteven merged 8 commits into
mainfrom
codex/issue764-public-surface
Aug 4, 2026
Merged

EffortlessSteven merged 8 commits into
mainfrom
codex/issue764-public-surface

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR completes the bounded #764 public-surface contract on current main.

It ensures that one semantic current-head claim has at most one planned public
location, that exact cross-surface duplicates are accounted for explicitly, and
that planned delivery metadata is deterministic and source-thread bound. The
artifact verifier now enforces the same contract, including the explicit
none plan for a receipted claim-graph loser. GitHub transport, delivery
confirmation, retries, proof execution, and body ranking remain out of scope
for #825; #765 owns transport.

Source and policy receipts

  • Parent issue: M1: compile one current-head claim graph and reuse existing review threads #764.
  • Exact PR head: d0ad0a97cf02015d5ce8889fe491072a3e6dfc07.
  • RIPR remains strict zero; no threshold or broad suppression was added.
  • The RIPR ledger contains exact, owned receipts for weakly exposed analyzer
    records after the colocated semantic matrices and generated-packet checks
    passed. The final local ready scan reports new_unsuppressed=0 and
    threshold=0; its only notice is the existing Python preview skip.
  • The pre-existing overdue non-rust-ripr-suppressions review warning was not
    renewed or changed.

Verification

Local proof passed:

  • cargo fmt --all -- --check
  • 16 review_topics tests and 9 compiler_reconciliation tests
  • 716 ub-review binary tests
  • cargo test --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo doc --workspace --no-deps --locked
  • cargo xtask policy-check
  • artifact verifier self-test and generated hosted-shape packet verification
  • git diff --check
  • full-context local RIPR with new_unsuppressed=0

Hosted exact-head run 30873539288 passed the ub-review/gate, artifact
verifier, Codecov, and GitGuardian checks. The hosted gate is the authoritative
integration proof; it confirms the final generated packet and strict-zero
RIPR enforcement, not GitHub comment delivery, which is intentionally later
work.

CI budget

The exact-head hosted gate took approximately four minutes. It is required for
this slice because local RIPR and packet verification must be checked with the
hosted repository context and gate policy.

Agent notes

The valid exact-head findings were repaired or narrowly receipted after the
semantic tests were added. The final remaining hosted failure was a verifier
contract mismatch for an explicitly adjudicated losing topic; the verifier now
accepts only that conflict-receipted no-human-surface/none case and has a
regression self-test. CodeRabbit review automation was rate-limited during the
final pass; its actionable findings were independently checked and addressed.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Improved reconciliation of inline comments and summary findings.
    • Duplicate findings with matching public claims are now identified and consolidated.
    • Review topics now include planned delivery actions and source-thread details.
    • Added cross-surface duplicate classification and validation.
  • Bug Fixes

    • Prevented duplicate or ambiguous findings from being incorrectly merged.
    • Improved claim normalization for more consistent matching.
    • Added validation to preserve accurate source and delivery mappings.

Walkthrough

The change adds planned delivery metadata to review topics, reconciles inline and summary findings, classifies cross-surface duplicates, and validates these contracts in compiler artifact verification.

Changes

Cross-surface reconciliation

Layer / File(s) Summary
Topic delivery and surface reconciliation
src/review_topics.rs, src/main.rs, .ripr/suppressions.toml
Review topics now store planned actions and optional threads. Public reconciliation suppresses exact duplicates and preserves distinct or ambiguous findings. Main processing uses the combined reconciliation function.
Compiler duplicate classification
src/compiler_reconciliation.rs
Removed summaries matching one retained inline claim now receive the duplicate_cross_surface disposition and evidence receipt. Tests cover exact receipts and ambiguous matches.
Verifier contract validation
scripts/verify-bun-review-artifacts.py
The verifier validates planned actions, planned threads, normalized claims, and cross-surface duplicate receipts. Self-tests cover valid and invalid cases.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

Suggested labels: enhancement, codex

Poem

I’m a rabbit with claims in a row,
Matching inline and summary flow.
Threads receive plans, duplicates hide,
Receipts keep each finding tied.
Cross-surface paths reconcile bright—
Hop, hop, verified right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 83.72% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title clearly and concisely describes the main change: reconciling public claim surfaces.
Description check ✅ Passed The description covers the summary, policy receipts, verification, CI budget, and agent notes required by the template.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue764-public-surface

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.

@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: 5c535398cc

ℹ️ 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".

Comment thread src/review_topics.rs Outdated
Comment on lines +338 to +340
let left = canonical_text(left);
let right = canonical_text(right);
!left.is_empty() && left == right

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Compare all tokens before suppressing a summary

When an inline comment and a distinct summary share their first 24 whitespace-delimited tokens, this comparison treats them as identical because canonical_text truncates after 24 tokens. reconcile_public_surfaces then silently removes the summary even if the claims differ in a qualifying condition or consequence after that prefix, and the Python verifier repeats the same truncation so it will accept the loss. Use a non-truncated normalized key for exact cross-surface deduplication.

Useful? React with 👍 / 👎.

Comment thread src/review_topics.rs
Comment on lines 198 to +200
topic.thread_disposition = thread_disposition(topic, &matching_threads);
topic.planned_action = planned_action(topic);
topic.planned_thread_id = if topic.planned_action == "reply" {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Derive planned actions after conflict adjudication

When an explicit cross-lane conflict is resolved later in build_active_claim_graph, adjudicate_claim_graph_conflicts changes the losing topic's delivery to no-human-surface, but the action computed here remains inline or summary. The resulting handoff therefore instructs the later delivery seam to publish a proof-refuted claim that final surface reconciliation suppresses; recompute or clear the plan after adjudication for losing topics.

Useful? React with 👍 / 👎.

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/verify-bun-review-artifacts.py (1)

11857-11906: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add negative self-tests for the new planned_action validation.

self_test_claim_graph_contract only exercises the happy path for the new planned_action/planned_thread_id fields ("novel" → "summary", no thread). The validation added at lines 1920-1963 has several failure branches: mismatched planned_action for a given thread_disposition, a "reply" plan with a missing or non-existing thread id, and a non-"reply" plan with a thread id set. None of these failure paths has a self-test.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify-bun-review-artifacts.py` around lines 11857 - 11906, Extend
self_test_claim_graph_contract with negative cases for planned_action
validation: reject mismatched planned_action/thread_disposition combinations,
reject reply plans when planned_thread_id is missing or not present in
existing_threads, and reject non-reply plans when planned_thread_id is set. Use
write_graph overrides and expect_self_test_failure assertions matching the
validation messages.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/verify-bun-review-artifacts.py`:
- Around line 5994-6007: Update the duplicate_cross_surface branch around
expected["kind"] to require that the removed surface is kind "summary" before
validating retained inline twins and receipts; reject any other kind while
preserving the existing exact-twin and source-bound receipt checks.

---

Outside diff comments:
In `@scripts/verify-bun-review-artifacts.py`:
- Around line 11857-11906: Extend self_test_claim_graph_contract with negative
cases for planned_action validation: reject mismatched
planned_action/thread_disposition combinations, reject reply plans when
planned_thread_id is missing or not present in existing_threads, and reject
non-reply plans when planned_thread_id is set. Use write_graph overrides and
expect_self_test_failure assertions matching the validation messages.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d91a9b1d-d6fe-4512-8cdf-a71550b105b2

📥 Commits

Reviewing files that changed from the base of the PR and between ca616b4 and 5c53539.

📒 Files selected for processing (4)
  • scripts/verify-bun-review-artifacts.py
  • src/compiler_reconciliation.rs
  • src/main.rs
  • src/review_topics.rs

Comment thread scripts/verify-bun-review-artifacts.py Resolved

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • planned_action is computed before adjudicate_claim_graph_conflicts overwrites delivery to 'no-human-surface'; losing topics keep 'inline' or 'summary' plan, instructing the delivery seam to surface refuted claims. Recompute plan after adjudication or clear it for losing topics.
  • same_public_claim suppresses summary findings when only the first 24 tokens of normalized text match; later qualifying-condition divergence is silently dropped. Use a non-truncated normalized key or hash full canonical text for exact cross-surface dedup.

Confirmed findings

  • same_public_claim strips a [lane] prefix then calls canonical_text; canonical_text (per prior P1 review) truncates to first 24 whitespace tokens. Two distinct claims sharing the first 24 tokens but diverging after the prefix (or after token 24) will compare equal and the summary will be suppressed.
  • duplicate_cross_surface path in compiler_reconciliation requires exactly one retained inline twin (matching_inline_claims.len() == 1); ambiguity leaves the summary unaccounted rather than surfaced, hiding duplicates from the receipt.
  • reconcile_inline_comments and reconcile_summary_only_findings are now redundant in production paths and only kept alive by tests; consider gating them behind #[cfg(test)] or deleting to keep the public API minimal.
  • duplicate_cross_surface removal requires retained_ids size == 1 and exact set match against adjudicating; an inline summary pair that also has a second identical inline would still pass removal but produce a misleading retained_ids cardinality. Coverage is symmetric to the Rust test only when exactly one inline twin exists.

Verification questions

  • Confirm reconcile_public_surfaces filter retains summary findings whose inline count != 1. With 0 inline matches the duplicate summary is kept; with 2+ inline matches the ambiguous duplicate is kept (per test). Good, but claim_graph topic.planned_action for that summary is set to 'summary' before reconciliation runs, so the handoff plan is not updated to reflect suppression.
  • Confirm several existing tests had to be updated to add planned_action/planned_thread_id fields to fixtures; six assertion sites now cover the new planned delivery field across dispositions (none, inline, summary, reply). Adjudication-loss re-derivation is not exercised.
  • Confirm canonical_text truncates after 24 tokens, so same_public_claim treats near-duplicates with diverging tails as identical and silently suppresses summary copies.
  • Confirm planned_action is computed in build_active_claim_graph before adjudicate_claim_graph_conflicts; losing topics keep inline/summary plan while delivery flips to no-human-surface.
  • Confirm prior P1 objection (truncated canonical_text silently suppresses summary after 24 tokens) was answered by adding same_public_claim with prefix-strip + full canonical_text, so reopens only if a qualifying prefix difference still falls through.

Verification questions

Refuted

[review body truncated; see review artifacts]

[review body truncated; see review artifacts]

Comment thread src/review_topics.rs
@@ -192,6 +196,12 @@ pub(crate) fn build_active_claim_graph(
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[opposition] planned_action is computed before adjudicate_claim_graph_conflicts overwrites delivery to 'no-human-surface'; losing topics keep 'inline' or 'summary' plan, instructing the delivery seam to surface refuted claims. Recompute plan after adjudication or clear it for losing topics.

Comment thread src/review_topics.rs
.map_or(left, |(_, body)| body.trim());
let left = canonical_text(left);
let right = canonical_text(right);
!left.is_empty() && left == right

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[source-route] same_public_claim suppresses summary findings when only the first 24 tokens of normalized text match; later qualifying-condition divergence is silently dropped. Use a non-truncated normalized key or hash full canonical text for exact cross-surface dedup.

@codecov

codecov Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.84940% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/compiler_reconciliation.rs 99.35% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/compiler_reconciliation.rs`:
- Around line 706-725: Remove the redundant assertions at all three sites: in
src/compiler_reconciliation.rs:706-725, delete the seven-element tuple assertion
because lines 679-698 already cover each field; in
src/compiler_reconciliation.rs:762-770, delete the individual explanation.0,
explanation.1, and explanation.2 assertions because lines 751-761 assert the
tuple; in src/review_topics.rs:1606-1618, remove the inline_identity and
summary_identity rebuild, adding path and line checks to the existing assertions
only if those checks are required.
- Around line 512-515: Remove the tautological planned_action and
planned_thread_id assertions from the direct loser_graph fixture, and update the
associated suppression so it no longer cites them as evidence. Add equivalent
assertions in a test that obtains the graph through build_active_claim_graph,
where they validate production behavior rather than fixture literals.

In `@src/review_topics.rs`:
- Around line 1682-1701: Extend the planned_action test matrix around the
corroborated_with_new_evidence and refuted_by_new_evidence cases to explicitly
clear existing_threads and assert "none" when no current thread exists. Retain
the existing non-empty-thread assertions for both reply dispositions, covering
both guard outcomes in planned_action.
- Around line 1526-1553: Extend reconcile_public_surfaces_exact_matrix to use an
active claim graph with adjudicated survivor and losing topic identities,
ensuring graph-driven filter branches suppress the losing inline or summary
surface. Preserve the existing exact text-matching assertions, and add coverage
for the active losing-topic scenario rather than relying solely on
build_shadow_claim_graph’s empty topics and conflicts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4a4bc3cb-b979-4cdf-9f77-12c0026cec69

📥 Commits

Reviewing files that changed from the base of the PR and between 5c53539 and f025356.

📒 Files selected for processing (3)
  • .ripr/suppressions.toml
  • src/compiler_reconciliation.rs
  • src/review_topics.rs

Comment thread src/compiler_reconciliation.rs Resolved
Comment thread src/compiler_reconciliation.rs Resolved
Comment thread src/review_topics.rs Resolved
Comment thread src/review_topics.rs Resolved

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/verify-bun-review-artifacts.py (1)

5994-6009: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Match the Rust public-claim identity contract.

Line 6001 compares keys without either surface lane. The verifier cannot restrict prefix removal to the owning lane. It can treat a structural prefix such as [src/other_parser.rs:18] as metadata.

compiler_canonical_tokens also truncates at 24 tokens. Rust now compares the complete normalized public claim. Claims that differ after token 24 can therefore pass this verifier branch as duplicates.

Pass each surface lane to compiler_public_claim_key. Use an untruncated canonical-text path for this comparison. Add tests for structural prefixes and claims with different trailing conditions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify-bun-review-artifacts.py` around lines 5994 - 6009, Update the
duplicate_cross_surface validation to call compiler_public_claim_key with the
appropriate surface lane for both claims, while preserving structural prefixes
such as [src/other_parser.rs:18] as metadata rather than claim content. Use the
untruncated canonical-text identity path so differences after 24 tokens remain
distinct, and add coverage for structural prefixes and differing trailing
conditions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@scripts/verify-bun-review-artifacts.py`:
- Around line 5994-6009: Update the duplicate_cross_surface validation to call
compiler_public_claim_key with the appropriate surface lane for both claims,
while preserving structural prefixes such as [src/other_parser.rs:18] as
metadata rather than claim content. Use the untruncated canonical-text identity
path so differences after 24 tokens remain distinct, and add coverage for
structural prefixes and differing trailing conditions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fc29c4f9-c143-4d75-8aad-8f3489813ecb

📥 Commits

Reviewing files that changed from the base of the PR and between f025356 and 2e05407.

📒 Files selected for processing (4)
  • .ripr/suppressions.toml
  • scripts/verify-bun-review-artifacts.py
  • src/compiler_reconciliation.rs
  • src/review_topics.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant