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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure tasking-eligibility resolution — the auto-task decision layer, one level
|
|
3
|
+
* UP from the build gate (`eligibility.ts`). No I/O: callers pass in the prd's
|
|
4
|
+
* two autonomy axes (`humanOnly`, `needsAnswers`), the repo's `autoTask` policy,
|
|
5
|
+
* the prd's `taskedAfter` slugs, and the set of slugs whose prds are already
|
|
6
|
+
* TASKED (resolved against `work/prds/tasked/` residence, NOT `work/done/`).
|
|
7
|
+
*
|
|
8
|
+
* This mirrors the build-gate shape deliberately (CONTEXT.md / the `auto-slice`
|
|
9
|
+
* prd): the same `needsAnswers !== true && humanOnly !== true && <repo policy>`
|
|
10
|
+
* predicate, applied to a prd's two axes + the repo's `autoTask` toggle — and a
|
|
11
|
+
* cross-prd ordering check that resolves against tasked-ness rather than done-ness.
|
|
12
|
+
*/
|
|
13
|
+
import type { HumanOnlyGate } from './eligibility.js';
|
|
14
|
+
export type { HumanOnlyGate };
|
|
15
|
+
/** Resolution of a prd's `taskedAfter` against the set of already-tasked prds. */
|
|
16
|
+
export interface TaskedAfterResult {
|
|
17
|
+
/** True when every listed prd is already tasked. */
|
|
18
|
+
satisfied: boolean;
|
|
19
|
+
/** Listed prd slugs not yet tasked, in declaration order. */
|
|
20
|
+
missing: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface TaskingEligibilityInput {
|
|
23
|
+
/** Autonomy axis 1 (DECIDED): a human must drive THIS prd's tasking. */
|
|
24
|
+
humanOnly: HumanOnlyGate;
|
|
25
|
+
/** Autonomy axis 2 (DISCOVERED): the prd has unresolved questions. */
|
|
26
|
+
needsAnswers: HumanOnlyGate;
|
|
27
|
+
/** Cross-prd order: prd slugs that must already be tasked before this one. */
|
|
28
|
+
taskedAfter: string[];
|
|
29
|
+
/** Slugs of prds that are already TASKED (residence in `work/prds/tasked/`). */
|
|
30
|
+
taskedSlugs: Set<string>;
|
|
31
|
+
/** Per-repo policy: may an agent auto-task *undeclared* prds in this repo? */
|
|
32
|
+
autoTask: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The target was named EXPLICITLY by the operator (`do prd:<slug>`), so the
|
|
35
|
+
* `autoTask` POLICY is already satisfied — naming the prd IS the authorization,
|
|
36
|
+
* exactly as `do <task>` builds a named task regardless of `autoBuild` (the
|
|
37
|
+
* `autoBuild` precedent: the pool/scan gates the policy, the explicit claim path
|
|
38
|
+
* never re-checks it). When `true`, the policy term drops from the gate and ONLY
|
|
39
|
+
* the prd's own readiness axes (`humanOnly`/`needsAnswers`) + `taskedAfter` bind.
|
|
40
|
+
* Defaults `false` (the AUTO-PICK pool path, where the `autoTask` policy DOES
|
|
41
|
+
* gate). The pool is the single policy-enforcement point; the per-invocation gate
|
|
42
|
+
* applies the policy only when NOT explicit.
|
|
43
|
+
*/
|
|
44
|
+
explicit?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface TaskingEligibilityResult {
|
|
47
|
+
/** Taskable now = gate passes AND every `taskedAfter` prd is already tasked. */
|
|
48
|
+
taskable: boolean;
|
|
49
|
+
/** Whether the autonomy gate alone passes (agent-taskable on its own axes). */
|
|
50
|
+
gatePass: boolean;
|
|
51
|
+
taskedAfter: TaskedAfterResult;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the tasking autonomy gate: agent-taskable iff `needsAnswers` is not
|
|
55
|
+
* `true` AND `humanOnly` is not `true` AND the repo's `autoTask` POLICY is
|
|
56
|
+
* satisfied — where the policy is satisfied either by the repo's `autoTask`
|
|
57
|
+
* toggle being on (the AUTO-PICK pool path) OR by the target being named
|
|
58
|
+
* EXPLICITLY (`explicit: true` — `do prd:<slug>`, where naming IS the
|
|
59
|
+
* authorization, mirroring `do <task>` vs `autoBuild`). Both readiness axes
|
|
60
|
+
* block orthogonally and are never agent-taskable regardless of policy; a human
|
|
61
|
+
* is never bound by either. The exact mirror of `resolveGate` (the build gate),
|
|
62
|
+
* one level up.
|
|
63
|
+
*/
|
|
64
|
+
export declare function resolveTaskGate(humanOnly: HumanOnlyGate, needsAnswers: HumanOnlyGate, autoTask: boolean, explicit?: boolean): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve a prd's `taskedAfter` against the slugs of prds already TASKED (NOT
|
|
67
|
+
* `done/`): satisfied iff every listed prd is present in `taskedSlugs`. An
|
|
68
|
+
* untasked blocker ⇒ not yet taskable (so this prd's emitted tasks can
|
|
69
|
+
* reference the real slugs of those prds' tasks).
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveTaskedAfter(taskedAfter: string[], taskedSlugs: Set<string>): TaskedAfterResult;
|
|
72
|
+
/** Combine the tasking gate and `taskedAfter` resolution into a verdict. */
|
|
73
|
+
export declare function resolveTaskingEligibility(input: TaskingEligibilityInput): TaskingEligibilityResult;
|
|
74
|
+
//# sourceMappingURL=tasking-eligibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasking-eligibility.d.ts","sourceRoot":"","sources":["../src/tasking-eligibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAC,aAAa,EAAC,CAAC;AAE5B,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IACjC,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACvC,wEAAwE;IACxE,SAAS,EAAE,aAAa,CAAC;IACzB,sEAAsE;IACtE,YAAY,EAAE,aAAa,CAAC;IAC5B,8EAA8E;IAC9E,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gFAAgF;IAChF,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACxC,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,iBAAiB,CAAC;CAC/B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC9B,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,aAAa,EAC3B,QAAQ,EAAE,OAAO,EACjB,QAAQ,UAAQ,GACd,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,WAAW,EAAE,MAAM,EAAE,EACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACtB,iBAAiB,CAGnB;AAED,4EAA4E;AAC5E,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,uBAAuB,GAC5B,wBAAwB,CAa1B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure tasking-eligibility resolution — the auto-task decision layer, one level
|
|
3
|
+
* UP from the build gate (`eligibility.ts`). No I/O: callers pass in the prd's
|
|
4
|
+
* two autonomy axes (`humanOnly`, `needsAnswers`), the repo's `autoTask` policy,
|
|
5
|
+
* the prd's `taskedAfter` slugs, and the set of slugs whose prds are already
|
|
6
|
+
* TASKED (resolved against `work/prds/tasked/` residence, NOT `work/done/`).
|
|
7
|
+
*
|
|
8
|
+
* This mirrors the build-gate shape deliberately (CONTEXT.md / the `auto-slice`
|
|
9
|
+
* prd): the same `needsAnswers !== true && humanOnly !== true && <repo policy>`
|
|
10
|
+
* predicate, applied to a prd's two axes + the repo's `autoTask` toggle — and a
|
|
11
|
+
* cross-prd ordering check that resolves against tasked-ness rather than done-ness.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the tasking autonomy gate: agent-taskable iff `needsAnswers` is not
|
|
15
|
+
* `true` AND `humanOnly` is not `true` AND the repo's `autoTask` POLICY is
|
|
16
|
+
* satisfied — where the policy is satisfied either by the repo's `autoTask`
|
|
17
|
+
* toggle being on (the AUTO-PICK pool path) OR by the target being named
|
|
18
|
+
* EXPLICITLY (`explicit: true` — `do prd:<slug>`, where naming IS the
|
|
19
|
+
* authorization, mirroring `do <task>` vs `autoBuild`). Both readiness axes
|
|
20
|
+
* block orthogonally and are never agent-taskable regardless of policy; a human
|
|
21
|
+
* is never bound by either. The exact mirror of `resolveGate` (the build gate),
|
|
22
|
+
* one level up.
|
|
23
|
+
*/
|
|
24
|
+
export function resolveTaskGate(humanOnly, needsAnswers, autoTask, explicit = false) {
|
|
25
|
+
if (needsAnswers === true || humanOnly === true) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
// EXPLICIT naming satisfies the policy term (the build path's autoBuild
|
|
29
|
+
// precedent); otherwise the repo's autoTask toggle gates the auto-pick pool.
|
|
30
|
+
return explicit || autoTask;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a prd's `taskedAfter` against the slugs of prds already TASKED (NOT
|
|
34
|
+
* `done/`): satisfied iff every listed prd is present in `taskedSlugs`. An
|
|
35
|
+
* untasked blocker ⇒ not yet taskable (so this prd's emitted tasks can
|
|
36
|
+
* reference the real slugs of those prds' tasks).
|
|
37
|
+
*/
|
|
38
|
+
export function resolveTaskedAfter(taskedAfter, taskedSlugs) {
|
|
39
|
+
const missing = taskedAfter.filter((slug) => !taskedSlugs.has(slug));
|
|
40
|
+
return { satisfied: missing.length === 0, missing };
|
|
41
|
+
}
|
|
42
|
+
/** Combine the tasking gate and `taskedAfter` resolution into a verdict. */
|
|
43
|
+
export function resolveTaskingEligibility(input) {
|
|
44
|
+
const gatePass = resolveTaskGate(input.humanOnly, input.needsAnswers, input.autoTask, input.explicit);
|
|
45
|
+
const taskedAfter = resolveTaskedAfter(input.taskedAfter, input.taskedSlugs);
|
|
46
|
+
return {
|
|
47
|
+
taskable: gatePass && taskedAfter.satisfied,
|
|
48
|
+
gatePass,
|
|
49
|
+
taskedAfter,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=tasking-eligibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasking-eligibility.js","sourceRoot":"","sources":["../src/tasking-eligibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA+CH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC9B,SAAwB,EACxB,YAA2B,EAC3B,QAAiB,EACjB,QAAQ,GAAG,KAAK;IAEhB,IAAI,YAAY,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,wEAAwE;IACxE,6EAA6E;IAC7E,OAAO,QAAQ,IAAI,QAAQ,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CACjC,WAAqB,EACrB,WAAwB;IAExB,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACrE,OAAO,EAAC,SAAS,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,EAAC,CAAC;AACnD,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,yBAAyB,CACxC,KAA8B;IAE9B,MAAM,QAAQ,GAAG,eAAe,CAC/B,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,QAAQ,CACd,CAAC;IACF,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC7E,OAAO;QACN,QAAQ,EAAE,QAAQ,IAAI,WAAW,CAAC,SAAS;QAC3C,QAAQ;QACR,WAAW;KACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** A semantic label for the lock-acquire outcome (never the verdict itself). */
|
|
2
|
+
export type AcquireTaskingLockOutcome = 'acquired' | 'usage-error' | 'lost' | 'contended';
|
|
3
|
+
/** Maps onto the claim-CAS exit codes (identical semantics). */
|
|
4
|
+
export type AcquireTaskingLockExitCode = 0 | 1 | 2 | 3;
|
|
5
|
+
export interface AcquireTaskingLockOptions {
|
|
6
|
+
/** The prd slug to lock (`work/prds/ready/<slug>.md`). */
|
|
7
|
+
slug: string;
|
|
8
|
+
/** Working clone/worktree the lock acquire runs in. */
|
|
9
|
+
cwd: string;
|
|
10
|
+
/** Name of the arbiter remote (`--arbiter`). Defaults to `origin`. */
|
|
11
|
+
arbiter?: string;
|
|
12
|
+
/** Advisory locker id. Defaults to git user.name, then $USER. */
|
|
13
|
+
by?: string;
|
|
14
|
+
/** Cap on push retries when main merely advanced. Default 3. (Unified lock is retry-free; retained for API parity.) */
|
|
15
|
+
retries?: number;
|
|
16
|
+
/** Show the intended acquire without mutating the arbiter (`--dry-run`). */
|
|
17
|
+
dryRun?: boolean;
|
|
18
|
+
/** Environment for child git processes. */
|
|
19
|
+
env?: NodeJS.ProcessEnv;
|
|
20
|
+
/** Sink for human-readable progress notes. */
|
|
21
|
+
note?: (message: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface AcquireTaskingLockResult {
|
|
24
|
+
exitCode: AcquireTaskingLockExitCode;
|
|
25
|
+
outcome: AcquireTaskingLockOutcome;
|
|
26
|
+
/** Human-readable summary of the terminal condition. */
|
|
27
|
+
message: string;
|
|
28
|
+
/**
|
|
29
|
+
* On a successful acquire (`acquired`), the git BLOB sha of the prd body that
|
|
30
|
+
* the lock TOOK (`work/prds/ready/<slug>.md` on the arbiter). This IS the snapshot the
|
|
31
|
+
* tasker reads + tasks from; the integrate transition compares the current
|
|
32
|
+
* `work/prds/ready/<slug>.md` blob against it to fail loud on a concurrent edit (the
|
|
33
|
+
* read-stability backstop). `undefined` unless `outcome === 'acquired'` (and on
|
|
34
|
+
* dry-run, where nothing was published).
|
|
35
|
+
*/
|
|
36
|
+
lockedBlob?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Acquire the tasking lock for `slug`: take the item's unified `action: task`
|
|
40
|
+
* lock (a parentless ref CAS). Never throws for the expected "lost the race"
|
|
41
|
+
* (exit 2) case — it is returned. Usage/environment problems surface as exit 1; a
|
|
42
|
+
* held lock is exit 0.
|
|
43
|
+
*/
|
|
44
|
+
export declare function acquireTaskingLock(options: AcquireTaskingLockOptions): Promise<AcquireTaskingLockResult>;
|
|
45
|
+
/** A semantic label for the lock-release outcome. */
|
|
46
|
+
export type ReleaseTaskingLockOutcome = 'released' | 'usage-error' | 'lost' | 'contended' | 'stale';
|
|
47
|
+
/** Maps onto the claim-CAS exit codes, plus `4` for a STALE (conflicting) lock. */
|
|
48
|
+
export type ReleaseTaskingLockExitCode = 0 | 1 | 2 | 3 | 4;
|
|
49
|
+
export interface ReleaseTaskingLockOptions {
|
|
50
|
+
/** The prd slug whose lock to release. */
|
|
51
|
+
slug: string;
|
|
52
|
+
/** Working clone/worktree the release runs in. */
|
|
53
|
+
cwd: string;
|
|
54
|
+
/** Name of the arbiter remote (`--arbiter`). Defaults to `origin`. */
|
|
55
|
+
arbiter?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The git BLOB sha the lock TOOK ({@link AcquireTaskingLockResult.lockedBlob}).
|
|
58
|
+
* RETAINED for API parity; the content-identity stale check now lives at the
|
|
59
|
+
* integrate seam (`tasking.ts` `heldSpecIsStale`), which runs BEFORE the
|
|
60
|
+
* completing commit. The release itself no longer reads the held body (there is
|
|
61
|
+
* no `tasking/` marker), so it does not consult this.
|
|
62
|
+
*/
|
|
63
|
+
lockedBlob?: string;
|
|
64
|
+
/** Advisory releaser id. Defaults to git user.name, then $USER. */
|
|
65
|
+
by?: string;
|
|
66
|
+
/** Cap on push retries when main merely advanced. Default 3. */
|
|
67
|
+
retries?: number;
|
|
68
|
+
/**
|
|
69
|
+
* The tasker review→edit LOOP's **decomposition-unclear** verdict
|
|
70
|
+
* (`slicer-review-edit-loop`), or the task-SET acceptance gate's `block`:
|
|
71
|
+
* instead of DELETING the lock (returning the prd to the claimable/taskable
|
|
72
|
+
* pool), amend it `active → stuck` with this reason recorded on the entry,
|
|
73
|
+
* emitting NO guessed tasks. The prd body stays in `work/prds/ready/` (it never moved
|
|
74
|
+
* under the lock); the stuck lock IS the tasking needs-attention surface (no
|
|
75
|
+
* `work/needs-attention/` folder write), so it is NOT re-taskable until a human
|
|
76
|
+
* resolves it via `release-lock`/`resume`. Omitted ⇒ the normal release DELETES
|
|
77
|
+
* the lock ref.
|
|
78
|
+
*/
|
|
79
|
+
routeToNeedsAttention?: {
|
|
80
|
+
reason: string;
|
|
81
|
+
};
|
|
82
|
+
/** Environment for child git processes. */
|
|
83
|
+
env?: NodeJS.ProcessEnv;
|
|
84
|
+
/** Sink for human-readable progress notes. */
|
|
85
|
+
note?: (message: string) => void;
|
|
86
|
+
}
|
|
87
|
+
export interface ReleaseTaskingLockResult {
|
|
88
|
+
exitCode: ReleaseTaskingLockExitCode;
|
|
89
|
+
outcome: ReleaseTaskingLockOutcome;
|
|
90
|
+
/** Human-readable summary of the terminal condition. */
|
|
91
|
+
message: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Release the tasking lock for `slug`: DELETE the unified `action: task` lock ref
|
|
95
|
+
* (idempotent — an already-absent ref is a clean `released`). It moves NO lifecycle
|
|
96
|
+
* file: the durable `prd → prd-tasked` success move is owned by the integrate band,
|
|
97
|
+
* and the prd body never left `work/prds/ready/` under the lock, so there is no
|
|
98
|
+
* `tasking/ → prd/` restore.
|
|
99
|
+
*
|
|
100
|
+
* When `routeToNeedsAttention` is set (the tasker decomposition-unclear verdict /
|
|
101
|
+
* the task-SET acceptance gate `block`), the lock is AMENDED `active → stuck`
|
|
102
|
+
* with the reason on the entry INSTEAD of deleted — the stuck per-item lock IS the
|
|
103
|
+
* tasking needs-attention surface now (no folder write).
|
|
104
|
+
*
|
|
105
|
+
* Outcomes:
|
|
106
|
+
* - `released` (0): the lock ref is deleted (or amended stuck), the tasking is done.
|
|
107
|
+
* - `usage-error` (1): bad input / environment / a lock-amend fault.
|
|
108
|
+
* - `lost` (2): the lock is not held (nothing to release).
|
|
109
|
+
*/
|
|
110
|
+
export declare function releaseTaskingLock(options: ReleaseTaskingLockOptions): Promise<ReleaseTaskingLockResult>;
|
|
111
|
+
//# sourceMapping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,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE3D,MAAM,WAAW,yBAAyB;IACzC,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;OAUG;IACH,qBAAqB,CAAC,EAAE;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC;IACzC,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,wBAAwB;IACxC,QAAQ,EAAE,0BAA0B,CAAC;IACrC,OAAO,EAAE,yBAAyB,CAAC;IACnC,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,yBAAyB,GAChC,OAAO,CAAC,wBAAwB,CAAC,CAWnC"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { runAsync } from './git.js';
|
|
2
|
+
import { acquireItemLock, releaseItemLock, markStuckItemLock, } from './item-lock.js';
|
|
3
|
+
import { workItemRel } from './work-layout.js';
|
|
4
|
+
/**
|
|
5
|
+
* The **tasking concurrency lock** (prd `auto-slice`, task `autoslice-lock`).
|
|
6
|
+
*
|
|
7
|
+
* Serialises *concurrent* taskers (two CI runs, or human + CI) so a prd is never
|
|
8
|
+
* double-tasked. As of the capstone cut-over (task
|
|
9
|
+
* `cutover-retire-slicing-advancing-markers-and-trim-folder-sets`, prd
|
|
10
|
+
* `ledger-status-per-item-lock-refs`; ADR `ledger-status-on-per-item-lock-refs`)
|
|
11
|
+
* the legacy `git mv work/prds/ready/<slug>.md → work/tasking/<slug>.md` MARKER on `main`
|
|
12
|
+
* is GONE: the body NEVER relocates until the durable promotion, exactly as claim
|
|
13
|
+
* no longer moves the task body (task
|
|
14
|
+
* `cutover-claim-body-stays-and-complete-sources-from-backlog`). The tasking lock
|
|
15
|
+
* is now ONLY the UNIFIED per-item lock (`refs/dorfl/lock/<entry>`,
|
|
16
|
+
* `action: task`, keyed `prd:<slug>`) — the SAME ref claim and advance use for
|
|
17
|
+
* the same item, so tasking a prd is mutually exclusive with claiming/advancing
|
|
18
|
+
* the SAME item BY CONSTRUCTION (the second acquirer loses the SAME create-only
|
|
19
|
+
* ref CAS, with NO retry budget and NO false contention). There is no transient
|
|
20
|
+
* status in `main`'s tree anymore, so a work branch cut from `main` inherits no
|
|
21
|
+
* stale `tasking/` marker.
|
|
22
|
+
*
|
|
23
|
+
* - **Acquire** ({@link acquireTaskingLock}) acquires the unified per-item lock.
|
|
24
|
+
* A `lost` (the item is already held for implement/task/advance) makes the
|
|
25
|
+
* tasking acquire lose DEFINITIVELY (exit 2, no retry). On a successful acquire
|
|
26
|
+
* it returns {@link AcquireTaskingLockResult.lockedBlob}: the git blob sha of the
|
|
27
|
+
* prd body the lock TOOK, read from `work/prds/ready/<slug>.md` on the arbiter — the
|
|
28
|
+
* snapshot the tasker reads + tasks from, handed back so the integrate
|
|
29
|
+
* transition can fail loud if the held prd was edited concurrently (the
|
|
30
|
+
* read-stability backstop). A dry-run takes no lock (it mutates nothing).
|
|
31
|
+
*
|
|
32
|
+
* - **Release** ({@link releaseTaskingLock}) DELETES the unified lock ref. It
|
|
33
|
+
* moves NO lifecycle file: the durable `prd → prd-tasked` success move is owned
|
|
34
|
+
* by the integrate band (`tasking.ts`/`integration-core.ts`), and there is no
|
|
35
|
+
* `tasking/ → prd/` abort bounce anymore (the body never left `prd/`). When
|
|
36
|
+
* `routeToNeedsAttention` is set (the tasker review/edit loop's
|
|
37
|
+
* decomposition-unclear verdict, or the task-SET acceptance gate's `block`),
|
|
38
|
+
* release amends the lock `active → stuck` with the reason on the entry INSTEAD
|
|
39
|
+
* of deleting it — the per-item-lock stuck state IS the tasking needs-attention
|
|
40
|
+
* surface now (no `work/needs-attention/` folder write), consistent with the
|
|
41
|
+
* needs-attention cut-over (task
|
|
42
|
+
* `cutover-needs-attention-becomes-lock-stuck-recovery-surface`). A human reads
|
|
43
|
+
* it via `dorfl status` / `gc --ledger` and resolves via
|
|
44
|
+
* `release-lock`/`resume`.
|
|
45
|
+
*
|
|
46
|
+
* The READ-STABILITY backstop (the content-identity stale check that used to live
|
|
47
|
+
* in the release, comparing the held `work/tasking/<slug>.md` blob against the
|
|
48
|
+
* acquire-time snapshot) now lives at the integrate seam (`tasking.ts`
|
|
49
|
+
* `heldSpecIsStale`, comparing `work/prds/ready/<slug>.md`) — relocated because the
|
|
50
|
+
* completing transition, not the release, owns the commit. See
|
|
51
|
+
* `work/notes/observations/tasking-lock-does-not-stabilise-prd-content.md`.
|
|
52
|
+
*
|
|
53
|
+
* This module provides the lock PRIMITIVES only. The orchestrating `do prd:<slug>`
|
|
54
|
+
* tasking command (`tasking.ts`) acquires, drives the agent's tasking, integrates
|
|
55
|
+
* the emitted tasks + the durable `prd → prd-tasked` move, and releases. The
|
|
56
|
+
* human path (no contention) may task on `main` directly without the lock.
|
|
57
|
+
*/
|
|
58
|
+
const DEFAULT_ARBITER = 'origin';
|
|
59
|
+
/** Raised for usage/environment errors (exit 1). */
|
|
60
|
+
class TaskingLockUsageError extends Error {
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Acquire the tasking lock for `slug`: take the item's unified `action: task`
|
|
64
|
+
* lock (a parentless ref CAS). Never throws for the expected "lost the race"
|
|
65
|
+
* (exit 2) case — it is returned. Usage/environment problems surface as exit 1; a
|
|
66
|
+
* held lock is exit 0.
|
|
67
|
+
*/
|
|
68
|
+
export async function acquireTaskingLock(options) {
|
|
69
|
+
const note = options.note ?? (() => { });
|
|
70
|
+
try {
|
|
71
|
+
return await runAcquire(options, note);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
if (err instanceof TaskingLockUsageError) {
|
|
75
|
+
return { exitCode: 1, outcome: 'usage-error', message: err.message };
|
|
76
|
+
}
|
|
77
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
78
|
+
return { exitCode: 1, outcome: 'usage-error', message };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function runAcquire(options, note) {
|
|
82
|
+
const slug = options.slug;
|
|
83
|
+
const arbiter = options.arbiter ?? DEFAULT_ARBITER;
|
|
84
|
+
const dryRun = options.dryRun ?? false;
|
|
85
|
+
const cwd = options.cwd;
|
|
86
|
+
const env = options.env;
|
|
87
|
+
if (!slug) {
|
|
88
|
+
throw new TaskingLockUsageError('missing <slug>. usage: acquireTaskingLock({slug, cwd, arbiter})');
|
|
89
|
+
}
|
|
90
|
+
if ((await gitSoft(['rev-parse', '--git-dir'], cwd, env)).status !== 0) {
|
|
91
|
+
throw new TaskingLockUsageError('not inside a git repository');
|
|
92
|
+
}
|
|
93
|
+
if ((await gitSoft(['remote', 'get-url', arbiter], cwd, env)).status !== 0) {
|
|
94
|
+
throw new TaskingLockUsageError(`no git remote named '${arbiter}' (set one, or pass --arbiter)`);
|
|
95
|
+
}
|
|
96
|
+
const by = options.by || (await resolveBy(cwd, env));
|
|
97
|
+
// Is the prd still lockable (present in work/prds/ready/ on the arbiter's main)?
|
|
98
|
+
await gitHard(['fetch', '--quiet', arbiter], cwd, env);
|
|
99
|
+
const spec = workItemRel('specs-ready', `${slug}.md`);
|
|
100
|
+
const specBlob = await gitSoft(['rev-parse', `${arbiter}/main:${spec}`], cwd, env);
|
|
101
|
+
if (specBlob.status !== 0) {
|
|
102
|
+
const message = `'${spec}' not found on ${arbiter}/main (no such prd, or it was already moved/tasked).`;
|
|
103
|
+
note(message);
|
|
104
|
+
return { exitCode: 2, outcome: 'lost', message };
|
|
105
|
+
}
|
|
106
|
+
const lockedBlob = specBlob.stdout.trim();
|
|
107
|
+
// A dry-run takes no lock (it mutates nothing) but still reports the lockable
|
|
108
|
+
// snapshot it WOULD take.
|
|
109
|
+
if (dryRun) {
|
|
110
|
+
const message = `[dry-run] would acquire the tasking lock for '${slug}' (${spec} present on ${arbiter}/main).`;
|
|
111
|
+
note(message);
|
|
112
|
+
return { exitCode: 0, outcome: 'acquired', message, lockedBlob };
|
|
113
|
+
}
|
|
114
|
+
// Acquire the UNIFIED per-item lock (`action: task`, keyed `prd:<slug>` so it
|
|
115
|
+
// shares the ONE ref with claim/advance of the SAME item). A create-only ref
|
|
116
|
+
// CAS: the winner holds it, the loser is DEFINITIVELY `lost` (exit 2, no retry
|
|
117
|
+
// budget). No auto-steal of an orphaned lock, consistent with claim/advance and
|
|
118
|
+
// the ADR's recovery model (no liveness heartbeat / auto-sweep; a human asserts
|
|
119
|
+
// a lock is dead via `release-lock` + `gc --ledger`).
|
|
120
|
+
// MIGRATE step (prd `prd-to-spec-vocabulary-cutover-and-migration-command`):
|
|
121
|
+
// EMIT the parent-spec item identity as `spec:<slug>` so the unified per-item
|
|
122
|
+
// lock ref is `refs/dorfl/lock/spec-<slug>` (the expand-lock task made
|
|
123
|
+
// `spec:<slug>` resolve to a `spec-<slug>` entry). The resolver still ACCEPTS
|
|
124
|
+
// `prd:<slug>`, so any lock taken under the old identity stays readable; the
|
|
125
|
+
// contract task removes the legacy form.
|
|
126
|
+
const lock = await acquireItemLock({
|
|
127
|
+
item: `spec:${slug}`,
|
|
128
|
+
action: 'task',
|
|
129
|
+
cwd,
|
|
130
|
+
arbiter,
|
|
131
|
+
holder: by,
|
|
132
|
+
env,
|
|
133
|
+
});
|
|
134
|
+
if (lock.outcome === 'error') {
|
|
135
|
+
throw new TaskingLockUsageError(`failed to acquire the item lock for '${slug}': ${lock.message}`);
|
|
136
|
+
}
|
|
137
|
+
if (lock.outcome === 'lost') {
|
|
138
|
+
note(lock.message);
|
|
139
|
+
return { exitCode: 2, outcome: 'lost', message: lock.message };
|
|
140
|
+
}
|
|
141
|
+
const message = `LOCKED '${slug}' for tasking on ${arbiter} (unified lock).`;
|
|
142
|
+
note(message);
|
|
143
|
+
return { exitCode: 0, outcome: 'acquired', message, lockedBlob };
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Release the tasking lock for `slug`: DELETE the unified `action: task` lock ref
|
|
147
|
+
* (idempotent — an already-absent ref is a clean `released`). It moves NO lifecycle
|
|
148
|
+
* file: the durable `prd → prd-tasked` success move is owned by the integrate band,
|
|
149
|
+
* and the prd body never left `work/prds/ready/` under the lock, so there is no
|
|
150
|
+
* `tasking/ → prd/` restore.
|
|
151
|
+
*
|
|
152
|
+
* When `routeToNeedsAttention` is set (the tasker decomposition-unclear verdict /
|
|
153
|
+
* the task-SET acceptance gate `block`), the lock is AMENDED `active → stuck`
|
|
154
|
+
* with the reason on the entry INSTEAD of deleted — the stuck per-item lock IS the
|
|
155
|
+
* tasking needs-attention surface now (no folder write).
|
|
156
|
+
*
|
|
157
|
+
* Outcomes:
|
|
158
|
+
* - `released` (0): the lock ref is deleted (or amended stuck), the tasking is done.
|
|
159
|
+
* - `usage-error` (1): bad input / environment / a lock-amend fault.
|
|
160
|
+
* - `lost` (2): the lock is not held (nothing to release).
|
|
161
|
+
*/
|
|
162
|
+
export async function releaseTaskingLock(options) {
|
|
163
|
+
const note = options.note ?? (() => { });
|
|
164
|
+
try {
|
|
165
|
+
return await runRelease(options, note);
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
if (err instanceof TaskingLockUsageError) {
|
|
169
|
+
return { exitCode: 1, outcome: 'usage-error', message: err.message };
|
|
170
|
+
}
|
|
171
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
172
|
+
return { exitCode: 1, outcome: 'usage-error', message };
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async function runRelease(options, note) {
|
|
176
|
+
const slug = options.slug;
|
|
177
|
+
const arbiter = options.arbiter ?? DEFAULT_ARBITER;
|
|
178
|
+
const cwd = options.cwd;
|
|
179
|
+
const env = options.env;
|
|
180
|
+
if (!slug) {
|
|
181
|
+
throw new TaskingLockUsageError('missing <slug>. usage: releaseTaskingLock({slug, cwd, arbiter})');
|
|
182
|
+
}
|
|
183
|
+
if ((await gitSoft(['rev-parse', '--git-dir'], cwd, env)).status !== 0) {
|
|
184
|
+
throw new TaskingLockUsageError('not inside a git repository');
|
|
185
|
+
}
|
|
186
|
+
if ((await gitSoft(['remote', 'get-url', arbiter], cwd, env)).status !== 0) {
|
|
187
|
+
throw new TaskingLockUsageError(`no git remote named '${arbiter}' (set one, or pass --arbiter)`);
|
|
188
|
+
}
|
|
189
|
+
// DECOMPOSITION-UNCLEAR / TASK-GATE BLOCK: amend the lock `active → stuck` with
|
|
190
|
+
// the reason on the entry (the tasking needs-attention surface), NOT delete it.
|
|
191
|
+
// The prd body stays in `work/prds/ready/`; the stuck lock keeps it out of the
|
|
192
|
+
// taskable pool until a human resolves it (`release-lock`/`resume`).
|
|
193
|
+
if (options.routeToNeedsAttention !== undefined) {
|
|
194
|
+
// MIGRATE: EMIT `spec:<slug>` (keyed to the `spec-<slug>` lock entry).
|
|
195
|
+
const stuck = await markStuckItemLock({
|
|
196
|
+
item: `spec:${slug}`,
|
|
197
|
+
reason: options.routeToNeedsAttention.reason,
|
|
198
|
+
cwd,
|
|
199
|
+
arbiter,
|
|
200
|
+
env,
|
|
201
|
+
});
|
|
202
|
+
if (stuck.outcome === 'transitioned' || stuck.outcome === 'wrong-state') {
|
|
203
|
+
// `wrong-state` (already stuck) is a tolerated idempotent re-surface.
|
|
204
|
+
const message = `Routed the tasking of '${slug}' to needs-attention (per-item lock marked stuck).`;
|
|
205
|
+
note(message);
|
|
206
|
+
return { exitCode: 0, outcome: 'released', message };
|
|
207
|
+
}
|
|
208
|
+
if (stuck.outcome === 'not-held') {
|
|
209
|
+
const message = `'${slug}' is not locked for tasking — nothing to mark stuck.`;
|
|
210
|
+
note(message);
|
|
211
|
+
return { exitCode: 2, outcome: 'lost', message };
|
|
212
|
+
}
|
|
213
|
+
const message = `could not mark the per-item lock for '${slug}' stuck (${stuck.outcome}: ${stuck.message}).`;
|
|
214
|
+
note(message);
|
|
215
|
+
return { exitCode: 1, outcome: 'usage-error', message };
|
|
216
|
+
}
|
|
217
|
+
// NORMAL release: delete the lock ref (idempotent).
|
|
218
|
+
// MIGRATE: EMIT `spec:<slug>` (keyed to the `spec-<slug>` lock entry).
|
|
219
|
+
const released = await releaseItemLock({
|
|
220
|
+
item: `spec:${slug}`,
|
|
221
|
+
cwd,
|
|
222
|
+
arbiter,
|
|
223
|
+
env,
|
|
224
|
+
});
|
|
225
|
+
if (released.outcome === 'error') {
|
|
226
|
+
throw new TaskingLockUsageError(`failed to release the item lock for '${slug}': ${released.message}`);
|
|
227
|
+
}
|
|
228
|
+
const message = released.outcome === 'not-held'
|
|
229
|
+
? `'${slug}' was not locked for tasking (already released).`
|
|
230
|
+
: `RELEASED the tasking lock for '${slug}' on ${arbiter}.`;
|
|
231
|
+
note(message);
|
|
232
|
+
return { exitCode: 0, outcome: 'released', message };
|
|
233
|
+
}
|
|
234
|
+
// --- Shared helpers -------------------------------------------------------
|
|
235
|
+
/** Resolve the advisory locker: git user.name, else $USER/$USERNAME, else ''. */
|
|
236
|
+
async function resolveBy(cwd, env) {
|
|
237
|
+
const name = await gitSoft(['config', 'user.name'], cwd, env);
|
|
238
|
+
if (name.status === 0 && name.stdout.trim() !== '') {
|
|
239
|
+
return name.stdout.trim();
|
|
240
|
+
}
|
|
241
|
+
const e = env ?? process.env;
|
|
242
|
+
return e.USER ?? e.USERNAME ?? '';
|
|
243
|
+
}
|
|
244
|
+
/** Run git, returning the raw result (no throw) — for soft checks. */
|
|
245
|
+
function gitSoft(args, cwd, env) {
|
|
246
|
+
return runAsync('git', args, cwd, { env });
|
|
247
|
+
}
|
|
248
|
+
/** Run git; throw on non-zero (genuinely unexpected plumbing failures). */
|
|
249
|
+
async function gitHard(args, cwd, env) {
|
|
250
|
+
const result = await runAsync('git', args, cwd, { env });
|
|
251
|
+
if (result.status !== 0) {
|
|
252
|
+
throw new Error(`git ${args.join(' ')} failed (exit ${result.status}): ${result.stderr.trim()}`);
|
|
253
|
+
}
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=tasking-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasking-lock.js","sourceRoot":"","sources":["../src/tasking-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAiB,MAAM,UAAU,CAAC;AAClD,OAAO,EACN,eAAe,EACf,eAAe,EACf,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,MAAM,eAAe,GAAG,QAAQ,CAAC;AA+CjC,oDAAoD;AACpD,MAAM,qBAAsB,SAAQ,KAAK;CAAG;AAE5C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,OAAkC;IAElC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACxC,IAAI,CAAC;QACJ,OAAO,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,IAAI,GAAG,YAAY,qBAAqB,EAAE,CAAC;YAC1C,OAAO,EAAC,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAC,CAAC;QACpE,CAAC;QACD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