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,204 @@
|
|
|
1
|
+
import { type LedgerReadStrategy } from './ledger-read.js';
|
|
2
|
+
/**
|
|
3
|
+
* The **§3a slug-namespace resolver** (`docs/adr/command-surface-and-
|
|
4
|
+
* journeys.md` §3a). A spec and a task can share a slug (e.g. spec `auto-slice`),
|
|
5
|
+
* and `do` spans BOTH namespaces (build a task OR task a spec), so a bare slug
|
|
6
|
+
* is ambiguous. This module is the pure resolver that turns a CLI slug argument
|
|
7
|
+
* into a resolved target, plus the guard the TASK-ONLY commands use to reject a
|
|
8
|
+
* `spec:` argument.
|
|
9
|
+
*
|
|
10
|
+
* | input | resolves to | on collision (a task AND a spec share `<slug>`) |
|
|
11
|
+
* | ---------------- | --------------- | ----------------------------------------------- |
|
|
12
|
+
* | `<slug>` (bare) | the **task** | **ERROR** — "use task:<slug> or spec:<slug>" |
|
|
13
|
+
* | `task:<slug>` | the task | always unambiguous |
|
|
14
|
+
* | `spec:<slug>` | the spec | always unambiguous |
|
|
15
|
+
*
|
|
16
|
+
* The two load-bearing rules:
|
|
17
|
+
*
|
|
18
|
+
* - **Bare `<slug>` is human convenience ONLY.** It resolves to the task, but
|
|
19
|
+
* ONLY after a cheap cross-namespace existence check confirms NO spec shares
|
|
20
|
+
* the slug; on a collision it ERRORS loudly (it never silently guesses). CI /
|
|
21
|
+
* automation MUST use explicit prefixes (collision-proof across time).
|
|
22
|
+
* - **Task-only commands** (`claim`, `start`, `resume`, `complete`, `prompt`,
|
|
23
|
+
* `requeue`, `work-on`) accept bare (= task) + `task:` and **reject `spec:`**
|
|
24
|
+
* with a clear "operates on tasks, not specs" error.
|
|
25
|
+
*
|
|
26
|
+
* It is PURE: no git, no mutation, no side effects beyond the two cheap EXISTENCE
|
|
27
|
+
* reads (task through the existing read seam; spec through the seam's
|
|
28
|
+
* `resolveSpecExistence` spec reader — the single shared spec read path the later
|
|
29
|
+
* tasking / `do spec:` work reuses).
|
|
30
|
+
*
|
|
31
|
+
* This mirrors the field-level namespace split the contract already makes (task
|
|
32
|
+
* `blockedBy` resolves against tasks; spec `taskedAfter` against specs); the
|
|
33
|
+
* `task:`/`spec:` prefixes are the command-line form of that one rule.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* The namespaces a slug can name. `task`/`spec` are the §3a pair that `do` spans;
|
|
37
|
+
* `observation` is the NEW namespace the `advance` verb adds (spec `advance-loop`,
|
|
38
|
+
* task `advance-verb-resolver`) so `advance obs:<slug>` can name an observation to
|
|
39
|
+
* triage. The `do`-family resolvers (`resolveSlug`, `resolveTaskOnlyArg`)
|
|
40
|
+
* deliberately do NOT span `observation` — only the `advance` resolver does (see
|
|
41
|
+
* {@link resolveAdvanceArg}).
|
|
42
|
+
*
|
|
43
|
+
* HARD CUTOVER (spec `prd-to-spec-vocabulary-cutover-and-migration-command`,
|
|
44
|
+
* contract step): the legacy `'prd'` member is GONE — the parent-spec namespace
|
|
45
|
+
* is `'spec'` only. A `prd:<slug>` arg no longer parses to a namespace (it falls
|
|
46
|
+
* through to a bare literal slug), and a `work/prd-<slug>` branch ref no longer
|
|
47
|
+
* parses. No back-compat alias (the clean-break stance).
|
|
48
|
+
*/
|
|
49
|
+
export type SlugNamespace = 'task' | 'spec' | 'observation';
|
|
50
|
+
/**
|
|
51
|
+
* The PRODUCER axis (ORTHOGONAL to {@link SlugNamespace}): WHICH lifecycle
|
|
52
|
+
* created the branch, when that matters for collision isolation. `'intake'` is
|
|
53
|
+
* the only producer today — an `intake N` run that CREATES a brand-new backlog
|
|
54
|
+
* item (`work/backlog/<slug>.md`) or spec (`work/specs/<slug>.md`). Its branch is a
|
|
55
|
+
* short-lived "create the item" branch, a SEPARATE lifecycle from the later
|
|
56
|
+
* claim→build→complete of `do task:<slug>` — so it gets its own branch ref and
|
|
57
|
+
* never reuses (or is reused by) the build branch for the same slug. Absent for
|
|
58
|
+
* the build/tasking paths (the common case), which carry no producer prefix.
|
|
59
|
+
*/
|
|
60
|
+
export type BranchProducer = 'intake';
|
|
61
|
+
/**
|
|
62
|
+
* The **ONE** construction of the work-BRANCH ref from the namespaced identity.
|
|
63
|
+
* The branch ref is the last identity to join the `<type>-<slug>` scheme the
|
|
64
|
+
* advance sidecar filename (`work/questions/<type>-<slug>.md`) and the
|
|
65
|
+
* lock entry already use — so a spec `<slug>` and a task `<slug>`
|
|
66
|
+
* sharing a slug NEVER collide on the arbiter branch (the structural bug this
|
|
67
|
+
* fixes: `intake`, `do task:<slug>`, and `do spec:<slug>` all built on the SAME
|
|
68
|
+
* un-namespaced `work/<slug>` branch).
|
|
69
|
+
*
|
|
70
|
+
* Spelling: `work/<type>-<slug>` (i.e. `work/task-<slug>`, `work/spec-<slug>`),
|
|
71
|
+
* matching the lock-entry + sidecar-filename `<type>-<slug>` form EXACTLY. The
|
|
72
|
+
* optional {@link BranchProducer} prefixes it (`work/<producer>-<type>-<slug>`,
|
|
73
|
+
* e.g. `work/intake-task-<slug>`, `work/intake-spec-<slug>`) so a branch that
|
|
74
|
+
* CREATES an item (intake) never collides with the branch that later BUILDS the
|
|
75
|
+
* same-slug task. One consistent rule, not a second derivation. EVERY site
|
|
76
|
+
* that builds or reads a work-branch ref MUST call this (or
|
|
77
|
+
* {@link parseWorkBranchRef}); none may hand-build `work/${slug}`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function workBranchRef(namespace: SlugNamespace, slug: string, opts?: {
|
|
80
|
+
producer?: BranchProducer;
|
|
81
|
+
}): string;
|
|
82
|
+
/**
|
|
83
|
+
* The inverse of {@link workBranchRef}: parse a namespaced work-branch ref back
|
|
84
|
+
* into its `{producer?, namespace, slug}`. Returns `undefined` for any ref that
|
|
85
|
+
* is NOT a `work/[<producer>-]<type>-<slug>` branch (e.g. `main`, a detached
|
|
86
|
+
* HEAD, or — after the clean breaking cutover — a pre-rename `work/slice-<slug>`
|
|
87
|
+
* / `work/prd-<slug>` ref or an un-namespaced `work/<slug>`). This is how
|
|
88
|
+
* `complete`/`integration` recover the type carried IN the branch name they are
|
|
89
|
+
* already standing on, rather than re-deriving it inconsistently. The regex
|
|
90
|
+
* anchors the optional producer prefix BEFORE the type alternation, so
|
|
91
|
+
* `work/intake-task-foo` resolves to
|
|
92
|
+
* `{producer:'intake', namespace:'task', slug:'foo'}` (the `slug` never
|
|
93
|
+
* swallows the `intake-`/`task-` prefixes). The old `slice`/`brief`/`prd` types
|
|
94
|
+
* are NOT in the alternation, so a pre-rename `work/prd-foo` ref returns
|
|
95
|
+
* `undefined` (the clean-break stance: no migration-window alias).
|
|
96
|
+
*/
|
|
97
|
+
export declare function parseWorkBranchRef(branch: string): {
|
|
98
|
+
producer?: BranchProducer;
|
|
99
|
+
namespace: SlugNamespace;
|
|
100
|
+
slug: string;
|
|
101
|
+
} | undefined;
|
|
102
|
+
/** A slug argument's parsed namespace + bare slug (before any existence check). */
|
|
103
|
+
export interface ParsedSlugArg {
|
|
104
|
+
/**
|
|
105
|
+
* `'task'` / `'spec'` when an explicit prefix was given; `undefined` for a
|
|
106
|
+
* bare slug (the namespace is then resolved by the cross-namespace check).
|
|
107
|
+
*/
|
|
108
|
+
explicit: SlugNamespace | undefined;
|
|
109
|
+
/** The bare slug with any `task:`/`spec:` prefix stripped. */
|
|
110
|
+
slug: string;
|
|
111
|
+
}
|
|
112
|
+
/** A fully-resolved slug target: which namespace it names + the bare slug. */
|
|
113
|
+
export interface ResolvedSlug {
|
|
114
|
+
namespace: SlugNamespace;
|
|
115
|
+
slug: string;
|
|
116
|
+
/** Whether the caller wrote an explicit `task:`/`spec:` prefix. */
|
|
117
|
+
explicit: boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Raised when a slug argument cannot be resolved: an ambiguous bare slug
|
|
121
|
+
* (collision across namespaces), or a `spec:` argument handed to a task-only
|
|
122
|
+
* command. Carries a clear, human-resolvable message.
|
|
123
|
+
*/
|
|
124
|
+
export declare class SlugResolutionError extends Error {
|
|
125
|
+
constructor(message: string);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Split a raw CLI slug argument into its explicit namespace (if any) + the bare
|
|
129
|
+
* slug. PURE string work, no existence check: `task:foo` → explicit task,
|
|
130
|
+
* `spec:foo` → explicit spec, `foo` → bare (`explicit: undefined`). The prefix
|
|
131
|
+
* match is case-sensitive and exact (`task:`/`spec:`); a slug like `tasked` is
|
|
132
|
+
* NOT a prefix and stays bare. HARD CUTOVER: the legacy `prd:` prefix is not a
|
|
133
|
+
* namespace prefix anymore — `prd:foo` stays a bare literal slug.
|
|
134
|
+
*/
|
|
135
|
+
export declare function parseSlugArg(arg: string): ParsedSlugArg;
|
|
136
|
+
/** What the resolver needs to perform the existence checks. */
|
|
137
|
+
export interface ResolveSlugInput {
|
|
138
|
+
/** The raw CLI slug argument (bare, `task:<slug>`, or `spec:<slug>`). */
|
|
139
|
+
arg: string;
|
|
140
|
+
/** The repo working-tree root whose `work/` namespaces to read. */
|
|
141
|
+
repoPath: string;
|
|
142
|
+
/**
|
|
143
|
+
* The read seam to resolve existence through (task via `resolveLocalState`,
|
|
144
|
+
* spec via `resolveSpecExistence`). Defaults to the active {@link ledgerRead};
|
|
145
|
+
* injectable for tests.
|
|
146
|
+
*/
|
|
147
|
+
read?: LedgerReadStrategy;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Resolve a raw slug argument (`do`'s cross-namespace path) into its namespace +
|
|
151
|
+
* bare slug, per ADR §3a:
|
|
152
|
+
*
|
|
153
|
+
* - `task:<slug>` → `{namespace: 'task'}` — always unambiguous (no check).
|
|
154
|
+
* - `spec:<slug>` → `{namespace: 'spec'}` — always unambiguous (no check).
|
|
155
|
+
* - `<slug>` (bare) → the **task**, but ONLY after confirming no spec shares the
|
|
156
|
+
* slug. On a collision (both a task AND a spec named `<slug>` exist) it throws
|
|
157
|
+
* {@link SlugResolutionError} — loud, immediate, human-resolvable. It NEVER
|
|
158
|
+
* silently guesses.
|
|
159
|
+
*
|
|
160
|
+
* Explicit prefixes skip the existence check entirely (they are collision-proof
|
|
161
|
+
* by construction); only the bare path pays the cheap cross-namespace read.
|
|
162
|
+
*/
|
|
163
|
+
export declare function resolveSlug(input: ResolveSlugInput): ResolvedSlug;
|
|
164
|
+
/**
|
|
165
|
+
* Resolve a slug argument for the `advance` verb (prd `advance-loop`, task
|
|
166
|
+
* `advance-verb-resolver`). `advance` is the SIBLING top-level verb (NOT a `do`
|
|
167
|
+
* subcommand) that reuses this SAME shared `prefix:arg` resolver, EXTENDED with
|
|
168
|
+
* the `observation` namespace `do` does not span:
|
|
169
|
+
*
|
|
170
|
+
* - `task:<slug>` → `{namespace: 'task'}` — unambiguous (no check).
|
|
171
|
+
* - `spec:<slug>` → `{namespace: 'spec'}` — unambiguous (no check).
|
|
172
|
+
* - `obs:<slug>` /
|
|
173
|
+
* `observation:<slug>` → `{namespace: 'observation'}` — unambiguous (no check).
|
|
174
|
+
* - `<slug>` (bare) → the **task**, but ONLY after the SAME cheap
|
|
175
|
+
* cross-namespace check `do` makes (no spec shares the slug); on a task/spec
|
|
176
|
+
* collision it throws {@link SlugResolutionError}, never silently guessing.
|
|
177
|
+
*
|
|
178
|
+
* The bare-slug cross-check is intentionally IDENTICAL to {@link resolveSlug}'s
|
|
179
|
+
* (bare = task, error on a task/spec collision) — the "bare slug = task"
|
|
180
|
+
* ergonomic is preserved exactly as `do` has it. An observation is NEVER reached
|
|
181
|
+
* by a bare slug; it must be named explicitly (`obs:<slug>`), because the bare
|
|
182
|
+
* path stays the task/spec two-namespace check (an observation sharing a slug
|
|
183
|
+
* does not make a bare slug ambiguous — a human typing a bare slug means the
|
|
184
|
+
* task, as everywhere else).
|
|
185
|
+
*/
|
|
186
|
+
export declare function resolveAdvanceArg(input: ResolveSlugInput): ResolvedSlug;
|
|
187
|
+
/**
|
|
188
|
+
* Resolve a slug argument for a TASK-ONLY command (`claim`, `start`, `resume`,
|
|
189
|
+
* `complete`, `prompt`, `requeue`, `work-on`). These operate on tasks, not specs,
|
|
190
|
+
* so:
|
|
191
|
+
*
|
|
192
|
+
* - `spec:<slug>` is REJECTED with a clear "operates on tasks, not specs" error.
|
|
193
|
+
* - `task:<slug>` is accepted (the explicit alias) → the bare slug.
|
|
194
|
+
* - `<slug>` (bare) is accepted (= the task). A task-only command does NOT
|
|
195
|
+
* need the cross-namespace collision check: a bare slug here ALWAYS means the
|
|
196
|
+
* task (there is no spec ambiguity, because the spec namespace is rejected
|
|
197
|
+
* outright), so it resolves straight to the task slug.
|
|
198
|
+
*
|
|
199
|
+
* Returns the bare task slug to feed the existing task machinery (claim CAS,
|
|
200
|
+
* start, …). PURE: it touches no files (no existence read needed — `spec:` is
|
|
201
|
+
* rejected on the prefix alone, bare/`task:` resolve to the task slug).
|
|
202
|
+
*/
|
|
203
|
+
export declare function resolveTaskOnlyArg(arg: string): string;
|
|
204
|
+
//# sourceMappingURL=slug-namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slug-namespace.d.ts","sourceRoot":"","sources":["../src/slug-namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAC5B,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;IAAC,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAC,GAChC,MAAM,CAKR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,MAAM,GAEZ;IAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GACnE,SAAS,CAmBX;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;CACb;AAED,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC5B,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC;CAClB;AAmBD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI3B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAiBvD;AAED,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAChC,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC1B;AA0BD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CA4BjE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAkBvE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBtD"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { ledgerRead } from './ledger-read.js';
|
|
2
|
+
/**
|
|
3
|
+
* The **ONE** construction of the work-BRANCH ref from the namespaced identity.
|
|
4
|
+
* The branch ref is the last identity to join the `<type>-<slug>` scheme the
|
|
5
|
+
* advance sidecar filename (`work/questions/<type>-<slug>.md`) and the
|
|
6
|
+
* lock entry already use — so a spec `<slug>` and a task `<slug>`
|
|
7
|
+
* sharing a slug NEVER collide on the arbiter branch (the structural bug this
|
|
8
|
+
* fixes: `intake`, `do task:<slug>`, and `do spec:<slug>` all built on the SAME
|
|
9
|
+
* un-namespaced `work/<slug>` branch).
|
|
10
|
+
*
|
|
11
|
+
* Spelling: `work/<type>-<slug>` (i.e. `work/task-<slug>`, `work/spec-<slug>`),
|
|
12
|
+
* matching the lock-entry + sidecar-filename `<type>-<slug>` form EXACTLY. The
|
|
13
|
+
* optional {@link BranchProducer} prefixes it (`work/<producer>-<type>-<slug>`,
|
|
14
|
+
* e.g. `work/intake-task-<slug>`, `work/intake-spec-<slug>`) so a branch that
|
|
15
|
+
* CREATES an item (intake) never collides with the branch that later BUILDS the
|
|
16
|
+
* same-slug task. One consistent rule, not a second derivation. EVERY site
|
|
17
|
+
* that builds or reads a work-branch ref MUST call this (or
|
|
18
|
+
* {@link parseWorkBranchRef}); none may hand-build `work/${slug}`.
|
|
19
|
+
*/
|
|
20
|
+
export function workBranchRef(namespace, slug, opts) {
|
|
21
|
+
const producer = opts?.producer;
|
|
22
|
+
return producer === undefined
|
|
23
|
+
? `work/${namespace}-${slug}`
|
|
24
|
+
: `work/${producer}-${namespace}-${slug}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The inverse of {@link workBranchRef}: parse a namespaced work-branch ref back
|
|
28
|
+
* into its `{producer?, namespace, slug}`. Returns `undefined` for any ref that
|
|
29
|
+
* is NOT a `work/[<producer>-]<type>-<slug>` branch (e.g. `main`, a detached
|
|
30
|
+
* HEAD, or — after the clean breaking cutover — a pre-rename `work/slice-<slug>`
|
|
31
|
+
* / `work/prd-<slug>` ref or an un-namespaced `work/<slug>`). This is how
|
|
32
|
+
* `complete`/`integration` recover the type carried IN the branch name they are
|
|
33
|
+
* already standing on, rather than re-deriving it inconsistently. The regex
|
|
34
|
+
* anchors the optional producer prefix BEFORE the type alternation, so
|
|
35
|
+
* `work/intake-task-foo` resolves to
|
|
36
|
+
* `{producer:'intake', namespace:'task', slug:'foo'}` (the `slug` never
|
|
37
|
+
* swallows the `intake-`/`task-` prefixes). The old `slice`/`brief`/`prd` types
|
|
38
|
+
* are NOT in the alternation, so a pre-rename `work/prd-foo` ref returns
|
|
39
|
+
* `undefined` (the clean-break stance: no migration-window alias).
|
|
40
|
+
*/
|
|
41
|
+
export function parseWorkBranchRef(branch) {
|
|
42
|
+
// HARD CUTOVER (spec `prd-to-spec-vocabulary-cutover-and-migration-command`,
|
|
43
|
+
// contract step): the type alternation is `task|spec` ONLY — the legacy `prd`
|
|
44
|
+
// token is GONE, so a pre-rename `work/prd-<slug>` ref returns `undefined` (no
|
|
45
|
+
// migration-window alias; the clean-break stance).
|
|
46
|
+
const match = /^work\/(?:(intake)-)?(task|spec)-(.+)$/.exec(branch);
|
|
47
|
+
if (!match) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const producer = match[1];
|
|
51
|
+
const result = { namespace: match[2], slug: match[3] };
|
|
52
|
+
if (producer !== undefined) {
|
|
53
|
+
result.producer = producer;
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
/** The explicit-prefix forms the resolver understands. */
|
|
58
|
+
const TASK_PREFIX = 'task:';
|
|
59
|
+
/**
|
|
60
|
+
* The parent-spec namespace prefix: `spec:<slug>` → `{explicit: 'spec'}`. HARD
|
|
61
|
+
* CUTOVER (spec `prd-to-spec-vocabulary-cutover-and-migration-command`): the
|
|
62
|
+
* legacy `prd:` prefix is GONE — a `prd:<slug>` arg falls through to a bare
|
|
63
|
+
* literal slug (no namespace), the clean-break stance.
|
|
64
|
+
*/
|
|
65
|
+
const SPEC_PREFIX = 'spec:';
|
|
66
|
+
/**
|
|
67
|
+
* The observation namespace's prefixes: the short `obs:` CLI alias and the
|
|
68
|
+
* canonical `observation:` long form both parse to the `observation` namespace.
|
|
69
|
+
* Only the `advance` resolver acts on this namespace; `do` rejects it.
|
|
70
|
+
*/
|
|
71
|
+
const OBS_PREFIX = 'obs:';
|
|
72
|
+
const OBSERVATION_PREFIX = 'observation:';
|
|
73
|
+
/**
|
|
74
|
+
* Raised when a slug argument cannot be resolved: an ambiguous bare slug
|
|
75
|
+
* (collision across namespaces), or a `spec:` argument handed to a task-only
|
|
76
|
+
* command. Carries a clear, human-resolvable message.
|
|
77
|
+
*/
|
|
78
|
+
export class SlugResolutionError extends Error {
|
|
79
|
+
constructor(message) {
|
|
80
|
+
super(message);
|
|
81
|
+
this.name = 'SlugResolutionError';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Split a raw CLI slug argument into its explicit namespace (if any) + the bare
|
|
86
|
+
* slug. PURE string work, no existence check: `task:foo` → explicit task,
|
|
87
|
+
* `spec:foo` → explicit spec, `foo` → bare (`explicit: undefined`). The prefix
|
|
88
|
+
* match is case-sensitive and exact (`task:`/`spec:`); a slug like `tasked` is
|
|
89
|
+
* NOT a prefix and stays bare. HARD CUTOVER: the legacy `prd:` prefix is not a
|
|
90
|
+
* namespace prefix anymore — `prd:foo` stays a bare literal slug.
|
|
91
|
+
*/
|
|
92
|
+
export function parseSlugArg(arg) {
|
|
93
|
+
if (arg.startsWith(TASK_PREFIX)) {
|
|
94
|
+
return { explicit: 'task', slug: arg.slice(TASK_PREFIX.length) };
|
|
95
|
+
}
|
|
96
|
+
if (arg.startsWith(SPEC_PREFIX)) {
|
|
97
|
+
return { explicit: 'spec', slug: arg.slice(SPEC_PREFIX.length) };
|
|
98
|
+
}
|
|
99
|
+
if (arg.startsWith(OBSERVATION_PREFIX)) {
|
|
100
|
+
return {
|
|
101
|
+
explicit: 'observation',
|
|
102
|
+
slug: arg.slice(OBSERVATION_PREFIX.length),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (arg.startsWith(OBS_PREFIX)) {
|
|
106
|
+
return { explicit: 'observation', slug: arg.slice(OBS_PREFIX.length) };
|
|
107
|
+
}
|
|
108
|
+
return { explicit: undefined, slug: arg };
|
|
109
|
+
}
|
|
110
|
+
/** Does a TASK named `slug` exist (backlog or in-progress) in this repo? */
|
|
111
|
+
function taskExists(read, repoPath, slug) {
|
|
112
|
+
// The task side resolves THROUGH the existing read seam — its local-tree
|
|
113
|
+
// method already parses the task-pool slugs (frontmatter, falling back
|
|
114
|
+
// to filename). An in-progress task is ALSO a task (a claimed one); the
|
|
115
|
+
// local state's backlog covers the up-for-grabs case, which is what a bare
|
|
116
|
+
// `<slug>` collision check needs.
|
|
117
|
+
const state = read.resolveLocalState({ repoPath });
|
|
118
|
+
return state.ready.some((item) => item.slug === slug);
|
|
119
|
+
}
|
|
120
|
+
/** Does a spec named `slug` exist (ready or being tasked) in this repo? */
|
|
121
|
+
function specExists(read, repoPath, slug) {
|
|
122
|
+
return read.resolveSpecExistence({ repoPath, slug }).exists;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Resolve a raw slug argument (`do`'s cross-namespace path) into its namespace +
|
|
126
|
+
* bare slug, per ADR §3a:
|
|
127
|
+
*
|
|
128
|
+
* - `task:<slug>` → `{namespace: 'task'}` — always unambiguous (no check).
|
|
129
|
+
* - `spec:<slug>` → `{namespace: 'spec'}` — always unambiguous (no check).
|
|
130
|
+
* - `<slug>` (bare) → the **task**, but ONLY after confirming no spec shares the
|
|
131
|
+
* slug. On a collision (both a task AND a spec named `<slug>` exist) it throws
|
|
132
|
+
* {@link SlugResolutionError} — loud, immediate, human-resolvable. It NEVER
|
|
133
|
+
* silently guesses.
|
|
134
|
+
*
|
|
135
|
+
* Explicit prefixes skip the existence check entirely (they are collision-proof
|
|
136
|
+
* by construction); only the bare path pays the cheap cross-namespace read.
|
|
137
|
+
*/
|
|
138
|
+
export function resolveSlug(input) {
|
|
139
|
+
const read = input.read ?? ledgerRead;
|
|
140
|
+
const parsed = parseSlugArg(input.arg);
|
|
141
|
+
if (parsed.explicit === 'observation') {
|
|
142
|
+
// `do` spans the task/prd namespaces ONLY (build a task OR task a prd).
|
|
143
|
+
// The `observation` namespace is `advance`'s alone (triage). Reject it here
|
|
144
|
+
// rather than let a `do obs:<slug>` resolve into a namespace `do` cannot act
|
|
145
|
+
// on — point the human at the verb that owns it.
|
|
146
|
+
throw new SlugResolutionError(`'${input.arg}' names an observation, which \`do\` does not act on. ` +
|
|
147
|
+
`Use \`advance obs:${parsed.slug}\` to triage it.`);
|
|
148
|
+
}
|
|
149
|
+
if (parsed.explicit !== undefined) {
|
|
150
|
+
// Explicit prefix: unambiguous by construction. No existence check.
|
|
151
|
+
return { namespace: parsed.explicit, slug: parsed.slug, explicit: true };
|
|
152
|
+
}
|
|
153
|
+
// Bare slug: resolve to the task, but ONLY after the cross-namespace check.
|
|
154
|
+
// A task/spec collision is a loud ERROR — never a silent guess.
|
|
155
|
+
if (specExists(read, input.repoPath, parsed.slug)) {
|
|
156
|
+
throw new SlugResolutionError(`'${parsed.slug}' is ambiguous: both a task and a spec share that slug. ` +
|
|
157
|
+
`Use \`task:${parsed.slug}\` or \`spec:${parsed.slug}\` to disambiguate.`);
|
|
158
|
+
}
|
|
159
|
+
return { namespace: 'task', slug: parsed.slug, explicit: false };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Resolve a slug argument for the `advance` verb (prd `advance-loop`, task
|
|
163
|
+
* `advance-verb-resolver`). `advance` is the SIBLING top-level verb (NOT a `do`
|
|
164
|
+
* subcommand) that reuses this SAME shared `prefix:arg` resolver, EXTENDED with
|
|
165
|
+
* the `observation` namespace `do` does not span:
|
|
166
|
+
*
|
|
167
|
+
* - `task:<slug>` → `{namespace: 'task'}` — unambiguous (no check).
|
|
168
|
+
* - `spec:<slug>` → `{namespace: 'spec'}` — unambiguous (no check).
|
|
169
|
+
* - `obs:<slug>` /
|
|
170
|
+
* `observation:<slug>` → `{namespace: 'observation'}` — unambiguous (no check).
|
|
171
|
+
* - `<slug>` (bare) → the **task**, but ONLY after the SAME cheap
|
|
172
|
+
* cross-namespace check `do` makes (no spec shares the slug); on a task/spec
|
|
173
|
+
* collision it throws {@link SlugResolutionError}, never silently guessing.
|
|
174
|
+
*
|
|
175
|
+
* The bare-slug cross-check is intentionally IDENTICAL to {@link resolveSlug}'s
|
|
176
|
+
* (bare = task, error on a task/spec collision) — the "bare slug = task"
|
|
177
|
+
* ergonomic is preserved exactly as `do` has it. An observation is NEVER reached
|
|
178
|
+
* by a bare slug; it must be named explicitly (`obs:<slug>`), because the bare
|
|
179
|
+
* path stays the task/spec two-namespace check (an observation sharing a slug
|
|
180
|
+
* does not make a bare slug ambiguous — a human typing a bare slug means the
|
|
181
|
+
* task, as everywhere else).
|
|
182
|
+
*/
|
|
183
|
+
export function resolveAdvanceArg(input) {
|
|
184
|
+
const read = input.read ?? ledgerRead;
|
|
185
|
+
const parsed = parseSlugArg(input.arg);
|
|
186
|
+
if (parsed.explicit !== undefined) {
|
|
187
|
+
// Explicit prefix (task / spec / observation): unambiguous by construction.
|
|
188
|
+
return { namespace: parsed.explicit, slug: parsed.slug, explicit: true };
|
|
189
|
+
}
|
|
190
|
+
// Bare slug: the SAME task/spec cross-namespace check `do` makes — bare = task,
|
|
191
|
+
// a task/spec collision is a loud ERROR, never a silent guess.
|
|
192
|
+
if (specExists(read, input.repoPath, parsed.slug)) {
|
|
193
|
+
throw new SlugResolutionError(`'${parsed.slug}' is ambiguous: both a task and a spec share that slug. ` +
|
|
194
|
+
`Use \`task:${parsed.slug}\` or \`spec:${parsed.slug}\` to disambiguate.`);
|
|
195
|
+
}
|
|
196
|
+
return { namespace: 'task', slug: parsed.slug, explicit: false };
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Resolve a slug argument for a TASK-ONLY command (`claim`, `start`, `resume`,
|
|
200
|
+
* `complete`, `prompt`, `requeue`, `work-on`). These operate on tasks, not specs,
|
|
201
|
+
* so:
|
|
202
|
+
*
|
|
203
|
+
* - `spec:<slug>` is REJECTED with a clear "operates on tasks, not specs" error.
|
|
204
|
+
* - `task:<slug>` is accepted (the explicit alias) → the bare slug.
|
|
205
|
+
* - `<slug>` (bare) is accepted (= the task). A task-only command does NOT
|
|
206
|
+
* need the cross-namespace collision check: a bare slug here ALWAYS means the
|
|
207
|
+
* task (there is no spec ambiguity, because the spec namespace is rejected
|
|
208
|
+
* outright), so it resolves straight to the task slug.
|
|
209
|
+
*
|
|
210
|
+
* Returns the bare task slug to feed the existing task machinery (claim CAS,
|
|
211
|
+
* start, …). PURE: it touches no files (no existence read needed — `spec:` is
|
|
212
|
+
* rejected on the prefix alone, bare/`task:` resolve to the task slug).
|
|
213
|
+
*/
|
|
214
|
+
export function resolveTaskOnlyArg(arg) {
|
|
215
|
+
const parsed = parseSlugArg(arg);
|
|
216
|
+
if (parsed.explicit === 'spec') {
|
|
217
|
+
throw new SlugResolutionError(`this command operates on tasks, not specs — '${arg}' names a spec. ` +
|
|
218
|
+
`Drop the \`spec:\` prefix to act on the task, or use \`do ${arg}\` ` +
|
|
219
|
+
`to task the spec.`);
|
|
220
|
+
}
|
|
221
|
+
if (parsed.explicit === 'observation') {
|
|
222
|
+
throw new SlugResolutionError(`this command operates on tasks, not observations — '${arg}' names an ` +
|
|
223
|
+
`observation. Use \`advance obs:${parsed.slug}\` to triage it.`);
|
|
224
|
+
}
|
|
225
|
+
// Bare or `task:` → the task slug. (A bare slug on a task-only command is
|
|
226
|
+
// unambiguously the task; the prd namespace is unreachable here.)
|
|
227
|
+
return parsed.slug;
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=slug-namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slug-namespace.js","sourceRoot":"","sources":["../src/slug-namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AAgErE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,aAAa,CAC5B,SAAwB,EACxB,IAAY,EACZ,IAAkC;IAElC,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,CAAC;IAChC,OAAO,QAAQ,KAAK,SAAS;QAC5B,CAAC,CAAC,QAAQ,SAAS,IAAI,IAAI,EAAE;QAC7B,CAAC,CAAC,QAAQ,QAAQ,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAAc;IAId,6EAA6E;IAC7E,8EAA8E;IAC9E,+EAA+E;IAC/E,mDAAmD;IACnD,MA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,gFAAgF;IAChF,+DAA+D;IAC/D,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,mBAAmB,CAC5B,IAAI,MAAM,CAAC,IAAI,0DAA0D;YACxE,cAAc,MAAM,CAAC,IAAI,gBAAgB,MAAM,CAAC,IAAI,qBAAqB,CAC1E,CAAC;IACH,CAAC;IACD,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC7C,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAChC,MAAM,IAAI,mBAAmB,CAC5B,gDAAgD,GAAG,kBAAkB;YACpE,6DAA6D,GAAG,KAAK;YACrE,mBAAmB,CACpB,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QACvC,MAAM,IAAI,mBAAmB,CAC5B,uDAAuD,GAAG,aAAa;YACtE,kCAAkC,MAAM,CAAC,IAAI,kBAAkB,CAChE,CAAC;IACH,CAAC;IACD,0EAA0E;IAC1E,kEAAkE;IAClE,OAAO,MAAM,CAAC,IAAI,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type TaskLifecycleFolder } from './work-layout.js';
|
|
2
|
+
/** Where a task resides — the folder name under `work/`. */
|
|
3
|
+
type TaskFolder = TaskLifecycleFolder;
|
|
4
|
+
/** What the query needs: which repo's `work/` tree to scan + which spec slug. */
|
|
5
|
+
export interface SpecCompleteInput {
|
|
6
|
+
/** The repo working-tree root whose `work/` task folders to scan. */
|
|
7
|
+
repoPath: string;
|
|
8
|
+
/** The spec slug to check (matched against each task's frontmatter `spec:`). */
|
|
9
|
+
slug: string;
|
|
10
|
+
}
|
|
11
|
+
/** One task carrying `spec:<slug>`, with the folder it resides in. */
|
|
12
|
+
export interface SpecTask {
|
|
13
|
+
/** Filename within `work/<folder>/` (e.g. `add-quiet-flag.md`). */
|
|
14
|
+
file: string;
|
|
15
|
+
/** The task's resolved slug (frontmatter `slug:`, falling back to filename). */
|
|
16
|
+
slug: string;
|
|
17
|
+
/** Which task folder it resides in. */
|
|
18
|
+
folder: TaskFolder;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The result of the "is this spec complete?" query. {@link complete} is the
|
|
22
|
+
* load-bearing verdict; {@link tasks} surfaces the matched set (with residence)
|
|
23
|
+
* so a caller can explain the verdict if it wants to.
|
|
24
|
+
*/
|
|
25
|
+
export interface SpecCompleteResult {
|
|
26
|
+
/**
|
|
27
|
+
* `true` iff ≥1 task carries `spec:<slug>` AND every such task resides in
|
|
28
|
+
* `work/done/`. `false` when no task carries the slug (≥1 is REQUIRED) OR when
|
|
29
|
+
* any matching task is still outside `work/done/`.
|
|
30
|
+
*/
|
|
31
|
+
complete: boolean;
|
|
32
|
+
/** Every task carrying `spec:<slug>`, across all task folders, sorted by slug. */
|
|
33
|
+
tasks: SpecTask[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Is this spec COMPLETE? Read-only: scan the task lifecycle folders, parse each
|
|
37
|
+
* task's `spec:` via {@link parseFrontmatter}, keep those whose `spec:` equals
|
|
38
|
+
* `slug`, and return COMPLETE iff that set is NON-EMPTY and EVERY member resides in
|
|
39
|
+
* `work/done/`. Touches no git, no network, no mutation — a pure `work/`-folder
|
|
40
|
+
* residence scan keyed on the parsed `spec:` field.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isSpecComplete(input: SpecCompleteInput): SpecCompleteResult;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=spec-complete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-complete.d.ts","sourceRoot":"","sources":["../src/spec-complete.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,mBAAmB,EAIxB,MAAM,kBAAkB,CAAC;AA4B1B,4DAA4D;AAC5D,KAAK,UAAU,GAAG,mBAAmB,CAAC;AAEtC,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IACjC,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;CACb;AAED,sEAAsE;AACtE,MAAM,WAAW,QAAQ;IACxB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,MAAM,EAAE,UAAU,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,kFAAkF;IAClF,KAAK,EAAE,QAAQ,EAAE,CAAC;CAClB;AAcD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAwB3E"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
import { parseFrontmatter } from './frontmatter.js';
|
|
4
|
+
import { TASK_LIFECYCLE_FOLDERS, workFolderPath, workItemRel, isWorkItemFile, } from './work-layout.js';
|
|
5
|
+
/**
|
|
6
|
+
* The read-only **"is this spec complete?"** core query (prd `issue-intake`, US #8 —
|
|
7
|
+
* the closure-linkage half). Given a spec slug + a `work/` tree, a spec is COMPLETE
|
|
8
|
+
* iff there is **≥1 task carrying `spec:<slug>`** AND **all such tasks reside in
|
|
9
|
+
* `work/done/`**. Pure `work/`-folder logic — no seam, no git, no `gh`, no mutation.
|
|
10
|
+
*
|
|
11
|
+
* This is the LINKAGE the intake engine emits for CI to ACT on: a spec fans out to N
|
|
12
|
+
* tasks = N PRs whose tasks carry `spec:` ONLY (no `Refs #N` keyword is emitted),
|
|
13
|
+
* and the issue is closed by CI's merge-to-main JOB that runs THIS query +
|
|
14
|
+
* `closeIssue`. That close JOB is `runner-in-ci`'s — NOT
|
|
15
|
+
* built here; this module exposes ONLY the query for the job to call. The issue
|
|
16
|
+
* number lives ONLY on the spec (`issue:`); tasks link via `task.spec: → spec`, so
|
|
17
|
+
* this query keys on the SAME `spec:` field that hop uses.
|
|
18
|
+
*
|
|
19
|
+
* It is a `work/`-FOLDER RESIDENCE scan keyed on the parsed `spec:` field — NOT the
|
|
20
|
+
* claim ledger (`ledger-read.ts` resolves claim-STATE, a different concern). It
|
|
21
|
+
* reuses {@link parseFrontmatter} (the `spec:` field) rather than hand-rolling a YAML
|
|
22
|
+
* parse, and scans the task lifecycle folders directly: `work/tasks/ready/`,
|
|
23
|
+
* `work/in-progress/`, `work/needs-attention/`, and `work/done/`. A task that has
|
|
24
|
+
* NOT yet landed in `work/done/` (still in backlog / in-progress / needs-attention)
|
|
25
|
+
* means the spec is not yet complete.
|
|
26
|
+
*/
|
|
27
|
+
/** The task lifecycle folders a `prd:<slug>` task can reside in. */
|
|
28
|
+
const TASK_FOLDERS = TASK_LIFECYCLE_FOLDERS;
|
|
29
|
+
/** List the `.md` filenames in `<repoPath>/work/<folder>/`, sorted; `[]` if absent. */
|
|
30
|
+
function listMarkdown(repoPath, folder) {
|
|
31
|
+
const dir = workFolderPath(repoPath, folder);
|
|
32
|
+
let entries;
|
|
33
|
+
try {
|
|
34
|
+
entries = readdirSync(dir);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
return entries.filter((name) => isWorkItemFile(name)).sort();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Is this spec COMPLETE? Read-only: scan the task lifecycle folders, parse each
|
|
43
|
+
* task's `spec:` via {@link parseFrontmatter}, keep those whose `spec:` equals
|
|
44
|
+
* `slug`, and return COMPLETE iff that set is NON-EMPTY and EVERY member resides in
|
|
45
|
+
* `work/done/`. Touches no git, no network, no mutation — a pure `work/`-folder
|
|
46
|
+
* residence scan keyed on the parsed `spec:` field.
|
|
47
|
+
*/
|
|
48
|
+
export function isSpecComplete(input) {
|
|
49
|
+
const { repoPath, slug } = input;
|
|
50
|
+
const tasks = [];
|
|
51
|
+
for (const folder of TASK_FOLDERS) {
|
|
52
|
+
for (const file of listMarkdown(repoPath, folder)) {
|
|
53
|
+
const content = readFileSync(join(repoPath, workItemRel(folder, file)), 'utf8');
|
|
54
|
+
const fm = parseFrontmatter(content);
|
|
55
|
+
if (fm.spec === slug) {
|
|
56
|
+
tasks.push({
|
|
57
|
+
file,
|
|
58
|
+
slug: fm.slug ?? basename(file, '.md'),
|
|
59
|
+
folder,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
tasks.sort((a, b) => a.slug.localeCompare(b.slug));
|
|
65
|
+
// COMPLETE iff ≥1 such task AND every one of them is in `work/done/`.
|
|
66
|
+
const complete = tasks.length > 0 && tasks.every((s) => s.folder === 'done');
|
|
67
|
+
return { complete, tasks };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=spec-complete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-complete.js","sourceRoot":"","sources":["../src/spec-complete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACN,sBAAsB,EAEtB,cAAc,EACd,WAAW,EACX,cAAc,GACd,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;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