Findings log: record every returned result in .unwritten/findings.log - #24
Merged
Conversation
…findings.log Every check_holes (MCP), check (CLI), and Stop-hook run now appends a pretty-printed JSON entry — timestamp, source, structured findings — to .unwritten/findings.log. The file is capped at 1 MB: once exceeded, the oldest whole entries are trimmed down to 512 KB. Logging is best-effort by design; an I/O failure can never fail a check. IndexStore gains a comment spelling out why index.json stays compact: it is machine state reloaded on every CLI/hook invocation, and on large repos indentation would add ~60% to a multi-MB parse per commit.
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
Every findings result the tool hands to a consumer is now logged to
.unwritten/findings.log:check_holeslogs the exact result object it serializes for the model.unwritten checklogs the structured findings (checked files, thresholds, holes, member holes with locations, suppressed holes, fail status), including the no-holes case.CheckCommand.RunwithlogSource: stop-hookso its entries are distinguishable.Entries are pretty-printed JSON with
timestamp,source, andresult.Size cap
The log is capped at 1 MB. Once exceeded, the oldest whole entries are trimmed down to 512 KB (trim points are entry boundaries, so pretty-printed entries are never split). The trim rewrite uses the same unique-temp-then-move pattern as
IndexStoresince the MCP server and a hook can log concurrently.Design notes
.unwritten/already self-gitignores, so the log never appears ingit status.index.jsondeliberately stays compact — it is machine state reloaded on every CLI/hook invocation, and on large repos indentation would add ~60% to a multi-MB parse per commit. A comment inIndexStorenow records that decision.Tests
Four new tests in
FindingsLogTests.cs(entry format, self-gitignore, cap trimming, I/O-failure swallowing). Full suite: 142 passing.