# Current owner follow-up — deploy and validate the self-contained account Add flow

The owner-observed Accounts → Add Codex failure (`Cannot find module ... @zed-industries/codex-acp/dist/bin.js`) has a **source-level repair on canonical main**. The control plane now owns an explicit `@openai/codex` dependency, dogfood deployment points `AWP_CODEX_COMMAND` at the repo-local control-plane binary, configuration bootstrap is ordered before control-plane restart, and account login runs in an isolated temporary home.

Do **not** mark the owner boundary complete from source/tests alone. Before the real journey, the live Debian3 deployment must be verified to contain that exact canonical source, expose the repo-local Codex binary, complete authoritative configuration import, and successfully finish one Accounts → Add Codex device-auth/import cycle into the dedicated K3s Subrouter. No workstation/Systray/Overdeck auth may be copied or inherited. Preserve the current dogfood constraint `gpt-5.6-luna` with `low` effort only.

Canonical deployment identity is now a hard proof precondition: invoke the deploy with an explicit intended `AWP_DOGFOOD_SOURCE_SHA`, require it still equals fetched `origin/main`, and accept the cutover only when control-plane `/health` reports the same Git commit/tree and `~/.config/awp-dogfood/deployment-receipt.json` records that identity plus immutable system/runner images. A copied `/repo` tree without this receipt is not valid GOLIVE evidence.

The account-login subprocess must also remain least-authority: it may inherit only process/network mechanics required to run the CLI, never the control plane's database URL, AWP token/secret paths, callback secret, publication authority, or ambient provider API keys.

---

# Historical Slice 1 debian3 cutover baseline — 2026-08-24

> The `806da97` deployment record below is retained as historical cutover evidence. Later canonical-main redeploys supersede it as the live source identity; do not use this section to claim the current deployed SHA after subsequent cutovers.

This section supersedes the earlier pre-cutover owner-boundary items for deployment and deployment credential provisioning. The remaining owner gates are still in force.

- Exact deployed candidate: `806da97` (`ops/i1-dogfood-deploy`), staged from a `git archive` with SHA-256 `6031bb12819c29ff654997394df40bfa514cbf4345aae2fd9abbca7a71237003`.
- Canonical operator Argon2id hash was provisioned to debian3 without printing its value. No GitHub publication token is present. No Multideal/Subrouter account login, account import/selection, FactoryRun, AgentRun, ChangeSet, publication, or merge was initiated.
- `awp-dogfood-postgres.service`, `awp-dogfood-control-plane.service`, and `awp-dogfood-web.service` are active. Control plane and web run on repository-pinned Node 24 and listen only on `127.0.0.1:8787` and `127.0.0.1:4173`.
- `/health` is green with PostgreSQL migrations `20/20`, `pending=0`, `drift=[]`.
- Tailscale Serve is configured at `https://debian3.taild2daa0.ts.net/` -> `http://127.0.0.1:4173`; TLS verification from the Overdeck VM returned HTTP `303` for the unauthenticated root request. The debian3 `user` account is now the Tailscale operator so the repository deploy script can repeat the Serve step without privileged intervention.
- Live system images match the current locks: Subrouter `sha256:8498311b745f32e862bc09e33c4ed081eb60c1bd34e0176aec8a8532ce114440`; model gateway `sha256:98dee1f8c6a5cd43067a0a4066e5c0c7e24be064c2ed97e14c8c5b6b43ee3fd7`; Fabro `sha256:94e65f3da935a3b269818a0238c8f304fe5cf2aad5db856859d5ba3050eef6e7`; configured runner `sha256:3f246521725fa019ec1897badf0bf3aef44d2ebdbd21d62f87486b157d779cf4`.
- Retained execution state remains zero: FactoryRun, AgentRun, ChangeSet, ReviewFinding, VerificationEvidence and Workspace rows are all `0`; `awp-workspaces` has no Pods or PVCs. In-pod Subrouter inspection reports `No accounts configured`.
- The cutover exposed pre-existing debian3 ephemeral-storage pressure. Unused rootless Podman images were pruned, increasing free root storage from about 12 GiB to about 19 GiB; K3s now reports `DiskPressure=False`, and fresh Subrouter/Fabro/model-gateway pods are Ready. Two dead pre-cutover CNI network-namespace mounts remain as non-running runtime debris; they have no member processes and are not blocking the healthy deployments. Avoid a broad K3s restart solely to remove them while unrelated workloads are active; clear them in a maintenance window if they persist.

Remaining explicit owner gates: (1) Multideal/Subrouter account login/import/selection; (2) repository-scoped GitHub publication authority; (3) explicit authorization to initiate the real owner FactoryRun/GOLIVE controller. Keep owner acceptance at `0/30` until that journey is actually executed and retained evidence passes.

---

> **SUPERSEDED — historical recovery evidence only.** The dirty/ahead branch state and open FOUNDATION/N2 findings below describe an interrupted pre-convergence snapshot. Those repairs were subsequently preserved, tested, converged with ADR-0009/durability work, and landed to canonical main. Do **not** resume from this handoff as current execution guidance. Use `docs/progress/2026-08-24-final-main-convergence.md`, `docs/progress/2026-08-24-awp-direction-progress-audit.md`, and `docs/progress/2026-08-24-awp-i1-audit-remediation-plan.md` for current state.

## Historical Slice 1 convergence addendum — 2026-08-24

> **SUPERSEDED by the cutover-completion section at the top of this file and by canonical-main convergence.** The state below was the final pre-cutover checkpoint used to reach the deployed Slice-1 baseline. It is not current execution guidance and must not be used to downgrade Node/runtime/schema/image/auth topology or to resume the old branch sequence.


This addendum records the historical durable state for `ops/i1-dogfood-deploy` at that checkpoint; the material below remains recovery evidence only.

### Exact repository state

- Worktree: `/home/user/Projects/.worktrees/awp-i1-dogfood-deploy`
- Branch: `ops/i1-dogfood-deploy`
- Exact HEAD: `03b7bf45118eed1ca963bdd9f668a0d8ce3f70c5`
- Latest merged `origin/main`: `30373c60408a7dba420d6b364016715d31aa15ef`
- Remote lane tip at reconciliation: `af666f1b5b8fe0ccde5281eff5e86b3bddac57e6`
- Worktree is clean and locally ahead of the remote lane; no push was performed.
- `e144a82 test(golive): make lifecycle lock crash-safe` uses a kernel `flock` lease so owner-lifecycle serialization releases automatically if the controller process crashes.
- `a501c1c test(golive): converge canonical journey controller` introduced the P0–P10 barrier controller, run-scoped proof receipts, atomic GOLIVE reconciliation and exact persisted journey binding.

### Final local/buildbox verification

Validation was repeated after merging the newest `origin/main`, using the repository-pinned Node 24 runtime on `debian1` (`v24.19.0`) and pnpm 9.7.0. The exact merged tree passed:

- `pnpm install --frozen-lockfile`
- full `pnpm check`
- 59 test files passed, 5 skipped
- 264 tests passed, 9 skipped
- build green
- architecture 6/6
- dependency-cruiser: zero violations (119 modules / 214 dependencies)
- Prettier clean
- `pnpm test:golive:validate`: registry structure 30/30; semantic readiness 30/30; owner acceptance 0/30
- `GOLIVE.md`: exactly 30 criteria, 0 checked; current metric remains `0 / 30 (0%) re-proven after the I1 drift audit`

The exact Node 24 agent-runner Dockerfile also built successfully on `debian1`. A disposable normal-entrypoint IPC smoke returned protocol version 1, agent `codex-acp`, and `session.new`, `session.load`, `session.resume`, `session.cancel`, and `tool-call` capabilities. The disposable container and local smoke image tag were removed.

### Read-only live reconciliation on debian3

No deployment, credential provisioning, account import, FactoryRun, publication, merge or process stop was performed. Read-only evidence shows the canonical live environment is not currently eligible for the owner journey:

- `awp-i1-control-plane.service`: inactive; MainPID 0.
- `awp-i1-web.service`: inactive; MainPID 0.
- Ports 8787/4173 are nevertheless served by unmanaged Node 22 processes with cwd `/home/user/services/awp-i1/repo`; this stale tree declares Node `22.x`. A separate old `awp-golive-ac12` control-plane process also remains. Do not terminate any of them without an explicitly authorized cutover/cleanup action.
- Stale control-plane `/health` reports PostgreSQL healthy with migrations `14/14`; the current merged repository contains 20 migration SQL files (`0000` through `0019`).
- `tailscale serve status`: no serve config. There is therefore no current canonical HTTPS owner entrypoint.
- Canonical local credential files are absent: operator Argon2 hash, module service token, Subrouter admin-token file and GitHub App publication token. Their values were not read or printed.
- K3s nodes `debian1`, `debian2`, `debian3` are Ready. Namespaces `awp-system` and `awp-workspaces` are Active. `awp-workspaces` has no lingering Pods or PVCs.
- `awp-fabro`, `awp-model-gateway`, and `awp-subrouter` are Running 1/1, but the deployed gateway/Subrouter images are stale relative to the current digest locks.
- Running gateway image: `ghcr.io/platform-modules/awp-model-gateway@sha256:363379789126fc7869b909838c7e9045c31ac5a35bf7186f6940471e4884d369`; current lock: `ghcr.io/platform-modules/awp-model-gateway@sha256:98dee1f8c6a5cd43067a0a4066e5c0c7e24be064c2ed97e14c8c5b6b43ee3fd7`.
- Running Subrouter image: `ghcr.io/platform-modules/awp-subrouter@sha256:28b809b6dc3d13501edc38525ccb564f04b6bb68b9a03266bd1ab2e3a2cacfd2`; current lock: `ghcr.io/platform-modules/awp-subrouter@sha256:8498311b745f32e862bc09e33c4ed081eb60c1bd34e0176aec8a8532ce114440`.
- The stale control plane is configured with runner `ghcr.io/platform-modules/awp-agent-runner@sha256:afed7f0708643f8bc5fa365ef1f7569675eab93fdf607dce312eec26177366e5`; current lock is `ghcr.io/platform-modules/awp-agent-runner@sha256:3f246521725fa019ec1897badf0bf3aef44d2ebdbd21d62f87486b157d779cf4`.
- The in-cluster Subrouter management secret is internally usable at the documented `/_subrouter/accounts` endpoint, but inventory is exactly 0 accounts. No account identifiers or credentials were exposed.

### Remaining explicit owner boundary

All autonomous implementation/convergence work currently available without crossing owner authority is complete. The canonical live proof cannot begin until the owner explicitly authorizes/provides the live boundary:

1. authorize cutover/deployment of the exact settled candidate to debian3, including migration 14 -> 20, Node 24 service replacement, current immutable system/runner image locks and HTTPS Tailscale Serve;
2. provide/authorize the canonical operator/session and module-service credential provisioning required by that deployment;
3. perform or authorize Subrouter/Codex account login/import and selection (current inventory is 0);
4. provide/authorize repository-scoped GitHub publication authority for the self-repository journey;
5. explicitly authorize initiation of the real owner FactoryRun/GOLIVE controller once the above live preconditions are green.

Until those actions are authorized, keep owner acceptance at 0/30 and do not run `test:golive:execute`, deploy, provision credentials, import accounts, publish, or merge.

# AWP I1 dogfood handoff — 2026-08-24

## BLUF

Work stopped on request. The active workflow was terminated. Resume only in `/home/user/Projects/.worktrees/awp-i1-dogfood-deploy` on `ops/i1-dogfood-deploy`; do not work in `/home/user/Projects/awp`.

The branch is **ahead of origin by 10 commits and dirty**. HEAD is `ea3e04d036044a25f5cf6f8ef60776ddbd589103`. Four files contain interrupted, uncommitted FOUNDATION repair work:

- `tests/application/golive-orchestrator.test.ts`
- `tests/golive/15-changeset.spec.ts`
- `tests/golive/repository-identity.ts`
- `tests/golive/run.ts`

`git diff --check` passed at stop. Diff size: 56 insertions, 22 deletions. Inspect the actual diff before editing or resuming any workflow.

## Stopped workflow

- Task ID: `wk6u7qs3d` — stopped successfully.
- Run ID: `wf_dc3f43a4-672`
- Script: `/home/user/.claude/projects/-home-user-Projects-awp/7ea529fc-6d1f-416e-8799-f584787c3938/workflows/scripts/awp-i1-last-foundation-blockers-wf_dc3f43a4-672.js`
- Transcript/journal: `/home/user/.claude/projects/-home-user-Projects-awp/7ea529fc-6d1f-416e-8799-f584787c3938/subagents/workflows/wf_dc3f43a4-672/journal.jsonl`

Do not resume blindly: the stopped FOUNDATION refix agent left the four-file working-tree diff above. Read the journal and diff first, then decide whether to preserve it manually or resume from the earliest safe cached prefix.

Persisted TaskList task `#1 Implement autonomous wave 1` remains `in_progress`; update it only after the foundation really passes.

## Current branch state

`git status --short --branch` at stop:

```text
## ops/i1-dogfood-deploy...origin/ops/i1-dogfood-deploy [ahead 10]
 M tests/application/golive-orchestrator.test.ts
 M tests/golive/15-changeset.spec.ts
 M tests/golive/repository-identity.ts
 M tests/golive/run.ts
```

Recent local commits, newest first:

```text
ea3e04d fix(dogfood): reattach legacy ACP sessions
6dd7233 fix(golive): close recovery and repository identity gaps
6002f68 fix(dogfood): reattach legacy ACP sessions
b8f1b29 fix(golive): reconcile staged lifecycle retries
453c2d6 fix(dogfood): prove native ACP injection end to end
d460c89 fix(golive): reject ambiguous remote paths
1711f7e fix(dogfood): prove native ACP injection end to end
a81aadd fix(golive): reconcile staged lifecycle retries
e12c278 style(smoke): format explicit smoke config
cec5bb9 fix(golive): reject ambiguous remote paths
```

Remote branch tip at stop: `3c6efcc` (`Update I1 dogfood session handoff`). No push was performed in this session. Do not push, publish, or deploy without re-establishing authorization and a green exact-head gate.

## Approved foundation pieces

- N1 fail-closed deployment configuration: `1ebdd05a6ddfb615821d74059b2e3cbb0aef5247`; Node 22 gateway/control-plane typechecks and 23 focused tests passed; reviewer approved.
- G2 smoke isolation/config: `e12c278d39c129076c2563b33334578e123dc2db`; Node 22 format/lint/typecheck and safe smoke-config resolution passed; reviewer approved.
- G3 owner-lifecycle implementation: `9fde8258ebd02e5a8440b7ada7a3d87328b2ba3e`; reviewer approved before later G1 integration work.
- R1 AC-15 proof at `d460c893f62c8b83df109b9a40f4191c70c0b62d` was file-level approved, but later shared-preflight review required one strict canonicalizer for both `run.ts` and AC-15. Commit `6dd7233` plus the interrupted diff attempt that integration; treat final FOUNDATION as unapproved until reviewed.

## Open blocking defects

### N2 legacy ACP state migration

HEAD `ea3e04d` is **not approved**. Reviews confirmed that treating missing `selectionKind` / `failureInjection` fields as legacy is permanently permissive and also affects current selection-less sessions.

Required fix:

1. Persist an immutable-input schema version on every new runner state.
2. Only unversioned persisted states receive legacy compatibility.
3. On the first accepted legacy reattach, atomically backfill the schema version plus canonical `selectionKind` and `failureInjection` values.
4. Thereafter compare recorded values strictly and return 409 on changes.
5. Preserve strict matching for every pre-existing immutable field.
6. Add tests for one-time initial/retry/fallback migration, modern explicit-none collision, and post-backfill mismatch.
7. Re-run Node 22 focused tests, full typecheck, Prettier, and diff checks.

Relevant files: `infra/agent-runner/runner.mjs` and `tests/application/kubernetes-acp-recovery.test.ts`. Existing native injection implementation spans the provider/client/runner files from commit `1711f7e` and follow-ups.

### FOUNDATION recovery and repository identity

Commit `6dd7233` was not fully accepted; the stopped refix left uncommitted work. Reviewer findings to verify against the current diff:

- Authoring recovery must validate exact `task2 -> task1` and `task3 -> task2` edges, constrain Vision and every Task to the recovered Project/PlanRevision, require dependent blocked states, and reject extra/wrong edges.
- Recovery cannot emit AC-09 passed unless cycle rejection was actually observed and recorded in a durable receipt. Database closure alone is insufficient.
- Approval recovery must inspect all Task states and exact dependencies. With no FactoryRun, only exact pristine pre-approval state may proceed to click; any partial mutation fails closed.
- A successfully approved FactoryRun may already be `running` or later after a crash; recovery must accept valid causal advancement, not require only queued state/reason.
- AC-10/11 UI evidence cannot be fabricated from PostgreSQL-only recovery. Persist/reconcile separate durable UI evidence or require the UI checks before marking those criteria passed.
- FactoryRun must reference the intended dispatched Task where the schema/contract requires it.
- Side effects need a journey-scoped lock spanning reconciliation plus UI mutation so overlapping retries cannot create duplicate Projects/Plans/FactoryRuns.
- Shared repository canonicalization must be identical in orchestrator preflight and AC-15, reject parser-normalized ambiguity before URL parsing, accept case-insensitive scheme/host for documented GitHub HTTPS/SSH/scp forms, and strip exactly one command-output line delimiter only at the Git-command boundary.

Current LSP diagnostics on the interrupted diff included `replaceAll` target compatibility and typing around `OwnerEvidence`/criterion IDs. Do not trust LSP alone; run the repository's pinned Node 22 gate after inspection.

## Remaining autonomous work after foundation convergence

Use the execution plan in the completed recovery workflow output/journal rather than duplicating it here. The major remaining groups are:

- N3: durable replacement-compute retry evidence.
- G4–G7: exact-run K3s/dependency, cleanup/review/observability/history, restart/reconciliation, plan-completion/live-transition bindings.
- N4: canonical AC-17 binding over exactly two Attempts and real native ACP evidence.
- Local runner image build and IPC smoke.
- Reconciliation docs, full `pnpm check`, exact-head remote validation, and only then a local publication candidate.

Keep `GOLIVE.md` at **0/30** until canonical retained live evidence passes each criterion.

## Owner gates — do not cross

Do not autonomously:

- authorize or provision repository-scoped GitHub publication credentials;
- perform Subrouter/Codex account login or selection;
- initiate a real FactoryRun/owner journey;
- trigger runner publication or push merely because credentials exist;
- deploy to live debian3 without explicit authorization for the exact settled digest-lock commit;
- perform the protected UI merge.

At the last durable live baseline, accounts and execution/review/workspace tables were empty, GitHub publication authority absent, migrations 14/14 with zero drift, and GOLIVE 0/30. Re-verify rather than assume this remains current.

## Factory runs

No factory/ADW run was launched in this session. There is no `adw_id` or request-spec path to resume. No owner FactoryRun was started.

## Suggested skills

1. `/pickup` — recover the interrupted worktree/session carefully.
2. `/claudex-workflow` — continue using `gpt-5.6-sol` low for implementation/research and medium for reviewers, with strict disjoint file ownership and maximum safe parallelism.
3. `/code-review high` — fresh exact-diff review after FOUNDATION and N2 converge.
4. `/prod-env` only for read-only environment verification after local gates; do not use it to cross owner gates.
5. `/handoff` again before stopping if work remains dirty/unpushed.

## First actions next session

1. Invoke `/pickup` and `/claudex-workflow` with the model/effort constraints above.
2. Read this handoff, the stopped workflow journal, and the full four-file working-tree diff.
3. Run `git diff --check`; do not reset or discard the interrupted diff.
4. Decide whether the partial FOUNDATION refix correctly addresses the seven review findings. Finish/review it before committing.
5. Implement explicit N2 persisted-state versioning and one-time backfill; do not retain absence-based permanent compatibility.
6. Run pinned Node 22 focused tests, full typecheck/lint/format, then independent medium-effort reviews.
7. Only after both pass, mark TaskList task #1 complete and launch the remaining disjoint GOLIVE/N3 waves.
