Skip to content

feat(sweep): earlier values from the home's source, shared resources in km search coverage - #121

Open
pasrom wants to merge 3 commits into
mainfrom
feat/sweep-source-history
Open

pasrom wants to merge 3 commits into
mainfrom
feat/sweep-source-history

Conversation

@pasrom

@pasrom pasrom commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Lessons from a real sweep run on a large brain, generalised.

km search

  • Shared resources in the coverage. A brain whose mounts all sit outside brains/ printed one coverage line, for itself, and nothing about repositories it could not read. Every gitlink of .gitmodules outside brains/ (plain names only, like mounts) now gets a line: resource checked out, not searched by km search (read it directly), or resource NOT SEARCHED (not checked out; run km sync) / (left out here: ...). The latter is a coverage gap (exit 3), since such a resource cannot be read directly either. A checked-out resource is no gap: km search never searched resources, so a brain with checked-out resources keeps its exit code. Resources are in scope with the brain itself (--brain <mount> leaves them out). --json gets a resources list.
  • --all-lines: every matching line of a doc or pull request, not the first three, so a holder's file:line per fact needs no second grep.
  • Smoke cases for both (they fail on main).

Skill

sweep.md: earlier values also from the history of the source the home names (git log -p / -S<key> in a mount, resource or local clone) and the statements built on them; a row split into fact groups, with rows and groups left named in the report; names first, short values only beside the item's name; --all-lines; unsearched mounts reported, never skipped; a PR file read at its head via gh api .../contents/<path>?ref=<headRefOid> (no PR refs fetched); the home read at the brain's pin and a linked branch that differs from it reported; home facts limited to the row's topic; generated _index.md and name-only mentions are no holders; a figure labelled as of its date or as a target ("the spec target", "the set of ", "as offered") is a correct record, also in an artifact; "home incomplete" when holders state a condition the home lacks; a present-tense note with only a frontmatter date is undated; related: is no link and frontmatter must not count as one; the reads named in the read-only claim.

review-and-pr.md: a mount km search reports NOT SEARCHED is named in the review; the artifact rule takes the labelled-figure exception, so it agrees with the sweep. brains.md, github-reads.md: the resource coverage line.

Evals

The sweep fixture (sweep_source_brain, the shared sweep_brain unchanged) mounts a parameter file whose history changed a delay before the home was written with the new value only; an undated note builds its own delay on the old value, and an artifact gives the old one labelled "as offered". New graders: names-the-source-drift (regex), traces-the-source-history, keeps-the-labelled-offer (llm).

After review fixes (head after fold), 3 runs each, --ablation none:

Case Score Cost
sweep 0.97 (keeps-the-labelled-offer failed in one run: the offer was left out of the reply) $1.23
sweep on main's skill (the new eval files copied in) 0.85 $1.29
review-stale-record 1.00 $1.15
review-restated-value 1.00 $1.16
review-doc 1.00 $1.03
review-ownership-table 0.93 (reads-conventions: one run read CONVENTIONS.md without the Read tool) $1.11
pr 1.00 $1.79
pr-review-comments 1.00 $1.94
lookup-all-brains 1.00 $0.46
lookup-question 1.00 $0.45
brains-list-remove 1.00 $1.00

New sweep graders, this branch vs main's skill (3 runs each): keeps-the-labelled-offer 2/3 vs 0/3, traces-the-source-history (now requires the change date, which only the resource's history holds) 3/3 vs 2/3, reads-the-source-history (a git log on the resource in the trace) 3/3 vs 2/3, names-the-source-drift (file:line with a stale class) 3/3 vs 3/3. A first round with an invalid grader regex (JS has no inline (?i)) is not counted ($1.27).

All tests/*_smoke.sh pass. The new search cases were mutation-checked: removing the left-out branch for resources, keeping pull request lines at three under --all-lines, dropping the gitlink check and dropping the plain-name filter each fail a case.

…hecked out

A brain whose mounts all sit outside brains/ got one coverage line, for
itself, and said nothing about the repositories it could not read. Each
gitlink of .gitmodules outside brains/ now gets a coverage line: checked
out, not searched (read it directly); not checked out or left out here,
NOT SEARCHED and a coverage gap, exit 3. They are in scope with the brain
itself. --all-lines prints every matching line of a file, so a caller
that needs each line of a holder does not grep again.
…, labelled records

The sweep took earlier values only from the home's text and history, so a
copy of a value the source behind the home changed read as agreeing or as
another condition. It now reads the source's history too and searches the
statements built on an earlier value. Also: a row split into fact groups,
names before short values, every line of a hit, a PR file read at its
head through the API, the home read at the brain's pin, home facts limited
to the row's topic, no holders in generated listings or name-only
mentions, a labelled figure in a record or artifact as correct, a home
that lacks a condition its holders state, undated notes, the link check
without related:, the reads named, and a mount km search could not read
reported in the sweep and the review.
@pasrom
pasrom force-pushed the feat/sweep-source-history branch from a5b1a09 to a1585a5 Compare December 3, 2026 11:21
…anged

The sweep fixture mounts a parameter file whose history changed a delay
before the home was written with the new one only. An undated note builds
its own delay on the old value, and a dated offer gives it labelled as
offered: the first must be found and traced to the source's history, the
second kept as a correct record.
@pasrom
pasrom force-pushed the feat/sweep-source-history branch from a1585a5 to 9b5a519 Compare December 3, 2026 11:25
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