# S8 Tactical WorkGraph — Controller-Owned Delivery & Reconciliation

**Slice:** S8 — Controller-Owned Delivery & Reconciliation

**Base checkpoint:** `8e7359740a4d0aeab5f77df54d6579c49a34297a` (accepted S7)

**WorkGraph frozen:** 2026-09-25, after pre-edit branch, diff, dependency, caller, and effect-producer audit; revised on 2026-09-25 for the Director's explicit resource classification, and amended before resumed-lead source work to add a non-overlapping Flash policy-test unit.

**Normative source:** `docs/CORE_ARCHITECTURE_V2.md`; this file records the S8 work contract and does not change target semantics.

## Pre-edit audit and dependency check

The checkout is on `core-architecture-v2` at the expected HEAD. The only existing changes are the named S8 files: `src/security/gatedAction.ts`, `src/delivery/handoff.ts`, `tests/deliveryFinalize.test.ts`, this WorkGraph, and new `tests/security/gatedAction.test.ts`. The normative target is byte-identical to HEAD. STATUS and CONFORMANCE record accepted deterministic S3 authority, S6 current AcceptanceOracle/objective completion, and S7 provenance gates. REAL_PROVIDER, BROWSER, OPA_PROVIDER, ADVERSARIAL, and PACKED_E2E remain separate evidence lanes.

Production effect/caller inventory:

- `executeIssueWorkflow` calls `prepareGithubIssueTask`, which only reads the source issue and writes local snapshot/contract/seal/delivery-record state, then currently calls `handoffTask` before `runTask`. That handoff can POST a new public GitHub issue and remote branch and create a Paseo worktree. The pre-acceptance public mutations must be decoupled from internal execution setup.
- Direct SDD handoff CLI calls `handoffTask`. Its GitHub issue and remote branch POSTs and delivery finalization paths require the current managed operation, candidate, AcceptanceOracle, S7 policy gate, ToolActionGate, intent, and receipt. An existing imported issue is already seeded by `prepareGithubIssueTask`; it does not need another issue or an initial remote branch to execute.
- `OperationController.ensureOperationWorkspace` creates an isolated Paseo worktree and local candidate branch after current controller policy/candidate binding and before implementation. This is controller-owned temporary execution infrastructure and is explicitly permitted pre-acceptance by the Director. `paseo.workspace.create` must be classified `LOCAL_RESOURCE_CREATION` and must not appear in `configuredExternalEffects()`. Keep its S3 controller authority/epoch fencing, ActionIntent/ToolActionGate/ActionReceipt behavior, and conservative resource reconciliation; do not impose the AcceptanceOracle delivery gate on this infrastructure. Its uncertain create result remains fail-closed and unresolved until provider identity can be safely inspected.
- `finalizeAcceptedIssue` is the production push/PR producer in `runTask`; it checks the persisted current S6 ACCEPTED disposition, candidate/workspace identity, and required S7 provenance before its gated commit, push, and PR actions. Push can create the public branch after acceptance; no pre-execution remote branch is needed for an imported issue.
- `executeGatedAction` persists an intent before execution, but executor exceptions currently return only after observing state through the provided reconciliation callback; reconciliation exceptions and UNKNOWN/HUMAN_REQUIRED must leave the intent unresolved and must never re-execute it. Operation cancellation already refuses unresolved intents. Objective completion currently consumes delivery disposition and identity, so verify that a success disposition cannot be asserted without exact requested-effect receipts or safe reconciled equivalents.

## Frozen S8 contract

Classify mechanisms as `DETERMINISTIC`, `MODEL`, or `HYBRID`. This slice is deterministic for identity, effect, authorization, receipt, and reconciliation facts; the semantic interpretation of the requested external effects is hybrid with frozen policy and controller verification. Model output cannot grant effect authority.

Every requested, policy-authorized external effect runs only after the current candidate passes validation, required review, current AcceptanceOracle acceptance, and policy-required certification. The current controller persists an ActionIntent, passes the exact request through ToolActionGate, executes once against bound candidate/authority, and persists an ActionReceipt or exact safe reconciled equivalent. A possibly completed non-idempotent action is never retried until observable state is inspected. Unknown state is BLOCKED or HUMAN_REQUIRED and cannot count as delivered or completed. Controller-owned disposable execution workspaces/sessions and local candidate branches are internal setup, permitted before acceptance; `paseo.workspace.create` is `LOCAL_RESOURCE_CREATION`, is excluded from requested external-delivery effects, and remains controller-fenced with durable intent/receipt and safe resource reconciliation. Preserve S3 authority, S6 acceptance, S7 provenance where policy requires it, and all Section 11/12 semantics. Do not change `docs/CORE_ARCHITECTURE_V2.md`; keep S9 supervision/lease/Control Center lifecycle, S13 provider certification, and S14 self-hosting out of scope.

## Tactical WorkUnits and Delegation Assessment

| Unit | Owner | Mechanism | Dependencies | Files / areas | Invariants | Acceptance criteria | Tests / validation |
| --- | --- | --- | --- | --- | --- | --- | --- |
| S8-WU1: freeze boundary and production-effect map | LUNA_OWNED | HYBRID | Accepted S3, S6, S7; audited all known production callers | `src/delivery/**`, `src/security/**`, `src/operations/controller.ts`, `src/operations/state.ts`, `src/core/run.ts`, `src/cli.ts`, `src/issues/intake.ts`, objective-completion code, tests | Normative Sections 11/12 and Director clarification; distinguish internal execution provisioning from requested delivery; keep authority, candidate, policy, acceptance, provenance, and no-S9 boundaries | Every producer classified and routed or explicitly blocked; no pre-acceptance GitHub issue/remote branch/push/PR; internal setup is not treated as delivery | `rg` caller/effect inventory; focused delivery, action, issue, and lifecycle tests |
| S8-WU2: reconcile uncertain gated-action executions | FLASH_DELEGATABLE | DETERMINISTIC | WU1 contract frozen; existing `executeGatedAction`, `reconcileToolAction`, and receipt contracts | `src/security/gatedAction.ts`, `tests/security/gatedAction.test.ts` only | Durable intent precedes execution; no second execution after throw; only observed SUCCEEDED/FAILED may receive reconciled receipt; UNKNOWN/HUMAN_REQUIRED and reconciliation exceptions leave intent unresolved; do not alter authority or action policy | Success/failure persists one receipt; throw triggers observation; conclusive observation persists one reconciled receipt; unknown/error has no receipt; denied/stale request never executes; later call reconciles before retry | Focused gated-action Vitest suite; no commit/push; no nested delegation |
| S8-WU3: split issue intake/setup from public delivery | LUNA_OWNED | HYBRID | WU1; WU2 reviewed/integrated; S3/S6/S7; current operation workspace contract | `src/cli.ts`, `src/issues/intake.ts`, `src/issues/workflow.ts`, `src/delivery/handoff.ts`, `src/delivery/finalize.ts`, `src/operations/controller.ts`, issue/delivery tests | Importing an existing issue is read-only externally; no new issue/remote branch before acceptance; controller-owned local workspace and candidate branch may be prepared before acceptance; push/PR stay after current Oracle and required S7; no direct ungated remote mutation | Default issue execution starts a managed run without public handoff; accepted finalization provisions any missing public issue/branch through gated actions and does not create a second execution workspace; direct handoff cannot mutate remotely outside current accepted managed operation | Issue intake and delivery tests; explicit request-count/intent checks before/after acceptance; controller workspace tests |
| S8-WU4: classify internal resource actions and close receipt/completion invariants | LUNA_OWNED | DETERMINISTIC | WU2 integration; WU3 effect request contract; accepted S3/S6/S7; Director resource clarification | `src/security/actionPolicy.ts`, `src/security/toolActionGate.ts`, `src/security/actionReconciliation.ts`, `src/operations/controller.ts`, `src/operations/state.ts`, `src/architecture/objectiveCompletion.ts`, `src/core/run.ts`, related tests | `paseo.workspace.create` is `LOCAL_RESOURCE_CREATION`, absent from configured delivery external effects, yet remains S3 controller-authorized/fenced and intent/receipt/reconciliation tracked; every remote/public effect stays after current acceptance; exact intent/receipt identity; no unknown or assumed delivery; no lifecycle broadening | Internal workspace can be created before acceptance without being counted as delivery; its authority, receipt, and conservative reconciliation remain enforced; issue handoff and finalization outcomes require accepted current candidate and pass through gated, receipted actions; stale, missing, conflicting, and unknown receipts block | Action policy/gate/reconciliation, controller workspace, objective and operation completion, finalization, deterministic system suites |
| S8-WU5: documentation and slice evidence | LUNA_OWNED | DETERMINISTIC | WU3/WU4 complete; required deterministic gate run and diff review | `docs/CORE_ARCHITECTURE_V2_STATUS.md`, `docs/CORE_ARCHITECTURE_V2_CONFORMANCE.md`, `docs/ENGINEERING_LEDGER.md`, this WorkGraph | Normative target remains byte-identical; fixture evidence never claims provider certification; no S9 work | Current/gap/next gate/evidence/lane/date reflect actual S8 state; ledger records findings and exact validation | Focused tests, `npx tsc --noEmit`, build, non-system Vitest, affected deterministic system suites, `git diff --check` |
| S8-WU6: add an independent policy-classification matrix regression | FLASH_DELEGATABLE | DETERMINISTIC | WU1 and Director resource clarification frozen; no dependence on WU2 implementation | New `tests/security/actionPolicy.test.ts` only | Test the frozen interface: local Paseo workspace provisioning is absent from external-effect policy; GitHub effect selection and exact human-authorization requirements remain deterministic; do not edit source or the overlapping `toolActionGate.test.ts` | Tests cover audit/no-GitHub configurations, GitHub enabled/finalize combinations, `paseo.workspace.create` exclusion regardless of Paseo configuration, and human authorization for public effects only; test-only change is ready to pass after Luna's production classification change | Run `npx vitest run tests/security/actionPolicy.test.ts --reporter=dot`; report the expected base-checkpoint failures from the not-yet-applied S8 production change without changing or weakening tests |

## Delegation plan

WU6 was the resumed lead's non-overlapping `FLASH_DELEGATABLE` unit: a test-only matrix for the frozen effect-classification contract in a new file. The first WU2 worker task overlapped code already present in the incoming S8 changes, so it was not counted as the resumed lead's independent assignment. The fresh WU6 worker used a separate Paseo worktree and the listed DeepSeek V4.1 Flash settings (`build`, `max`, `auto_accept: true`); its six expected base-checkpoint failures were the missing internal-resource classification, while four authorization tests passed. All architecture decisions, provider/action classification, integration, issue flow, receipt-closure checks, docs, conflict resolution, and final review remain LUNA_OWNED. No nested delegation, commit, or push was used.

## Integration and gate control

Each Flash worker edits only its assigned files in its separate worktree; the primary checkout owns integration and all LUNA units. Review worker diffs and tests before selective integration. Re-read caller inventory after changes. Run the deterministic S8 gate; do not claim real-provider certification from fixtures. After acceptable validation, update the S8 status and conformance evidence lanes and ledger, leave the target unchanged, and return to the Campaign Director for independent acceptance. Do not start S9.

## Fresh lead remediation — stale public SDD handoff command

**Remediation audit:** 2026-09-25, resumed from HEAD `8e7359740a4d0aeab5f77df54d6579c49a34297a` on `core-architecture-v2`. The existing working-tree changes span only the S8 delivery/action/issue paths, their focused tests, and S8 evidence documents; these changes were inspected and are preserved. The five required architecture/evidence documents were read. S3 authority/human controls, S6 AcceptanceOracle/objective completion, and S7 provenance are accepted in STATUS/CONFORMANCE. `docs/CORE_ARCHITECTURE_V2.md` is unchanged from HEAD.

**Exact gap:** `src/cli.ts` registers `aeh sdd handoff <taskId>` with a description promising GitHub issue/branch and Paseo worktree delivery, then directly calls `handoffTask`. That function now requires a managed operation, its current CandidateRevision, a current accepted AcceptanceOracle disposition, and policy-required S7 evidence before requested effects. A normal CLI invocation has no managed operation/controller context, so it cannot fulfill its advertised action. No existing accepted-delivery controller lifecycle is exposed by this CLI command. The approved resolution is an explicit unsupported/deferred CLI response, before project loading or delivery code; the managed accepted-operation finalizer remains the production delivery path. This changes no target lifecycle, authority, role, acceptance, delivery, or invariant semantics.

| Unit | Owner | Mechanism | Dependencies | Files / areas | Invariants | Acceptance criteria | Tests / validation |
| --- | --- | --- | --- | --- | --- | --- | --- |
| S8-RWU1: preserve and review incoming S8 changes; freeze remediation contract | LUNA_OWNED | HYBRID | Accepted S3, S6, S7; expected S7 HEAD | Existing S8 changes in `src/cli.ts`, `src/core/run.ts`, `src/delivery/**`, `src/issues/**`, `src/security/**`, related delivery/action tests, and status/conformance/ledger | Preserve attributable S8 work; no path normalization; frozen target and S3/S6/S7 semantics; no S9 | Changed paths each map to S8; CLI mismatch is resolved only within the approved alternatives; graph records units before source/test edits | `git status --short --branch`, HEAD/log, changed-path/diff inspection, target-vs-HEAD check, caller/effect inventory, existing focused test inspection |
| S8-RWU2: add a CLI unsupported/deferred regression | FLASH_DELEGATABLE | DETERMINISTIC | RWU1 contract frozen; current unsupported message/code agreed | New `tests/cliS8Handoff.test.ts` only | Invoke the normal `sdd handoff` CLI path; no GitHub/provider mutation; no lifecycle or authority changes; no nested delegation | Regression asserts an explicit unsupported/deferred result for normal invocation and proves the command does not create public delivery effects; file is ready to pass after RWU3 | `npx vitest run tests/cliS8Handoff.test.ts --reporter=dot`; report expected base-checkpoint failure if the production CLI fix has not yet been integrated |
| S8-RWU3: remove the misleading public delivery behavior from the CLI command | SEQUENTIAL_AFTER_CONTRACT_FREEZE | DETERMINISTIC | RWU1; RWU2 message/code contract frozen | `src/cli.ts` handoff import/registration only | Do not call `handoffTask`, create an issue/remote branch/workspace, or load the project for this unsupported invocation; keep controller-owned accepted delivery intact; no new lifecycle or compatibility execution path | Help no longer promises publication; direct CLI invocation returns the explicit deferred/unsupported state without entering delivery code; managed accepted finalization remains the sole supported delivery lifecycle | RWU2 regression; existing `tests/deliveryFinalize.test.ts` direct pre-acceptance handoff regression; focused delivery/action tests |
| S8-RWU4: reconcile S8 status, conformance, and ledger evidence | SEQUENTIAL_AFTER_CONTRACT_FREEZE | DETERMINISTIC | RWU2/RWU3 integrated; required validation results available | `docs/CORE_ARCHITECTURE_V2_STATUS.md`, `docs/CORE_ARCHITECTURE_V2_CONFORMANCE.md`, `docs/ENGINEERING_LEDGER.md`, this WorkGraph | Keep S8 unaccepted pending Director review; deterministic fixtures are not provider certification; no normative target change; no S9 | Current gap/status accurately includes the CLI surface finding and its resolution; evidence names exact new gate results; stale handoff/reconciliation wording is reconciled | Documentation consistency review; `git diff --check`; target-vs-HEAD check |
| S8-RWU5: integrate, review, and run the S8 remediation gate | LUNA_OWNED | DETERMINISTIC | RWU2/RWU3 complete; RWU4 updated after results | All incoming S8 paths plus RWU2/RWU3/RWU4 files; affected delivery/action/issue and system suites | Exact current AcceptanceOracle and required policy gates precede public effects; internal controller-owned workspaces remain permitted and S3-fenced; intent/gate/receipt/safe reconciliation retained; unknown is fail-closed; target unchanged; no commits/pushes/S9 | No new external effect before acceptance; normal CLI cannot accidentally enter direct delivery; all required deterministic S8 checks pass or are reported precisely; provider lanes stay separate | Focused action/delivery/issue tests; `npx tsc --noEmit`; `npm run build`; full non-system Vitest; affected deterministic system suites; `git diff --check` |

### Fresh delegation assessment

RWU2 is the only Flash-delegated unit. A fresh `list_profiles` call found `DeepSeek V4.1 Flash Implementer` (`opencode` / `opencode-go/deepseek-v4.1-flash`, mode `build`, thinking `max`, features `{ "auto_accept": true }`). The worker receives only `tests/cliS8Handoff.test.ts` in a separate Paseo worktree. It must not create nested agents or edit production/documentation files. The lead owns the frozen behavior contract, CLI production change, integration, final review, validation, and evidence updates. No child agents are authorized or used.

**Materialized delegation record:** Paseo worker `878745d5-509a-4183-a562-4820199b3a0c`; workspace `wks_718cee24ee9da9d0`; branch `s8-cli-handoff-test-flash`; path `/home/james/.paseo/worktrees/0jx5pvzi/s8-cli-handoff-test-flash`; provider/model `opencode/opencode-go/deepseek-v4.1-flash`; mode `build`; thinking `max`; `auto_accept: true`. The worker returned only `tests/cliS8Handoff.test.ts`, with no commit or nested delegation. Its baseline run failed both expected assertions against the stale CLI. The worker also ran the same regression against a throwaway copy of the lead's CLI remediation and got 2/2 passing; after selective integration the same file passed 2/2 in the primary checkout. No real provider or network effect was used. Its temporary dependency symlink was removed before completion.

## Campaign Director acceptance — 2026-09-25

The Campaign Director independently reviewed the final S8 diff, verified the strict pre-acceptance external-effect boundary and internal-resource classification, confirmed the normative target was unchanged, and reran the focused S8 delivery/action/issue/CLI suite (7 files / 89 tests), TypeScript check, production build, full non-system Vitest suite (162 files passed, 1 skipped; 1,014 passed, 7 skipped), and affected scenario/concurrency suites (2 files / 17 tests). All passed. **Disposition: SLICE_ACCEPTED.** REAL_PROVIDER, BROWSER, OPA_PROVIDER, ADVERSARIAL, and PACKED_E2E lanes remain pending. No S9 work had started at acceptance.
