152 lines
7.0 KiB
Markdown
152 lines
7.0 KiB
Markdown
---
|
|
from: usc
|
|
to: all
|
|
utc: 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_id`
|
|
- `assignment_id`
|
|
- `assignment_generation`
|
|
- opaque non-reusable `assignment_fence_token`
|
|
- `work_status`
|
|
- `owner`
|
|
- `next_action`
|
|
- `authority_scope`
|
|
- `allowed_capabilities`
|
|
- `prohibited_capabilities`
|
|
- `completion_condition`
|
|
- `handoff_target`
|
|
- `handoff_ack`
|
|
- `last_progress_at`
|
|
- `inactivity_ttl`
|
|
- `blocker_code` and 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:
|
|
|
|
```yaml
|
|
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_end` is too early because retry, compaction, or queued follow-up may remain;
|
|
- `agent_settled` is the correct idle integration point;
|
|
- `session_shutdown` reports quit/reload/new/resume/fork but is not cancellable;
|
|
- `session_before_switch` and `session_before_fork` can 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:
|
|
|
|
1. At `agent_settled`, query/validate the generation-bound coordinator assignment receipt.
|
|
2. If assignment is authorized+unfinished, no objective blocker exists, no accepted handoff exists, and no pending message exists, report `continuation_required` and inject one coordinator-signed continuation message using `pi.sendUserMessage()`.
|
|
3. Use bounded retry/challenge IDs to prevent loops. Extension never invents next action or authority.
|
|
4. At `session_before_switch`/`session_before_fork`, cancel when active unfinished work lacks a coordinator-authorized generation swap or accepted handoff.
|
|
5. At `session_shutdown`, emit an unfinished-work termination receipt. Shutdown cannot be mechanically canceled by this event; coordinator watchdog must relaunch/reassign/quarantine.
|
|
6. Do not infer assignment truth from `docs/TASKS.md`, mission JSON, heartbeat, tmux name, or LLM text. Use coordinator SOT/envelope.
|
|
7. Current `turn_end` heartbeat `ok` means 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_end` does not prematurely continue while retry/follow-up remains; `agent_settled` does;
|
|
- pending messages prevent duplicate continuation injection;
|
|
- user `/new`, `/resume`, `/fork`, `/clone` is 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:
|
|
|
|
1. continuity contract/threat-model amendment;
|
|
2. coordinator persistence schema + invariants/watchdog;
|
|
3. generation-bound continuation/ACK protocol;
|
|
4. adapter termination/settled capability registry;
|
|
5. Pi extension augmentation, then Claude/Codex/OpenCode parity;
|
|
6. conformance and crash/replay tests;
|
|
7. monitoring/runbooks;
|
|
8. 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.
|