WIP: Seed the default phase graph with CI to AI-review ordering as an explicit edge #447

Closed
toasterson wants to merge 2 commits from claude/wi-019fa59b-seed-the-default-phase-graph-with-ci-to into main
Owner

Anima work item 019fa59b-8eb8-71d2-9211-0a76ca6ff6a9.

What to build

The default workflow expressed as a phase graph in which today's implicit gate ordering becomes explicit edges: implement → CI (Machine) → AI review (Agent) → merge. Demoable by walking a Work Item through the seeded graph and observing that the review phase cannot be entered until the CI phase has passed.

Pushed context

  • ADR 0030 (docs/adr/0030-gates-become-phases-inventory.md) and ADR 0028.
  • This is the defect the edge prevents. On 2026-07-27 a review was dispatched alongside the implementation it was supposed to grade, so it graded the previous round's branch and burned the budget. Today the "AI gate runs only after the machine bar is green" rule is implicit in exit-bar machinery; as phases it must be an edge or the defect returns.
  • Existing exit-bar schema: crates/anima-db/migrations/034_phase_exit_bars.sql, 049_ai_bar_on_working_phase.sql.
  • The AI gate is an Agent phase, the CI gate a Machine phase, human approval a Human phase.
  • Nothing is removed in this slice. The graph is seeded alongside the existing machinery; the cutover and column removal are later slices. ADR 0018's precedent — deleting machinery whose prompts encoded behaviour, leaving the review prompt NULL — is why.

Acceptance criteria

  • The default graph exists as data and is readable by the dispatch path
  • Entering the AI-review phase before the CI phase passes is rejected
  • The graph reproduces today's observable lifecycle for a Work Item that passes first time
  • Existing exit-bar machinery still functions unchanged

Blocked by

  • PhaseKind enum and phase_kinds table (ADR 0028 Plan).
Anima work item `019fa59b-8eb8-71d2-9211-0a76ca6ff6a9`. ## What to build The default workflow expressed as a phase graph in which today's implicit gate ordering becomes **explicit edges**: implement → CI (`Machine`) → AI review (`Agent`) → merge. Demoable by walking a Work Item through the seeded graph and observing that the review phase cannot be entered until the CI phase has passed. ## Pushed context - ADR 0030 (`docs/adr/0030-gates-become-phases-inventory.md`) and ADR 0028. - **This is the defect the edge prevents.** On 2026-07-27 a review was dispatched alongside the implementation it was supposed to grade, so it graded the previous round's branch and burned the budget. Today the "AI gate runs only after the machine bar is green" rule is implicit in exit-bar machinery; as phases it must be an edge or the defect returns. - Existing exit-bar schema: `crates/anima-db/migrations/034_phase_exit_bars.sql`, `049_ai_bar_on_working_phase.sql`. - The AI gate is an `Agent` phase, the CI gate a `Machine` phase, human approval a `Human` phase. - **Nothing is removed in this slice.** The graph is seeded alongside the existing machinery; the cutover and column removal are later slices. ADR 0018's precedent — deleting machinery whose prompts encoded behaviour, leaving the review prompt NULL — is why. ## Acceptance criteria - [ ] The default graph exists as data and is readable by the dispatch path - [ ] Entering the AI-review phase before the CI phase passes is rejected - [ ] The graph reproduces today's observable lifecycle for a Work Item that passes first time - [ ] Existing exit-bar machinery still functions unchanged ## Blocked by - `PhaseKind` enum and `phase_kinds` table (ADR 0028 Plan).
toasterson force-pushed claude/wi-019fa59b-seed-the-default-phase-graph-with-ci-to from fcacfd944e to 6abed3e435 2026-08-02 09:38:20 +00:00 Compare
toasterson force-pushed claude/wi-019fa59b-seed-the-default-phase-graph-with-ci-to from 6abed3e435 to dfa9d25bbe
Some checks failed
CI / docker (pull_request) Has been skipped
CI / test (pull_request) Failing after 2h1m37s
CI / conflict-check (pull_request) Failing after 2h2m13s
2026-08-20 18:36:22 +00:00
Compare
Author
Owner

Closed by operator (Till) during the 2026-08-20 babysit pass.

This PR's work item (WI-381) was cancelled on 2026-08-08 as part of a deliberate replan, with an explicit operator supersession note naming its replacement. Nothing closes a PR when its work item is cancelled, so this branch stayed open and was re-analysed and re-rebased by successive babysit passes at real cost.

Superseded by: WI-523 'Seed the versioned default phase graph with explicit CI to AI-review ordering', plus WI-393 for the dispatch-time rejection half. The cancellation note records this PR was 124 main commits behind and targets the pre-versioned graph.

The branch is not deleted — it remains available as reference/archaeology. Do not rebase or merge it: it targets a base many merges behind current main, and in several cases the successor deliberately re-implemented rather than salvaged.

Verified this pass: the supersession note exists on the work item, the successor exists, and its acceptance criteria carry this item's scope.

**Closed by operator (Till) during the 2026-08-20 babysit pass.** This PR's work item (WI-381) was **cancelled** on 2026-08-08 as part of a deliberate replan, with an explicit operator supersession note naming its replacement. Nothing closes a PR when its work item is cancelled, so this branch stayed open and was re-analysed and re-rebased by successive babysit passes at real cost. Superseded by: WI-523 'Seed the versioned default phase graph with explicit CI to AI-review ordering', plus WI-393 for the dispatch-time rejection half. The cancellation note records this PR was 124 main commits behind and targets the pre-versioned graph. The branch is **not** deleted — it remains available as reference/archaeology. Do not rebase or merge it: it targets a base many merges behind current main, and in several cases the successor deliberately re-implemented rather than salvaged. Verified this pass: the supersession note exists on the work item, the successor exists, and its acceptance criteria carry this item's scope.
toasterson closed this pull request 2026-08-20 19:25:22 +00:00
Some checks failed
CI / docker (pull_request) Has been skipped
CI / test (pull_request) Failing after 2h1m37s
CI / conflict-check (pull_request) Failing after 2h2m13s

Pull request closed

Sign in to join this conversation.
No reviewers
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
toasterson/Anima!447
No description provided.