Skip to content

Stop coverage patterns and path anchors from reading as stale - #35

Merged
kylebegeman merged 3 commits into
masterfrom
stale-patterns
Sep 20, 2026
Merged

kylebegeman merged 3 commits into
masterfrom
stale-patterns

Conversation

@kylebegeman

Copy link
Copy Markdown
Owner

Summary

ledger stale reported drift that records did not have, which surfaced while triaging Kore's stale report for its handoff. Kore showed 169 signals, 156 of them stale symbols. Every one of the sampled symbols exists in the tree, in the directories its receipt names.

Two causes, one receipt each.

  • 0193, coverage patterns were dropped. A record that lists src/** alongside a couple of exact files had its symbols and anchors checked against only those exact files, so anything living under the pattern looked missing. Patterns now become :(glob) pathspecs searched with git grep for whatever the exact files did not account for. When the search cannot run, because Git is missing or a pathspec is unusable, the pattern reports nothing rather than guessing.
  • 0194, directory headings and path anchors. A Changed Files heading that names a directory path now matches the record's files under it, and an anchor that names a path the tree still holds is treated as a reference to that file rather than as content to find inside another. A heading candidate without a separator stays prose, so a block titled "Tests, skill, and docs" does not claim every file under docs/.

Effect

Repository Before After
Kore, 12,004 tracked files 169 14
This repository 0 0

Of Kore's remaining 14, six are capture artifacts in its own Anchor lines and eight are candidates for real drift.

Cost

The search runs once per record and block file list, and only for records that name patterns. ledger stale and ledger doctor take about 15 seconds on Kore's tree against 0.4 seconds here. A single pass over the union of every record's patterns would cut that further; memoizing and batching a record's blocks only saved about a tenth, because each record's pattern set is its own.

Verification

  • npm run ci exit 0: 61 test files, 494 tests, Ledger CI passed.
  • New cases: a receipt listing src/** reports nothing without Git and only the absent symbol and anchor with Git; a block headed internal/composer, CHANGELOG.md keeps the directory's test name and a real doc path clean while a missing doc path still reports.
  • Measured against Kore read-only at fe1e66e8; nothing was written there.

🤖 Generated with Claude Code

Kyle Begeman and others added 3 commits September 19, 2026 22:09
ledger stale dropped every coverage pattern from a record's file references and
checked its symbols and anchors against whatever exact files remained, so a
symbol living under src/** looked like drift. Patterns now become :(glob)
pathspecs searched with git grep for the candidates the exact files did not
account for, and a pattern that cannot be searched reports nothing rather than
guessing. In Kore this takes the stale report from 169 signals to 25, with
stale symbols falling from 156 to 2. Receipt 0193.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A Changed Files heading that names a directory path now matches the record's
files under it, so its anchors are checked against them, while a prose heading
word without a separator stays prose. An anchor that names a path the tree
still holds is a reference to that file rather than content to find inside
another. Kore's stale report falls from 25 signals to 14 and this repository
stays at 0. Receipt 0194.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Bumps the package to 0.9.4 and writes the release record over receipts 0192
through 0195, with Public Notes covering the stale fixes: coverage patterns are
searched rather than dropped, a directory heading covers the files under it,
and an anchor naming a path in the tree is a reference. The handoff records the
prepared release, the cost of the new search on a large tree, and that Kore's
own session owns moving its pin and clearing the signals that remain there.
Receipt 0195.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kylebegeman

Copy link
Copy Markdown
Owner Author

Release preparation added: version 0.9.4, the release record over receipts 0192 through 0195, and a handoff update. npm run ci is green at 494 tests, and ledger unreleased is empty. Publishing waits on Kyle: merge, then git tag v0.9.4 && git push origin v0.9.4.

@kylebegeman
kylebegeman merged commit 103709b into master Sep 20, 2026
6 of 7 checks passed
kylebegeman pushed a commit that referenced this pull request Sep 20, 2026
The handoff described 0.9.4 as prepared on a branch, which stopped being true
when #35 merged. It now names the state, the tag command, and the README pin
move that has to land with it. Receipt 0195.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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