@ashlr/hub 2.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/CHANGELOG.md +1158 -0
- package/LICENSE +21 -0
- package/README.md +833 -0
- package/bin/ashlr +8 -0
- package/dist/api/core.d.ts +28 -0
- package/dist/api/core.js +42 -0
- package/dist/api/core.js.map +1 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/index.js +9 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/plugin.d.ts +12 -0
- package/dist/api/plugin.js +13 -0
- package/dist/api/plugin.js.map +1 -0
- package/dist/api/types.d.ts +9 -0
- package/dist/api/types.js +9 -0
- package/dist/api/types.js.map +1 -0
- package/dist/cli/args.d.ts +20 -0
- package/dist/cli/args.js +23 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/ask.d.ts +22 -0
- package/dist/cli/ask.js +240 -0
- package/dist/cli/ask.js.map +1 -0
- package/dist/cli/audit.d.ts +26 -0
- package/dist/cli/audit.js +199 -0
- package/dist/cli/audit.js.map +1 -0
- package/dist/cli/backlog.d.ts +26 -0
- package/dist/cli/backlog.js +322 -0
- package/dist/cli/backlog.js.map +1 -0
- package/dist/cli/completions.d.ts +18 -0
- package/dist/cli/completions.js +156 -0
- package/dist/cli/completions.js.map +1 -0
- package/dist/cli/daemon.d.ts +31 -0
- package/dist/cli/daemon.js +334 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/demo-sandbox.d.ts +78 -0
- package/dist/cli/demo-sandbox.js +227 -0
- package/dist/cli/demo-sandbox.js.map +1 -0
- package/dist/cli/demo.d.ts +76 -0
- package/dist/cli/demo.js +285 -0
- package/dist/cli/demo.js.map +1 -0
- package/dist/cli/digest.d.ts +46 -0
- package/dist/cli/digest.js +352 -0
- package/dist/cli/digest.js.map +1 -0
- package/dist/cli/doctor-init.d.ts +28 -0
- package/dist/cli/doctor-init.js +335 -0
- package/dist/cli/doctor-init.js.map +1 -0
- package/dist/cli/genome.d.ts +62 -0
- package/dist/cli/genome.js +1061 -0
- package/dist/cli/genome.js.map +1 -0
- package/dist/cli/gh.d.ts +27 -0
- package/dist/cli/gh.js +322 -0
- package/dist/cli/gh.js.map +1 -0
- package/dist/cli/goals.d.ts +55 -0
- package/dist/cli/goals.js +667 -0
- package/dist/cli/goals.js.map +1 -0
- package/dist/cli/health.d.ts +56 -0
- package/dist/cli/health.js +407 -0
- package/dist/cli/health.js.map +1 -0
- package/dist/cli/help.d.ts +51 -0
- package/dist/cli/help.js +436 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/inbox.d.ts +28 -0
- package/dist/cli/inbox.js +589 -0
- package/dist/cli/inbox.js.map +1 -0
- package/dist/cli/index.d.ts +41 -0
- package/dist/cli/index.js +1208 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/knowledge.d.ts +33 -0
- package/dist/cli/knowledge.js +575 -0
- package/dist/cli/knowledge.js.map +1 -0
- package/dist/cli/mcp.d.ts +26 -0
- package/dist/cli/mcp.js +487 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/models.d.ts +26 -0
- package/dist/cli/models.js +435 -0
- package/dist/cli/models.js.map +1 -0
- package/dist/cli/new.d.ts +32 -0
- package/dist/cli/new.js +565 -0
- package/dist/cli/new.js.map +1 -0
- package/dist/cli/notify.d.ts +20 -0
- package/dist/cli/notify.js +188 -0
- package/dist/cli/notify.js.map +1 -0
- package/dist/cli/onboard.d.ts +85 -0
- package/dist/cli/onboard.js +305 -0
- package/dist/cli/onboard.js.map +1 -0
- package/dist/cli/open.d.ts +38 -0
- package/dist/cli/open.js +86 -0
- package/dist/cli/open.js.map +1 -0
- package/dist/cli/orient.d.ts +14 -0
- package/dist/cli/orient.js +110 -0
- package/dist/cli/orient.js.map +1 -0
- package/dist/cli/picker.d.ts +21 -0
- package/dist/cli/picker.js +177 -0
- package/dist/cli/picker.js.map +1 -0
- package/dist/cli/plugins.d.ts +21 -0
- package/dist/cli/plugins.js +394 -0
- package/dist/cli/plugins.js.map +1 -0
- package/dist/cli/preflight.d.ts +29 -0
- package/dist/cli/preflight.js +131 -0
- package/dist/cli/preflight.js.map +1 -0
- package/dist/cli/pulse.d.ts +26 -0
- package/dist/cli/pulse.js +482 -0
- package/dist/cli/pulse.js.map +1 -0
- package/dist/cli/reflect.d.ts +42 -0
- package/dist/cli/reflect.js +381 -0
- package/dist/cli/reflect.js.map +1 -0
- package/dist/cli/run.d.ts +29 -0
- package/dist/cli/run.js +687 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/sandbox.d.ts +20 -0
- package/dist/cli/sandbox.js +345 -0
- package/dist/cli/sandbox.js.map +1 -0
- package/dist/cli/seams.d.ts +41 -0
- package/dist/cli/seams.js +167 -0
- package/dist/cli/seams.js.map +1 -0
- package/dist/cli/serve.d.ts +25 -0
- package/dist/cli/serve.js +249 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/ship.d.ts +33 -0
- package/dist/cli/ship.js +433 -0
- package/dist/cli/ship.js.map +1 -0
- package/dist/cli/spec.d.ts +19 -0
- package/dist/cli/spec.js +478 -0
- package/dist/cli/spec.js.map +1 -0
- package/dist/cli/swarm.d.ts +42 -0
- package/dist/cli/swarm.js +1365 -0
- package/dist/cli/swarm.js.map +1 -0
- package/dist/cli/telemetry.d.ts +26 -0
- package/dist/cli/telemetry.js +364 -0
- package/dist/cli/telemetry.js.map +1 -0
- package/dist/cli/tui.d.ts +17 -0
- package/dist/cli/tui.js +52 -0
- package/dist/cli/tui.js.map +1 -0
- package/dist/cli/ui.d.ts +53 -0
- package/dist/cli/ui.js +66 -0
- package/dist/cli/ui.js.map +1 -0
- package/dist/cli/update.d.ts +38 -0
- package/dist/cli/update.js +682 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/vercel.d.ts +20 -0
- package/dist/cli/vercel.js +193 -0
- package/dist/cli/vercel.js.map +1 -0
- package/dist/cli/verify-safety.d.ts +96 -0
- package/dist/cli/verify-safety.js +509 -0
- package/dist/cli/verify-safety.js.map +1 -0
- package/dist/cli/wire.d.ts +22 -0
- package/dist/cli/wire.js +205 -0
- package/dist/cli/wire.js.map +1 -0
- package/dist/core/classify.d.ts +51 -0
- package/dist/core/classify.js +450 -0
- package/dist/core/classify.js.map +1 -0
- package/dist/core/config.d.ts +63 -0
- package/dist/core/config.js +474 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/daemon/loop.d.ts +74 -0
- package/dist/core/daemon/loop.js +618 -0
- package/dist/core/daemon/loop.js.map +1 -0
- package/dist/core/daemon/state.d.ts +66 -0
- package/dist/core/daemon/state.js +197 -0
- package/dist/core/daemon/state.js.map +1 -0
- package/dist/core/dashboard.d.ts +40 -0
- package/dist/core/dashboard.js +463 -0
- package/dist/core/dashboard.js.map +1 -0
- package/dist/core/digest/build.d.ts +51 -0
- package/dist/core/digest/build.js +230 -0
- package/dist/core/digest/build.js.map +1 -0
- package/dist/core/digest/deliver.d.ts +47 -0
- package/dist/core/digest/deliver.js +230 -0
- package/dist/core/digest/deliver.js.map +1 -0
- package/dist/core/digest/store.d.ts +57 -0
- package/dist/core/digest/store.js +223 -0
- package/dist/core/digest/store.js.map +1 -0
- package/dist/core/doctor-fix.d.ts +21 -0
- package/dist/core/doctor-fix.js +440 -0
- package/dist/core/doctor-fix.js.map +1 -0
- package/dist/core/doctor.d.ts +18 -0
- package/dist/core/doctor.js +806 -0
- package/dist/core/doctor.js.map +1 -0
- package/dist/core/env-bridge.d.ts +64 -0
- package/dist/core/env-bridge.js +103 -0
- package/dist/core/env-bridge.js.map +1 -0
- package/dist/core/genome/capture.d.ts +49 -0
- package/dist/core/genome/capture.js +352 -0
- package/dist/core/genome/capture.js.map +1 -0
- package/dist/core/genome/consolidate.d.ts +38 -0
- package/dist/core/genome/consolidate.js +426 -0
- package/dist/core/genome/consolidate.js.map +1 -0
- package/dist/core/genome/export.d.ts +29 -0
- package/dist/core/genome/export.js +102 -0
- package/dist/core/genome/export.js.map +1 -0
- package/dist/core/genome/playbook.d.ts +33 -0
- package/dist/core/genome/playbook.js +320 -0
- package/dist/core/genome/playbook.js.map +1 -0
- package/dist/core/genome/recall.d.ts +45 -0
- package/dist/core/genome/recall.js +293 -0
- package/dist/core/genome/recall.js.map +1 -0
- package/dist/core/genome/store.d.ts +62 -0
- package/dist/core/genome/store.js +711 -0
- package/dist/core/genome/store.js.map +1 -0
- package/dist/core/git.d.ts +34 -0
- package/dist/core/git.js +115 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/goals/advance.d.ts +82 -0
- package/dist/core/goals/advance.js +263 -0
- package/dist/core/goals/advance.js.map +1 -0
- package/dist/core/goals/planner.d.ts +58 -0
- package/dist/core/goals/planner.js +233 -0
- package/dist/core/goals/planner.js.map +1 -0
- package/dist/core/goals/store.d.ts +128 -0
- package/dist/core/goals/store.js +442 -0
- package/dist/core/goals/store.js.map +1 -0
- package/dist/core/inbox/apply.d.ts +36 -0
- package/dist/core/inbox/apply.js +407 -0
- package/dist/core/inbox/apply.js.map +1 -0
- package/dist/core/inbox/notify-proposal.d.ts +13 -0
- package/dist/core/inbox/notify-proposal.js +21 -0
- package/dist/core/inbox/notify-proposal.js.map +1 -0
- package/dist/core/inbox/store.d.ts +67 -0
- package/dist/core/inbox/store.js +258 -0
- package/dist/core/inbox/store.js.map +1 -0
- package/dist/core/index-engine.d.ts +62 -0
- package/dist/core/index-engine.js +486 -0
- package/dist/core/index-engine.js.map +1 -0
- package/dist/core/integrations/desktop-notify.d.ts +18 -0
- package/dist/core/integrations/desktop-notify.js +42 -0
- package/dist/core/integrations/desktop-notify.js.map +1 -0
- package/dist/core/integrations/editors.d.ts +50 -0
- package/dist/core/integrations/editors.js +216 -0
- package/dist/core/integrations/editors.js.map +1 -0
- package/dist/core/integrations/github.d.ts +66 -0
- package/dist/core/integrations/github.js +332 -0
- package/dist/core/integrations/github.js.map +1 -0
- package/dist/core/integrations/identity.d.ts +29 -0
- package/dist/core/integrations/identity.js +359 -0
- package/dist/core/integrations/identity.js.map +1 -0
- package/dist/core/integrations/notify.d.ts +23 -0
- package/dist/core/integrations/notify.js +96 -0
- package/dist/core/integrations/notify.js.map +1 -0
- package/dist/core/integrations/vercel.d.ts +37 -0
- package/dist/core/integrations/vercel.js +192 -0
- package/dist/core/integrations/vercel.js.map +1 -0
- package/dist/core/knowledge/ask.d.ts +34 -0
- package/dist/core/knowledge/ask.js +325 -0
- package/dist/core/knowledge/ask.js.map +1 -0
- package/dist/core/knowledge/graph.d.ts +51 -0
- package/dist/core/knowledge/graph.js +564 -0
- package/dist/core/knowledge/graph.js.map +1 -0
- package/dist/core/knowledge/index.d.ts +74 -0
- package/dist/core/knowledge/index.js +586 -0
- package/dist/core/knowledge/index.js.map +1 -0
- package/dist/core/learn/playbooks.d.ts +84 -0
- package/dist/core/learn/playbooks.js +241 -0
- package/dist/core/learn/playbooks.js.map +1 -0
- package/dist/core/learn/reflect.d.ts +87 -0
- package/dist/core/learn/reflect.js +435 -0
- package/dist/core/learn/reflect.js.map +1 -0
- package/dist/core/learn/store.d.ts +51 -0
- package/dist/core/learn/store.js +165 -0
- package/dist/core/learn/store.js.map +1 -0
- package/dist/core/learn/tuning.d.ts +48 -0
- package/dist/core/learn/tuning.js +201 -0
- package/dist/core/learn/tuning.js.map +1 -0
- package/dist/core/lifecycle/scaffold.d.ts +43 -0
- package/dist/core/lifecycle/scaffold.js +260 -0
- package/dist/core/lifecycle/scaffold.js.map +1 -0
- package/dist/core/lifecycle/ship.d.ts +48 -0
- package/dist/core/lifecycle/ship.js +513 -0
- package/dist/core/lifecycle/ship.js.map +1 -0
- package/dist/core/lifecycle/templates.d.ts +20 -0
- package/dist/core/lifecycle/templates.js +605 -0
- package/dist/core/lifecycle/templates.js.map +1 -0
- package/dist/core/mcp-gateway.d.ts +59 -0
- package/dist/core/mcp-gateway.js +385 -0
- package/dist/core/mcp-gateway.js.map +1 -0
- package/dist/core/mcp-native.d.ts +53 -0
- package/dist/core/mcp-native.js +507 -0
- package/dist/core/mcp-native.js.map +1 -0
- package/dist/core/mcp-registry.d.ts +36 -0
- package/dist/core/mcp-registry.js +180 -0
- package/dist/core/mcp-registry.js.map +1 -0
- package/dist/core/observability/budget-alert.d.ts +18 -0
- package/dist/core/observability/budget-alert.js +90 -0
- package/dist/core/observability/budget-alert.js.map +1 -0
- package/dist/core/observability/estimate.d.ts +27 -0
- package/dist/core/observability/estimate.js +188 -0
- package/dist/core/observability/estimate.js.map +1 -0
- package/dist/core/observability/forecast.d.ts +19 -0
- package/dist/core/observability/forecast.js +101 -0
- package/dist/core/observability/forecast.js.map +1 -0
- package/dist/core/observability/governance.d.ts +28 -0
- package/dist/core/observability/governance.js +101 -0
- package/dist/core/observability/governance.js.map +1 -0
- package/dist/core/observability/otlp.d.ts +88 -0
- package/dist/core/observability/otlp.js +217 -0
- package/dist/core/observability/otlp.js.map +1 -0
- package/dist/core/observability/rollup.d.ts +35 -0
- package/dist/core/observability/rollup.js +311 -0
- package/dist/core/observability/rollup.js.map +1 -0
- package/dist/core/observability/telemetry-sink.d.ts +63 -0
- package/dist/core/observability/telemetry-sink.js +350 -0
- package/dist/core/observability/telemetry-sink.js.map +1 -0
- package/dist/core/observability/usage-source.d.ts +60 -0
- package/dist/core/observability/usage-source.js +347 -0
- package/dist/core/observability/usage-source.js.map +1 -0
- package/dist/core/onboard.d.ts +27 -0
- package/dist/core/onboard.js +288 -0
- package/dist/core/onboard.js.map +1 -0
- package/dist/core/orient.d.ts +23 -0
- package/dist/core/orient.js +135 -0
- package/dist/core/orient.js.map +1 -0
- package/dist/core/phantom.d.ts +23 -0
- package/dist/core/phantom.js +279 -0
- package/dist/core/phantom.js.map +1 -0
- package/dist/core/plugins/host-api.d.ts +29 -0
- package/dist/core/plugins/host-api.js +113 -0
- package/dist/core/plugins/host-api.js.map +1 -0
- package/dist/core/plugins/integrity.d.ts +36 -0
- package/dist/core/plugins/integrity.js +73 -0
- package/dist/core/plugins/integrity.js.map +1 -0
- package/dist/core/plugins/manifest.d.ts +31 -0
- package/dist/core/plugins/manifest.js +316 -0
- package/dist/core/plugins/manifest.js.map +1 -0
- package/dist/core/plugins/registry.d.ts +87 -0
- package/dist/core/plugins/registry.js +415 -0
- package/dist/core/plugins/registry.js.map +1 -0
- package/dist/core/plugins/types.d.ts +182 -0
- package/dist/core/plugins/types.js +40 -0
- package/dist/core/plugins/types.js.map +1 -0
- package/dist/core/plugins/wrappers.d.ts +40 -0
- package/dist/core/plugins/wrappers.js +229 -0
- package/dist/core/plugins/wrappers.js.map +1 -0
- package/dist/core/portfolio/backlog.d.ts +40 -0
- package/dist/core/portfolio/backlog.js +177 -0
- package/dist/core/portfolio/backlog.js.map +1 -0
- package/dist/core/portfolio/scanners.d.ts +21 -0
- package/dist/core/portfolio/scanners.js +600 -0
- package/dist/core/portfolio/scanners.js.map +1 -0
- package/dist/core/providers.d.ts +34 -0
- package/dist/core/providers.js +250 -0
- package/dist/core/providers.js.map +1 -0
- package/dist/core/quality/conventions.d.ts +35 -0
- package/dist/core/quality/conventions.js +267 -0
- package/dist/core/quality/conventions.js.map +1 -0
- package/dist/core/quality/fixes.d.ts +56 -0
- package/dist/core/quality/fixes.js +209 -0
- package/dist/core/quality/fixes.js.map +1 -0
- package/dist/core/quality/health.d.ts +69 -0
- package/dist/core/quality/health.js +350 -0
- package/dist/core/quality/health.js.map +1 -0
- package/dist/core/quality/store.d.ts +56 -0
- package/dist/core/quality/store.js +195 -0
- package/dist/core/quality/store.js.map +1 -0
- package/dist/core/readiness.d.ts +112 -0
- package/dist/core/readiness.js +431 -0
- package/dist/core/readiness.js.map +1 -0
- package/dist/core/run/agent-loop.d.ts +40 -0
- package/dist/core/run/agent-loop.js +291 -0
- package/dist/core/run/agent-loop.js.map +1 -0
- package/dist/core/run/budget.d.ts +47 -0
- package/dist/core/run/budget.js +113 -0
- package/dist/core/run/budget.js.map +1 -0
- package/dist/core/run/engines.d.ts +75 -0
- package/dist/core/run/engines.js +199 -0
- package/dist/core/run/engines.js.map +1 -0
- package/dist/core/run/model-manager.d.ts +64 -0
- package/dist/core/run/model-manager.js +339 -0
- package/dist/core/run/model-manager.js.map +1 -0
- package/dist/core/run/orchestrator.d.ts +100 -0
- package/dist/core/run/orchestrator.js +1515 -0
- package/dist/core/run/orchestrator.js.map +1 -0
- package/dist/core/run/provider-client.d.ts +46 -0
- package/dist/core/run/provider-client.js +796 -0
- package/dist/core/run/provider-client.js.map +1 -0
- package/dist/core/run/retry.d.ts +19 -0
- package/dist/core/run/retry.js +68 -0
- package/dist/core/run/retry.js.map +1 -0
- package/dist/core/run/router.d.ts +50 -0
- package/dist/core/run/router.js +257 -0
- package/dist/core/run/router.js.map +1 -0
- package/dist/core/run/self-heal.d.ts +52 -0
- package/dist/core/run/self-heal.js +181 -0
- package/dist/core/run/self-heal.js.map +1 -0
- package/dist/core/run/streaming.d.ts +31 -0
- package/dist/core/run/streaming.js +122 -0
- package/dist/core/run/streaming.js.map +1 -0
- package/dist/core/run/verify.d.ts +30 -0
- package/dist/core/run/verify.js +204 -0
- package/dist/core/run/verify.js.map +1 -0
- package/dist/core/sandbox/audit.d.ts +31 -0
- package/dist/core/sandbox/audit.js +169 -0
- package/dist/core/sandbox/audit.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +61 -0
- package/dist/core/sandbox/policy.js +211 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/worktree.d.ts +175 -0
- package/dist/core/sandbox/worktree.js +673 -0
- package/dist/core/sandbox/worktree.js.map +1 -0
- package/dist/core/seams/backlog.d.ts +47 -0
- package/dist/core/seams/backlog.js +47 -0
- package/dist/core/seams/backlog.js.map +1 -0
- package/dist/core/seams/daemon-coordinator.d.ts +72 -0
- package/dist/core/seams/daemon-coordinator.js +76 -0
- package/dist/core/seams/daemon-coordinator.js.map +1 -0
- package/dist/core/seams/genome.d.ts +45 -0
- package/dist/core/seams/genome.js +53 -0
- package/dist/core/seams/genome.js.map +1 -0
- package/dist/core/seams/identity.d.ts +40 -0
- package/dist/core/seams/identity.js +44 -0
- package/dist/core/seams/identity.js.map +1 -0
- package/dist/core/seams/inbox.d.ts +60 -0
- package/dist/core/seams/inbox.js +66 -0
- package/dist/core/seams/inbox.js.map +1 -0
- package/dist/core/seams/index.d.ts +20 -0
- package/dist/core/seams/index.js +21 -0
- package/dist/core/seams/index.js.map +1 -0
- package/dist/core/seams/portfolio.d.ts +50 -0
- package/dist/core/seams/portfolio.js +61 -0
- package/dist/core/seams/portfolio.js.map +1 -0
- package/dist/core/seams/registry.d.ts +42 -0
- package/dist/core/seams/registry.js +128 -0
- package/dist/core/seams/registry.js.map +1 -0
- package/dist/core/seams/run-swarm.d.ts +66 -0
- package/dist/core/seams/run-swarm.js +74 -0
- package/dist/core/seams/run-swarm.js.map +1 -0
- package/dist/core/seams/types.d.ts +123 -0
- package/dist/core/seams/types.js +35 -0
- package/dist/core/seams/types.js.map +1 -0
- package/dist/core/spec/spec-store.d.ts +62 -0
- package/dist/core/spec/spec-store.js +359 -0
- package/dist/core/spec/spec-store.js.map +1 -0
- package/dist/core/swarm/gate.d.ts +45 -0
- package/dist/core/swarm/gate.js +114 -0
- package/dist/core/swarm/gate.js.map +1 -0
- package/dist/core/swarm/planner.d.ts +32 -0
- package/dist/core/swarm/planner.js +293 -0
- package/dist/core/swarm/planner.js.map +1 -0
- package/dist/core/swarm/rollback.d.ts +56 -0
- package/dist/core/swarm/rollback.js +266 -0
- package/dist/core/swarm/rollback.js.map +1 -0
- package/dist/core/swarm/runner.d.ts +62 -0
- package/dist/core/swarm/runner.js +1263 -0
- package/dist/core/swarm/runner.js.map +1 -0
- package/dist/core/swarm/sign.d.ts +71 -0
- package/dist/core/swarm/sign.js +362 -0
- package/dist/core/swarm/sign.js.map +1 -0
- package/dist/core/swarm/store.d.ts +52 -0
- package/dist/core/swarm/store.js +195 -0
- package/dist/core/swarm/store.js.map +1 -0
- package/dist/core/tidy.d.ts +32 -0
- package/dist/core/tidy.js +354 -0
- package/dist/core/tidy.js.map +1 -0
- package/dist/core/tools-registry.d.ts +16 -0
- package/dist/core/tools-registry.js +308 -0
- package/dist/core/tools-registry.js.map +1 -0
- package/dist/core/types.d.ts +2545 -0
- package/dist/core/types.js +9 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/web/api.d.ts +53 -0
- package/dist/core/web/api.js +698 -0
- package/dist/core/web/api.js.map +1 -0
- package/dist/core/web/public/app.js +1906 -0
- package/dist/core/web/public/index.html +721 -0
- package/dist/core/web/public/styles.css +2007 -0
- package/dist/core/web/server.d.ts +18 -0
- package/dist/core/web/server.js +122 -0
- package/dist/core/web/server.js.map +1 -0
- package/dist/core/web/static.d.ts +18 -0
- package/dist/core/web/static.js +122 -0
- package/dist/core/web/static.js.map +1 -0
- package/dist/tui/app.d.ts +33 -0
- package/dist/tui/app.js +350 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/render.d.ts +20 -0
- package/dist/tui/render.js +558 -0
- package/dist/tui/render.js.map +1 -0
- package/package.json +80 -0
- package/schema/config.schema.json +223 -0
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `ashlr verify-safety` — H4 READ-ONLY safety self-check.
|
|
3
|
+
*
|
|
4
|
+
* The runtime analogue of the H4 regression suite. It runs the STRUCTURAL safety
|
|
5
|
+
* guards against the INSTALLED build and prints a pass/fail report, so a human or
|
|
6
|
+
* CI can confirm — on any machine — that the hard safety invariants still hold.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ashlr verify-safety # human-readable PASS/FAIL report
|
|
10
|
+
* ashlr verify-safety --json # machine-readable { ok, checks: [...] }
|
|
11
|
+
*
|
|
12
|
+
* HARD CONTRACT (docs/contracts/CONTRACT-H4.md §Verify-Safety) — this command:
|
|
13
|
+
* - MUTATES NOTHING. It writes no file, creates no sandbox, enrolls nothing,
|
|
14
|
+
* toggles no kill switch, and creates no proposal. It performs only reads
|
|
15
|
+
* (source reads) and pure in-memory checks.
|
|
16
|
+
* - MAKES NO OUTWARD CALL. No network, no `git push`, no PR, no deploy, no model
|
|
17
|
+
* spawn. Local-only and side-effect-free by construction.
|
|
18
|
+
* - Runs these READ-ONLY structural checks (each → one PASS/FAIL line):
|
|
19
|
+
* 1. ENROLLMENT default-empty: an absent/malformed registry parses to
|
|
20
|
+
* { repos: [] } (checked against synthesized in-memory input).
|
|
21
|
+
* 2. KILL-SWITCH precedence: assertMayMutate enforces the kill check BEFORE
|
|
22
|
+
* the enrollment/allowAnyRepo check (source check — never touches
|
|
23
|
+
* ~/.ashlr/KILL).
|
|
24
|
+
* 3. DAEMON exports no outward primitive: daemon/loop.ts imports/call-tokens
|
|
25
|
+
* contain no apply/push/createPr/deploy.
|
|
26
|
+
* 4. SCRUB patterns match: index.ts/graph.ts scrubSecrets redact a
|
|
27
|
+
* synthesized secret string (in-memory; no file written).
|
|
28
|
+
* 5. PROVIDER cloud-gate present: provider-client.ts defines the cloud gate
|
|
29
|
+
* and the !allowCloud throw path.
|
|
30
|
+
*
|
|
31
|
+
* Exit codes: 0 all checks pass, 1 one or more FAIL (so CI can gate), 2 bad usage.
|
|
32
|
+
*
|
|
33
|
+
* NOTE (integration — owned by the Build/Integrate phase, NOT this scaffold):
|
|
34
|
+
* src/cli/index.ts must add a
|
|
35
|
+
* `loadVerifySafetyCmd = lazyCmd(() => import('./verify-safety.js'),
|
|
36
|
+
* (m) => m.cmdVerifySafety as Cmd, 'verify-safety requires src/cli/verify-safety.ts (H4)')`,
|
|
37
|
+
* a `case 'verify-safety':` arm in the dispatch switch, and a cmdHelp entry.
|
|
38
|
+
*
|
|
39
|
+
* No new runtime deps; node builtins only; never throws out of cmdVerifySafety.
|
|
40
|
+
*/
|
|
41
|
+
import { readFileSync } from 'node:fs';
|
|
42
|
+
import { fileURLToPath } from 'node:url';
|
|
43
|
+
import { dirname, join, resolve } from 'node:path';
|
|
44
|
+
// The REAL secret-scrub guard — imported (not copied) so CHECK 4 exercises the
|
|
45
|
+
// actual redaction logic. This is a pure, local-only function (no network, no
|
|
46
|
+
// I/O); importing it keeps verify-safety side-effect-free and outward-call-free.
|
|
47
|
+
import { scrubSecrets, SECRET_PATTERNS } from '../core/knowledge/index.js';
|
|
48
|
+
/**
|
|
49
|
+
* Read a module under `core/` of THIS build as raw UTF-8 text. Resolved RELATIVE
|
|
50
|
+
* to this running module (`<root>/cli/verify-safety.<ext>` → `<root>/core/<rel>`),
|
|
51
|
+
* so it works for both the compiled build (`dist/core/...js`) and the dev/test
|
|
52
|
+
* tree (`src/core/...ts`). Tries this file's own extension first, then the
|
|
53
|
+
* sibling extension, so a `.ts` test run still resolves the `.ts` source.
|
|
54
|
+
*
|
|
55
|
+
* READ-ONLY: a plain `readFileSync`. Makes no outward call and writes nothing.
|
|
56
|
+
*/
|
|
57
|
+
function defaultReadCore(relFromCore) {
|
|
58
|
+
const here = dirname(fileURLToPath(import.meta.url)); // <root>/cli
|
|
59
|
+
const coreDir = resolve(here, '..', 'core'); // <root>/core
|
|
60
|
+
const selfExt = import.meta.url.endsWith('.ts') ? '.ts' : '.js';
|
|
61
|
+
const otherExt = selfExt === '.ts' ? '.js' : '.ts';
|
|
62
|
+
const base = join(coreDir, relFromCore);
|
|
63
|
+
try {
|
|
64
|
+
return readFileSync(base + selfExt, 'utf8');
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return readFileSync(base + otherExt, 'utf8');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
// Static-scan helpers (comment-strip + import specifiers + token scan)
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
/**
|
|
74
|
+
* Strip `//` line comments and block comments so a forbidden-call-token scan
|
|
75
|
+
* never trips on a passing mention inside a comment. Conservative — does not
|
|
76
|
+
* parse strings (acceptable: the scanned tokens never legitimately live in a
|
|
77
|
+
* string literal in these modules).
|
|
78
|
+
*/
|
|
79
|
+
function stripComments(src) {
|
|
80
|
+
return src
|
|
81
|
+
.replace(/\/\*[\s\S]*?\*\//g, ' ')
|
|
82
|
+
.replace(/(^|[^:])\/\/[^\n]*/g, '$1');
|
|
83
|
+
}
|
|
84
|
+
/** Extract the set of module specifiers imported by `src`. */
|
|
85
|
+
function importSpecifiers(src) {
|
|
86
|
+
const specs = [];
|
|
87
|
+
const fromRe = /\bimport\b[^'"]*?from\s*['"]([^'"]+)['"]/g;
|
|
88
|
+
const bareRe = /\bimport\s*['"]([^'"]+)['"]/g;
|
|
89
|
+
const dynRe = /\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
90
|
+
for (const re of [fromRe, bareRe, dynRe]) {
|
|
91
|
+
let m;
|
|
92
|
+
while ((m = re.exec(src)) !== null) {
|
|
93
|
+
if (m[1] !== undefined)
|
|
94
|
+
specs.push(m[1]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return specs;
|
|
98
|
+
}
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Structural checks (READ-ONLY) — each is a pure read + in-memory assertion.
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
/**
|
|
103
|
+
* The complete set of structural-check ids the report MUST contain. A runtime
|
|
104
|
+
* coverage guard in {@link runSafetyChecks} emits a synthetic FAIL for any id
|
|
105
|
+
* here that did not run, so dropping a runner fails CI rather than silently
|
|
106
|
+
* shrinking coverage to a smaller all-passing set.
|
|
107
|
+
*/
|
|
108
|
+
const EXPECTED_CHECK_IDS = [
|
|
109
|
+
'enrollment-default-empty',
|
|
110
|
+
'kill-switch-precedence',
|
|
111
|
+
'daemon-no-primitive',
|
|
112
|
+
'scrub-patterns-match',
|
|
113
|
+
'provider-cloud-gate',
|
|
114
|
+
];
|
|
115
|
+
/** Construct a SafetyCheck, normalizing the detail string. */
|
|
116
|
+
function mk(id, label, pass, detail = '') {
|
|
117
|
+
return { id, label, pass, detail };
|
|
118
|
+
}
|
|
119
|
+
/** Normalize an unknown thrown value to a message string. */
|
|
120
|
+
function errMsg(err) {
|
|
121
|
+
return err instanceof Error ? err.message : String(err);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Replicates policy.ts's `readRegistry` parse semantics on a SYNTHESIZED
|
|
125
|
+
* in-memory string — never reading or writing the real registry — so we can
|
|
126
|
+
* assert the DEFAULT-EMPTY guarantee at runtime. Mirrors the real parser:
|
|
127
|
+
* absent/malformed/non-`{repos:[]}` input yields `{ repos: [] }`; a valid
|
|
128
|
+
* `{ repos: [...] }` keeps only the string entries.
|
|
129
|
+
*/
|
|
130
|
+
function parseRegistryLike(raw) {
|
|
131
|
+
if (raw === null)
|
|
132
|
+
return { repos: [] };
|
|
133
|
+
try {
|
|
134
|
+
const parsed = JSON.parse(raw);
|
|
135
|
+
if (typeof parsed === 'object' &&
|
|
136
|
+
parsed !== null &&
|
|
137
|
+
!Array.isArray(parsed) &&
|
|
138
|
+
Array.isArray(parsed['repos'])) {
|
|
139
|
+
const repos = parsed['repos'].filter((r) => typeof r === 'string');
|
|
140
|
+
return { repos };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// malformed — treat as empty
|
|
145
|
+
}
|
|
146
|
+
return { repos: [] };
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* CHECK 1 — ENROLLMENT default-empty semantics. Asserts the registry parser
|
|
150
|
+
* yields `{ repos: [] }` for absent (null), malformed (`{`), and wrong-shape
|
|
151
|
+
* (`[]`, `{"repos":"x"}`) inputs, and keeps only string entries otherwise. Runs
|
|
152
|
+
* entirely in-memory against synthesized inputs — the real registry is never
|
|
153
|
+
* touched.
|
|
154
|
+
*/
|
|
155
|
+
function checkEnrollmentDefaultEmpty() {
|
|
156
|
+
const id = 'enrollment-default-empty';
|
|
157
|
+
const label = 'ENROLLMENT: absent/malformed registry parses to { repos: [] }';
|
|
158
|
+
const emptyCases = [null, '', '{', 'null', '[]', '{}', '{"repos":"nope"}'];
|
|
159
|
+
for (const raw of emptyCases) {
|
|
160
|
+
const got = parseRegistryLike(raw);
|
|
161
|
+
if (got.repos.length !== 0) {
|
|
162
|
+
return mk(id, label, false, `input ${JSON.stringify(raw)} did not yield empty repos`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// A valid registry keeps only string entries (drops non-strings).
|
|
166
|
+
const mixed = parseRegistryLike('{"repos":["/a",5,"/b",null]}');
|
|
167
|
+
if (mixed.repos.length !== 2 || mixed.repos[0] !== '/a' || mixed.repos[1] !== '/b') {
|
|
168
|
+
return mk(id, label, false, 'valid registry did not normalize to its string entries');
|
|
169
|
+
}
|
|
170
|
+
return mk(id, label, true);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* CHECK 2 — KILL-SWITCH precedes the enrollment / allowAnyRepo gate. Asserts (by
|
|
174
|
+
* reading the real `assertMayMutate` source) that the kill-switch check appears
|
|
175
|
+
* BEFORE the enrollment check, so `allowAnyRepo` can never reach a mutation while
|
|
176
|
+
* kill is on. Pure source read — never touches `~/.ashlr/KILL`.
|
|
177
|
+
*/
|
|
178
|
+
function checkKillSwitchPrecedence(read) {
|
|
179
|
+
const id = 'kill-switch-precedence';
|
|
180
|
+
const label = 'KILL-SWITCH: kill check precedes the enrollment/allowAnyRepo check';
|
|
181
|
+
let src;
|
|
182
|
+
try {
|
|
183
|
+
src = stripComments(read('sandbox/policy'));
|
|
184
|
+
}
|
|
185
|
+
catch (err) {
|
|
186
|
+
return mk(id, label, false, `could not read policy source: ${errMsg(err)}`);
|
|
187
|
+
}
|
|
188
|
+
const fnIdx = src.indexOf('function assertMayMutate');
|
|
189
|
+
if (fnIdx === -1)
|
|
190
|
+
return mk(id, label, false, 'assertMayMutate not found in policy source');
|
|
191
|
+
// Scan the function BODY (after the parameter list) so the `allowAnyRepo`
|
|
192
|
+
// TYPE annotation in the signature never reorders the comparison — we compare
|
|
193
|
+
// the kill GUARD against the enrollment GUARD, which is unambiguous.
|
|
194
|
+
const bodyIdx = src.indexOf('{', fnIdx);
|
|
195
|
+
const body = bodyIdx === -1 ? src.slice(fnIdx) : src.slice(bodyIdx);
|
|
196
|
+
const killIdx = body.indexOf('killSwitchOn(');
|
|
197
|
+
const enrollIdx = body.indexOf('isEnrolled(');
|
|
198
|
+
if (killIdx === -1)
|
|
199
|
+
return mk(id, label, false, 'assertMayMutate has no killSwitchOn() check');
|
|
200
|
+
if (enrollIdx === -1)
|
|
201
|
+
return mk(id, label, false, 'assertMayMutate has no isEnrolled() check');
|
|
202
|
+
// The kill-switch check MUST appear before the enrollment/allowAnyRepo gate so
|
|
203
|
+
// allowAnyRepo can never reach a mutation while kill is on.
|
|
204
|
+
if (killIdx > enrollIdx) {
|
|
205
|
+
return mk(id, label, false, 'kill-switch check does NOT precede the enrollment/allowAnyRepo check');
|
|
206
|
+
}
|
|
207
|
+
return mk(id, label, true);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* CHECK 3 — DAEMON exports no outward primitive (the [STATIC] grep-guard). Reads
|
|
211
|
+
* `daemon/loop` and asserts its import specifiers + comment-stripped call tokens
|
|
212
|
+
* contain none of apply/push/createPr/deploy. The only inbox import allowed is
|
|
213
|
+
* the read-only `inbox/store` (pendingCount).
|
|
214
|
+
*/
|
|
215
|
+
function checkDaemonNoPrimitive(read) {
|
|
216
|
+
const id = 'daemon-no-primitive';
|
|
217
|
+
const label = 'PROPOSAL-ONLY: daemon/loop imports no apply/push/createPr/deploy primitive';
|
|
218
|
+
let src;
|
|
219
|
+
try {
|
|
220
|
+
src = read('daemon/loop');
|
|
221
|
+
}
|
|
222
|
+
catch (err) {
|
|
223
|
+
return mk(id, label, false, `could not read daemon/loop source: ${errMsg(err)}`);
|
|
224
|
+
}
|
|
225
|
+
// Forbidden import specifiers (substring match on each specifier). Includes
|
|
226
|
+
// the modules that EXPORT outward primitives (apply/createPr/ship/deploy) so a
|
|
227
|
+
// bare named import of one is caught at its specifier even if the call token
|
|
228
|
+
// is later renamed.
|
|
229
|
+
const forbiddenImports = ['inbox/apply', 'integrations/github', 'ship/', 'deploy'];
|
|
230
|
+
for (const spec of importSpecifiers(src)) {
|
|
231
|
+
for (const bad of forbiddenImports) {
|
|
232
|
+
if (spec.includes(bad)) {
|
|
233
|
+
return mk(id, label, false, `forbidden import specifier: ${spec}`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Forbidden CALL tokens (comment-stripped, so a doc-comment mention is fine).
|
|
238
|
+
// Kept in lockstep with the H4 regression suite's set
|
|
239
|
+
// (test/h4.proposal-only.test.ts guard 1.9) so the runtime self-check and CI
|
|
240
|
+
// assert the SAME token surface — including the gitPush( helper form.
|
|
241
|
+
const stripped = stripComments(src);
|
|
242
|
+
const forbiddenTokens = ['applyProposal(', 'createPr(', 'git push', 'gitPush(', 'deploy('];
|
|
243
|
+
for (const tok of forbiddenTokens) {
|
|
244
|
+
if (stripped.includes(tok)) {
|
|
245
|
+
return mk(id, label, false, `forbidden outward call token: ${tok}`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return mk(id, label, true);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* CHECK 4 — SCRUB patterns redact a synthesized secret. Reads the index.ts and
|
|
252
|
+
* graph.ts scrub sources for the drift markers, then invokes the REAL (imported,
|
|
253
|
+
* not copied) `scrubSecrets` over a synthesized JWT / AWS key / assignment-style
|
|
254
|
+
* secret and asserts every raw value is gone. Because it runs the actual
|
|
255
|
+
* redaction logic, a weakening of the real function body or pattern set FAILs
|
|
256
|
+
* this check. Run entirely in-memory on a synthesized string — no file is read
|
|
257
|
+
* into the index and nothing is written.
|
|
258
|
+
*/
|
|
259
|
+
function checkScrubPatterns(read) {
|
|
260
|
+
const id = 'scrub-patterns-match';
|
|
261
|
+
const label = 'SECRET-SCRUB: index.ts/graph.ts scrubSecrets redact a synthesized secret';
|
|
262
|
+
let indexSrc;
|
|
263
|
+
let graphSrc;
|
|
264
|
+
try {
|
|
265
|
+
indexSrc = read('knowledge/index');
|
|
266
|
+
graphSrc = read('knowledge/graph');
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
return mk(id, label, false, `could not read scrub sources: ${errMsg(err)}`);
|
|
270
|
+
}
|
|
271
|
+
// Both impls must define a scrubSecrets + a SECRET pattern source.
|
|
272
|
+
if (!/function scrubSecrets/.test(indexSrc) || !/SECRET_PATTERNS/.test(indexSrc)) {
|
|
273
|
+
return mk(id, label, false, 'index.ts is missing scrubSecrets / SECRET_PATTERNS');
|
|
274
|
+
}
|
|
275
|
+
if (!/function scrubSecrets/.test(graphSrc) || !/SECRET_PATTERNS/.test(graphSrc)) {
|
|
276
|
+
return mk(id, label, false, 'graph.ts is missing scrubSecrets / SECRET_PATTERNS');
|
|
277
|
+
}
|
|
278
|
+
// The index high-entropy markers must still be present (drift-guard against
|
|
279
|
+
// an INJECTED/broken source where the real import can't be swapped). This is
|
|
280
|
+
// what the H4 broken-reader negative test trips: a source missing these
|
|
281
|
+
// markers fails here even though the real import below still redacts.
|
|
282
|
+
if (!indexSrc.includes('AKIA') || !indexSrc.includes('eyJ')) {
|
|
283
|
+
return mk(id, label, false, 'index.ts no longer pins the AWS/JWT secret patterns');
|
|
284
|
+
}
|
|
285
|
+
// STRENGTH: run the REAL scrubSecrets (imported, not copied) over a synthesized
|
|
286
|
+
// secret carrying a JWT, an AWS key, and an assignment-style api_key. If a
|
|
287
|
+
// future change weakens the actual function body OR any pattern in the real
|
|
288
|
+
// SECRET_PATTERNS array, the raw values survive and this check FAILs — so the
|
|
289
|
+
// self-check tracks the real redaction logic, not a drifting private copy.
|
|
290
|
+
const synthSecret = [
|
|
291
|
+
'api_key = "abcdefghij0123456789ABCDEFGHIJ"',
|
|
292
|
+
'aws=AKIAIOSFODNN7EXAMPLE',
|
|
293
|
+
'jwt=eyJhbGci.eyJzdWIiOiIxIn0.SflKxwRJSMeKKF2QT4fwpMeJf36',
|
|
294
|
+
].join(' ');
|
|
295
|
+
const scrubbed = scrubSecrets(synthSecret);
|
|
296
|
+
for (const raw of [
|
|
297
|
+
'abcdefghij0123456789ABCDEFGHIJ',
|
|
298
|
+
'AKIAIOSFODNN7EXAMPLE',
|
|
299
|
+
'eyJhbGci.eyJzdWIiOiIxIn0.SflKxwRJSMeKKF2QT4fwpMeJf36',
|
|
300
|
+
]) {
|
|
301
|
+
if (scrubbed.includes(raw)) {
|
|
302
|
+
return mk(id, label, false, `real scrubSecrets left a secret unredacted: ${raw}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (!scrubbed.includes('[REDACTED]')) {
|
|
306
|
+
return mk(id, label, false, 'real scrubSecrets produced no [REDACTED] marker');
|
|
307
|
+
}
|
|
308
|
+
// The real pattern array must still carry the high-entropy shapes (a complete
|
|
309
|
+
// wipe of the array would leave the synthSecret above only assignment-covered;
|
|
310
|
+
// pin the count so silent shrinkage of the pattern set is visible).
|
|
311
|
+
if (SECRET_PATTERNS.length < 6) {
|
|
312
|
+
return mk(id, label, false, `index SECRET_PATTERNS shrank to ${SECRET_PATTERNS.length} (<6)`);
|
|
313
|
+
}
|
|
314
|
+
// graph.ts must DELEGATE to index.ts's real scrub via the parity import
|
|
315
|
+
// (live code, not a vestigial assignment-regex comment): pin the
|
|
316
|
+
// `from './index.js'` import pulling scrubSecrets + SECRET_PATTERNS, which is
|
|
317
|
+
// the genuine H6 §B.1 strengthening. A cosmetic comment edit can no longer
|
|
318
|
+
// trip this; only removing the real delegation will.
|
|
319
|
+
if (!/from ['"]\.\/index\.js['"]/.test(graphSrc) ||
|
|
320
|
+
!/scrubSecrets/.test(graphSrc) || !/SECRET_PATTERNS/.test(graphSrc)) {
|
|
321
|
+
return mk(id, label, false, 'graph.ts no longer imports the index.ts parity scrub');
|
|
322
|
+
}
|
|
323
|
+
return mk(id, label, true);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* CHECK 5 — PROVIDER cloud-gate present. Reads `run/provider-client` and asserts
|
|
327
|
+
* it defines the `CLOUD_PROVIDERS` gate and the `!opts.allowCloud` (local-first)
|
|
328
|
+
* throw path, so cloud egress can never happen silently.
|
|
329
|
+
*/
|
|
330
|
+
function checkProviderCloudGate(read) {
|
|
331
|
+
const id = 'provider-cloud-gate';
|
|
332
|
+
const label = 'LOCAL-FIRST: provider-client defines the cloud gate + !allowCloud throw';
|
|
333
|
+
let src;
|
|
334
|
+
try {
|
|
335
|
+
src = read('run/provider-client');
|
|
336
|
+
}
|
|
337
|
+
catch (err) {
|
|
338
|
+
return mk(id, label, false, `could not read provider-client source: ${errMsg(err)}`);
|
|
339
|
+
}
|
|
340
|
+
if (!/CLOUD_PROVIDERS\s*=\s*new Set/.test(src)) {
|
|
341
|
+
return mk(id, label, false, 'CLOUD_PROVIDERS gate set not found');
|
|
342
|
+
}
|
|
343
|
+
if (!/isCloudProvider\(/.test(src)) {
|
|
344
|
+
return mk(id, label, false, 'isCloudProvider() gate not found');
|
|
345
|
+
}
|
|
346
|
+
const stripped = stripComments(src);
|
|
347
|
+
if (!/!\s*opts\.allowCloud/.test(stripped)) {
|
|
348
|
+
return mk(id, label, false, '!allowCloud throw path not found');
|
|
349
|
+
}
|
|
350
|
+
if (!/Pass --allow-cloud/.test(stripped)) {
|
|
351
|
+
return mk(id, label, false, 'local-first cloud-gate error message not found');
|
|
352
|
+
}
|
|
353
|
+
// ORDERING (mirrors CHECK 2's kill/enroll precedence technique): a present-but-
|
|
354
|
+
// bypassed gate (throw moved below the local-client build, or an early `return`
|
|
355
|
+
// added before the gate) must NOT pass. Scope the scan to the getActiveClient
|
|
356
|
+
// function BODY so an earlier buildOllamaClient/buildLmStudioClient DEFINITION
|
|
357
|
+
// never confuses the call-site ordering; then assert the cloud-gate refusal
|
|
358
|
+
// appears BEFORE the first LOCAL provider client is BUILT (called).
|
|
359
|
+
const fnIdx = stripped.search(/function getActiveClient\b/);
|
|
360
|
+
const body = fnIdx === -1 ? stripped : stripped.slice(fnIdx);
|
|
361
|
+
const gateIdx = body.search(/if\s*\(\s*isCloudProvider\(/);
|
|
362
|
+
// The cloud-gate refusal is uniquely marked by its 'Pass --allow-cloud' message;
|
|
363
|
+
// use that marker's position as the throw site (robust to error-text edits).
|
|
364
|
+
const throwIdx = body.indexOf('Pass --allow-cloud');
|
|
365
|
+
const allowIdx = body.indexOf('!opts.allowCloud');
|
|
366
|
+
// Call sites within the function body. The body slice starts AT
|
|
367
|
+
// `function getActiveClient`, so the earlier `function buildOllamaClient` /
|
|
368
|
+
// `function buildLmStudioClient` DEFINITIONS are already excluded — any
|
|
369
|
+
// `buildOllamaClient(` / `buildLmStudioClient(` token here is a CALL.
|
|
370
|
+
const localBuildIdx = (() => {
|
|
371
|
+
const o = body.indexOf('buildOllamaClient(');
|
|
372
|
+
const l = body.indexOf('buildLmStudioClient(');
|
|
373
|
+
if (o === -1)
|
|
374
|
+
return l;
|
|
375
|
+
if (l === -1)
|
|
376
|
+
return o;
|
|
377
|
+
return Math.min(o, l);
|
|
378
|
+
})();
|
|
379
|
+
if (gateIdx === -1) {
|
|
380
|
+
return mk(id, label, false, 'isCloudProvider() gate block not found in body');
|
|
381
|
+
}
|
|
382
|
+
if (allowIdx === -1 || allowIdx < gateIdx) {
|
|
383
|
+
return mk(id, label, false, '!opts.allowCloud check is not inside the cloud-gate block');
|
|
384
|
+
}
|
|
385
|
+
if (localBuildIdx !== -1 && throwIdx !== -1 && throwIdx > localBuildIdx) {
|
|
386
|
+
return mk(id, label, false, 'cloud-gate throw does NOT precede the local client build (bypassable)');
|
|
387
|
+
}
|
|
388
|
+
if (localBuildIdx !== -1 && gateIdx > localBuildIdx) {
|
|
389
|
+
return mk(id, label, false, 'cloud-gate block does NOT precede the local client build');
|
|
390
|
+
}
|
|
391
|
+
return mk(id, label, true);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Run all READ-ONLY structural safety checks and return the report.
|
|
395
|
+
*
|
|
396
|
+
* MUTATES NOTHING and makes NO outward call: each check is a pure read (source
|
|
397
|
+
* text + in-memory assertions). Never throws — an unexpected error inside a
|
|
398
|
+
* check is captured as that check FAILing (a thrown check would otherwise be
|
|
399
|
+
* indistinguishable from a missing guard).
|
|
400
|
+
*
|
|
401
|
+
* @param opts optional injectable source reader (test seam, default = this
|
|
402
|
+
* build's own sibling source).
|
|
403
|
+
*/
|
|
404
|
+
export function runSafetyChecks(opts) {
|
|
405
|
+
const read = opts?.readSource ?? defaultReadCore;
|
|
406
|
+
const runners = [
|
|
407
|
+
() => checkEnrollmentDefaultEmpty(),
|
|
408
|
+
() => checkKillSwitchPrecedence(read),
|
|
409
|
+
() => checkDaemonNoPrimitive(read),
|
|
410
|
+
() => checkScrubPatterns(read),
|
|
411
|
+
() => checkProviderCloudGate(read),
|
|
412
|
+
];
|
|
413
|
+
const checks = [];
|
|
414
|
+
for (const run of runners) {
|
|
415
|
+
try {
|
|
416
|
+
checks.push(run());
|
|
417
|
+
}
|
|
418
|
+
catch (err) {
|
|
419
|
+
// A check should never throw, but if one does, record it as a FAIL rather
|
|
420
|
+
// than letting it escape cmdVerifySafety.
|
|
421
|
+
checks.push(mk('check-error', 'a structural check threw', false, errMsg(err)));
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
// COVERAGE GUARD: a future edit that drops a runner from the array must FAIL CI
|
|
425
|
+
// rather than silently shrink the report to a smaller all-passing set. Emit a
|
|
426
|
+
// synthetic FAIL for any EXPECTED id that is missing from the produced checks.
|
|
427
|
+
const producedIds = new Set(checks.map((c) => c.id));
|
|
428
|
+
for (const expected of EXPECTED_CHECK_IDS) {
|
|
429
|
+
if (!producedIds.has(expected)) {
|
|
430
|
+
checks.push(mk('missing-check', `expected check '${expected}' did not run`, false, `coverage regression: '${expected}' is missing from the safety report`));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
const ok = checks.length > 0 && checks.every((c) => c.pass);
|
|
434
|
+
return { ok, checks };
|
|
435
|
+
}
|
|
436
|
+
/** Parse the verify-safety argv. Recognizes only --json/--help; rejects others. */
|
|
437
|
+
function parseArgs(args) {
|
|
438
|
+
const parsed = { json: false, help: false, error: null };
|
|
439
|
+
for (const a of args) {
|
|
440
|
+
if (a === '--json')
|
|
441
|
+
parsed.json = true;
|
|
442
|
+
else if (a === '--help' || a === '-h')
|
|
443
|
+
parsed.help = true;
|
|
444
|
+
else {
|
|
445
|
+
parsed.error = `unknown argument: ${a}`;
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return parsed;
|
|
450
|
+
}
|
|
451
|
+
function printHelp() {
|
|
452
|
+
process.stdout.write([
|
|
453
|
+
'ashlr verify-safety — READ-ONLY safety self-check (mutates nothing).',
|
|
454
|
+
'',
|
|
455
|
+
'Usage:',
|
|
456
|
+
' ashlr verify-safety Human-readable PASS/FAIL report',
|
|
457
|
+
' ashlr verify-safety --json Machine-readable { ok, checks: [...] }',
|
|
458
|
+
'',
|
|
459
|
+
'Exit codes: 0 all pass · 1 a check failed · 2 bad usage',
|
|
460
|
+
'',
|
|
461
|
+
].join('\n'));
|
|
462
|
+
}
|
|
463
|
+
// ---------------------------------------------------------------------------
|
|
464
|
+
// Reporting
|
|
465
|
+
// ---------------------------------------------------------------------------
|
|
466
|
+
/** Render the human-readable PASS/FAIL report to stdout. */
|
|
467
|
+
function renderReport(report) {
|
|
468
|
+
for (const c of report.checks) {
|
|
469
|
+
const tag = c.pass ? 'PASS' : 'FAIL';
|
|
470
|
+
const detail = c.detail ? ` — ${c.detail}` : '';
|
|
471
|
+
process.stdout.write(`[${tag}] ${c.label}${detail}\n`);
|
|
472
|
+
}
|
|
473
|
+
if (report.checks.length === 0) {
|
|
474
|
+
process.stdout.write('verify-safety: no checks ran (unexpected).\n');
|
|
475
|
+
}
|
|
476
|
+
process.stdout.write(`\n${report.ok ? 'OK' : 'FAILED'}: ${report.checks.filter((c) => c.pass).length}/${report.checks.length} checks passed\n`);
|
|
477
|
+
}
|
|
478
|
+
// ---------------------------------------------------------------------------
|
|
479
|
+
// cmdVerifySafety — the CLI entry point (Cmd shape: src/cli/index.ts:59)
|
|
480
|
+
// ---------------------------------------------------------------------------
|
|
481
|
+
/**
|
|
482
|
+
* `ashlr verify-safety` entry point. READ-ONLY: runs the structural safety
|
|
483
|
+
* checks and prints the report. Returns 0 when every check passes, 1 when any
|
|
484
|
+
* check fails, 2 on bad usage. Never throws.
|
|
485
|
+
*/
|
|
486
|
+
export async function cmdVerifySafety(args) {
|
|
487
|
+
// Async only to satisfy the repo's `Cmd = (args) => Promise<number>` shape;
|
|
488
|
+
// the checks themselves are synchronous, read-only, and outward-call-free.
|
|
489
|
+
await Promise.resolve();
|
|
490
|
+
const parsed = parseArgs(args);
|
|
491
|
+
if (parsed.help) {
|
|
492
|
+
printHelp();
|
|
493
|
+
return 0;
|
|
494
|
+
}
|
|
495
|
+
if (parsed.error) {
|
|
496
|
+
process.stderr.write(`error: ${parsed.error}\n`);
|
|
497
|
+
process.stderr.write('Run `ashlr verify-safety --help` for usage.\n');
|
|
498
|
+
return 2;
|
|
499
|
+
}
|
|
500
|
+
const report = runSafetyChecks();
|
|
501
|
+
if (parsed.json) {
|
|
502
|
+
process.stdout.write(JSON.stringify(report, null, 2) + '\n');
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
renderReport(report);
|
|
506
|
+
}
|
|
507
|
+
return report.ok ? 0 : 1;
|
|
508
|
+
}
|
|
509
|
+
//# sourceMappingURL=verify-safety.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-safety.js","sourceRoot":"","sources":["../../src/cli/verify-safety.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,O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
|
+
/**
|
|
2
|
+
* `ashlr wire` — wire the ashlr MCP gateway into editor config(s).
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ashlr wire [claude|codex|cursor|all] [--config <path>] [--json]
|
|
6
|
+
*
|
|
7
|
+
* Defaults to detected editors when no target is specified.
|
|
8
|
+
* Backup-first, deep-merge mcpServers, idempotent, LOCAL only.
|
|
9
|
+
* `--config <path>` overrides the default config path for the first/only target
|
|
10
|
+
* (temp-config-safe for tests; with `all` it applies to each detected editor).
|
|
11
|
+
*
|
|
12
|
+
* Exit codes:
|
|
13
|
+
* 0 all targets wired (or already up-to-date)
|
|
14
|
+
* 1 one or more targets failed
|
|
15
|
+
* 2 bad usage
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* `ashlr wire <claude|codex|cursor|all>` — wire MCP gateway into editor config(s).
|
|
19
|
+
* Defaults to detected editors; backup-first, idempotent, local.
|
|
20
|
+
* Returns a process exit code.
|
|
21
|
+
*/
|
|
22
|
+
export declare function cmdWire(args: string[]): Promise<number>;
|