The design note's share is the page's, not one constant - #313
Conversation
`ND_NOTE_BYTES` was sized for a three-row page, so the one-row caller — the tool's default, and the only page a ruling reads — paid for two rows it did not ask for out of the one field it cannot reconstruct. The share is now derived from the budget and the page requested: 12,672 bytes at `limit: 1`, 2,912 at 3. `next_close_candidate` carried the same shape and measures worse, so its two prose fields get the same treatment, splitting the share evenly. `next_ready` was measured and does not share the defect. `next_leak`'s population is currently empty and could not be measured; both are unchanged. Closes #311 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 57 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. WalkthroughThe PR adds page-aware prose budgets for close-candidate and design queues. It separates row construction from fetching, adds budget and clipping tests, updates truncation guidance, and increments the ChangesQueue pagination and truncation
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change makes note capacity depend on the requested page size and updates the affected tools while preserving the overall result budget; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Reviewer
participant next_close_candidate
participant next_design
participant RowBuilders
participant ContextTools
Reviewer->>next_close_candidate: request page with limit
next_close_candidate->>RowBuilders: build bounded close-candidate rows
RowBuilders-->>Reviewer: return rows with truncation indicators
Reviewer->>next_design: request page with limit
next_design->>RowBuilders: build bounded design rows
RowBuilders-->>Reviewer: return rows with truncation indicators
Reviewer->>ContextTools: request complete prose when truncated
ContextTools-->>Reviewer: return expanded context
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
… moves with the protocol `command_contract` learned the dispatcher/agent split in #322, so the five `marketplace_tests` this branch was red on now pass: 1404 green with these plugin files on that contract. Three conflicts, all the same shape: #313 edited command bodies this branch replaces with dispatchers. Resolved to the dispatcher — but taking it alone would have DROPPED #313, because `agents/*.md` were forked from the command bodies before #313 landed and carry the truncation mention without the escape it added. So the escape is ported to where the protocol now lives: - `agents/ncc.md` — `flag.reason` / `verdict.note` share is the PAGE's, re-ask step 1 at `limit: 1` - `agents/ndd.md` — same for `question.note` `agents/nr.md` needed nothing: #313 measured `next_ready` over 297 samples, none within 1,600 bytes of the cap, and left it alone. `plugin.json` took this branch's description, which is the same text plus the sentence explaining why the four reads dispatch. Also deleted the `Landing note (#316)` block from the plugin README. It said `command_contract` does not yet know this shape; #322 merged, so it is false. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The version gate asks for a bump PAST main, not a bump from the branch's own base. This branch raised 0.24.0 -> 0.25.0 while #313 landed 0.25.0, so after the merge the plugin files change with no version movement and the gate is right to refuse. Marketplace listing moves with it — a separate check holds the two equal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Closes #311
The clip was sized for a page nobody asks for
ND_NOTE_BYTESwas one constant for every page size, so it had to fit threerows — and
next_design's default page is ONE. The one-row caller paid for tworows it did not ask for, out of the single field it cannot reconstruct.
The note's share is now derived from the budget and the page actually requested:
limitquestion.noteMCP_MAX_RESULT_BYTESis unchanged at 36,000. Nothing was taken from anotherfield: the whole raise is the rows the caller did not ask for. The compile-time
guarantee now holds for EVERY admitted page size rather than only the widest,
and a floor beneath it fails the build if a field added to the row eats the
note's share instead.
3,200 does not compile
The issue's suggestion cannot be a constant. Under the old shape, three rows
times two-for-JSON-escaping left 1,872 bytes of headroom — 312 raw note bytes.
The largest flat value that builds is 2,912, which still clips the 3,046 case,
and it spends the last byte of slack to get there. That is what makes this a
shape problem rather than a number problem.
Measured populations
Org-wide (
rainlanguage cyclofinance S01-Issuer), trusted author only, applyingeach tool's own predicate to comment bodies. Corpus: the 216 open producer PRs
plus the 500 most recently updated closed ones.
next_designquestion.notenext_readyverdict.notenext_close_candidateflag.reasonnext_close_candidateverdict.notenext_leakhas.producerNoteThe seven
/nddrulings the issue names reproduce inside the design row — 989,1133, 1450, 2335, 2622, 2629, 3046.
next_readydoes not share the defect. 297 ready verdicts, none within1,600 bytes of its cap. Left alone.
next_close_candidatehas it worse. A third of its verdict notes clip, andits two prose fields are the pair a ruling turns on — the flag's claim and the
vetter's check of that claim — so a page carrying one whole and cutting the
other answers half the question. Same treatment, the two fields splitting the
share evenly: 6,152 each at
limit: 1, 2,492 at 2, 1,272 at 3.next_leakcould not be measured. The live dashboard readsleaks: 0, soits population is empty and there is nothing to check the cap against. A proxy —
the newest trusted producer note on each open producer PR, which is the text
leak_reasonreturns — puts 18 of 109 past 2,000 with a 5,006 maximum, but aleak note is drawn from a narrower slice of that text than the proxy is, so it
is a reason to re-measure when the queue is non-empty rather than a reason to
change the cap now.
NL_NOTE_BYTESis untouched.The close-candidate figures are a FLOOR. They come from an
in:commentssearchwhose index demonstrably lags — it missed design questions I could read directly
off the PRs — so the real over-cap rate is at least the one above.
Escape
A clipped note now has a cheaper escape than
pr_context: ask for a narrowerpage. Both tool descriptions and both skills say so.
QA
Discriminating tests:
a_narrower_page_carries_a_longer_question,a_narrower_page_carries_a_longer_claim(both go throughnext_design_rows/next_close_candidate_rows, so the wiring fromlimitto the clip is whatthey hold, not a hand-passed byte count);
every_admitted_page_size_keeps_its_note_share,every_admitted_page_size_keeps_its_prose_share(each page's share fits thebudget AND is the whole of what the page leaves — one byte more is over);
a_page_size_the_limit_refuses_never_reaches_an_unbounded_share(×2);a_maximal_page_of_adversarial_rows_still_fits_the_budget(×2) now loops overevery admitted page size instead of only the widest. Each fails on base
behavior: base clips at one constant for every page, so the claim that a
limit: 1call carries a note the widest page cuts cannot hold there — M1/M6re-create exactly that constant inside the new shape and kill the tests.
Mutations applied:
nd_note_bytes→ the old flat constant →a_narrower_page_carries_a_longer_questionFAILSnext_design_rowspassesNEXT_DESIGN_MAX_ROWSinstead oflimit→ same test FAILSnd_note_bytesdivides byNEXT_DESIGN_MAX_ROWSinstead ofrows→every_admitted_page_size_keeps_its_note_shareFAILSnd_note_rowsupper clamp dropped →a_page_size_the_limit_refuses_never_reaches_an_unbounded_shareFAILSnext_design_row's noteclip_fieldremoved →a_maximal_page_of_adversarial_rows_still_fits_the_budgetFAILSncc_prose_bytes→ the old flat constant →a_narrower_page_carries_a_longer_claimFAILSnext_close_candidate_rowspassesNEXT_CC_MAX_ROWSinstead oflimit→ same test FAILSncc_prose_bytesdivides byNEXT_CC_MAX_ROWSinstead ofrows→every_admitted_page_size_keeps_its_prose_shareFAILSM3 SURVIVED the first pass — it undersizes the narrow page without breaking
the budget, and "the share fits" is a claim a smaller divisor also satisfies.
The maximality half of both page-size tests was added to kill it, and M8 is
the same mutant on the sibling.
Oracle: the byte figures come from GitHub comment bodies read org-wide and
measured with each tool's own predicate, never from the constants being
changed. The derived caps come from
MCP_MAX_RESULT_BYTESminus every othercapped field, which the compile-time assertion and the adversarial page test
check independently of the arithmetic that produced them.
Category check: the issue asks for the design clip raised and the three
siblings checked against their own populations. All four measured; the two
that showed the defect changed,
next_readycleared on 297 samples, andnext_leakreported as unmeasurable rather than guessed at.Summary by CodeRabbit
New Features
Bug Fixes
Documentation