fix(index-append): stop losing the conclusion on numbered lists — and never miss silently - #1
Merged
Merged
Conversation
… never miss silently The knowledge-index extractor assumed the "What was closed" section opened with a `- ` bullet. A numbered list (`1. …`) matched nothing, so the entry was indexed with an empty conclusion — while the close still succeeded and the log still printed "knowledge index appended". The failure was invisible. Observed in a real ledger, not hypothetically: 3 of 11 entries were empty, all three from the same cause, and the two most recent closes were consecutive misses — i.e. the newer writing style was silently draining the index. - take the section's first substantive line and strip only the list marker (`-`/`*`/`+`, `1.`, `1)`); `**1. …**` is content and is kept verbatim - warn loudly next to the success line when extraction yields nothing, so a miss is visible at close time. Still best-effort: it never blocks the close. - regression tests for each list style + the loud-miss path. Verified they fail against the old extractor (4 of 7 assertions), so the tests actually bite. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What broke
The knowledge-index extractor assumed the
## What was closedsection opened with a-bullet:A numbered list (
1. …) matched nothing → the entry was indexed with an empty conclusion.But the close still succeeded and the log still printed
📚 knowledge index appended.The failure was invisible, which is the part that matters.
Not hypothetical
Found while auditing a real ledger: 3 of 11 entries had an empty conclusion, all three from
this same cause, and the two most recent closes were consecutive misses — the newer
writing style was quietly draining the index one close at a time.
The fix
-/*/+,1.,1)).**1. …**is content, so it is kept verbatim.it never blocks the close (asserted).
Tests
Seven assertions in
tests/test_gates.sh: bullet / numbered / paren-numbered / bold-numbered /leading blockquote / loud-miss / never-blocks.
Manipulation check — reverted
bin/index-appendto the old version and re-ran: 4 of the 7 fail(numbered, paren-numbered, bold-numbered, loud-miss); the other 3 are backward-compat and pass on both.
The tests bite the actual defect rather than restating the new code.
🤖 Generated with Claude Code