docs(architecture): task-lifecycle provenance addendum; fix stale routing table

Completes another piece of archie-core-t2db.6 (ARCHITECTURE.md task
lifecycle should say a playbook-binding task has different provenance
from a forge-issue task) -- states the dual-enqueue-mechanism finding
from docs/architecture/bindings.md directly in ARCHITECTURE.md's own
task lifecycle section, cross-referencing both.

Also fixed a second, related staleness caught while in this section:
"Routing (Route)" presented the label->workflow table as fixed/hardcoded,
which the t2db.9/.10 YAML-override work (this session) already made
untrue. Updated to describe the actual current behavior.

Corrected one wrong path in-flight before committing: the
event-sources-and-reactions.md decision doc lives under docs/prds/, not
docs/architecture/ -- checked with ls, not assumed.
This commit is contained in:
sam committed 2026-09-03 04:40:31 +10:00
1 parent 133cac8370
commit 076c5eb207
1 file changed
+20 -1
+20 -1
View File
@@ -63,6 +63,16 @@ dashboard and `/api/tasks`. Retries are an explicit operator action capped by
**PR reconciliation:** the daemon polls open PRs, checks GitHub state
(`merged`/`closed`), transitions the task, and cleans up worktrees.
**Provenance by origin:** a task's origin determines which enqueue path
created it, though every origin converges on the same `tasks` table and the
same `Route`/`Run` lifecycle above once queued. Forge-polled tasks enqueue via
`workintake.TaskEnvelope` (see `docs/prds/event-sources-and-
reactions.md`'s decided contract); playbook-binding-dispatched tasks enqueue
via `EnqueueChatTask`/`EnqueueBindingTask` (`internal/store`), the same direct
path chat-spawned tasks use, stamped with `binding_id`/`binding_version` for
provenance. See `docs/architecture/bindings.md` for the binding model and its
threat model in full.
## Workflow Engine
### Core types (`workflow.go`)
@@ -77,13 +87,22 @@ dashboard and `/api/tasks`. Retries are an explicit operator action capped by
### Routing (`Route`)
Label-driven, no LLM involved. Pre-assigned workflow wins; then labels decide:
Label-driven, no LLM involved. Pre-assigned workflow wins; then labels decide.
The built-in bindings are:
- `bug` → `tdd`
- `feature` → `feasibility`
- `bootstrap` → `bootstrap` (diagnostics, no LLM spend)
- Default → `implement`
Both the closed `bug`/`feature`/`bootstrap` set's target workflow and
arbitrary additional labels are YAML-overridable at daemon startup
(`internal/domain/workflow/routing.go`'s `LoadKindWorkflowsYAML`/
`LoadLabelWorkflowsYAML`, `WorkflowRoutingFile`/`WorkflowLabelsFile`/
`PlaybookDirs` config) -- see `docs/prds/eda-playbook-engine.md`. A label
already owned by the closed kind set, or a binding declared twice across
sources, is a reported load failure, not a silent override.
### Execution (`Run`)
Stages execute sequentially. After each stage: