|
| 1 | +# Natural-Language Loop Runtime |
| 2 | + |
| 3 | +Status: accepted |
| 4 | +Date: 2026-06-09 |
| 5 | +Question: Should Decodex expose execution graphs as the user workflow, or keep graph |
| 6 | +semantics internal behind a natural-language loop runtime? |
| 7 | +Decision: Decodex should be a natural-language-first loop runtime. Research produces a |
| 8 | +latent Loop/Decision Contract, accepted decisions promote into an internal Execution |
| 9 | +Program, and normal Linear issues remain the executable Decodex lanes. |
| 10 | + |
| 11 | +## Context |
| 12 | + |
| 13 | +The current Decodex runtime already owns issue eligibility, retained worktrees, |
| 14 | +tracker writes, validation gates, review handoff, retained review repair, landing, |
| 15 | +closeout, and operator status. A loop-engineering layer needs dependency, ordering, |
| 16 | +conflict-domain, and drift semantics, but exposing those mechanics directly would make |
| 17 | +ordinary use more complicated than the existing Codex conversation workflow. |
| 18 | + |
| 19 | +The intended everyday flow is: |
| 20 | + |
| 21 | +1. The user discusses and researches work in Codex conversation. |
| 22 | +2. Research or design produces a latent decision package. |
| 23 | +3. The user accepts the direction or asks Decodex to arrange or push it forward. |
| 24 | +4. Decodex promotes accepted decisions into internal execution state and normal Linear |
| 25 | + lanes. |
| 26 | + |
| 27 | +## Decision |
| 28 | + |
| 29 | +Decodex keeps graph semantics backstage. |
| 30 | + |
| 31 | +- The user-facing surface stays natural language. |
| 32 | +- Decodex owns a native Research/Decision stage for Decodex work. |
| 33 | +- Research output is latent until accepted or promoted. |
| 34 | +- Accepted decisions become a Loop/Decision Contract. |
| 35 | +- The loop runtime derives an internal Execution Program with DAG semantics such as |
| 36 | + objective lineage, dependencies, stage, conflict domain, acceptance criteria, queue |
| 37 | + intent, ready-node selection, and drift handling. |
| 38 | +- Normal Linear issues remain the executable Decodex lanes. |
| 39 | +- Phase-scoped Codex goals are allowed; one giant "finish issue" goal is not. |
| 40 | +- Goal completion triggers validation or review. It does not prove lane completion. |
| 41 | +- Self-review is cheap smoke. Completion depends on deterministic validation and, |
| 42 | + where risk warrants, independent fresh-context read-only review. |
| 43 | +- Long unattended execution must stop affected branches for contract or architecture |
| 44 | + decisions when execution discovers uncovered direction, while continuing independent |
| 45 | + ready nodes. |
| 46 | + |
| 47 | +The normative contract lives in [`../spec/loop-runtime.md`](../spec/loop-runtime.md). |
| 48 | + |
| 49 | +## Rejected Alternative |
| 50 | + |
| 51 | +The rejected alternative is a user-visible DAG workflow with graph ids, explicit edge |
| 52 | +editing, dry-run/apply/status mechanics, or direct manipulation of Codex goal state as |
| 53 | +the ordinary interface. |
| 54 | + |
| 55 | +That design would expose implementation machinery to users before it creates leverage. |
| 56 | +It would also duplicate the existing Linear lane and Decodex runtime contracts instead |
| 57 | +of letting the runtime use those surfaces as execution adapters. |
| 58 | + |
| 59 | +## Consequences |
| 60 | + |
| 61 | +- Future runtime lanes must treat loop graph state as internal runtime state. |
| 62 | +- Documentation and operator UI should not teach ordinary users to drive Decodex by |
| 63 | + graph ids or DAG commands. |
| 64 | +- New execution-program code must bridge into existing Linear issue lanes rather than |
| 65 | + replacing them. |
| 66 | +- Research adapters must preserve an acceptance/promotion boundary before queueing or |
| 67 | + implementation starts. |
| 68 | +- Loop stop conditions must route to failure attribution, research-contract feedback, |
| 69 | + architecture review, or manual attention instead of infinite patching. |
| 70 | +- Harness telemetry should improve prompts, skills, validators, issue templates, and |
| 71 | + loop policy without retroactively changing accepted lane contracts. |
0 commit comments