workflow-generator: simplify meta to routing signals + log-to-file pattern #5

Closed
opened 2026-04-28 10:18:49 +00:00 by xiaoju · 0 comments
Owner

Context

Following the structural refactor (#3), the workflow-generator roles still have overly complex meta types (7-9 fields each). Meta should only be routing signals for the moderator. All verbose output goes to log files, content only carries summaries + file paths.

Design

Meta — one boolean per role

Role Meta true false
planner { ready: boolean } → coder → END
coder { done: boolean } → tester → coder (multi-step)
tester { passed: boolean } → committer → coder
committer { success: boolean } → END → coder

Max coder iterations capped (e.g. 5) to prevent infinite loops.

Role factories

Role Factory Mode Notes
planner createCursorRole ask Reads existing code to assess if requirements are clear. May need to understand existing workflow code for modification requests.
coder createCursorRole default Writes/modifies code. Can express done: false to continue in next iteration.
tester createHermesRole Runs validation commands (nerve validate, build, dry-run).
committer Direct spawn (no factory) Hardcoded git add/commit/push. No agent needed.

Log-to-file pattern

All verbose output goes to log files instead of thread content:

  • Committer: workflows/<name>/committer.log (git push output, hook failures)
  • Content only carries: result summary + log file path
  • Example: "push failed: pre-push hook exited 1\nsee: workflows/workflow-generator/committer.log"
  • Coder reads log files itself when fixing issues

This keeps thread context clean regardless of output length.

Moderator flow

planner →(ready?)→ coder →(done? loop)→ tester →(passed?)→ committer →(success?)→ END
                     ↑                     |                   |
                     ├── !passed ──────────┘                   |
                     └── !success ─────────────────────────────┘

Planner behavior

  • ready: true — requirements are clear, plan is in content, proceed to coder
  • ready: false — insufficient information to proceed, workflow ends
    • (Future: human role can be inserted here to answer questions)

Tasks

  1. Simplify all meta schemas to single boolean each
  2. Change planner from createLlmRole to createCursorRole (ask mode)
  3. Rewrite committer as direct spawn function (no agent factory)
  4. Implement log-to-file pattern for committer output
  5. Update moderator to match new flow (including committer → coder on failure)
  6. Update prompts for each role to match new responsibilities
  7. Rebuild dist/

Reference

  • sense-generator tester meta: { passed: boolean } — same pattern
  • Current role files: workflows/workflow-generator/roles/*/
## Context Following the structural refactor (#3), the workflow-generator roles still have overly complex meta types (7-9 fields each). Meta should only be routing signals for the moderator. All verbose output goes to log files, content only carries summaries + file paths. ## Design ### Meta — one boolean per role | Role | Meta | true | false | |------|------|------|-------| | planner | `{ ready: boolean }` | → coder | → END | | coder | `{ done: boolean }` | → tester | → coder (multi-step) | | tester | `{ passed: boolean }` | → committer | → coder | | committer | `{ success: boolean }` | → END | → coder | Max coder iterations capped (e.g. 5) to prevent infinite loops. ### Role factories | Role | Factory | Mode | Notes | |------|---------|------|-------| | planner | `createCursorRole` | ask | Reads existing code to assess if requirements are clear. May need to understand existing workflow code for modification requests. | | coder | `createCursorRole` | default | Writes/modifies code. Can express `done: false` to continue in next iteration. | | tester | `createHermesRole` | — | Runs validation commands (nerve validate, build, dry-run). | | committer | Direct spawn (no factory) | — | Hardcoded `git add/commit/push`. No agent needed. | ### Log-to-file pattern All verbose output goes to log files instead of thread content: - Committer: `workflows/<name>/committer.log` (git push output, hook failures) - Content only carries: result summary + log file path - Example: `"push failed: pre-push hook exited 1\nsee: workflows/workflow-generator/committer.log"` - Coder reads log files itself when fixing issues This keeps thread context clean regardless of output length. ### Moderator flow ``` planner →(ready?)→ coder →(done? loop)→ tester →(passed?)→ committer →(success?)→ END ↑ | | ├── !passed ──────────┘ | └── !success ─────────────────────────────┘ ``` ### Planner behavior - `ready: true` — requirements are clear, plan is in content, proceed to coder - `ready: false` — insufficient information to proceed, workflow ends - (Future: human role can be inserted here to answer questions) ## Tasks 1. Simplify all meta schemas to single boolean each 2. Change planner from `createLlmRole` to `createCursorRole` (ask mode) 3. Rewrite committer as direct spawn function (no agent factory) 4. Implement log-to-file pattern for committer output 5. Update moderator to match new flow (including committer → coder on failure) 6. Update prompts for each role to match new responsibilities 7. Rebuild dist/ ## Reference - sense-generator tester meta: `{ passed: boolean }` — same pattern - Current role files: `workflows/workflow-generator/roles/*/`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: xiaoju/nerve-workspace#5
No description provided.