Skip to content

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
Digital-Process-Tools:mainfrom
Buzzwoo-Ecom-Team:fix/consolidation-validate-output
Open

fix(consolidate): reject SKIP/non-conforming Haiku output instead of writing it as memory#90
Buzzwoo-Ecom-Team wants to merge 1 commit into
Digital-Process-Tools:mainfrom
Buzzwoo-Ecom-Team:fix/consolidation-validate-output

Conversation

@Buzzwoo-Ecom-Team
Copy link
Copy Markdown

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's else branch treated the entire reply as recent.md content, and run-consolidation.sh then wrote it and renamed the source today-*.md files to .done.md — corrupting memory and destroying the recoverable source.

Changes

  • consolidate(): raise ConsolidationSkipped when result.is_skip, or when the output carries neither ===RECENT=== nor any ## entry header.
  • cmd_consolidate(): emit CONSOLIDATION_STATUS=skip (and no temp files) on skip.
  • run-consolidation.sh: gate the write + staging rename on CONSOLIDATION_STATUS=ok, so a skipped/failed run leaves memory and staging files untouched for the next run.
  • Tests: validation, skip-on-refusal, skip-on-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.py at 100% coverage (98.3% total, gate is 80%). One unrelated pre-existing failure (test_path_resolution.py::test_12h_format_produces_ampm) reproduces on clean main and is a locale quirk, not from this change.

…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
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.

Consolidation writes the model's conversational replies into memory files as content, and destroys the source staging files

1 participant