Skip to content

fix(consolidation): log the auto-trigger failure instead of printing it - #176

Merged
Paul-Kyle merged 2 commits into
phasespace-labs:mainfrom
chiruu12:fix/172-log-trigger-failure
Sep 2, 2026
Merged

fix(consolidation): log the auto-trigger failure instead of printing it#176
Paul-Kyle merged 2 commits into
phasespace-labs:mainfrom
chiruu12:fix/172-log-trigger-failure

Conversation

@chiruu12

@chiruu12 chiruu12 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Closes #172

logger.warning with %s placeholders, matching the two existing warnings in the file at lines 67 and 119.

Kept warning rather than error. 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.py since the audibility section there already covers "degrading must not be silent" and has the helpers for it. It makes embedder.embed raise, 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 with files_split == 1 and triggers_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: SecretRedactingFilter calls record.getMessage() first, so it scrubs the expanded string either way. The %s form 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.

Copilot AI lite review requested due to automatic review settings September 1, 2026 23:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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() in split_all_core_files() with logger.warning(..., %s) to keep failures in the logging pipeline (leveling, handlers, redaction).
  • Add a pytest that forces embedder.embed to 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.

@Paul-Kyle

Copy link
Copy Markdown
Member

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 files_split == 1 and triggers_registered == 0. A test that would pass either way would have been the easy version of this.

Your scope check holds — that was the only print in either package. The one other print in the library, in core/config.py, is a deliberate file=sys.stderr banner and is meant to stay.

Nothing needed on your side; the branch was only behind because the v0.15.0 release landed half an hour after you pushed.

@Paul-Kyle
Paul-Kyle merged commit 7ad5682 into phasespace-labs:main Sep 2, 2026
9 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.

fix(consolidation): auto-trigger failure prints to stdout instead of logging

3 participants