dorfl 0.0.0 → 0.1.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 +73 -0
- package/dist/advance-ci-template.d.ts.map +1 -0
- package/dist/advance-ci-template.js +104 -0
- package/dist/advance-ci-template.js.map +1 -0
- package/dist/advance-classify.d.ts +132 -0
- package/dist/advance-classify.d.ts.map +1 -0
- package/dist/advance-classify.js +120 -0
- package/dist/advance-classify.js.map +1 -0
- package/dist/advance-drivers.d.ts +182 -0
- package/dist/advance-drivers.d.ts.map +1 -0
- package/dist/advance-drivers.js +231 -0
- package/dist/advance-drivers.js.map +1 -0
- package/dist/advance-isolated.d.ts +156 -0
- package/dist/advance-isolated.d.ts.map +1 -0
- package/dist/advance-isolated.js +256 -0
- package/dist/advance-isolated.js.map +1 -0
- package/dist/advance-lifecycle-template.d.ts +107 -0
- package/dist/advance-lifecycle-template.d.ts.map +1 -0
- package/dist/advance-lifecycle-template.js +668 -0
- package/dist/advance-lifecycle-template.js.map +1 -0
- package/dist/advance-loop-driver.d.ts +325 -0
- package/dist/advance-loop-driver.d.ts.map +1 -0
- package/dist/advance-loop-driver.js +437 -0
- package/dist/advance-loop-driver.js.map +1 -0
- package/dist/advance-treeless-publish.d.ts +108 -0
- package/dist/advance-treeless-publish.d.ts.map +1 -0
- package/dist/advance-treeless-publish.js +71 -0
- package/dist/advance-treeless-publish.js.map +1 -0
- package/dist/advance.d.ts +340 -0
- package/dist/advance.d.ts.map +1 -0
- package/dist/advance.js +1122 -0
- package/dist/advance.js.map +1 -0
- package/dist/advancing-lock.d.ts +294 -0
- package/dist/advancing-lock.d.ts.map +1 -0
- package/dist/advancing-lock.js +594 -0
- package/dist/advancing-lock.js.map +1 -0
- package/dist/agent-launch.d.ts +79 -0
- package/dist/agent-launch.d.ts.map +1 -0
- package/dist/agent-launch.js +61 -0
- package/dist/agent-launch.js.map +1 -0
- package/dist/agent-stop.d.ts +149 -0
- package/dist/agent-stop.d.ts.map +1 -0
- package/dist/agent-stop.js +307 -0
- package/dist/agent-stop.js.map +1 -0
- package/dist/apply-decide.d.ts +127 -0
- package/dist/apply-decide.d.ts.map +1 -0
- package/dist/apply-decide.js +176 -0
- package/dist/apply-decide.js.map +1 -0
- package/dist/apply-merge-action.d.ts +206 -0
- package/dist/apply-merge-action.d.ts.map +1 -0
- package/dist/apply-merge-action.js +307 -0
- package/dist/apply-merge-action.js.map +1 -0
- package/dist/apply-persist.d.ts +174 -0
- package/dist/apply-persist.d.ts.map +1 -0
- package/dist/apply-persist.js +359 -0
- package/dist/apply-persist.js.map +1 -0
- package/dist/arbiter.d.ts +120 -0
- package/dist/arbiter.d.ts.map +1 -0
- package/dist/arbiter.js +255 -0
- package/dist/arbiter.js.map +1 -0
- package/dist/brand.d.ts +70 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +84 -0
- package/dist/brand.js.map +1 -0
- package/dist/buildable-body.d.ts +132 -0
- package/dist/buildable-body.d.ts.map +1 -0
- package/dist/buildable-body.js +131 -0
- package/dist/buildable-body.js.map +1 -0
- package/dist/categorise.d.ts +66 -0
- package/dist/categorise.d.ts.map +1 -0
- package/dist/categorise.js +106 -0
- package/dist/categorise.js.map +1 -0
- package/dist/claim-cas.d.ts +117 -0
- package/dist/claim-cas.d.ts.map +1 -0
- package/dist/claim-cas.js +312 -0
- package/dist/claim-cas.js.map +1 -0
- package/dist/cli-spinner.d.ts +112 -0
- package/dist/cli-spinner.d.ts.map +1 -0
- package/dist/cli-spinner.js +157 -0
- package/dist/cli-spinner.js.map +1 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3094 -0
- package/dist/cli.js.map +1 -0
- package/dist/close-job-template.d.ts +70 -0
- package/dist/close-job-template.d.ts.map +1 -0
- package/dist/close-job-template.js +180 -0
- package/dist/close-job-template.js.map +1 -0
- package/dist/close-job.d.ts +95 -0
- package/dist/close-job.d.ts.map +1 -0
- package/dist/close-job.js +226 -0
- package/dist/close-job.js.map +1 -0
- package/dist/complete.d.ts +361 -0
- package/dist/complete.d.ts.map +1 -0
- package/dist/complete.js +885 -0
- package/dist/complete.js.map +1 -0
- package/dist/concurrency.d.ts +68 -0
- package/dist/concurrency.d.ts.map +1 -0
- package/dist/concurrency.js +112 -0
- package/dist/concurrency.js.map +1 -0
- package/dist/config-override.d.ts +76 -0
- package/dist/config-override.d.ts.map +1 -0
- package/dist/config-override.js +50 -0
- package/dist/config-override.js.map +1 -0
- package/dist/config.d.ts +668 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +241 -0
- package/dist/config.js.map +1 -0
- package/dist/continue-branch.d.ts +249 -0
- package/dist/continue-branch.d.ts.map +1 -0
- package/dist/continue-branch.js +389 -0
- package/dist/continue-branch.js.map +1 -0
- package/dist/cwd-section.d.ts +186 -0
- package/dist/cwd-section.d.ts.map +1 -0
- package/dist/cwd-section.js +209 -0
- package/dist/cwd-section.js.map +1 -0
- package/dist/decision-engine.d.ts +170 -0
- package/dist/decision-engine.d.ts.map +1 -0
- package/dist/decision-engine.js +136 -0
- package/dist/decision-engine.js.map +1 -0
- package/dist/detect.d.ts +17 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +118 -0
- package/dist/detect.js.map +1 -0
- package/dist/do-autopick.d.ts +85 -0
- package/dist/do-autopick.d.ts.map +1 -0
- package/dist/do-autopick.js +112 -0
- package/dist/do-autopick.js.map +1 -0
- package/dist/do-config.d.ts +312 -0
- package/dist/do-config.d.ts.map +1 -0
- package/dist/do-config.js +358 -0
- package/dist/do-config.js.map +1 -0
- package/dist/do-remote-auto.d.ts +75 -0
- package/dist/do-remote-auto.d.ts.map +1 -0
- package/dist/do-remote-auto.js +111 -0
- package/dist/do-remote-auto.js.map +1 -0
- package/dist/do.d.ts +621 -0
- package/dist/do.d.ts.map +1 -0
- package/dist/do.js +1882 -0
- package/dist/do.js.map +1 -0
- package/dist/drop-source.d.ts +96 -0
- package/dist/drop-source.d.ts.map +1 -0
- package/dist/drop-source.js +91 -0
- package/dist/drop-source.js.map +1 -0
- package/dist/eligibility.d.ts +46 -0
- package/dist/eligibility.d.ts.map +1 -0
- package/dist/eligibility.js +34 -0
- package/dist/eligibility.js.map +1 -0
- package/dist/env-config.d.ts +51 -0
- package/dist/env-config.d.ts.map +1 -0
- package/dist/env-config.js +272 -0
- package/dist/env-config.js.map +1 -0
- package/dist/failure-cause.d.ts +70 -0
- package/dist/failure-cause.d.ts.map +1 -0
- package/dist/failure-cause.js +126 -0
- package/dist/failure-cause.js.map +1 -0
- package/dist/format.d.ts +43 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +256 -0
- package/dist/format.js.map +1 -0
- package/dist/frontmatter.d.ts +215 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +345 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/gate-readiness.d.ts +84 -0
- package/dist/gate-readiness.d.ts.map +1 -0
- package/dist/gate-readiness.js +103 -0
- package/dist/gate-readiness.js.map +1 -0
- package/dist/gc.d.ts +165 -0
- package/dist/gc.d.ts.map +1 -0
- package/dist/gc.js +313 -0
- package/dist/gc.js.map +1 -0
- package/dist/gh-failure.d.ts +42 -0
- package/dist/gh-failure.d.ts.map +1 -0
- package/dist/gh-failure.js +49 -0
- package/dist/gh-failure.js.map +1 -0
- package/dist/git.d.ts +75 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +130 -0
- package/dist/git.js.map +1 -0
- package/dist/github.d.ts +187 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +343 -0
- package/dist/github.js.map +1 -0
- package/dist/harness.d.ts +242 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +157 -0
- package/dist/harness.js.map +1 -0
- package/dist/identity.d.ts +167 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +231 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/install-ci-branch-protection.d.ts +147 -0
- package/dist/install-ci-branch-protection.d.ts.map +1 -0
- package/dist/install-ci-branch-protection.js +166 -0
- package/dist/install-ci-branch-protection.js.map +1 -0
- package/dist/install-ci-capabilities/advance-lifecycle.d.ts +15 -0
- package/dist/install-ci-capabilities/advance-lifecycle.d.ts.map +1 -0
- package/dist/install-ci-capabilities/advance-lifecycle.js +28 -0
- package/dist/install-ci-capabilities/advance-lifecycle.js.map +1 -0
- package/dist/install-ci-capabilities/close-job.d.ts +13 -0
- package/dist/install-ci-capabilities/close-job.d.ts.map +1 -0
- package/dist/install-ci-capabilities/close-job.js +26 -0
- package/dist/install-ci-capabilities/close-job.js.map +1 -0
- package/dist/install-ci-capabilities/example-noop.d.ts +16 -0
- package/dist/install-ci-capabilities/example-noop.d.ts.map +1 -0
- package/dist/install-ci-capabilities/example-noop.js +23 -0
- package/dist/install-ci-capabilities/example-noop.js.map +1 -0
- package/dist/install-ci-capabilities/intake.d.ts +15 -0
- package/dist/install-ci-capabilities/intake.d.ts.map +1 -0
- package/dist/install-ci-capabilities/intake.js +28 -0
- package/dist/install-ci-capabilities/intake.js.map +1 -0
- package/dist/install-ci-capabilities/verify.d.ts +14 -0
- package/dist/install-ci-capabilities/verify.d.ts.map +1 -0
- package/dist/install-ci-capabilities/verify.js +27 -0
- package/dist/install-ci-capabilities/verify.js.map +1 -0
- package/dist/install-ci-core.d.ts +446 -0
- package/dist/install-ci-core.d.ts.map +1 -0
- package/dist/install-ci-core.js +760 -0
- package/dist/install-ci-core.js.map +1 -0
- package/dist/install-ci-github.d.ts +167 -0
- package/dist/install-ci-github.d.ts.map +1 -0
- package/dist/install-ci-github.js +315 -0
- package/dist/install-ci-github.js.map +1 -0
- package/dist/install-ci.d.ts +105 -0
- package/dist/install-ci.d.ts.map +1 -0
- package/dist/install-ci.js +363 -0
- package/dist/install-ci.js.map +1 -0
- package/dist/intake-event.d.ts +88 -0
- package/dist/intake-event.d.ts.map +1 -0
- package/dist/intake-event.js +66 -0
- package/dist/intake-event.js.map +1 -0
- package/dist/intake-marker.d.ts +95 -0
- package/dist/intake-marker.d.ts.map +1 -0
- package/dist/intake-marker.js +127 -0
- package/dist/intake-marker.js.map +1 -0
- package/dist/intake-triage.d.ts +48 -0
- package/dist/intake-triage.d.ts.map +1 -0
- package/dist/intake-triage.js +95 -0
- package/dist/intake-triage.js.map +1 -0
- package/dist/intake-trigger-template.d.ts +185 -0
- package/dist/intake-trigger-template.d.ts.map +1 -0
- package/dist/intake-trigger-template.js +449 -0
- package/dist/intake-trigger-template.js.map +1 -0
- package/dist/intake.d.ts +569 -0
- package/dist/intake.d.ts.map +1 -0
- package/dist/intake.js +1628 -0
- package/dist/intake.js.map +1 -0
- package/dist/integration-core.d.ts +539 -0
- package/dist/integration-core.d.ts.map +1 -0
- package/dist/integration-core.js +2195 -0
- package/dist/integration-core.js.map +1 -0
- package/dist/integrator.d.ts +343 -0
- package/dist/integrator.d.ts.map +1 -0
- package/dist/integrator.js +400 -0
- package/dist/integrator.js.map +1 -0
- package/dist/isolation.d.ts +219 -0
- package/dist/isolation.d.ts.map +1 -0
- package/dist/isolation.js +261 -0
- package/dist/isolation.js.map +1 -0
- package/dist/issue-provider.d.ts +349 -0
- package/dist/issue-provider.d.ts.map +1 -0
- package/dist/issue-provider.js +360 -0
- package/dist/issue-provider.js.map +1 -0
- package/dist/item-lock.d.ts +626 -0
- package/dist/item-lock.d.ts.map +1 -0
- package/dist/item-lock.js +1381 -0
- package/dist/item-lock.js.map +1 -0
- package/dist/item-path.d.ts +49 -0
- package/dist/item-path.d.ts.map +1 -0
- package/dist/item-path.js +66 -0
- package/dist/item-path.js.map +1 -0
- package/dist/ledger-lint.d.ts +129 -0
- package/dist/ledger-lint.d.ts.map +1 -0
- package/dist/ledger-lint.js +249 -0
- package/dist/ledger-lint.js.map +1 -0
- package/dist/ledger-read.d.ts +357 -0
- package/dist/ledger-read.d.ts.map +1 -0
- package/dist/ledger-read.js +442 -0
- package/dist/ledger-read.js.map +1 -0
- package/dist/ledger-write.d.ts +330 -0
- package/dist/ledger-write.d.ts.map +1 -0
- package/dist/ledger-write.js +411 -0
- package/dist/ledger-write.js.map +1 -0
- package/dist/lifecycle-gather.d.ts +30 -0
- package/dist/lifecycle-gather.d.ts.map +1 -0
- package/dist/lifecycle-gather.js +205 -0
- package/dist/lifecycle-gather.js.map +1 -0
- package/dist/lifecycle-pools.d.ts +180 -0
- package/dist/lifecycle-pools.d.ts.map +1 -0
- package/dist/lifecycle-pools.js +78 -0
- package/dist/lifecycle-pools.js.map +1 -0
- package/dist/merge-question-surfacer.d.ts +166 -0
- package/dist/merge-question-surfacer.d.ts.map +1 -0
- package/dist/merge-question-surfacer.js +297 -0
- package/dist/merge-question-surfacer.js.map +1 -0
- package/dist/mint-adr.d.ts +126 -0
- package/dist/mint-adr.d.ts.map +1 -0
- package/dist/mint-adr.js +257 -0
- package/dist/mint-adr.js.map +1 -0
- package/dist/mirror-pool-scan.d.ts +125 -0
- package/dist/mirror-pool-scan.d.ts.map +1 -0
- package/dist/mirror-pool-scan.js +104 -0
- package/dist/mirror-pool-scan.js.map +1 -0
- package/dist/needs-attention.d.ts +341 -0
- package/dist/needs-attention.d.ts.map +1 -0
- package/dist/needs-attention.js +900 -0
- package/dist/needs-attention.js.map +1 -0
- package/dist/orphan-sidecar.d.ts +79 -0
- package/dist/orphan-sidecar.d.ts.map +1 -0
- package/dist/orphan-sidecar.js +71 -0
- package/dist/orphan-sidecar.js.map +1 -0
- package/dist/output.d.ts +48 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +66 -0
- package/dist/output.js.map +1 -0
- package/dist/pi-harness.d.ts +179 -0
- package/dist/pi-harness.d.ts.map +1 -0
- package/dist/pi-harness.js +342 -0
- package/dist/pi-harness.js.map +1 -0
- package/dist/placement.d.ts +99 -0
- package/dist/placement.d.ts.map +1 -0
- package/dist/placement.js +67 -0
- package/dist/placement.js.map +1 -0
- package/dist/prd-to-spec.d.ts +315 -0
- package/dist/prd-to-spec.d.ts.map +1 -0
- package/dist/prd-to-spec.js +684 -0
- package/dist/prd-to-spec.js.map +1 -0
- package/dist/prepare.d.ts +121 -0
- package/dist/prepare.d.ts.map +1 -0
- package/dist/prepare.js +140 -0
- package/dist/prepare.js.map +1 -0
- package/dist/prompt.d.ts +360 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +499 -0
- package/dist/prompt.js.map +1 -0
- package/dist/protocol/ADR-FORMAT.md +47 -0
- package/dist/protocol/CLAIM-PROTOCOL.md +217 -0
- package/dist/protocol/REVIEW-PROTOCOL.md +119 -0
- package/dist/protocol/SURFACE-PROTOCOL.md +121 -0
- package/dist/protocol/TASKING-PROTOCOL.md +122 -0
- package/dist/protocol/WORK-CONTRACT.md +276 -0
- package/dist/protocol/spec-template.md +71 -0
- package/dist/protocol/task-template.md +65 -0
- package/dist/readiness.d.ts +66 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +36 -0
- package/dist/readiness.js.map +1 -0
- package/dist/reap-branches.d.ts +102 -0
- package/dist/reap-branches.d.ts.map +1 -0
- package/dist/reap-branches.js +149 -0
- package/dist/reap-branches.js.map +1 -0
- package/dist/recover-isolated.d.ts +72 -0
- package/dist/recover-isolated.d.ts.map +1 -0
- package/dist/recover-isolated.js +188 -0
- package/dist/recover-isolated.js.map +1 -0
- package/dist/registry.d.ts +172 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +296 -0
- package/dist/registry.js.map +1 -0
- package/dist/repo-config.d.ts +201 -0
- package/dist/repo-config.d.ts.map +1 -0
- package/dist/repo-config.js +414 -0
- package/dist/repo-config.js.map +1 -0
- package/dist/repo-key.d.ts +20 -0
- package/dist/repo-key.d.ts.map +1 -0
- package/dist/repo-key.js +68 -0
- package/dist/repo-key.js.map +1 -0
- package/dist/repo-mirror.d.ts +177 -0
- package/dist/repo-mirror.d.ts.map +1 -0
- package/dist/repo-mirror.js +271 -0
- package/dist/repo-mirror.js.map +1 -0
- package/dist/retry-backoff.d.ts +90 -0
- package/dist/retry-backoff.d.ts.map +1 -0
- package/dist/retry-backoff.js +98 -0
- package/dist/retry-backoff.js.map +1 -0
- package/dist/review-gate.d.ts +173 -0
- package/dist/review-gate.d.ts.map +1 -0
- package/dist/review-gate.js +261 -0
- package/dist/review-gate.js.map +1 -0
- package/dist/review-verdict.d.ts +149 -0
- package/dist/review-verdict.d.ts.map +1 -0
- package/dist/review-verdict.js +332 -0
- package/dist/review-verdict.js.map +1 -0
- package/dist/run.d.ts +221 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +963 -0
- package/dist/run.js.map +1 -0
- package/dist/scan.d.ts +308 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +374 -0
- package/dist/scan.js.map +1 -0
- package/dist/select-order.d.ts +75 -0
- package/dist/select-order.d.ts.map +1 -0
- package/dist/select-order.js +108 -0
- package/dist/select-order.js.map +1 -0
- package/dist/select-priority.d.ts +188 -0
- package/dist/select-priority.d.ts.map +1 -0
- package/dist/select-priority.js +80 -0
- package/dist/select-priority.js.map +1 -0
- package/dist/select.d.ts +25 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +43 -0
- package/dist/select.js.map +1 -0
- package/dist/session-path.d.ts +36 -0
- package/dist/session-path.d.ts.map +1 -0
- package/dist/session-path.js +129 -0
- package/dist/session-path.js.map +1 -0
- package/dist/sidecar-apply.d.ts +83 -0
- package/dist/sidecar-apply.d.ts.map +1 -0
- package/dist/sidecar-apply.js +111 -0
- package/dist/sidecar-apply.js.map +1 -0
- package/dist/sidecar.d.ts +245 -0
- package/dist/sidecar.d.ts.map +1 -0
- package/dist/sidecar.js +481 -0
- package/dist/sidecar.js.map +1 -0
- package/dist/slug-namespace.d.ts +204 -0
- package/dist/slug-namespace.d.ts.map +1 -0
- package/dist/slug-namespace.js +229 -0
- package/dist/slug-namespace.js.map +1 -0
- package/dist/spec-complete.d.ts +44 -0
- package/dist/spec-complete.d.ts.map +1 -0
- package/dist/spec-complete.js +69 -0
- package/dist/spec-complete.js.map +1 -0
- package/dist/start.d.ts +97 -0
- package/dist/start.d.ts.map +1 -0
- package/dist/start.js +633 -0
- package/dist/start.js.map +1 -0
- package/dist/status.d.ts +199 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +228 -0
- package/dist/status.js.map +1 -0
- package/dist/surface-gate.d.ts +162 -0
- package/dist/surface-gate.d.ts.map +1 -0
- package/dist/surface-gate.js +206 -0
- package/dist/surface-gate.js.map +1 -0
- package/dist/surface-persist.d.ts +86 -0
- package/dist/surface-persist.d.ts.map +1 -0
- package/dist/surface-persist.js +129 -0
- package/dist/surface-persist.js.map +1 -0
- package/dist/tasker-review-loop.d.ts +249 -0
- package/dist/tasker-review-loop.d.ts.map +1 -0
- package/dist/tasker-review-loop.js +369 -0
- package/dist/tasker-review-loop.js.map +1 -0
- package/dist/tasking-eligibility.d.ts +74 -0
- package/dist/tasking-eligibility.d.ts.map +1 -0
- package/dist/tasking-eligibility.js +52 -0
- package/dist/tasking-eligibility.js.map +1 -0
- package/dist/tasking-lock.d.ts +111 -0
- package/dist/tasking-lock.d.ts.map +1 -0
- package/dist/tasking-lock.js +256 -0
- package/dist/tasking-lock.js.map +1 -0
- package/dist/tasking.d.ts +275 -0
- package/dist/tasking.d.ts.map +1 -0
- package/dist/tasking.js +952 -0
- package/dist/tasking.js.map +1 -0
- package/dist/triage-gate.d.ts +127 -0
- package/dist/triage-gate.d.ts.map +1 -0
- package/dist/triage-gate.js +139 -0
- package/dist/triage-gate.js.map +1 -0
- package/dist/triage-persist.d.ts +163 -0
- package/dist/triage-persist.d.ts.map +1 -0
- package/dist/triage-persist.js +387 -0
- package/dist/triage-persist.js.map +1 -0
- package/dist/verdict-json.d.ts +32 -0
- package/dist/verdict-json.d.ts.map +1 -0
- package/dist/verdict-json.js +74 -0
- package/dist/verdict-json.js.map +1 -0
- package/dist/verify-workflow-template.d.ts +60 -0
- package/dist/verify-workflow-template.d.ts.map +1 -0
- package/dist/verify-workflow-template.js +126 -0
- package/dist/verify-workflow-template.js.map +1 -0
- package/dist/verify.d.ts +60 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +62 -0
- package/dist/verify.js.map +1 -0
- package/dist/watch-session.d.ts +112 -0
- package/dist/watch-session.d.ts.map +1 -0
- package/dist/watch-session.js +347 -0
- package/dist/watch-session.js.map +1 -0
- package/dist/work-layout.d.ts +198 -0
- package/dist/work-layout.d.ts.map +1 -0
- package/dist/work-layout.js +217 -0
- package/dist/work-layout.js.map +1 -0
- package/dist/work-on.d.ts +154 -0
- package/dist/work-on.d.ts.map +1 -0
- package/dist/work-on.js +387 -0
- package/dist/work-on.js.map +1 -0
- package/dist/workspace.d.ts +224 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +325 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +46 -2
- package/src/advance-ci-template.ts +203 -0
- package/src/advance-classify.ts +197 -0
- package/src/advance-drivers.ts +414 -0
- package/src/advance-isolated.ts +432 -0
- package/src/advance-lifecycle-template.ts +791 -0
- package/src/advance-loop-driver.ts +745 -0
- package/src/advance-treeless-publish.ts +177 -0
- package/src/advance.ts +1564 -0
- package/src/advancing-lock.ts +988 -0
- package/src/agent-launch.ts +137 -0
- package/src/agent-stop.ts +361 -0
- package/src/apply-decide.ts +242 -0
- package/src/apply-merge-action.ts +502 -0
- package/src/apply-persist.ts +518 -0
- package/src/arbiter.ts +372 -0
- package/src/brand.ts +111 -0
- package/src/buildable-body.ts +196 -0
- package/src/categorise.ts +158 -0
- package/src/claim-cas.ts +513 -0
- package/src/cli-spinner.ts +225 -0
- package/src/cli.ts +4369 -0
- package/src/close-job-template.ts +236 -0
- package/src/close-job.ts +319 -0
- package/src/complete.ts +1379 -0
- package/src/concurrency.ts +151 -0
- package/src/config-override.ts +116 -0
- package/src/config.ts +883 -0
- package/src/continue-branch.ts +542 -0
- package/src/cwd-section.ts +392 -0
- package/src/decision-engine.ts +272 -0
- package/src/detect.ts +124 -0
- package/src/do-autopick.ts +223 -0
- package/src/do-config.ts +589 -0
- package/src/do-remote-auto.ts +197 -0
- package/src/do.ts +2623 -0
- package/src/drop-source.ts +194 -0
- package/src/eligibility.ts +79 -0
- package/src/env-config.ts +305 -0
- package/src/failure-cause.ts +142 -0
- package/src/format.ts +313 -0
- package/src/frontmatter.ts +485 -0
- package/src/gate-readiness.ts +147 -0
- package/src/gc.ts +510 -0
- package/src/gh-failure.ts +53 -0
- package/src/git.ts +186 -0
- package/src/github.ts +468 -0
- package/src/harness.ts +355 -0
- package/src/identity.ts +322 -0
- package/src/index.ts +785 -0
- package/src/install-ci-branch-protection.ts +255 -0
- package/src/install-ci-capabilities/advance-lifecycle.ts +34 -0
- package/src/install-ci-capabilities/close-job.ts +32 -0
- package/src/install-ci-capabilities/example-noop.ts +24 -0
- package/src/install-ci-capabilities/intake.ts +34 -0
- package/src/install-ci-capabilities/verify.ts +33 -0
- package/src/install-ci-core.ts +1088 -0
- package/src/install-ci-github.ts +376 -0
- package/src/install-ci.ts +552 -0
- package/src/intake-event.ts +102 -0
- package/src/intake-marker.ts +195 -0
- package/src/intake-triage.ts +138 -0
- package/src/intake-trigger-template.ts +591 -0
- package/src/intake.ts +2445 -0
- package/src/integration-core.ts +3065 -0
- package/src/integrator.ts +771 -0
- package/src/isolation.ts +484 -0
- package/src/issue-provider.ts +733 -0
- package/src/item-lock.ts +1858 -0
- package/src/item-path.ts +75 -0
- package/src/ledger-lint.ts +332 -0
- package/src/ledger-read.ts +924 -0
- package/src/ledger-write.ts +865 -0
- package/src/lifecycle-gather.ts +298 -0
- package/src/lifecycle-pools.ts +250 -0
- package/src/merge-question-surfacer.ts +496 -0
- package/src/mint-adr.ts +362 -0
- package/src/mirror-pool-scan.ts +240 -0
- package/src/needs-attention.ts +1506 -0
- package/src/orphan-sidecar.ts +150 -0
- package/src/output.ts +89 -0
- package/src/pi-harness.ts +403 -0
- package/src/placement.ts +131 -0
- package/src/prd-to-spec.ts +1023 -0
- package/src/prepare.ts +230 -0
- package/src/prompt.ts +760 -0
- package/src/readiness.ts +98 -0
- package/src/reap-branches.ts +278 -0
- package/src/recover-isolated.ts +276 -0
- package/src/registry.ts +475 -0
- package/src/repo-config.ts +550 -0
- package/src/repo-key.ts +74 -0
- package/src/repo-mirror.ts +367 -0
- package/src/retry-backoff.ts +130 -0
- package/src/review-gate.ts +389 -0
- package/src/review-verdict.ts +422 -0
- package/src/run.ts +1430 -0
- package/src/scan.ts +611 -0
- package/src/select-order.ts +143 -0
- package/src/select-priority.ts +266 -0
- package/src/select.ts +62 -0
- package/src/session-path.ts +153 -0
- package/src/sidecar-apply.ts +216 -0
- package/src/sidecar.ts +700 -0
- package/src/slug-namespace.ts +367 -0
- package/src/spec-complete.ts +118 -0
- package/src/start.ts +974 -0
- package/src/status.ts +441 -0
- package/src/surface-gate.ts +337 -0
- package/src/surface-persist.ts +241 -0
- package/src/tasker-review-loop.ts +671 -0
- package/src/tasking-eligibility.ts +114 -0
- package/src/tasking-lock.ts +416 -0
- package/src/tasking.ts +1438 -0
- package/src/triage-gate.ts +248 -0
- package/src/triage-persist.ts +570 -0
- package/src/verdict-json.ts +73 -0
- package/src/verify-workflow-template.ts +159 -0
- package/src/verify.ts +123 -0
- package/src/watch-session.ts +397 -0
- package/src/work-layout.ts +262 -0
- package/src/work-on.ts +660 -0
- package/src/workspace.ts +502 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { performAdvance, } from './advance.js';
|
|
2
|
+
import { scanMirrorPool } from './mirror-pool-scan.js';
|
|
3
|
+
import { ledgerRead } from './ledger-read.js';
|
|
4
|
+
import { selectPrioritised } from './select-priority.js';
|
|
5
|
+
import { runConcurrent } from './concurrency.js';
|
|
6
|
+
import { scan } from './scan.js';
|
|
7
|
+
import { run as runProcess } from './git.js';
|
|
8
|
+
import { jobWorktreeDoDriver } from './do.js';
|
|
9
|
+
import { pushTreelessResult, TREELESS_RUNGS, } from './advance-treeless-publish.js';
|
|
10
|
+
/**
|
|
11
|
+
* Run ONE batch of the loop driver: scan the mirror's eligible pool, select +
|
|
12
|
+
* order it (gated per-action), and run the advance TICK per item CONCURRENTLY,
|
|
13
|
+
* each independently `advancing`-lock-guarded inside {@link performAdvance}.
|
|
14
|
+
* Returns every item's result (input order preserved). A `run` daemon / CI cron
|
|
15
|
+
* loops THIS — the loop owns cadence, the batch owns one round's work.
|
|
16
|
+
*/
|
|
17
|
+
export async function advanceOnce(options) {
|
|
18
|
+
const run = options.run ?? performAdvance;
|
|
19
|
+
const read = options.read ?? ledgerRead;
|
|
20
|
+
const maxParallel = options.maxParallel ?? options.config.maxParallel;
|
|
21
|
+
const perRepoMax = options.perRepoMax ?? options.config.perRepoMax;
|
|
22
|
+
// Enumerate the eligible pool from the bare mirror's committed `main` — the
|
|
23
|
+
// SHARED `mirror-side-eligible-pool-scan` (gated on `autoBuild`/`autoTask`).
|
|
24
|
+
const scan = await scanMirrorPool({
|
|
25
|
+
mirrorPath: options.mirrorPath,
|
|
26
|
+
config: options.config,
|
|
27
|
+
ref: options.ref,
|
|
28
|
+
read,
|
|
29
|
+
warn: options.warn,
|
|
30
|
+
env: options.env,
|
|
31
|
+
lifecycleGates: options.lifecycleGates,
|
|
32
|
+
});
|
|
33
|
+
// Order across the (up to) FIVE pools per the resolved `selectionOrder` (apply
|
|
34
|
+
// pinned first) — ALL eligible items (the loop drains the whole pool each batch;
|
|
35
|
+
// `count` is the one-shot/`-n` concern). The lifecycle pools come from the SHARED
|
|
36
|
+
// mirror enumeration, so the loop/CI selection agrees with the in-place one-shot.
|
|
37
|
+
const selected = selectPrioritised({
|
|
38
|
+
report: scan.report,
|
|
39
|
+
caps: {
|
|
40
|
+
maxParallel: Number.MAX_SAFE_INTEGER,
|
|
41
|
+
perRepoMax: Number.MAX_SAFE_INTEGER,
|
|
42
|
+
},
|
|
43
|
+
specs: scan.specs,
|
|
44
|
+
selectionOrder: options.config.selectionOrder,
|
|
45
|
+
lifecycle: scan.lifecycle,
|
|
46
|
+
});
|
|
47
|
+
if (selected.length === 0) {
|
|
48
|
+
return { items: [] };
|
|
49
|
+
}
|
|
50
|
+
// Run the tick per item CONCURRENTLY (the SAME bounded scheduler `run`'s build
|
|
51
|
+
// tick uses), each independently `advancing`-lock-guarded inside the tick. The
|
|
52
|
+
// scheduler never rejects — a thrown tick is captured, so one item can never
|
|
53
|
+
// abort the batch (mirrors `runOnce`'s settled-slot contract).
|
|
54
|
+
const settled = await runConcurrent({
|
|
55
|
+
items: selected,
|
|
56
|
+
maxInFlight: Math.max(1, maxParallel),
|
|
57
|
+
// The mirror is ONE repo, so every item shares the repo key — `perRepoMax`
|
|
58
|
+
// bounds the whole batch (matching `run`'s per-repo cap semantics).
|
|
59
|
+
keyFor: () => options.mirrorPath,
|
|
60
|
+
perKeyMax: Math.max(1, perRepoMax),
|
|
61
|
+
worker: async (item) => {
|
|
62
|
+
const result = await run({
|
|
63
|
+
...options.context,
|
|
64
|
+
arg: argForSelected(item),
|
|
65
|
+
read,
|
|
66
|
+
});
|
|
67
|
+
// A TREE-LESS rung (surface/apply/triage) committed its sidecar / marker
|
|
68
|
+
// LOCALLY in the shared per-mirror `treelessCwd` (`context.cwd`); ff-push
|
|
69
|
+
// it to the mirror's arbiter so the result LANDS on `main` (the CLI wipes +
|
|
70
|
+
// re-clones that cwd EACH TICK, so an un-pushed local commit is lost). The
|
|
71
|
+
// build/task rungs already pushed via the job-worktree `doDriver`.
|
|
72
|
+
//
|
|
73
|
+
// The bounded re-fetch+rebase retry inside `pushTreelessResult` is
|
|
74
|
+
// LOAD-BEARING here: the `treelessCwd` is cloned ONCE per mirror at tick
|
|
75
|
+
// start and SHARED across the mirror's SERIAL batch, so a `build`/`task`
|
|
76
|
+
// rung EARLIER in the batch can integrate to the mirror's `main` mid-tick
|
|
77
|
+
// and a LATER tree-less push is non-fast-forward BY CONSTRUCTION — the
|
|
78
|
+
// retry rebases the slug-only commit onto the advanced `main` and lands it.
|
|
79
|
+
if (result.exitCode === 0 &&
|
|
80
|
+
result.rung !== undefined &&
|
|
81
|
+
TREELESS_RUNGS.has(result.rung) &&
|
|
82
|
+
options.context.cwd !== undefined) {
|
|
83
|
+
await pushTreelessResult({
|
|
84
|
+
cwd: options.context.cwd,
|
|
85
|
+
arbiter: options.context.arbiter ?? 'origin',
|
|
86
|
+
// Large liveness ceiling (C2, task `c2-rebase-until-real-on-durable-main-
|
|
87
|
+
// promotions`): a clean re-rebase no longer counts against a small
|
|
88
|
+
// budget; a genuine same-path conflict still stops definitively.
|
|
89
|
+
retries: 1000,
|
|
90
|
+
env: options.env,
|
|
91
|
+
note: options.context.note ?? (() => { }),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
const items = settled.map((slot, i) => {
|
|
98
|
+
const arg = argForSelected(selected[i]);
|
|
99
|
+
if ('ok' in slot) {
|
|
100
|
+
return { arg, result: slot.ok };
|
|
101
|
+
}
|
|
102
|
+
// A captured throw → a usage-error result (never crashes the batch).
|
|
103
|
+
const detail = slot.error instanceof Error ? slot.error.message : String(slot.error);
|
|
104
|
+
return {
|
|
105
|
+
arg,
|
|
106
|
+
result: { exitCode: 1, outcome: 'usage-error', message: detail },
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
return { items };
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The advance arg for a selected item (the SELECTION->ARG dispatch): `obs:<slug>`
|
|
113
|
+
* for an observation (the triage rung), `spec:<slug>` for a spec, bare slug for a
|
|
114
|
+
* task. The tick re-classifies each arg into the right rung (surface/apply for a
|
|
115
|
+
* `needsAnswers`-blocked task/spec; triage for an observation).
|
|
116
|
+
*/
|
|
117
|
+
function argForSelected(item) {
|
|
118
|
+
if (item.namespace === 'observation') {
|
|
119
|
+
return `obs:${item.slug}`;
|
|
120
|
+
}
|
|
121
|
+
return item.namespace === 'spec' ? `spec:${item.slug}` : item.slug;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Read a bare hub mirror's `origin` URL (`git -C <mirror> remote get-url
|
|
125
|
+
* origin`) — the arbiter URL the per-mirror job-worktree `do` driver
|
|
126
|
+
* ({@link jobWorktreeDoDriver}) materialises its worktree off (the SAME URL
|
|
127
|
+
* `run`'s `claimAgainstRepo` resolves; `registry.ts readOriginUrl` reads it for
|
|
128
|
+
* the registry view). Falls back to a `file://<path>` URL when the remote is
|
|
129
|
+
* unreadable, so a malformed/origin-less mirror still resolves to SOMETHING
|
|
130
|
+
* addressable rather than throwing mid-batch.
|
|
131
|
+
*/
|
|
132
|
+
function mirrorOriginUrl(mirrorPath, env) {
|
|
133
|
+
const result = runProcess('git', ['remote', 'get-url', 'origin'], mirrorPath, { env });
|
|
134
|
+
const url = result.status === 0 ? result.stdout.trim() : '';
|
|
135
|
+
return url !== '' ? url : `file://${mirrorPath}`;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The **registry-set advance DRIVER** with **per-mirror job-worktree isolation**
|
|
139
|
+
* (task `advance-loop-driver-registry-set-job-worktrees`) — the advance-tick TWIN
|
|
140
|
+
* of `runOnce`/`runOneItem`'s build substrate, the substrate `run-uses-advance-tick`
|
|
141
|
+
* needs to become a clean tick swap. Where {@link advanceOnce} drains ONE named
|
|
142
|
+
* mirror's pool IN-PLACE (the single-mirror path), this driver:
|
|
143
|
+
*
|
|
144
|
+
* 1. **discovers the REGISTRY SET** the SAME way `runOnce` does — via
|
|
145
|
+
* {@link scan} over `config.workspacesDir`'s hub mirrors (NOT a single
|
|
146
|
+
* `--advance <mirror>` arg); and
|
|
147
|
+
* 2. loops {@link advanceOnce}'s batch over that set, GENUINELY CONCURRENT
|
|
148
|
+
* ACROSS REPOS under {@link runConcurrent} (`maxParallel` global /
|
|
149
|
+
* `perRepoMax` per repo — the SAME scheduler `run`'s build tick uses), each
|
|
150
|
+
* mirror's pool itself drained concurrently by `advanceOnce` (reusing the
|
|
151
|
+
* per-item `advancing` borrow INSIDE {@link performAdvance} — no new lock,
|
|
152
|
+
* no new scheduler); and
|
|
153
|
+
* 3. threads a **per-mirror job-worktree `doDriver`** ({@link jobWorktreeDoDriver})
|
|
154
|
+
* into each mirror's advance context, so the build/task rungs run isolated
|
|
155
|
+
* in their OWN worktree off THAT mirror's arbiter (the SAME isolation
|
|
156
|
+
* `runOneItem` gives the build tick) instead of in `process.cwd()`. The
|
|
157
|
+
* surface/triage/apply rungs stay on their tree-less ledger-write moves
|
|
158
|
+
* (no build worktree needed) — the worktree driver governs ONLY the
|
|
159
|
+
* build/task orchestration target.
|
|
160
|
+
*
|
|
161
|
+
* Under calm gates (both lifecycle create-gates off) this is the OBSERVABLE-
|
|
162
|
+
* OUTCOME equivalent of plain `run`'s build tick over the same registry: build
|
|
163
|
+
* ready tasks / task ready prds, each per-job-worktree-isolated off the
|
|
164
|
+
* mirror's arbiter, same integration result — two callers of one
|
|
165
|
+
* `performIntegration` band (the advance build rung reaches it via `performDo`
|
|
166
|
+
* → `performDoRemote`; `runOneItem` reaches it directly), NOT a shared code path.
|
|
167
|
+
*/
|
|
168
|
+
export async function advanceRegistrySet(options) {
|
|
169
|
+
const config = options.config;
|
|
170
|
+
const workspace = options.workspace ?? config.workspacesDir;
|
|
171
|
+
// DISCOVERY = the registry (the hub-mirror set, ADR §1) — the SAME `scan(config)`
|
|
172
|
+
// `runOnce` uses. Each row's `path` is a bare hub mirror to drain.
|
|
173
|
+
const report = options.report ??
|
|
174
|
+
(await scan(config, {
|
|
175
|
+
warn: options.warn,
|
|
176
|
+
env: options.env,
|
|
177
|
+
override: options.override,
|
|
178
|
+
}));
|
|
179
|
+
const mirrors = report.repos.map((repo) => repo.path);
|
|
180
|
+
// GENUINELY CONCURRENT ACROSS REPOS (the registry-set point) under the SAME
|
|
181
|
+
// bounded scheduler `run`'s build tick uses: `maxParallel` bounds the whole
|
|
182
|
+
// registry sweep, one `advanceOnce` per mirror in flight.
|
|
183
|
+
//
|
|
184
|
+
// WITHIN one mirror the batch is SERIALISED (`perRepoMax: 1` into `advanceOnce`).
|
|
185
|
+
// WHY: the per-item `advancing` borrow + the tree-less surface/triage/apply rungs
|
|
186
|
+
// commit in the per-mirror `context.cwd` working tree, and the borrow's CAS is
|
|
187
|
+
// race-correct ONLY when each contender holds its OWN clone (the distinct-clone
|
|
188
|
+
// model `advancing-lock.ts` is built + tested against — two contenders sharing
|
|
189
|
+
// one checkout corrupt each other's HEAD/index, the SAME reason `run` serialises
|
|
190
|
+
// the per-repo CLAIM via `createKeyedLock`). A bare mirror has no per-item cwd, so
|
|
191
|
+
// the build/task rungs already get their OWN job worktree (via `jobWorktreeDoDriver`
|
|
192
|
+
// → `performDoRemote`) but the lock + tree-less rungs share the one cwd — so within
|
|
193
|
+
// ONE mirror they must run one-at-a-time. Cross-mirror concurrency (distinct
|
|
194
|
+
// arbiters → distinct cwds, no contention) stays GENUINE, which is the
|
|
195
|
+
// registry-set point. Per-item-cwd isolation (to also parallelise WITHIN a
|
|
196
|
+
// mirror) is a follow-up; this task keeps the borrow reused unchanged + correct.
|
|
197
|
+
const settled = await runConcurrent({
|
|
198
|
+
items: mirrors,
|
|
199
|
+
maxInFlight: Math.max(1, config.maxParallel),
|
|
200
|
+
keyFor: (mirrorPath) => mirrorPath,
|
|
201
|
+
perKeyMax: 1,
|
|
202
|
+
worker: (mirrorPath) => {
|
|
203
|
+
const originUrl = mirrorOriginUrl(mirrorPath, options.env);
|
|
204
|
+
// The per-mirror context the CLI shaped (gates + doOptions base) PLUS the
|
|
205
|
+
// per-mirror job-worktree `doDriver` injected here, so the build/task rungs
|
|
206
|
+
// build isolated off THIS mirror's arbiter (cwd untouched).
|
|
207
|
+
const baseContext = options.contextFor({ mirrorPath, originUrl });
|
|
208
|
+
const context = {
|
|
209
|
+
...baseContext,
|
|
210
|
+
doDriver: jobWorktreeDoDriver({
|
|
211
|
+
remote: originUrl,
|
|
212
|
+
workspacesDir: workspace,
|
|
213
|
+
}),
|
|
214
|
+
};
|
|
215
|
+
return advanceOnce({
|
|
216
|
+
mirrorPath,
|
|
217
|
+
config,
|
|
218
|
+
context,
|
|
219
|
+
run: options.run,
|
|
220
|
+
read: options.read,
|
|
221
|
+
warn: options.warn,
|
|
222
|
+
env: options.env,
|
|
223
|
+
lifecycleGates: options.lifecycleGates,
|
|
224
|
+
// SERIALISE within the mirror (one tick at a time over the shared cwd) —
|
|
225
|
+
// the borrow + tree-less rungs commit in `context.cwd` and are race-correct
|
|
226
|
+
// only per distinct clone (see the block above). Cross-mirror concurrency
|
|
227
|
+
// is genuine (the outer `runConcurrent`).
|
|
228
|
+
maxParallel: 1,
|
|
229
|
+
perRepoMax: 1,
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
// One mirror can never abort the registry sweep: a captured throw becomes an
|
|
234
|
+
// empty batch (mirrors `advanceOnce`'s per-item settled-slot contract one layer up).
|
|
235
|
+
const mirrorResults = settled.map((slot, i) => ({
|
|
236
|
+
mirrorPath: mirrors[i],
|
|
237
|
+
batch: 'ok' in slot ? slot.ok : { items: [] },
|
|
238
|
+
}));
|
|
239
|
+
return { mirrors: mirrorResults };
|
|
240
|
+
}
|
|
241
|
+
/** Project a whole registry-set batch onto the convergence counts (a pure sum). */
|
|
242
|
+
export function advanceRegistrySetSummary(result) {
|
|
243
|
+
let advanced = 0;
|
|
244
|
+
let idle = 0;
|
|
245
|
+
let stuck = 0;
|
|
246
|
+
let total = 0;
|
|
247
|
+
for (const { batch } of result.mirrors) {
|
|
248
|
+
const s = advanceBatchSummary(batch);
|
|
249
|
+
advanced += s.advanced;
|
|
250
|
+
idle += s.idle;
|
|
251
|
+
stuck += s.stuck;
|
|
252
|
+
total += s.total;
|
|
253
|
+
}
|
|
254
|
+
return { advanced, idle, stuck, total };
|
|
255
|
+
}
|
|
256
|
+
/** Summarise a batch into the convergence counts (a pure projection). */
|
|
257
|
+
export function advanceBatchSummary(result) {
|
|
258
|
+
let advanced = 0;
|
|
259
|
+
let idle = 0;
|
|
260
|
+
let stuck = 0;
|
|
261
|
+
for (const { result: r } of result.items) {
|
|
262
|
+
if (r.outcome === 'no-op') {
|
|
263
|
+
idle++;
|
|
264
|
+
}
|
|
265
|
+
else if (r.exitCode === 0) {
|
|
266
|
+
advanced++;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
stuck++;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return { advanced, idle, stuck, total: result.items.length };
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Is this batch CALM-AT-REST (US #31) — every selected item idled (a pending
|
|
276
|
+
* sidecar awaiting a human) and nothing failed? A pending-sidecar pool is STABLE:
|
|
277
|
+
* the loop re-ticks it, finds all no-ops, and idles without thrash. As answers
|
|
278
|
+
* arrive the idle count shrinks MONOTONICALLY (an answered item flips to an
|
|
279
|
+
* advance), so the loop converges.
|
|
280
|
+
*/
|
|
281
|
+
export function isBatchCalmAtRest(result) {
|
|
282
|
+
const s = advanceBatchSummary(result);
|
|
283
|
+
return s.total > 0 && s.advanced === 0 && s.stuck === 0;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Adapt the {@link advanceOnce} LOOP DRIVER to the {@link RunTick} swap SEAM so
|
|
287
|
+
* `run` (≡ CI, US #7) drives the ADVANCE tick over the mirror-side eligible pool
|
|
288
|
+
* instead of the build tick. `run.ts` deliberately writes {@link runLoop} against
|
|
289
|
+
* {@link RunTick} (NOT against `runOnce`) precisely so the advance-loop prd can
|
|
290
|
+
* swap the tick WITHOUT re-architecting the loop — this is that swap.
|
|
291
|
+
*
|
|
292
|
+
* The seam is `(RunOnceOptions) => Promise<RunOnceResult>`; one advance batch is
|
|
293
|
+
* `(AdvanceOnceOptions) => Promise<AdvanceBatchResult>`. The deps the advance
|
|
294
|
+
* batch needs that the generic per-tick options do NOT carry (the mirror to
|
|
295
|
+
* drain, the remote config, the per-item advance context) are CLOSED OVER here;
|
|
296
|
+
* the per-tick `RunOnceOptions` contribute only the cross-cutting seams that DO
|
|
297
|
+
* generalise — `onWarn` (the warning sink) and `env` (the git env). The batch's
|
|
298
|
+
* own item-level pool scan supersedes `RunOnceOptions.report` (the build tick's
|
|
299
|
+
* checkout scan), so that field is ignored for the advance tick.
|
|
300
|
+
*
|
|
301
|
+
* The {@link AdvanceBatchResult} is projected onto {@link RunOnceResult} so the
|
|
302
|
+
* loop's aggregation/reporting (`claimedAndDone` / `skipped` / `failed` /
|
|
303
|
+
* `needsAttention`) works UNCHANGED — an `advanced` item is `claimed-done`, an
|
|
304
|
+
* idling pending-sidecar `no-op` is `lost-race` (skipped, calm-at-rest), a CAS
|
|
305
|
+
* loser is `claim-contended` (skipped), and any error is `needs-attention`. So
|
|
306
|
+
* the loop's existing convergence signal (`claimedAndDone` falls to 0 once the
|
|
307
|
+
* pool is all idle) doubles as the advance loop's drain/idle signal (US #31).
|
|
308
|
+
*/
|
|
309
|
+
export function advanceRunTick(deps) {
|
|
310
|
+
return async (options) => {
|
|
311
|
+
const batch = await advanceOnce({
|
|
312
|
+
mirrorPath: deps.mirrorPath,
|
|
313
|
+
config: deps.config,
|
|
314
|
+
ref: deps.ref,
|
|
315
|
+
context: deps.context,
|
|
316
|
+
run: deps.run,
|
|
317
|
+
read: deps.read,
|
|
318
|
+
lifecycleGates: deps.lifecycleGates,
|
|
319
|
+
maxParallel: deps.maxParallel,
|
|
320
|
+
perRepoMax: deps.perRepoMax,
|
|
321
|
+
// Cross-cutting seams that DO generalise come from the per-tick options
|
|
322
|
+
// (the SAME ones the build tick receives) — so a `run` daemon threads its
|
|
323
|
+
// warning sink + git env to the advance tick identically.
|
|
324
|
+
warn: options.onWarn,
|
|
325
|
+
env: options.env,
|
|
326
|
+
});
|
|
327
|
+
return batchToRunOnceResult(batch, deps.mirrorPath);
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Adapt the REGISTRY-SET advance DRIVER ({@link advanceRegistrySet}) onto the
|
|
332
|
+
* {@link RunTick} swap SEAM so plain `run` (no flag) drives the ADVANCE tick over
|
|
333
|
+
* the WHOLE registry instead of the build tick (`runOnce`) — the task
|
|
334
|
+
* `run-uses-advance-tick`. `run.ts` deliberately writes {@link runLoop} against
|
|
335
|
+
* {@link RunTick} (NOT against `runOnce`) precisely so the advance-loop design can
|
|
336
|
+
* swap the tick WITHOUT re-architecting the loop; this is that swap, now pointing
|
|
337
|
+
* the seam at the REGISTRY-SET advance driver the precursor built (registry-set
|
|
338
|
+
* discovery + per-mirror job-worktree isolation — the SAME substrate plain `run`'s
|
|
339
|
+
* build tick uses).
|
|
340
|
+
*
|
|
341
|
+
* Under calm gates (both lifecycle create-gates off) this is the OBSERVABLE-
|
|
342
|
+
* OUTCOME equivalent of plain `run`'s build tick over the same registry: build
|
|
343
|
+
* ready tasks / task ready prds, each per-job-worktree-isolated off the
|
|
344
|
+
* mirror's arbiter, same integration result; touch no observations, surface no
|
|
345
|
+
* questions. Flip a gate and the SAME tick performs the lifecycle
|
|
346
|
+
* (triage / surface / apply) for free — no separate `--advance` mode to discover.
|
|
347
|
+
*
|
|
348
|
+
* The seam is `(RunOnceOptions) => Promise<RunOnceResult>`; one registry-set
|
|
349
|
+
* batch is `(AdvanceRegistrySetOptions) => Promise<AdvanceRegistrySetResult>`. The
|
|
350
|
+
* deps the batch needs that the generic per-tick options do NOT carry (the config,
|
|
351
|
+
* the per-mirror context factory, the workspace) are CLOSED OVER here; the
|
|
352
|
+
* per-tick `RunOnceOptions` contribute only the cross-cutting seams that DO
|
|
353
|
+
* generalise — `onWarn` (the warning sink) and `env` (the git env). The batch's
|
|
354
|
+
* own registry discovery supersedes `RunOnceOptions.report` (the build tick's
|
|
355
|
+
* checkout scan), so that field is ignored for the advance tick.
|
|
356
|
+
*/
|
|
357
|
+
export function advanceRegistrySetRunTick(deps) {
|
|
358
|
+
return async (options) => {
|
|
359
|
+
const result = await advanceRegistrySet({
|
|
360
|
+
config: deps.config,
|
|
361
|
+
override: deps.override,
|
|
362
|
+
contextFor: deps.contextFor,
|
|
363
|
+
workspace: deps.workspace,
|
|
364
|
+
run: deps.run,
|
|
365
|
+
read: deps.read,
|
|
366
|
+
lifecycleGates: deps.lifecycleGates,
|
|
367
|
+
// Cross-cutting seams that DO generalise come from the per-tick options
|
|
368
|
+
// (the SAME ones the build tick receives) — so the `run` daemon threads its
|
|
369
|
+
// warning sink + git env to the advance tick identically.
|
|
370
|
+
warn: options.onWarn,
|
|
371
|
+
env: options.env,
|
|
372
|
+
});
|
|
373
|
+
return registrySetToRunOnceResult(result);
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Project a whole REGISTRY-SET advance batch onto a {@link RunOnceResult} so the
|
|
378
|
+
* existing run loop aggregates + reports it with NO advance-specific code. Each
|
|
379
|
+
* mirror's per-item results are flattened (the `repoPath` is that mirror; the
|
|
380
|
+
* `slug` is the advanced arg), reusing the SAME per-item status mapping the
|
|
381
|
+
* single-mirror {@link batchToRunOnceResult} uses — so the loop's convergence
|
|
382
|
+
* signal (`claimedAndDone` falls to 0 once every pool idles) holds across the
|
|
383
|
+
* registry exactly as it does for one mirror.
|
|
384
|
+
*/
|
|
385
|
+
function registrySetToRunOnceResult(result) {
|
|
386
|
+
const items = result.mirrors.flatMap(({ mirrorPath, batch }) => batch.items.map(({ arg, result: r }) => ({
|
|
387
|
+
repoPath: mirrorPath,
|
|
388
|
+
slug: arg,
|
|
389
|
+
status: advanceOutcomeToItemStatus(r),
|
|
390
|
+
detail: r.message,
|
|
391
|
+
})));
|
|
392
|
+
const claimedAndDone = items.filter((i) => i.status === 'claimed-done').length;
|
|
393
|
+
const skipped = items.filter((i) => i.status === 'lost-race' || i.status === 'claim-contended').length;
|
|
394
|
+
const needsAttention = items.filter((i) => i.status === 'needs-attention').length;
|
|
395
|
+
const failed = needsAttention;
|
|
396
|
+
return { claimedAndDone, skipped, failed, needsAttention, items };
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Project one advance batch onto a {@link RunOnceResult} so the existing run loop
|
|
400
|
+
* aggregates + reports it with NO advance-specific code. The `repoPath` is the
|
|
401
|
+
* mirror (the one repo this batch drains); the `slug` is the advanced arg.
|
|
402
|
+
*/
|
|
403
|
+
function batchToRunOnceResult(batch, mirrorPath) {
|
|
404
|
+
const items = batch.items.map(({ arg, result }) => ({
|
|
405
|
+
repoPath: mirrorPath,
|
|
406
|
+
slug: arg,
|
|
407
|
+
status: advanceOutcomeToItemStatus(result),
|
|
408
|
+
detail: result.message,
|
|
409
|
+
}));
|
|
410
|
+
const claimedAndDone = items.filter((i) => i.status === 'claimed-done').length;
|
|
411
|
+
const skipped = items.filter((i) => i.status === 'lost-race' || i.status === 'claim-contended').length;
|
|
412
|
+
const needsAttention = items.filter((i) => i.status === 'needs-attention').length;
|
|
413
|
+
const failed = needsAttention;
|
|
414
|
+
return { claimedAndDone, skipped, failed, needsAttention, items };
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Map one advance tick's outcome onto the run loop's {@link ItemStatus} so the
|
|
418
|
+
* loop's counters carry the convergence semantics: an item that ADVANCED a rung
|
|
419
|
+
* is `claimed-done`; a `no-op` (an idling pending sidecar — the calm-at-rest
|
|
420
|
+
* population) is `lost-race` (skipped, NOT a failure — the loop does no work on
|
|
421
|
+
* it and does not retry); a CAS `lost`/`contended` is `lost-race`/
|
|
422
|
+
* `claim-contended` (a parallel sibling won; back off); anything else (a
|
|
423
|
+
* usage/invariant error or a captured throw) is `needs-attention`.
|
|
424
|
+
*/
|
|
425
|
+
function advanceOutcomeToItemStatus(result) {
|
|
426
|
+
if (result.exitCode === 0) {
|
|
427
|
+
return result.outcome === 'no-op' ? 'lost-race' : 'claimed-done';
|
|
428
|
+
}
|
|
429
|
+
if (result.exitCode === 2 || result.outcome === 'lost') {
|
|
430
|
+
return 'lost-race';
|
|
431
|
+
}
|
|
432
|
+
if (result.exitCode === 3 || result.outcome === 'contended') {
|
|
433
|
+
return 'claim-contended';
|
|
434
|
+
}
|
|
435
|
+
return 'needs-attention';
|
|
436
|
+
}
|
|
437
|
+
//# sourceMappingURL=advance-loop-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advance-loop-driver.js","sourceRoot":"","sources":["../src/advance-loop-driver.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,GAGd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAoB,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAkB,MAAM,WAAW,CAAC;AAChD,OAAO,EAAC,GAAG,IAAI,UAAU,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,EACN,kBAAkB,EAClB,cAAc,GACd,MAAM,+BAA+B,CAAC;AA8GvC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,OAA2B;IAE3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,cAAc,CAAC;IAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,UAAU,CAAC;IACxC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;IACtE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAEnE,4EAA4E;IAC5E,6EAA6E;IAC7E,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC;QACjC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,MAAM,EAAE,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G,KAAK,CAAC,MAAM,CAClC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAClC,CAAC,MAAM,CAAC;IACT,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,MAAM,KAAK,iBAAiB,CACjE,CAAC,MAAM,CAAC;IACT,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAClC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,iBAAiB,CACrC,CAAC,MAAM,CAAC;IACT,MAAM,MAAM,GAAG,cAAc,CAAC;IAC9B,OAAO,EAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,0BAA0B,CAAC,MAAqB;IACxD,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC;IAClE,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QACxD,OAAO,WAAW,CAAC;IACpB,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QAC7D,OAAO,iBAAiB,CAAC;IAC1B,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SHARED tree-less-result PUBLISH (task
|
|
3
|
+
* `loop-advance-persists-treeless-rungs-to-arbiter`) — the ONE implementation of
|
|
4
|
+
* "ff-push a locally-committed tree-less rung result to the arbiter" called by
|
|
5
|
+
* BOTH advance drivers that run the tick in a working clone:
|
|
6
|
+
*
|
|
7
|
+
* - the one-shot ISOLATED runner (`advance-isolated.ts`'s
|
|
8
|
+
* {@link import('./advance-isolated.js')} `performAdvanceIsolated`), and
|
|
9
|
+
* - the LOOP / registry-set driver (`advance-loop-driver.ts`'s `advanceOnce`),
|
|
10
|
+
* whose per-mirror `treelessCwd` (cloned once per tick by the CLI) is wiped +
|
|
11
|
+
* re-cloned every tick, so a locally-committed sidecar would otherwise be lost.
|
|
12
|
+
*
|
|
13
|
+
* The tree-less lifecycle rungs (surface / apply / triage-observation) commit the
|
|
14
|
+
* sidecar / `needsAnswers` / `triaged:` marker LOCALLY in their working clone
|
|
15
|
+
* (`surface-persist.ts`, `apply-persist.ts`); only the `advancing` borrow + the
|
|
16
|
+
* promote-CAS reach the arbiter on their own. The arbiter is the source of truth
|
|
17
|
+
* for the ledger, so a local commit in a per-tick clone is NOT on the ledger until
|
|
18
|
+
* pushed. This is that push — NO new isolation MECHANISM, just a git ff-push of an
|
|
19
|
+
* already-committed `main`.
|
|
20
|
+
*
|
|
21
|
+
* The bounded re-fetch + rebase retry is LOAD-BEARING, not defensive padding:
|
|
22
|
+
* - one-shot: a sequential `-n` run ff-pushes item 1's surface, then item 2's
|
|
23
|
+
* clone branches off the advanced `main`;
|
|
24
|
+
* - loop: a single mirror's SERIAL batch routinely MIXES rungs — a `build`/`task`
|
|
25
|
+
* rung integrates `work/<slug>` to the mirror's `main` MID-TICK (via the
|
|
26
|
+
* job-worktree `doDriver`), and a LATER tree-less rung in the SAME batch holds a
|
|
27
|
+
* `treelessCwd` cloned BEFORE that integration. So its `HEAD:main` push is
|
|
28
|
+
* non-fast-forward BY CONSTRUCTION (not a rare concurrent race) — the retry MUST
|
|
29
|
+
* re-fetch the advanced `main` and rebase the one slug-only tree-less commit onto
|
|
30
|
+
* it before pushing. The tree-less commit touches only the slug's sidecar/marker,
|
|
31
|
+
* so the rebase applies cleanly.
|
|
32
|
+
*
|
|
33
|
+
* **C2 rebase-until-real-conflict (task `c2-rebase-until-real-on-durable-main-
|
|
34
|
+
* promotions`).** This same `HEAD:main` push carries the won't-proceed terminal
|
|
35
|
+
* `tasks/ready → tasks/cancelled` / `prds/ready → prds/dropped` (slug-RELOCATION
|
|
36
|
+
* family) when `apply-persist.ts` resolves a `dropped` disposition; under sustained
|
|
37
|
+
* parallel load on the shared `main` ref two DIFFERENT items' concurrent promotions
|
|
38
|
+
* can falsely-contend even though nothing tree-conflicts, exhausting a small fixed
|
|
39
|
+
* cap. C2 turns the existing bounded retry into rebase-until-real-conflict: the
|
|
40
|
+
* GENUINE conflict terminator is REUSED — a rebase replay that fails (the slug is
|
|
41
|
+
* gone from its expected source folder on the new `main`, e.g. a concurrent
|
|
42
|
+
* legitimate same-item transition already moved it) STOPS the loop with the
|
|
43
|
+
* existing definitive outcome (the `rebase --abort` + note path below). A CLEAN
|
|
44
|
+
* re-rebase no longer counts against a tiny budget; `retries` is now a LARGE
|
|
45
|
+
* LIVENESS CEILING on the pathological livelock tail. Modest jitter on the refetch
|
|
46
|
+
* desynchronises the herd. SCOPE caveat (the SCOPE box in the design trail): a
|
|
47
|
+
* relocation MUST keep its source-folder precondition recheck — the rebase replay
|
|
48
|
+
* IS that recheck (the `git mv` fails when the source path is missing on new
|
|
49
|
+
* `main`), so the genuine-conflict signal is preserved verbatim.
|
|
50
|
+
*
|
|
51
|
+
* NEVER `--force`. A push that keeps failing (or a genuine rebase conflict) is
|
|
52
|
+
* REPORTED via `note` but does NOT crash the tick — the work stays committed in the
|
|
53
|
+
* clone for the next pass / a human.
|
|
54
|
+
*/
|
|
55
|
+
export interface PushTreelessResultParams {
|
|
56
|
+
/** The working clone whose `HEAD:main` carries the tree-less commit to publish. */
|
|
57
|
+
cwd: string;
|
|
58
|
+
/** Name of the arbiter git remote in `cwd` (the ledger to publish to). */
|
|
59
|
+
arbiter: string;
|
|
60
|
+
/**
|
|
61
|
+
* LIVENESS CEILING for the re-fetch+rebase retry on a non-fast-forward push.
|
|
62
|
+
* Under C2 (task `c2-rebase-until-real-on-durable-main-promotions`) this is no
|
|
63
|
+
* longer a small false-contention budget: a CLEAN re-rebase loops without
|
|
64
|
+
* counting against a tiny cap; a GENUINE conflict (the rebase fails because the
|
|
65
|
+
* slug's source path is gone on the new `main` — a concurrent legitimate
|
|
66
|
+
* same-item transition already moved it) STOPS definitively. The ceiling bounds
|
|
67
|
+
* only the pathological livelock tail; pass a small value (e.g. `0`) in tests
|
|
68
|
+
* to exercise the un-retried / cap-exhausted path deterministically.
|
|
69
|
+
*/
|
|
70
|
+
retries: number;
|
|
71
|
+
/**
|
|
72
|
+
* Modest jitter (ms) on the refetch between retries — load-bearing under
|
|
73
|
+
* sustained parallel load to desynchronise a thundering-herd lockstep loop (C2,
|
|
74
|
+
* task `c2-rebase-until-real-on-durable-main-promotions`). Each non-final
|
|
75
|
+
* attempt sleeps a uniformly-random integer in `[0, jitterMs]` ms. Defaults to
|
|
76
|
+
* {@link DEFAULT_TREELESS_JITTER_MS}; pass `0` in tests for deterministic,
|
|
77
|
+
* latency-free retries.
|
|
78
|
+
*/
|
|
79
|
+
jitterMs?: number;
|
|
80
|
+
/** Environment for child git processes. */
|
|
81
|
+
env: NodeJS.ProcessEnv | undefined;
|
|
82
|
+
/** Sink for the non-fatal "could not publish" note. */
|
|
83
|
+
note: (m: string) => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Default modest jitter (ms) on the refetch between {@link pushTreelessResult}
|
|
87
|
+
* retries — see the `PushTreelessResultParams.jitterMs` doc + the C2 block at the
|
|
88
|
+
* top of this file. Mirrors `integration-core.ts`'s `DEFAULT_MERGE_JITTER_MS`.
|
|
89
|
+
*/
|
|
90
|
+
export declare const DEFAULT_TREELESS_JITTER_MS = 25;
|
|
91
|
+
/**
|
|
92
|
+
* Fast-forward-push the working clone's `main` to the arbiter after a tree-less
|
|
93
|
+
* rung committed locally, so the sidecar / marker LANDS on the arbiter. Re-fetches
|
|
94
|
+
* + retries a bounded few times if `main` advanced under us (NEVER `--force`); a
|
|
95
|
+
* push that keeps failing is reported but does not crash the tick (the work is
|
|
96
|
+
* still saved in the clone for the next pass / a human).
|
|
97
|
+
*/
|
|
98
|
+
export declare function pushTreelessResult(params: PushTreelessResultParams): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* The rung kinds that commit a tree-less result LOCALLY (sidecar / `needsAnswers`
|
|
101
|
+
* / `triaged:` marker) and therefore need {@link pushTreelessResult} to reach the
|
|
102
|
+
* arbiter. The build/task rungs are NOT here — they already push via the
|
|
103
|
+
* job-worktree `doDriver` → `performIntegration` band. The `advancing` borrow +
|
|
104
|
+
* the promote-CAS are NOT here either — they CAS straight to the arbiter, so
|
|
105
|
+
* publishing here would double-publish nothing they own.
|
|
106
|
+
*/
|
|
107
|
+
export declare const TREELESS_RUNGS: ReadonlySet<string>;
|
|
108
|
+
//# sourceMappingURL=advance-treeless-publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advance-treeless-publish.d.ts","sourceRoot":"","sources":["../src/advance-treeless-publish.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,WAAW,wBAAwB;IACxC,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;OASG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;IACnC,uDAAuD;IACvD,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAM7C;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACvC,MAAM,EAAE,wBAAwB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAuDf;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAI7C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { runAsync } from './git.js';
|
|
2
|
+
/**
|
|
3
|
+
* Default modest jitter (ms) on the refetch between {@link pushTreelessResult}
|
|
4
|
+
* retries — see the `PushTreelessResultParams.jitterMs` doc + the C2 block at the
|
|
5
|
+
* top of this file. Mirrors `integration-core.ts`'s `DEFAULT_MERGE_JITTER_MS`.
|
|
6
|
+
*/
|
|
7
|
+
export const DEFAULT_TREELESS_JITTER_MS = 25;
|
|
8
|
+
function sleepMs(ms) {
|
|
9
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fast-forward-push the working clone's `main` to the arbiter after a tree-less
|
|
13
|
+
* rung committed locally, so the sidecar / marker LANDS on the arbiter. Re-fetches
|
|
14
|
+
* + retries a bounded few times if `main` advanced under us (NEVER `--force`); a
|
|
15
|
+
* push that keeps failing is reported but does not crash the tick (the work is
|
|
16
|
+
* still saved in the clone for the next pass / a human).
|
|
17
|
+
*/
|
|
18
|
+
export async function pushTreelessResult(params) {
|
|
19
|
+
const { cwd, arbiter, retries, env, note } = params;
|
|
20
|
+
const jitterMs = params.jitterMs ?? DEFAULT_TREELESS_JITTER_MS;
|
|
21
|
+
for (let i = 0; i <= retries; i++) {
|
|
22
|
+
const push = await runAsync('git', ['push', '--quiet', arbiter, 'HEAD:main'], cwd, { env });
|
|
23
|
+
if (push.status === 0) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const contended = /non-fast-forward|rejected|fetch first|stale info/i.test(push.stderr);
|
|
27
|
+
if (!contended || i === retries) {
|
|
28
|
+
note(`advance: could not publish the tree-less result to ` +
|
|
29
|
+
`${arbiter}/main (${push.stderr.trim() || 'push failed'}); the work is ` +
|
|
30
|
+
`saved in the working clone and will re-apply on the next pass.`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
// Modest jitter on the refetch (C2, task `c2-rebase-until-real-on-durable-main-
|
|
34
|
+
// promotions`): an instant lockstep refetch→re-push loop maximises mutual
|
|
35
|
+
// rejection under sustained parallel load (thundering herd). A uniformly-
|
|
36
|
+
// random `[0, jitterMs]` ms sleep desynchronises the herd; `jitterMs: 0` opts
|
|
37
|
+
// out (the test seam).
|
|
38
|
+
if (jitterMs > 0) {
|
|
39
|
+
await sleepMs(Math.floor(Math.random() * (jitterMs + 1)));
|
|
40
|
+
}
|
|
41
|
+
// `main` advanced under us — re-fetch + rebase our (one) commit onto it, retry.
|
|
42
|
+
// A CLEAN rebase loops; a GENUINE conflict (the slug's source path is gone on
|
|
43
|
+
// the new `main` because a concurrent legitimate same-item transition already
|
|
44
|
+
// moved it — the slug-relocation source-folder precondition recheck) STOPS
|
|
45
|
+
// definitively below. The natural rebase-conflict IS the C2 terminator (we add
|
|
46
|
+
// no new conflict-detection path; the SCOPE box requires reusing the existing
|
|
47
|
+
// recheck).
|
|
48
|
+
await runAsync('git', ['fetch', '--quiet', arbiter], cwd, { env });
|
|
49
|
+
const rebase = await runAsync('git', ['rebase', '--quiet', `${arbiter}/main`], cwd, { env });
|
|
50
|
+
if (rebase.status !== 0) {
|
|
51
|
+
await runAsync('git', ['rebase', '--abort'], cwd, { env });
|
|
52
|
+
note(`advance: the tree-less result conflicted with ${arbiter}/main; ` +
|
|
53
|
+
`the work is saved in the working clone for the next pass / a human.`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The rung kinds that commit a tree-less result LOCALLY (sidecar / `needsAnswers`
|
|
60
|
+
* / `triaged:` marker) and therefore need {@link pushTreelessResult} to reach the
|
|
61
|
+
* arbiter. The build/task rungs are NOT here — they already push via the
|
|
62
|
+
* job-worktree `doDriver` → `performIntegration` band. The `advancing` borrow +
|
|
63
|
+
* the promote-CAS are NOT here either — they CAS straight to the arbiter, so
|
|
64
|
+
* publishing here would double-publish nothing they own.
|
|
65
|
+
*/
|
|
66
|
+
export const TREELESS_RUNGS = new Set([
|
|
67
|
+
'surface',
|
|
68
|
+
'apply',
|
|
69
|
+
'triage-observation',
|
|
70
|
+
]);
|
|
71
|
+
//# sourceMappingURL=advance-treeless-publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advance-treeless-publish.js","sourceRoot":"","sources":["../src/advance-treeless-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAuFlC;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,SAAS,OAAO,CAAC,EAAU;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,MAAgC;IAEhC,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAC,GAAG,MAAM,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,0BAA0B,CAAC;IAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAC1B,KAAK,EACL,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,CAAC,EACzC,GAAG,EACH,EAAC,GAAG,EAAC,CACL,CAAC;QACF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,O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