feat(cli-workflow): implement multi-strategy workflow resolution #438

Merged
xiaomo merged 1 commits from fix/428-multi-strategy-workflow-resolution into main 2026-05-23 11:12:57 +00:00
Owner

What

Implement 4-strategy workflow resolution for uwf thread start.

Why

Resolves #428 — allow workflows to be referenced via CAS hash, file path, local directory discovery, or global registry.

Changes

  • thread.ts: Refactor resolveWorkflowCasRef with 4-strategy priority (hash → path → discovery → registry)
  • Add helpers: isFilePath, workflowFileExists, findWorkflowInDir, findWorkflowInParents
  • Support .workflow/ and .workflows/ dirs with .yaml/.yml extensions
  • New test file: 367 lines, 24 test cases covering all strategies and edge cases

Ref

Fixes #428

小橘 🍊(NEKO Team)

## What Implement 4-strategy workflow resolution for `uwf thread start`. ## Why Resolves #428 — allow workflows to be referenced via CAS hash, file path, local directory discovery, or global registry. ## Changes - `thread.ts`: Refactor `resolveWorkflowCasRef` with 4-strategy priority (hash → path → discovery → registry) - Add helpers: `isFilePath`, `workflowFileExists`, `findWorkflowInDir`, `findWorkflowInParents` - Support `.workflow/` and `.workflows/` dirs with `.yaml`/`.yml` extensions - New test file: 367 lines, 24 test cases covering all strategies and edge cases ## Ref Fixes #428 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-05-23 11:12:23 +00:00
- Add 4-strategy resolution priority: CAS hash → file path → local discovery → global registry
- Add helper functions: isFilePath, workflowFileExists, findWorkflowInDir, findWorkflowInParents
- Refactor resolveWorkflowCasRef to support direct hash, explicit paths, and parent traversal
- Add comprehensive test suite with 24 tests covering all strategies and edge cases
- Support .workflow/ and .workflows/ directories with .yaml/.yml extensions
- All 60 tests pass across 5 test files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xiaomo approved these changes 2026-05-23 11:12:56 +00:00
xiaomo left a comment
Owner

LGTM #436 同样的核心逻辑,去掉了 lint 噪音,干净。

findWorkflowInParents.git 停止逻辑那个 minor 还在,follow-up 修。

LGTM ✅ 和 #436 同样的核心逻辑,去掉了 lint 噪音,干净。 `findWorkflowInParents` 的 `.git` 停止逻辑那个 minor 还在,follow-up 修。
xiaomo merged commit 52879c0028 into main 2026-05-23 11:12:57 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#438