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 @@
|
|
|
1
|
+
{"version":3,"file":"merge-question-surfacer.d.ts","sourceRoot":"","sources":["../src/merge-question-surfacer.ts"],"names":[],"mappings":"AAUA,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IAClC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Sync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { run } from './git.js';
|
|
4
|
+
import { isGitHubArbiterUrl, DEFAULT_GH_BIN } from './github.js';
|
|
5
|
+
import { parseSidecar, sidecarPathFor, isEntryAnswered, } from './sidecar.js';
|
|
6
|
+
import { persistSurfacedQuestions, } from './surface-persist.js';
|
|
7
|
+
import { workItemRel } from './work-layout.js';
|
|
8
|
+
/** Raised for fatal usage errors (a missing repo, etc.). */
|
|
9
|
+
export class MergeQuestionSurfacerError extends Error {
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'MergeQuestionSurfacerError';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** The lifecycle folders a task body may rest in (the FOLDERS the persist
|
|
16
|
+
* needs to find the item file to set `needsAnswers:true` on). Matches
|
|
17
|
+
* `advance.ts`'s `findItemPath` task-folder set. */
|
|
18
|
+
const TASK_FOLDERS = [
|
|
19
|
+
'tasks-ready',
|
|
20
|
+
'tasks-backlog',
|
|
21
|
+
'done',
|
|
22
|
+
'cancelled',
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Surface merge-questions for every unmerged `work/*` branch in `cwd`.
|
|
26
|
+
*
|
|
27
|
+
* The FLOOR (git reachability) is authoritative; the CEILING (`gh pr list`)
|
|
28
|
+
* runs only when {@link isGitHubArbiterUrl} accepts the arbiter URL, and is
|
|
29
|
+
* pure enrichment (a missing/failed `gh` degrades silently — the floor still
|
|
30
|
+
* surfaces the question).
|
|
31
|
+
*
|
|
32
|
+
* Idempotency: a branch whose sidecar ALREADY carries a PENDING `kind: merge`
|
|
33
|
+
* entry is SKIPPED (with `already-pending-merge-question`). A branch with no
|
|
34
|
+
* item body on `main` is SKIPPED (with `no-item-body`) — the cross-cutting
|
|
35
|
+
* branch-keyed sidecar identity (PRD sidecar Q5-i) is OOS for this task; an
|
|
36
|
+
* unmerged-branch-with-no-body lands on the same skip path until that
|
|
37
|
+
* generalisation arrives.
|
|
38
|
+
*/
|
|
39
|
+
export function surfaceMergeQuestions(options) {
|
|
40
|
+
const { cwd } = options;
|
|
41
|
+
const base = options.base ?? 'main';
|
|
42
|
+
const env = options.env;
|
|
43
|
+
const note = options.note ?? (() => { });
|
|
44
|
+
const persist = options.persist ?? persistSurfacedQuestions;
|
|
45
|
+
const listBranches = options.listUnmergedWorkBranches ?? listUnmergedWorkBranchesViaGit;
|
|
46
|
+
const branches = listBranches({ cwd, base, env });
|
|
47
|
+
// CEILING: only consult `gh pr list` when the arbiter is GitHub-shaped. A
|
|
48
|
+
// bare / non-GitHub arbiter never spawns `gh` (the floor is sufficient).
|
|
49
|
+
let prs = new Map();
|
|
50
|
+
const ghEnabled = options.arbiterUrl !== undefined && isGitHubArbiterUrl(options.arbiterUrl);
|
|
51
|
+
if (ghEnabled && branches.length > 0) {
|
|
52
|
+
const listPRs = options.listOpenPullRequests ?? listOpenPullRequestsViaGh;
|
|
53
|
+
try {
|
|
54
|
+
prs = listPRs({
|
|
55
|
+
cwd,
|
|
56
|
+
ghBin: options.ghBin ?? DEFAULT_GH_BIN,
|
|
57
|
+
base,
|
|
58
|
+
env,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
// `gh` is the ENRICHMENT layer — a failure must NEVER suppress the
|
|
63
|
+
// floor's surfacing. Note it and proceed with an empty PR map.
|
|
64
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
65
|
+
note(`merge-question surfacer: gh pr list failed (${detail}) — continuing with the git-only floor.`);
|
|
66
|
+
prs = new Map();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const surfaced = [];
|
|
70
|
+
const skipped = [];
|
|
71
|
+
for (const branch of branches) {
|
|
72
|
+
const item = `task:${branch.slug}`;
|
|
73
|
+
// Idempotency: if the sidecar already carries a PENDING `kind: merge`
|
|
74
|
+
// entry, this surfacer must not append a duplicate. (An ANSWERED merge
|
|
75
|
+
// entry is fine — apply will dispatch it; appending a new entry would
|
|
76
|
+
// re-pause the sidecar unnecessarily.)
|
|
77
|
+
if (alreadyHasPendingMergeQuestion(cwd, item)) {
|
|
78
|
+
skipped.push({
|
|
79
|
+
ref: branch.ref,
|
|
80
|
+
slug: branch.slug,
|
|
81
|
+
reason: 'already-pending-merge-question',
|
|
82
|
+
});
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const itemPath = findTaskItemPath(cwd, branch.slug);
|
|
86
|
+
if (itemPath === undefined) {
|
|
87
|
+
// The `branch:`/`ref:`-keyed sidecar identity (PRD sidecar Q5-i, the
|
|
88
|
+
// cross-cutting open question SHARED with the stuck-lock surfacer) is
|
|
89
|
+
// OUT OF SCOPE for this task — without a body to flip `needsAnswers`
|
|
90
|
+
// on, persist would tear the invariant. Skip with the reason so the
|
|
91
|
+
// case is visible to the caller.
|
|
92
|
+
skipped.push({
|
|
93
|
+
ref: branch.ref,
|
|
94
|
+
slug: branch.slug,
|
|
95
|
+
reason: 'no-item-body',
|
|
96
|
+
});
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const pr = prs.get(branch.ref);
|
|
100
|
+
const question = buildMergeQuestion(branch, pr);
|
|
101
|
+
const result = persist({
|
|
102
|
+
cwd,
|
|
103
|
+
item,
|
|
104
|
+
itemPath,
|
|
105
|
+
questions: [question],
|
|
106
|
+
env,
|
|
107
|
+
note,
|
|
108
|
+
});
|
|
109
|
+
if (result.outcome === 'nothing') {
|
|
110
|
+
skipped.push({
|
|
111
|
+
ref: branch.ref,
|
|
112
|
+
slug: branch.slug,
|
|
113
|
+
reason: 'persist-nothing',
|
|
114
|
+
});
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
surfaced.push({
|
|
118
|
+
item,
|
|
119
|
+
slug: branch.slug,
|
|
120
|
+
ref: branch.ref,
|
|
121
|
+
sidecarPath: result.sidecarPath,
|
|
122
|
+
commit: result.commit,
|
|
123
|
+
prUrl: pr?.url,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return { considered: branches.length, surfaced, skipped };
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Build the merge-question for ONE unmerged branch.
|
|
130
|
+
*
|
|
131
|
+
* - The QUESTION is a plain English "should this branch land?" prompt.
|
|
132
|
+
* - The CONTEXT carries the floor evidence (the unmerged branch ref) and, if
|
|
133
|
+
* a host PR matched, the ceiling enrichment (PR number, url, title).
|
|
134
|
+
* - The DEFAULT carries `merge | hold | drop` as a HUMAN-READABLE HINT only.
|
|
135
|
+
* The MACHINE dispatch signal is `kind: merge`, NEVER the shape of
|
|
136
|
+
* `default` (the workaround the first build was blocked for).
|
|
137
|
+
* - The KIND is the typed dispatch axis from `sidecar-kind-field` —
|
|
138
|
+
* `kind: merge` is what the apply rung reads to route the answer to the
|
|
139
|
+
* deterministic land primitive.
|
|
140
|
+
*/
|
|
141
|
+
function buildMergeQuestion(branch, pr) {
|
|
142
|
+
const contextLines = [
|
|
143
|
+
`The branch \`${branch.ref}\` is not reachable from \`main\` — it carries pushed work that has not yet landed.`,
|
|
144
|
+
];
|
|
145
|
+
if (pr !== undefined) {
|
|
146
|
+
const titleSuffix = pr.title ? `: ${pr.title}` : '';
|
|
147
|
+
const urlSuffix = pr.url ? ` (${pr.url})` : '';
|
|
148
|
+
const stateSuffix = pr.state ? ` [${pr.state}]` : '';
|
|
149
|
+
contextLines.push(`Open PR #${pr.number}${stateSuffix}${titleSuffix}${urlSuffix}.`);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
contextLines.push(`No host PR metadata available (git-alone floor — the branch is the source of truth).`);
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
question: `Land \`${branch.ref}\`? An unmerged \`work/*\` branch is awaiting an integration decision.`,
|
|
156
|
+
context: contextLines.join('\n'),
|
|
157
|
+
// HUMAN HINT only — the apply layer MUST NOT string-sniff this.
|
|
158
|
+
default: 'merge | hold | drop',
|
|
159
|
+
// MACHINE dispatch signal — the apply layer routes on this, not on `default`.
|
|
160
|
+
kind: 'merge',
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/** Probe the sidecar for an existing pending `kind: merge` entry. */
|
|
164
|
+
function alreadyHasPendingMergeQuestion(cwd, item) {
|
|
165
|
+
const rel = sidecarPathFor(item);
|
|
166
|
+
const abs = join(cwd, rel);
|
|
167
|
+
if (!existsSync(abs)) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
try {
|
|
171
|
+
const model = parseSidecar(readFileSync(abs, 'utf8'));
|
|
172
|
+
return model.entries.some((e) => e.kind === 'merge' && !isEntryAnswered(e));
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
// A malformed sidecar is not THIS surfacer's problem — pretend there is
|
|
176
|
+
// no pending merge-question and let the persist write surface the issue.
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/** Locate the task body `work/<folder>/<slug>.md` across lifecycle folders. */
|
|
181
|
+
function findTaskItemPath(cwd, slug) {
|
|
182
|
+
for (const folder of TASK_FOLDERS) {
|
|
183
|
+
const rel = workItemRel(folder, `${slug}.md`);
|
|
184
|
+
if (existsSync(join(cwd, rel))) {
|
|
185
|
+
return rel;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
// --- Production seams ----------------------------------------------------
|
|
191
|
+
function gitSoft(args, cwd, env) {
|
|
192
|
+
return run('git', args, cwd, { env });
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Production FLOOR: enumerate every `refs/heads/work/*` whose tip is NOT
|
|
196
|
+
* reachable from `<base>`. A repo with no `<base>` (e.g. a fresh init before
|
|
197
|
+
* the first commit) yields the empty list — the surfacer is a no-op until
|
|
198
|
+
* `main` exists.
|
|
199
|
+
*/
|
|
200
|
+
export function listUnmergedWorkBranchesViaGit(input) {
|
|
201
|
+
const { cwd, base, env } = input;
|
|
202
|
+
// Bail if `<base>` does not resolve — without a base, "unmerged" is
|
|
203
|
+
// meaningless and we'd over-surface every branch as unmerged.
|
|
204
|
+
const haveBase = gitSoft(['rev-parse', '--verify', '--quiet', base], cwd, env);
|
|
205
|
+
if (haveBase.status !== 0) {
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
const refs = gitSoft([
|
|
209
|
+
'for-each-ref',
|
|
210
|
+
'--format=%(refname:short) %(objectname)',
|
|
211
|
+
'refs/heads/work/',
|
|
212
|
+
], cwd, env);
|
|
213
|
+
if (refs.status !== 0) {
|
|
214
|
+
return [];
|
|
215
|
+
}
|
|
216
|
+
const lines = refs.stdout
|
|
217
|
+
.split('\n')
|
|
218
|
+
.map((l) => l.trim())
|
|
219
|
+
.filter((l) => l !== '');
|
|
220
|
+
const unmerged = [];
|
|
221
|
+
for (const line of lines) {
|
|
222
|
+
const space = line.indexOf(' ');
|
|
223
|
+
if (space === -1) {
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const ref = line.slice(0, space);
|
|
227
|
+
const sha = line.slice(space + 1).trim();
|
|
228
|
+
if (!ref.startsWith('work/')) {
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
const slug = ref.slice('work/'.length);
|
|
232
|
+
if (slug === '') {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
// `git merge-base --is-ancestor <sha> <base>` — exit 0 ⇒ reachable
|
|
236
|
+
// (merged), exit 1 ⇒ unmerged.
|
|
237
|
+
const reach = gitSoft(['merge-base', '--is-ancestor', sha, base], cwd, env);
|
|
238
|
+
if (reach.status !== 0) {
|
|
239
|
+
unmerged.push({ ref, slug, sha });
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return unmerged;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Production CEILING: shell `gh pr list --state open --json …` and index the
|
|
246
|
+
* results by their `headRefName` so the surfacer can enrich the matching
|
|
247
|
+
* branch's question. A non-zero / missing `gh` is treated as "no host
|
|
248
|
+
* metadata available" — the floor still surfaces every unmerged branch.
|
|
249
|
+
*/
|
|
250
|
+
export function listOpenPullRequestsViaGh(input) {
|
|
251
|
+
const { cwd, ghBin, base, env } = input;
|
|
252
|
+
const result = run(ghBin, [
|
|
253
|
+
'pr',
|
|
254
|
+
'list',
|
|
255
|
+
'--state',
|
|
256
|
+
'open',
|
|
257
|
+
'--base',
|
|
258
|
+
base,
|
|
259
|
+
'--limit',
|
|
260
|
+
'200',
|
|
261
|
+
'--json',
|
|
262
|
+
'number,url,title,headRefName,state',
|
|
263
|
+
], cwd, { env });
|
|
264
|
+
if (result.status !== 0) {
|
|
265
|
+
return new Map();
|
|
266
|
+
}
|
|
267
|
+
let parsed;
|
|
268
|
+
try {
|
|
269
|
+
parsed = JSON.parse(result.stdout);
|
|
270
|
+
}
|
|
271
|
+
catch {
|
|
272
|
+
return new Map();
|
|
273
|
+
}
|
|
274
|
+
if (!Array.isArray(parsed)) {
|
|
275
|
+
return new Map();
|
|
276
|
+
}
|
|
277
|
+
const out = new Map();
|
|
278
|
+
for (const raw of parsed) {
|
|
279
|
+
if (typeof raw !== 'object' || raw === null) {
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
const r = raw;
|
|
283
|
+
const headRefName = typeof r.headRefName === 'string' ? r.headRefName : '';
|
|
284
|
+
const number = typeof r.number === 'number' ? r.number : undefined;
|
|
285
|
+
if (headRefName === '' || number === undefined) {
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
out.set(headRefName, {
|
|
289
|
+
number,
|
|
290
|
+
url: typeof r.url === 'string' ? r.url : undefined,
|
|
291
|
+
title: typeof r.title === 'string' ? r.title : undefined,
|
|
292
|
+
state: typeof r.state === 'string' ? r.state : undefined,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
return out;
|
|
296
|
+
}
|
|
297
|
+
//# sourceMappingURL=merge-question-surfacer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,SAAS;QACV,CAAC;QACD,MAAM,CAAC,GAAG,GAA8B,CAAC;QACzC,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACnE,IAAI,WAAW,KAAK,EAAE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAChD,SAAS;QACV,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE;YACpB,MAAM;YACN,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;YAClD,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YACxD,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SACxD,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { type CasContentionBudget } from './advancing-lock.js';
|
|
2
|
+
/** Raised for usage errors (an empty slug, an unreadable observation). */
|
|
3
|
+
export declare class MintAdrError extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The repo-relative `docs/adr/` home for minted ADRs. ADRs live OUTSIDE the
|
|
8
|
+
* `work/` governance tree (so they are NOT in `work-layout.ts`'s registry); this
|
|
9
|
+
* is the single literal the route roots its target on. `docs/adr/` is created
|
|
10
|
+
* lazily by {@link createItemThroughCas} (it `mkdir -p`s the target's dirname).
|
|
11
|
+
*/
|
|
12
|
+
export declare const ADR_DIR_REL = "docs/adr";
|
|
13
|
+
/** The repo-relative path of a minted ADR file: `docs/adr/<slug>.md`. */
|
|
14
|
+
export declare function adrItemRel(slug: string): string;
|
|
15
|
+
export interface MintAdrOptions {
|
|
16
|
+
/** Working clone/worktree the mint runs in. */
|
|
17
|
+
cwd: string;
|
|
18
|
+
/** The namespaced source identity (`observation:<slug>`). */
|
|
19
|
+
item: string;
|
|
20
|
+
/** The source item file path RELATIVE to `cwd` (e.g. `work/notes/observations/foo.md`). */
|
|
21
|
+
itemPath: string;
|
|
22
|
+
/**
|
|
23
|
+
* The ADR slug to draft. Defaults to the source observation's own slug, so the
|
|
24
|
+
* minted ADR is `docs/adr/<obs-slug>.md`. The CAS is keyed on the new ADR's
|
|
25
|
+
* PATH, so a same-slug ADR race ⇒ the loser fails the CAS and backs off.
|
|
26
|
+
*/
|
|
27
|
+
adrSlug?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The ADR's short title (the `# {title}` heading line). Defaults to the slug
|
|
30
|
+
* when absent.
|
|
31
|
+
*/
|
|
32
|
+
adrTitle?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The ADR's content — the markdown AFTER the frontmatter (the
|
|
35
|
+
* context/decision/why record). When omitted, a SELF-CONTAINED body is built
|
|
36
|
+
* FROM the source observation + its answered question(s) (see
|
|
37
|
+
* {@link buildAdrBody}), so the decision's WHY is carried in and the source is
|
|
38
|
+
* safely deletable.
|
|
39
|
+
*/
|
|
40
|
+
adrBody?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The answered question(s) + answers the decision rests on, carried into the
|
|
43
|
+
* built body's Context/Decision when no explicit `adrBody` is supplied (so the
|
|
44
|
+
* minted ADR is self-contained even without an agent-drafted body).
|
|
45
|
+
*/
|
|
46
|
+
answers?: {
|
|
47
|
+
question: string;
|
|
48
|
+
answer: string;
|
|
49
|
+
}[];
|
|
50
|
+
/** Name of the arbiter remote (`--arbiter`). Defaults to `origin`. */
|
|
51
|
+
arbiter?: string;
|
|
52
|
+
/** Advisory committer id for the commit subject. Defaults to git user.name. */
|
|
53
|
+
by?: string;
|
|
54
|
+
/** Environment for child git processes. */
|
|
55
|
+
env?: NodeJS.ProcessEnv;
|
|
56
|
+
/** Show the intended CAS push without mutating the arbiter (`--dry-run`). */
|
|
57
|
+
dryRun?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The CAS CONTENTION-RETRY BUDGET (jittered inter-retry delay + widened
|
|
60
|
+
* attempt / wall-clock envelope). Threaded through to
|
|
61
|
+
* {@link createItemThroughCas}. The lifecycle driver passes
|
|
62
|
+
* `LIFECYCLE_CAS_CONTENTION` here so a propose-tick FAN-OUT of parallel
|
|
63
|
+
* `mint-adr` legs desynchronises and DRAINS instead of thrashing to `contended`.
|
|
64
|
+
* Absent ⇒ the interactive default (3 retries, no delay).
|
|
65
|
+
*/
|
|
66
|
+
contention?: CasContentionBudget;
|
|
67
|
+
/** Sink for human-readable progress notes. */
|
|
68
|
+
note?: (message: string) => void;
|
|
69
|
+
}
|
|
70
|
+
export interface MintAdrResult {
|
|
71
|
+
/**
|
|
72
|
+
* `minted` (the ADR landed via the CAS + the observation+sidecar were deleted
|
|
73
|
+
* in the SAME commit), `lost` (the same-slug ADR race was lost — the loser backs
|
|
74
|
+
* off, observation left INTACT), or `contended` (the CAS push kept failing).
|
|
75
|
+
* Maps onto the claim-CAS exit codes.
|
|
76
|
+
*/
|
|
77
|
+
outcome: 'minted' | 'lost' | 'contended' | 'usage-error';
|
|
78
|
+
exitCode: 0 | 1 | 2 | 3;
|
|
79
|
+
/** The new ADR's path (relative to repo root) on a WIN. */
|
|
80
|
+
adrPath?: string;
|
|
81
|
+
/** A human-readable summary. */
|
|
82
|
+
message: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Mint a NEW, SELF-CONTAINED ADR FROM an answered observation (the agentic apply
|
|
86
|
+
* `mint-adr` verdict, US #2): CAS-create `docs/adr/<slug>.md` keyed on the new
|
|
87
|
+
* ADR's identity (its path), with the source observation + its answered sidecar
|
|
88
|
+
* `git rm`-ed IN THE SAME atomic commit. The mint is ONE commit (create + delete).
|
|
89
|
+
*
|
|
90
|
+
* The minted body is built FROM the source + the answered question(s) (see
|
|
91
|
+
* {@link buildAdrBody}) so an engineer can read the decision's WHY from the ADR
|
|
92
|
+
* ALONE — that self-containment is the PRECONDITION for the same-commit deletion
|
|
93
|
+
* of the source. An agent-drafted `adrBody` (when present) is used verbatim.
|
|
94
|
+
*
|
|
95
|
+
* The CAS-create is the new-item-creation helper ({@link createItemThroughCas}):
|
|
96
|
+
* a same-slug ADR race needs NO special case — exactly one creator lands the
|
|
97
|
+
* file, the LOSER fails the CAS (exit 2) and backs off WITHOUT deleting the
|
|
98
|
+
* source (so a retry can re-mint). The source (+ its sidecar) is deleted ONLY on a
|
|
99
|
+
* WIN, riding the winning creator's commit.
|
|
100
|
+
*/
|
|
101
|
+
export declare function mintAdr(options: MintAdrOptions): Promise<MintAdrResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Build a SELF-CONTAINED ADR file FROM an answered observation + its answer(s),
|
|
104
|
+
* in the repo's existing `docs/adr/` shape (recorded `## Decisions`): a `---`
|
|
105
|
+
* frontmatter fence (`title` / `status: accepted` / `created`) then a
|
|
106
|
+
* `# ADR: {title}` heading and the three ADR-FORMAT sections — **Context**
|
|
107
|
+
* (the source signal that prompted the decision), **Decision** (what was decided,
|
|
108
|
+
* from the human's answer), and **Why** (the rationale the answer carries). The
|
|
109
|
+
* decision's WHY is carried IN (the answer prose), so the ADR reads alone — the
|
|
110
|
+
* precondition for deleting the source in the same commit.
|
|
111
|
+
*
|
|
112
|
+
* The mechanism prose of the observation (everything before its first
|
|
113
|
+
* `## Open questions` heading, frontmatter dropped) seeds Context; the
|
|
114
|
+
* question(s)+answer(s) seed Decision + Why. When no answers are threaded the
|
|
115
|
+
* Decision/Why fall back to the observation's prose so the file is never empty.
|
|
116
|
+
*/
|
|
117
|
+
export declare function buildAdrBody(input: {
|
|
118
|
+
slug: string;
|
|
119
|
+
title: string;
|
|
120
|
+
observation: string;
|
|
121
|
+
answers: {
|
|
122
|
+
question: string;
|
|
123
|
+
answer: string;
|
|
124
|
+
}[];
|
|
125
|
+
}): string;
|
|
126
|
+
//# sourceMappingURL=mint-adr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mint-adr.d.ts","sourceRoot":"","sources":["../src/mint-adr.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,mBAAmB,EAExB,MAAM,qBAAqB,CAAC;AAqE7B,0EAA0E;AAC1E,qBAAa,YAAa,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,MAAM,WAAW,cAAc;IAC9B,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAC/C,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,6E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