Skip to content

Run review-comments owner attribution under the run cancellation token - #10252

Merged
EffortlessSteven merged 4 commits into
mainfrom
claude/review-comments-cancel
Oct 25, 2026
Merged

EffortlessSteven merged 4 commits into
mainfrom
claude/review-comments-cancel

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Plan item: #1604 piece 1, prove the cancellation token reaches the long analysis loops.

Governing issue or accepted claim: #1604

Acceptance delta (one sentence): ripr review-comments owner attribution, which builds a Rust index over every changed file, now runs under the run's cancellation token instead of outside it.

What I checked

The canonical analysis, seam inventory and related phases already run under analysis::cancellation::with_token. Owner attribution (attribute_owners in review_comments_with_admission) did not, so the per-file and per-batch checkpoints inside build_index were inert there and a large diff could spend the budget with nothing to stop it.

Proof

  • New test review_comments_owner_attribution_runs_under_the_run_token injects an attribute_owners closure that records whether a token is installed.
  • Negative control: with the with_token wrapper reverted the test fails ("owner attribution ran without the run's cancellation token installed"); with it restored it passes.
  • cargo test -p ripr --lib review_comments: 99 passed.
  • cargo xtask precommit: passed.

Behavior note

A cancelled attribution still returns empty owners (the helper swallows Err). That cannot be published as complete: the deadline check that follows uses the same clock and records a limited_timeout receipt.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FrVWuPEQjhYo674kxG7wdc

@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 marked this pull request as ready for review October 25, 2026 06:13
@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!

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

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

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 168 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: bd940a03-8ea8-477b-9c02-ac79309cf934
Commits

Reviewing files that changed from the base of the PR and between feea378 and 573fec5.

Files selected for processing: 3
  • .ripr/traceability.toml
  • changelog.d/1604-review-comments-owner-attribution-token.md
  • crates/ripr/src/cli/commands/review_comments.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Verification questions

  • Confirm the focused test verifies token presence during owner attribution but does not assert that cancellation interrupts an already-running owner-attribution operation.
  • Confirm the new test proves token presence, not that a large or already-expired run is interrupted inside owner attribution.

Refuted

  • The changelog says a large diff can no longer spend the budget there with no checkpoint, while the PR body explicitly disclaims interior checkpoints in rust_index::build_index.
  • The changelog overstates the effect: installing a cancellation token does not itself make a large diff stop at an interior checkpoint unless owner attribution consults that token.
  • The fix should introduce a broader cancellation helper or refactor all analysis phases to ensure owner attribution is covered.; refuted because: Rejected: the existing with_token helper is already the established phase-level mechanism; a local wrapper around the complete owner-attribution call is the smallest complete boundary change.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

…ten changelog wording (#1604)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FrVWuPEQjhYo674kxG7wdc

Copy link
Copy Markdown
Member Author

Review of record so far (head f28b98a; supersedes b46651e)

Two independent read-only reviewers inspected b46651e: (1) correctness and edge cases, (2) tests, regressions, spec and contract. Gemini and CodeRabbit were quota-limited, so they count as missing, not clean.

  • Correctness: no defects. A cancelled attribution yields empty owners, but the deadline check that follows uses the same clock, so it cannot be published as complete. Token scoping and restore on unwind are correct.
  • Tests/spec: no blocking findings. The token test exercises review_comments_with_admission and fails with the wrapper removed. No spec contradiction (RIPR-SPEC-0012 says cooperative cancellation does not complete perf(analysis): bound review-comments on large workspaces and always emit a typed timeout receipt #1604; this PR does not claim to close it).
  • Resolved in f28b98a: the changelog now says "honors the time budget (cooperatively)" instead of implying a guarantee; added review_comments_budget_spent_in_owner_attribution_records_timeout to pin the deadline-check guarantee (expiry during attribution gives a typed limited_timeout and no artifacts). That test guards existing behavior rather than the new wrapper; I did not run a negative control for it.
  • A correction to my first PR body: build_index does have per-file checkpoints; they were inert without a token, which is the bug. PR body updated.
  • The github-actions "Needs verification" review of b46651e raised the changelog overclaim and the missing expiry test; both are addressed above.

cargo xtask precommit passes on f28b98a. Waiting on the required CI result for this head before squash.


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 source comment says the token gives the index build an interior checkpoint to stop it, but the diff only installs a token around the complete attribution call; it does not make an already-running index build observe cancellation.
  • Confirm the added tests verify token presence and the post-attribution timeout publication path, but do not directly assert interruption of an already-running attribution operation.

Refuted

  • Installing the cancellation token necessarily interrupts an already-running owner-attribution index build.; refuted because: The changed code establishes phase-level token scope, not an interrupt mechanism. The PR body explicitly disclaims interior checkpoints, so the claim is false unless a separate index implementation detail is shown.
  • The changelog overclaims that owner attribution cannot spend the budget without an interior stop.; refuted because: The current wording says the index build honors the time budget cooperatively, while the PR body and code comments explicitly preserve only phase-boundary enforcement; the seeded thread records this earlier objection as corrected.
  • Installing the run token alone proves owner attribution is stopped at an interior checkpoint.; refuted because: The diff establishes token installation, while interruption semantics depend on the attribution implementation consulting the token; the PR wording intentionally limits the claim to cooperative behavior and the seeded thread resolved the earlier overstatement.
  • Wrapping only the attribution call introduces duplicated token scoping or leaks scope across phases.; refuted because: The wrapper owns a scoped phase boundary, follows the existing helper used by other analysis phases, and leaves the subsequent deadline check outside the scope where needed.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

Reply to the github-actions "Needs verification" review of f28b98a. No change needed.

  • The PR body no longer disclaims interior checkpoints; I corrected it after the correctness reviewer found them. build_index calls cancellation::checkpoint() per file and per parse batch (analysis/facts/build.rs, e.g. lines 229, 267, 289-307). Without a token checkpoint_typed returns Ok, so they were inert during attribution. The wrapper makes them live, which is what the diff changes.
  • Interruption is real, not just phase-level: an expiry inside the index build makes build_index return Err, the helper turns it into empty owners, and the deadline check that follows records limited_timeout. review_comments_budget_spent_in_owner_attribution_records_timeout pins that second half. It does not drive the real build_index mid-run; the closure bypasses it.
  • The source comment's "no interior checkpoint to stop it" means "no live checkpoint"; I'll tighten it if this PR takes another code push, but it is not worth restarting the ~33 minute CI for a comment.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Required CI on f28b98a is red, and it is not this PR's. All 21094 tests passed; the job then failed at cargo xtask goldens check, reporting formatting-only drift in 13 Python fixtures (for example python_conditional_foreign_callable_write): the current binary prints Next: lines from RIPR-SPEC-0319 (#9449) that the committed human-full.txt goldens lack. This PR touches no fixture or output code.

Fix of record is #10269 (re-blesses the 14 drifting fixtures; #10273 is a duplicate). No re-run is available to me without dispatching the routed workflow, which is not allowed on a PR branch. Once #10269 lands I will merge main into this branch and re-apply merge-ready.


Generated by Claude Code

@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

…2 traceability (#1604)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FrVWuPEQjhYo674kxG7wdc

Copy link
Copy Markdown
Member Author

Head is now 573fec5 (main merged in, then one repair).

  • Devin's traceability finding was correct: the two new tests were missing from RIPR-SPEC-0012. Added both to .ripr/traceability.toml; check-traceability, check-generated-clean, check-spec-format and check-fixture-contracts pass.
  • Devin's analysis note (the timeout test uses an injected closure, so it covers the deadline check, not real index interruption) is accurate and already stated in the test doc comment and my earlier comment; no change.
  • Review of record from the two independent reviewers (correctness; tests/spec/contract) on b46651e still stands: the only later changes are the changelog wording, the added test, this traceability registration and a merge of main (no overlap with this diff).

Waiting on the required result for 573fec5.


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 one verification check before upstream.

Verification questions

  • Confirm the new token test proves scope but not interruption inside a real index build.

Refuted

  • The diff causes an already-running owner-attribution index build to observe cancellation directly.; refuted because: The wrapper installs the token, but the added tests do not prove prompt interruption of a real index build; the conservative changelog wording and seeded-thread clarification avoid promising that stronger behavior.
  • The timeout test claims to prove real index cancellation.; refuted because: The test and seeded discussion explicitly scope it to the post-attribution deadline/publication path; it does not claim to interrupt a real index build.
  • The changelog overclaims that owner attribution honors the time budget.; refuted because: The wording says it honors the budget cooperatively, matching the established token/checkpoint mechanism rather than guaranteeing immediate interruption. The seeded thread records an earlier overclaim was corrected.

Parked follow-ups

  • The new tests prove token installation and timeout publication, but do not exercise an actual index build observing cancellation at an interior checkpoint.
  • Real index-build interruption is not directly tested by the added unit tests.
  • The changelog's cooperative-cancellation wording is materially accurate but stronger than the directly injected test proof.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven
EffortlessSteven merged commit a561a4e into main Oct 25, 2026
55 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/review-comments-cancel branch October 25, 2026 09:37
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