YggdrasilFactory is an issue-driven build recipe cycler for JuliaPackaging/Yggdrasil, inspired by SciMLFactory.
A single concrete Python master (master.py) owns scheduling, state, risk classification, safe upstream SHA/tag verification, Buildkite polling, and GitHub writes. Fresh isolated sessions of any agent CLI (claude, codex, devin, opencode, gemini, or a custom command via YF_AGENT_CMD) perform triage, recipe edits, and review.
Requires gh (authenticated with Yggdrasil + YggdrasilFactory write access), any supported agent CLI (claude, codex, devin, opencode, gemini, or custom YF_AGENT_CMD), Python 3.9+, and git. Durable state lives on the factory-state branch of JuliaPackaging/YggdrasilFactory (sanitized before every commit).
Paste this into any agent CLI to initialize and inspect status:
Clone (or cd into) JuliaPackaging/YggdrasilFactory, read GOAL.md, and follow its Startup instructions before taking any action.
Then start the cycler with your CLI's loop/goal command or a terminal:
- Claude Code (
/loop):/loop 5m Run python3 master.py tick and report any newly ready PRs or maintainer decisions - Goal-capable CLI (
/goal):/goal Read GOAL.md and cycle python3 master.py tick on JuliaPackaging/YggdrasilFactory until stopped; run python3 master.py doctor first and report newly ready PRs or maintainer decisions. - Any terminal (continuous loop):
gh repo clone JuliaPackaging/YggdrasilFactory && cd YggdrasilFactory python3 master.py run
See GOAL.md for the full agent operating rules, operator actions, and merge safety policy.
python3 master.py doctor # Verify GitHub permissions, state branch, and detected CLI/models
python3 master.py tick # Run one bounded scheduler step and print readable status
python3 master.py run # Run continuous scheduler ticks (default interval: 300s)
python3 master.py status # Human-readable queue + clickable issue/PR URLs
python3 master.py plan --summary # Bounded JSON summary
python3 master.py plan --issue 12345 # Detailed JSON state for one issue
python3 master.py review-policy # Print reviewer levels and risk requirements
python3 master.py merge 12345 --dry-run # Check all merge gates on a ready PR
python3 master.py merge 12345 # Mark ready + squash-merge an eligible PR- Label-gated enrollment (
factory: active/factory: inactive): On initialization,master.pyrecords a UTC cutoff timestamp. All open issues created at or before the cutoff are backfilled asfactory: inactivein batches of 25 (pass--include-closed-backfillto label closed historical issues too). New issues opened after the cutoff enroll automatically asfactory: active. Maintainers can enroll or pause any issue at any time with labels oractivate/pause. - Triage (
roles/triage.md): Maps the issue to one recipeA/Name–Z/Name, estimates difficulty (easy,medium,hard), and checks maintainer-only flags (security,provenance,license,shared,multi-recipe,registration) and critical recipes (OpenSSL,LLVM,CUDA,0_RootFS/, etc.). - Worker (
roles/worker.md) + safe upstream helper (tools/upstream.py): Edits onlybuild_tarballs.jlandbundled/in an isolated workspace without shell execution. Git tag/commit pairs from upstreamGitSourceURLs are pre-fetched safely, andArchiveSource/FileSourcePENDING_SHA256_*placeholders are resolved deterministically over public HTTPS (with SSRF checks) before committing and opening a[PackageName] ...draft PR. - Buildkite + Review (
roles/reviewer.md): Waits forbuildkite/yggdrasiland all per-tripletbuildkite/yggdrasil/build-*statuses on the exact PR head, fetches bounded failure log tails forCHANGESfix passes, runs an independent fresh-session review, classifies the Yggdrasil risk criterion (YL1–YH8), and syncs## Risk assessmentonto the draft PR body. - Decision & Merge:
- Manual mode (default): Low- and medium-risk PRs with green Buildkite and a clean advisory review enter
READY TO MERGE(review_tier: "advisory") for maintainer review andpython3 master.py merge N. High-risk PRs always hold inNEEDS MAINTAINER DECISION. - Opt-in low-risk automerge (
YF_MERGE_MODE=low-risk): Requires a qualifying counted reviewer (YF_COUNTED_REVIEW_MODELat reviewer level ≥ 3 from a separate native session). Onlylow-risk PRs (YL1–YL3, non-critical, green Buildkite, satisfied counted review, noCHANGES_REQUESTED) auto-merge via exact-SHA squash merge.
- Manual mode (default): Low- and medium-risk PRs with green Buildkite and a clean advisory review enter
python3 master.py activate 12345 --reason 'Confirmed target version v1.2.3'
python3 master.py pause 12345 --reason 'Waiting for upstream JLL registration'
python3 master.py link-follow-up 12345 --follow-up 12346 --reason 'Tracks deferred Windows target'
python3 master.py published 12345 --reason 'Verified JLL tag and General registration'| Variable | Default | Purpose |
|---|---|---|
YF_HARNESS |
auto |
Agent CLI (auto, claude, codex, devin, opencode, gemini, custom) |
YF_MODEL |
CLI default (swe-2-1-high on Devin) |
Default model passed to worker/triage/advisory reviewer |
YF_AGENT_CMD |
unset | Custom headless CLI template when YF_HARNESS=custom (supports {role}, {model}, {workspace}, {recipe}) |
YF_FACTORY_REPO |
JuliaPackaging/YggdrasilFactory |
Repository holding the factory-state branch |
YF_REQUIRE_PRIVATE_STATE |
0 |
Set 1 to enforce a private state repository |
YF_PUSH_REPO |
JuliaPackaging/Yggdrasil |
Target or fork (owner/Yggdrasil) for factory branches |
YF_MERGE_MODE |
manual |
manual (default) or low-risk (requires YF_COUNTED_REVIEW_MODEL) |
YF_STRONG_MODEL |
unset | Optional escalation model (Devin falls back to swe-2-1-xhigh if available) |
YF_COUNTED_REVIEW_MODEL |
unset | Level 3–5 UID from YF_REVIEW_MODELS_FILE for counted reviews / automerge |
YF_REVIEW_MODELS_FILE |
unset | Local JSON registry scoring external counted-review models |
YF_DAILY_CALLS |
10 |
Daily agent CLI invocation cap (UTC) |
YF_INTERVAL |
300 |
Seconds between scheduler ticks in run mode |