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,387 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { run } from './git.js';
|
|
4
|
+
import { workItemRel } from './work-layout.js';
|
|
5
|
+
import { createItemThroughCas, } from './advancing-lock.js';
|
|
6
|
+
import { resolveSidecarIdentity, sidecarPathFor } from './sidecar.js';
|
|
7
|
+
import { renderTaskBody, renderSpecBody } from './buildable-body.js';
|
|
8
|
+
/**
|
|
9
|
+
* The engine-owned TRIAGE PERSIST (prd `advance-loop`, task `advance-rung-triage`,
|
|
10
|
+
* US #16/17/24/30) — the half of the observation-triage rung the ENGINE owns (the
|
|
11
|
+
* triage gate JUDGES, the engine ACTS). It is the SIBLING of `surface-persist.ts`
|
|
12
|
+
* (the surface rung's persist) and `apply-persist.ts` (the apply rung's persist),
|
|
13
|
+
* kept file-orthogonal so the rung bodies land in different tasks.
|
|
14
|
+
*
|
|
15
|
+
* It delivers the two WRITES the triage rung needs beyond the always-allowed
|
|
16
|
+
* question-gated surface path (which reuses `surface-persist.ts` verbatim):
|
|
17
|
+
*
|
|
18
|
+
* 1. **the conservative auto-disposition** ({@link autoDispositionObservation},
|
|
19
|
+
* US #17, `observationTriage: 'auto'`-gated): act on the no-question case on
|
|
20
|
+
* the UNTRIAGED observation in ONE local commit. BOTH no-question cases now
|
|
21
|
+
* DISCHARGE the redundant note BY DELETION (there is no resting `triaged:keep`
|
|
22
|
+
* state any more — task `agentic-apply-retire-disposition-vocabulary`):
|
|
23
|
+
* - `duplicate` → `git rm` the duplicate in a standalone commit, the
|
|
24
|
+
* duplicated-of identity + reason in the commit message (git history =
|
|
25
|
+
* archive). A duplicate is a redundant copy of an already-captured signal,
|
|
26
|
+
* so deleting it loses nothing; or
|
|
27
|
+
* - `map` → the note is already covered by the existing item it maps onto, so
|
|
28
|
+
* it is settled — `git rm` it in a standalone commit, the mapped-onto
|
|
29
|
+
* identity + reason recorded in the commit message (mirroring `duplicate`).
|
|
30
|
+
* There is no resting `triaged:keep` note any more.
|
|
31
|
+
* 2. **promote → SELF-CONTAINED new-item creation + DELETE through the CAS**
|
|
32
|
+
* ({@link promoteObservation}, US #1/#3/#8): an ANSWERED "promote" drafts a
|
|
33
|
+
* new `work/tasks/ready/<new-slug>.md` whose body is built FROM the
|
|
34
|
+
* observation (mechanism + fix prose into `## What to build`, the
|
|
35
|
+
* `## Open questions` scoping transcribed, `needsAnswers` set when questions
|
|
36
|
+
* remain), routed THROUGH the CAS keyed on the NEW item's identity (its
|
|
37
|
+
* target path) — so the (unlikely) same-slug new-item race needs NO special
|
|
38
|
+
* case (the loser fails the CAS and backs off). On a WIN the observation +
|
|
39
|
+
* its answered sidecar are `git rm`-ed IN THE SAME atomic create commit
|
|
40
|
+
* (discharge by DELETION; the human's ratified "promote" answer authors it),
|
|
41
|
+
* so a crash never strands the note without its successor.
|
|
42
|
+
*
|
|
43
|
+
* Like its sibling persists, the auto-disposition is a LOCAL one-commit primitive
|
|
44
|
+
* over a working tree (the throwaway-git-repo test pattern); the CAS-create (now
|
|
45
|
+
* carrying the note+sidecar deletion in the SAME commit) is the ONLY arbiter race
|
|
46
|
+
* (it IS the new-item-creation CAS helper from `advancing-lock-borrow`). The
|
|
47
|
+
* `advancing` CAS lock that makes the triage rung WINNER-ONLY on the OBSERVATION
|
|
48
|
+
* is held by `performAdvance` BEFORE this is called.
|
|
49
|
+
*
|
|
50
|
+
* **NEVER auto-deletes a NON-duplicate signal; NEVER auto-promotes a judgement
|
|
51
|
+
* call (US #17).** The auto-disposition is bounded to `duplicate`/`map` (the gate's
|
|
52
|
+
* high bar). A `duplicate` IS discharged by deletion (it is a redundant copy of an
|
|
53
|
+
* already-captured signal — deleting it loses nothing, the original carries the
|
|
54
|
+
* signal), which is NOT "auto-deleting a live signal". Promotion is ALWAYS a human
|
|
55
|
+
* answer (the apply path), never an auto-disposition.
|
|
56
|
+
*/
|
|
57
|
+
function gitSoft(args, cwd, env) {
|
|
58
|
+
return run('git', args, cwd, { env });
|
|
59
|
+
}
|
|
60
|
+
function gitHard(args, cwd, env) {
|
|
61
|
+
const result = run('git', args, cwd, { env });
|
|
62
|
+
if (result.status !== 0) {
|
|
63
|
+
throw new TriagePersistError(`git ${args.join(' ')} failed (exit ${result.status}): ${result.stderr.trim()}`);
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
function resolveBy(cwd, env) {
|
|
68
|
+
const name = gitSoft(['config', 'user.name'], cwd, env);
|
|
69
|
+
if (name.status === 0 && name.stdout.trim() !== '') {
|
|
70
|
+
return name.stdout.trim();
|
|
71
|
+
}
|
|
72
|
+
const e = env ?? process.env;
|
|
73
|
+
return e.USER ?? e.USERNAME ?? '';
|
|
74
|
+
}
|
|
75
|
+
/** Read the observation body from the tree (committed) then the working file. */
|
|
76
|
+
function readItem(cwd, itemPath, env) {
|
|
77
|
+
const show = gitSoft(['show', `:${itemPath}`], cwd, env);
|
|
78
|
+
if (show.status === 0) {
|
|
79
|
+
return show.stdout;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
return readFileSync(join(cwd, itemPath), 'utf8');
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
throw new TriagePersistError(`cannot read observation body for '${itemPath}' (the triage rung needs the item file)`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Raised for usage errors (a missing repo, an unreadable observation). */
|
|
89
|
+
export class TriagePersistError extends Error {
|
|
90
|
+
constructor(message) {
|
|
91
|
+
super(message);
|
|
92
|
+
this.name = 'TriagePersistError';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Execute a CONSERVATIVE auto-disposition on an UNTRIAGED observation (US #17),
|
|
97
|
+
* ONE local commit, no question surfaced. BOTH no-question cases DISCHARGE the
|
|
98
|
+
* redundant note BY DELETION (`git rm` in a STANDALONE commit, the mapped/
|
|
99
|
+
* duplicated-of identity + reason in the commit message; git history = archive).
|
|
100
|
+
* There is no resting `triaged:keep` state any more (task
|
|
101
|
+
* `agentic-apply-retire-disposition-vocabulary` — a signal is still-open,
|
|
102
|
+
* acted-on, or deleted):
|
|
103
|
+
*
|
|
104
|
+
* - `duplicate` → the note is an EXACT duplicate of `existing` (already
|
|
105
|
+
* captured); the original carries the signal, so the copy is deleted; or
|
|
106
|
+
* - `map` → the note maps UNAMBIGUOUSLY onto `existing` (already covered there),
|
|
107
|
+
* so it is settled — deleted, the mapping recorded in the commit message
|
|
108
|
+
* (mirroring `duplicate`).
|
|
109
|
+
*
|
|
110
|
+
* It NEVER promotes (promotion is a human "worth building?" answer, the apply path)
|
|
111
|
+
* and NEVER auto-deletes a NON-redundant signal (the gate's high bar bounds it to
|
|
112
|
+
* `duplicate`/`map`, both of which carry no unique signal).
|
|
113
|
+
*/
|
|
114
|
+
export function autoDispositionObservation(options) {
|
|
115
|
+
const { cwd, item, itemPath, kind, existing, env } = options;
|
|
116
|
+
const note = options.note ?? (() => { });
|
|
117
|
+
if (gitSoft(['rev-parse', '--git-dir'], cwd, env).status !== 0) {
|
|
118
|
+
throw new TriagePersistError('not inside a git repository');
|
|
119
|
+
}
|
|
120
|
+
const reason = options.reason?.trim() ?? '';
|
|
121
|
+
const by = options.by || resolveBy(cwd, env);
|
|
122
|
+
// DISCHARGE BY DELETION (both cases): `git rm` the redundant note in a STANDALONE
|
|
123
|
+
// commit (no spawned artifact), the relationship + reason in the commit message.
|
|
124
|
+
// No body marker, no `triaged:` stamp — the note is out of the pool by being gone.
|
|
125
|
+
gitHard(['rm', '--quiet', '--', itemPath], cwd, env);
|
|
126
|
+
const relationship = kind === 'duplicate'
|
|
127
|
+
? `an EXACT duplicate of ${existing} (already captured; the original carries the signal`
|
|
128
|
+
: `mapped UNAMBIGUOUSLY onto ${existing} (already covered there; the existing item carries the signal`;
|
|
129
|
+
const subject = `advance: triage ${item} → ${kind} (by ${by})`;
|
|
130
|
+
const messageBody = `Discharged by deletion: ${relationship}, git history is the archive).` +
|
|
131
|
+
(reason !== '' ? `\n\nreason: ${reason}` : '');
|
|
132
|
+
gitHard(['commit', '--quiet', '-m', subject, '-m', messageBody], cwd, env);
|
|
133
|
+
const commit = gitHard(['rev-parse', 'HEAD'], cwd, env).stdout.trim();
|
|
134
|
+
const message = `auto-triaged ${item} → ${kind} of ${existing}: DELETED the note in a ` +
|
|
135
|
+
'standalone commit (relationship + reason in the commit message, git history is the archive).';
|
|
136
|
+
note(message);
|
|
137
|
+
return { outcome: 'deleted', commit, itemPath, message };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Promote an ANSWERED observation to a NEW, SELF-CONTAINED artifact (US #1/#3/#8
|
|
141
|
+
* for the task route; US #4/#9 for the PRD route): CAS-create the new item keyed
|
|
142
|
+
* on the NEW item's identity (its target path), with the observation note + its
|
|
143
|
+
* answered sidecar `git rm`-ed IN THE SAME atomic commit. Promote is ONE commit
|
|
144
|
+
* (create + delete).
|
|
145
|
+
*
|
|
146
|
+
* The artifact TYPE (`options.artifact`) selects the target + body shape: `'task'`
|
|
147
|
+
* (default) mints `work/tasks/ready/<slug>.md`; `'prd'` mints
|
|
148
|
+
* `work/prds/proposed/<slug>.md` (PRD staging — a human later promotes it to
|
|
149
|
+
* `ready/`). BOTH routes use the SAME triage-local {@link createItemThroughCas}
|
|
150
|
+
* writer (NOT intake's `switchToWorkBranch`/`performIntegration` branch+integrate
|
|
151
|
+
* band, which is intake's standalone front door): one create/integrate surface for
|
|
152
|
+
* triage, the CAS-loser-backs-off guarantee uniform across task and PRD promotion.
|
|
153
|
+
*
|
|
154
|
+
* The minted body is built FROM the observation (see {@link buildPromotedBody}):
|
|
155
|
+
* its mechanism + fix prose is carried into the artifact's lead section (`## What
|
|
156
|
+
* to build` for a task, `## Problem Statement` for a PRD), and its
|
|
157
|
+
* `## Open questions` scoping is transcribed into the new item's own
|
|
158
|
+
* `## Open questions` block with `needsAnswers` set when questions remain (cleared
|
|
159
|
+
* when none do) — so an agent can build from the artifact ALONE and no decision
|
|
160
|
+
* residue is lost on deletion. This self-containment is the PRECONDITION for the
|
|
161
|
+
* same-commit deletion.
|
|
162
|
+
*
|
|
163
|
+
* The CAS-create is the new-item-creation helper from `advancing-lock-borrow`
|
|
164
|
+
* ({@link createItemThroughCas}): a same-slug new-item race needs NO special case
|
|
165
|
+
* — exactly one creator lands the file, the LOSER fails the CAS (exit 2) and backs
|
|
166
|
+
* off WITHOUT deleting the observation (so a retry can re-promote). The observation
|
|
167
|
+
* (+ its sidecar) is deleted ONLY on a WIN, riding the winning creator's commit.
|
|
168
|
+
*/
|
|
169
|
+
export async function promoteObservation(options) {
|
|
170
|
+
const { cwd, item, itemPath, env } = options;
|
|
171
|
+
const note = options.note ?? (() => { });
|
|
172
|
+
const { slug: obsSlug } = resolveSidecarIdentity(item);
|
|
173
|
+
const newSlug = (options.newSlug ?? obsSlug).trim();
|
|
174
|
+
const artifact = options.artifact ?? 'task';
|
|
175
|
+
if (newSlug === '') {
|
|
176
|
+
return {
|
|
177
|
+
outcome: 'usage-error',
|
|
178
|
+
exitCode: 1,
|
|
179
|
+
message: `promote ${item}: empty new slug — cannot draft a ${artifact}`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// Branch the target on artifact TYPE: `task` → the agent pool (`tasks-ready`);
|
|
183
|
+
// `spec` → SPEC STAGING (`specs-proposed`), the conservative default a human later
|
|
184
|
+
// promotes to `ready/`. Both still go through the SAME createItemThroughCas
|
|
185
|
+
// writer below — only the destination folder + body shape differ.
|
|
186
|
+
const newItemPath = workItemRel(artifact === 'spec' ? 'specs-proposed' : 'tasks-ready', `${newSlug}.md`);
|
|
187
|
+
const by = options.by || resolveBy(cwd, env);
|
|
188
|
+
const content = ensureTaskDispatchable(artifact, newSlug, options.stubContent ??
|
|
189
|
+
buildPromotedBody(artifact, newSlug, readItem(cwd, itemPath, env)));
|
|
190
|
+
// The note + its answered sidecar `git rm` IN THE SAME create commit (promote =
|
|
191
|
+
// ONE atomic commit). A CAS LOSER never reaches the commit, so it leaves both
|
|
192
|
+
// INTACT for a retry (today's loser-backs-off guarantee, now over deletion).
|
|
193
|
+
const sidecarPath = sidecarPathFor(item);
|
|
194
|
+
// CAS-CREATE the new task keyed on its identity, carrying the note+sidecar
|
|
195
|
+
// deletion in the SAME commit. A same-slug race ⇒ the loser fails here and
|
|
196
|
+
// backs off WITHOUT deleting the observation.
|
|
197
|
+
const created = await createItemThroughCas({
|
|
198
|
+
path: newItemPath,
|
|
199
|
+
content,
|
|
200
|
+
deletePaths: [itemPath, sidecarPath],
|
|
201
|
+
cwd,
|
|
202
|
+
arbiter: options.arbiter,
|
|
203
|
+
by,
|
|
204
|
+
dryRun: options.dryRun,
|
|
205
|
+
env,
|
|
206
|
+
note,
|
|
207
|
+
...(options.contention !== undefined
|
|
208
|
+
? { contention: options.contention }
|
|
209
|
+
: {}),
|
|
210
|
+
});
|
|
211
|
+
if (created.exitCode !== 0) {
|
|
212
|
+
const message = `promote ${item}: the new item ${newItemPath} ${created.outcome} the ` +
|
|
213
|
+
`create CAS (${created.message}) — backing off, the observation is left ` +
|
|
214
|
+
'intact for a retry.';
|
|
215
|
+
note(message);
|
|
216
|
+
return {
|
|
217
|
+
outcome: created.outcome === 'lost' ? 'lost' : 'contended',
|
|
218
|
+
exitCode: created.exitCode,
|
|
219
|
+
message,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
const message = `promoted ${item} → CREATED ${newItemPath} (via the CAS) + DELETED the ` +
|
|
223
|
+
'observation + its sidecar in the same commit.';
|
|
224
|
+
note(message);
|
|
225
|
+
return { outcome: 'promoted', exitCode: 0, newItemPath, message };
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Build a SELF-CONTAINED body from a promoted observation. The observation's body
|
|
229
|
+
* (its mechanism + fix prose) is lifted into the artifact's LEAD section; its
|
|
230
|
+
* `## Open questions` section — if any — is SPLIT OUT and transcribed into the new
|
|
231
|
+
* item's own `## Open questions` block, and `needsAnswers: true` is stamped iff
|
|
232
|
+
* that block carries content (so deleting the note loses no scoping residue).
|
|
233
|
+
*
|
|
234
|
+
* The artifact TYPE selects the frontmatter + lead heading: a `task` gets
|
|
235
|
+
* `## What to build` + `blockedBy: []` + a `## Prompt` (the buildable-task shape);
|
|
236
|
+
* a `prd` gets `## Problem Statement` (the PRD document shape, with no `blockedBy` —
|
|
237
|
+
* a PRD is not a blockable task — and no `## Prompt`, since a PRD is not
|
|
238
|
+
* dispatched by `do`/`run`). BOTH carry the SAME transcribed mechanism prose +
|
|
239
|
+
* open-question block, so a PRD minted into `proposed/` is just as self-contained
|
|
240
|
+
* as a task.
|
|
241
|
+
*
|
|
242
|
+
* The `## Prompt` (task only) is the STRUCTURAL dispatchability the validator
|
|
243
|
+
* `resolveTask`/`extractPromptSection` (`prompt.ts`) requires: without it a
|
|
244
|
+
* dispatched build throws "has no '## Prompt' section". The body BELOW the
|
|
245
|
+
* frontmatter (lead section + mechanism prose + optional `## Open questions` +
|
|
246
|
+
* the task-only `## Prompt`) is rendered by the SHARED owner of the
|
|
247
|
+
* buildable-task/PRD schema, {@link renderTaskBody} / {@link renderSpecBody}
|
|
248
|
+
* (`buildable-body.ts`), so the producer and the consumer cannot drift apart
|
|
249
|
+
* (prd `centralize-buildable-task-renderer-shared-by-intake-and-promotion`,
|
|
250
|
+
* US #3/#5/#6). This function owns only the FRONTMATTER writer; the section
|
|
251
|
+
* skeleton lives in the one renderer. The empty-mechanism `## Prompt` seed is
|
|
252
|
+
* passed EXPLICITLY (`Build the task '<slug>', described above.`) so promotion's
|
|
253
|
+
* output is byte-for-byte unchanged — it differs from the renderer's generic
|
|
254
|
+
* `Build the task described above.` default.
|
|
255
|
+
*
|
|
256
|
+
* Composition rule (recorded in the done record `## Decisions`): the split point
|
|
257
|
+
* is the observation's FIRST `## Open questions` heading (any later sibling text
|
|
258
|
+
* up to the next same-level heading, or EOF, is the scoping). Everything BEFORE it
|
|
259
|
+
* is the mechanism/fix prose. We copy PROSE (not a back-pointer) so the artifact is
|
|
260
|
+
* buildable on its own.
|
|
261
|
+
*/
|
|
262
|
+
/**
|
|
263
|
+
* Guarantee a minted TASK body is DISPATCHABLE (carries a `## Prompt`). The
|
|
264
|
+
* agentic apply path (`apply-decide` → `promoteObservation` with `stubContent`)
|
|
265
|
+
* lets a fresh-context agent AUTHOR the task body, and that agent frequently omits
|
|
266
|
+
* the `## Prompt` section (drafting its own `## Context`/`## Definition of done`
|
|
267
|
+
* skeleton instead) — so the raw drafted body bypasses {@link buildPromotedBody}'s
|
|
268
|
+
* renderer and lands NON-dispatchable: the `advance --propose` build leg then
|
|
269
|
+
* fails with `has no '## Prompt' section` (the `extractPromptSection`/`resolveTask`
|
|
270
|
+
* guard in `prompt.ts`). This is the robust backstop that closes that hole
|
|
271
|
+
* regardless of agent compliance: for a TASK, if the body has no `## Prompt`
|
|
272
|
+
* heading, append a seeded one (blockquoted, matching the renderer's shape). A PRD
|
|
273
|
+
* is left UNTOUCHED — a PRD is a north-star doc, not dispatched by `do`/`run`, and carries no
|
|
274
|
+
* `## Prompt` by design.
|
|
275
|
+
*/
|
|
276
|
+
function ensureTaskDispatchable(artifact, slug, body) {
|
|
277
|
+
if (artifact === 'spec') {
|
|
278
|
+
return body;
|
|
279
|
+
}
|
|
280
|
+
// A task WITH a `## Prompt` heading (any level-2 spelling the validator matches)
|
|
281
|
+
// is already dispatchable — leave it byte-for-byte.
|
|
282
|
+
if (/^##\s+Prompt\b/im.test(body)) {
|
|
283
|
+
return body;
|
|
284
|
+
}
|
|
285
|
+
// No `## Prompt`: append a seeded, blockquoted one so the minted task never
|
|
286
|
+
// lands non-dispatchable. The seed points the builder at the body above (the
|
|
287
|
+
// same shape `renderTaskBody`'s empty-mechanism default uses).
|
|
288
|
+
const trimmed = body.replace(/\s+$/, '');
|
|
289
|
+
const seed = `Build the task '${slug}', described above.`;
|
|
290
|
+
const promptBlock = `## Prompt\n\n> ${seed}\n`;
|
|
291
|
+
return `${trimmed}\n\n${promptBlock}`;
|
|
292
|
+
}
|
|
293
|
+
function buildPromotedBody(artifact, slug, observation) {
|
|
294
|
+
const { mechanism, openQuestions } = splitObservationBody(observation);
|
|
295
|
+
const hasQuestions = openQuestions.trim() !== '';
|
|
296
|
+
const frontmatter = [
|
|
297
|
+
'---',
|
|
298
|
+
`title: ${slug}`,
|
|
299
|
+
`slug: ${slug}`,
|
|
300
|
+
`needsAnswers: ${hasQuestions ? 'true' : 'false'}`,
|
|
301
|
+
// A PRD is a north-star doc, not a blockable task — only the task shape carries
|
|
302
|
+
// `blockedBy`.
|
|
303
|
+
...(artifact === 'spec' ? [] : ['blockedBy: []']),
|
|
304
|
+
'---',
|
|
305
|
+
];
|
|
306
|
+
// One BLANK line separates the closing frontmatter fence from the rendered
|
|
307
|
+
// body (`---\n\n## ...`): the shared renderer starts AT its first heading with no
|
|
308
|
+
// leading blank, so the separator is owned here. This keeps promotion's output
|
|
309
|
+
// byte-for-byte identical to the pre-rewire hand-rolled body (which placed an
|
|
310
|
+
// empty array element between the `---` fence and the lead heading) and matches
|
|
311
|
+
// what intake will emit once it adopts the same renderer. RATIFIED as a
|
|
312
|
+
// cross-module convention in `docs/adr/frontmatter-owns-fence-to-heading-blank-line.md`
|
|
313
|
+
// — frontmatter owns the `\n\n`, the renderer starts at the first heading with
|
|
314
|
+
// no leading blank. Do NOT move the separator into the renderer.
|
|
315
|
+
const fenceToBody = frontmatter.join('\n') + '\n\n';
|
|
316
|
+
// The body BELOW the frontmatter is rendered by the SHARED schema owner so the
|
|
317
|
+
// section skeleton has one home, not two (prd
|
|
318
|
+
// `centralize-buildable-task-renderer-shared-by-intake-and-promotion`). A PRD
|
|
319
|
+
// goes through `renderSpecBody` (no `## Prompt`); a task through
|
|
320
|
+
// `renderTaskBody` (always a `## Prompt`).
|
|
321
|
+
if (artifact === 'spec') {
|
|
322
|
+
return (fenceToBody +
|
|
323
|
+
renderSpecBody({
|
|
324
|
+
problemStatement: mechanism,
|
|
325
|
+
openQuestions,
|
|
326
|
+
}));
|
|
327
|
+
}
|
|
328
|
+
// Pass the slug-bearing empty-mechanism seed EXPLICITLY: the renderer's generic
|
|
329
|
+
// default is `Build the task described above.`, but promotion has always seeded
|
|
330
|
+
// the empty-mechanism case with the slug (`Build the task '<slug>', described
|
|
331
|
+
// above.`), so we keep that byte-for-byte by handing the seed in rather than
|
|
332
|
+
// relying on the renderer default. A non-empty mechanism seeds the `## Prompt`
|
|
333
|
+
// from the mechanism prose (the renderer blockquotes it).
|
|
334
|
+
const promptSeed = mechanism.trim() === ''
|
|
335
|
+
? `Build the task '${slug}', described above.`
|
|
336
|
+
: mechanism;
|
|
337
|
+
return (fenceToBody +
|
|
338
|
+
renderTaskBody({
|
|
339
|
+
whatToBuild: mechanism,
|
|
340
|
+
openQuestions,
|
|
341
|
+
prompt: promptSeed,
|
|
342
|
+
}));
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Split an observation's text into its mechanism/fix PROSE (before the first
|
|
346
|
+
* `## Open questions` heading) and its open-questions SCOPING (that section's
|
|
347
|
+
* body, up to the next `## ` heading or EOF). The frontmatter fence is dropped
|
|
348
|
+
* (the new task gets its own). When there is no `## Open questions` heading the
|
|
349
|
+
* whole body is mechanism and the scoping is empty.
|
|
350
|
+
*/
|
|
351
|
+
function splitObservationBody(observation) {
|
|
352
|
+
const body = stripFrontmatter(observation);
|
|
353
|
+
const lines = body.split('\n');
|
|
354
|
+
// Match `## Open questions` (and tolerant variants like
|
|
355
|
+
// `## Open questions to NOT guess` the capture-signal skill writes).
|
|
356
|
+
const startIdx = lines.findIndex((l) => /^##\s+Open questions\b/i.test(l));
|
|
357
|
+
if (startIdx === -1) {
|
|
358
|
+
return { mechanism: body, openQuestions: '' };
|
|
359
|
+
}
|
|
360
|
+
let endIdx = lines.length;
|
|
361
|
+
for (let i = startIdx + 1; i < lines.length; i++) {
|
|
362
|
+
if (/^##\s+/.test(lines[i])) {
|
|
363
|
+
endIdx = i;
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const mechanism = lines.slice(0, startIdx).join('\n');
|
|
368
|
+
const openQuestions = lines.slice(startIdx + 1, endIdx).join('\n');
|
|
369
|
+
return { mechanism, openQuestions };
|
|
370
|
+
}
|
|
371
|
+
/** Strip a leading `---\n…\n---` frontmatter fence, returning the body. */
|
|
372
|
+
function stripFrontmatter(content) {
|
|
373
|
+
const normalized = content.replace(/\r\n/g, '\n').replace(/^\uFEFF/, '');
|
|
374
|
+
if (!normalized.startsWith('---\n')) {
|
|
375
|
+
return normalized;
|
|
376
|
+
}
|
|
377
|
+
const lines = normalized.split('\n');
|
|
378
|
+
const closing = lines.indexOf('---', 1);
|
|
379
|
+
if (closing === -1) {
|
|
380
|
+
return normalized;
|
|
381
|
+
}
|
|
382
|
+
return lines
|
|
383
|
+
.slice(closing + 1)
|
|
384
|
+
.join('\n')
|
|
385
|
+
.replace(/^\n+/, '');
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=triage-persist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triage-persist.js","sourceRoot":"","sources":["../src/triage-persist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,GAAG,EAAiB,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACN,oBAAoB,GAGpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,sBAAsB,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,SAAS,OAAO,CACf,IAAc,EACd,GAAW,EACX,GAAkC;IAElC,OAAO,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,OAAO,CACf,IAAc,EACd,GAAW,EACX,GAAkC;IAElC,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC;IAC5C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;Q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MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxC,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,UAAU,CAAC;IACnB,CAAC;IACD,OAAO,KAAK;SACV,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;SAClB,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SHARED "first JSON object in agent prose" extractor — the single
|
|
3
|
+
* implementation behind every prompt→verdict→dispatch seam in this package
|
|
4
|
+
* (the Gate-2 PR/code review gate and the task-SET acceptance gate in
|
|
5
|
+
* `review-gate.ts`, the tasker IMPROVER loop in `tasker-review-loop.ts`, and the
|
|
6
|
+
* issue-intake decision in `intake.ts`). Each of those launches an agent that
|
|
7
|
+
* EMITS a single JSON object (possibly fenced / wrapped in prose) and the runner
|
|
8
|
+
* pulls it back out to dispatch on it — the SAME need, so it is ONE extractor, not
|
|
9
|
+
* a forked copy per caller (coherence; task `intake-production-verdict-parse`).
|
|
10
|
+
*
|
|
11
|
+
* The only thing that varies between callers is the DISCRIMINATOR KEY they brace-
|
|
12
|
+
* match outward from: the review gates emit `{"verdict": …}`, intake emits
|
|
13
|
+
* `{"outcome": …}`. {@link extractJsonObjectSpan} takes that key as a parameter
|
|
14
|
+
* (defaulting to `"verdict"` so the review-gate callers read identically).
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Locate the first JSON object that carries a `"<key>"` field in arbitrary agent
|
|
18
|
+
* output (it may be fenced, prefixed with prose, or bare), returning its `[start,
|
|
19
|
+
* end)` span (`output.slice(start, end)` is the JSON). Brace-matched from the
|
|
20
|
+
* `"<key>"` occurrence OUTWARD (walk back to the enclosing `{`, then brace-match
|
|
21
|
+
* forward, respecting strings) so a surrounding fence / prose does not defeat
|
|
22
|
+
* parsing. Returns `undefined` when none is found.
|
|
23
|
+
*
|
|
24
|
+
* @param output the agent's raw textual output.
|
|
25
|
+
* @param key the discriminator field name to anchor on, WITHOUT quotes
|
|
26
|
+
* (defaults to `verdict`, the review gates' key; intake passes `outcome`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractJsonObjectSpan(output: string, key?: string): {
|
|
29
|
+
start: number;
|
|
30
|
+
end: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
//# sourceMappingURL=verdict-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdict-json.d.ts","sourceRoot":"","sources":["../src/verdict-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,MAAM,EACd,GAAG,SAAY,GACb;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG,SAAS,CAyC1C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SHARED "first JSON object in agent prose" extractor — the single
|
|
3
|
+
* implementation behind every prompt→verdict→dispatch seam in this package
|
|
4
|
+
* (the Gate-2 PR/code review gate and the task-SET acceptance gate in
|
|
5
|
+
* `review-gate.ts`, the tasker IMPROVER loop in `tasker-review-loop.ts`, and the
|
|
6
|
+
* issue-intake decision in `intake.ts`). Each of those launches an agent that
|
|
7
|
+
* EMITS a single JSON object (possibly fenced / wrapped in prose) and the runner
|
|
8
|
+
* pulls it back out to dispatch on it — the SAME need, so it is ONE extractor, not
|
|
9
|
+
* a forked copy per caller (coherence; task `intake-production-verdict-parse`).
|
|
10
|
+
*
|
|
11
|
+
* The only thing that varies between callers is the DISCRIMINATOR KEY they brace-
|
|
12
|
+
* match outward from: the review gates emit `{"verdict": …}`, intake emits
|
|
13
|
+
* `{"outcome": …}`. {@link extractJsonObjectSpan} takes that key as a parameter
|
|
14
|
+
* (defaulting to `"verdict"` so the review-gate callers read identically).
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Locate the first JSON object that carries a `"<key>"` field in arbitrary agent
|
|
18
|
+
* output (it may be fenced, prefixed with prose, or bare), returning its `[start,
|
|
19
|
+
* end)` span (`output.slice(start, end)` is the JSON). Brace-matched from the
|
|
20
|
+
* `"<key>"` occurrence OUTWARD (walk back to the enclosing `{`, then brace-match
|
|
21
|
+
* forward, respecting strings) so a surrounding fence / prose does not defeat
|
|
22
|
+
* parsing. Returns `undefined` when none is found.
|
|
23
|
+
*
|
|
24
|
+
* @param output the agent's raw textual output.
|
|
25
|
+
* @param key the discriminator field name to anchor on, WITHOUT quotes
|
|
26
|
+
* (defaults to `verdict`, the review gates' key; intake passes `outcome`).
|
|
27
|
+
*/
|
|
28
|
+
export function extractJsonObjectSpan(output, key = 'verdict') {
|
|
29
|
+
const anchor = output.indexOf(`"${key}"`);
|
|
30
|
+
if (anchor === -1) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
// Walk back to the opening brace of the object containing the key.
|
|
34
|
+
let start = anchor;
|
|
35
|
+
while (start >= 0 && output[start] !== '{') {
|
|
36
|
+
start--;
|
|
37
|
+
}
|
|
38
|
+
if (start < 0) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
// Brace-match forward from that opening brace, respecting strings.
|
|
42
|
+
let depth = 0;
|
|
43
|
+
let inString = false;
|
|
44
|
+
let escaped = false;
|
|
45
|
+
for (let i = start; i < output.length; i++) {
|
|
46
|
+
const ch = output[i];
|
|
47
|
+
if (inString) {
|
|
48
|
+
if (escaped) {
|
|
49
|
+
escaped = false;
|
|
50
|
+
}
|
|
51
|
+
else if (ch === '\\') {
|
|
52
|
+
escaped = true;
|
|
53
|
+
}
|
|
54
|
+
else if (ch === '"') {
|
|
55
|
+
inString = false;
|
|
56
|
+
}
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (ch === '"') {
|
|
60
|
+
inString = true;
|
|
61
|
+
}
|
|
62
|
+
else if (ch === '{') {
|
|
63
|
+
depth++;
|
|
64
|
+
}
|
|
65
|
+
else if (ch === '}') {
|
|
66
|
+
depth--;
|
|
67
|
+
if (depth === 0) {
|
|
68
|
+
return { start, end: i + 1 };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=verdict-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdict-json.js","sourceRoot":"","sources":["../src/verdict-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CACpC,MAAc,EACd,GAAG,GAAG,SAAS;IAEf,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;IAC1C,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,mEAAmE;IACnE,IAAI,KAAK,GAAG,MAAM,CAAC;IACnB,OAAO,KAAK,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;QAC5C,KAAK,EAAE,CAAC;IACT,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,mEAAmE;IACnE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,QAAQ,EAAE,CAAC;YACd,IAAI,OAAO,EAAE,CAAC;gBACb,OAAO,GAAG,KAAK,CAAC;YACjB,CAAC;iBAAM,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;gBACxB,OAAO,GAAG,IAAI,CAAC;YAChB,CAAC;iBAAM,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBACvB,QAAQ,GAAG,KAAK,CAAC;YAClB,CAAC;YACD,SAAS;QACV,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YAChB,QAAQ,GAAG,IAAI,CAAC;QACjB,CAAC;aAAM,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACvB,KAAK,EAAE,CAAC;QACT,CAAC;aAAM,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACvB,KAAK,EAAE,CAAC;YACR,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACjB,OAAO,EAAC,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAC,CAAC;YAC5B,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `install-ci` VERIFY-WORKFLOW capability (prd
|
|
3
|
+
* `land-time-reverify-and-parallel-merge-ceiling`, task
|
|
4
|
+
* `install-ci-tier1-branch-protection`; Story 11 — the Tier-1 GitHub ceiling).
|
|
5
|
+
* Emits a small `verify.yml` workflow whose ONLY job is `verify` and runs on
|
|
6
|
+
* `pull_request` (and `merge_group`, the Tier-2 forward seam). It produces the
|
|
7
|
+
* GitHub check named exactly {@link VERIFY_CHECK_CONTEXT}, which the
|
|
8
|
+
* branch-protection step ({@link installCIBranchProtectionStep}) names as the
|
|
9
|
+
* required-status check `context`. Co-locating the two strings — the EMITTED
|
|
10
|
+
* job/check name AND the REQUIRED context — in one constant pins the
|
|
11
|
+
* acceptance-criterion "context matches the workflow's job name" by construction
|
|
12
|
+
* (a single test diffs the two).
|
|
13
|
+
*
|
|
14
|
+
* The workflow is deliberately thin: it wires the same composite setup action
|
|
15
|
+
* the other capabilities use, then runs `dorfl verify` — the deterministic shell
|
|
16
|
+
* gate the repo declares in `.dorfl.json`. No agent, no provider secrets, no
|
|
17
|
+
* `gh` mutation; it is read-only with respect to `work/`.
|
|
18
|
+
*
|
|
19
|
+
* `merge_group` is present (with no extra wiring) so a follow-on Tier-2 task
|
|
20
|
+
* (GitHub Merge Queue) can flip the ruleset on without changing this workflow's
|
|
21
|
+
* trigger surface — the forward seam the spec's Applied Answers q3 names.
|
|
22
|
+
*/
|
|
23
|
+
import type { ResolvedCIConfig } from './install-ci-core.js';
|
|
24
|
+
/**
|
|
25
|
+
* The required-status-check CONTEXT install-ci sets via branch protection AND the
|
|
26
|
+
* job/check name the emitted verify workflow produces. ONE source of truth so
|
|
27
|
+
* the two strings can never drift (the "context matches the workflow's job name"
|
|
28
|
+
* acceptance criterion is enforced by both reading this constant).
|
|
29
|
+
*/
|
|
30
|
+
export declare const VERIFY_CHECK_CONTEXT = "verify";
|
|
31
|
+
/** The capability id (the registry key + the emitted workflow file stem). */
|
|
32
|
+
export declare const VERIFY_CAPABILITY_ID = "verify";
|
|
33
|
+
/** The wizard-facing label for the verify capability. */
|
|
34
|
+
export declare const VERIFY_CAPABILITY_LABEL = "Run the repo `verify` gate on every PR (the Tier-1 GitHub ceiling: produces the required-status check `verify` that branch protection requires)";
|
|
35
|
+
/** The repo-relative path (under the output base) of the emitted workflow. */
|
|
36
|
+
export declare const VERIFY_WORKFLOW_PATH = "workflows/verify.yml";
|
|
37
|
+
/**
|
|
38
|
+
* Generate the verify workflow YAML. Deterministic: the same config produces
|
|
39
|
+
* byte-identical output. The job is named exactly {@link VERIFY_CHECK_CONTEXT}
|
|
40
|
+
* so the GitHub check it produces matches the required-status `context` install-ci
|
|
41
|
+
* configures on `main` — by construction, not by hand-typed agreement.
|
|
42
|
+
*/
|
|
43
|
+
export declare function generateVerifyWorkflow(_config: ResolvedCIConfig): string;
|
|
44
|
+
/** A single structural problem found in the generated verify workflow. */
|
|
45
|
+
export interface VerifyWorkflowProblem {
|
|
46
|
+
id: string;
|
|
47
|
+
message: string;
|
|
48
|
+
}
|
|
49
|
+
/** Result of {@link validateVerifyWorkflow}. */
|
|
50
|
+
export interface VerifyWorkflowValidation {
|
|
51
|
+
ok: boolean;
|
|
52
|
+
problems: VerifyWorkflowProblem[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Structurally validate the verify workflow against the task's acceptance
|
|
56
|
+
* criteria (job name = required context, runs on `pull_request`, ships the
|
|
57
|
+
* `merge_group` seam, no `workflows:` permission).
|
|
58
|
+
*/
|
|
59
|
+
export declare function validateVerifyWorkflow(text: string): VerifyWorkflowValidation;
|
|
60
|
+
//# sourceMappingURL=verify-workflow-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-workflow-template.d.ts","sourceRoot":"","sources":["../src/verify-workflow-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C,yDAAyD;AACzD,eAAO,MAAM,uBAAuB,oJAC8G,CAAC;AAEnJ,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CA4DxE;AAED,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,gDAAgD;AAChD,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CA8B7E"}
|