Skip to content

Collapse dispatch store bumps into one v5 -> v6; open dev v7..v15 stores as v6 (T313) - #241

Merged
smarzban merged 2 commits into
dispatchfrom
tsk/t313-collapse-dispatch-store-bumps
Oct 20, 2026
Merged

smarzban merged 2 commits into
dispatchfrom
tsk/t313-collapse-dispatch-store-bumps

Conversation

@smarzban

Copy link
Copy Markdown
Owner

What

Before #120 lands, the store moves up one version over v0.12.0 (v5), not ten.

  • STORE_FORMAT_VERSION = 6. MIGRATIONS ends at one identity migrate_v5_to_v6; its doc comment lists everything v6 adds (folded from the old v6..v15 comments). migrate_v6_to_v7 … migrate_v14_to_v15 are gone.
  • Dev stores: DEV_FORMAT_VERSIONS: RangeInclusive<u32> = 7..=15 plus one helper reads_as(found) in src/store.rs. A v7..v15 document opens as v6 (no transform, format_version restamped), its next save writes 6 and keeps tsk.json.v<N>. check_document (restore, backup) accepts v7..v15 too. v16+ is still refused. The three gates (load, pre-save peek, check_document) all go through reads_as.
  • Guard: a const _: () = assert!(STORE_FORMAT_VERSION < *DEV_FORMAT_VERSIONS.start(), …) breaks the build when a future bump enters the dev range (message says: drop the range or bump past it and migrate dev documents from v6), plus a unit test of the same predicate.
  • Docs: storage.md "Store version" says this version writes format 6 and tsk 0.12 and older refuse it. CHANGELOG Breaking line uses the shipped Store format N: prefix. No dev versions in user docs.

Where to look

  • src/store.rs top: MIGRATIONS, DEV_FORMAT_VERSIONS, the const guard, reads_as; then load_unlocked_supported, save_unlocked_supported (backup condition is now version != supported), check_document.
  • tests/fixtures/current_store_v6.json is now the canonical v6 wire (old v15 content stamped 6). The old dev-v6 fixture was v5 + version only and was replaced. The v7..v15 fixtures stay as dev inputs.

Tests

  • New: a_populated_dev_v15_store_opens_as_v6_and_keeps_tsk_json_v15 (agent and person assignees, hidden name, after link, review round with a sent reply, batch done; opens unchanged, saves v6, tsk.json.v15 byte-identical, batch undoes), dev_v7_and_v11_open_as_v6_and_v16_is_refused, check_document_accepts_a_dev_v15_store_and_refuses_v16, a_restored_dev_v15_document_opens_as_v6_and_keeps_its_copy, the_current_format_sits_below_the_dev_range.
  • Existing dev-fixture tests (v7..v14, populated v10, v11 replies, v12 undo, v13 kinds) now assert "opens as v6, keeps tsk.json.vN". migrated_load_backs_up… reseeded at v5 (v6 is current now); restore-older test uses v5; refusal tests use DEV_FORMAT_VERSIONS.end() + 1.
  • Reverted by hand, watched fail, restored: restamp hunk (14 persist + 1 lib fail), load gate (14 + 1), backup condition (11 + 1), check_document gate (2 lib), save refusal gate (14). Setting STORE_FORMAT_VERSION = 7 fails the build with the guard message.
  • tests/packaging/test_install.py and src/domain/undo.rs hold no version pins (grepped); undo.rs only had comment wording, updated.

Gate

  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test: green (1082 lib + 967 integration + rest).
  • cargo clippy --all-targets --target x86_64-pc-windows-gnu -- -D warnings: clean.
  • cd site && npm test: 57 pass, 0 fail.

Real proof (copies only; ~/.tsk/tsk.json sha256 prefix 3be3306fb7ad9f17 before and after)

Dogfood binary = ~/.herdr/worktrees/herdr-tsk/dispatch/target/release/tsk (what ~/.local/bin/tsk links to). Live store is format 15. Both copies under the session scratchpad, every command with env TSK_STATE_DIR=<copy>.

Step Result
tsk list --json --all, dogfood vs new, on two copies byte-identical (14,265 bytes); tsk list --json identical too
new tsk add -t "T313 collapse proof task" --desk ok; live format_version 6; tsk.json.v15 written and byte-identical to the original
list --json --all after the add 45 → 46 tasks, every existing task unchanged; only next_task_number differs in the document
Board (new release build) in a Herdr pane on another fresh copy opens and renders the board (NEEDS YOU etc.); q quits; no write on open
v0.12.0 release binary (gh release download) seeds a fresh store, 2 adds format 5
new list --json --all on it same tasks as v0.12 lists
new tsk add on it live format 6, tsk.json.v5 byte-identical to the v0.12 original
v0.12.0 tsk list on the v6 store store format 6 is unsupported by this tsk (expected 5)

Note: the old dogfood (v15) binary still opens a v6 store (it migrates 6 → 15 by identity), so swapping back and forth during dogfood is safe.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
herdr-tsk Ignored Ignored Preview Oct 20, 2026 11:07pm UTC

@smarzban

Copy link
Copy Markdown
Owner Author

Note: the live board check covered open and render on a v15 copy; a save from the board itself was not driven. The CLI tsk add exercises the same save gate, and reload_merge_save on a loaded dev store is covered by tests.

@smarzban
smarzban merged commit 444a687 into dispatch Oct 20, 2026
2 checks passed
@smarzban
smarzban deleted the tsk/t313-collapse-dispatch-store-bumps branch October 20, 2026 23:12
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.

1 participant