Skip to content

Commit 65bd707

Browse files
{"schema":"decodex/commit/1","summary":"Promote Decodex loop-runtime contract","authority":"XY-851"}
1 parent 733b72f commit 65bd707

10 files changed

Lines changed: 395 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Repo-native agent orchestration, upstream Codex radar, and public publishing.
1616
## Feature Highlights
1717

1818
- Rust CLI and runtime for repo-native retained coding-agent lanes.
19+
- Natural-language-first loop-runtime contract with research/decision promotion,
20+
internal execution-program state, and normal Linear issue lanes.
1921
- Native macOS app for Decodex Codex account-pool management.
2022
- Explicit project registry under `~/.codex/decodex/projects/<service-id>/`.
2123
- Local operator listener with a dashboard at `/` and `/dashboard`, WebSocket
@@ -333,6 +335,7 @@ structure. For the authoritative layout and ownership map, read
333335

334336
- Product and development overview: this `README.md`
335337
- Unified documentation router: `docs/index.md`
338+
- Natural-language loop-runtime contract: `docs/spec/loop-runtime.md`
336339
- Normative specs: `docs/spec/index.md`
337340
- Procedural runbooks: `docs/runbook/index.md`
338341
- Current implementation references: `docs/reference/index.md`

docs/decisions/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Question this index answers: "why was it designed this way?"
2020

2121
## Current decisions
2222

23+
- [`natural-language-loop-runtime.md`](./natural-language-loop-runtime.md) records why
24+
Decodex keeps execution-graph semantics internal behind a natural-language research
25+
and promotion surface.
2326
- [`decodex-plugin-source.md`](./decodex-plugin-source.md) records why this repository
2427
owns the canonical Decodex plugin and why generic Playbook guidance should only keep
2528
portable routing.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.

docs/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ The split below is by question type, not by human-versus-agent audience.
3030

3131
- Need runtime contracts, invariants, schemas, enums, state machines, or required
3232
behavior -> `docs/spec/`
33+
- Need the natural-language-first loop-runtime contract, Research/Decision stage,
34+
latent Loop/Decision Contract, internal Execution Program, phase-scoped goals,
35+
unattended execution behavior, or loop guardrails -> `docs/spec/loop-runtime.md`
3336
- Need current Decodex/Codex app-server protocol support
3437
evidence -> `docs/spec/app-server.md`
3538
- Need Decodex operator lane-control capability support, including inspect,
@@ -46,6 +49,9 @@ The split below is by question type, not by human-versus-agent audience.
4649
implementation surface maps -> `docs/reference/`
4750
- Need durable design rationale, packaging choices, or static-site tradeoffs ->
4851
`docs/decisions/`
52+
- Need rationale for keeping execution-graph semantics internal behind a
53+
natural-language user surface ->
54+
`docs/decisions/natural-language-loop-runtime.md`
4955
- Need the current Radar, Control Plane, and Publisher capability boundary ->
5056
`docs/decisions/radar-control-plane-publisher.md`
5157
- Need Radar raw-artifact retention, archive manifests, or GitHub Release archive
@@ -89,3 +95,5 @@ The split below is by question type, not by human-versus-agent audience.
8995
- Keep links explicit and stable.
9096
- Treat `docs/research/` and `docs/plans/` as supporting or historical evidence, not as
9197
primary authority lanes.
98+
- Treat research output as latent until accepted or promoted through the loop-runtime
99+
contract in `docs/spec/loop-runtime.md`.

docs/reference/operator-control-plane.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Decodex currently runs as a local, single-machine control plane:
3232
- Each project row is scoped by `project_id` and canonical `repo_root`.
3333
- The project-owned `WORKFLOW.md` remains the execution-policy contract for that
3434
registered repo.
35+
- The everyday loop-runtime surface remains Codex conversation. Research/decision
36+
promotion and internal Execution Program state are governed by
37+
[`../spec/loop-runtime.md`](../spec/loop-runtime.md), not by dashboard graph editing
38+
or user-visible DAG commands.
3539

3640
Decodex App is a native shell over the same local runtime and account-pool state. On
3741
launch it connects to an existing default local listener when one is reachable; if
@@ -442,8 +446,9 @@ rate-limited, or unavailable.
442446
These directions were discussed but are not part of the current implemented contract:
443447

444448
- Active-lane UI controls for steer, retry, task replacement, or lifecycle mutation.
445-
- Conflict-domain scheduling for `ui-preview`, `docs`, `tests`, `runtime`, or similar
446-
lane classes.
449+
- User-visible conflict-domain scheduling for `ui-preview`, `docs`, `tests`,
450+
`runtime`, or similar lane classes. Future conflict-domain scheduling belongs to the
451+
internal Execution Program contract, not to ordinary dashboard graph controls.
447452
- Demo batch planning that automatically selects two or three small visible issues and
448453
generates operator observation points.
449454
- Editing project configuration from the operator UI.
@@ -457,6 +462,7 @@ governing spec first, then update the operator runbook and this reference.
457462

458463
## Authority Links
459464

465+
- Loop-runtime contract: [`../spec/loop-runtime.md`](../spec/loop-runtime.md)
460466
- Runtime contract: [`../spec/runtime.md`](../spec/runtime.md)
461467
- Lane-control capability contract: [`../spec/lane-control.md`](../spec/lane-control.md)
462468
- Linear execution ledger schema: [`../spec/linear-execution-ledger.md`](../spec/linear-execution-ledger.md)

docs/spec/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ Then keep the body explicit:
5454

5555
## Current governing specs
5656

57+
- [`loop-runtime.md`](./loop-runtime.md) defines the natural-language-first loop
58+
runtime, Decodex-native Research/Decision stage, latent Loop/Decision Contract,
59+
internal Execution Program, phase-scoped goals, unattended execution behavior, and
60+
loop guardrails.
5761
- [`runtime.md`](./runtime.md) defines the runtime state model, reconciliation rules, and
5862
tracker writeback boundaries.
5963
- [`app-server.md`](./app-server.md) defines the direct Codex `app-server` interaction

docs/spec/lane-control.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Lane control is the operator-facing ability to inspect and influence a Decodex-o
2020
lane without bypassing the runtime lease, tracker, retained-worktree, and review
2121
contracts.
2222

23+
[`loop-runtime.md`](./loop-runtime.md) owns the natural-language-first research,
24+
promotion, and internal Execution Program contract. Lane control does not expose that
25+
program as a user-visible DAG surface. Inspect, steer, interrupt, retained retry, and
26+
manual attention remain lane controls for already-owned runtime lanes.
27+
2328
The first supported operator-control surface for this rollout is CLI/API. Active-lane
2429
UI controls are intentionally deferred. The dashboard may show local runtime state for
2530
observation, but it must not become the primary place where agents or operators author

0 commit comments

Comments
 (0)