1515 description : Allow one agent repair and a fresh fully validated attempt
1616 type : boolean
1717 default : true
18+ repair_commit :
19+ description : Internal approved repair commit; pins follow-up checkouts and no-op publication
20+ type : string
21+ default : " "
1822 canary_warm_rust :
1923 description : >
2024 Dispatch-only. Realize specified rust-warmup slot(s) or crate
21- family against the current plan on this branch. Skips prepare,
22- Linux validate, Darwin roots, publish, and coverage. The push
25+ family against a freshly prepared current plan on this branch.
26+ Runs prepare/plan producers; skips Linux validate, Darwin roots,
27+ publish, and coverage. The push
2328 and schedule no-skip run is still the done-bar proof.
2429 type : boolean
2530 default : false
3540 - cron : " 17 7 * * 1"
3641 # workflow_dispatch is unavailable to the Cursor GitHub App token
3742 # (HTTP 403, missing actions:write). Touching .github/update-kick on
38- # main or a listed feature branch queues one Update run. Prefer
43+ # main queues one Update run. Prefer
3944 # `gh workflow run` when the App has Actions write.
4045 # lib/update/** also queues so a pipeline fix can start Update
4146 # without a kick-file bump.
4247 push :
4348 branches :
4449 - main
45- - cursor/no-skip-darwin-shards-6614
4650 paths :
4751 - .github/update-kick
4852 - lib/update/**
6569 # #1263 force-local dry-runs the will-be-built set so a 406-drv
6670 # bootstrap compile fails the slot immediately.
6771 prepare-pins :
68- if : |-
69- github.event_name != 'workflow_dispatch' ||
70- (inputs.canary_warm_rust != true && inputs.canary_warm_rust != 'true' &&
71- inputs.canary_slots == '' && inputs.canary_crates == '')
7272 uses : ./.github/workflows/update-native.yml
7373 with :
7474 runner : ubuntu-24.04
@@ -215,7 +215,10 @@ jobs:
215215 needs : prepare-merge
216216 if : |-
217217 always() && !cancelled() &&
218- needs.prepare-merge.result == 'success'
218+ needs.prepare-merge.result == 'success' &&
219+ (github.event_name != 'workflow_dispatch' ||
220+ (inputs.canary_warm_rust != true && inputs.canary_warm_rust != 'true' &&
221+ inputs.canary_slots == '' && inputs.canary_crates == ''))
219222 uses : ./.github/workflows/update-native.yml
220223 with :
221224 runner : ubuntu-24.04-arm
@@ -227,7 +230,10 @@ jobs:
227230 needs : prepare-merge
228231 if : |-
229232 always() && !cancelled() &&
230- needs.prepare-merge.result == 'success'
233+ needs.prepare-merge.result == 'success' &&
234+ (github.event_name != 'workflow_dispatch' ||
235+ (inputs.canary_warm_rust != true && inputs.canary_warm_rust != 'true' &&
236+ inputs.canary_slots == '' && inputs.canary_crates == ''))
231237 uses : ./.github/workflows/update-native.yml
232238 with :
233239 runner : ubuntu-24.04
@@ -251,6 +257,7 @@ jobs:
251257 steps :
252258 - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
253259 with :
260+ ref : ${{ github.event.inputs.repair_commit || github.sha }}
254261 persist-credentials : false
255262 - name : Compute canary rust-warmup matrix
256263 id : slots
@@ -353,11 +360,13 @@ jobs:
353360 canary-warm-rust :
354361 needs :
355362 - canary-slots
363+ - prepare-merge
356364 - plan-darwin-closures
357365 - canary-darwin-fods
358366 if : |-
359367 always() && !cancelled() &&
360368 needs.canary-slots.result == 'success' &&
369+ needs.prepare-merge.result == 'success' &&
361370 needs.plan-darwin-closures.result == 'success' &&
362371 needs.canary-darwin-fods.result == 'success' &&
363372 needs.canary-slots.outputs.enabled == 'true'
@@ -403,7 +412,10 @@ jobs:
403412 always() && !cancelled() &&
404413 needs.prepare-merge.result == 'success' &&
405414 needs.plan-darwin-closures.result == 'success' &&
406- needs.canary-darwin-fods.result == 'success'
415+ needs.canary-darwin-fods.result == 'success' &&
416+ (github.event_name != 'workflow_dispatch' ||
417+ (inputs.canary_warm_rust != true && inputs.canary_warm_rust != 'true' &&
418+ inputs.canary_slots == '' && inputs.canary_crates == ''))
407419 strategy :
408420 fail-fast : false
409421 max-parallel : 5
@@ -448,7 +460,10 @@ jobs:
448460 needs.canary-darwin-fods.result == 'success' &&
449461 (needs.canary-warm-rust.result == 'success' ||
450462 needs.canary-warm-rust.result == 'skipped' ||
451- needs.canary-warm-rust.result == 'failure')
463+ needs.canary-warm-rust.result == 'failure') &&
464+ (github.event_name != 'workflow_dispatch' ||
465+ (inputs.canary_warm_rust != true && inputs.canary_warm_rust != 'true' &&
466+ inputs.canary_slots == '' && inputs.canary_crates == ''))
452467 uses : ./.github/workflows/update-native.yml
453468 with :
454469 runner : macos-15
@@ -619,6 +634,7 @@ jobs:
619634 steps :
620635 - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
621636 with :
637+ ref : ${{ github.event.inputs.repair_commit || github.sha }}
622638 persist-credentials : false
623639 - uses : ./.github/actions/update-runtime
624640 id : runtime
@@ -669,7 +685,10 @@ jobs:
669685 env :
670686 NIXCFG_RUNTIME : ${{ steps.runtime.outputs.runtime }}
671687 NIXCFG_DEVSHELL : ${{ steps.runtime.outputs.devshell }}
688+ NIXCFG_NIXPKGS_PATH : ${{ steps.runtime.outputs.nixpkgs }}
689+ NIXCFG_REQUIRE_NIX_EVAL : " true"
672690 NIXCFG_CI_STAGE : certify
691+ NIXCFG_REPAIR_COMMIT : ${{ inputs.repair_commit || '' }}
673692 run : |
674693 import runpy
675694 runpy.run_path("lib/update/ci/jobs.py", run_name="__main__")
@@ -689,6 +708,7 @@ jobs:
689708 # This job already has contents:write and pull-requests:write.
690709 GH_TOKEN : ${{ github.token }}
691710 UPDATE_BASE_BRANCH : ${{ github.event.repository.default_branch }}
711+ NIXCFG_REPAIR_COMMIT : ${{ inputs.repair_commit || '' }}
692712 NIXCFG_CI_STAGE : publish
693713 run : |
694714 import runpy
@@ -703,6 +723,8 @@ jobs:
703723 runpy.run_path("lib/update/ci/jobs.py", run_name="__main__")
704724 shell : python
705725 repair :
726+ outputs :
727+ tree : ${{ steps.proposal.outputs.tree }}
706728 needs :
707729 - prepare-pins
708730 - prepare-darwin
@@ -728,21 +750,24 @@ jobs:
728750 (inputs.canary_warm_rust != true && inputs.canary_warm_rust != 'true' &&
729751 inputs.canary_slots == '' && inputs.canary_crates == '')
730752 # The repair gate runs the Darwin-maintained Python suite, as publish does.
753+ # The agent runs with --allow-all-tools on untrusted failure logs, so this
754+ # job holds read-only tokens and no Cachix or signing credentials. The
755+ # start-repair job owns every write.
731756 runs-on : macos-15
732757 timeout-minutes : 120
733758 permissions :
734- actions : write
735- contents : write
759+ actions : read
760+ contents : read
736761 copilot-requests : write
737762 steps :
738763 - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
739764 with :
765+ ref : ${{ github.event.inputs.repair_commit || github.sha }}
740766 persist-credentials : false
741767 - uses : ./.github/actions/update-runtime
742768 id : runtime
743769 with :
744- github-token : ${{ secrets.UPDATE_SELF_HEAL_GITHUB_TOKEN }}
745- cachix-token : ${{ secrets.CACHIX_AUTH_TOKEN }}
770+ github-token : ${{ github.token }}
746771 cache-generators : " true"
747772 light-image-reclaim : " true"
748773 - uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
@@ -764,9 +789,12 @@ jobs:
764789 env :
765790 NIXCFG_CI_STAGE : install-agent
766791 - name : Propose one repair
792+ id : proposal
767793 env :
768794 NIXCFG_RUNTIME : ${{ steps.runtime.outputs.runtime }}
769795 NIXCFG_DEVSHELL : ${{ steps.runtime.outputs.devshell }}
796+ NIXCFG_NIXPKGS_PATH : ${{ steps.runtime.outputs.nixpkgs }}
797+ NIXCFG_REQUIRE_NIX_EVAL : " true"
770798 GITHUB_TOKEN : ${{ github.token }}
771799 COPILOT_MODEL : gpt-6-astra
772800 COPILOT_AUTO_UPDATE : ' false'
@@ -782,10 +810,37 @@ jobs:
782810 name : repair
783811 path : |
784812 ${{ runner.temp }}/repair.patch
813+ ${{ runner.temp }}/repair-receipt.json
785814 ${{ runner.temp }}/repair-evidence/repair.log
786815 if-no-files-found : warn
787816 overwrite : true
788817 retention-days : 30
818+ start-repair :
819+ needs : repair
820+ if : needs.repair.result == 'success'
821+ # This environment must have required reviewers in GitHub settings. The
822+ # approval gates this exact artifact before any write or credentialed run.
823+ environment : update-repair-approval
824+ # Commit and dispatch only; the repair job already ran the Darwin gates.
825+ runs-on : ubuntu-24.04
826+ timeout-minutes : 30
827+ permissions :
828+ actions : write
829+ contents : write
830+ steps :
831+ - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
832+ with :
833+ ref : ${{ github.event.inputs.repair_commit || github.sha }}
834+ persist-credentials : false
835+ - uses : ./.github/actions/update-runtime
836+ id : runtime
837+ with :
838+ github-token : ${{ secrets.UPDATE_SELF_HEAL_GITHUB_TOKEN }}
839+ light-image-reclaim : " true"
840+ - uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
841+ with :
842+ name : repair
843+ path : ${{ runner.temp }}
789844 - uses : crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6
790845 with :
791846 gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
@@ -795,18 +850,12 @@ jobs:
795850 - name : Start a fresh attempt with repair disabled
796851 env :
797852 NIXCFG_DEVSHELL : ${{ steps.runtime.outputs.devshell }}
853+ NIXCFG_RUNTIME : ${{ steps.runtime.outputs.runtime }}
798854 GH_TOKEN : ${{ github.token }}
799855 NIXCFG_CI_STAGE : start-repair
856+ NIXCFG_REPAIR_TREE : ${{ needs.repair.outputs.tree }}
800857 NIXCFG_UPDATE_TARGETS : ${{ inputs.targets || '' }}
801858 run : |
802859 import runpy
803860 runpy.run_path("lib/update/ci/jobs.py", run_name="__main__")
804861 shell : python
805- - name : Flush Cachix daemon
806- if : always()
807- env :
808- NIXCFG_CI_STAGE : flush-cachix
809- run : |
810- import runpy
811- runpy.run_path("lib/update/ci/jobs.py", run_name="__main__")
812- shell : python
0 commit comments