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,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectIndexStore = exports.MAX_SNAPSHOTS = void 0;
|
|
4
|
+
const core_1 = require("@looply/core");
|
|
5
|
+
/**
|
|
6
|
+
* How many snapshots to keep.
|
|
7
|
+
*
|
|
8
|
+
* Small on purpose: a snapshot is worth keeping only while somebody might
|
|
9
|
+
* still be on that revision, and a rebuild is cheap. The alternative — an
|
|
10
|
+
* unbounded directory of derived files — is the defect that arrives months
|
|
11
|
+
* later on somebody else's machine, which this codebase has already met once.
|
|
12
|
+
*/
|
|
13
|
+
exports.MAX_SNAPSHOTS = 4;
|
|
14
|
+
class ProjectIndexStore {
|
|
15
|
+
stateDir;
|
|
16
|
+
fs;
|
|
17
|
+
state = 'ok';
|
|
18
|
+
constructor(stateDir, fs) {
|
|
19
|
+
this.stateDir = stateDir;
|
|
20
|
+
this.fs = fs;
|
|
21
|
+
}
|
|
22
|
+
pathFor(treeSha) {
|
|
23
|
+
return `${this.stateDir}/project-index-${treeSha}.json`;
|
|
24
|
+
}
|
|
25
|
+
status() {
|
|
26
|
+
return this.state;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The snapshot for a tree, or null.
|
|
30
|
+
*
|
|
31
|
+
* 🔴 REFUSES A SNAPSHOT THAT DOES NOT DESCRIBE THE TREE ASKED FOR. The file
|
|
32
|
+
* name says which revision it is, and so does the content; if they disagree,
|
|
33
|
+
* something copied a file or a write was interrupted, and the honest answer
|
|
34
|
+
* is "I do not have one" rather than a plausible index of the wrong revision.
|
|
35
|
+
* A stale index is worse than no index, because a reader cannot tell.
|
|
36
|
+
*/
|
|
37
|
+
async load(treeSha,
|
|
38
|
+
/**
|
|
39
|
+
* 🔴 THE PACKAGE SET THE CALLER WILL BUILD WITH, AND WITHOUT IT THIS CACHE
|
|
40
|
+
* IS KEYED ON LESS THAN THE SNAPSHOT DEPENDS ON.
|
|
41
|
+
*
|
|
42
|
+
* Found by an adversarial review during Phase 13, and it is a fourth class
|
|
43
|
+
* of staleness none of the checks below can see. A snapshot is a function
|
|
44
|
+
* of (tree, packages) — `run-cmd.ts` builds it with
|
|
45
|
+
* `workspacePackages(config)`, derived from `config.scope.free`, which is
|
|
46
|
+
* read from a WORKING-TREE config file that no tree sha covers. That value
|
|
47
|
+
* reaches the snapshot twice: every file’s `packageName`, and the signed
|
|
48
|
+
* `packages` array.
|
|
49
|
+
*
|
|
50
|
+
* So a person adding a workspace to their config, without committing and
|
|
51
|
+
* without any code changing, got the previous package set back for ever
|
|
52
|
+
* under a matching key — and `factsFromIndex` then wrote "package X lives
|
|
53
|
+
* at Y" from it. No version bump is even conceptually available for that
|
|
54
|
+
* class: nothing about the CODE changed.
|
|
55
|
+
*
|
|
56
|
+
* ⚠️ OPTIONAL, SO EVERY EXISTING CALLER KEEPS WORKING — but a caller that
|
|
57
|
+
* omits it is asking to be handed a snapshot built under a package set
|
|
58
|
+
* nobody compared. The two production callers both pass it.
|
|
59
|
+
*/
|
|
60
|
+
expectedPackages) {
|
|
61
|
+
let text;
|
|
62
|
+
try {
|
|
63
|
+
text = await this.fs.readFile(this.pathFor(treeSha));
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
this.state = 'unreadable';
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (text === null)
|
|
70
|
+
return null;
|
|
71
|
+
let parsed;
|
|
72
|
+
try {
|
|
73
|
+
parsed = JSON.parse(text);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// A torn write. The repository can rebuild it; nothing is lost but time.
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
if (!isSnapshot(parsed))
|
|
80
|
+
return null;
|
|
81
|
+
if (parsed.schema !== core_1.PROJECT_INDEX_SCHEMA)
|
|
82
|
+
return null;
|
|
83
|
+
/**
|
|
84
|
+
* 🔴 AND THE EXTRACTOR VERSION, WHICH IS NOT THE SCHEMA. A snapshot written
|
|
85
|
+
* by older extraction code describes the repository the way that code used
|
|
86
|
+
* to — on the correct revision, in the correct shape, and wrongly. The tree
|
|
87
|
+
* sha cannot see it and neither can the schema, which changes only when the
|
|
88
|
+
* FILE SHAPE does.
|
|
89
|
+
*/
|
|
90
|
+
if (parsed.extractor !== core_1.INDEX_EXTRACTOR_VERSION)
|
|
91
|
+
return null;
|
|
92
|
+
// The content must agree with the name it was filed under.
|
|
93
|
+
if (parsed.treeSha !== treeSha)
|
|
94
|
+
return null;
|
|
95
|
+
/**
|
|
96
|
+
* And with the package set it would be rebuilt under. Compared as a sorted
|
|
97
|
+
* join rather than element-wise because both sides are already sorted by
|
|
98
|
+
* construction (`buildProjectIndex` sorts, and so does this) — so a
|
|
99
|
+
* disagreement here is a real difference in membership, never in order.
|
|
100
|
+
*/
|
|
101
|
+
if (expectedPackages !== undefined) {
|
|
102
|
+
const want = [...expectedPackages].sort().join(String.fromCharCode(0));
|
|
103
|
+
const have = [...parsed.packages].sort().join(String.fromCharCode(0));
|
|
104
|
+
if (want !== have)
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return parsed;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Write a snapshot for its own tree.
|
|
111
|
+
*
|
|
112
|
+
* Temp-then-rename, so a reader never sees half a file — the same contract
|
|
113
|
+
* every other durable write in this repository uses, and the reason `load`
|
|
114
|
+
* can treat unparseable JSON as merely absent rather than as corruption to
|
|
115
|
+
* reason about.
|
|
116
|
+
*/
|
|
117
|
+
async save(snapshot) {
|
|
118
|
+
await this.fs.mkdir(this.stateDir);
|
|
119
|
+
const target = this.pathFor(snapshot.treeSha);
|
|
120
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
121
|
+
await this.fs.writeFile(tmp, `${JSON.stringify(snapshot, null, 2)}\n`);
|
|
122
|
+
await this.fs.rename(tmp, target);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.ProjectIndexStore = ProjectIndexStore;
|
|
126
|
+
function isSnapshot(v) {
|
|
127
|
+
if (typeof v !== 'object' || v === null)
|
|
128
|
+
return false;
|
|
129
|
+
const o = v;
|
|
130
|
+
return (typeof o['schema'] === 'number' &&
|
|
131
|
+
// Absent on a snapshot written before the version existed, which is
|
|
132
|
+
// exactly the kind that must not be reused.
|
|
133
|
+
typeof o['extractor'] === 'number' &&
|
|
134
|
+
typeof o['treeSha'] === 'string' &&
|
|
135
|
+
Array.isArray(o['files']) &&
|
|
136
|
+
Array.isArray(o['symbols']) &&
|
|
137
|
+
Array.isArray(o['imports']) &&
|
|
138
|
+
Array.isArray(o['packages']));
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=project-index-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-index-store.js","sourceRoot":"","sources":["../src/project-index-store.ts"],"names":[],"mappings":";;;AAAA,uCAIsB;AAsCtB;;;;;;;GAOG;AACU,QAAA,aAAa,GAAG,CAAC,CAAC;AAE/B,MAAa,iBAAiB;IAIT;IACA;IAJX,KAAK,GAAoB,IAAI,CAAC;IAEtC,YACmB,QAAgB,EAChB,EAAgE;QADhE,aAAQ,GAAR,QAAQ,CAAQ;QAChB,OAAE,GAAF,EAAE,CAA8D;IAChF,CAAC;IAEI,OAAO,CAAC,OAAe;QAC7B,OAAO,GAAG,IAAI,CAAC,QAAQ,kBAAkB,OAAO,OAAO,CAAC;IAC1D,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CACR,OAAe;IACf;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,gBAAoC;QAEpC,IAAI,IAAmB,CAAC;QACxB,IAAI,CAAC;YACH,IAAI,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAE/B,IAAI,MAAe,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,yEAAy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I,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;CAgBF;AA3HD,8CA2HC;AAED,SAAS,UAAU,CAAC,CAAU;IAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,OAAO,CACL,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ;QAC/B,oEAAoE;QACpE,4CAA4C;QAC5C,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,QAAQ;QAClC,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type MemoryKind, type ProjectMemoryRecord } from '@looply/core';
|
|
2
|
+
import type { LedgerFs } from './ledger-store';
|
|
3
|
+
/**
|
|
4
|
+
* How many records of one kind, for one pursuit, the reader keeps.
|
|
5
|
+
*
|
|
6
|
+
* 🔴 PER BUCKET, NOT GLOBAL, AND PHASE 9 IS WHY. Its safety history used one
|
|
7
|
+
* global window across every goal on the machine, so a busy pursuit evicted a
|
|
8
|
+
* quiet one's history before it reached the threshold that would have stopped
|
|
9
|
+
* it — the brake switched itself off on the busiest machines, silently. A
|
|
10
|
+
* global bound here would do the same to memory: one active goal would erase
|
|
11
|
+
* another's decisions.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MAX_PER_BUCKET = 32;
|
|
14
|
+
/**
|
|
15
|
+
* Caps on the free-text fields.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately small. A `content` long enough to hold a stack trace is a
|
|
18
|
+
* `content` long enough to hold a secret, and the point of memory is a claim a
|
|
19
|
+
* person could have written on a card.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MAX_SUBJECT_CHARS = 200;
|
|
22
|
+
export declare const MAX_CONTENT_CHARS = 1000;
|
|
23
|
+
export declare const MAX_NOTE_CHARS = 200;
|
|
24
|
+
export declare const MAX_REFS = 16;
|
|
25
|
+
export type MemoryStoreState = 'ok' | 'unreadable';
|
|
26
|
+
export type RememberResult = {
|
|
27
|
+
readonly ok: true;
|
|
28
|
+
readonly record: ProjectMemoryRecord;
|
|
29
|
+
} | {
|
|
30
|
+
readonly ok: false;
|
|
31
|
+
readonly because: string;
|
|
32
|
+
};
|
|
33
|
+
/** What a caller supplies. `id` and `recordedAt` are the store's to mint. */
|
|
34
|
+
export type MemoryDraft = Omit<ProjectMemoryRecord, 'id' | 'recordedAt'> & {
|
|
35
|
+
/** Only meaningful on an attempt; see `semanticKey`. */
|
|
36
|
+
readonly distinct?: string;
|
|
37
|
+
};
|
|
38
|
+
export interface MemoryQuery {
|
|
39
|
+
readonly kind?: MemoryKind;
|
|
40
|
+
readonly goalId?: string;
|
|
41
|
+
readonly subject?: string;
|
|
42
|
+
readonly path?: string;
|
|
43
|
+
/** Hard ceiling on what comes back. Defaults to `MAX_PER_BUCKET`. */
|
|
44
|
+
readonly limit?: number;
|
|
45
|
+
}
|
|
46
|
+
/** A record as held in memory: what was written, plus its identity. */
|
|
47
|
+
type Held = ProjectMemoryRecord & {
|
|
48
|
+
readonly key: string;
|
|
49
|
+
};
|
|
50
|
+
export declare class ProjectMemoryStore {
|
|
51
|
+
private readonly stateDir;
|
|
52
|
+
/**
|
|
53
|
+
* 🔴 THE ISOLATION KEY, FIXED AT CONSTRUCTION. A record whose scope names a
|
|
54
|
+
* different project is not filtered out of a query — it is never loaded.
|
|
55
|
+
* Isolation that depends on every caller remembering to pass a filter is
|
|
56
|
+
* isolation that holds until the first caller forgets.
|
|
57
|
+
*/
|
|
58
|
+
private readonly projectKey;
|
|
59
|
+
private readonly fs;
|
|
60
|
+
private readonly now;
|
|
61
|
+
private records;
|
|
62
|
+
private state;
|
|
63
|
+
private opened;
|
|
64
|
+
private minted;
|
|
65
|
+
constructor(stateDir: string,
|
|
66
|
+
/**
|
|
67
|
+
* 🔴 THE ISOLATION KEY, FIXED AT CONSTRUCTION. A record whose scope names a
|
|
68
|
+
* different project is not filtered out of a query — it is never loaded.
|
|
69
|
+
* Isolation that depends on every caller remembering to pass a filter is
|
|
70
|
+
* isolation that holds until the first caller forgets.
|
|
71
|
+
*/
|
|
72
|
+
projectKey: string, fs: LedgerFs, now?: () => number);
|
|
73
|
+
private get path();
|
|
74
|
+
/** Read what is on disk. Never throws: an unreadable file is a state. */
|
|
75
|
+
open(): Promise<MemoryStoreState>;
|
|
76
|
+
/**
|
|
77
|
+
* Parse the ledger, skipping anything unreadable.
|
|
78
|
+
*
|
|
79
|
+
* ⚠️ A BAD LINE IS SKIPPED, NOT FATAL. A torn final line is what a crash
|
|
80
|
+
* leaves, and it costs one record. Refusing to read the whole file over it
|
|
81
|
+
* would discard every decision and every failed approach the project has
|
|
82
|
+
* accumulated — which is a far worse outcome than losing the last one.
|
|
83
|
+
*
|
|
84
|
+
* A line whose `schema` is unknown is skipped for a different reason: this
|
|
85
|
+
* repository's convention is that a reader REFUSES TO GUESS rather than
|
|
86
|
+
* silently misreading a shape it does not know.
|
|
87
|
+
*/
|
|
88
|
+
private parse;
|
|
89
|
+
status(): MemoryStoreState;
|
|
90
|
+
/**
|
|
91
|
+
* Write something down, if its author is entitled to assert it.
|
|
92
|
+
*
|
|
93
|
+
* `writtenByModel` is supplied by the RUNTIME, never by the record. See
|
|
94
|
+
* `admitMemory` for why that separation is the whole fence.
|
|
95
|
+
*/
|
|
96
|
+
remember(draft: MemoryDraft, writtenByModel: boolean): Promise<RememberResult>;
|
|
97
|
+
/** Trim the free-text fields to their caps. See the header on why. */
|
|
98
|
+
private bound;
|
|
99
|
+
/** Every record ever written for this project, newest last. History, not truth. */
|
|
100
|
+
history(): readonly Held[];
|
|
101
|
+
/** The ids a later record has explicitly replaced. */
|
|
102
|
+
private supersededIds;
|
|
103
|
+
/**
|
|
104
|
+
* What memory says about the present.
|
|
105
|
+
*
|
|
106
|
+
* 🔴 BOUNDED PER BUCKET AND CURRENCY-FILTERED. A caller asking "what do you
|
|
107
|
+
* know" must not receive the project's entire history: an unbounded answer is
|
|
108
|
+
* one nobody reads and a context nobody can budget.
|
|
109
|
+
*/
|
|
110
|
+
current(currentTreeSha: string | null, query?: MemoryQuery): readonly Held[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The per-working-copy isolation key.
|
|
114
|
+
*
|
|
115
|
+
* 🔴 NOT THE SERVER'S `projectId`. An unpaired machine stamps events
|
|
116
|
+
* `projectId: 'local'` — a shared literal — so two unrelated repositories on one
|
|
117
|
+
* machine would collide under it. This is derived from the absolute path of the
|
|
118
|
+
* working copy, which is always available, needs no pairing, and differs
|
|
119
|
+
* between any two checkouts.
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ IT FAILS CLOSED ON A MOVE. Relocating a repository changes its key, so its
|
|
122
|
+
* memory stops being found. That is the safe direction: the alternative is
|
|
123
|
+
* memory being adopted by whatever now occupies the old path.
|
|
124
|
+
*/
|
|
125
|
+
export declare function projectKeyFor(absoluteRepoPath: string, sha256: (s: string) => string): string;
|
|
126
|
+
export {};
|
|
127
|
+
//# sourceMappingURL=project-memory-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-memory-store.d.ts","sourceRoot":"","sources":["../src/project-memory-store.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA6C/C;;;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AAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAftB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAK;gBAGA,QAAQ,EAAE,MAAM;IACjC;;;;;OAKG;IACc,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,QAAQ,EACZ,GAAG,GAAE,MAAM,MAAyB;IAGvD,OAAO,KAAK,IAAI,GAEf;IAED,yEAAyE;IACnE,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAcvC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,KAAK;IAmBb,MAAM,IAAI,gBAAgB;IAI1B;;;;;OAKG;IACG,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IA2CpF,sEAAsE;IACtE,OAAO,CAAC,KAAK;IAab,mFAAmF;IACnF,OAAO,IAAI,SAAS,IAAI,EAAE;IAI1B,sDAAsD;IACtD,OAAO,CAAC,aAAa;IAMrB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,GAAE,WAAgB,GAAG,SAAS,IAAI,EAAE;CAiCjF;AAsBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAO7F"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectMemoryStore = exports.MAX_REFS = exports.MAX_NOTE_CHARS = exports.MAX_CONTENT_CHARS = exports.MAX_SUBJECT_CHARS = exports.MAX_PER_BUCKET = void 0;
|
|
4
|
+
exports.projectKeyFor = projectKeyFor;
|
|
5
|
+
const trusted_git_1 = require("./trusted-git");
|
|
6
|
+
const core_1 = require("@looply/core");
|
|
7
|
+
/**
|
|
8
|
+
* DURABLE PROJECT MEMORY — `.looply/state/project-memory.jsonl`.
|
|
9
|
+
*
|
|
10
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
* APPEND-ONLY, AND NOT BY PREFERENCE
|
|
12
|
+
*
|
|
13
|
+
* Two runs can learn the same thing at once, and a daemon can be writing while
|
|
14
|
+
* a run is. The repository has exactly two durable-write idioms — append-only
|
|
15
|
+
* JSONL with a rebuilt projection, and create-once `O_EXCL` one file per fact —
|
|
16
|
+
* and a third was invented once, in Phase 9: a whole-document rewrite, which
|
|
17
|
+
* lost a concurrent writer's record and had to be replaced by this same shape.
|
|
18
|
+
* That lesson is two weeks old. This starts where it ended.
|
|
19
|
+
*
|
|
20
|
+
* The file is NEVER rewritten. Not trimmed, not compacted, not rotated. A
|
|
21
|
+
* compaction is a rewrite and a rewrite is the bug, so the bound lives on what
|
|
22
|
+
* is READ rather than on what is kept — see `MAX_PER_BUCKET`.
|
|
23
|
+
*
|
|
24
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
25
|
+
* 🔴 EVERY RECORD IS LED BY A NEWLINE
|
|
26
|
+
*
|
|
27
|
+
* A crash part-way through an append leaves a fragment with no trailing
|
|
28
|
+
* newline. If the next record were merely terminated by one it would
|
|
29
|
+
* concatenate onto that fragment and BOTH would be unreadable — one torn write
|
|
30
|
+
* costing two records. Leading each record means a fragment always ends up
|
|
31
|
+
* alone on its line and is skipped by itself. The blank line this leaves in the
|
|
32
|
+
* ordinary case is skipped by the same rule, and it needs no read-before-append,
|
|
33
|
+
* so it stays correct against a concurrent writer.
|
|
34
|
+
*
|
|
35
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
36
|
+
* WHAT CANNOT REACH THIS FILE
|
|
37
|
+
*
|
|
38
|
+
* There is no general redaction utility in this repository, and that is
|
|
39
|
+
* deliberate: the house policy is structural exclusion, because a blocklist
|
|
40
|
+
* fails open the day somebody adds a field it does not know. So this store has
|
|
41
|
+
* NO ACCESS PATH to command output, prompts, environments or logs — it accepts
|
|
42
|
+
* a subject, a claim, and identifiers. The length caps below are not tidiness;
|
|
43
|
+
* they are what stops a caller pasting a log into `content` and calling it a
|
|
44
|
+
* memory.
|
|
45
|
+
*/
|
|
46
|
+
/** The one file. Never rewritten — see the header. */
|
|
47
|
+
const MEMORY_FILE = 'project-memory.jsonl';
|
|
48
|
+
/**
|
|
49
|
+
* How many records of one kind, for one pursuit, the reader keeps.
|
|
50
|
+
*
|
|
51
|
+
* 🔴 PER BUCKET, NOT GLOBAL, AND PHASE 9 IS WHY. Its safety history used one
|
|
52
|
+
* global window across every goal on the machine, so a busy pursuit evicted a
|
|
53
|
+
* quiet one's history before it reached the threshold that would have stopped
|
|
54
|
+
* it — the brake switched itself off on the busiest machines, silently. A
|
|
55
|
+
* global bound here would do the same to memory: one active goal would erase
|
|
56
|
+
* another's decisions.
|
|
57
|
+
*/
|
|
58
|
+
exports.MAX_PER_BUCKET = 32;
|
|
59
|
+
/**
|
|
60
|
+
* Caps on the free-text fields.
|
|
61
|
+
*
|
|
62
|
+
* Deliberately small. A `content` long enough to hold a stack trace is a
|
|
63
|
+
* `content` long enough to hold a secret, and the point of memory is a claim a
|
|
64
|
+
* person could have written on a card.
|
|
65
|
+
*/
|
|
66
|
+
exports.MAX_SUBJECT_CHARS = 200;
|
|
67
|
+
exports.MAX_CONTENT_CHARS = 1000;
|
|
68
|
+
exports.MAX_NOTE_CHARS = 200;
|
|
69
|
+
exports.MAX_REFS = 16;
|
|
70
|
+
class ProjectMemoryStore {
|
|
71
|
+
stateDir;
|
|
72
|
+
projectKey;
|
|
73
|
+
fs;
|
|
74
|
+
now;
|
|
75
|
+
records = [];
|
|
76
|
+
state = 'ok';
|
|
77
|
+
opened = false;
|
|
78
|
+
minted = 0;
|
|
79
|
+
constructor(stateDir,
|
|
80
|
+
/**
|
|
81
|
+
* 🔴 THE ISOLATION KEY, FIXED AT CONSTRUCTION. A record whose scope names a
|
|
82
|
+
* different project is not filtered out of a query — it is never loaded.
|
|
83
|
+
* Isolation that depends on every caller remembering to pass a filter is
|
|
84
|
+
* isolation that holds until the first caller forgets.
|
|
85
|
+
*/
|
|
86
|
+
projectKey, fs, now = () => Date.now()) {
|
|
87
|
+
this.stateDir = stateDir;
|
|
88
|
+
this.projectKey = projectKey;
|
|
89
|
+
this.fs = fs;
|
|
90
|
+
this.now = now;
|
|
91
|
+
}
|
|
92
|
+
get path() {
|
|
93
|
+
return `${this.stateDir}/${MEMORY_FILE}`;
|
|
94
|
+
}
|
|
95
|
+
/** Read what is on disk. Never throws: an unreadable file is a state. */
|
|
96
|
+
async open() {
|
|
97
|
+
this.opened = true;
|
|
98
|
+
let text;
|
|
99
|
+
try {
|
|
100
|
+
text = await this.fs.readFile(this.path);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
this.state = 'unreadable';
|
|
104
|
+
return this.state;
|
|
105
|
+
}
|
|
106
|
+
this.records = text === null ? [] : this.parse(text);
|
|
107
|
+
this.state = 'ok';
|
|
108
|
+
return this.state;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Parse the ledger, skipping anything unreadable.
|
|
112
|
+
*
|
|
113
|
+
* ⚠️ A BAD LINE IS SKIPPED, NOT FATAL. A torn final line is what a crash
|
|
114
|
+
* leaves, and it costs one record. Refusing to read the whole file over it
|
|
115
|
+
* would discard every decision and every failed approach the project has
|
|
116
|
+
* accumulated — which is a far worse outcome than losing the last one.
|
|
117
|
+
*
|
|
118
|
+
* A line whose `schema` is unknown is skipped for a different reason: this
|
|
119
|
+
* repository's convention is that a reader REFUSES TO GUESS rather than
|
|
120
|
+
* silently misreading a shape it does not know.
|
|
121
|
+
*/
|
|
122
|
+
parse(text) {
|
|
123
|
+
const out = [];
|
|
124
|
+
for (const line of text.split('\n')) {
|
|
125
|
+
if (line.trim() === '')
|
|
126
|
+
continue;
|
|
127
|
+
let parsed;
|
|
128
|
+
try {
|
|
129
|
+
parsed = JSON.parse(line);
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (!isStoredLine(parsed))
|
|
135
|
+
continue;
|
|
136
|
+
if (parsed.schema !== core_1.PROJECT_MEMORY_SCHEMA)
|
|
137
|
+
continue;
|
|
138
|
+
// Never loaded, not merely filtered. See the constructor.
|
|
139
|
+
if (parsed.scope.projectKey !== this.projectKey)
|
|
140
|
+
continue;
|
|
141
|
+
out.push(parsed);
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
status() {
|
|
146
|
+
return this.state;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Write something down, if its author is entitled to assert it.
|
|
150
|
+
*
|
|
151
|
+
* `writtenByModel` is supplied by the RUNTIME, never by the record. See
|
|
152
|
+
* `admitMemory` for why that separation is the whole fence.
|
|
153
|
+
*/
|
|
154
|
+
async remember(draft, writtenByModel) {
|
|
155
|
+
if (!this.opened)
|
|
156
|
+
throw new Error('ProjectMemoryStore.remember before open()');
|
|
157
|
+
if (this.state === 'unreadable') {
|
|
158
|
+
// Appending to a file we could not read would be writing into the dark:
|
|
159
|
+
// the duplicate check below is derived from what was loaded, so every
|
|
160
|
+
// repeat observation would land again and grow the file without bound.
|
|
161
|
+
return { ok: false, because: 'the memory ledger could not be read' };
|
|
162
|
+
}
|
|
163
|
+
if (draft.scope.projectKey !== this.projectKey) {
|
|
164
|
+
return { ok: false, because: 'that memory belongs to another project' };
|
|
165
|
+
}
|
|
166
|
+
const bounded = this.bound(draft);
|
|
167
|
+
const admission = (0, core_1.admitMemory)(bounded, writtenByModel);
|
|
168
|
+
if (!admission.ok)
|
|
169
|
+
return { ok: false, because: admission.because };
|
|
170
|
+
/**
|
|
171
|
+
* The same claim observed again is ONE memory. A newer observation of an
|
|
172
|
+
* unchanged claim still gets appended — the revision it was seen at is what
|
|
173
|
+
* makes it useful — but only when something a reader would act on differs,
|
|
174
|
+
* so a run that re-observes an unchanged world adds nothing.
|
|
175
|
+
*/
|
|
176
|
+
const key = (0, core_1.semanticKey)(bounded);
|
|
177
|
+
const existing = this.records.find((r) => r.key === key);
|
|
178
|
+
if (existing !== undefined && existing.revision?.treeSha === draft.revision?.treeSha) {
|
|
179
|
+
return { ok: true, record: existing };
|
|
180
|
+
}
|
|
181
|
+
this.minted += 1;
|
|
182
|
+
const record = {
|
|
183
|
+
...bounded,
|
|
184
|
+
id: `mem_${this.now().toString(36)}_${this.minted.toString(36)}`,
|
|
185
|
+
recordedAt: new Date(this.now()).toISOString(),
|
|
186
|
+
};
|
|
187
|
+
await this.fs.mkdir(this.stateDir);
|
|
188
|
+
await this.fs.appendFile(this.path, `\n${JSON.stringify({ schema: core_1.PROJECT_MEMORY_SCHEMA, key, ...record })}\n`);
|
|
189
|
+
this.records.push({ ...record, key });
|
|
190
|
+
return { ok: true, record };
|
|
191
|
+
}
|
|
192
|
+
/** Trim the free-text fields to their caps. See the header on why. */
|
|
193
|
+
bound(d) {
|
|
194
|
+
return {
|
|
195
|
+
...d,
|
|
196
|
+
subject: d.subject.slice(0, exports.MAX_SUBJECT_CHARS),
|
|
197
|
+
content: d.content.slice(0, exports.MAX_CONTENT_CHARS),
|
|
198
|
+
provenance: {
|
|
199
|
+
...d.provenance,
|
|
200
|
+
refs: d.provenance.refs.slice(0, exports.MAX_REFS),
|
|
201
|
+
...(d.provenance.note === undefined ? {} : { note: d.provenance.note.slice(0, exports.MAX_NOTE_CHARS) }),
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/** Every record ever written for this project, newest last. History, not truth. */
|
|
206
|
+
history() {
|
|
207
|
+
return this.records;
|
|
208
|
+
}
|
|
209
|
+
/** The ids a later record has explicitly replaced. */
|
|
210
|
+
supersededIds() {
|
|
211
|
+
const out = new Set();
|
|
212
|
+
for (const r of this.records)
|
|
213
|
+
if (r.supersedes !== undefined)
|
|
214
|
+
out.add(r.supersedes);
|
|
215
|
+
return out;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* What memory says about the present.
|
|
219
|
+
*
|
|
220
|
+
* 🔴 BOUNDED PER BUCKET AND CURRENCY-FILTERED. A caller asking "what do you
|
|
221
|
+
* know" must not receive the project's entire history: an unbounded answer is
|
|
222
|
+
* one nobody reads and a context nobody can budget.
|
|
223
|
+
*/
|
|
224
|
+
current(currentTreeSha, query = {}) {
|
|
225
|
+
const superseded = this.supersededIds();
|
|
226
|
+
const limit = Math.max(0, Math.min(query.limit ?? exports.MAX_PER_BUCKET, exports.MAX_PER_BUCKET));
|
|
227
|
+
const matching = this.records.filter((r) => {
|
|
228
|
+
// A withdrawal exists only to retire another record. It is never
|
|
229
|
+
// itself shown — it is not a claim, it is the act of dropping one.
|
|
230
|
+
if (r.withdrawn === true)
|
|
231
|
+
return false;
|
|
232
|
+
if (!(0, core_1.currencyOf)(r, { currentTreeSha, supersededIds: superseded }).current)
|
|
233
|
+
return false;
|
|
234
|
+
if (query.kind !== undefined && r.kind !== query.kind)
|
|
235
|
+
return false;
|
|
236
|
+
if (query.goalId !== undefined && r.scope.goalId !== query.goalId)
|
|
237
|
+
return false;
|
|
238
|
+
if (query.subject !== undefined && r.subject !== query.subject)
|
|
239
|
+
return false;
|
|
240
|
+
if (query.path !== undefined && r.scope.path !== query.path)
|
|
241
|
+
return false;
|
|
242
|
+
return true;
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Newest wins for one semantic claim: a fact re-observed at a newer tree
|
|
246
|
+
* supersedes its own older observation without anybody writing a
|
|
247
|
+
* supersession, which is what stops a stale duplicate outliving its update.
|
|
248
|
+
*/
|
|
249
|
+
// Newest wins for one semantic claim: a fact re-observed at a newer tree
|
|
250
|
+
// supersedes its own older observation without anybody writing a
|
|
251
|
+
// supersession, which stops a stale duplicate outliving its update.
|
|
252
|
+
//
|
|
253
|
+
// The key is the one stored at WRITE time, so two attempts differing only
|
|
254
|
+
// by the run they happened in stay two — see `StoredLine.key`.
|
|
255
|
+
const newestByClaim = new Map();
|
|
256
|
+
for (const r of matching)
|
|
257
|
+
newestByClaim.set(r.key, r);
|
|
258
|
+
const collapsed = [...newestByClaim.values()];
|
|
259
|
+
return collapsed.slice(Math.max(0, collapsed.length - limit));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
exports.ProjectMemoryStore = ProjectMemoryStore;
|
|
263
|
+
function isStoredLine(v) {
|
|
264
|
+
if (typeof v !== 'object' || v === null)
|
|
265
|
+
return false;
|
|
266
|
+
const o = v;
|
|
267
|
+
const scope = o['scope'];
|
|
268
|
+
return (typeof o['schema'] === 'number' &&
|
|
269
|
+
typeof o['id'] === 'string' &&
|
|
270
|
+
typeof o['kind'] === 'string' &&
|
|
271
|
+
typeof o['source'] === 'string' &&
|
|
272
|
+
typeof o['subject'] === 'string' &&
|
|
273
|
+
typeof o['content'] === 'string' &&
|
|
274
|
+
typeof o['recordedAt'] === 'string' &&
|
|
275
|
+
typeof o['provenance'] === 'object' &&
|
|
276
|
+
o['provenance'] !== null &&
|
|
277
|
+
typeof scope === 'object' &&
|
|
278
|
+
scope !== null &&
|
|
279
|
+
typeof scope['projectKey'] === 'string');
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* The per-working-copy isolation key.
|
|
283
|
+
*
|
|
284
|
+
* 🔴 NOT THE SERVER'S `projectId`. An unpaired machine stamps events
|
|
285
|
+
* `projectId: 'local'` — a shared literal — so two unrelated repositories on one
|
|
286
|
+
* machine would collide under it. This is derived from the absolute path of the
|
|
287
|
+
* working copy, which is always available, needs no pairing, and differs
|
|
288
|
+
* between any two checkouts.
|
|
289
|
+
*
|
|
290
|
+
* ⚠️ IT FAILS CLOSED ON A MOVE. Relocating a repository changes its key, so its
|
|
291
|
+
* memory stops being found. That is the safe direction: the alternative is
|
|
292
|
+
* memory being adopted by whatever now occupies the old path.
|
|
293
|
+
*/
|
|
294
|
+
function projectKeyFor(absoluteRepoPath, sha256) {
|
|
295
|
+
// 🔴 THE REPOSITORY, NOT THE DIRECTORY — same reason as `repoPathHash`. A run
|
|
296
|
+
// in a linked worktree was reading an EMPTY project memory and writing its
|
|
297
|
+
// own, so everything the project had learned stopped being carried in.
|
|
298
|
+
// Unchanged for an ordinary checkout, which resolves to itself.
|
|
299
|
+
const path = (0, trusted_git_1.repoIdentityPath)(absoluteRepoPath);
|
|
300
|
+
return `pk_${sha256(path.replace(/\\/g, '/').toLowerCase()).slice(0, 32)}`;
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=project-memory-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-memory-store.js","sourceRoot":"","sources":["../src/project-memory-store.ts"],"names":[],"mappings":";;;AAmVA,sCAOC;AA1VD,+CAAiD;AACjD,uCAQsB;AAGtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,sDAAsD;AACtD,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAE3C;;;;;;;;;GASG;AACU,QAAA,cAAc,GAAG,EAAE,CAAC;AAEjC;;;;;;GAMG;AACU,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACxB,QAAA,iBAAiB,GAAG,IAAI,CAAC;AACzB,QAAA,cAAc,GAAG,GAAG,CAAC;AACrB,QAAA,QAAQ,GAAG,EAAE,CAAC;AAuC3B,MAAa,kBAAkB;IAOV;IAOA;IACA;IACA;IAfX,OAAO,GAAW,EAAE,CAAC;IACrB,KAAK,GAAqB,IAAI,CAAC;IAC/B,MAAM,GAAG,KAAK,CAAC;IACf,MAAM,GAAG,CAAC,CAAC;IAEnB,YACmB,QAAgB;IACjC;;;;;OAKG;IACc,UAAkB,EAClB,EAAY,EACZ,MAAoB,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QATpC,aAAQ,GAAR,QAAQ,CAAQ;QAOhB,eAAU,GAAV,UAAU,CAAQ;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OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ;QAC/B,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,QAAQ;QAC3B,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,QAAQ;QAC7B,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ;QAC/B,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ;QAChC,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ;QAChC,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,QAAQ;QACnC,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,QAAQ;QACnC,CAAC,CAAC,YAAY,CAAC,KAAK,IAAI;QACxB,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAAiC,CAAC,YAAY,CAAC,KAAK,QAAQ,CACrE,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,aAAa,CAAC,gBAAwB,EAAE,MAA6B;IACnF,8EAA8E;IAC9E,2EAA2E;IAC3E,uEAAuE;IACvE,gEAAgE;IAChE,MAAM,IAAI,GAAG,IAAA,8BAAgB,EAAC,gBAAgB,CAAC,CAAC;IAChD,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ProposalRecord } from '@looply/core';
|
|
2
|
+
import type { LedgerFs } from './ledger-store';
|
|
3
|
+
import { AppendOnlyStore } from './record-store';
|
|
4
|
+
/**
|
|
5
|
+
* THE PROPOSAL RECORDS ON DISK — `.looply/state/proposals.jsonl`.
|
|
6
|
+
*
|
|
7
|
+
* Append-only (see `record-store.ts`), keyed by the record id — the QUESTION
|
|
8
|
+
* (goal, version, tree, prompt digest) — so the same question asked again is
|
|
9
|
+
* answered from here and the transport is not called twice for it.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ProposalStore extends AppendOnlyStore<ProposalRecord> {
|
|
12
|
+
constructor(stateDir: string, fs: LedgerFs);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=proposal-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposal-store.d.ts","sourceRoot":"","sources":["../src/proposal-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,eAAe,CAAC,cAAc,CAAC;gBACpD,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ;CAG3C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProposalStore = void 0;
|
|
4
|
+
const core_1 = require("@looply/core");
|
|
5
|
+
const record_store_1 = require("./record-store");
|
|
6
|
+
/**
|
|
7
|
+
* THE PROPOSAL RECORDS ON DISK — `.looply/state/proposals.jsonl`.
|
|
8
|
+
*
|
|
9
|
+
* Append-only (see `record-store.ts`), keyed by the record id — the QUESTION
|
|
10
|
+
* (goal, version, tree, prompt digest) — so the same question asked again is
|
|
11
|
+
* answered from here and the transport is not called twice for it.
|
|
12
|
+
*/
|
|
13
|
+
class ProposalStore extends record_store_1.AppendOnlyStore {
|
|
14
|
+
constructor(stateDir, fs) {
|
|
15
|
+
super(stateDir, 'proposals.jsonl', core_1.isProposalRecord, fs);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ProposalStore = ProposalStore;
|
|
19
|
+
//# sourceMappingURL=proposal-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposal-store.js","sourceRoot":"","sources":["../src/proposal-store.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AAErE,iDAAiD;AAEjD;;;;;;GAMG;AACH,MAAa,aAAc,SAAQ,8BAA+B;IAChE,YAAY,QAAgB,EAAE,EAAY;QACxC,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,uBAAgB,EAAE,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF;AAJD,sCAIC"}
|