ktg-plugin-marketplace/plugins/ultraplan-local/tests
Kjell Tore Guttormsen 655c8d46f8 refactor(ultraplan-local): extract atomicWriteJson to lib/util
Three changes in one commit:

1. NEW lib/util/atomic-write.mjs — exports atomicWriteJson(path, obj),
   the canonical tmp+rename pattern. Reused by pre-compact-flush.mjs and
   (in subsequent steps) by the new session-state writer.

2. NEW tests/lib/atomic-write.test.mjs — 4 unit tests covering
   round-trip, no-orphan-tmp, overwrite-atomic, pretty-print formatting.

3. REFACTOR hooks/scripts/pre-compact-flush.mjs — replace the inline
   atomicWrite() with the imported atomicWriteJson(). Also fixes a
   pre-existing syntax error (leading whitespace + stray --resume token
   outside the comment block) that silently broke the hook from v3.1.0
   onward — PreCompact runtime is fail-open and swallowed the error.
   File reformatted with standard zero-indent JS.

163 → 167 tests, 0 fail.

Step 2 of /ultracontinue v3.3.0 (project 2026-05-01-ultracontinue).
2026-05-01 20:21:15 +02:00
..
fixtures test(ultraplan-local): add SC3(b) source_findings structural test 2026-05-01 17:23:30 +02:00
helpers chore(ultraplan-local): Spor 0 — foundation for v3.1.0 kvalitetsprogram 2026-05-01 05:27:44 +02:00
lib refactor(ultraplan-local): extract atomicWriteJson to lib/util 2026-05-01 20:21:15 +02:00
validators feat(ultraplan-local): extend brief-validator to accept type:ultrareview 2026-05-01 13:31:39 +02:00