refactor: migrate registry from YAML to ocas variable (Phase 4a) #16
Reference in New Issue
Block a user
Delete Branch "refactor/registry-to-ocas-variable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Migrate workflow registry from
workflows.yamlto ocas VariableStore (SQLite).Why
Phase 4a of issue #11 — first step of data layer migration.
Changes
UwfStoregainsvarStore: VariableStore(SQLite at~/.ocas/variables.db)loadWorkflowRegistry(varStore)reads@uwf/registry/*variablessaveWorkflowRegistry(varStore, name, hash)sets individual variablesworkflows.yaml→ variables on firstcreateUwfStore(), renames to.migratedworkflow.tsandthread.tsVariable schema
@uwf/registry/<workflow-name>→ CAS hashVerification
bun run check✅bun run test✅ (401 CLI tests)Ref #11
LGTM ✅
Registry → ocas variable 迁移干净:
UwfStore新增varStore字段,createUwfStore统一初始化@uwf/registry/<name>清晰loadWorkflowRegistry/saveWorkflowRegistry从 async YAML 读写变为同步 variable 操作,调用点简化workflows.yaml→ 导入 variables → rename.migrated(可逆可追溯)resolveWorkflowCasRef去掉了storageRoot参数,直接用uwf.varStoremakeUwfStore统一改用createUwfStore,减少重复代码