<DelegationChain> is the composite behind the
delegation-chain workflow: a <Sequence> of
seven phases in <Parallel> with a live-edit signal listener. Each phase
re-derives its slice of the delegation tree from the dc* output rows on
every render, so fan-out materializes level by level, and edits or probe
findings replan the affected subtree without a restart.
delegationSchemas in createSmithers and pass the matching
outputs subset. Tiers are labels only: missing ones fall back to the
nearest configured tier in tierOrder. Setting budget.maxMinutes wraps the
chain in <Aspects> with a wall-clock latencySlo; dollar budgets are
enforced by per-leaf guard tasks over rolled-up dcExec actuals (hard error
over the limit, warning row at 80%).
Phase composites
Each phase is exported separately for standalone use and takesDelegationSharedProps plus the extras noted:
Output tables
delegationSchemas (from smthrs) registers every table;
DelegationOutputs is the matching prop shape. dcApproval needs an
approvalPolicy, dcBudget needs a budget, and dcScore needs run-level
scorers.
Physical node ids
Every task id followsdc:<logicalId>:<phase> (idPrefix defaults to dc).
Logical ids are /-separated paths (root/core/reducer); physical ids
encode the / as : because node ids only allow [a-zA-Z0-9:_-]. Row
logicalId fields keep the / form. Phases:
- Goal:
dc:goal:forecast,dc:goal:forms:question-<seq>,dc:goal:question-<seq>(the durable human answer),dc:goal:goal,dc:goal:approve - Planning:
dc:<logicalId>:plan, replan versionsdc:<logicalId>:plan-<k> - Previews:
dc:<logicalId>:preview - Gates:
dc:<logicalId>:gates - Derisk:
dc:<logicalId>:probe-<n>,dc:<logicalId>:replan-<k> - Execution:
dc:<logicalId>:exec,dc:<logicalId>:review-<i>(reviews then checks, in declared order),dc:<logicalId>:approval-<i>,dc:<logicalId>:dev-preview(thendev-preview-2, …),dc:<logicalId>:budget - Scoring:
dc:root:score,dc:root:poll
Signals
Two fixed durable signal names (exported asDC_EDIT_SIGNAL and
DC_SKIP_PREVIEW_SIGNAL):
dc-editwith payload{ editId, logicalId, editedOutput, note? }. Each delivered edit writes adcEditrow that the derisk loop treats like a plan-changing probe finding.dc-skip-previewwith payload{ skipped: true }. Once adcSkiprow exists, no further preview tasks mount.
Gates
AdcGates row declares an ordered list of gates:
dcExec.commitRange, with
instructions to inspect the commits themselves; chunk-level reviews get the
union of their subtree’s ranges (exec agents wrap with the exported
withCommitRange, measuring the working-copy commit before and after the
attempt: jj first, git fallback). preview gates build a developer preview
after execution; builtOk: false fails the attempt like a failed review. The
gates prompt requires the root node to declare a slideshow preview, so a
run always ends showable.
UI side
smthrs/gateway-react exports the matching read model:
useDelegationChain folds a
run’s dc* rows into a DelegationGraph (nodes with status, versions,
attention rollups, budget rollup, phase) and returns submitEdit,
skipPreviews, answerHuman, and submitPoll. The pure reducer
foldDelegation is exported for tests and non-React use.
Notes
- Approval gates require
outputs.dcApproval;<DelegationExecution>throwsINVALID_INPUTif the policy produced approval gates without it. dcPlan.orchestration("tasks" | "workflow") is reserved for higher-order orchestration (a node authoring its own workflow as its execution strategy); accepted but ignored today. The fold store behinduseDelegationChainruns on Effect.ts behind the frozen hook signature.- Scoring wiring:
scorers.exec/scorers.reviewride the exec and review tasks;scorers.runrides the digest task. The delegation scorers live insmthrs/scorers(see scorer reference).