server: post-publish status.json writes (resend, phase-3 transitions) must be committed — they dirty the host checkout and block the coa role's git pull (GOTCHAS 14) #82

Closed
opened 2026-08-31 05:31:56 +00:00 by ben · 3 comments
Owner

Plan

Phase 3 follow-up from the #39 smoke (GOTCHAS 14). Decision context: ADR 0003 (the server commits communities/<slug>/ to main).

Problem

make resend SLUG=… (server resend) rewrites communities/<slug>/status.json in place (updatedAt) but does not commit or push it. The host checkout on matou is then dirty and the coa role's ansible.builtin.git task (force: false, deliberately — it must never discard a submission) fails with Local modifications exist in the destination. Every future status transition (phase-3 build states) has the same shape.

Deliverable (pick one, state the choice in the PR)

  1. Server-side (preferred): every status write after publish goes through GitPublisher — git add communities/<slug>/status.json && git commit -m "status: <slug> <state>" && pull --rebase && push, same retry/serialisation as publish(slug). resend and the phase-3 transitions call it. Test with the stubbed exec like git-publisher.test.ts.
  2. Role-side fallback: the mds coa role updates the checkout with pull --rebase --autostash semantics instead of failing (still never force).

Acceptance

  • After resend, git status --short in the checkout is clean and origin/main carries the status commit authored coa-server.
  • The coa role re-runs green on matou immediately after a resend.
  • docs/GOTCHAS.md 14 updated to point at the fix.

depends_on

  • #39 (closed — phase 2 proven)

out_of_scope

Build dispatch and the phase-3 states themselves (their own tickets).

## Plan Phase 3 follow-up from the #39 smoke (GOTCHAS 14). Decision context: ADR 0003 (the server commits `communities/<slug>/` to `main`). ## Problem `make resend SLUG=…` (server `resend`) rewrites `communities/<slug>/status.json` in place (`updatedAt`) but does not commit or push it. The host checkout on `matou` is then dirty and the `coa` role's `ansible.builtin.git` task (`force: false`, deliberately — it must never discard a submission) fails with *Local modifications exist in the destination*. Every future status transition (phase-3 build states) has the same shape. ## Deliverable (pick one, state the choice in the PR) 1. **Server-side (preferred):** every status write after publish goes through `GitPublisher` — `git add communities/<slug>/status.json && git commit -m "status: <slug> <state>" && pull --rebase && push`, same retry/serialisation as `publish(slug)`. `resend` and the phase-3 transitions call it. Test with the stubbed `exec` like `git-publisher.test.ts`. 2. **Role-side fallback:** the mds `coa` role updates the checkout with `pull --rebase --autostash` semantics instead of failing (still never `force`). ## Acceptance - After `resend`, `git status --short` in the checkout is clean and `origin/main` carries the status commit authored `coa-server`. - The `coa` role re-runs green on `matou` immediately after a `resend`. - `docs/GOTCHAS.md` 14 updated to point at the fix. ## depends_on - #39 (closed — phase 2 proven) ## out_of_scope Build dispatch and the phase-3 states themselves (their own tickets).

This was generated by AI during triage.

Ruled by agent under ADR 0174 (two-way-door doctrine) — veto anytime

Ruling: ready-for-agent. post-publish status.json writes must be committed (GOTCHAS 14) — option 1 (server-side GitPublisher) is stated preferred.

Why this is a two-way door: it is revertible by a later commit or label change, and provable by the tests the plan specifies — which never reach the real network, send real mail, dispatch a real build or provision a real tenant. It is not on the one-way-door list: the credential bytes, real GitHub dispatch/release and live coa-shared tenant are already carved out into the human ticket #79 and the session tickets #80/#81; env-gated defaults keep the wired code inert (noop/static, 503/unconfigured) until those land.

What proves it: option 1 is proven by a stubbed-exec test like git-publisher.test.ts (same retry/serialisation as publish(slug)); the host re-run acceptance is a deploy-time check owned by the phase-3 deploy ticket (#81), not this PR.

The ticket body is a complete agent brief (Deliverable / Acceptance / depends_on). The native Forgejo dependency links already mirror the plan's graph, so the swarm ready-list filter holds this ticket until its blockers close.

> *This was generated by AI during triage.* ## Ruled by agent under ADR 0174 (two-way-door doctrine) — veto anytime **Ruling:** `ready-for-agent`. post-publish status.json writes must be committed (GOTCHAS 14) — option 1 (server-side GitPublisher) is stated preferred. **Why this is a two-way door:** it is revertible by a later commit or label change, and provable by the tests the plan specifies — which never reach the real network, send real mail, dispatch a real build or provision a real tenant. It is not on the one-way-door list: the credential bytes, real GitHub dispatch/release and live coa-shared tenant are already carved out into the human ticket #79 and the session tickets #80/#81; env-gated defaults keep the wired code inert (noop/static, 503/unconfigured) until those land. **What proves it:** option 1 is proven by a stubbed-`exec` test like `git-publisher.test.ts` (same retry/serialisation as `publish(slug)`); the host re-run acceptance is a deploy-time check owned by the phase-3 deploy ticket (#81), not this PR. The ticket body is a complete agent brief (Deliverable / Acceptance / depends_on). The native Forgejo dependency links already mirror the plan's graph, so the swarm ready-list filter holds this ticket until its blockers close.

swarm-claim host=matou-dev-server-01 run=1253
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=1253 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #82 — status success

✅ close-report gates passed — every claim verified against the PR head; PR #83 (#83) is green and was merged (agent-after-green); the issue closed via closes #82.

envelope
{
  "issue": 82,
  "status": "success",
  "commits": [
    "cd9533f27423f40b6d84eff7e1bf7c176bfc3715"
  ],
  "changed_files": [
    "server/src/git-publisher.ts",
    "server/src/cli/resend.ts",
    "server/test/git-publisher.test.ts",
    "server/test/resend.test.ts",
    "server/test/submit.test.ts",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "pnpm install --frozen-lockfile",
      "exit_code": 0
    },
    {
      "command": "pnpm -r typecheck",
      "exit_code": 0
    },
    {
      "command": "pnpm -r test",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Server-side (preferred): every status write after publish goes through GitPublisher (add status.json, commit 'status: <slug> <state>', pull --rebase, push), same retry/serialisation as publish(slug)": "server/src/git-publisher.ts GitPublisher.publishStatus + shared commit()/serialise(); git-publisher.test.ts proves add/commit/retry/serialisation with fake git",
    "resend calls it": "server/src/cli/resend.ts calls publisher.publishStatus after each patchStatus (success + send-failure paths)",
    "Tested with the stubbed exec like git-publisher.test.ts": "server/test/git-publisher.test.ts publishStatus tests use fakeExec",
    "After resend, git status --short in the checkout is clean and origin/main carries the status commit": "server/test/resend.test.ts real-git test asserts 'git status --short' empty and bare remote log contains 'status: ngati-example page-ready'",
    "docs/GOTCHAS.md 14 updated to point at the fix": "docs/GOTCHAS.md entry 14 marked Fixed (coa #82) with the publishStatus mechanism"
  },
  "summary": "Post-publish status.json writes now commit + push via GitPublisher.publishStatus so the host checkout stays clean and the coa role's force:false git pull is unblocked (GOTCHAS 14).",
  "reason": "Deliverable option 1 (server-side, ticket's preferred) implemented and tested; the coa-role host re-run acceptance is a deploy-time check owned by phase-3 deploy ticket #81.",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #82 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the PR head; PR #83 (https://git.matou.nz/Matou/coa/pulls/83) is green and was merged (agent-after-green); the issue closed via `closes #82`. <details><summary>envelope</summary> ```json { "issue": 82, "status": "success", "commits": [ "cd9533f27423f40b6d84eff7e1bf7c176bfc3715" ], "changed_files": [ "server/src/git-publisher.ts", "server/src/cli/resend.ts", "server/test/git-publisher.test.ts", "server/test/resend.test.ts", "server/test/submit.test.ts", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "pnpm install --frozen-lockfile", "exit_code": 0 }, { "command": "pnpm -r typecheck", "exit_code": 0 }, { "command": "pnpm -r test", "exit_code": 0 } ], "criteria": { "Server-side (preferred): every status write after publish goes through GitPublisher (add status.json, commit 'status: <slug> <state>', pull --rebase, push), same retry/serialisation as publish(slug)": "server/src/git-publisher.ts GitPublisher.publishStatus + shared commit()/serialise(); git-publisher.test.ts proves add/commit/retry/serialisation with fake git", "resend calls it": "server/src/cli/resend.ts calls publisher.publishStatus after each patchStatus (success + send-failure paths)", "Tested with the stubbed exec like git-publisher.test.ts": "server/test/git-publisher.test.ts publishStatus tests use fakeExec", "After resend, git status --short in the checkout is clean and origin/main carries the status commit": "server/test/resend.test.ts real-git test asserts 'git status --short' empty and bare remote log contains 'status: ngati-example page-ready'", "docs/GOTCHAS.md 14 updated to point at the fix": "docs/GOTCHAS.md entry 14 marked Fixed (coa #82) with the publishStatus mechanism" }, "summary": "Post-publish status.json writes now commit + push via GitPublisher.publishStatus so the host checkout stays clean and the coa role's force:false git pull is unblocked (GOTCHAS 14).", "reason": "Deliverable option 1 (server-side, ticket's preferred) implemented and tested; the coa-role host re-run acceptance is a deploy-time check owned by phase-3 deploy ticket #81.", "blockers": [], "no_code_change": "" } ``` </details>
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.

Dependencies

No dependencies set.

Reference
Matou/coa#82
No description provided.