Skip to content

Release v0.5.12 — state schema versioning (clears the world-class punch-list)#20

Merged
mixflavor merged 1 commit into
mainfrom
release/v0.5.12
Jun 5, 2026
Merged

Release v0.5.12 — state schema versioning (clears the world-class punch-list)#20
mixflavor merged 1 commit into
mainfrom
release/v0.5.12

Conversation

@mixflavor

Copy link
Copy Markdown
Contributor

What

Everything under $CLIKAE_HOME/ was un-versioned — the moment an on-disk format needs a new field, there'd be no way to tell old from new and no migration path (dim ⑤, the portfolio-wide weak dimension flagged in docs/HANDOFF-world-class-gaps.md). This is the minimum, restrained fix.

How

  • lib/core/state_version.sh — a $CLIKAE_HOME/version integer (CLIKAE_STATE_VERSION, the state schema version — bumped only on a format change, not per release) + a forward-migration runner:
    • on startup, state_version_check migrates n→n+1 via _state_migrate_<n> hooks if the on-disk version is older, warns (never downgrades) if newer, and no-ops when current.
    • a missing version file = the original un-versioned layout = v1 (migrates cleanly to a future v2).
  • Read-only-preserving — stamped when state is created (ensure_profile --create), so steady-state read commands never write it. The "bare clikae changes nothing on disk" guarantee still holds (test-verified).
  • dry_store's line format is documented as governed by the schema version.
  • Restrained: one version file + one runner. No framework.

Tests

tests/bats/state-version.bats — 8 cases (stamp-on-init · no-file=v1 · migrate-older · migrate-from-unversioned · warn-on-newer · no-op-when-current · no-op-no-dir). bats -r tests = 345/345; shellcheck -S warning = 0.

With this, clikae's quality punch-list is empty — it clears the 世界第一讚 bar.

🤖 Generated with Claude Code

…ch-list)

Everything under $CLIKAE_HOME/ was un-versioned: the moment any on-disk format
needs a new field there'd be no way to tell old from new and no migration path
(dim ⑤, the portfolio-wide weak dimension). This is the minimum fix.

- lib/core/state_version.sh: a $CLIKAE_HOME/version integer (CLIKAE_STATE_VERSION
  — the STATE schema version, bumped only on a format change, not per release) +
  a forward-migration runner. state_version_check on startup migrates n→n+1 via
  _state_migrate_<n> hooks when the on-disk version is older, warns (not downgrades)
  when newer, no-ops when current. A missing file = the original un-versioned
  layout = v1 (migrates cleanly to a future v2).
- Read-only-preserving: stamped when state is CREATED (ensure_profile --create →
  state_version_ensure), so steady-state read commands never write it. The "bare
  clikae changes nothing on disk" guarantee still holds (test-verified).
- dry_store's line format documented as governed by the schema version (evolve via
  a migration, not by parsing two shapes).
- Deliberately 克制: one version file + one runner, no framework.

tests/bats/state-version.bats: 8 cases (stamp on init, no-file=v1, migrate older,
migrate-from-unversioned, warn-on-newer, no-op-when-current, no-op-no-dir).
bats -r tests = 345/345; shellcheck -S warning = 0.

With this, clikae's quality punch-list (docs/HANDOFF-world-class-gaps.md) is empty.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mixflavor mixflavor merged commit 556b459 into main Jun 5, 2026
5 of 6 checks passed
@mixflavor mixflavor deleted the release/v0.5.12 branch June 5, 2026 13:13
mixflavor added a commit that referenced this pull request Jun 13, 2026
Release v0.5.12 — state schema versioning (clears the world-class punch-list)
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.

2 participants