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: 4/5

Reject repeated authored override IDs before merging; otherwise a required check can silently disappear.

Fix All in CursorFindings

  1. P1 Repeated overrides silently drop checks ▶
  2. P2 Earlier checks show later types ▶
Fix with agent prompt
### Issue 1
src/agent_env/examples/milestone-gates/artifacts/milestone-gates/hook.py:954-957
When a carrying revision writes two gates with the same inherited ID, `_spec` accepts both as overrides, then `mine` keeps only the last. The first check never runs, so the revision can pass without meeting all its authored checks. Reject repeated IDs within each entry's own `gates` list before merging carried gates.

### Issue 2
src/agent_env/examples/milestone-gates/artifacts/milestone-gates/hook.py:303
The nested revision rows can report the wrong gate `type`. `_summary` builds one `types` map keyed only by gate ID, but revisions can now override that ID with a different check kind or explicit `type`. Changing an action gate to a format gate makes the original revision show `format` too, even before the revision opens. Look up types by milestone ID and gate ID so each row describes the check it actually ran.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds milestone revisions with optional carried gates and nested summaries.

  • Milestones can now run ordered revisions with their own gates.
  • The wrap-up checks earlier milestones for work that changed later.
  • Milestone summaries now show revision-by-revision progress.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Check open revision] --> B{Gates pass?}
  B -->|Yes| C[Open next entry or send wrap-up]
  B -->|No| D{Nudges exhausted?}
  D -->|No| E[Send nudge]
  D -->|Yes, blocking| F[End run]
  D -->|Yes, nonblocking| C
  C --> G[Agent answers wrap-up]
  G --> H[Recheck last entry and earlier state gates]
  H --> I[Update summaries and end]
Loading

Reviews (1) · Last reviewed commit: "feat(milestone-gates): revisions of a mi..." · 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