dorfl 0.14.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advance-ci-template.d.ts +17 -16
- package/dist/advance-ci-template.d.ts.map +1 -1
- package/dist/advance-ci-template.js +42 -53
- package/dist/advance-ci-template.js.map +1 -1
- package/dist/advance-drivers.d.ts +8 -0
- package/dist/advance-drivers.d.ts.map +1 -1
- package/dist/advance-drivers.js +28 -4
- package/dist/advance-drivers.js.map +1 -1
- package/dist/advance-isolated.d.ts.map +1 -1
- package/dist/advance-isolated.js +3 -2
- package/dist/advance-isolated.js.map +1 -1
- package/dist/advance-lifecycle-template.d.ts +41 -40
- package/dist/advance-lifecycle-template.d.ts.map +1 -1
- package/dist/advance-lifecycle-template.js +309 -489
- package/dist/advance-lifecycle-template.js.map +1 -1
- package/dist/advance-loop-driver.d.ts.map +1 -1
- package/dist/advance-loop-driver.js +3 -2
- package/dist/advance-loop-driver.js.map +1 -1
- package/dist/advance-treeless-publish.d.ts +31 -0
- package/dist/advance-treeless-publish.d.ts.map +1 -1
- package/dist/advance-treeless-publish.js +40 -0
- package/dist/advance-treeless-publish.js.map +1 -1
- package/dist/advance.d.ts +63 -3
- package/dist/advance.d.ts.map +1 -1
- package/dist/advance.js +80 -12
- package/dist/advance.js.map +1 -1
- package/dist/advancing-lock.d.ts +9 -0
- package/dist/advancing-lock.d.ts.map +1 -1
- package/dist/advancing-lock.js +21 -1
- package/dist/advancing-lock.js.map +1 -1
- package/dist/agent-env.d.ts +61 -0
- package/dist/agent-env.d.ts.map +1 -0
- package/dist/agent-env.js +144 -0
- package/dist/agent-env.js.map +1 -0
- package/dist/agent-stop.d.ts +35 -0
- package/dist/agent-stop.d.ts.map +1 -1
- package/dist/agent-stop.js +62 -0
- package/dist/agent-stop.js.map +1 -1
- package/dist/apply-merge-action.d.ts +76 -34
- package/dist/apply-merge-action.d.ts.map +1 -1
- package/dist/apply-merge-action.js +339 -129
- package/dist/apply-merge-action.js.map +1 -1
- package/dist/apply-stuck-action.js +2 -2
- package/dist/apply-stuck-action.js.map +1 -1
- package/dist/ci-agent-result.d.ts +151 -0
- package/dist/ci-agent-result.d.ts.map +1 -0
- package/dist/ci-agent-result.js +314 -0
- package/dist/ci-agent-result.js.map +1 -0
- package/dist/ci-handoff-apply.d.ts +162 -0
- package/dist/ci-handoff-apply.d.ts.map +1 -0
- package/dist/ci-handoff-apply.js +497 -0
- package/dist/ci-handoff-apply.js.map +1 -0
- package/dist/ci-handoff-format.d.ts +369 -0
- package/dist/ci-handoff-format.d.ts.map +1 -0
- package/dist/ci-handoff-format.js +646 -0
- package/dist/ci-handoff-format.js.map +1 -0
- package/dist/ci-handoff-lfs.d.ts +146 -0
- package/dist/ci-handoff-lfs.d.ts.map +1 -0
- package/dist/ci-handoff-lfs.js +397 -0
- package/dist/ci-handoff-lfs.js.map +1 -0
- package/dist/ci-handoff.d.ts +99 -0
- package/dist/ci-handoff.d.ts.map +1 -0
- package/dist/ci-handoff.js +277 -0
- package/dist/ci-handoff.js.map +1 -0
- package/dist/ci-lock-outputs.d.ts +93 -0
- package/dist/ci-lock-outputs.d.ts.map +1 -0
- package/dist/ci-lock-outputs.js +223 -0
- package/dist/ci-lock-outputs.js.map +1 -0
- package/dist/ci-phase-build.d.ts +178 -0
- package/dist/ci-phase-build.d.ts.map +1 -0
- package/dist/ci-phase-build.js +989 -0
- package/dist/ci-phase-build.js.map +1 -0
- package/dist/ci-phase-driver.d.ts +247 -0
- package/dist/ci-phase-driver.d.ts.map +1 -0
- package/dist/ci-phase-driver.js +370 -0
- package/dist/ci-phase-driver.js.map +1 -0
- package/dist/ci-phase-intake.d.ts +172 -0
- package/dist/ci-phase-intake.d.ts.map +1 -0
- package/dist/ci-phase-intake.js +555 -0
- package/dist/ci-phase-intake.js.map +1 -0
- package/dist/ci-phase-tasking.d.ts +205 -0
- package/dist/ci-phase-tasking.d.ts.map +1 -0
- package/dist/ci-phase-tasking.js +906 -0
- package/dist/ci-phase-tasking.js.map +1 -0
- package/dist/ci-phase-treeless.d.ts +224 -0
- package/dist/ci-phase-treeless.d.ts.map +1 -0
- package/dist/ci-phase-treeless.js +1482 -0
- package/dist/ci-phase-treeless.js.map +1 -0
- package/dist/ci-read-token.d.ts +47 -0
- package/dist/ci-read-token.d.ts.map +1 -0
- package/dist/ci-read-token.js +80 -0
- package/dist/ci-read-token.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +447 -22
- package/dist/cli.js.map +1 -1
- package/dist/close-job-template.d.ts +10 -1
- package/dist/close-job-template.d.ts.map +1 -1
- package/dist/close-job-template.js +46 -14
- package/dist/close-job-template.js.map +1 -1
- package/dist/close-job.d.ts +20 -5
- package/dist/close-job.d.ts.map +1 -1
- package/dist/close-job.js +65 -12
- package/dist/close-job.js.map +1 -1
- package/dist/complete.d.ts.map +1 -1
- package/dist/complete.js +20 -1
- package/dist/complete.js.map +1 -1
- package/dist/config.d.ts +41 -44
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -4
- package/dist/config.js.map +1 -1
- package/dist/continue-branch.d.ts +63 -15
- package/dist/continue-branch.d.ts.map +1 -1
- package/dist/continue-branch.js +75 -8
- package/dist/continue-branch.js.map +1 -1
- package/dist/crashed-run-save.d.ts +73 -0
- package/dist/crashed-run-save.d.ts.map +1 -0
- package/dist/crashed-run-save.js +86 -0
- package/dist/crashed-run-save.js.map +1 -0
- package/dist/cwd-section.d.ts.map +1 -1
- package/dist/cwd-section.js +10 -2
- package/dist/cwd-section.js.map +1 -1
- package/dist/decision-engine.d.ts +10 -0
- package/dist/decision-engine.d.ts.map +1 -1
- package/dist/decision-engine.js.map +1 -1
- package/dist/do-config.d.ts +2 -24
- package/dist/do-config.d.ts.map +1 -1
- package/dist/do-config.js +1 -33
- package/dist/do-config.js.map +1 -1
- package/dist/do.d.ts +149 -1
- package/dist/do.d.ts.map +1 -1
- package/dist/do.js +115 -25
- package/dist/do.js.map +1 -1
- package/dist/dorfl-item-template.d.ts +98 -0
- package/dist/dorfl-item-template.d.ts.map +1 -0
- package/dist/dorfl-item-template.js +504 -0
- package/dist/dorfl-item-template.js.map +1 -0
- package/dist/env-config.d.ts.map +1 -1
- package/dist/env-config.js +7 -5
- package/dist/env-config.js.map +1 -1
- package/dist/frontmatter.d.ts +52 -0
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +136 -2
- package/dist/frontmatter.js.map +1 -1
- package/dist/gc.d.ts +13 -0
- package/dist/gc.d.ts.map +1 -1
- package/dist/gc.js +16 -2
- package/dist/gc.js.map +1 -1
- package/dist/git.d.ts +18 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +70 -5
- package/dist/git.js.map +1 -1
- package/dist/harness.d.ts +44 -5
- package/dist/harness.d.ts.map +1 -1
- package/dist/harness.js +24 -1
- package/dist/harness.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/install-ci-action-pins.d.ts +123 -0
- package/dist/install-ci-action-pins.d.ts.map +1 -0
- package/dist/install-ci-action-pins.js +190 -0
- package/dist/install-ci-action-pins.js.map +1 -0
- package/dist/install-ci-actions-pr-creation.d.ts +70 -0
- package/dist/install-ci-actions-pr-creation.d.ts.map +1 -0
- package/dist/install-ci-actions-pr-creation.js +106 -0
- package/dist/install-ci-actions-pr-creation.js.map +1 -0
- package/dist/install-ci-capabilities/dorfl-item.d.ts +12 -0
- package/dist/install-ci-capabilities/dorfl-item.d.ts.map +1 -0
- package/dist/install-ci-capabilities/dorfl-item.js +26 -0
- package/dist/install-ci-capabilities/dorfl-item.js.map +1 -0
- package/dist/install-ci-core.d.ts +155 -37
- package/dist/install-ci-core.d.ts.map +1 -1
- package/dist/install-ci-core.js +304 -200
- package/dist/install-ci-core.js.map +1 -1
- package/dist/install-ci-github.d.ts +47 -2
- package/dist/install-ci-github.d.ts.map +1 -1
- package/dist/install-ci-github.js +113 -1
- package/dist/install-ci-github.js.map +1 -1
- package/dist/install-ci.d.ts +25 -6
- package/dist/install-ci.d.ts.map +1 -1
- package/dist/install-ci.js +72 -36
- package/dist/install-ci.js.map +1 -1
- package/dist/intake-marker.d.ts +6 -1
- package/dist/intake-marker.d.ts.map +1 -1
- package/dist/intake-marker.js.map +1 -1
- package/dist/intake-triage.d.ts.map +1 -1
- package/dist/intake-triage.js +6 -2
- package/dist/intake-triage.js.map +1 -1
- package/dist/intake-trigger-template.d.ts +31 -25
- package/dist/intake-trigger-template.d.ts.map +1 -1
- package/dist/intake-trigger-template.js +107 -292
- package/dist/intake-trigger-template.js.map +1 -1
- package/dist/intake.d.ts +186 -4
- package/dist/intake.d.ts.map +1 -1
- package/dist/intake.js +533 -416
- package/dist/intake.js.map +1 -1
- package/dist/integration-core.d.ts +154 -1
- package/dist/integration-core.d.ts.map +1 -1
- package/dist/integration-core.js +759 -486
- package/dist/integration-core.js.map +1 -1
- package/dist/integrator.d.ts +12 -0
- package/dist/integrator.d.ts.map +1 -1
- package/dist/integrator.js +21 -0
- package/dist/integrator.js.map +1 -1
- package/dist/isolation.d.ts +12 -2
- package/dist/isolation.d.ts.map +1 -1
- package/dist/isolation.js +19 -8
- package/dist/isolation.js.map +1 -1
- package/dist/item-lock.d.ts +93 -11
- package/dist/item-lock.d.ts.map +1 -1
- package/dist/item-lock.js +233 -65
- package/dist/item-lock.js.map +1 -1
- package/dist/land-question-residue.d.ts +58 -0
- package/dist/land-question-residue.d.ts.map +1 -0
- package/dist/land-question-residue.js +95 -0
- package/dist/land-question-residue.js.map +1 -0
- package/dist/lifecycle-gather.d.ts +16 -0
- package/dist/lifecycle-gather.d.ts.map +1 -1
- package/dist/lifecycle-gather.js +54 -6
- package/dist/lifecycle-gather.js.map +1 -1
- package/dist/merge-answer.d.ts +41 -0
- package/dist/merge-answer.d.ts.map +1 -0
- package/dist/merge-answer.js +60 -0
- package/dist/merge-answer.js.map +1 -0
- package/dist/merge-question-surfacer.d.ts +105 -30
- package/dist/merge-question-surfacer.d.ts.map +1 -1
- package/dist/merge-question-surfacer.js +202 -91
- package/dist/merge-question-surfacer.js.map +1 -1
- package/dist/merge-question-tick.d.ts +64 -0
- package/dist/merge-question-tick.d.ts.map +1 -0
- package/dist/merge-question-tick.js +96 -0
- package/dist/merge-question-tick.js.map +1 -0
- package/dist/mint-adr.d.ts.map +1 -1
- package/dist/mint-adr.js +20 -2
- package/dist/mint-adr.js.map +1 -1
- package/dist/needs-attention.d.ts +72 -2
- package/dist/needs-attention.d.ts.map +1 -1
- package/dist/needs-attention.js +275 -38
- package/dist/needs-attention.js.map +1 -1
- package/dist/phase-recorder.d.ts +168 -0
- package/dist/phase-recorder.d.ts.map +1 -0
- package/dist/phase-recorder.js +218 -0
- package/dist/phase-recorder.js.map +1 -0
- package/dist/phase.d.ts +94 -0
- package/dist/phase.d.ts.map +1 -0
- package/dist/phase.js +148 -0
- package/dist/phase.js.map +1 -0
- package/dist/pi-harness.d.ts.map +1 -1
- package/dist/pi-harness.js +19 -6
- package/dist/pi-harness.js.map +1 -1
- package/dist/prepare.d.ts.map +1 -1
- package/dist/prepare.js +4 -0
- package/dist/prepare.js.map +1 -1
- package/dist/prompt.d.ts +4 -0
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +48 -1
- package/dist/prompt.js.map +1 -1
- package/dist/protocol/CLAIM-PROTOCOL.md +3 -1
- package/dist/protocol/WORK-CONTRACT.md +1 -1
- package/dist/reap-branches.d.ts +48 -0
- package/dist/reap-branches.d.ts.map +1 -1
- package/dist/reap-branches.js +64 -0
- package/dist/reap-branches.js.map +1 -1
- package/dist/ref-write.d.ts +198 -0
- package/dist/ref-write.d.ts.map +1 -0
- package/dist/ref-write.js +79 -0
- package/dist/ref-write.js.map +1 -0
- package/dist/repo-config.js +8 -8
- package/dist/repo-config.js.map +1 -1
- package/dist/repo-mirror.d.ts +36 -0
- package/dist/repo-mirror.d.ts.map +1 -1
- package/dist/repo-mirror.js +91 -1
- package/dist/repo-mirror.js.map +1 -1
- package/dist/review-verdict.d.ts +1 -1
- package/dist/review-verdict.js +1 -1
- package/dist/run.d.ts +7 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +28 -4
- package/dist/run.js.map +1 -1
- package/dist/scan.d.ts +19 -1
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +21 -8
- package/dist/scan.js.map +1 -1
- package/dist/sidecar.d.ts +14 -0
- package/dist/sidecar.d.ts.map +1 -1
- package/dist/sidecar.js +21 -0
- package/dist/sidecar.js.map +1 -1
- package/dist/single-job-warning.d.ts +63 -0
- package/dist/single-job-warning.d.ts.map +1 -0
- package/dist/single-job-warning.js +110 -0
- package/dist/single-job-warning.js.map +1 -0
- package/dist/skills/setup/protocol/CLAIM-PROTOCOL.md +3 -1
- package/dist/skills/setup/protocol/WORK-CONTRACT.md +1 -1
- package/dist/spec-complete.d.ts +13 -6
- package/dist/spec-complete.d.ts.map +1 -1
- package/dist/spec-complete.js +23 -11
- package/dist/spec-complete.js.map +1 -1
- package/dist/start.d.ts.map +1 -1
- package/dist/start.js +47 -14
- package/dist/start.js.map +1 -1
- package/dist/status.d.ts +12 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +11 -3
- package/dist/status.js.map +1 -1
- package/dist/tasking.d.ts +246 -1
- package/dist/tasking.d.ts.map +1 -1
- package/dist/tasking.js +452 -358
- package/dist/tasking.js.map +1 -1
- package/dist/triage-persist.d.ts.map +1 -1
- package/dist/triage-persist.js +21 -2
- package/dist/triage-persist.js.map +1 -1
- package/dist/verify-workflow-template.d.ts.map +1 -1
- package/dist/verify-workflow-template.js +8 -4
- package/dist/verify-workflow-template.js.map +1 -1
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +4 -0
- package/dist/verify.js.map +1 -1
- package/dist/watch-session.d.ts +42 -13
- package/dist/watch-session.d.ts.map +1 -1
- package/dist/watch-session.js +52 -23
- package/dist/watch-session.js.map +1 -1
- package/dist/work-layout.d.ts +10 -4
- package/dist/work-layout.d.ts.map +1 -1
- package/dist/work-layout.js +11 -3
- package/dist/work-layout.js.map +1 -1
- package/dist/workspace.d.ts +65 -4
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +159 -11
- package/dist/workspace.js.map +1 -1
- package/package.json +1 -1
- package/src/advance-ci-template.ts +80 -81
- package/src/advance-drivers.ts +45 -6
- package/src/advance-isolated.ts +3 -5
- package/src/advance-lifecycle-template.ts +375 -538
- package/src/advance-loop-driver.ts +3 -5
- package/src/advance-treeless-publish.ts +61 -0
- package/src/advance.ts +145 -15
- package/src/advancing-lock.ts +36 -1
- package/src/agent-env.ts +174 -0
- package/src/agent-stop.ts +81 -0
- package/src/apply-merge-action.ts +401 -154
- package/src/apply-stuck-action.ts +2 -2
- package/src/ci-agent-result.ts +421 -0
- package/src/ci-handoff-apply.ts +737 -0
- package/src/ci-handoff-format.ts +926 -0
- package/src/ci-handoff-lfs.ts +519 -0
- package/src/ci-handoff.ts +392 -0
- package/src/ci-lock-outputs.ts +273 -0
- package/src/ci-phase-build.ts +1328 -0
- package/src/ci-phase-driver.ts +548 -0
- package/src/ci-phase-intake.ts +861 -0
- package/src/ci-phase-tasking.ts +1255 -0
- package/src/ci-phase-treeless.ts +2028 -0
- package/src/ci-read-token.ts +90 -0
- package/src/cli.ts +591 -29
- package/src/close-job-template.ts +52 -15
- package/src/close-job.ts +77 -12
- package/src/complete.ts +19 -1
- package/src/config.ts +43 -48
- package/src/continue-branch.ts +121 -16
- package/src/crashed-run-save.ts +162 -0
- package/src/cwd-section.ts +10 -0
- package/src/decision-engine.ts +10 -0
- package/src/do-config.ts +2 -57
- package/src/do.ts +170 -28
- package/src/dorfl-item-template.ts +556 -0
- package/src/env-config.ts +7 -5
- package/src/frontmatter.ts +155 -2
- package/src/gc.ts +27 -2
- package/src/git.ts +83 -5
- package/src/harness.ts +58 -6
- package/src/index.ts +50 -1
- package/src/install-ci-action-pins.ts +209 -0
- package/src/install-ci-actions-pr-creation.ts +186 -0
- package/src/install-ci-capabilities/dorfl-item.ts +33 -0
- package/src/install-ci-core.ts +388 -233
- package/src/install-ci-github.ts +149 -1
- package/src/install-ci.ts +83 -37
- package/src/intake-marker.ts +6 -1
- package/src/intake-triage.ts +7 -3
- package/src/intake-trigger-template.ts +126 -327
- package/src/intake.ts +725 -544
- package/src/integration-core.ts +975 -523
- package/src/integrator.ts +28 -0
- package/src/isolation.ts +29 -10
- package/src/item-lock.ts +308 -92
- package/src/land-question-residue.ts +122 -0
- package/src/lifecycle-gather.ts +82 -10
- package/src/merge-answer.ts +82 -0
- package/src/merge-question-surfacer.ts +320 -112
- package/src/merge-question-tick.ts +182 -0
- package/src/mint-adr.ts +28 -2
- package/src/needs-attention.ts +350 -42
- package/src/phase-recorder.ts +350 -0
- package/src/phase.ts +177 -0
- package/src/pi-harness.ts +25 -5
- package/src/prepare.ts +4 -0
- package/src/prompt.ts +68 -1
- package/src/reap-branches.ts +107 -0
- package/src/ref-write.ts +324 -0
- package/src/repo-config.ts +8 -8
- package/src/repo-mirror.ts +107 -1
- package/src/review-verdict.ts +1 -1
- package/src/run.ts +47 -6
- package/src/scan.ts +37 -7
- package/src/sidecar.ts +36 -0
- package/src/single-job-warning.ts +135 -0
- package/src/spec-complete.ts +36 -14
- package/src/start.ts +55 -16
- package/src/status.ts +29 -3
- package/src/tasking.ts +593 -378
- package/src/triage-persist.ts +24 -2
- package/src/verify-workflow-template.ts +8 -4
- package/src/verify.ts +4 -0
- package/src/watch-session.ts +86 -28
- package/src/work-layout.ts +11 -3
- package/src/workspace.ts +210 -14
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SPLIT CI ITEM workflows (spec `ci-agent-job-without-write-token` §2, ADR
|
|
3
|
+
* `ci-agent-job-holds-no-write-token`; task `ci-split-generate-workflows`).
|
|
4
|
+
*
|
|
5
|
+
* Every CI item runs as three jobs in a workflow run of its own:
|
|
6
|
+
*
|
|
7
|
+
* - **lock** (write token, no agent, no repository code): classify the item
|
|
8
|
+
* at the arbiter's current `main`, take its locks, publish trusted facts as
|
|
9
|
+
* job outputs (`ci-lock-outputs.ts`);
|
|
10
|
+
* - **agent** (a read-only token, `persist-credentials: false`): run the
|
|
11
|
+
* agents and upload the handoff;
|
|
12
|
+
* - **apply** (write token, no agent, no repository code, `if: always()`):
|
|
13
|
+
* validate the handoff as hostile and do every write.
|
|
14
|
+
*
|
|
15
|
+
* This module generates the two files that carry that shape:
|
|
16
|
+
*
|
|
17
|
+
* - `dorfl-item.yml` ({@link generateItemWorkflow}): the three jobs, reached
|
|
18
|
+
* only through `workflow_call`, with NO workflow-level `concurrency`;
|
|
19
|
+
* - `dorfl-item-dispatch.yml` ({@link generateItemDispatchWorkflow}): the thin
|
|
20
|
+
* `workflow_dispatch` wrapper the advance tick starts once per item. It
|
|
21
|
+
* holds the parallelism slot (`concurrency: dorfl-slot-<slot>` with
|
|
22
|
+
* `queue: max`) and calls `dorfl-item.yml`.
|
|
23
|
+
*
|
|
24
|
+
* `intake.yml` calls `dorfl-item.yml` directly with `item: issue:<N>` under its
|
|
25
|
+
* own per-issue group (decision 10). One item per run means one artifact
|
|
26
|
+
* namespace per item (decision 1): the artifact the apply job downloads (no
|
|
27
|
+
* `run-id`) can only come from this item's agent job.
|
|
28
|
+
*
|
|
29
|
+
* The item decides the verb: `issue:<N>` runs `dorfl intake <N>`, every other
|
|
30
|
+
* namespaced id runs `dorfl advance <item> --<integrationMode>`, one line per
|
|
31
|
+
* phase (`advance --phase` routes build / tasking / tree-less itself from the
|
|
32
|
+
* lock job's `rung`).
|
|
33
|
+
*/
|
|
34
|
+
import { ACTION_PINS, pinnedUses } from './install-ci-action-pins.js';
|
|
35
|
+
import { LOCK_OUTPUT_KEYS } from './ci-lock-outputs.js';
|
|
36
|
+
import { PR_IDENTITY_SECRET_NAME, SETUP_ACTION_USES, WRITER_SETUP_ACTION_USES, providerSecretNames, providerSecretsWithBlock, } from './install-ci-core.js';
|
|
37
|
+
/** The repo-relative path (under the output base) of the item workflow. */
|
|
38
|
+
export const ITEM_WORKFLOW_PATH = 'workflows/dorfl-item.yml';
|
|
39
|
+
/** The repo-relative path (under the output base) of the dispatch wrapper. */
|
|
40
|
+
export const ITEM_DISPATCH_WORKFLOW_PATH = 'workflows/dorfl-item-dispatch.yml';
|
|
41
|
+
/** The file name the advance tick dispatches (`gh workflow run <this>`). */
|
|
42
|
+
export const ITEM_DISPATCH_WORKFLOW_FILE = 'dorfl-item-dispatch.yml';
|
|
43
|
+
/** The `run-name` prefix of a dispatched item run (`dorfl-item <item>`). */
|
|
44
|
+
export const ITEM_RUN_NAME_PREFIX = 'dorfl-item';
|
|
45
|
+
/** The four one-shot gate overrides, with their `DORFL_*` env and values. */
|
|
46
|
+
export const GATE_OVERRIDES = [
|
|
47
|
+
{ input: 'autoBuild', env: 'DORFL_AUTO_BUILD', values: ['true', 'false'] },
|
|
48
|
+
{ input: 'autoTask', env: 'DORFL_AUTO_TASK', values: ['true', 'false'] },
|
|
49
|
+
{
|
|
50
|
+
input: 'observationTriage',
|
|
51
|
+
env: 'DORFL_OBSERVATION_TRIAGE',
|
|
52
|
+
values: ['off', 'ask', 'auto'],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
input: 'surfaceBlockers',
|
|
56
|
+
env: 'DORFL_SURFACE_BLOCKERS',
|
|
57
|
+
values: ['true', 'false'],
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* The scopes every job of `dorfl-item.yml` requests, together: what a calling
|
|
62
|
+
* job must grant (a called workflow can only narrow its caller's token).
|
|
63
|
+
*/
|
|
64
|
+
export const ITEM_WORKFLOW_CALLER_PERMISSIONS = `\
|
|
65
|
+
contents: write
|
|
66
|
+
issues: write
|
|
67
|
+
pull-requests: write
|
|
68
|
+
actions: read
|
|
69
|
+
checks: read`;
|
|
70
|
+
/** `DISPATCH_AUTO_BUILD` for `DORFL_AUTO_BUILD`. */
|
|
71
|
+
function dispatchVar(env) {
|
|
72
|
+
return env.replace(/^DORFL_/, 'DISPATCH_');
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The gate-override step (a 6-space-indented workflow step): each of the four
|
|
76
|
+
* one-shot overrides reaches the shell through `env:` from `source` (e.g.
|
|
77
|
+
* `inputs` or `github.event.inputs`), is refused when it carries a line break or
|
|
78
|
+
* is not its enum (blank means no override), and is exported as its `DORFL_*`
|
|
79
|
+
* only when non-blank. `ifDispatch` adds the `workflow_dispatch` guard (the
|
|
80
|
+
* lifecycle tick; a schedule or push run exports nothing).
|
|
81
|
+
*/
|
|
82
|
+
export function gateOverridesStep(options) {
|
|
83
|
+
const envLines = GATE_OVERRIDES.map((g) => ` ${dispatchVar(g.env)}: \${{ ${options.source}.${g.input} }}`).join('\n');
|
|
84
|
+
const all = GATE_OVERRIDES.map((g) => `\${${dispatchVar(g.env)}}`).join('');
|
|
85
|
+
const enumLines = GATE_OVERRIDES.map((g) => ` case "\${${dispatchVar(g.env)}}" in ''|${g.values.join('|')}) ;; *) echo "::error::the ${g.input} override must be blank, ${g.values.join(', ')}"; exit 1 ;; esac`).join('\n');
|
|
86
|
+
const writeLines = GATE_OVERRIDES.map((g) => ` [ -n "\${${dispatchVar(g.env)}}" ] && echo "${g.env}=\${${dispatchVar(g.env)}}" >> "$GITHUB_ENV"`).join('\n');
|
|
87
|
+
const ifLine = options.ifDispatch
|
|
88
|
+
? `\n if: \${{ github.event_name == 'workflow_dispatch' }}`
|
|
89
|
+
: '';
|
|
90
|
+
return `\
|
|
91
|
+
- name: apply dispatch gate overrides (one-shot, this run only)
|
|
92
|
+
${options.comment}${ifLine}
|
|
93
|
+
env:
|
|
94
|
+
${envLines}
|
|
95
|
+
run: |
|
|
96
|
+
case "${all}" in
|
|
97
|
+
*$'\\n'*|*$'\\r'*) echo "::error::a dispatch gate override contains a line break"; exit 1 ;;
|
|
98
|
+
esac
|
|
99
|
+
${enumLines}
|
|
100
|
+
${writeLines}
|
|
101
|
+
true`;
|
|
102
|
+
}
|
|
103
|
+
/** The standard comment on the item workflow's gate-override step. */
|
|
104
|
+
const ITEM_GATE_COMMENT = `\
|
|
105
|
+
# The four one-shot gate overrides of the tick (blank: none, the
|
|
106
|
+
# committed dorfl.json wins). Exported in the lock, agent AND apply jobs,
|
|
107
|
+
# because each resolves the gate family (the lock job's classification
|
|
108
|
+
# picks the rung from it). Each reaches the shell through \`env:\` as DATA,
|
|
109
|
+
# a line break or a value outside its enum is refused (the
|
|
110
|
+
# \`workflow_call\` inputs are free strings), and only a non-blank value is
|
|
111
|
+
# written to $GITHUB_ENV (an empty DORFL_* makes the env coercion throw).`;
|
|
112
|
+
/**
|
|
113
|
+
* The shell that runs ONE phase of the item: `issue:<N>` is intake, every
|
|
114
|
+
* other id is `advance <item> --<integrationMode>`. `advanceExtra` and
|
|
115
|
+
* `intakeExtra` are the phase-specific arguments (quoted shell words).
|
|
116
|
+
*/
|
|
117
|
+
function phaseScript(options) {
|
|
118
|
+
const prelude = options.prelude ? `${options.prelude}\n` : '';
|
|
119
|
+
return `\
|
|
120
|
+
set -euo pipefail
|
|
121
|
+
case "\${WORK_ITEM}" in
|
|
122
|
+
''|-*) echo "::error::the item must be a namespaced id (task:<slug>, spec:<slug>, obs:<slug>, issue:<N>)"; exit 1 ;;
|
|
123
|
+
esac
|
|
124
|
+
case "\${INTEGRATION_MODE}" in
|
|
125
|
+
propose|merge) ;;
|
|
126
|
+
*) echo "::error::integrationMode must be propose or merge"; exit 1 ;;
|
|
127
|
+
esac
|
|
128
|
+
${prelude} case "\${WORK_ITEM}" in
|
|
129
|
+
issue:*) dorfl intake "\${WORK_ITEM#issue:}" --phase ${options.phase}${options.intakeExtra} --arbiter origin ;;
|
|
130
|
+
*) dorfl advance "\${WORK_ITEM}" "--\${INTEGRATION_MODE}" --phase ${options.phase}${options.advanceExtra} --arbiter origin ;;
|
|
131
|
+
esac`;
|
|
132
|
+
}
|
|
133
|
+
/** The `workflow_call` secrets block of `dorfl-item.yml`. */
|
|
134
|
+
function callSecretsBlock(config) {
|
|
135
|
+
const names = [...providerSecretNames(config), PR_IDENTITY_SECRET_NAME];
|
|
136
|
+
return names
|
|
137
|
+
.map((name) => ` ${name}:\n required: false`)
|
|
138
|
+
.join('\n');
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The `secrets:` a calling job passes to `dorfl-item.yml`: explicit, never
|
|
142
|
+
* `inherit`, so nothing reaches the item workflow by default. `withPrIdentity`
|
|
143
|
+
* adds {@link PR_IDENTITY_SECRET_NAME} (the advance tick; intake keeps the
|
|
144
|
+
* built-in token, as before the split).
|
|
145
|
+
*/
|
|
146
|
+
export function itemCallSecrets(config, withPrIdentity) {
|
|
147
|
+
const names = [
|
|
148
|
+
...providerSecretNames(config),
|
|
149
|
+
...(withPrIdentity ? [PR_IDENTITY_SECRET_NAME] : []),
|
|
150
|
+
];
|
|
151
|
+
if (names.length === 0) {
|
|
152
|
+
return '';
|
|
153
|
+
}
|
|
154
|
+
return ('\n secrets:\n' +
|
|
155
|
+
names.map((n) => ` ${n}: \${{ secrets.${n} }}`).join('\n'));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Generate `dorfl-item.yml`: the lock, agent and apply jobs of ONE item.
|
|
159
|
+
* Deterministic. See the module comment for the shape; every value reaches a
|
|
160
|
+
* `run:` script through `env:`.
|
|
161
|
+
*/
|
|
162
|
+
export function generateItemWorkflow(config) {
|
|
163
|
+
const workspace = config.installSource === 'workspace';
|
|
164
|
+
const lockOutputs = LOCK_OUTPUT_KEYS.map((k) => ` ${k}: \${{ steps.lock.outputs.${k} }}`).join('\n');
|
|
165
|
+
const gate = gateOverridesStep({
|
|
166
|
+
source: 'inputs',
|
|
167
|
+
ifDispatch: false,
|
|
168
|
+
comment: ITEM_GATE_COMMENT,
|
|
169
|
+
});
|
|
170
|
+
const workspaceHeader = workspace
|
|
171
|
+
? `
|
|
172
|
+
#
|
|
173
|
+
# WORKSPACE INSTALL MODE (this repository builds dorfl from source, decision 8
|
|
174
|
+
# of ADR ci-agent-job-holds-no-write-token): all three jobs build dorfl from
|
|
175
|
+
# the item's base sha (the arbiter's main tip the lock job classifies
|
|
176
|
+
# against). In MERGE mode this runs code an earlier agent landed on \`main\`
|
|
177
|
+
# inside the WRITE jobs (lock, apply), which is the trust merge mode already
|
|
178
|
+
# implies: that code is what \`main\` runs anyway.`
|
|
179
|
+
: '';
|
|
180
|
+
const lockBaseStep = workspace
|
|
181
|
+
? `
|
|
182
|
+
- name: resolve the arbiter tip to build dorfl from (workspace mode)
|
|
183
|
+
id: base
|
|
184
|
+
# The lock phase classifies against <arbiter>/main (its baseSha), not
|
|
185
|
+
# this run's github.sha, so build dorfl from that same tip.
|
|
186
|
+
run: |
|
|
187
|
+
set -euo pipefail
|
|
188
|
+
git fetch --quiet --no-tags origin +refs/heads/main:refs/remotes/origin/main
|
|
189
|
+
echo "sha=$(git rev-parse --verify 'refs/remotes/origin/main^{commit}')" >> "$GITHUB_OUTPUT"`
|
|
190
|
+
: '';
|
|
191
|
+
const lockSetupWith = workspace
|
|
192
|
+
? `
|
|
193
|
+
with:
|
|
194
|
+
source-ref: \${{ steps.base.outputs.sha }}`
|
|
195
|
+
: '';
|
|
196
|
+
const lockBaseCheck = workspace
|
|
197
|
+
? `
|
|
198
|
+
- name: check dorfl was built from the base sha (workspace mode)
|
|
199
|
+
# main can move between the fetch above and the lock phase's own fetch;
|
|
200
|
+
# the agent and apply jobs build from the base sha either way.
|
|
201
|
+
env:
|
|
202
|
+
BUILT_FROM: \${{ steps.base.outputs.sha }}
|
|
203
|
+
BASE_SHA: \${{ steps.lock.outputs.baseSha }}
|
|
204
|
+
run: |
|
|
205
|
+
if [ -n "\${BASE_SHA}" ] && [ "\${BASE_SHA}" != "\${BUILT_FROM}" ]; then
|
|
206
|
+
echo "::warning::main moved during the lock job: its dorfl was built from \${BUILT_FROM}, the item's base is \${BASE_SHA} (the agent and apply jobs build from the base)."
|
|
207
|
+
fi`
|
|
208
|
+
: '';
|
|
209
|
+
return `\
|
|
210
|
+
# dorfl — ONE CI ITEM as three jobs (spec ci-agent-job-without-write-token,
|
|
211
|
+
# ADR ci-agent-job-holds-no-write-token). EMITTED by \`dorfl install-ci\`; the
|
|
212
|
+
# human commits it. DO NOT hand-edit a copy: re-run install-ci to upgrade.
|
|
213
|
+
#
|
|
214
|
+
# lock write token, NO agent, NO repository code: classify the item at the
|
|
215
|
+
# arbiter's current main (its tip is the base), take the locks, and
|
|
216
|
+
# publish trusted facts as job outputs.
|
|
217
|
+
# agent read-only token, persist-credentials: false: run the agents, the
|
|
218
|
+
# gate and the review, stop at the first write, upload the handoff.
|
|
219
|
+
# apply write token, NO agent, NO repository code, if: always(): treat the
|
|
220
|
+
# handoff as HOSTILE, validate it against the lock outputs, do every
|
|
221
|
+
# write (or release / surface the item when the agent job failed).
|
|
222
|
+
#
|
|
223
|
+
# Reached only through \`workflow_call\`: from dorfl-item-dispatch.yml (one run
|
|
224
|
+
# per advance item, holding the parallelism slot) and from intake.yml
|
|
225
|
+
# (\`item: issue:<N>\`, under its per-issue group). ONE item per run: the
|
|
226
|
+
# artifact namespace is this run's, so the apply job's download (no run-id)
|
|
227
|
+
# can only read this item's agent job. NO workflow-level concurrency here: the
|
|
228
|
+
# callers own it.
|
|
229
|
+
#
|
|
230
|
+
# The base is the arbiter tip, never the run's commit: a queued run may start
|
|
231
|
+
# hours after its dispatch. The lock job's checkout (github.sha) only loads the
|
|
232
|
+
# local composite action; dorfl fetches <arbiter>/main itself and publishes its
|
|
233
|
+
# tip as \`baseSha\`, which the agent and apply jobs check out.
|
|
234
|
+
#
|
|
235
|
+
# Secrets: the provider key(s) reach the AGENT job only; DORFL_GH_TOKEN and the
|
|
236
|
+
# write-scoped GITHUB_TOKEN reach lock and apply only. The agent job's
|
|
237
|
+
# GITHUB_TOKEN is read-only (its job permissions).
|
|
238
|
+
#
|
|
239
|
+
# All jobs run on GitHub-hosted runners: each job needs a FRESH machine. A
|
|
240
|
+
# self-hosted runner must be ephemeral (one job per machine), or files and
|
|
241
|
+
# processes an agent planted survive into a later lock or apply job.${workspaceHeader}
|
|
242
|
+
|
|
243
|
+
name: dorfl-item
|
|
244
|
+
|
|
245
|
+
on:
|
|
246
|
+
workflow_call:
|
|
247
|
+
inputs:
|
|
248
|
+
item:
|
|
249
|
+
description: 'The namespaced item id: task:<slug>, spec:<slug>, obs:<slug>, observation:<slug> (advance) or issue:<N> (intake).'
|
|
250
|
+
required: true
|
|
251
|
+
type: string
|
|
252
|
+
integrationMode:
|
|
253
|
+
description: 'propose or merge (advance items; the lock phase refuses anything else). Intake reads its document mode from dorfl.json.'
|
|
254
|
+
required: false
|
|
255
|
+
default: 'propose'
|
|
256
|
+
type: string
|
|
257
|
+
autoBuild:
|
|
258
|
+
description: 'One-shot autoBuild override (blank: none).'
|
|
259
|
+
required: false
|
|
260
|
+
default: ''
|
|
261
|
+
type: string
|
|
262
|
+
autoTask:
|
|
263
|
+
description: 'One-shot autoTask override (blank: none).'
|
|
264
|
+
required: false
|
|
265
|
+
default: ''
|
|
266
|
+
type: string
|
|
267
|
+
observationTriage:
|
|
268
|
+
description: 'One-shot observationTriage override (blank: none).'
|
|
269
|
+
required: false
|
|
270
|
+
default: ''
|
|
271
|
+
type: string
|
|
272
|
+
surfaceBlockers:
|
|
273
|
+
description: 'One-shot surfaceBlockers override (blank: none).'
|
|
274
|
+
required: false
|
|
275
|
+
default: ''
|
|
276
|
+
type: string
|
|
277
|
+
secrets:
|
|
278
|
+
${callSecretsBlock(config)}
|
|
279
|
+
|
|
280
|
+
# Nothing at workflow level: each job grants its own scopes (and a caller's
|
|
281
|
+
# grant caps them).
|
|
282
|
+
permissions: {}
|
|
283
|
+
|
|
284
|
+
jobs:
|
|
285
|
+
# ── LOCK: write token, no agent, no repository code ─────────────────────────
|
|
286
|
+
lock:
|
|
287
|
+
runs-on: ubuntu-latest
|
|
288
|
+
timeout-minutes: 15
|
|
289
|
+
permissions:
|
|
290
|
+
contents: write
|
|
291
|
+
issues: write
|
|
292
|
+
pull-requests: write
|
|
293
|
+
# Exactly the lock phase's facts (ci-lock-outputs.ts), written by dorfl to
|
|
294
|
+
# $GITHUB_OUTPUT. The agent and apply jobs read them back as ONE JSON value,
|
|
295
|
+
# DORFL_LOCK_OUTPUTS = toJSON(needs.lock.outputs), which dorfl re-validates.
|
|
296
|
+
outputs:
|
|
297
|
+
${lockOutputs}
|
|
298
|
+
steps:
|
|
299
|
+
- uses: ${pinnedUses(ACTION_PINS.checkout)}
|
|
300
|
+
with:
|
|
301
|
+
fetch-depth: 0${lockBaseStep}
|
|
302
|
+
- uses: ${WRITER_SETUP_ACTION_USES}${lockSetupWith}
|
|
303
|
+
${gate}
|
|
304
|
+
- name: lock the item (no agent, no repository code)
|
|
305
|
+
id: lock
|
|
306
|
+
# dorfl fetches <arbiter>/main, classifies the item at its tip (the
|
|
307
|
+
# base), takes the locks and writes its facts to $GITHUB_OUTPUT (among
|
|
308
|
+
# them agentTimeoutMinutes, read from dorfl.json at the base). Intake
|
|
309
|
+
# derives the origin trust from this run's event and the document mode
|
|
310
|
+
# from dorfl.json at the base.
|
|
311
|
+
env:
|
|
312
|
+
GH_TOKEN: \${{ secrets.${PR_IDENTITY_SECRET_NAME} || secrets.GITHUB_TOKEN }}
|
|
313
|
+
WORK_ITEM: \${{ inputs.item }}
|
|
314
|
+
INTEGRATION_MODE: \${{ inputs.integrationMode }}
|
|
315
|
+
run: |
|
|
316
|
+
${phaseScript({ phase: 'lock', advanceExtra: '', intakeExtra: '' })}${lockBaseCheck}
|
|
317
|
+
|
|
318
|
+
# ── AGENT: read-only token, no persisted credential ────────────────────────
|
|
319
|
+
agent:
|
|
320
|
+
needs: lock
|
|
321
|
+
if: \${{ needs.lock.outputs.acquired == 'true' && needs.lock.outputs.needsAgent == 'true' }}
|
|
322
|
+
runs-on: ubuntu-latest
|
|
323
|
+
# agentDeadlineMinutes + checkpointHeadroomMinutes from dorfl.json at the
|
|
324
|
+
# base, computed by the lock job (a job output is a string: fromJSON).
|
|
325
|
+
timeout-minutes: \${{ fromJSON(needs.lock.outputs.agentTimeoutMinutes) }}
|
|
326
|
+
permissions:
|
|
327
|
+
contents: read
|
|
328
|
+
issues: read
|
|
329
|
+
steps:
|
|
330
|
+
- uses: ${pinnedUses(ACTION_PINS.checkout)}
|
|
331
|
+
with:
|
|
332
|
+
ref: \${{ needs.lock.outputs.baseSha }}
|
|
333
|
+
fetch-depth: 0
|
|
334
|
+
# Nothing in this job may hold a credential the agent could use: the
|
|
335
|
+
# read token reaches dorfl's own git per command, never .git/config.
|
|
336
|
+
persist-credentials: false
|
|
337
|
+
lfs: true
|
|
338
|
+
- uses: ${SETUP_ACTION_USES}${providerSecretsWithBlock(config)}
|
|
339
|
+
- name: enable git LFS in this checkout
|
|
340
|
+
run: git lfs install --local
|
|
341
|
+
${gate}
|
|
342
|
+
- name: run the agents (stops at the first write, writes the handoff)
|
|
343
|
+
env:
|
|
344
|
+
# Read-only (this job's permissions): dorfl's fetches pass it per
|
|
345
|
+
# command and scrub it from the agent's environment.
|
|
346
|
+
GH_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
347
|
+
DORFL_LOCK_OUTPUTS: \${{ toJSON(needs.lock.outputs) }}
|
|
348
|
+
WORK_ITEM: \${{ inputs.item }}
|
|
349
|
+
INTEGRATION_MODE: \${{ inputs.integrationMode }}
|
|
350
|
+
# \`--watch\` streams the build agent's turns into this job log.
|
|
351
|
+
run: |
|
|
352
|
+
${phaseScript({
|
|
353
|
+
phase: 'agent',
|
|
354
|
+
advanceExtra: ' --watch --handoff-out "${RUNNER_TEMP}/dorfl-handoff"',
|
|
355
|
+
intakeExtra: ' --handoff-out "${RUNNER_TEMP}/dorfl-handoff"',
|
|
356
|
+
})}
|
|
357
|
+
- name: upload the handoff
|
|
358
|
+
if: \${{ always() }}
|
|
359
|
+
uses: ${pinnedUses(ACTION_PINS.uploadArtifact)}
|
|
360
|
+
with:
|
|
361
|
+
name: \${{ needs.lock.outputs.handoffName }}
|
|
362
|
+
path: \${{ runner.temp }}/dorfl-handoff
|
|
363
|
+
retention-days: 1
|
|
364
|
+
if-no-files-found: ignore
|
|
365
|
+
|
|
366
|
+
# ── APPLY: write token, no agent, no repository code ────────────────────────
|
|
367
|
+
apply:
|
|
368
|
+
needs: [lock, agent]
|
|
369
|
+
if: \${{ always() && needs.lock.outputs.acquired == 'true' }}
|
|
370
|
+
runs-on: ubuntu-latest
|
|
371
|
+
timeout-minutes: 30
|
|
372
|
+
# actions: read + checks: read tell a timed-out agent job from a cancelled
|
|
373
|
+
# one (GitHub reports both as cancelled; decision 5).
|
|
374
|
+
permissions:
|
|
375
|
+
contents: write
|
|
376
|
+
issues: write
|
|
377
|
+
pull-requests: write
|
|
378
|
+
actions: read
|
|
379
|
+
checks: read
|
|
380
|
+
steps:
|
|
381
|
+
- uses: ${pinnedUses(ACTION_PINS.checkout)}
|
|
382
|
+
with:
|
|
383
|
+
ref: \${{ needs.lock.outputs.baseSha }}
|
|
384
|
+
fetch-depth: 0
|
|
385
|
+
- uses: ${WRITER_SETUP_ACTION_USES}
|
|
386
|
+
${gate}
|
|
387
|
+
- name: download the handoff (this run's own artifact)
|
|
388
|
+
# No run-id: only this run's artifacts, i.e. this item's agent job. A
|
|
389
|
+
# missing artifact is the apply phase's to judge, not a job failure.
|
|
390
|
+
if: \${{ needs.agent.result == 'success' }}
|
|
391
|
+
continue-on-error: true
|
|
392
|
+
uses: ${pinnedUses(ACTION_PINS.downloadArtifact)}
|
|
393
|
+
with:
|
|
394
|
+
name: \${{ needs.lock.outputs.handoffName }}
|
|
395
|
+
path: \${{ runner.temp }}/dorfl-handoff
|
|
396
|
+
- name: apply the item (validates the handoff as hostile, does every write)
|
|
397
|
+
env:
|
|
398
|
+
GH_TOKEN: \${{ secrets.${PR_IDENTITY_SECRET_NAME} || secrets.GITHUB_TOKEN }}
|
|
399
|
+
# The agent job's timeout check reads the Actions API with THIS token
|
|
400
|
+
# only (never DORFL_GH_TOKEN).
|
|
401
|
+
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
402
|
+
DORFL_LOCK_OUTPUTS: \${{ toJSON(needs.lock.outputs) }}
|
|
403
|
+
AGENT_RESULT: \${{ needs.agent.result }}
|
|
404
|
+
AGENT_TIMEOUT_MINUTES: \${{ needs.lock.outputs.agentTimeoutMinutes }}
|
|
405
|
+
WORK_ITEM: \${{ inputs.item }}
|
|
406
|
+
INTEGRATION_MODE: \${{ inputs.integrationMode }}
|
|
407
|
+
run: |
|
|
408
|
+
${phaseScript({
|
|
409
|
+
phase: 'apply',
|
|
410
|
+
prelude: `\
|
|
411
|
+
timeout_args=()
|
|
412
|
+
if [ -n "\${AGENT_TIMEOUT_MINUTES}" ]; then
|
|
413
|
+
timeout_args=(--agent-timeout-minutes "\${AGENT_TIMEOUT_MINUTES}")
|
|
414
|
+
fi`,
|
|
415
|
+
advanceExtra: ' --agent-result "${AGENT_RESULT}" "${timeout_args[@]}" --handoff-in "${RUNNER_TEMP}/dorfl-handoff"',
|
|
416
|
+
intakeExtra: ' --agent-result "${AGENT_RESULT}" "${timeout_args[@]}" --handoff-in "${RUNNER_TEMP}/dorfl-handoff"',
|
|
417
|
+
})}
|
|
418
|
+
`;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Generate `dorfl-item-dispatch.yml`: the `workflow_dispatch` wrapper the
|
|
422
|
+
* advance tick starts once per item (`gh workflow run`). It holds the
|
|
423
|
+
* parallelism slot and calls `dorfl-item.yml`. Deterministic.
|
|
424
|
+
*/
|
|
425
|
+
export function generateItemDispatchWorkflow(config) {
|
|
426
|
+
const gateInputs = GATE_OVERRIDES.map((g) => `\
|
|
427
|
+
${g.input}:
|
|
428
|
+
description: 'One-shot override of the ${g.input} gate (${g.env}) for this item run only. Blank: no override (config wins).'
|
|
429
|
+
required: false
|
|
430
|
+
default: ''
|
|
431
|
+
type: choice
|
|
432
|
+
options:
|
|
433
|
+
- ''
|
|
434
|
+
${g.values.map((v) => ` - '${v}'`).join('\n')}`).join('\n');
|
|
435
|
+
const gateWith = GATE_OVERRIDES.map((g) => ` ${g.input}: \${{ inputs.${g.input} }}`).join('\n');
|
|
436
|
+
return `\
|
|
437
|
+
# dorfl — ONE ADVANCE ITEM per workflow run (spec
|
|
438
|
+
# ci-agent-job-without-write-token, decision 1 of ADR
|
|
439
|
+
# ci-agent-job-holds-no-write-token). EMITTED by \`dorfl install-ci\`; the human
|
|
440
|
+
# commits it. DO NOT hand-edit a copy: re-run install-ci to upgrade.
|
|
441
|
+
#
|
|
442
|
+
# The advance-lifecycle tick's \`dispatch\` job starts one run of THIS workflow
|
|
443
|
+
# per eligible item (\`gh workflow run\`); its single job calls dorfl-item.yml
|
|
444
|
+
# (lock, agent, apply). A run of its own per item gives the item its own
|
|
445
|
+
# artifact namespace, so no other item's agent can plant its handoff.
|
|
446
|
+
#
|
|
447
|
+
# PARALLELISM: each run joins the concurrency group dorfl-slot-<slot> (slot =
|
|
448
|
+
# item index mod maxParallel) with \`queue: max\`, so at most maxParallel item
|
|
449
|
+
# runs execute at once and the rest wait first-in-first-out, costing no runner
|
|
450
|
+
# minutes. A slot holds at most 100 pending runs; beyond that GitHub cancels,
|
|
451
|
+
# and the next tick re-dispatches (the item is still eligible).
|
|
452
|
+
#
|
|
453
|
+
# The run name \`dorfl-item <item>\` is what the tick de-duplicates on: an item
|
|
454
|
+
# whose run is not completed yet is not dispatched again.
|
|
455
|
+
|
|
456
|
+
name: dorfl-item-dispatch
|
|
457
|
+
|
|
458
|
+
run-name: ${ITEM_RUN_NAME_PREFIX} \${{ inputs.item }}
|
|
459
|
+
|
|
460
|
+
on:
|
|
461
|
+
workflow_dispatch:
|
|
462
|
+
inputs:
|
|
463
|
+
item:
|
|
464
|
+
description: 'The namespaced item id (task:<slug>, spec:<slug>, obs:<slug>, observation:<slug>).'
|
|
465
|
+
required: true
|
|
466
|
+
type: string
|
|
467
|
+
integrationMode:
|
|
468
|
+
description: 'propose: open a PR for the item; merge: land it on main (rebase + CAS push).'
|
|
469
|
+
required: true
|
|
470
|
+
default: 'propose'
|
|
471
|
+
type: choice
|
|
472
|
+
options:
|
|
473
|
+
- propose
|
|
474
|
+
- merge
|
|
475
|
+
slot:
|
|
476
|
+
description: 'The parallelism slot (the concurrency group dorfl-slot-<slot>).'
|
|
477
|
+
required: true
|
|
478
|
+
default: '0'
|
|
479
|
+
type: string
|
|
480
|
+
${gateInputs}
|
|
481
|
+
|
|
482
|
+
# Nothing at workflow level: the calling job grants what dorfl-item.yml needs.
|
|
483
|
+
permissions: {}
|
|
484
|
+
|
|
485
|
+
concurrency:
|
|
486
|
+
group: dorfl-slot-\${{ inputs.slot }}
|
|
487
|
+
cancel-in-progress: false
|
|
488
|
+
queue: max
|
|
489
|
+
|
|
490
|
+
jobs:
|
|
491
|
+
item:
|
|
492
|
+
# The union of what dorfl-item.yml's jobs request (a called workflow can
|
|
493
|
+
# only narrow this): lock and apply write, apply reads the agent job's
|
|
494
|
+
# check runs.
|
|
495
|
+
permissions:
|
|
496
|
+
${ITEM_WORKFLOW_CALLER_PERMISSIONS}
|
|
497
|
+
uses: ./.github/workflows/dorfl-item.yml
|
|
498
|
+
with:
|
|
499
|
+
item: \${{ inputs.item }}
|
|
500
|
+
integrationMode: \${{ inputs.integrationMode }}
|
|
501
|
+
${gateWith}${itemCallSecrets(config, true)}
|
|
502
|
+
`;
|
|
503
|
+
}
|
|
504
|
+
//# sourceMappingURL=dorfl-item-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dorfl-item-template.js","sourceRoot":"","sources":["../src/dorfl-item-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EACN,uBAAuB,EACvB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ot":"","sources":["../src/env-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,aAAa,CAAC;AAGvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../src/env-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,aAAa,CAAC;AAGvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAAkB,CAAC;AAqL1C;0EAC0E;AAC1E,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,MAAM,GAAG,MAAM,CAEpD;AAED,iDAAiD;AACjD,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAsDxD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC3B,GAAG,GAAE,MAAoB,EACzB,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAsC,GAC/D,aAAa,CAwDf"}
|
package/dist/env-config.js
CHANGED
|
@@ -52,12 +52,14 @@ const KEY_COERCIONS = {
|
|
|
52
52
|
// so `DORFL_OBSERVATION_TRIAGE=off|ask|auto` works and a typo FAILS
|
|
53
53
|
// LOUDLY naming the variable + the valid options.
|
|
54
54
|
observationTriage: { enum: ['off', 'ask', 'auto'] },
|
|
55
|
-
// The merge-question SURFACER gate is a
|
|
56
|
-
// `observationTriage`
|
|
55
|
+
// The merge-question SURFACER gate is a 2-state ENUM coercion (a SEPARATE
|
|
56
|
+
// axis from `observationTriage` with a HIGHER default, spec
|
|
57
57
|
// `land-time-reverify-and-parallel-merge-ceiling` Story 17 / task
|
|
58
|
-
// `merge-questions-gate-axis
|
|
59
|
-
//
|
|
60
|
-
|
|
58
|
+
// `merge-questions-gate-axis`; `auto` removed by task
|
|
59
|
+
// `wire-merge-questions-into-the-advance-tick`), so
|
|
60
|
+
// `DORFL_MERGE_QUESTIONS=off|ask` works and a typo (or the retired `auto`)
|
|
61
|
+
// FAILS LOUDLY naming the variable + the valid options.
|
|
62
|
+
mergeQuestions: { enum: ['off', 'ask'] },
|
|
61
63
|
// The surface-blockers gate is a BOOLEAN coercion (like `autoBuild`), so
|
|
62
64
|
// `DORFL_SURFACE_BLOCKERS=true|false` works and a typo FAILS LOUDLY.
|
|
63
65
|
surfaceBlockers: 'boolean',
|
package/dist/env-config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-config.js","sourceRoot":"","sources":["../src/env-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;AAU1C;;;;;;;;;;;GAWG;AACH,MAAM,aAAa,GAAqC;IACvD,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,SAAS;IACnB,+EAA+E;IAC/E,oEAAoE;IACpE,kDAAkD;IAClD,iBAAiB,EAAE,EAAC,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAC;IACjD,
|
|
1
|
+
{"version":3,"file":"env-config.js","sourceRoot":"","sources":["../src/env-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;AAU1C;;;;;;;;;;;GAWG;AACH,MAAM,aAAa,GAAqC;IACvD,SAAS,EAAE,SAAS;I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S;QACV,CAAC;QACD,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;QACzB,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACvB,SAAS;QACV,CAAC;QACD,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QACpD,2EAA2E;QAC1E,SAAqC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;IACvD,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
package/dist/frontmatter.d.ts
CHANGED
|
@@ -137,6 +137,58 @@ export interface Frontmatter {
|
|
|
137
137
|
testFirst: boolean | undefined;
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* The read half of {@link quoteYamlScalar}, for the frontmatter readers that
|
|
142
|
+
* live outside this module (the `title:` readers in `tasking.ts` and
|
|
143
|
+
* `integration-core.ts`), so a quoted title reads back the same everywhere.
|
|
144
|
+
*/
|
|
145
|
+
export declare function unquoteYamlScalar(value: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* Raised when a runner-side renderer is handed a value it cannot write safely
|
|
148
|
+
* into frontmatter, or when the rendered document does not read back the keys
|
|
149
|
+
* the runner meant to write (task
|
|
150
|
+
* `intake-frontmatter-title-injection-strips-origin-stamp`).
|
|
151
|
+
*/
|
|
152
|
+
export declare class FrontmatterRenderError extends Error {
|
|
153
|
+
constructor(message: string);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Why `value` cannot be a one-line frontmatter scalar, or `undefined` when it
|
|
157
|
+
* can. The verdict boundaries (intake, ADR mint) use it to refuse an
|
|
158
|
+
* agent-drafted title before anything is rendered.
|
|
159
|
+
*/
|
|
160
|
+
export declare function singleLineScalarProblem(value: string): string | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* THE shared quoter for agent-supplied text a runner writes into frontmatter
|
|
163
|
+
* (task `intake-frontmatter-title-injection-strips-origin-stamp`). Returns a
|
|
164
|
+
* YAML single-quoted scalar (`'...'`, an embedded `'` doubled), which is valid
|
|
165
|
+
* YAML for every one-line string and reads back verbatim through
|
|
166
|
+
* {@link unquote} (and so {@link readFrontmatterField}). A single-quoted scalar
|
|
167
|
+
* has no escape for a line break, so a value that is not one line, or holds any
|
|
168
|
+
* control character, THROWS {@link FrontmatterRenderError}: callers must reject
|
|
169
|
+
* such a value at their verdict boundary, and this throw is the backstop.
|
|
170
|
+
*/
|
|
171
|
+
export declare function quoteYamlScalar(value: string): string;
|
|
172
|
+
/**
|
|
173
|
+
* The post-render RE-PARSE assertion (task
|
|
174
|
+
* `intake-frontmatter-title-injection-strips-origin-stamp`). A runner renders a
|
|
175
|
+
* document, then calls this with the frontmatter values it MEANT to write;
|
|
176
|
+
* any disagreement THROWS {@link FrontmatterRenderError}, so a document whose
|
|
177
|
+
* runner-owned keys were displaced (a closed-early fence demoting the
|
|
178
|
+
* `originTrust` stamp into the body, a smuggled duplicate `slug:`) is never
|
|
179
|
+
* emitted.
|
|
180
|
+
*
|
|
181
|
+
* For each `expected` entry: a string value means the key must appear EXACTLY
|
|
182
|
+
* ONCE as a top-level key and read back (via {@link unquote}) equal to it;
|
|
183
|
+
* `undefined` means the key must be ABSENT. The typed keys that
|
|
184
|
+
* {@link parseFrontmatter} models (`slug`, `issue`, `origin`, `originTrust`,
|
|
185
|
+
* `humanOnly`, `needsAnswers`) are ALSO cross-checked through that parser, the
|
|
186
|
+
* same reader the rest of dorfl uses. With `exact`, the frontmatter may hold no
|
|
187
|
+
* top-level key outside `expected` (for a document the runner renders whole).
|
|
188
|
+
*/
|
|
189
|
+
export declare function assertFrontmatterFields(content: string, expected: Readonly<Record<string, string | undefined>>, options?: {
|
|
190
|
+
exact?: boolean;
|
|
191
|
+
}): void;
|
|
140
192
|
/**
|
|
141
193
|
* Set (or clear) the top-level `needsAnswers:` frontmatter marker on a `work/`
|
|
142
194
|
* markdown document, returning the new content. Used by the tasker review→edit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AACvC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAElD,MAAM,WAAW,WAAW;IAC3B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;;;OAKG;IACH,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,qDAAqD;IACrD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B;;;;;OAKG;IACH,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,iEAAiE;IACjE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;;;;;;;;;;;OAeG;IACH,cAAc,EAAE;QAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;KAAC,CAAC;CACjD;
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AACvC,MAAM,MA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