looply-cli 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +137 -3
- package/dist/.src-hash +1 -0
- package/dist/acceptance-observe.d.ts +108 -0
- package/dist/acceptance-observe.d.ts.map +1 -0
- package/dist/acceptance-observe.js +152 -0
- package/dist/acceptance-observe.js.map +1 -0
- package/dist/agent-cmd.d.ts +131 -0
- package/dist/agent-cmd.d.ts.map +1 -0
- package/dist/agent-cmd.js +154 -0
- package/dist/agent-cmd.js.map +1 -0
- package/dist/agent-contained.d.ts +114 -0
- package/dist/agent-contained.d.ts.map +1 -0
- package/dist/agent-contained.js +292 -0
- package/dist/agent-contained.js.map +1 -0
- package/dist/agent-driver.d.ts +130 -0
- package/dist/agent-driver.d.ts.map +1 -0
- package/dist/agent-driver.js +170 -0
- package/dist/agent-driver.js.map +1 -0
- package/dist/agent-envelope.d.ts +94 -0
- package/dist/agent-envelope.d.ts.map +1 -0
- package/dist/agent-envelope.js +214 -0
- package/dist/agent-envelope.js.map +1 -0
- package/dist/agent-exec.d.ts +182 -0
- package/dist/agent-exec.d.ts.map +1 -0
- package/dist/agent-exec.js +125 -0
- package/dist/agent-exec.js.map +1 -0
- package/dist/agent-runtime.d.ts +23 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/agent-runtime.js +143 -0
- package/dist/agent-runtime.js.map +1 -0
- package/dist/approval-gate-read.d.ts +66 -0
- package/dist/approval-gate-read.d.ts.map +1 -0
- package/dist/approval-gate-read.js +138 -0
- package/dist/approval-gate-read.js.map +1 -0
- package/dist/approval-resolution.d.ts +87 -0
- package/dist/approval-resolution.d.ts.map +1 -0
- package/dist/approval-resolution.js +100 -0
- package/dist/approval-resolution.js.map +1 -0
- package/dist/approval-resumes.d.ts +102 -0
- package/dist/approval-resumes.d.ts.map +1 -0
- package/dist/approval-resumes.js +167 -0
- package/dist/approval-resumes.js.map +1 -0
- package/dist/ask-brain.d.ts +167 -0
- package/dist/ask-brain.d.ts.map +1 -0
- package/dist/ask-brain.js +355 -0
- package/dist/ask-brain.js.map +1 -0
- package/dist/autonomy-authority.d.ts +80 -0
- package/dist/autonomy-authority.d.ts.map +1 -0
- package/dist/autonomy-authority.js +82 -0
- package/dist/autonomy-authority.js.map +1 -0
- package/dist/autonomy-controller.d.ts +321 -0
- package/dist/autonomy-controller.d.ts.map +1 -0
- package/dist/autonomy-controller.js +517 -0
- package/dist/autonomy-controller.js.map +1 -0
- package/dist/autonomy-store.d.ts +327 -0
- package/dist/autonomy-store.d.ts.map +1 -0
- package/dist/autonomy-store.js +581 -0
- package/dist/autonomy-store.js.map +1 -0
- package/dist/autonomy-tick.d.ts +257 -0
- package/dist/autonomy-tick.d.ts.map +1 -0
- package/dist/autonomy-tick.js +616 -0
- package/dist/autonomy-tick.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +2719 -0
- package/dist/bin.js.map +1 -0
- package/dist/brain-advice.d.ts +21 -0
- package/dist/brain-advice.d.ts.map +1 -0
- package/dist/brain-advice.js +51 -0
- package/dist/brain-advice.js.map +1 -0
- package/dist/candidate-replay-runtime.d.ts +125 -0
- package/dist/candidate-replay-runtime.d.ts.map +1 -0
- package/dist/candidate-replay-runtime.js +188 -0
- package/dist/candidate-replay-runtime.js.map +1 -0
- package/dist/checkout-carry.d.ts +76 -0
- package/dist/checkout-carry.d.ts.map +1 -0
- package/dist/checkout-carry.js +125 -0
- package/dist/checkout-carry.js.map +1 -0
- package/dist/citation-readers.d.ts +26 -0
- package/dist/citation-readers.d.ts.map +1 -0
- package/dist/citation-readers.js +102 -0
- package/dist/citation-readers.js.map +1 -0
- package/dist/command-receipts.d.ts +79 -0
- package/dist/command-receipts.d.ts.map +1 -0
- package/dist/command-receipts.js +143 -0
- package/dist/command-receipts.js.map +1 -0
- package/dist/command-runner.d.ts +32 -0
- package/dist/command-runner.d.ts.map +1 -0
- package/dist/command-runner.js +108 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/compatible-sets.d.ts +67 -0
- package/dist/compatible-sets.d.ts.map +1 -0
- package/dist/compatible-sets.js +81 -0
- package/dist/compatible-sets.js.map +1 -0
- package/dist/compile-check.d.ts +31 -0
- package/dist/compile-check.d.ts.map +1 -0
- package/dist/compile-check.js +34 -0
- package/dist/compile-check.js.map +1 -0
- package/dist/compile-store.d.ts +16 -0
- package/dist/compile-store.d.ts.map +1 -0
- package/dist/compile-store.js +21 -0
- package/dist/compile-store.js.map +1 -0
- package/dist/completion.d.ts +106 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +131 -0
- package/dist/completion.js.map +1 -0
- package/dist/config.d.ts +549 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +763 -0
- package/dist/config.js.map +1 -0
- package/dist/control-file.d.ts +142 -0
- package/dist/control-file.d.ts.map +1 -0
- package/dist/control-file.js +144 -0
- package/dist/control-file.js.map +1 -0
- package/dist/coordinator-state.d.ts +131 -0
- package/dist/coordinator-state.d.ts.map +1 -0
- package/dist/coordinator-state.js +380 -0
- package/dist/coordinator-state.js.map +1 -0
- package/dist/coordinator.d.ts +95 -0
- package/dist/coordinator.d.ts.map +1 -0
- package/dist/coordinator.js +97 -0
- package/dist/coordinator.js.map +1 -0
- package/dist/cursor-store.d.ts +53 -0
- package/dist/cursor-store.d.ts.map +1 -0
- package/dist/cursor-store.js +98 -0
- package/dist/cursor-store.js.map +1 -0
- package/dist/daemon-cmd.d.ts +239 -0
- package/dist/daemon-cmd.d.ts.map +1 -0
- package/dist/daemon-cmd.js +1751 -0
- package/dist/daemon-cmd.js.map +1 -0
- package/dist/daemon-lock.d.ts +140 -0
- package/dist/daemon-lock.d.ts.map +1 -0
- package/dist/daemon-lock.js +352 -0
- package/dist/daemon-lock.js.map +1 -0
- package/dist/daemon-recovery.d.ts +78 -0
- package/dist/daemon-recovery.d.ts.map +1 -0
- package/dist/daemon-recovery.js +161 -0
- package/dist/daemon-recovery.js.map +1 -0
- package/dist/daemon.d.ts +368 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +601 -0
- package/dist/daemon.js.map +1 -0
- package/dist/declared-response-shape.d.ts +93 -0
- package/dist/declared-response-shape.d.ts.map +1 -0
- package/dist/declared-response-shape.js +200 -0
- package/dist/declared-response-shape.js.map +1 -0
- package/dist/declared-surfaces.d.ts +16 -0
- package/dist/declared-surfaces.d.ts.map +1 -0
- package/dist/declared-surfaces.js +19 -0
- package/dist/declared-surfaces.js.map +1 -0
- package/dist/depends-review.d.ts +113 -0
- package/dist/depends-review.d.ts.map +1 -0
- package/dist/depends-review.js +110 -0
- package/dist/depends-review.js.map +1 -0
- package/dist/doctor.d.ts +91 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +71 -0
- package/dist/doctor.js.map +1 -0
- package/dist/edge-approval.d.ts +105 -0
- package/dist/edge-approval.d.ts.map +1 -0
- package/dist/edge-approval.js +100 -0
- package/dist/edge-approval.js.map +1 -0
- package/dist/evidence-cache.d.ts +45 -0
- package/dist/evidence-cache.d.ts.map +1 -0
- package/dist/evidence-cache.js +90 -0
- package/dist/evidence-cache.js.map +1 -0
- package/dist/evidence-cmd.d.ts +133 -0
- package/dist/evidence-cmd.d.ts.map +1 -0
- package/dist/evidence-cmd.js +347 -0
- package/dist/evidence-cmd.js.map +1 -0
- package/dist/evidence-facts.d.ts +40 -0
- package/dist/evidence-facts.d.ts.map +1 -0
- package/dist/evidence-facts.js +114 -0
- package/dist/evidence-facts.js.map +1 -0
- package/dist/exclusive-lock.d.ts +52 -0
- package/dist/exclusive-lock.d.ts.map +1 -0
- package/dist/exclusive-lock.js +150 -0
- package/dist/exclusive-lock.js.map +1 -0
- package/dist/exec-domains.d.ts +140 -0
- package/dist/exec-domains.d.ts.map +1 -0
- package/dist/exec-domains.js +287 -0
- package/dist/exec-domains.js.map +1 -0
- package/dist/exemption-store.d.ts +197 -0
- package/dist/exemption-store.d.ts.map +1 -0
- package/dist/exemption-store.js +266 -0
- package/dist/exemption-store.js.map +1 -0
- package/dist/explicit-start-gate.d.ts +96 -0
- package/dist/explicit-start-gate.d.ts.map +1 -0
- package/dist/explicit-start-gate.js +103 -0
- package/dist/explicit-start-gate.js.map +1 -0
- package/dist/fs-trouble.d.ts +70 -0
- package/dist/fs-trouble.d.ts.map +1 -0
- package/dist/fs-trouble.js +98 -0
- package/dist/fs-trouble.js.map +1 -0
- package/dist/gate.d.ts +278 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +278 -0
- package/dist/gate.js.map +1 -0
- package/dist/git-driver.d.ts +519 -0
- package/dist/git-driver.d.ts.map +1 -0
- package/dist/git-driver.js +900 -0
- package/dist/git-driver.js.map +1 -0
- package/dist/git-push-executor.d.ts +41 -0
- package/dist/git-push-executor.d.ts.map +1 -0
- package/dist/git-push-executor.js +142 -0
- package/dist/git-push-executor.js.map +1 -0
- package/dist/glob.d.ts +26 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +93 -0
- package/dist/glob.js.map +1 -0
- package/dist/goal-adaptive.d.ts +295 -0
- package/dist/goal-adaptive.d.ts.map +1 -0
- package/dist/goal-adaptive.js +393 -0
- package/dist/goal-adaptive.js.map +1 -0
- package/dist/goal-compile.d.ts +342 -0
- package/dist/goal-compile.d.ts.map +1 -0
- package/dist/goal-compile.js +444 -0
- package/dist/goal-compile.js.map +1 -0
- package/dist/goal-depends-executor.d.ts +55 -0
- package/dist/goal-depends-executor.d.ts.map +1 -0
- package/dist/goal-depends-executor.js +202 -0
- package/dist/goal-depends-executor.js.map +1 -0
- package/dist/goal-execution-evidence.d.ts +135 -0
- package/dist/goal-execution-evidence.d.ts.map +1 -0
- package/dist/goal-execution-evidence.js +159 -0
- package/dist/goal-execution-evidence.js.map +1 -0
- package/dist/goal-gap.d.ts +140 -0
- package/dist/goal-gap.d.ts.map +1 -0
- package/dist/goal-gap.js +197 -0
- package/dist/goal-gap.js.map +1 -0
- package/dist/goal-met-target.d.ts +98 -0
- package/dist/goal-met-target.d.ts.map +1 -0
- package/dist/goal-met-target.js +92 -0
- package/dist/goal-met-target.js.map +1 -0
- package/dist/goal-ownership.d.ts +416 -0
- package/dist/goal-ownership.d.ts.map +1 -0
- package/dist/goal-ownership.js +576 -0
- package/dist/goal-ownership.js.map +1 -0
- package/dist/goal-runs.d.ts +82 -0
- package/dist/goal-runs.d.ts.map +1 -0
- package/dist/goal-runs.js +120 -0
- package/dist/goal-runs.js.map +1 -0
- package/dist/goal-store.d.ts +146 -0
- package/dist/goal-store.d.ts.map +1 -0
- package/dist/goal-store.js +294 -0
- package/dist/goal-store.js.map +1 -0
- package/dist/goal-view.d.ts +156 -0
- package/dist/goal-view.d.ts.map +1 -0
- package/dist/goal-view.js +499 -0
- package/dist/goal-view.js.map +1 -0
- package/dist/governed-approvals.d.ts +152 -0
- package/dist/governed-approvals.d.ts.map +1 -0
- package/dist/governed-approvals.js +246 -0
- package/dist/governed-approvals.js.map +1 -0
- package/dist/governed-broker.d.ts +169 -0
- package/dist/governed-broker.d.ts.map +1 -0
- package/dist/governed-broker.js +196 -0
- package/dist/governed-broker.js.map +1 -0
- package/dist/governed-run.d.ts +220 -0
- package/dist/governed-run.d.ts.map +1 -0
- package/dist/governed-run.js +406 -0
- package/dist/governed-run.js.map +1 -0
- package/dist/grant-reconcile.d.ts +63 -0
- package/dist/grant-reconcile.d.ts.map +1 -0
- package/dist/grant-reconcile.js +121 -0
- package/dist/grant-reconcile.js.map +1 -0
- package/dist/index-for-head.d.ts +56 -0
- package/dist/index-for-head.d.ts.map +1 -0
- package/dist/index-for-head.js +103 -0
- package/dist/index-for-head.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/init-detect.d.ts +39 -0
- package/dist/init-detect.d.ts.map +1 -0
- package/dist/init-detect.js +188 -0
- package/dist/init-detect.js.map +1 -0
- package/dist/integration-deps.d.ts +62 -0
- package/dist/integration-deps.d.ts.map +1 -0
- package/dist/integration-deps.js +251 -0
- package/dist/integration-deps.js.map +1 -0
- package/dist/integration-runtime.d.ts +458 -0
- package/dist/integration-runtime.d.ts.map +1 -0
- package/dist/integration-runtime.js +681 -0
- package/dist/integration-runtime.js.map +1 -0
- package/dist/integration.d.ts +45 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +87 -0
- package/dist/integration.js.map +1 -0
- package/dist/integrator.d.ts +84 -0
- package/dist/integrator.d.ts.map +1 -0
- package/dist/integrator.js +193 -0
- package/dist/integrator.js.map +1 -0
- package/dist/lane-claims.d.ts +174 -0
- package/dist/lane-claims.d.ts.map +1 -0
- package/dist/lane-claims.js +218 -0
- package/dist/lane-claims.js.map +1 -0
- package/dist/lane-coverage.d.ts +87 -0
- package/dist/lane-coverage.d.ts.map +1 -0
- package/dist/lane-coverage.js +129 -0
- package/dist/lane-coverage.js.map +1 -0
- package/dist/ledger-replay.d.ts +115 -0
- package/dist/ledger-replay.d.ts.map +1 -0
- package/dist/ledger-replay.js +155 -0
- package/dist/ledger-replay.js.map +1 -0
- package/dist/ledger-store.d.ts +68 -0
- package/dist/ledger-store.d.ts.map +1 -0
- package/dist/ledger-store.js +111 -0
- package/dist/ledger-store.js.map +1 -0
- package/dist/loop-safety-observer.d.ts +132 -0
- package/dist/loop-safety-observer.d.ts.map +1 -0
- package/dist/loop-safety-observer.js +76 -0
- package/dist/loop-safety-observer.js.map +1 -0
- package/dist/loop-safety-store.d.ts +339 -0
- package/dist/loop-safety-store.d.ts.map +1 -0
- package/dist/loop-safety-store.js +800 -0
- package/dist/loop-safety-store.js.map +1 -0
- package/dist/machine-store.d.ts +54 -0
- package/dist/machine-store.d.ts.map +1 -0
- package/dist/machine-store.js +149 -0
- package/dist/machine-store.js.map +1 -0
- package/dist/mcp-main.d.ts +2 -0
- package/dist/mcp-main.d.ts.map +1 -0
- package/dist/mcp-main.js +116 -0
- package/dist/mcp-main.js.map +1 -0
- package/dist/mcp-server.d.ts +72 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +259 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/model-routing.d.ts +75 -0
- package/dist/model-routing.d.ts.map +1 -0
- package/dist/model-routing.js +108 -0
- package/dist/model-routing.js.map +1 -0
- package/dist/model-transport.d.ts +188 -0
- package/dist/model-transport.d.ts.map +1 -0
- package/dist/model-transport.js +625 -0
- package/dist/model-transport.js.map +1 -0
- package/dist/notify-cadence.d.ts +55 -0
- package/dist/notify-cadence.d.ts.map +1 -0
- package/dist/notify-cadence.js +68 -0
- package/dist/notify-cadence.js.map +1 -0
- package/dist/notify-channel.d.ts +69 -0
- package/dist/notify-channel.d.ts.map +1 -0
- package/dist/notify-channel.js +151 -0
- package/dist/notify-channel.js.map +1 -0
- package/dist/notify.d.ts +71 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +125 -0
- package/dist/notify.js.map +1 -0
- package/dist/observation-inventory.d.ts +65 -0
- package/dist/observation-inventory.d.ts.map +1 -0
- package/dist/observation-inventory.js +139 -0
- package/dist/observation-inventory.js.map +1 -0
- package/dist/owned-children.d.ts +45 -0
- package/dist/owned-children.d.ts.map +1 -0
- package/dist/owned-children.js +64 -0
- package/dist/owned-children.js.map +1 -0
- package/dist/packet-for-goal.d.ts +19 -0
- package/dist/packet-for-goal.d.ts.map +1 -0
- package/dist/packet-for-goal.js +32 -0
- package/dist/packet-for-goal.js.map +1 -0
- package/dist/pair-cmd.d.ts +85 -0
- package/dist/pair-cmd.d.ts.map +1 -0
- package/dist/pair-cmd.js +205 -0
- package/dist/pair-cmd.js.map +1 -0
- package/dist/partial-asker.d.ts +96 -0
- package/dist/partial-asker.d.ts.map +1 -0
- package/dist/partial-asker.js +117 -0
- package/dist/partial-asker.js.map +1 -0
- package/dist/pdf-text-lines.d.ts +17 -0
- package/dist/pdf-text-lines.d.ts.map +1 -0
- package/dist/pdf-text-lines.js +70 -0
- package/dist/pdf-text-lines.js.map +1 -0
- package/dist/pdf-text-worker.d.ts +2 -0
- package/dist/pdf-text-worker.d.ts.map +1 -0
- package/dist/pdf-text-worker.js +81 -0
- package/dist/pdf-text-worker.js.map +1 -0
- package/dist/pdf-text.d.ts +56 -0
- package/dist/pdf-text.d.ts.map +1 -0
- package/dist/pdf-text.js +64 -0
- package/dist/pdf-text.js.map +1 -0
- package/dist/pending-action.d.ts +154 -0
- package/dist/pending-action.d.ts.map +1 -0
- package/dist/pending-action.js +148 -0
- package/dist/pending-action.js.map +1 -0
- package/dist/preemptor.d.ts +40 -0
- package/dist/preemptor.d.ts.map +1 -0
- package/dist/preemptor.js +49 -0
- package/dist/preemptor.js.map +1 -0
- package/dist/programme-mode.d.ts +29 -0
- package/dist/programme-mode.d.ts.map +1 -0
- package/dist/programme-mode.js +50 -0
- package/dist/programme-mode.js.map +1 -0
- package/dist/progress-view.d.ts +14 -0
- package/dist/progress-view.d.ts.map +1 -0
- package/dist/progress-view.js +114 -0
- package/dist/progress-view.js.map +1 -0
- package/dist/project-graph-builder.d.ts +81 -0
- package/dist/project-graph-builder.d.ts.map +1 -0
- package/dist/project-graph-builder.js +246 -0
- package/dist/project-graph-builder.js.map +1 -0
- package/dist/project-graph-runtime.d.ts +86 -0
- package/dist/project-graph-runtime.d.ts.map +1 -0
- package/dist/project-graph-runtime.js +112 -0
- package/dist/project-graph-runtime.js.map +1 -0
- package/dist/project-index-builder.d.ts +96 -0
- package/dist/project-index-builder.d.ts.map +1 -0
- package/dist/project-index-builder.js +298 -0
- package/dist/project-index-builder.js.map +1 -0
- package/dist/project-index-facts.d.ts +51 -0
- package/dist/project-index-facts.d.ts.map +1 -0
- package/dist/project-index-facts.js +117 -0
- package/dist/project-index-facts.js.map +1 -0
- package/dist/project-index-store.d.ts +97 -0
- package/dist/project-index-store.d.ts.map +1 -0
- package/dist/project-index-store.js +140 -0
- package/dist/project-index-store.js.map +1 -0
- package/dist/project-memory-store.d.ts +127 -0
- package/dist/project-memory-store.d.ts.map +1 -0
- package/dist/project-memory-store.js +302 -0
- package/dist/project-memory-store.js.map +1 -0
- package/dist/proposal-store.d.ts +14 -0
- package/dist/proposal-store.d.ts.map +1 -0
- package/dist/proposal-store.js +19 -0
- package/dist/proposal-store.js.map +1 -0
- package/dist/prover.d.ts +80 -0
- package/dist/prover.d.ts.map +1 -0
- package/dist/prover.js +137 -0
- package/dist/prover.js.map +1 -0
- package/dist/provider-identity-store.d.ts +34 -0
- package/dist/provider-identity-store.d.ts.map +1 -0
- package/dist/provider-identity-store.js +72 -0
- package/dist/provider-identity-store.js.map +1 -0
- package/dist/provider-identity.d.ts +104 -0
- package/dist/provider-identity.d.ts.map +1 -0
- package/dist/provider-identity.js +167 -0
- package/dist/provider-identity.js.map +1 -0
- package/dist/provider-limit.d.ts +79 -0
- package/dist/provider-limit.d.ts.map +1 -0
- package/dist/provider-limit.js +148 -0
- package/dist/provider-limit.js.map +1 -0
- package/dist/provider-preflight.d.ts +171 -0
- package/dist/provider-preflight.d.ts.map +1 -0
- package/dist/provider-preflight.js +395 -0
- package/dist/provider-preflight.js.map +1 -0
- package/dist/provider-state.d.ts +120 -0
- package/dist/provider-state.d.ts.map +1 -0
- package/dist/provider-state.js +182 -0
- package/dist/provider-state.js.map +1 -0
- package/dist/providers.d.ts +132 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +161 -0
- package/dist/providers.js.map +1 -0
- package/dist/publication-recorder.d.ts +117 -0
- package/dist/publication-recorder.d.ts.map +1 -0
- package/dist/publication-recorder.js +124 -0
- package/dist/publication-recorder.js.map +1 -0
- package/dist/pursuit-delivery.d.ts +24 -0
- package/dist/pursuit-delivery.d.ts.map +1 -0
- package/dist/pursuit-delivery.js +38 -0
- package/dist/pursuit-delivery.js.map +1 -0
- package/dist/queue-store.d.ts +132 -0
- package/dist/queue-store.d.ts.map +1 -0
- package/dist/queue-store.js +185 -0
- package/dist/queue-store.js.map +1 -0
- package/dist/queue-summary.d.ts +14 -0
- package/dist/queue-summary.d.ts.map +1 -0
- package/dist/queue-summary.js +82 -0
- package/dist/queue-summary.js.map +1 -0
- package/dist/queue-view.d.ts +20 -0
- package/dist/queue-view.d.ts.map +1 -0
- package/dist/queue-view.js +163 -0
- package/dist/queue-view.js.map +1 -0
- package/dist/queue-write-lease.d.ts +106 -0
- package/dist/queue-write-lease.d.ts.map +1 -0
- package/dist/queue-write-lease.js +282 -0
- package/dist/queue-write-lease.js.map +1 -0
- package/dist/rails-home.d.ts +162 -0
- package/dist/rails-home.d.ts.map +1 -0
- package/dist/rails-home.js +452 -0
- package/dist/rails-home.js.map +1 -0
- package/dist/rails-migrations.d.ts +75 -0
- package/dist/rails-migrations.d.ts.map +1 -0
- package/dist/rails-migrations.js +199 -0
- package/dist/rails-migrations.js.map +1 -0
- package/dist/rails-stores.d.ts +49 -0
- package/dist/rails-stores.d.ts.map +1 -0
- package/dist/rails-stores.js +100 -0
- package/dist/rails-stores.js.map +1 -0
- package/dist/reaper.d.ts +69 -0
- package/dist/reaper.d.ts.map +1 -0
- package/dist/reaper.js +152 -0
- package/dist/reaper.js.map +1 -0
- package/dist/record-store.d.ts +36 -0
- package/dist/record-store.d.ts.map +1 -0
- package/dist/record-store.js +78 -0
- package/dist/record-store.js.map +1 -0
- package/dist/recovery-io.d.ts +50 -0
- package/dist/recovery-io.d.ts.map +1 -0
- package/dist/recovery-io.js +122 -0
- package/dist/recovery-io.js.map +1 -0
- package/dist/recovery.d.ts +146 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +110 -0
- package/dist/recovery.js.map +1 -0
- package/dist/redraw.d.ts +34 -0
- package/dist/redraw.d.ts.map +1 -0
- package/dist/redraw.js +62 -0
- package/dist/redraw.js.map +1 -0
- package/dist/rejected-evidence.d.ts +255 -0
- package/dist/rejected-evidence.d.ts.map +1 -0
- package/dist/rejected-evidence.js +324 -0
- package/dist/rejected-evidence.js.map +1 -0
- package/dist/report-cmd.d.ts +32 -0
- package/dist/report-cmd.d.ts.map +1 -0
- package/dist/report-cmd.js +201 -0
- package/dist/report-cmd.js.map +1 -0
- package/dist/repos-cmd.d.ts +80 -0
- package/dist/repos-cmd.d.ts.map +1 -0
- package/dist/repos-cmd.js +240 -0
- package/dist/repos-cmd.js.map +1 -0
- package/dist/request-body-shape.d.ts +93 -0
- package/dist/request-body-shape.d.ts.map +1 -0
- package/dist/request-body-shape.js +407 -0
- package/dist/request-body-shape.js.map +1 -0
- package/dist/requirement-claims.d.ts +89 -0
- package/dist/requirement-claims.d.ts.map +1 -0
- package/dist/requirement-claims.js +92 -0
- package/dist/requirement-claims.js.map +1 -0
- package/dist/retention-apply-runtime.d.ts +105 -0
- package/dist/retention-apply-runtime.d.ts.map +1 -0
- package/dist/retention-apply-runtime.js +269 -0
- package/dist/retention-apply-runtime.js.map +1 -0
- package/dist/reverify.d.ts +41 -0
- package/dist/reverify.d.ts.map +1 -0
- package/dist/reverify.js +69 -0
- package/dist/reverify.js.map +1 -0
- package/dist/round-records.d.ts +65 -0
- package/dist/round-records.d.ts.map +1 -0
- package/dist/round-records.js +61 -0
- package/dist/round-records.js.map +1 -0
- package/dist/round-runner.d.ts +924 -0
- package/dist/round-runner.d.ts.map +1 -0
- package/dist/round-runner.js +1693 -0
- package/dist/round-runner.js.map +1 -0
- package/dist/run-approval.d.ts +180 -0
- package/dist/run-approval.d.ts.map +1 -0
- package/dist/run-approval.js +199 -0
- package/dist/run-approval.js.map +1 -0
- package/dist/run-cmd.d.ts +359 -0
- package/dist/run-cmd.d.ts.map +1 -0
- package/dist/run-cmd.js +4418 -0
- package/dist/run-cmd.js.map +1 -0
- package/dist/run-delivery.d.ts +71 -0
- package/dist/run-delivery.d.ts.map +1 -0
- package/dist/run-delivery.js +104 -0
- package/dist/run-delivery.js.map +1 -0
- package/dist/run-ended.d.ts +75 -0
- package/dist/run-ended.d.ts.map +1 -0
- package/dist/run-ended.js +27 -0
- package/dist/run-ended.js.map +1 -0
- package/dist/run-ending-locator.d.ts +125 -0
- package/dist/run-ending-locator.d.ts.map +1 -0
- package/dist/run-ending-locator.js +133 -0
- package/dist/run-ending-locator.js.map +1 -0
- package/dist/run-launcher.d.ts +459 -0
- package/dist/run-launcher.d.ts.map +1 -0
- package/dist/run-launcher.js +652 -0
- package/dist/run-launcher.js.map +1 -0
- package/dist/run-lease.d.ts +208 -0
- package/dist/run-lease.d.ts.map +1 -0
- package/dist/run-lease.js +301 -0
- package/dist/run-lease.js.map +1 -0
- package/dist/run-refusal-marks.d.ts +189 -0
- package/dist/run-refusal-marks.d.ts.map +1 -0
- package/dist/run-refusal-marks.js +249 -0
- package/dist/run-refusal-marks.js.map +1 -0
- package/dist/run-start-marks.d.ts +153 -0
- package/dist/run-start-marks.d.ts.map +1 -0
- package/dist/run-start-marks.js +269 -0
- package/dist/run-start-marks.js.map +1 -0
- package/dist/scan-cmd.d.ts +14 -0
- package/dist/scan-cmd.d.ts.map +1 -0
- package/dist/scan-cmd.js +270 -0
- package/dist/scan-cmd.js.map +1 -0
- package/dist/scan-events.d.ts +50 -0
- package/dist/scan-events.d.ts.map +1 -0
- package/dist/scan-events.js +91 -0
- package/dist/scan-events.js.map +1 -0
- package/dist/scan.d.ts +191 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +417 -0
- package/dist/scan.js.map +1 -0
- package/dist/scope-rule.d.ts +148 -0
- package/dist/scope-rule.d.ts.map +1 -0
- package/dist/scope-rule.js +121 -0
- package/dist/scope-rule.js.map +1 -0
- package/dist/self-repo-id.d.ts +18 -0
- package/dist/self-repo-id.d.ts.map +1 -0
- package/dist/self-repo-id.js +70 -0
- package/dist/self-repo-id.js.map +1 -0
- package/dist/server-client.d.ts +766 -0
- package/dist/server-client.d.ts.map +1 -0
- package/dist/server-client.js +475 -0
- package/dist/server-client.js.map +1 -0
- package/dist/session-adapter-runtime.d.ts +195 -0
- package/dist/session-adapter-runtime.d.ts.map +1 -0
- package/dist/session-adapter-runtime.js +373 -0
- package/dist/session-adapter-runtime.js.map +1 -0
- package/dist/session-checkpoint-runtime.d.ts +62 -0
- package/dist/session-checkpoint-runtime.d.ts.map +1 -0
- package/dist/session-checkpoint-runtime.js +268 -0
- package/dist/session-checkpoint-runtime.js.map +1 -0
- package/dist/session-control-transport.d.ts +106 -0
- package/dist/session-control-transport.d.ts.map +1 -0
- package/dist/session-control-transport.js +232 -0
- package/dist/session-control-transport.js.map +1 -0
- package/dist/session-observation-store.d.ts +98 -0
- package/dist/session-observation-store.d.ts.map +1 -0
- package/dist/session-observation-store.js +155 -0
- package/dist/session-observation-store.js.map +1 -0
- package/dist/session-observe-runtime.d.ts +123 -0
- package/dist/session-observe-runtime.d.ts.map +1 -0
- package/dist/session-observe-runtime.js +317 -0
- package/dist/session-observe-runtime.js.map +1 -0
- package/dist/session-store.d.ts +98 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/session-store.js +116 -0
- package/dist/session-store.js.map +1 -0
- package/dist/sessions-cmd.d.ts +202 -0
- package/dist/sessions-cmd.d.ts.map +1 -0
- package/dist/sessions-cmd.js +609 -0
- package/dist/sessions-cmd.js.map +1 -0
- package/dist/settings-overlay.d.ts +53 -0
- package/dist/settings-overlay.d.ts.map +1 -0
- package/dist/settings-overlay.js +175 -0
- package/dist/settings-overlay.js.map +1 -0
- package/dist/setup-prompt.d.ts +34 -0
- package/dist/setup-prompt.d.ts.map +1 -0
- package/dist/setup-prompt.js +92 -0
- package/dist/setup-prompt.js.map +1 -0
- package/dist/setup.d.ts +103 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +283 -0
- package/dist/setup.js.map +1 -0
- package/dist/shared-grants.d.ts +164 -0
- package/dist/shared-grants.d.ts.map +1 -0
- package/dist/shared-grants.js +242 -0
- package/dist/shared-grants.js.map +1 -0
- package/dist/signals.d.ts +55 -0
- package/dist/signals.d.ts.map +1 -0
- package/dist/signals.js +85 -0
- package/dist/signals.js.map +1 -0
- package/dist/source-cmd.d.ts +201 -0
- package/dist/source-cmd.d.ts.map +1 -0
- package/dist/source-cmd.js +684 -0
- package/dist/source-cmd.js.map +1 -0
- package/dist/source-verdict.d.ts +99 -0
- package/dist/source-verdict.d.ts.map +1 -0
- package/dist/source-verdict.js +182 -0
- package/dist/source-verdict.js.map +1 -0
- package/dist/spend-ledger.d.ts +350 -0
- package/dist/spend-ledger.d.ts.map +1 -0
- package/dist/spend-ledger.js +546 -0
- package/dist/spend-ledger.js.map +1 -0
- package/dist/stale-run-sweep.d.ts +79 -0
- package/dist/stale-run-sweep.d.ts.map +1 -0
- package/dist/stale-run-sweep.js +116 -0
- package/dist/stale-run-sweep.js.map +1 -0
- package/dist/start-attempts.d.ts +385 -0
- package/dist/start-attempts.d.ts.map +1 -0
- package/dist/start-attempts.js +613 -0
- package/dist/start-attempts.js.map +1 -0
- package/dist/status-cmd.d.ts +28 -0
- package/dist/status-cmd.d.ts.map +1 -0
- package/dist/status-cmd.js +116 -0
- package/dist/status-cmd.js.map +1 -0
- package/dist/stop-follow-up.d.ts +107 -0
- package/dist/stop-follow-up.d.ts.map +1 -0
- package/dist/stop-follow-up.js +172 -0
- package/dist/stop-follow-up.js.map +1 -0
- package/dist/surface-lease.d.ts +118 -0
- package/dist/surface-lease.d.ts.map +1 -0
- package/dist/surface-lease.js +485 -0
- package/dist/surface-lease.js.map +1 -0
- package/dist/sync.d.ts +54 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +93 -0
- package/dist/sync.js.map +1 -0
- package/dist/syncing-ledger.d.ts +45 -0
- package/dist/syncing-ledger.d.ts.map +1 -0
- package/dist/syncing-ledger.js +53 -0
- package/dist/syncing-ledger.js.map +1 -0
- package/dist/temp-fixtures.d.ts +68 -0
- package/dist/temp-fixtures.d.ts.map +1 -0
- package/dist/temp-fixtures.js +38 -0
- package/dist/temp-fixtures.js.map +1 -0
- package/dist/token-window.d.ts +84 -0
- package/dist/token-window.d.ts.map +1 -0
- package/dist/token-window.js +143 -0
- package/dist/token-window.js.map +1 -0
- package/dist/tool-bridge.d.ts +177 -0
- package/dist/tool-bridge.d.ts.map +1 -0
- package/dist/tool-bridge.js +329 -0
- package/dist/tool-bridge.js.map +1 -0
- package/dist/tool-call-record.d.ts +197 -0
- package/dist/tool-call-record.d.ts.map +1 -0
- package/dist/tool-call-record.js +276 -0
- package/dist/tool-call-record.js.map +1 -0
- package/dist/tool-protocol.d.ts +135 -0
- package/dist/tool-protocol.d.ts.map +1 -0
- package/dist/tool-protocol.js +104 -0
- package/dist/tool-protocol.js.map +1 -0
- package/dist/tool-worker.d.ts +3 -0
- package/dist/tool-worker.d.ts.map +1 -0
- package/dist/tool-worker.js +478 -0
- package/dist/tool-worker.js.map +1 -0
- package/dist/toolchain-mirror.d.ts +86 -0
- package/dist/toolchain-mirror.d.ts.map +1 -0
- package/dist/toolchain-mirror.js +307 -0
- package/dist/toolchain-mirror.js.map +1 -0
- package/dist/trusted-git.d.ts +243 -0
- package/dist/trusted-git.d.ts.map +1 -0
- package/dist/trusted-git.js +920 -0
- package/dist/trusted-git.js.map +1 -0
- package/dist/ui.d.ts +76 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +118 -0
- package/dist/ui.js.map +1 -0
- package/dist/untrusted-exec.d.ts +275 -0
- package/dist/untrusted-exec.d.ts.map +1 -0
- package/dist/untrusted-exec.js +479 -0
- package/dist/untrusted-exec.js.map +1 -0
- package/dist/untrusted-gate.d.ts +73 -0
- package/dist/untrusted-gate.d.ts.map +1 -0
- package/dist/untrusted-gate.js +226 -0
- package/dist/untrusted-gate.js.map +1 -0
- package/dist/uploader.d.ts +153 -0
- package/dist/uploader.d.ts.map +1 -0
- package/dist/uploader.js +204 -0
- package/dist/uploader.js.map +1 -0
- package/dist/verifier.d.ts +66 -0
- package/dist/verifier.d.ts.map +1 -0
- package/dist/verifier.js +170 -0
- package/dist/verifier.js.map +1 -0
- package/dist/verify-apply.d.ts +26 -0
- package/dist/verify-apply.d.ts.map +1 -0
- package/dist/verify-apply.js +36 -0
- package/dist/verify-apply.js.map +1 -0
- package/dist/verify-cmd.d.ts +44 -0
- package/dist/verify-cmd.d.ts.map +1 -0
- package/dist/verify-cmd.js +125 -0
- package/dist/verify-cmd.js.map +1 -0
- package/dist/verify-pass.d.ts +73 -0
- package/dist/verify-pass.d.ts.map +1 -0
- package/dist/verify-pass.js +103 -0
- package/dist/verify-pass.js.map +1 -0
- package/dist/welcome.d.ts +43 -0
- package/dist/welcome.d.ts.map +1 -0
- package/dist/welcome.js +116 -0
- package/dist/welcome.js.map +1 -0
- package/dist/workspace-provisioner.d.ts +65 -0
- package/dist/workspace-provisioner.d.ts.map +1 -0
- package/dist/workspace-provisioner.js +66 -0
- package/dist/workspace-provisioner.js.map +1 -0
- package/dist/workspace-quarantine.d.ts +64 -0
- package/dist/workspace-quarantine.d.ts.map +1 -0
- package/dist/workspace-quarantine.js +156 -0
- package/dist/workspace-quarantine.js.map +1 -0
- package/dist/workspace-residue-sweep.d.ts +113 -0
- package/dist/workspace-residue-sweep.d.ts.map +1 -0
- package/dist/workspace-residue-sweep.js +158 -0
- package/dist/workspace-residue-sweep.js.map +1 -0
- package/dist/workspace.d.ts +639 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +2026 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +54 -6
- package/win/CredProbe.cs +64 -0
- package/win/FakeClaude.cs +56 -0
- package/win/HandleProbe.cs +116 -0
- package/win/TokenProbe.cs +53 -0
- package/win/appcontainer.ps1 +500 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nodeCommandRunner = void 0;
|
|
4
|
+
exports.makeCommandRunner = makeCommandRunner;
|
|
5
|
+
exports.nodeSpawn = nodeSpawn;
|
|
6
|
+
exports.nodeKillTree = nodeKillTree;
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const untrusted_exec_1 = require("./untrusted-exec");
|
|
10
|
+
function makeCommandRunner(deps) {
|
|
11
|
+
return (cmd, timeoutMs) => new Promise((resolve) => {
|
|
12
|
+
const started = Date.now();
|
|
13
|
+
const chunks = [];
|
|
14
|
+
let settled = false;
|
|
15
|
+
let timer;
|
|
16
|
+
const finish = (ok, timedOut) => {
|
|
17
|
+
// First outcome wins: exit-after-kill and error-then-exit must not
|
|
18
|
+
// resolve twice or report a second, contradictory result.
|
|
19
|
+
if (settled)
|
|
20
|
+
return;
|
|
21
|
+
settled = true;
|
|
22
|
+
if (timer !== undefined)
|
|
23
|
+
clearTimeout(timer);
|
|
24
|
+
resolve({ ok, timedOut, ms: Date.now() - started, output: chunks.join('') });
|
|
25
|
+
};
|
|
26
|
+
const handle = deps.spawn(cmd);
|
|
27
|
+
handle.onOutput((c) => chunks.push(c));
|
|
28
|
+
handle.onError((err) => {
|
|
29
|
+
// Kept in the output so a missing tool reads differently in the log
|
|
30
|
+
// from a failing test (DESIGN §12 case 6).
|
|
31
|
+
chunks.push(err.message);
|
|
32
|
+
finish(false, false);
|
|
33
|
+
});
|
|
34
|
+
handle.onExit((code) => finish(code === 0, false));
|
|
35
|
+
timer = setTimeout(() => {
|
|
36
|
+
if (settled)
|
|
37
|
+
return;
|
|
38
|
+
if (handle.pid !== undefined)
|
|
39
|
+
deps.killTree(handle.pid);
|
|
40
|
+
// Resolve now rather than waiting for the exit event: a process that
|
|
41
|
+
// survives the kill is exactly the hang the timeout exists to escape.
|
|
42
|
+
finish(false, true);
|
|
43
|
+
}, timeoutMs);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function nodeSpawn(cmd) {
|
|
47
|
+
// `detached` puts the child in its own process group on POSIX so `kill(-pid)`
|
|
48
|
+
// reaches the whole tree; on Windows it would open a new console instead, and
|
|
49
|
+
// taskkill walks the tree by itself.
|
|
50
|
+
const child = (0, node_child_process_1.spawn)(cmd, {
|
|
51
|
+
shell: true,
|
|
52
|
+
detached: process.platform !== 'win32',
|
|
53
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
pid: child.pid,
|
|
57
|
+
onExit: (cb) => child.on('exit', (code) => cb(code)),
|
|
58
|
+
onError: (cb) => child.on('error', cb),
|
|
59
|
+
onOutput: (cb) => {
|
|
60
|
+
child.stdout?.on('data', (d) => cb(d.toString('utf8')));
|
|
61
|
+
child.stderr?.on('data', (d) => cb(d.toString('utf8')));
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function nodeKillTree(pid) {
|
|
66
|
+
if (process.platform === 'win32') {
|
|
67
|
+
/**
|
|
68
|
+
* 🔴 ABSOLUTE, AND FROM A CWD LOOPLY OWNS. This was `spawnSync('taskkill',
|
|
69
|
+
* …)` with neither.
|
|
70
|
+
*
|
|
71
|
+
* Windows resolves a bare program name from the CURRENT DIRECTORY before
|
|
72
|
+
* PATH, and the current directory here is the project — the one place a
|
|
73
|
+
* contained agent is granted write. So a repository holding a
|
|
74
|
+
* `taskkill.exe` had it executed, uncontained and with the runner's own
|
|
75
|
+
* privileges, by the very code whose job is to stop a command that has
|
|
76
|
+
* overrun its timeout. It is the same hole `gitBinary` was written for; the
|
|
77
|
+
* name is different and the consequence is identical.
|
|
78
|
+
*
|
|
79
|
+
* `model-transport`'s killer already resolved this way. Two spellings of
|
|
80
|
+
* the same rule, and only one of them was safe.
|
|
81
|
+
*/
|
|
82
|
+
const system32 = (0, node_path_1.join)((0, untrusted_exec_1.systemRoot)(), 'System32');
|
|
83
|
+
(0, node_child_process_1.spawnSync)((0, node_path_1.join)(system32, 'taskkill.exe'), ['/pid', String(pid), '/T', '/F'], {
|
|
84
|
+
cwd: system32,
|
|
85
|
+
windowsHide: true,
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
process.kill(-pid, 'SIGKILL');
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// The group may already be gone, or the child never got its own group
|
|
94
|
+
// (spawn raced the kill); fall back to the single pid before giving up.
|
|
95
|
+
try {
|
|
96
|
+
process.kill(pid, 'SIGKILL');
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
/* already dead — the goal state */
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** The runner the gate executor should be handed in real use. */
|
|
104
|
+
exports.nodeCommandRunner = makeCommandRunner({
|
|
105
|
+
spawn: nodeSpawn,
|
|
106
|
+
killTree: nodeKillTree,
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=command-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-runner.js","sourceRoot":"","sources":["../src/command-runner.ts"],"names":[],"mappings":";;;AAiCA,8CAmCC;AAED,8BAkBC;AAED,oCAmCC;AA7HD,2DAAsD;AACtD,yCAAiC;AAEjC,qDAA8C;AA8B9C,SAAgB,iBAAiB,CAAC,IAAuB;IACvD,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,CACxB,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,IAAI,KAAgD,CAAC;QAErD,MAAM,MAAM,GAAG,CAAC,EAAW,EAAE,QAAiB,EAAQ,EAAE;YACtD,mEAAmE;YACnE,0DAA0D;YAC1D,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,KAAK,KAAK,SAAS;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAC7C,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,M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H,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,mCAAmC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED,iEAAiE;AACpD,QAAA,iBAAiB,GAAkB,iBAAiB,CAAC;IAChE,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,YAAY;CACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type CompatibleSet, type RepoRevision } from '@looply/core';
|
|
2
|
+
import type { LedgerFs } from './ledger-store';
|
|
3
|
+
import { AppendOnlyStore } from './record-store';
|
|
4
|
+
/**
|
|
5
|
+
* THE COMPATIBLE-REVISION RECORDS — `.looply/state/compatible-sets.jsonl`.
|
|
6
|
+
*
|
|
7
|
+
* 🔴 EVERY LINE IS AN IMMUTABLE FACT, AND THE SET IS A FOLD OVER THEM.
|
|
8
|
+
*
|
|
9
|
+
* The first shape of this rewrote a set's state each time a repository
|
|
10
|
+
* published, with the latest line winning. `AppendOnlyStore` refuses that
|
|
11
|
+
* outright — *"written once. Appending an id already on record is a programming
|
|
12
|
+
* error, not a second answer"* — and it is right: a store whose records
|
|
13
|
+
* supersede each other cannot say what happened, only what is currently
|
|
14
|
+
* believed, and what happened is the entire point of a resumable publication.
|
|
15
|
+
*
|
|
16
|
+
* So there are two kinds of line, each written once:
|
|
17
|
+
*
|
|
18
|
+
* accepted somebody accepted these revisions TOGETHER. One per set.
|
|
19
|
+
* published one repository published that set. One per (set, repository),
|
|
20
|
+
* which is exactly the granularity a non-atomic publication
|
|
21
|
+
* advances in.
|
|
22
|
+
*
|
|
23
|
+
* `setFrom` folds them back into the `CompatibleSet` the pure decision takes.
|
|
24
|
+
* An interrupted publication leaves the accepted line plus however many
|
|
25
|
+
* published lines got written — which is a resumable state by construction,
|
|
26
|
+
* not by care.
|
|
27
|
+
*/
|
|
28
|
+
export type CompatibleRecord = {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly kind: 'accepted';
|
|
31
|
+
readonly setId: string;
|
|
32
|
+
readonly at: string;
|
|
33
|
+
readonly revisions: readonly RepoRevision[];
|
|
34
|
+
} | {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly kind: 'published';
|
|
37
|
+
readonly setId: string;
|
|
38
|
+
readonly at: string;
|
|
39
|
+
readonly repo: string;
|
|
40
|
+
};
|
|
41
|
+
/** The id a publication line is written under — one per (set, repository). */
|
|
42
|
+
export declare function publishedId(setId: string, repo: string): string;
|
|
43
|
+
export declare class CompatibleSetStore extends AppendOnlyStore<CompatibleRecord> {
|
|
44
|
+
constructor(stateDir: string, fs: LedgerFs);
|
|
45
|
+
}
|
|
46
|
+
export declare function isRepoRevision(v: unknown): v is RepoRevision;
|
|
47
|
+
export declare function isCompatibleRecord(v: unknown): v is CompatibleRecord;
|
|
48
|
+
/**
|
|
49
|
+
* Fold the records for one set back into the set.
|
|
50
|
+
*
|
|
51
|
+
* ⚠️ NULL WHEN NOTHING ACCEPTED IT. A publication line without its acceptance is
|
|
52
|
+
* not half a set — it is a record about something nobody agreed to, and
|
|
53
|
+
* inventing a set around it would be the caller's guess wearing the store's
|
|
54
|
+
* authority.
|
|
55
|
+
*/
|
|
56
|
+
export declare function setFrom(records: readonly CompatibleRecord[], setId: string): CompatibleSet | null;
|
|
57
|
+
/**
|
|
58
|
+
* The most recently accepted set, which is the one a bare `looply repos` asks
|
|
59
|
+
* about.
|
|
60
|
+
*
|
|
61
|
+
* ⚠️ BY ACCEPTANCE TIME, NOT BY FILE ORDER. A publication line for an older set
|
|
62
|
+
* can be appended after a newer set was accepted — that is exactly what
|
|
63
|
+
* finishing an interrupted publication looks like — and taking the last line in
|
|
64
|
+
* the file would then answer about the wrong set.
|
|
65
|
+
*/
|
|
66
|
+
export declare function newestSetId(records: readonly CompatibleRecord[]): string | null;
|
|
67
|
+
//# sourceMappingURL=compatible-sets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AgB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAYjG;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,GAAG,IAAI,CAO/E"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompatibleSetStore = void 0;
|
|
4
|
+
exports.publishedId = publishedId;
|
|
5
|
+
exports.isRepoRevision = isRepoRevision;
|
|
6
|
+
exports.isCompatibleRecord = isCompatibleRecord;
|
|
7
|
+
exports.setFrom = setFrom;
|
|
8
|
+
exports.newestSetId = newestSetId;
|
|
9
|
+
const core_1 = require("@looply/core");
|
|
10
|
+
const record_store_1 = require("./record-store");
|
|
11
|
+
/** The id a publication line is written under — one per (set, repository). */
|
|
12
|
+
function publishedId(setId, repo) {
|
|
13
|
+
return `${setId}:${repo}`;
|
|
14
|
+
}
|
|
15
|
+
class CompatibleSetStore extends record_store_1.AppendOnlyStore {
|
|
16
|
+
constructor(stateDir, fs) {
|
|
17
|
+
super(stateDir, 'compatible-sets.jsonl', isCompatibleRecord, fs);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.CompatibleSetStore = CompatibleSetStore;
|
|
21
|
+
function isRepoRevision(v) {
|
|
22
|
+
if (typeof v !== 'object' || v === null)
|
|
23
|
+
return false;
|
|
24
|
+
const o = v;
|
|
25
|
+
return typeof o['repo'] === 'string' && typeof o['sha'] === 'string';
|
|
26
|
+
}
|
|
27
|
+
function isCompatibleRecord(v) {
|
|
28
|
+
if (typeof v !== 'object' || v === null)
|
|
29
|
+
return false;
|
|
30
|
+
const o = v;
|
|
31
|
+
if (typeof o['id'] !== 'string' || typeof o['setId'] !== 'string' || typeof o['at'] !== 'string')
|
|
32
|
+
return false;
|
|
33
|
+
if (o['kind'] === 'accepted')
|
|
34
|
+
return Array.isArray(o['revisions']) && o['revisions'].every(isRepoRevision);
|
|
35
|
+
if (o['kind'] === 'published')
|
|
36
|
+
return typeof o['repo'] === 'string';
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Fold the records for one set back into the set.
|
|
41
|
+
*
|
|
42
|
+
* ⚠️ NULL WHEN NOTHING ACCEPTED IT. A publication line without its acceptance is
|
|
43
|
+
* not half a set — it is a record about something nobody agreed to, and
|
|
44
|
+
* inventing a set around it would be the caller's guess wearing the store's
|
|
45
|
+
* authority.
|
|
46
|
+
*/
|
|
47
|
+
function setFrom(records, setId) {
|
|
48
|
+
const accepted = records.find((r) => r.kind === 'accepted' && r.setId === setId);
|
|
49
|
+
if (accepted === undefined || accepted.kind !== 'accepted')
|
|
50
|
+
return null;
|
|
51
|
+
let set = { id: setId, at: accepted.at, revisions: accepted.revisions, published: [] };
|
|
52
|
+
// `recordPublished` is the pure step, reused rather than re-implemented: it is
|
|
53
|
+
// idempotent, and a line naming a repository the set does not name folds to
|
|
54
|
+
// nothing rather than throwing — which leaves that repository reading `to
|
|
55
|
+
// publish`, the direction a corrupt record is safe to be wrong in.
|
|
56
|
+
for (const r of records) {
|
|
57
|
+
if (r.kind === 'published' && r.setId === setId)
|
|
58
|
+
set = (0, core_1.recordPublished)(set, r.repo);
|
|
59
|
+
}
|
|
60
|
+
return set;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The most recently accepted set, which is the one a bare `looply repos` asks
|
|
64
|
+
* about.
|
|
65
|
+
*
|
|
66
|
+
* ⚠️ BY ACCEPTANCE TIME, NOT BY FILE ORDER. A publication line for an older set
|
|
67
|
+
* can be appended after a newer set was accepted — that is exactly what
|
|
68
|
+
* finishing an interrupted publication looks like — and taking the last line in
|
|
69
|
+
* the file would then answer about the wrong set.
|
|
70
|
+
*/
|
|
71
|
+
function newestSetId(records) {
|
|
72
|
+
let best = null;
|
|
73
|
+
for (const r of records) {
|
|
74
|
+
if (r.kind !== 'accepted')
|
|
75
|
+
continue;
|
|
76
|
+
if (best === null || r.at > best.at)
|
|
77
|
+
best = { setId: r.setId, at: r.at };
|
|
78
|
+
}
|
|
79
|
+
return best === null ? null : best.setId;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=compatible-sets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatible-sets.js","sourceRoot":"","sources":["../src/compatible-sets.ts"],"names":[],"mappings":";;;AA8CA,kCAEC;AAQD,wCAIC;AAED,gDAOC;AAUD,0BAYC;AAWD,kCAOC;AA7GD,uCAAsF;AAEtF,iDAAiD;AA2CjD,8EAA8E;AAC9E,SAAgB,WAAW,CAAC,KAAa,EAAE,IAAY;IACrD,OAAO,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,MAAa,kBAAmB,SAAQ,8BAAiC;IACvE,YAAY,QAAgB,EAAE,EAAY;QACxC,KAAK,CAAC,QAAQ,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AAJD,gDAIC;AAED,SAAgB,cAAc,CAAC,CAAU;IACvC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC;AACvE,CAAC;AAED,SAAgB,kBAAkB,CAAC,CAAU;IAC3C,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,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C9D,IAAI,IAAI,GAAyC,IAAI,CAAC;IACtD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU;YAAE,SAAS;QACpC,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE;YAAE,IAAI,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type StepVerdict } from '@looply/core';
|
|
2
|
+
import type { CitationReaders } from './citation-readers';
|
|
3
|
+
import type { PlanStep } from './goal-compile';
|
|
4
|
+
/**
|
|
5
|
+
* THE COMPILER'S ANSWER IS CHECKED BEFORE IT BECOMES WORK (M3-2, audit D-02).
|
|
6
|
+
*
|
|
7
|
+
* Every evidence entry of every step is re-read at the committed tree the plan
|
|
8
|
+
* was made against, through the readers the composition root injects — a path
|
|
9
|
+
* for its presence, a line for its presence, a quote for being on that line
|
|
10
|
+
* (or, with no line given, on some line of the file). `judgeStep` in core
|
|
11
|
+
* decides; this file only fetches and sorts. A refused step is kept with its
|
|
12
|
+
* facts so the log and the record can show the claim beside what is there.
|
|
13
|
+
*
|
|
14
|
+
* 🔴 PURE OF GIT, FS AND THE MODEL: readers in, verdicts out. With no tree
|
|
15
|
+
* (`null`) nothing can be re-read, and a step that cites anything is refused —
|
|
16
|
+
* an unreadable citation is not a satisfied one.
|
|
17
|
+
*/
|
|
18
|
+
export interface CheckedStep {
|
|
19
|
+
readonly step: PlanStep;
|
|
20
|
+
readonly facts: readonly (string | null)[];
|
|
21
|
+
readonly verdict: StepVerdict;
|
|
22
|
+
}
|
|
23
|
+
export interface CheckedPlan {
|
|
24
|
+
readonly admitted: PlanStep[];
|
|
25
|
+
readonly refused: CheckedStep[];
|
|
26
|
+
readonly treeSha: string | null;
|
|
27
|
+
}
|
|
28
|
+
export declare function checkCompiledPlan(steps: readonly PlanStep[], readers: CitationReaders, treeSha: string | null): Promise<CheckedPlan>;
|
|
29
|
+
/** The log line: the step by its title, the claim and the fact in the judge's words. */
|
|
30
|
+
export declare function describeRefusal(c: CheckedStep): string;
|
|
31
|
+
//# sourceMappingURL=compile-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-check.d.ts","sourceRoot":"","sources":["../src/compile-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AASD,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAW1I;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkCompiledPlan = checkCompiledPlan;
|
|
4
|
+
exports.describeRefusal = describeRefusal;
|
|
5
|
+
const core_1 = require("@looply/core");
|
|
6
|
+
async function readEvidence(e, readers, treeSha) {
|
|
7
|
+
if (treeSha === null)
|
|
8
|
+
return null;
|
|
9
|
+
if (e.line !== undefined)
|
|
10
|
+
return readers.file(e.path, e.line, treeSha);
|
|
11
|
+
if (e.quote !== undefined && e.quote.trim() !== '')
|
|
12
|
+
return readers.find(e.path, e.quote, treeSha);
|
|
13
|
+
return readers.path(e.path, treeSha);
|
|
14
|
+
}
|
|
15
|
+
async function checkCompiledPlan(steps, readers, treeSha) {
|
|
16
|
+
const admitted = [];
|
|
17
|
+
const refused = [];
|
|
18
|
+
for (const step of steps) {
|
|
19
|
+
const facts = [];
|
|
20
|
+
for (const e of step.evidence)
|
|
21
|
+
facts.push(await readEvidence(e, readers, treeSha));
|
|
22
|
+
const verdict = (0, core_1.judgeStep)(step, facts);
|
|
23
|
+
if (verdict.ok)
|
|
24
|
+
admitted.push(step);
|
|
25
|
+
else
|
|
26
|
+
refused.push({ step, facts, verdict });
|
|
27
|
+
}
|
|
28
|
+
return { admitted, refused, treeSha };
|
|
29
|
+
}
|
|
30
|
+
/** The log line: the step by its title, the claim and the fact in the judge's words. */
|
|
31
|
+
function describeRefusal(c) {
|
|
32
|
+
return `step ${JSON.stringify(c.step.title)} refused — ${c.verdict.ok ? 'admitted' : c.verdict.because}`;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=compile-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-check.js","sourceRoot":"","sources":["../src/compile-check.ts"],"names":[],"mappings":";;AAqCA,8CAWC;AAGD,0CAEC;AArDD,uCAA0E;AA8B1E,KAAK,UAAU,YAAY,CAAC,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xF,SAAgB,eAAe,CAAC,CAAc;IAC5C,OAAO,QAAQ,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3G,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CompileRecord } from '@looply/core';
|
|
2
|
+
import type { LedgerFs } from './ledger-store';
|
|
3
|
+
import { AppendOnlyStore } from './record-store';
|
|
4
|
+
/**
|
|
5
|
+
* THE COMPILE RECORDS ON DISK — `.looply/state/compiles.jsonl`, beside the
|
|
6
|
+
* ledger of the checkout the compile happened in.
|
|
7
|
+
*
|
|
8
|
+
* One line per compile attempt (an EVENT, not a memo — the same question may
|
|
9
|
+
* be put again after a timeout): who was asked, with what (a digest), at which
|
|
10
|
+
* tree, what came back, how many steps were admitted and which were refused
|
|
11
|
+
* with the reason. Written before any step becomes an item.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CompileStore extends AppendOnlyStore<CompileRecord> {
|
|
14
|
+
constructor(stateDir: string, fs: LedgerFs);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=compile-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-store.d.ts","sourceRoot":"","sources":["../src/compile-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,eAAe,CAAC,aAAa,CAAC;gBAClD,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ;CAG3C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompileStore = void 0;
|
|
4
|
+
const core_1 = require("@looply/core");
|
|
5
|
+
const record_store_1 = require("./record-store");
|
|
6
|
+
/**
|
|
7
|
+
* THE COMPILE RECORDS ON DISK — `.looply/state/compiles.jsonl`, beside the
|
|
8
|
+
* ledger of the checkout the compile happened in.
|
|
9
|
+
*
|
|
10
|
+
* One line per compile attempt (an EVENT, not a memo — the same question may
|
|
11
|
+
* be put again after a timeout): who was asked, with what (a digest), at which
|
|
12
|
+
* tree, what came back, how many steps were admitted and which were refused
|
|
13
|
+
* with the reason. Written before any step becomes an item.
|
|
14
|
+
*/
|
|
15
|
+
class CompileStore extends record_store_1.AppendOnlyStore {
|
|
16
|
+
constructor(stateDir, fs) {
|
|
17
|
+
super(stateDir, 'compiles.jsonl', core_1.isCompileRecord, fs);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.CompileStore = CompileStore;
|
|
21
|
+
//# sourceMappingURL=compile-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-store.js","sourceRoot":"","sources":["../src/compile-store.ts"],"names":[],"mappings":";;;AAAA,uCAAmE;AAEnE,iDAAiD;AAEjD;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,8BAA8B;IAC9D,YAAY,QAAgB,EAAE,EAAY;QACxC,KAAK,CAAC,QAAQ,EAAE,gBAAgB,EAAE,sBAAe,EAAE,EAAE,CAAC,CAAC;IACzD,CAAC;CACF;AAJD,oCAIC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type IntegrationAttempt } from './integration-runtime';
|
|
2
|
+
import type { IntegratedReceipt } from '@looply/core';
|
|
3
|
+
import type { LaneCoverage } from './lane-coverage';
|
|
4
|
+
/**
|
|
5
|
+
* THE THIRD KEY (M5-2).
|
|
6
|
+
*
|
|
7
|
+
* A Start ends `goal_satisfied` when two keys turn inside the run: the
|
|
8
|
+
* evaluator's verdict and the machine's own evidence. Both are about the run's
|
|
9
|
+
* checkout. Whether the LANE ever took the work was nobody's key — the commits
|
|
10
|
+
* sat on `looply/run-…` and "satisfied" meant "the run said so", while a
|
|
11
|
+
* second branch the lane refused converged only through a person's hands.
|
|
12
|
+
* With the daemon integrating for itself (M5-1) there is a third fact to read
|
|
13
|
+
* before a grant closes: has `looply/integration` published that branch?
|
|
14
|
+
*
|
|
15
|
+
* This file answers that one question, for one branch, from the two sources
|
|
16
|
+
* the lane already keeps — its attempt log and the repository — and takes no
|
|
17
|
+
* position on what the answer means for a grant. That is the controller's
|
|
18
|
+
* decision (`decideControllerRefusal` with the facts), fixed by its own spec.
|
|
19
|
+
*/
|
|
20
|
+
export type Publication =
|
|
21
|
+
/**
|
|
22
|
+
* The lane holds the branch's work: an attempt on record published it, or its
|
|
23
|
+
* tip is already inside the lane.
|
|
24
|
+
*
|
|
25
|
+
* `reviewOwed` is present when the attempt that published it owes an
|
|
26
|
+
* evaluator verdict — the model's judgement did not carry across a replay.
|
|
27
|
+
* It is a FACT ABOUT THE PUBLICATION, carried here so the controller can
|
|
28
|
+
* decide what it means for a grant; this type takes no position on that.
|
|
29
|
+
*/
|
|
30
|
+
{
|
|
31
|
+
readonly kind: 'published';
|
|
32
|
+
readonly branch: string;
|
|
33
|
+
readonly sha: string;
|
|
34
|
+
readonly reviewOwed?: {
|
|
35
|
+
readonly reason: 'revalidate' | 'unmeasurable';
|
|
36
|
+
readonly because: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* WHICH SOURCE REQUIREMENTS THIS INTEGRATED REVISION WAS FOUND TO MEET.
|
|
40
|
+
*
|
|
41
|
+
* Another FACT ABOUT THE PUBLICATION, carried for the same reason
|
|
42
|
+
* `reviewOwed` is: the controller decides what it means for a grant, and
|
|
43
|
+
* this type takes no position. Absent for every project that holds no
|
|
44
|
+
* claims, which is most of them.
|
|
45
|
+
*/
|
|
46
|
+
readonly requirements?: IntegratedReceipt;
|
|
47
|
+
/** The goal the publishing attempt was for, when the lane recorded one. */
|
|
48
|
+
readonly goalId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Programme mode: strict coverage of the pursuit's goal, judged on the integration
|
|
51
|
+
* tip (`withLaneCoverage`). Another FACT; the controller decides what it means.
|
|
52
|
+
*/
|
|
53
|
+
readonly coverage?: LaneCoverage;
|
|
54
|
+
/**
|
|
55
|
+
* F27: a goal-met Start JUDGED exactly this commit, so the verdict `reviewOwed` names was
|
|
56
|
+
* taken. Present only beside `reviewOwed`, and only when the commit matches.
|
|
57
|
+
*/
|
|
58
|
+
readonly reviewTakenAt?: string;
|
|
59
|
+
/** F27: a new Start here judges the tree the lane holds, so buying one can move a hold. */
|
|
60
|
+
readonly rejudge?: true;
|
|
61
|
+
}
|
|
62
|
+
/** The branch exists, is not in the lane, and the lane has not answered for its current tip. */
|
|
63
|
+
| {
|
|
64
|
+
readonly kind: 'pending';
|
|
65
|
+
readonly branch: string;
|
|
66
|
+
}
|
|
67
|
+
/** The lane answered for this tip and did not publish. `rebase` when its answer was `needs-rebase`. */
|
|
68
|
+
| {
|
|
69
|
+
readonly kind: 'refused';
|
|
70
|
+
readonly branch: string;
|
|
71
|
+
readonly because: string;
|
|
72
|
+
readonly rebase: boolean;
|
|
73
|
+
readonly rejudge?: true;
|
|
74
|
+
}
|
|
75
|
+
/** No branch was named, or the one named is not in the repository and nothing on record published it. */
|
|
76
|
+
| {
|
|
77
|
+
readonly kind: 'unknown';
|
|
78
|
+
readonly branch?: string;
|
|
79
|
+
};
|
|
80
|
+
/** The branch as the repository has it now: its tip, and whether the lane already contains that tip. */
|
|
81
|
+
export interface BranchStanding {
|
|
82
|
+
readonly sha: string;
|
|
83
|
+
readonly inLane: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Pure over what was read. The attempt log is append-only, so among several
|
|
87
|
+
* records for one branch the LAST is the lane's latest word; a record for a
|
|
88
|
+
* tip that has since moved is not an answer about the tip that exists.
|
|
89
|
+
*/
|
|
90
|
+
export declare function publicationOf(attempts: readonly IntegrationAttempt[], branch: string | undefined, standing: BranchStanding | null,
|
|
91
|
+
/** F27: the commits a goal-met Start judged for this branch (`judgedAt` on its delivery records). */
|
|
92
|
+
judged?: readonly string[]): Publication;
|
|
93
|
+
/**
|
|
94
|
+
* The daemon's reader: the lane's log beside the repository, re-read on every
|
|
95
|
+
* ask because both are written by other processes between cadences.
|
|
96
|
+
*
|
|
97
|
+
* ⚠️ A QUESTION THIS CADENCE COULD NOT ANSWER IS NOT AN ANSWER. Anything that
|
|
98
|
+
* throws — a repository mid-operation, a log mid-write — comes back `unknown`,
|
|
99
|
+
* which holds; it can never close a grant.
|
|
100
|
+
*/
|
|
101
|
+
export declare function nodePublication(cwd: string,
|
|
102
|
+
/** F27: `rejudge` — this daemon runs a programme whose Starts judge the tree the lane holds. */
|
|
103
|
+
opts?: {
|
|
104
|
+
readonly rejudge?: boolean;
|
|
105
|
+
}): (branch: string | undefined) => Promise<Publication>;
|
|
106
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../src/completion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,WAAW;AACrB;;;;;;;;GAQG;AACD;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,QAAQ,CAAC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SAAS,MAAM,EAAO,GAC7B,WAAW,CAiEb;AAYD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM;AACX,gGAAgG;AAChG,IAAI,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,WAAW,CAAC,CAqBtD"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.publicationOf = publicationOf;
|
|
4
|
+
exports.nodePublication = nodePublication;
|
|
5
|
+
const git_driver_1 = require("./git-driver");
|
|
6
|
+
const integration_1 = require("./integration");
|
|
7
|
+
const integration_runtime_1 = require("./integration-runtime");
|
|
8
|
+
const lane_claims_1 = require("./lane-claims");
|
|
9
|
+
/** How much of the lane's reason a hold repeats. A hold is read in a log line, not a report. */
|
|
10
|
+
const MAX_REASON = 500;
|
|
11
|
+
/**
|
|
12
|
+
* Pure over what was read. The attempt log is append-only, so among several
|
|
13
|
+
* records for one branch the LAST is the lane's latest word; a record for a
|
|
14
|
+
* tip that has since moved is not an answer about the tip that exists.
|
|
15
|
+
*/
|
|
16
|
+
function publicationOf(attempts, branch, standing,
|
|
17
|
+
/** F27: the commits a goal-met Start judged for this branch (`judgedAt` on its delivery records). */
|
|
18
|
+
judged = []) {
|
|
19
|
+
if (branch === undefined)
|
|
20
|
+
return { kind: 'unknown' };
|
|
21
|
+
const mine = attempts.filter((a) => a.branch === branch);
|
|
22
|
+
const published = latest(mine.filter((a) => a.published !== undefined));
|
|
23
|
+
if (published?.published !== undefined) {
|
|
24
|
+
return {
|
|
25
|
+
kind: 'published',
|
|
26
|
+
branch,
|
|
27
|
+
sha: published.published.to,
|
|
28
|
+
...(published.reviewOwed === undefined ? {} : { reviewOwed: published.reviewOwed }),
|
|
29
|
+
...(published.reviewOwed !== undefined && judged.includes(published.published.to) ? { reviewTakenAt: published.published.to } : {}),
|
|
30
|
+
...(published.requirements === undefined ? {} : { requirements: published.requirements }),
|
|
31
|
+
...(published.goalId === undefined ? {} : { goalId: published.goalId }),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 🔴 A REPLAYED BRANCH IS ANSWERED BY ITS REPLAY (F21).
|
|
36
|
+
*
|
|
37
|
+
* The lane cannot fast-forward a branch whose base moved, so it carries the
|
|
38
|
+
* change onto the new base as `looply/replay-…` and publishes THAT. The run
|
|
39
|
+
* branch's own attempt stays `needs-rebase` — so this answered `refused`, a
|
|
40
|
+
* rebase, and the controller bought a new Start every cadence for work that was
|
|
41
|
+
* already integrated, until the grant was spent. Measured by reading
|
|
42
|
+
* (live2/CLOSURE-CHAIN-MAP.md B8): whichever of two concurrent goals lands second
|
|
43
|
+
* is always replayed. The replay's answer — published, refused or not yet
|
|
44
|
+
* offered — is this branch's answer.
|
|
45
|
+
*
|
|
46
|
+
* ⚠️ ONLY FOR THE TIP THAT WAS CARRIED. A branch that moved since is a new
|
|
47
|
+
* candidate, and the old replay says nothing about it. One hop: replays are
|
|
48
|
+
* never offered as run branches, so they are never replayed again.
|
|
49
|
+
*/
|
|
50
|
+
const carried = latest(mine.filter((a) => a.replayedAs !== undefined && (standing === null || a.commitSha === standing.sha)));
|
|
51
|
+
if (carried?.replayedAs !== undefined) {
|
|
52
|
+
const replay = carried.replayedAs;
|
|
53
|
+
const theirs = attempts.filter((a) => a.branch === replay);
|
|
54
|
+
const landed = latest(theirs.filter((a) => a.published !== undefined));
|
|
55
|
+
if (landed?.published !== undefined) {
|
|
56
|
+
return {
|
|
57
|
+
kind: 'published',
|
|
58
|
+
branch: replay,
|
|
59
|
+
sha: landed.published.to,
|
|
60
|
+
...(landed.reviewOwed === undefined ? {} : { reviewOwed: landed.reviewOwed }),
|
|
61
|
+
...(landed.reviewOwed !== undefined && judged.includes(landed.published.to) ? { reviewTakenAt: landed.published.to } : {}),
|
|
62
|
+
...(landed.requirements === undefined ? {} : { requirements: landed.requirements }),
|
|
63
|
+
...(landed.goalId === undefined ? {} : { goalId: landed.goalId }),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const last = latest(theirs);
|
|
67
|
+
if (last === undefined)
|
|
68
|
+
return { kind: 'pending', branch: replay };
|
|
69
|
+
return { kind: 'refused', branch: replay, because: reasonOf(last), rebase: last.verdict === 'needs-rebase' };
|
|
70
|
+
}
|
|
71
|
+
if (standing === null)
|
|
72
|
+
return { kind: 'unknown', branch };
|
|
73
|
+
/**
|
|
74
|
+
* ⚠️ NO OBLIGATION IS REPORTED FOR A TIP THAT IS SIMPLY INSIDE THE LANE.
|
|
75
|
+
*
|
|
76
|
+
* This branch answers from the REPOSITORY, not from an attempt: the tip is
|
|
77
|
+
* already contained, and no attempt on record published it. There is nothing
|
|
78
|
+
* to read an obligation off, and inventing an absence would be the same
|
|
79
|
+
* mistake as inventing a presence. A tip that got there through an attempt is
|
|
80
|
+
* answered by the branch above, which does carry it.
|
|
81
|
+
*/
|
|
82
|
+
if (standing.inLane)
|
|
83
|
+
return { kind: 'published', branch, sha: standing.sha };
|
|
84
|
+
const answered = latest(mine.filter((a) => a.commitSha === standing.sha || a.candidateSha === standing.sha));
|
|
85
|
+
if (answered === undefined)
|
|
86
|
+
return { kind: 'pending', branch };
|
|
87
|
+
return { kind: 'refused', branch, because: reasonOf(answered), rebase: answered.verdict === 'needs-rebase' };
|
|
88
|
+
}
|
|
89
|
+
function latest(list) {
|
|
90
|
+
return list.length === 0 ? undefined : list[list.length - 1];
|
|
91
|
+
}
|
|
92
|
+
function reasonOf(a) {
|
|
93
|
+
if (a.because !== undefined)
|
|
94
|
+
return a.because.slice(0, MAX_REASON);
|
|
95
|
+
const red = (a.checks ?? []).filter((c) => !c.ok).map((c) => `${c.name}: ${c.detail}`);
|
|
96
|
+
return (red.length > 0 ? `the gate was red — ${red.join('; ')}` : `the lane's verdict was ${a.verdict}`).slice(0, MAX_REASON);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The daemon's reader: the lane's log beside the repository, re-read on every
|
|
100
|
+
* ask because both are written by other processes between cadences.
|
|
101
|
+
*
|
|
102
|
+
* ⚠️ A QUESTION THIS CADENCE COULD NOT ANSWER IS NOT AN ANSWER. Anything that
|
|
103
|
+
* throws — a repository mid-operation, a log mid-write — comes back `unknown`,
|
|
104
|
+
* which holds; it can never close a grant.
|
|
105
|
+
*/
|
|
106
|
+
function nodePublication(cwd,
|
|
107
|
+
/** F27: `rejudge` — this daemon runs a programme whose Starts judge the tree the lane holds. */
|
|
108
|
+
opts = {}) {
|
|
109
|
+
const git = new git_driver_1.GitDriver((0, git_driver_1.nodeGitExec)(cwd));
|
|
110
|
+
const mark = (p) => opts.rejudge === true && (p.kind === 'published' || p.kind === 'refused') ? { ...p, rejudge: true } : p;
|
|
111
|
+
return async (branch) => {
|
|
112
|
+
if (branch === undefined)
|
|
113
|
+
return publicationOf([], undefined, null);
|
|
114
|
+
try {
|
|
115
|
+
const attempts = (0, integration_runtime_1.readAttempts)(cwd);
|
|
116
|
+
// F27: the commits a goal-met Start judged for this branch — where an owed verdict was taken.
|
|
117
|
+
const judged = (0, lane_claims_1.readLaneClaims)(cwd).flatMap((r) => r.kind === 'delivery' && r.branch === branch && r.judgedAt !== undefined ? [r.judgedAt] : []);
|
|
118
|
+
if (!(await git.refExists(branch)))
|
|
119
|
+
return mark(publicationOf(attempts, branch, null, judged));
|
|
120
|
+
const sha = await git.mergeBase(branch, branch);
|
|
121
|
+
if (sha === null)
|
|
122
|
+
return mark(publicationOf(attempts, branch, null, judged));
|
|
123
|
+
const inLane = (await git.refExists(integration_1.INTEGRATION_BRANCH)) && (await git.mergeBase(integration_1.INTEGRATION_BRANCH, branch)) === sha;
|
|
124
|
+
return mark(publicationOf(attempts, branch, { sha, inLane }, judged));
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return { kind: 'unknown', branch };
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=completion.js.map
|