Shipped workflows are Go code behind a fake YAML vocabulary; rewrite them in general step types #1440

Closed
opened 2026-10-27 13:40:24 +00:00 by sam · 0 comments
Owner

BuiltinStepRegistry (internal/domain/workflow/definition.go) turns every stage of the seven hard-coded Go workflows (bootstrap, feasibility, implement, pr-review, remediate, tdd, triage) into a step type named .. About 45 of the ~50 step types are these. They take no settings, cannot be reordered or reused outside their own workflow, and their names say nothing to an operator. The YAML is a facade over Go.

Done when:

  • A small set of general step types covers what the stages do: agent.run (mission, role, read_only) for the thinking stages; repository steps for commit-push, open-pr and a diff-size gate; command.run and gate.diff-rules for checks; workflow.call for composition. Add only the generic steps that are missing.
  • Each shipped workflow that is worth keeping is rewritten in those types, so its YAML reads as what it does. bootstrap (writes .archie/bootstrap.md and opens a PR to prove the plumbing) is deleted, not rewritten.
  • BuiltinStepRegistry, legacyBuiltinWorkflows and retiredSteps are deleted, and the vocabulary is only the general types.

Design

Workflow language the shipped Go workflows need, from an inventory of every stage:

  1. Step ids and references: {{ task.* }}, {{ inputs.* }}, {{ steps..* }}, earlier steps only, checked at save.
  2. Structured step results: agent.run takes result_schema (the triage/feasibility decide tool), referenced as steps..result..
  3. Conditions: when: on any step, over task, inputs and earlier results.
  4. Outcomes: workflow.finish with status (completed, no-change, wont-do, parked, waiting-human, pr-open) and detail; a step's on_failure: park | continue.
  5. Handoff: workflow.call with a templated workflow id (triage routes, feasibility hands to implement after approval).
  6. Human gates: human.approve (feasibility go/no-go, pr-review operator approval).
  7. Forge actions: forge.comment (issue or PR), forge.reply (review thread), forge.close-issue, repo.open-pr.
  8. Repository actions: repo.prepare (fresh or task branch), repo.commit (message), repo.push, gate.diff-size.
  9. Checks: command.run with expect_failure and captured output as a step result (tdd repro proof); repository gate as an agent.run setting; baseline gate with optional agent repair.
  10. Counters and caps: per-task counters readable in when: (remediation round cap).
  11. Agent controls: role, read_only, budget, extra rules, protected paths.
  12. Every step emits start, finish, outcome and duration on NATS, for the canvas.
    Build order: 1+2+4 (agent.run usable end to end), then 8+9 (rewrite implement, tdd), then 3+5+6+7 (feasibility, triage), then 10 (remediate). pr-review ships as one review.pr step with depth. Delete BuiltinStepRegistry last.

Notes

2026-10-04: bootstrap deleted (9b0a4c75). triage and feasibility are kept: triage is the fallback router for unmatched tasks, feasibility the default for features. Blocker for the rest: agent.run cannot read an earlier step's result (implement's build reads plan's output via TaskContext fields), so the general vocabulary needs step ids plus references to earlier step outputs before any workflow can be rewritten.
Added to design: 13. Retries: retry: {attempts, backoff} on any step, retrying only that step. 14. Parallel branches: a parallel step holding named branches of steps that run concurrently; all must finish (or any, per setting) before the next step; branch step results are referenceable as steps..

Close reason

All six shipped workflows are YAML over 17 general step types (agent.run, repo., gate., forge., human.approve, workflow.call/handoff/finish, review., command.run); step ids, {{ }} references, result schemas, when, on_failure, retry and parallel branches are in the language. BuiltinStepRegistry and the . types are deleted.


Imported from beads archie-core-m14o · GitHub #1408 · type task · priority P1 · created 2026-10-04 · closed 2026-10-04

BuiltinStepRegistry (internal/domain/workflow/definition.go) turns every stage of the seven hard-coded Go workflows (bootstrap, feasibility, implement, pr-review, remediate, tdd, triage) into a step type named <workflow>.<stage>. About 45 of the ~50 step types are these. They take no settings, cannot be reordered or reused outside their own workflow, and their names say nothing to an operator. The YAML is a facade over Go. Done when: - A small set of general step types covers what the stages do: agent.run (mission, role, read_only) for the thinking stages; repository steps for commit-push, open-pr and a diff-size gate; command.run and gate.diff-rules for checks; workflow.call for composition. Add only the generic steps that are missing. - Each shipped workflow that is worth keeping is rewritten in those types, so its YAML reads as what it does. bootstrap (writes .archie/bootstrap.md and opens a PR to prove the plumbing) is deleted, not rewritten. - BuiltinStepRegistry, legacyBuiltinWorkflows and retiredSteps are deleted, and the vocabulary is only the general types. ### Design Workflow language the shipped Go workflows need, from an inventory of every stage: 1. Step ids and references: {{ task.* }}, {{ inputs.* }}, {{ steps.<id>.* }}, earlier steps only, checked at save. 2. Structured step results: agent.run takes result_schema (the triage/feasibility decide tool), referenced as steps.<id>.result.<field>. 3. Conditions: when: on any step, over task, inputs and earlier results. 4. Outcomes: workflow.finish with status (completed, no-change, wont-do, parked, waiting-human, pr-open) and detail; a step's on_failure: park | continue. 5. Handoff: workflow.call with a templated workflow id (triage routes, feasibility hands to implement after approval). 6. Human gates: human.approve (feasibility go/no-go, pr-review operator approval). 7. Forge actions: forge.comment (issue or PR), forge.reply (review thread), forge.close-issue, repo.open-pr. 8. Repository actions: repo.prepare (fresh or task branch), repo.commit (message), repo.push, gate.diff-size. 9. Checks: command.run with expect_failure and captured output as a step result (tdd repro proof); repository gate as an agent.run setting; baseline gate with optional agent repair. 10. Counters and caps: per-task counters readable in when: (remediation round cap). 11. Agent controls: role, read_only, budget, extra rules, protected paths. 12. Every step emits start, finish, outcome and duration on NATS, for the canvas. Build order: 1+2+4 (agent.run usable end to end), then 8+9 (rewrite implement, tdd), then 3+5+6+7 (feasibility, triage), then 10 (remediate). pr-review ships as one review.pr step with depth. Delete BuiltinStepRegistry last. ### Notes 2026-10-04: bootstrap deleted (9b0a4c75). triage and feasibility are kept: triage is the fallback router for unmatched tasks, feasibility the default for features. Blocker for the rest: agent.run cannot read an earlier step's result (implement's build reads plan's output via TaskContext fields), so the general vocabulary needs step ids plus references to earlier step outputs before any workflow can be rewritten. Added to design: 13. Retries: retry: {attempts, backoff} on any step, retrying only that step. 14. Parallel branches: a parallel step holding named branches of steps that run concurrently; all must finish (or any, per setting) before the next step; branch step results are referenceable as steps.<id>. ### Close reason All six shipped workflows are YAML over 17 general step types (agent.run, repo.*, gate.*, forge.*, human.approve, workflow.call/handoff/finish, review.*, command.run); step ids, {{ }} references, result schemas, when, on_failure, retry and parallel branches are in the language. BuiltinStepRegistry and the <workflow>.<stage> types are deleted. --- _Imported from beads `archie-core-m14o` · GitHub #1408 · type task · priority P1 · created 2026-10-04 · closed 2026-10-04_
sam added the hightask labels 2026-10-27 13:40:24 +00:00
sam self-assigned this 2026-10-27 13:40:24 +00:00
sam closed this issue 2026-10-27 13:40:24 +00:00
sam added a new dependency 2026-10-27 13:42:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1440