ADR-0016: Bounded GraphRun and Durable GoalWorkflow Are Separate Control Authoritiesπ
Statusπ
Accepted
Contextπ
ContextUnity needs two different forms of agentic control:
- a bounded reasoning and execution cycle that plans, acts, observes, verifies, and may replan while handling one request; and
- a durable goal that may span several such executions, survive process restarts, wait for human or external-agent input, enforce an aggregate budget, and eventually terminate.
Treating both as one generic long-lived loop would duplicate lifecycle authority. Long-lived waits could leak into Router checkpoints, while GraphRun state could be copied into Worker, Brain, Forge, Blackboard, Execution Trace, or a protocol-specific task ledger. That would make cancellation, recovery, idempotency, retention, and local/production runtime parity ambiguous.
Conversely, reducing every long goal to an indefinitely parked Router graph would couple durable product state to executor checkpoint mechanics and require a distributed atomic transition between a live Router checkpoint and its external workflow owner.
Decisionπ
ContextUnity separates the two control authorities.
Bounded inner controlπ
Router owns one bounded graph run. Its resolved GraphRunControlPolicy governs graph cycles or supersteps, progress and stagnation, verifier evidence, cost/token/time/side-effect limits, replanning, and closed terminal reasons. Router GraphState and its checkpoint are live execution mechanics for that run, not a durable multi-run workflow record.
Every graph run terminates with a typed FinalVerdict and a completed Execution Trace. Missing verifier evidence cannot become success.
Durable outer controlπ
WorkerRunner is the only platform candidate to own a future durable goal workflow spanning multiple completed graph runs. Its product record owns aggregate attempts and budgets, waiting-input state, optimistic versioning, idempotent callbacks, cancellation, deadline, restart recovery, and the final goal outcome.
The default continuation model is:
Worker goal-workflow attempt N
-> Router executes one bounded GraphRun
-> GraphRun terminates with FinalVerdict + Execution Trace
-> Worker records immutable result/evidence references
-> complete | start attempt N+1 | wait for typed input | fail/cancelWhile waiting, no Router graph remains live. An authorized, versioned, and idempotent callback updates the Worker-owned record and may start a new bounded graph run from immutable continuation and evidence references.
Parking and resuming the same graph run requires a separate architecture slice. It may be introduced only by a separate architecture slice that proves a named scenario cannot preserve its required semantics through terminal continuation and also proves checkpoint ownership, atomicity, lease/split-brain recovery, cancellation, security, and PATH L/PATH T parity.
State and evidence ownershipπ
The separation is mandatory:
| Information | Authority |
|---|---|
| Live state inside one bounded graph | Router GraphState/checkpoint |
| Durable multi-run goal lifecycle | Worker-owned goal/workflow record |
| Completed graph journey | Brain Execution Trace |
| Negative experience and recovery evidence | UDB |
| Large or transient payload | Blackboard/artifact reference owner |
| Independently attributable action/outcome learning | BrainSynapse |
| Stable reusable procedure | Governed BrainEngram/runbook |
| Review and control UI | Forge adapter over owner APIs |
None of the evidence, memory, payload, UI, telemetry, or protocol surfaces may act as a substitute workflow-state store.
Control-policy levelsπ
Provider retries, DAG node attempts, GraphRun cycles, and durable goal attempts are separate policies. Each level has its own retry budget. Project policy may narrow operator limits within the admitted bounds.
This ADR accepts the ownership boundary and terminal-continuation default. It does not claim that the goal-workflow contracts or durable store are implemented. Those remain deferred until a complete architecture slice has a real caller, store, runtime paths, security gates, failure-path tests, and local/production parity.
Alternatives consideredπ
Wrap every GraphRun in ContextLoop or LoopRunπ
Rejected. It adds a second lifecycle around ordinary graph execution without a distinct product owner or caller and encourages duplicated retry, budget, and terminal semantics.
Keep a Router graph parked during every human, A2A, or external waitπ
Rejected as the default. It turns executor checkpoints into long-lived product state and introduces unnecessary cross-service atomicity and split-brain risk.
Store durable goal state in Brain, Execution Trace, UDB, or Blackboardπ
Rejected. These surfaces own cognitive memory/evidence, completed journeys, negative experience, and payload references respectively; workflow mutation has different consistency, authorization, retention, and query semantics.
Let Forge or an A2A protocol own the lifecycleπ
Rejected. Forge is an adapter and reviewer; A2A is a protocol adapter. Either may issue typed commands through the owner API but cannot become a second execution authority.
Consequencesπ
- Bounded agentic loops do not depend on a generic durable goal-workflow subsystem.
- Worker run records are prerequisites, not evidence that a multi-run goal workflow already exists.
- Long-running Lab, human-review, and A2A scenarios should first use terminal GraphRun continuation through Worker.
- Restarts and recoveries remain observable events as required by ADR-0008; continuation may not pretend that a new GraphRun is the same uninterrupted run.
- Execution Trace, UDB, telemetry, and domain evidence retain the separate authorities established by ADR-0014.
- Public contracts and manifest fields must not be added ahead of a production caller and full resolve/runtime/gate/test slice.
Non-goalsπ
- Defining a goal-workflow specification, record schema, storage backend, gRPC, CLI, or Forge surface.
- Selecting the first product caller or scheduling implementation in a phase.
- Defining A2A identity, discovery, negotiation, artifacts, or task semantics.
- Introducing online self-modification, automatic procedure promotion, or automatic LoRA training from every loop iteration.
Implementation planningπ
Deferred goal-workflow implementation requires a separate, explicit task scope and promotion criteria before delivery.