server: GitPublisher — commit+push communities/<slug> to main (phase-2 plan Task 3, ADR 0003) #30

Closed
opened 2026-08-28 21:00:23 +00:00 by ben · 1 comment
Owner

Plan

docs/superpowers/plans/2026-08-28-coa-phase-2.md Task 3. Decision: docs/adr/0003-communities-committed-to-main.md.

Deliverable

server/src/git-publisher.ts: Exec type, nodeExec (execFile wrapper), GitPublisher { publish(slug) → {ok:true} | {ok:false,error} }, gitPublisher({repoDir, exec, remote?, branch?, attempts?}), noopPublisher(). Sequence add -A communities/<slug> → commit -m "community: <slug>" → up to 3 × (pull --rebase origin main → push origin main); promise-chain mutex; never throws. AppDeps.publisher; defaultDeps() uses gitPublisher only when COA_GIT_PUSH=1 (COA_REPO_DIR, default .), else noopPublisher. .env.example entries.

Acceptance (plan's four tests)

  • Fake exec: exact command sequence; push failing → 3 push attempts then {ok:false, error:'…rejected…'}.
  • Concurrent publish calls never overlap (max active exec = 1).
  • Real git against a local bare repo: the commit community: ngati-example lands on the bare main.
  • No test touches a real remote.

depends_on

  • server: CommunityStore (Task 2)

out_of_scope

Wiring into /api/submit (Task 6); credentials/identity (ticket "push credentials", human).

Phase gate

No build dispatch, no coa-shared provisioning, no status transitions beyond page-ready (phase 3). Never delete or rewrite anything under communities/ (ADR 0002/0003).

## Plan `docs/superpowers/plans/2026-08-28-coa-phase-2.md` **Task 3**. Decision: `docs/adr/0003-communities-committed-to-main.md`. ## Deliverable `server/src/git-publisher.ts`: `Exec` type, `nodeExec` (execFile wrapper), `GitPublisher { publish(slug) → {ok:true} | {ok:false,error} }`, `gitPublisher({repoDir, exec, remote?, branch?, attempts?})`, `noopPublisher()`. Sequence `add -A communities/<slug>` → `commit -m "community: <slug>"` → up to 3 × (`pull --rebase origin main` → `push origin main`); promise-chain mutex; never throws. `AppDeps.publisher`; `defaultDeps()` uses `gitPublisher` only when `COA_GIT_PUSH=1` (`COA_REPO_DIR`, default `.`), else `noopPublisher`. `.env.example` entries. ## Acceptance (plan's four tests) - Fake exec: exact command sequence; push failing → 3 push attempts then `{ok:false, error:'…rejected…'}`. - Concurrent `publish` calls never overlap (max active exec = 1). - Real git against a local bare repo: the commit `community: ngati-example` lands on the bare `main`. - No test touches a real remote. ## depends_on - server: CommunityStore (Task 2) ## out_of_scope Wiring into `/api/submit` (Task 6); credentials/identity (ticket "push credentials", human). ## Phase gate No build dispatch, no `coa-shared` provisioning, no status transitions beyond `page-ready` (phase 3). Never delete or rewrite anything under `communities/` (ADR 0002/0003).
Author
Owner

Claimed by the interactive session — working plan Task 3 next (after #29 merges); branch agent/issue-30.

Claimed by the interactive session — working plan Task 3 next (after #29 merges); branch agent/issue-30.
ben closed this issue 2026-08-30 00:34:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#30
No description provided.