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,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sweepTargets = sweepTargets;
|
|
4
|
+
exports.makeStaleRunSweep = makeStaleRunSweep;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_os_1 = require("node:os");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const daemon_recovery_1 = require("./daemon-recovery");
|
|
9
|
+
const git_driver_1 = require("./git-driver");
|
|
10
|
+
const ledger_store_1 = require("./ledger-store");
|
|
11
|
+
const run_lease_1 = require("./run-lease");
|
|
12
|
+
const trusted_git_1 = require("./trusted-git");
|
|
13
|
+
const workspace_1 = require("./workspace");
|
|
14
|
+
const workspace_quarantine_1 = require("./workspace-quarantine");
|
|
15
|
+
/**
|
|
16
|
+
* The checkouts a sweep of this project covers, in a deterministic order: the
|
|
17
|
+
* main checkout first, then the workspaces by name.
|
|
18
|
+
*/
|
|
19
|
+
function sweepTargets(cwd, home = (0, node_os_1.homedir)()) {
|
|
20
|
+
const seen = new Set();
|
|
21
|
+
const out = [];
|
|
22
|
+
const add = (path) => {
|
|
23
|
+
let key;
|
|
24
|
+
try {
|
|
25
|
+
key = node_fs_1.realpathSync.native(path);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return; // gone between the listing and here; nothing to sweep
|
|
29
|
+
}
|
|
30
|
+
if (seen.has(key))
|
|
31
|
+
return;
|
|
32
|
+
seen.add(key);
|
|
33
|
+
out.push(path);
|
|
34
|
+
};
|
|
35
|
+
add((0, node_path_1.resolve)(cwd));
|
|
36
|
+
const root = (0, workspace_1.workspacesRoot)(cwd, home);
|
|
37
|
+
let names;
|
|
38
|
+
try {
|
|
39
|
+
names = (0, node_fs_1.readdirSync)(root).sort();
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
const identity = (0, trusted_git_1.repoIdentityPath)(cwd);
|
|
45
|
+
for (const name of names) {
|
|
46
|
+
const path = (0, node_path_1.join)(root, name);
|
|
47
|
+
if (!(0, node_fs_1.existsSync)((0, node_path_1.join)(path, git_driver_1.STATE_DIR)))
|
|
48
|
+
continue;
|
|
49
|
+
if ((0, workspace_quarantine_1.quarantineOf)(cwd, path) !== null)
|
|
50
|
+
continue;
|
|
51
|
+
if ((0, trusted_git_1.repoIdentityPath)(path) !== identity)
|
|
52
|
+
continue;
|
|
53
|
+
add(path);
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The daemon's `recoverStaleRun` dependency. ONE factory for the daemon and the
|
|
59
|
+
* end-to-end proof, so the proof sweeps with the sweep the daemon runs.
|
|
60
|
+
*/
|
|
61
|
+
function makeStaleRunSweep(deps) {
|
|
62
|
+
const home = deps.home ?? (0, node_os_1.homedir)();
|
|
63
|
+
const now = deps.now ?? (() => Date.now());
|
|
64
|
+
return async () => {
|
|
65
|
+
const swept = [];
|
|
66
|
+
for (const checkout of sweepTargets(deps.cwd, home)) {
|
|
67
|
+
const stateDir = (0, git_driver_1.executionStateDir)(checkout);
|
|
68
|
+
try {
|
|
69
|
+
const outcome = await (0, daemon_recovery_1.recoverStaleRunOnStartup)({
|
|
70
|
+
leases: new run_lease_1.RunLeaseStore(stateDir, run_lease_1.nodeLeaseFs, deps.probe),
|
|
71
|
+
git: new git_driver_1.GitDriver((0, git_driver_1.nodeGitExec)(checkout)),
|
|
72
|
+
ledger: new ledger_store_1.LedgerStore(stateDir, ledger_store_1.nodeLedgerFs),
|
|
73
|
+
ledgerStateDir: stateDir,
|
|
74
|
+
ledgerFs: ledger_store_1.nodeLedgerFs,
|
|
75
|
+
projectId: deps.projectId,
|
|
76
|
+
now,
|
|
77
|
+
log: deps.log,
|
|
78
|
+
});
|
|
79
|
+
swept.push({ checkout, outcome });
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
const because = e.message;
|
|
83
|
+
deps.log(`recover : could not check ${checkout} for a dead run (${because})`);
|
|
84
|
+
swept.push({ checkout, outcome: { kind: 'failed', because } });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* M5-5: THE RECORD THAT LINGERS. A registered run whose process is PROVEN
|
|
89
|
+
* dead and whose checkout is gone — the reaper removed it (M4-4), or a
|
|
90
|
+
* person did — kept its record and its slot until `looply runs --release`
|
|
91
|
+
* (STATE §5 item 15; measured after the managed harness: one). Nothing can
|
|
92
|
+
* still be running there, so the record is released and the slot freed.
|
|
93
|
+
* A live record, a record the pid cannot be judged for, or one whose
|
|
94
|
+
* checkout still stands is left exactly alone — those are the reaper's and
|
|
95
|
+
* the person's to decide.
|
|
96
|
+
*/
|
|
97
|
+
try {
|
|
98
|
+
const registry = new workspace_1.RunRegistry((0, git_driver_1.projectStateDir)(deps.cwd), deps.probe);
|
|
99
|
+
for (const entry of registry.list()) {
|
|
100
|
+
if (entry.kind !== 'orphaned')
|
|
101
|
+
continue;
|
|
102
|
+
if ((0, node_fs_1.existsSync)(entry.record.workspace))
|
|
103
|
+
continue;
|
|
104
|
+
const because = `its process is gone and so is its checkout ${entry.record.workspace}`;
|
|
105
|
+
const out = registry.forget(entry.record.runId);
|
|
106
|
+
deps.log(`recover : released the record of run ${entry.record.runId} — ${because}${out.slot === null ? '' : ` (slot ${out.slot} freed)`}`);
|
|
107
|
+
swept.push({ checkout: entry.record.workspace, outcome: { kind: 'released', runId: entry.record.runId, because } });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
deps.log(`recover : could not read the run registry (${e.message})`);
|
|
112
|
+
}
|
|
113
|
+
return swept;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=stale-run-sweep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stale-run-sweep.js","sourceRoot":"","sources":["../src/stale-run-sweep.ts"],"names":[],"mappings":";;AA6EA,oCAgCC;AAMD,8CAkDC;AArKD,qCAAgE;AAChE,qCAAkC;AAClC,yCAA0C;AAC1C,uDAAmF;AACnF,6CAAqG;AACrG,iDAA2D;AAC3D,2CAAuE;AACvE,+CAAiD;AACjD,2CAA0D;AAC1D,iEAAsD;AAgEtD;;;GAGG;AACH,SAAgB,YAAY,CAAC,GAAW,EAAE,OAAe,IAAA,iBAAO,GAAE;IAChE,MAAM,IAAI,GAAG,IAAI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C;IACf,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { type RunRefusalCode } from '@looply/core';
|
|
2
|
+
import { type Liveness, type ProbeFn } from './run-lease';
|
|
3
|
+
import { type LedgerFs } from './ledger-store';
|
|
4
|
+
/**
|
|
5
|
+
* ONE ATTEMPT TO EXECUTE ONE BOUNDED START.
|
|
6
|
+
*
|
|
7
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
8
|
+
* TWO FACTS, NOT ONE
|
|
9
|
+
*
|
|
10
|
+
* A grant's ordinal receipt (autonomy-store.ts) says one thing and must go on
|
|
11
|
+
* saying only that: CONTROLLER C HAS PERMANENTLY SPENT START SLOT N. It is
|
|
12
|
+
* immutable, it is the budget, and nothing that goes wrong afterwards refunds
|
|
13
|
+
* it.
|
|
14
|
+
*
|
|
15
|
+
* This file records something different: ONE PROCESS HAS ATTEMPTED TO EXECUTE
|
|
16
|
+
* REQUEST S. A process can claim an attempt and die without ever reaching a
|
|
17
|
+
* Run, and that must be recoverable — otherwise a machine that crashed in the
|
|
18
|
+
* wrong second would burn a person's whole night one ordinal at a time.
|
|
19
|
+
*
|
|
20
|
+
* Conflating the two is what makes a controller wedge. If "the ordinal is
|
|
21
|
+
* reserved" also means "a Start is in flight", then a reservation followed by a
|
|
22
|
+
* crash is a Start that is in flight forever, against a process that does not
|
|
23
|
+
* exist, and nothing can ever move.
|
|
24
|
+
*
|
|
25
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
26
|
+
* THE REQUEST ID NEVER CHANGES
|
|
27
|
+
*
|
|
28
|
+
* Attempts 1, 2 and 3 of ordinal N all carry the SAME requestId. They are not
|
|
29
|
+
* three Starts; they are three tries at establishing one Start, and every
|
|
30
|
+
* durable fact about it — the lease, the start mark, the refusal mark — is
|
|
31
|
+
* filed under that one id. A retry that minted a new id would be a second
|
|
32
|
+
* Start wearing a disguise, and the budget would be a lie.
|
|
33
|
+
*
|
|
34
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
35
|
+
* THE CHILD CLAIMS, NOT THE DAEMON
|
|
36
|
+
*
|
|
37
|
+
* The claim is made by the process that could actually go on to do the work,
|
|
38
|
+
* immediately before it does. That is deliberate and it is the whole reason
|
|
39
|
+
* this is safe.
|
|
40
|
+
*
|
|
41
|
+
* A daemon that claimed before spawning would be recording the identity of a
|
|
42
|
+
* process that is NOT the executor: children here are detached and outlive
|
|
43
|
+
* their parent, so a dead daemon proves nothing about whether the run it
|
|
44
|
+
* launched is still going. The claimant would be a corpse and the executor
|
|
45
|
+
* would still be compiling. By having the child write its own pid, the durable
|
|
46
|
+
* claimant IS the process whose liveness decides whether a retry is safe.
|
|
47
|
+
*/
|
|
48
|
+
/** Bumped only when the on-disk shape changes incompatibly. Read, not decorative. */
|
|
49
|
+
export declare const START_ATTEMPTS_SCHEMA = 1;
|
|
50
|
+
/**
|
|
51
|
+
* How many times one Start request may be attempted.
|
|
52
|
+
*
|
|
53
|
+
* Three, matching `MAX_ITEM_EXECUTION_ATTEMPTS` — the repository's existing
|
|
54
|
+
* answer to "how many times may one thing be tried before we stop and say so".
|
|
55
|
+
*
|
|
56
|
+
* It needs its own bound rather than borrowing one. A HUMAN Start is bounded by
|
|
57
|
+
* the server's one-hour redelivery window: `pop` marks anything un-acked and
|
|
58
|
+
* older than that `expired`, and stops offering it. An autonomous Start has no
|
|
59
|
+
* server row, so it inherits none of that — the only ceiling it would otherwise
|
|
60
|
+
* have is the grant's 24-hour lifetime, which at a ten-second cadence is more
|
|
61
|
+
* than eight thousand attempts at a request that has failed the same way every
|
|
62
|
+
* time.
|
|
63
|
+
*/
|
|
64
|
+
export declare const MAX_START_REQUEST_ATTEMPTS = 3;
|
|
65
|
+
/**
|
|
66
|
+
* The deterministic name of one attempt.
|
|
67
|
+
*
|
|
68
|
+
* Derived, never minted, for the same reason `autonomyStartId` is: two daemons
|
|
69
|
+
* that independently conclude attempt 2 of request S is due must compute the
|
|
70
|
+
* same name, so that the filesystem can tell them apart instead of both
|
|
71
|
+
* believing they own it.
|
|
72
|
+
*/
|
|
73
|
+
export declare function startAttemptId(requestId: string, attempt: number): string;
|
|
74
|
+
/** What a claimant says about itself. Written once, never rewritten. */
|
|
75
|
+
export interface StartAttemptClaim {
|
|
76
|
+
requestId: string;
|
|
77
|
+
attempt: number;
|
|
78
|
+
/**
|
|
79
|
+
* Distinguishes this claimant from a later process that reuses the pid.
|
|
80
|
+
*
|
|
81
|
+
* The same three fields the run lease records, and for the same reason: a
|
|
82
|
+
* pid on its own is not an identity, because the operating system hands
|
|
83
|
+
* numbers out again. `RunLeaseStore` already learned this; nothing here
|
|
84
|
+
* invents a second convention.
|
|
85
|
+
*/
|
|
86
|
+
token: string;
|
|
87
|
+
pid: number;
|
|
88
|
+
host: string;
|
|
89
|
+
claimedAt: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A DAEMON SAYING IT IS ABOUT TO SPAWN. The retry budget, and nothing else.
|
|
93
|
+
*
|
|
94
|
+
* The claim beside it is written by the CHILD, at the admission seam, and that
|
|
95
|
+
* is right: the child is the process whose liveness decides whether work is
|
|
96
|
+
* still happening. But a receipt written by the child can only count children
|
|
97
|
+
* that GOT there, and a launch that dies first — a missing binary, an argv the
|
|
98
|
+
* CLI rejects, EPERM on the state directory, a partial upgrade — leaves nothing
|
|
99
|
+
* behind at all.
|
|
100
|
+
*
|
|
101
|
+
* So the bound counted admissions and the failure mode never produced one. A
|
|
102
|
+
* certification pass measured it: five hundred ticks, five hundred spawns,
|
|
103
|
+
* every one of them calling itself attempt 1, `MAX_START_REQUEST_ATTEMPTS`
|
|
104
|
+
* never once consulted with anything to consult it about. The only ceiling was
|
|
105
|
+
* the grant's own 24 hours, at eight thousand spawns.
|
|
106
|
+
*
|
|
107
|
+
* Two different facts, so two different artifacts:
|
|
108
|
+
*
|
|
109
|
+
* LAUNCH a daemon spent one of three tries. Written BEFORE the spawn,
|
|
110
|
+
* because a budget consumed after the risky act is not a budget.
|
|
111
|
+
* CLAIM a child crossed the admission seam. Written by that child.
|
|
112
|
+
*
|
|
113
|
+
* Neither pretends to be the other.
|
|
114
|
+
*/
|
|
115
|
+
export interface StartLaunch {
|
|
116
|
+
requestId: string;
|
|
117
|
+
attempt: number;
|
|
118
|
+
/**
|
|
119
|
+
* The daemon that reserved this try, so a successor can tell "somebody is
|
|
120
|
+
* spawning right now" from "somebody died mid-spawn". Same three fields as a
|
|
121
|
+
* claim, and for the same reason: a pid alone is not an identity.
|
|
122
|
+
*/
|
|
123
|
+
token: string;
|
|
124
|
+
pid: number;
|
|
125
|
+
host: string;
|
|
126
|
+
at: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* WHETHER A CHILD ACTUALLY CAME INTO EXISTENCE, recorded by the daemon that
|
|
130
|
+
* asked for one.
|
|
131
|
+
*
|
|
132
|
+
* Without it, a launch with no claim is unreadable: it could be a spawn that
|
|
133
|
+
* failed outright, a child that died before its first write, or a child that is
|
|
134
|
+
* about to claim a millisecond from now. Guessing "dead" would start a second
|
|
135
|
+
* executor on an assumption — the failure 6D2B exists to prevent. Guessing
|
|
136
|
+
* "alive" would stall a grant on a spawn that never happened.
|
|
137
|
+
*
|
|
138
|
+
* So the daemon writes down what the launcher told it, the moment it is told.
|
|
139
|
+
*/
|
|
140
|
+
export interface StartSpawn {
|
|
141
|
+
requestId: string;
|
|
142
|
+
attempt: number;
|
|
143
|
+
/** False when the launcher could not produce a child at all. */
|
|
144
|
+
spawned: boolean;
|
|
145
|
+
/** The child's pid when there is one and the platform reported it. */
|
|
146
|
+
pid?: number;
|
|
147
|
+
host: string;
|
|
148
|
+
at: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Where one request's attempts live.
|
|
152
|
+
*
|
|
153
|
+
* A directory per request, beside nothing else. Deliberately NOT a field on
|
|
154
|
+
* any of the whole-file JSON stores this state directory already holds: each of
|
|
155
|
+
* those is rewritten entire by writers that hold no lease, so attempt history
|
|
156
|
+
* filed there would be erased by a process that never knew it existed.
|
|
157
|
+
*
|
|
158
|
+
* The directory name is derived rather than used raw. A request id contains
|
|
159
|
+
* colons (`controller-start:aut_1:3`) and a colon cannot appear in a Windows
|
|
160
|
+
* filename, so the readable part is sanitised and an eight-hex digest of the
|
|
161
|
+
* WHOLE id is appended — readable enough to debug by eye, and unique because
|
|
162
|
+
* the digest is over the original.
|
|
163
|
+
*/
|
|
164
|
+
export declare function attemptDirName(requestId: string): string;
|
|
165
|
+
export type ClaimOutcome = {
|
|
166
|
+
ok: true;
|
|
167
|
+
claim: StartAttemptClaim;
|
|
168
|
+
}
|
|
169
|
+
/** Somebody else owns this exact attempt. NOT a statement about the goal. */
|
|
170
|
+
| {
|
|
171
|
+
ok: false;
|
|
172
|
+
because: string;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* WHAT HAS BEEN TRIED, AND WHETHER ANOTHER TRY IS ALLOWED.
|
|
176
|
+
*
|
|
177
|
+
* One authority, read by the daemon side and by every test. A second derivation
|
|
178
|
+
* living somewhere else is how two halves of a system come to disagree about
|
|
179
|
+
* whether a Start already happened.
|
|
180
|
+
*/
|
|
181
|
+
export type AttemptProgress =
|
|
182
|
+
/** Nothing has been tried. Attempt 1 may be claimed. */
|
|
183
|
+
{
|
|
184
|
+
kind: 'none';
|
|
185
|
+
nextAttempt: 1;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The latest claimant may still be working.
|
|
189
|
+
*
|
|
190
|
+
* Covers `alive` AND `unknown`, and the second is the point: a pid this
|
|
191
|
+
* process cannot probe is not evidence of death, and starting a second
|
|
192
|
+
* executor on a guess is the failure the whole file exists to prevent.
|
|
193
|
+
*/
|
|
194
|
+
| {
|
|
195
|
+
kind: 'active';
|
|
196
|
+
attempt: number;
|
|
197
|
+
liveness: Liveness;
|
|
198
|
+
claim: StartAttemptClaim;
|
|
199
|
+
}
|
|
200
|
+
/** The latest claimant is PROVEN dead and the budget has room. */
|
|
201
|
+
| {
|
|
202
|
+
kind: 'retryable';
|
|
203
|
+
nextAttempt: number;
|
|
204
|
+
deadAttempt: number;
|
|
205
|
+
}
|
|
206
|
+
/** A Run demonstrably began for this request. Irreversible. */
|
|
207
|
+
| {
|
|
208
|
+
kind: 'run-started';
|
|
209
|
+
runId: string;
|
|
210
|
+
}
|
|
211
|
+
/** The run itself decided. Irreversible. */
|
|
212
|
+
| {
|
|
213
|
+
kind: 'refused';
|
|
214
|
+
code: RunRefusalCode;
|
|
215
|
+
reason: string;
|
|
216
|
+
}
|
|
217
|
+
/** Every permitted attempt has been spent without a durable outcome. */
|
|
218
|
+
| {
|
|
219
|
+
kind: 'exhausted';
|
|
220
|
+
attempts: number;
|
|
221
|
+
}
|
|
222
|
+
/** The record cannot be trusted. Never guessed around. */
|
|
223
|
+
| {
|
|
224
|
+
kind: 'corrupt';
|
|
225
|
+
because: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The record could not be READ this instant. Not the same thing at all.
|
|
229
|
+
*
|
|
230
|
+
* `corrupt` is durable damage: the bytes are wrong and reading them again
|
|
231
|
+
* reaches the same conclusion, so the only honest end is to stop and ask a
|
|
232
|
+
* person. This is weather — an antivirus scanner or the search indexer
|
|
233
|
+
* holding a handle for a few milliseconds, which on Windows is ordinary.
|
|
234
|
+
*
|
|
235
|
+
* Collapsing the two ended a person's pursuit over a file lock that cleared
|
|
236
|
+
* before they read the message.
|
|
237
|
+
*/
|
|
238
|
+
| {
|
|
239
|
+
kind: 'unreadable';
|
|
240
|
+
because: string;
|
|
241
|
+
};
|
|
242
|
+
/** What `attemptProgress` needs to know that is not its own business to read. */
|
|
243
|
+
export interface RequestOutcomes {
|
|
244
|
+
/** The start mark for this request, if a Run demonstrably began. */
|
|
245
|
+
startedRun: {
|
|
246
|
+
runId: string;
|
|
247
|
+
} | null;
|
|
248
|
+
/** The refusal mark for this request, if the run decided against one. */
|
|
249
|
+
refusal: {
|
|
250
|
+
reason: string;
|
|
251
|
+
code?: RunRefusalCode;
|
|
252
|
+
} | null;
|
|
253
|
+
/**
|
|
254
|
+
* Whether the ordinal this request spends is still reserved.
|
|
255
|
+
*
|
|
256
|
+
* An attempt with no reservation behind it is a contradiction — the budget
|
|
257
|
+
* says nothing was spent while the attempt history says something was tried —
|
|
258
|
+
* and a contradiction is not something to pick a side of.
|
|
259
|
+
*/
|
|
260
|
+
ordinalReserved: boolean;
|
|
261
|
+
}
|
|
262
|
+
export declare class StartAttempts {
|
|
263
|
+
private readonly stateDir;
|
|
264
|
+
private readonly fs;
|
|
265
|
+
private readonly probe;
|
|
266
|
+
private readonly deps;
|
|
267
|
+
constructor(stateDir: string, fs: AttemptFs, probe?: ProbeFn, deps?: {
|
|
268
|
+
now?: () => number;
|
|
269
|
+
pid?: () => number;
|
|
270
|
+
host?: () => string;
|
|
271
|
+
token?: () => string;
|
|
272
|
+
});
|
|
273
|
+
private dir;
|
|
274
|
+
private path;
|
|
275
|
+
/** The daemon's "I am spending a try" receipt. Beside the claim, never instead of it. */
|
|
276
|
+
private launchPath;
|
|
277
|
+
/** What the launcher reported: a child, or no child. */
|
|
278
|
+
private spawnPath;
|
|
279
|
+
/**
|
|
280
|
+
* SPEND ONE OF THE THREE TRIES, before anything is spawned.
|
|
281
|
+
*
|
|
282
|
+
* Exclusive, like every other budget fact here, so two daemons that both
|
|
283
|
+
* decide attempt N is due cannot both take it. The loser is told, and does
|
|
284
|
+
* not spawn.
|
|
285
|
+
*
|
|
286
|
+
* Deliberately written BEFORE the launcher is called. A try recorded
|
|
287
|
+
* afterwards is not recorded at all for precisely the failures that need
|
|
288
|
+
* bounding — the ones where nothing comes back.
|
|
289
|
+
*/
|
|
290
|
+
reserveLaunch(requestId: string, attempt: number): Promise<{
|
|
291
|
+
ok: true;
|
|
292
|
+
launch: StartLaunch;
|
|
293
|
+
} | {
|
|
294
|
+
ok: false;
|
|
295
|
+
because: string;
|
|
296
|
+
}>;
|
|
297
|
+
/**
|
|
298
|
+
* Record what the launcher answered. Idempotent on the same answer.
|
|
299
|
+
*
|
|
300
|
+
* A second, DIFFERENT answer for one launch is two processes disagreeing
|
|
301
|
+
* about whether a child exists, which is not something to overwrite.
|
|
302
|
+
*/
|
|
303
|
+
noteSpawn(requestId: string, attempt: number, outcome: {
|
|
304
|
+
spawned: boolean;
|
|
305
|
+
pid?: number;
|
|
306
|
+
}): Promise<void>;
|
|
307
|
+
/**
|
|
308
|
+
* Every try spent on this request, lowest first, and what became of each.
|
|
309
|
+
*
|
|
310
|
+
* A hole is refused here for the same reason it is refused among the ordinal
|
|
311
|
+
* receipts: launches are taken in order, so a gap means one was removed, and
|
|
312
|
+
* a removed launch is a retry budget quietly topped up.
|
|
313
|
+
*/
|
|
314
|
+
launches(requestId: string): Promise<{
|
|
315
|
+
ok: true;
|
|
316
|
+
launches: {
|
|
317
|
+
launch: StartLaunch;
|
|
318
|
+
spawn: StartSpawn | null;
|
|
319
|
+
}[];
|
|
320
|
+
} | {
|
|
321
|
+
ok: false;
|
|
322
|
+
transient: boolean;
|
|
323
|
+
because: string;
|
|
324
|
+
}>;
|
|
325
|
+
/**
|
|
326
|
+
* Take attempt N of this request, or lose it.
|
|
327
|
+
*
|
|
328
|
+
* Exclusive create and nothing else — no read, no check, no "does it exist".
|
|
329
|
+
* The operating system hands the file to exactly one caller, and the loser
|
|
330
|
+
* finds out from the filesystem rather than from a stale read of its own.
|
|
331
|
+
*
|
|
332
|
+
* There is deliberately NO takeover path. If the claimant of attempt 1 is
|
|
333
|
+
* dead, the answer is attempt 2, not attempt 1 again: an attempt receipt is a
|
|
334
|
+
* historical fact and rewriting one would both lose the history that bounds
|
|
335
|
+
* the retries and reopen the dead-lease race class this repository already
|
|
336
|
+
* closed once.
|
|
337
|
+
*/
|
|
338
|
+
claim(requestId: string, attempt: number): Promise<ClaimOutcome>;
|
|
339
|
+
/** Every claim on record for this request, lowest attempt first. */
|
|
340
|
+
claims(requestId: string): Promise<{
|
|
341
|
+
ok: true;
|
|
342
|
+
claims: StartAttemptClaim[];
|
|
343
|
+
} | {
|
|
344
|
+
ok: false;
|
|
345
|
+
transient: boolean;
|
|
346
|
+
because: string;
|
|
347
|
+
}>;
|
|
348
|
+
/**
|
|
349
|
+
* What has become of this request, as something that must DECIDE reads it.
|
|
350
|
+
*
|
|
351
|
+
* The order of the questions is the safety argument, and it is not
|
|
352
|
+
* negotiable:
|
|
353
|
+
*
|
|
354
|
+
* A Run that demonstrably began outranks everything. Once `run.started` is
|
|
355
|
+
* durable no further attempt may ever be made, whatever the attempt history
|
|
356
|
+
* says and whichever process died — the work is happening, or it happened.
|
|
357
|
+
*
|
|
358
|
+
* A refusal the run itself made outranks the attempt history too. The run
|
|
359
|
+
* reached a decision; trying again would ask the same question of the same
|
|
360
|
+
* repository and get the same answer.
|
|
361
|
+
*
|
|
362
|
+
* Only then does whether anybody is still working matter.
|
|
363
|
+
*/
|
|
364
|
+
progress(requestId: string, outcomes: RequestOutcomes): Promise<AttemptProgress>;
|
|
365
|
+
/**
|
|
366
|
+
* Whether the process that made this claim is still about.
|
|
367
|
+
*
|
|
368
|
+
* A claim made on another machine is `unknown`, never `dead`: a pid means
|
|
369
|
+
* nothing off the host that issued it, and probing a local pid that happens
|
|
370
|
+
* to match somebody else's would be reading a stranger's process as evidence
|
|
371
|
+
* about ours.
|
|
372
|
+
*/
|
|
373
|
+
private livenessOf;
|
|
374
|
+
}
|
|
375
|
+
/** The filesystem this store needs. `createExclusive` is the whole argument. */
|
|
376
|
+
export interface AttemptFs extends LedgerFs {
|
|
377
|
+
/** Create only if absent. MUST reject with an `EEXIST` error when it is not. */
|
|
378
|
+
createExclusive(path: string, data: string): Promise<void>;
|
|
379
|
+
}
|
|
380
|
+
export declare const nodeAttemptFs: AttemptFs;
|
|
381
|
+
/** Narrow a refusal mark's code without trusting it. */
|
|
382
|
+
export declare function codeOf(mark: {
|
|
383
|
+
code?: unknown;
|
|
384
|
+
} | null): RunRefusalCode | undefined;
|
|
385
|
+
//# sourceMappingURL=start-attempts.d.ts.map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