32 Commits

Author SHA1 Message Date
xiaoju 55144d0e4a feat: add list-meta and list-schema commands with persistent meta index
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>
2026-06-01 05:10:25 +00:00
xiaoju ceba0b5d43 chore: add prepublishOnly workspace:* guard
Checks for unresolved workspace:* dependencies before publish.
Changesets resolves these automatically, so normal release flow
passes through. Direct npm publish with workspace deps is blocked.
2026-05-31 23:43:51 +00:00
xiaoju a050160bee chore: remove prepublishOnly guards
Changesets already handles workspace:* → real version resolution
during publish. The guard scripts are unnecessary and block the
release flow.
2026-05-31 23:33:58 +00:00
xiaoju 515f4d32f9 chore: version 0.6.0 — unified envelope output (RFC #67) 2026-05-31 23:24:59 +00:00
xiaoju 0dca8a5521 feat: register 18 @output/* schemas, default templates, wrapEnvelope (Phase 1c)
Fixes #75
2026-05-31 15:14:28 +00:00
xiaoju c8bf38cb81 feat: auto-bootstrap CAS store on open (Phase 1a)
Changes:
1. openStore() now async, auto-creates directory and bootstraps
2. Removed shouldCreate parameter and validateStoreExists()
3. All openStore() calls now awaited
4. Deleted init and bootstrap commands
5. Removed Issue #55 store validation tests (superseded by auto-bootstrap)
6. Enhanced error handling in openStore() for permission/path issues
7. Updated e2e snapshots after fixing missed await in cmdRender

Bootstrap is idempotent. Core tests using createMemoryStore() unaffected.

Fixes #73

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-31 13:34:43 +00:00
xiaoju 22fce0ac66 feat: add built-in schema aliases with @ prefix support
Implements Phase 1 of issue #37:
- Extended variable name validation to allow @ prefix (system-reserved)
- Registered 6 built-in schemas with @ aliases during bootstrap
  - @schema → meta-schema (self-referential)
  - @string → { type: "string" }
  - @number → { type: "number" }
  - @object → { type: "object" }
  - @array → { type: "array" }
  - @bool → { type: "boolean" }
- Bootstrap now returns Record<string, Hash> instead of Hash
- Added CLI @ alias resolution for all commands accepting type-hash
  - ucas schema get @string
  - ucas put @string <file>
  - ucas hash @string <file>
- Added comprehensive test coverage for all features
  - Variable name validation with @ prefix
  - Built-in schema registration
  - CLI alias resolution
  - Integration tests

Fixes #37

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-31 04:18:46 +00:00
xiaoju 7242588dd9 feat: implement RFC-20 Phase 3 GC integration
Implements garbage collection (GC) with mark-and-sweep algorithm:
- Mark phase: recursively walks references from all variable values (global, not scoped)
- Sweep phase: deletes unmarked CAS nodes
- Schema preservation: schemas referenced by reachable nodes are preserved
- Bootstrap preservation: self-referencing meta-schema always preserved

New features:
- Core gc() function in packages/json-cas/src/gc.ts with GcStats interface
- Extended Store interface with listAll() and delete() methods
- CLI command: json-cas gc (outputs JSON stats)
- Comprehensive test suite with 16 test scenarios

Implements: #23

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-30 08:16:20 +00:00
xiaoju 98dc91e848 Revert "chore: normalize to bun monorepo conventions"
This reverts commit 064c9afa1e.
2026-05-29 04:45:50 +00:00
xiaoju 064c9afa1e chore: normalize to bun monorepo conventions
CI / check (push) Failing after 43s
Applied monorepo normalization:
- Updated TypeScript to use composite project references with NodeNext
- Configured Biome for linting and formatting
- Standardized package.json metadata across all packages
- Set up changesets for version management and npm publishing
- Added vitest test infrastructure to all packages
- Created Gitea Actions CI pipeline
- Added solve-issue workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-29 04:39:36 +00:00
xiaoju c20c6df2bf chore: version packages (0.5.3)
feat: add oneOf support to meta-schema validation

小橘 🍊
2026-05-25 13:10:49 +00:00
xiaomo 1dacd699d5 docs: sync READMEs, remove json-cas-workflow references 2026-05-25 10:27:59 +00:00
xiaomo e00a23dd80 docs: add READMEs for all packages, move sync-readme to docs/ 2026-05-25 09:51:54 +00:00
xiaomo 4d7b439aaa chore: add release script and prepublishOnly guard 2026-05-25 09:35:50 +00:00
xiaomo b7aa90d8e6 chore: add *.tsbuildinfo to .gitignore, remove duplicate dist/ entry 2026-05-25 04:14:14 +00:00
xiaomo 9a1954f6f9 fix: resolve lint errors — remove useless constructor, fix import ordering, replace as any with as unknown as JSONSchema in tests, apply biome formatting 2026-05-25 04:09:47 +00:00
xiaomo 0706307e85 fix: align all packages to 0.5.0 and restore workspace:^ deps
- All @uncaged/* packages → 0.5.0 (fixed versioning per changesets config)
- Restore workspace:^ for internal deps (was broken to ^0.3.0/^0.4.0)
- Regenerate bun.lock (removes duplicate npm registry entries)
2026-05-25 04:05:17 +00:00
xiaoju 054d78296a feat!: self-validating meta-schema for putSchema
Replace bootstrap payload with a JSON Schema meta-schema describing
our supported schema subset. putSchema now validates input schemas
against the meta-schema before storing, rejecting invalid schemas
with SchemaValidationError.

- bootstrap.ts: self-describing meta-schema (type, properties, required,
  additionalProperties, anyOf, items, format, title, enum, const, description)
- schema.ts: recursive isValidSchema(), SchemaValidationError class
- index.ts: export SchemaValidationError
- package.json: bump 0.4.0 → 1.0.0 (breaking change)

BREAKING CHANGE: meta-schema hash changed, old CAS data invalid.

Fixes #15
2026-05-25 03:51:43 +00:00
scottwei cfe791180b Merge pull request 'feat: remove Store.list() from interface' (#14) from issue-11-remove-store-list into main
Reviewed-on: #14
2026-05-25 01:35:02 +00:00
xiaoju 09526b63da fix: json-cas-fs and json-cas-workflow depend on json-cas ^0.4.0
小橘 🍊(NEKO Team)
2026-05-19 10:21:41 +00:00
xiaoju 00f191e105 chore: bump to 0.4.0
小橘 🍊(NEKO Team)
2026-05-19 10:19:38 +00:00
xiaoju 52cb7a30ba fix: publish compiled .js + .d.ts instead of raw .ts sources
- Add tsc --build pipeline for json-cas, json-cas-fs, json-cas-workflow
- Update package.json exports to point to dist/ (types + import)
- Fix Store type error: use BootstrapCapableStore for stores with bootstrap
- Export BootstrapCapableStore type from json-cas
- Fix meta-schema: nodeSchema now uses real JSON Schema (draft 2020-12)
- Exclude test files from tsc compilation

Breaking: bootstrap hash changes due to meta-schema payload update.

小橘 🍊(NEKO Team)
2026-05-19 10:18:31 +00:00
Scott Wei 1b53cf5ff8 feat: remove Store.list() from interface
Removes the list() method from the Store type and all implementations.
Callers now use listByType() or has() instead.

The CLI 'list' subcommand is removed. 'schema list' now uses
listByType(metaHash) to enumerate schemas.

Closes #11
2026-05-19 01:24:12 +08:00
xiaoju 17ed619900 chore: release @uncaged/* 0.3.0 2026-05-18 15:00:40 +00:00
xiaoju 4989cd31ba Remove null from Store.put typeHash parameter
Self-referencing nodes are created only through bootstrap() via an internal BOOTSTRAP_STORE symbol on memory and fs store implementations. put() always requires a Hash typeHash and uses computeHash.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 14:54:40 +00:00
xiaoju 38aad696fc chore: release @uncaged/* 0.2.0 2026-05-18 14:15:33 +00:00
xiaoju 5fc475704b feat: add listByType(typeHash) to Store interface
Implement in-memory type index and fs append-only _index files. Rebuild index from existing .bin nodes on first load when _index is missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 14:11:53 +00:00
xiaoju 6e77e4a110 fix: replace workspace:^ deps with real versions + merge cli global store path
- All packages bumped to 0.1.3 via changesets (fixed group)
- Replace workspace:^ with ^0.1.x in json-cas-fs, json-cas-workflow, cli-json-cas
- Merge PR #8: cli default store path → ~/.uncaged/json-cas/

Co-authored-by: 星月 🌙 (SORA Team)
小橘 🍊(NEKO Team)
2026-05-18 10:47:12 +00:00
xiaoju a3a21b153c fix: replace workspace:^ with ^0.1.1 in json-cas-fs deps 2026-05-18 10:43:22 +00:00
xiaoju bf6aabe29d chore: bump to 0.1.1
小橘 <xiaoju@shazhou.work>
2026-05-18 02:52:38 +00:00
xiaoju 55b4a0a219 chore: add changesets, set version 0.1.0
小橘 <xiaoju@shazhou.work>
2026-05-18 02:48:58 +00:00
xiaoju 49b1d5d665 feat: Phase 3 — filesystem backend (@uncaged/json-cas-fs)
- createFsStore(dir) implementing Store interface
- CBOR binary blob storage with atomic writes (tmp+rename)
- Auto-create directory, idempotent put
- 15 new tests (64 total), biome clean

Closes #5
小橘 <xiaoju@shazhou.work>
2026-05-17 09:31:04 +00:00