Repository navigation
feat: adopt mode for impl-generate (source_ref) - #12274
Merged
Merged
Conversation
impl-generate.yml and bulk-generate.yml get a `source_ref` input. With it
set, impl-generate takes plots/{spec}/implementations/{language}/{library}{ext}
from that ref of origin instead of running Claude, renders it in both themes
with the generator's commands (Python `python -P`, the JS render harness),
checks both PNGs with core.canvas, and commits and pushes that one file.
Every later step runs unchanged: metadata, adaptability smoke run, image
processing, PR, staging upload, review dispatch.
An adopted run is always a forced regeneration (regen:forced). The routed
model only runs repair; the PR body adds a **Generation:** line above the
**Model:** line that review and repair rescues parse, and the metadata
records generated_by: adopted:<ref>. A missing file or ref, a failed
render, or an R/Julia pair is a source failure: one issue comment with its
own marker, no auto-retry, no attempt counted, never impl:<lib>:failed.
Later failures retry as before and the retry forwards source_ref.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175hA62juZoajMcqKxWFGza
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175hA62juZoajMcqKxWFGza
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved workflow defects include a critical dependency-install failure path and multiple moderate adoption validation, fetch, failure-notification, and regeneration-gate issues.
3 open issues
What changed in this PR
This pull request adds an adoption mode that lets implementation files from a branch, tag, or commit SHA pass through rendering, validation, review, repair, and merge without initial Claude generation.
Changes:
- Adds
source_refhandling to the single and bulk generation workflows. - Adds source rendering, canvas validation, metadata, PR-body, retry, and failure-reporting support.
- Adds workflow tests and documents adoption behavior, routing, and operational usage.
| File | Summary | Review notes |
|---|---|---|
tests/unit/workflows/test_regen_gate_workflows.py |
Updates regeneration and failure-handler coverage. | No final comments. |
tests/unit/workflows/test_model_routing.py |
Verifies adopted PR model metadata survives review and repair rescue paths. | No final comments. |
tests/unit/workflows/test_impl_generate_adopt.py |
Tests adoption rendering, validation, metadata, commits, failures, retries, and bulk wiring. | No final comments. |
docs/workflows/overview.md |
Documents adoption mode, forced regeneration, and failure behavior. | Nit: the documented 323-item migration exceeds the bulk workflow’s 360-minute timeout at its default pacing. |
changelog.d/impl-generate-adopt.md |
Adds the changelog entry for the new capability. | No final comments. |
agentic/docs/project-guide.md |
Documents adoption behavior in the pipeline and regeneration architecture. | No final comments. |
.github/workflows/impl-generate.yml |
Implements source adoption, rendering, canvas checks, metadata, PR creation, retry, and failure handling. | Moderate: raw source_ref=origin/ can force regeneration despite normalization. Critical: failed dependency installation can be treated as tolerated canvas drift. Moderate: adoption failures without an issue receive neither notification nor cleanup. Moderate: fetch failures are treated as missing refs and suppress retries. Moderate: invalid refs follow the ordinary retry path and consume attempts. |
.github/workflows/bulk-generate.yml |
Passes source_ref through bulk dispatches and reports adoption mode. |
No final comments. |
.claude/skills/babysit-pipeline/SKILL.md |
Documents monitoring and retry behavior for adopted runs. | No final comments. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
From the Copilot review of #12274: - A failed numpy install, or a core.canvas crash, exited 1 like a canvas drift and let the file be pushed unchecked. numpy is now installed and verified fatally, and exit 1 counts as drift only when the check printed its failing canvas_gate verdict; anything else fails without a cause, so the ordinary retry path takes it. - A failed fetch always read as a missing ref, which is never retried. The step now asks origin with ls-remote first: unreachable is the runner's failure, reachable means the ref is missing. - `source_ref=origin/` normalized to an ordinary generation while the REGEN_GATE expressions, which read the raw input, still forced the regen. A non-empty input that normalizes to nothing is now an error. Docs: the pacing arithmetic for a whole-catalogue adoption (about 115 pairs per bulk run at 180 s before the 6-hour timeout). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175hA62juZoajMcqKxWFGza
This was referenced Oct 23, 2026
MarkusNeusinger
added a commit
that referenced
this pull request
Oct 23, 2026
## Summary - The owner authorized this metadata correction on 2026-10-23. Metadata is normally written by the pipeline; this PR edits it by hand once, for 20 files. - The 20 MUI X 9 implementations below were migrated by Gemini 4 Argon in the owner's interactive Antigravity session (issue #12267, draft #12275) and adopted by the pipeline from `gemini/12267-muix-9-batch1` (PRs #12276 to #12295). Their metadata recorded `generated_by: adopted:gemini/12267-muix-9-batch1`, the only form adopt mode had before `source_model`. - In each `plots/<spec>/metadata/javascript/muix.yaml`, `generated_by` becomes `gemini-4-argon` and `adopted_from: gemini/12267-muix-9-batch1 (8cfea56)` follows it. Nothing else changes: 20 files, 40 insertions, 20 deletions. Specs: alluvial-basic, calibration-beer-lambert, datamatrix-basic, genome-track-multi, horizon-basic, map-marker-clustered, phase-diagram, recurrence-basic, sequence-logo-basic, ternary-density, area-basic, confusion-matrix, hexbin-basic, line-stepwise, scatter-color-mapped, acf-pacf, calibration-curve, gauge-basic, line-loss-training, scatter-annotated. **Merge after #12297**, which adds `source_model` to adopt mode and documents the `adopted_from` key. Plots-only, so no changelog fragment. Not touched: `gauge-activity-rings`, whose metadata says `generated_by: adopted:main` from the adopt-mode smoke run of #12274. That file came from `main`, not from Gemini. ## Plan N/A ## Test plan - [x] Before the edit, each of the 20 files carried `generated_by: adopted:gemini/12267-muix-9-batch1` exactly once, and no other metadata file did. - [x] `8cfea568c` resolves to `8cfea568c8ff9311e21de7c0133a2e5ee506f089`, the current head of `gemini/12267-muix-9-batch1` and the SHA on the `**Generation:**` line of #12276. - [x] The diff is exactly the two-line change in each of the 20 files (`git diff` grouped by line: 20 removals and 2 × 20 additions, no other lines). - [x] Every file parses as YAML with `generated_by: gemini-4-argon` and `adopted_from` directly after it. - [x] `sync_to_postgres` reads a fixed key list, so `adopted_from` is ignored and the next sync writes `gemini-4-argon` into the existing `generated_by` column (covered by a test in #12297). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0175hA62juZoajMcqKxWFGza Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
impl-generate.ymlandbulk-generate.ymlget asource_refinput (default empty). With it set, impl-generate takesplots/{spec}/implementations/{language}/{library}{ext}from that branch, tag or SHA of origin instead of running Claude. A new step, "Adopt implementation from source ref", renders it in both themes with the generator's Step 3 commands (PythonMPLBACKEND=Agg python -P, the JS render harness), checks both PNGs withcore.canvas, and commits and pushes that one file. Every later step runs unchanged: metadata, adaptability smoke run, image processing, PR, staging upload, preview, review dispatch. The purpose is to let agemini/*branch that migrates the 323 MUI X implementations to MUI X 9 reach main only through render, Opus review, repair and impl-merge.REGEN_GATEexpression (the same in all three steps) treatssource_ref != ''likeregen_gate=false, so the PR is labelledregen:forced. Both Claude steps and the prompts overlay are skipped withif:. The routed model only runs repair. The PR body adds a**Generation:** adopted from <ref> (<sha>)line and keeps the**Model:**line, because the rescue paths of impl-review and impl-repair parse exactly that line. The metadata recordsgenerated_by: adopted:<ref>.causebefore the step fails. The failure handler then posts one issue comment with its own marker (impl-adopt-fail). It does not auto-retry, counts no attempt and never setsimpl:<lib>:failed, because a retry would read the same file. Any later failure takes the ordinary path, anddispatch_retrynow forwardssource_ref.Plan
N/A. The design follows the lead's contract. Decisions are listed in the test plan notes below.
Test plan
tests/unit/workflows/test_impl_generate_adopt.py(77 cases). It runs the real adopt step against a throwaway origin underbash -eandbash -eo pipefail, covering: Python and JS renders, branch/tag/SHA refs, a file identical to main (empty adopt commit), canvas drift (warns, still pushes), a missing file or ref, a failing or silent or non-PNG render, R/Julia refused, numpy installed into the helper venv, and staged unrelated changes kept out of the commit. It also runs "Extract inputs" (normalization oforigin/, validation, notices), the metadata writer (generated_by), the failure handler (source failure vs later failure, retry forwarding), and bulk-generate's dispatch loop. Wiring guards coverif:conditions, step order and the sharedREGEN_GATEexpression.test_model_routing.py: the adopted PR body round-trips through impl-review's "Extract PR info" and impl-repair's "Resolve model" rescues (model opus survives).uv run ruff check .,ruff format --check .,mypy api core agents,uv run pytest tests/unit -n 4(13240 passed), andtools.changelog check --base origin/main. actionlint is not installed locally, so it was not run.gauge-activity-rings/muix/source_ref=main(a spec whose muix.tsx renders identically on MUI X 9). The adopt step succeeded, the Claude steps and the overlay were skipped, andcanvas_gatepassed at 2400x2400 in both themes. PR feat(muix): implement gauge-activity-rings #12273 opened withregen:forced, the adopted-from line,generated_by: adopted:mainandlibrary_version: 9.16.0, and its review dispatched. impl-review, impl-repair and impl-merge are unchanged, so their Claude steps pass claude-code-action's workflow validation on the branch ref.