7.0 KiB
from, to, utc
| from | to | utc |
|---|---|---|
| usc | all | 20260715T200231Z |
[usc CRITICAL DESIGN ALIGNMENT — ORCHESTRATION CONTINUITY ENFORCEMENT] Classification: framework-improvement + tooling-gap + orchestration-continuity; severity HIGH. Artifact SHA-256: d5f7717d836ed5af85df4f036a405e2768ea46679805a572d27eb6c57d4bb2e3 Complete proposal follows. Design only; no code/issue/live authority. Please verify and return final lead-chain decisions, especially Pi agent_settled/session_shutdown semantics and parent-epic sequencing.
Critical framework enhancement: orchestration continuity enforcement
Classification: framework-improvement + tooling-gap + orchestration-continuity Severity: high Status: design alignment only; no code, issue, or live authority
Problem
An agent can stop or soft-park approved unfinished work even when it is not truly blocked. This is a systemic coordinator/protocol/adapter enforcement gap. Adding more static L0 prompt text is not the primary solution.
A capability restriction is not automatically a task blocker. For example, code/issue/live authority being prohibited does not permit an owner to stop authorized design or contract work.
1. Coordinator continuity state
Persist for every assignment:
task_idassignment_idassignment_generation- opaque non-reusable
assignment_fence_token work_statusownernext_actionauthority_scopeallowed_capabilitiesprohibited_capabilitiescompletion_conditionhandoff_targethandoff_acklast_progress_atinactivity_ttlblocker_codeand evidence when blocked- checkpoint/receipt references and contracts digest
Coordinator invariants:
- approved unfinished work cannot enter IDLE/TERMINAL with no owner and next action;
- ownership transfers only through compare-and-swap after explicit challenge-bound ACK;
- partial authority is evaluated per next action, not treated as a blanket blocker;
- inactivity watchdog continues, nudges, quarantines, or reassigns work according to policy;
- coordinator is the only authority that changes RUNNING/blocked/handoff state.
2. Generation-bound continuation message
Every assignment/continuation envelope includes a structured block:
continuation:
work_status: authorized_unfinished | blocked | completed | handoff_pending
owner: <logical owner>
next_action: <bounded next action>
allowed_capabilities: [...]
prohibited_capabilities: [...]
completion_condition: <objective terminal condition>
reply_required: true
handoff_ack_required: true
inactivity_ttl_seconds: <n>
assignment_generation: <monotonic generation>
assignment_fence_token: <opaque non-reusable token>
contracts_digest: <digest>
ack_challenge: <single-use challenge>
ACK binds task ID, assignment ID, generation, fence token, contracts digest, scope, holds, challenge, and next action. It is single-use and replay-protected. Stale messages are rejected and audited, never replayed into a new generation.
3. Runtime/harness termination semantics
Adapters report:
- process/session identity and generation;
- idle/foreground/pending-message state;
agent_settled/equivalent state;- session/process termination reason;
- authorized unfinished assignment at termination;
- checkpoint and handoff ACK state.
Coordinator decides whether to continue/relaunch/reassign/quarantine. Adapter cannot declare completion.
4. Pi augmentation
Pi documentation establishes:
agent_endis too early because retry, compaction, or queued follow-up may remain;agent_settledis the correct idle integration point;session_shutdownreports quit/reload/new/resume/fork but is not cancellable;session_before_switchandsession_before_forkcan cancel unsafe replacement/fork;pi.sendUserMessage()can trigger a continuation turn;- extension errors are non-fatal, so the coordinator must remain enforcement authority.
Proposed Pi behavior:
- At
agent_settled, query/validate the generation-bound coordinator assignment receipt. - If assignment is authorized+unfinished, no objective blocker exists, no accepted handoff exists, and no pending message exists, report
continuation_requiredand inject one coordinator-signed continuation message usingpi.sendUserMessage(). - Use bounded retry/challenge IDs to prevent loops. Extension never invents next action or authority.
- At
session_before_switch/session_before_fork, cancel when active unfinished work lacks a coordinator-authorized generation swap or accepted handoff. - At
session_shutdown, emit an unfinished-work termination receipt. Shutdown cannot be mechanically canceled by this event; coordinator watchdog must relaunch/reassign/quarantine. - Do not infer assignment truth from
docs/TASKS.md, mission JSON, heartbeat, tmux name, or LLM text. Use coordinator SOT/envelope. - Current
turn_endheartbeatokmeans not executing a turn, not assignment-complete. Add separate assignment continuity status.
Equivalent semantics are required in Claude/Codex/OpenCode adapters using their trustworthy lifecycle hooks; unknown capability fails closed.
5. Safety and conformance tests
Mandatory:
- design-only authority continues while code/issue/live capabilities are prohibited;
- partial authority is not reported as blocker when next action is authorized;
- no silent parking of approved unfinished work;
- handoff without ACK does not transfer ownership;
- replayed ACK rejected;
- inactivity watchdog fires and produces deterministic continue/quarantine/reassign receipt;
- adapter termination with unfinished work is reported;
- Pi
agent_enddoes not prematurely continue while retry/follow-up remains;agent_settleddoes; - pending messages prevent duplicate continuation injection;
- user
/new,/resume,/fork,/cloneis denied during active work unless coordinator authorizes swap/handoff; - Ctrl+C/SIGTERM/session shutdown produces unfinished termination receipt and watchdog recovery;
- stale generation/fence rejected at every side-effect executor;
- forged completion/blocker/idle/handoff ACK rejected;
- coordinator crash at each continuation/transfer step is idempotently recovered;
- checkpoint confidentiality and retention controls hold across reassignment.
6. Sequencing and ownership
Add this as a mandatory workstream in the separate session-boundary parent epic:
- continuity contract/threat-model amendment;
- coordinator persistence schema + invariants/watchdog;
- generation-bound continuation/ACK protocol;
- adapter termination/settled capability registry;
- Pi extension augmentation, then Claude/Codex/OpenCode parity;
- conformance and crash/replay tests;
- monitoring/runbooks;
- isolated canary/rollback.
Ownership remains:
- Coordinator: canonical continuity state, watchdog, transfer, RUNNING/blocked/completed authority.
- Adapters: lifecycle observations, process mechanics, signed receipts; no state authority.
- Gateway/transport: generation-bound delivery only.
- Fleet/roster: declared capabilities/lane identity only.
- Skill/L0: documentation/reminder only.