looply-cli 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +137 -3
- package/dist/.src-hash +1 -0
- package/dist/acceptance-observe.d.ts +108 -0
- package/dist/acceptance-observe.d.ts.map +1 -0
- package/dist/acceptance-observe.js +152 -0
- package/dist/acceptance-observe.js.map +1 -0
- package/dist/agent-cmd.d.ts +131 -0
- package/dist/agent-cmd.d.ts.map +1 -0
- package/dist/agent-cmd.js +154 -0
- package/dist/agent-cmd.js.map +1 -0
- package/dist/agent-contained.d.ts +114 -0
- package/dist/agent-contained.d.ts.map +1 -0
- package/dist/agent-contained.js +292 -0
- package/dist/agent-contained.js.map +1 -0
- package/dist/agent-driver.d.ts +130 -0
- package/dist/agent-driver.d.ts.map +1 -0
- package/dist/agent-driver.js +170 -0
- package/dist/agent-driver.js.map +1 -0
- package/dist/agent-envelope.d.ts +94 -0
- package/dist/agent-envelope.d.ts.map +1 -0
- package/dist/agent-envelope.js +214 -0
- package/dist/agent-envelope.js.map +1 -0
- package/dist/agent-exec.d.ts +182 -0
- package/dist/agent-exec.d.ts.map +1 -0
- package/dist/agent-exec.js +125 -0
- package/dist/agent-exec.js.map +1 -0
- package/dist/agent-runtime.d.ts +23 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/agent-runtime.js +143 -0
- package/dist/agent-runtime.js.map +1 -0
- package/dist/approval-gate-read.d.ts +66 -0
- package/dist/approval-gate-read.d.ts.map +1 -0
- package/dist/approval-gate-read.js +138 -0
- package/dist/approval-gate-read.js.map +1 -0
- package/dist/approval-resolution.d.ts +87 -0
- package/dist/approval-resolution.d.ts.map +1 -0
- package/dist/approval-resolution.js +100 -0
- package/dist/approval-resolution.js.map +1 -0
- package/dist/approval-resumes.d.ts +102 -0
- package/dist/approval-resumes.d.ts.map +1 -0
- package/dist/approval-resumes.js +167 -0
- package/dist/approval-resumes.js.map +1 -0
- package/dist/ask-brain.d.ts +167 -0
- package/dist/ask-brain.d.ts.map +1 -0
- package/dist/ask-brain.js +355 -0
- package/dist/ask-brain.js.map +1 -0
- package/dist/autonomy-authority.d.ts +80 -0
- package/dist/autonomy-authority.d.ts.map +1 -0
- package/dist/autonomy-authority.js +82 -0
- package/dist/autonomy-authority.js.map +1 -0
- package/dist/autonomy-controller.d.ts +321 -0
- package/dist/autonomy-controller.d.ts.map +1 -0
- package/dist/autonomy-controller.js +517 -0
- package/dist/autonomy-controller.js.map +1 -0
- package/dist/autonomy-store.d.ts +327 -0
- package/dist/autonomy-store.d.ts.map +1 -0
- package/dist/autonomy-store.js +581 -0
- package/dist/autonomy-store.js.map +1 -0
- package/dist/autonomy-tick.d.ts +257 -0
- package/dist/autonomy-tick.d.ts.map +1 -0
- package/dist/autonomy-tick.js +616 -0
- package/dist/autonomy-tick.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +2727 -0
- package/dist/bin.js.map +1 -0
- package/dist/brain-advice.d.ts +21 -0
- package/dist/brain-advice.d.ts.map +1 -0
- package/dist/brain-advice.js +51 -0
- package/dist/brain-advice.js.map +1 -0
- package/dist/candidate-replay-runtime.d.ts +125 -0
- package/dist/candidate-replay-runtime.d.ts.map +1 -0
- package/dist/candidate-replay-runtime.js +188 -0
- package/dist/candidate-replay-runtime.js.map +1 -0
- package/dist/checkout-carry.d.ts +76 -0
- package/dist/checkout-carry.d.ts.map +1 -0
- package/dist/checkout-carry.js +125 -0
- package/dist/checkout-carry.js.map +1 -0
- package/dist/citation-readers.d.ts +26 -0
- package/dist/citation-readers.d.ts.map +1 -0
- package/dist/citation-readers.js +102 -0
- package/dist/citation-readers.js.map +1 -0
- package/dist/command-receipts.d.ts +79 -0
- package/dist/command-receipts.d.ts.map +1 -0
- package/dist/command-receipts.js +143 -0
- package/dist/command-receipts.js.map +1 -0
- package/dist/command-runner.d.ts +32 -0
- package/dist/command-runner.d.ts.map +1 -0
- package/dist/command-runner.js +108 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/compatible-sets.d.ts +67 -0
- package/dist/compatible-sets.d.ts.map +1 -0
- package/dist/compatible-sets.js +81 -0
- package/dist/compatible-sets.js.map +1 -0
- package/dist/compile-check.d.ts +31 -0
- package/dist/compile-check.d.ts.map +1 -0
- package/dist/compile-check.js +34 -0
- package/dist/compile-check.js.map +1 -0
- package/dist/compile-store.d.ts +16 -0
- package/dist/compile-store.d.ts.map +1 -0
- package/dist/compile-store.js +21 -0
- package/dist/compile-store.js.map +1 -0
- package/dist/completion.d.ts +106 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +131 -0
- package/dist/completion.js.map +1 -0
- package/dist/config.d.ts +549 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +763 -0
- package/dist/config.js.map +1 -0
- package/dist/control-file.d.ts +142 -0
- package/dist/control-file.d.ts.map +1 -0
- package/dist/control-file.js +144 -0
- package/dist/control-file.js.map +1 -0
- package/dist/coordinator-state.d.ts +131 -0
- package/dist/coordinator-state.d.ts.map +1 -0
- package/dist/coordinator-state.js +380 -0
- package/dist/coordinator-state.js.map +1 -0
- package/dist/coordinator.d.ts +95 -0
- package/dist/coordinator.d.ts.map +1 -0
- package/dist/coordinator.js +97 -0
- package/dist/coordinator.js.map +1 -0
- package/dist/cursor-store.d.ts +53 -0
- package/dist/cursor-store.d.ts.map +1 -0
- package/dist/cursor-store.js +98 -0
- package/dist/cursor-store.js.map +1 -0
- package/dist/daemon-cmd.d.ts +239 -0
- package/dist/daemon-cmd.d.ts.map +1 -0
- package/dist/daemon-cmd.js +1751 -0
- package/dist/daemon-cmd.js.map +1 -0
- package/dist/daemon-lock.d.ts +140 -0
- package/dist/daemon-lock.d.ts.map +1 -0
- package/dist/daemon-lock.js +352 -0
- package/dist/daemon-lock.js.map +1 -0
- package/dist/daemon-recovery.d.ts +78 -0
- package/dist/daemon-recovery.d.ts.map +1 -0
- package/dist/daemon-recovery.js +161 -0
- package/dist/daemon-recovery.js.map +1 -0
- package/dist/daemon.d.ts +368 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +601 -0
- package/dist/daemon.js.map +1 -0
- package/dist/declared-response-shape.d.ts +93 -0
- package/dist/declared-response-shape.d.ts.map +1 -0
- package/dist/declared-response-shape.js +200 -0
- package/dist/declared-response-shape.js.map +1 -0
- package/dist/declared-surfaces.d.ts +16 -0
- package/dist/declared-surfaces.d.ts.map +1 -0
- package/dist/declared-surfaces.js +19 -0
- package/dist/declared-surfaces.js.map +1 -0
- package/dist/depends-review.d.ts +113 -0
- package/dist/depends-review.d.ts.map +1 -0
- package/dist/depends-review.js +110 -0
- package/dist/depends-review.js.map +1 -0
- package/dist/doctor.d.ts +91 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +71 -0
- package/dist/doctor.js.map +1 -0
- package/dist/edge-approval.d.ts +105 -0
- package/dist/edge-approval.d.ts.map +1 -0
- package/dist/edge-approval.js +100 -0
- package/dist/edge-approval.js.map +1 -0
- package/dist/evidence-cache.d.ts +45 -0
- package/dist/evidence-cache.d.ts.map +1 -0
- package/dist/evidence-cache.js +90 -0
- package/dist/evidence-cache.js.map +1 -0
- package/dist/evidence-cmd.d.ts +133 -0
- package/dist/evidence-cmd.d.ts.map +1 -0
- package/dist/evidence-cmd.js +347 -0
- package/dist/evidence-cmd.js.map +1 -0
- package/dist/evidence-facts.d.ts +40 -0
- package/dist/evidence-facts.d.ts.map +1 -0
- package/dist/evidence-facts.js +114 -0
- package/dist/evidence-facts.js.map +1 -0
- package/dist/exclusive-lock.d.ts +52 -0
- package/dist/exclusive-lock.d.ts.map +1 -0
- package/dist/exclusive-lock.js +150 -0
- package/dist/exclusive-lock.js.map +1 -0
- package/dist/exec-domains.d.ts +140 -0
- package/dist/exec-domains.d.ts.map +1 -0
- package/dist/exec-domains.js +287 -0
- package/dist/exec-domains.js.map +1 -0
- package/dist/exemption-store.d.ts +197 -0
- package/dist/exemption-store.d.ts.map +1 -0
- package/dist/exemption-store.js +266 -0
- package/dist/exemption-store.js.map +1 -0
- package/dist/explicit-start-gate.d.ts +96 -0
- package/dist/explicit-start-gate.d.ts.map +1 -0
- package/dist/explicit-start-gate.js +103 -0
- package/dist/explicit-start-gate.js.map +1 -0
- package/dist/fs-trouble.d.ts +70 -0
- package/dist/fs-trouble.d.ts.map +1 -0
- package/dist/fs-trouble.js +98 -0
- package/dist/fs-trouble.js.map +1 -0
- package/dist/gate.d.ts +278 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +278 -0
- package/dist/gate.js.map +1 -0
- package/dist/git-driver.d.ts +519 -0
- package/dist/git-driver.d.ts.map +1 -0
- package/dist/git-driver.js +900 -0
- package/dist/git-driver.js.map +1 -0
- package/dist/git-push-executor.d.ts +41 -0
- package/dist/git-push-executor.d.ts.map +1 -0
- package/dist/git-push-executor.js +142 -0
- package/dist/git-push-executor.js.map +1 -0
- package/dist/glob.d.ts +26 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +93 -0
- package/dist/glob.js.map +1 -0
- package/dist/goal-adaptive.d.ts +295 -0
- package/dist/goal-adaptive.d.ts.map +1 -0
- package/dist/goal-adaptive.js +393 -0
- package/dist/goal-adaptive.js.map +1 -0
- package/dist/goal-compile.d.ts +342 -0
- package/dist/goal-compile.d.ts.map +1 -0
- package/dist/goal-compile.js +444 -0
- package/dist/goal-compile.js.map +1 -0
- package/dist/goal-depends-executor.d.ts +55 -0
- package/dist/goal-depends-executor.d.ts.map +1 -0
- package/dist/goal-depends-executor.js +202 -0
- package/dist/goal-depends-executor.js.map +1 -0
- package/dist/goal-execution-evidence.d.ts +135 -0
- package/dist/goal-execution-evidence.d.ts.map +1 -0
- package/dist/goal-execution-evidence.js +159 -0
- package/dist/goal-execution-evidence.js.map +1 -0
- package/dist/goal-gap.d.ts +140 -0
- package/dist/goal-gap.d.ts.map +1 -0
- package/dist/goal-gap.js +197 -0
- package/dist/goal-gap.js.map +1 -0
- package/dist/goal-met-target.d.ts +98 -0
- package/dist/goal-met-target.d.ts.map +1 -0
- package/dist/goal-met-target.js +92 -0
- package/dist/goal-met-target.js.map +1 -0
- package/dist/goal-ownership.d.ts +416 -0
- package/dist/goal-ownership.d.ts.map +1 -0
- package/dist/goal-ownership.js +576 -0
- package/dist/goal-ownership.js.map +1 -0
- package/dist/goal-runs.d.ts +82 -0
- package/dist/goal-runs.d.ts.map +1 -0
- package/dist/goal-runs.js +120 -0
- package/dist/goal-runs.js.map +1 -0
- package/dist/goal-store.d.ts +146 -0
- package/dist/goal-store.d.ts.map +1 -0
- package/dist/goal-store.js +294 -0
- package/dist/goal-store.js.map +1 -0
- package/dist/goal-view.d.ts +156 -0
- package/dist/goal-view.d.ts.map +1 -0
- package/dist/goal-view.js +499 -0
- package/dist/goal-view.js.map +1 -0
- package/dist/governed-approvals.d.ts +152 -0
- package/dist/governed-approvals.d.ts.map +1 -0
- package/dist/governed-approvals.js +246 -0
- package/dist/governed-approvals.js.map +1 -0
- package/dist/governed-broker.d.ts +169 -0
- package/dist/governed-broker.d.ts.map +1 -0
- package/dist/governed-broker.js +196 -0
- package/dist/governed-broker.js.map +1 -0
- package/dist/governed-run.d.ts +220 -0
- package/dist/governed-run.d.ts.map +1 -0
- package/dist/governed-run.js +406 -0
- package/dist/governed-run.js.map +1 -0
- package/dist/grant-reconcile.d.ts +63 -0
- package/dist/grant-reconcile.d.ts.map +1 -0
- package/dist/grant-reconcile.js +121 -0
- package/dist/grant-reconcile.js.map +1 -0
- package/dist/index-for-head.d.ts +56 -0
- package/dist/index-for-head.d.ts.map +1 -0
- package/dist/index-for-head.js +103 -0
- package/dist/index-for-head.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/init-detect.d.ts +39 -0
- package/dist/init-detect.d.ts.map +1 -0
- package/dist/init-detect.js +188 -0
- package/dist/init-detect.js.map +1 -0
- package/dist/integration-deps.d.ts +62 -0
- package/dist/integration-deps.d.ts.map +1 -0
- package/dist/integration-deps.js +251 -0
- package/dist/integration-deps.js.map +1 -0
- package/dist/integration-runtime.d.ts +458 -0
- package/dist/integration-runtime.d.ts.map +1 -0
- package/dist/integration-runtime.js +681 -0
- package/dist/integration-runtime.js.map +1 -0
- package/dist/integration.d.ts +45 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +87 -0
- package/dist/integration.js.map +1 -0
- package/dist/integrator.d.ts +84 -0
- package/dist/integrator.d.ts.map +1 -0
- package/dist/integrator.js +193 -0
- package/dist/integrator.js.map +1 -0
- package/dist/lane-claims.d.ts +174 -0
- package/dist/lane-claims.d.ts.map +1 -0
- package/dist/lane-claims.js +218 -0
- package/dist/lane-claims.js.map +1 -0
- package/dist/lane-coverage.d.ts +87 -0
- package/dist/lane-coverage.d.ts.map +1 -0
- package/dist/lane-coverage.js +129 -0
- package/dist/lane-coverage.js.map +1 -0
- package/dist/ledger-replay.d.ts +115 -0
- package/dist/ledger-replay.d.ts.map +1 -0
- package/dist/ledger-replay.js +155 -0
- package/dist/ledger-replay.js.map +1 -0
- package/dist/ledger-store.d.ts +68 -0
- package/dist/ledger-store.d.ts.map +1 -0
- package/dist/ledger-store.js +111 -0
- package/dist/ledger-store.js.map +1 -0
- package/dist/loop-safety-observer.d.ts +132 -0
- package/dist/loop-safety-observer.d.ts.map +1 -0
- package/dist/loop-safety-observer.js +76 -0
- package/dist/loop-safety-observer.js.map +1 -0
- package/dist/loop-safety-store.d.ts +339 -0
- package/dist/loop-safety-store.d.ts.map +1 -0
- package/dist/loop-safety-store.js +800 -0
- package/dist/loop-safety-store.js.map +1 -0
- package/dist/machine-store.d.ts +54 -0
- package/dist/machine-store.d.ts.map +1 -0
- package/dist/machine-store.js +149 -0
- package/dist/machine-store.js.map +1 -0
- package/dist/mcp-main.d.ts +2 -0
- package/dist/mcp-main.d.ts.map +1 -0
- package/dist/mcp-main.js +116 -0
- package/dist/mcp-main.js.map +1 -0
- package/dist/mcp-server.d.ts +72 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +259 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/model-routing.d.ts +75 -0
- package/dist/model-routing.d.ts.map +1 -0
- package/dist/model-routing.js +108 -0
- package/dist/model-routing.js.map +1 -0
- package/dist/model-transport.d.ts +188 -0
- package/dist/model-transport.d.ts.map +1 -0
- package/dist/model-transport.js +625 -0
- package/dist/model-transport.js.map +1 -0
- package/dist/notify-cadence.d.ts +55 -0
- package/dist/notify-cadence.d.ts.map +1 -0
- package/dist/notify-cadence.js +68 -0
- package/dist/notify-cadence.js.map +1 -0
- package/dist/notify-channel.d.ts +69 -0
- package/dist/notify-channel.d.ts.map +1 -0
- package/dist/notify-channel.js +151 -0
- package/dist/notify-channel.js.map +1 -0
- package/dist/notify.d.ts +71 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +125 -0
- package/dist/notify.js.map +1 -0
- package/dist/observation-inventory.d.ts +65 -0
- package/dist/observation-inventory.d.ts.map +1 -0
- package/dist/observation-inventory.js +139 -0
- package/dist/observation-inventory.js.map +1 -0
- package/dist/owned-children.d.ts +45 -0
- package/dist/owned-children.d.ts.map +1 -0
- package/dist/owned-children.js +64 -0
- package/dist/owned-children.js.map +1 -0
- package/dist/packet-for-goal.d.ts +19 -0
- package/dist/packet-for-goal.d.ts.map +1 -0
- package/dist/packet-for-goal.js +32 -0
- package/dist/packet-for-goal.js.map +1 -0
- package/dist/pair-cmd.d.ts +85 -0
- package/dist/pair-cmd.d.ts.map +1 -0
- package/dist/pair-cmd.js +205 -0
- package/dist/pair-cmd.js.map +1 -0
- package/dist/partial-asker.d.ts +96 -0
- package/dist/partial-asker.d.ts.map +1 -0
- package/dist/partial-asker.js +117 -0
- package/dist/partial-asker.js.map +1 -0
- package/dist/pdf-text-lines.d.ts +17 -0
- package/dist/pdf-text-lines.d.ts.map +1 -0
- package/dist/pdf-text-lines.js +70 -0
- package/dist/pdf-text-lines.js.map +1 -0
- package/dist/pdf-text-worker.d.ts +2 -0
- package/dist/pdf-text-worker.d.ts.map +1 -0
- package/dist/pdf-text-worker.js +81 -0
- package/dist/pdf-text-worker.js.map +1 -0
- package/dist/pdf-text.d.ts +56 -0
- package/dist/pdf-text.d.ts.map +1 -0
- package/dist/pdf-text.js +64 -0
- package/dist/pdf-text.js.map +1 -0
- package/dist/pending-action.d.ts +154 -0
- package/dist/pending-action.d.ts.map +1 -0
- package/dist/pending-action.js +148 -0
- package/dist/pending-action.js.map +1 -0
- package/dist/preemptor.d.ts +40 -0
- package/dist/preemptor.d.ts.map +1 -0
- package/dist/preemptor.js +49 -0
- package/dist/preemptor.js.map +1 -0
- package/dist/programme-mode.d.ts +29 -0
- package/dist/programme-mode.d.ts.map +1 -0
- package/dist/programme-mode.js +50 -0
- package/dist/programme-mode.js.map +1 -0
- package/dist/progress-view.d.ts +14 -0
- package/dist/progress-view.d.ts.map +1 -0
- package/dist/progress-view.js +114 -0
- package/dist/progress-view.js.map +1 -0
- package/dist/project-graph-builder.d.ts +81 -0
- package/dist/project-graph-builder.d.ts.map +1 -0
- package/dist/project-graph-builder.js +246 -0
- package/dist/project-graph-builder.js.map +1 -0
- package/dist/project-graph-runtime.d.ts +86 -0
- package/dist/project-graph-runtime.d.ts.map +1 -0
- package/dist/project-graph-runtime.js +112 -0
- package/dist/project-graph-runtime.js.map +1 -0
- package/dist/project-index-builder.d.ts +96 -0
- package/dist/project-index-builder.d.ts.map +1 -0
- package/dist/project-index-builder.js +298 -0
- package/dist/project-index-builder.js.map +1 -0
- package/dist/project-index-facts.d.ts +51 -0
- package/dist/project-index-facts.d.ts.map +1 -0
- package/dist/project-index-facts.js +117 -0
- package/dist/project-index-facts.js.map +1 -0
- package/dist/project-index-store.d.ts +97 -0
- package/dist/project-index-store.d.ts.map +1 -0
- package/dist/project-index-store.js +140 -0
- package/dist/project-index-store.js.map +1 -0
- package/dist/project-memory-store.d.ts +127 -0
- package/dist/project-memory-store.d.ts.map +1 -0
- package/dist/project-memory-store.js +302 -0
- package/dist/project-memory-store.js.map +1 -0
- package/dist/proposal-store.d.ts +14 -0
- package/dist/proposal-store.d.ts.map +1 -0
- package/dist/proposal-store.js +19 -0
- package/dist/proposal-store.js.map +1 -0
- package/dist/prover.d.ts +80 -0
- package/dist/prover.d.ts.map +1 -0
- package/dist/prover.js +137 -0
- package/dist/prover.js.map +1 -0
- package/dist/provider-identity-store.d.ts +34 -0
- package/dist/provider-identity-store.d.ts.map +1 -0
- package/dist/provider-identity-store.js +72 -0
- package/dist/provider-identity-store.js.map +1 -0
- package/dist/provider-identity.d.ts +104 -0
- package/dist/provider-identity.d.ts.map +1 -0
- package/dist/provider-identity.js +167 -0
- package/dist/provider-identity.js.map +1 -0
- package/dist/provider-limit.d.ts +79 -0
- package/dist/provider-limit.d.ts.map +1 -0
- package/dist/provider-limit.js +148 -0
- package/dist/provider-limit.js.map +1 -0
- package/dist/provider-preflight.d.ts +171 -0
- package/dist/provider-preflight.d.ts.map +1 -0
- package/dist/provider-preflight.js +395 -0
- package/dist/provider-preflight.js.map +1 -0
- package/dist/provider-state.d.ts +120 -0
- package/dist/provider-state.d.ts.map +1 -0
- package/dist/provider-state.js +182 -0
- package/dist/provider-state.js.map +1 -0
- package/dist/providers.d.ts +132 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +161 -0
- package/dist/providers.js.map +1 -0
- package/dist/publication-recorder.d.ts +117 -0
- package/dist/publication-recorder.d.ts.map +1 -0
- package/dist/publication-recorder.js +124 -0
- package/dist/publication-recorder.js.map +1 -0
- package/dist/pursuit-delivery.d.ts +24 -0
- package/dist/pursuit-delivery.d.ts.map +1 -0
- package/dist/pursuit-delivery.js +38 -0
- package/dist/pursuit-delivery.js.map +1 -0
- package/dist/queue-store.d.ts +132 -0
- package/dist/queue-store.d.ts.map +1 -0
- package/dist/queue-store.js +185 -0
- package/dist/queue-store.js.map +1 -0
- package/dist/queue-summary.d.ts +14 -0
- package/dist/queue-summary.d.ts.map +1 -0
- package/dist/queue-summary.js +82 -0
- package/dist/queue-summary.js.map +1 -0
- package/dist/queue-view.d.ts +20 -0
- package/dist/queue-view.d.ts.map +1 -0
- package/dist/queue-view.js +163 -0
- package/dist/queue-view.js.map +1 -0
- package/dist/queue-write-lease.d.ts +106 -0
- package/dist/queue-write-lease.d.ts.map +1 -0
- package/dist/queue-write-lease.js +282 -0
- package/dist/queue-write-lease.js.map +1 -0
- package/dist/rails-home.d.ts +162 -0
- package/dist/rails-home.d.ts.map +1 -0
- package/dist/rails-home.js +452 -0
- package/dist/rails-home.js.map +1 -0
- package/dist/rails-migrations.d.ts +75 -0
- package/dist/rails-migrations.d.ts.map +1 -0
- package/dist/rails-migrations.js +199 -0
- package/dist/rails-migrations.js.map +1 -0
- package/dist/rails-stores.d.ts +49 -0
- package/dist/rails-stores.d.ts.map +1 -0
- package/dist/rails-stores.js +100 -0
- package/dist/rails-stores.js.map +1 -0
- package/dist/reaper.d.ts +69 -0
- package/dist/reaper.d.ts.map +1 -0
- package/dist/reaper.js +152 -0
- package/dist/reaper.js.map +1 -0
- package/dist/record-store.d.ts +36 -0
- package/dist/record-store.d.ts.map +1 -0
- package/dist/record-store.js +78 -0
- package/dist/record-store.js.map +1 -0
- package/dist/recovery-io.d.ts +50 -0
- package/dist/recovery-io.d.ts.map +1 -0
- package/dist/recovery-io.js +122 -0
- package/dist/recovery-io.js.map +1 -0
- package/dist/recovery.d.ts +146 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +110 -0
- package/dist/recovery.js.map +1 -0
- package/dist/redraw.d.ts +34 -0
- package/dist/redraw.d.ts.map +1 -0
- package/dist/redraw.js +62 -0
- package/dist/redraw.js.map +1 -0
- package/dist/rejected-evidence.d.ts +255 -0
- package/dist/rejected-evidence.d.ts.map +1 -0
- package/dist/rejected-evidence.js +324 -0
- package/dist/rejected-evidence.js.map +1 -0
- package/dist/report-cmd.d.ts +32 -0
- package/dist/report-cmd.d.ts.map +1 -0
- package/dist/report-cmd.js +201 -0
- package/dist/report-cmd.js.map +1 -0
- package/dist/repos-cmd.d.ts +80 -0
- package/dist/repos-cmd.d.ts.map +1 -0
- package/dist/repos-cmd.js +240 -0
- package/dist/repos-cmd.js.map +1 -0
- package/dist/request-body-shape.d.ts +93 -0
- package/dist/request-body-shape.d.ts.map +1 -0
- package/dist/request-body-shape.js +407 -0
- package/dist/request-body-shape.js.map +1 -0
- package/dist/requirement-claims.d.ts +89 -0
- package/dist/requirement-claims.d.ts.map +1 -0
- package/dist/requirement-claims.js +92 -0
- package/dist/requirement-claims.js.map +1 -0
- package/dist/retention-apply-runtime.d.ts +105 -0
- package/dist/retention-apply-runtime.d.ts.map +1 -0
- package/dist/retention-apply-runtime.js +269 -0
- package/dist/retention-apply-runtime.js.map +1 -0
- package/dist/reverify.d.ts +41 -0
- package/dist/reverify.d.ts.map +1 -0
- package/dist/reverify.js +69 -0
- package/dist/reverify.js.map +1 -0
- package/dist/round-records.d.ts +65 -0
- package/dist/round-records.d.ts.map +1 -0
- package/dist/round-records.js +61 -0
- package/dist/round-records.js.map +1 -0
- package/dist/round-runner.d.ts +924 -0
- package/dist/round-runner.d.ts.map +1 -0
- package/dist/round-runner.js +1693 -0
- package/dist/round-runner.js.map +1 -0
- package/dist/run-approval.d.ts +180 -0
- package/dist/run-approval.d.ts.map +1 -0
- package/dist/run-approval.js +199 -0
- package/dist/run-approval.js.map +1 -0
- package/dist/run-cmd.d.ts +359 -0
- package/dist/run-cmd.d.ts.map +1 -0
- package/dist/run-cmd.js +4418 -0
- package/dist/run-cmd.js.map +1 -0
- package/dist/run-delivery.d.ts +71 -0
- package/dist/run-delivery.d.ts.map +1 -0
- package/dist/run-delivery.js +104 -0
- package/dist/run-delivery.js.map +1 -0
- package/dist/run-ended.d.ts +75 -0
- package/dist/run-ended.d.ts.map +1 -0
- package/dist/run-ended.js +27 -0
- package/dist/run-ended.js.map +1 -0
- package/dist/run-ending-locator.d.ts +125 -0
- package/dist/run-ending-locator.d.ts.map +1 -0
- package/dist/run-ending-locator.js +133 -0
- package/dist/run-ending-locator.js.map +1 -0
- package/dist/run-launcher.d.ts +459 -0
- package/dist/run-launcher.d.ts.map +1 -0
- package/dist/run-launcher.js +652 -0
- package/dist/run-launcher.js.map +1 -0
- package/dist/run-lease.d.ts +208 -0
- package/dist/run-lease.d.ts.map +1 -0
- package/dist/run-lease.js +301 -0
- package/dist/run-lease.js.map +1 -0
- package/dist/run-refusal-marks.d.ts +189 -0
- package/dist/run-refusal-marks.d.ts.map +1 -0
- package/dist/run-refusal-marks.js +249 -0
- package/dist/run-refusal-marks.js.map +1 -0
- package/dist/run-start-marks.d.ts +153 -0
- package/dist/run-start-marks.d.ts.map +1 -0
- package/dist/run-start-marks.js +269 -0
- package/dist/run-start-marks.js.map +1 -0
- package/dist/scan-cmd.d.ts +14 -0
- package/dist/scan-cmd.d.ts.map +1 -0
- package/dist/scan-cmd.js +270 -0
- package/dist/scan-cmd.js.map +1 -0
- package/dist/scan-events.d.ts +50 -0
- package/dist/scan-events.d.ts.map +1 -0
- package/dist/scan-events.js +91 -0
- package/dist/scan-events.js.map +1 -0
- package/dist/scan.d.ts +191 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +417 -0
- package/dist/scan.js.map +1 -0
- package/dist/scope-rule.d.ts +148 -0
- package/dist/scope-rule.d.ts.map +1 -0
- package/dist/scope-rule.js +121 -0
- package/dist/scope-rule.js.map +1 -0
- package/dist/self-repo-id.d.ts +18 -0
- package/dist/self-repo-id.d.ts.map +1 -0
- package/dist/self-repo-id.js +70 -0
- package/dist/self-repo-id.js.map +1 -0
- package/dist/serve-cmd.d.ts +115 -0
- package/dist/serve-cmd.d.ts.map +1 -0
- package/dist/serve-cmd.js +505 -0
- package/dist/serve-cmd.js.map +1 -0
- package/dist/serve.d.ts +167 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +336 -0
- package/dist/serve.js.map +1 -0
- package/dist/server-client.d.ts +766 -0
- package/dist/server-client.d.ts.map +1 -0
- package/dist/server-client.js +475 -0
- package/dist/server-client.js.map +1 -0
- package/dist/session-adapter-runtime.d.ts +195 -0
- package/dist/session-adapter-runtime.d.ts.map +1 -0
- package/dist/session-adapter-runtime.js +373 -0
- package/dist/session-adapter-runtime.js.map +1 -0
- package/dist/session-checkpoint-runtime.d.ts +62 -0
- package/dist/session-checkpoint-runtime.d.ts.map +1 -0
- package/dist/session-checkpoint-runtime.js +268 -0
- package/dist/session-checkpoint-runtime.js.map +1 -0
- package/dist/session-control-transport.d.ts +106 -0
- package/dist/session-control-transport.d.ts.map +1 -0
- package/dist/session-control-transport.js +232 -0
- package/dist/session-control-transport.js.map +1 -0
- package/dist/session-observation-store.d.ts +98 -0
- package/dist/session-observation-store.d.ts.map +1 -0
- package/dist/session-observation-store.js +155 -0
- package/dist/session-observation-store.js.map +1 -0
- package/dist/session-observe-runtime.d.ts +123 -0
- package/dist/session-observe-runtime.d.ts.map +1 -0
- package/dist/session-observe-runtime.js +317 -0
- package/dist/session-observe-runtime.js.map +1 -0
- package/dist/session-store.d.ts +98 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/session-store.js +116 -0
- package/dist/session-store.js.map +1 -0
- package/dist/sessions-cmd.d.ts +202 -0
- package/dist/sessions-cmd.d.ts.map +1 -0
- package/dist/sessions-cmd.js +609 -0
- package/dist/sessions-cmd.js.map +1 -0
- package/dist/settings-overlay.d.ts +53 -0
- package/dist/settings-overlay.d.ts.map +1 -0
- package/dist/settings-overlay.js +175 -0
- package/dist/settings-overlay.js.map +1 -0
- package/dist/setup-prompt.d.ts +34 -0
- package/dist/setup-prompt.d.ts.map +1 -0
- package/dist/setup-prompt.js +92 -0
- package/dist/setup-prompt.js.map +1 -0
- package/dist/setup.d.ts +103 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +283 -0
- package/dist/setup.js.map +1 -0
- package/dist/shared-grants.d.ts +164 -0
- package/dist/shared-grants.d.ts.map +1 -0
- package/dist/shared-grants.js +242 -0
- package/dist/shared-grants.js.map +1 -0
- package/dist/signals.d.ts +55 -0
- package/dist/signals.d.ts.map +1 -0
- package/dist/signals.js +85 -0
- package/dist/signals.js.map +1 -0
- package/dist/source-cmd.d.ts +201 -0
- package/dist/source-cmd.d.ts.map +1 -0
- package/dist/source-cmd.js +684 -0
- package/dist/source-cmd.js.map +1 -0
- package/dist/source-verdict.d.ts +99 -0
- package/dist/source-verdict.d.ts.map +1 -0
- package/dist/source-verdict.js +182 -0
- package/dist/source-verdict.js.map +1 -0
- package/dist/spend-ledger.d.ts +350 -0
- package/dist/spend-ledger.d.ts.map +1 -0
- package/dist/spend-ledger.js +546 -0
- package/dist/spend-ledger.js.map +1 -0
- package/dist/stale-run-sweep.d.ts +79 -0
- package/dist/stale-run-sweep.d.ts.map +1 -0
- package/dist/stale-run-sweep.js +116 -0
- package/dist/stale-run-sweep.js.map +1 -0
- package/dist/start-attempts.d.ts +385 -0
- package/dist/start-attempts.d.ts.map +1 -0
- package/dist/start-attempts.js +613 -0
- package/dist/start-attempts.js.map +1 -0
- package/dist/status-cmd.d.ts +28 -0
- package/dist/status-cmd.d.ts.map +1 -0
- package/dist/status-cmd.js +116 -0
- package/dist/status-cmd.js.map +1 -0
- package/dist/stop-follow-up.d.ts +107 -0
- package/dist/stop-follow-up.d.ts.map +1 -0
- package/dist/stop-follow-up.js +172 -0
- package/dist/stop-follow-up.js.map +1 -0
- package/dist/surface-lease.d.ts +118 -0
- package/dist/surface-lease.d.ts.map +1 -0
- package/dist/surface-lease.js +485 -0
- package/dist/surface-lease.js.map +1 -0
- package/dist/sync.d.ts +54 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +93 -0
- package/dist/sync.js.map +1 -0
- package/dist/syncing-ledger.d.ts +45 -0
- package/dist/syncing-ledger.d.ts.map +1 -0
- package/dist/syncing-ledger.js +53 -0
- package/dist/syncing-ledger.js.map +1 -0
- package/dist/temp-fixtures.d.ts +68 -0
- package/dist/temp-fixtures.d.ts.map +1 -0
- package/dist/temp-fixtures.js +38 -0
- package/dist/temp-fixtures.js.map +1 -0
- package/dist/token-window.d.ts +84 -0
- package/dist/token-window.d.ts.map +1 -0
- package/dist/token-window.js +143 -0
- package/dist/token-window.js.map +1 -0
- package/dist/tool-bridge.d.ts +177 -0
- package/dist/tool-bridge.d.ts.map +1 -0
- package/dist/tool-bridge.js +329 -0
- package/dist/tool-bridge.js.map +1 -0
- package/dist/tool-call-record.d.ts +197 -0
- package/dist/tool-call-record.d.ts.map +1 -0
- package/dist/tool-call-record.js +276 -0
- package/dist/tool-call-record.js.map +1 -0
- package/dist/tool-protocol.d.ts +135 -0
- package/dist/tool-protocol.d.ts.map +1 -0
- package/dist/tool-protocol.js +104 -0
- package/dist/tool-protocol.js.map +1 -0
- package/dist/tool-worker.d.ts +3 -0
- package/dist/tool-worker.d.ts.map +1 -0
- package/dist/tool-worker.js +478 -0
- package/dist/tool-worker.js.map +1 -0
- package/dist/toolchain-mirror.d.ts +86 -0
- package/dist/toolchain-mirror.d.ts.map +1 -0
- package/dist/toolchain-mirror.js +307 -0
- package/dist/toolchain-mirror.js.map +1 -0
- package/dist/trusted-git.d.ts +243 -0
- package/dist/trusted-git.d.ts.map +1 -0
- package/dist/trusted-git.js +920 -0
- package/dist/trusted-git.js.map +1 -0
- package/dist/ui.d.ts +76 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +118 -0
- package/dist/ui.js.map +1 -0
- package/dist/untrusted-exec.d.ts +275 -0
- package/dist/untrusted-exec.d.ts.map +1 -0
- package/dist/untrusted-exec.js +479 -0
- package/dist/untrusted-exec.js.map +1 -0
- package/dist/untrusted-gate.d.ts +73 -0
- package/dist/untrusted-gate.d.ts.map +1 -0
- package/dist/untrusted-gate.js +226 -0
- package/dist/untrusted-gate.js.map +1 -0
- package/dist/uploader.d.ts +153 -0
- package/dist/uploader.d.ts.map +1 -0
- package/dist/uploader.js +204 -0
- package/dist/uploader.js.map +1 -0
- package/dist/verifier.d.ts +66 -0
- package/dist/verifier.d.ts.map +1 -0
- package/dist/verifier.js +170 -0
- package/dist/verifier.js.map +1 -0
- package/dist/verify-apply.d.ts +26 -0
- package/dist/verify-apply.d.ts.map +1 -0
- package/dist/verify-apply.js +36 -0
- package/dist/verify-apply.js.map +1 -0
- package/dist/verify-cmd.d.ts +44 -0
- package/dist/verify-cmd.d.ts.map +1 -0
- package/dist/verify-cmd.js +125 -0
- package/dist/verify-cmd.js.map +1 -0
- package/dist/verify-pass.d.ts +73 -0
- package/dist/verify-pass.d.ts.map +1 -0
- package/dist/verify-pass.js +103 -0
- package/dist/verify-pass.js.map +1 -0
- package/dist/welcome.d.ts +43 -0
- package/dist/welcome.d.ts.map +1 -0
- package/dist/welcome.js +116 -0
- package/dist/welcome.js.map +1 -0
- package/dist/workspace-provisioner.d.ts +65 -0
- package/dist/workspace-provisioner.d.ts.map +1 -0
- package/dist/workspace-provisioner.js +66 -0
- package/dist/workspace-provisioner.js.map +1 -0
- package/dist/workspace-quarantine.d.ts +64 -0
- package/dist/workspace-quarantine.d.ts.map +1 -0
- package/dist/workspace-quarantine.js +156 -0
- package/dist/workspace-quarantine.js.map +1 -0
- package/dist/workspace-residue-sweep.d.ts +113 -0
- package/dist/workspace-residue-sweep.d.ts.map +1 -0
- package/dist/workspace-residue-sweep.js +158 -0
- package/dist/workspace-residue-sweep.js.map +1 -0
- package/dist/workspace.d.ts +639 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +2026 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +52 -4
- package/win/CredProbe.cs +64 -0
- package/win/FakeClaude.cs +56 -0
- package/win/HandleProbe.cs +116 -0
- package/win/TokenProbe.cs +53 -0
- package/win/appcontainer.ps1 +500 -0
package/dist/scan.js
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DISTILL_TIMEOUT_MS = exports.DEFAULT_LENSES = void 0;
|
|
4
|
+
exports.buildScanPrompt = buildScanPrompt;
|
|
5
|
+
exports.buildDistillPrompt = buildDistillPrompt;
|
|
6
|
+
exports.extractFindings = extractFindings;
|
|
7
|
+
exports.runLens = runLens;
|
|
8
|
+
exports.mergeFindings = mergeFindings;
|
|
9
|
+
exports.describeEmptyScan = describeEmptyScan;
|
|
10
|
+
exports.renderScanReport = renderScanReport;
|
|
11
|
+
const core_1 = require("@looply/core");
|
|
12
|
+
/**
|
|
13
|
+
* The default lenses.
|
|
14
|
+
*
|
|
15
|
+
* Each is narrow on purpose. "Find bugs" produces a list of whatever the model
|
|
16
|
+
* noticed first; "find places where a failure is swallowed" produces a list you
|
|
17
|
+
* can act on, and a different one from every other lens.
|
|
18
|
+
*/
|
|
19
|
+
exports.DEFAULT_LENSES = [
|
|
20
|
+
{
|
|
21
|
+
key: 'silent-failures',
|
|
22
|
+
label: 'places a failure goes unnoticed',
|
|
23
|
+
brief: 'Calls whose failure path does nothing: an empty catch, a promise with no rejection handler, a mutation with no error branch, a response code nobody checks. Not style, not naming.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: 'dead-ends',
|
|
27
|
+
label: 'things built but never reachable',
|
|
28
|
+
brief: 'Exported functions, endpoints, components and flags with no caller anywhere. Say where it should be called from, not merely that it is unused.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'missing-states',
|
|
32
|
+
label: 'screens with no empty, loading or error state',
|
|
33
|
+
brief: 'Views that render a list, a fetch or a form with no handling for zero results, a slow response, or a refusal. Name the screen and the state it lacks.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'untested-logic',
|
|
37
|
+
label: 'logic nothing exercises',
|
|
38
|
+
brief: 'Branching logic — cascades, permission checks, money or date arithmetic, state machines — with no test. Prefer the ones where being wrong is expensive.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 'accessibility',
|
|
42
|
+
label: 'controls assistive tech cannot use',
|
|
43
|
+
brief: 'Icon-only controls with no label, dialogs with no role or focus management, targets under 44px, colour as the only signal. Not colour-contrast opinions.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 'boundaries',
|
|
47
|
+
label: 'input that reaches the database unchecked',
|
|
48
|
+
brief: 'Query parameters, bodies and route params passed onward without validation. Name the path from the edge to the sink.',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
/**
|
|
52
|
+
* The lens prompt.
|
|
53
|
+
*
|
|
54
|
+
* Shaped by a real failure: an earlier version opened with "You are a read-only
|
|
55
|
+
* reviewer" and the agent replied by describing the repository and asking which
|
|
56
|
+
* target to review. A non-interactive agent given a role and no imperative will
|
|
57
|
+
* orient itself and wait. So this opens with the task, forbids questions
|
|
58
|
+
* explicitly, and states the output contract twice — once as the instruction and
|
|
59
|
+
* once as the last thing read.
|
|
60
|
+
*/
|
|
61
|
+
function buildScanPrompt(lens, ctx) {
|
|
62
|
+
return `Write a JSON file at ${ctx.outputPath} listing every place in the ${ctx.projectName} codebase with ${lens.label}.
|
|
63
|
+
|
|
64
|
+
Writing that file is the task. Read the code first, then write it, then stop.
|
|
65
|
+
|
|
66
|
+
## What counts
|
|
67
|
+
|
|
68
|
+
${lens.brief}
|
|
69
|
+
|
|
70
|
+
Look in: ${ctx.scope.join(', ') || 'the whole repository'}
|
|
71
|
+
|
|
72
|
+
At most ${ctx.perLens}, each with a file and a line you actually opened. No new features.
|
|
73
|
+
|
|
74
|
+
Then write the file — this exact shape, nothing else in it:
|
|
75
|
+
|
|
76
|
+
{"findings":[{"title":"what is wrong and what to do, one sentence","tag":"area","evidence":[{"path":"src/x.ts","line":12,"quote":"the line"}]}]}
|
|
77
|
+
|
|
78
|
+
Found nothing? Write {"findings":[]}.
|
|
79
|
+
|
|
80
|
+
Do not reply with a report. Nobody reads your reply; only the file is read.`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The follow-up call: prose in, JSON out.
|
|
84
|
+
*
|
|
85
|
+
* Every attempt to make a single call both *review the code* and *obey a
|
|
86
|
+
* format* has failed the same way — the review arrives, well written, as prose,
|
|
87
|
+
* and the contract is treated as background. The one thing that never failed is
|
|
88
|
+
* the reviewing itself. So this splits the two: the first call may answer
|
|
89
|
+
* however it likes, and a second call that reads no code and makes no judgement
|
|
90
|
+
* turns what it said into the shape.
|
|
91
|
+
*
|
|
92
|
+
* It is deliberately not a reviewer. "Do not read any code" is stated because a
|
|
93
|
+
* call that can open files will start reviewing again, and then it is the same
|
|
94
|
+
* unreliable single call with an extra bill attached.
|
|
95
|
+
*/
|
|
96
|
+
function buildDistillPrompt(prose, lens, ctx) {
|
|
97
|
+
return `Turn the review at the bottom of this message into one line of JSON.
|
|
98
|
+
|
|
99
|
+
Reformatting is the whole task. Do not read any code, do not open any files, do not visit any path it names, and do not add, drop or reword anything the review does not already say.
|
|
100
|
+
|
|
101
|
+
Reply with exactly this shape and nothing else — no explanation, no code fence:
|
|
102
|
+
|
|
103
|
+
{"findings":[{"title":"what is wrong and what to do, one sentence","tag":"area","evidence":[{"path":"src/x.ts","line":12,"quote":"the line"}]}]}
|
|
104
|
+
|
|
105
|
+
Rules:
|
|
106
|
+
- One entry per distinct problem the review raises, at most ${ctx.perLens}.
|
|
107
|
+
- Leave out anything the review does not tie to a file. Without a path it is not actionable.
|
|
108
|
+
- \`title\` is the review's own point in one sentence. \`tag\` is the area it is in.
|
|
109
|
+
- If the review raises no problems, reply {"findings":[]}.
|
|
110
|
+
|
|
111
|
+
--- the review of ${ctx.projectName}, looking for ${lens.label} ---
|
|
112
|
+
|
|
113
|
+
${prose}`;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Pull the findings out of a transcript.
|
|
117
|
+
*
|
|
118
|
+
* Scans from the end: an agent may echo the example object from its own prompt
|
|
119
|
+
* before producing the real one, and taking the first match would read the
|
|
120
|
+
* example back as data.
|
|
121
|
+
*/
|
|
122
|
+
function extractFindings(transcript, lens) {
|
|
123
|
+
// A written file is usually pretty-printed across many lines, so try the whole
|
|
124
|
+
// text as one object before falling back to the line scan a transcript needs.
|
|
125
|
+
const whole = tryParseFindings(transcript.trim(), lens);
|
|
126
|
+
if (whole)
|
|
127
|
+
return { ok: true, findings: whole };
|
|
128
|
+
const lines = transcript.split('\n').map((l) => l.trim()).filter(Boolean);
|
|
129
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
130
|
+
const line = lines[i];
|
|
131
|
+
if (!line.startsWith('{') || !line.includes('findings'))
|
|
132
|
+
continue;
|
|
133
|
+
try {
|
|
134
|
+
const parsed = JSON.parse(line);
|
|
135
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
136
|
+
continue;
|
|
137
|
+
const raw = parsed.findings;
|
|
138
|
+
if (!Array.isArray(raw))
|
|
139
|
+
continue;
|
|
140
|
+
const findings = [];
|
|
141
|
+
for (const f of raw) {
|
|
142
|
+
const norm = normalizeFinding(f, lens);
|
|
143
|
+
// A finding with no evidence is a guess, and acting on guesses is the
|
|
144
|
+
// main source of wasted rounds. Drop it rather than queueing it.
|
|
145
|
+
if (norm)
|
|
146
|
+
findings.push(norm);
|
|
147
|
+
}
|
|
148
|
+
return { ok: true, findings };
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { ok: false, findings: [], reason: 'the agent produced no findings object' };
|
|
155
|
+
}
|
|
156
|
+
/** Parse one whole JSON document into findings, or null when it is not one. */
|
|
157
|
+
function tryParseFindings(text, lens) {
|
|
158
|
+
if (!text.startsWith('{'))
|
|
159
|
+
return null;
|
|
160
|
+
try {
|
|
161
|
+
const parsed = JSON.parse(text);
|
|
162
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
163
|
+
return null;
|
|
164
|
+
const raw = parsed.findings;
|
|
165
|
+
if (!Array.isArray(raw))
|
|
166
|
+
return null;
|
|
167
|
+
return raw.flatMap((f) => {
|
|
168
|
+
const norm = normalizeFinding(f, lens);
|
|
169
|
+
return norm ? [norm] : [];
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function normalizeFinding(v, lens) {
|
|
177
|
+
if (typeof v !== 'object' || v === null)
|
|
178
|
+
return null;
|
|
179
|
+
const o = v;
|
|
180
|
+
const title = typeof o['title'] === 'string' ? o['title'].trim() : '';
|
|
181
|
+
if (!title)
|
|
182
|
+
return null;
|
|
183
|
+
const rawEvidence = Array.isArray(o['evidence']) ? o['evidence'] : [];
|
|
184
|
+
const evidence = [];
|
|
185
|
+
for (const e of rawEvidence) {
|
|
186
|
+
if (typeof e !== 'object' || e === null)
|
|
187
|
+
continue;
|
|
188
|
+
const eo = e;
|
|
189
|
+
if (typeof eo['path'] !== 'string' || !eo['path'])
|
|
190
|
+
continue;
|
|
191
|
+
const item = { path: eo['path'] };
|
|
192
|
+
if (typeof eo['line'] === 'number' && Number.isInteger(eo['line']))
|
|
193
|
+
item.line = eo['line'];
|
|
194
|
+
if (typeof eo['quote'] === 'string')
|
|
195
|
+
item.quote = eo['quote'];
|
|
196
|
+
evidence.push(item);
|
|
197
|
+
}
|
|
198
|
+
if (!evidence.length)
|
|
199
|
+
return null;
|
|
200
|
+
return {
|
|
201
|
+
title,
|
|
202
|
+
tag: typeof o['tag'] === 'string' && o['tag'] ? o['tag'] : lens,
|
|
203
|
+
evidence,
|
|
204
|
+
lens,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
const TRANSCRIPT_TAIL = 600;
|
|
208
|
+
/**
|
|
209
|
+
* How long the follow-up gets. Much shorter than a lens pass on purpose — it
|
|
210
|
+
* opens no files and searches nothing, so a follow-up that runs for minutes is
|
|
211
|
+
* one that started reviewing again, and killing it is the right answer.
|
|
212
|
+
*/
|
|
213
|
+
exports.DISTILL_TIMEOUT_MS = 90_000;
|
|
214
|
+
/**
|
|
215
|
+
* Below this, there is nothing to reformat.
|
|
216
|
+
*
|
|
217
|
+
* A short reply is a refusal, a question, or `{"reply":"Ready — what would you
|
|
218
|
+
* like me to do?"}` — all of which were real answers from live passes. Paying
|
|
219
|
+
* for a second call to turn any of them into `{"findings":[]}` is spending
|
|
220
|
+
* money to learn what we already know.
|
|
221
|
+
*/
|
|
222
|
+
const MIN_PROSE = 200;
|
|
223
|
+
async function runLens(invoke, lens, ctx, timeoutMs, readOutput) {
|
|
224
|
+
const r = await invoke(buildScanPrompt(lens, ctx), timeoutMs);
|
|
225
|
+
const transcript = r.output ?? '';
|
|
226
|
+
// The file first, because it is the deliverable. The transcript is only a
|
|
227
|
+
// fallback for an agent that answered in the old shape — and one that talks
|
|
228
|
+
// its way through the task while writing the file correctly is a success,
|
|
229
|
+
// not something to punish.
|
|
230
|
+
const written = readOutput?.(ctx.outputPath) ?? null;
|
|
231
|
+
let extracted = written !== null ? extractFindings(written, lens.key) : extractFindings(transcript, lens.key);
|
|
232
|
+
// A file that is not the shape we asked for does not mean the answer is not
|
|
233
|
+
// in what the agent said. Try both before paying for another call.
|
|
234
|
+
if (!extracted.ok && written !== null)
|
|
235
|
+
extracted = extractFindings(transcript, lens.key);
|
|
236
|
+
// The follow-up. Only from a pass that finished and actually said something:
|
|
237
|
+
// there is nothing to reformat in a timeout, a crash, or a one-line refusal,
|
|
238
|
+
// and every one of those would otherwise double the bill for the same zero.
|
|
239
|
+
const prose = written !== null && written.trim().length >= MIN_PROSE ? written : transcript;
|
|
240
|
+
const distill = !extracted.ok && r.ok && !r.timedOut && prose.trim().length >= MIN_PROSE;
|
|
241
|
+
let ms = r.ms;
|
|
242
|
+
if (distill) {
|
|
243
|
+
const second = await invoke(buildDistillPrompt(prose, lens, ctx), exports.DISTILL_TIMEOUT_MS);
|
|
244
|
+
// Wall clock for the lens, both calls: the cost of the follow-up is the
|
|
245
|
+
// whole argument against it and hiding it would make it look free.
|
|
246
|
+
ms += second.ms;
|
|
247
|
+
const reformatted = extractFindings(second.output ?? '', lens.key);
|
|
248
|
+
extracted = reformatted.ok
|
|
249
|
+
? reformatted
|
|
250
|
+
: {
|
|
251
|
+
ok: false,
|
|
252
|
+
findings: [],
|
|
253
|
+
reason: 'the agent answered in prose and the follow-up call could not turn it into findings',
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
const reason = extracted.ok
|
|
257
|
+
? undefined
|
|
258
|
+
: r.timedOut
|
|
259
|
+
? `the pass hit its ${Math.round(timeoutMs / 1000)}s timeout and was killed`
|
|
260
|
+
: !r.ok
|
|
261
|
+
? 'the agent exited non-zero'
|
|
262
|
+
: extracted.reason;
|
|
263
|
+
// The cap in the prompt is a request; this is the rule. A live pass asked for
|
|
264
|
+
// at most three findings and returned ten — configuration that is only
|
|
265
|
+
// advisory is not configuration, and the overflow is reported rather than
|
|
266
|
+
// dropped in silence.
|
|
267
|
+
const capped = extracted.findings.slice(0, ctx.perLens);
|
|
268
|
+
const over = extracted.findings.length - capped.length;
|
|
269
|
+
return {
|
|
270
|
+
lens: lens.key,
|
|
271
|
+
findings: capped,
|
|
272
|
+
ok: extracted.ok,
|
|
273
|
+
...(over > 0 ? { overflow: over } : {}),
|
|
274
|
+
...(distill ? { distilled: true } : {}),
|
|
275
|
+
...(reason ? { reason } : {}),
|
|
276
|
+
// The prose is the diagnosis, not the follow-up's reply — the tail kept on
|
|
277
|
+
// failure is what the pass itself produced, which is what says whether the
|
|
278
|
+
// lens found nothing or found plenty and could not be made to say so.
|
|
279
|
+
...(extracted.ok ? {} : { transcriptTail: prose.slice(-TRANSCRIPT_TAIL) }),
|
|
280
|
+
ms,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Merge every lens's output into a queue-ready batch.
|
|
285
|
+
*
|
|
286
|
+
* Two trims, both deliberate. Duplicates across lenses collapse by evidence
|
|
287
|
+
* location, because two lenses noticing the same line is agreement, not two
|
|
288
|
+
* pieces of work. Then the shape cap applies, because a batch dominated by one
|
|
289
|
+
* kind of chore is how a queue decays into busywork.
|
|
290
|
+
*/
|
|
291
|
+
function mergeFindings(results, opts) {
|
|
292
|
+
const now = opts.now ?? Date.now();
|
|
293
|
+
const seen = new Set();
|
|
294
|
+
const unique = [];
|
|
295
|
+
const byLens = {};
|
|
296
|
+
const quiet = [];
|
|
297
|
+
const failed = [];
|
|
298
|
+
for (const r of results) {
|
|
299
|
+
byLens[r.lens] = r.findings.length;
|
|
300
|
+
// A failed pass is not a quiet one. It used to be counted as quiet, so a
|
|
301
|
+
// scan where every lens crashed printed the same shape as a scan of a clean
|
|
302
|
+
// codebase.
|
|
303
|
+
if (!r.ok)
|
|
304
|
+
failed.push(r.lens);
|
|
305
|
+
else if (!r.findings.length)
|
|
306
|
+
quiet.push(r.lens);
|
|
307
|
+
for (const f of r.findings) {
|
|
308
|
+
const first = f.evidence[0];
|
|
309
|
+
const key = `${first.path}:${first.line ?? 0}`;
|
|
310
|
+
if (seen.has(key))
|
|
311
|
+
continue;
|
|
312
|
+
seen.add(key);
|
|
313
|
+
unique.push(f);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const { kept, dropped } = (0, core_1.capByShape)(unique, opts.maxSameShape);
|
|
317
|
+
const items = kept.map((f, i) => ({
|
|
318
|
+
id: (0, core_1.newId)('item', now + i),
|
|
319
|
+
projectId: opts.projectId,
|
|
320
|
+
title: f.title,
|
|
321
|
+
tag: f.tag,
|
|
322
|
+
// Every scanned item starts unverified: a finding is a claim about the code
|
|
323
|
+
// until a second pass has confirmed it against the code as it stands now.
|
|
324
|
+
state: 'draft',
|
|
325
|
+
source: 'scan',
|
|
326
|
+
evidence: f.evidence,
|
|
327
|
+
parentId: null,
|
|
328
|
+
orderKey: (0, core_1.newId)('item', now + i),
|
|
329
|
+
attempts: 0,
|
|
330
|
+
}));
|
|
331
|
+
return {
|
|
332
|
+
// Distinct findings after dedupe. `kept + dropped` sums to this — dropped
|
|
333
|
+
// items are a subset of unique, so adding them again would double-count.
|
|
334
|
+
found: unique.length,
|
|
335
|
+
kept: items.length,
|
|
336
|
+
dropped: dropped.length,
|
|
337
|
+
byLens,
|
|
338
|
+
quiet,
|
|
339
|
+
failed,
|
|
340
|
+
entropy: (0, core_1.shapeEntropy)(kept),
|
|
341
|
+
items,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* What a scan that queued nothing actually means.
|
|
346
|
+
*
|
|
347
|
+
* `found : 0` was printed for two opposite outcomes: a codebase with nothing
|
|
348
|
+
* worth queueing, and a scan where no pass came back with an answer anything
|
|
349
|
+
* could read. The second is the common case today — the agent reviews the code
|
|
350
|
+
* competently and then answers in prose, and the extractor gets nothing — and
|
|
351
|
+
* printing it as a zero tells somebody their code is clean when in fact nothing
|
|
352
|
+
* ever reported on it. Name which one it was, and say what to do instead.
|
|
353
|
+
*
|
|
354
|
+
* `looply queue` is deliberately not the pointer here: it is listed under "not
|
|
355
|
+
* built yet" in the CLI's own usage, and sending someone to a command that does
|
|
356
|
+
* not exist is the same lie in a different place.
|
|
357
|
+
*
|
|
358
|
+
* Empty when the scan queued something — this block is only for a zero.
|
|
359
|
+
*/
|
|
360
|
+
function describeEmptyScan(report) {
|
|
361
|
+
if (report.kept > 0)
|
|
362
|
+
return [];
|
|
363
|
+
const ran = report.failed.length + report.quiet.length;
|
|
364
|
+
if (!report.failed.length) {
|
|
365
|
+
return [
|
|
366
|
+
'',
|
|
367
|
+
'nothing : every lens ran and had nothing to queue. That is a real result —',
|
|
368
|
+
' add an item from the app if you already know what you want built.',
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
const retry = ` Read the transcripts above and re-run with \`looply scan --lens ${report.failed.join(',')}\`,`;
|
|
372
|
+
if (!report.quiet.length) {
|
|
373
|
+
return [
|
|
374
|
+
'',
|
|
375
|
+
'nothing : no lens produced a usable answer, so this scan is a failure and not',
|
|
376
|
+
' a clean codebase — nothing here ever reported on the code.',
|
|
377
|
+
retry,
|
|
378
|
+
' or add items from the app by hand.',
|
|
379
|
+
];
|
|
380
|
+
}
|
|
381
|
+
return [
|
|
382
|
+
'',
|
|
383
|
+
`nothing : ${report.failed.length} of ${ran} lenses produced no usable answer, so a zero here is`,
|
|
384
|
+
' partly a failed scan rather than a clean codebase.',
|
|
385
|
+
retry,
|
|
386
|
+
' or add items from the app by hand.',
|
|
387
|
+
];
|
|
388
|
+
}
|
|
389
|
+
/** A human-readable summary for the terminal and for the app's scan card. */
|
|
390
|
+
function renderScanReport(report) {
|
|
391
|
+
const lines = [];
|
|
392
|
+
for (const [lens, n] of Object.entries(report.byLens)) {
|
|
393
|
+
lines.push(` ${n.toString().padStart(3)} ${lens}`);
|
|
394
|
+
}
|
|
395
|
+
lines.push('');
|
|
396
|
+
lines.push(`found : ${report.found}`);
|
|
397
|
+
lines.push(`queued : ${report.kept}`);
|
|
398
|
+
if (report.dropped) {
|
|
399
|
+
lines.push(`trimmed : ${report.dropped} — too many of one shape in a single batch`);
|
|
400
|
+
}
|
|
401
|
+
if (report.failed.length) {
|
|
402
|
+
lines.push(`failed : ${report.failed.join(', ')} — produced nothing usable, check the lens`);
|
|
403
|
+
}
|
|
404
|
+
if (report.quiet.length) {
|
|
405
|
+
lines.push(`quiet : ${report.quiet.join(', ')} — ran to the end with nothing to report`);
|
|
406
|
+
}
|
|
407
|
+
for (const line of describeEmptyScan(report))
|
|
408
|
+
lines.push(line);
|
|
409
|
+
if (report.kept >= 5 && report.entropy < 3) {
|
|
410
|
+
// Low entropy across a whole scan is a finding about the scan itself.
|
|
411
|
+
lines.push('');
|
|
412
|
+
lines.push('note : this batch is nearly all one kind of work. That usually means the');
|
|
413
|
+
lines.push(' lenses found what is easy to grep for rather than what matters.');
|
|
414
|
+
}
|
|
415
|
+
return lines.join('\n') + '\n';
|
|
416
|
+
}
|
|
417
|
+
//# sourceMappingURL=scan.js.map
|
package/dist/scan.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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AAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHAT A ROUND WAS ACTUALLY ALLOWED TO DO TO THE TREE — decided, not described.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* 🔴 WHAT THIS REPLACES, AND WHY IT IS NOT A NEW FEATURE SO MUCH AS A REPAIR.
|
|
6
|
+
*
|
|
7
|
+
* `scope.free` and `scope.additive` have been in the config since setup wrote
|
|
8
|
+
* its first file. Until now they were interpolated into the implementer's
|
|
9
|
+
* prompt and compared against nothing. The project's own documentation said so
|
|
10
|
+
* outright — "`scope.additive` in particular describes an add-only rule that
|
|
11
|
+
* nothing checks — an agent that edits an existing file under it produces an
|
|
12
|
+
* ordinary round" — and `judged-by.ts` spelled out the consequence: a gate step
|
|
13
|
+
* lives at a path the config marks additive-only, so **a green gate a round
|
|
14
|
+
* weakened was indistinguishable from a green gate it earned**.
|
|
15
|
+
*
|
|
16
|
+
* The one place scope WAS compared mechanically made it worse rather than
|
|
17
|
+
* better. `prepareRepair` permitted `[...scope.free, ...scope.additive]`,
|
|
18
|
+
* which is to say it treated an additive-only path as freely editable — the
|
|
19
|
+
* exact opposite of what the word promises.
|
|
20
|
+
*
|
|
21
|
+
* ⚠️ SO THE OLD BEHAVIOUR WAS NOT "UNENFORCED". IT WAS "ENFORCED WRONGLY IN
|
|
22
|
+
* ONE PLACE AND NOWHERE ELSE", which is the shape of defect that reads as a
|
|
23
|
+
* working feature at a grep.
|
|
24
|
+
*
|
|
25
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
26
|
+
* THE PROMISED MEANING, WHICH IS THE ONE IMPLEMENTED HERE
|
|
27
|
+
*
|
|
28
|
+
* free the declared paths may be edited. Still subject to rails and to
|
|
29
|
+
* protected acceptance — a permission, never an override.
|
|
30
|
+
* additive a path may be ADDED. It may not be modified, deleted, renamed,
|
|
31
|
+
* replaced, or have its type or mode changed.
|
|
32
|
+
*
|
|
33
|
+
* PRECEDENCE, made explicit because two grants overlapping is the normal case
|
|
34
|
+
* and not an edge one — `looply init` in `improve` mode writes the SAME globs
|
|
35
|
+
* into both lists:
|
|
36
|
+
*
|
|
37
|
+
* 1. rails / deny win over everything. They are checked before this fold runs
|
|
38
|
+
* and abort on their own code, so nothing here can open a railed path.
|
|
39
|
+
* `free` permission never overrides a mandatory deny.
|
|
40
|
+
* 2. `free` beats `additive` for a path in both. A broader grant is not
|
|
41
|
+
* narrowed by also appearing in a narrower one, and reading it the other
|
|
42
|
+
* way would make `improve` — every default project — refuse every edit.
|
|
43
|
+
* 3. a path in `additive` only may be added and nothing else.
|
|
44
|
+
* 4. a path in neither is outside the declared scope.
|
|
45
|
+
*
|
|
46
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
47
|
+
* ABSENT IS NOT EMPTY, AND THE DIFFERENCE IS A COMPATIBILITY PROMISE
|
|
48
|
+
*
|
|
49
|
+
* `declared: false` — the project's config has no `scope` block. It keeps its
|
|
50
|
+
* documented behaviour, which is no constraint. Every project written before
|
|
51
|
+
* this file existed is in that state, and none of them starts failing today.
|
|
52
|
+
*
|
|
53
|
+
* `declared: true` with two empty lists — the project said `scope:` and named
|
|
54
|
+
* nothing. That is deny-all, because an explicit empty grant is a grant of
|
|
55
|
+
* nothing, and reading it as "no constraint" would make the safest-looking
|
|
56
|
+
* config the most permissive one.
|
|
57
|
+
*
|
|
58
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
59
|
+
* ⚠️ WHAT THIS FOLD CANNOT SEE, SAID HERE RATHER THAN DISCOVERED LATER
|
|
60
|
+
*
|
|
61
|
+
* It reads paths and porcelain status codes. It performs no filesystem I/O, so
|
|
62
|
+
* it cannot resolve a junction or a symlink to its target. A junction INSIDE the
|
|
63
|
+
* worktree is matched by the path git reports, which is the correct behaviour
|
|
64
|
+
* for a scope rule — scope is a statement about paths in this repository. A
|
|
65
|
+
* link whose target escapes the worktree is a CONTAINMENT question, owned by
|
|
66
|
+
* the rails and by the exec domain, not by this file.
|
|
67
|
+
*
|
|
68
|
+
* What it does catch, and what the status codes are load-bearing for:
|
|
69
|
+
* - delete-then-recreate, because the delete arrives as its own `D` entry;
|
|
70
|
+
* - untracked files, because `changedEntries` runs `git status -uall` and a
|
|
71
|
+
* new file inside a new directory is listed individually rather than
|
|
72
|
+
* collapsed to `newdir/`;
|
|
73
|
+
* - rename, because both ends are emitted and neither is a pure addition.
|
|
74
|
+
*
|
|
75
|
+
* Pure and total, like the other folds in this package.
|
|
76
|
+
*/
|
|
77
|
+
/** One entry of a round's diff: the path, and git's two-character status. */
|
|
78
|
+
export interface ChangedEntry {
|
|
79
|
+
readonly path: string;
|
|
80
|
+
/** Porcelain v1 XY status, e.g. `??`, `A `, ` M`, `D `, `R `, `T `. */
|
|
81
|
+
readonly status: string;
|
|
82
|
+
}
|
|
83
|
+
/** A project's declared scope, plus whether it declared one at all. */
|
|
84
|
+
export interface ScopeDecl {
|
|
85
|
+
readonly free: readonly string[];
|
|
86
|
+
readonly additive: readonly string[];
|
|
87
|
+
/**
|
|
88
|
+
* Whether the config carried a `scope` block.
|
|
89
|
+
*
|
|
90
|
+
* ⚠️ OPTIONAL, AND ABSENT MEANS ABSENT. A caller that builds a `ScopeDecl`
|
|
91
|
+
* by hand — every existing test fixture does — gets the legacy no-constraint
|
|
92
|
+
* behaviour rather than a surprise refusal.
|
|
93
|
+
*/
|
|
94
|
+
readonly declared?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export type ScopeViolationKind =
|
|
97
|
+
/** The path is in neither grant. */
|
|
98
|
+
'outside-scope'
|
|
99
|
+
/** The path is additive-only and the round did something other than add it. */
|
|
100
|
+
| 'additive-modify'
|
|
101
|
+
/** The path is one this fold refuses to reason about at all. */
|
|
102
|
+
| 'unanalysable';
|
|
103
|
+
export interface ScopeViolation {
|
|
104
|
+
readonly path: string;
|
|
105
|
+
readonly status: string;
|
|
106
|
+
readonly kind: ScopeViolationKind;
|
|
107
|
+
/** One sentence, for a person reading an abort. */
|
|
108
|
+
readonly because: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Does this status introduce a path that did not exist in the base?
|
|
112
|
+
*
|
|
113
|
+
* 🔴 DELIBERATELY AN ALLOW-LIST, NOT A DENY-LIST. A status this function has
|
|
114
|
+
* never heard of returns `false` and the path is refused under an additive
|
|
115
|
+
* grant. That is the direction an interlock has to fail in: a wrong refusal is
|
|
116
|
+
* loud, visible in the abort, and fixed by widening the grant — a wrong pass
|
|
117
|
+
* lets a worker rewrite a file the operator believed was frozen, and nothing
|
|
118
|
+
* says it happened.
|
|
119
|
+
*
|
|
120
|
+
* Accepted:
|
|
121
|
+
* `??` untracked — the ordinary shape of a new file, with `-uall` listing it
|
|
122
|
+
* individually rather than collapsing it into its directory
|
|
123
|
+
* `A ` added to the index
|
|
124
|
+
* `AM` added, then further modified in the worktree. Still a file that did
|
|
125
|
+
* not exist in the base; the modification is to the round's own new
|
|
126
|
+
* content and takes nothing away.
|
|
127
|
+
*
|
|
128
|
+
* Refused, each for a stated reason:
|
|
129
|
+
* `AD` added then deleted — the net effect is no file, and calling that an
|
|
130
|
+
* addition would let a delete-recreate-delete sequence read as clean.
|
|
131
|
+
* `R`/`C` rename and copy. `changedEntries` emits BOTH ends of these with
|
|
132
|
+
* the same status, so accepting the destination would also accept the
|
|
133
|
+
* source — a rename out of an additive path would be permitted by the
|
|
134
|
+
* very rule that names renaming as forbidden.
|
|
135
|
+
* `T` type or mode change, which the decision names explicitly.
|
|
136
|
+
* everything else, including the unmerged states.
|
|
137
|
+
*/
|
|
138
|
+
export declare function isPureAddition(status: string): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Every changed entry the declared scope does not permit, with the reason.
|
|
141
|
+
*
|
|
142
|
+
* Returns `[]` when the project declared no scope — the legacy contract — and
|
|
143
|
+
* for a diff that stays inside its grant.
|
|
144
|
+
*/
|
|
145
|
+
export declare function scopeViolations(entries: readonly ChangedEntry[], scope: ScopeDecl): ScopeViolation[];
|
|
146
|
+
/** One line a person can read, for the abort's reason field. */
|
|
147
|
+
export declare function describeScopeViolations(violations: readonly ScopeViolation[]): string;
|
|
148
|
+
//# sourceMappingURL=scope-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-rule.d.ts","sourceRoot":"","sources":["../src/scope-rule.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,uEAAuE;AACvE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,MAAM,kBAAkB;AAC5B,oCAAoC;AAClC,eAAe;AACjB,+EAA+E;GAC7E,iBAAiB;AACnB,gEAAgE;GAC9D,cAAc,CAAC;AAEnB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAOtD;AAiBD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