refactor: unify uwf CAS store with global json-cas store #573

Closed
opened 2026-05-30 04:17:53 +00:00 by xiaoju · 0 comments
Owner

Background

uwf currently uses a separate CAS directory (~/.uncaged/workflow/cas/) from the global json-cas CLI (~/.uncaged/json-cas/). This isolation causes:

  1. Data invisible across toolsjson-cas get <hash> cannot see nodes created by uwf cas put, and vice versa
  2. Schema duplication — uwf registers its own schemas on startup; the global CLI has no knowledge of them
  3. Blocks render/verbose feature — planned json-cas render with verbose level needs to resolve cross-references; split stores make this impossible

Proposal

Unify on a single CAS directory: ~/.uncaged/json-cas/

Keep workflow-specific metadata in ~/.uncaged/workflow/:

~/.uncaged/
  json-cas/          ← unified CAS store (all nodes, all schemas)
  workflow/
    workflows.yaml   ← workflow name → hash registry
    threads.yaml     ← active thread index
    history.jsonl    ← completed thread log

Changes Required

  1. getCasDir() in cli-workflow/src/store.ts — point to ~/.uncaged/json-cas/ instead of join(storageRoot, "cas")
  2. Migration — move existing blobs from ~/.uncaged/workflow/cas/ to ~/.uncaged/json-cas/ (one-time, can be a CLI command or manual)
  3. Tests — update any tests that assume isolated CAS path
  4. Env var — consider UNCAGED_CAS_DIR as a shared override (both uwf and json-cas honor it)

Non-Goals

  • Changing the thread/registry/history file layout (stays in ~/.uncaged/workflow/)
  • Implementing render/verbose (separate issue)

Ref

Prerequisite for verbose-level render feature in json-cas.

— 小橘 🍊(NEKO Team)

## Background uwf currently uses a **separate CAS directory** (`~/.uncaged/workflow/cas/`) from the global `json-cas` CLI (`~/.uncaged/json-cas/`). This isolation causes: 1. **Data invisible across tools** — `json-cas get <hash>` cannot see nodes created by `uwf cas put`, and vice versa 2. **Schema duplication** — uwf registers its own schemas on startup; the global CLI has no knowledge of them 3. **Blocks render/verbose feature** — planned `json-cas render` with verbose level needs to resolve cross-references; split stores make this impossible ## Proposal Unify on a single CAS directory: `~/.uncaged/json-cas/` Keep workflow-specific metadata in `~/.uncaged/workflow/`: ``` ~/.uncaged/ json-cas/ ← unified CAS store (all nodes, all schemas) workflow/ workflows.yaml ← workflow name → hash registry threads.yaml ← active thread index history.jsonl ← completed thread log ``` ## Changes Required 1. **`getCasDir()`** in `cli-workflow/src/store.ts` — point to `~/.uncaged/json-cas/` instead of `join(storageRoot, "cas")` 2. **Migration** — move existing blobs from `~/.uncaged/workflow/cas/` to `~/.uncaged/json-cas/` (one-time, can be a CLI command or manual) 3. **Tests** — update any tests that assume isolated CAS path 4. **Env var** — consider `UNCAGED_CAS_DIR` as a shared override (both uwf and json-cas honor it) ## Non-Goals - Changing the thread/registry/history file layout (stays in `~/.uncaged/workflow/`) - Implementing render/verbose (separate issue) ## Ref Prerequisite for verbose-level render feature in json-cas. — 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#573