diff --git a/.workflows/e2e-walkthrough.yaml b/.workflows/e2e-walkthrough.yaml index 0753eb6..73f5476 100644 --- a/.workflows/e2e-walkthrough.yaml +++ b/.workflows/e2e-walkthrough.yaml @@ -17,7 +17,7 @@ roles: docker run -d --name uwf-e2e-$$ \ -v "$(pwd):/workspace:ro" \ -e HOME=/root \ - -e UNCAGED_WORKFLOW_STORAGE_ROOT=/tmp/uwf-e2e-storage \ + -e UWF_STORAGE_ROOT=/tmp/uwf-e2e-storage \ --add-host=host.docker.internal:host-gateway \ -w /workspace \ node:22-bookworm \ @@ -39,7 +39,7 @@ roles: export PATH="$HOME/.bun/bin:$PATH" # Isolated storage - mkdir -p $UNCAGED_WORKFLOW_STORAGE_ROOT + mkdir -p $UWF_STORAGE_ROOT # Install workspace deps cd /root/workflow && bun install @@ -60,11 +60,11 @@ roles: The host config contains provider credentials and model settings needed for LLM calls. Also rewrite any localhost URLs to host.docker.internal so the container can reach host services. ``` - docker cp ~/.uncaged/workflow/config.yaml uwf-e2e-$$:/tmp/uwf-e2e-storage/config.yaml 2>/dev/null || true + docker cp ~/.uwf/config.yaml uwf-e2e-$$:/tmp/uwf-e2e-storage/config.yaml 2>/dev/null || true docker exec uwf-e2e-$$ bash -c ' - if [ -f $UNCAGED_WORKFLOW_STORAGE_ROOT/config.yaml ]; then + if [ -f $UWF_STORAGE_ROOT/config.yaml ]; then sed -i "s|localhost|host.docker.internal|g; s|127\.0\.0\.1|host.docker.internal|g" \ - $UNCAGED_WORKFLOW_STORAGE_ROOT/config.yaml + $UWF_STORAGE_ROOT/config.yaml fi ' ``` @@ -95,7 +95,7 @@ roles: All commands use `uwf` (installed via `bun link` inside the container). Remember to set env vars in each exec: export PATH="$HOME/.bun/bin:$PATH" - export UNCAGED_WORKFLOW_STORAGE_ROOT=/tmp/uwf-e2e-storage + export UWF_STORAGE_ROOT=/tmp/uwf-e2e-storage Config tests: 1. `uwf config list` — verify it returns valid JSON @@ -133,7 +133,7 @@ roles: procedure: | Use the container (containerName) and workflow (workflowName) from your prompt. All commands via: `docker exec bash -c '...'` - Set env: PATH="$HOME/.bun/bin:$PATH" UNCAGED_WORKFLOW_STORAGE_ROOT=/tmp/uwf-e2e-storage + Set env: PATH="$HOME/.bun/bin:$PATH" UWF_STORAGE_ROOT=/tmp/uwf-e2e-storage 1. `uwf thread start -p 'E2E test: what is 2+2?'` — capture thread ID from JSON output 2. `uwf thread list` — verify the thread appears in the list @@ -166,7 +166,7 @@ roles: procedure: | Use the container (containerName) and threadId from your prompt. All commands via: `docker exec bash -c '...'` - Set env: PATH="$HOME/.bun/bin:$PATH" UNCAGED_WORKFLOW_STORAGE_ROOT=/tmp/uwf-e2e-storage + Set env: PATH="$HOME/.bun/bin:$PATH" UWF_STORAGE_ROOT=/tmp/uwf-e2e-storage Step inspection: 1. `uwf step list ` — verify steps array has length > 1 @@ -208,7 +208,7 @@ roles: procedure: | Use containerName, threadId, lastStepHash, and workflowName from your prompt. All commands via: `docker exec bash -c '...'` - Set env: PATH="$HOME/.bun/bin:$PATH" UNCAGED_WORKFLOW_STORAGE_ROOT=/tmp/uwf-e2e-storage + Set env: PATH="$HOME/.bun/bin:$PATH" UWF_STORAGE_ROOT=/tmp/uwf-e2e-storage Cancel: 1. Start a second thread: `uwf thread start -p 'E2E cancel test'` diff --git a/.workflows/solve-issue.yaml b/.workflows/solve-issue.yaml index 3a1ac3c..f975afa 100644 --- a/.workflows/solve-issue.yaml +++ b/.workflows/solve-issue.yaml @@ -201,7 +201,7 @@ roles: "https://git.shazhou.work/api/v1/repos///pulls" \ -d '{"title":"...","body":"...","head":"","base":"main"}' ``` - - The repo remote (owner/repo format, e.g. "uncaged/workflow") is given in your task prompt — use it directly. + - The repo remote (owner/repo format, e.g. "shazhou/united-workforce") is given in your task prompt — use it directly. - PR body must include: What / Why / Changes / Ref sections, with `Fixes #N` in Ref 6. **Verify PR was created** — parse the curl response JSON: it must contain a `"number"` field. Print the PR URL. - If curl returns an error or no number field: capture the response, mark hook_failed diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index bca22bc..c4ba009 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -1,6 +1,6 @@ # UWF Bootstrap Guide -This guide helps any AI agent set up `uwf` (Uncaged Workflow) from scratch — or self-check and upgrade an existing installation. +This guide helps any AI agent set up `uwf` (United Workforce) from scratch — or self-check and upgrade an existing installation. ## Prerequisites @@ -16,7 +16,7 @@ This guide helps any AI agent set up `uwf` (Uncaged Workflow) from scratch — o ### 1. Install uwf CLI ```bash -bun install -g @uncaged/cli +bun install -g @united-workforce/cli ``` ✅ **Check:** `uwf --version` prints a version number (e.g. `0.5.1`). @@ -27,11 +27,11 @@ Install the adapter that matches your agent runtime. Pick **one**: | Agent | Package | Binary | |-------|---------|--------| -| Hermes | `@uncaged/agent-hermes` | `uwf-hermes` | +| Hermes | `@united-workforce/agent-hermes` | `uwf-hermes` | ```bash # Example: Hermes agent -bun install -g @uncaged/agent-hermes +bun install -g @united-workforce/agent-hermes ``` ✅ **Check:** `uwf-hermes --version` prints a version number. @@ -55,7 +55,7 @@ uwf setup \ --agent hermes ``` -This creates `~/.uncaged/workflow/config.yaml` with your provider, model, and default agent. +This creates `~/.uwf/config.yaml` with your provider, model, and default agent. #### Config Structure @@ -76,7 +76,7 @@ defaultAgent: hermes defaultModel: default ``` -✅ **Check:** `cat ~/.uncaged/workflow/config.yaml` shows valid provider, model, and agent config. +✅ **Check:** `cat ~/.uwf/config.yaml` shows valid provider, model, and agent config. ### 4. Verify Installation @@ -129,23 +129,23 @@ Compare with latest published versions: ```bash bun pm ls -g | grep -E "cli|workflow-agent" -npm info @uncaged/cli version -npm info @uncaged/agent-hermes version +npm info @united-workforce/cli version +npm info @united-workforce/agent-hermes version ``` If local version < published version, upgrade: ```bash -bun install -g @uncaged/cli@latest -bun install -g @uncaged/agent-hermes@latest +bun install -g @united-workforce/cli@latest +bun install -g @united-workforce/agent-hermes@latest ``` -✅ **Check:** `uwf --version` matches `npm info @uncaged/cli version`. +✅ **Check:** `uwf --version` matches `npm info @united-workforce/cli version`. ### Config Check ```bash -cat ~/.uncaged/workflow/config.yaml +cat ~/.uwf/config.yaml ``` Verify: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7b1d91..3e471ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to @uncaged/workflow +# Contributing to @united-workforce/cli Thank you for your interest in contributing! This guide covers setup, conventions, and the PR workflow. @@ -11,8 +11,8 @@ Thank you for your interest in contributing! This guide covers setup, convention ## Setup ```bash -git clone https://github.com/shazhou-ww/uncaged-workflow.git -cd uncaged-workflow +git clone https://github.com/shazhou-ww/united-workforce.git +cd united-workforce bun install bun run build bun test @@ -36,7 +36,7 @@ See [CLAUDE.md](CLAUDE.md) for the full coding standard. Key points: - **Functional-first** — `function` + `type`, not `class` + `interface` - **No optional properties** — use `T | null` instead of `?:` - **Named exports only** — no default exports -- **No `console.log`** — use the structured logger from `@uncaged/util` +- **No `console.log`** — use the structured logger from `@united-workforce/util` - **Static imports only** — no `await import()` in production code - **Biome** for lint + format — run `bun run check` before committing diff --git a/LICENSE b/LICENSE index 4fa8e29..c536cd6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 Uncaged +Copyright (c) 2026 United Workforce Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index c57cb5f..2bb9304 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # United Workforce (uwf) -[![CI](https://github.com/shazhou-ww/uncaged-workflow/actions/workflows/ci.yml/badge.svg)](https://github.com/shazhou-ww/uncaged-workflow/actions/workflows/ci.yml) +[![CI](https://github.com/shazhou-ww/united-workforce/actions/workflows/ci.yml/badge.svg)](https://github.com/shazhou-ww/united-workforce/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/@united-workforce/cli?label=%40united-workforce%2Fcli)](https://www.npmjs.com/package/@united-workforce/cli) [![npm](https://img.shields.io/npm/v/@united-workforce/protocol?label=%40united-workforce%2Fprotocol)](https://www.npmjs.com/package/@united-workforce/protocol) [![npm](https://img.shields.io/npm/v/@united-workforce/util-agent?label=%40united-workforce%2Futil-agent)](https://www.npmjs.com/package/@united-workforce/util-agent) diff --git a/docs/architecture.md b/docs/architecture.md index 864a80c..9ca9da0 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -358,7 +358,7 @@ threads.yaml: { "01J7K9...4T": "8FWKR3TN5V1QA" } ## Storage layout ``` -~/.uncaged/workflow/ +~/.uwf/ ├── cas/ # json-cas filesystem store (all CAS nodes) ├── config.yaml # Provider, model, agent configuration ├── threads.yaml # Active thread head pointers: threadId → CasRef diff --git a/docs/builtin-agent-research.md b/docs/builtin-agent-research.md index 75a00ea..cfbfa97 100644 --- a/docs/builtin-agent-research.md +++ b/docs/builtin-agent-research.md @@ -82,7 +82,7 @@ Agent 解析优先级(`resolveAgentConfig`): ```33:43:packages/util-agent/src/storage.ts export function resolveStorageRoot(): string { - const internal = process.env.UNCAGED_WORKFLOW_STORAGE_ROOT; + const internal = process.env.UWF_STORAGE_ROOT; if (internal !== undefined && internal !== "") { return internal; } @@ -94,7 +94,7 @@ export function resolveStorageRoot(): string { } ``` -Agent 子进程通过继承的 `process.env` 与父 CLI 共享同一 storage root;`createAgent` 内还会 `loadDotenv({ path: getEnvPath(storageRoot) })` 加载 `~/.uncaged/workflow/.env`。 +Agent 子进程通过继承的 `process.env` 与父 CLI 共享同一 storage root;`createAgent` 内还会 `loadDotenv({ path: getEnvPath(storageRoot) })` 加载 `~/.uwf/.env`。 #### Agent 侧职责(设计文档 + 实现) diff --git a/docs/wf-stateless-design.md b/docs/wf-stateless-design.md index 962fed6..b0b0e33 100644 --- a/docs/wf-stateless-design.md +++ b/docs/wf-stateless-design.md @@ -202,7 +202,7 @@ payload: - `graph` — `Record>`,每个 Target = `{ role, prompt }` - Status 来自上一个 role 输出的 `status` 字段,`$START` 用 `_` 作为初始 status - Prompt 模板使用 Mustache 渲染,变量来自 lastOutput -- 不含 agent binding — agent 配置在 `~/.uncaged/workflow/config.yaml` 中管理 +- 不含 agent binding — agent 配置在 `~/.uwf/config.yaml` 中管理 Moderator 的求值逻辑: @@ -276,7 +276,7 @@ threads.yaml: { "01J7K9M2XNPQR5VWBCDF8G3H4T": "8FWKR3TN5V1QA" } 系统两个顶层 YAML 文件和一个 env 文件: ```yaml -# ~/.uncaged/workflow/config.yaml — 全局配置 +# ~/.uwf/config.yaml — 全局配置 providers: openai: baseUrl: "https://api.openai.com/v1" @@ -315,7 +315,7 @@ modelOverrides: ``` ```yaml -# ~/.uncaged/workflow/threads.yaml — active thread 链头指针 +# ~/.uwf/threads.yaml — active thread 链头指针 01J7K9M2XNPQR5VWBCDF8G3H4T: "8FWKR3TN5V1QA" 01J8AB3QRMSTV6WKXZ2C4DF7GN: "3CNWT9KR6D2HV" ``` @@ -323,7 +323,7 @@ modelOverrides: Thread 结束时从 threads.yaml 移除。可选:追加到 `history.jsonl` 做归档。 ```bash -# ~/.uncaged/workflow/.env — 敏感信息(API keys) +# ~/.uwf/.env — 敏感信息(API keys) OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... OPENROUTER_API_KEY=sk-or-... @@ -478,7 +478,7 @@ type AgentConfig = { args: string[]; }; -/** ~/.uncaged/workflow/config.yaml */ +/** ~/.uwf/config.yaml */ type WorkflowConfig = { providers: Record; models: Record; @@ -489,7 +489,7 @@ type WorkflowConfig = { modelOverrides: Record | null; }; -/** ~/.uncaged/workflow/threads.yaml */ +/** ~/.uwf/threads.yaml */ type ThreadsIndex = Record; // ^ thread-id ^ head StepNode/StartNode hash ``` diff --git a/package.json b/package.json index c26c8d1..986bd47 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,11 @@ }, "repository": { "type": "git", - "url": "https://github.com/shazhou-ww/uncaged-workflow.git" + "url": "https://github.com/shazhou-ww/united-workforce.git" }, - "homepage": "https://github.com/shazhou-ww/uncaged-workflow#readme", + "homepage": "https://github.com/shazhou-ww/united-workforce#readme", "bugs": { - "url": "https://github.com/shazhou-ww/uncaged-workflow/issues" + "url": "https://github.com/shazhou-ww/united-workforce/issues" }, "license": "MIT" } diff --git a/packages/agent-builtin/README.md b/packages/agent-builtin/README.md index 58c9b1f..0ff89bc 100644 --- a/packages/agent-builtin/README.md +++ b/packages/agent-builtin/README.md @@ -136,6 +136,6 @@ src/ ## Configuration -Requires a configured OpenAI-compatible provider and model in `~/.uncaged/workflow/config.yaml` (via `uwf setup`). API keys are loaded from `~/.uncaged/workflow/.env`. +Requires a configured OpenAI-compatible provider and model in `~/.uwf/config.yaml` (via `uwf setup`). API keys are loaded from `~/.uwf/.env`. Tools run with the current working directory as `ToolContext.cwd` (typically the directory where `uwf thread step` was invoked). diff --git a/packages/agent-builtin/package.json b/packages/agent-builtin/package.json index 384f6f2..fc8f2a4 100644 --- a/packages/agent-builtin/package.json +++ b/packages/agent-builtin/package.json @@ -35,12 +35,12 @@ }, "repository": { "type": "git", - "url": "https://git.shazhou.work/uncaged/workflow.git", + "url": "https://git.shazhou.work/shazhou/united-workforce.git", "directory": "packages/agent-builtin" }, - "homepage": "https://git.shazhou.work/uncaged/workflow#readme", + "homepage": "https://git.shazhou.work/shazhou/united-workforce#readme", "bugs": { - "url": "https://git.shazhou.work/uncaged/workflow/issues" + "url": "https://git.shazhou.work/shazhou/united-workforce/issues" }, "license": "MIT" } diff --git a/packages/agent-claude-code/package.json b/packages/agent-claude-code/package.json index d9df03d..a3d3cc3 100644 --- a/packages/agent-claude-code/package.json +++ b/packages/agent-claude-code/package.json @@ -35,12 +35,12 @@ }, "repository": { "type": "git", - "url": "https://git.shazhou.work/uncaged/workflow.git", + "url": "https://git.shazhou.work/shazhou/united-workforce.git", "directory": "packages/agent-claude-code" }, - "homepage": "https://git.shazhou.work/uncaged/workflow#readme", + "homepage": "https://git.shazhou.work/shazhou/united-workforce#readme", "bugs": { - "url": "https://git.shazhou.work/uncaged/workflow/issues" + "url": "https://git.shazhou.work/shazhou/united-workforce/issues" }, "license": "MIT" } diff --git a/packages/agent-hermes/README.md b/packages/agent-hermes/README.md index ec291c8..f1b8511 100644 --- a/packages/agent-hermes/README.md +++ b/packages/agent-hermes/README.md @@ -96,6 +96,6 @@ src/ ## Configuration -Uses workflow config from `~/.uncaged/workflow/config.yaml` (via agent-kit). Hermes session files are stored under the workflow storage root (see `session-detail.ts`). +Uses workflow config from `~/.uwf/config.yaml` (via agent-kit). Hermes session files are stored under the workflow storage root (see `session-detail.ts`). Set `UWF_HERMES_NO_RESUME=1` to disable session resume (see `isResumeDisabled` in `session-cache.ts`). diff --git a/packages/agent-hermes/package.json b/packages/agent-hermes/package.json index 2b8743e..6aa3ef2 100644 --- a/packages/agent-hermes/package.json +++ b/packages/agent-hermes/package.json @@ -36,12 +36,12 @@ }, "repository": { "type": "git", - "url": "https://git.shazhou.work/uncaged/workflow.git", + "url": "https://git.shazhou.work/shazhou/united-workforce.git", "directory": "packages/agent-hermes" }, - "homepage": "https://git.shazhou.work/uncaged/workflow#readme", + "homepage": "https://git.shazhou.work/shazhou/united-workforce#readme", "bugs": { - "url": "https://git.shazhou.work/uncaged/workflow/issues" + "url": "https://git.shazhou.work/shazhou/united-workforce/issues" }, "engines": { "bun": ">= 1.0.0" diff --git a/packages/cli/README.md b/packages/cli/README.md index 4b64ec3..d8bc0e9 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -120,7 +120,7 @@ uwf setup --provider openai --base-url https://api.openai.com/v1 \ --api-key sk-... --model gpt-4o --agent hermes ``` -Config: `~/.uncaged/workflow/config.yaml` (includes API keys). +Config: `~/.uwf/config.yaml` (includes API keys). ### Skill @@ -206,17 +206,17 @@ src/ | File | Purpose | |------|---------| -| `~/.uncaged/workflow/config.yaml` | Providers, models, default agent | -| `~/.uncaged/workflow/.env` | API keys (referenced by `apiKeyEnv` in config) | -| `~/.uncaged/workflow/registry.yaml` | Workflow name → CAS hash | -| `~/.uncaged/workflow/threads.yaml` | Active thread head pointers | -| `~/.uncaged/json-cas/` | Content-addressed node storage (unified CAS store, shared with `ocas` CLI) | +| `~/.uwf/config.yaml` | Providers, models, default agent | +| `~/.uwf/.env` | API keys (referenced by `apiKeyEnv` in config) | +| `~/.uwf/registry.yaml` | Workflow name → CAS hash | +| `~/.uwf/threads.yaml` | Active thread head pointers | +| `~/.ocas/` | Content-addressed node storage (unified CAS store, shared with `ocas` CLI) | ### Environment Variables | Variable | Purpose | Default | |----------|---------|---------| -| `UNCAGED_CAS_DIR` | Override the global CAS directory location | `~/.uncaged/json-cas` | -| `UNCAGED_WORKFLOW_STORAGE_ROOT` | Internal override for workflow metadata storage | `~/.uncaged/workflow` | -| `WORKFLOW_STORAGE_ROOT` | User override for workflow metadata storage | `~/.uncaged/workflow` | +| `OCAS_DIR` | Override the global CAS directory location | `~/.ocas` | +| `UWF_STORAGE_ROOT` | Internal override for workflow metadata storage | `~/.uwf` | +| `WORKFLOW_STORAGE_ROOT` | User override for workflow metadata storage | `~/.uwf` | diff --git a/packages/cli/package.json b/packages/cli/package.json index 395208c..cc02d6f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -34,12 +34,12 @@ }, "repository": { "type": "git", - "url": "https://git.shazhou.work/uncaged/workflow.git", + "url": "https://git.shazhou.work/shazhou/united-workforce.git", "directory": "packages/cli" }, - "homepage": "https://git.shazhou.work/uncaged/workflow#readme", + "homepage": "https://git.shazhou.work/shazhou/united-workforce#readme", "bugs": { - "url": "https://git.shazhou.work/uncaged/workflow/issues" + "url": "https://git.shazhou.work/shazhou/united-workforce/issues" }, "license": "MIT" } diff --git a/packages/cli/src/__tests__/adapter-json-roundtrip.test.ts b/packages/cli/src/__tests__/adapter-json-roundtrip.test.ts index af8a0be..2de2d23 100644 --- a/packages/cli/src/__tests__/adapter-json-roundtrip.test.ts +++ b/packages/cli/src/__tests__/adapter-json-roundtrip.test.ts @@ -67,7 +67,7 @@ describe("C1: adapter JSON round-trip integration", () => { prompt: "Test round-trip task", }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const threadId = "01ROUNDTRIPTEST0000000000" as ThreadId; await seedThreads(tmpDir, { [threadId]: startHash }); @@ -134,7 +134,7 @@ describe("C1: adapter JSON round-trip integration", () => { env: { ...process.env, WORKFLOW_STORAGE_ROOT: tmpDir, - UNCAGED_CAS_DIR: casDir, + OCAS_DIR: casDir, }, cwd: tmpDir, timeout: 30000, diff --git a/packages/cli/src/__tests__/current-role.test.ts b/packages/cli/src/__tests__/current-role.test.ts index 3f9efd6..fc9b559 100644 --- a/packages/cli/src/__tests__/current-role.test.ts +++ b/packages/cli/src/__tests__/current-role.test.ts @@ -225,9 +225,9 @@ describe("currentRole field", () => { await mkdir(storageRoot, { recursive: true }); await mkdir(casDir, { recursive: true }); - // Set UNCAGED_CAS_DIR for this test - originalEnv = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + // Set OCAS_DIR for this test + originalEnv = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; } async function teardown() { @@ -236,9 +236,9 @@ describe("currentRole field", () => { } // Restore original environment if (originalEnv === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalEnv; + process.env.OCAS_DIR = originalEnv; } } diff --git a/packages/cli/src/__tests__/resolve-head-hash.test.ts b/packages/cli/src/__tests__/resolve-head-hash.test.ts index 39dc1d0..b1dac22 100644 --- a/packages/cli/src/__tests__/resolve-head-hash.test.ts +++ b/packages/cli/src/__tests__/resolve-head-hash.test.ts @@ -12,7 +12,7 @@ beforeEach(async () => { tmpDir = await mkdtemp(join(tmpdir(), "cli-uwf-resolve-head-")); const casDir = join(tmpDir, "cas"); await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; }); afterEach(async () => { diff --git a/packages/cli/src/__tests__/step-read.test.ts b/packages/cli/src/__tests__/step-read.test.ts index 45037e5..d481292 100644 --- a/packages/cli/src/__tests__/step-read.test.ts +++ b/packages/cli/src/__tests__/step-read.test.ts @@ -70,16 +70,16 @@ let originalEnv: string | undefined; beforeEach(async () => { tmpDir = await mkdtemp(join(tmpdir(), "cli-uwf-step-read-test-")); - originalEnv = process.env.UNCAGED_CAS_DIR; + originalEnv = process.env.OCAS_DIR; }); afterEach(async () => { await rm(tmpDir, { recursive: true, force: true }); // Restore original environment if (originalEnv === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalEnv; + process.env.OCAS_DIR = originalEnv; } }); @@ -88,10 +88,10 @@ afterEach(async () => { describe("step read", () => { test("test 1: basic single-step read with 3 turns", async () => { const casDir = join(tmpDir, "cas"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const store = createFsStore(casDir); const schemas = await registerUwfSchemas(store); const detailSchemas = await registerDetailSchemas(store); @@ -177,9 +177,9 @@ describe("step read", () => { test("test 2: quota enforcement - multiple turns", async () => { const casDir = join(tmpDir, "cas"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const store = createFsStore(casDir); const schemas = await registerUwfSchemas(store); const detailSchemas = await registerDetailSchemas(store); @@ -263,9 +263,9 @@ describe("step read", () => { test("test 3: minimal quota edge case - always show at least one turn", async () => { const casDir = join(tmpDir, "cas"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const store = createFsStore(casDir); const schemas = await registerUwfSchemas(store); const detailSchemas = await registerDetailSchemas(store); @@ -340,9 +340,9 @@ describe("step read", () => { test("test 4: step with no detail field", async () => { const casDir = join(tmpDir, "cas"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const store = createFsStore(casDir); const schemas = await registerUwfSchemas(store); @@ -401,9 +401,9 @@ describe("step read", () => { test("test 5: step with detail but no turns array", async () => { const casDir = join(tmpDir, "cas"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const store = createFsStore(casDir); const schemas = await registerUwfSchemas(store); await registerDetailSchemas(store); @@ -479,9 +479,9 @@ describe("step read", () => { test("test 6: displays role and tool calls in turn body", async () => { const casDir = join(tmpDir, "cas"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const store = createFsStore(casDir); const schemas = await registerUwfSchemas(store); const detailSchemas = await registerDetailSchemas(store); @@ -553,9 +553,9 @@ describe("step read", () => { test("test 7: turn content with special characters", async () => { const casDir = join(tmpDir, "cas"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; const store = createFsStore(casDir); const schemas = await registerUwfSchemas(store); const detailSchemas = await registerDetailSchemas(store); diff --git a/packages/cli/src/__tests__/step-show-json.test.ts b/packages/cli/src/__tests__/step-show-json.test.ts index 6715e8e..b99e02d 100644 --- a/packages/cli/src/__tests__/step-show-json.test.ts +++ b/packages/cli/src/__tests__/step-show-json.test.ts @@ -131,16 +131,16 @@ describe("cmdStepShow JSON serialization", () => { testDir = await mkdtemp(join(tmpdir(), "uwf-test-")); casDir = join(testDir, "cas"); await mkdir(casDir, { recursive: true }); - originalEnv = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + originalEnv = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; }); afterEach(async () => { await rm(testDir, { recursive: true, force: true }); if (originalEnv === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalEnv; + process.env.OCAS_DIR = originalEnv; } }); diff --git a/packages/cli/src/__tests__/step-timing.test.ts b/packages/cli/src/__tests__/step-timing.test.ts index 5cc556f..763e386 100644 --- a/packages/cli/src/__tests__/step-timing.test.ts +++ b/packages/cli/src/__tests__/step-timing.test.ts @@ -67,17 +67,17 @@ let originalEnv: string | undefined; beforeEach(async () => { tmpDir = await mkdtemp(join(tmpdir(), "cli-uwf-step-timing-test-")); - originalEnv = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = join(tmpDir, "cas"); - await mkdir(process.env.UNCAGED_CAS_DIR, { recursive: true }); + originalEnv = process.env.OCAS_DIR; + process.env.OCAS_DIR = join(tmpDir, "cas"); + await mkdir(process.env.OCAS_DIR, { recursive: true }); }); afterEach(async () => { await rm(tmpDir, { recursive: true, force: true }); if (originalEnv === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalEnv; + process.env.OCAS_DIR = originalEnv; } }); diff --git a/packages/cli/src/__tests__/store-global-cas.test.ts b/packages/cli/src/__tests__/store-global-cas.test.ts index d65de14..7ebdc65 100644 --- a/packages/cli/src/__tests__/store-global-cas.test.ts +++ b/packages/cli/src/__tests__/store-global-cas.test.ts @@ -16,13 +16,11 @@ import { describe("Global CAS directory", () => { let tmpDir: string; let originalOcasDir: string | undefined; - let originalLegacyCasDir: string | undefined; beforeEach(async () => { tmpDir = join(tmpdir(), `uwf-test-global-cas-${Date.now()}`); await mkdir(tmpDir, { recursive: true }); originalOcasDir = process.env.OCAS_DIR; - originalLegacyCasDir = process.env.UNCAGED_CAS_DIR; }); afterEach(async () => { @@ -34,16 +32,10 @@ describe("Global CAS directory", () => { } else { process.env.OCAS_DIR = originalOcasDir; } - if (originalLegacyCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; - } else { - process.env.UNCAGED_CAS_DIR = originalLegacyCasDir; - } }); test("getGlobalCasDir returns default path when no env var set", () => { delete process.env.OCAS_DIR; - delete process.env.UNCAGED_CAS_DIR; const casDir = getGlobalCasDir(); expect(casDir).toContain(".ocas"); }); @@ -55,22 +47,8 @@ describe("Global CAS directory", () => { expect(casDir).toBe(customPath); }); - test("getGlobalCasDir respects UNCAGED_CAS_DIR environment variable", () => { - const customPath = join(tmpDir, "legacy-cas"); - process.env.UNCAGED_CAS_DIR = customPath; - const casDir = getGlobalCasDir(); - expect(casDir).toBe(customPath); - }); - - test("getGlobalCasDir prefers OCAS_DIR over UNCAGED_CAS_DIR", () => { - process.env.OCAS_DIR = join(tmpDir, "primary-cas"); - process.env.UNCAGED_CAS_DIR = join(tmpDir, "legacy-cas"); - expect(getGlobalCasDir()).toBe(join(tmpDir, "primary-cas")); - }); - test("getGlobalCasDir ignores empty OCAS_DIR", () => { process.env.OCAS_DIR = ""; - delete process.env.UNCAGED_CAS_DIR; const casDir = getGlobalCasDir(); expect(casDir).toContain(".ocas"); }); @@ -83,7 +61,7 @@ describe("Global CAS directory", () => { test("createUwfStore uses global CAS directory", async () => { const globalCasDir = join(tmpDir, "global-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage"); await mkdir(storageRoot, { recursive: true }); @@ -104,7 +82,7 @@ describe("Global CAS directory", () => { test("createUwfStore creates global CAS directory if it does not exist", async () => { const globalCasDir = join(tmpDir, "new-global-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage"); await mkdir(storageRoot, { recursive: true }); @@ -119,7 +97,7 @@ describe("Global CAS directory", () => { test("multiple uwfStore instances share the same global CAS filesystem", async () => { const globalCasDir = join(tmpDir, "shared-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot1 = join(tmpDir, "storage1"); const storageRoot2 = join(tmpDir, "storage2"); @@ -149,7 +127,7 @@ describe("Global CAS directory", () => { test("workflow registry is stored in global CAS variable store", async () => { const globalCasDir = join(tmpDir, "global-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage"); await mkdir(storageRoot, { recursive: true }); @@ -170,7 +148,7 @@ describe("Global CAS directory", () => { test("migrates workflows.yaml to variable store and renames file", async () => { const globalCasDir = join(tmpDir, "global-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage-migrate"); await mkdir(storageRoot, { recursive: true }); @@ -195,7 +173,7 @@ describe("Global CAS directory", () => { test("migrates threads.yaml to variable store and renames file", async () => { const globalCasDir = join(tmpDir, "global-cas-threads"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage-threads-migrate"); await mkdir(storageRoot, { recursive: true }); @@ -219,7 +197,7 @@ describe("Global CAS directory", () => { test("thread metadata stored in ocas variable store", async () => { const globalCasDir = join(tmpDir, "global-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage"); await mkdir(storageRoot, { recursive: true }); @@ -240,7 +218,7 @@ describe("Global CAS directory", () => { test("history is stored in global CAS variable store", async () => { const globalCasDir = join(tmpDir, "global-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage"); await mkdir(storageRoot, { recursive: true }); @@ -271,7 +249,7 @@ describe("Global CAS directory", () => { test("migrates history.jsonl to variable store and renames file", async () => { const globalCasDir = join(tmpDir, "global-cas-history"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage-history-migrate"); await mkdir(storageRoot, { recursive: true }); @@ -314,7 +292,7 @@ describe("Global CAS directory", () => { test("CAS nodes are stored in global directory", async () => { const globalCasDir = join(tmpDir, "global-cas"); - process.env.UNCAGED_CAS_DIR = globalCasDir; + process.env.OCAS_DIR = globalCasDir; const storageRoot = join(tmpDir, "storage"); await mkdir(storageRoot, { recursive: true }); diff --git a/packages/cli/src/__tests__/store-storage-root.test.ts b/packages/cli/src/__tests__/store-storage-root.test.ts index cc90711..333d70f 100644 --- a/packages/cli/src/__tests__/store-storage-root.test.ts +++ b/packages/cli/src/__tests__/store-storage-root.test.ts @@ -10,13 +10,7 @@ import { } from "../store.js"; describe("Storage root resolution", () => { - const envKeys = [ - "UWF_STORAGE_ROOT", - "WORKFLOW_STORAGE_ROOT", - "UNCAGED_WORKFLOW_STORAGE_ROOT", - "OCAS_DIR", - "UNCAGED_CAS_DIR", - ] as const; + const envKeys = ["UWF_STORAGE_ROOT", "WORKFLOW_STORAGE_ROOT", "OCAS_DIR"] as const; const savedEnv: Partial> = {}; beforeEach(() => { @@ -43,36 +37,23 @@ describe("Storage root resolution", () => { test("resolveStorageRoot prefers UWF_STORAGE_ROOT", () => { process.env.UWF_STORAGE_ROOT = "/tmp/uwf-primary"; process.env.WORKFLOW_STORAGE_ROOT = "/tmp/uwf-fallback"; - process.env.UNCAGED_WORKFLOW_STORAGE_ROOT = "/tmp/uwf-legacy"; expect(resolveStorageRoot()).toBe("/tmp/uwf-primary"); }); test("resolveStorageRoot falls back to WORKFLOW_STORAGE_ROOT", () => { process.env.WORKFLOW_STORAGE_ROOT = "/tmp/uwf-fallback"; - process.env.UNCAGED_WORKFLOW_STORAGE_ROOT = "/tmp/uwf-legacy"; expect(resolveStorageRoot()).toBe("/tmp/uwf-fallback"); }); - test("resolveStorageRoot falls back to UNCAGED_WORKFLOW_STORAGE_ROOT", () => { - process.env.UNCAGED_WORKFLOW_STORAGE_ROOT = "/tmp/uwf-legacy"; - expect(resolveStorageRoot()).toBe("/tmp/uwf-legacy"); - }); - test("getGlobalCasDir returns ~/.ocas by default", () => { const casDir = getGlobalCasDir(); expect(casDir).toBe(join(homedir(), ".ocas")); }); - test("getGlobalCasDir prefers OCAS_DIR over UNCAGED_CAS_DIR", () => { + test("getGlobalCasDir respects OCAS_DIR", () => { process.env.OCAS_DIR = "/tmp/ocas-primary"; - process.env.UNCAGED_CAS_DIR = "/tmp/ocas-legacy"; expect(getGlobalCasDir()).toBe("/tmp/ocas-primary"); }); - - test("getGlobalCasDir falls back to UNCAGED_CAS_DIR", () => { - process.env.UNCAGED_CAS_DIR = "/tmp/ocas-legacy"; - expect(getGlobalCasDir()).toBe("/tmp/ocas-legacy"); - }); }); describe("migrateStorageIfNeeded", () => { diff --git a/packages/cli/src/__tests__/thread-cancel-status.test.ts b/packages/cli/src/__tests__/thread-cancel-status.test.ts index afe4ba4..f50940c 100644 --- a/packages/cli/src/__tests__/thread-cancel-status.test.ts +++ b/packages/cli/src/__tests__/thread-cancel-status.test.ts @@ -8,7 +8,7 @@ import { addHistoryEntry, createUwfStore, loadAllHistory } from "../store.js"; async function makeUwfStore(storageRoot: string) { const casDir = join(storageRoot, "cas"); await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; return createUwfStore(storageRoot); } diff --git a/packages/cli/src/__tests__/thread-list-filters.test.ts b/packages/cli/src/__tests__/thread-list-filters.test.ts index ffe583d..717e97b 100644 --- a/packages/cli/src/__tests__/thread-list-filters.test.ts +++ b/packages/cli/src/__tests__/thread-list-filters.test.ts @@ -22,8 +22,8 @@ import { async function makeUwfStore(storageRoot: string): Promise { const casDir = join(storageRoot, "cas"); await mkdir(casDir, { recursive: true }); - // Set UNCAGED_CAS_DIR to use the test's CAS directory - process.env.UNCAGED_CAS_DIR = casDir; + // Set OCAS_DIR to use the test's CAS directory + process.env.OCAS_DIR = casDir; return createUwfStore(storageRoot); } diff --git a/packages/cli/src/__tests__/thread-location.test.ts b/packages/cli/src/__tests__/thread-location.test.ts index 1c466f1..fd8f73f 100644 --- a/packages/cli/src/__tests__/thread-location.test.ts +++ b/packages/cli/src/__tests__/thread-location.test.ts @@ -19,9 +19,9 @@ describe("Thread and edge location integration", () => { await mkdir(storageRoot, { recursive: true }); await mkdir(casDir, { recursive: true }); - // Set UNCAGED_CAS_DIR for this test - originalEnv = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + // Set OCAS_DIR for this test + originalEnv = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; } async function teardown() { @@ -30,9 +30,9 @@ describe("Thread and edge location integration", () => { } // Restore original environment if (originalEnv === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalEnv; + process.env.OCAS_DIR = originalEnv; } } diff --git a/packages/cli/src/__tests__/thread-read-quota.test.ts b/packages/cli/src/__tests__/thread-read-quota.test.ts index b68a832..830e784 100644 --- a/packages/cli/src/__tests__/thread-read-quota.test.ts +++ b/packages/cli/src/__tests__/thread-read-quota.test.ts @@ -71,17 +71,17 @@ let originalEnv: string | undefined; beforeEach(async () => { tmpDir = await mkdtemp(join(tmpdir(), "cli-uwf-quota-test-")); - originalEnv = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = join(tmpDir, "cas"); - await mkdir(process.env.UNCAGED_CAS_DIR, { recursive: true }); + originalEnv = process.env.OCAS_DIR; + process.env.OCAS_DIR = join(tmpDir, "cas"); + await mkdir(process.env.OCAS_DIR, { recursive: true }); }); afterEach(async () => { await rm(tmpDir, { recursive: true, force: true }); if (originalEnv === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalEnv; + process.env.OCAS_DIR = originalEnv; } }); diff --git a/packages/cli/src/__tests__/thread-read-xml-tags.test.ts b/packages/cli/src/__tests__/thread-read-xml-tags.test.ts index a514470..905e2f2 100644 --- a/packages/cli/src/__tests__/thread-read-xml-tags.test.ts +++ b/packages/cli/src/__tests__/thread-read-xml-tags.test.ts @@ -53,7 +53,7 @@ const DETAIL_SCHEMA = { async function makeUwfStore(storageRoot: string): Promise { const casDir = join(storageRoot, "cas"); await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; return createUwfStore(storageRoot); } diff --git a/packages/cli/src/__tests__/thread-resume.test.ts b/packages/cli/src/__tests__/thread-resume.test.ts index 096f87a..1d09aa9 100644 --- a/packages/cli/src/__tests__/thread-resume.test.ts +++ b/packages/cli/src/__tests__/thread-resume.test.ts @@ -88,7 +88,7 @@ async function setupSuspendedThread(mode: MockAgentMode): Promise<{ cwd: tmpDir, }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await seedThreads(tmpDir, { [THREAD_ID]: startHash }); const outputHash = await store.put(outputSchemaHash, { @@ -189,7 +189,7 @@ function runUwf( env: { ...process.env, WORKFLOW_STORAGE_ROOT: tmpDir, - UNCAGED_CAS_DIR: casDir, + OCAS_DIR: casDir, }, cwd: tmpDir, timeout: 30000, @@ -241,7 +241,7 @@ describe("uwf thread resume", () => { cwd: tmpDir, }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; await seedThreads(tmpDir, { [THREAD_ID]: startHash }); const result = runUwf(["thread", "resume", THREAD_ID], casDir); @@ -250,9 +250,9 @@ describe("uwf thread resume", () => { }); test("resume suspended thread executes step and becomes idle", async () => { - const originalCasDir = process.env.UNCAGED_CAS_DIR; + const originalCasDir = process.env.OCAS_DIR; const { casDir, mockAgentPath } = await setupSuspendedThread("ok"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; try { const result = runUwf(["thread", "resume", THREAD_ID, "--agent", mockAgentPath], casDir); @@ -278,17 +278,17 @@ describe("uwf thread resume", () => { expect(showResult.suspendMessage).toBeNull(); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); test("resume without -p uses suspend message as agent prompt", async () => { - const originalCasDir = process.env.UNCAGED_CAS_DIR; + const originalCasDir = process.env.OCAS_DIR; const { casDir, mockAgentPath, promptCapturePath } = await setupSuspendedThread("ok"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; try { const result = runUwf(["thread", "resume", THREAD_ID, "--agent", mockAgentPath], casDir); @@ -298,17 +298,17 @@ describe("uwf thread resume", () => { expect(capturedPrompt).toBe(SUSPEND_MESSAGE); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); test("resume with -p appends supplementary info to agent prompt", async () => { - const originalCasDir = process.env.UNCAGED_CAS_DIR; + const originalCasDir = process.env.OCAS_DIR; const { casDir, mockAgentPath, promptCapturePath } = await setupSuspendedThread("ok"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; try { const supplement = "Use the REST API."; @@ -322,17 +322,17 @@ describe("uwf thread resume", () => { expect(capturedPrompt).toBe(`${SUSPEND_MESSAGE}\n\n${supplement}`); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); test("multiple suspend/resume cycles", async () => { - const originalCasDir = process.env.UNCAGED_CAS_DIR; + const originalCasDir = process.env.OCAS_DIR; const { casDir, mockAgentPath, promptCapturePath } = await setupSuspendedThread("suspend"); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; try { const firstResult = runUwf(["thread", "resume", THREAD_ID, "--agent", mockAgentPath], casDir); @@ -370,9 +370,9 @@ describe("uwf thread resume", () => { expect(capturedPrompt).toBe(SUSPEND_MESSAGE); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); diff --git a/packages/cli/src/__tests__/thread-show-status.test.ts b/packages/cli/src/__tests__/thread-show-status.test.ts index 50f8447..4ae35ed 100644 --- a/packages/cli/src/__tests__/thread-show-status.test.ts +++ b/packages/cli/src/__tests__/thread-show-status.test.ts @@ -305,8 +305,8 @@ describe("thread show status field", () => { await setupTestEnv(); const casDir = join(tmpDir, "cas"); await mkdir(casDir, { recursive: true }); - const originalCasDir = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + const originalCasDir = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; try { const workflowPath = join(tmpDir, "test-suspend-status.yaml"); @@ -331,9 +331,9 @@ describe("thread show status field", () => { expect(result.thread).toBe(threadId); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } await teardown(); } diff --git a/packages/cli/src/__tests__/thread-start-cwd-cli.test.ts b/packages/cli/src/__tests__/thread-start-cwd-cli.test.ts index 3ccd791..15a1200 100644 --- a/packages/cli/src/__tests__/thread-start-cwd-cli.test.ts +++ b/packages/cli/src/__tests__/thread-start-cwd-cli.test.ts @@ -20,9 +20,9 @@ describe("thread start --cwd CLI option", () => { await mkdir(storageRoot, { recursive: true }); await mkdir(casDir, { recursive: true }); - // Set UNCAGED_CAS_DIR for this test - originalEnv = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + // Set OCAS_DIR for this test + originalEnv = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; } async function teardown() { @@ -31,9 +31,9 @@ describe("thread start --cwd CLI option", () => { } // Restore original environment if (originalEnv === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalEnv; + process.env.OCAS_DIR = originalEnv; } } @@ -137,7 +137,7 @@ graph: // Register the workflow execFileSync("bun", [uwfBin, "workflow", "add", workflowPath], { - env: { ...process.env, UWF_STORAGE_ROOT: storageRoot, UNCAGED_CAS_DIR: casDir }, + env: { ...process.env, UWF_STORAGE_ROOT: storageRoot, OCAS_DIR: casDir }, encoding: "utf8", }); @@ -146,7 +146,7 @@ graph: "bun", [uwfBin, "thread", "start", "test-cwd-cli", "-p", "test prompt", "--cwd", testCwd], { - env: { ...process.env, UWF_STORAGE_ROOT: storageRoot, UNCAGED_CAS_DIR: casDir }, + env: { ...process.env, UWF_STORAGE_ROOT: storageRoot, OCAS_DIR: casDir }, encoding: "utf8", }, ); diff --git a/packages/cli/src/__tests__/thread-suspend-step.test.ts b/packages/cli/src/__tests__/thread-suspend-step.test.ts index 8982426..1489baf 100644 --- a/packages/cli/src/__tests__/thread-suspend-step.test.ts +++ b/packages/cli/src/__tests__/thread-suspend-step.test.ts @@ -34,8 +34,8 @@ describe("suspend step CAS chain and threads.yaml metadata", () => { test("thread exec records suspend step in CAS and suspend metadata in threads.yaml", async () => { const casDir = join(tmpDir, "cas"); await mkdir(casDir, { recursive: true }); - const originalCasDir = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + const originalCasDir = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; try { const store = createFsStore(casDir); @@ -128,7 +128,7 @@ describe("suspend step CAS chain and threads.yaml metadata", () => { env: { ...process.env, WORKFLOW_STORAGE_ROOT: tmpDir, - UNCAGED_CAS_DIR: casDir, + OCAS_DIR: casDir, }, cwd: tmpDir, timeout: 30000, @@ -169,9 +169,9 @@ describe("suspend step CAS chain and threads.yaml metadata", () => { expect(showResult.suspendedRole).toBe("worker"); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); diff --git a/packages/cli/src/__tests__/thread-suspended-display.test.ts b/packages/cli/src/__tests__/thread-suspended-display.test.ts index cd5b82f..45ae96b 100644 --- a/packages/cli/src/__tests__/thread-suspended-display.test.ts +++ b/packages/cli/src/__tests__/thread-suspended-display.test.ts @@ -33,8 +33,8 @@ describe("suspended thread display", () => { test("thread list shows [suspended] marker for suspended threads", async () => { const casDir = join(tmpDir, "cas"); await mkdir(casDir, { recursive: true }); - const originalCasDir = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + const originalCasDir = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; try { const uwf = await createUwfStore(tmpDir); @@ -131,9 +131,9 @@ describe("suspended thread display", () => { expect(idleItem!.statusDisplay).toBe("idle"); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); @@ -141,8 +141,8 @@ describe("suspended thread display", () => { test("thread show displays suspend info and resume hint", async () => { const casDir = join(tmpDir, "cas"); await mkdir(casDir, { recursive: true }); - const originalCasDir = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + const originalCasDir = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; try { const uwf = await createUwfStore(tmpDir); @@ -219,9 +219,9 @@ describe("suspended thread display", () => { ); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); @@ -229,8 +229,8 @@ describe("suspended thread display", () => { test("non-suspended threads do not show suspend markers or hints", async () => { const casDir = join(tmpDir, "cas"); await mkdir(casDir, { recursive: true }); - const originalCasDir = process.env.UNCAGED_CAS_DIR; - process.env.UNCAGED_CAS_DIR = casDir; + const originalCasDir = process.env.OCAS_DIR; + process.env.OCAS_DIR = casDir; try { const uwf = await createUwfStore(tmpDir); @@ -278,9 +278,9 @@ describe("suspended thread display", () => { expect(threadItem!.statusDisplay).toBe("idle"); } finally { if (originalCasDir === undefined) { - delete process.env.UNCAGED_CAS_DIR; + delete process.env.OCAS_DIR; } else { - process.env.UNCAGED_CAS_DIR = originalCasDir; + process.env.OCAS_DIR = originalCasDir; } } }); diff --git a/packages/cli/src/__tests__/thread.test.ts b/packages/cli/src/__tests__/thread.test.ts index 1eefdaa..2388c85 100644 --- a/packages/cli/src/__tests__/thread.test.ts +++ b/packages/cli/src/__tests__/thread.test.ts @@ -58,7 +58,7 @@ const DETAIL_SCHEMA = { async function makeUwfStore(storageRoot: string): Promise { const casDir = join(storageRoot, "cas"); await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; return createUwfStore(storageRoot); } diff --git a/packages/cli/src/__tests__/workflow-resolution.test.ts b/packages/cli/src/__tests__/workflow-resolution.test.ts index 873f8b3..84cc38b 100644 --- a/packages/cli/src/__tests__/workflow-resolution.test.ts +++ b/packages/cli/src/__tests__/workflow-resolution.test.ts @@ -13,7 +13,7 @@ import { createUwfStore, saveWorkflowRegistry } from "../store.js"; async function makeUwfStore(storageRoot: string): Promise { const casDir = join(storageRoot, "cas"); await mkdir(casDir, { recursive: true }); - process.env.UNCAGED_CAS_DIR = casDir; + process.env.OCAS_DIR = casDir; return createUwfStore(storageRoot); } diff --git a/packages/cli/src/store.ts b/packages/cli/src/store.ts index d19daf4..17db95b 100644 --- a/packages/cli/src/store.ts +++ b/packages/cli/src/store.ts @@ -119,7 +119,7 @@ export function getDefaultStorageRoot(): string { /** * Resolve storage root. - * Priority: `UWF_STORAGE_ROOT` → `WORKFLOW_STORAGE_ROOT` → `UNCAGED_WORKFLOW_STORAGE_ROOT` (legacy) → default. + * Priority: `UWF_STORAGE_ROOT` → `WORKFLOW_STORAGE_ROOT` → default. */ export function resolveStorageRoot(): string { const primary = process.env.UWF_STORAGE_ROOT; @@ -130,10 +130,6 @@ export function resolveStorageRoot(): string { if (userOverride !== undefined && userOverride !== "") { return userOverride; } - const legacy = process.env.UNCAGED_WORKFLOW_STORAGE_ROOT; - if (legacy !== undefined && legacy !== "") { - return legacy; - } return getDefaultStorageRoot(); } @@ -145,7 +141,7 @@ export function migrateStorageIfNeeded(home: string = homedir()): void { if (!existsSync(newPath) && existsSync(oldPath)) { symlinkSync(oldPath, newPath); // biome-ignore lint/suspicious/noConsole: migration notice - console.log("⚠️ Storage migrated: ~/.uwf → ~/.uncaged/workflow (symlink)"); + console.log("⚠️ Storage linked: ~/.uwf → legacy workflow directory (symlink)"); // biome-ignore lint/suspicious/noConsole: migration notice console.log( " This symlink is temporary. Copy your data to ~/.uwf/ and remove the symlink in a future version.", @@ -157,7 +153,7 @@ export function migrateStorageIfNeeded(home: string = homedir()): void { if (!existsSync(newCas) && existsSync(oldCas)) { symlinkSync(oldCas, newCas); // biome-ignore lint/suspicious/noConsole: migration notice - console.log("⚠️ CAS storage migrated: ~/.ocas → ~/.uncaged/json-cas (symlink)"); + console.log("⚠️ CAS storage linked: ~/.ocas → legacy CAS directory (symlink)"); } } @@ -171,17 +167,13 @@ export function getCasDir(storageRoot: string): string { /** * Returns the global CAS directory shared by all uwf and ocas tools. - * Priority: `OCAS_DIR` → `UNCAGED_CAS_DIR` (legacy) → default ~/.ocas + * Priority: `OCAS_DIR` → default ~/.ocas */ export function getGlobalCasDir(): string { const primary = process.env.OCAS_DIR; if (primary !== undefined && primary !== "") { return primary; } - const legacy = process.env.UNCAGED_CAS_DIR; - if (legacy !== undefined && legacy !== "") { - return legacy; - } return join(homedir(), ".ocas"); } diff --git a/packages/protocol/package.json b/packages/protocol/package.json index ced161d..9d7bf80 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -31,12 +31,12 @@ }, "repository": { "type": "git", - "url": "https://git.shazhou.work/uncaged/workflow.git", + "url": "https://git.shazhou.work/shazhou/united-workforce.git", "directory": "packages/protocol" }, - "homepage": "https://git.shazhou.work/uncaged/workflow#readme", + "homepage": "https://git.shazhou.work/shazhou/united-workforce#readme", "bugs": { - "url": "https://git.shazhou.work/uncaged/workflow/issues" + "url": "https://git.shazhou.work/shazhou/united-workforce/issues" }, "license": "MIT" } diff --git a/packages/util-agent/README.md b/packages/util-agent/README.md index 91f7517..49fbf28 100644 --- a/packages/util-agent/README.md +++ b/packages/util-agent/README.md @@ -180,4 +180,4 @@ src/ ## Configuration -Reads `config.yaml` and `.env` from the workflow storage root (`~/.uncaged/workflow` by default). See `@united-workforce/protocol` for `WorkflowConfig` shape. Set via `uwf setup`. +Reads `config.yaml` and `.env` from the workflow storage root (`~/.uwf` by default). See `@united-workforce/protocol` for `WorkflowConfig` shape. Set via `uwf setup`. diff --git a/packages/util-agent/package.json b/packages/util-agent/package.json index 1f3e2c7..e607203 100644 --- a/packages/util-agent/package.json +++ b/packages/util-agent/package.json @@ -35,12 +35,12 @@ }, "repository": { "type": "git", - "url": "https://git.shazhou.work/uncaged/workflow.git", + "url": "https://git.shazhou.work/shazhou/united-workforce.git", "directory": "packages/util-agent" }, - "homepage": "https://git.shazhou.work/uncaged/workflow#readme", + "homepage": "https://git.shazhou.work/shazhou/united-workforce#readme", "bugs": { - "url": "https://git.shazhou.work/uncaged/workflow/issues" + "url": "https://git.shazhou.work/shazhou/united-workforce/issues" }, "license": "MIT" } diff --git a/packages/util-agent/src/storage.ts b/packages/util-agent/src/storage.ts index 34f14fa..9a9abf3 100644 --- a/packages/util-agent/src/storage.ts +++ b/packages/util-agent/src/storage.ts @@ -29,7 +29,7 @@ export function getDefaultStorageRoot(): string { /** * Resolve storage root. - * Priority: `UWF_STORAGE_ROOT` → `WORKFLOW_STORAGE_ROOT` → `UNCAGED_WORKFLOW_STORAGE_ROOT` (legacy) → default. + * Priority: `UWF_STORAGE_ROOT` → `WORKFLOW_STORAGE_ROOT` → default. */ export function resolveStorageRoot(): string { const primary = process.env.UWF_STORAGE_ROOT; @@ -40,10 +40,6 @@ export function resolveStorageRoot(): string { if (userOverride !== undefined && userOverride !== "") { return userOverride; } - const legacy = process.env.UNCAGED_WORKFLOW_STORAGE_ROOT; - if (legacy !== undefined && legacy !== "") { - return legacy; - } return getDefaultStorageRoot(); } @@ -63,17 +59,13 @@ const THREAD_VAR_PREFIX = "@uwf/thread/"; /** * Global CAS directory (same as uwf CLI). - * Priority: `OCAS_DIR` → `UNCAGED_CAS_DIR` (legacy) → default ~/.ocas + * Priority: `OCAS_DIR` → default ~/.ocas */ export function getGlobalCasDir(): string { const primary = process.env.OCAS_DIR; if (primary !== undefined && primary !== "") { return primary; } - const legacy = process.env.UNCAGED_CAS_DIR; - if (legacy !== undefined && legacy !== "") { - return legacy; - } return join(homedir(), ".ocas"); } diff --git a/packages/util/README.md b/packages/util/README.md index 463edac..61eb730 100644 --- a/packages/util/README.md +++ b/packages/util/README.md @@ -135,7 +135,7 @@ src/ ├── frontmatter-markdown/ Parse and validate agent frontmatter ├── refs-field.ts Normalize refs arrays on CAS nodes ├── result.ts ok / err helpers -├── storage-root.ts Default ~/.uncaged/workflow paths +├── storage-root.ts Default ~/.uwf paths ├── env.ts Environment variable helper ├── cli-reference.ts Markdown CLI reference generator └── types.ts LogFn, Result, logger options @@ -143,4 +143,4 @@ src/ ## Configuration -`getDefaultWorkflowStorageRoot()` resolves to `~/.uncaged/workflow` unless overridden by environment (see `storage-root.ts`). +`getDefaultWorkflowStorageRoot()` resolves to `~/.uwf` unless overridden by environment (see `storage-root.ts`). diff --git a/packages/util/package.json b/packages/util/package.json index 19a12b6..98eda74 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -28,12 +28,12 @@ }, "repository": { "type": "git", - "url": "https://git.shazhou.work/uncaged/workflow.git", + "url": "https://git.shazhou.work/shazhou/united-workforce.git", "directory": "packages/util" }, - "homepage": "https://git.shazhou.work/uncaged/workflow#readme", + "homepage": "https://git.shazhou.work/shazhou/united-workforce#readme", "bugs": { - "url": "https://git.shazhou.work/uncaged/workflow/issues" + "url": "https://git.shazhou.work/shazhou/united-workforce/issues" }, "license": "MIT" } diff --git a/packages/util/src/bootstrap-reference.ts b/packages/util/src/bootstrap-reference.ts index 4ec9d4e..60b76e0 100644 --- a/packages/util/src/bootstrap-reference.ts +++ b/packages/util/src/bootstrap-reference.ts @@ -1,15 +1,15 @@ export function generateBootstrapReference(): string { return `--- name: uwf -description: "Uncaged Workflow (uwf) — YAML 状态机工作流引擎。任务涉及 workflow 时加载此 skill。" -tags: [workflow, uwf, uncaged] +description: "United Workforce (uwf) — YAML 状态机工作流引擎。任务涉及 workflow 时加载此 skill。" +tags: [workflow, uwf] triggers: - uwf - workflow - 工作流 --- -# uwf (Uncaged Workflow) +# uwf (United Workforce) YAML 状态机工作流引擎。当用户提到「workflow」「工作流」时,指的是 **uwf workflow**(YAML 定义的状态机),不是 Hermes skill。用 \`uwf\` CLI 操作,不要混淆。 diff --git a/scripts/batch-solve.sh b/scripts/batch-solve.sh index 6426008..a82efe4 100755 --- a/scripts/batch-solve.sh +++ b/scripts/batch-solve.sh @@ -7,12 +7,12 @@ # Examples: # ./scripts/batch-solve.sh 448 449 # ./scripts/batch-solve.sh --agent "bun run $(pwd)/packages/agent-claude-code/src/cli.ts" 448 449 -# ./scripts/batch-solve.sh --repo uncaged/workflow --count 15 448 449 +# ./scripts/batch-solve.sh --repo shazhou/united-workforce --count 15 448 449 set -euo pipefail AGENT="" -REPO="uncaged/workflow" +REPO="shazhou/united-workforce" COUNT=10 ISSUES=() diff --git a/scripts/check-dev-env.sh b/scripts/check-dev-env.sh index 072b67d..74ad3a9 100755 --- a/scripts/check-dev-env.sh +++ b/scripts/check-dev-env.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Check development environment prerequisites for uncaged/workflow. +# Check development environment prerequisites for shazhou/united-workforce. # Non-interactive — prints actionable fix instructions on failure. # Exit 0 = all good, exit 1 = missing dependencies. set -euo pipefail @@ -54,7 +54,7 @@ echo "=== Workflow ===" REPO_DIR="${WORKFLOW_REPO:-$(cd "$(dirname "$0")/.." && pwd)}" check "repo at ~/repos/workflow or WORKFLOW_REPO set" \ "[ -f '$REPO_DIR/packages/cli/src/cli.ts' ]" \ - "Clone the repo: git clone https://git.shazhou.work/uncaged/workflow ~/repos/workflow" + "Clone the repo: git clone https://git.shazhou.work/shazhou/united-workforce ~/repos/workflow" # Check bun install check "node_modules installed" \ @@ -89,7 +89,7 @@ echo "" echo "=== Config ===" # Check workflow config exists -CONFIG_DIR="${UNCAGED_WORKFLOW_STORAGE_ROOT:-$HOME/.uncaged/workflow}" +CONFIG_DIR="${UWF_STORAGE_ROOT:-$HOME/.shazhou/united-workforce}" check "config.yaml exists" \ "[ -f '$CONFIG_DIR/config.yaml' ]" \ "Run: uwf setup" diff --git a/scripts/e2e-walkthrough.sh b/scripts/e2e-walkthrough.sh index f966d73..986ec26 100755 --- a/scripts/e2e-walkthrough.sh +++ b/scripts/e2e-walkthrough.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# E2E walkthrough for uncaged/workflow. -# Runs inside Docker with isolated UNCAGED_WORKFLOW_STORAGE_ROOT. +# E2E walkthrough for shazhou/united-workforce. +# Runs inside Docker with isolated UWF_STORAGE_ROOT. # Exercises: setup → workflow add → thread start/exec → cancel/fork → read/inspect. # # Usage: @@ -69,9 +69,9 @@ cat > "$E2E_DIR/run.sh" << 'INNER_SCRIPT' #!/usr/bin/env bash set -euo pipefail -# Isolated storage — never touches host's ~/.uncaged/workflow -export UNCAGED_WORKFLOW_STORAGE_ROOT="/tmp/uwf-e2e-storage" -mkdir -p "$UNCAGED_WORKFLOW_STORAGE_ROOT" +# Isolated storage — never touches host's ~/.uwf +export UWF_STORAGE_ROOT="/tmp/uwf-e2e-storage" +mkdir -p "$UWF_STORAGE_ROOT" REPO_DIR="$1" AGENT="$2" @@ -156,8 +156,8 @@ if [ -n "$PROVIDER" ] && [ -n "$MODEL" ] && [ -n "$API_KEY" ]; then run_test "uwf setup (non-interactive)" bash -c "$SETUP_CMD" else # Copy host config if available - if [ -f "$HOME/.uncaged/workflow/config.yaml" ]; then - cp "$HOME/.uncaged/workflow/config.yaml" "$UNCAGED_WORKFLOW_STORAGE_ROOT/config.yaml" + if [ -f "$HOME/.shazhou/united-workforce/config.yaml" ]; then + cp "$HOME/.shazhou/united-workforce/config.yaml" "$UWF_STORAGE_ROOT/config.yaml" echo " Copied host config.yaml" >&2 fi fi diff --git a/skills/uwf-skill.md b/skills/uwf-skill.md index 0d68c49..7659cbc 100644 --- a/skills/uwf-skill.md +++ b/skills/uwf-skill.md @@ -1,14 +1,14 @@ --- name: uwf -description: "Uncaged Workflow (uwf) — YAML 状态机工作流引擎。任务涉及 workflow 时加载此 skill。" -tags: [workflow, uwf, uncaged] +description: "United Workforce (uwf) — YAML 状态机工作流引擎。任务涉及 workflow 时加载此 skill。" +tags: [workflow, uwf] triggers: - uwf - workflow - 工作流 --- -# uwf (Uncaged Workflow) +# uwf (United Workforce) YAML 状态机工作流引擎。当用户提到「workflow」「工作流」时,指的是 **uwf workflow**(YAML 定义的状态机),不是 Hermes skill。用 `uwf` CLI 操作,不要混淆。 diff --git a/workflows/normalize-bun-monorepo.yaml b/workflows/normalize-bun-monorepo.yaml index d2c32d4..e426c49 100644 --- a/workflows/normalize-bun-monorepo.yaml +++ b/workflows/normalize-bun-monorepo.yaml @@ -742,7 +742,7 @@ roles: 6. Private packages (server, frontend, tools) must have `"private": true` and can skip publishConfig/files 7. Each package should have a `"scripts"` section with at least `"test"` if tests exist 8. Workspace dependencies should use `"workspace:^"` protocol, not version numbers - - Check: `grep -r '"@uncaged/' packages/*/package.json | grep -v 'workspace:'` + - Check: `grep -r '"@united-workforce/' packages/*/package.json | grep -v 'workspace:'` ## Verification You MUST actually run each command below and include real output. Do NOT guess or fabricate results. @@ -764,7 +764,7 @@ roles: " done # No hardcoded workspace deps - ! grep -r '"@uncaged/' packages/*/package.json | grep -v 'workspace:' | grep -v node_modules + ! grep -r '"@united-workforce/' packages/*/package.json | grep -v 'workspace:' | grep -v node_modules ``` Post-condition: Verification script shows OK for all non-private packages, no hardcoded workspace versions. @@ -849,4 +849,4 @@ roles: type: string capabilities: - workflow-config -description: Normalize an existing project to @uncaged bun monorepo conventions. Supports both TypeScript and JS/MJS projects. Each role handles one configuration layer. All roles allow fail. \ No newline at end of file +description: Normalize an existing project to @united-workforce bun monorepo conventions. Supports both TypeScript and JS/MJS projects. Each role handles one configuration layer. All roles allow fail. \ No newline at end of file diff --git a/workflows/solve-issue.yaml b/workflows/solve-issue.yaml index 86179be..f75759f 100644 --- a/workflows/solve-issue.yaml +++ b/workflows/solve-issue.yaml @@ -148,7 +148,7 @@ roles: - Crockford Base32 log tags (8-char, unique per call site) - - No `console.log` in production code (use createLogger from @uncaged/util) + - No `console.log` in production code (use createLogger from @united-workforce/util) - No dynamic imports in production code @@ -247,7 +247,7 @@ roles: \ create a new branch.\n1. Stage all changes: `git add -A`\n2. Commit with a descriptive message referencing the issue: `git commit -m \"type: description\\n\\nFixes #N\"`\n3. Push the branch: `git\ \ push -u origin `\n4. **Verify push succeeded** — run `git ls-remote origin ` and confirm it prints a commit hash.\n - If no output or push failed: capture the error, mark hook_failed\n\ 5. Create a PR using the Gitea API (do NOT use `tea pr create` — it fails in worktrees):\n ```bash\n GITEA_TOKEN=$(cfg get GITEA_TOKEN)\n curl -s -X POST -H \"Authorization: token $GITEA_TOKEN\" -H \"Content-Type: application/json\" \\\n\ - \ \"https://git.shazhou.work/api/v1/repos///pulls\" \\\n -d '{\"title\":\"...\",\"body\":\"...\",\"head\":\"\",\"base\":\"main\"}'\n ```\n - The repo remote (owner/repo format, e.g. \"uncaged/workflow\") is given in your task prompt — use it directly.\n\ + \ \"https://git.shazhou.work/api/v1/repos///pulls\" \\\n -d '{\"title\":\"...\",\"body\":\"...\",\"head\":\"\",\"base\":\"main\"}'\n ```\n - The repo remote (owner/repo format, e.g. \"shazhou/united-workforce\") is given in your task prompt — use it directly.\n\ \ - PR body must include: What / Why / Changes / Ref sections, with `Fixes #N` in Ref\n6. **Verify PR was created** — parse the curl response JSON: it must contain a `\"number\"` field. Print the PR URL.\n\ \ - If curl returns an error or no number field: capture the response, mark hook_failed\n7. After PR creation, clean up the worktree:\n - cd to the repo root (parent of .worktrees)\n - `git worktree remove `" output: Include PR URL on success or error log on failure. Set $status to committed (with prUrl) or hook_failed (with error).