fix(consolidation): log the auto-trigger failure instead of printing it - #176
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, consistent with existing logging patterns in the module, and is covered by a targeted regression test.
Pull request overview
This PR fixes an operational logging gap in the consolidation layer-splitting sweep by routing auto-trigger registration failures through the module logger (instead of printing to stdout), and adds a regression test to ensure the failure is audible via logging while the sweep still completes.
Changes:
- Replace a
print()insplit_all_core_files()withlogger.warning(..., %s)to keep failures in the logging pipeline (leveling, handlers, redaction). - Add a pytest that forces
embedder.embedto raise and asserts: one WARNING record is emitted, nothing is printed to stdout, and stats reflect a completed sweep with zero triggers registered.
File summaries
| File | Description |
|---|---|
palinode/consolidation/layer_split.py |
Replaces stdout printing on auto-trigger failure with a structured WARNING log record. |
tests/test_layer_split_hint_hardening.py |
Adds a regression test verifying the failure is logged (not printed) and the sweep continues. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Merged — thank you. This is the seventh you've landed here. Two things worth calling out. First: you corrected your own claim about the redacting filter in the PR body, unprompted, before anyone asked you to. That is the expensive habit: a wrong mechanism in a PR body outlives the PR, because the next person reads it as the reason the code is shaped that way. Second, the test earns its place. It fails on the unfixed line with the raw string in captured stdout, and it pins the level, the file, the failure text, and that the sweep still completes with Your scope check holds — that was the only Nothing needed on your side; the branch was only behind because the v0.15.0 release landed half an hour after you pushed. |
Closes #172
logger.warningwith%splaceholders, matching the two existing warnings in the file at lines 67 and 119.Kept
warningrather thanerror. The trigger is enrichment on top of a split that already succeeded, and the sweep carries on to the next file, which is the same posture as the other two.Test is in
test_layer_split_hint_hardening.pysince the audibility section there already covers "degrading must not be silent" and has the helpers for it. It makesembedder.embedraise, then asserts one WARNING record from this module's logger naming the file and carrying the failure, nothing on stdout, and that the sweep still returns withfiles_split == 1andtriggers_registered == 0. It fails on the unfixed line, where the string shows up in captured stdout and no record is emitted.One correction to what I said when I claimed this. I had it that passing the exception as an argument is what gets it past the redacting filter. That is wrong, and your note in the issue is right:
SecretRedactingFiltercallsrecord.getMessage()first, so it scrubs the expanded string either way. The%sform is worth using because it defers formatting and matches the neighbours, not because it changes what gets redacted.git grep -n "print(" palinode/consolidation/ palinode/indexer/returns only this one line, so nothing else was folded in.