Repository navigation
skills(review-runs): read the evidence windows from a file, not the command's stdout - #1373
Conversation
tend-agent
left a comment
There was a problem hiding this comment.
The occurrence-counting recipe this adds matches lexically: grep both windows for a distinctive phrase. But each entry carries whichever wording its own session chose, so a prior occurrence described in other words goes uncounted — and Gate 1 then acts on an undercount, which is the failure mode the evidence store exists to prevent. review-gates.md's finding format gives every entry a ### heading, and those headings are a small enough index to read whole: on tracker #1125's current-month window, 380 KB of comment bodies carry 230 ### headings totalling 19 KB. Listing them first lets the match be on meaning rather than phrasing, with the phrase grep reserved for pulling out the entry behind each candidate. Suggestion inline; I'll push it.
Separately, the description cites list_recent_runs.py as one of three neighbouring steps that "already redirects to $TMPDIR". It doesn't — Step 1 runs it with no redirect and reads its JSON inline; the $TMPDIR file it produces (review-runs-since) is written by the script itself. token_report.py and outage-trackers are the two that redirect.
The rest checks out against the script: current_comments, previous_comments, tracking_number and month are the keys prepare-evidence emits, and github_cli.run captures every subordinate gh call, so nothing else reaches stdout to corrupt the redirected JSON.
Grepping the windows for this run's phrasing only matches entries whose author happened to choose the same words. Listing the `### ` headings review-gates.md's finding format guarantees gives a semantic index small enough to read whole, with the phrase grep left for pulling out the entry behind a candidate.
prepare-evidencereturns both months of the tracking issue in one JSON blob, and the skill tells the session to read it from the command's stdout. On an established tracker that blob is 600–700 KB — far past what a tool result carries — so what actually reaches context is a truncated preview plus a path to a persisted file. Every sweep since 2026-09-18 has hit this and independently improvised the same recovery: re-run the command redirected, thenjqthe two comment arrays out. This change makes the recipe do that up front, the way the two neighbouring steps that produce large output already do (token_report.pyandoutage-trackersboth redirect to$TMPDIR).The two extracted files are also how you count a finding's prior occurrences, which Gate 1 requires — but a grep for this run's phrasing only matches entries whose author happened to choose the same words, so the prose routes the count through the
###heading@review-gates.md's finding format gives every entry. Listing those headings is a semantic index small enough to read whole; the phrase grep pulls out the entry behind a candidate. This replaces the "prints both evidence windows" claim that has not been true of this repo's tracker for a month.Verified against this run's real output: the three
jqlines yieldtracker #1125 2026-09, a 363 KB current-month file and a 347 KB previous-month file, with 30## Runheadings across them. The current-month window alone carries 230###headings totalling 19 KB, so the index is ~5% of the text it indexes. All 13 pre-commit hooks pass.uv run pytestis 1214 passed, 2 failed — both thetest_refresh_consumers.pycases that need PyPI and fail in this sandbox by design.Prior observations are recorded on #1125.
Gate assessment and observation history
.claude/skills/review-reviewers/SKILL.mdcarries the same "prints both evidence windows" sentence, but its evidence lives in per-consumer gists that have not approached the limit, so it is left alone.