looply-cli 0.0.0-stage → 0.3.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 +2727 -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/serve-cmd.d.ts +115 -0
- package/dist/serve-cmd.d.ts.map +1 -0
- package/dist/serve-cmd.js +505 -0
- package/dist/serve-cmd.js.map +1 -0
- package/dist/serve.d.ts +167 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +336 -0
- package/dist/serve.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 +52 -4
- 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,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.artifactFacts = artifactFacts;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const observation_inventory_1 = require("./observation-inventory");
|
|
7
|
+
/**
|
|
8
|
+
* A single plain name: no separator of either kind, no leading dot, so no `..`
|
|
9
|
+
* and no traversal. This is the boundary; the routing below is only routing.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ A MUTATION BATTERY SHOWED WHY IT IS THE ONE THAT MATTERS. The first
|
|
12
|
+
* version routed on `id.includes('/')` and ALSO tested for a backslash there —
|
|
13
|
+
* and narrowing that back to a forward slash survived every test, because an
|
|
14
|
+
* id with a backslash is not a plain name either and this line refuses it.
|
|
15
|
+
* Two guards where one is load-bearing is two things to keep true; the routing
|
|
16
|
+
* asks only "is this an observation id", and everything else lands here.
|
|
17
|
+
*/
|
|
18
|
+
const PLAIN = /^[^\\/.][^\\/]*$/;
|
|
19
|
+
/**
|
|
20
|
+
* 🔴 EVERY FIELD SET SO THAT `decideRemoval` REFUSES: it refuses on
|
|
21
|
+
* `owned !== true`, on `pinned`, on `referenced`, and on `durable`. One of
|
|
22
|
+
* those would do; all four is what "nothing is permission" looks like when the
|
|
23
|
+
* answer is "I do not know what this is".
|
|
24
|
+
*/
|
|
25
|
+
const REFUSES = { owned: false, pinned: true, referenced: true, class: 'durable' };
|
|
26
|
+
/**
|
|
27
|
+
* WHAT THE FILESYSTEM CANNOT SAY: provenance, pins and references, asked
|
|
28
|
+
* again at the moment of removal.
|
|
29
|
+
*
|
|
30
|
+
* 🔴 IT LIVES HERE, AND NOT IN `bin.ts`, FOR THE REASON `self-repo-id.ts`
|
|
31
|
+
* gives at length: a spec that needs this would otherwise have to import the
|
|
32
|
+
* CLI entry point, and two suites importing that file is how a half-written
|
|
33
|
+
* transform cache entry took the gate down twice. It is also the only way to
|
|
34
|
+
* test it at all — this is the last check before a delete, and it had no
|
|
35
|
+
* spec of its own while it was a private function in a 2,000-line file.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Ownership, class and — the hard one — whether anything still refers to it.
|
|
39
|
+
*
|
|
40
|
+
* 🔴 `referenced` DEFAULTS TO TRUE, AND THAT IS THE WHOLE DESIGN OF IT.
|
|
41
|
+
* `OWNER_CHARTER.md` §5 D5 forbids deleting *"artifacts referenced by
|
|
42
|
+
* active/review/recovery work"* and says *"missing/unreadable/unknown is never
|
|
43
|
+
* deletion permission"*. Put together, those mean an artifact whose references
|
|
44
|
+
* could not be established is referenced as far as this is concerned. Only a
|
|
45
|
+
* check that RAN and found nothing may answer false.
|
|
46
|
+
*
|
|
47
|
+
* The three places a rejected candidate can still be spoken for, and all of them
|
|
48
|
+
* are bounded reads of files this project already keeps:
|
|
49
|
+
*
|
|
50
|
+
* run.lease.json the run holding the project right now
|
|
51
|
+
* runs/ the run records that have not been reaped
|
|
52
|
+
* queue.json an item still carrying the failure this candidate is from
|
|
53
|
+
*
|
|
54
|
+
* ⚠️ NOT `events.jsonl`. Every run id that ever existed is in it, so a search
|
|
55
|
+
* there would find every artifact referenced for ever and the policy would never
|
|
56
|
+
* expire anything — a rule that always says no is indistinguishable from one
|
|
57
|
+
* nobody wrote.
|
|
58
|
+
*/
|
|
59
|
+
function artifactFacts(stateDir, id) {
|
|
60
|
+
/**
|
|
61
|
+
* 🔴 AN OBSERVATION IS ASKED ABOUT AS AN OBSERVATION, and this branch is
|
|
62
|
+
* here because the fallback below would have got BOTH answers wrong: not
|
|
63
|
+
* under `rejected/`, so `durable` — which refuses every removal — and
|
|
64
|
+
* `pinned: false`, which would have been a lie about a watch still running.
|
|
65
|
+
* The re-check D5 asks for is only a re-check if it asks the same question
|
|
66
|
+
* the plan did.
|
|
67
|
+
*
|
|
68
|
+
* `null` from `observationFacts` is an id that could leave the store, a
|
|
69
|
+
* session with no such file, or a record that no longer parses. Every one of
|
|
70
|
+
* those is answered with facts that REFUSE, never with permission.
|
|
71
|
+
*/
|
|
72
|
+
if (id.includes('/')) {
|
|
73
|
+
const seen = (0, observation_inventory_1.observationFacts)(stateDir, id);
|
|
74
|
+
if (seen === null)
|
|
75
|
+
return REFUSES;
|
|
76
|
+
return { owned: seen.owned, pinned: seen.pinned, referenced: false, class: seen.class };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 🔴 AND AN ID THAT IS NOT A PLAIN NAME IS NOT ANSWERED AT ALL.
|
|
80
|
+
*
|
|
81
|
+
* A test with `ses_1\..\..\secret.json` found this: it contains no FORWARD
|
|
82
|
+
* slash, so the branch above did not take it, and the walk below answered
|
|
83
|
+
* `owned: true` for a path with two parent traversals in it. `class:
|
|
84
|
+
* 'durable'` happened to refuse the removal and `insideRoot` would have
|
|
85
|
+
* refused it again — but this function had stated, as a fact, that a
|
|
86
|
+
* traversal was an artifact created by this policy. `..` alone is worse
|
|
87
|
+
* still: `existsSync(rejected/..)` is TRUE, which would have made the state
|
|
88
|
+
* directory itself a `failure-diagnostic` this policy owns.
|
|
89
|
+
*
|
|
90
|
+
* D5 asks for *"path boundaries"* to be checked again here, not only at the
|
|
91
|
+
* delete. A name is a name; anything else is refused.
|
|
92
|
+
*/
|
|
93
|
+
if (!PLAIN.test(id))
|
|
94
|
+
return REFUSES;
|
|
95
|
+
const rejectedDir = (0, node_path_1.join)(stateDir, 'rejected');
|
|
96
|
+
const isRejected = (0, node_fs_1.existsSync)((0, node_path_1.join)(rejectedDir, id));
|
|
97
|
+
const cls = isRejected ? 'failure-diagnostic' : 'durable';
|
|
98
|
+
let referenced = true;
|
|
99
|
+
try {
|
|
100
|
+
const lease = (0, node_fs_1.existsSync)((0, node_path_1.join)(stateDir, 'run.lease.json'))
|
|
101
|
+
? (0, node_fs_1.readFileSync)((0, node_path_1.join)(stateDir, 'run.lease.json'), 'utf8')
|
|
102
|
+
: '';
|
|
103
|
+
const queue = (0, node_fs_1.existsSync)((0, node_path_1.join)(stateDir, 'queue.json')) ? (0, node_fs_1.readFileSync)((0, node_path_1.join)(stateDir, 'queue.json'), 'utf8') : '';
|
|
104
|
+
const runsDir = (0, node_path_1.join)(stateDir, 'runs');
|
|
105
|
+
const runs = (0, node_fs_1.existsSync)(runsDir) ? (0, node_fs_1.readdirSync)(runsDir).join('\n') : '';
|
|
106
|
+
referenced = lease.includes(id) || queue.includes(id) || runs.includes(id);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// A read that failed establishes nothing, and nothing is permission.
|
|
110
|
+
referenced = true;
|
|
111
|
+
}
|
|
112
|
+
return { owned: true, pinned: false, referenced, class: cls };
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=evidence-facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-facts.js","sourceRoot":"","sources":["../src/evidence-facts.ts"],"names":[],"mappings":";;AA2DA,sCA4DC;AAvHD,qCAAgE;AAChE,yCAAiC;AACjC,mEAA2D;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAW,CAAC;AAE5F;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,aAAa,CAAC,QAAgB,EAAE,EAAU;IAMxD;;;;;;;;;;;OAWG;IACH,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,GAAG,IAAA,wCAAgB,EAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,OAAO,CAAC;QAClC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,OAAO,CAAC;IAEpC,MAAM,WAAW,GAAG,IAAA,gBAAI,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAE,oBAA8B,CAAC,CAAC,CAAE,SAAmB,CAAC;IAEhF,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;YACxD,CAAC,CAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;YACxD,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,KAAK,GAAG,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjH,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAAC,MAAM,CAAC;QACP,qEAAqE;QACrE,UAAU,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ONE SHORT MUTEX, SHARED BY EVERY CHECK-AND-CLAIM THAT NEEDS ONE.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* 🔴 COMPARE-AFTER-CLAIM ONLY WORKS WHEN EVERY CLAIMANT COMPARES THE SAME
|
|
6
|
+
* SEQUENCE — AND TWO SEPARATE MECHANISMS HAVE NOW LEARNED THAT THE HARD WAY.
|
|
7
|
+
*
|
|
8
|
+
* The surface lease learned it first: `src` and `src/app` are different
|
|
9
|
+
* directories with independent ordinals, so "who got there first" is not a
|
|
10
|
+
* question their contents can answer. MEASURED with the read-back in place and
|
|
11
|
+
* no mutex: eight racers produced FOUR simultaneous holders, three trials
|
|
12
|
+
* running.
|
|
13
|
+
*
|
|
14
|
+
* The spend ledger learned it second, and worse. Its claimants DID share one
|
|
15
|
+
* sequence — an append-only file ordered by `(at, id)` — and it still was not
|
|
16
|
+
* enough. A claimant that obtained an early ordering key and published it LATE
|
|
17
|
+
* was counted by nobody: everyone who decided in between sorted after it and so
|
|
18
|
+
* was excluded from its own view. MEASURED against a $3 ceiling with $2
|
|
19
|
+
* estimates: B published at T+1000 and was admitted, A published at T and was
|
|
20
|
+
* admitted, and the window held $4. A total order over rows says who is first;
|
|
21
|
+
* it does not say who has already been told yes.
|
|
22
|
+
*
|
|
23
|
+
* So the operation that makes an admission authoritative is the WHOLE
|
|
24
|
+
* check-and-claim, taken inside this lock. Publication and decision happen in
|
|
25
|
+
* the same critical section, so there is no interval in which a claim has been
|
|
26
|
+
* decided but not published — which is exactly what makes a late publication
|
|
27
|
+
* harmless: there is no such thing.
|
|
28
|
+
*
|
|
29
|
+
* ⚠️ THE READ PATHS TAKE NOTHING. `holderOf`, `checkFence` and `spendInWindow`
|
|
30
|
+
* stay lock-free; only the writers serialise. Acquisition happens once per run
|
|
31
|
+
* and takes microseconds.
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ AND A DEAD HOLDER'S LOCK IS BROKEN BY CONTENT MATCH, NEVER BY PATH. Phase
|
|
34
|
+
* 1 measured what removing a lock by path costs: a process that had already lost
|
|
35
|
+
* its claim deleted the winner's, and four processes then held one lock.
|
|
36
|
+
*
|
|
37
|
+
* ⚠️ ONE IMPLEMENTATION, NOT TWO. This was extracted from `surface-lease` rather
|
|
38
|
+
* than copied beside it. A second "safe enough" mutex is how two callers come to
|
|
39
|
+
* disagree about what holding one means.
|
|
40
|
+
*/
|
|
41
|
+
export declare const EXCLUSIVE_LOCK_WAIT_MS = 5000;
|
|
42
|
+
/**
|
|
43
|
+
* F43: HOW LONG A WAITER PAUSES BETWEEN ATTEMPTS. It waits; it does not spin.
|
|
44
|
+
* A wait sized for microsecond critical sections could afford a busy loop; the
|
|
45
|
+
* shared-grant lock is held across an ACL write that takes tens of seconds, and
|
|
46
|
+
* a spinning waiter burns a core and hammers the lock file for all of it.
|
|
47
|
+
* `Atomics.wait` blocks the thread without the event loop, which this
|
|
48
|
+
* synchronous function already does.
|
|
49
|
+
*/
|
|
50
|
+
export declare const EXCLUSIVE_LOCK_PAUSE_MS = 20;
|
|
51
|
+
export declare function withExclusiveLock<T>(path: string, fn: () => T, fallback: (why: string) => T, waitMs?: number): T;
|
|
52
|
+
//# sourceMappingURL=exclusive-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exclusive-lock.d.ts","sourceRoot":"","sources":["../src/exclusive-lock.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,sBAAsB,OAAQ,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAG1C,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,CAAC,EACX,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,EAC5B,MAAM,GAAE,MAA+B,GACtC,CAAC,CAmFH"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXCLUSIVE_LOCK_PAUSE_MS = exports.EXCLUSIVE_LOCK_WAIT_MS = void 0;
|
|
4
|
+
exports.withExclusiveLock = withExclusiveLock;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const node_os_1 = require("node:os");
|
|
8
|
+
const run_lease_1 = require("./run-lease");
|
|
9
|
+
/**
|
|
10
|
+
* ONE SHORT MUTEX, SHARED BY EVERY CHECK-AND-CLAIM THAT NEEDS ONE.
|
|
11
|
+
*
|
|
12
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
* 🔴 COMPARE-AFTER-CLAIM ONLY WORKS WHEN EVERY CLAIMANT COMPARES THE SAME
|
|
14
|
+
* SEQUENCE — AND TWO SEPARATE MECHANISMS HAVE NOW LEARNED THAT THE HARD WAY.
|
|
15
|
+
*
|
|
16
|
+
* The surface lease learned it first: `src` and `src/app` are different
|
|
17
|
+
* directories with independent ordinals, so "who got there first" is not a
|
|
18
|
+
* question their contents can answer. MEASURED with the read-back in place and
|
|
19
|
+
* no mutex: eight racers produced FOUR simultaneous holders, three trials
|
|
20
|
+
* running.
|
|
21
|
+
*
|
|
22
|
+
* The spend ledger learned it second, and worse. Its claimants DID share one
|
|
23
|
+
* sequence — an append-only file ordered by `(at, id)` — and it still was not
|
|
24
|
+
* enough. A claimant that obtained an early ordering key and published it LATE
|
|
25
|
+
* was counted by nobody: everyone who decided in between sorted after it and so
|
|
26
|
+
* was excluded from its own view. MEASURED against a $3 ceiling with $2
|
|
27
|
+
* estimates: B published at T+1000 and was admitted, A published at T and was
|
|
28
|
+
* admitted, and the window held $4. A total order over rows says who is first;
|
|
29
|
+
* it does not say who has already been told yes.
|
|
30
|
+
*
|
|
31
|
+
* So the operation that makes an admission authoritative is the WHOLE
|
|
32
|
+
* check-and-claim, taken inside this lock. Publication and decision happen in
|
|
33
|
+
* the same critical section, so there is no interval in which a claim has been
|
|
34
|
+
* decided but not published — which is exactly what makes a late publication
|
|
35
|
+
* harmless: there is no such thing.
|
|
36
|
+
*
|
|
37
|
+
* ⚠️ THE READ PATHS TAKE NOTHING. `holderOf`, `checkFence` and `spendInWindow`
|
|
38
|
+
* stay lock-free; only the writers serialise. Acquisition happens once per run
|
|
39
|
+
* and takes microseconds.
|
|
40
|
+
*
|
|
41
|
+
* ⚠️ AND A DEAD HOLDER'S LOCK IS BROKEN BY CONTENT MATCH, NEVER BY PATH. Phase
|
|
42
|
+
* 1 measured what removing a lock by path costs: a process that had already lost
|
|
43
|
+
* its claim deleted the winner's, and four processes then held one lock.
|
|
44
|
+
*
|
|
45
|
+
* ⚠️ ONE IMPLEMENTATION, NOT TWO. This was extracted from `surface-lease` rather
|
|
46
|
+
* than copied beside it. A second "safe enough" mutex is how two callers come to
|
|
47
|
+
* disagree about what holding one means.
|
|
48
|
+
*/
|
|
49
|
+
exports.EXCLUSIVE_LOCK_WAIT_MS = 5_000;
|
|
50
|
+
/**
|
|
51
|
+
* F43: HOW LONG A WAITER PAUSES BETWEEN ATTEMPTS. It waits; it does not spin.
|
|
52
|
+
* A wait sized for microsecond critical sections could afford a busy loop; the
|
|
53
|
+
* shared-grant lock is held across an ACL write that takes tens of seconds, and
|
|
54
|
+
* a spinning waiter burns a core and hammers the lock file for all of it.
|
|
55
|
+
* `Atomics.wait` blocks the thread without the event loop, which this
|
|
56
|
+
* synchronous function already does.
|
|
57
|
+
*/
|
|
58
|
+
exports.EXCLUSIVE_LOCK_PAUSE_MS = 20;
|
|
59
|
+
const PAUSE = new Int32Array(new SharedArrayBuffer(4));
|
|
60
|
+
function withExclusiveLock(path, fn, fallback, waitMs = exports.EXCLUSIVE_LOCK_WAIT_MS) {
|
|
61
|
+
const mine = `${JSON.stringify({ pid: process.pid, host: (0, node_os_1.hostname)(), at: new Date().toISOString() })}\n`;
|
|
62
|
+
/**
|
|
63
|
+
* 🔴 THIS FUNCTION DOES NOT THROW ON A LOCK IT CANNOT TAKE — IT REFUSES.
|
|
64
|
+
*
|
|
65
|
+
* The extracted version rethrew an unexpected errno and let `mkdirSync`
|
|
66
|
+
* escape, and that turned a REFUSAL into a CRASH at the budget seam: a home
|
|
67
|
+
* directory that is a FILE — which is exactly how `admitSpend` is asked to
|
|
68
|
+
* prove it refuses when it cannot record — threw ENOTDIR out of the lock
|
|
69
|
+
* instead of answering "could not record what it is about to spend".
|
|
70
|
+
*
|
|
71
|
+
* Both callers already treat "could not serialise" as a refusal, and a
|
|
72
|
+
* refusal is the only safe reading of it. So every acquisition failure comes
|
|
73
|
+
* out of `fallback` with its reason. `fn()` is deliberately outside this: a
|
|
74
|
+
* caller's own error is not a lock failure and must propagate.
|
|
75
|
+
*/
|
|
76
|
+
try {
|
|
77
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(path), { recursive: true });
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
return fallback(`this lock's directory could not be created: ${e.message}`);
|
|
81
|
+
}
|
|
82
|
+
let refused = null;
|
|
83
|
+
const take = () => {
|
|
84
|
+
try {
|
|
85
|
+
(0, node_fs_1.writeFileSync)(path, mine, { encoding: 'utf8', flag: 'wx' });
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
const code = e.code;
|
|
90
|
+
// Windows answers EPERM rather than EEXIST against a pending-delete file.
|
|
91
|
+
if (code === 'EEXIST' || code === 'EPERM')
|
|
92
|
+
return false;
|
|
93
|
+
refused = e.message;
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const deadline = Date.now() + waitMs;
|
|
98
|
+
let held = take();
|
|
99
|
+
while (!held && refused === null && Date.now() < deadline) {
|
|
100
|
+
Atomics.wait(PAUSE, 0, 0, exports.EXCLUSIVE_LOCK_PAUSE_MS);
|
|
101
|
+
// A holder that is gone leaves a lock nobody will ever release. Broken by
|
|
102
|
+
// reading the file, judging that pid, and removing only if the bytes have
|
|
103
|
+
// not changed in between.
|
|
104
|
+
let raw = null;
|
|
105
|
+
try {
|
|
106
|
+
raw = (0, node_fs_1.readFileSync)(path, 'utf8');
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
raw = null;
|
|
110
|
+
}
|
|
111
|
+
if (raw !== null) {
|
|
112
|
+
let owner = {};
|
|
113
|
+
try {
|
|
114
|
+
owner = JSON.parse(raw);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
owner = {};
|
|
118
|
+
}
|
|
119
|
+
const judgeable = owner.host === (0, node_os_1.hostname)() && typeof owner.pid === 'number';
|
|
120
|
+
if (judgeable && (0, run_lease_1.nodeProbe)(owner.pid) === 'dead') {
|
|
121
|
+
try {
|
|
122
|
+
if ((0, node_fs_1.readFileSync)(path, 'utf8') === raw)
|
|
123
|
+
(0, node_fs_1.unlinkSync)(path);
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
/* somebody else got there first, which is fine */
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
held = take();
|
|
131
|
+
}
|
|
132
|
+
if (!held) {
|
|
133
|
+
return fallback(refused === null
|
|
134
|
+
? 'another process is holding this lock and did not finish in time'
|
|
135
|
+
: `this lock could not be taken: ${refused}`);
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
return fn();
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
try {
|
|
142
|
+
if ((0, node_fs_1.readFileSync)(path, 'utf8') === mine)
|
|
143
|
+
(0, node_fs_1.unlinkSync)(path);
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
/* already gone, or broken by somebody who judged us dead */
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=exclusive-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exclusive-lock.js","sourceRoot":"","sources":["../src/exclusive-lock.ts"],"names":[],"mappings":";;;AA0DA,8CAwFC;AAlJD,qCAA6E;AAC7E,yCAAoC;AACpC,qCAAmC;AACnC,2CAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACU,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAE5C;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAAG,EAAE,CAAC;AAC1C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvD,SAAgB,iBAAiB,CAC/B,IAAY,EACZ,EAAW,EACX,QAA4B,EAC5B,SAAiB,8BAAsB;IAEvC,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAA,kBAAQ,GAAE,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC;IACzG;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC;QACH,IAAA,mBAAS,EAAC,IAAA,mBAAO,EAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,QAAQ,CAAC,+CAAgD,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,MAAM,IAAI,GAAG,GAAY,EAAE;QACzB,IAAI,CAAC;YACH,IAAA,uBAAa,EAAC,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5D,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,GAAI,CAA2B,CAAC,IAAI,CAAC;YAC/C,0EAA0E;YAC1E,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO;gBAAE,OAAO,KAAK,CAAC;YACxD,OAAO,GAAI,CAAW,CAAC,OAAO,CAAC;YAC/B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;IACrC,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;IAClB,OAAO,CAAC,IAAI,IAAI,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,+BAAuB,CAAC,CAAC;QACnD,0EAA0E;QAC1E,0EAA0E;QAC1E,0BAA0B;QAC1B,IAAI,GAAG,GAAkB,IAAI,CAAC;QAC9B,IAAI,CAAC;YACH,GAAG,GAAG,IAAA,sBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,GAAG,GAAG,IAAI,CAAC;QACb,CAAC;QACD,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,IAAI,KAAK,GAAoC,EAAE,CAAC;YAChD,IAAI,CAAC;gBACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAoC,CAAC;YAC7D,CAAC;YAAC,MAAM,CAAC;gBACP,KAAK,GAAG,EAAE,CAAC;YACb,CAAC;YACD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,KAAK,IAAA,kBAAQ,GAAE,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC;YAC7E,IAAI,SAAS,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,GAAI,CAAC,KAAK,MAAM,EAAE,CAAC;gBAClD,IAAI,CAAC;oBACH,IAAI,IAAA,sBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG;wBAAE,IAAA,oBAAU,EAAC,IAAI,CAAC,CAAC;gBAC3D,CAAC;gBAAC,MAAM,CAAC;oBACP,kDAAkD;gBACpD,CAAC;YACH,CAAC;QACH,CAAC;QACD,IAAI,GAAG,IAAI,EAAE,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,QAAQ,CACb,OAAO,KAAK,IAAI;YACd,CAAC,CAAC,iEAAiE;YACnE,CAAC,CAAC,iCAAiC,OAAO,EAAE,CAC/C,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,IAAI,IAAA,sBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI;gBAAE,IAAA,oBAAU,EAAC,IAAI,CAAC,CAAC;QAC5D,CAAC;QAAC,MAAM,CAAC;YACP,4DAA4D;QAC9D,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { type FsGrant, type UntrustedKind } from './untrusted-exec';
|
|
2
|
+
/**
|
|
3
|
+
* WHICH SIDE OF THE BOUNDARY A CHILD BELONGS ON, AND WHAT IT IS HANDED.
|
|
4
|
+
*
|
|
5
|
+
* There are exactly two domains and the rule for sorting into them is short: if
|
|
6
|
+
* anything about what runs can be influenced by project source, project config
|
|
7
|
+
* or the coding model, it is UNTRUSTED. That includes `npm test` — npm is not
|
|
8
|
+
* the point, the code underneath it is.
|
|
9
|
+
*
|
|
10
|
+
* TRUSTED children are Looply's own: git with argv Looply built, the run child,
|
|
11
|
+
* the containment helper. They keep the daemon's authority because they are the
|
|
12
|
+
* daemon.
|
|
13
|
+
*
|
|
14
|
+
* The environments are built here rather than at each call site so there is one
|
|
15
|
+
* place to read when asking what a contained process can see — and so that
|
|
16
|
+
* "start from `process.env` and delete the scary ones" is not expressible. Each
|
|
17
|
+
* builder starts from the platform baseline and adds, which fails safe when a
|
|
18
|
+
* new secret appears in the daemon's environment later.
|
|
19
|
+
*/
|
|
20
|
+
/** The trust domain of a child process. */
|
|
21
|
+
export type ExecutionDomain = 'trusted' | 'untrusted';
|
|
22
|
+
/**
|
|
23
|
+
* Where a contained child keeps the profile Windows insists it has.
|
|
24
|
+
*
|
|
25
|
+
* An AppContainer needs USERPROFILE/APPDATA/LOCALAPPDATA to start at all — the
|
|
26
|
+
* loader resolves the container's redirected storage through them. Pointing
|
|
27
|
+
* them at the daemon's profile would hand back everything the container exists
|
|
28
|
+
* to keep away: `~/.looply/machine.json`, `~/.claude`, `~/.gitconfig`. So the
|
|
29
|
+
* child gets its own, created beside the system temp directory and granted to
|
|
30
|
+
* it explicitly.
|
|
31
|
+
*
|
|
32
|
+
* Per project and per domain, so a gate cannot read what an agent left behind.
|
|
33
|
+
*/
|
|
34
|
+
export declare function containedRoot(kind: UntrustedKind, projectKey: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* The environment for project-controlled test, build and typecheck commands.
|
|
37
|
+
*
|
|
38
|
+
* Carries no credential of any kind. The two extras are both about making the
|
|
39
|
+
* boundary work rather than about trust:
|
|
40
|
+
*
|
|
41
|
+
* `NODE_OPTIONS` — an AppContainer cannot stat `C:\`, and Node's module
|
|
42
|
+
* resolution walks to the drive root, so without these flags nothing Node runs
|
|
43
|
+
* at all. Scoped here rather than set on the daemon.
|
|
44
|
+
*
|
|
45
|
+
* `GIT_CONFIG_NOSYSTEM` — defence in depth only. It removes the system git
|
|
46
|
+
* config, and with it the ambient credential helper, from anything the gate
|
|
47
|
+
* runs. It is NOT the boundary: a determined process can clear a variable. The
|
|
48
|
+
* container is the boundary.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildUntrustedGateEnv(projectKey: string, toolchain?: string): Record<string, string>;
|
|
51
|
+
/**
|
|
52
|
+
* The search path a contained child gets.
|
|
53
|
+
*
|
|
54
|
+
* Built, not inherited. The daemon's PATH names sixty-odd directories the
|
|
55
|
+
* container cannot read, and — worse — it names the real toolchain directory,
|
|
56
|
+
* which on this machine also holds `claude`, `eas` and `heroku` shims. A gate
|
|
57
|
+
* that could resolve those would be a gate that could deploy.
|
|
58
|
+
*
|
|
59
|
+
* So: Looply's own runtime copy first, then the project's own `.bin` (which is
|
|
60
|
+
* inside the granted worktree and is how `tsc`, `jest` and friends are found),
|
|
61
|
+
* then the two system directories a shell needs to function.
|
|
62
|
+
*/
|
|
63
|
+
export declare function containedPath(projectKey: string, toolchain?: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* The environment for the coding agent.
|
|
66
|
+
*
|
|
67
|
+
* Separate from the gate's because the agent legitimately needs its model
|
|
68
|
+
* provider — and separate so that giving the agent something never gives it to
|
|
69
|
+
* the gate. It still carries no Looply machine token and no broker credential:
|
|
70
|
+
* using the model is the agent's job, speaking for the machine is not.
|
|
71
|
+
*/
|
|
72
|
+
export declare function buildAgentEnv(projectKey: string, provider?: Record<string, string>, toolchain?: string): Record<string, string>;
|
|
73
|
+
/**
|
|
74
|
+
* The environment for the PROVIDER TRANSPORT.
|
|
75
|
+
*
|
|
76
|
+
* This one is different in kind from the others, and the difference is the
|
|
77
|
+
* point of the whole decomposition. The transport is not contained — it cannot
|
|
78
|
+
* be, because the packaged provider spawns children with piped stdio and an
|
|
79
|
+
* AppContainer cannot create the named pipes that needs. So it runs as the
|
|
80
|
+
* daemon user, and the only thing standing between it and the machine's
|
|
81
|
+
* authority is what Looply chooses to hand it.
|
|
82
|
+
*
|
|
83
|
+
* Which is: the platform baseline, its own profile, and whatever the person
|
|
84
|
+
* named in `agent.env`. Built up rather than filtered down, so a Looply
|
|
85
|
+
* credential added to the daemon's environment next year does not silently
|
|
86
|
+
* appear here.
|
|
87
|
+
*
|
|
88
|
+
* It carries NO PATH into the project. The transport has no reason to resolve
|
|
89
|
+
* anything from the worktree; the tools it can call are served over MCP and run
|
|
90
|
+
* somewhere else entirely.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildProviderEnv(sessionDir: string, provider?: Record<string, string>): Record<string, string>;
|
|
93
|
+
/**
|
|
94
|
+
* The environment for the user's own notification script.
|
|
95
|
+
*
|
|
96
|
+
* NOT contained: this file is the person's, stored under their home directory,
|
|
97
|
+
* and running it is the product working as intended. But it inherited the whole
|
|
98
|
+
* daemon environment — every secret the daemon holds — for no reason at all. A
|
|
99
|
+
* notification does not need the machine token.
|
|
100
|
+
*/
|
|
101
|
+
export declare function buildNotifyEnv(): Record<string, string>;
|
|
102
|
+
/**
|
|
103
|
+
* Paths inside a granted worktree that untrusted execution must never reach.
|
|
104
|
+
*
|
|
105
|
+
* Derived from the execution kind rather than chosen per call site, because a
|
|
106
|
+
* caller that forgets one is a caller that quietly hands over the authority
|
|
107
|
+
* state.
|
|
108
|
+
*
|
|
109
|
+
* `.looply/state` holds every durable fact Phase 6 rests on — the grant, the
|
|
110
|
+
* receipts, the launch and claim records, the ledger, the human control file.
|
|
111
|
+
* `.git` is where a repository-controlled config can turn a trusted git command
|
|
112
|
+
* into arbitrary execution. `config.yaml` is the one file the person edits by
|
|
113
|
+
* hand, and it names the gate commands and the rails: a round that could write
|
|
114
|
+
* it could weaken every round after it.
|
|
115
|
+
*
|
|
116
|
+
* `<projectDir>/.git` IS PROTECTED WHATEVER IT TURNS OUT TO BE. In a linked
|
|
117
|
+
* worktree it is a pointer file rather than a directory, and a write to it
|
|
118
|
+
* redirects every later git command at metadata of the writer's choosing — so
|
|
119
|
+
* it is protected for its own sake, not merely as a route to a directory.
|
|
120
|
+
*
|
|
121
|
+
* AND WHEREVER THE METADATA REALLY LIVES, appended below. In a linked worktree
|
|
122
|
+
* the real gitdir is `<common>/worktrees/<name>` and the config that decides
|
|
123
|
+
* what git executes is in the shared common dir; neither is under `projectDir`,
|
|
124
|
+
* so neither is covered by the three literals.
|
|
125
|
+
*
|
|
126
|
+
* ⚠️ THE THREE LITERALS STAY AT THE TOP OF THE BODY, and the prose stays up
|
|
127
|
+
* here. `project-memory-reachability.spec.ts` pins them by slicing the first 400
|
|
128
|
+
* characters after the signature — a deliberate guard on the ground under
|
|
129
|
+
* `source: 'human'` — and a comment inside the body pushes them out of it.
|
|
130
|
+
*/
|
|
131
|
+
export declare function protectedPaths(projectDir: string): string[];
|
|
132
|
+
/** What untrusted execution is granted: the worktree, and its own profile. */
|
|
133
|
+
export declare function untrustedGrants(kind: UntrustedKind, projectDir: string): FsGrant[];
|
|
134
|
+
/**
|
|
135
|
+
* The shared directories a contained execution needs, which are granted under
|
|
136
|
+
* the shared-grant lock rather than per launch. `toolchain` is absent for the
|
|
137
|
+
* built-in provider, which resolves its own.
|
|
138
|
+
*/
|
|
139
|
+
export declare function sharedGrantPaths(toolchain?: string, extra?: readonly string[]): string[];
|
|
140
|
+
//# sourceMappingURL=exec-domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-domains.d.ts","sourceRoot":"","sources":["../src/exec-domains.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG/F;;;;;;;;;;;;;;;;;GAiBG;AAEH,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAO7E;AAiDD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAS5E;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACrC,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAoB3D;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,EAAE,CA2BlF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,EAAE,CAE5F"}
|