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,154 @@
|
|
|
1
|
+
import { type ActionRequest, type BuildActionErrorCode, type TrustedActionContext } from '@looply/core';
|
|
2
|
+
import { type PublishPolicy } from './config';
|
|
3
|
+
/**
|
|
4
|
+
* A MODEL ASKING FOR SOMETHING IT MAY NOT DO, SAID AS DATA.
|
|
5
|
+
*
|
|
6
|
+
* 7B1 gave a requested action an exact shape and an exact fingerprint, and left
|
|
7
|
+
* the seam inert: nothing produced one. This is the producer, and it is the
|
|
8
|
+
* narrowest one that could work — a model turn either carries a declaration in
|
|
9
|
+
* the structured channel it already answers on, or it does not.
|
|
10
|
+
*
|
|
11
|
+
* NOT PROSE, AND THAT IS THE WHOLE POINT. There is no phrase that stops a run,
|
|
12
|
+
* no word a transcript can contain to make Looply ask a person for permission.
|
|
13
|
+
* A run that could be halted by an agent writing "I need approval to push" is a
|
|
14
|
+
* run that can be halted by an agent QUOTING somebody who wrote it — and the
|
|
15
|
+
* same reasoning in reverse is worse: a consequential act sliding past because
|
|
16
|
+
* the sentence announcing it was worded unusually. The declaration is a shape
|
|
17
|
+
* or it is nothing.
|
|
18
|
+
*
|
|
19
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
20
|
+
* WHAT THE MODEL SAYS, AND WHAT IT CANNOT SAY
|
|
21
|
+
*
|
|
22
|
+
* It names the action and fills in the action's own fields. That is the entire
|
|
23
|
+
* surface. The project, the actor, the pursuit, the run, the request key and
|
|
24
|
+
* the risk class are all supplied by the code that is executing, because every
|
|
25
|
+
* one of them is a way of describing WHOSE authority this is — and a thing
|
|
26
|
+
* asking for authority does not get to describe the authority it is asking for.
|
|
27
|
+
*
|
|
28
|
+
* The risk class in particular is recomputed here from Looply's own classifier
|
|
29
|
+
* and never read off anything the model wrote. `buildActionRequest` already
|
|
30
|
+
* refuses a payload carrying a `riskClass` key; this asks the classifier again
|
|
31
|
+
* afterwards, so a declaration that somehow arrived pre-classified would still
|
|
32
|
+
* be judged by policy rather than by claim.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* The envelope version, carried so an older machine meets a newer declaration
|
|
36
|
+
* and refuses it rather than reading four of its five fields.
|
|
37
|
+
*
|
|
38
|
+
* Separate from `ACTION_REQUEST_VERSION`: that one versions what an action IS,
|
|
39
|
+
* shared by the server and the phone, and this one versions how a model may ask
|
|
40
|
+
* for one — which only ever travels between a provider and this process.
|
|
41
|
+
*/
|
|
42
|
+
export declare const PENDING_ACTION_VERSION = 1;
|
|
43
|
+
/** The key a declaration must appear under. One name, checked exactly. */
|
|
44
|
+
export declare const PENDING_ACTION_KEY = "pendingAction";
|
|
45
|
+
/**
|
|
46
|
+
* What a model wrote, before anything trusted has touched it.
|
|
47
|
+
*
|
|
48
|
+
* `type` and `action` are `unknown` on purpose and stay that way until
|
|
49
|
+
* {@link buildPendingActionSignal} hands them to the 7B1 parser. Typing them as
|
|
50
|
+
* strings and objects here would mean this file had already decided they were
|
|
51
|
+
* well-formed, in the one place whose entire job is to assume they are not.
|
|
52
|
+
*/
|
|
53
|
+
export interface PendingActionDeclaration {
|
|
54
|
+
readonly type: unknown;
|
|
55
|
+
readonly action: unknown;
|
|
56
|
+
/** Why the model wants it, for a person to read. Never authority — see 7B1. */
|
|
57
|
+
readonly note?: string;
|
|
58
|
+
}
|
|
59
|
+
export type ReadDeclaration =
|
|
60
|
+
/** No declaration here. The ordinary answer for the ordinary turn. */
|
|
61
|
+
{
|
|
62
|
+
readonly kind: 'none';
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: 'declared';
|
|
65
|
+
readonly declaration: PendingActionDeclaration;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Something claimed to be a declaration and was not.
|
|
69
|
+
*
|
|
70
|
+
* Kept apart from `none`, because they must not lead to the same place: a
|
|
71
|
+
* turn with no declaration is a turn that asked for nothing, and a turn with
|
|
72
|
+
* a broken one asked for something nobody can identify. Silently treating the
|
|
73
|
+
* second as the first would let a malformed request become ordinary work.
|
|
74
|
+
*/
|
|
75
|
+
| {
|
|
76
|
+
readonly kind: 'malformed';
|
|
77
|
+
readonly because: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Is this one parsed JSON object a declaration?
|
|
81
|
+
*
|
|
82
|
+
* Takes a value rather than a transcript so that the transcript scan stays in
|
|
83
|
+
* one place — `agent-driver` owns what counts as a candidate, and the prover
|
|
84
|
+
* and the implementer parser already share it. A second scanner here would be a
|
|
85
|
+
* second definition of "the model's structured answer".
|
|
86
|
+
*/
|
|
87
|
+
export declare function readPendingActionDeclaration(value: Record<string, unknown>): ReadDeclaration;
|
|
88
|
+
/**
|
|
89
|
+
* A REQUEST FOR HUMAN AUTHORITY, BUILT AND CHECKED.
|
|
90
|
+
*
|
|
91
|
+
* One field, and no state. This is not an approval and it is not a decision:
|
|
92
|
+
* it is the exact thing a person is about to be asked about, and it exists for
|
|
93
|
+
* exactly as long as it takes to write that question down somewhere durable.
|
|
94
|
+
*/
|
|
95
|
+
export interface PendingActionSignal {
|
|
96
|
+
readonly request: ActionRequest;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Why a declaration did not become a signal.
|
|
100
|
+
*
|
|
101
|
+
* `not_consequential` is the interesting one and is deliberately its own code.
|
|
102
|
+
* A model asking for a routine action is not misbehaving — the run is already
|
|
103
|
+
* authorised to edit files, and nothing about that needs a person — so this
|
|
104
|
+
* must not read as a refusal of the model. What it means is that this path is
|
|
105
|
+
* the wrong one, and the run carries on being an ordinary run.
|
|
106
|
+
*
|
|
107
|
+
* `unverifiable` should be unreachable: `buildActionRequest` derives the
|
|
108
|
+
* fingerprint it then fails to reproduce. It is checked anyway, because the one
|
|
109
|
+
* value this whole system turns on is that a fingerprint describes the action
|
|
110
|
+
* standing next to it, and a place that assumes it rather than asking is a
|
|
111
|
+
* place where it can quietly stop being true.
|
|
112
|
+
*/
|
|
113
|
+
export type PendingActionRefusal = BuildActionErrorCode | 'not_consequential' | 'unverifiable'
|
|
114
|
+
/**
|
|
115
|
+
* The action would leave this machine and the project has not permitted that.
|
|
116
|
+
*
|
|
117
|
+
* REFUSED HERE, BEFORE AN APPROVAL EXISTS, and that placement is the point. A
|
|
118
|
+
* policy checked at execution time would let a model raise a request, put a
|
|
119
|
+
* publishing question on somebody's phone, and have them approve something
|
|
120
|
+
* that then cannot happen — teaching people that approving is theatre. Under
|
|
121
|
+
* `never` the question is never asked at all.
|
|
122
|
+
*/
|
|
123
|
+
| 'publishing_not_permitted';
|
|
124
|
+
export type PendingActionOutcome = {
|
|
125
|
+
readonly ok: true;
|
|
126
|
+
readonly signal: PendingActionSignal;
|
|
127
|
+
} | {
|
|
128
|
+
readonly ok: false;
|
|
129
|
+
readonly code: PendingActionRefusal;
|
|
130
|
+
readonly because: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Turn what a model asked for into what a person will be asked about.
|
|
134
|
+
*
|
|
135
|
+
* The two halves arrive separately and are never merged before this point:
|
|
136
|
+
* `declaration` is model input and is validated to death by 7B1's registry;
|
|
137
|
+
* `ctx` is the run's own and is taken as given. There is no arrangement of the
|
|
138
|
+
* first that can reach the second.
|
|
139
|
+
*
|
|
140
|
+
* FAILS CLOSED at every step. An unregistered action type is refused rather
|
|
141
|
+
* than assumed harmless, a payload that does not match its schema is refused
|
|
142
|
+
* rather than trimmed, and an action Looply classifies as anything other than
|
|
143
|
+
* consequential does not travel this road at all.
|
|
144
|
+
*/
|
|
145
|
+
export declare function buildPendingActionSignal(declaration: PendingActionDeclaration, ctx: TrustedActionContext,
|
|
146
|
+
/**
|
|
147
|
+
* Whether this project permits Looply to publish. Absent means it does not.
|
|
148
|
+
*
|
|
149
|
+
* NOT OPTIONAL BECAUSE IT IS UNIMPORTANT — optional because a caller with no
|
|
150
|
+
* config has certainly not been granted anything, and the safe reading of a
|
|
151
|
+
* missing policy is the same as the safe reading of `never`.
|
|
152
|
+
*/
|
|
153
|
+
policy?: PublishPolicy): PendingActionOutcome;
|
|
154
|
+
//# sourceMappingURL=pending-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-action.d.ts","sourceRoot":"","sources":["../src/pending-action.ts"],"names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,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,wBAAwB,EACrC,GAAG,EAAE,oBAAoB;AACzB;;;;;;GAMG;AACH,MAAM,CAAC,EAAE,aAAa,GACrB,oBAAoB,CAqCtB"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PENDING_ACTION_KEY = exports.PENDING_ACTION_VERSION = void 0;
|
|
4
|
+
exports.readPendingActionDeclaration = readPendingActionDeclaration;
|
|
5
|
+
exports.buildPendingActionSignal = buildPendingActionSignal;
|
|
6
|
+
const core_1 = require("@looply/core");
|
|
7
|
+
const config_1 = require("./config");
|
|
8
|
+
/**
|
|
9
|
+
* A MODEL ASKING FOR SOMETHING IT MAY NOT DO, SAID AS DATA.
|
|
10
|
+
*
|
|
11
|
+
* 7B1 gave a requested action an exact shape and an exact fingerprint, and left
|
|
12
|
+
* the seam inert: nothing produced one. This is the producer, and it is the
|
|
13
|
+
* narrowest one that could work — a model turn either carries a declaration in
|
|
14
|
+
* the structured channel it already answers on, or it does not.
|
|
15
|
+
*
|
|
16
|
+
* NOT PROSE, AND THAT IS THE WHOLE POINT. There is no phrase that stops a run,
|
|
17
|
+
* no word a transcript can contain to make Looply ask a person for permission.
|
|
18
|
+
* A run that could be halted by an agent writing "I need approval to push" is a
|
|
19
|
+
* run that can be halted by an agent QUOTING somebody who wrote it — and the
|
|
20
|
+
* same reasoning in reverse is worse: a consequential act sliding past because
|
|
21
|
+
* the sentence announcing it was worded unusually. The declaration is a shape
|
|
22
|
+
* or it is nothing.
|
|
23
|
+
*
|
|
24
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
25
|
+
* WHAT THE MODEL SAYS, AND WHAT IT CANNOT SAY
|
|
26
|
+
*
|
|
27
|
+
* It names the action and fills in the action's own fields. That is the entire
|
|
28
|
+
* surface. The project, the actor, the pursuit, the run, the request key and
|
|
29
|
+
* the risk class are all supplied by the code that is executing, because every
|
|
30
|
+
* one of them is a way of describing WHOSE authority this is — and a thing
|
|
31
|
+
* asking for authority does not get to describe the authority it is asking for.
|
|
32
|
+
*
|
|
33
|
+
* The risk class in particular is recomputed here from Looply's own classifier
|
|
34
|
+
* and never read off anything the model wrote. `buildActionRequest` already
|
|
35
|
+
* refuses a payload carrying a `riskClass` key; this asks the classifier again
|
|
36
|
+
* afterwards, so a declaration that somehow arrived pre-classified would still
|
|
37
|
+
* be judged by policy rather than by claim.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* The envelope version, carried so an older machine meets a newer declaration
|
|
41
|
+
* and refuses it rather than reading four of its five fields.
|
|
42
|
+
*
|
|
43
|
+
* Separate from `ACTION_REQUEST_VERSION`: that one versions what an action IS,
|
|
44
|
+
* shared by the server and the phone, and this one versions how a model may ask
|
|
45
|
+
* for one — which only ever travels between a provider and this process.
|
|
46
|
+
*/
|
|
47
|
+
exports.PENDING_ACTION_VERSION = 1;
|
|
48
|
+
/** The key a declaration must appear under. One name, checked exactly. */
|
|
49
|
+
exports.PENDING_ACTION_KEY = 'pendingAction';
|
|
50
|
+
/**
|
|
51
|
+
* Is this one parsed JSON object a declaration?
|
|
52
|
+
*
|
|
53
|
+
* Takes a value rather than a transcript so that the transcript scan stays in
|
|
54
|
+
* one place — `agent-driver` owns what counts as a candidate, and the prover
|
|
55
|
+
* and the implementer parser already share it. A second scanner here would be a
|
|
56
|
+
* second definition of "the model's structured answer".
|
|
57
|
+
*/
|
|
58
|
+
function readPendingActionDeclaration(value) {
|
|
59
|
+
if (!Object.prototype.hasOwnProperty.call(value, exports.PENDING_ACTION_KEY))
|
|
60
|
+
return { kind: 'none' };
|
|
61
|
+
const raw = value[exports.PENDING_ACTION_KEY];
|
|
62
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
63
|
+
return { kind: 'malformed', because: `${exports.PENDING_ACTION_KEY} must be an object` };
|
|
64
|
+
}
|
|
65
|
+
const o = raw;
|
|
66
|
+
if (o['version'] !== exports.PENDING_ACTION_VERSION) {
|
|
67
|
+
return {
|
|
68
|
+
kind: 'malformed',
|
|
69
|
+
because: `this is a version ${String(o['version'])} request and this build speaks ${exports.PENDING_ACTION_VERSION}`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (!('type' in o))
|
|
73
|
+
return { kind: 'malformed', because: 'type is required' };
|
|
74
|
+
if (!('action' in o))
|
|
75
|
+
return { kind: 'malformed', because: 'action is required' };
|
|
76
|
+
const note = o['note'];
|
|
77
|
+
if (note !== undefined && typeof note !== 'string') {
|
|
78
|
+
return { kind: 'malformed', because: 'note must be a string' };
|
|
79
|
+
}
|
|
80
|
+
// Anything beyond the four is refused rather than ignored, for the reason
|
|
81
|
+
// 7B1's `exactly` gives: a field this skips and something downstream reads is
|
|
82
|
+
// a request nobody validated travelling inside one somebody did.
|
|
83
|
+
const extra = Object.keys(o).filter((k) => !['version', 'type', 'action', 'note'].includes(k));
|
|
84
|
+
if (extra.length > 0) {
|
|
85
|
+
return { kind: 'malformed', because: `${extra.sort().join(', ')} is not part of a pending action` };
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
kind: 'declared',
|
|
89
|
+
declaration: { type: o['type'], action: o['action'], ...(note === undefined ? {} : { note }) },
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Turn what a model asked for into what a person will be asked about.
|
|
94
|
+
*
|
|
95
|
+
* The two halves arrive separately and are never merged before this point:
|
|
96
|
+
* `declaration` is model input and is validated to death by 7B1's registry;
|
|
97
|
+
* `ctx` is the run's own and is taken as given. There is no arrangement of the
|
|
98
|
+
* first that can reach the second.
|
|
99
|
+
*
|
|
100
|
+
* FAILS CLOSED at every step. An unregistered action type is refused rather
|
|
101
|
+
* than assumed harmless, a payload that does not match its schema is refused
|
|
102
|
+
* rather than trimmed, and an action Looply classifies as anything other than
|
|
103
|
+
* consequential does not travel this road at all.
|
|
104
|
+
*/
|
|
105
|
+
function buildPendingActionSignal(declaration, ctx,
|
|
106
|
+
/**
|
|
107
|
+
* Whether this project permits Looply to publish. Absent means it does not.
|
|
108
|
+
*
|
|
109
|
+
* NOT OPTIONAL BECAUSE IT IS UNIMPORTANT — optional because a caller with no
|
|
110
|
+
* config has certainly not been granted anything, and the safe reading of a
|
|
111
|
+
* missing policy is the same as the safe reading of `never`.
|
|
112
|
+
*/
|
|
113
|
+
policy) {
|
|
114
|
+
const built = (0, core_1.buildActionRequest)(declaration.type, declaration.action, ctx, declaration.note);
|
|
115
|
+
if (!built.ok)
|
|
116
|
+
return { ok: false, code: built.code, because: built.because };
|
|
117
|
+
// ASKED AGAIN, of the classifier rather than of the request. `built.request`
|
|
118
|
+
// carries a risk field, and reading it here would make this check circular
|
|
119
|
+
// the day anything else can construct one.
|
|
120
|
+
const risk = (0, core_1.classifyAction)(built.request.type);
|
|
121
|
+
if (risk !== 'consequential') {
|
|
122
|
+
return {
|
|
123
|
+
ok: false,
|
|
124
|
+
code: 'not_consequential',
|
|
125
|
+
because: `${built.request.type} is ${risk ?? 'unknown'}, and only a consequential action needs a person`,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
// ASKED OF THE REGISTRY, NOT OF THE NAME. `actionPublishes` is Looply's own
|
|
129
|
+
// judgement about the action, and it fails closed for a type nobody has
|
|
130
|
+
// judged — so an executor added later cannot slip past a publish policy by
|
|
131
|
+
// being unknown to it.
|
|
132
|
+
if ((0, core_1.actionPublishes)(built.request.type) && !(0, config_1.mayPublish)(policy ?? 'never')) {
|
|
133
|
+
return {
|
|
134
|
+
ok: false,
|
|
135
|
+
code: 'publishing_not_permitted',
|
|
136
|
+
because: `${built.request.type} would leave this machine, and this project's publish policy is ${policy ?? 'never'}`,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
if (!(0, core_1.verifyActionRequest)(built.request)) {
|
|
140
|
+
return {
|
|
141
|
+
ok: false,
|
|
142
|
+
code: 'unverifiable',
|
|
143
|
+
because: 'the request did not survive its own fingerprint check',
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return { ok: true, signal: { request: built.request } };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=pending-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-action.js","sourceRoot":"","sources":["../src/pending-action.ts"],"names":[],"mappings":";;;AA6FA,oEAiCC;AA4DD,4DAgDC;AA1OD,uCAQsB;AACtB,qCAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;GAOG;AACU,QAAA,sBAAsB,GAAG,CAAC,CAAC;AAExC,0EAA0E;AAC7D,QAAA,kBAAkB,GAAG,eAAe,CAAC;AA+BlD;;;;;;;GAOG;AACH,SAAgB,4BAA4B,CAAC,KAA8B;IACzE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,0BAAkB,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC9F,MAAM,GAAG,GAAG,KAAK,CAAC,0BAAkB,CAAC,CAAC;IACtC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,0BAAkB,oBAAoB,EAAE,CAAC;IACnF,CAAC;IACD,MAAM,CAAC,GAAG,GAA8B,CAAC;IA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mE,MAAM,IAAI,OAAO,EAAE;SACrH,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAA,0BAAmB,EAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,OAAO;YACL,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,uDAAuD;SACjE,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { LedgerFs } from './ledger-store';
|
|
2
|
+
import { type ProbeFn } from './workspace';
|
|
3
|
+
/**
|
|
4
|
+
* THE MACHINE ASKS ONE OF ITS OWN RUNS TO STOP — when the project asked (M4-2).
|
|
5
|
+
*
|
|
6
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
* The scheduler has decided preemption since Phase 3 ("it stops at its next
|
|
8
|
+
* round boundary") and nothing acted on it: every run was reported as not
|
|
9
|
+
* preemptible, and the tick read only starts. With `machine.preemption: true`
|
|
10
|
+
* the daemon answers the first `preempt` of a tick here, after the tick: the
|
|
11
|
+
* run's OWN graceful `stop` request, written into its addressed control file
|
|
12
|
+
* exactly as `looply stop` writes it (actor `coordinator`), which the run
|
|
13
|
+
* honours at its round boundary. Never a signal, never a kill.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ A STANDING REQUEST IS NOT REPEATED. An autonomous run leaves a stop on
|
|
16
|
+
* disk until it has obeyed (its runner does not consume it — see the round
|
|
17
|
+
* runner), so a tick that names the same victim twice finds the request
|
|
18
|
+
* already there and writes nothing.
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ AND IT KNOWS NOTHING ABOUT GOALS. Whose run this is and why it is asked
|
|
21
|
+
* are the daemon's to say, in the words it hands over; the gatherer is what
|
|
22
|
+
* keeps a person's run off the victim list (`startedBy` is not `machine`).
|
|
23
|
+
*/
|
|
24
|
+
export interface PreemptRequest {
|
|
25
|
+
readonly runId: string;
|
|
26
|
+
/** The daemon's description of the run — id, goal, who started it — quoted in the log. */
|
|
27
|
+
readonly who: string;
|
|
28
|
+
/** The scheduler's reason, quoted in the log. */
|
|
29
|
+
readonly because: string;
|
|
30
|
+
}
|
|
31
|
+
export type PreemptAnswer = 'requested' | 'standing' | 'unknown-run';
|
|
32
|
+
export type Preemptor = (runId: string) => Promise<PreemptAnswer>;
|
|
33
|
+
export declare function nodePreemptor(projectState: string, fs: LedgerFs, probe?: ProbeFn): Preemptor;
|
|
34
|
+
export type PreemptOutcome = PreemptAnswer | 'failed' | 'none';
|
|
35
|
+
/**
|
|
36
|
+
* Answer the tick's request, if there was one and preemption is on. Every
|
|
37
|
+
* outcome is a log line; a failure names itself and is never a throw.
|
|
38
|
+
*/
|
|
39
|
+
export declare function preemptOnce(request: PreemptRequest | null, preemptor: Preemptor | null, log: (line: string) => void): Promise<PreemptOutcome>;
|
|
40
|
+
//# sourceMappingURL=preemptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preemptor.d.ts","sourceRoot":"","sources":["../src/preemptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;AACrE,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;AAElE,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAa5F;AAED,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/D;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,GAAG,IAAI,EAC9B,SAAS,EAAE,SAAS,GAAG,IAAI,EAC3B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC1B,OAAO,CAAC,cAAc,CAAC,CAgBzB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nodePreemptor = nodePreemptor;
|
|
4
|
+
exports.preemptOnce = preemptOnce;
|
|
5
|
+
const control_file_1 = require("./control-file");
|
|
6
|
+
const workspace_1 = require("./workspace");
|
|
7
|
+
function nodePreemptor(projectState, fs, probe) {
|
|
8
|
+
return async (runId) => {
|
|
9
|
+
const registry = probe === undefined ? new workspace_1.RunRegistry(projectState) : new workspace_1.RunRegistry(projectState, probe);
|
|
10
|
+
const live = registry
|
|
11
|
+
.list()
|
|
12
|
+
.find((e) => e.kind === 'active' && e.record.runId === runId);
|
|
13
|
+
if (live === undefined)
|
|
14
|
+
return 'unknown-run';
|
|
15
|
+
const control = control_file_1.ControlStore.addressed(live.record.stateDir, runId, fs);
|
|
16
|
+
const standing = await control.read();
|
|
17
|
+
if (standing !== null && standing.kind === 'stop')
|
|
18
|
+
return 'standing';
|
|
19
|
+
await control.request('stop', 'coordinator');
|
|
20
|
+
return 'requested';
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Answer the tick's request, if there was one and preemption is on. Every
|
|
25
|
+
* outcome is a log line; a failure names itself and is never a throw.
|
|
26
|
+
*/
|
|
27
|
+
async function preemptOnce(request, preemptor, log) {
|
|
28
|
+
if (request === null)
|
|
29
|
+
return 'none';
|
|
30
|
+
if (preemptor === null) {
|
|
31
|
+
log(`daemon : the scheduler would preempt ${request.who}, but preemption is off — not asked`);
|
|
32
|
+
return 'none';
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const answer = await preemptor(request.runId);
|
|
36
|
+
if (answer === 'requested')
|
|
37
|
+
log(`daemon : asked ${request.who} to stop at its round boundary — ${request.because}`);
|
|
38
|
+
else if (answer === 'standing')
|
|
39
|
+
log(`daemon : ${request.who} was already asked to stop — not asked again`);
|
|
40
|
+
else
|
|
41
|
+
log(`daemon : ${request.who} is not an active run on this machine — nothing to stop`);
|
|
42
|
+
return answer;
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
log(`daemon : could not ask ${request.who} to stop — ${e.message}`);
|
|
46
|
+
return 'failed';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=preemptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preemptor.js","sourceRoot":"","sources":["../src/preemptor.ts"],"names":[],"mappings":";;AAqCA,sCAaC;AAQD,kCAoBC;AA9ED,iDAA8C;AAE9C,2CAAwD;AAmCxD,SAAgB,aAAa,CAAC,YAAoB,EAAE,EAAY,EAAE,KAAe;IAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE;QACrB,MAAM,QAAQ,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,uBAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,uBAAW,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAC5G,MAAM,IAAI,GAAG,QAAQ;aAClB,IAAI,EAAE;aACN,IAAI,CAAC,CAAC,CAAC,EAA8C,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK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W,CAAC,OAAO,EAAE,CAAC,CAAC;QAChF,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROGRAMME MODE, slice 2 (M6-10): ONE SENTENCE FOR THE OWNER.
|
|
3
|
+
*
|
|
4
|
+
* The parser has already applied the umbrella (config.ts: `parseProgrammeBlock`,
|
|
5
|
+
* every face on unless turned off explicitly, the limits landed on their
|
|
6
|
+
* knobs). This says what came of it — the same sentence in `looply doctor` and
|
|
7
|
+
* on the daemon's first lines, so a person can see the mode the machine is in
|
|
8
|
+
* without reading the config back.
|
|
9
|
+
*/
|
|
10
|
+
import type { LooplyConfig } from './config';
|
|
11
|
+
/**
|
|
12
|
+
* Is this machine running as a programme at all?
|
|
13
|
+
*
|
|
14
|
+
* 🔴 EITHER FORM COUNTS, AND THE DIRECTION IS DELIBERATE. The block
|
|
15
|
+
* (`machine.programme: { on, limits }`) is the full mode; `machine.programme:
|
|
16
|
+
* true` is slice 1, continuation-only — a machine that carries on from an
|
|
17
|
+
* approved decision without another tap. Both mean completions are reached
|
|
18
|
+
* with nobody reading each one, which is the condition that makes an unearned
|
|
19
|
+
* completion dangerous.
|
|
20
|
+
*
|
|
21
|
+
* ⚠️ OVER-BLOCKING A COMPLETION IS RECOVERABLE AND UNDER-BLOCKING ONE IS NOT,
|
|
22
|
+
* which is the same direction `isMandatory` takes for an unclassified
|
|
23
|
+
* statement. A machine that stops one Start early costs a person a sentence; a
|
|
24
|
+
* machine that declares a goal met on a green tree nobody claimed costs them
|
|
25
|
+
* the thing the goal was about.
|
|
26
|
+
*/
|
|
27
|
+
export declare function programmeIsOn(cfg: LooplyConfig): boolean;
|
|
28
|
+
export declare function describeProgramme(cfg: LooplyConfig): string;
|
|
29
|
+
//# sourceMappingURL=programme-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"programme-mode.d.ts","sourceRoot":"","sources":["../src/programme-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAExD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAoB3D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.programmeIsOn = programmeIsOn;
|
|
4
|
+
exports.describeProgramme = describeProgramme;
|
|
5
|
+
/**
|
|
6
|
+
* Is this machine running as a programme at all?
|
|
7
|
+
*
|
|
8
|
+
* 🔴 EITHER FORM COUNTS, AND THE DIRECTION IS DELIBERATE. The block
|
|
9
|
+
* (`machine.programme: { on, limits }`) is the full mode; `machine.programme:
|
|
10
|
+
* true` is slice 1, continuation-only — a machine that carries on from an
|
|
11
|
+
* approved decision without another tap. Both mean completions are reached
|
|
12
|
+
* with nobody reading each one, which is the condition that makes an unearned
|
|
13
|
+
* completion dangerous.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ OVER-BLOCKING A COMPLETION IS RECOVERABLE AND UNDER-BLOCKING ONE IS NOT,
|
|
16
|
+
* which is the same direction `isMandatory` takes for an unclassified
|
|
17
|
+
* statement. A machine that stops one Start early costs a person a sentence; a
|
|
18
|
+
* machine that declares a goal met on a green tree nobody claimed costs them
|
|
19
|
+
* the thing the goal was about.
|
|
20
|
+
*/
|
|
21
|
+
function programmeIsOn(cfg) {
|
|
22
|
+
return cfg.machine?.programmeMode !== undefined || cfg.machine?.programme === true;
|
|
23
|
+
}
|
|
24
|
+
function describeProgramme(cfg) {
|
|
25
|
+
const m = cfg.machine;
|
|
26
|
+
if (m?.programmeMode !== undefined) {
|
|
27
|
+
const l = m.programmeMode.limits;
|
|
28
|
+
const n = (count, word) => `${count} ${word}${count === 1 ? '' : 's'}`;
|
|
29
|
+
const off = [];
|
|
30
|
+
if (m.coordinator !== true)
|
|
31
|
+
off.push('coordinator');
|
|
32
|
+
if (m.provisionWorkspaces !== true)
|
|
33
|
+
off.push('provisioning');
|
|
34
|
+
if (m.reapProvisioned !== true)
|
|
35
|
+
off.push('reaping');
|
|
36
|
+
if (m.preemption !== true)
|
|
37
|
+
off.push('preemption');
|
|
38
|
+
if (m.integrate !== true || cfg.run.integration !== true)
|
|
39
|
+
off.push('integration');
|
|
40
|
+
if (cfg.run.brain !== true)
|
|
41
|
+
off.push('brain');
|
|
42
|
+
return (`programme mode: on — ${n(l.maxWorkspaces, 'checkout')}, ${n(l.maxAgentsInFlight, 'agent')} in flight, ` +
|
|
43
|
+
`${n(l.startsPerGrant, 'Start')} per grant, ${l.windowMinutes}-minute window, integrates to ${l.integrationRef}` +
|
|
44
|
+
(off.length === 0 ? '' : ` — turned off here: ${off.join(', ')}`));
|
|
45
|
+
}
|
|
46
|
+
if (m?.programme === true)
|
|
47
|
+
return 'programme mode: continuation only (machine.programme: true)';
|
|
48
|
+
return 'programme mode: off (manual defaults)';
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=programme-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"programme-mode.js","sourceRoot":"","sources":["../src/programme-mode.ts"],"names":[],"mappings":";;AA2BA,sCAEC;AAED,8CAoBC;AAxCD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,aAAa,CAAC,GAAiB;IAC7C,OAAO,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,SAAS,IAAI,GAAG,CAAC,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;AACrF,CAAC;AAED,SAAgB,iBAAiB,CAAC,GAAiB;IACjD,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,CAAC,GA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CAAC,EAAE,CAAC,CAClE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,EAAE,SAAS,KAAK,IAAI;QAAE,OAAO,6DAA6D,CAAC;IAChG,OAAO,uCAAuC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RoundFinishInfo, RunEndInfo, RunProgressNotifier, RunStartInfo } from './notify-cadence';
|
|
2
|
+
export declare class TerminalNotifier implements RunProgressNotifier {
|
|
3
|
+
private readonly log;
|
|
4
|
+
private round;
|
|
5
|
+
constructor(log: (line: string) => void);
|
|
6
|
+
/** Called by the runner's phase wrappers, not by the notifier interface. */
|
|
7
|
+
phase(round: number, phase: string, detail: string): void;
|
|
8
|
+
runStarted(_info: RunStartInfo): Promise<void>;
|
|
9
|
+
roundFinished(info: RoundFinishInfo): Promise<void>;
|
|
10
|
+
runEnded(info: RunEndInfo): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
/** Report to several notifiers at once; one throwing must not silence the rest. */
|
|
13
|
+
export declare function fanOut(...notifiers: readonly RunProgressNotifier[]): RunProgressNotifier;
|
|
14
|
+
//# sourceMappingURL=progress-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-view.d.ts","sourceRoot":"","sources":["../src/progress-view.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAwCvG,qBAAa,gBAAiB,YAAW,mBAAmB;IAG9C,OAAO,CAAC,QAAQ,CAAC,GAAG;IAFhC,OAAO,CAAC,KAAK,CAAK;gBAEW,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;IAExD,4EAA4E;IAC5E,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAKnD,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAuChD;AAED,mFAAmF;AACnF,wBAAgB,MAAM,CAAC,GAAG,SAAS,EAAE,SAAS,mBAAmB,EAAE,GAAG,mBAAmB,CAYxF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalNotifier = void 0;
|
|
4
|
+
exports.fanOut = fanOut;
|
|
5
|
+
const ui_1 = require("./ui");
|
|
6
|
+
/**
|
|
7
|
+
* What a run says in the terminal it is running in.
|
|
8
|
+
*
|
|
9
|
+
* A run printed three header lines and then nothing at all until it stopped —
|
|
10
|
+
* for hours. Somebody watching it could not tell a working loop from a hung
|
|
11
|
+
* one, which is the exact failure mode the whole product is written against:
|
|
12
|
+
* silence is worse than bad news. `notify.every_min` governs the *phone*, so it
|
|
13
|
+
* cannot cover this; a terminal has a person already looking at it.
|
|
14
|
+
*
|
|
15
|
+
* Kept separate from CadenceNotifier because the two answer different
|
|
16
|
+
* questions. The cadence one decides whether to interrupt somebody who is not
|
|
17
|
+
* here; this one narrates to somebody who is, and so has no rate limit and no
|
|
18
|
+
* off switch beyond redirecting stdout.
|
|
19
|
+
*/
|
|
20
|
+
const OUTCOME_MARK = {
|
|
21
|
+
committed: ui_1.volt,
|
|
22
|
+
discarded: ui_1.amber,
|
|
23
|
+
abandoned: ui_1.red,
|
|
24
|
+
};
|
|
25
|
+
const OUTCOME_WORD = {
|
|
26
|
+
committed: 'kept',
|
|
27
|
+
discarded: 'thrown away',
|
|
28
|
+
abandoned: 'abandoned',
|
|
29
|
+
};
|
|
30
|
+
function clip(s, n) {
|
|
31
|
+
return s.length <= n ? s : `${s.slice(0, n - 1)}…`;
|
|
32
|
+
}
|
|
33
|
+
function mins(ms) {
|
|
34
|
+
const m = Math.round(ms / 60_000);
|
|
35
|
+
if (m < 60)
|
|
36
|
+
return `${m}m`;
|
|
37
|
+
return `${Math.floor(m / 60)}h${String(m % 60).padStart(2, '0')}`;
|
|
38
|
+
}
|
|
39
|
+
class TerminalNotifier {
|
|
40
|
+
log;
|
|
41
|
+
round = 0;
|
|
42
|
+
constructor(log) {
|
|
43
|
+
this.log = log;
|
|
44
|
+
}
|
|
45
|
+
/** Called by the runner's phase wrappers, not by the notifier interface. */
|
|
46
|
+
phase(round, phase, detail) {
|
|
47
|
+
this.round = round;
|
|
48
|
+
this.log(`${(0, ui_1.grey)(`round ${String(round).padStart(2)}`)} ${(0, ui_1.white)(phase.padEnd(12))} ${(0, ui_1.dim)(clip(detail, 58))}`);
|
|
49
|
+
}
|
|
50
|
+
async runStarted(_info) {
|
|
51
|
+
this.log('');
|
|
52
|
+
}
|
|
53
|
+
async roundFinished(info) {
|
|
54
|
+
const paint = OUTCOME_MARK[info.outcome];
|
|
55
|
+
const left = info.remainingMs > 0 ? ` ${(0, ui_1.dim)(`· ${mins(info.remainingMs)} left`)}` : '';
|
|
56
|
+
this.log(`${(0, ui_1.grey)(`round ${String(this.round).padStart(2)}`)} ${paint(OUTCOME_WORD[info.outcome].padEnd(12))}` +
|
|
57
|
+
` ${(0, ui_1.dim)(clip(info.itemTitle, 46))} ${(0, ui_1.dim)(`(${mins(info.elapsedMs)})`)}${left}`);
|
|
58
|
+
}
|
|
59
|
+
async runEnded(info) {
|
|
60
|
+
const t = info.totals;
|
|
61
|
+
this.log('');
|
|
62
|
+
this.log(`${(0, ui_1.grey)('run')} ${(0, ui_1.white)(`${t.rounds} round${t.rounds === 1 ? '' : 's'}`)} · ` +
|
|
63
|
+
`${(0, ui_1.volt)(`${t.committed} kept`)} · ${(0, ui_1.amber)(`${t.discarded} thrown away`)} · ` +
|
|
64
|
+
`${t.abandoned ? (0, ui_1.red)(`${t.abandoned} abandoned`) : (0, ui_1.dim)('0 abandoned')}`);
|
|
65
|
+
/**
|
|
66
|
+
* The number the plan calls the honesty check: a prover that never rejects
|
|
67
|
+
* anything is not checking, and this is where a run says so out loud.
|
|
68
|
+
*
|
|
69
|
+
* 🔴 IT USED TO COUNT EVERY DISCARD AS A PROVER REJECTION. `t.discarded`
|
|
70
|
+
* counts reds of every kind, so a round killed by a GATE — which the prover
|
|
71
|
+
* never even saw — was reported as "rejected by the second agent".
|
|
72
|
+
* Measured live on a run whose gate timed out and whose spend ledger shows
|
|
73
|
+
* the prover was never invoked: "100% of finished rounds were rejected by
|
|
74
|
+
* the second agent". The honesty check was the dishonest line.
|
|
75
|
+
*
|
|
76
|
+
* ⚠️ AND ABSENT IS NOT ZERO. A producer that did not count says nothing
|
|
77
|
+
* here rather than claiming the prover rejected none — that claim is
|
|
78
|
+
* exactly what this must stop making without evidence.
|
|
79
|
+
*/
|
|
80
|
+
const judged = t.committed + t.discarded;
|
|
81
|
+
if (judged > 0) {
|
|
82
|
+
const rejected = t.proverRejected;
|
|
83
|
+
if (rejected === undefined) {
|
|
84
|
+
const pct = Math.round((t.discarded / judged) * 100);
|
|
85
|
+
this.log(`${(0, ui_1.grey)('proof')} ${(0, ui_1.dim)(`${pct}% of finished rounds were thrown away — the ledger says where each one failed`)}`);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const pct = Math.round((rejected / judged) * 100);
|
|
89
|
+
this.log(`${(0, ui_1.grey)('proof')} ${(0, ui_1.dim)(`${pct}% of finished rounds were rejected by the second agent`)}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
this.log(`${(0, ui_1.grey)('branch')} ${(0, ui_1.dim)(info.branch)} ${(0, ui_1.dim)(`· ${info.stopReason} · ${mins(info.elapsedMs)}`)}`);
|
|
93
|
+
this.log('');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.TerminalNotifier = TerminalNotifier;
|
|
97
|
+
/** Report to several notifiers at once; one throwing must not silence the rest. */
|
|
98
|
+
function fanOut(...notifiers) {
|
|
99
|
+
const each = async (fn) => {
|
|
100
|
+
// DESIGN section 12 case 33: a notifier must never fail a round. One that
|
|
101
|
+
// throws here would take the round down with it, which is a far worse
|
|
102
|
+
// outcome than a missed message.
|
|
103
|
+
await Promise.all(notifiers.map(async (n) => { try {
|
|
104
|
+
await fn(n);
|
|
105
|
+
}
|
|
106
|
+
catch { /* reported, never fatal */ } }));
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
runStarted: (i) => each((n) => n.runStarted(i)),
|
|
110
|
+
roundFinished: (i) => each((n) => n.roundFinished(i)),
|
|
111
|
+
runEnded: (i) => each((n) => n.runEnded(i)),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=progress-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-view.js","sourceRoot":"","sources":["../src/progress-view.ts"],"names":[],"mappings":";;;AA2GA,wBAYC;AArHD,6BAA0D;AAE1D;;;;;;;;;;;;;GAaG;AAEH,MAAM,YAAY,GAAgD;IAChE,SAAS,EAAE,SAAI;IACf,SAAS,EAAE,UAAK;IAChB,SAAS,EAAE,QAAG;CACf,CAAC;AAEF,MAAM,YAAY,GAAiC;IACjD,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS;IAChC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AACrD,CAAC;AAED,SAAS,IAAI,CAAC,EAAU;IACtB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;IAClC,IAAI,CAAC,GAAG,EAAE;QAAE,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