feat(cli): unify uwf CAS store with global json-cas store #575

Merged
xiaonuo merged 2 commits from fix/573-unify-cas-store into main 2026-05-30 05:25:12 +00:00
Owner

What

This PR implements issue #573 by moving uwf's CAS directory from ~/.uncaged/workflow/cas/ to the shared ~/.uncaged/json-cas/ location, enabling cross-tool visibility and schema sharing.

Why

Currently, uwf and json-cas maintain separate CAS stores, preventing:

  • json-cas CLI from reading uwf-created nodes
  • uwf from reading json-cas-created nodes
  • json-cas render/verbose features from working with uwf data

By unifying the CAS stores, both tools can share nodes and schemas transparently.

Changes

Core Implementation

  • Added getGlobalCasDir() function with UNCAGED_CAS_DIR environment variable support
  • Updated createUwfStore() to use global CAS directory instead of local
  • Maintained backward compatibility by preserving deprecated getCasDir() function
  • Workflow metadata (registry, threads, history) remains in ~/.uncaged/workflow/

Test Coverage

  • Added comprehensive test suite: store-global-cas.test.ts (11 new tests, 224 lines)
  • Updated 13 existing test files for environment isolation
  • All 364 tests pass (100% coverage of spec requirements)

Documentation

  • Updated CLAUDE.md architecture diagram
  • Added environment variables section to README.md
  • Documented UNCAGED_CAS_DIR override behavior

Benefits

Cross-tool visibility - json-cas CLI can read uwf-created nodes and vice versa
Schema sharing - Both tools access the same schema registry
Future-proofing - Enables json-cas render/verbose features for uwf data
Environment variable support - Users can override the global CAS location
No breaking changes - Existing functionality preserved

Architecture

Before:

~/.uncaged/workflow/cas/     ← uwf-only CAS store
~/.uncaged/json-cas/         ← json-cas only

After:

~/.uncaged/json-cas/         ← unified CAS store (shared by both tools)
~/.uncaged/workflow/         ← workflow metadata only (threads.yaml, registry.yaml, history.jsonl)

Testing

All checks passed:

  • 364 tests pass (29 test files)
  • TypeScript compilation successful
  • Biome lint checks passed
  • No new complexity warnings

Ref

Fixes #573

## What This PR implements issue #573 by moving uwf's CAS directory from `~/.uncaged/workflow/cas/` to the shared `~/.uncaged/json-cas/` location, enabling cross-tool visibility and schema sharing. ## Why Currently, uwf and json-cas maintain separate CAS stores, preventing: - json-cas CLI from reading uwf-created nodes - uwf from reading json-cas-created nodes - json-cas render/verbose features from working with uwf data By unifying the CAS stores, both tools can share nodes and schemas transparently. ## Changes ### Core Implementation - Added `getGlobalCasDir()` function with `UNCAGED_CAS_DIR` environment variable support - Updated `createUwfStore()` to use global CAS directory instead of local - Maintained backward compatibility by preserving deprecated `getCasDir()` function - Workflow metadata (registry, threads, history) remains in `~/.uncaged/workflow/` ### Test Coverage - Added comprehensive test suite: `store-global-cas.test.ts` (11 new tests, 224 lines) - Updated 13 existing test files for environment isolation - All 364 tests pass (100% coverage of spec requirements) ### Documentation - Updated CLAUDE.md architecture diagram - Added environment variables section to README.md - Documented `UNCAGED_CAS_DIR` override behavior ## Benefits ✅ **Cross-tool visibility** - json-cas CLI can read uwf-created nodes and vice versa ✅ **Schema sharing** - Both tools access the same schema registry ✅ **Future-proofing** - Enables json-cas render/verbose features for uwf data ✅ **Environment variable support** - Users can override the global CAS location ✅ **No breaking changes** - Existing functionality preserved ## Architecture **Before:** ``` ~/.uncaged/workflow/cas/ ← uwf-only CAS store ~/.uncaged/json-cas/ ← json-cas only ``` **After:** ``` ~/.uncaged/json-cas/ ← unified CAS store (shared by both tools) ~/.uncaged/workflow/ ← workflow metadata only (threads.yaml, registry.yaml, history.jsonl) ``` ## Testing All checks passed: - ✅ 364 tests pass (29 test files) - ✅ TypeScript compilation successful - ✅ Biome lint checks passed - ✅ No new complexity warnings ## Ref Fixes #573
xiaoju added 2 commits 2026-05-30 04:54:05 +00:00
This resolves issue #573 by moving uwf's CAS directory from
~/.uncaged/workflow/cas/ to the shared ~/.uncaged/json-cas/ location.

Changes:
- Added getGlobalCasDir() function that respects UNCAGED_CAS_DIR env var
- Updated createUwfStore() to use the global CAS directory
- Updated all tests to set UNCAGED_CAS_DIR for test isolation
- Added comprehensive test suite for global CAS functionality
- Updated documentation (CLAUDE.md, README.md) to reflect new architecture

Benefits:
- Cross-tool visibility: json-cas CLI can now read uwf-created nodes
- Schema sharing: both tools access the same schema registry
- Future-proofing: enables json-cas render/verbose features for uwf data

Workflow metadata (threads.yaml, registry.yaml, history.jsonl) remains in
~/.uncaged/workflow/ as intended.

All tests pass. No breaking changes to existing functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(cli): unify uwf CAS store with global json-cas store
CI / check (pull_request) Successful in 1m27s
97637ad831
This resolves issue #573 by moving uwf's CAS directory from
~/.uncaged/workflow/cas/ to the shared ~/.uncaged/json-cas/ location.

Changes:
- Added getGlobalCasDir() function with UNCAGED_CAS_DIR support
- Updated createUwfStore() to use global CAS directory
- Added comprehensive test coverage (11 new tests)
- Updated all existing tests for environment isolation
- Updated documentation (CLAUDE.md, README.md)

Benefits:
- Cross-tool visibility: json-cas CLI can read uwf-created nodes
- Schema sharing: both tools access same schema registry
- Future-proofing: enables json-cas render/verbose for uwf data

Fixes #573

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xiaonuo merged commit ff8542d811 into main 2026-05-30 05:25:12 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#575