Skip to content

feat(skill): countable restatement findings, stale records of a moment, /km sweep - #120

Merged
pasrom merged 4 commits into
mainfrom
feat/review-findings-sweep
Dec 3, 2026
Merged

pasrom merged 4 commits into
mainfrom
feat/review-findings-sweep

Conversation

@pasrom

@pasrom pasrom commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

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 review tags 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.

  • The review now ends with one fixed line: restatements: firmware 2, datasheet 1, or restatements: none.
  • The two flows that already write to a pull request carry it. /km pr step 6 puts it into the PR body next to Last 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 its body with the line for the findings it posts.
  • One read-only gh pr list ... --jq call 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 says none does not hide a reviewer's count. It reads through case, markup and spacing, and prints what it cannot read as not parsed with the PR number.
  • The PR-body line is written whatever the label, restatements: none included.

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 gh call with a jq program, and it needs no state of km's. skill_smoke.sh extracts the program from the reference file and runs it on sample data (body against reviews, a body's none beside 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: new skills/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 with km 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 pr or brain fix on 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_smoke 9/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.

Case Score Note
sweep (new) 1.00 without the plugin 0.33
review-stale-record (new) 1.00, final head 1.00 without the plugin 0.17; with the skill of the base commit 0.72 (asks-to-mark-the-record fails in two of three runs there)
review-restated-value 1.00, final head 1.00 counts-the-restatements now needs a count above zero on the reply's last line
review-doc, review-ownership-table 1.00
brains-list-remove 0.92 one run fails stages-conventions on a 2:1 judge vote; brains.md is unchanged
pr-review-comments 0.83 and 0.92 with the old grader, final head 1.00 see below
the other 18 cases 1.00

pr-review-comments: folds-the-fix was an llm grader 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 makes folds-the-fix judge the reply and adds runs-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_brain in evals/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, runs km 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 the restatements: line.
  • review-restated-value gets the counts-the-restatements grader: the reply's last line is a restatements: line with a count above zero (none would be a wrong answer there).

Left open

  • No eval shows the search for other spellings of a value on its own: the sweep fixture's mA copy is also found by the item's name.
  • The evals do not cover the PR-body line or the counter against a live repository: nothing is posted in an eval. The counter ran once against this repository through gh (no line found, empty output, exit 0).
  • /simplify and /code-review were not run by the author of this branch; a separate review follows.

@pasrom
pasrom force-pushed the feat/review-findings-sweep branch from 9fe82fa to 64974dd Compare December 3, 2026 06:48
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
pasrom force-pushed the feat/review-findings-sweep branch from 64974dd to cb2fd67 Compare December 3, 2026 07:16
@pasrom
pasrom merged commit d7621e1 into main Dec 3, 2026
5 checks passed
@pasrom
pasrom deleted the feat/review-findings-sweep branch December 3, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant