Skip to content

Findings log: record every returned result in .unwritten/findings.log - #24

Merged
Byggarepop merged 1 commit into
mainfrom
findings-log
Jul 13, 2026
Merged

Findings log: record every returned result in .unwritten/findings.log#24
Byggarepop merged 1 commit into
mainfrom
findings-log

Conversation

@Byggarepop

Copy link
Copy Markdown
Owner

What

Every findings result the tool hands to a consumer is now logged to .unwritten/findings.log:

  • MCPcheck_holes logs the exact result object it serializes for the model.
  • CLIunwritten check logs the structured findings (checked files, thresholds, holes, member holes with locations, suppressed holes, fail status), including the no-holes case.
  • Stop hook — goes through CheckCommand.Run with logSource: stop-hook so its entries are distinguishable.

Entries are pretty-printed JSON with timestamp, source, and result.

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 IndexStore since the MCP server and a hook can log concurrently.

Design notes

  • Logging is best-effort: all I/O errors are swallowed — a broken log must never fail a check, and on the MCP path stdout is protocol so there is nowhere safe to report.
  • .unwritten/ already self-gitignores, so the log never appears in git status.
  • index.json deliberately 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 in IndexStore now records that decision.

Tests

Four new tests in FindingsLogTests.cs (entry format, self-gitignore, cap trimming, I/O-failure swallowing). Full suite: 142 passing.

…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.
@Byggarepop
Byggarepop merged commit 2e58b6e into main Jul 13, 2026
1 check passed
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