fix(consolidate): reject SKIP/non-conforming Haiku output instead of writing it as memory#90
Open
Buzzwoo-Ecom-Team wants to merge 1 commit into
Conversation
…writing it as memory When the consolidation Haiku call returns anything other than the ===RECENT===/===ARCHIVE=== envelope (a refusal, a clarifying question, or a preamble), the parser's else-branch treated the entire reply as recent.md content and the shell then wrote it and renamed the source today-*.md files to .done.md — corrupting memory and destroying the recoverable source. - consolidate(): raise ConsolidationSkipped when result.is_skip or the output carries neither ===RECENT=== nor any '## ' entry header. - cmd_consolidate(): emit CONSOLIDATION_STATUS=skip (no temp files) on skip. - run-consolidation.sh: gate write + staging rename on CONSOLIDATION_STATUS=ok, so a skipped/failed run leaves memory and staging files untouched. - tests: cover validation + skip-on-refusal/SKIP + valid-envelope passthrough. parse_consolidation_response() is unchanged, preserving existing semantics. Fixes Digital-Process-Tools#89
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.
Fixes #89.
When the consolidation Haiku call returns anything other than the
===RECENT===/===ARCHIVE===envelope (a refusal, a clarifying question, or a "here's what I'd compress…" preamble),parse_consolidation_response'selsebranch treated the entire reply asrecent.mdcontent, andrun-consolidation.shthen wrote it and renamed the sourcetoday-*.mdfiles to.done.md— corrupting memory and destroying the recoverable source.Changes
consolidate(): raiseConsolidationSkippedwhenresult.is_skip, or when the output carries neither===RECENT===nor any##entry header.cmd_consolidate(): emitCONSOLIDATION_STATUS=skip(and no temp files) on skip.run-consolidation.sh: gate the write + staging rename onCONSOLIDATION_STATUS=ok, so a skipped/failed run leaves memory and staging files untouched for the next run.SKIP, and valid-envelope passthrough.parse_consolidation_response()is unchanged, preserving existing semantics and tests.Testing
Full suite passes locally — 403 passed, 1 skipped;
pipeline/consolidate.pyat 100% coverage (98.3% total, gate is 80%). One unrelated pre-existing failure (test_path_resolution.py::test_12h_format_produces_ampm) reproduces on cleanmainand is a locale quirk, not from this change.