Commit Graph

27 Commits

Author SHA1 Message Date
xingyue 87b893bd28 refactor: remove all uncaged codename references
CI / check (pull_request) Failing after 8m0s
- Remove UNCAGED_CAS_DIR and UNCAGED_WORKFLOW_STORAGE_ROOT env var fallbacks
- Tests updated to use OCAS_DIR / UWF_STORAGE_ROOT
- All docs, READMEs, scripts, workflows, skills updated
- Only symlink migration code retains .uncaged paths (functional requirement)

Closes #12 (Phase 5 complete)
2026-06-03 00:08:45 +08: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
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 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
xiaoju f9b8cf025e fix: add repoRemote to planner required fields 2026-05-30 23:36:49 +00:00
xiaoju d10f55294a improve: solve-issue — replace tea pr create with Gitea API curl
Fixes the committer role's inefficiency (thread 06F7JE4NDERP6J3W2RWVFQVQ7G analysis).

1. **Committer procedure**: Replace `tea pr create` with direct Gitea API calls via curl
   - Eliminates 15-18 wasted turns (~30-40% overhead) caused by incorrect tea CLI syntax
   - Adds verification steps: check push success + verify PR creation response
   - Warns explicitly: "do NOT use tea pr create — it fails in worktrees"

2. **Planner enhancement**: Extract and propagate `repoRemote` (owner/repo) in frontmatter
   - Downstream roles no longer need to extract repo info from git remote
   - Reduces discovery overhead and shell parsing errors

3. **Frontmatter schema updates**: Add `repoRemote` field to all roles
   - Developer, reviewer, tester, committer all propagate repoRemote
   - Ensures consistent data flow through the graph

4. **Graph prompt updates**: Pass `{{{repoRemote}}}` through all transitions
   - All roles receive repo remote context in task prompts
   - Committer receives "Repo remote (owner/repo): {{{repoRemote}}}"

5. **Test updates**: Update `solve-issue-tea-worktree.test.ts`
   - Expect curl API instead of tea pr create
   - Verify warning against tea pr create exists
   - All 8 tests pass

-  15-18 fewer turns per thread in committer role (30-40% reduction)
-  ~20-30 seconds saved per thread execution
-  Improved reliability — no CLI version/config dependencies
-  Cross-platform compatibility — works anywhere with curl + git

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-30 22:38:28 +00:00
xiaoju 0ece23f03e improve: solve-issue — add mandatory verification and escalation steps
Fixes hallucination issues observed in thread 06F7FSTXQGY3D5CY5YPQFK2Y3W:

1. Developer self-verification (critical): Added step 12 requiring
   mandatory verification of branch, file existence, and git status
   before reporting done status. Prevents hallucinated completions
   without actual tool execution.

2. Reviewer hard-check enforcement (critical): Added critical warning
   and step 0 requiring cd/pwd verification before review. Prevents
   false rejections based on assumptions without actual path checks.

3. Test debugging escalation (medium): Added structured debugging
   guidance with escalation path after 3 test cycles. Prevents
   infinite retry loops by providing strategy and fail-fast guidance.

Also added 3 test cases to verify the new procedure steps exist.

Based on change plan 9EVZPDTS16PMG analyzing execution anomalies
that resulted in 58% waste (13 of 23 minutes).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-30 22:37:42 +00:00
xingyue 0fcab06b80 improve(workflow): solve-issue — fix committer tea PR creation in worktrees
- Remove --repo flag from tea pr create (fails in git worktrees)
- Add guard to skip staging when developer already committed changes

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-05-30 15:41:08 +08:00
xiaoju 9c26285424 chore: make solve-issue.yaml portable and add developer failed exit
- Remove hardcoded ~/repos/workflow paths from procedure text
- Use .worktrees/ relative to repo root instead of global path
- Add developer failed → $END exit for unrecoverable situations
- Add worktree field to reviewer rejected variant
- Fix test workflowPath to use import.meta.dirname

Refs #506
2026-05-25 09:07:58 +00:00
xiaoju 827ff13c4a refactor: discriminated union frontmatter for solve-issue workflow
- planner: oneOf ready (plan, repoPath) | insufficient_info
- developer: single exit, plain object (branch, worktree), no $status
- reviewer: oneOf approved (branch, worktree) | rejected (comments)
- tester: oneOf passed (branch, worktree) | fix_code (report) | fix_spec (report)
- committer: oneOf committed (prUrl) | hook_failed (error)
- Edge prompts now use mustache templates with variant-specific fields
- Developer simplified from 2 exits to single exit (unit routing)

Phase 2 of #499 (closes #501)
2026-05-25 06:34:56 +00:00
xiaoju 7a19ceca89 refactor: rename status to $status, default to _ when absent
- evaluate() reads $status instead of status, defaults to _ when missing
- Update all YAML examples and .workflows to use $status
- Update cli-workflow resolveEvaluateArgs to use $status
- 10 moderator tests pass including new default _ test
- Single-exit roles no longer need to declare status field

Phase 1 of #499 (closes #500)
2026-05-25 06:22:53 +00:00
xiaoju e40e41555b refactor: dashboard status-based edge routing
- Rename ConditionalEdge → StatusEdge, condition → status throughout
- Rename conditional.tsx → status.tsx, edge label shows status value
- Update trans-in/trans-out to use status field instead of condition
- Update validate to check status edges
- Align server/workflow.ts with new WorkflowPayload.graph format
- 20 dashboard tests pass

Phase 3 of #490 (closes #493)
2026-05-25 05:05:57 +00:00
xiaoju 9ab6291a41 fix(workflow): add --repo flag to tea pr create in worktree dirs
Fixes #474
2026-05-24 16:56:19 +00:00
xiaoju b0e3f4a363 feat: use git worktree for isolated development in solve-issue workflow
All roles (developer, reviewer, tester, committer) now work in
~/repos/workflow-worktrees/fix/<issue>-<slug> instead of modifying
the main working directory. Prevents self-destructive edits.

Fixes #464
2026-05-24 10:22:25 +00:00
xiaoju 155b879d29 chore(workflow): developer must rebase main when bounced back
Prevents duplicate lint fixes when main already has the fixes.

小橘 🍊(NEKO Team)
2026-05-23 10:57:44 +00:00
xiaoju 3d6399c0e3 feat: make edge prompt required (Phase 1)
- Transition.prompt: string | null → string
- EvaluateResult.prompt: string | null → string
- AgentContext.edgePrompt: string | null → string
- CLI YAML validation rejects missing prompt
- All tests updated

Phase 2 will replace edgePrompt === null checks with findLastRoleIndex.

Refs #405, #406, #404
2026-05-23 04:28:58 +00:00
xiaoju aeb7180e9d chore: fix meta.plan → frontmatter.plan in workflow procedures
小橘 <xiaoju@shazhou.work>
2026-05-22 11:22:34 +00:00
xiaoju c9507b8dc1 fix: add git worktree hygiene to solve-issue workflow
Developer: checkout main + create fresh branch before coding.
Reviewer: verify branch matches issue before reviewing.

Fixes #395

小橘 <xiaoju@shazhou.work>
2026-05-22 10:59:08 +00:00
xiaoju a803fcb4fc fix: solve-issue.yaml meta.plan → frontmatter.plan
Follows #375 rename.
2026-05-22 09:04:34 +00:00
xiaoju 3b7d0564bb feat: uwf cas put-text for storing plain text in CAS
- Register built-in text schema ({type: 'string'}) alongside workflow schemas
- Add cmdCasPutText command: uwf cas put-text <text>
- Update CLI reference in workflow-util
- Update solve-issue.yaml procedure to use put-text

Refs #380
2026-05-22 08:53:27 +00:00
xiaoju e5ae9a134c feat: register $first/$last JSONata functions in moderator
Register custom $first(role) and $last(role) functions in the JSONata
evaluator. These search the steps array and return the matching role's
frontmatter (output) directly, replacing verbose steps[-1].output.x
expressions with semantic $last('role').field syntax.

- workflow-moderator: register functions via expr.registerFunction()
- Updated all condition expressions in .workflows/ and examples/
- Added tests for $last, $first, and unmatched role (undefined)

Fixes #376
2026-05-22 06:29:56 +00:00
xiaoju 02f7f0b708 refactor!: rename RoleDefinition.meta → frontmatter
BREAKING CHANGE: All workflow YAML files must use 'frontmatter' instead of 'meta'.

- workflow-protocol: RoleDefinition.meta → frontmatter, schema updated
- cli-workflow: validate.ts, workflow.ts — resolveMetaRef → resolveFrontmatterRef
- workflow-agent-kit: run.ts — metaSchema → frontmatterSchema
- All YAML files updated (examples/, .workflows/)

Fixes #374
2026-05-22 06:05:07 +00:00
xiaoju 8a425521da fix: output instructions now specify required frontmatter meta fields 2026-05-22 05:42:17 +00:00
xiaoju f174f2fd0a fix: remove redundant condition null from $START 2026-05-22 05:33:39 +00:00
xiaoju 355594d074 refactor: graph fallback pattern + positive condition names
- Last transition in each graph node is now the fallback (no condition)
- Remove redundant positive conditions (ready, devDone, approved, passed, pushSuccess)
- notApproved → rejected (positive naming)
2026-05-22 05:31:43 +00:00
xiaoju fd7609fe90 fix: address review feedback from xingyue
1. npm/npx → bun/bunx (project standard)
2. Fix tea CLI usage (tea comment + -r flag)
3. cursor-agent → coding (abstract capability)
4. Clarify committer inherits developer's worktree
5. Mark meta.plan required when status=ready
6. PR description must follow What/Why/Changes/Ref template
7. Note maxRounds loop protection in description
2026-05-22 05:27:21 +00:00
xiaoju dacecfbbb7 feat: create .workflows/solve-issue.yaml
TDD-driven issue resolution workflow with 5 roles:
- planner: analyzes issue, outputs TDD test spec (stored in CAS)
- developer: implements code following TDD
- reviewer: code standards compliance check (not functionality)
- tester: functional correctness verification
- committer: commits and creates PR

Graph handles bounce-backs: reviewer→developer, tester→developer,
tester→planner (fix_spec), committer→developer (hook_failed).

Refs #370
2026-05-22 05:21:19 +00:00