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,639 @@
|
|
|
1
|
+
import { GitDriver } from './git-driver';
|
|
2
|
+
import { type Liveness, type ProbeFn as LeaseProbeFn } from './run-lease';
|
|
3
|
+
import { type ControlKind } from './control-file';
|
|
4
|
+
import type { LedgerFs } from './ledger-store';
|
|
5
|
+
/**
|
|
6
|
+
* WHERE A SECOND EXECUTION LIVES, AND WHO IS ALLOWED TO SAY SO.
|
|
7
|
+
*
|
|
8
|
+
* Phase 1 makes two executions safe by giving each its own checkout and its own
|
|
9
|
+
* execution state directory, rather than by making a dozen single-writer stores
|
|
10
|
+
* multi-writer. That is the cheaper half of a decision the recon argued at
|
|
11
|
+
* length: every store already takes `stateDir` as its first argument, so N state
|
|
12
|
+
* directories are already expressible — what was missing was a place to put
|
|
13
|
+
* them and something that knows they exist.
|
|
14
|
+
*
|
|
15
|
+
* TWO THINGS LIVE HERE AND THEY ARE DELIBERATELY SEPARATE:
|
|
16
|
+
*
|
|
17
|
+
* the WORKSPACE a linked git worktree plus its own `.looply/state`. Created
|
|
18
|
+
* through `GitDriver`, so it inherits every Phase 0/0.5
|
|
19
|
+
* defence rather than reimplementing a safe-enough subset.
|
|
20
|
+
* the REGISTRY one exclusively-created file per live execution, under the
|
|
21
|
+
* PROJECT's state directory. It is what makes capacity
|
|
22
|
+
* countable, `status` aggregable, and an orphan identifiable.
|
|
23
|
+
*
|
|
24
|
+
* ⚠️ THE REGISTRY IS NOT A LOCK. The run lease is still the mutual exclusion,
|
|
25
|
+
* still one per execution state directory, and still the thing that decides
|
|
26
|
+
* whether a checkout is busy. The registry answers a different question — "what
|
|
27
|
+
* else is running for this project" — which no lease can answer because leases
|
|
28
|
+
* cannot see each other.
|
|
29
|
+
*/
|
|
30
|
+
/** How a workspace's own directory is named under the workspaces root. */
|
|
31
|
+
export declare const WORKSPACES_DIR = "workspaces";
|
|
32
|
+
/**
|
|
33
|
+
* Clear a workspace's creation marker, by name.
|
|
34
|
+
*
|
|
35
|
+
* 🔴 A MARKER WHOSE PID IS RECYCLED PINS ITS WORKSPACE AS "in use" FOR EVER.
|
|
36
|
+
* `looply runs` shows it, `--reap` refuses it because something appears to be
|
|
37
|
+
* using it, and nothing else can ever say otherwise — the same permanent wedge
|
|
38
|
+
* a recycled pid makes of a slot, in a place with no `--release` to reach it.
|
|
39
|
+
*
|
|
40
|
+
* ⚠️ IT CLEARS THE MARKER, NOT THE CHECKOUT. Afterwards the workspace is
|
|
41
|
+
* ordinary: `--reap` judges it on residue and evidence like any other, and will
|
|
42
|
+
* still keep it if it holds a person's files.
|
|
43
|
+
*/
|
|
44
|
+
export declare function forgetCreationMarker(cwd: string, name: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Where every workspace for a project lives — OUTSIDE the repository.
|
|
47
|
+
*
|
|
48
|
+
* 🔴 IT WAS INSIDE, AND THAT WAS WRONG. The first version put workspaces under
|
|
49
|
+
* `<root>/.looply/workspaces`, and `.gitignore` covers `.looply/state/` and
|
|
50
|
+
* `.looply/runs/` but not that. Measured: creating one workspace turned the main
|
|
51
|
+
* checkout's `git status --porcelain` into `?? .looply/`. Looply's own dirty
|
|
52
|
+
* check would not have noticed — `changedPaths` filters `.looply/**` — but a
|
|
53
|
+
* PERSON would, and a person who then typed `git add -A` would commit an entire
|
|
54
|
+
* second checkout into their repository.
|
|
55
|
+
*
|
|
56
|
+
* `~/.looply` is where this codebase already puts state that must survive the
|
|
57
|
+
* repository, and for the same stated reason: `git clean -fd` would delete
|
|
58
|
+
* in-tree credentials. A workspace has exactly that property.
|
|
59
|
+
*
|
|
60
|
+
* ⚠️ KEYED BY A HASH OF THE MAIN WORKTREE PATH, not by the project's name. Two
|
|
61
|
+
* checkouts of the same repository in two places are two projects here, which is
|
|
62
|
+
* the same identity rule `containerName` and `providerSessionDir` already use.
|
|
63
|
+
*/
|
|
64
|
+
export declare function workspacesRoot(cwd: string, home?: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* One live execution, as the project can see it.
|
|
67
|
+
*
|
|
68
|
+
* Everything here is what a later phase needs to correlate evidence: which
|
|
69
|
+
* execution, in which checkout, on which branch, from which commit, writing
|
|
70
|
+
* which state directory, under which process.
|
|
71
|
+
*
|
|
72
|
+
* ⚠️ THE PURSUIT IS DELIBERATELY ABSENT. The registry bounds capacity and
|
|
73
|
+
* identifies orphans, and it can do both without ever knowing what the work is
|
|
74
|
+
* FOR — which is the bar `goal-wiring.spec.ts` sets for that vocabulary. The
|
|
75
|
+
* correlation a later phase needs already exists: `run.started` joins this
|
|
76
|
+
* `runId` to its goal on the ledger, once, where the binding was checked.
|
|
77
|
+
*/
|
|
78
|
+
export interface RunRecord {
|
|
79
|
+
runId: string;
|
|
80
|
+
/** The checkout this execution owns. The main worktree for an ordinary run. */
|
|
81
|
+
workspace: string;
|
|
82
|
+
/** Its own state directory — `<workspace>/.looply/state`. */
|
|
83
|
+
stateDir: string;
|
|
84
|
+
branch: string;
|
|
85
|
+
/** The commit the workspace was cut from. Phase 5 needs it; Phase 1 records it. */
|
|
86
|
+
baseSha: string;
|
|
87
|
+
/** Null for the main checkout, which no execution created and none may remove. */
|
|
88
|
+
worktree: boolean;
|
|
89
|
+
pid: number;
|
|
90
|
+
host: string;
|
|
91
|
+
startedAt: string;
|
|
92
|
+
/**
|
|
93
|
+
* M4-2: who asked for this run. `machine` is the daemon's autonomy tick
|
|
94
|
+
* (the launcher says `--autonomous`); `person` is `looply run` by hand or a
|
|
95
|
+
* start-run command from the phone. ABSENT — every record from before — is
|
|
96
|
+
* a person's: only a machine-started run is ever preemptible.
|
|
97
|
+
*/
|
|
98
|
+
startedBy?: 'machine' | 'person';
|
|
99
|
+
}
|
|
100
|
+
/** What a registry entry looks like once its process has been probed. */
|
|
101
|
+
export type RunLiveness = {
|
|
102
|
+
kind: 'active';
|
|
103
|
+
record: RunRecord;
|
|
104
|
+
}
|
|
105
|
+
/** The process is PROVEN gone. The workspace may still hold work worth keeping. */
|
|
106
|
+
| {
|
|
107
|
+
kind: 'orphaned';
|
|
108
|
+
record: RunRecord;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The pid could not be judged — EPERM, an unfamiliar errno, a nonsense pid.
|
|
112
|
+
* ⚠️ NOT AN ORPHAN. Every consumer here must treat this as "do not touch":
|
|
113
|
+
* unknown means the reaper leaves the directory and the slot stays held.
|
|
114
|
+
*/
|
|
115
|
+
| {
|
|
116
|
+
kind: 'unknown';
|
|
117
|
+
record: RunRecord;
|
|
118
|
+
}
|
|
119
|
+
/** The file could not be read or understood; never reaped on a guess. */
|
|
120
|
+
| {
|
|
121
|
+
kind: 'unreadable';
|
|
122
|
+
path: string;
|
|
123
|
+
because: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* 🔴 THE PID PROBE IS `run-lease`'s, NOT A SECOND ONE. This file had its own,
|
|
127
|
+
* and it was worse in both directions:
|
|
128
|
+
*
|
|
129
|
+
* • Two-valued. Anything other than `EPERM` — including an unfamiliar errno —
|
|
130
|
+
* read as DEAD, which is the exact mistake `run-lease` documents at length
|
|
131
|
+
* and defends against with a third answer.
|
|
132
|
+
* • It never rejected pid 0. `process.kill(0, 0)` signals the CURRENT PROCESS
|
|
133
|
+
* GROUP and succeeds, so a record carrying pid 0 read as alive forever and
|
|
134
|
+
* its slot could never be reclaimed — a permanent capacity leak from one
|
|
135
|
+
* torn write.
|
|
136
|
+
*
|
|
137
|
+
* The owner's standing rule about not building a second "safe enough" Git
|
|
138
|
+
* runner is the same rule: liveness has one implementation, hardened once.
|
|
139
|
+
*/
|
|
140
|
+
export type ProbeFn = LeaseProbeFn;
|
|
141
|
+
export declare const nodeProbe: ProbeFn;
|
|
142
|
+
export declare class WorkspaceError extends Error {
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The registry of live executions for one project.
|
|
146
|
+
*
|
|
147
|
+
* Entries are one file each, created with `wx`, exactly as the run lease is —
|
|
148
|
+
* the filesystem decides the winner, no read-then-write, and a crash leaves a
|
|
149
|
+
* file that can be judged rather than a lock nobody can clear.
|
|
150
|
+
*/
|
|
151
|
+
export declare class RunRegistry {
|
|
152
|
+
private readonly projectState;
|
|
153
|
+
private readonly probe;
|
|
154
|
+
constructor(projectState: string, probe?: ProbeFn);
|
|
155
|
+
private get dir();
|
|
156
|
+
private pathFor;
|
|
157
|
+
/**
|
|
158
|
+
* Claim a slot. Throws if this runId is already registered.
|
|
159
|
+
*
|
|
160
|
+
* ⚠️ EXCLUSIVE CREATE, not "check then write". Two executions starting in the
|
|
161
|
+
* same moment must not both believe they took the last slot, and only the
|
|
162
|
+
* filesystem can arbitrate that without a lock of our own.
|
|
163
|
+
*/
|
|
164
|
+
register(record: RunRecord): void;
|
|
165
|
+
/**
|
|
166
|
+
* Take one of `limit` slots, or refuse. THIS is the bound.
|
|
167
|
+
*
|
|
168
|
+
* 🔴 COUNTING WAS CHECK-THEN-ACT AND CLAIMED NOT TO BE. `capacityVerdict`
|
|
169
|
+
* read `active()`, judged, and only then did anything get created — and the
|
|
170
|
+
* exclusive `wx` this class pointed at as "the arbitration" is keyed on
|
|
171
|
+
* `runId`, minted fresh per run. Two runs starting together could never
|
|
172
|
+
* collide on that name, so both passed the count and both registered. Nothing
|
|
173
|
+
* upstream helped: two workspaces hold two different leases, and a lease
|
|
174
|
+
* cannot see another checkout.
|
|
175
|
+
*
|
|
176
|
+
* The SLOT is the exclusive thing. There are at most `limit` slot names, so at
|
|
177
|
+
* most `limit` runs can hold one, and the filesystem decides — exactly as it
|
|
178
|
+
* does for the run lease and the override marker.
|
|
179
|
+
*
|
|
180
|
+
* ⚠️ A SLOT HELD BY A DEAD PROCESS IS RECLAIMED, not counted. Otherwise one
|
|
181
|
+
* crash would lower this machine's concurrency until somebody noticed, which
|
|
182
|
+
* is the capacity leak this exists to avoid.
|
|
183
|
+
*/
|
|
184
|
+
claim(record: RunRecord, limit: number): {
|
|
185
|
+
ok: true;
|
|
186
|
+
slot: number;
|
|
187
|
+
} | {
|
|
188
|
+
ok: false;
|
|
189
|
+
because: string;
|
|
190
|
+
};
|
|
191
|
+
/** Wait a short while for the claim lock, breaking one a dead process left. */
|
|
192
|
+
private waitForToken;
|
|
193
|
+
private claimUnderLock;
|
|
194
|
+
/**
|
|
195
|
+
* Having WON a slot, decide whether it may be kept.
|
|
196
|
+
*
|
|
197
|
+
* 🔴 THE OVER-LIMIT COUNT WAS CHECK-THEN-ACT, and it was the only thing that
|
|
198
|
+
* could see slots above the limit. The exclusive `wx` is the arbitration for
|
|
199
|
+
* `[0, limit)` and nothing else, so with two live runs on out-of-range slots
|
|
200
|
+
* and the limit lowered, several starts could all pass the count and then all
|
|
201
|
+
* win DIFFERENT in-range slots. Reproduced: five executions at a limit of
|
|
202
|
+
* three. The fix for one hole opened a smaller one beside it.
|
|
203
|
+
*
|
|
204
|
+
* A count cannot be made atomic, so the decision moves AFTER the exclusive
|
|
205
|
+
* create: take the slot, then look. At most `limit` in-range slots can exist,
|
|
206
|
+
* so what is left to judge is how many holders there are in total.
|
|
207
|
+
*
|
|
208
|
+
* ⚠️ THE TIE-BREAK IS THE SLOT NUMBER, so simultaneous winners do not all back
|
|
209
|
+
* out and leave the machine idle. A holder keeps its slot when the holders
|
|
210
|
+
* BELOW it, plus every out-of-range holder, still leave room; otherwise it
|
|
211
|
+
* gives the slot back and refuses. Deterministic, and it always leaves exactly
|
|
212
|
+
* as many runs as the limit allows.
|
|
213
|
+
*/
|
|
214
|
+
private settle;
|
|
215
|
+
/**
|
|
216
|
+
* The claim lock, if one is being held, and by whom.
|
|
217
|
+
*
|
|
218
|
+
* 🔴 A WEDGED LOCK WAS INVISIBLE TO EVERY COMMAND. It is only breakable when
|
|
219
|
+
* its owner is PROVEN dead, so a lock left by a process that is alive but
|
|
220
|
+
* hung — or by one whose pid cannot be judged — denied every start of the
|
|
221
|
+
* project with a message about "another start deciding" and no way to see or
|
|
222
|
+
* clear it. That is the same wedge the slot files had before `looply runs`
|
|
223
|
+
* listed them.
|
|
224
|
+
*/
|
|
225
|
+
claimLock(): {
|
|
226
|
+
pid: number | null;
|
|
227
|
+
liveness: Liveness | 'unknown';
|
|
228
|
+
} | null;
|
|
229
|
+
/** Clear a held claim lock. A person's last resort, as `forgetSlot` is. */
|
|
230
|
+
forgetClaimLock(): boolean;
|
|
231
|
+
/** Every slot that is still held, whatever its number. `except` is skipped. */
|
|
232
|
+
private allHolders;
|
|
233
|
+
private atCapacity;
|
|
234
|
+
/**
|
|
235
|
+
* Take a free slot. The ONLY way a slot file is ever created.
|
|
236
|
+
*
|
|
237
|
+
* ⚠️ `wx` AND NOTHING ELSE. No read first, no delete first: the filesystem is
|
|
238
|
+
* the arbitration, exactly as it is for the run lease and the override marker.
|
|
239
|
+
*/
|
|
240
|
+
private take;
|
|
241
|
+
/**
|
|
242
|
+
* Remove a slot file whose holder is proven gone — or refuse to.
|
|
243
|
+
*
|
|
244
|
+
* 🔴 THE OLD RECLAIM WAS UNLINK-THEN-CREATE, WHICH IS THE CHECK-THEN-ACT THIS
|
|
245
|
+
* WHOLE CLASS EXISTS TO REMOVE. It judged a slot stale, unlinked it BY PATH,
|
|
246
|
+
* and only then tried its exclusive create. Two starters that both saw the
|
|
247
|
+
* same stale slot both unlinked — and the second unlink deleted the FIRST
|
|
248
|
+
* one's freshly created file, so both believed they held slot 0 and both ran.
|
|
249
|
+
* At limit 1. Reproduced with real concurrent processes.
|
|
250
|
+
*
|
|
251
|
+
* Two things fix it, and the second is the one that actually holds:
|
|
252
|
+
*
|
|
253
|
+
* THE TOKEN `slot-<n>.reclaiming`, created with `wx`. At most one
|
|
254
|
+
* process reclaims a given slot at a time, so the common case
|
|
255
|
+
* has no race to lose.
|
|
256
|
+
* THE RE-READ nothing is unlinked unless it is STILL the same record this
|
|
257
|
+
* judged, and still gone. A slot that has been re-taken names
|
|
258
|
+
* a different runId, and a different runId is never removed.
|
|
259
|
+
*
|
|
260
|
+
* The re-read is what makes this correct even if the token were somehow held
|
|
261
|
+
* twice — after a crash, say. The token only makes the correct path the quiet
|
|
262
|
+
* one.
|
|
263
|
+
*
|
|
264
|
+
* ⚠️ A TOKEN LEFT BY A CRASH IS BROKEN ONLY IF ITS OWN PID IS PROVEN DEAD, and
|
|
265
|
+
* then the re-read still decides. Otherwise a crash during reclaim would wedge
|
|
266
|
+
* one slot of this project for ever.
|
|
267
|
+
*/
|
|
268
|
+
private reclaim;
|
|
269
|
+
private takeToken;
|
|
270
|
+
/**
|
|
271
|
+
* The token's contents, once they have stopped changing.
|
|
272
|
+
*
|
|
273
|
+
* An exclusive create is two syscalls — open, then write — so a token read in
|
|
274
|
+
* between is empty through no fault of its holder. This re-reads over a short
|
|
275
|
+
* window and only reports empty if it stays empty.
|
|
276
|
+
*/
|
|
277
|
+
private settledText;
|
|
278
|
+
/** Give back a token THIS process holds. One held by anybody else is left. */
|
|
279
|
+
private dropToken;
|
|
280
|
+
/**
|
|
281
|
+
* Remove a token judged un-defendable — and ONLY if it is still the one that
|
|
282
|
+
* was judged.
|
|
283
|
+
*
|
|
284
|
+
* 🔴 THIS UNLINKED BY PATH. Two processes could both judge the same stale lock
|
|
285
|
+
* breakable; the first broke it and won the exclusive create, and the second —
|
|
286
|
+
* still inside its own break — then unlinked the FIRST one's fresh lock and
|
|
287
|
+
* created its own. Both were inside the critical section, and the loss
|
|
288
|
+
* cascaded from there. An adversarial pass measured up to four at once.
|
|
289
|
+
*
|
|
290
|
+
* `judged` is the content this decided about. If the file no longer says that,
|
|
291
|
+
* somebody else has already acted and this must not.
|
|
292
|
+
*/
|
|
293
|
+
private breakToken;
|
|
294
|
+
/**
|
|
295
|
+
* Give back the slot THIS run holds. A slot held by anybody else is left.
|
|
296
|
+
*
|
|
297
|
+
* 🔴 IT USED TO UNLINK BY INDEX, unconditionally, and that was the worst
|
|
298
|
+
* defect in this file. `releaseHold` gives the lease back BEFORE the slot, and
|
|
299
|
+
* `claim` treats a slot whose holder's lease is gone as free — so between
|
|
300
|
+
* those two lines another run could legitimately reclaim slot N, and this
|
|
301
|
+
* run's teardown would then delete the NEW holder's claim. The bound is
|
|
302
|
+
* exceeded, and it stays exceeded: the same window reopens at every teardown.
|
|
303
|
+
*
|
|
304
|
+
* Every sibling here is keyed on identity — `release(runId)`, `forget(runId)`.
|
|
305
|
+
* This one is now too. Absent is success, and so is a slot that has moved on.
|
|
306
|
+
*/
|
|
307
|
+
releaseSlot(slot: number, runId: string): void;
|
|
308
|
+
/** Every slot, as a person needs to see it — including ones nothing can read. */
|
|
309
|
+
slots(): {
|
|
310
|
+
slot: number;
|
|
311
|
+
record: RunRecord | null;
|
|
312
|
+
path: string;
|
|
313
|
+
}[];
|
|
314
|
+
/**
|
|
315
|
+
* The files in the slots directory that `slots()` refuses to name.
|
|
316
|
+
*
|
|
317
|
+
* 🔴 THE DOCBLOCK ABOVE CLAIMED THESE WERE REPORTED, AND THEY WERE NOT.
|
|
318
|
+
*
|
|
319
|
+
* Filtering `slot-abc.json` and `slot-01.json` out of `slots()` is right —
|
|
320
|
+
* a slot nobody can name is not a slot, and showing a person a row that
|
|
321
|
+
* `--release slot-01` cannot clear is worse than showing nothing. But the
|
|
322
|
+
* consequence of "not a slot" was "not anywhere": no row, no count, no
|
|
323
|
+
* mention, while the file sat in the directory looking exactly like the
|
|
324
|
+
* others. That is the failure mode this whole command exists to prevent.
|
|
325
|
+
*
|
|
326
|
+
* ⚠️ IT IS INERT, NOT DANGEROUS. Nothing counts it toward the bound and
|
|
327
|
+
* nothing reads it. It is reported because a file a person can see on disk
|
|
328
|
+
* and cannot see in `looply runs` is the thing that makes people distrust
|
|
329
|
+
* the listing — and because `rm` is the fix, which they can only reach if
|
|
330
|
+
* they are told the path.
|
|
331
|
+
*/
|
|
332
|
+
strayFiles(): string[];
|
|
333
|
+
/**
|
|
334
|
+
* Clear one slot by NUMBER, whatever it holds or fails to hold.
|
|
335
|
+
*
|
|
336
|
+
* The companion to `forget(runId)` for the case a runId cannot answer: a slot
|
|
337
|
+
* file that is corrupt, or truncated, or written by a version that is gone.
|
|
338
|
+
* Nothing automatic reaches this either — a person types `slot-<n>`.
|
|
339
|
+
*/
|
|
340
|
+
forgetSlot(slot: number): boolean;
|
|
341
|
+
/**
|
|
342
|
+
* Whether the run this slot names is still holding its own lease.
|
|
343
|
+
*
|
|
344
|
+
* ⚠️ A SECOND WITNESS, BECAUSE A PID IS A WEAK ONE. Pids are recycled, and a
|
|
345
|
+
* record left behind by a hard crash whose number a later process inherits
|
|
346
|
+
* probes as ALIVE for ever — so the slot it holds is never reclaimed and the
|
|
347
|
+
* machine's concurrency drops by one permanently, with nothing to point at.
|
|
348
|
+
*
|
|
349
|
+
* A live run always holds the lease in its own execution state directory: it
|
|
350
|
+
* is taken before the slot is claimed and given back in the same breath as
|
|
351
|
+
* the slot. So a slot whose run has NO lease is not a run, whatever its pid
|
|
352
|
+
* says — which covers the leak this cannot otherwise see, including the
|
|
353
|
+
* narrow one where releasing the lease succeeded and clearing the entry did
|
|
354
|
+
* not.
|
|
355
|
+
*
|
|
356
|
+
* ⚠️ IT DOES NOT CLOSE THE PID-RECYCLING HOLE, and saying so is the point: a
|
|
357
|
+
* hard crash leaves BOTH the lease and the record behind, so both witnesses
|
|
358
|
+
* agree and both are wrong. That residual is inherited from the lease's own
|
|
359
|
+
* liveness model, which documents it and deliberately has no heartbeat. What
|
|
360
|
+
* bounds it is that a person can always say so by name — see
|
|
361
|
+
* `looply runs --release`.
|
|
362
|
+
*
|
|
363
|
+
* ⚠️ AND IT FAILS TOWARDS "HELD". An unreadable lease is not evidence of
|
|
364
|
+
* absence; only a lease that is gone, or one that names a DIFFERENT run,
|
|
365
|
+
* frees the slot.
|
|
366
|
+
*/
|
|
367
|
+
private leaseAgrees;
|
|
368
|
+
/**
|
|
369
|
+
* Forget a run entirely: its record and any slot it holds.
|
|
370
|
+
*
|
|
371
|
+
* ⚠️ THE ONLY THING THAT CAN CLEAR A SLOT WHOSE PID LOOKS ALIVE, and it exists
|
|
372
|
+
* for exactly one situation: a pid recycled onto a crashed run's number, where
|
|
373
|
+
* every automatic witness agrees and every one of them is wrong. It is not
|
|
374
|
+
* called by anything automatic — a person names the run.
|
|
375
|
+
*/
|
|
376
|
+
forget(runId: string): {
|
|
377
|
+
forgot: boolean;
|
|
378
|
+
slot: number | null;
|
|
379
|
+
};
|
|
380
|
+
private slotPath;
|
|
381
|
+
private readSlot;
|
|
382
|
+
/** Give the slot back. Absent is success: releasing twice is not an error. */
|
|
383
|
+
release(runId: string): void;
|
|
384
|
+
/** Every entry, with its process probed. Never throws on a bad file. */
|
|
385
|
+
list(): RunLiveness[];
|
|
386
|
+
/**
|
|
387
|
+
* Everything NOT PROVEN DEAD — what capacity counts and what `stop` signals.
|
|
388
|
+
*
|
|
389
|
+
* ⚠️ 'unknown' IS INCLUDED, DELIBERATELY. Both callers are safer over-counting
|
|
390
|
+
* than under-counting: capacity would otherwise start an extra execution, and
|
|
391
|
+
* `stop` would otherwise report a run as finished while it is still writing.
|
|
392
|
+
*/
|
|
393
|
+
active(): RunRecord[];
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* 🔴 `capacityVerdict` WAS DELETED, and its absence is the point.
|
|
397
|
+
*
|
|
398
|
+
* It counted live records and judged them against the limit, and it read like
|
|
399
|
+
* the concurrency bound — but `claim` replaced it and nothing called it any
|
|
400
|
+
* more. A function that looks like the bound, is exported, is tested, and
|
|
401
|
+
* decides nothing is worse than no function at all: the next person to reach
|
|
402
|
+
* for it gets check-then-act semantics back, with tests that pass.
|
|
403
|
+
*
|
|
404
|
+
* The bound is `RunRegistry.claim`. There is one.
|
|
405
|
+
*/
|
|
406
|
+
/**
|
|
407
|
+
* Write a control request where EVERY live execution will read it.
|
|
408
|
+
*
|
|
409
|
+
* 🔴 ONE SHARED FILE PLUS N CONSUMERS IS A BRAKE THAT RELEASES ITSELF, and both
|
|
410
|
+
* writers had the same hole. `ControlStore.consume()` writes `resume` into the
|
|
411
|
+
* file it read, so the FIRST execution to reach a round boundary clears the
|
|
412
|
+
* instruction and every other one reads `resume` and carries on.
|
|
413
|
+
*
|
|
414
|
+
* `looply stop` was taught to write an addressed request per execution; the
|
|
415
|
+
* DAEMON — which is how the phone's Stop and Pause arrive — was not, and it is
|
|
416
|
+
* the path that matters most, because nobody is standing at the terminal to
|
|
417
|
+
* notice that two of three runs kept going.
|
|
418
|
+
*
|
|
419
|
+
* So there is one function, and both call it.
|
|
420
|
+
*
|
|
421
|
+
* ⚠️ THE SHARED FILE IS STILL WRITTEN, FIRST. It is what a run started AFTER
|
|
422
|
+
* this request will read, what Simple Mode has always used, and what `resume`
|
|
423
|
+
* has to clear. The addressed files are additive.
|
|
424
|
+
*
|
|
425
|
+
* ⚠️ AND A FAILURE TO REACH ONE EXECUTION IS REPORTED, not swallowed. A brake
|
|
426
|
+
* that misses a run must say which.
|
|
427
|
+
*/
|
|
428
|
+
export declare function requestControlEverywhere(projectState: string, live: readonly RunRecord[], kind: ControlKind, actor: string, fs: LedgerFs,
|
|
429
|
+
/** Where this project's executions may legitimately keep state. See below. */
|
|
430
|
+
cwd?: string): Promise<{
|
|
431
|
+
reached: string[];
|
|
432
|
+
unreachable: string[];
|
|
433
|
+
}>;
|
|
434
|
+
/**
|
|
435
|
+
* Create a workspace for an execution: a linked worktree on a fresh branch.
|
|
436
|
+
*
|
|
437
|
+
* ⚠️ THE GIT DRIVER DOES THE WORK, so the worktree is created by the same
|
|
438
|
+
* substrate every other verb uses — the repository-config refusal, the
|
|
439
|
+
* repository-root check, the rebuilt `GIT_` environment and the absolute git
|
|
440
|
+
* binary all apply. A provisioner with its own runner would be a second path
|
|
441
|
+
* around four defences at once.
|
|
442
|
+
*/
|
|
443
|
+
export declare function createWorkspace(git: GitDriver, cwd: string, runId: string, branch: string, baseSha: string,
|
|
444
|
+
/** Whose home the workspaces root lives under; the user's unless a test says otherwise (M4-1). */
|
|
445
|
+
home?: string,
|
|
446
|
+
/**
|
|
447
|
+
* `run.carry_into_checkouts` — directories this fresh checkout needs that git
|
|
448
|
+
* does not carry, above all `node_modules`.
|
|
449
|
+
*
|
|
450
|
+
* 🔴 WITHOUT IT THE GATE CANNOT PASS HERE. A worktree holds what git tracks,
|
|
451
|
+
* the gate runs with no network by design, and so a second worker's every
|
|
452
|
+
* round went red on the same missing toolchain. Measured: four rounds, one
|
|
453
|
+
* output digest.
|
|
454
|
+
*
|
|
455
|
+
* ⚠️ LAST AND DEFAULTED, so every existing caller and fixture is untouched and
|
|
456
|
+
* an empty list is byte-identical to the old behaviour.
|
|
457
|
+
*/
|
|
458
|
+
carry?: readonly string[]): Promise<string>;
|
|
459
|
+
/**
|
|
460
|
+
* 🔴 THE PART OF A REAP REFUSAL THAT NEVER CHANGES, ASKED ON ITS OWN.
|
|
461
|
+
*
|
|
462
|
+
* `looply runs` counted the orphans `--reap` could take by `record.worktree`,
|
|
463
|
+
* which does not mean "a checkout looply made". It means "not the main
|
|
464
|
+
* checkout" — and it is TRUE for a worktree a PERSON made and pointed `--in`
|
|
465
|
+
* at. So a crashed `--in` run was announced as "in a checkout looply made",
|
|
466
|
+
* the person ran `--reap`, and `--reap` refused it. Correctly, permanently,
|
|
467
|
+
* and once a day for ever.
|
|
468
|
+
*
|
|
469
|
+
* ⚠️ LIVENESS IS DELIBERATELY NOT ASKED HERE. That answer changes between the
|
|
470
|
+
* listing and the reap; this one does not. `reapVerdict` calls this, so the
|
|
471
|
+
* count in the summary and the refusal that follows it cannot drift apart
|
|
472
|
+
* again — there is one test, not two spellings of nearly the same one.
|
|
473
|
+
*/
|
|
474
|
+
export declare function reapableCheckout(record: RunRecord, cwd: string,
|
|
475
|
+
/** Whose home the workspaces root lives under; the user's unless a caller says otherwise (M4-4). */
|
|
476
|
+
home?: string): {
|
|
477
|
+
ok: true;
|
|
478
|
+
} | {
|
|
479
|
+
ok: false;
|
|
480
|
+
because: string;
|
|
481
|
+
};
|
|
482
|
+
export declare function reapVerdict(record: RunRecord, cwd: string, probe?: ProbeFn, home?: string): {
|
|
483
|
+
ok: true;
|
|
484
|
+
} | {
|
|
485
|
+
ok: false;
|
|
486
|
+
because: string;
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* Remove a proven-dead workspace, worktree record and registry entry.
|
|
490
|
+
*
|
|
491
|
+
* ⚠️ `git worktree remove` WITHOUT `--force`, then nothing. If git refuses —
|
|
492
|
+
* because the tree is dirty, or a file is held — the directory is LEFT and the
|
|
493
|
+
* refusal is returned. `--force` deletes ignored files, which is how a reaper
|
|
494
|
+
* would take somebody's `node_modules` or `.env` with it, and it fires exactly
|
|
495
|
+
* when git has already judged there is something worth refusing over.
|
|
496
|
+
*/
|
|
497
|
+
/**
|
|
498
|
+
* Everything in a workspace that is not a pristine checkout — INCLUDING ignored
|
|
499
|
+
* files, which is the whole reason this exists.
|
|
500
|
+
*
|
|
501
|
+
* ⚠️ THE DRIVER MUST BE BUILT FOR THE WORKSPACE, not for the main checkout.
|
|
502
|
+
* `trustedGitEnv` pins GIT_DIR and GIT_WORK_TREE from the cwd a driver was made
|
|
503
|
+
* with, and a pinned work tree beats `-C` — so a main-checkout driver asked
|
|
504
|
+
* about a workspace answers about the main checkout, confidently and wrongly.
|
|
505
|
+
*
|
|
506
|
+
* A failure to ask counts AS residue: a reaper that cannot see what is there
|
|
507
|
+
* must not delete it.
|
|
508
|
+
*/
|
|
509
|
+
export declare function workspaceResidue(gitInWorkspace: GitDriver, workspace: string,
|
|
510
|
+
/**
|
|
511
|
+
* `run.carry_into_checkouts` — paths LOOPLY PUT HERE ITSELF, and therefore not
|
|
512
|
+
* the person's.
|
|
513
|
+
*
|
|
514
|
+
* 🔴 WITHOUT THIS, PROVISIONING A WORKSPACE MAKES IT UNREAPABLE FOR EVER.
|
|
515
|
+
* `--ignored` is the whole point of this check, and a carried `node_modules`
|
|
516
|
+
* is ignored by definition — so the reaper counted the product's own copy as
|
|
517
|
+
* "file(s) nothing else has a copy of" and refused. Measured immediately after
|
|
518
|
+
* the carry landed: SIX workspaces, every one kept, each naming
|
|
519
|
+
* `!! node_modules/` as the person's content.
|
|
520
|
+
*
|
|
521
|
+
* The reasoning is the same one that drops `.looply/state/` two lines below:
|
|
522
|
+
* this is looply's own, it was copied from a source that still has it, and
|
|
523
|
+
* deleting it loses nothing. It is a COPY — that is the whole contract of
|
|
524
|
+
* `carryIntoCheckout` — so "nothing else has a copy of it" is exactly false.
|
|
525
|
+
*
|
|
526
|
+
* ⚠️ TOP-LEVEL NAMES ONLY, matching what `carryNameTrouble` permits. A path
|
|
527
|
+
* deeper than one segment is not carriable, so it cannot be excused here.
|
|
528
|
+
*/
|
|
529
|
+
carried?: readonly string[]): Promise<string[]>;
|
|
530
|
+
/**
|
|
531
|
+
* Move a dead execution's own state out of the workspace, so removing the
|
|
532
|
+
* checkout does not take the evidence with it.
|
|
533
|
+
*
|
|
534
|
+
* ⚠️ MOVED, NEVER DELETED, and the reap stops if this fails. A crashed run's
|
|
535
|
+
* ledger is the only account of why it crashed; a reaper that removes the
|
|
536
|
+
* checkout and loses it has destroyed the one thing somebody would come looking
|
|
537
|
+
* for. It lands in the PROJECT's state directory, which outlives every workspace.
|
|
538
|
+
*
|
|
539
|
+
* ⚠️ AND IT NEVER OVERWRITES. A second reap of the same runId — which can only
|
|
540
|
+
* happen if the first was interrupted — lands beside the first, not on it.
|
|
541
|
+
*/
|
|
542
|
+
export declare function retainEvidence(record: Pick<RunRecord, 'runId' | 'workspace'>, cwd: string): {
|
|
543
|
+
ok: true;
|
|
544
|
+
at: string | null;
|
|
545
|
+
} | {
|
|
546
|
+
ok: false;
|
|
547
|
+
because: string;
|
|
548
|
+
};
|
|
549
|
+
export declare function reapWorkspace(git: GitDriver, registry: RunRegistry, record: RunRecord, cwd: string, probe?: ProbeFn,
|
|
550
|
+
/** A driver bound to the given checkout. See `workspaceResidue`. */
|
|
551
|
+
gitInWorkspace?: (dir: string) => GitDriver, home?: string,
|
|
552
|
+
/**
|
|
553
|
+
* `run.carry_into_checkouts` - paths looply provisioned into the checkout
|
|
554
|
+
* itself. Passed through to `workspaceResidue`, which explains why.
|
|
555
|
+
*/
|
|
556
|
+
carried?: readonly string[]): Promise<{
|
|
557
|
+
reaped: boolean;
|
|
558
|
+
because?: string;
|
|
559
|
+
evidenceAt?: string;
|
|
560
|
+
}>;
|
|
561
|
+
/**
|
|
562
|
+
* Workspaces on disk that no live execution and no registry record account for.
|
|
563
|
+
*
|
|
564
|
+
* 🔴 THE LIFECYCLE HAD A THIRD HOLE, and I found this one by using the command I
|
|
565
|
+
* had just written. `looply run --new-workspace` cuts the checkout BEFORE the
|
|
566
|
+
* run registers, so anything that ends the run in between — a config error, a
|
|
567
|
+
* dirty tree, `--dry-run`, a crash — leaves a real worktree that `looply runs`
|
|
568
|
+
* cannot see and `--reap` cannot reach, because both work from registry records
|
|
569
|
+
* and there is none. They accumulate silently, one per failed start.
|
|
570
|
+
*
|
|
571
|
+
* ⚠️ ABSENCE OF A RECORD IS NOT ENOUGH TO CALL ONE ABANDONED. A run that has
|
|
572
|
+
* created its workspace and not yet registered is in exactly that state for a
|
|
573
|
+
* few hundred milliseconds. So the LEASE is the second witness, as it is for a
|
|
574
|
+
* slot: a workspace whose own execution state holds a lease naming a process
|
|
575
|
+
* that is not proven dead is left alone.
|
|
576
|
+
*
|
|
577
|
+
* ⚠️ AND IT LOOKS ONLY UNDER THE WORKSPACES ROOT — never at a `--in` checkout,
|
|
578
|
+
* which is the person's and which nothing here may ever remove.
|
|
579
|
+
*/
|
|
580
|
+
export declare function abandonedWorkspaces(cwd: string, registry: RunRegistry, probe?: ProbeFn, home?: string): {
|
|
581
|
+
abandoned: string[];
|
|
582
|
+
busy: string[];
|
|
583
|
+
};
|
|
584
|
+
export declare function checkoutBusy(stateDir: string, probe?: ProbeFn): boolean;
|
|
585
|
+
/** Whose start marker a workspace carries, so a person can be warned before clearing it. */
|
|
586
|
+
export declare function creationMarkerHolder(cwd: string, name: string, probe?: ProbeFn): {
|
|
587
|
+
pid: number;
|
|
588
|
+
liveness: Liveness;
|
|
589
|
+
} | null;
|
|
590
|
+
/**
|
|
591
|
+
* Drop the creation marker — the LAST thing a run does, and only then.
|
|
592
|
+
*
|
|
593
|
+
* 🔴 THE TIMING IS THE WHOLE DESIGN, and both extremes were shipped and wrong.
|
|
594
|
+
*
|
|
595
|
+
* Cleared EARLY (the moment the run had its lease and record) it reopened the
|
|
596
|
+
* window it exists to close: `releaseHold` gives the lease and the record back
|
|
597
|
+
* at the TOP of the teardown, with work still to do below it, so a concurrent
|
|
598
|
+
* `--reap` saw no lease, no record and no marker while the run was still
|
|
599
|
+
* writing.
|
|
600
|
+
*
|
|
601
|
+
* NEVER cleared, it becomes a permanent pid-shaped claim on a finished
|
|
602
|
+
* checkout: once that pid is recycled the workspace reads as busy for ever,
|
|
603
|
+
* invisible to `--reap`, with nothing a person could point at.
|
|
604
|
+
*
|
|
605
|
+
* So: last, after everything else the run does.
|
|
606
|
+
*/
|
|
607
|
+
export declare function clearCreationMarker(stateDir: string): void;
|
|
608
|
+
/**
|
|
609
|
+
* Drop this run's addressed control file, once the run is over.
|
|
610
|
+
*
|
|
611
|
+
* ⚠️ NOT REQUIRED FOR CORRECTNESS EITHER — it is named for a runId that will
|
|
612
|
+
* never exist again, so nothing can ever read it. It is cleared because
|
|
613
|
+
* otherwise `looply stop` leaves one behind per stopped run, for ever, in a
|
|
614
|
+
* directory that never had them: an ordinary Simple Mode checkout would
|
|
615
|
+
* accumulate a `control.<runId>.json` every time a person pressed stop.
|
|
616
|
+
*
|
|
617
|
+
* ⚠️ AND AT TEARDOWN, NOT AT CONSUME. Between consuming a stop and actually
|
|
618
|
+
* ending, a run is still running and a second stop is still a thing a person
|
|
619
|
+
* may send it.
|
|
620
|
+
*/
|
|
621
|
+
export declare function clearAddressedControl(stateDir: string, runId: string): void;
|
|
622
|
+
/**
|
|
623
|
+
* Retire a workspace that no record accounts for.
|
|
624
|
+
*
|
|
625
|
+
* Everything the record-based reap checks, minus the record: containment on the
|
|
626
|
+
* real path, residue, evidence retention, and `worktree remove` without
|
|
627
|
+
* `--force`. A person's `--in` checkout can never reach this — it is not under
|
|
628
|
+
* the workspaces root, which is checked first and by realpath.
|
|
629
|
+
*/
|
|
630
|
+
export declare function reapAbandoned(git: GitDriver, cwd: string, path: string, probe?: ProbeFn, gitInWorkspace?: (dir: string) => GitDriver, home?: string,
|
|
631
|
+
/**
|
|
632
|
+
* `run.carry_into_checkouts` - paths looply provisioned into the checkout
|
|
633
|
+
* itself. Passed through to `workspaceResidue`, which explains why.
|
|
634
|
+
*/
|
|
635
|
+
carried?: readonly string[]): Promise<{
|
|
636
|
+
reaped: boolean;
|
|
637
|
+
because?: string;
|
|
638
|
+
}>;
|
|
639
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAA2C,MAAM,cAAc,CAAC;AAElF,OAAO,EAAwC,KAAK,QAAQ,EAAE,KAAK,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAChH,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,cAAc,eAAe,CAAC;AAEzC;;;;;;;;;;;EAWC;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAqBvE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,CAoB5E;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAClC;AAED,yEAAyE;AACzE,MAAM,MAAM,WAAW,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