feat: RFC-31 Phase 3 — rewrite CLI var subcommands for composite key model #35

Closed
xiaoju wants to merge 0 commits from fix/34-cli-var-rewrite into main
Owner

Summary

Implements RFC-31 Phase 3: Complete rewrite of CLI var subcommands to support the new (name, schema) composite key model.

What

Command Migration:

  • var create --scope --value -> var set
  • var get -> var get --schema
  • var update -> REMOVED
  • var delete -> var delete [--schema ]
  • var list --scope -> var list [prefix]
  • var tag -> var tag --schema

Why

Enable multiple schema variants per variable name with intuitive CLI interface.

Changes

  • packages/cli-json-cas/src/index.ts (-82/+71)
  • packages/cli-json-cas/src/var.test.ts (NEW, 1037 lines)

Tests: 41 pass, 235 total pass
Build: success, Lint: clean

Ref

Fixes #34

Related: #31 (RFC-31 Phase 1+2), #33 (Variable API refinements)

## Summary Implements RFC-31 Phase 3: Complete rewrite of CLI var subcommands to support the new (name, schema) composite key model. ## What Command Migration: - var create --scope <s> --value <h> -> var set <name> <hash> - var get <ulid> -> var get <name> --schema <hash> - var update <ulid> <hash> -> REMOVED - var delete <ulid> -> var delete <name> [--schema <hash>] - var list --scope <prefix> -> var list [prefix] - var tag <ulid> -> var tag <name> --schema <hash> ## Why Enable multiple schema variants per variable name with intuitive CLI interface. ## Changes - packages/cli-json-cas/src/index.ts (-82/+71) - packages/cli-json-cas/src/var.test.ts (NEW, 1037 lines) Tests: 41 pass, 235 total pass Build: success, Lint: clean ## Ref Fixes #34 Related: #31 (RFC-31 Phase 1+2), #33 (Variable API refinements)
xiaoju added 1 commit 2026-05-30 14:31:25 +00:00
Migrate CLI var subcommands from ULID ID model to (name, schema) composite key model.

- Replace var create/update with unified var set (upsert semantics)
- Update var get to require --schema parameter for precise query
- Enhance var delete with batch (no --schema) and precise (with --schema) modes
- Refactor var list to use positional prefix parameter
- Update var tag to target composite keys
- Add comprehensive test suite (41 tests, 100% coverage)
- Update Variable schema: remove id/scope, add name field

Fixes #34

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
scottwei closed this pull request 2026-05-31 02:35:01 +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#35