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,359 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { run } from './git.js';
|
|
4
|
+
import { applyAtomic } from './sidecar-apply.js';
|
|
5
|
+
import { allAnswered, appendQuestions, parseSidecar, sidecarPathFor, } from './sidecar.js';
|
|
6
|
+
import { APPLY_LIFECYCLE_FOLDERS, resolveItemPathByIdentity, } from './item-path.js';
|
|
7
|
+
/**
|
|
8
|
+
* The engine-owned APPLY PERSIST (prd `advance-loop`, task `advance-rung-apply`;
|
|
9
|
+
* AGENTIC apply, task `agentic-apply-retire-disposition-vocabulary`) — the half of
|
|
10
|
+
* the APPLY rung the ENGINE owns. On `classify=apply` (ALL sidecar entries
|
|
11
|
+
* answered), it applies the HUMAN's answers to the item ATOMICALLY (item body +
|
|
12
|
+
* sidecar in ONE commit, via the sidecar contract's {@link applyAtomic}), then
|
|
13
|
+
* EITHER:
|
|
14
|
+
*
|
|
15
|
+
* - **append / re-pause** — when the apply has NEW questions to ask: append
|
|
16
|
+
* `qN+1…`, stay `needsAnswers:true`, re-pause (the "all answered?" flips back
|
|
17
|
+
* to false); OR
|
|
18
|
+
* - **discharge by deletion** — when the caller decided the SOURCE should leave
|
|
19
|
+
* by deletion (`discharge` set): `git rm` the source + sidecar in a STANDALONE
|
|
20
|
+
* revertible commit, the reason in the commit message (git history is the
|
|
21
|
+
* archive); OR
|
|
22
|
+
* - **resolve fully** (the default) — clear `needsAnswers` + DELETE the sidecar
|
|
23
|
+
* in the SAME atomic commit (the invariant `needsAnswers:false ⟺ no active
|
|
24
|
+
* sidecar`); the item advances toward build by its normal lifecycle.
|
|
25
|
+
*
|
|
26
|
+
* **The disposition vocabulary is GONE** (task
|
|
27
|
+
* `agentic-apply-retire-disposition-vocabulary`): the apply rung no longer reads a
|
|
28
|
+
* per-entry `disposition=` token, no longer runs a most-decisive picker, and has
|
|
29
|
+
* no `keep`/`triaged:keep` resting state. A sidecar entry is BINARY (no-answer |
|
|
30
|
+
* answered); what to DO with a fully-answered OBSERVATION is decided by the
|
|
31
|
+
* AGENTIC apply decision in the advance tick (`advance.ts` `applyRung` over the
|
|
32
|
+
* shared `decide` engine), which then routes here (re-pause / discharge / via
|
|
33
|
+
* `promoteObservation` for a mint). A signal is still-open, acted-on, or deleted
|
|
34
|
+
* — there is no \"retain as resolved\" state.
|
|
35
|
+
*
|
|
36
|
+
* The work-item (task/prd) terminal MOVES (`tasks/cancelled`, `prds/dropped`) and
|
|
37
|
+
* the `needs-attention/` LIFECYCLE state are a SEPARATE lifecycle concern (a
|
|
38
|
+
* task/prd is dropped by its own lifecycle, not by a question answer) — they are
|
|
39
|
+
* NOT routed from here any more (they were the removed disposition vocabulary).
|
|
40
|
+
*
|
|
41
|
+
* It is the SIBLING of {@link import('./surface-persist.js').persistSurfacedQuestions}:
|
|
42
|
+
* that is the SURFACE rung's one-commit primitive (append-or-create + set
|
|
43
|
+
* `needsAnswers`); this is the APPLY rung's (apply answers + resolve / re-pause /
|
|
44
|
+
* discharge). Kept file-orthogonal so the rung bodies land in different tasks.
|
|
45
|
+
*
|
|
46
|
+
* **NEVER invents an answer (US #4).** The apply rung applies ONLY what the human
|
|
47
|
+
* authored — the recorded `answer:` text. It does NOT fill, guess, or author an
|
|
48
|
+
* answer; a SUBSET-answered sidecar is not even classified `apply` (the classifier
|
|
49
|
+
* NO-OPs), so this is only ever called with a fully-answered sidecar. **ALWAYS
|
|
50
|
+
* allowed (no gate)** — applying a human's answer is never gated, even with every
|
|
51
|
+
* autonomy flag off (the engine, not this module, enforces the no-gate
|
|
52
|
+
* sequencing).
|
|
53
|
+
*
|
|
54
|
+
* Like the surface persist, this is the LOCAL one-commit primitive over a working
|
|
55
|
+
* tree (the throwaway-git-repo test pattern). The `advancing` CAS lock that makes
|
|
56
|
+
* it WINNER-ONLY is held by `performAdvance` BEFORE this is called; this module
|
|
57
|
+
* does NOT race the arbiter — that is the lock's job.
|
|
58
|
+
*/
|
|
59
|
+
// Re-export the extracted neutral resolver so existing importers of
|
|
60
|
+
// `apply-persist.ts` keep working (the resolver now LIVES in `item-path.ts`, a
|
|
61
|
+
// non-hot module the sibling CLI / gc-sweep tasks import without touching this
|
|
62
|
+
// rewritten file).
|
|
63
|
+
export { APPLY_LIFECYCLE_FOLDERS, resolveItemPathByIdentity };
|
|
64
|
+
/** Marker that opens the applied-answers record in an item body. */
|
|
65
|
+
const APPLIED_HEADING = '## Applied answers';
|
|
66
|
+
/**
|
|
67
|
+
* The STRUCTURAL fence the templates wrap the transient open-questions block in
|
|
68
|
+
* — an HTML-comment marker pair, mirroring the existing `<!-- dorfl-…
|
|
69
|
+
* -->` style in `sidecar.ts`. Apply's reconcile (full-resolution route only)
|
|
70
|
+
* strips everything between the OPEN and CLOSE markers (inclusive) when it folds
|
|
71
|
+
* answers in and clears `needsAnswers`, so the resolved item body reads as
|
|
72
|
+
* resolved (no leftover "these are still open" prose above `## Applied answers`).
|
|
73
|
+
*
|
|
74
|
+
* The strip is STRUCTURAL (marker-pair based), NOT a heading-text regex — the
|
|
75
|
+
* prd's D1 decision: a `## Open questions` heading match would be fragile to
|
|
76
|
+
* author wording (`## Open questions (clear needsAnswers when resolved)` vs.
|
|
77
|
+
* `## Open questions`). Items authored WITHOUT the markers are left untouched
|
|
78
|
+
* (backward compat — no marker ⇒ nothing to strip ⇒ identical bytes).
|
|
79
|
+
*
|
|
80
|
+
* The sibling task `templates-mark-transient-open-questions-block` introduces
|
|
81
|
+
* the markers in the prd/task templates; this task exports the constants so
|
|
82
|
+
* the two tasks agree on the literal byte sequence.
|
|
83
|
+
*/
|
|
84
|
+
export const OPEN_QUESTIONS_MARKER_OPEN = '<!-- open-questions -->';
|
|
85
|
+
export const OPEN_QUESTIONS_MARKER_CLOSE = '<!-- /open-questions -->';
|
|
86
|
+
/** Raised for usage errors (a missing repo, an unreadable item, a subset apply). */
|
|
87
|
+
export class ApplyPersistError extends Error {
|
|
88
|
+
constructor(message) {
|
|
89
|
+
super(message);
|
|
90
|
+
this.name = 'ApplyPersistError';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function gitSoft(args, cwd, env) {
|
|
94
|
+
return run('git', args, cwd, { env });
|
|
95
|
+
}
|
|
96
|
+
function gitHard(args, cwd, env) {
|
|
97
|
+
const result = run('git', args, cwd, { env });
|
|
98
|
+
if (result.status !== 0) {
|
|
99
|
+
throw new ApplyPersistError(`git ${args.join(' ')} failed (exit ${result.status}): ${result.stderr.trim()}`);
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
function resolveBy(cwd, env) {
|
|
104
|
+
const name = gitSoft(['config', 'user.name'], cwd, env);
|
|
105
|
+
if (name.status === 0 && name.stdout.trim() !== '') {
|
|
106
|
+
return name.stdout.trim();
|
|
107
|
+
}
|
|
108
|
+
const e = env ?? process.env;
|
|
109
|
+
return e.USER ?? e.USERNAME ?? '';
|
|
110
|
+
}
|
|
111
|
+
/** Read the item body from the tree (committed) then the working-tree file. */
|
|
112
|
+
function readItem(itemAbs, cwd, itemPath, env) {
|
|
113
|
+
const show = gitSoft(['show', `:${itemPath}`], cwd, env);
|
|
114
|
+
if (show.status === 0) {
|
|
115
|
+
return show.stdout;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
return readFileSync(itemAbs, 'utf8');
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
throw new ApplyPersistError(`cannot read item body for '${itemPath}' (the apply rung needs the item file)`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Read + parse the existing sidecar (from the working file). */
|
|
125
|
+
function readSidecar(cwd, item) {
|
|
126
|
+
const path = sidecarPathFor(item);
|
|
127
|
+
const abs = join(cwd, path);
|
|
128
|
+
if (!existsSync(abs)) {
|
|
129
|
+
throw new ApplyPersistError(`no sidecar at ${path} for ${item} — the apply rung needs an answered sidecar`);
|
|
130
|
+
}
|
|
131
|
+
return { model: parseSidecar(readFileSync(abs, 'utf8')), path };
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Render the applied-answers record appended to the item body. PURELY the human's
|
|
135
|
+
* recorded answers (verbatim) under a dated heading — NEVER an invented or
|
|
136
|
+
* paraphrased answer. Append-only (a prior record stays); the body is the durable
|
|
137
|
+
* home of what the human decided.
|
|
138
|
+
*/
|
|
139
|
+
function appliedAnswersBlock(entries) {
|
|
140
|
+
const date = new Date().toISOString().slice(0, 10);
|
|
141
|
+
const lines = ['', `${APPLIED_HEADING} ${date}`, ''];
|
|
142
|
+
for (const entry of entries) {
|
|
143
|
+
lines.push(`### ${entry.id}: ${entry.question.trim()}`);
|
|
144
|
+
lines.push('');
|
|
145
|
+
lines.push(entry.answer.trim());
|
|
146
|
+
lines.push('');
|
|
147
|
+
}
|
|
148
|
+
return lines.join('\n');
|
|
149
|
+
}
|
|
150
|
+
/** Append the applied-answers record to an item body (append-only). */
|
|
151
|
+
function withAppliedAnswers(body, entries) {
|
|
152
|
+
const base = body.replace(/\s*$/, '');
|
|
153
|
+
return `${base}\n${appliedAnswersBlock(entries)}`;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Strip ALL marker-fenced open-questions blocks from an item body — the FULL
|
|
157
|
+
* RESOLUTION reconcile step (prd `apply-reconciles-stale-open-questions`,
|
|
158
|
+
* decisions D1 / D3). Removes each `<!-- open-questions -->` … `<!--
|
|
159
|
+
* /open-questions -->` pair (markers included) plus the blank lines that
|
|
160
|
+
* flanked it, so the answers in `## Applied answers` no longer sit beneath a
|
|
161
|
+
* stale "these are still open" section.
|
|
162
|
+
*
|
|
163
|
+
* Behavioural choices (recorded in the done note):
|
|
164
|
+
* - strips EVERY well-formed marker pair, not just the first (an authoring
|
|
165
|
+
* template may legitimately fence more than one transient block — e.g.
|
|
166
|
+
* open-questions plus an autonomy-note — and partial strips would re-create
|
|
167
|
+
* the same drift the reconcile exists to prevent);
|
|
168
|
+
* - FAIL-SAFE on a malformed fence (a lone opener with no matching closer):
|
|
169
|
+
* the regex simply doesn't match, the body is returned unchanged. A
|
|
170
|
+
* fail-loud throw would block the apply commit on a template authoring bug;
|
|
171
|
+
* leaving the body intact preserves the answer-application invariant and
|
|
172
|
+
* surfaces the stale block to a human reviewer instead;
|
|
173
|
+
* - collapses runs of 3+ newlines down to 2 after a strip, so removing a
|
|
174
|
+
* block doesn't leave a triple-blank gap between the surrounding paragraphs.
|
|
175
|
+
*
|
|
176
|
+
* Called ONLY from the full-resolution path. The re-pause path (follow-up
|
|
177
|
+
* questions appended, `needsAnswers` stays true) NEVER calls this — the
|
|
178
|
+
* open-questions block is still legitimately open there (D3).
|
|
179
|
+
*/
|
|
180
|
+
function stripOpenQuestionsBlocks(body) {
|
|
181
|
+
const escOpen = OPEN_QUESTIONS_MARKER_OPEN.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
182
|
+
const escClose = OPEN_QUESTIONS_MARKER_CLOSE.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
183
|
+
const re = new RegExp(`\\n*[ \\t]*${escOpen}[\\s\\S]*?${escClose}[ \\t]*\\n*`, 'g');
|
|
184
|
+
if (!re.test(body))
|
|
185
|
+
return body;
|
|
186
|
+
return body.replace(re, '\n\n').replace(/\n{3,}/g, '\n\n');
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Apply a FULLY-ANSWERED sidecar's answers to its item ATOMICALLY, then route it.
|
|
190
|
+
* The keystone APPLY rung the advance engine dispatches into once the classifier
|
|
191
|
+
* said `apply` (all entries answered) AND the `advancing` lock was won.
|
|
192
|
+
*
|
|
193
|
+
* The decision (the human's recorded intent + the caller's routing — NEVER an
|
|
194
|
+
* invention):
|
|
195
|
+
*
|
|
196
|
+
* 1. **append / re-pause** — `appendQuestions` is non-empty: append `qN+1…`,
|
|
197
|
+
* keep `needsAnswers:true`, re-pause (one commit, body + sidecar).
|
|
198
|
+
* 2. **discharge by deletion** — `discharge` is set (the `delete-source`
|
|
199
|
+
* verdict): `git rm` the source + sidecar in a standalone revertible commit,
|
|
200
|
+
* the reason in the commit message.
|
|
201
|
+
* 3. **resolve fully** (the default) — clear `needsAnswers` + delete the sidecar
|
|
202
|
+
* in ONE commit; the item advances toward build by its normal lifecycle.
|
|
203
|
+
*/
|
|
204
|
+
export function applyAnsweredQuestions(options) {
|
|
205
|
+
const { cwd, item, itemPath: capturedItemPath, env } = options;
|
|
206
|
+
const note = options.note ?? (() => { });
|
|
207
|
+
if (gitSoft(['rev-parse', '--git-dir'], cwd, env).status !== 0) {
|
|
208
|
+
throw new ApplyPersistError('not inside a git repository');
|
|
209
|
+
}
|
|
210
|
+
const { model, path: sidecarPath } = readSidecar(cwd, item);
|
|
211
|
+
// FOLDER-AGNOSTIC at WRITE-TIME (F3a, prd
|
|
212
|
+
// `staging-surface-and-apply-promote-safety`): re-resolve the item's CURRENT
|
|
213
|
+
// path by IDENTITY, mirroring the sidecar's already-folder-agnostic
|
|
214
|
+
// resolution. The captured `itemPath` is ADVISORY — a concurrent `promote`
|
|
215
|
+
// (`tasks/backlog → tasks/ready`, `prds/proposed → prds/ready`) may have
|
|
216
|
+
// moved the item between capture and now, and we MUST write the post-move
|
|
217
|
+
// path, never the stale one. If the item has vanished entirely, exit CLEAN
|
|
218
|
+
// (no commit, no ghost file) — the matching benign skip the surface/triage
|
|
219
|
+
// rungs already use.
|
|
220
|
+
const resolvedItemPath = resolveItemPathByIdentity(cwd, item);
|
|
221
|
+
if (resolvedItemPath === undefined) {
|
|
222
|
+
const message = `apply ${item}: item file is gone (captured '${capturedItemPath}' is ` +
|
|
223
|
+
`stale and no current path resolves by identity) — exiting clean (no ` +
|
|
224
|
+
`commit), the apply rung does not recreate a vanished item.`;
|
|
225
|
+
note(message);
|
|
226
|
+
return {
|
|
227
|
+
outcome: 'vanished',
|
|
228
|
+
sidecarPath,
|
|
229
|
+
itemPath: capturedItemPath,
|
|
230
|
+
message,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
const itemPath = resolvedItemPath;
|
|
234
|
+
// NEVER invent an answer: the apply only ever runs on a FULLY-answered sidecar
|
|
235
|
+
// (the classifier NO-OPs a subset). Assert the boundary so a mis-call is loud,
|
|
236
|
+
// not a silent invention of an answer for an unanswered entry.
|
|
237
|
+
if (!allAnswered(model)) {
|
|
238
|
+
throw new ApplyPersistError(`refusing to apply ${item}: the sidecar has unanswered entries — a subset ` +
|
|
239
|
+
'is a classifier NO-OP, never an apply (the rung NEVER invents an answer)');
|
|
240
|
+
}
|
|
241
|
+
const itemAbs = join(cwd, itemPath);
|
|
242
|
+
const baseBody = readItem(itemAbs, cwd, itemPath, env);
|
|
243
|
+
const by = options.by || resolveBy(cwd, env);
|
|
244
|
+
// (1) APPEND / RE-PAUSE: the apply has new questions. Append them (`qN+1…`,
|
|
245
|
+
// never mutating an answered entry), stay needsAnswers:true, re-pause. Re-pause
|
|
246
|
+
// WINS over a discharge — you cannot discharge a source you are still asking
|
|
247
|
+
// about.
|
|
248
|
+
const followups = options.appendQuestions ?? [];
|
|
249
|
+
if (followups.length > 0) {
|
|
250
|
+
const repaused = appendQuestions(model, followups);
|
|
251
|
+
const result = applyAtomic({
|
|
252
|
+
cwd,
|
|
253
|
+
itemPath,
|
|
254
|
+
itemBody: withAppliedAnswers(baseBody, model.entries),
|
|
255
|
+
sidecar: repaused,
|
|
256
|
+
mode: 'repause',
|
|
257
|
+
by,
|
|
258
|
+
env,
|
|
259
|
+
note,
|
|
260
|
+
});
|
|
261
|
+
const message = `applied ${item} + appended ${followups.length} new question(s) → re-paused (needsAnswers:true).`;
|
|
262
|
+
note(message);
|
|
263
|
+
return {
|
|
264
|
+
outcome: 'repaused',
|
|
265
|
+
commit: result.commit,
|
|
266
|
+
sidecarPath,
|
|
267
|
+
itemPath,
|
|
268
|
+
message,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
// (2) DISCHARGE BY DELETION: the caller decided the source should leave by
|
|
272
|
+
// deletion (the `delete-source` verdict). `git rm` the source + sidecar in a
|
|
273
|
+
// STANDALONE revertible commit, the reason in the commit message (git history =
|
|
274
|
+
// archive). DIRECT — no preview/confirm (decision 12); the human's answer is
|
|
275
|
+
// the source of truth.
|
|
276
|
+
if (options.discharge !== undefined) {
|
|
277
|
+
return dischargeByDeletion({
|
|
278
|
+
cwd,
|
|
279
|
+
item,
|
|
280
|
+
itemPath,
|
|
281
|
+
reason: options.discharge.reason,
|
|
282
|
+
sidecarPath,
|
|
283
|
+
by,
|
|
284
|
+
env,
|
|
285
|
+
note,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
// (3) RESOLVE FULLY (the default): clear needsAnswers + delete the sidecar in
|
|
289
|
+
// ONE commit. Full-resolution reconcile (D1): strip the now-stale marker-fenced
|
|
290
|
+
// open-questions block(s) so the resolved body reads as resolved. Backward
|
|
291
|
+
// compatible — no marker ⇒ identical bytes. The re-pause path above is
|
|
292
|
+
// deliberately untouched (D3): its open-questions block is still open.
|
|
293
|
+
const reconciledBody = stripOpenQuestionsBlocks(baseBody);
|
|
294
|
+
const resolvedBody = withAppliedAnswers(reconciledBody, model.entries);
|
|
295
|
+
const result = applyAtomic({
|
|
296
|
+
cwd,
|
|
297
|
+
itemPath,
|
|
298
|
+
itemBody: resolvedBody,
|
|
299
|
+
sidecar: model,
|
|
300
|
+
mode: 'resolve',
|
|
301
|
+
by,
|
|
302
|
+
env,
|
|
303
|
+
note,
|
|
304
|
+
});
|
|
305
|
+
const message = `applied ${item} → resolved (needsAnswers cleared, sidecar deleted).`;
|
|
306
|
+
note(message);
|
|
307
|
+
return {
|
|
308
|
+
outcome: 'resolved',
|
|
309
|
+
commit: result.commit,
|
|
310
|
+
sidecarPath,
|
|
311
|
+
itemPath,
|
|
312
|
+
message,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* DISCHARGE a source by DELETION (the `delete-source` verdict, US #5/#11): `git
|
|
317
|
+
* rm` the source AND its answered sidecar in ONE STANDALONE commit, the human's
|
|
318
|
+
* discharge reason recorded in the commit MESSAGE (git history is the archive).
|
|
319
|
+
* There is no spawned artifact for a discharge, so the deletion is a standalone
|
|
320
|
+
* commit (a `mint`, by contrast, rides the new artifact's create commit through
|
|
321
|
+
* `promoteObservation`).
|
|
322
|
+
*
|
|
323
|
+
* A discharged item leaves by being GONE — no resting body marker, no `triaged:`
|
|
324
|
+
* stamp (the resting-state machinery is retired; an item is still-open, acted-on,
|
|
325
|
+
* or deleted). This is the apply rung applying the human's RATIFIED answer (the
|
|
326
|
+
* deletion is human-authored), and it is git-recoverable (a single revertible
|
|
327
|
+
* commit) — a wrong inference is never catastrophic.
|
|
328
|
+
*/
|
|
329
|
+
function dischargeByDeletion(input) {
|
|
330
|
+
const { cwd, item, itemPath, reason, sidecarPath, by, env, note } = input;
|
|
331
|
+
// `git rm` the source. The sidecar may not exist in every path; rm it too when
|
|
332
|
+
// present, so the discharge leaves no answered-sidecar residue. Both ride ONE
|
|
333
|
+
// commit.
|
|
334
|
+
const rmPaths = [itemPath];
|
|
335
|
+
if (existsSync(join(cwd, sidecarPath))) {
|
|
336
|
+
rmPaths.push(sidecarPath);
|
|
337
|
+
}
|
|
338
|
+
gitHard(['rm', '--quiet', '--', ...rmPaths], cwd, env);
|
|
339
|
+
const reasonLine = reason.trim() === '' ? '(no reason given)' : reason.trim();
|
|
340
|
+
const subject = `advance: ${item} → deleted (by ${by})`;
|
|
341
|
+
const messageBody = `Discharged by deletion (the human's ratified answer authors it; ` +
|
|
342
|
+
`git history is the archive).\n\nreason: ${reasonLine}`;
|
|
343
|
+
gitHard(['commit', '--quiet', '-m', subject, '-m', messageBody], cwd, env);
|
|
344
|
+
const commit = gitHard(['rev-parse', 'HEAD'], cwd, env).stdout.trim();
|
|
345
|
+
const message = `applied ${item} → deleted (source git rm-ed in a standalone commit; reason ` +
|
|
346
|
+
'in the commit message, git history is the archive).';
|
|
347
|
+
note(message);
|
|
348
|
+
return {
|
|
349
|
+
outcome: 'deleted',
|
|
350
|
+
commit,
|
|
351
|
+
sidecarPath,
|
|
352
|
+
itemPath,
|
|
353
|
+
message,
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
// Re-export the heading constant the tests assert against, so the byte-level
|
|
357
|
+
// marker stays in one place.
|
|
358
|
+
export { APPLIED_HEADING };
|
|
359
|
+
//# sourceMappingURL=apply-persist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-persist.js","sourceRoot":"","sources":["../src/apply-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CAAC,OAAO,CAAC,CAAC;IACd,OAAO;QACN,OAAO,EAAE,SAAS;QAClB,MAAM;QACN,WAAW;QACX,QAAQ;QACR,OAAO;KACP,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,6BAA6B;AAC7B,OAAO,EAAC,eAAe,EAAC,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The **arbiter management** primitive (ADR §7 in
|
|
3
|
+
* `docs/adr/execution-substrate-decisions.md`): provision and inspect a local
|
|
4
|
+
* `--bare` arbiter — the offline source of truth the claim/integration
|
|
5
|
+
* protocols serialize on (`scripts/CLAIM-PROTOCOL.md`).
|
|
6
|
+
*
|
|
7
|
+
* An arbiter is **precious DATA**, not state or cache: it is the very thing the
|
|
8
|
+
* deletion-safety predicate (ADR §4) proves everything else safe *against*. So:
|
|
9
|
+
*
|
|
10
|
+
* - It is provisioned under a visible `~/git/` (config `arbitersDir`),
|
|
11
|
+
* hierarchical (`<host>/<org>/<name>.git`), reusing the workspace repo→key
|
|
12
|
+
* encoding (`.`→`-` per segment) — NEVER under `~/.dorfl/`, whose
|
|
13
|
+
* `gc`/cleanup could nuke the only copy.
|
|
14
|
+
* - It is created `git clone --bare`. A non-bare repo with `main` checked out
|
|
15
|
+
* CANNOT be an arbiter: it rejects pushes to `main` (CLAIM-PROTOCOL), which
|
|
16
|
+
* would silently break every claim. `init` refuses that unsafe case; `status`
|
|
17
|
+
* flags it.
|
|
18
|
+
*
|
|
19
|
+
* This module only **provisions/locates** the arbiter (`arbiterInit` from an
|
|
20
|
+
* existing working repo, `arbiterStatus`). It does NOT claim, run, or fetch —
|
|
21
|
+
* those consume what this provides. It reuses the `repo-mirror` repo→key
|
|
22
|
+
* encoding (it does NOT duplicate it).
|
|
23
|
+
*/
|
|
24
|
+
/** The conventional default name for the arbiter remote in a working repo. */
|
|
25
|
+
export declare const DEFAULT_ARBITER_REMOTE = "arbiter";
|
|
26
|
+
/**
|
|
27
|
+
* The on-disk location of the local bare arbiter for `url`:
|
|
28
|
+
* `<arbitersDir>/<host>/<org>/<name>.git` (hierarchical, reusing the
|
|
29
|
+
* `repo-mirror` repo→key encoding, with a `.git` suffix). Lives under
|
|
30
|
+
* `arbitersDir` (default `~/git`), NEVER `~/.dorfl` (ADR §7).
|
|
31
|
+
*/
|
|
32
|
+
export declare function arbiterPath(arbitersDir: string, url: string): string;
|
|
33
|
+
export interface ArbiterInitOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The working repo to derive the arbiter FROM (its current contents seed the
|
|
36
|
+
* bare clone, and its `<remote>` is wired to point at it). Defaults to `cwd`.
|
|
37
|
+
*/
|
|
38
|
+
repo?: string;
|
|
39
|
+
/** Working directory `repo` defaults to when omitted. Defaults to `process.cwd()`. */
|
|
40
|
+
cwd?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Override the resolved default path (`<arbitersDir>/<key>.git`) with an
|
|
43
|
+
* explicit location (`--at`). Still created `--bare`.
|
|
44
|
+
*/
|
|
45
|
+
at?: string;
|
|
46
|
+
/** Where to provision the arbiter (config `arbitersDir`, default `~/git`). */
|
|
47
|
+
arbitersDir?: string;
|
|
48
|
+
/** Name of the remote to wire in `repo` (`--remote`). Default `arbiter`. */
|
|
49
|
+
remote?: string;
|
|
50
|
+
env?: NodeJS.ProcessEnv;
|
|
51
|
+
/** Sink for human-readable progress notes. */
|
|
52
|
+
note?: (message: string) => void;
|
|
53
|
+
}
|
|
54
|
+
export interface ArbiterInitResult {
|
|
55
|
+
/** Absolute path to the (existing or just-created) bare arbiter. */
|
|
56
|
+
path: string;
|
|
57
|
+
/** The `file://` URL the repo's remote was wired to. */
|
|
58
|
+
url: string;
|
|
59
|
+
/** The remote name wired in the working repo. */
|
|
60
|
+
remote: string;
|
|
61
|
+
/** True iff the arbiter did not exist and was just `clone --bare`d. */
|
|
62
|
+
created: boolean;
|
|
63
|
+
/** True iff an arbiter already existed at the path (idempotent no-clobber). */
|
|
64
|
+
alreadyExisted: boolean;
|
|
65
|
+
/** True iff the arbiter is bare (always true on success — invariant). */
|
|
66
|
+
bare: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** Raised when `init` cannot safely provision/locate an arbiter. */
|
|
69
|
+
export declare class ArbiterError extends Error {
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Provision (or locate) a local bare arbiter from a working repo and wire the
|
|
73
|
+
* repo's `<remote>` to it. Idempotent: an existing arbiter is detected and NOT
|
|
74
|
+
* clobbered (it is only re-pointed by the remote, never re-cloned). Refuses the
|
|
75
|
+
* unsafe case where the target is a non-bare repo with `main` checked out (which
|
|
76
|
+
* would reject claim pushes — CLAIM-PROTOCOL).
|
|
77
|
+
*
|
|
78
|
+
* The default path is hierarchical under `arbitersDir` (`~/git`), NEVER under
|
|
79
|
+
* `~/.dorfl` (ADR §7) — overridable via `at`.
|
|
80
|
+
*/
|
|
81
|
+
export declare function arbiterInit(options: ArbiterInitOptions): ArbiterInitResult;
|
|
82
|
+
export interface ArbiterStatusOptions {
|
|
83
|
+
/** The working repo to inspect. Defaults to `process.cwd()`. */
|
|
84
|
+
cwd?: string;
|
|
85
|
+
/** The arbiter remote name to report on. Default `arbiter`. */
|
|
86
|
+
remote?: string;
|
|
87
|
+
env?: NodeJS.ProcessEnv;
|
|
88
|
+
}
|
|
89
|
+
export interface ArbiterStatusReport {
|
|
90
|
+
/** The remote name inspected. */
|
|
91
|
+
remote: string;
|
|
92
|
+
/** True iff the working repo has a remote with that name. */
|
|
93
|
+
configured: boolean;
|
|
94
|
+
/** The remote's URL, if configured. */
|
|
95
|
+
url?: string;
|
|
96
|
+
/** The local filesystem path the URL resolves to (for `file://` / local URLs). */
|
|
97
|
+
path?: string;
|
|
98
|
+
/** True iff a git repo exists at `path` (or the URL is reachable locally). */
|
|
99
|
+
exists: boolean;
|
|
100
|
+
/** True iff the arbiter is a bare repo (the safe shape). */
|
|
101
|
+
bare: boolean;
|
|
102
|
+
/** True iff `main` is reachable on the arbiter. */
|
|
103
|
+
mainReachable: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* True iff the arbiter is in the unsafe non-bare-with-main shape: it EXISTS
|
|
106
|
+
* but is not bare (CLAIM-PROTOCOL warns this rejects claim pushes).
|
|
107
|
+
*/
|
|
108
|
+
unsafe: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Read-only report of the current repo's arbiter: which remote it is, its
|
|
112
|
+
* URL/path, whether it exists and is bare, and whether `main` is reachable. It
|
|
113
|
+
* MUTATES NOTHING (no fetch, no checkout) — it reads the local remote config and
|
|
114
|
+
* inspects the arbiter repo in place. Flags the unsafe non-bare-with-main case
|
|
115
|
+
* (ADR §7 / CLAIM-PROTOCOL).
|
|
116
|
+
*/
|
|
117
|
+
export declare function arbiterStatus(options: ArbiterStatusOptions): ArbiterStatusReport;
|
|
118
|
+
/** Render an `arbiter status` report for the terminal. */
|
|
119
|
+
export declare function formatArbiterStatus(report: ArbiterStatusReport): string;
|
|
120
|
+
//# sourceMappingURL=arbiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arbiter.d.ts","sourceRoot":"","sources":["../src/arbiter.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,E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