Research stage: platform REST merge support + idempotent shipping workflow #211

Open
opened 2026-08-16 21:52:03 +00:00 by david · 0 comments
Owner

Add the deterministic research shipping workflow (git + platform REST, mirroring runMrStage) and the REST merge support it needs:

  • REST merge support — add a merge method to the platform REST clients (Forgejo, GitLab, GitHub) behind the existing seams; unit tests per platform.
  • Shipping workflow (runResearchShipping.ts) — deterministic: branch research/issue-{no}/{issue-title-as-slug} → commit docs/reference/ → push → open PR (targeting the repo's default branch) → merge (squash by default) → return to the default branch.
  • Idempotent on resume — skip when the research PR is already merged; reference an existing open PR instead of duplicating.
  • Hard-fail policy — ALL shipping failures (branch/commit/push/PR/merge/auth/network) abort the run with error.json; no non-fatal merge-blocked path. research.enabled: false is the escape hatch for protected repos.
  • The docs PR references the existing issue but must never close it.

Unit tests use a fake git runner + fake REST client covering every step and every failure path. References: ADR-014, DESIGN.md §4 (Stage R shipping), AGENTS.md commit model footnote.

Add the deterministic research **shipping workflow** (git + platform REST, mirroring runMrStage) and the REST merge support it needs: - **REST merge support** — add a `merge` method to the platform REST clients (Forgejo, GitLab, GitHub) behind the existing seams; unit tests per platform. - **Shipping workflow** (`runResearchShipping.ts`) — deterministic: branch `research/issue-{no}/{issue-title-as-slug}` → commit `docs/reference/` → push → open PR (targeting the repo's default branch) → merge (squash by default) → return to the default branch. - **Idempotent on resume** — skip when the research PR is already merged; reference an existing open PR instead of duplicating. - **Hard-fail policy** — ALL shipping failures (branch/commit/push/PR/merge/auth/network) abort the run with `error.json`; no non-fatal merge-blocked path. `research.enabled: false` is the escape hatch for protected repos. - The docs PR references the existing issue but must **never close it**. Unit tests use a fake git runner + fake REST client covering every step and every failure path. References: ADR-014, DESIGN.md §4 (Stage R shipping), AGENTS.md commit model footnote.
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.

Dependencies

No dependencies set

Reference
david/pi-loop#211
No description provided.