looply-cli 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +137 -3
- package/dist/.src-hash +1 -0
- package/dist/acceptance-observe.d.ts +108 -0
- package/dist/acceptance-observe.d.ts.map +1 -0
- package/dist/acceptance-observe.js +152 -0
- package/dist/acceptance-observe.js.map +1 -0
- package/dist/agent-cmd.d.ts +131 -0
- package/dist/agent-cmd.d.ts.map +1 -0
- package/dist/agent-cmd.js +154 -0
- package/dist/agent-cmd.js.map +1 -0
- package/dist/agent-contained.d.ts +114 -0
- package/dist/agent-contained.d.ts.map +1 -0
- package/dist/agent-contained.js +292 -0
- package/dist/agent-contained.js.map +1 -0
- package/dist/agent-driver.d.ts +130 -0
- package/dist/agent-driver.d.ts.map +1 -0
- package/dist/agent-driver.js +170 -0
- package/dist/agent-driver.js.map +1 -0
- package/dist/agent-envelope.d.ts +94 -0
- package/dist/agent-envelope.d.ts.map +1 -0
- package/dist/agent-envelope.js +214 -0
- package/dist/agent-envelope.js.map +1 -0
- package/dist/agent-exec.d.ts +182 -0
- package/dist/agent-exec.d.ts.map +1 -0
- package/dist/agent-exec.js +125 -0
- package/dist/agent-exec.js.map +1 -0
- package/dist/agent-runtime.d.ts +23 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/agent-runtime.js +143 -0
- package/dist/agent-runtime.js.map +1 -0
- package/dist/approval-gate-read.d.ts +66 -0
- package/dist/approval-gate-read.d.ts.map +1 -0
- package/dist/approval-gate-read.js +138 -0
- package/dist/approval-gate-read.js.map +1 -0
- package/dist/approval-resolution.d.ts +87 -0
- package/dist/approval-resolution.d.ts.map +1 -0
- package/dist/approval-resolution.js +100 -0
- package/dist/approval-resolution.js.map +1 -0
- package/dist/approval-resumes.d.ts +102 -0
- package/dist/approval-resumes.d.ts.map +1 -0
- package/dist/approval-resumes.js +167 -0
- package/dist/approval-resumes.js.map +1 -0
- package/dist/ask-brain.d.ts +167 -0
- package/dist/ask-brain.d.ts.map +1 -0
- package/dist/ask-brain.js +355 -0
- package/dist/ask-brain.js.map +1 -0
- package/dist/autonomy-authority.d.ts +80 -0
- package/dist/autonomy-authority.d.ts.map +1 -0
- package/dist/autonomy-authority.js +82 -0
- package/dist/autonomy-authority.js.map +1 -0
- package/dist/autonomy-controller.d.ts +321 -0
- package/dist/autonomy-controller.d.ts.map +1 -0
- package/dist/autonomy-controller.js +517 -0
- package/dist/autonomy-controller.js.map +1 -0
- package/dist/autonomy-store.d.ts +327 -0
- package/dist/autonomy-store.d.ts.map +1 -0
- package/dist/autonomy-store.js +581 -0
- package/dist/autonomy-store.js.map +1 -0
- package/dist/autonomy-tick.d.ts +257 -0
- package/dist/autonomy-tick.d.ts.map +1 -0
- package/dist/autonomy-tick.js +616 -0
- package/dist/autonomy-tick.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +2719 -0
- package/dist/bin.js.map +1 -0
- package/dist/brain-advice.d.ts +21 -0
- package/dist/brain-advice.d.ts.map +1 -0
- package/dist/brain-advice.js +51 -0
- package/dist/brain-advice.js.map +1 -0
- package/dist/candidate-replay-runtime.d.ts +125 -0
- package/dist/candidate-replay-runtime.d.ts.map +1 -0
- package/dist/candidate-replay-runtime.js +188 -0
- package/dist/candidate-replay-runtime.js.map +1 -0
- package/dist/checkout-carry.d.ts +76 -0
- package/dist/checkout-carry.d.ts.map +1 -0
- package/dist/checkout-carry.js +125 -0
- package/dist/checkout-carry.js.map +1 -0
- package/dist/citation-readers.d.ts +26 -0
- package/dist/citation-readers.d.ts.map +1 -0
- package/dist/citation-readers.js +102 -0
- package/dist/citation-readers.js.map +1 -0
- package/dist/command-receipts.d.ts +79 -0
- package/dist/command-receipts.d.ts.map +1 -0
- package/dist/command-receipts.js +143 -0
- package/dist/command-receipts.js.map +1 -0
- package/dist/command-runner.d.ts +32 -0
- package/dist/command-runner.d.ts.map +1 -0
- package/dist/command-runner.js +108 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/compatible-sets.d.ts +67 -0
- package/dist/compatible-sets.d.ts.map +1 -0
- package/dist/compatible-sets.js +81 -0
- package/dist/compatible-sets.js.map +1 -0
- package/dist/compile-check.d.ts +31 -0
- package/dist/compile-check.d.ts.map +1 -0
- package/dist/compile-check.js +34 -0
- package/dist/compile-check.js.map +1 -0
- package/dist/compile-store.d.ts +16 -0
- package/dist/compile-store.d.ts.map +1 -0
- package/dist/compile-store.js +21 -0
- package/dist/compile-store.js.map +1 -0
- package/dist/completion.d.ts +106 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +131 -0
- package/dist/completion.js.map +1 -0
- package/dist/config.d.ts +549 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +763 -0
- package/dist/config.js.map +1 -0
- package/dist/control-file.d.ts +142 -0
- package/dist/control-file.d.ts.map +1 -0
- package/dist/control-file.js +144 -0
- package/dist/control-file.js.map +1 -0
- package/dist/coordinator-state.d.ts +131 -0
- package/dist/coordinator-state.d.ts.map +1 -0
- package/dist/coordinator-state.js +380 -0
- package/dist/coordinator-state.js.map +1 -0
- package/dist/coordinator.d.ts +95 -0
- package/dist/coordinator.d.ts.map +1 -0
- package/dist/coordinator.js +97 -0
- package/dist/coordinator.js.map +1 -0
- package/dist/cursor-store.d.ts +53 -0
- package/dist/cursor-store.d.ts.map +1 -0
- package/dist/cursor-store.js +98 -0
- package/dist/cursor-store.js.map +1 -0
- package/dist/daemon-cmd.d.ts +239 -0
- package/dist/daemon-cmd.d.ts.map +1 -0
- package/dist/daemon-cmd.js +1751 -0
- package/dist/daemon-cmd.js.map +1 -0
- package/dist/daemon-lock.d.ts +140 -0
- package/dist/daemon-lock.d.ts.map +1 -0
- package/dist/daemon-lock.js +352 -0
- package/dist/daemon-lock.js.map +1 -0
- package/dist/daemon-recovery.d.ts +78 -0
- package/dist/daemon-recovery.d.ts.map +1 -0
- package/dist/daemon-recovery.js +161 -0
- package/dist/daemon-recovery.js.map +1 -0
- package/dist/daemon.d.ts +368 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +601 -0
- package/dist/daemon.js.map +1 -0
- package/dist/declared-response-shape.d.ts +93 -0
- package/dist/declared-response-shape.d.ts.map +1 -0
- package/dist/declared-response-shape.js +200 -0
- package/dist/declared-response-shape.js.map +1 -0
- package/dist/declared-surfaces.d.ts +16 -0
- package/dist/declared-surfaces.d.ts.map +1 -0
- package/dist/declared-surfaces.js +19 -0
- package/dist/declared-surfaces.js.map +1 -0
- package/dist/depends-review.d.ts +113 -0
- package/dist/depends-review.d.ts.map +1 -0
- package/dist/depends-review.js +110 -0
- package/dist/depends-review.js.map +1 -0
- package/dist/doctor.d.ts +91 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +71 -0
- package/dist/doctor.js.map +1 -0
- package/dist/edge-approval.d.ts +105 -0
- package/dist/edge-approval.d.ts.map +1 -0
- package/dist/edge-approval.js +100 -0
- package/dist/edge-approval.js.map +1 -0
- package/dist/evidence-cache.d.ts +45 -0
- package/dist/evidence-cache.d.ts.map +1 -0
- package/dist/evidence-cache.js +90 -0
- package/dist/evidence-cache.js.map +1 -0
- package/dist/evidence-cmd.d.ts +133 -0
- package/dist/evidence-cmd.d.ts.map +1 -0
- package/dist/evidence-cmd.js +347 -0
- package/dist/evidence-cmd.js.map +1 -0
- package/dist/evidence-facts.d.ts +40 -0
- package/dist/evidence-facts.d.ts.map +1 -0
- package/dist/evidence-facts.js +114 -0
- package/dist/evidence-facts.js.map +1 -0
- package/dist/exclusive-lock.d.ts +52 -0
- package/dist/exclusive-lock.d.ts.map +1 -0
- package/dist/exclusive-lock.js +150 -0
- package/dist/exclusive-lock.js.map +1 -0
- package/dist/exec-domains.d.ts +140 -0
- package/dist/exec-domains.d.ts.map +1 -0
- package/dist/exec-domains.js +287 -0
- package/dist/exec-domains.js.map +1 -0
- package/dist/exemption-store.d.ts +197 -0
- package/dist/exemption-store.d.ts.map +1 -0
- package/dist/exemption-store.js +266 -0
- package/dist/exemption-store.js.map +1 -0
- package/dist/explicit-start-gate.d.ts +96 -0
- package/dist/explicit-start-gate.d.ts.map +1 -0
- package/dist/explicit-start-gate.js +103 -0
- package/dist/explicit-start-gate.js.map +1 -0
- package/dist/fs-trouble.d.ts +70 -0
- package/dist/fs-trouble.d.ts.map +1 -0
- package/dist/fs-trouble.js +98 -0
- package/dist/fs-trouble.js.map +1 -0
- package/dist/gate.d.ts +278 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +278 -0
- package/dist/gate.js.map +1 -0
- package/dist/git-driver.d.ts +519 -0
- package/dist/git-driver.d.ts.map +1 -0
- package/dist/git-driver.js +900 -0
- package/dist/git-driver.js.map +1 -0
- package/dist/git-push-executor.d.ts +41 -0
- package/dist/git-push-executor.d.ts.map +1 -0
- package/dist/git-push-executor.js +142 -0
- package/dist/git-push-executor.js.map +1 -0
- package/dist/glob.d.ts +26 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +93 -0
- package/dist/glob.js.map +1 -0
- package/dist/goal-adaptive.d.ts +295 -0
- package/dist/goal-adaptive.d.ts.map +1 -0
- package/dist/goal-adaptive.js +393 -0
- package/dist/goal-adaptive.js.map +1 -0
- package/dist/goal-compile.d.ts +342 -0
- package/dist/goal-compile.d.ts.map +1 -0
- package/dist/goal-compile.js +444 -0
- package/dist/goal-compile.js.map +1 -0
- package/dist/goal-depends-executor.d.ts +55 -0
- package/dist/goal-depends-executor.d.ts.map +1 -0
- package/dist/goal-depends-executor.js +202 -0
- package/dist/goal-depends-executor.js.map +1 -0
- package/dist/goal-execution-evidence.d.ts +135 -0
- package/dist/goal-execution-evidence.d.ts.map +1 -0
- package/dist/goal-execution-evidence.js +159 -0
- package/dist/goal-execution-evidence.js.map +1 -0
- package/dist/goal-gap.d.ts +140 -0
- package/dist/goal-gap.d.ts.map +1 -0
- package/dist/goal-gap.js +197 -0
- package/dist/goal-gap.js.map +1 -0
- package/dist/goal-met-target.d.ts +98 -0
- package/dist/goal-met-target.d.ts.map +1 -0
- package/dist/goal-met-target.js +92 -0
- package/dist/goal-met-target.js.map +1 -0
- package/dist/goal-ownership.d.ts +416 -0
- package/dist/goal-ownership.d.ts.map +1 -0
- package/dist/goal-ownership.js +576 -0
- package/dist/goal-ownership.js.map +1 -0
- package/dist/goal-runs.d.ts +82 -0
- package/dist/goal-runs.d.ts.map +1 -0
- package/dist/goal-runs.js +120 -0
- package/dist/goal-runs.js.map +1 -0
- package/dist/goal-store.d.ts +146 -0
- package/dist/goal-store.d.ts.map +1 -0
- package/dist/goal-store.js +294 -0
- package/dist/goal-store.js.map +1 -0
- package/dist/goal-view.d.ts +156 -0
- package/dist/goal-view.d.ts.map +1 -0
- package/dist/goal-view.js +499 -0
- package/dist/goal-view.js.map +1 -0
- package/dist/governed-approvals.d.ts +152 -0
- package/dist/governed-approvals.d.ts.map +1 -0
- package/dist/governed-approvals.js +246 -0
- package/dist/governed-approvals.js.map +1 -0
- package/dist/governed-broker.d.ts +169 -0
- package/dist/governed-broker.d.ts.map +1 -0
- package/dist/governed-broker.js +196 -0
- package/dist/governed-broker.js.map +1 -0
- package/dist/governed-run.d.ts +220 -0
- package/dist/governed-run.d.ts.map +1 -0
- package/dist/governed-run.js +406 -0
- package/dist/governed-run.js.map +1 -0
- package/dist/grant-reconcile.d.ts +63 -0
- package/dist/grant-reconcile.d.ts.map +1 -0
- package/dist/grant-reconcile.js +121 -0
- package/dist/grant-reconcile.js.map +1 -0
- package/dist/index-for-head.d.ts +56 -0
- package/dist/index-for-head.d.ts.map +1 -0
- package/dist/index-for-head.js +103 -0
- package/dist/index-for-head.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/init-detect.d.ts +39 -0
- package/dist/init-detect.d.ts.map +1 -0
- package/dist/init-detect.js +188 -0
- package/dist/init-detect.js.map +1 -0
- package/dist/integration-deps.d.ts +62 -0
- package/dist/integration-deps.d.ts.map +1 -0
- package/dist/integration-deps.js +251 -0
- package/dist/integration-deps.js.map +1 -0
- package/dist/integration-runtime.d.ts +458 -0
- package/dist/integration-runtime.d.ts.map +1 -0
- package/dist/integration-runtime.js +681 -0
- package/dist/integration-runtime.js.map +1 -0
- package/dist/integration.d.ts +45 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +87 -0
- package/dist/integration.js.map +1 -0
- package/dist/integrator.d.ts +84 -0
- package/dist/integrator.d.ts.map +1 -0
- package/dist/integrator.js +193 -0
- package/dist/integrator.js.map +1 -0
- package/dist/lane-claims.d.ts +174 -0
- package/dist/lane-claims.d.ts.map +1 -0
- package/dist/lane-claims.js +218 -0
- package/dist/lane-claims.js.map +1 -0
- package/dist/lane-coverage.d.ts +87 -0
- package/dist/lane-coverage.d.ts.map +1 -0
- package/dist/lane-coverage.js +129 -0
- package/dist/lane-coverage.js.map +1 -0
- package/dist/ledger-replay.d.ts +115 -0
- package/dist/ledger-replay.d.ts.map +1 -0
- package/dist/ledger-replay.js +155 -0
- package/dist/ledger-replay.js.map +1 -0
- package/dist/ledger-store.d.ts +68 -0
- package/dist/ledger-store.d.ts.map +1 -0
- package/dist/ledger-store.js +111 -0
- package/dist/ledger-store.js.map +1 -0
- package/dist/loop-safety-observer.d.ts +132 -0
- package/dist/loop-safety-observer.d.ts.map +1 -0
- package/dist/loop-safety-observer.js +76 -0
- package/dist/loop-safety-observer.js.map +1 -0
- package/dist/loop-safety-store.d.ts +339 -0
- package/dist/loop-safety-store.d.ts.map +1 -0
- package/dist/loop-safety-store.js +800 -0
- package/dist/loop-safety-store.js.map +1 -0
- package/dist/machine-store.d.ts +54 -0
- package/dist/machine-store.d.ts.map +1 -0
- package/dist/machine-store.js +149 -0
- package/dist/machine-store.js.map +1 -0
- package/dist/mcp-main.d.ts +2 -0
- package/dist/mcp-main.d.ts.map +1 -0
- package/dist/mcp-main.js +116 -0
- package/dist/mcp-main.js.map +1 -0
- package/dist/mcp-server.d.ts +72 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +259 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/model-routing.d.ts +75 -0
- package/dist/model-routing.d.ts.map +1 -0
- package/dist/model-routing.js +108 -0
- package/dist/model-routing.js.map +1 -0
- package/dist/model-transport.d.ts +188 -0
- package/dist/model-transport.d.ts.map +1 -0
- package/dist/model-transport.js +625 -0
- package/dist/model-transport.js.map +1 -0
- package/dist/notify-cadence.d.ts +55 -0
- package/dist/notify-cadence.d.ts.map +1 -0
- package/dist/notify-cadence.js +68 -0
- package/dist/notify-cadence.js.map +1 -0
- package/dist/notify-channel.d.ts +69 -0
- package/dist/notify-channel.d.ts.map +1 -0
- package/dist/notify-channel.js +151 -0
- package/dist/notify-channel.js.map +1 -0
- package/dist/notify.d.ts +71 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +125 -0
- package/dist/notify.js.map +1 -0
- package/dist/observation-inventory.d.ts +65 -0
- package/dist/observation-inventory.d.ts.map +1 -0
- package/dist/observation-inventory.js +139 -0
- package/dist/observation-inventory.js.map +1 -0
- package/dist/owned-children.d.ts +45 -0
- package/dist/owned-children.d.ts.map +1 -0
- package/dist/owned-children.js +64 -0
- package/dist/owned-children.js.map +1 -0
- package/dist/packet-for-goal.d.ts +19 -0
- package/dist/packet-for-goal.d.ts.map +1 -0
- package/dist/packet-for-goal.js +32 -0
- package/dist/packet-for-goal.js.map +1 -0
- package/dist/pair-cmd.d.ts +85 -0
- package/dist/pair-cmd.d.ts.map +1 -0
- package/dist/pair-cmd.js +205 -0
- package/dist/pair-cmd.js.map +1 -0
- package/dist/partial-asker.d.ts +96 -0
- package/dist/partial-asker.d.ts.map +1 -0
- package/dist/partial-asker.js +117 -0
- package/dist/partial-asker.js.map +1 -0
- package/dist/pdf-text-lines.d.ts +17 -0
- package/dist/pdf-text-lines.d.ts.map +1 -0
- package/dist/pdf-text-lines.js +70 -0
- package/dist/pdf-text-lines.js.map +1 -0
- package/dist/pdf-text-worker.d.ts +2 -0
- package/dist/pdf-text-worker.d.ts.map +1 -0
- package/dist/pdf-text-worker.js +81 -0
- package/dist/pdf-text-worker.js.map +1 -0
- package/dist/pdf-text.d.ts +56 -0
- package/dist/pdf-text.d.ts.map +1 -0
- package/dist/pdf-text.js +64 -0
- package/dist/pdf-text.js.map +1 -0
- package/dist/pending-action.d.ts +154 -0
- package/dist/pending-action.d.ts.map +1 -0
- package/dist/pending-action.js +148 -0
- package/dist/pending-action.js.map +1 -0
- package/dist/preemptor.d.ts +40 -0
- package/dist/preemptor.d.ts.map +1 -0
- package/dist/preemptor.js +49 -0
- package/dist/preemptor.js.map +1 -0
- package/dist/programme-mode.d.ts +29 -0
- package/dist/programme-mode.d.ts.map +1 -0
- package/dist/programme-mode.js +50 -0
- package/dist/programme-mode.js.map +1 -0
- package/dist/progress-view.d.ts +14 -0
- package/dist/progress-view.d.ts.map +1 -0
- package/dist/progress-view.js +114 -0
- package/dist/progress-view.js.map +1 -0
- package/dist/project-graph-builder.d.ts +81 -0
- package/dist/project-graph-builder.d.ts.map +1 -0
- package/dist/project-graph-builder.js +246 -0
- package/dist/project-graph-builder.js.map +1 -0
- package/dist/project-graph-runtime.d.ts +86 -0
- package/dist/project-graph-runtime.d.ts.map +1 -0
- package/dist/project-graph-runtime.js +112 -0
- package/dist/project-graph-runtime.js.map +1 -0
- package/dist/project-index-builder.d.ts +96 -0
- package/dist/project-index-builder.d.ts.map +1 -0
- package/dist/project-index-builder.js +298 -0
- package/dist/project-index-builder.js.map +1 -0
- package/dist/project-index-facts.d.ts +51 -0
- package/dist/project-index-facts.d.ts.map +1 -0
- package/dist/project-index-facts.js +117 -0
- package/dist/project-index-facts.js.map +1 -0
- package/dist/project-index-store.d.ts +97 -0
- package/dist/project-index-store.d.ts.map +1 -0
- package/dist/project-index-store.js +140 -0
- package/dist/project-index-store.js.map +1 -0
- package/dist/project-memory-store.d.ts +127 -0
- package/dist/project-memory-store.d.ts.map +1 -0
- package/dist/project-memory-store.js +302 -0
- package/dist/project-memory-store.js.map +1 -0
- package/dist/proposal-store.d.ts +14 -0
- package/dist/proposal-store.d.ts.map +1 -0
- package/dist/proposal-store.js +19 -0
- package/dist/proposal-store.js.map +1 -0
- package/dist/prover.d.ts +80 -0
- package/dist/prover.d.ts.map +1 -0
- package/dist/prover.js +137 -0
- package/dist/prover.js.map +1 -0
- package/dist/provider-identity-store.d.ts +34 -0
- package/dist/provider-identity-store.d.ts.map +1 -0
- package/dist/provider-identity-store.js +72 -0
- package/dist/provider-identity-store.js.map +1 -0
- package/dist/provider-identity.d.ts +104 -0
- package/dist/provider-identity.d.ts.map +1 -0
- package/dist/provider-identity.js +167 -0
- package/dist/provider-identity.js.map +1 -0
- package/dist/provider-limit.d.ts +79 -0
- package/dist/provider-limit.d.ts.map +1 -0
- package/dist/provider-limit.js +148 -0
- package/dist/provider-limit.js.map +1 -0
- package/dist/provider-preflight.d.ts +171 -0
- package/dist/provider-preflight.d.ts.map +1 -0
- package/dist/provider-preflight.js +395 -0
- package/dist/provider-preflight.js.map +1 -0
- package/dist/provider-state.d.ts +120 -0
- package/dist/provider-state.d.ts.map +1 -0
- package/dist/provider-state.js +182 -0
- package/dist/provider-state.js.map +1 -0
- package/dist/providers.d.ts +132 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +161 -0
- package/dist/providers.js.map +1 -0
- package/dist/publication-recorder.d.ts +117 -0
- package/dist/publication-recorder.d.ts.map +1 -0
- package/dist/publication-recorder.js +124 -0
- package/dist/publication-recorder.js.map +1 -0
- package/dist/pursuit-delivery.d.ts +24 -0
- package/dist/pursuit-delivery.d.ts.map +1 -0
- package/dist/pursuit-delivery.js +38 -0
- package/dist/pursuit-delivery.js.map +1 -0
- package/dist/queue-store.d.ts +132 -0
- package/dist/queue-store.d.ts.map +1 -0
- package/dist/queue-store.js +185 -0
- package/dist/queue-store.js.map +1 -0
- package/dist/queue-summary.d.ts +14 -0
- package/dist/queue-summary.d.ts.map +1 -0
- package/dist/queue-summary.js +82 -0
- package/dist/queue-summary.js.map +1 -0
- package/dist/queue-view.d.ts +20 -0
- package/dist/queue-view.d.ts.map +1 -0
- package/dist/queue-view.js +163 -0
- package/dist/queue-view.js.map +1 -0
- package/dist/queue-write-lease.d.ts +106 -0
- package/dist/queue-write-lease.d.ts.map +1 -0
- package/dist/queue-write-lease.js +282 -0
- package/dist/queue-write-lease.js.map +1 -0
- package/dist/rails-home.d.ts +162 -0
- package/dist/rails-home.d.ts.map +1 -0
- package/dist/rails-home.js +452 -0
- package/dist/rails-home.js.map +1 -0
- package/dist/rails-migrations.d.ts +75 -0
- package/dist/rails-migrations.d.ts.map +1 -0
- package/dist/rails-migrations.js +199 -0
- package/dist/rails-migrations.js.map +1 -0
- package/dist/rails-stores.d.ts +49 -0
- package/dist/rails-stores.d.ts.map +1 -0
- package/dist/rails-stores.js +100 -0
- package/dist/rails-stores.js.map +1 -0
- package/dist/reaper.d.ts +69 -0
- package/dist/reaper.d.ts.map +1 -0
- package/dist/reaper.js +152 -0
- package/dist/reaper.js.map +1 -0
- package/dist/record-store.d.ts +36 -0
- package/dist/record-store.d.ts.map +1 -0
- package/dist/record-store.js +78 -0
- package/dist/record-store.js.map +1 -0
- package/dist/recovery-io.d.ts +50 -0
- package/dist/recovery-io.d.ts.map +1 -0
- package/dist/recovery-io.js +122 -0
- package/dist/recovery-io.js.map +1 -0
- package/dist/recovery.d.ts +146 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +110 -0
- package/dist/recovery.js.map +1 -0
- package/dist/redraw.d.ts +34 -0
- package/dist/redraw.d.ts.map +1 -0
- package/dist/redraw.js +62 -0
- package/dist/redraw.js.map +1 -0
- package/dist/rejected-evidence.d.ts +255 -0
- package/dist/rejected-evidence.d.ts.map +1 -0
- package/dist/rejected-evidence.js +324 -0
- package/dist/rejected-evidence.js.map +1 -0
- package/dist/report-cmd.d.ts +32 -0
- package/dist/report-cmd.d.ts.map +1 -0
- package/dist/report-cmd.js +201 -0
- package/dist/report-cmd.js.map +1 -0
- package/dist/repos-cmd.d.ts +80 -0
- package/dist/repos-cmd.d.ts.map +1 -0
- package/dist/repos-cmd.js +240 -0
- package/dist/repos-cmd.js.map +1 -0
- package/dist/request-body-shape.d.ts +93 -0
- package/dist/request-body-shape.d.ts.map +1 -0
- package/dist/request-body-shape.js +407 -0
- package/dist/request-body-shape.js.map +1 -0
- package/dist/requirement-claims.d.ts +89 -0
- package/dist/requirement-claims.d.ts.map +1 -0
- package/dist/requirement-claims.js +92 -0
- package/dist/requirement-claims.js.map +1 -0
- package/dist/retention-apply-runtime.d.ts +105 -0
- package/dist/retention-apply-runtime.d.ts.map +1 -0
- package/dist/retention-apply-runtime.js +269 -0
- package/dist/retention-apply-runtime.js.map +1 -0
- package/dist/reverify.d.ts +41 -0
- package/dist/reverify.d.ts.map +1 -0
- package/dist/reverify.js +69 -0
- package/dist/reverify.js.map +1 -0
- package/dist/round-records.d.ts +65 -0
- package/dist/round-records.d.ts.map +1 -0
- package/dist/round-records.js +61 -0
- package/dist/round-records.js.map +1 -0
- package/dist/round-runner.d.ts +924 -0
- package/dist/round-runner.d.ts.map +1 -0
- package/dist/round-runner.js +1693 -0
- package/dist/round-runner.js.map +1 -0
- package/dist/run-approval.d.ts +180 -0
- package/dist/run-approval.d.ts.map +1 -0
- package/dist/run-approval.js +199 -0
- package/dist/run-approval.js.map +1 -0
- package/dist/run-cmd.d.ts +359 -0
- package/dist/run-cmd.d.ts.map +1 -0
- package/dist/run-cmd.js +4418 -0
- package/dist/run-cmd.js.map +1 -0
- package/dist/run-delivery.d.ts +71 -0
- package/dist/run-delivery.d.ts.map +1 -0
- package/dist/run-delivery.js +104 -0
- package/dist/run-delivery.js.map +1 -0
- package/dist/run-ended.d.ts +75 -0
- package/dist/run-ended.d.ts.map +1 -0
- package/dist/run-ended.js +27 -0
- package/dist/run-ended.js.map +1 -0
- package/dist/run-ending-locator.d.ts +125 -0
- package/dist/run-ending-locator.d.ts.map +1 -0
- package/dist/run-ending-locator.js +133 -0
- package/dist/run-ending-locator.js.map +1 -0
- package/dist/run-launcher.d.ts +459 -0
- package/dist/run-launcher.d.ts.map +1 -0
- package/dist/run-launcher.js +652 -0
- package/dist/run-launcher.js.map +1 -0
- package/dist/run-lease.d.ts +208 -0
- package/dist/run-lease.d.ts.map +1 -0
- package/dist/run-lease.js +301 -0
- package/dist/run-lease.js.map +1 -0
- package/dist/run-refusal-marks.d.ts +189 -0
- package/dist/run-refusal-marks.d.ts.map +1 -0
- package/dist/run-refusal-marks.js +249 -0
- package/dist/run-refusal-marks.js.map +1 -0
- package/dist/run-start-marks.d.ts +153 -0
- package/dist/run-start-marks.d.ts.map +1 -0
- package/dist/run-start-marks.js +269 -0
- package/dist/run-start-marks.js.map +1 -0
- package/dist/scan-cmd.d.ts +14 -0
- package/dist/scan-cmd.d.ts.map +1 -0
- package/dist/scan-cmd.js +270 -0
- package/dist/scan-cmd.js.map +1 -0
- package/dist/scan-events.d.ts +50 -0
- package/dist/scan-events.d.ts.map +1 -0
- package/dist/scan-events.js +91 -0
- package/dist/scan-events.js.map +1 -0
- package/dist/scan.d.ts +191 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +417 -0
- package/dist/scan.js.map +1 -0
- package/dist/scope-rule.d.ts +148 -0
- package/dist/scope-rule.d.ts.map +1 -0
- package/dist/scope-rule.js +121 -0
- package/dist/scope-rule.js.map +1 -0
- package/dist/self-repo-id.d.ts +18 -0
- package/dist/self-repo-id.d.ts.map +1 -0
- package/dist/self-repo-id.js +70 -0
- package/dist/self-repo-id.js.map +1 -0
- package/dist/server-client.d.ts +766 -0
- package/dist/server-client.d.ts.map +1 -0
- package/dist/server-client.js +475 -0
- package/dist/server-client.js.map +1 -0
- package/dist/session-adapter-runtime.d.ts +195 -0
- package/dist/session-adapter-runtime.d.ts.map +1 -0
- package/dist/session-adapter-runtime.js +373 -0
- package/dist/session-adapter-runtime.js.map +1 -0
- package/dist/session-checkpoint-runtime.d.ts +62 -0
- package/dist/session-checkpoint-runtime.d.ts.map +1 -0
- package/dist/session-checkpoint-runtime.js +268 -0
- package/dist/session-checkpoint-runtime.js.map +1 -0
- package/dist/session-control-transport.d.ts +106 -0
- package/dist/session-control-transport.d.ts.map +1 -0
- package/dist/session-control-transport.js +232 -0
- package/dist/session-control-transport.js.map +1 -0
- package/dist/session-observation-store.d.ts +98 -0
- package/dist/session-observation-store.d.ts.map +1 -0
- package/dist/session-observation-store.js +155 -0
- package/dist/session-observation-store.js.map +1 -0
- package/dist/session-observe-runtime.d.ts +123 -0
- package/dist/session-observe-runtime.d.ts.map +1 -0
- package/dist/session-observe-runtime.js +317 -0
- package/dist/session-observe-runtime.js.map +1 -0
- package/dist/session-store.d.ts +98 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/session-store.js +116 -0
- package/dist/session-store.js.map +1 -0
- package/dist/sessions-cmd.d.ts +202 -0
- package/dist/sessions-cmd.d.ts.map +1 -0
- package/dist/sessions-cmd.js +609 -0
- package/dist/sessions-cmd.js.map +1 -0
- package/dist/settings-overlay.d.ts +53 -0
- package/dist/settings-overlay.d.ts.map +1 -0
- package/dist/settings-overlay.js +175 -0
- package/dist/settings-overlay.js.map +1 -0
- package/dist/setup-prompt.d.ts +34 -0
- package/dist/setup-prompt.d.ts.map +1 -0
- package/dist/setup-prompt.js +92 -0
- package/dist/setup-prompt.js.map +1 -0
- package/dist/setup.d.ts +103 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +283 -0
- package/dist/setup.js.map +1 -0
- package/dist/shared-grants.d.ts +164 -0
- package/dist/shared-grants.d.ts.map +1 -0
- package/dist/shared-grants.js +242 -0
- package/dist/shared-grants.js.map +1 -0
- package/dist/signals.d.ts +55 -0
- package/dist/signals.d.ts.map +1 -0
- package/dist/signals.js +85 -0
- package/dist/signals.js.map +1 -0
- package/dist/source-cmd.d.ts +201 -0
- package/dist/source-cmd.d.ts.map +1 -0
- package/dist/source-cmd.js +684 -0
- package/dist/source-cmd.js.map +1 -0
- package/dist/source-verdict.d.ts +99 -0
- package/dist/source-verdict.d.ts.map +1 -0
- package/dist/source-verdict.js +182 -0
- package/dist/source-verdict.js.map +1 -0
- package/dist/spend-ledger.d.ts +350 -0
- package/dist/spend-ledger.d.ts.map +1 -0
- package/dist/spend-ledger.js +546 -0
- package/dist/spend-ledger.js.map +1 -0
- package/dist/stale-run-sweep.d.ts +79 -0
- package/dist/stale-run-sweep.d.ts.map +1 -0
- package/dist/stale-run-sweep.js +116 -0
- package/dist/stale-run-sweep.js.map +1 -0
- package/dist/start-attempts.d.ts +385 -0
- package/dist/start-attempts.d.ts.map +1 -0
- package/dist/start-attempts.js +613 -0
- package/dist/start-attempts.js.map +1 -0
- package/dist/status-cmd.d.ts +28 -0
- package/dist/status-cmd.d.ts.map +1 -0
- package/dist/status-cmd.js +116 -0
- package/dist/status-cmd.js.map +1 -0
- package/dist/stop-follow-up.d.ts +107 -0
- package/dist/stop-follow-up.d.ts.map +1 -0
- package/dist/stop-follow-up.js +172 -0
- package/dist/stop-follow-up.js.map +1 -0
- package/dist/surface-lease.d.ts +118 -0
- package/dist/surface-lease.d.ts.map +1 -0
- package/dist/surface-lease.js +485 -0
- package/dist/surface-lease.js.map +1 -0
- package/dist/sync.d.ts +54 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +93 -0
- package/dist/sync.js.map +1 -0
- package/dist/syncing-ledger.d.ts +45 -0
- package/dist/syncing-ledger.d.ts.map +1 -0
- package/dist/syncing-ledger.js +53 -0
- package/dist/syncing-ledger.js.map +1 -0
- package/dist/temp-fixtures.d.ts +68 -0
- package/dist/temp-fixtures.d.ts.map +1 -0
- package/dist/temp-fixtures.js +38 -0
- package/dist/temp-fixtures.js.map +1 -0
- package/dist/token-window.d.ts +84 -0
- package/dist/token-window.d.ts.map +1 -0
- package/dist/token-window.js +143 -0
- package/dist/token-window.js.map +1 -0
- package/dist/tool-bridge.d.ts +177 -0
- package/dist/tool-bridge.d.ts.map +1 -0
- package/dist/tool-bridge.js +329 -0
- package/dist/tool-bridge.js.map +1 -0
- package/dist/tool-call-record.d.ts +197 -0
- package/dist/tool-call-record.d.ts.map +1 -0
- package/dist/tool-call-record.js +276 -0
- package/dist/tool-call-record.js.map +1 -0
- package/dist/tool-protocol.d.ts +135 -0
- package/dist/tool-protocol.d.ts.map +1 -0
- package/dist/tool-protocol.js +104 -0
- package/dist/tool-protocol.js.map +1 -0
- package/dist/tool-worker.d.ts +3 -0
- package/dist/tool-worker.d.ts.map +1 -0
- package/dist/tool-worker.js +478 -0
- package/dist/tool-worker.js.map +1 -0
- package/dist/toolchain-mirror.d.ts +86 -0
- package/dist/toolchain-mirror.d.ts.map +1 -0
- package/dist/toolchain-mirror.js +307 -0
- package/dist/toolchain-mirror.js.map +1 -0
- package/dist/trusted-git.d.ts +243 -0
- package/dist/trusted-git.d.ts.map +1 -0
- package/dist/trusted-git.js +920 -0
- package/dist/trusted-git.js.map +1 -0
- package/dist/ui.d.ts +76 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +118 -0
- package/dist/ui.js.map +1 -0
- package/dist/untrusted-exec.d.ts +275 -0
- package/dist/untrusted-exec.d.ts.map +1 -0
- package/dist/untrusted-exec.js +479 -0
- package/dist/untrusted-exec.js.map +1 -0
- package/dist/untrusted-gate.d.ts +73 -0
- package/dist/untrusted-gate.d.ts.map +1 -0
- package/dist/untrusted-gate.js +226 -0
- package/dist/untrusted-gate.js.map +1 -0
- package/dist/uploader.d.ts +153 -0
- package/dist/uploader.d.ts.map +1 -0
- package/dist/uploader.js +204 -0
- package/dist/uploader.js.map +1 -0
- package/dist/verifier.d.ts +66 -0
- package/dist/verifier.d.ts.map +1 -0
- package/dist/verifier.js +170 -0
- package/dist/verifier.js.map +1 -0
- package/dist/verify-apply.d.ts +26 -0
- package/dist/verify-apply.d.ts.map +1 -0
- package/dist/verify-apply.js +36 -0
- package/dist/verify-apply.js.map +1 -0
- package/dist/verify-cmd.d.ts +44 -0
- package/dist/verify-cmd.d.ts.map +1 -0
- package/dist/verify-cmd.js +125 -0
- package/dist/verify-cmd.js.map +1 -0
- package/dist/verify-pass.d.ts +73 -0
- package/dist/verify-pass.d.ts.map +1 -0
- package/dist/verify-pass.js +103 -0
- package/dist/verify-pass.js.map +1 -0
- package/dist/welcome.d.ts +43 -0
- package/dist/welcome.d.ts.map +1 -0
- package/dist/welcome.js +116 -0
- package/dist/welcome.js.map +1 -0
- package/dist/workspace-provisioner.d.ts +65 -0
- package/dist/workspace-provisioner.d.ts.map +1 -0
- package/dist/workspace-provisioner.js +66 -0
- package/dist/workspace-provisioner.js.map +1 -0
- package/dist/workspace-quarantine.d.ts +64 -0
- package/dist/workspace-quarantine.d.ts.map +1 -0
- package/dist/workspace-quarantine.js +156 -0
- package/dist/workspace-quarantine.js.map +1 -0
- package/dist/workspace-residue-sweep.d.ts +113 -0
- package/dist/workspace-residue-sweep.d.ts.map +1 -0
- package/dist/workspace-residue-sweep.js +158 -0
- package/dist/workspace-residue-sweep.js.map +1 -0
- package/dist/workspace.d.ts +639 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +2026 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +54 -6
- package/win/CredProbe.cs +64 -0
- package/win/FakeClaude.cs +56 -0
- package/win/HandleProbe.cs +116 -0
- package/win/TokenProbe.cs +53 -0
- package/win/appcontainer.ps1 +500 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.goalDependsExecutor = goalDependsExecutor;
|
|
4
|
+
exports.describeEdgeEffect = describeEdgeEffect;
|
|
5
|
+
/**
|
|
6
|
+
* The approved action, re-read from the envelope.
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ CHECKED AGAIN HERE EVEN THOUGH THE PARSER ALREADY REFUSED THESE. This is
|
|
9
|
+
* the last code before an effect, and `git-push-executor.ts` makes the same
|
|
10
|
+
* argument about a forced push: a shape the parser rejects should still not be
|
|
11
|
+
* carried out if it somehow arrives.
|
|
12
|
+
*/
|
|
13
|
+
function actionOf(env) {
|
|
14
|
+
const a = env.actionRequest.action;
|
|
15
|
+
if (typeof a?.goalId !== 'string' || a.goalId === '')
|
|
16
|
+
return 'no goal';
|
|
17
|
+
if (typeof a?.dependsOnId !== 'string' || a.dependsOnId === '')
|
|
18
|
+
return 'no dependency';
|
|
19
|
+
if (a.goalId === a.dependsOnId)
|
|
20
|
+
return 'a goal cannot be made to wait for itself';
|
|
21
|
+
if (typeof a?.goalVersion !== 'number' || !Number.isInteger(a.goalVersion) || a.goalVersion < 0) {
|
|
22
|
+
return 'the approved goal version is not a whole number';
|
|
23
|
+
}
|
|
24
|
+
if (typeof a?.dependsOnVersion !== 'number' || !Number.isInteger(a.dependsOnVersion) || a.dependsOnVersion < 0) {
|
|
25
|
+
return 'the approved dependency version is not a whole number';
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
goalId: a.goalId,
|
|
29
|
+
dependsOnId: a.dependsOnId,
|
|
30
|
+
goalVersion: a.goalVersion,
|
|
31
|
+
dependsOnVersion: a.dependsOnVersion,
|
|
32
|
+
sourceId: typeof a.sourceId === 'string' ? a.sourceId : '',
|
|
33
|
+
sourceSha: typeof a.sourceSha === 'string' ? a.sourceSha : '',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* What is kept as evidence.
|
|
38
|
+
*
|
|
39
|
+
* ⚠️ EVERY FIELD IS ALREADY INSIDE THE FINGERPRINT A PERSON APPROVED, so none
|
|
40
|
+
* of it is new information and none of it is a secret. The observed list is
|
|
41
|
+
* summarised as a COUNT rather than enumerated: how many edges that goal has is
|
|
42
|
+
* the fact worth recording, and the other goals' ids are nobody's business
|
|
43
|
+
* here.
|
|
44
|
+
*/
|
|
45
|
+
function evidenceOf(a, observedEdges) {
|
|
46
|
+
return {
|
|
47
|
+
goal: a.goalId,
|
|
48
|
+
dependsOn: a.dependsOnId,
|
|
49
|
+
goalVersion: String(a.goalVersion),
|
|
50
|
+
...(observedEdges === null ? {} : { edgesAfter: String(observedEdges) }),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function goalDependsExecutor(projectId, goals) {
|
|
54
|
+
const look = async (a) => {
|
|
55
|
+
try {
|
|
56
|
+
return await goals.read(projectId, a.goalId);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
/**
|
|
60
|
+
* 🔴 COULD NOT LOOK IS NOT "NOT THERE". The same distinction
|
|
61
|
+
* `git-push-executor.ts` keeps about a remote: reading a failure to read
|
|
62
|
+
* as an absence is how an effect gets applied twice.
|
|
63
|
+
*/
|
|
64
|
+
return { because: `the goal could not be read (${e.message})` };
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
type: 'goal.depends',
|
|
69
|
+
async execute(env) {
|
|
70
|
+
const a = actionOf(env);
|
|
71
|
+
if (typeof a === 'string')
|
|
72
|
+
return { kind: 'failure', safeReason: a, evidence: {} };
|
|
73
|
+
const seen = await look(a);
|
|
74
|
+
if (seen !== null && 'because' in seen) {
|
|
75
|
+
return { kind: 'ambiguous', safeReason: seen.because, evidence: evidenceOf(a, null) };
|
|
76
|
+
}
|
|
77
|
+
if (seen === null) {
|
|
78
|
+
return { kind: 'failure', safeReason: `${a.goalId} is not a goal in this project`, evidence: evidenceOf(a, null) };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 🔴 THE APPROVAL WAS FOR ONE VERSION OF THIS GOAL. If it has moved,
|
|
82
|
+
* nothing is written: the edge may still be right, and it is not the same
|
|
83
|
+
* decision any more, so it goes back to a person rather than through.
|
|
84
|
+
*/
|
|
85
|
+
if (seen.version !== a.goalVersion) {
|
|
86
|
+
return {
|
|
87
|
+
kind: 'failure',
|
|
88
|
+
safeReason: `this was approved for ${a.goalId}@${a.goalVersion} and it is now at ${seen.version}`,
|
|
89
|
+
evidence: evidenceOf(a, seen.dependsOn.length),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (seen.dependsOn.includes(a.dependsOnId)) {
|
|
93
|
+
// The approved effect is present. `git.push` answers the same way when
|
|
94
|
+
// the remote already holds the commit.
|
|
95
|
+
return { kind: 'success', evidence: evidenceOf(a, seen.dependsOn.length) };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 🔴 AND THE GOAL IT WILL WAIT FOR IS STILL THE ONE THAT WAS APPROVED. The
|
|
99
|
+
* person read "wait for R2@2"; an R2 rewritten or abandoned since is not
|
|
100
|
+
* what they said yes to. `dependsOnVersion` was parsed here and compared
|
|
101
|
+
* with nothing until the governed write became reachable (F11 review).
|
|
102
|
+
*/
|
|
103
|
+
const prerequisite = await look({ ...a, goalId: a.dependsOnId });
|
|
104
|
+
if (prerequisite !== null && 'because' in prerequisite) {
|
|
105
|
+
return { kind: 'ambiguous', safeReason: prerequisite.because, evidence: evidenceOf(a, null) };
|
|
106
|
+
}
|
|
107
|
+
if (prerequisite === null) {
|
|
108
|
+
return { kind: 'failure', safeReason: `${a.dependsOnId} is not a goal in this project`, evidence: evidenceOf(a, null) };
|
|
109
|
+
}
|
|
110
|
+
if (prerequisite.version !== a.dependsOnVersion) {
|
|
111
|
+
return {
|
|
112
|
+
kind: 'failure',
|
|
113
|
+
safeReason: `this was approved to wait for ${a.dependsOnId}@${a.dependsOnVersion} and it is now at ${prerequisite.version}`,
|
|
114
|
+
evidence: evidenceOf(a, seen.dependsOn.length),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 🔴 THE UNION, NEVER THE ONE EDGE. `PATCH dependsOn` REPLACES the list,
|
|
119
|
+
* so sending `[dependsOnId]` alone would delete every other edge on this
|
|
120
|
+
* goal as a side effect of adding one.
|
|
121
|
+
*/
|
|
122
|
+
const next = [...seen.dependsOn, a.dependsOnId];
|
|
123
|
+
try {
|
|
124
|
+
// 🔴 NAMING THE EXECUTION IS WHAT LETS THE MACHINE WRITE THIS AT ALL.
|
|
125
|
+
// Changing a goal is a person's route; the server admits this one write
|
|
126
|
+
// only as the effect of THIS execution of an approved `goal.depends`,
|
|
127
|
+
// and checks the list against the action it holds (see the server's
|
|
128
|
+
// `GovernedGoalEdgeService`). Without it every approved edge was a 403.
|
|
129
|
+
await goals.setDependsOn(projectId, a.goalId, a.goalVersion, next, env.executionId);
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
/**
|
|
133
|
+
* IT THREW, AND THAT IS NOT THE SAME AS IT NOT HAPPENING. A request
|
|
134
|
+
* that timed out after the server applied it looks identical from here,
|
|
135
|
+
* so this does not decide — it goes and LOOKS.
|
|
136
|
+
*/
|
|
137
|
+
const after = await look(a);
|
|
138
|
+
if (after === null || 'because' in after) {
|
|
139
|
+
return {
|
|
140
|
+
kind: 'ambiguous',
|
|
141
|
+
safeReason: `the edge was not confirmed and ${after === null ? 'the goal is no longer there' : after.because}`,
|
|
142
|
+
evidence: evidenceOf(a, null),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
if (after.dependsOn.includes(a.dependsOnId)) {
|
|
146
|
+
return { kind: 'success', evidence: evidenceOf(a, after.dependsOn.length) };
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
kind: 'failure',
|
|
150
|
+
safeReason: `the edge was refused (${e.message})`,
|
|
151
|
+
evidence: evidenceOf(a, after.dependsOn.length),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* ⚠️ IT RETURNED CLEANLY AND IT IS STILL CONFIRMED. One read, and the
|
|
156
|
+
* success recorded is one somebody could go and verify.
|
|
157
|
+
*/
|
|
158
|
+
const after = await look(a);
|
|
159
|
+
if (after === null || 'because' in after) {
|
|
160
|
+
return {
|
|
161
|
+
kind: 'ambiguous',
|
|
162
|
+
safeReason: `the edge was written and ${after === null ? 'the goal is no longer there' : after.because}`,
|
|
163
|
+
evidence: evidenceOf(a, null),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (!after.dependsOn.includes(a.dependsOnId)) {
|
|
167
|
+
return {
|
|
168
|
+
kind: 'ambiguous',
|
|
169
|
+
safeReason: 'the edge was written and the goal does not have it',
|
|
170
|
+
evidence: evidenceOf(a, after.dependsOn.length),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return { kind: 'success', evidence: evidenceOf(a, after.dependsOn.length) };
|
|
174
|
+
},
|
|
175
|
+
async reconcile(env) {
|
|
176
|
+
const a = actionOf(env);
|
|
177
|
+
// An action this executor cannot read is not one it can have performed.
|
|
178
|
+
if (typeof a === 'string')
|
|
179
|
+
return { kind: 'observed-not-executed' };
|
|
180
|
+
const seen = await look(a);
|
|
181
|
+
if (seen !== null && 'because' in seen)
|
|
182
|
+
return { kind: 'ambiguous', safeReason: seen.because };
|
|
183
|
+
/**
|
|
184
|
+
* ⚠️ A GOAL THAT IS GONE IS AMBIGUOUS, NOT "NOT EXECUTED". The edge may
|
|
185
|
+
* have been written and the goal deleted afterwards; answering
|
|
186
|
+
* `observed-not-executed` would permit a retry against something that is
|
|
187
|
+
* not there, and that arm is the ONLY one that permits one.
|
|
188
|
+
*/
|
|
189
|
+
if (seen === null)
|
|
190
|
+
return { kind: 'ambiguous', safeReason: `${a.goalId} is no longer a goal in this project` };
|
|
191
|
+
if (seen.dependsOn.includes(a.dependsOnId)) {
|
|
192
|
+
return { kind: 'observed-success', evidence: evidenceOf(a, seen.dependsOn.length) };
|
|
193
|
+
}
|
|
194
|
+
return { kind: 'observed-not-executed' };
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/** One line for a person, for a result that already carries its own evidence. */
|
|
199
|
+
function describeEdgeEffect(a) {
|
|
200
|
+
return `${a.goalId} waits for ${a.dependsOnId}`;
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=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
|
|
4
|
+
* KEY 2 — THE HALF OF "THIS GOAL IS MET" THAT CANNOT BE TALKED INTO AN ANSWER.
|
|
5
|
+
*
|
|
6
|
+
* The evaluator is the same write-capable machinery that produced the work it
|
|
7
|
+
* is judging, so its `satisfied` is necessary and never sufficient. This is the
|
|
8
|
+
* other key, and it asks the only question the machine can answer for itself:
|
|
9
|
+
* did Looply actually deliver this plan, and is what it delivered what the
|
|
10
|
+
* repository is standing on right now?
|
|
11
|
+
*
|
|
12
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
* WHY THIS REPLACED AN EVIDENCE-FRESHNESS CHECK
|
|
14
|
+
*
|
|
15
|
+
* The first version of KEY 2 asked whether every delivered item had a verifier
|
|
16
|
+
* evidence entry recorded at the current HEAD. An adversarial review proved
|
|
17
|
+
* that could never be true, and the proof is short:
|
|
18
|
+
*
|
|
19
|
+
* the evidence cache is keyed by (item, head) and written by the VERIFY pass,
|
|
20
|
+
* which reads HEAD before the work happens (verify-pass.ts) — then the round
|
|
21
|
+
* implements the item and COMMITS, which moves HEAD, and only then marks it
|
|
22
|
+
* `done` (round-runner.ts). Nothing writes evidence in between.
|
|
23
|
+
*
|
|
24
|
+
* So a genuinely delivered item's evidence is always pinned to an ancestor of
|
|
25
|
+
* its own commit; `lookup` answers `moved`; KEY 2 refused. Every goal, for
|
|
26
|
+
* ever, at the cost of an eight-minute evaluation each time. The end-to-end
|
|
27
|
+
* test passed only because its simulated run recorded evidence at a HEAD that
|
|
28
|
+
* never moved — a commit that changes nothing, which the real runner cannot
|
|
29
|
+
* produce.
|
|
30
|
+
*
|
|
31
|
+
* The mistake was asking pre-commit evidence to vouch for a post-commit tree.
|
|
32
|
+
* It was never checked against that tree and pretending otherwise would be the
|
|
33
|
+
* kind of lie this codebase refuses elsewhere.
|
|
34
|
+
*
|
|
35
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
36
|
+
* WHAT IT ASKS INSTEAD
|
|
37
|
+
*
|
|
38
|
+
* There must exist a real delivered round for the CURRENT goal, version and
|
|
39
|
+
* plan revision such that:
|
|
40
|
+
*
|
|
41
|
+
* 1. the round COMMITTED — `round.ended.outcome === 'committed'`
|
|
42
|
+
* 2. its commit is what the repository is on NOW — `sha === current HEAD`
|
|
43
|
+
* 3. its own gate record proves every CURRENTLY-required step passed
|
|
44
|
+
*
|
|
45
|
+
* (2) is what makes this honest without pretending: rather than asking stale
|
|
46
|
+
* evidence about a new tree, it asks whether the tree is still the one the
|
|
47
|
+
* round produced. If anything has moved HEAD since — another run, a person, a
|
|
48
|
+
* merge — KEY 2 fails closed, because nothing here has checked that.
|
|
49
|
+
*
|
|
50
|
+
* (3) is re-derived from the CURRENT config every time, not from what was
|
|
51
|
+
* required when the round ran. A step added to `config.gates` since is a step
|
|
52
|
+
* this delivery never passed, and the answer to "is the goal met" must be
|
|
53
|
+
* about the standard in force now.
|
|
54
|
+
*
|
|
55
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
56
|
+
* WHAT IT REFUSES TO REST ON
|
|
57
|
+
*
|
|
58
|
+
* - `proof.reason` — agent prose.
|
|
59
|
+
* - `proof.confidence` — an agent's self-report.
|
|
60
|
+
* - the mere existence of a commit. `mayCommit` runs with `proofEnabled`
|
|
61
|
+
* taken from config, and the audit established it is commonly false, so a
|
|
62
|
+
* commit alone says only that something was written down.
|
|
63
|
+
* - evidence-cache freshness, for the reason above.
|
|
64
|
+
* - the plan's revision MARKER, which is a receipt that a plan happened and
|
|
65
|
+
* is not work. A revision that delivered nothing cannot meet a goal.
|
|
66
|
+
*
|
|
67
|
+
* PURE. No agent, no git, no queue write, no compiler. Everything it needs is
|
|
68
|
+
* an argument, which is what lets production and the tests run the same code
|
|
69
|
+
* rather than two descriptions of it.
|
|
70
|
+
*/
|
|
71
|
+
export interface GoalExecutionInput {
|
|
72
|
+
/**
|
|
73
|
+
* The goal, version AND revision being asked about.
|
|
74
|
+
*
|
|
75
|
+
* `planRevision` is required, not optional. Production once passed a scope
|
|
76
|
+
* whose revision had not been assigned yet, which made `classifyForScope`
|
|
77
|
+
* revision-blind and let revision 1's delivery answer for revision 2 — a
|
|
78
|
+
* defect no unit test could see, because the unit tests supplied a revision
|
|
79
|
+
* the composition root did not. Failing closed on a missing one is the fix
|
|
80
|
+
* that cannot be forgotten again.
|
|
81
|
+
*/
|
|
82
|
+
scope: RunScope;
|
|
83
|
+
items: readonly Item[];
|
|
84
|
+
rounds: readonly RoundRecord[];
|
|
85
|
+
currentHead: string;
|
|
86
|
+
/** Re-derived from the CURRENT config, via `requiredSteps(cfg.gates)`. */
|
|
87
|
+
requiredSteps: readonly string[];
|
|
88
|
+
/**
|
|
89
|
+
* Whether work a PERSON adopted into the goal may provide the delivery.
|
|
90
|
+
*
|
|
91
|
+
* Default true, and the reasoning is that `source` records where an item came
|
|
92
|
+
* from, not how much it is trusted: an item somebody adopted, which Looply
|
|
93
|
+
* then implemented, gated and committed, is delivered by exactly the same
|
|
94
|
+
* machinery as a compiled one. What is excluded either way is a commit
|
|
95
|
+
* Looply did not make — this only ever looks at rounds in its own ledger, so
|
|
96
|
+
* a person's own `git commit` can never qualify.
|
|
97
|
+
*/
|
|
98
|
+
countManualWork?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export type GoalExecutionOutcome = {
|
|
101
|
+
ok: true;
|
|
102
|
+
round: RoundRecord;
|
|
103
|
+
/**
|
|
104
|
+
* The items this plan actually delivered, and the gate steps the
|
|
105
|
+
* confirming round recorded.
|
|
106
|
+
*
|
|
107
|
+
* 🔴 REPORTED BY THE FUNCTION THAT ESTABLISHED KEY 2, not re-derived by
|
|
108
|
+
* the caller. Per-requirement coverage asks two further questions — was
|
|
109
|
+
* the item claiming a requirement in this delivery, and did the check it
|
|
110
|
+
* names pass at this tree — and both are things this function has
|
|
111
|
+
* already looked at. A second derivation elsewhere is a second answer
|
|
112
|
+
* that can disagree with the one the completion claim rests on.
|
|
113
|
+
*
|
|
114
|
+
* ⚠️ THE STEPS ARE THE CONFIRMING ROUND'S, which is the round whose
|
|
115
|
+
* commit IS the current HEAD. That is the tree being judged, so its own
|
|
116
|
+
* gate record is the only one that can speak for it.
|
|
117
|
+
*/
|
|
118
|
+
delivered: readonly string[];
|
|
119
|
+
} | {
|
|
120
|
+
ok: false;
|
|
121
|
+
because: string;
|
|
122
|
+
};
|
|
123
|
+
export declare function confirmGoalExecutionEvidence(input: GoalExecutionInput): GoalExecutionOutcome;
|
|
124
|
+
/** A committed round, as a goal-met Start locates it: its commit and the run that made it. */
|
|
125
|
+
export interface DeliveredTip {
|
|
126
|
+
readonly sha: string;
|
|
127
|
+
readonly runId: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The plan's NEWEST committed round — the delivered tree a goal-met Start judges while the
|
|
131
|
+
* lane has not moved it (F27). Null wherever KEY 2 would find nothing to confirm, and when
|
|
132
|
+
* the revision is unknown, for the reason KEY 2 fails closed on it.
|
|
133
|
+
*/
|
|
134
|
+
export declare function deliveredTipOf(input: Pick<GoalExecutionInput, 'scope' | 'items' | 'rounds' | 'countManualWork'>): DeliveredTip | null;
|
|
135
|
+
//# sourceMappingURL=goal-execution-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-execution-evidence.d.ts","sourceRoot":"","sources":["../src/goal-execution-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,oBAAoB,GAC5B;IACE,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE,WAAW,CAAC;IACnB;;;;;;;;;;;;;;OAcG;IACH,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,kBAAkB,GAAG,oBAAoB,CAuG5F;AA8CD,8FAA8F;AAC9F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,iBAAiB,CAAC,GAChF,YAAY,GAAG,IAAI,CAOrB"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.confirmGoalExecutionEvidence = confirmGoalExecutionEvidence;
|
|
4
|
+
exports.deliveredTipOf = deliveredTipOf;
|
|
5
|
+
const core_1 = require("@looply/core");
|
|
6
|
+
const goal_compile_1 = require("./goal-compile");
|
|
7
|
+
function confirmGoalExecutionEvidence(input) {
|
|
8
|
+
const { scope, currentHead } = input;
|
|
9
|
+
if (scope === null)
|
|
10
|
+
return { ok: false, because: 'this run is not bound to a goal' };
|
|
11
|
+
if (scope.planRevision === undefined) {
|
|
12
|
+
// Fails closed rather than defaulting. A caller that has not worked out
|
|
13
|
+
// which plan it is asking about is a caller whose answer would be about
|
|
14
|
+
// every plan the version ever had.
|
|
15
|
+
return { ok: false, because: 'the plan revision is unknown, so there is nothing definite to confirm' };
|
|
16
|
+
}
|
|
17
|
+
if (currentHead === '')
|
|
18
|
+
return { ok: false, because: 'the current commit could not be read' };
|
|
19
|
+
/**
|
|
20
|
+
* COMPLETION AUTHORITY IS STRICTER THAN COMMIT AUTHORITY.
|
|
21
|
+
*
|
|
22
|
+
* `mayCommit` with an empty `requiredSteps` only rejects a step that ran and
|
|
23
|
+
* FAILED. Executed, it returns ok for a round whose single gate step was
|
|
24
|
+
* skipped, and for a round with no steps at all. That is a defensible commit
|
|
25
|
+
* policy — a project may choose to gate nothing — but it means the gate half
|
|
26
|
+
* of this check degenerates to "nothing actively failed", i.e. "something
|
|
27
|
+
* committed at HEAD".
|
|
28
|
+
*
|
|
29
|
+
* Under one explicit Start a person reads the answer and judges it. Under an
|
|
30
|
+
* autonomous controller it is a FALSE TERMINATION: the machine would declare
|
|
31
|
+
* a goal met because a commit exists, and stop.
|
|
32
|
+
*
|
|
33
|
+
* So automatic satisfaction requires at least one required step to exist.
|
|
34
|
+
* This does not change `mayCommit` for anybody else; it says that finishing a
|
|
35
|
+
* goal by itself needs a standard, and a project with no required gate has
|
|
36
|
+
* not given the machine one.
|
|
37
|
+
*/
|
|
38
|
+
if (input.requiredSteps.length === 0) {
|
|
39
|
+
return {
|
|
40
|
+
ok: false,
|
|
41
|
+
because: 'no gate step is marked required, so nothing here can prove a goal is met — ' +
|
|
42
|
+
'mark at least one required step, or finish this goal yourself',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const plan = committedOfPlan(input, scope);
|
|
46
|
+
if (!plan.ok)
|
|
47
|
+
return plan;
|
|
48
|
+
const { committed, deliveredIds, mineById } = plan;
|
|
49
|
+
const atHead = committed.filter((r) => r.sha === currentHead);
|
|
50
|
+
if (atHead.length === 0) {
|
|
51
|
+
// Deliberately not "close enough". Something has moved the repository since
|
|
52
|
+
// this plan landed, and nothing here has checked that the goal survived it.
|
|
53
|
+
return {
|
|
54
|
+
ok: false,
|
|
55
|
+
because: 'the code has moved on since this plan was delivered, so what is here now was never checked',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// An EXISTS, not a FOR-ALL, and that is the whole reachability argument: a
|
|
59
|
+
// plan of five steps produces five commits and only the last is HEAD, so
|
|
60
|
+
// requiring all of them to be at HEAD would be the same unreachable demand
|
|
61
|
+
// the evidence-cache version made.
|
|
62
|
+
let lastReason = 'the gate that permitted this plan’s commit was never recorded';
|
|
63
|
+
for (const round of atHead) {
|
|
64
|
+
const item = mineById.get(round.itemId);
|
|
65
|
+
/**
|
|
66
|
+
* Belt and braces on the marker — STRUCTURALLY, by the id a receipt for
|
|
67
|
+
* these exact fields would have.
|
|
68
|
+
*
|
|
69
|
+
* This line first read `item.tag === 'goal'`, and that was a live defect of
|
|
70
|
+
* exactly the kind the whole repair exists to remove. `'goal'` is not a
|
|
71
|
+
* marker signature: it is the COMPILER'S DEFAULT TAG for any step the agent
|
|
72
|
+
* left untagged, which `normalizeStep` blesses as legitimate. So a
|
|
73
|
+
* genuinely delivered, gated, committed step whose tag the model happened
|
|
74
|
+
* to omit was skipped here, KEY 2 fell through to "the gate was never
|
|
75
|
+
* recorded" — about a gate that was in the ledger — and completion became
|
|
76
|
+
* unreachable again, for one line of redundant caution.
|
|
77
|
+
*
|
|
78
|
+
* A receipt cannot claim its exemption by holding a value; it can only be
|
|
79
|
+
* one by ALREADY having the id a receipt for its own fields would have.
|
|
80
|
+
*
|
|
81
|
+
* Deliberately NOT `goal-ownership`'s `isPlanReceipt`, which also requires
|
|
82
|
+
* `state === 'closed'`. That condition is right where it lives — it guards
|
|
83
|
+
* the rule that rows are born `draft`, and a receipt is the one exception —
|
|
84
|
+
* but it is exactly wrong here. The question here is whether a row may
|
|
85
|
+
* count as DELIVERY, and a receipt somehow carrying another state is more
|
|
86
|
+
* suspect than one behaving itself, not less. So the state is not part of
|
|
87
|
+
* the test: a row holding a marker's id is never delivery, whatever state
|
|
88
|
+
* it is in.
|
|
89
|
+
*/
|
|
90
|
+
if (item === undefined || (0, goal_compile_1.isPlanMarker)(item))
|
|
91
|
+
continue;
|
|
92
|
+
if (round.gate === undefined)
|
|
93
|
+
continue;
|
|
94
|
+
// The SAME authority that permitted the commit, asked again with the
|
|
95
|
+
// requirements in force now. `proofEnabled: false` on purpose: the proof
|
|
96
|
+
// key is a separate question with a separate answer, and this one is about
|
|
97
|
+
// gates. Reused rather than reimplemented so the two cannot disagree about
|
|
98
|
+
// what "every required step passed" means.
|
|
99
|
+
const permitted = (0, core_1.mayCommit)({
|
|
100
|
+
steps: round.gate.steps,
|
|
101
|
+
requiredSteps: input.requiredSteps,
|
|
102
|
+
proofEnabled: false,
|
|
103
|
+
});
|
|
104
|
+
if (permitted.ok)
|
|
105
|
+
return { ok: true, round, delivered: [...deliveredIds] };
|
|
106
|
+
lastReason = permitted.reason ?? 'the gate did not pass';
|
|
107
|
+
}
|
|
108
|
+
return { ok: false, because: lastReason };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The committed rounds of this plan's delivered work — KEY 2's own selection, shared so
|
|
112
|
+
* `deliveredTipOf` can never pick a round KEY 2 would not (F27).
|
|
113
|
+
*/
|
|
114
|
+
function committedOfPlan(input, scope) {
|
|
115
|
+
const countManual = input.countManualWork ?? true;
|
|
116
|
+
// The rows this revision may claim. `classifyForScope` is the one authority
|
|
117
|
+
// on that and is asked directly, rather than re-deriving its rules here.
|
|
118
|
+
const mine = input.items.filter((item) => {
|
|
119
|
+
const verdict = (0, core_1.classifyForScope)(item, scope);
|
|
120
|
+
if (verdict === 'current-plan')
|
|
121
|
+
return true;
|
|
122
|
+
return countManual && verdict === 'manual';
|
|
123
|
+
});
|
|
124
|
+
// Delivery means `done`. A marker is born `closed` and can never be `done`,
|
|
125
|
+
// so it is excluded by this alone — but it is the single most important thing
|
|
126
|
+
// this function must not accept, so it is also excluded by name in the caller.
|
|
127
|
+
const delivered = mine.filter((i) => i.state === 'done');
|
|
128
|
+
if (delivered.length === 0) {
|
|
129
|
+
return { ok: false, because: 'nothing in this plan was actually delivered' };
|
|
130
|
+
}
|
|
131
|
+
const deliveredIds = new Set(delivered.map((i) => i.id));
|
|
132
|
+
const mineById = new Map(mine.map((i) => [i.id, i]));
|
|
133
|
+
// Every round this plan's own delivered work produced.
|
|
134
|
+
const ours = input.rounds.filter((r) => deliveredIds.has(r.itemId));
|
|
135
|
+
if (ours.length === 0) {
|
|
136
|
+
return { ok: false, because: 'no round in this machine’s ledger delivered any of this plan' };
|
|
137
|
+
}
|
|
138
|
+
const committed = ours.filter((r) => r.outcome === 'committed');
|
|
139
|
+
if (committed.length === 0) {
|
|
140
|
+
return { ok: false, because: 'nothing in this plan reached a commit' };
|
|
141
|
+
}
|
|
142
|
+
return { ok: true, committed, deliveredIds, mineById };
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The plan's NEWEST committed round — the delivered tree a goal-met Start judges while the
|
|
146
|
+
* lane has not moved it (F27). Null wherever KEY 2 would find nothing to confirm, and when
|
|
147
|
+
* the revision is unknown, for the reason KEY 2 fails closed on it.
|
|
148
|
+
*/
|
|
149
|
+
function deliveredTipOf(input) {
|
|
150
|
+
const { scope } = input;
|
|
151
|
+
if (scope === null || scope.planRevision === undefined)
|
|
152
|
+
return null;
|
|
153
|
+
const plan = committedOfPlan(input, scope);
|
|
154
|
+
if (!plan.ok)
|
|
155
|
+
return null;
|
|
156
|
+
const newest = [...plan.committed].reverse().find((r) => r.sha !== undefined);
|
|
157
|
+
return newest?.sha === undefined ? null : { sha: newest.sha, runId: newest.runId };
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=goal-execution-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-execution-evidence.js","sourceRoot":"","sources":["../src/goal-execution-evidence.ts"],"names":[],"mappings":";;AA8HA,oEAuGC;AAyDD,wCASC;AAvSD,uCAAqF;AACrF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E,uCAAuC,EAAE,CAAC;IACzE,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AACzD,CAAC;AAQD;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,KAAiF;IAEjF,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;IAC9E,OAAO,MAAM,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { Evidence, Item } from '@looply/core';
|
|
2
|
+
import type { AgentInvoke } from './agent-exec';
|
|
3
|
+
/**
|
|
4
|
+
* WHAT IS STILL MISSING, if anything.
|
|
5
|
+
*
|
|
6
|
+
* A plan finishing is not a goal being met. The compiler is heuristic — it
|
|
7
|
+
* proposes six steps for a sentence a person wrote — and when all six land, the
|
|
8
|
+
* only thing that has been established is that six particular pieces of work
|
|
9
|
+
* were done. "Add secure password reset" can have every planned step delivered
|
|
10
|
+
* and still be missing expiry, or rate limiting, or the screen.
|
|
11
|
+
*
|
|
12
|
+
* So this asks. Once, bounded, at the one moment it can be answered usefully:
|
|
13
|
+
* the current plan is exhausted and nothing else can move.
|
|
14
|
+
*
|
|
15
|
+
* WHAT IT IS NOT. It is not a second key. `AgentInvoke` is the same
|
|
16
|
+
* write-capable machinery the compiler and the implementer use — there is no
|
|
17
|
+
* read-only mode in this system, and calling this an independent review would
|
|
18
|
+
* be a lie of exactly the kind `goal-compile.ts` warns about. A `satisfied`
|
|
19
|
+
* verdict from here is NECESSARY and never SUFFICIENT: the caller pairs it with
|
|
20
|
+
* machine-enforced evidence before believing it.
|
|
21
|
+
*
|
|
22
|
+
* WHAT IT MAY NOT DO. It describes a gap; it does not produce work. The
|
|
23
|
+
* compiler turns gaps into steps, and keeping those apart is what stops a
|
|
24
|
+
* reviewer that can also plan from becoming a second, hidden round runner. It
|
|
25
|
+
* therefore imports neither the compiler nor anything that touches the
|
|
26
|
+
* repository, and the architecture guard asserts both.
|
|
27
|
+
*/
|
|
28
|
+
/** One reasoning call about whether a goal is met. Shorter than the compiler's. */
|
|
29
|
+
export declare const GOAL_GAP_TIMEOUT_MS: number;
|
|
30
|
+
/**
|
|
31
|
+
* How many gaps one evaluation may name.
|
|
32
|
+
*
|
|
33
|
+
* The compiler that answers them is capped at ADAPTIVE_MAX_STEPS, so naming
|
|
34
|
+
* more would be naming work nothing will do. Bounded here as well because this
|
|
35
|
+
* is untrusted input and the list ends up in a prompt.
|
|
36
|
+
*/
|
|
37
|
+
export declare const MAX_GAPS = 6;
|
|
38
|
+
/** Longest a single gap description may be; the rest is trimmed, not refused. */
|
|
39
|
+
export declare const MAX_GAP_TEXT = 300;
|
|
40
|
+
/**
|
|
41
|
+
* One thing the goal still needs. DATA ONLY, deliberately.
|
|
42
|
+
*
|
|
43
|
+
* No command, no path to write, no item id, no goal version, no revision. A
|
|
44
|
+
* model that could name any of those could choose what executes, which is the
|
|
45
|
+
* authority this whole phase keeps in machine hands.
|
|
46
|
+
*/
|
|
47
|
+
export interface Gap {
|
|
48
|
+
/** Stable-ish handle for logs and prompts. Normalised from the description. */
|
|
49
|
+
key: string;
|
|
50
|
+
description: string;
|
|
51
|
+
}
|
|
52
|
+
export type GoalGapVerdict =
|
|
53
|
+
/** Nothing is missing, as far as reading the code can tell. Never believed alone. */
|
|
54
|
+
{
|
|
55
|
+
kind: 'satisfied';
|
|
56
|
+
summary?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Named, bounded things still to do. The compiler decides how. */
|
|
59
|
+
| {
|
|
60
|
+
kind: 'incomplete';
|
|
61
|
+
gaps: Gap[];
|
|
62
|
+
}
|
|
63
|
+
/** Cannot be decided by reading. A person has to say what they meant. */
|
|
64
|
+
| {
|
|
65
|
+
kind: 'human-required';
|
|
66
|
+
reason: string;
|
|
67
|
+
};
|
|
68
|
+
export type GoalGapOutcome = {
|
|
69
|
+
ok: true;
|
|
70
|
+
verdict: GoalGapVerdict;
|
|
71
|
+
transcript: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The evaluation did not happen. RETRYABLE, and deliberately distinct from
|
|
75
|
+
* every verdict: a timeout, a crashed agent or an unreadable answer must
|
|
76
|
+
* never be turned into `satisfied` (which would finish a goal that is not
|
|
77
|
+
* finished) or into `incomplete` (which would spend a plan revision on
|
|
78
|
+
* nothing). Both directions cost something real, so neither is guessed.
|
|
79
|
+
*/
|
|
80
|
+
| {
|
|
81
|
+
ok: false;
|
|
82
|
+
reason: string;
|
|
83
|
+
transcript: string;
|
|
84
|
+
};
|
|
85
|
+
export interface GoalGapInput {
|
|
86
|
+
goalId: string;
|
|
87
|
+
goalVersion: number;
|
|
88
|
+
goalText: string;
|
|
89
|
+
planRevision: number;
|
|
90
|
+
projectName: string;
|
|
91
|
+
/** The current plan's rows and how each ended. Titles and states, nothing more. */
|
|
92
|
+
planItems: readonly Pick<Item, 'title' | 'state' | 'attempts'>[];
|
|
93
|
+
/** Evidence the verifier recorded for this plan, at the HEAD it was recorded against. */
|
|
94
|
+
evidence?: readonly Evidence[];
|
|
95
|
+
/** The commit the answer is about. Carried back so staleness is detectable. */
|
|
96
|
+
headSha: string;
|
|
97
|
+
/**
|
|
98
|
+
* F37: in a programme, what the OTHER goals own (the packet's `ownedElsewhere`). MEASURED LIVE (LIVE-2,
|
|
99
|
+
* 2026-09-26): the dependency-intent goal ("R2 and R3 … may be implemented concurrently") compiled an empty
|
|
100
|
+
* plan — F19 told the COMPILER what others own — and then this check, told nothing, called R2's missing fee
|
|
101
|
+
* calculator a gap; the re-plan built it, and a second checkout implemented R2's capability for the wrong goal.
|
|
102
|
+
*/
|
|
103
|
+
ownedElsewhere?: readonly {
|
|
104
|
+
readonly goalId: string;
|
|
105
|
+
readonly key: string;
|
|
106
|
+
readonly text: string;
|
|
107
|
+
}[];
|
|
108
|
+
}
|
|
109
|
+
export interface GoalGapDeps {
|
|
110
|
+
invoke: AgentInvoke;
|
|
111
|
+
timeoutMs?: number;
|
|
112
|
+
maxGaps?: number;
|
|
113
|
+
}
|
|
114
|
+
export declare function gapKey(description: string): string;
|
|
115
|
+
export declare function buildGapPrompt(input: GoalGapInput): string;
|
|
116
|
+
/**
|
|
117
|
+
* Pull the verdict out of what the agent said.
|
|
118
|
+
*
|
|
119
|
+
* Scans from the END, like `extractPlan` and `extractFindings`, and for the
|
|
120
|
+
* same reason: an agent often echoes the example object from its own prompt
|
|
121
|
+
* before producing the real one, and taking the first match reads the example
|
|
122
|
+
* back as an answer. The whole transcript is tried first, because a
|
|
123
|
+
* pretty-printed object spans many lines.
|
|
124
|
+
*
|
|
125
|
+
* Unlike a plan, NOTHING here is dropped and carried on with. A plan is a list
|
|
126
|
+
* of proposals and a malformed one is simply fewer proposals; a verdict is a
|
|
127
|
+
* single decision, so a malformed one is no decision at all.
|
|
128
|
+
*/
|
|
129
|
+
export declare function extractVerdict(transcript: string, maxGaps: number): GoalGapVerdict | null;
|
|
130
|
+
/**
|
|
131
|
+
* Ask, once.
|
|
132
|
+
*
|
|
133
|
+
* Every failure direction returns `ok: false` rather than a verdict, because
|
|
134
|
+
* both verdicts cost something: `satisfied` ends a goal, `incomplete` spends
|
|
135
|
+
* one of a small number of plan revisions. A truncated run that exits zero is
|
|
136
|
+
* caught by the envelope, which is the only thing that can tell a finished
|
|
137
|
+
* answer from a stopped one.
|
|
138
|
+
*/
|
|
139
|
+
export declare function evaluateGoalGap(input: GoalGapInput, deps: GoalGapDeps): Promise<GoalGapOutcome>;
|
|
140
|
+
//# sourceMappingURL=goal-gap.d.ts.map
|