Repository navigation
feat(skill): countable restatement findings, stale records of a moment, /km sweep - #120
Merged
Merged
Conversation
pasrom
force-pushed
the
feat/review-findings-sweep
branch
from
December 3, 2026 06:48
9fe82fa to
64974dd
Compare
A review tags each restated value with the origin of its home, but the tags stayed in the chat of whoever ran the review. The review now ends with one fixed line, `restatements: firmware 2, datasheet 1` or `restatements: none`. The flows that already write to a pull request carry it: the PR body of `/km pr`, as a sum over the PR's reviews, and the body of a review of a PR someone else opened, which is posted on the user's OK as before. One read-only gh call sums the lines over a brain's pull requests; a smoke test runs its jq program on sample data. A review that never reaches a pull request is still not counted.
A dated record (a decision, minutes, a commissioning or measurement report) may quote the figures of its day. One that states such a fact in the present tense, while its home has since changed, reads as current and misleads. `/km review` now reports it as a non-blocking finding that asks for an update note with the date and a link to the home, the recorded text kept. It also does so for a record the review only meets among its search hits, as a finding on that record and none against the doc under review. Eval case review-stale-record: the home of a rating is under review, and an accepted commissioning report still gives the earlier rating.
A review sees the docs of one branch. Copies of a fact that nobody touched since its home, or the source behind the home, changed are seen by no review. `/km sweep [<topic>]` takes the hand-written Topic rows of the Ownership table, reads each home, finds every holder with `km search` (names, each value in its other spellings and units, and earlier values), and classes each one: agrees, disagrees, different condition, a record that is correct or marked, a record that is outdated and unmarked, or cannot tell, each with whether it links the home. It reports a table per topic with file and line and a suggested fix, and changes nothing; fixes go through the PR flow on the user's OK. No new subcommand: the sweep is a reference file the core dispatches to. The core stays under its size limit by tightening a few sentences. Eval case sweep: a home, a linked copy, an unlinked copy in another unit and a dated report with the earlier value.
`folds-the-fix` was an llm grader on the trace. The judge is handed a long trace with its middle cut out, and in this case the fold's commands sit in that middle, behind the Read of the review reference: it voted on what was left, and failed runs whose reply shows the fold, the lease and the folded sha. It now judges the reply. `runs-the-fold`, a regex on the whole trace anchored to a Bash call's input, checks that a rebase, an amend or a soft reset ran.
pasrom
force-pushed
the
feat/review-findings-sweep
branch
from
December 3, 2026 07:16
64974dd to
cb2fd67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes to the skill, one commit each, and a fourth commit that repairs an eval grader. No new CLI subcommand, no version bump.
1. Restatement findings that can be counted
/km reviewtags each restated value with the origin of its home ((origin: firmware|datasheet|...)), "so restatements can be counted by origin". Nothing counted them: a review runs locally and its findings stay in the chat.restatements: firmware 2, datasheet 1, orrestatements: none./km prstep 6 puts it into the PR body next toLast reviewed:, as the sum over the PR's reviews (found, fixed since or not; a later review adds and never takes away). A review of a PR someone else opened ends itsbodywith the line for the findings it posts.gh pr list ... --jqcall in review-and-pr.md sums the lines over a brain's pull requests. Per PR and origin it takes the larger of the body's count and the sum of its reviews' lines: author and reviewer mostly find the same restatements, so adding both would count them twice, and a body that saysnonedoes not hide a reviewer's count. It reads through case, markup and spacing, and prints what it cannot read asnot parsedwith the PR number.restatements: noneincluded.Why this place: the PR body and the review body are the only durable, shared places the review flow writes to today, and both writes already exist. Nothing new is posted and no confirmation rule changes: the foreign-PR review is still shown in full and posted only on the user's OK. A file in the brain was the alternative; it would add a commit to every review and a merge conflict to every second PR.
Why no helper command: the count is one
ghcall with a jq program, and it needs no state of km's.skill_smoke.shextracts the program from the reference file and runs it on sample data (body against reviews, a body'snonebeside a reviewer's count, CRLF, markup, case, a comma without a space, an unknown origin, a missing number, an empty list), so the line format and the counter cannot drift apart unnoticed. Run against the base commit, those checks fail.Limit: a review that never reaches a pull request is still not counted. The reference says so.
2. Stale records of a moment
A decision, minutes or a commissioning report may quote the figures of its day; that stays. New, under "link, don't restate": a record that states a fact as current (present tense) which its home now states differently is a non-blocking finding that asks to mark it, an update note at that line with the date and a link to the home, the recorded text kept. A differing figure the record tells as past or as of its date is no finding, nor is a record that already carries a note. The same holds for a record the review only meets among its search hits: the finding names that record and is none against the doc under review; it is reported, and the note is left to a branch of its own, since the record is no doc of the PR. Step 4 lists it under "not blocking but always reported".
3.
/km sweep [<topic>]A read-only drift sweep over the hand-written Topic table of
## Ownership: newskills/km/reference/sweep.md, one dispatch row, one line in the README's command list. Per topic it reads the home (into a mount or the outside source where readable, else "not compared"), finds every holder withkm search(names, each value in its other spellings and units, earlier values), classes each holder (agrees, disagrees, different condition, record correct or marked, record outdated and unmarked, cannot tell) with whether it links the home, and reports one table per topic with file:line and a suggested fix. It changes nothing; fixes are offered afterwards and go through/km prorbrain fixon the user's OK.SKILL.md was at 11992 of 12000 bytes. The row and five words in the description fit after tightening six phrases in the mounted-brain and query-to-wiki sections; it is at 11986 bytes. No rule was dropped.
Tests
All 21 smoke suites pass locally (
skill_smoke9/0 with the four counter checks).Evals
claude plugin eval . --scaffold --no-publish --ablation none --allow-tools Bash Write Edit, three runs per case.Full suite (the core and the dispatch table changed), 25 cases, run once on the first version of this branch: 23 cases at 1.00, overall 0.99. After the review fixes the three affected cases ran again on the final head.
sweep(new)review-stale-record(new)asks-to-mark-the-recordfails in two of three runs there)review-restated-valuecounts-the-restatementsnow needs a count above zero on the reply's last linereview-doc,review-ownership-tablebrains-list-removestages-conventionson a 2:1 judge vote; brains.md is unchangedpr-review-commentspr-review-comments:folds-the-fixwas anllmgrader on the trace and failed three of six runs here, none of three on the base commit. The stored evidence of that grader is the trace cut to 100 kB with its middle elided, and the fold's commands are in the elided part; the review of this PR found one failing run that was demonstrably correct. The fourth commit makesfolds-the-fixjudge the reply and addsruns-the-fold, a regex on the whole trace anchored to a Bash call's input (rebase, amend or soft reset). With both, three of three runs pass.Cost of all eval runs for this PR, comparison runs on the base commit included: about 41 USD.
New cases:
sweep:sweep_braininevals/lib/brain.sh(an Ownership row, its home with the current rating and the earlier one with the date of the change, a copy that links the home, a copy in mA without a link, a commissioning report with the earlier rating in the present tense). Graders: reads sweep.md and CONVENTIONS.md, runskm search, names the report and the mA copy with their lines, classes the report as outdated and to be marked (not rewritten) and the mA copy as agreeing but unlinked, changes nothing (trace judge, and the report's line as the fixture wrote it).review-stale-record: the same brain with the home in review; the review must name the report's line, ask to mark it without blocking the home, tag the origin and end with therestatements:line.review-restated-valuegets thecounts-the-restatementsgrader: the reply's last line is arestatements:line with a count above zero (nonewould be a wrong answer there).Left open
sweepfixture's mA copy is also found by the item's name.gh(no line found, empty output, exit 0)./simplifyand/code-reviewwere not run by the author of this branch; a separate review follows.