[Commit-model M4] Implement stage commit (D1 + D5) #103

Closed
opened 2026-08-01 02:22:24 +00:00 by david · 1 comment
Owner

Commit implement output as commit #1; empty ⇒ hard failure (D1 + D5).

Changes

  • src/implement/services/runImplementStage.ts: after the agent session, captureDiffAgainstBase(runGit, repoRoot, base)implementation.diff; if !hasStagedOrUncommittedChanges ⇒ throw hard failure (agent did no work) → orchestrator writes error.json and aborts; else git add -- . ':(exclude).pi-loop' then git commit with buildStageCommitMessage(key, summary, 1).

Tests: non-empty ⇒ diff written, add+commit with Pi-Loop-Stage: 1; empty ⇒ hard failure, no commit, error.json path exercised.

Exit: implement always leaves exactly one stage-1 commit or fails fast.

Plan: docs/implementation-plan-commit-model.md §M4. Design: docs/design-commit-model.md.

Commit implement output as commit #1; empty ⇒ hard failure (D1 + D5). **Changes** - `src/implement/services/runImplementStage.ts`: after the agent session, `captureDiffAgainstBase(runGit, repoRoot, base)` → `implementation.diff`; if `!hasStagedOrUncommittedChanges` ⇒ throw hard failure (agent did no work) → orchestrator writes `error.json` and aborts; else `git add -- . ':(exclude).pi-loop'` then `git commit` with `buildStageCommitMessage(key, summary, 1)`. **Tests**: non-empty ⇒ diff written, add+commit with `Pi-Loop-Stage: 1`; empty ⇒ hard failure, no commit, `error.json` path exercised. **Exit**: implement always leaves exactly one stage-1 commit or fails fast. Plan: `docs/implementation-plan-commit-model.md` §M4. Design: `docs/design-commit-model.md`.
david closed this issue 2026-08-01 05:40:07 +00:00
Author
Owner

pi-loop opened and merged a pull request for this issue: #117

pi-loop opened and merged a pull request for this issue: https://git.excelera.net/david/pi-loop/pulls/117
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#103
No description provided.