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,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **The tasking path split into the three CI phases** (spec
|
|
3
|
+
* `ci-agent-job-without-write-token` §3 tasking row, ADR
|
|
4
|
+
* `ci-agent-job-holds-no-write-token`, task `ci-split-tasking`).
|
|
5
|
+
*
|
|
6
|
+
* `do spec:<slug>` / `advance spec:<slug>` with `--phase` run ONE of three
|
|
7
|
+
* halves of the one tasking pipeline (`tasking.ts`: {@link runTaskingAgentHalf}
|
|
8
|
+
* is the agent half, {@link integrateTaskingCandidates} /
|
|
9
|
+
* {@link surfaceTaskingBlock} / {@link persistTaskingCandidates} the write half),
|
|
10
|
+
* never a second implementation:
|
|
11
|
+
*
|
|
12
|
+
* - **lock** ({@link performTaskingLockPhase}): fetch `<arbiter>/main` (its tip
|
|
13
|
+
* is `baseSha`); in a throwaway worktree of it, check the spec rests in
|
|
14
|
+
* `work/specs/ready/` and passes the agent tasking gate (and, for `advance`,
|
|
15
|
+
* classifies on the `task-spec` rung); take the tasking lock
|
|
16
|
+
* (`acquireTaskingLock`, the unified `spec:<slug>` lock, `action: task`);
|
|
17
|
+
* publish `acquired`, `needsAgent`, `rung`, `baseSha`, `lockSha`,
|
|
18
|
+
* `handoffName` and `agentTimeoutMinutes`. No agent, no repository code.
|
|
19
|
+
* - **agent** ({@link performTaskingAgentPhase}): check, read-only, that the
|
|
20
|
+
* lock ref still equals `lockSha`; on a `work/spec-<slug>` branch cut from
|
|
21
|
+
* `baseSha`, run the tasker, its review rounds, and the one-round task-set
|
|
22
|
+
* review (which the laptop path runs inside `performIntegration`; it is an
|
|
23
|
+
* agent, so it runs HERE), then hand over `tasking-land` (the candidates, the
|
|
24
|
+
* PR body, the review verdict and prose, the trimmed spec body) or
|
|
25
|
+
* `tasking-surface` (the candidates to save, the reason). Writes nothing to
|
|
26
|
+
* the arbiter: every write seam records into a recorder that knows no write.
|
|
27
|
+
* A tasker failure writes no handoff and fails the job.
|
|
28
|
+
* - **apply** ({@link performTaskingApplyPhase}): refuse to write unless the
|
|
29
|
+
* lock ref still equals `lockSha`; act on the agent job's result first
|
|
30
|
+
* (`failure` / timeout surfaces the spec, a real cancel only releases the
|
|
31
|
+
* lock); read the handoff as hostile and never take a bundle: it re-commits
|
|
32
|
+
* only VALIDATED candidate files ({@link checkTaskingCandidate}) and the
|
|
33
|
+
* validated trimmed spec body ({@link checkTrimmedSpecBody}) on a fresh
|
|
34
|
+
* `work/spec-<slug>` branch cut from `baseSha`, then integrates with the spec
|
|
35
|
+
* move and the review OFF (it already ran), or saves the candidates on the
|
|
36
|
+
* work branch, closes a stale PR in propose mode and surfaces. Every lock
|
|
37
|
+
* release is leased on `lockSha`.
|
|
38
|
+
*/
|
|
39
|
+
import { type HandoffRecord } from './ci-handoff-format.js';
|
|
40
|
+
import type { LockOutputs } from './ci-lock-outputs.js';
|
|
41
|
+
import type { AgentJobResult, GithubApiGet } from './ci-agent-result.js';
|
|
42
|
+
import type { DoOptions } from './do.js';
|
|
43
|
+
import { type Frontmatter } from './frontmatter.js';
|
|
44
|
+
import type { Phase } from './phase.js';
|
|
45
|
+
/** The verb a tasking phase runs under (they classify the argument differently). */
|
|
46
|
+
export type TaskingPhaseVerb = 'do' | 'advance';
|
|
47
|
+
/** Options of a tasking phase run: the `do` pipeline's options plus the phase inputs. */
|
|
48
|
+
export interface TaskingPhaseOptions extends DoOptions {
|
|
49
|
+
/** Which of the three jobs this process is. */
|
|
50
|
+
phase: Phase;
|
|
51
|
+
/** `do spec:<slug>` or `advance spec:<slug>`. */
|
|
52
|
+
verb: TaskingPhaseVerb;
|
|
53
|
+
/** agent: write the handoff here (empty or absent); apply: read it (under {@link runnerTemp}). */
|
|
54
|
+
handoffDir?: string;
|
|
55
|
+
/** `$RUNNER_TEMP` (the apply phase); defaults to the env's. */
|
|
56
|
+
runnerTemp?: string;
|
|
57
|
+
/** The lock job's outputs (agent / apply); defaults to `DORFL_LOCK_OUTPUTS`. */
|
|
58
|
+
lockOutputs?: LockOutputs;
|
|
59
|
+
/** `github.run_attempt` (the lock phase names the artifact with it); default the env's, else 1. */
|
|
60
|
+
runAttempt?: string;
|
|
61
|
+
/** The `$GITHUB_OUTPUT` file the lock phase appends to; default the env's. */
|
|
62
|
+
githubOutput?: string;
|
|
63
|
+
/** The merge-mode CAS-loop jitter (tests pass 0). */
|
|
64
|
+
mergeJitterMs?: number;
|
|
65
|
+
/** apply: `needs.agent.result` (`--agent-result`), REQUIRED. Only `success` reads the handoff. */
|
|
66
|
+
agentResult?: AgentJobResult;
|
|
67
|
+
/** apply: the agent job's timeout (`--agent-timeout-minutes`); default the lock outputs'. */
|
|
68
|
+
agentTimeoutMinutes?: number;
|
|
69
|
+
/** apply: the Actions API reader (tests stub it); default `fetch` with `GITHUB_TOKEN`. */
|
|
70
|
+
actionsApi?: GithubApiGet;
|
|
71
|
+
}
|
|
72
|
+
/** How a tasking phase run ended. */
|
|
73
|
+
export type TaskingPhaseOutcome =
|
|
74
|
+
/** lock: the spec is locked; the agent phase runs next. */
|
|
75
|
+
'locked'
|
|
76
|
+
/** lock: nothing to task at the arbiter's `main`. */
|
|
77
|
+
| 'no-op'
|
|
78
|
+
/** lock: the agent tasking gate refused the spec (nothing was written). */
|
|
79
|
+
| 'gate-refused'
|
|
80
|
+
/** lock: another run holds the spec's lock. */
|
|
81
|
+
| 'lost'
|
|
82
|
+
/** agent / apply: the lock ref no longer equals `lockSha`; nothing was done. */
|
|
83
|
+
| 'stale-lock'
|
|
84
|
+
/** agent: the handoff was written (see `intent`). */
|
|
85
|
+
| 'handed-over'
|
|
86
|
+
/** agent: the tasker (or the phase) failed; no handoff (the job fails). */
|
|
87
|
+
| 'agent-failed'
|
|
88
|
+
/** apply: the tasks and the spec move landed on `main`; the lock was released. */
|
|
89
|
+
| 'landed'
|
|
90
|
+
/** apply: the work branch was pushed (and a PR requested); the lock stays held. */
|
|
91
|
+
| 'proposed'
|
|
92
|
+
/** apply: the spec was surfaced to needs-attention and its lock released. */
|
|
93
|
+
| 'surfaced'
|
|
94
|
+
/** apply: surfacing the spec did not land on the arbiter. */
|
|
95
|
+
| 'surface-unmoved'
|
|
96
|
+
/** apply: the spec on `main` changed since the lock job; nothing was written. */
|
|
97
|
+
| 'stale'
|
|
98
|
+
/** apply: the agent job was cancelled (not timed out); the lock was only released. */
|
|
99
|
+
| 'released'
|
|
100
|
+
/** apply: the cancelled agent job's leased lock release was refused. */
|
|
101
|
+
| 'release-refused'
|
|
102
|
+
/** apply: the handoff broke a rule; the spec was surfaced, nothing from it landed. */
|
|
103
|
+
| 'rejected'
|
|
104
|
+
/** A usage or environment problem. */
|
|
105
|
+
| 'usage-error';
|
|
106
|
+
/** The result of one tasking phase run. */
|
|
107
|
+
export interface TaskingPhaseResult {
|
|
108
|
+
/** See "A handled outcome is green" in `ci-phase-driver.ts`. */
|
|
109
|
+
exitCode: 0 | 1 | 2 | 3 | 4;
|
|
110
|
+
outcome: TaskingPhaseOutcome;
|
|
111
|
+
/**
|
|
112
|
+
* The result line: the CLI prints it (`>> ` or `error: `), so the phase does
|
|
113
|
+
* NOT also `note` it (each line appears once in the job log).
|
|
114
|
+
*/
|
|
115
|
+
message: string;
|
|
116
|
+
slug?: string;
|
|
117
|
+
/** lock: the facts published. */
|
|
118
|
+
lockOutputs?: LockOutputs;
|
|
119
|
+
/** agent: the handed-over intent kind. */
|
|
120
|
+
intent?: HandoffRecord['intent']['kind'];
|
|
121
|
+
/** apply: the repository paths of the tasks the runner committed. */
|
|
122
|
+
emitted?: string[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Run one phase of the tasking path. The CLI calls this for `do spec:<slug>
|
|
126
|
+
* --phase` and `advance spec:<slug> --phase`.
|
|
127
|
+
*/
|
|
128
|
+
export declare function performTaskingPhase(options: TaskingPhaseOptions): Promise<TaskingPhaseResult>;
|
|
129
|
+
/**
|
|
130
|
+
* The lock phase: check the spec at the arbiter's `main`, take the tasking lock
|
|
131
|
+
* and publish the trusted facts. Runs no agent and no repository code. A spec
|
|
132
|
+
* that is not taskable at `baseSha` is refused BEFORE any write.
|
|
133
|
+
*/
|
|
134
|
+
export declare function performTaskingLockPhase(options: TaskingPhaseOptions): Promise<TaskingPhaseResult>;
|
|
135
|
+
/**
|
|
136
|
+
* The agent phase: after a read-only lock-ownership check, run the tasker, its
|
|
137
|
+
* review rounds and the task-set review on a `work/spec-<slug>` branch cut from
|
|
138
|
+
* `baseSha`, and write the handoff. Holds a read-only token: every write seam
|
|
139
|
+
* records into a recorder that knows no write, so a write attempt fails the
|
|
140
|
+
* job. Any failure writes no handoff and fails the job (the apply job then
|
|
141
|
+
* surfaces the spec).
|
|
142
|
+
*/
|
|
143
|
+
export declare function performTaskingAgentPhase(options: TaskingPhaseOptions): Promise<TaskingPhaseResult>;
|
|
144
|
+
/** The spec's origin stamp at `baseSha`: the one every candidate carries. */
|
|
145
|
+
export type OriginStamp = Pick<Frontmatter, 'origin' | 'originTrust'>;
|
|
146
|
+
/**
|
|
147
|
+
* Check ONE candidate task file of a hostile handoff and return the content the
|
|
148
|
+
* apply job commits (spec §3 "Structured products", task `ci-split-tasking`).
|
|
149
|
+
*
|
|
150
|
+
* - The path is derived, never taken: `work/tasks/backlog/<slug>.md`, and the
|
|
151
|
+
* slug must be safe (`slug-safety.ts`; the record validation already refused
|
|
152
|
+
* any other key, so `..` or a folder can never reach here).
|
|
153
|
+
* - It must be NEW relative to `baseSha`: a candidate that names a staged task
|
|
154
|
+
* already on the base is an edit to a task this run did not produce.
|
|
155
|
+
* - Its frontmatter must parse (an opening AND a closing `---`): an unclosed
|
|
156
|
+
* fence reads as no frontmatter, which would silently drop the stamp.
|
|
157
|
+
* - `humanOnly` / `needsAnswers` must each appear at most once and read as a
|
|
158
|
+
* boolean. Their VALUES are not judged: the review loop that sets them ran in
|
|
159
|
+
* the hostile job, and every candidate lands staged for a human to promote.
|
|
160
|
+
* - `origin` / `originTrust` are OVERWRITTEN with the spec's stamp at `baseSha`:
|
|
161
|
+
* every such line is dropped (with its continuation lines) and exactly one of
|
|
162
|
+
* each is written, so a candidate that repeats `originTrust: trusted` cannot
|
|
163
|
+
* keep one past the stamp (observation
|
|
164
|
+
* `tasker-drafted-duplicate-origintrust-launders-propagated-stamp`); then the
|
|
165
|
+
* result is re-parsed with `assertFrontmatterFields`, and any duplicate or
|
|
166
|
+
* mismatch rejects it.
|
|
167
|
+
*
|
|
168
|
+
* Throws {@link HandoffRejected} on any breach.
|
|
169
|
+
*/
|
|
170
|
+
export declare function checkTaskingCandidate(params: {
|
|
171
|
+
slug: string;
|
|
172
|
+
content: string;
|
|
173
|
+
stamp: OriginStamp;
|
|
174
|
+
existsAtBase: boolean;
|
|
175
|
+
}): string;
|
|
176
|
+
/**
|
|
177
|
+
* The spec frontmatter keys a trimmed body must keep EXACTLY as they are at
|
|
178
|
+
* `baseSha`: the gate keys (`humanOnly`, `needsAnswers`, `taskedAfter`), the
|
|
179
|
+
* issue link and the origin stamp, plus `slug` (the tasked-spec identity
|
|
180
|
+
* `taskedAfter` of other specs resolves against).
|
|
181
|
+
*/
|
|
182
|
+
export declare const SPEC_PINNED_KEYS: readonly ["humanOnly", "needsAnswers", "taskedAfter", "issue", "origin", "originTrust", "slug"];
|
|
183
|
+
/** The headings a trimmed spec keeps (its durable framing, TASKING-PROTOCOL §6). */
|
|
184
|
+
export declare const SPEC_REQUIRED_HEADINGS: readonly ["Problem Statement", "Solution", "User Stories"];
|
|
185
|
+
/**
|
|
186
|
+
* Check the trimmed spec body of a hostile `tasking-land` against the spec at
|
|
187
|
+
* `baseSha`, and return the body the apply job commits as the tasked spec. Its
|
|
188
|
+
* frontmatter must parse; every {@link SPEC_PINNED_KEYS} key must read EXACTLY
|
|
189
|
+
* as at `baseSha` (the same top-level lines, in the same order, with the same
|
|
190
|
+
* continuation lines, so neither a first-wins nor a last-wins reader can see
|
|
191
|
+
* another value); and every {@link SPEC_REQUIRED_HEADINGS} heading the base
|
|
192
|
+
* spec has must still be there. Throws {@link HandoffRejected} otherwise.
|
|
193
|
+
*/
|
|
194
|
+
export declare function checkTrimmedSpecBody(params: {
|
|
195
|
+
slug: string;
|
|
196
|
+
body: string;
|
|
197
|
+
baseSpec: string;
|
|
198
|
+
}): string;
|
|
199
|
+
/**
|
|
200
|
+
* The apply phase: check the lock is still this run's, act on the agent job's
|
|
201
|
+
* result, validate the handoff as hostile, then resume at the tasking write
|
|
202
|
+
* half. Runs no agent and no repository code.
|
|
203
|
+
*/
|
|
204
|
+
export declare function performTaskingApplyPhase(options: TaskingPhaseOptions): Promise<TaskingPhaseResult>;
|
|
205
|
+
//# sourceMappingURL=ci-phase-tasking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-phase-tasking.d.ts","sourceRoot":"","sources":["../src/ci-phase-tasking.ts"],"names":[],"mappings":"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"}
|