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,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small, shared **bounded exponential-backoff** retry helper for git / provider
|
|
3
|
+
* NETWORK ops on the needs-attention route (the OBSERVABLE surface push, the
|
|
4
|
+
* RECOVERABLE branch push, and the propose-mode PR create). The route does a
|
|
5
|
+
* LOCAL move that always succeeds offline, then these best-effort remote ops; a
|
|
6
|
+
* transient OUTAGE (unreachable arbiter / flaky provider) should be RETRIED a few
|
|
7
|
+
* times with a temporal delay before a clean BOUNDED give-up into the local-only
|
|
8
|
+
* degraded state — never an indefinite hang, never an uncaught throw out of the
|
|
9
|
+
* failure handler.
|
|
10
|
+
*
|
|
11
|
+
* This is DELIBERATELY NOT the model in {@link file://./claim-cas.ts}: that loop
|
|
12
|
+
* retries CONTENTION (a REJECTED push — someone advanced the ref) INSTANTLY with
|
|
13
|
+
* NO delay, refetching+rebuilding against the new base. THIS helper is for the
|
|
14
|
+
* OUTAGE/unreachable case, which needs a temporal back-off (the remote may come
|
|
15
|
+
* back); the two are distinct and must not be conflated.
|
|
16
|
+
*
|
|
17
|
+
* Bounds (all configurable, sensible defaults):
|
|
18
|
+
* - `initialDelayMs` (X): the first inter-attempt delay.
|
|
19
|
+
* - `maxDelayMs` (Y): the cap the exponentially-growing delay never exceeds.
|
|
20
|
+
* - `maxTotalMs` (Z): the wall-clock budget; once the NEXT delay would push the
|
|
21
|
+
* cumulative sleep past this, we stop retrying (a clean bounded give-up).
|
|
22
|
+
* - `maxAttempts`: a hard upper bound on attempts (a belt-and-braces cap so a
|
|
23
|
+
* tiny/zero delay budget still terminates).
|
|
24
|
+
*
|
|
25
|
+
* The SLEEP is INJECTABLE (reusing the `sleep?: (ms) => Promise<void>` /
|
|
26
|
+
* `realSleep` seam `src/run.ts` already uses for the inter-tick sleep) so tests
|
|
27
|
+
* drive the whole retry TIMELINE deterministically with NO real wall-clock waits.
|
|
28
|
+
*
|
|
29
|
+
* Model-endpoint retries are NOT this helper's job — the pi harness retries its
|
|
30
|
+
* own API. This is git/provider network resilience only.
|
|
31
|
+
*/
|
|
32
|
+
/** The default real sleep (a `setTimeout`-backed promise). */
|
|
33
|
+
export const realSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
34
|
+
/**
|
|
35
|
+
* The default bounds: a short first delay growing exponentially to a modest cap,
|
|
36
|
+
* with a small total budget — enough to ride out a blip, NOT a hang. A clean
|
|
37
|
+
* bounded give-up into the local-only degraded state beats waiting forever;
|
|
38
|
+
* CI/humans then retry deliberately.
|
|
39
|
+
*/
|
|
40
|
+
export const DEFAULT_BACKOFF = {
|
|
41
|
+
initialDelayMs: 500,
|
|
42
|
+
maxDelayMs: 8_000,
|
|
43
|
+
maxTotalMs: 30_000,
|
|
44
|
+
maxAttempts: 6,
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Run `op` and, if it reports failure, RETRY it with bounded exponential backoff
|
|
48
|
+
* until it succeeds or the bounds are exhausted (then a clean give-up — NEVER an
|
|
49
|
+
* indefinite loop). `op` reports failure in EITHER of two ways, both treated the
|
|
50
|
+
* same so callers can use whichever fits the underlying API:
|
|
51
|
+
*
|
|
52
|
+
* - it RETURNS `{ok: false, error?}` (e.g. a git `RunResult` mapped to a
|
|
53
|
+
* boolean — a non-zero exit is a failure, not a throw), OR
|
|
54
|
+
* - it THROWS (e.g. a git plumbing helper's hard-fetch against an unreachable
|
|
55
|
+
* remote) — the throw is CAUGHT here and treated as a failed attempt.
|
|
56
|
+
*
|
|
57
|
+
* On success it returns `{ok: true, value}`. On exhaustion it returns
|
|
58
|
+
* `{ok: false, lastError}` — it NEVER throws out (the route must not crash on a
|
|
59
|
+
* git outage). The delay schedule is `initialDelayMs`, doubling each attempt up
|
|
60
|
+
* to `maxDelayMs`, stopping once another attempt's delay would exceed the
|
|
61
|
+
* `maxTotalMs` budget or `maxAttempts` is reached.
|
|
62
|
+
*/
|
|
63
|
+
export async function retryWithBackoff(op, options = {}) {
|
|
64
|
+
const initialDelayMs = options.initialDelayMs ?? DEFAULT_BACKOFF.initialDelayMs;
|
|
65
|
+
const maxDelayMs = options.maxDelayMs ?? DEFAULT_BACKOFF.maxDelayMs;
|
|
66
|
+
const maxTotalMs = options.maxTotalMs ?? DEFAULT_BACKOFF.maxTotalMs;
|
|
67
|
+
const maxAttempts = options.maxAttempts ?? DEFAULT_BACKOFF.maxAttempts;
|
|
68
|
+
const sleep = options.sleep ?? realSleep;
|
|
69
|
+
let attempts = 0;
|
|
70
|
+
let elapsed = 0;
|
|
71
|
+
let delay = initialDelayMs;
|
|
72
|
+
let lastError;
|
|
73
|
+
// eslint-disable-next-line no-constant-condition
|
|
74
|
+
while (true) {
|
|
75
|
+
attempts++;
|
|
76
|
+
try {
|
|
77
|
+
const r = await op();
|
|
78
|
+
if (r.ok) {
|
|
79
|
+
return { ok: true, value: r.value, attempts };
|
|
80
|
+
}
|
|
81
|
+
lastError = r.error;
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
lastError = err instanceof Error ? err.message : String(err);
|
|
85
|
+
}
|
|
86
|
+
// Decide whether ANOTHER attempt is allowed (bounded give-up, not a hang).
|
|
87
|
+
if (attempts >= maxAttempts) {
|
|
88
|
+
return { ok: false, attempts, lastError };
|
|
89
|
+
}
|
|
90
|
+
if (elapsed + delay > maxTotalMs) {
|
|
91
|
+
return { ok: false, attempts, lastError };
|
|
92
|
+
}
|
|
93
|
+
await sleep(delay);
|
|
94
|
+
elapsed += delay;
|
|
95
|
+
delay = Math.min(delay * 2, maxDelayMs);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=retry-backoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-backoff.js","sourceRoot":"","sources":["../src/retry-backoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,SAAS,GAAU,CAAC,EAAU,EAAiB,EAAE,CAC7D,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAgBnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAA4C;IACvE,cAAc,EAAE,GAAG;IACnB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,CAAC;CACd,CAAC;AAOF;;;;;;;;;;;;;;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AAG,KAAK,GAAG,UAAU,EAAE,CAAC;YAClC,OAAO,EAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAC,CAAC;QACzC,CAAC;QAED,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO,IAAI,KAAK,CAAC;QACjB,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { type Harness } from './harness.js';
|
|
2
|
+
import { type ReviewVerdict } from './review-verdict.js';
|
|
3
|
+
export { parseReviewVerdict, ReviewParseError, type ReviewFinding, type ReviewVerdict, } from './review-verdict.js';
|
|
4
|
+
/**
|
|
5
|
+
* **Gate 2 — the PR/code review gate** (GATES prd `work/prds/tasked/review.md`), the
|
|
6
|
+
* JUDGEMENT layer that rides ON TOP of the deterministic `verify` floor (ADR §8).
|
|
7
|
+
*
|
|
8
|
+
* After the green `verify` and BEFORE the done-move, `complete`/`do` invoke the
|
|
9
|
+
* `review` SKILL (`skills/review/SKILL.md`) as a **fresh-context** agent — its
|
|
10
|
+
* OWN harness launch, never the builder's session — to read the diff against the
|
|
11
|
+
* task it claims and EMIT a verdict. The verdict is then ROUTED by the caller
|
|
12
|
+
* (`complete.ts`): `approve` → done-move/commit/integrate; `block` → the SAME
|
|
13
|
+
* `needs-attention` machinery the red gate uses (never a merge).
|
|
14
|
+
*
|
|
15
|
+
* This module is the SEAM (the {@link ReviewGate} function type) + its
|
|
16
|
+
* production harness-backed implementation ({@link harnessReviewGate}). The seam
|
|
17
|
+
* is injectable exactly like `do`'s `dorfl`: tests stub a canned
|
|
18
|
+
* `approve`/`block` verdict (no real model); production launches the review agent
|
|
19
|
+
* through the EXISTING harness seam ({@link Harness}/`LaunchInput`), routing the
|
|
20
|
+
* `reviewModel` override through `LaunchInput.model` / {@link substituteModel} —
|
|
21
|
+
* NOT a new model/launch mechanism (the §13 model-routing intent).
|
|
22
|
+
*
|
|
23
|
+
* Determinism boundary (ADR §8), explicit: review is a JUDGEMENT gate, never a
|
|
24
|
+
* replacement for `verify`. `verify` stays the non-skippable model-free floor;
|
|
25
|
+
* review runs ON TOP, only when `review` resolves on.
|
|
26
|
+
*/
|
|
27
|
+
/** What the review gate needs to launch a fresh-context review of one task. */
|
|
28
|
+
export interface ReviewGateInput {
|
|
29
|
+
/** The slug under review (the task the diff claims to deliver). */
|
|
30
|
+
slug: string;
|
|
31
|
+
/** The working clone/checkout the gate runs in (the prepared work branch). */
|
|
32
|
+
cwd: string;
|
|
33
|
+
/**
|
|
34
|
+
* The model the REVIEW agent runs on (`reviewModel`, de-correlated from the
|
|
35
|
+
* builder). `undefined` ⇒ no forced model (the harness's own default). Flows
|
|
36
|
+
* to the launch through `LaunchInput.model` / {@link substituteModel}.
|
|
37
|
+
*/
|
|
38
|
+
reviewModel?: string;
|
|
39
|
+
/** Which review ROUND this is (1-based), for the revise↔review loop bound. */
|
|
40
|
+
round: number;
|
|
41
|
+
/**
|
|
42
|
+
* `--watch`: tail the REVIEW agent's pi session `.jsonl` live, the SAME way the
|
|
43
|
+
* build agent's is tailed (task `watch-review-session`). Threaded in from the
|
|
44
|
+
* caller's `CompleteOptions`/`DoOptions` so the production gate
|
|
45
|
+
* ({@link harnessReviewGate}) can route its launch through the shared
|
|
46
|
+
* {@link launchWithOptionalWatch} helper. OFF (the default) ⇒ the gate does a
|
|
47
|
+
* plain sync `launch`, byte-identical to before. A pure observer — it never
|
|
48
|
+
* changes the verdict.
|
|
49
|
+
*/
|
|
50
|
+
watch?: boolean;
|
|
51
|
+
/** Where the tailed review lines are written (defaults to stderr). */
|
|
52
|
+
watchSink?: (line: string) => void;
|
|
53
|
+
/** Emit ANSI colour in the tailed review lines (the caller's TTY decision). */
|
|
54
|
+
color?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The HOST-ONLY sessions root the review session FILE is generated under
|
|
57
|
+
* (resolved `config.sessionsDir`). `undefined` ⇒ pi's per-cwd default. Same
|
|
58
|
+
* bridge the build launch uses; the review launch passes a DISTINCT session id
|
|
59
|
+
* (`<slug>-review`) under it so its session never collides with the build's.
|
|
60
|
+
*/
|
|
61
|
+
sessionsDir?: string;
|
|
62
|
+
/** Environment for the review-agent launch. */
|
|
63
|
+
env?: NodeJS.ProcessEnv;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The review-gate SEAM: run a fresh-context review of the slug's diff and return
|
|
67
|
+
* a parsed verdict. Injected by tests (a canned verdict, no real model);
|
|
68
|
+
* production uses {@link harnessReviewGate}. Mirrors `do`'s `DoDorfl`
|
|
69
|
+
* injectable-seam shape so the gate wiring is testable as pure logic.
|
|
70
|
+
*/
|
|
71
|
+
export type ReviewGate = (input: ReviewGateInput) => Promise<ReviewVerdict>;
|
|
72
|
+
/**
|
|
73
|
+
* Render the review-agent PROMPT: instruct a fresh-context agent to apply the
|
|
74
|
+
* **review discipline** (`work/protocol/REVIEW-PROTOCOL.md`) to the code
|
|
75
|
+
* changes on this work branch against the task that specified them, and to
|
|
76
|
+
* EMIT a single unified `ReviewVerdict` JSON object (so
|
|
77
|
+
* {@link parseReviewVerdict} can read it). The discipline body (the lenses +
|
|
78
|
+
* the destination check) lives in `REVIEW-PROTOCOL.md` — NOT inlined here —
|
|
79
|
+
* and the JSON-emitted-shape contract comes from
|
|
80
|
+
* {@link verdictContractPrompt}, the ONE shared helper called by all four
|
|
81
|
+
* review-prompt builders (task `review-protocol-doc-and-shared-machinery`).
|
|
82
|
+
*
|
|
83
|
+
* This builder owns ONLY the PER-BUILDER framing: who you are (Gate 2 — PR/code
|
|
84
|
+
* review), what you are reviewing (code-vs-its-task, the diff on this work
|
|
85
|
+
* branch), and which optional verdict channels to fill (the `review` prose for
|
|
86
|
+
* the in-core PR-comment poster; an in-scope DECISION ratification hunt; a
|
|
87
|
+
* conceptual-coherence check). The shared discipline body and the verdict
|
|
88
|
+
* contract are NOT duplicated here.
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildReviewPrompt(slug: string): string;
|
|
91
|
+
/** What a harness-backed review gate needs to launch the review agent. */
|
|
92
|
+
export interface HarnessReviewGateOptions {
|
|
93
|
+
/** The harness seam used to launch the fresh-context review agent. */
|
|
94
|
+
harness?: Harness;
|
|
95
|
+
/** The agent command the null/shell adapter shells out to (`{model}`-aware). */
|
|
96
|
+
agentCmd?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Read the review agent's textual output for parsing. The harness now surfaces
|
|
99
|
+
* the agent's final assistant message in `LaunchResult.output` (task
|
|
100
|
+
* `harness-agent-output`, Option C) — the ANSWER channel, distinct from
|
|
101
|
+
* `detail` (the failure/`stderr` channel). Production reads `launched.output`;
|
|
102
|
+
* tests inject `readOutput` to stub a canned verdict string. The reader is
|
|
103
|
+
* passed the launch's `output` and returns the text to parse.
|
|
104
|
+
*/
|
|
105
|
+
readOutput?: (output: string | undefined) => string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The PRODUCTION review gate: launch the `review` SKILL as a fresh-context agent
|
|
109
|
+
* through the EXISTING harness seam, routing the `reviewModel` override via
|
|
110
|
+
* `LaunchInput.model` (the §13 model-routing intent — NOT a new mechanism), then
|
|
111
|
+
* parse the emitted `{verdict, findings}`.
|
|
112
|
+
*
|
|
113
|
+
* It is a SEPARATE harness launch (fresh context = not the builder's session) in
|
|
114
|
+
* the same checkout `cwd` (the prepared, gated work branch). The launch is fed
|
|
115
|
+
* {@link buildReviewPrompt}; the model flows through `LaunchInput.model`, which
|
|
116
|
+
* each adapter injects natively (pi: `--model`; null/shell: the `{model}`
|
|
117
|
+
* placeholder via {@link substituteModel}). auth/keys stay the harness's job.
|
|
118
|
+
*/
|
|
119
|
+
export declare function harnessReviewGate(options?: HarnessReviewGateOptions): ReviewGate;
|
|
120
|
+
/**
|
|
121
|
+
* Render the TASK-SET acceptance-gate PROMPT — the task-path mirror of
|
|
122
|
+
* {@link buildReviewPrompt} (task `slice-acceptance-gate`). Instead of
|
|
123
|
+
* reviewing a code diff against ONE task, this instructs a FRESH-CONTEXT
|
|
124
|
+
* agent to review the WHOLE candidate SET of tasks produced for prd `slug`,
|
|
125
|
+
* using the **review discipline**'s SET-OF-TASKS lens (coherence / dependency
|
|
126
|
+
* graph / gaps + overlap / "if every task is built exactly as written, do we
|
|
127
|
+
* reach the system the prd describes, and is each task
|
|
128
|
+
* correct-if-implemented?"). It emits the SAME unified `ReviewVerdict` shape
|
|
129
|
+
* so {@link parseReviewVerdict} reads it identically.
|
|
130
|
+
*
|
|
131
|
+
* This is a TERMINAL, ONE-SHOT accept/reject gate (it runs BEFORE the task
|
|
132
|
+
* set integrates) — NOT the tasker IMPROVER loop (`tasker-review-loop.ts`),
|
|
133
|
+
* which EDITS tasks between passes. This prompt explicitly forbids editing.
|
|
134
|
+
*
|
|
135
|
+
* Per-builder framing only — the discipline body lives in
|
|
136
|
+
* `work/protocol/REVIEW-PROTOCOL.md`; the JSON shape comes from
|
|
137
|
+
* {@link verdictContractPrompt}.
|
|
138
|
+
*/
|
|
139
|
+
export declare function buildTaskAcceptancePrompt(slug: string): string;
|
|
140
|
+
/**
|
|
141
|
+
* The PRODUCTION task-SET acceptance gate (task `slice-acceptance-gate`): the
|
|
142
|
+
* task-path mirror of {@link harnessReviewGate}. It launches the `review` SKILL
|
|
143
|
+
* as a fresh-context agent through the SAME harness seam, routing the
|
|
144
|
+
* `reviewModel` override via `LaunchInput.model`, then parses the emitted
|
|
145
|
+
* `{verdict, findings}` — IDENTICAL machinery to the build gate, differing ONLY
|
|
146
|
+
* in the PROMPT ({@link buildTaskAcceptancePrompt}, a task-SET review) and in
|
|
147
|
+
* being driven ONE-SHOT by the caller (the tasking path passes
|
|
148
|
+
* `reviewMaxRounds: 1`).
|
|
149
|
+
*
|
|
150
|
+
* Reuses the `ReviewGate` seam type verbatim so `performIntegration`'s review
|
|
151
|
+
* block runs it with no shape change. The review uses a DISTINCT session id
|
|
152
|
+
* (`<slug>-task-acceptance`) so it never collides with the build review session
|
|
153
|
+
* OR the tasker improver loop's review session. NAME: `harnessTaskAcceptanceGate`
|
|
154
|
+
* (the ACCEPTANCE gate), DISTINCT from `tasker-review-loop.ts`'s
|
|
155
|
+
* `harnessTaskReviewGate` (the IMPROVER loop seam, which EDITS tasks) — the two
|
|
156
|
+
* are non-overlapping concepts (gate = terminal pass/fail; loop = review→edit).
|
|
157
|
+
*/
|
|
158
|
+
export declare function harnessTaskAcceptanceGate(options?: HarnessReviewGateOptions): ReviewGate;
|
|
159
|
+
/**
|
|
160
|
+
* Format a review's BLOCKING findings into a needs-attention reason string —
|
|
161
|
+
* recorded in the item body when the gate routes a `block` (the SAME body-prose
|
|
162
|
+
* mechanism the red gate's reason uses; WORK-CONTRACT rule 3). Non-blocking
|
|
163
|
+
* findings are omitted from the reason (they do not block). On exhaustion of
|
|
164
|
+
* `reviewMaxRounds`, {@link reviewRoundsExhaustedReason} is used instead.
|
|
165
|
+
*/
|
|
166
|
+
export declare function formatBlockReason(verdict: ReviewVerdict): string;
|
|
167
|
+
/**
|
|
168
|
+
* The needs-attention reason when Gate 2 does not reach a UNANIMOUS approve —
|
|
169
|
+
* either a round returned a (terminal) block, or not all `reviewMaxRounds` rounds
|
|
170
|
+
* corroborated the approve.
|
|
171
|
+
*/
|
|
172
|
+
export declare function reviewRoundsExhaustedReason(maxRounds: number): string;
|
|
173
|
+
//# sourceMappingURL=review-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-gate.d.ts","sourceRoot":"","sources":["../src/review-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,OAAO,EAAC,MAAM,cAAc,CAAC;AAGxE,OAAO,EAMN,KAAK,aAAa,EAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,GAClB,MAAM,qBAAqB,CAAC;AAE7B;;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iBG;AACH,wBAAgB,yBAAyB,CACxC,OAAO,GAAE,wBAA6B,GACpC,UAAU,CAoCZ;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAQhE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMrE"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { NullHarness } from './harness.js';
|
|
2
|
+
import { launchWithOptionalWatch } from './agent-launch.js';
|
|
3
|
+
import { boundaryLine } from './watch-session.js';
|
|
4
|
+
import { parseReviewVerdict, ReviewParseError, reviewDisciplinePrompt, verdictContractPrompt, } from './review-verdict.js';
|
|
5
|
+
export { parseReviewVerdict, ReviewParseError, } from './review-verdict.js';
|
|
6
|
+
/**
|
|
7
|
+
* Render the review-agent PROMPT: instruct a fresh-context agent to apply the
|
|
8
|
+
* **review discipline** (`work/protocol/REVIEW-PROTOCOL.md`) to the code
|
|
9
|
+
* changes on this work branch against the task that specified them, and to
|
|
10
|
+
* EMIT a single unified `ReviewVerdict` JSON object (so
|
|
11
|
+
* {@link parseReviewVerdict} can read it). The discipline body (the lenses +
|
|
12
|
+
* the destination check) lives in `REVIEW-PROTOCOL.md` — NOT inlined here —
|
|
13
|
+
* and the JSON-emitted-shape contract comes from
|
|
14
|
+
* {@link verdictContractPrompt}, the ONE shared helper called by all four
|
|
15
|
+
* review-prompt builders (task `review-protocol-doc-and-shared-machinery`).
|
|
16
|
+
*
|
|
17
|
+
* This builder owns ONLY the PER-BUILDER framing: who you are (Gate 2 — PR/code
|
|
18
|
+
* review), what you are reviewing (code-vs-its-task, the diff on this work
|
|
19
|
+
* branch), and which optional verdict channels to fill (the `review` prose for
|
|
20
|
+
* the in-core PR-comment poster; an in-scope DECISION ratification hunt; a
|
|
21
|
+
* conceptual-coherence check). The shared discipline body and the verdict
|
|
22
|
+
* contract are NOT duplicated here.
|
|
23
|
+
*/
|
|
24
|
+
export function buildReviewPrompt(slug) {
|
|
25
|
+
return [
|
|
26
|
+
`You are a FRESH-CONTEXT reviewer (Gate 2 — PR/code review). Review the`,
|
|
27
|
+
`code changes on this work branch AGAINST the task that specified them`,
|
|
28
|
+
`(work/in-progress/${slug}.md or work/done/${slug}.md) and its source prd.`,
|
|
29
|
+
``,
|
|
30
|
+
reviewDisciplinePrompt(),
|
|
31
|
+
``,
|
|
32
|
+
`The acceptance gate (Gate 1 — build + tests + format) has ALREADY passed`,
|
|
33
|
+
`and is GREEN before you run (review runs only on a green gate), so ASSUME`,
|
|
34
|
+
`it is green and do NOT re-run build/tests/format — that is settled. You may`,
|
|
35
|
+
`still READ and reason about the tests for coverage/judgement; just do not`,
|
|
36
|
+
`re-execute the suite. Spend your budget on JUDGEMENT.`,
|
|
37
|
+
`Do NOT edit any files, run no git — you EMIT a verdict only.`,
|
|
38
|
+
``,
|
|
39
|
+
`ALSO HUNT for IN-SCOPE DECISIONS THE TASK DID NOT SPECIFY — a non-obvious`,
|
|
40
|
+
`design choice the agent made on its own while building: a CROSS-TASK`,
|
|
41
|
+
`INTERACTION (a choice affecting another command/flag/task's behaviour), a new`,
|
|
42
|
+
`ERROR/REFUSAL, or a user-visible DEFAULT. The agent SHOULD have recorded these`,
|
|
43
|
+
`in a "## Decisions" block in its PR description — START from that block (ratify`,
|
|
44
|
+
`each entry) AND hunt for any it MISSED. Flag EACH such decision as a finding`,
|
|
45
|
+
`for the human to RATIFY — "non-blocking" by DEFAULT (the build proceeds; the`,
|
|
46
|
+
`human ratifies or reverses), escalating to "blocking" ONLY if the decision looks`,
|
|
47
|
+
`WRONG or is genuinely load-bearing-and-hard-to-reverse. An un-recorded in-scope`,
|
|
48
|
+
`decision is NOT itself a block — it is a ratification finding.`,
|
|
49
|
+
``,
|
|
50
|
+
`ALSO CHECK CONCEPTUAL COHERENCE — does this diff fit the system's existing`,
|
|
51
|
+
`LANGUAGE? For each concept / flag / config key / status / verb it introduces or`,
|
|
52
|
+
`touches: (a) is the term used CONSISTENTLY with how it is already defined`,
|
|
53
|
+
`elsewhere (CONTEXT.md glossary + the ADRs + the code), not silently re-meaning`,
|
|
54
|
+
`an existing word or meaning two things in two places? (b) is the concept at the`,
|
|
55
|
+
`RIGHT LAYER (e.g. a policy gate on the autonomous-SELECTION step vs the explicit`,
|
|
56
|
+
`VERB someone typed)? (c) does it DUPLICATE/overlap an existing concept it should`,
|
|
57
|
+
`reuse or rename instead of forking? A mechanism that is correct in isolation but`,
|
|
58
|
+
`INCOHERENT against the system's language is a defect — BLOCK if it re-means or`,
|
|
59
|
+
`forks a load-bearing concept or sits at the wrong layer; otherwise flag it as a`,
|
|
60
|
+
`coherence finding.`,
|
|
61
|
+
``,
|
|
62
|
+
verdictContractPrompt(),
|
|
63
|
+
``,
|
|
64
|
+
`Fill the "review" field: a human-readable REVIEW that gets posted as a`,
|
|
65
|
+
`comment on the PR — write it FOR a human landing there, NOT as scratch`,
|
|
66
|
+
`thinking. LEAD with the verdict ("Approved" or "Blocked") and then give the`,
|
|
67
|
+
`lenses' reasoning and the destination check ("merged as written, do we reach`,
|
|
68
|
+
`the task/prd goal?"). Write it deliberately; do NOT narrate your process`,
|
|
69
|
+
`("Let me check…"). Keep it TIGHT: aim for a few short sentences and DO NOT`,
|
|
70
|
+
`exceed ~1500 characters — a long, multi-paragraph field is exactly what`,
|
|
71
|
+
`corrupts the JSON on large diffs; say less, not more. It is plain text inside`,
|
|
72
|
+
`the JSON string (escape any newline as \\n; better, keep it to ONE line). Do`,
|
|
73
|
+
`NOT fill "edits"/"edit"/`,
|
|
74
|
+
`"questions"/"uncertainTasks"/"decompositionUnclear" — those channels are`,
|
|
75
|
+
`for other review callers (the tasker loop / the lone-task review), not this`,
|
|
76
|
+
`code-review gate.`,
|
|
77
|
+
].join('\n');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The PRODUCTION review gate: launch the `review` SKILL as a fresh-context agent
|
|
81
|
+
* through the EXISTING harness seam, routing the `reviewModel` override via
|
|
82
|
+
* `LaunchInput.model` (the §13 model-routing intent — NOT a new mechanism), then
|
|
83
|
+
* parse the emitted `{verdict, findings}`.
|
|
84
|
+
*
|
|
85
|
+
* It is a SEPARATE harness launch (fresh context = not the builder's session) in
|
|
86
|
+
* the same checkout `cwd` (the prepared, gated work branch). The launch is fed
|
|
87
|
+
* {@link buildReviewPrompt}; the model flows through `LaunchInput.model`, which
|
|
88
|
+
* each adapter injects natively (pi: `--model`; null/shell: the `{model}`
|
|
89
|
+
* placeholder via {@link substituteModel}). auth/keys stay the harness's job.
|
|
90
|
+
*/
|
|
91
|
+
export function harnessReviewGate(options = {}) {
|
|
92
|
+
const harness = options.harness ?? new NullHarness();
|
|
93
|
+
const readOutput = options.readOutput ?? ((output) => output ?? '');
|
|
94
|
+
return async (input) => {
|
|
95
|
+
// When watching, print the build→review BOUNDARY banner so the human knows
|
|
96
|
+
// the build stream ended and the review stream is beginning (reuses the watch
|
|
97
|
+
// formatting; task `watch-review-session`). A pure observability line.
|
|
98
|
+
if (input.watch === true) {
|
|
99
|
+
const sink = input.watchSink ??
|
|
100
|
+
((line) => process.stderr.write(`${line}\n`));
|
|
101
|
+
sink(boundaryLine(`review gate — reviewing ${input.slug}…`, input.color ?? false));
|
|
102
|
+
}
|
|
103
|
+
// The SAME shared launch helper the BUILD launch uses (task
|
|
104
|
+
// `watch-review-session`) — NOT a copy of the watch block. When `watch` is on
|
|
105
|
+
// (pi harness), it tails the review session `.jsonl` live; OFF, it does a
|
|
106
|
+
// plain sync `launch`, byte-identical to before. The review uses a DISTINCT
|
|
107
|
+
// session id (`<slug>-review`) so it never collides with the build session.
|
|
108
|
+
const launched = await launchWithOptionalWatch({
|
|
109
|
+
harness,
|
|
110
|
+
dir: input.cwd,
|
|
111
|
+
slug: input.slug,
|
|
112
|
+
command: options.agentCmd ?? '',
|
|
113
|
+
prompt: buildReviewPrompt(input.slug),
|
|
114
|
+
// The reviewModel override rides the EXISTING model-routing seam.
|
|
115
|
+
model: input.reviewModel,
|
|
116
|
+
sessionId: `${input.slug}-review`,
|
|
117
|
+
sessionsDir: input.sessionsDir,
|
|
118
|
+
watch: input.watch,
|
|
119
|
+
watchSink: input.watchSink,
|
|
120
|
+
color: input.color,
|
|
121
|
+
env: input.env,
|
|
122
|
+
});
|
|
123
|
+
if (!launched.ok) {
|
|
124
|
+
throw new ReviewParseError(`review agent launch failed${launched.detail ? `: ${launched.detail}` : ''}`);
|
|
125
|
+
}
|
|
126
|
+
// Read the verdict from the agent's ANSWER channel (`output`), NOT `detail`
|
|
127
|
+
// (which is empty on success). An empty/absent output → parseReviewVerdict
|
|
128
|
+
// throws ReviewParseError → needs-attention (never a silent approve).
|
|
129
|
+
return parseReviewVerdict(readOutput(launched.output));
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Render the TASK-SET acceptance-gate PROMPT — the task-path mirror of
|
|
134
|
+
* {@link buildReviewPrompt} (task `slice-acceptance-gate`). Instead of
|
|
135
|
+
* reviewing a code diff against ONE task, this instructs a FRESH-CONTEXT
|
|
136
|
+
* agent to review the WHOLE candidate SET of tasks produced for prd `slug`,
|
|
137
|
+
* using the **review discipline**'s SET-OF-TASKS lens (coherence / dependency
|
|
138
|
+
* graph / gaps + overlap / "if every task is built exactly as written, do we
|
|
139
|
+
* reach the system the prd describes, and is each task
|
|
140
|
+
* correct-if-implemented?"). It emits the SAME unified `ReviewVerdict` shape
|
|
141
|
+
* so {@link parseReviewVerdict} reads it identically.
|
|
142
|
+
*
|
|
143
|
+
* This is a TERMINAL, ONE-SHOT accept/reject gate (it runs BEFORE the task
|
|
144
|
+
* set integrates) — NOT the tasker IMPROVER loop (`tasker-review-loop.ts`),
|
|
145
|
+
* which EDITS tasks between passes. This prompt explicitly forbids editing.
|
|
146
|
+
*
|
|
147
|
+
* Per-builder framing only — the discipline body lives in
|
|
148
|
+
* `work/protocol/REVIEW-PROTOCOL.md`; the JSON shape comes from
|
|
149
|
+
* {@link verdictContractPrompt}.
|
|
150
|
+
*/
|
|
151
|
+
export function buildTaskAcceptancePrompt(slug) {
|
|
152
|
+
return [
|
|
153
|
+
`You are a FRESH-CONTEXT reviewer (the task-SET ACCEPTANCE GATE). Review`,
|
|
154
|
+
`the candidate tasks this tasking run produced for the prd "${slug}" — the`,
|
|
155
|
+
`new/changed candidate task files on this work branch — AGAINST their source`,
|
|
156
|
+
`prd (work/prds/ready/${slug}.md — the held prd stays in prds/ready/ while it is being`,
|
|
157
|
+
`tasked).`,
|
|
158
|
+
``,
|
|
159
|
+
reviewDisciplinePrompt(),
|
|
160
|
+
``,
|
|
161
|
+
`Review the WHOLE SET as a SET, not each task in isolation. The set-level`,
|
|
162
|
+
`framings the review discipline names:`,
|
|
163
|
+
` - COHERENCE — do the tasks speak the prd's (and the system's) language`,
|
|
164
|
+
` consistently; no task re-means or forks a concept another task/the prd`,
|
|
165
|
+
` already owns?`,
|
|
166
|
+
` - DEPENDENCY GRAPH — is the \`blockedBy\`/ordering graph sound (acyclic, the`,
|
|
167
|
+
` keystone first, each task's stated blockers really land its premise)?`,
|
|
168
|
+
` - GAPS + OVERLAP — does the set COVER the prd with no missing piece, and`,
|
|
169
|
+
` without two tasks doing the same work or fighting over the same seam?`,
|
|
170
|
+
` - CORRECT-IF-IMPLEMENTED — if EVERY task is built EXACTLY as written, do we`,
|
|
171
|
+
` reach the system the prd describes, and is each task individually`,
|
|
172
|
+
` correct-if-implemented (no task that compiles but builds the wrong thing)?`,
|
|
173
|
+
``,
|
|
174
|
+
`This is a TERMINAL one-shot accept/reject gate: do NOT edit any task, do NOT`,
|
|
175
|
+
`run git — you EMIT a verdict only (the tasker improver loop, a SEPARATE`,
|
|
176
|
+
`concept, is what edits tasks; this gate does not).`,
|
|
177
|
+
``,
|
|
178
|
+
verdictContractPrompt(),
|
|
179
|
+
``,
|
|
180
|
+
`Fill the "review" field: a human-readable REVIEW of the SET — write it FOR a`,
|
|
181
|
+
`human deciding whether to land these tasks. LEAD with the verdict`,
|
|
182
|
+
`("Approved" or "Blocked") and then give the lenses' reasoning and the`,
|
|
183
|
+
`destination check. Do NOT fill the improver-loop channels ("edits",`,
|
|
184
|
+
`"uncertainTasks", "decompositionUnclear") — this is a terminal gate, not the`,
|
|
185
|
+
`loop.`,
|
|
186
|
+
].join('\n');
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The PRODUCTION task-SET acceptance gate (task `slice-acceptance-gate`): the
|
|
190
|
+
* task-path mirror of {@link harnessReviewGate}. It launches the `review` SKILL
|
|
191
|
+
* as a fresh-context agent through the SAME harness seam, routing the
|
|
192
|
+
* `reviewModel` override via `LaunchInput.model`, then parses the emitted
|
|
193
|
+
* `{verdict, findings}` — IDENTICAL machinery to the build gate, differing ONLY
|
|
194
|
+
* in the PROMPT ({@link buildTaskAcceptancePrompt}, a task-SET review) and in
|
|
195
|
+
* being driven ONE-SHOT by the caller (the tasking path passes
|
|
196
|
+
* `reviewMaxRounds: 1`).
|
|
197
|
+
*
|
|
198
|
+
* Reuses the `ReviewGate` seam type verbatim so `performIntegration`'s review
|
|
199
|
+
* block runs it with no shape change. The review uses a DISTINCT session id
|
|
200
|
+
* (`<slug>-task-acceptance`) so it never collides with the build review session
|
|
201
|
+
* OR the tasker improver loop's review session. NAME: `harnessTaskAcceptanceGate`
|
|
202
|
+
* (the ACCEPTANCE gate), DISTINCT from `tasker-review-loop.ts`'s
|
|
203
|
+
* `harnessTaskReviewGate` (the IMPROVER loop seam, which EDITS tasks) — the two
|
|
204
|
+
* are non-overlapping concepts (gate = terminal pass/fail; loop = review→edit).
|
|
205
|
+
*/
|
|
206
|
+
export function harnessTaskAcceptanceGate(options = {}) {
|
|
207
|
+
const harness = options.harness ?? new NullHarness();
|
|
208
|
+
const readOutput = options.readOutput ?? ((output) => output ?? '');
|
|
209
|
+
return async (input) => {
|
|
210
|
+
if (input.watch === true) {
|
|
211
|
+
const sink = input.watchSink ??
|
|
212
|
+
((line) => process.stderr.write(`${line}\n`));
|
|
213
|
+
sink(boundaryLine(`task acceptance gate — reviewing ${input.slug}…`, input.color ?? false));
|
|
214
|
+
}
|
|
215
|
+
const launched = await launchWithOptionalWatch({
|
|
216
|
+
harness,
|
|
217
|
+
dir: input.cwd,
|
|
218
|
+
slug: input.slug,
|
|
219
|
+
command: options.agentCmd ?? '',
|
|
220
|
+
prompt: buildTaskAcceptancePrompt(input.slug),
|
|
221
|
+
model: input.reviewModel,
|
|
222
|
+
sessionId: `${input.slug}-task-acceptance`,
|
|
223
|
+
sessionsDir: input.sessionsDir,
|
|
224
|
+
watch: input.watch,
|
|
225
|
+
watchSink: input.watchSink,
|
|
226
|
+
color: input.color,
|
|
227
|
+
env: input.env,
|
|
228
|
+
});
|
|
229
|
+
if (!launched.ok) {
|
|
230
|
+
throw new ReviewParseError(`task acceptance gate launch failed${launched.detail ? `: ${launched.detail}` : ''}`);
|
|
231
|
+
}
|
|
232
|
+
return parseReviewVerdict(readOutput(launched.output));
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Format a review's BLOCKING findings into a needs-attention reason string —
|
|
237
|
+
* recorded in the item body when the gate routes a `block` (the SAME body-prose
|
|
238
|
+
* mechanism the red gate's reason uses; WORK-CONTRACT rule 3). Non-blocking
|
|
239
|
+
* findings are omitted from the reason (they do not block). On exhaustion of
|
|
240
|
+
* `reviewMaxRounds`, {@link reviewRoundsExhaustedReason} is used instead.
|
|
241
|
+
*/
|
|
242
|
+
export function formatBlockReason(verdict) {
|
|
243
|
+
const blocking = verdict.findings.filter((f) => f.severity === 'blocking');
|
|
244
|
+
const lines = (blocking.length > 0 ? blocking : verdict.findings).map((f) => {
|
|
245
|
+
const ctx = f.context ? ` (${f.context})` : '';
|
|
246
|
+
return `- ${f.question}${ctx}`;
|
|
247
|
+
});
|
|
248
|
+
const head = 'PR/code review (Gate 2) blocked this work:';
|
|
249
|
+
return lines.length > 0 ? `${head}\n${lines.join('\n')}` : head;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* The needs-attention reason when Gate 2 does not reach a UNANIMOUS approve —
|
|
253
|
+
* either a round returned a (terminal) block, or not all `reviewMaxRounds` rounds
|
|
254
|
+
* corroborated the approve.
|
|
255
|
+
*/
|
|
256
|
+
export function reviewRoundsExhaustedReason(maxRounds) {
|
|
257
|
+
return (`PR/code review (Gate 2) did not reach a unanimous approve across ` +
|
|
258
|
+
`reviewMaxRounds=${maxRounds} round(s) (a block is terminal and is never ` +
|
|
259
|
+
`re-rolled); forcing needs-attention (never silently merged or looped).`);
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=review-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-gate.js","sourceRoot":"","sources":["../src/review-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAgC,MAAM,cAAc,CAAC;AACxE,OAAO,EAAC,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GAGrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,kBAAkB,EAClB,gBAAgB,GAGhB,MAAM,qBAAqB,CAAC;AAyE7B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC7C,OAAO;QACN,wEAAwE;QACxE,uEAAuE;QACvE,qBAAqB,IAAI,oBAAoB,IAAI,0BAA0B;QAC3E,EAAE;QACF,sBAAsB,EAAE;QACxB,EAAE;QACF,0EAA0E;QAC1E,2EAA2E;QAC3E,6EAA6E;QAC7E,2EAA2E;QAC3E,uDAAuD;QACvD,8DAA8D;QAC9D,EAAE;QACF,2EAA2E;QAC3E,sEAAsE;QACtE,+EAA+E;QAC/E,gFAAgF;QAChF,iFAAiF;QACjF,8EAA8E;QAC9E,8EAA8E;QAC9E,kFAA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