Skip to content

Demote per-file directive skip logs to DEBUG (M13.5)#15

Merged
mfwolffe merged 2 commits into
trunkfrom
fix/m13-5-show-cache-quiet
May 3, 2026
Merged

Demote per-file directive skip logs to DEBUG (M13.5)#15
mfwolffe merged 2 commits into
trunkfrom
fix/m13-5-show-cache-quiet

Conversation

@espadonne
Copy link
Copy Markdown
Contributor

Summary

Audit 13 M13.5: `dlm show` on a 2,021-file source-directive document
emits 243 `directive: ... exceeds max_bytes_per_file=...; skipping`
lines to stderr — once per oversize file, every invocation. The
audit explicitly flagged this as a 1-2s/call hit + log noise.

This change demotes all per-file skip logs in `directives/expand.py`
from INFO to DEBUG:

  • size-cap (`exceeds max_bytes_per_file`)
  • max_files truncation
  • binary file (NUL in first KiB)
  • image / audio without blob_store
  • audio without transcript

WARNING-level logs for genuine read/stat/UTF-8 failures stay loud —
those indicate something the user might want to fix. The summary
count is still surfaced via `provenance.skipped_*` (and via the
trainer's `directives: expanded N file(s) across M source(s)` line).

A separate caching layer for the expansion result is the right
follow-up to address the re-walk cost — out of scope for this
fix; tracked for a future sprint.

Test plan

  • New caplog test asserts no INFO records on size-cap skip path
  • All 16 existing expand tests still pass
  • ruff + mypy clean

@mfwolffe mfwolffe merged commit 0569d3b into trunk May 3, 2026
4 checks 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.

2 participants