Commit Graph

924 Commits

Author SHA1 Message Date
xiaomo dea6ed629e Merge pull request 'refactor: align package folder names with npm package names' (#22) from refactor/align-package-folder-names into main
CI / check (push) Failing after 8m36s
2026-06-02 15:54:11 +00:00
xingyue 5970456a54 refactor: align package folder names with npm package names
CI / check (pull_request) Failing after 8m30s
Rename packages/ subdirectories to match their @united-workforce/* scope:
  cli-workflow → cli
  workflow-agent-builtin → agent-builtin
  workflow-agent-claude-code → agent-claude-code
  workflow-agent-hermes → agent-hermes
  workflow-dashboard → dashboard
  workflow-protocol → protocol
  workflow-util-agent → util-agent
  workflow-util → util

Updated all tsconfig references, scripts, and active docs.
Historical docs (docs/plans/, docs/superpowers/) left as-is.

Closes #21
2026-06-02 23:45:45 +08:00
xiaomo e4e4288d00 Merge pull request 'fix: agent CAS path mismatch (~/.uwf/cas → ~/.ocas)' (#20) from fix/agent-cas-path into main
CI / check (push) Failing after 9m48s
2026-06-02 15:20:35 +00:00
xingyue 34ce190e5f fix: agent createAgentStore uses wrong CAS path (~/.uwf/cas instead of ~/.ocas)
CI / check (pull_request) Failing after 8m23s
createAgentStore was calling getCasDir(storageRoot) which resolves to
~/.uwf/cas/, but since Phase 3 all CAS data lives in ~/.ocas/.
getActiveThreadEntry already used getGlobalCasDir() correctly, causing
a split where thread lookup succeeded but CAS node reads failed.

Found during e2e walkthrough after Phase 0-5 migration.
2026-06-02 23:19:14 +08:00
xiaomo 65b5ebc065 Merge pull request 'Phase 5: Docs branding cleanup — @uncaged → @united-workforce' (#19) from docs/phase5-branding-cleanup into main
CI / check (push) Failing after 11m21s
2026-06-02 15:07:43 +00:00
xingyue e899c11b92 docs: update branding to @united-workforce and fix stale storage references (Phase 5)
CI / check (pull_request) Failing after 8m38s
2026-06-02 23:00:11 +08:00
xiaomo 74b81fe9ba Merge pull request 'Phase 4c: Migrate thread history from JSONL to ocas variable store' (#18) from refactor/history-to-ocas-variable into main
CI / check (push) Failing after 9m31s
2026-06-02 14:54:33 +00:00
xingyue 3e12e6ebc0 refactor: migrate thread history from JSONL to ocas variable store (Phase 4c)
CI / check (pull_request) Failing after 10m39s
2026-06-02 22:53:24 +08:00
xiaomo e881e0772b Merge pull request 'refactor: migrate threads index from YAML to ocas variable (Phase 4b)' (#17) from refactor/threads-to-ocas-variable into main
CI / check (push) Failing after 10m24s
CI / check (pull_request) Failing after 10m33s
2026-06-02 14:28:17 +00:00
xingyue 93b96987a3 refactor: migrate threads index from YAML to ocas variable store (Phase 4b)
CI / check (pull_request) Failing after 12m38s
- Replace loadThreadsIndex/saveThreadsIndex with granular variable API:
  loadAllThreads, getThread, setThread, deleteThread
- Variable: @uwf/thread/<thread-id>, value=head hash, tags=suspend metadata
- Auto-migration: threads.yaml → variables, renames to .migrated
- Updated ~20 call sites in thread.ts, step.ts, shared.ts
- workflow-util-agent: getActiveThreadEntry reads from variable store
- New test helper: seedThread/seedThreads
- biome fix: removed unused imports
- 22 files changed

Ref #11
2026-06-02 22:22:38 +08:00
xiaomo 9326cc430f Merge pull request 'refactor: migrate registry from YAML to ocas variable (Phase 4a)' (#16) from refactor/registry-to-ocas-variable into main
CI / check (push) Failing after 9m24s
2026-06-02 14:06:51 +00:00
xingyue 8052473728 refactor: migrate workflow registry from YAML to ocas variable store (Phase 4a)
CI / check (pull_request) Failing after 8m40s
- UwfStore gains varStore: VariableStore (SQLite at ~/.ocas/variables.db)
- loadWorkflowRegistry reads from @uwf/registry/* variables
- saveWorkflowRegistry writes individual @uwf/registry/<name> variables
- Auto-migration: workflows.yaml → variables on first run, renames to .migrated
- Updated callers in workflow.ts and thread.ts
- Tests updated and passing

Ref #11
2026-06-02 21:58:58 +08:00
xiaomo 323bbf4d13 Merge pull request 'refactor: remove uwf cas subcommand, use ocas CLI' (#15) from refactor/remove-uwf-cas into main
CI / check (push) Failing after 9m21s
2026-06-02 13:45:48 +00:00
xingyue 1aacf11ad9 refactor: remove uwf cas subcommand, use ocas CLI
CI / check (pull_request) Failing after 9m57s
- Remove entire 'uwf cas' command group from CLI
- Delete commands/cas.ts (only used by CLI + tests)
- Delete cas.test.ts and cas-exit-code.test.ts
- Update workflow YAMLs: uwf cas get/has/refs/walk → ocas
- Update e2e-walkthrough script to use ocas
- Update docs and reference files
- Keep store-global-cas.test.ts (internal CAS store tests)

CAS operations now go through 'ocas' CLI exclusively.
Agent text storage handled internally by uwf pipeline.

Closes #10
2026-06-02 21:30:59 +08:00
xiaomo ccc7539d52 Merge pull request 'refactor: migrate storage paths ~/.uncaged/workflow → ~/.uwf' (#14) from refactor/storage-path-migration into main
CI / check (push) Failing after 10m50s
2026-06-02 13:20:08 +00:00
xingyue eb8e98f67f refactor: migrate storage paths ~/.uncaged/workflow → ~/.uwf
CI / check (pull_request) Failing after 8m2s
- Default storage root: ~/.uncaged/workflow → ~/.uwf
- Default CAS root: ~/.uncaged/json-cas → ~/.ocas
- Env var priority: UWF_STORAGE_ROOT → WORKFLOW_STORAGE_ROOT → UNCAGED_WORKFLOW_STORAGE_ROOT (legacy)
- CAS env var: OCAS_DIR → UNCAGED_CAS_DIR (legacy)
- Auto-migration: symlink old paths on first run + deprecation warning
- Updated all comments, JSDoc, reference docs, CLAUDE.md
- New test: store-storage-root.test.ts

Closes #9
2026-06-02 21:14:48 +08:00
xiaomo 6ffe2ede5c Merge pull request 'refactor: rebrand npm packages @uncaged/* → @united-workforce/*' (#13) from refactor/rebrand-npm-packages into main
CI / check (push) Failing after 9m20s
2026-06-02 13:05:01 +00:00
xingyue e067a2f25a refactor: rebrand npm packages @uncaged/* → @united-workforce/*
CI / check (pull_request) Failing after 9m51s
Package mapping:
- @uncaged/cli-workflow → @united-workforce/cli
- @uncaged/workflow-protocol → @united-workforce/protocol
- @uncaged/workflow-util → @united-workforce/util
- @uncaged/workflow-util-agent → @united-workforce/util-agent
- @uncaged/workflow-agent-hermes → @united-workforce/agent-hermes
- @uncaged/workflow-agent-claude-code → @united-workforce/agent-claude-code
- @uncaged/workflow-agent-builtin → @united-workforce/agent-builtin
- @uncaged/workflow-dashboard → @united-workforce/dashboard

Changes:
- 8 package.json name + dependency refs
- 82 files: import statements updated
- .changeset/config.json updated
- CLAUDE.md updated
- bunfig.toml restored for preload

CLI command (uwf) and directory names unchanged.

Closes shazhou/united-workforce#8
2026-06-02 20:56:06 +08:00
xingyue 7b1db96d7e chore: remove legacy-packages (Phase 0)
CI / check (push) Failing after 8m30s
Delete all archived packages from legacy-packages/.
These were preserved for reference in the old repo but are
not needed in the new united-workforce repo.

Ref: shazhou/united-workforce#7
2026-06-02 20:28:11 +08:00
xiaomo 4786a247ac Merge pull request 'refactor: migrate test runner from vitest to bun:test' (#602) from refactor/vitest-to-bun-test into main
CI / check (push) Failing after 8m28s
2026-06-02 11:02:12 +00:00
xiaomo 6802aecb2e Merge pull request 'fix(e2e): cross-platform Docker isolation for e2e-walkthrough' (#600) from fix/e2e-walkthrough-cross-platform into main 2026-06-02 11:02:05 +00:00
xingyue e65e2aec72 refactor: migrate test runner from vitest to bun:test
- Replace vitest with bun:test across all 8 packages (47 test files)
- vi.spyOn → spyOn, vi.restoreAllMocks() → mock.restore() (3 files)
- toHaveBeenCalledOnce → toHaveBeenCalledTimes(1) (bun:test compat)
- Delete all vitest.config.ts files
- Remove vitest from devDependencies
- Add preload.ts for process.exit mock (cli-workflow)
- Fix import ordering (biome check --write)

All tests pass. Closes #601
2026-06-02 18:55:17 +08:00
xingyue 008701ef46 fix(e2e): cross-platform Docker isolation for e2e-walkthrough
Problems on macOS:
- `-v $HOME:$HOME` let container's bun install overwrite host bun
  binary (Linux ARM64 replaced macOS ARM64)
- Container couldn't reach host LLM endpoints (localhost != host)
- Hardcoded `~/repos/workflow` path didn't exist on all machines

Fixes:
- Mount source read-only (`-v $(pwd):/workspace:ro`) + copy inside
- Use container-local HOME (/root) to isolate bun/npm installs
- Add `--add-host=host.docker.internal:host-gateway` for Linux compat
- `docker cp` host config + sed localhost→host.docker.internal
- Use `debate.yaml` instead of `solve-issue.yaml` (no $SUSPEND dep)
- Fix cancel test: `--status cancelled` not `--status completed`

Verified: full 6-step walkthrough passes on macOS, host bun intact.
2026-06-02 18:28:59 +08:00
xingyue f6298c73bf fix: add missing reason field to planner insufficient_info frontmatter
The $SUSPEND edge for insufficient_info uses {{{reason}}} template
variable, but the frontmatter schema was missing the reason field.
This caused workflow validation to reject the workflow on thread start.

Fixed in all 3 copies: .workflows/, examples/, workflows/
2026-06-02 13:54:01 +08:00
xiaomo fa188ddf21 Merge pull request 'feat: rename skill subcommand to prompt, add usage/setup' (#599) from feat/prompt-subcommand into main 2026-06-02 05:46:44 +00:00
xingyue 61ee22f647 feat: rename skill subcommand to prompt, add usage/setup
Rename `uwf skill` → `uwf prompt` to align with ocas CLI convention.

Changes:
- `uwf prompt usage` — combined output of all references (for skill installation)
- `uwf prompt setup` — agent-facing setup instructions
- `uwf prompt list` — list available prompt names
- `uwf prompt <name>` — individual reference (user/author/developer/adapter/bootstrap)
- Removed: commands/skill.ts, __tests__/skill.test.ts
- Added: commands/prompt.ts, __tests__/prompt.test.ts

Ref #598
2026-06-02 13:41:46 +08:00
xiaomo dbfed616f8 Merge pull request 'feat: record suspend event as StepNode in CAS chain' (#594) from feat/589-suspend-cas-chain into main 2026-06-02 05:13:13 +00:00
xiaomo f493b251db Merge branch 'main' into feat/589-suspend-cas-chain 2026-06-02 05:13:04 +00:00
xiaomo b699200adf Merge pull request 'chore: update solve-issue workflow to use $SUSPEND for insufficient_info' (#597) from feat/592-solve-issue-suspend into main 2026-06-02 05:12:14 +00:00
xiaomo 7b13e7deb4 Merge pull request 'feat: thread list/show displays suspended state and message' (#596) from feat/591-thread-list-suspended into main 2026-06-02 05:12:12 +00:00
xiaomo b1d9eebcf7 Merge pull request 'feat: uwf thread resume command' (#595) from feat/590-thread-resume into main 2026-06-02 05:12:10 +00:00
xiaomo 6b201fd73e Merge pull request 'feat: moderator recognizes $SUSPEND as pseudo-role target' (#593) from feat/588-suspend-pseudo-role into main 2026-06-02 05:12:08 +00:00
xiaomo f67507bb32 chore: update solve-issue workflow to use $SUSPEND for insufficient_info
- .workflows/solve-issue.yaml
- examples/solve-issue.yaml
- workflows/solve-issue.yaml

All planner insufficient_info routes now use $SUSPEND instead of $END.

Closes #592
2026-06-02 04:56:59 +00:00
xiaomo 00f95547d9 Merge branch 'feat/591-thread-list-suspended' into feat/592-solve-issue-suspend 2026-06-02 04:55:21 +00:00
xiaomo f79db334a0 feat: thread list/show displays suspended state and message
- thread list: suspended threads show [suspended] marker via statusDisplay
- thread show: displays suspendedRole, suspendMessage, and resume hint
- New ThreadShowOutput type with hint field
- Tests: 3 cases for display formatting

Closes #591
2026-06-02 04:55:08 +00:00
xiaomo 8e7aa3362a feat: uwf thread resume command
- New CLI: uwf thread resume <thread-id> [-p "supplement"]
- Validates thread is suspended, reads suspendedRole/suspendMessage
- Executes step as suspendedRole with resume prompt
- Clears suspend metadata on success
- Refactored cmdThreadStepOnce into composable helpers
- Tests: 5 cases including error, idle transition, prompt injection, cycles

Closes #590
2026-06-02 04:47:47 +00:00
xiaomo 10b478640d feat: record suspend event as StepNode in CAS chain
- ThreadIndexEntry supports suspendedRole + suspendMessage metadata
- threads.yaml: suspended threads serialize as objects (backward compat)
- cmdThreadStepOnce writes step before marking thread suspended
- StepOutput extended with suspendedRole/suspendMessage fields
- thread show displays suspend message

Closes #589
2026-06-02 04:44:05 +00:00
xiaomo b0ef9c55a9 feat: moderator recognizes $SUSPEND as pseudo-role target
- Add GraphPseudoRole type ($END | $SUSPEND) to workflow-protocol
- Add 'suspended' to ThreadStatus
- evaluate() returns EvaluateSuspendResult for $SUSPEND targets
- Thread show/list derive suspended status from moderator evaluation
- validate-semantic treats $SUSPEND like $END (valid target, no outgoing edges)
- Tests: routing to $SUSPEND, mustache rendering, thread status display

Closes #588
2026-06-02 04:39:29 +00:00
xingyue a335471cc7 Merge pull request 'chore: migrate json-cas to ocas' (#586) from chore/migrate-ocas into main 2026-06-02 03:07:50 +00:00
xiaomo 7a0c928a4a docs: update all docs to reference @ocas/core and ocas_ref
- README.md, docs/architecture.md, docs/wf-stateless-design.md
- docs/builtin-agent-research.md
- All package README.md files
- cas_ref → ocas_ref, @uncaged/json-cas → @ocas/core, json-cas-fs → @ocas/fs
2026-06-02 02:55:42 +00:00
xiaomo d8181e9fdf fix: config test reads source file from correct path
Test was reading from dist/commands/config.ts which doesn't exist
(only .js files in dist). Navigate to src/ instead.
2026-06-02 02:53:35 +00:00
xiaomo ef0174a6f1 chore: migrate @uncaged/json-cas to @ocas/core, @uncaged/json-cas-fs to @ocas/fs
- Replace all package.json dependencies
- Update all imports across 7 packages + scripts
- cas_ref → ocas_ref in schema definitions
- listByType() adapted for ListEntry[] return type
- Update CLAUDE.md references

Fixes #585
2026-06-02 02:51:21 +00:00
xiaomo 2a72dcde20 Merge pull request 'feat: !include YAML tag and folder-based workflow layout' (#584) from feat/include-and-folder-workflow into main 2026-05-31 04:54:16 +00:00
xiaomo b1759096a2 fix: biome 2.4.16 migration, reduce scanWorkflowDir complexity, fix formatting 2026-05-31 04:52:08 +00:00
xiaomo f8c06ada64 style: fix biome lint (template literal, import sorting) 2026-05-31 04:48:16 +00:00
xiaomo 806edb2750 style: fix biome lint (import sorting, formatting) 2026-05-31 04:44:09 +00:00
xiaomo da1678ffef fix: address review feedback on !include and folder workflow
- Fix nested !include: pass customTags recursively, scoped to included file's dir
- Add path traversal guard: !include paths must resolve within base directory
- Fix discoverProjectWorkflows: scan both .workflow/ and .workflows/ (consistent with findWorkflowInDir)
- Add tests: path traversal blocking, nested !include, absolute path rejection
2026-05-31 04:26:54 +00:00
xiaomo 88c251fc14 feat: !include YAML tag and folder-based workflow layout
- Add !include custom YAML tag for referencing external files (Fixes #582)
  - .md/.txt files included as strings
  - .json files parsed as JSON objects
  - .yaml/.yml files parsed as YAML objects
  - Paths resolved relative to the workflow YAML file

- Support foo/index.yaml as alternative to foo.yaml (Fixes #583)
  - Updated discoverProjectWorkflows(), findWorkflowInDir()
  - Updated workflowNameFromPath() for index.yaml detection
  - Flat files take priority over folder layout

- Added tests for both features
2026-05-31 04:12:11 +00:00
xiaoju 9fb817a99c Merge pull request 'improve: solve-issue — replace tea pr create with Gitea API' (#581) from retrospect/fix-committer-tea into main 2026-05-30 23:37:31 +00:00
xiaoju f9b8cf025e fix: add repoRemote to planner required fields 2026-05-30 23:36:49 +00:00