From 076c5eb207dc4134992d21c7c2b288d75703911f Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 3 Sep 2026 04:40:31 +1000 Subject: [PATCH] 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. --- ARCHITECTURE.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 843de8632..301894e67 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -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: