session: deploy coa.matou.nz and prove phase 2 (phase-2 plan Task 12) #39

Closed
opened 2026-08-28 21:00:32 +00:00 by ben · 5 comments
Owner

Plan

docs/superpowers/plans/2026-08-28-coa-phase-2.md Task 12. Live host + real email + real commit on main → ready-for-session.

Steps

  1. make host LIMIT=matou -t coa in matou-distributed-servers (role ticket there). https://coa.matou.nz/ and /api/health answer.
  2. Smoke submission: slug matou-smoke, shared backend, contact ben@matou.nz. Expect 200 with pageUrl; /c/matou-smoke renders; email arrives from notify@mail.matou.nz; community: matou-smoke authored by coa-server on origin/main; no ci run for that push.
  3. docker exec coa pnpm --filter @coa/server resend matou-smoke re-sends.
  4. Remove communities/matou-smoke with a normal commit from the laptop (the one sanctioned deletion — never a real submission), re-run the playbook so the host pulls it.
  5. STATUS.md header → Phase 2 complete + log lines; docs/GOTCHAS.md for whatever bit (bind-mount uid, Caddy reading the checkout, first-push protection).

depends_on

  • server: /api/submit phase-2 pipeline (Task 6)
  • e2e drive (Task 9)
  • ci paths-ignore (Task 10)
  • human: push credentials (Task 11a)
  • matou-distributed-servers: coa role (Task 11, that repo)

out_of_scope

Anything phase 3.

## Plan `docs/superpowers/plans/2026-08-28-coa-phase-2.md` **Task 12**. Live host + real email + real commit on `main` → `ready-for-session`. ## Steps 1. `make host LIMIT=matou -t coa` in matou-distributed-servers (role ticket there). `https://coa.matou.nz/` and `/api/health` answer. 2. Smoke submission: slug `matou-smoke`, shared backend, contact `ben@matou.nz`. Expect 200 with `pageUrl`; `/c/matou-smoke` renders; email arrives from `notify@mail.matou.nz`; `community: matou-smoke` authored by `coa-server` on `origin/main`; **no** ci run for that push. 3. `docker exec coa pnpm --filter @coa/server resend matou-smoke` re-sends. 4. Remove `communities/matou-smoke` with a normal commit from the laptop (the one sanctioned deletion — never a real submission), re-run the playbook so the host pulls it. 5. `STATUS.md` header → **Phase 2 complete** + log lines; `docs/GOTCHAS.md` for whatever bit (bind-mount uid, Caddy reading the checkout, first-push protection). ## depends_on - server: /api/submit phase-2 pipeline (Task 6) - e2e drive (Task 9) - ci paths-ignore (Task 10) - human: push credentials (Task 11a) - matou-distributed-servers: `coa` role (Task 11, that repo) ## out_of_scope Anything phase 3.

Blocked: the deploy artifact (matou-distributed-servers coa role, Task 11) does not exist

Session on matou-workstation, first attempt. I hold this host's standing (coa checkout reset to origin/main, FORGEJO_TOKEN, host SSH). I stopped before doing anything irreversible because the ticket's hard prerequisite is missing.

What Task 12 needs: Step 1 is make host LIMIT=matou -t coa in matou-distributed-servers, which runs the coa Ansible role in that repo. That role is Task 11 (a ticket in that repo's tracker) and is this ticket's explicit depends_on.

Evidence the role has not landed (checked /home/dev/matou/matou-distributed-servers, freshly git fetched):

  • git ls-tree -r origin/main — no roles/coa (33 roles present, none named coa).
  • No coa on any branch or remote ref (git for-each-ref, git ls-remote — empty).
  • playbooks/host.yml lists roles explicitly; there is no coa role and no coa tag, so -t coa selects zero tasks.
  • https://coa.matou.nz/ → HTTP 404 and /api/health → "Not found" (DNS + Caddy answer; the coa app is simply not deployed).
  • The coa repo itself carries no alternative deploy path (only .sandcastle/Dockerfile, the vendored harness image) — production deploy is exclusively the matou-distributed-servers role per the phase-2 plan Task 11.

Without the role there is nothing to deploy, so Steps 1–5 (deploy, smoke submission, resend, cleanup, record) cannot begin.

Why human

  • Missing upstream artifact, cross-repo: the coa role must be authored and landed in matou-distributed-servers (Task 11) first. That is a different repo on gitlab; this host env has only FORGEJO_TOKEN, no gitlab credentials — a coa session cannot do it, and Rule 1 (work only this ticket) forbids picking it up here.
  • Not resolvable by re-running a coa session: every future coa session hits the identical wall (role still absent), so leaving this ready-for-session would only burn attempts to reach the same conclusion — hence routing to human now rather than after the two-attempt counter.
  • The deploy itself is one-way-door territory (ADR 0002 / plan §Global Constraints): first real deployment, the SMTP password (vault), and the push credential. Task 11a (push identity) is proven per STATUS.md #38, but the vault SMTP secret + first-deploy remain human/session residue that Task 11 pulls in.

Unblock path: land the matou-distributed-servers coa role (Task 11 in that repo's tracker), then re-dispatch this ticket as a session — the standing session can then run Steps 1–5 as written.

Ruled by agent under the two-way-door doctrine (ADR 0002) — veto anytime. No commits, no pushes, no deploy attempted; working tree clean, nothing under communities/ touched.

## Blocked: the deploy artifact (matou-distributed-servers `coa` role, Task 11) does not exist Session on matou-workstation, first attempt. I hold this host's standing (coa checkout reset to `origin/main`, `FORGEJO_TOKEN`, host SSH). I stopped before doing anything irreversible because the ticket's hard prerequisite is missing. **What Task 12 needs:** Step 1 is `make host LIMIT=matou -t coa` in `matou-distributed-servers`, which runs the **`coa` Ansible role** in that repo. That role is Task 11 (a ticket in *that* repo's tracker) and is this ticket's explicit `depends_on`. **Evidence the role has not landed** (checked `/home/dev/matou/matou-distributed-servers`, freshly `git fetch`ed): - `git ls-tree -r origin/main` — **no `roles/coa`** (33 roles present, none named coa). - No `coa` on any branch or remote ref (`git for-each-ref`, `git ls-remote` — empty). - `playbooks/host.yml` lists roles explicitly; there is **no `coa` role and no `coa` tag**, so `-t coa` selects zero tasks. - `https://coa.matou.nz/` → **HTTP 404** and `/api/health` → "Not found" (DNS + Caddy answer; the coa app is simply not deployed). - The coa repo itself carries **no alternative deploy path** (only `.sandcastle/Dockerfile`, the vendored harness image) — production deploy is exclusively the matou-distributed-servers role per the phase-2 plan Task 11. Without the role there is nothing to deploy, so Steps 1–5 (deploy, smoke submission, resend, cleanup, record) cannot begin. ## Why human - **Missing upstream artifact, cross-repo:** the `coa` role must be authored and landed in `matou-distributed-servers` (Task 11) first. That is a different repo on gitlab; this host env has only `FORGEJO_TOKEN`, no gitlab credentials — a coa session cannot do it, and Rule 1 (work only this ticket) forbids picking it up here. - **Not resolvable by re-running a coa session:** every future coa session hits the identical wall (role still absent), so leaving this `ready-for-session` would only burn attempts to reach the same conclusion — hence routing to human now rather than after the two-attempt counter. - **The deploy itself is one-way-door territory** (ADR 0002 / plan §Global Constraints): first real deployment, the SMTP password (vault), and the push credential. Task 11a (push identity) is proven per STATUS.md #38, but the vault SMTP secret + first-deploy remain human/session residue that Task 11 pulls in. **Unblock path:** land the `matou-distributed-servers` `coa` role (Task 11 in that repo's tracker), then re-dispatch this ticket as a session — the standing session can then run Steps 1–5 as written. Ruled by agent under the two-way-door doctrine (ADR 0002) — veto anytime. No commits, no pushes, no deploy attempted; working tree clean, nothing under `communities/` touched.
Author
Owner

Unblocked — the role exists; the host checkout was looking at the wrong remote

Ruled by human (Ben) with the interactive session, 2026-08-31 03:4x UTC.

The coa role landed on Forgejo Matou/matou-distributed-servers main at 36043246 (PR #4, merged 03:11 UTC, closes #3). The workstation checkout /home/dev/matou/matou-distributed-servers tracks the GitLab remote (gitlab.com:matou-collective/…), whose main was still 7809249 — so a fresh git fetch there genuinely showed no roles/coa. Forgejo was a strict superset (ahead by exactly the two role commits, no divergence).

Fix applied:

  • GitLab main fast-forwarded to 3604324 (git push gitlab origin/main:main from Ben's laptop) — both remotes now agree.
  • Workstation checkout fast-forwarded to 3604324; roles/coa/{defaults,tasks,templates} present, playbooks/host.yml has the coa block, host_vars/matou.yml has coa_enabled: true.

Prerequisites re-verified: coa #38 closed (deploy key coa_forgejo_deploy_key + stalwart_notify_app_password in the vault), coa PR #66 COA_HOST merged, mds #3 closed. Re-dispatching as ready-for-session; Steps 1–5 as written.

## Unblocked — the role exists; the host checkout was looking at the wrong remote Ruled by human (Ben) with the interactive session, 2026-08-31 03:4x UTC. The `coa` role landed on **Forgejo** `Matou/matou-distributed-servers` `main` at `36043246` (PR #4, merged 03:11 UTC, closes #3). The workstation checkout `/home/dev/matou/matou-distributed-servers` tracks the **GitLab** remote (`gitlab.com:matou-collective/…`), whose `main` was still `7809249` — so a fresh `git fetch` there genuinely showed no `roles/coa`. Forgejo was a strict superset (ahead by exactly the two role commits, no divergence). Fix applied: - GitLab `main` fast-forwarded to `3604324` (`git push gitlab origin/main:main` from Ben's laptop) — both remotes now agree. - Workstation checkout fast-forwarded to `3604324`; `roles/coa/{defaults,tasks,templates}` present, `playbooks/host.yml` has the `coa` block, `host_vars/matou.yml` has `coa_enabled: true`. Prerequisites re-verified: coa #38 closed (deploy key `coa_forgejo_deploy_key` + `stalwart_notify_app_password` in the vault), coa PR #66 `COA_HOST` merged, mds #3 closed. Re-dispatching as `ready-for-session`; Steps 1–5 as written.

Blocked → ready-for-human: this session cannot reach matou and this host's vault lacks the coa credentials

Second session attempt. Ruled by agent under ADR 0002 (two-way-door doctrine) — veto anytime. I stopped before touching anything irreversible because Task 12's prerequisites (a reachable matou host + the coa credential bytes) are both absent on the host this session was dispatched to, and neither is a two-way door I can open.

Where this session is running

  • Host: matou-dev-server-01 — NetBird IP 100.83.253.239, FQDN matou-dev-server-01.netbird.selfhosted, mesh netbird.dev.matou.nz (the dev mesh). netbird status -d peers: matou-dev-server-01/02/03 only.
  • mds checkout /home/dev/matou/matou-distributed-servers is present, current (3604324, roles/coa + coa_enabled: true in host_vars/matou.yml) — the #38/GOTCHAS-12 fixes are in place.

Blocker A — the deploy target matou is not reachable from here (infra)

matou (inventory ansible_host: 100.98.48.68, public 143.198.134.168, coa.matou.nz) lives on the production mesh netbird.matou.nz and is not a peer of this dev-mesh host:

  • ip route get 100.98.48.68 → via 134.199.144.1 dev eth0 (falls through the public default route, not wt0).
  • ssh dev@100.98.48.68 → connect to host 100.98.48.68 port 22: Network is unreachable.
  • ansible-playbook playbooks/host.yml --limit matou --tags coa --check → UNREACHABLE! … Network is unreachable.
  • https://coa.matou.nz/ → 404 (app not deployed; matches the first-attempt evidence).

The ticket/runbook assume the session runs on matou-workstation, which is on the production mesh. The runner dispatched #39 to a dev-cluster host instead. I cannot join this host to the production mesh — that is an infra/security-posture change, not a two-way door.

Blocker B — this host's vault is missing both coa secrets (one-way door)

/home/dev/matou/matou-distributed-servers/secrets.yml is a gitignored, local file (untracked; git check-ignore → .gitignore:7; mtime 2026-07-21, never updated). ansible-vault view secrets.yml decrypts fine (198 lines) but its top-level keys contain neither coa_forgejo_deploy_key nor stalwart_notify_app_password (both appear only as references in host_vars/matou.yml and roles/coa, never as definitions; no inventory/secrets/, no env override). roles/coa/tasks/main.yml's first task asserts both are set, so even with mesh reachability the run would fail at "Sanity-check coa inputs".

#38 installed these bytes into Ben's laptop vault (that's what proved the push); they were never propagated to this host's local secrets.yml. Credential bytes are explicitly a one-way door (ADR 0002 / plan Task 11a) — never the agent's to mint or copy.

What a human needs to do (either path clears both blockers)

  1. Re-dispatch #39 to the matou-workstation checkout that already holds the production-mesh peering and the full vault (coa_forgejo_deploy_key + stalwart_notify_app_password) — the environment #38 was proven from; or
  2. Provision this host onto the production mesh and add the two secrets to its secrets.yml.

Nothing in Task 12 (deploy → smoke → resend → cleanup → record) is upstream-independent of the deploy, so there is no two-way part to land from here. Leaving Steps 1–5 exactly as written.

Relabelling ready-for-human and adding this as the ## Why human residue. No repo changes made beyond a STATUS.md log line recording this attempt.

## Blocked → `ready-for-human`: this session cannot reach `matou` and this host's vault lacks the coa credentials Second session attempt. Ruled by agent under ADR 0002 (two-way-door doctrine) — veto anytime. I stopped before touching anything irreversible because Task 12's prerequisites (a reachable `matou` host + the coa credential bytes) are **both absent on the host this session was dispatched to**, and neither is a two-way door I can open. ### Where this session is running - Host: `matou-dev-server-01` — NetBird IP `100.83.253.239`, FQDN `matou-dev-server-01.netbird.selfhosted`, mesh `netbird.dev.matou.nz` (the **dev** mesh). `netbird status -d` peers: `matou-dev-server-01/02/03` only. - mds checkout `/home/dev/matou/matou-distributed-servers` is present, current (`3604324`, `roles/coa` + `coa_enabled: true` in `host_vars/matou.yml`) — the #38/GOTCHAS-12 fixes are in place. ### Blocker A — the deploy target `matou` is not reachable from here (infra) `matou` (inventory `ansible_host: 100.98.48.68`, public `143.198.134.168`, `coa.matou.nz`) lives on the **production** mesh `netbird.matou.nz` and is **not a peer of this dev-mesh host**: - `ip route get 100.98.48.68` → `via 134.199.144.1 dev eth0` (falls through the public default route, not `wt0`). - `ssh dev@100.98.48.68` → `connect to host 100.98.48.68 port 22: Network is unreachable`. - `ansible-playbook playbooks/host.yml --limit matou --tags coa --check` → `UNREACHABLE! … Network is unreachable`. - `https://coa.matou.nz/` → `404` (app not deployed; matches the first-attempt evidence). The ticket/runbook assume the session runs on **matou-workstation**, which is on the production mesh. The runner dispatched #39 to a **dev-cluster** host instead. I cannot join this host to the production mesh — that is an infra/security-posture change, not a two-way door. ### Blocker B — this host's vault is missing both coa secrets (one-way door) `/home/dev/matou/matou-distributed-servers/secrets.yml` is a **gitignored, local** file (untracked; `git check-ignore` → `.gitignore:7`; mtime **2026-07-21**, never updated). `ansible-vault view secrets.yml` decrypts fine (198 lines) but its top-level keys contain **neither** `coa_forgejo_deploy_key` **nor** `stalwart_notify_app_password` (both appear only as *references* in `host_vars/matou.yml` and `roles/coa`, never as definitions; no `inventory/secrets/`, no env override). `roles/coa/tasks/main.yml`'s first task asserts both are set, so even with mesh reachability the run would fail at "Sanity-check coa inputs". #38 installed these bytes into **Ben's laptop** vault (that's what proved the push); they were never propagated to this host's local `secrets.yml`. Credential bytes are explicitly a one-way door (ADR 0002 / plan Task 11a) — never the agent's to mint or copy. ### What a human needs to do (either path clears both blockers) 1. **Re-dispatch #39 to the matou-workstation checkout** that already holds the production-mesh peering *and* the full vault (`coa_forgejo_deploy_key` + `stalwart_notify_app_password`) — the environment #38 was proven from; **or** 2. Provision *this* host onto the production mesh **and** add the two secrets to its `secrets.yml`. Nothing in Task 12 (deploy → smoke → resend → cleanup → record) is upstream-independent of the deploy, so there is no two-way part to land from here. Leaving Steps 1–5 exactly as written. Relabelling `ready-for-human` and adding this as the `## Why human` residue. No repo changes made beyond a STATUS.md log line recording this attempt.
Author
Owner

Done — phase 2 proven from Ben's laptop (the only seat with prod-mesh reach + the vault)

Ruled by human (Ben) with the interactive session, 2026-08-31.

Step 1 — deploy. mds PR #4 (role) + PR #5 (coa_uid 1001: uid 1000 on matou is dev; node user remapped at build; guard refuses a taken uid) merged; ansible-playbook host.yml -l matou -t coa → ok=17 changed=10 failed=0. https://coa.matou.nz/, /apply, /api/health 200. Deploy key verified from inside the container (git ls-remote origin over mesh SSH).

Step 2 — smoke matou-smoke (shared backend, contact ben@matou.nz).

  • First submit: 200 page-ready but publishError: paths are ignored by .gitignore — .gitignore carried communities/*/ since 4c500ec, contradicting ADR 0003. Fixed in ea9359f (+ tools/repo-hygiene.test.ts, GOTCHAS 13), pulled onto the host.
  • Second submit: 200 page-ready, /c/matou-smoke rendered ("Matou Smoke", build pending), ade14f2 community: matou-smoke on main authored coa-server <notify@mail.matou.nz> (rebased cleanly over an unrelated push), zero commit statuses on it vs ci / seam on the preceding normal push (#37 works).
  • Email: Stalwart log shows Message delivered to ben@matou.nz from notify@mail.matou.nz at 05:16:41, 05:23:24 (the two submits) and 05:27:31 (resend).

Step 3 — docker exec coa pnpm --filter @coa/server resend matou-smoke → "sent to ben@matou.nz", delivered (above).

Step 4 — cleanup. ba46779 removes communities/matou-smoke (laptop commit); role re-run pulled it, /c/matou-smoke → 404. On the way: resend had rewritten status.json after publish, dirtying the checkout and blocking the role's force: false pull → GOTCHAS 14, follow-up #82 (phase 3).

Step 5 — record. STATUS.md header → Phase 2 complete (6f422d1), /api/health → phase: 2, GOTCHAS 12 (mds two remotes), 13, 14.

Not done by the factory because the session host (matou-dev-server-01) is on the dev mesh and its vault lacks the coa secrets — a standing gap if #39-style tickets are to run unattended (no ticket filed; Ben's call).

## Done — phase 2 proven from Ben's laptop (the only seat with prod-mesh reach + the vault) Ruled by human (Ben) with the interactive session, 2026-08-31. **Step 1 — deploy.** mds PR #4 (role) + PR #5 (`coa_uid` 1001: uid 1000 on matou is `dev`; node user remapped at build; guard refuses a taken uid) merged; `ansible-playbook host.yml -l matou -t coa` → `ok=17 changed=10 failed=0`. `https://coa.matou.nz/`, `/apply`, `/api/health` 200. Deploy key verified from inside the container (`git ls-remote origin` over mesh SSH). **Step 2 — smoke `matou-smoke` (shared backend, contact ben@matou.nz).** - First submit: `200 page-ready` but `publishError: paths are ignored by .gitignore` — `.gitignore` carried `communities/*/` since `4c500ec`, contradicting ADR 0003. Fixed in `ea9359f` (+ `tools/repo-hygiene.test.ts`, GOTCHAS 13), pulled onto the host. - Second submit: `200 page-ready`, `/c/matou-smoke` rendered ("Matou Smoke", build pending), **`ade14f2 community: matou-smoke` on `main` authored `coa-server <notify@mail.matou.nz>`** (rebased cleanly over an unrelated push), **zero commit statuses** on it vs `ci / seam` on the preceding normal push (#37 works). - Email: Stalwart log shows `Message delivered` to `ben@matou.nz` from `notify@mail.matou.nz` at 05:16:41, 05:23:24 (the two submits) and 05:27:31 (resend). **Step 3 — `docker exec coa pnpm --filter @coa/server resend matou-smoke`** → "sent to ben@matou.nz", delivered (above). **Step 4 — cleanup.** `ba46779` removes `communities/matou-smoke` (laptop commit); role re-run pulled it, `/c/matou-smoke` → 404. On the way: `resend` had rewritten `status.json` after publish, dirtying the checkout and blocking the role's `force: false` pull → GOTCHAS 14, follow-up #82 (phase 3). **Step 5 — record.** STATUS.md header → **Phase 2 complete** (`6f422d1`), `/api/health` → `phase: 2`, GOTCHAS 12 (mds two remotes), 13, 14. Not done by the factory because the session host (matou-dev-server-01) is on the dev mesh and its vault lacks the coa secrets — a standing gap if #39-style tickets are to run unattended (no ticket filed; Ben's call).
ben 2026-08-31 05:35:01 +00:00
Author
Owner

Follow-up: the standing gap noted at close is fixed (2026-08-31). matou-workstation now has a second NetBird daemon on the production mesh (netbird-prod, wt1, peer matou-workstation 100.98.216.186), matou trusts its dev key (mds PR #8, host-scoped), and its vault carries coa_forgejo_deploy_key + stalwart_notify_app_password (mds scripts/factory-deploy-seat.sh, runbook docs/runbooks/factory-deploy-seat.md). Verified from the workstation: ansible matou -m ping → pong; host.yml -l matou -t coa --check → ok=13 failed=0. Phase-3 #81 can run as a normal session ticket.

Follow-up: the standing gap noted at close is fixed (2026-08-31). matou-workstation now has a second NetBird daemon on the production mesh (`netbird-prod`, `wt1`, peer `matou-workstation` 100.98.216.186), `matou` trusts its `dev` key (mds PR #8, host-scoped), and its vault carries `coa_forgejo_deploy_key` + `stalwart_notify_app_password` (mds `scripts/factory-deploy-seat.sh`, runbook `docs/runbooks/factory-deploy-seat.md`). Verified from the workstation: `ansible matou -m ping` → pong; `host.yml -l matou -t coa --check` → ok=13 failed=0. Phase-3 #81 can run as a normal session ticket.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/coa#39
No description provided.