Skip to content

mia-data: re-trigger of a failed develop round should resume the existing snippet PR - #51

Merged
krokicki merged 1 commit into
mainfrom
autodev-rokickik/issue-38
Oct 16, 2026
Merged

krokicki merged 1 commit into
mainfrom
autodev-rokickik/issue-38

Conversation

@mia-autodev

@mia-autodev mia-autodev Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #38: ## Problem

Implemented by autodev-rokickik: Claude Code running in a sandboxed job on the cluster. The agent's own
summary is the first comment.

  • Merge: approve this PR, or comment /approve <head sha> (needed when running under a personal token).
    autodev-rokickik merges once an approval matches the current head and checks are not failing.
  • Request changes: submit a review with Request changes, or comment /revise <what to change>.
    Up to 3 revision rounds.
  • Stop: close this PR.

A develop round that ends in needs-human for a reason of our own (a lost
job, a failed status write) could not be resumed: the next go reset the
state, matched again and opened a second mia-snippets issue, so autodev
wrote the same snippet twice.

MiaDataDataset._round now remembers the snippets issue and PR of a
needs-human round. When the PR is still open, the new round (fresh id and
pins, tests cleared) resumes it: the issue goes to testing with a comment
saying so and the current head gets test crops again. A PR closed or
merged meanwhile falls through to the normal match, and the remembered
snippets issue is handed to open_snippet_issue, which reuses it while it
is open and ours instead of opening another. Guarded with
workflow.patched("resume-snippet-pr"); the recorded histories replay
unchanged.

Tests: the resume (same PR re-tested, no second issue, new round's job
keys), a closed and a merged PR (new match), and the activity reusing a
remembered issue only while open, ours and this dataset's. Docs and the
spec's re-trigger rule updated.

Closes #38

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mia-autodev

mia-autodev Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

autodev-rokickik: round 1 pushed 3f9927a615b1 to autodev-rokickik/issue-38 · $7.23

Committed as 3f9927a on autodev-rokickik/issue-38. The work is complete.

Summary

A data:go on a dataset whose last round ended in needs-human while following a snippet PR now resumes that PR instead of matching again and opening a duplicate mia-snippets issue.

Workflow (mia_data/workflows.py)

  • _round remembers the snippets issue and PR from a needs-human round before resetting the state. If the PR is still open and belongs to that snippets issue, the new round (fresh round id, pins and seed, tests cleared) moves the issue to data:testing with a comment naming the resumed PR and re-tests the current head through the existing _on_pr / _follow_pr path.
  • If the PR was closed or merged meanwhile, the round falls through to the normal match. The remembered snippets issue is passed to open_snippet_issue so a needs_snippet outcome reuses it.
  • The feature is guarded with workflow.patched("resume-snippet-pr"), so in-flight histories where an old-style re-trigger already ran keep replaying on their old path. Both recorded histories replay unchanged.

Activity (mia_data/activities.py)

  • open_snippet_issue takes an optional remembered issue number and returns it when that issue is open, authored by the bot, and carries this dataset's marker for any round id. The per-round marker scan remains for same-round retries.

Tests

  • Resume: a crop job lost during develop → go → the same PR is re-tested under the new round's job keys and status, reaches pr-ready, merges, and finishes done, with exactly one open_snippet_issue call.
  • Closed and merged PR (parametrized): go → new match, and the snippets issue number is handed back for reuse.
  • Activity: a remembered issue is reused across rounds, but not when closed, not another dataset's, and not an outsider's.

Docs: the workflow overview and the spec's re-trigger rule (§4) and develop step 6 (§7.3) describe the new behaviour.

Verification

This sandbox has no pixi and blocks GitHub, so I bootstrapped an equivalent environment from conda-forge and PyPI pinned to the lock file's versions (Python 3.12.14, ruff 0.17.0, mypy 2.4.0, temporalio 1.34.0).

check result
ruff check + format check clean
mypy autodev mia_data mia_ops clean
git diff | grep 'rokickik|/nrs/' empty
tests/test_mia_workflows.py + test_mia_activities.py 61 passed, incl. both replay tests
all other test modules 291 passed
tests/test_autodev_workflows.py not run

The autodev workflow tests were not run: they need Temporal's time-skipping test server, which is downloaded from GitHub at test time and unreachable here. The mia workflow tests ran against a Temporal CLI dev server instead; they poll rather than use timers, so time skipping is not needed for them. The autodev package is untouched by this change, so CI should be the confirming run for that module.

Deploy note for the PR: in-flight MiaDataDataset runs are unaffected. The activity signature change is additive, and the workflow passes the extra argument only when it carries a value.

@krokicki
krokicki merged commit 8942c79 into main Oct 16, 2026
1 check passed
@krokicki
krokicki deleted the autodev-rokickik/issue-38 branch October 16, 2026 20:59
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.

mia-data: re-trigger of a failed develop round should resume the existing snippet PR

1 participant