Skip to content

feat(milestone-gates): revisions of a milestone, each with its own gates - #920

Open
kaihackney-scale wants to merge 3 commits into
mainfrom
kai/milestone-revisions
Open

kaihackney-scale wants to merge 3 commits into
mainfrom
kai/milestone-revisions

Conversation

@kaihackney-scale

@kaihackney-scale kaihackney-scale commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

The milestone-gates post-turn hook ran a flat list of milestones. A long task often asks for the same work again, changed ("make it tables", "it's going public now, take out the internal numbers"), and each of those asks should have its own gates. This adds revisions as a first-class part of a milestone.

  • group on a milestone entry names the milestone it revises (or an earlier revision of it). check_params refuses a group that names no earlier milestone, and a revision that doesn't come right after its milestone or that milestone's last revision.
  • carry_gates: true re-checks the previous revision's gates and keeps its artifacts, merged when the spec loads. A gate the revision writes with a carried gate's id replaces it in place. Any other repeated gate id is still refused.
  • Revisions behave like milestones. Each is opened, nudged, given up on and ended on its own line, max_nudges and blocking. Giving up stays per revision: a revision that's let go opens the next entry. Revisions are never skipped as already done unless they set skip_if_done: true, since a revision asks for a change.
  • Summary: a milestone with revisions holds them in revisions. Each is the usual row, with its revision number and its carried gates marked carried: true. The milestone's row rolls them up: the status of the furthest revision reached, reached_revision, total nudges and revisions_done. The top level adds reached_revision, revisions_done and revisions_total. A task without revisions gets the same summary as before.
  • Final check after the wrap-up: the last milestone is checked again as before. Now the latest revision of every earlier milestone is checked too, but only on its state gates (call, artifact and judge checks). no_new and trajectory_judge gates are skipped there because they describe the turns that milestone was open. A milestone found broken becomes undone. A pass in this check doesn't upgrade a let-go revision to passed, because its other gates weren't re-run.

Nudges, max_nudges/blocking, skip-if-done, the final check of the last milestone and the load-time check_params all work as before. All 66 existing tests pass unchanged.

The README has a new Revisions section with an example. A one-off check confirms the example loads through _spec.

Tests

  • tst/unit/task_step/test_milestone_gates_hook.py: 11 new tests (77 in all) covering:
    • load checks on group and carry_gates
    • gate-id reuse
    • carried gates' order and overrides
    • revisions that don't carry gates
    • a revision opened even when already done, then nudged on a carried gate
    • give-up per revision
    • a blocking revision ending the run
    • the nested summary
    • the final check across milestones (an earlier revision found undone, its no_new gate not run)
    • the same check for a flat task
  • The full tst/unit/task_step suite: 4619 passed, 3 skipped. The 6 failures are the known computer_exec_test.py (4) and test_mcp_cli_builder.py (2) ones; this change touches only the hook, its README and its tests.
  • ruff check . is clean.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both previous findings are fixed and no new actionable issues were found.

Summary

Adds milestone revisions with optional carried gates, nested summaries, and final state checks across milestones.

  • Milestones can now have ordered revisions with their own gates.
  • Summaries group revision progress under each milestone.
  • Wrap-up checks now revisit earlier milestone work.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Open milestone or revision] --> B[Check its gates]
  B -->|Pass or nonblocking give-up| C[Open next entry]
  B -->|Retry available| A
  C -->|More entries| A
  C -->|No entries left| D[Ask for wrap-up]
  D --> E[Recheck last entry and earlier milestones' latest state gates]
  E --> F[Save summary and end]
Loading

Reviews (2) · Last reviewed commit: "fix(milestone-gates): refuse a gate id t..." · Reviewed by Greptile

A milestone entry can now name the milestone it revises (`group`), for a long
task that asks for the same work again, changed. Revisions follow their
milestone one after another and are checked at load; each is opened, nudged
and given up on like any milestone, and by default never skipped as done.
`carry_gates: true` re-checks the previous revision's gates (and keeps its
artifacts), a gate with the same id overriding the carried one.

The summary nests revisions under their milestone with a roll-up (furthest
revision reached, its status, nudges, revisions done); a task without
revisions keeps its summary's shape. After the wrap-up the hook also re-checks
the latest revision of every earlier milestone on its state gates, so one the
agent broke later is `undone`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kaihackney-scale
kaihackney-scale requested a review from a team as a code owner November 25, 2026 05:03
kaihackney-scale and others added 2 commits November 25, 2026 12:23
…ion's row shows its own gate types

A carrying revision could write two gates with one inherited id: both counted
as overrides and only the last ran. An entry's own gate ids must now be unique.
The summary looked gate types up by gate id alone, so an override with another
check showed its type on the earlier revision too; types are now per entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant