dorfl 0.14.3 → 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 +305 -486
- 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 +44 -13
- 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 +25 -0
- package/dist/install-ci-action-pins.d.ts.map +1 -1
- package/dist/install-ci-action-pins.js +25 -0
- package/dist/install-ci-action-pins.js.map +1 -1
- 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 +148 -37
- package/dist/install-ci-core.d.ts.map +1 -1
- package/dist/install-ci-core.js +278 -190
- 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 -293
- 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 +6 -3
- 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 +371 -535
- 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 +50 -14
- 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 +25 -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 +352 -223
- 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 -328
- 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 +6 -3
- 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
package/dist/config.d.ts
CHANGED
|
@@ -69,31 +69,28 @@ export type SpecsLandIn = 'proposed' | 'ready';
|
|
|
69
69
|
*/
|
|
70
70
|
export type ObservationTriage = 'off' | 'ask' | 'auto';
|
|
71
71
|
/**
|
|
72
|
-
* **The `mergeQuestions` gate axis
|
|
72
|
+
* **The `mergeQuestions` gate axis**: the 2-state member of the question-
|
|
73
73
|
* surfacing gate family that governs the MERGE-QUESTION surfacer (spec
|
|
74
74
|
* `land-time-reverify-and-parallel-merge-ceiling` Story 17 / task
|
|
75
|
-
* `merge-questions-gate-axis`).
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* lands). The states:
|
|
75
|
+
* `merge-questions-gate-axis`). A SEPARATE axis from `observationTriage`:
|
|
76
|
+
* "should this built work merge?" is materially more consequential than "is
|
|
77
|
+
* this observation worth promoting?", so a merge-question must NEVER ride
|
|
78
|
+
* `observationTriage` and must NOT default `off` (a silently-dropped
|
|
79
|
+
* merge-question means finished, pushed work never lands). The states:
|
|
81
80
|
* - `off` ⇒ the merge-question surfacer is not invoked (only correct for a
|
|
82
81
|
* repo that lands by some other means);
|
|
83
|
-
* - `ask` (DEFAULT) ⇒ the surfacer enumerates unmerged `work/*` branches
|
|
84
|
-
* emits a merge-question sidecar; a human's plain
|
|
85
|
-
* answer is required before the land. The
|
|
86
|
-
* propose semantics and never silently
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* answered in this task's Applied answers 2026-06-26 (q1/q2/q3) + SPEC sidecar
|
|
94
|
-
* Q3.
|
|
82
|
+
* - `ask` (DEFAULT) ⇒ the surfacer enumerates unmerged `work/*` branches with
|
|
83
|
+
* no open PR + emits a merge-question sidecar; a human's plain
|
|
84
|
+
* `merge | hold | drop` answer is required before the land. The
|
|
85
|
+
* conservative default that honours propose semantics and never silently
|
|
86
|
+
* drops pushed work.
|
|
87
|
+
* There is NO `auto` (task `wire-merge-questions-into-the-advance-tick`,
|
|
88
|
+
* decision 3): unattended landing is what merge mode (`integration: merge`) is
|
|
89
|
+
* for. Resolved through the precedence chain env > per-repo > global > default
|
|
90
|
+
* `ask` (there is no CLI flag). The surfacer runs in the laptop bare `advance`
|
|
91
|
+
* tick and in the CI `surface-merge-questions` job (`merge-question-tick.ts`).
|
|
95
92
|
*/
|
|
96
|
-
export type MergeQuestions = 'off' | 'ask'
|
|
93
|
+
export type MergeQuestions = 'off' | 'ask';
|
|
97
94
|
/**
|
|
98
95
|
* Which harness adapter (ADR §5) launches a job's agent and reports its
|
|
99
96
|
* liveness: `null` (shell out to `agentCmd`) or `pi` (the pi CLI). Selected via
|
|
@@ -209,23 +206,20 @@ export interface Config {
|
|
|
209
206
|
*/
|
|
210
207
|
observationTriage: ObservationTriage;
|
|
211
208
|
/**
|
|
212
|
-
* Per-repo policy governing the MERGE-QUESTION SURFACER
|
|
209
|
+
* Per-repo policy governing the MERGE-QUESTION SURFACER, the 2-state member
|
|
213
210
|
* of the question-surfacing gate family (spec
|
|
214
211
|
* `land-time-reverify-and-parallel-merge-ceiling` Story 17 / task
|
|
215
|
-
* `merge-questions-gate-axis`).
|
|
216
|
-
*
|
|
217
|
-
* `
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* (`--merge-questions`) > `DORFL_MERGE_QUESTIONS` env > per-repo > global >
|
|
227
|
-
* default `ask`. Gates the SURFACE phase of the merge-question loop only;
|
|
228
|
-
* APPLY (consume a committed merge-answer) stays ALWAYS allowed (the
|
|
212
|
+
* `merge-questions-gate-axis`). A SEPARATE axis from `observationTriage` with
|
|
213
|
+
* a DIFFERENT default: `observationTriage` defaults `off` (a dropped
|
|
214
|
+
* observation is safely ignorable), `mergeQuestions` defaults `ask` (a
|
|
215
|
+
* dropped merge-question means pushed work never lands). `off` ⇒ the
|
|
216
|
+
* surfacer is NOT invoked (only for a repo that lands by some other means);
|
|
217
|
+
* `ask` (default) ⇒ the surfacer enumerates unmerged `work/*` branches with no
|
|
218
|
+
* open PR and emits a merge-question sidecar a human answers. No `auto` (task
|
|
219
|
+
* `wire-merge-questions-into-the-advance-tick`, decision 3: unattended landing
|
|
220
|
+
* is merge mode's job). Resolved `DORFL_MERGE_QUESTIONS` env > per-repo >
|
|
221
|
+
* global > default `ask`. Gates the SURFACE phase of the merge-question loop
|
|
222
|
+
* only; APPLY (consume a committed merge-answer) stays ALWAYS allowed (the
|
|
229
223
|
* create-vs-consume invariant the gate family obeys, ADR
|
|
230
224
|
* `ci-config-policy-and-gate-family` §4).
|
|
231
225
|
*/
|
|
@@ -726,8 +720,10 @@ export interface Config {
|
|
|
726
720
|
* INTEGRATES in ONE process; across separate CI jobs the CAS loop IS the queue,
|
|
727
721
|
* and this cap is what determines how wide a matrix burst converges before any
|
|
728
722
|
* spurious bounce. A wide-matrix CI raises it; the default stays modest. Race-1
|
|
729
|
-
* safety is unchanged (a lost CAS costs only a re-rebase
|
|
730
|
-
* `--force`, never a both-land-broken
|
|
723
|
+
* safety is unchanged (a lost CAS costs only a re-rebase and a retried push, never
|
|
724
|
+
* a `--force`, never a both-land-broken; it does NOT re-run the gate, and the CI
|
|
725
|
+
* apply phase reports a land whose tree differs from the gated tree, ADR
|
|
726
|
+
* `ci-agent-job-holds-no-write-token` decision 2) — scaling the cap only changes WHEN a
|
|
731
727
|
* genuinely-stuck loser gives up. Resolved per-repo like `freshWorktreeGate`:
|
|
732
728
|
* flag (`--merge-retries`) > env (`DORFL_MERGE_RETRIES`) > per-repo > global >
|
|
733
729
|
* default. The default matches `integration-core.ts`'s built-in fallback (1000 —
|
|
@@ -742,13 +738,14 @@ export interface Config {
|
|
|
742
738
|
* **Per-repo OPT-IN strictness layered on the OQ6 stale-approval default**
|
|
743
739
|
* (spec `land-time-reverify-and-parallel-merge-ceiling`, sidecar OQ6 / task
|
|
744
740
|
* `strict-merge-approval-gate`). Controls how the apply rung treats a prior
|
|
745
|
-
* merge-answer when
|
|
746
|
-
* the
|
|
747
|
-
* when the rebased tip re-verifies GREEN
|
|
748
|
-
* sufficient
|
|
749
|
-
*
|
|
750
|
-
* `main
|
|
751
|
-
* instead of auto-landing
|
|
741
|
+
* merge-answer when `main`'s code (outside `work/`) moved since the question
|
|
742
|
+
* was asked (the `askedAtMain` the question records). The default (`false`)
|
|
743
|
+
* honours the prior answer and lands when the rebased tip re-verifies GREEN
|
|
744
|
+
* (a green re-verify is trusted as sufficient: the cheap fast-path). `true`
|
|
745
|
+
* re-surfaces the merge-question (appends a follow-up asked against the
|
|
746
|
+
* current `main`, under the `advancing` lock, before any checkout or
|
|
747
|
+
* rebase: no branch-side mutation) instead of auto-landing when `main`
|
|
748
|
+
* moved, even on a green re-verify
|
|
752
749
|
* — the host-agnostic analogue of GitHub's "dismiss stale approvals when
|
|
753
750
|
* the base changes". Story #16's RED-re-verify refusal is UNCHANGED and
|
|
754
751
|
* independent of this flag.
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAmB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAEN,KAAK,oBAAoB,EACzB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC;AAElD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAmB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAEN,KAAK,oBAAoB,EACzB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AAC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AC,MAAM,EAAE,MAAM,CAAC,CAMnE,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAsC,GAC/D,IAAI,CAeN;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,MAsI5B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA+B3D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAoB3D;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAY5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAgBxD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAGpE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAA4B,GAAG,MAAM,CA0CrE"}
|
package/dist/config.js
CHANGED
|
@@ -80,10 +80,8 @@ export const DEFAULT_CONFIG = {
|
|
|
80
80
|
// a silently-dropped merge-question means finished, pushed work never lands —
|
|
81
81
|
// strictly more consequential than a dropped observation-promote prompt, so
|
|
82
82
|
// this gate axis is DELIBERATELY HIGHER than `observationTriage`'s `off`. A
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
// lands by some other means opts into `off`. Resolved per-repo through the
|
|
86
|
-
// SAME precedence chain (flag > env > per-repo > global > default).
|
|
83
|
+
// repo that lands by some other means opts into `off`. Resolved per-repo
|
|
84
|
+
// through the SAME precedence chain (env > per-repo > global > default).
|
|
87
85
|
mergeQuestions: 'ask',
|
|
88
86
|
// DECLARED blocked work is calm by default (`false`): the `needsAnswers`-blocked
|
|
89
87
|
// pool is dropped from the auto-pick selection, so `advance` does NOT proactively
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAgB,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC9D,OAAO,EACN,uBAAuB,GAEvB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAgB,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC9D,OAAO,EACN,uBAAuB,GAEvB,MAAM,mBAAmB,CAAC;AAqJ3B;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAChD,OAAO,EAAC,SAAS,EAAE,GAAG,CAAC,cAAc,EAAE,SAAS,KAAK,IAAI,EAAC,CAAC;AAC5D,CAAC;AAupBD;;;;;;;;;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GAAa,CAAC,OAAO,EAAE,CAClE,CAAC;QACH,CAAC;IACF,CAAC;IACD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,yEAAyE;IACzE,yDAAyD;IACzD,qDAAqD;IACrD,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -56,12 +56,58 @@ export declare function branchAheadOfArbiter(options: {
|
|
|
56
56
|
mainRef: string;
|
|
57
57
|
env: NodeJS.ProcessEnv | undefined;
|
|
58
58
|
}): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Why a continue rebase did not apply (task
|
|
61
|
+
* `a-failed-rebase-reports-its-real-cause`). Either way the rebase was
|
|
62
|
+
* `--abort`ed (NEVER auto-resolved) and the kept branch is back on its
|
|
63
|
+
* un-rebased tip; the two kinds differ only in what the report says:
|
|
64
|
+
*
|
|
65
|
+
* - `conflict`: git stopped on conflicting paths (`paths`, the unmerged index
|
|
66
|
+
* entries; empty only when git printed a `CONFLICT (...)` line but left no
|
|
67
|
+
* unmerged entry). A genuine content conflict for a human to resolve.
|
|
68
|
+
* - `failed`: the rebase exited non-zero WITHOUT a conflict (a missing
|
|
69
|
+
* committer identity, an unresolvable `main`, a dirty tree, a hook, ...).
|
|
70
|
+
* Calling it "conflicted" hid the real cause (observation
|
|
71
|
+
* `ci-answered-merge-reports-a-conflict-a-plain-rebase-does-not-have`).
|
|
72
|
+
*
|
|
73
|
+
* `onto` is the sha `mainRef` resolved to when the rebase ran (`''` when it did
|
|
74
|
+
* not resolve), and `output` is git's own report (stderr, then stdout),
|
|
75
|
+
* condensed to one line by {@link condenseGitOutput}.
|
|
76
|
+
*/
|
|
77
|
+
export type ContinueRebaseFailure = {
|
|
78
|
+
kind: 'conflict';
|
|
79
|
+
onto: string;
|
|
80
|
+
paths: string[];
|
|
81
|
+
output: string;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'failed';
|
|
84
|
+
onto: string;
|
|
85
|
+
output: string;
|
|
86
|
+
};
|
|
59
87
|
/** The result of rebasing a continued branch onto the freshly-fetched main. */
|
|
60
|
-
export
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
export type ContinueRebaseResult = {
|
|
89
|
+
kind: 'clean';
|
|
90
|
+
} | ContinueRebaseFailure;
|
|
91
|
+
/**
|
|
92
|
+
* Condense git's multi-line report into one line for a reason / note: split
|
|
93
|
+
* on newlines and on the carriage returns of git's progress lines, drop blank
|
|
94
|
+
* and `hint:` lines, join the rest with ` / `, and cap the length.
|
|
95
|
+
*/
|
|
96
|
+
export declare function condenseGitOutput(text: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* What happened to a continue rebase, as the tail of a sentence that starts
|
|
99
|
+
* "rebasing `<branch>` onto current main ...". A conflict names its paths and
|
|
100
|
+
* the `main` sha; any other failure says so and quotes git. Both say the rebase
|
|
101
|
+
* was aborted, so the kept work is intact.
|
|
102
|
+
*/
|
|
103
|
+
export declare function describeContinueRebaseFailure(failure: ContinueRebaseFailure): string;
|
|
104
|
+
/**
|
|
105
|
+
* The whole sentence for a continue rebase that did not apply: "rebasing
|
|
106
|
+
* `<branch>` onto current main (<sha>) conflicted on <paths> ..." or "... failed
|
|
107
|
+
* without a conflict (aborted); git: <report>". `failure` is optional only so a
|
|
108
|
+
* caller holding just the legacy boolean still gets a sentence.
|
|
109
|
+
*/
|
|
110
|
+
export declare function continueRebaseSentence(branch: string, failure: ContinueRebaseFailure | undefined): string;
|
|
65
111
|
/**
|
|
66
112
|
* Rebase the CURRENTLY-CHECKED-OUT continued `work/<slug>` branch onto
|
|
67
113
|
* `mainRef` (the freshly-fetched main), so the agent builds on a CURRENT base
|
|
@@ -78,10 +124,13 @@ export interface ContinueRebaseResult {
|
|
|
78
124
|
* rename/rename ledger conflict that inheritance caused) is deleted. The ONLY
|
|
79
125
|
* commits replayed are the agent's own wip / `→done` commits.
|
|
80
126
|
*
|
|
81
|
-
* A CLEAN rebase returns `{kind: 'clean'}
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
127
|
+
* A CLEAN rebase returns `{kind: 'clean'}`. Any other outcome is `--abort`ed
|
|
128
|
+
* (NEVER auto-resolved) and returns a {@link ContinueRebaseFailure} carrying the
|
|
129
|
+
* `main` sha rebased onto and git's report: `conflict` (with the conflicting
|
|
130
|
+
* paths) when git stopped on a GENUINE conflict, `failed` for every other
|
|
131
|
+
* non-zero exit. The caller routes either to needs-attention via the §10 path,
|
|
132
|
+
* naming the real cause ({@link describeContinueRebaseFailure}). Must be called
|
|
133
|
+
* while HEAD is the continued branch.
|
|
85
134
|
*
|
|
86
135
|
* RENAME-DETECTION-OFF (task `disable-rename-detection-on-continue-rebase`): the
|
|
87
136
|
* rebase is invoked with `-c merge.directoryRenames=false` SCOPED to the
|
|
@@ -187,13 +236,12 @@ export type ContinuedPushResult =
|
|
|
187
236
|
kind: 'pushed';
|
|
188
237
|
}
|
|
189
238
|
/**
|
|
190
|
-
* A re-rebase onto the freshly-fetched main
|
|
191
|
-
*
|
|
192
|
-
*
|
|
239
|
+
* A re-rebase onto the freshly-fetched main did not apply on a retry (a
|
|
240
|
+
* `conflict`, or a non-conflict `failed`); it was `--abort`ed (NEVER
|
|
241
|
+
* auto-resolved). The caller routes the item to needs-attention via the §10
|
|
242
|
+
* path, naming the cause; the green work stays intact on the branch.
|
|
193
243
|
*/
|
|
194
|
-
|
|
|
195
|
-
kind: 'conflict';
|
|
196
|
-
};
|
|
244
|
+
| ContinueRebaseFailure;
|
|
197
245
|
/**
|
|
198
246
|
* Push the CONTINUED `work/<slug>` branch to the arbiter with
|
|
199
247
|
* `--force-with-lease`, surviving a STALE-LEASE ("stale info") rejection by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue-branch.d.ts","sourceRoot":"","sources":["../src/continue-branch.ts"],"names":[],"mappings":"AA6DA;;;;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AmCG;AACH,wBAAgB,oCAAoC,CAAC,OAAO,EAAE;IAC7D,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;IACnC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,GAAG,iBAAiB,CAgHpB;AAED,qEAAqE;AACrE,MAAM,MAAM,mBAAmB;AAC9B,oFAAoF;AAClF;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAC;AAClB;;;;;GAKG;GACD,qBAAqB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,sCAAsC,CAAC,OAAO,EAAE;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;IACnC,qEAAqE;IACrE,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,GAAG,mBAAmB,CAmFtB"}
|
package/dist/continue-branch.js
CHANGED
|
@@ -131,6 +131,53 @@ export function branchAheadOfArbiter(options) {
|
|
|
131
131
|
// before this backstop existed).
|
|
132
132
|
return branchAheadOf(cwd, branchRef, mainRef, env);
|
|
133
133
|
}
|
|
134
|
+
/** The longest git report a {@link ContinueRebaseFailure} carries. */
|
|
135
|
+
const MAX_GIT_OUTPUT = 600;
|
|
136
|
+
/**
|
|
137
|
+
* Condense git's multi-line report into one line for a reason / note: split
|
|
138
|
+
* on newlines and on the carriage returns of git's progress lines, drop blank
|
|
139
|
+
* and `hint:` lines, join the rest with ` / `, and cap the length.
|
|
140
|
+
*/
|
|
141
|
+
export function condenseGitOutput(text) {
|
|
142
|
+
const lines = text
|
|
143
|
+
.split(/[\r\n]+/)
|
|
144
|
+
.map((l) => l.trim())
|
|
145
|
+
.filter((l) => l !== '' && !l.startsWith('hint:'));
|
|
146
|
+
const joined = lines.join(' / ');
|
|
147
|
+
return joined.length > MAX_GIT_OUTPUT
|
|
148
|
+
? `${joined.slice(0, MAX_GIT_OUTPUT)}...`
|
|
149
|
+
: joined;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* What happened to a continue rebase, as the tail of a sentence that starts
|
|
153
|
+
* "rebasing `<branch>` onto current main ...". A conflict names its paths and
|
|
154
|
+
* the `main` sha; any other failure says so and quotes git. Both say the rebase
|
|
155
|
+
* was aborted, so the kept work is intact.
|
|
156
|
+
*/
|
|
157
|
+
export function describeContinueRebaseFailure(failure) {
|
|
158
|
+
const onto = failure.onto === '' ? 'an unresolved main' : failure.onto;
|
|
159
|
+
if (failure.kind === 'conflict') {
|
|
160
|
+
const on = failure.paths.length > 0 ? ` on ${failure.paths.join(', ')}` : '';
|
|
161
|
+
return (`(${onto}) conflicted${on} (aborted, never auto-resolved)` +
|
|
162
|
+
(failure.paths.length > 0 || failure.output === ''
|
|
163
|
+
? ''
|
|
164
|
+
: `; git: ${failure.output}`));
|
|
165
|
+
}
|
|
166
|
+
return (`(${onto}) failed without a conflict (aborted); git: ` +
|
|
167
|
+
(failure.output === '' ? '(no output)' : failure.output));
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The whole sentence for a continue rebase that did not apply: "rebasing
|
|
171
|
+
* `<branch>` onto current main (<sha>) conflicted on <paths> ..." or "... failed
|
|
172
|
+
* without a conflict (aborted); git: <report>". `failure` is optional only so a
|
|
173
|
+
* caller holding just the legacy boolean still gets a sentence.
|
|
174
|
+
*/
|
|
175
|
+
export function continueRebaseSentence(branch, failure) {
|
|
176
|
+
const tail = failure === undefined
|
|
177
|
+
? 'did not apply (aborted, never auto-resolved)'
|
|
178
|
+
: describeContinueRebaseFailure(failure);
|
|
179
|
+
return `rebasing \`${branch}\` onto current main ${tail}`;
|
|
180
|
+
}
|
|
134
181
|
/**
|
|
135
182
|
* Rebase the CURRENTLY-CHECKED-OUT continued `work/<slug>` branch onto
|
|
136
183
|
* `mainRef` (the freshly-fetched main), so the agent builds on a CURRENT base
|
|
@@ -147,10 +194,13 @@ export function branchAheadOfArbiter(options) {
|
|
|
147
194
|
* rename/rename ledger conflict that inheritance caused) is deleted. The ONLY
|
|
148
195
|
* commits replayed are the agent's own wip / `→done` commits.
|
|
149
196
|
*
|
|
150
|
-
* A CLEAN rebase returns `{kind: 'clean'}
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
197
|
+
* A CLEAN rebase returns `{kind: 'clean'}`. Any other outcome is `--abort`ed
|
|
198
|
+
* (NEVER auto-resolved) and returns a {@link ContinueRebaseFailure} carrying the
|
|
199
|
+
* `main` sha rebased onto and git's report: `conflict` (with the conflicting
|
|
200
|
+
* paths) when git stopped on a GENUINE conflict, `failed` for every other
|
|
201
|
+
* non-zero exit. The caller routes either to needs-attention via the §10 path,
|
|
202
|
+
* naming the real cause ({@link describeContinueRebaseFailure}). Must be called
|
|
203
|
+
* while HEAD is the continued branch.
|
|
154
204
|
*
|
|
155
205
|
* RENAME-DETECTION-OFF (task `disable-rename-detection-on-continue-rebase`): the
|
|
156
206
|
* rebase is invoked with `-c merge.directoryRenames=false` SCOPED to the
|
|
@@ -165,13 +215,25 @@ export function branchAheadOfArbiter(options) {
|
|
|
165
215
|
* conflict still conflicts unchanged.
|
|
166
216
|
*/
|
|
167
217
|
export function rebaseContinuedBranchOntoMain(cwd, mainRef, env) {
|
|
218
|
+
const onto = gitSoft(['rev-parse', '--verify', '--quiet', `${mainRef}^{commit}`], cwd, env).stdout.trim();
|
|
168
219
|
const rebase = gitSoft(['-c', 'merge.directoryRenames=false', 'rebase', mainRef], cwd, env);
|
|
169
220
|
if (rebase.status === 0) {
|
|
170
221
|
return { kind: 'clean' };
|
|
171
222
|
}
|
|
172
|
-
//
|
|
223
|
+
// Read the conflicting paths (the unmerged index entries) BEFORE the abort
|
|
224
|
+
// clears them. git prints its `CONFLICT (...)` lines on stdout.
|
|
225
|
+
const paths = gitSoft(['diff', '--name-only', '--diff-filter=U'], cwd, env)
|
|
226
|
+
.stdout.split('\n')
|
|
227
|
+
.map((p) => p.trim())
|
|
228
|
+
.filter((p) => p !== '');
|
|
229
|
+
const output = condenseGitOutput([rebase.stderr, rebase.stdout].join('\n'));
|
|
230
|
+
// NEVER auto-resolve: abort back to a clean continued-branch tip. A failure
|
|
231
|
+
// that never started a rebase leaves nothing to abort; that exit is harmless.
|
|
173
232
|
gitSoft(['rebase', '--abort'], cwd, env);
|
|
174
|
-
|
|
233
|
+
if (paths.length > 0 || /^CONFLICT \(/m.test(rebase.stdout)) {
|
|
234
|
+
return { kind: 'conflict', onto, paths, output };
|
|
235
|
+
}
|
|
236
|
+
return { kind: 'failed', onto, output };
|
|
175
237
|
}
|
|
176
238
|
/**
|
|
177
239
|
* The default cap on stale-lease push retries — mirrors the claim / tasking-lock
|
|
@@ -281,6 +343,9 @@ export function pushProposeBranchWithStaleLeaseRetry(options) {
|
|
|
281
343
|
// shape is the same create-only `--force-with-lease=<ref>:` form
|
|
282
344
|
// `item-lock.ts` uses for the CAS create.
|
|
283
345
|
const lease = observed === '' ? `${branch}:` : `${branch}:${observed}`;
|
|
346
|
+
// Write-seam implementation: reached only from the integrator, behind
|
|
347
|
+
// `ledgerWrite.applyCompleteTransition` (guard:
|
|
348
|
+
// `write-sites-through-seams.test.ts`).
|
|
284
349
|
const push = gitSoft(['push', arbiter, `${branch}:${branch}`, `--force-with-lease=${lease}`], cwd, env);
|
|
285
350
|
if (push.status === 0) {
|
|
286
351
|
return { kind: 'pushed' };
|
|
@@ -360,6 +425,8 @@ export function pushContinuedBranchWithStaleLeaseRetry(options) {
|
|
|
360
425
|
let attempt = 0;
|
|
361
426
|
// eslint-disable-next-line no-constant-condition
|
|
362
427
|
while (true) {
|
|
428
|
+
// Write-seam implementation: callers reach this through
|
|
429
|
+
// `refWrite.pushContinuedBranch` (guard: `write-sites-through-seams.test.ts`).
|
|
363
430
|
const push = gitSoft([
|
|
364
431
|
'push',
|
|
365
432
|
arbiter,
|
|
@@ -402,8 +469,8 @@ export function pushContinuedBranchWithStaleLeaseRetry(options) {
|
|
|
402
469
|
// merge). A CONFLICT is the EXISTING abort → needs-attention path — the retry
|
|
403
470
|
// handles ONLY the clean-rebase stale-lease case (never auto-resolves).
|
|
404
471
|
const rebase = rebaseContinuedBranchOntoMain(cwd, mainRef, env);
|
|
405
|
-
if (rebase.kind
|
|
406
|
-
return
|
|
472
|
+
if (rebase.kind !== 'clean') {
|
|
473
|
+
return rebase;
|
|
407
474
|
}
|
|
408
475
|
// Loop: retry the push, now re-leased against the freshly-fetched remote tip.
|
|
409
476
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue-branch.js","sourceRoot":"","sources":["../src/continue-branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAiB,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,sEAAsE;AACtE,SAAS,OAAO,CACf,IAAc,EACd,GAAW,EACX,GAAkC;IAElC,OAAO,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAC5B,GAAW,EACX,SAAiB,EACjB,OAAe,EACf,GAAkC;IAElC,MAAM,GAAG,GAAG,OAAO,CAClB,CAAC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AAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import './pi-harness.js';
|
|
2
|
+
import type { BackoffOptions, Sleep } from './retry-backoff.js';
|
|
3
|
+
/**
|
|
4
|
+
* **Save a CRASHED run's local-only work before its lock is released** (task
|
|
5
|
+
* `a-crashed-runs-local-work-is-saved-before-its-lock-is-released`).
|
|
6
|
+
*
|
|
7
|
+
* A `do --isolated` run that is killed mid-agent (a host restart, an OOM kill)
|
|
8
|
+
* leaves its per-item lock `active` and its job worktree RETAINED under
|
|
9
|
+
* `<workspacesDir>/work/<work-id>/`. The runner's own abort handler may already
|
|
10
|
+
* have made the usual wip commit there, but the process died before pushing it,
|
|
11
|
+
* so the work exists ONLY in that worktree. A plain `requeue` then released the
|
|
12
|
+
* lock without saving it, and the next claim (or `gc --force`) cut the worktree
|
|
13
|
+
* away: the work was lost.
|
|
14
|
+
*
|
|
15
|
+
* This is the SAVE step `requeue` runs before it releases a held lock. It
|
|
16
|
+
* locates the slug's retained job worktree by the SAME arbiter-URL + slug naming
|
|
17
|
+
* `do --isolated` created it with (`jobWorktreePath`, as `complete --isolated`
|
|
18
|
+
* locates it), and:
|
|
19
|
+
*
|
|
20
|
+
* - no retained worktree (or one that belongs to a same-slug SPEC run)
|
|
21
|
+
* ⇒ `no-worktree`: nothing to do, requeue behaves as before;
|
|
22
|
+
* - the run is still ALIVE per its harness (PID/session, never mtime, ADR §5)
|
|
23
|
+
* ⇒ `alive`: we never write into a live agent's tree;
|
|
24
|
+
* - the gc deletion-safety predicate already holds (clean tree AND tip on the
|
|
25
|
+
* arbiter) ⇒ `nothing-unsaved`: requeue behaves as before;
|
|
26
|
+
* - otherwise commit any uncommitted residue as the usual wip commit and push
|
|
27
|
+
* the work branch through `refWrite.saveWorkBranch` (the SAME save half
|
|
28
|
+
* `routeToNeedsAttention` and the deadline checkpoint use: plain push, never
|
|
29
|
+
* `--force`, bounded backoff), then RE-CHECK the predicate: holds ⇒ `saved`,
|
|
30
|
+
* else `not-saved` with why (the caller keeps the lock and the worktree).
|
|
31
|
+
*
|
|
32
|
+
* A worktree whose HEAD is not on its work branch (e.g. a run killed mid-rebase,
|
|
33
|
+
* detached HEAD) is `not-saved` WITHOUT touching it: committing onto a detached
|
|
34
|
+
* HEAD would strand the commit, so the human resolves it by hand.
|
|
35
|
+
*/
|
|
36
|
+
export type CrashedRunSaveOutcome = {
|
|
37
|
+
kind: 'no-worktree';
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'alive';
|
|
40
|
+
dir: string;
|
|
41
|
+
branch: string;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'nothing-unsaved';
|
|
44
|
+
dir: string;
|
|
45
|
+
branch: string;
|
|
46
|
+
} | {
|
|
47
|
+
kind: 'saved';
|
|
48
|
+
dir: string;
|
|
49
|
+
branch: string;
|
|
50
|
+
committedResidue: boolean;
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'not-saved';
|
|
53
|
+
dir: string;
|
|
54
|
+
branch: string;
|
|
55
|
+
detail: string;
|
|
56
|
+
};
|
|
57
|
+
export interface SaveCrashedRunWorkOptions {
|
|
58
|
+
/** The operator's checkout; its `arbiter` remote names the repo. */
|
|
59
|
+
cwd: string;
|
|
60
|
+
/** The arbiter remote NAME in {@link cwd}. */
|
|
61
|
+
arbiter: string;
|
|
62
|
+
/** The task slug (the branch is `work/task-<slug>`). */
|
|
63
|
+
slug: string;
|
|
64
|
+
/** The execution working area (config `workspacesDir`). */
|
|
65
|
+
workspacesDir: string;
|
|
66
|
+
env?: NodeJS.ProcessEnv;
|
|
67
|
+
note?: (message: string) => void;
|
|
68
|
+
/** Backoff bounds for the save push (tests pass a no-wait `sleep`). */
|
|
69
|
+
backoff?: BackoffOptions;
|
|
70
|
+
sleep?: Sleep;
|
|
71
|
+
}
|
|
72
|
+
export declare function saveCrashedRunWork(options: SaveCrashedRunWorkOptions): Promise<CrashedRunSaveOutcome>;
|
|
73
|
+
//# sourceMappingURL=crashed-run-save.d.ts.map
|
|
@@ -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