Skip to content

fix(review-runs): size the combined evidence body, not the existing comment - #945

Merged
max-sixty merged 2 commits into
mainfrom
hourly/review-31476466100
Aug 11, 2026
Merged

max-sixty merged 2 commits into
mainfrom
hourly/review-31476466100

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

review-runs appends each leg's findings to a single evidence comment on the monthly tracking issue, and guards the 65,536-character comment limit by checking the size of the comment before appending (review-runs/SKILL.md#L111-L112 — EXISTING_SIZE=$(wc -c < /tmp/existing.md), -lt 50000). That threshold implies a maximum append of 15,536 characters. Appends are larger than that.

Measured on max-sixty/cargo-affected's tracking issue #73, splitting both evidence comments on their ## Run headings (character counts, not bytes):

Comment Appends Largest Final size
5150650688 (Aug 1–7) 4,570 / 3,980 / 7,985 / 8,661 / 8,202 / 9,215 / 14,559 14,559 57,172
5225265385 (Aug 8–11) 11,481 / 12,938 / 16,947 / 14,467 16,947 55,833

The Aug 10 append (run 31369370104) was 16,947 characters — 1,411 more than the headroom the guard leaves. Had it landed on a comment sized in [48,590, 50,000), the guard would have taken the append branch and the PATCH would have exceeded 65,536. Appends have also grown steadily: ~4 KB on Aug 1, 12–17 KB since Aug 8. max-sixty/tend's own tracking issue #801 shows the same distribution (largest append 14,695).

The failure mode is invisible. gh api ... -X PATCH returns 422 on an over-length body, the recipe has no fallback branch, and the surrounding step is not set -e — so the leg's findings are dropped and the run still reports success. The next leg then reads a log missing its predecessor and counts occurrences against incomplete history.

The fix sizes the body it is about to POST rather than a proxy for it, which removes the assumption entirely: build /tmp/combined.md first, branch on its size, spill to a new comment when it wouldn't fit. wc -c counts bytes and bytes ≥ characters in UTF-8, so 60,000 is a conservative bound under the 65,536-character limit with room for the multi-byte overhead these bodies carry (~0.6%).

No behavior changes when the append fits, which is the common case; the spill branch it already had is simply reached on the correct condition.

Gate assessment
  • Evidence level: structural, not stochastic — the guard's arithmetic is fixed, so whether it overflows depends only on sizes, and the premise (append < 15,536) is falsified by measurement rather than inferred from behavior. Occurrences of a realized overflow: 0 — all 11 daily legs of August are present in the log on both repos, so no evidence has been lost yet. Occurrences of an append exceeding the guard's headroom: 1 of 11 on the target this month, with 5 more within 1 KB of it.
  • Gate 1: this is below the table's bar read literally (a plausible problem seen once is Medium, needing 5+). Filing anyway because the finding is a provable defect in shipped recipe text rather than a judgment call about model behavior, and because the first realized occurrence costs a silently lost day of evidence. Close it as premature if you'd rather wait for the overflow.
  • Gate 2: targeted fix — 7 lines changed in one recipe, strictly more accurate than the check it replaces, no new guidance or structure.
  • Distinct from #883 (append target selected with | last) and #938 (window anchor), which touch the same recipe but not the size check.

Window analyzed: 2026-08-11T08:11:35Z → 09:11:35Z on max-sixty/cargo-affected, run 31476466100. Evidence log: https://gist.github.com/dca23a6e6a0d8cae2665944ba31676fb

…omment

The append guard checked the existing comment against 50000, implying a
maximum append of 15536 characters. Measured appends on the target's
tracking issue reach 16947, so the guard could take the append branch on
a body that overflows GitHub's 65536-character limit; the PATCH has no
fallback, so a 422 drops the leg's findings while the run reports
success. Build the combined body first and branch on its size.
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label Aug 11, 2026

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The logic change is right: combined.md is exactly the body that gets PATCHed, so branching on its own size removes the implicit maximum-append assumption rather than re-tuning it, and wc -c on bytes is a safe over-estimate of the character limit. Two notes, neither blocking.

The comment carries the history of the check it replaces. CLAUDE.md's skill-authoring rules ask to "cut motivation, anecdotes, and historical context unless required to apply the rule" and to date-stamp values expected to drift — once the recipe sizes the combined body, that it used to size the existing comment, and that appends have been measured at 16 KB, aren't needed to apply it, and the 16 KB figure will age. What is missing from the recipe is why the bound is 60000 rather than 65536: the bytes-vs-characters reasoning lives only in the PR description. Inline suggestion swaps one for the other.

The spill and create-new branches still -F body=@/tmp/findings.md with no size check, which is the same silent-422 shape for a single leg's findings — remote today at a ~17 KB measured maximum, but it's the residual half of the failure mode this PR names. Worth leaving alone until findings grow, rather than adding a second threshold now.

@max-sixty
max-sixty merged commit 33826a1 into main Aug 11, 2026
9 checks passed
@max-sixty
max-sixty deleted the hourly/review-31476466100 branch August 11, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants