feat: add list-meta and list-schema commands with persistent meta index #91

Merged
xiaoju merged 2 commits from fix/90-list-meta-schema into main 2026-06-01 05:48:07 +00:00
Owner

What

Adds list-meta and list-schema CLI commands backed by a new meta index in the Store interface, with persistent storage in the FS store.

Why

Previously there was no way to enumerate meta-schemas or all schemas (across multiple meta-schema versions). list --type @schema only resolved to the newest meta-schema, missing schemas typed by older meta-versions.

Changes

  • Core (json-cas): extended Store with listMeta()/listSchemas(); memory store maintains metaSet; bootstrap registers @output/list-meta and @output/list-schema envelope schemas.
  • FS store (json-cas-fs): persistent _index/_meta file with append/migrate/rewrite semantics; migrates from existing typeIndex when _meta is absent.
  • CLI (cli-json-cas): new list-meta and list-schema commands; usage updated.
  • Tests: B1–B7 (memory), C1–C8 (FS persistence), D1 (bootstrap), E1–E4 (CLI incl. multi meta-version regression), F1 (output schemas). 539 tests pass.

Ref

Fixes #90

## What Adds `list-meta` and `list-schema` CLI commands backed by a new meta index in the Store interface, with persistent storage in the FS store. ## Why Previously there was no way to enumerate meta-schemas or all schemas (across multiple meta-schema versions). `list --type @schema` only resolved to the newest meta-schema, missing schemas typed by older meta-versions. ## Changes - Core (json-cas): extended Store with listMeta()/listSchemas(); memory store maintains metaSet; bootstrap registers @output/list-meta and @output/list-schema envelope schemas. - FS store (json-cas-fs): persistent _index/_meta file with append/migrate/rewrite semantics; migrates from existing typeIndex when _meta is absent. - CLI (cli-json-cas): new list-meta and list-schema commands; usage updated. - Tests: B1–B7 (memory), C1–C8 (FS persistence), D1 (bootstrap), E1–E4 (CLI incl. multi meta-version regression), F1 (output schemas). 539 tests pass. ## Ref Fixes #90
xiaoju added 2 commits 2026-06-01 05:26:07 +00:00
Adds Store.listMeta() and Store.listSchemas() to expose meta-schema
discovery, backed by an in-memory metaSet (memory store) and a
persistent _index/_meta file (FS store). Surfaces both via new
json-cas list-meta and list-schema CLI commands wrapped in
@output/list-meta and @output/list-schema envelope schemas.

The FS store migrates from existing nodes when _meta is absent
(scanning self-referencing nodes) and preserves _meta on subsequent
opens. delete() removes affected hashes from the meta index and
persists the change.

Closes #90

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds the missing E4 regression scenario from the test spec:
demonstrates that with multiple meta-schema versions, list-schema
returns schemas typed by older metas while list --type @schema
(resolving to the newest meta) does not.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xiaoju merged commit 318df9b67f into main 2026-06-01 05:48:07 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/json-cas#91