@vibe-agent-toolkit/cli 0.2.0-rc.11 → 0.2.0-rc.12
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/README.md +3 -3
- package/dist/bin/supervise-cli.d.ts +45 -0
- package/dist/bin/supervise-cli.d.ts.map +1 -0
- package/dist/bin/supervise-cli.js +83 -0
- package/dist/bin/supervise-cli.js.map +1 -0
- package/dist/bin/vat +95 -43
- package/dist/bin/vat.d.ts +15 -4
- package/dist/bin/vat.d.ts.map +1 -1
- package/dist/bin/vat.js +95 -43
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +21 -29
- package/dist/bin.js.map +1 -1
- package/dist/command-tree.d.ts +45 -0
- package/dist/command-tree.d.ts.map +1 -0
- package/dist/command-tree.js +60 -0
- package/dist/command-tree.js.map +1 -0
- package/dist/commands/agent/build-schema.d.ts +100 -0
- package/dist/commands/agent/build-schema.d.ts.map +1 -0
- package/dist/commands/agent/build-schema.js +32 -0
- package/dist/commands/agent/build-schema.js.map +1 -0
- package/dist/commands/agent/build.d.ts +1 -0
- package/dist/commands/agent/build.d.ts.map +1 -1
- package/dist/commands/agent/build.js +63 -33
- package/dist/commands/agent/build.js.map +1 -1
- package/dist/commands/agent/import-schema.d.ts +75 -0
- package/dist/commands/agent/import-schema.d.ts.map +1 -0
- package/dist/commands/agent/import-schema.js +25 -0
- package/dist/commands/agent/import-schema.js.map +1 -0
- package/dist/commands/agent/import.d.ts.map +1 -1
- package/dist/commands/agent/import.js +33 -27
- package/dist/commands/agent/import.js.map +1 -1
- package/dist/commands/agent/index.d.ts.map +1 -1
- package/dist/commands/agent/index.js +132 -37
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/agent/install-path.d.ts.map +1 -1
- package/dist/commands/agent/install-path.js +2 -1
- package/dist/commands/agent/install-path.js.map +1 -1
- package/dist/commands/agent/install-schema.d.ts +89 -0
- package/dist/commands/agent/install-schema.d.ts.map +1 -0
- package/dist/commands/agent/install-schema.js +29 -0
- package/dist/commands/agent/install-schema.js.map +1 -0
- package/dist/commands/agent/install.d.ts +7 -1
- package/dist/commands/agent/install.d.ts.map +1 -1
- package/dist/commands/agent/install.js +78 -108
- package/dist/commands/agent/install.js.map +1 -1
- package/dist/commands/agent/installed-schema.d.ts +140 -0
- package/dist/commands/agent/installed-schema.d.ts.map +1 -0
- package/dist/commands/agent/installed-schema.js +36 -0
- package/dist/commands/agent/installed-schema.js.map +1 -0
- package/dist/commands/agent/installed.d.ts +1 -1
- package/dist/commands/agent/installed.d.ts.map +1 -1
- package/dist/commands/agent/installed.js +104 -75
- package/dist/commands/agent/installed.js.map +1 -1
- package/dist/commands/agent/list-schema.d.ts +128 -0
- package/dist/commands/agent/list-schema.d.ts.map +1 -0
- package/dist/commands/agent/list-schema.js +34 -0
- package/dist/commands/agent/list-schema.js.map +1 -0
- package/dist/commands/agent/list.d.ts +4 -3
- package/dist/commands/agent/list.d.ts.map +1 -1
- package/dist/commands/agent/list.js +50 -37
- package/dist/commands/agent/list.js.map +1 -1
- package/dist/commands/agent/run.d.ts +3 -0
- package/dist/commands/agent/run.d.ts.map +1 -1
- package/dist/commands/agent/run.js +8 -3
- package/dist/commands/agent/run.js.map +1 -1
- package/dist/commands/agent/uninstall-schema.d.ts +89 -0
- package/dist/commands/agent/uninstall-schema.d.ts.map +1 -0
- package/dist/commands/agent/uninstall-schema.js +29 -0
- package/dist/commands/agent/uninstall-schema.js.map +1 -0
- package/dist/commands/agent/uninstall.d.ts +5 -1
- package/dist/commands/agent/uninstall.d.ts.map +1 -1
- package/dist/commands/agent/uninstall.js +50 -38
- package/dist/commands/agent/uninstall.js.map +1 -1
- package/dist/commands/agent/validate-schema.d.ts +129 -0
- package/dist/commands/agent/validate-schema.d.ts.map +1 -0
- package/dist/commands/agent/validate-schema.js +35 -0
- package/dist/commands/agent/validate-schema.js.map +1 -0
- package/dist/commands/agent/validate.d.ts +6 -0
- package/dist/commands/agent/validate.d.ts.map +1 -1
- package/dist/commands/agent/validate.js +64 -36
- package/dist/commands/agent/validate.js.map +1 -1
- package/dist/commands/ard/emit-schema.d.ts +108 -0
- package/dist/commands/ard/emit-schema.d.ts.map +1 -0
- package/dist/commands/ard/emit-schema.js +37 -0
- package/dist/commands/ard/emit-schema.js.map +1 -0
- package/dist/commands/ard/emit.d.ts +21 -65
- package/dist/commands/ard/emit.d.ts.map +1 -1
- package/dist/commands/ard/emit.js +68 -74
- package/dist/commands/ard/emit.js.map +1 -1
- package/dist/commands/ard/index.d.ts.map +1 -1
- package/dist/commands/ard/index.js +14 -11
- package/dist/commands/ard/index.js.map +1 -1
- package/dist/commands/audit/compat-lane-findings.d.ts +65 -0
- package/dist/commands/audit/compat-lane-findings.d.ts.map +1 -0
- package/dist/commands/audit/compat-lane-findings.js +72 -0
- package/dist/commands/audit/compat-lane-findings.js.map +1 -0
- package/dist/commands/audit/distributed-tree.d.ts +2 -2
- package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
- package/dist/commands/audit/distributed-tree.js +23 -12
- package/dist/commands/audit/distributed-tree.js.map +1 -1
- package/dist/commands/audit/git-url-clone.d.ts +15 -7
- package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
- package/dist/commands/audit/git-url-clone.js +85 -42
- package/dist/commands/audit/git-url-clone.js.map +1 -1
- package/dist/commands/audit/hierarchical-output.d.ts +28 -4
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
- package/dist/commands/audit/hierarchical-output.js +44 -27
- package/dist/commands/audit/hierarchical-output.js.map +1 -1
- package/dist/commands/audit/scan-population.d.ts.map +1 -1
- package/dist/commands/audit/scan-population.js +2 -1
- package/dist/commands/audit/scan-population.js.map +1 -1
- package/dist/commands/audit-schema.d.ts +1247 -0
- package/dist/commands/audit-schema.d.ts.map +1 -0
- package/dist/commands/audit-schema.js +139 -0
- package/dist/commands/audit-schema.js.map +1 -0
- package/dist/commands/audit-settings-schema.d.ts +417 -0
- package/dist/commands/audit-settings-schema.d.ts.map +1 -0
- package/dist/commands/audit-settings-schema.js +77 -0
- package/dist/commands/audit-settings-schema.js.map +1 -0
- package/dist/commands/audit-settings.d.ts +28 -9
- package/dist/commands/audit-settings.d.ts.map +1 -1
- package/dist/commands/audit-settings.js +215 -151
- package/dist/commands/audit-settings.js.map +1 -1
- package/dist/commands/audit.d.ts +72 -33
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +405 -411
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +61 -4
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +176 -190
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cache/clear-schema.d.ts +111 -0
- package/dist/commands/cache/clear-schema.d.ts.map +1 -0
- package/dist/commands/cache/clear-schema.js +37 -0
- package/dist/commands/cache/clear-schema.js.map +1 -0
- package/dist/commands/cache/clear.d.ts +28 -26
- package/dist/commands/cache/clear.d.ts.map +1 -1
- package/dist/commands/cache/clear.js +108 -103
- package/dist/commands/cache/clear.js.map +1 -1
- package/dist/commands/cache/index.d.ts.map +1 -1
- package/dist/commands/cache/index.js +13 -7
- package/dist/commands/cache/index.js.map +1 -1
- package/dist/commands/claude/claude-config.d.ts +23 -6
- package/dist/commands/claude/claude-config.d.ts.map +1 -1
- package/dist/commands/claude/claude-config.js +29 -15
- package/dist/commands/claude/claude-config.js.map +1 -1
- package/dist/commands/claude/context.d.ts +55 -2
- package/dist/commands/claude/context.d.ts.map +1 -1
- package/dist/commands/claude/context.js +74 -50
- package/dist/commands/claude/context.js.map +1 -1
- package/dist/commands/claude/marketplace/changelog-utils.js +2 -2
- package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts +14 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.js +135 -68
- package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.d.ts +3 -5
- package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.js +16 -7
- package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/publish-schema.d.ts +137 -0
- package/dist/commands/claude/marketplace/publish-schema.d.ts.map +1 -0
- package/dist/commands/claude/marketplace/publish-schema.js +32 -0
- package/dist/commands/claude/marketplace/publish-schema.js.map +1 -0
- package/dist/commands/claude/marketplace/publish-tree.d.ts +6 -0
- package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish-tree.js +75 -17
- package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
- package/dist/commands/claude/marketplace/publish.d.ts +27 -0
- package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish.js +84 -50
- package/dist/commands/claude/marketplace/publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate-schema.d.ts +362 -0
- package/dist/commands/claude/marketplace/validate-schema.d.ts.map +1 -0
- package/dist/commands/claude/marketplace/validate-schema.js +67 -0
- package/dist/commands/claude/marketplace/validate-schema.js.map +1 -0
- package/dist/commands/claude/marketplace/validate.d.ts +40 -53
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +358 -214
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/api-keys.d.ts +3 -0
- package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
- package/dist/commands/claude/org/api-keys.js +4 -5
- package/dist/commands/claude/org/api-keys.js.map +1 -1
- package/dist/commands/claude/org/code-analytics.js +1 -1
- package/dist/commands/claude/org/code-analytics.js.map +1 -1
- package/dist/commands/claude/org/cost.d.ts.map +1 -1
- package/dist/commands/claude/org/cost.js +11 -33
- package/dist/commands/claude/org/cost.js.map +1 -1
- package/dist/commands/claude/org/helpers.d.ts +40 -27
- package/dist/commands/claude/org/helpers.d.ts.map +1 -1
- package/dist/commands/claude/org/helpers.js +61 -66
- package/dist/commands/claude/org/helpers.js.map +1 -1
- package/dist/commands/claude/org/index.d.ts.map +1 -1
- package/dist/commands/claude/org/index.js +10 -4
- package/dist/commands/claude/org/index.js.map +1 -1
- package/dist/commands/claude/org/info.d.ts.map +1 -1
- package/dist/commands/claude/org/info.js +2 -3
- package/dist/commands/claude/org/info.js.map +1 -1
- package/dist/commands/claude/org/invites.d.ts +3 -0
- package/dist/commands/claude/org/invites.d.ts.map +1 -1
- package/dist/commands/claude/org/invites.js +5 -7
- package/dist/commands/claude/org/invites.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +76 -21
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +273 -246
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/org/stubs-schema.d.ts +56 -0
- package/dist/commands/claude/org/stubs-schema.d.ts.map +1 -0
- package/dist/commands/claude/org/stubs-schema.js +23 -0
- package/dist/commands/claude/org/stubs-schema.js.map +1 -0
- package/dist/commands/claude/org/stubs.d.ts +8 -3
- package/dist/commands/claude/org/stubs.d.ts.map +1 -1
- package/dist/commands/claude/org/stubs.js +9 -9
- package/dist/commands/claude/org/stubs.js.map +1 -1
- package/dist/commands/claude/org/usage.d.ts.map +1 -1
- package/dist/commands/claude/org/usage.js +1 -2
- package/dist/commands/claude/org/usage.js.map +1 -1
- package/dist/commands/claude/org/users.d.ts +3 -0
- package/dist/commands/claude/org/users.d.ts.map +1 -1
- package/dist/commands/claude/org/users.js +6 -8
- package/dist/commands/claude/org/users.js.map +1 -1
- package/dist/commands/claude/org/workspaces.d.ts +3 -0
- package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
- package/dist/commands/claude/org/workspaces.js +10 -15
- package/dist/commands/claude/org/workspaces.js.map +1 -1
- package/dist/commands/claude/plugin/build-schema.d.ts +642 -0
- package/dist/commands/claude/plugin/build-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/build-schema.js +51 -0
- package/dist/commands/claude/plugin/build-schema.js.map +1 -0
- package/dist/commands/claude/plugin/build.d.ts +220 -45
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +466 -249
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/helpers.d.ts +186 -24
- package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
- package/dist/commands/claude/plugin/helpers.js +110 -68
- package/dist/commands/claude/plugin/helpers.js.map +1 -1
- package/dist/commands/claude/plugin/install-schema.d.ts +144 -0
- package/dist/commands/claude/plugin/install-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/install-schema.js +36 -0
- package/dist/commands/claude/plugin/install-schema.js.map +1 -0
- package/dist/commands/claude/plugin/install.d.ts +191 -11
- package/dist/commands/claude/plugin/install.d.ts.map +1 -1
- package/dist/commands/claude/plugin/install.js +688 -628
- package/dist/commands/claude/plugin/install.js.map +1 -1
- package/dist/commands/claude/plugin/kept-findings.d.ts +19 -0
- package/dist/commands/claude/plugin/kept-findings.d.ts.map +1 -0
- package/dist/commands/claude/plugin/kept-findings.js +24 -0
- package/dist/commands/claude/plugin/kept-findings.js.map +1 -0
- package/dist/commands/claude/plugin/list-schema.d.ts +223 -0
- package/dist/commands/claude/plugin/list-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/list-schema.js +34 -0
- package/dist/commands/claude/plugin/list-schema.js.map +1 -0
- package/dist/commands/claude/plugin/list.d.ts +18 -0
- package/dist/commands/claude/plugin/list.d.ts.map +1 -1
- package/dist/commands/claude/plugin/list.js +53 -45
- package/dist/commands/claude/plugin/list.js.map +1 -1
- package/dist/commands/claude/plugin/npm-pack.d.ts +15 -0
- package/dist/commands/claude/plugin/npm-pack.d.ts.map +1 -0
- package/dist/commands/claude/plugin/npm-pack.js +39 -0
- package/dist/commands/claude/plugin/npm-pack.js.map +1 -0
- package/dist/commands/claude/plugin/plugin-changelog.d.ts +5 -1
- package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-changelog.js +9 -5
- package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.d.ts +21 -2
- package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.js +65 -32
- package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.d.ts +13 -0
- package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.js +64 -16
- package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +63 -37
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/claude/plugin/uninstall-schema.d.ts +112 -0
- package/dist/commands/claude/plugin/uninstall-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/uninstall-schema.js +28 -0
- package/dist/commands/claude/plugin/uninstall-schema.js.map +1 -0
- package/dist/commands/claude/plugin/uninstall.d.ts +57 -0
- package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
- package/dist/commands/claude/plugin/uninstall.js +176 -64
- package/dist/commands/claude/plugin/uninstall.js.map +1 -1
- package/dist/commands/consistency-check.d.ts.map +1 -1
- package/dist/commands/consistency-check.js +8 -6
- package/dist/commands/consistency-check.js.map +1 -1
- package/dist/commands/corpus/index.d.ts.map +1 -1
- package/dist/commands/corpus/index.js +26 -10
- package/dist/commands/corpus/index.js.map +1 -1
- package/dist/commands/corpus/report.d.ts +34 -16
- package/dist/commands/corpus/report.d.ts.map +1 -1
- package/dist/commands/corpus/report.js +36 -18
- package/dist/commands/corpus/report.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts +25 -20
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +123 -67
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/corpus/scan-schema.d.ts +127 -0
- package/dist/commands/corpus/scan-schema.d.ts.map +1 -0
- package/dist/commands/corpus/scan-schema.js +31 -0
- package/dist/commands/corpus/scan-schema.js.map +1 -0
- package/dist/commands/corpus/scan.d.ts +31 -0
- package/dist/commands/corpus/scan.d.ts.map +1 -1
- package/dist/commands/corpus/scan.js +124 -50
- package/dist/commands/corpus/scan.js.map +1 -1
- package/dist/commands/corpus/seed.d.ts +11 -8
- package/dist/commands/corpus/seed.d.ts.map +1 -1
- package/dist/commands/corpus/seed.js +29 -11
- package/dist/commands/corpus/seed.js.map +1 -1
- package/dist/commands/doctor-render.d.ts +52 -0
- package/dist/commands/doctor-render.d.ts.map +1 -0
- package/dist/commands/doctor-render.js +110 -0
- package/dist/commands/doctor-render.js.map +1 -0
- package/dist/commands/doctor-schema.d.ts +191 -0
- package/dist/commands/doctor-schema.d.ts.map +1 -0
- package/dist/commands/doctor-schema.js +44 -0
- package/dist/commands/doctor-schema.js.map +1 -0
- package/dist/commands/doctor.d.ts +7 -62
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +126 -165
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/inventory-schema.d.ts +7297 -0
- package/dist/commands/inventory-schema.d.ts.map +1 -0
- package/dist/commands/inventory-schema.js +28 -0
- package/dist/commands/inventory-schema.js.map +1 -0
- package/dist/commands/inventory.d.ts +1 -1
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +89 -41
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/mcp/index.d.ts.map +1 -1
- package/dist/commands/mcp/index.js +15 -0
- package/dist/commands/mcp/index.js.map +1 -1
- package/dist/commands/mcp/list-collections-schema.d.ts +101 -0
- package/dist/commands/mcp/list-collections-schema.d.ts.map +1 -0
- package/dist/commands/mcp/list-collections-schema.js +22 -0
- package/dist/commands/mcp/list-collections-schema.js.map +1 -0
- package/dist/commands/mcp/list-collections.d.ts +1 -1
- package/dist/commands/mcp/list-collections.d.ts.map +1 -1
- package/dist/commands/mcp/list-collections.js +19 -17
- package/dist/commands/mcp/list-collections.js.map +1 -1
- package/dist/commands/mcp/serve.d.ts +5 -0
- package/dist/commands/mcp/serve.d.ts.map +1 -1
- package/dist/commands/mcp/serve.js +29 -15
- package/dist/commands/mcp/serve.js.map +1 -1
- package/dist/commands/okf/index.d.ts.map +1 -1
- package/dist/commands/okf/index.js +6 -5
- package/dist/commands/okf/index.js.map +1 -1
- package/dist/commands/okf/validate-schema.d.ts +171 -0
- package/dist/commands/okf/validate-schema.d.ts.map +1 -0
- package/dist/commands/okf/validate-schema.js +44 -0
- package/dist/commands/okf/validate-schema.js.map +1 -0
- package/dist/commands/okf/validate.d.ts +16 -149
- package/dist/commands/okf/validate.d.ts.map +1 -1
- package/dist/commands/okf/validate.js +64 -62
- package/dist/commands/okf/validate.js.map +1 -1
- package/dist/commands/orchestrator-schema.d.ts +419 -0
- package/dist/commands/orchestrator-schema.d.ts.map +1 -0
- package/dist/commands/orchestrator-schema.js +91 -0
- package/dist/commands/orchestrator-schema.js.map +1 -0
- package/dist/commands/phase-utils.d.ts +188 -220
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +210 -258
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/positional-args.d.ts +13 -11
- package/dist/commands/positional-args.d.ts.map +1 -1
- package/dist/commands/positional-args.js +16 -15
- package/dist/commands/positional-args.js.map +1 -1
- package/dist/commands/rag/admin-schema.d.ts +152 -0
- package/dist/commands/rag/admin-schema.d.ts.map +1 -0
- package/dist/commands/rag/admin-schema.js +31 -0
- package/dist/commands/rag/admin-schema.js.map +1 -0
- package/dist/commands/rag/clear-command.d.ts.map +1 -1
- package/dist/commands/rag/clear-command.js +30 -15
- package/dist/commands/rag/clear-command.js.map +1 -1
- package/dist/commands/rag/command-helpers.d.ts +31 -7
- package/dist/commands/rag/command-helpers.d.ts.map +1 -1
- package/dist/commands/rag/command-helpers.js +41 -21
- package/dist/commands/rag/command-helpers.js.map +1 -1
- package/dist/commands/rag/index-command.d.ts +37 -48
- package/dist/commands/rag/index-command.d.ts.map +1 -1
- package/dist/commands/rag/index-command.js +80 -65
- package/dist/commands/rag/index-command.js.map +1 -1
- package/dist/commands/rag/index-schema.d.ts +107 -0
- package/dist/commands/rag/index-schema.d.ts.map +1 -0
- package/dist/commands/rag/index-schema.js +34 -0
- package/dist/commands/rag/index-schema.js.map +1 -0
- package/dist/commands/rag/index.d.ts.map +1 -1
- package/dist/commands/rag/index.js +88 -41
- package/dist/commands/rag/index.js.map +1 -1
- package/dist/commands/rag/query-command.d.ts +18 -4
- package/dist/commands/rag/query-command.d.ts.map +1 -1
- package/dist/commands/rag/query-command.js +42 -27
- package/dist/commands/rag/query-command.js.map +1 -1
- package/dist/commands/rag/query-schema.d.ts +363 -0
- package/dist/commands/rag/query-schema.d.ts.map +1 -0
- package/dist/commands/rag/query-schema.js +59 -0
- package/dist/commands/rag/query-schema.js.map +1 -0
- package/dist/commands/rag/stats-command.d.ts.map +1 -1
- package/dist/commands/rag/stats-command.js +19 -18
- package/dist/commands/rag/stats-command.js.map +1 -1
- package/dist/commands/resources/check-progress.d.ts +64 -11
- package/dist/commands/resources/check-progress.d.ts.map +1 -1
- package/dist/commands/resources/check-progress.js +77 -4
- package/dist/commands/resources/check-progress.js.map +1 -1
- package/dist/commands/resources/check-schema.d.ts +335 -0
- package/dist/commands/resources/check-schema.d.ts.map +1 -0
- package/dist/commands/resources/check-schema.js +104 -0
- package/dist/commands/resources/check-schema.js.map +1 -0
- package/dist/commands/resources/check-supervisor.d.ts +315 -71
- package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
- package/dist/commands/resources/check-supervisor.js +493 -107
- package/dist/commands/resources/check-supervisor.js.map +1 -1
- package/dist/commands/resources/check.d.ts +56 -249
- package/dist/commands/resources/check.d.ts.map +1 -1
- package/dist/commands/resources/check.js +416 -276
- package/dist/commands/resources/check.js.map +1 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +165 -91
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/query-schema.d.ts +188 -0
- package/dist/commands/resources/query-schema.d.ts.map +1 -0
- package/dist/commands/resources/query-schema.js +48 -0
- package/dist/commands/resources/query-schema.js.map +1 -0
- package/dist/commands/resources/query.d.ts +17 -12
- package/dist/commands/resources/query.d.ts.map +1 -1
- package/dist/commands/resources/query.js +60 -48
- package/dist/commands/resources/query.js.map +1 -1
- package/dist/commands/resources/scan-schema.d.ts +195 -0
- package/dist/commands/resources/scan-schema.d.ts.map +1 -0
- package/dist/commands/resources/scan-schema.js +53 -0
- package/dist/commands/resources/scan-schema.js.map +1 -0
- package/dist/commands/resources/scan.d.ts +26 -3
- package/dist/commands/resources/scan.d.ts.map +1 -1
- package/dist/commands/resources/scan.js +51 -53
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/commands/resources/validate-schema.d.ts +326 -0
- package/dist/commands/resources/validate-schema.d.ts.map +1 -0
- package/dist/commands/resources/validate-schema.js +60 -0
- package/dist/commands/resources/validate-schema.js.map +1 -0
- package/dist/commands/resources/validate.d.ts +45 -169
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +221 -485
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review-checklist.d.ts.map +1 -1
- package/dist/commands/skill/review-checklist.js +0 -1
- package/dist/commands/skill/review-checklist.js.map +1 -1
- package/dist/commands/skill/review-schema.d.ts +278 -0
- package/dist/commands/skill/review-schema.d.ts.map +1 -0
- package/dist/commands/skill/review-schema.js +46 -0
- package/dist/commands/skill/review-schema.js.map +1 -0
- package/dist/commands/skill/review.d.ts +8 -234
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +54 -78
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skill/test/auth-flags.d.ts +3 -0
- package/dist/commands/skill/test/auth-flags.d.ts.map +1 -1
- package/dist/commands/skill/test/auth-flags.js +6 -2
- package/dist/commands/skill/test/auth-flags.js.map +1 -1
- package/dist/commands/skill/test/configure-schema.d.ts +67 -0
- package/dist/commands/skill/test/configure-schema.d.ts.map +1 -0
- package/dist/commands/skill/test/configure-schema.js +27 -0
- package/dist/commands/skill/test/configure-schema.js.map +1 -0
- package/dist/commands/skill/test/configure.d.ts +12 -5
- package/dist/commands/skill/test/configure.d.ts.map +1 -1
- package/dist/commands/skill/test/configure.js +101 -31
- package/dist/commands/skill/test/configure.js.map +1 -1
- package/dist/commands/skill/test/run-schema.d.ts +107 -0
- package/dist/commands/skill/test/run-schema.d.ts.map +1 -0
- package/dist/commands/skill/test/run-schema.js +36 -0
- package/dist/commands/skill/test/run-schema.js.map +1 -0
- package/dist/commands/skill/test/run.d.ts +3 -2
- package/dist/commands/skill/test/run.d.ts.map +1 -1
- package/dist/commands/skill/test/run.js +316 -155
- package/dist/commands/skill/test/run.js.map +1 -1
- package/dist/commands/skills/build-schema.d.ts +199 -0
- package/dist/commands/skills/build-schema.d.ts.map +1 -0
- package/dist/commands/skills/build-schema.js +55 -0
- package/dist/commands/skills/build-schema.js.map +1 -0
- package/dist/commands/skills/build.d.ts +95 -298
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +415 -818
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/command-helpers.d.ts +5 -11
- package/dist/commands/skills/command-helpers.d.ts.map +1 -1
- package/dist/commands/skills/command-helpers.js +7 -17
- package/dist/commands/skills/command-helpers.js.map +1 -1
- package/dist/commands/skills/index.js +12 -6
- package/dist/commands/skills/index.js.map +1 -1
- package/dist/commands/skills/install-schema.d.ts +153 -0
- package/dist/commands/skills/install-schema.d.ts.map +1 -0
- package/dist/commands/skills/install-schema.js +44 -0
- package/dist/commands/skills/install-schema.js.map +1 -0
- package/dist/commands/skills/install.d.ts +76 -8
- package/dist/commands/skills/install.d.ts.map +1 -1
- package/dist/commands/skills/install.js +230 -194
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/skills/list-schema.d.ts +145 -0
- package/dist/commands/skills/list-schema.d.ts.map +1 -0
- package/dist/commands/skills/list-schema.js +37 -0
- package/dist/commands/skills/list-schema.js.map +1 -0
- package/dist/commands/skills/list.d.ts +39 -8
- package/dist/commands/skills/list.d.ts.map +1 -1
- package/dist/commands/skills/list.js +110 -122
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/package-schema.d.ts +98 -0
- package/dist/commands/skills/package-schema.d.ts.map +1 -0
- package/dist/commands/skills/package-schema.js +32 -0
- package/dist/commands/skills/package-schema.js.map +1 -0
- package/dist/commands/skills/package.d.ts +85 -14
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +288 -207
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/scope-guard.d.ts +27 -20
- package/dist/commands/skills/scope-guard.d.ts.map +1 -1
- package/dist/commands/skills/scope-guard.js +43 -32
- package/dist/commands/skills/scope-guard.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts +1 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +40 -19
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/source-resolvers.d.ts +58 -8
- package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
- package/dist/commands/skills/source-resolvers.js +113 -38
- package/dist/commands/skills/source-resolvers.js.map +1 -1
- package/dist/commands/skills/validate-command.d.ts.map +1 -1
- package/dist/commands/skills/validate-command.js +31 -51
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate-schema.d.ts +199 -0
- package/dist/commands/skills/validate-schema.d.ts.map +1 -0
- package/dist/commands/skills/validate-schema.js +44 -0
- package/dist/commands/skills/validate-schema.js.map +1 -0
- package/dist/commands/skills/validate.d.ts +100 -136
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +257 -343
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/validate.d.ts +17 -5
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +139 -94
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +121 -110
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +230 -294
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/report-schemas.d.ts +12398 -35
- package/dist/report-schemas.d.ts.map +1 -1
- package/dist/report-schemas.js +624 -66
- package/dist/report-schemas.js.map +1 -1
- package/dist/skill-resolution/packaging-config.js +2 -2
- package/dist/skill-resolution/packaging-config.js.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.js +20 -13
- package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
- package/dist/utils/agent-discovery.d.ts +34 -1
- package/dist/utils/agent-discovery.d.ts.map +1 -1
- package/dist/utils/agent-discovery.js +80 -38
- package/dist/utils/agent-discovery.js.map +1 -1
- package/dist/utils/claude-context-lens.d.ts +13 -6
- package/dist/utils/claude-context-lens.d.ts.map +1 -1
- package/dist/utils/claude-context-lens.js +11 -12
- package/dist/utils/claude-context-lens.js.map +1 -1
- package/dist/utils/command-error-codes.d.ts +12 -0
- package/dist/utils/command-error-codes.d.ts.map +1 -0
- package/dist/utils/command-error-codes.js +12 -0
- package/dist/utils/command-error-codes.js.map +1 -0
- package/dist/utils/command-refusal.d.ts +58 -0
- package/dist/utils/command-refusal.d.ts.map +1 -0
- package/dist/utils/command-refusal.js +170 -0
- package/dist/utils/command-refusal.js.map +1 -0
- package/dist/utils/commander-ending.d.ts +40 -0
- package/dist/utils/commander-ending.d.ts.map +1 -0
- package/dist/utils/commander-ending.js +42 -0
- package/dist/utils/commander-ending.js.map +1 -0
- package/dist/utils/config-loader.d.ts +13 -8
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +84 -45
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/corpus-target.d.ts +1 -1
- package/dist/utils/corpus-target.d.ts.map +1 -1
- package/dist/utils/corpus-target.js +6 -4
- package/dist/utils/corpus-target.js.map +1 -1
- package/dist/utils/debug-diagnostics.d.ts +18 -0
- package/dist/utils/debug-diagnostics.d.ts.map +1 -0
- package/dist/utils/debug-diagnostics.js +23 -0
- package/dist/utils/debug-diagnostics.js.map +1 -0
- package/dist/utils/document-writer.d.ts +191 -0
- package/dist/utils/document-writer.d.ts.map +1 -0
- package/dist/utils/document-writer.js +319 -0
- package/dist/utils/document-writer.js.map +1 -0
- package/dist/utils/help-loader.d.ts +2 -2
- package/dist/utils/help-loader.js +2 -2
- package/dist/utils/install-plan.d.ts +99 -0
- package/dist/utils/install-plan.d.ts.map +1 -0
- package/dist/utils/install-plan.js +146 -0
- package/dist/utils/install-plan.js.map +1 -0
- package/dist/utils/issue-anchor.d.ts +1 -1
- package/dist/utils/issue-anchor.d.ts.map +1 -1
- package/dist/utils/issue-anchor.js.map +1 -1
- package/dist/utils/issue-rendering.d.ts +8 -3
- package/dist/utils/issue-rendering.d.ts.map +1 -1
- package/dist/utils/issue-rendering.js +4 -0
- package/dist/utils/issue-rendering.js.map +1 -1
- package/dist/utils/lens-population.d.ts +20 -0
- package/dist/utils/lens-population.d.ts.map +1 -0
- package/dist/utils/lens-population.js +15 -0
- package/dist/utils/lens-population.js.map +1 -0
- package/dist/utils/marketplace-io.d.ts +63 -0
- package/dist/utils/marketplace-io.d.ts.map +1 -0
- package/dist/utils/marketplace-io.js +63 -0
- package/dist/utils/marketplace-io.js.map +1 -0
- package/dist/utils/operator-notices.d.ts +97 -0
- package/dist/utils/operator-notices.d.ts.map +1 -0
- package/dist/utils/operator-notices.js +115 -0
- package/dist/utils/operator-notices.js.map +1 -0
- package/dist/utils/optional-backend.d.ts +18 -15
- package/dist/utils/optional-backend.d.ts.map +1 -1
- package/dist/utils/optional-backend.js +22 -33
- package/dist/utils/optional-backend.js.map +1 -1
- package/dist/utils/output.d.ts +5 -43
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +8 -63
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/package-json.d.ts +3 -4
- package/dist/utils/package-json.d.ts.map +1 -1
- package/dist/utils/package-json.js +8 -8
- package/dist/utils/package-json.js.map +1 -1
- package/dist/utils/population-wiring.d.ts +31 -38
- package/dist/utils/population-wiring.d.ts.map +1 -1
- package/dist/utils/population-wiring.js +38 -32
- package/dist/utils/population-wiring.js.map +1 -1
- package/dist/utils/project-root-policy.d.ts +74 -1
- package/dist/utils/project-root-policy.d.ts.map +1 -1
- package/dist/utils/project-root-policy.js +146 -8
- package/dist/utils/project-root-policy.js.map +1 -1
- package/dist/utils/projection-lenses.d.ts +25 -7
- package/dist/utils/projection-lenses.d.ts.map +1 -1
- package/dist/utils/projection-lenses.js +20 -6
- package/dist/utils/projection-lenses.js.map +1 -1
- package/dist/utils/projection-query.d.ts +17 -10
- package/dist/utils/projection-query.d.ts.map +1 -1
- package/dist/utils/projection-query.js +47 -28
- package/dist/utils/projection-query.js.map +1 -1
- package/dist/utils/projection-store.d.ts +2 -2
- package/dist/utils/projection-store.d.ts.map +1 -1
- package/dist/utils/projection-store.js +74 -45
- package/dist/utils/projection-store.js.map +1 -1
- package/dist/utils/rag-database.d.ts +61 -0
- package/dist/utils/rag-database.d.ts.map +1 -0
- package/dist/utils/rag-database.js +178 -0
- package/dist/utils/rag-database.js.map +1 -0
- package/dist/utils/relation-limits.d.ts +7 -2
- package/dist/utils/relation-limits.d.ts.map +1 -1
- package/dist/utils/relation-limits.js +6 -1
- package/dist/utils/relation-limits.js.map +1 -1
- package/dist/utils/relativize-paths.d.ts +23 -0
- package/dist/utils/relativize-paths.d.ts.map +1 -1
- package/dist/utils/relativize-paths.js +32 -1
- package/dist/utils/relativize-paths.js.map +1 -1
- package/dist/utils/resource-loader.d.ts +76 -32
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +132 -66
- package/dist/utils/resource-loader.js.map +1 -1
- package/dist/utils/run-integrity.d.ts +64 -31
- package/dist/utils/run-integrity.d.ts.map +1 -1
- package/dist/utils/run-integrity.js +76 -35
- package/dist/utils/run-integrity.js.map +1 -1
- package/dist/utils/scope-locations.d.ts +7 -5
- package/dist/utils/scope-locations.d.ts.map +1 -1
- package/dist/utils/scope-locations.js +37 -12
- package/dist/utils/scope-locations.js.map +1 -1
- package/dist/utils/staging-dir.d.ts +7 -0
- package/dist/utils/staging-dir.d.ts.map +1 -0
- package/dist/utils/staging-dir.js +12 -0
- package/dist/utils/staging-dir.js.map +1 -0
- package/dist/utils/url-redact.d.ts +9 -0
- package/dist/utils/url-redact.d.ts.map +1 -1
- package/dist/utils/url-redact.js +13 -0
- package/dist/utils/url-redact.js.map +1 -1
- package/dist/utils/user-context-scanner.d.ts +3 -2
- package/dist/utils/user-context-scanner.d.ts.map +1 -1
- package/dist/utils/user-context-scanner.js +24 -4
- package/dist/utils/user-context-scanner.js.map +1 -1
- package/dist/utils/validate-help-files.d.ts.map +1 -1
- package/dist/utils/validate-help-files.js +8 -14
- package/dist/utils/validate-help-files.js.map +1 -1
- package/dist/utils/vat-bin-path.d.ts.map +1 -1
- package/dist/utils/vat-bin-path.js +3 -3
- package/dist/utils/vat-bin-path.js.map +1 -1
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +5 -5
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/docs/agent.md +347 -2
- package/docs/audit.md +312 -89
- package/docs/doctor.md +65 -19
- package/docs/index.md +571 -20
- package/docs/mcp.md +64 -12
- package/docs/rag.md +176 -48
- package/docs/resources.md +257 -71
- package/docs/skill-test.md +148 -19
- package/docs/skills.md +459 -174
- package/package.json +16 -19
- package/schemas/agent-build.json +268 -0
- package/schemas/agent-import.json +252 -0
- package/schemas/agent-install.json +260 -0
- package/schemas/agent-installed.json +287 -0
- package/schemas/agent-list.json +279 -0
- package/schemas/agent-uninstall.json +260 -0
- package/schemas/agent-validate.json +279 -0
- package/schemas/ard-emit.json +224 -106
- package/schemas/audit-settings.json +472 -0
- package/schemas/audit.json +635 -0
- package/schemas/cache-clear.json +273 -0
- package/schemas/claude-marketplace-publish.json +286 -0
- package/schemas/claude-marketplace-validate.json +352 -0
- package/schemas/claude-org-not-implemented.json +239 -0
- package/schemas/claude-plugin-build.json +446 -0
- package/schemas/claude-plugin-install.json +291 -0
- package/schemas/claude-plugin-list.json +326 -0
- package/schemas/claude-plugin-uninstall.json +272 -0
- package/schemas/corpus-audit.json +635 -0
- package/schemas/corpus-scan.json +293 -0
- package/schemas/doctor.json +299 -0
- package/schemas/inventory.json +982 -0
- package/schemas/mcp-list-collections.json +268 -0
- package/schemas/okf-validate.json +224 -106
- package/schemas/orchestrator.json +299 -0
- package/schemas/rag-clear.json +253 -0
- package/schemas/rag-index.json +273 -0
- package/schemas/rag-query.json +365 -0
- package/schemas/rag-stats.json +269 -0
- package/schemas/resources-check.json +242 -108
- package/schemas/resources-query.json +333 -0
- package/schemas/resources-scan.json +321 -0
- package/schemas/resources-validate.json +332 -0
- package/schemas/skill-review.json +224 -106
- package/schemas/skill-test-configure.json +256 -0
- package/schemas/skill-test-run.json +296 -0
- package/schemas/skills-build.json +325 -0
- package/schemas/skills-install.json +287 -0
- package/schemas/skills-list.json +283 -0
- package/schemas/skills-package.json +270 -0
- package/schemas/skills-validate.json +285 -0
- package/dist/commands/skills/shared.d.ts +0 -29
- package/dist/commands/skills/shared.d.ts.map +0 -1
- package/dist/commands/skills/shared.js +0 -33
- package/dist/commands/skills/shared.js.map +0 -1
- package/dist/utils/command-error.d.ts +0 -194
- package/dist/utils/command-error.d.ts.map +0 -1
- package/dist/utils/command-error.js +0 -237
- package/dist/utils/command-error.js.map +0 -1
|
@@ -29,114 +29,22 @@
|
|
|
29
29
|
* a runtime optimizer to schedule between.
|
|
30
30
|
*/
|
|
31
31
|
import { performance } from 'node:perf_hooks';
|
|
32
|
-
import { bindBuiltinChecks, BUILTIN_CHECK_NAMES, issuesFromCheckRows,
|
|
33
|
-
import { buildReport, CUSTOM_CHECK_CODE_PREFIX,
|
|
32
|
+
import { bindBuiltinChecks, BUILTIN_CHECK_NAMES, issuesFromCheckRows, } from '@vibe-agent-toolkit/resources';
|
|
33
|
+
import { buildErrorReport, buildReport, CUSTOM_CHECK_CODE_PREFIX, isCustomCheckCode, toFindings, withAddedFindings, } from '@vibe-agent-toolkit/schema';
|
|
34
34
|
import { safePath } from '@vibe-agent-toolkit/utils';
|
|
35
|
-
import {
|
|
36
|
-
import { handleReportCommandError } from '../../utils/command-error.js';
|
|
35
|
+
import { CommandRefusalError, refusalCodeOf } from '../../utils/command-refusal.js';
|
|
37
36
|
import { loadConfigCached } from '../../utils/config-loader.js';
|
|
37
|
+
import { endWithForwardedDocument, endWithRefusal, endWithReport, leftoverIssueOf, NOTHING_FINISHED, } from '../../utils/document-writer.js';
|
|
38
38
|
import { formatDurationSecs } from '../../utils/duration.js';
|
|
39
39
|
import { resolveIssueSeverity } from '../../utils/issue-severity.js';
|
|
40
40
|
import { createLogger } from '../../utils/logger.js';
|
|
41
|
-
import {
|
|
41
|
+
import { EVERY_NOTICE, withNoticeAudience } from '../../utils/operator-notices.js';
|
|
42
42
|
import { assertDirectoryArgument, projectRootOrLoudCwd, projectRootOrNull } from '../../utils/project-root-policy.js';
|
|
43
43
|
import { withQueriedProjection, } from '../../utils/projection-query.js';
|
|
44
44
|
import { relationBoundsFor } from '../../utils/relation-limits.js';
|
|
45
|
-
import {
|
|
46
|
-
import { createProgressWriter, parseProgressLog, unitInFlight, } from './check-progress.js';
|
|
47
|
-
import { parseBudgetSeconds, requireSupervisableFlags, runsInThisProcess, superviseCheck, withProgressLog, } from './check-supervisor.js';
|
|
48
|
-
/** What one rule cost, as the document publishes it. */
|
|
49
|
-
const PublishedCheckCostSchema = z.object({
|
|
50
|
-
name: z.string(),
|
|
51
|
-
/** Three significant figures, so a 0.4 ms rule serializes as 0.0004 rather than a zero that reads as "not measured". */
|
|
52
|
-
durationSecs: z.number().nonnegative(),
|
|
53
|
-
/** Rows the statement returned. ABSENT, never 0, when the statement did not complete. */
|
|
54
|
-
rows: z.number().int().nonnegative().optional(),
|
|
55
|
-
broken: z.literal(true).optional(),
|
|
56
|
-
/** Present and `true` only for a rule VAT supplied — see {@link CheckCost.builtin}. */
|
|
57
|
-
builtin: z.literal(true).optional(),
|
|
58
|
-
}).strict();
|
|
59
|
-
/**
|
|
60
|
-
* The published copy of {@link relationBoundsFor}'s answer.
|
|
61
|
-
*
|
|
62
|
-
* The registry lists are `readonly` and this document is handed to a serializer,
|
|
63
|
-
* so the arrays are copied rather than referenced — the same rule
|
|
64
|
-
* `lensesEvaluated` follows one field above: a published document owns no
|
|
65
|
-
* reference into the run's own state.
|
|
66
|
-
*
|
|
67
|
-
* @param lensesEvaluated - The lenses this run evaluated
|
|
68
|
-
* @returns The bounds keys to spread, or nothing
|
|
69
|
-
*/
|
|
70
|
-
function structuredBounds(lensesEvaluated) {
|
|
71
|
-
const bounds = relationBoundsFor(lensesEvaluated);
|
|
72
|
-
if (bounds.boundsStatement === undefined || bounds.limits === undefined)
|
|
73
|
-
return {};
|
|
74
|
-
return { boundsStatement: bounds.boundsStatement, limits: bounds.limits.map((limit) => ({ ...limit })) };
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A signed bound on what the derived rows settle, as `@vibe-agent-toolkit/resources`
|
|
78
|
-
* states it.
|
|
79
|
-
*
|
|
80
|
-
* ⛔ The direction vocabulary is IMPORTED, never respelled: `LIMIT_DIRECTIONS`
|
|
81
|
-
* is the one list, tied to `StatedLimit['direction']` by `satisfies`, so a
|
|
82
|
-
* fifth direction cannot leave this schema quietly rejecting it.
|
|
83
|
-
*/
|
|
84
|
-
const StatedLimitSchema = z.object({
|
|
85
|
-
id: z.string(),
|
|
86
|
-
direction: z.enum(LIMIT_DIRECTIONS),
|
|
87
|
-
statement: z.string(),
|
|
88
|
-
}).strict();
|
|
89
|
-
/**
|
|
90
|
-
* What the check run reports beyond its findings.
|
|
91
|
-
*
|
|
92
|
-
* The envelope's `examined` is `membersEnumerated` — what the rules ran
|
|
93
|
-
* AGAINST. `checksRun` is the other denominator, the number of RULES, and both
|
|
94
|
-
* are needed: zero findings is the pass condition and either number at zero
|
|
95
|
-
* makes that pass vacuous.
|
|
96
|
-
*/
|
|
97
|
-
export const CheckDataSchema = z.object({
|
|
98
|
-
root: z.string(),
|
|
99
|
-
/**
|
|
100
|
-
* Whether the projection was derived this run or read from the store.
|
|
101
|
-
*
|
|
102
|
-
* 🔑 `null` — together with `populationSecs`, `lensSecs` and
|
|
103
|
-
* `lensesEvaluated` — exactly when the run was interrupted before its
|
|
104
|
-
* population completed. There was no projection, so there is no origin, cost
|
|
105
|
-
* or lens set to report, and a `RESOURCE_CHECK_BROKEN` finding says why.
|
|
106
|
-
*/
|
|
107
|
-
population: z.enum(['derived', 'store']).nullable(),
|
|
108
|
-
/** What the population cost — charged to no check, see `CheckCost`. Null as `population` is. */
|
|
109
|
-
populationSecs: z.number().nonnegative().nullable(),
|
|
110
|
-
/** What evaluating the lenses cost, paid before the first statement ran. Null as `population` is. */
|
|
111
|
-
lensSecs: z.number().nonnegative().nullable(),
|
|
112
|
-
/**
|
|
113
|
-
* Which lenses that covers — the derived relations this run's checks could
|
|
114
|
-
* actually read. 🔑 An empty list says "no check asked for a derived relation"
|
|
115
|
-
* rather than "a lens stopped running"; without it `lensSecs: 0` is the same
|
|
116
|
-
* document either way, and a gate whose rules silently read empty relations is
|
|
117
|
-
* a gate that cannot fail. Null as `population` is — `[]` would claim "no
|
|
118
|
-
* check asked", about a run that never got far enough to ask.
|
|
119
|
-
*/
|
|
120
|
-
lensesEvaluated: z.array(z.string()).nullable(),
|
|
121
|
-
/**
|
|
122
|
-
* The prose frame {@link CheckDataSchema.limits} is read under. Present
|
|
123
|
-
* exactly when a lens with stated bounds was evaluated.
|
|
124
|
-
*/
|
|
125
|
-
boundsStatement: z.string().optional(),
|
|
126
|
-
/**
|
|
127
|
-
* What the derived rows this run could read do NOT settle — signed and
|
|
128
|
-
* directional, the same list `vat claude context` publishes beside its own
|
|
129
|
-
* answer. Absent when no bounded lens ran: an empty list would claim nothing
|
|
130
|
-
* bounds the answer, which is stronger than "the answer holds no such row".
|
|
131
|
-
*/
|
|
132
|
-
limits: z.array(StatedLimitSchema).optional(),
|
|
133
|
-
/** The number of rules that EXECUTED. Derived from `checks`, never carried beside it. */
|
|
134
|
-
checksRun: z.number().int().nonnegative(),
|
|
135
|
-
/** What each rule cost, directly under the denominator it is the breakdown of. */
|
|
136
|
-
checks: z.array(PublishedCheckCostSchema),
|
|
137
|
-
}).strict();
|
|
138
|
-
/** The document this command publishes. */
|
|
139
|
-
export const CHECK_REPORT_SCHEMA = reportSchema(CheckDataSchema);
|
|
45
|
+
import { RUN_INTEGRITY_CODE, runIntegrityFinding } from '../../utils/run-integrity.js';
|
|
46
|
+
import { createProgressWriter, endWhenSupervisorGone, letSupervisorLossSurface, parseProgressLog, unitInFlight, } from './check-progress.js';
|
|
47
|
+
import { DEFAULT_BUDGET_SECONDS, parseBudgetSeconds, requireSupervisableFlags, runsInThisProcess, SUPERVISED_BY_FLAG, superviseCheck, supervisedByValue, withProgressLog, } from './check-supervisor.js';
|
|
140
48
|
/**
|
|
141
49
|
* The refusal for a run in which NO check executed.
|
|
142
50
|
*
|
|
@@ -164,10 +72,10 @@ export const CHECK_REPORT_SCHEMA = reportSchema(CheckDataSchema);
|
|
|
164
72
|
* having to remember it. It also lands after `resolveIssueSeverity`, which is
|
|
165
73
|
* belt and braces: the code is already unreachable from a `severity` key.
|
|
166
74
|
*
|
|
167
|
-
* The
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* stand-down matters here for an interrupted run, which recovers zero costs when
|
|
75
|
+
* The writer refuses a run that examined no RESOURCE; this is the other
|
|
76
|
+
* denominator, CHECKS, which only this verb knows — so it asks that count,
|
|
77
|
+
* never the config, and stands down behind an existing run-integrity finding
|
|
78
|
+
* (one report per situation). The stand-down matters here for an interrupted run, which recovers zero costs when
|
|
171
79
|
* the kill landed before the first statement finished and already carries
|
|
172
80
|
* {@link interruptedRunFinding}, the more specific of the two claims. A `--check`
|
|
173
81
|
* filter that matched nothing is refused earlier by {@link requireKnownCheck},
|
|
@@ -185,13 +93,15 @@ export const CHECK_REPORT_SCHEMA = reportSchema(CheckDataSchema);
|
|
|
185
93
|
* @returns The finding, or nothing when at least one check ran
|
|
186
94
|
*/
|
|
187
95
|
function noCheckRanFinding(costs, issues) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
96
|
+
if (costs.length > 0 || issues.some((issue) => issue.code === RUN_INTEGRITY_CODE))
|
|
97
|
+
return [];
|
|
98
|
+
return [runIntegrityFinding('No check ran at all, so this document is not a verdict: a gate that checked nothing'
|
|
99
|
+
+ ' produces the same report as a gate that was removed, and this run cannot tell'
|
|
100
|
+
+ ' you which happened.'
|
|
101
|
+
+ ' This is not an absent `resources.checks` block — VAT\'s own built-in checks run'
|
|
102
|
+
+ ' whether or not a project declares any, so reaching zero means not even those'
|
|
103
|
+
+ ' executed. Re-run with --debug and report it; if the run was filtered, check that'
|
|
104
|
+
+ ' --check named a rule this build still ships.')];
|
|
195
105
|
}
|
|
196
106
|
/**
|
|
197
107
|
* Build the check report.
|
|
@@ -241,6 +151,8 @@ export function buildCheckOutputData(input) {
|
|
|
241
151
|
const issues = [...noCheckRanFinding(input.costs, input.issues), ...input.issues];
|
|
242
152
|
const { populated } = input;
|
|
243
153
|
const report = buildReport({
|
|
154
|
+
// `vat resources check` offers no `--strict`: warnings never fail it.
|
|
155
|
+
gate: { strict: false },
|
|
244
156
|
// The OTHER denominator, and the one whose absence shipped a green gate over
|
|
245
157
|
// an empty repository. `checksRun` counts rules; this counts what they ran
|
|
246
158
|
// against. 🔑 0 for a run with no population is not a placeholder: nothing
|
|
@@ -282,21 +194,24 @@ export function buildCheckOutputData(input) {
|
|
|
282
194
|
* The error branch of the envelope, for a run that never had a population.
|
|
283
195
|
*
|
|
284
196
|
* `status: error`, nothing in `findings`, zero `summary`, and the reason in
|
|
285
|
-
* `error`
|
|
286
|
-
*
|
|
287
|
-
* that there was no projection, which is more than
|
|
197
|
+
* `error` under the registered refusal `RUN_INCOMPLETE` — the run started and
|
|
198
|
+
* stopped before its population completed — and `data` is KEPT: it names the
|
|
199
|
+
* root and says, with `null`, that there was no projection, which is more than
|
|
200
|
+
* `data: null` could. No `durationMs`: no refusal document carries one.
|
|
288
201
|
*
|
|
289
202
|
* @param report - The document as the findings would have built it
|
|
290
203
|
* @returns The same document on the error branch
|
|
291
204
|
*/
|
|
292
205
|
function couldNotRun(report) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
error: report.findings.map((finding) => finding.message).join('\n'),
|
|
206
|
+
// The one construction of the error branch — the same `buildErrorReport`
|
|
207
|
+
// every refusal the writer publishes goes through.
|
|
208
|
+
return buildErrorReport({
|
|
209
|
+
error: { code: 'RUN_INCOMPLETE', message: report.findings.map((finding) => finding.message).join('\n') },
|
|
210
|
+
gate: report.gate,
|
|
211
|
+
examined: report.examined,
|
|
297
212
|
findings: [],
|
|
298
|
-
|
|
299
|
-
};
|
|
213
|
+
data: report.data,
|
|
214
|
+
});
|
|
300
215
|
}
|
|
301
216
|
/**
|
|
302
217
|
* The document's population fields — all present, or all `null`.
|
|
@@ -306,7 +221,7 @@ function couldNotRun(report) {
|
|
|
306
221
|
*/
|
|
307
222
|
function populationData(populated) {
|
|
308
223
|
if (populated === null) {
|
|
309
|
-
return { population: null, populationSecs: null, lensSecs: null, lensesEvaluated: null };
|
|
224
|
+
return { population: null, populationSecs: null, lensSecs: null, lensesEvaluated: null, lensPopulation: null };
|
|
310
225
|
}
|
|
311
226
|
return {
|
|
312
227
|
population: populated.population,
|
|
@@ -323,12 +238,14 @@ function populationData(populated) {
|
|
|
323
238
|
// into a plain array so the published document owns no reference into the
|
|
324
239
|
// run's own state.
|
|
325
240
|
lensesEvaluated: [...populated.lensesEvaluated],
|
|
241
|
+
// Where those lenses' own populations came from — see `CheckDataSchema.lensPopulation`.
|
|
242
|
+
lensPopulation: populated.lensPopulation,
|
|
326
243
|
// The bounds of the rows those lenses produced, stated ONCE and only when
|
|
327
244
|
// a bounded lens ran. This is the verb an adopter makes GATE, so it is the
|
|
328
245
|
// one that most owes them — `utils/relation-limits.ts` carries why.
|
|
329
246
|
// Copied out of the readonly registry lists: the published document owns
|
|
330
247
|
// no reference into module state a later render could mutate.
|
|
331
|
-
...
|
|
248
|
+
...relationBoundsFor(populated.lensesEvaluated),
|
|
332
249
|
};
|
|
333
250
|
}
|
|
334
251
|
/**
|
|
@@ -557,7 +474,7 @@ export function requireKnownCheck(builtinNames, checks, only) {
|
|
|
557
474
|
if (only === undefined || builtinNames.includes(only) || Object.hasOwn(checks, only))
|
|
558
475
|
return;
|
|
559
476
|
const declared = Object.keys(checks);
|
|
560
|
-
throw new
|
|
477
|
+
throw new CommandRefusalError('USAGE_INVALID', `No check named "${only}" exists. `
|
|
561
478
|
+ `Built in: ${builtinNames.join(', ')}. `
|
|
562
479
|
+ (declared.length === 0
|
|
563
480
|
? 'This project declares none of its own — add them under `resources.checks` in'
|
|
@@ -631,10 +548,10 @@ export function warnUndeclaredOverrides(checks, validation, logger) {
|
|
|
631
548
|
* nothing all produce it — and because population DECLINES ignored members
|
|
632
549
|
* rather than flagging them, the tables carry no trace of the difference.
|
|
633
550
|
*
|
|
634
|
-
* The precedent is `population-wiring.ts`, which
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
551
|
+
* The precedent is `populateAndReport` in `population-wiring.ts`, which names
|
|
552
|
+
* a tree whose every document was declined as binary rather than letting it
|
|
553
|
+
* populate as empty and report success. That report covers blob refusals only;
|
|
554
|
+
* this guard covers the extent.
|
|
638
555
|
*
|
|
639
556
|
* 🪤 **Only when checks actually RAN.** A run with no rules at all is refused
|
|
640
557
|
* too — it is the same class one level further out — but by
|
|
@@ -664,6 +581,28 @@ function emptyCorpusFinding(checksRun, membersEnumerated) {
|
|
|
664
581
|
+ ' `root` in this report is the directory you meant.'
|
|
665
582
|
+ ' `vat resources scan` over the same path lists what an enumeration finds.')];
|
|
666
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* How to give the run more time, as one sentence — by who ran the checks.
|
|
586
|
+
*
|
|
587
|
+
* 🔑 A kill remedy names a flag only the verb that accepts it can be given. `--budget` is
|
|
588
|
+
* `vat resources check`'s alone, and in this release `vat validate` has NO way to give its checks
|
|
589
|
+
* phase more time: the phase always runs under {@link DEFAULT_BUDGET_SECONDS}. So the phase's
|
|
590
|
+
* sentence says exactly that — what the bound measures, its value, and that running the checks
|
|
591
|
+
* standalone with a larger `--budget` lets THEM pass but does not make `vat validate` pass. A
|
|
592
|
+
* remedy promising otherwise sends the operator round a loop that cannot end.
|
|
593
|
+
*
|
|
594
|
+
* @param invocation - Who ran the checks
|
|
595
|
+
* @returns The sentence, with a leading space
|
|
596
|
+
*/
|
|
597
|
+
function raiseBoundSentence(invocation) {
|
|
598
|
+
return invocation === 'standalone'
|
|
599
|
+
? ' Raise it with `--budget <seconds>`.'
|
|
600
|
+
: ' `vat validate` cannot give it more time: its checks phase always runs under the default'
|
|
601
|
+
+ ` bound of ${DEFAULT_BUDGET_SECONDS}s WITHOUT PROGRESS (a total bound on the population,`
|
|
602
|
+
+ ' which reports progress only when it finishes), and this release has no way to change'
|
|
603
|
+
+ ' it. Running the same checks on their own with `vat resources check --budget <seconds>`'
|
|
604
|
+
+ ' can let them pass there, but `vat validate` will still fail on this tree.';
|
|
605
|
+
}
|
|
667
606
|
/**
|
|
668
607
|
* Where the run was when it stopped, as a phrase.
|
|
669
608
|
*
|
|
@@ -693,6 +632,8 @@ function inFlightPhrase(inFlight) {
|
|
|
693
632
|
return 'while no check was running — either between the population and the first'
|
|
694
633
|
+ ' statement, or after the last one had filed its cost';
|
|
695
634
|
}
|
|
635
|
+
/** The supervisor's kind for a child whose exit contradicts its own complete document. */
|
|
636
|
+
const EXIT_DISAGREES = 'exit-disagrees';
|
|
696
637
|
/**
|
|
697
638
|
* What ended the child, as a phrase.
|
|
698
639
|
*
|
|
@@ -706,12 +647,21 @@ function deathPhrase(death) {
|
|
|
706
647
|
return `the child process could not be started at all (${death.binary}: ${death.detail})`;
|
|
707
648
|
}
|
|
708
649
|
if (death.kind === 'kill-failed') {
|
|
709
|
-
return
|
|
710
|
-
|
|
650
|
+
return death.refused
|
|
651
|
+
? `the budget was blown and the SIGKILL that should have ended the run was REFUSED (${death.detail})`
|
|
652
|
+
: `the budget was blown and the SIGKILL that should have ended the run DID NOT END IT (${death.detail})`;
|
|
711
653
|
}
|
|
712
654
|
if (death.kind === 'no-output') {
|
|
713
655
|
return `the child process exited ${death.code} and published no report at all`;
|
|
714
656
|
}
|
|
657
|
+
if (death.kind === 'unparseable-output') {
|
|
658
|
+
return `the child process exited ${death.code} and published a report that is not this`
|
|
659
|
+
+ ` command's document, most likely cut off mid-write (${death.detail})`;
|
|
660
|
+
}
|
|
661
|
+
if (death.kind === EXIT_DISAGREES) {
|
|
662
|
+
return `the child process published a complete report whose own verdict is exit ${death.documentExit},`
|
|
663
|
+
+ ` and then exited ${death.code}`;
|
|
664
|
+
}
|
|
715
665
|
return 'the child process ended with neither an exit code nor a signal';
|
|
716
666
|
}
|
|
717
667
|
/**
|
|
@@ -737,21 +687,25 @@ function spawnFailedRemedy(detail) {
|
|
|
737
687
|
+ ' anything about the SQL.';
|
|
738
688
|
}
|
|
739
689
|
/**
|
|
740
|
-
* What to do about a kill the
|
|
690
|
+
* What to do about a kill that did not end the child — refused, or accepted and ineffective.
|
|
741
691
|
*
|
|
742
692
|
* ⛔ This must never be composed from the spawn-failure sentence, however
|
|
743
693
|
* similar the plumbing is. The two are opposites: one child never existed, and
|
|
744
694
|
* this one is, as far as this process can tell, STILL RUNNING.
|
|
745
695
|
*
|
|
746
|
-
* @param death - The
|
|
696
|
+
* @param death - The kill that failed, and the pid it left behind
|
|
747
697
|
* @returns The remedy sentence
|
|
748
698
|
*/
|
|
749
|
-
function killFailedRemedy(
|
|
750
|
-
const handle = pid === undefined
|
|
699
|
+
function killFailedRemedy(death) {
|
|
700
|
+
const handle = death.pid === undefined
|
|
751
701
|
? ' The child\'s pid is not known to this process.'
|
|
752
|
-
: ` The child was process ${pid}.`;
|
|
702
|
+
: ` The child was process ${death.pid}.`;
|
|
703
|
+
const how = death.refused
|
|
704
|
+
? ` SIGKILL and the kernel would not deliver it (${death.detail}), which normally means EPERM.`
|
|
705
|
+
: ` SIGKILL, the kernel accepted it, and the process still did not end (${death.detail}) —`
|
|
706
|
+
+ ' which normally means it is stuck in uninterruptible I/O (a hung network mount, a wedged disk).';
|
|
753
707
|
return ' The run started, ran past its budget, and then REFUSED TO DIE: the watchdog sent'
|
|
754
|
-
+
|
|
708
|
+
+ how
|
|
755
709
|
+ handle
|
|
756
710
|
+ ' It may still be running and still holding whatever the statement was holding, so'
|
|
757
711
|
+ ' check for it and end it by hand before starting another run. Nothing about the SQL'
|
|
@@ -859,7 +813,7 @@ function noOutputRemedy(code) {
|
|
|
859
813
|
+ ' — surfaces as an exit code what macOS and Linux report as SIGABRT itself, and it is the'
|
|
860
814
|
+ ' same event.' + signalRemedy('SIGABRT');
|
|
861
815
|
}
|
|
862
|
-
return ` Exit ${code} is not Node's abort code, and the child published
|
|
816
|
+
return ` Exit ${code} is not Node's abort code, and the child published no usable copy of the document`
|
|
863
817
|
+ ' every path through this command ends by writing — so this is either a termination from'
|
|
864
818
|
+ ' outside that left an exit code instead of a signal, or a defect in vat. The child\'s stderr'
|
|
865
819
|
+ ' was inherited, so whatever it managed to say is above this report; if there is nothing'
|
|
@@ -885,16 +839,33 @@ function noOutputRemedy(code) {
|
|
|
885
839
|
*/
|
|
886
840
|
function deathRemedy(death) {
|
|
887
841
|
if (death.kind === 'kill-failed')
|
|
888
|
-
return killFailedRemedy(death
|
|
842
|
+
return killFailedRemedy(death);
|
|
889
843
|
if (death.kind === 'spawn-failed')
|
|
890
844
|
return spawnFailedRemedy(death.detail) + WATCHDOG_UNINVOLVED;
|
|
891
845
|
if (death.kind === 'signal')
|
|
892
846
|
return signalRemedy(death.signal) + WATCHDOG_UNINVOLVED;
|
|
893
|
-
if (death.kind === 'no-output')
|
|
847
|
+
if (death.kind === 'no-output' || death.kind === 'unparseable-output') {
|
|
894
848
|
return noOutputRemedy(death.code) + WATCHDOG_UNINVOLVED;
|
|
849
|
+
}
|
|
850
|
+
if (death.kind === EXIT_DISAGREES)
|
|
851
|
+
return EXIT_DISAGREES_REMEDY + WATCHDOG_UNINVOLVED;
|
|
895
852
|
return ' The cause is outside anything this command can observe; the child left no exit code'
|
|
896
853
|
+ ' to report.' + WATCHDOG_UNINVOLVED;
|
|
897
854
|
}
|
|
855
|
+
/**
|
|
856
|
+
* Why a child whose exit disagrees with its own document is not forwarded, and where to look.
|
|
857
|
+
*
|
|
858
|
+
* ⚠️ It does not guess which of the two is true. Every path through this command ends on the code
|
|
859
|
+
* its document derives, so the disagreement is either something ending the child after it wrote
|
|
860
|
+
* (a crash in teardown, an external termination that left a code) or a defect in vat — and the
|
|
861
|
+
* report cannot tell them apart.
|
|
862
|
+
*/
|
|
863
|
+
const EXIT_DISAGREES_REMEDY = ' Every path through this command ends on the exit code its own document derives, so the two'
|
|
864
|
+
+ ' should never disagree: either something ended the child AFTER it wrote its report — a crash'
|
|
865
|
+
+ ' during shutdown, or a termination from outside that left an exit code — or vat has a defect.'
|
|
866
|
+
+ ' Which one cannot be told from here, so the report is withheld rather than forwarded as the'
|
|
867
|
+
+ ' verdict. The child\'s stderr was inherited, so whatever it said is above this report; re-run'
|
|
868
|
+
+ ' it, and if the disagreement repeats, report the exit code with the platform.';
|
|
898
869
|
/**
|
|
899
870
|
* The sentence that keeps an abnormal death from being blamed on the bound.
|
|
900
871
|
*
|
|
@@ -952,12 +923,30 @@ function incompleteNotice(checksCompleted) {
|
|
|
952
923
|
function interruptedRunFinding(inFlight, ending, checksCompleted) {
|
|
953
924
|
const where = inFlightPhrase(inFlight);
|
|
954
925
|
const message = ending.kind === 'budget'
|
|
955
|
-
? budgetKillMessage(inFlight, ending
|
|
956
|
-
:
|
|
957
|
-
+ ' after it never executed and this document is not a verdict.'
|
|
958
|
-
+ deathRemedy(ending.death);
|
|
926
|
+
? budgetKillMessage(inFlight, ending, where)
|
|
927
|
+
: deathMessage(ending.death, where);
|
|
959
928
|
return runIntegrityFinding(message + incompleteNotice(checksCompleted));
|
|
960
929
|
}
|
|
930
|
+
/**
|
|
931
|
+
* What an abnormal death means.
|
|
932
|
+
*
|
|
933
|
+
* 🪤 A child whose exit disagrees with its document did NOT die mid-run — it finished every check
|
|
934
|
+
* and wrote a whole report — so it gets its own sentence rather than "DIED before it finished …
|
|
935
|
+
* the checks after it never executed", which would be false about it.
|
|
936
|
+
*
|
|
937
|
+
* @param death - The ending the supervisor resolved
|
|
938
|
+
* @param where - The clause naming the unit, from {@link inFlightPhrase}
|
|
939
|
+
* @returns The message body
|
|
940
|
+
*/
|
|
941
|
+
function deathMessage(death, where) {
|
|
942
|
+
if (death.kind === EXIT_DISAGREES) {
|
|
943
|
+
return `This run's exit contradicts its own report: ${deathPhrase(death)}, so neither can be`
|
|
944
|
+
+ ' trusted as the verdict and this document replaces the report.' + deathRemedy(death);
|
|
945
|
+
}
|
|
946
|
+
return `This run DIED before it finished: ${deathPhrase(death)} ${where}, so the checks`
|
|
947
|
+
+ ' after it never executed and this document is not a verdict.'
|
|
948
|
+
+ deathRemedy(death);
|
|
949
|
+
}
|
|
961
950
|
/**
|
|
962
951
|
* What a WATCHDOG kill means, which depends entirely on what was in flight.
|
|
963
952
|
*
|
|
@@ -975,17 +964,22 @@ function interruptedRunFinding(inFlight, ending, checksCompleted) {
|
|
|
975
964
|
* issues takes ~17 s after `checks-complete` is filed, which is one budget
|
|
976
965
|
* window on its own.
|
|
977
966
|
*
|
|
967
|
+
* 🔑 Every remedy names the bound through {@link raiseBoundSentence}, so a phase is never told to
|
|
968
|
+
* pass a flag its own verb (`vat validate`) rejects, nor promised a way to raise its bound.
|
|
969
|
+
*
|
|
978
970
|
* @param inFlight - What the log's last state says
|
|
979
|
-
* @param
|
|
971
|
+
* @param ending - The kill: the bound that was blown, and who ran the checks
|
|
980
972
|
* @param where - The clause naming the unit, from {@link inFlightPhrase}
|
|
981
973
|
* @returns The message body
|
|
982
974
|
*/
|
|
983
|
-
function budgetKillMessage(inFlight,
|
|
975
|
+
function budgetKillMessage(inFlight, ending, where) {
|
|
976
|
+
const { budgetSecs, invocation } = ending;
|
|
977
|
+
const raise = raiseBoundSentence(invocation);
|
|
984
978
|
if (inFlight.kind === 'startup' || inFlight.kind === 'population') {
|
|
985
979
|
return `This run made no progress for ${budgetSecs}s and was killed ${where}, so no`
|
|
986
980
|
+ ' check ran and this document is not a verdict. There is no projection, so the'
|
|
987
981
|
+ ' population fields in `data` are null and `examined` is 0.'
|
|
988
|
-
+ (inFlight.kind === 'startup' ?
|
|
982
|
+
+ (inFlight.kind === 'startup' ? startupRemedy(raise) : populationRemedy(raise));
|
|
989
983
|
}
|
|
990
984
|
if (inFlight.kind === 'reporting') {
|
|
991
985
|
return `This run made no progress for ${budgetSecs}s and was killed ${where}.`
|
|
@@ -994,15 +988,18 @@ function budgetKillMessage(inFlight, budgetSecs, where) {
|
|
|
994
988
|
+ ' being assembled, not a rule that would not return. Serialising a large result is'
|
|
995
989
|
+ ' linear in how much there is — 2,000,000 issues take about 17 seconds — so look at'
|
|
996
990
|
+ ' the rules under `checks` that produced the most rows and narrow them (a `LIMIT`, or'
|
|
997
|
-
+ ' one row per violation rather than one per member), or
|
|
998
|
-
+
|
|
991
|
+
+ ' one row per violation rather than one per member), or give the document more time to'
|
|
992
|
+
+ ` be written.${raise}`;
|
|
999
993
|
}
|
|
1000
994
|
return `This run made no progress for ${budgetSecs}s and was killed ${where}, so the`
|
|
1001
995
|
+ ' checks after it never executed and this document is not a verdict.'
|
|
1002
996
|
+ ' A statement that will not finish cannot be stopped from inside the process —'
|
|
1003
997
|
+ ' the query is synchronous and holds the event loop — so the bound is enforced by'
|
|
1004
|
-
+ ' killing the run.
|
|
1005
|
-
+
|
|
998
|
+
+ ' killing the run. If the work is legitimately slow, it needs more time.'
|
|
999
|
+
+ raise
|
|
1000
|
+
+ (invocation === 'standalone'
|
|
1001
|
+
? ' `--budget 0` removes it (the run can then hang forever).'
|
|
1002
|
+
: '');
|
|
1006
1003
|
}
|
|
1007
1004
|
/**
|
|
1008
1005
|
* What to do about a kill that landed before the child had BOOTED.
|
|
@@ -1011,22 +1008,32 @@ function budgetKillMessage(inFlight, budgetSecs, where) {
|
|
|
1011
1008
|
* sizing the budget against the population would be advice about a unit that
|
|
1012
1009
|
* never began. A boot that outlasts the budget is a saturated machine or a bound
|
|
1013
1010
|
* too small to be one.
|
|
1011
|
+
*
|
|
1012
|
+
* @param raise - How to raise the bound, from {@link raiseBoundSentence}
|
|
1013
|
+
* @returns The remedy sentence
|
|
1014
1014
|
*/
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1015
|
+
function startupRemedy(raise) {
|
|
1016
|
+
return ' Node and vat were still loading, so neither your tree nor your SQL is implicated: a'
|
|
1017
|
+
+ ' boot that outlasts the bound means a heavily loaded machine or a bound far smaller than'
|
|
1018
|
+
+ ` any run can meet.${raise}`;
|
|
1019
|
+
}
|
|
1018
1020
|
/**
|
|
1019
1021
|
* What to do about a kill that landed during the population.
|
|
1020
1022
|
*
|
|
1021
1023
|
* 🔑 The measured numbers are labelled as someone else's trees. An operator
|
|
1022
1024
|
* given one number reads it as a promise about theirs.
|
|
1025
|
+
*
|
|
1026
|
+
* @param raise - How to raise the bound, from {@link raiseBoundSentence}
|
|
1027
|
+
* @returns The remedy sentence
|
|
1023
1028
|
*/
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1029
|
+
function populationRemedy(raise) {
|
|
1030
|
+
return ' Population is legitimately slow on a large tree, and it reports progress only when it'
|
|
1031
|
+
+ ' FINISHES, so the budget is a total bound for that one unit — a crawl that outlasts it is'
|
|
1032
|
+
+ ` not necessarily stuck.${raise}`
|
|
1033
|
+
+ ' For scale, two MEASURED trees, neither of them yours: VAT\'s own repository is ~1.2s'
|
|
1034
|
+
+ ' warm and 33-35s with a cold parse cache; a 10,000-file adopter tree is ~5s warm and'
|
|
1035
|
+
+ ' 16.5s cold. Your tree is a third number.';
|
|
1036
|
+
}
|
|
1030
1037
|
/**
|
|
1031
1038
|
* Rebuild the document from what an INTERRUPTED run left on disk.
|
|
1032
1039
|
*
|
|
@@ -1079,6 +1086,7 @@ export function buildInterruptedCheckInput(options) {
|
|
|
1079
1086
|
? null
|
|
1080
1087
|
: {
|
|
1081
1088
|
population: population.population,
|
|
1089
|
+
lensPopulation: population.lensPopulation,
|
|
1082
1090
|
populationMs: population.populationMs,
|
|
1083
1091
|
lensMs: population.lensMs,
|
|
1084
1092
|
lensesEvaluated: population.lensesEvaluated,
|
|
@@ -1168,42 +1176,43 @@ export function runProjectChecks(options) {
|
|
|
1168
1176
|
costs,
|
|
1169
1177
|
};
|
|
1170
1178
|
}
|
|
1171
|
-
/**
|
|
1172
|
-
* Serialize the document in the format the operator asked for.
|
|
1173
|
-
*
|
|
1174
|
-
* Extracted because BOTH endings publish one — a completed run and a killed one
|
|
1175
|
-
* — and two copies of a two-branch format switch is how one of them ends up
|
|
1176
|
-
* ignoring `--format json`.
|
|
1177
|
-
*
|
|
1178
|
-
* @param payload - The document
|
|
1179
|
-
* @param format - `json`, or anything else for YAML
|
|
1180
|
-
*/
|
|
1181
|
-
function emitCheckDocument(payload, format) {
|
|
1182
|
-
writeStructuredOutput(payload, format);
|
|
1183
|
-
}
|
|
1184
1179
|
/**
|
|
1185
1180
|
* The child's argv — this very command, plus the hidden flag that stops it
|
|
1186
1181
|
* spawning a child of its own.
|
|
1187
1182
|
*
|
|
1188
|
-
* 🚨 `--
|
|
1183
|
+
* 🚨 `--supervised-by` is ALWAYS appended, and that is the recursion guard. Its
|
|
1189
1184
|
* presence is the sole discriminator between "supervise a child" and "do the
|
|
1190
|
-
* work"; a path that built these arguments without it would fork bomb.
|
|
1191
|
-
*
|
|
1192
|
-
*
|
|
1193
|
-
*
|
|
1185
|
+
* work"; a path that built these arguments without it would fork bomb. Its one
|
|
1186
|
+
* value carries who started the child (which decides the notices the child owes
|
|
1187
|
+
* the operator), this process's pid (which the child checks is its parent's) and
|
|
1188
|
+
* the progress log — see `supervisedByValue`.
|
|
1189
|
+
*
|
|
1190
|
+
* 🔑 The operand is the root the PARENT resolved, always. The child is spawned
|
|
1191
|
+
* with no `cwd`, so without it the child would resolve its own root from the
|
|
1192
|
+
* INHERITED working directory — which differs from the parent's root whenever
|
|
1193
|
+
* the operator named the project rather than standing in it: `vat resources
|
|
1194
|
+
* check <inner>` run from an outer project would check the outer tree and
|
|
1195
|
+
* report it as the inner one. (`vat validate` takes no operand and resolves its
|
|
1196
|
+
* root from the working directory the child inherits, so for it the operand
|
|
1197
|
+
* restates what the child would have found — it is passed so the phase cannot
|
|
1198
|
+
* depend on that coincidence.)
|
|
1199
|
+
*
|
|
1200
|
+
* @param root - The project root the parent resolved
|
|
1201
|
+
* @param request - What the child is asked to run, and in which format
|
|
1194
1202
|
* @param logPath - The progress log both sides watch
|
|
1195
1203
|
* @returns The child's arguments after the CLI entry point
|
|
1196
1204
|
*/
|
|
1197
|
-
function childArgs(
|
|
1205
|
+
function childArgs(root, request, logPath) {
|
|
1198
1206
|
return [
|
|
1199
1207
|
'resources',
|
|
1200
1208
|
'check',
|
|
1201
|
-
|
|
1202
|
-
...(
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
'--
|
|
1206
|
-
|
|
1209
|
+
root,
|
|
1210
|
+
...(request.check === undefined ? [] : ['--check', request.check]),
|
|
1211
|
+
'--format',
|
|
1212
|
+
request.format,
|
|
1213
|
+
...(request.debug ? ['--debug'] : []),
|
|
1214
|
+
SUPERVISED_BY_FLAG,
|
|
1215
|
+
supervisedByValue({ invoker: request.invocation, progressLog: logPath }),
|
|
1207
1216
|
];
|
|
1208
1217
|
}
|
|
1209
1218
|
/**
|
|
@@ -1216,26 +1225,23 @@ function childArgs(pathArg, options, logPath) {
|
|
|
1216
1225
|
* which are all of them but one, that would accumulate.
|
|
1217
1226
|
*
|
|
1218
1227
|
* @param options - The run
|
|
1219
|
-
* @param options.
|
|
1220
|
-
*
|
|
1228
|
+
* @param options.root - The project root the caller resolved. REQUIRED: the
|
|
1229
|
+
* child checks exactly this tree, and a killed run's document is labelled with it
|
|
1230
|
+
* @param options.request - What the child is asked to run, and who asked
|
|
1221
1231
|
* @param options.budgetSecs - The bound, in seconds
|
|
1222
1232
|
* @returns What to publish, and with what exit code
|
|
1223
1233
|
*/
|
|
1224
1234
|
async function superviseCheckRun(options) {
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
// stderr when there is no project ancestor, and the CHILD runs that policy for
|
|
1228
|
-
// real — a parent that ran it too would print the same warning twice for one
|
|
1229
|
-
// run. The parent needs a root only to label a KILLED run's document.
|
|
1230
|
-
const root = projectRootOrNull(startDir) ?? safePath.resolve(startDir);
|
|
1231
|
-
return withProgressLog(async (logPath) => {
|
|
1235
|
+
const { root, request } = options;
|
|
1236
|
+
const { value: ending, leftover } = await withProgressLog(async (log) => {
|
|
1232
1237
|
const run = await superviseCheck({
|
|
1233
|
-
args: childArgs(
|
|
1234
|
-
|
|
1238
|
+
args: childArgs(root, request, log.path),
|
|
1239
|
+
log,
|
|
1235
1240
|
budgetMs: options.budgetSecs * 1000,
|
|
1241
|
+
format: request.format,
|
|
1236
1242
|
});
|
|
1237
1243
|
if (run.outcome === 'completed')
|
|
1238
|
-
return { forward: run.
|
|
1244
|
+
return { forward: run.document };
|
|
1239
1245
|
return {
|
|
1240
1246
|
payload: buildCheckOutputData(buildInterruptedCheckInput({
|
|
1241
1247
|
entries: parseProgressLog(run.log),
|
|
@@ -1246,12 +1252,76 @@ async function superviseCheckRun(options) {
|
|
|
1246
1252
|
// argument — so a child that aborted on its heap limit printed nothing
|
|
1247
1253
|
// and exited 0, on precisely the runaway shape the bound exists for.
|
|
1248
1254
|
ending: run.outcome === 'killed'
|
|
1249
|
-
? { kind: 'budget', budgetSecs: options.budgetSecs }
|
|
1255
|
+
? { kind: 'budget', budgetSecs: options.budgetSecs, invocation: request.invocation }
|
|
1250
1256
|
: { kind: 'abnormal', death: run.death },
|
|
1251
1257
|
durationMs: run.elapsedMs,
|
|
1252
1258
|
})),
|
|
1253
1259
|
};
|
|
1254
1260
|
});
|
|
1261
|
+
return withLeftover(ending, leftover);
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* `ending` with the progress log's directory, when the OS would not remove it, as one
|
|
1265
|
+
* `TREE_CLEANUP_INCOMPLETE` warning beside the checks that ran. A forwarded document is then
|
|
1266
|
+
* published re-built rather than byte for byte: it gained a finding the child never knew of.
|
|
1267
|
+
*/
|
|
1268
|
+
function withLeftover(ending, leftover) {
|
|
1269
|
+
if (leftover === undefined)
|
|
1270
|
+
return ending;
|
|
1271
|
+
const added = toFindings([leftoverIssueOf(leftover)]);
|
|
1272
|
+
// The child's document was validated against this verb's schema when it was read.
|
|
1273
|
+
const report = 'forward' in ending ? ending.forward.report : ending.payload;
|
|
1274
|
+
return { payload: withAddedFindings(report, added) };
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* The `checks` phase of an orchestrator: the same supervised child `vat resources check` runs,
|
|
1278
|
+
* over the whole project, and its report is the phase's report.
|
|
1279
|
+
*
|
|
1280
|
+
* 🔑 **The report is the ending's own, in both arms** — the child's forwarded document, or the
|
|
1281
|
+
* document a killed or dead child's progress log rebuilt. There is no per-arm exit mapping: the
|
|
1282
|
+
* report's status already says what was in flight (findings with `RESOURCE_CHECK_BROKEN` once
|
|
1283
|
+
* the population was recorded, `error` before it), and the orchestrator derives the exit from it
|
|
1284
|
+
* as it does for every phase.
|
|
1285
|
+
*
|
|
1286
|
+
* @param options - The phase
|
|
1287
|
+
* @param options.root - The project root the orchestrator resolved. REQUIRED, so no caller can
|
|
1288
|
+
* fall back to the working directory and check a different project from the one it validated
|
|
1289
|
+
* @param options.debug - Whether the orchestrator was run with `--debug`, forwarded to the child
|
|
1290
|
+
* @returns The phase's report
|
|
1291
|
+
*/
|
|
1292
|
+
export async function runResourcesCheckPhase(options) {
|
|
1293
|
+
const ending = await superviseCheckRun({
|
|
1294
|
+
root: options.root,
|
|
1295
|
+
request: { check: undefined, format: 'json', debug: options.debug, invocation: 'phase' },
|
|
1296
|
+
budgetSecs: DEFAULT_BUDGET_SECONDS,
|
|
1297
|
+
});
|
|
1298
|
+
return { report: 'forward' in ending ? ending.forward.report : ending.payload };
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Warn, on the invoked process's stderr, that the project declares no checks of its own.
|
|
1302
|
+
*
|
|
1303
|
+
* 🪤 Stderr only, and it decides NOTHING — the document is what the exit code is computed from
|
|
1304
|
+
* and what CI parses. ⚠️ It does not stand beside a refusal: the built-in set runs, so the run
|
|
1305
|
+
* DID assert something. What the operator needs to know is that the project is relying entirely
|
|
1306
|
+
* on VAT's defaults, which is what a deleted `checks:` block looks like.
|
|
1307
|
+
*
|
|
1308
|
+
* Printed only by the process the operator ran as `vat resources check` — never by a supervised
|
|
1309
|
+
* child (any `--supervised-by` process) and so never by an orchestrator's `checks` phase, where a
|
|
1310
|
+
* project with `resources:` and no `resources.checks` still runs the built-ins and "no checks of
|
|
1311
|
+
* its own" is not news on every run.
|
|
1312
|
+
*
|
|
1313
|
+
* @param checks - The project's declared checks, or undefined
|
|
1314
|
+
* @param logger - Where the warning goes
|
|
1315
|
+
*/
|
|
1316
|
+
function warnWhenNoOwnChecks(checks, logger) {
|
|
1317
|
+
if (checks !== undefined && Object.keys(checks).length > 0)
|
|
1318
|
+
return;
|
|
1319
|
+
logger.warn(`No checks of this project's own are declared, so this run asserted only VAT's`
|
|
1320
|
+
+ ` built-in set (${BUILTIN_CHECK_NAMES.join(', ')}).`
|
|
1321
|
+
+ ' Add your own under `resources.checks` in vibe-agent-toolkit.config.yaml;'
|
|
1322
|
+
+ ' each is a description plus one SQL statement selecting the rows that VIOLATE it.'
|
|
1323
|
+
+ ' `vat resources check --help` prints the SQL each built-in is equivalent to,'
|
|
1324
|
+
+ ' as a starting point.');
|
|
1255
1325
|
}
|
|
1256
1326
|
/**
|
|
1257
1327
|
* Run the project's declared checks against its projection.
|
|
@@ -1264,11 +1334,14 @@ async function superviseCheckRun(options) {
|
|
|
1264
1334
|
*
|
|
1265
1335
|
* `query`'s author is at the keyboard, and Ctrl-C already works for them. It
|
|
1266
1336
|
* works for one reason worth stating, because it is fragile: NO signal handler
|
|
1267
|
-
* is installed
|
|
1337
|
+
* is installed in a process that runs the SQL. A process blocked in synchronous
|
|
1268
1338
|
* `node:sqlite` dies instantly on SIGINT while that remains true, and SURVIVES
|
|
1269
1339
|
* SIGINT and SIGTERM the moment a handler exists — the handler is a JS callback
|
|
1270
1340
|
* and the event loop that would schedule it is the blocked resource. Adding one
|
|
1271
|
-
* would take Ctrl-C away from `query
|
|
1341
|
+
* would take Ctrl-C away from `query`, and from `check`'s child and its
|
|
1342
|
+
* `--budget 0` run. (`check`'s SUPERVISING process does install handlers while
|
|
1343
|
+
* it supervises — its event loop is free — only to take its child down with it;
|
|
1344
|
+
* see `check-supervisor.ts`.)
|
|
1272
1345
|
*
|
|
1273
1346
|
* `check` runs unattended in CI, where nobody is there to press it. So it gets a
|
|
1274
1347
|
* bound enforced from outside itself, and a hang becomes a bounded failure
|
|
@@ -1289,99 +1362,163 @@ async function superviseCheckRun(options) {
|
|
|
1289
1362
|
export async function checkCommand(pathArg, options) {
|
|
1290
1363
|
const logger = createLogger({ debug: options.debug ?? false });
|
|
1291
1364
|
const startTime = Date.now();
|
|
1365
|
+
// The two formats this verb offers (Commander refuses any other).
|
|
1366
|
+
const format = options.format === 'json' ? 'json' : 'yaml';
|
|
1292
1367
|
try {
|
|
1293
1368
|
if (pathArg !== undefined)
|
|
1294
1369
|
assertDirectoryArgument(pathArg);
|
|
1295
1370
|
const budgetSecs = parseBudgetSeconds(options.budget);
|
|
1296
1371
|
// Before anything is spawned: a budget the fork below would silently ignore
|
|
1297
1372
|
// is an operator error, not a bound.
|
|
1298
|
-
requireSupervisableFlags({
|
|
1299
|
-
|
|
1373
|
+
const child = requireSupervisableFlags({
|
|
1374
|
+
supervisedBy: options.supervisedBy,
|
|
1300
1375
|
budgetRaw: options.budget,
|
|
1301
1376
|
budgetSecs,
|
|
1302
1377
|
});
|
|
1303
|
-
// The
|
|
1378
|
+
// The process the operator ran — never a supervised child — says when the
|
|
1379
|
+
// project declares no checks of its own, and prints the config's warnings
|
|
1380
|
+
// with it. See {@link warnWhenNoOwnChecks}.
|
|
1381
|
+
const root = standaloneRoot(pathArg);
|
|
1382
|
+
if (child === undefined) {
|
|
1383
|
+
warnWhenNoOwnChecks(loadConfigCached(root, 'source')?.resources?.checks, logger);
|
|
1384
|
+
}
|
|
1385
|
+
// The presence of `--supervised-by` says "you ARE the child". `--budget 0` says
|
|
1304
1386
|
// the operator declined the bound; both run the work here, and the second
|
|
1305
1387
|
// can therefore hang forever, which its help text says.
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
emitCheckDocument(ending.payload, options.format);
|
|
1326
|
-
// ⛔ Never OK, and never decided here. A run that did not finish carries a
|
|
1327
|
-
// RUN_INTEGRITY finding (a check was in flight: exit 1) or is on the error
|
|
1328
|
-
// branch (nothing was examined: exit 2) — the document says which, and
|
|
1329
|
-
// the code is derived from it, as everywhere else.
|
|
1330
|
-
process.exit(exitCodeForReport(ending.payload));
|
|
1331
|
-
}
|
|
1332
|
-
// 🔑 FIRST, before anything that touches the tree: the child has booted.
|
|
1333
|
-
// The watchdog's clock started at the spawn, so without this line Node's
|
|
1334
|
-
// startup and the CLI's import were charged to the population — the one
|
|
1335
|
-
// unit the budget is already a total bound for. See `StartedEntrySchema`.
|
|
1336
|
-
const onProgress = options.costLog === undefined
|
|
1337
|
-
? undefined
|
|
1338
|
-
: createProgressWriter(options.costLog);
|
|
1339
|
-
onProgress?.({ kind: 'started' });
|
|
1340
|
-
const projectRoot = projectRootOrLoudCwd(pathArg ?? process.cwd(), logger);
|
|
1341
|
-
const config = loadConfigCached(projectRoot);
|
|
1342
|
-
const checks = config?.resources?.checks;
|
|
1343
|
-
if (checks === undefined || Object.keys(checks).length === 0) {
|
|
1344
|
-
// 🪤 Stderr only, and it decides NOTHING — the document is what the exit
|
|
1345
|
-
// code is computed from and what CI parses. ⚠️ It does not stand beside a
|
|
1346
|
-
// refusal: the built-in set runs here, so this run DID assert something.
|
|
1347
|
-
// What the operator needs to know is that the project is relying entirely
|
|
1348
|
-
// on VAT's defaults, which is what a deleted `checks:` block looks like.
|
|
1349
|
-
logger.warn(`No checks of this project's own are declared, so this run asserted only VAT's`
|
|
1350
|
-
+ ` built-in set (${BUILTIN_CHECK_NAMES.join(', ')}).`
|
|
1351
|
-
+ ' Add your own under `resources.checks` in vibe-agent-toolkit.config.yaml;'
|
|
1352
|
-
+ ' each is a description plus one SQL statement selecting the rows that VIOLATE it.'
|
|
1353
|
-
+ ' `vat resources check --help` prints the SQL each built-in is equivalent to,'
|
|
1354
|
-
+ ' as a starting point.');
|
|
1388
|
+
const ending = runsInThisProcess({ supervisedBy: options.supervisedBy, budgetSecs })
|
|
1389
|
+
? { payload: await withNoticeAudience(noticeAudienceOf(child), () => runChecksHere(pathArg, options, child, logger, startTime)) }
|
|
1390
|
+
: await superviseStandalone(root, options, format, budgetSecs);
|
|
1391
|
+
if ('forward' in ending) {
|
|
1392
|
+
// Verbatim (unless `withLeftover` had to add a finding to it) — the supervisor already checked it is
|
|
1393
|
+
// this verb's document — and on the code that document derives. The child already built what the operator's `--format` asked for, and
|
|
1394
|
+
// re-serializing it here would be a second place for that shape to live.
|
|
1395
|
+
//
|
|
1396
|
+
// ⚠️ `durationSecs` in it is therefore the CHILD's wall time and does
|
|
1397
|
+
// not include this process's own startup and spawn (~0.15 s measured).
|
|
1398
|
+
// Deliberate: the field is a breakdown that `populationSecs` and the
|
|
1399
|
+
// per-rule costs have to reconcile against, and folding in a supervisor
|
|
1400
|
+
// overhead none of them can account for would leave a remainder a
|
|
1401
|
+
// reader would attribute to whichever rule they were looking at — the
|
|
1402
|
+
// exact defect `CheckCost` documents.
|
|
1403
|
+
//
|
|
1404
|
+
// 🪤 `return` it, though its type is `never`: under a test's returning
|
|
1405
|
+
// exit spy a bare call would fall through to the second ending below.
|
|
1406
|
+
return endWithForwardedDocument(ending.forward);
|
|
1355
1407
|
}
|
|
1356
|
-
//
|
|
1357
|
-
|
|
1358
|
-
//
|
|
1359
|
-
|
|
1360
|
-
// beside the other config news rather than after a full population.
|
|
1361
|
-
warnUndeclaredOverrides(checks ?? {}, config?.resources?.validation, logger);
|
|
1362
|
-
const outcome = await runOutcome({
|
|
1363
|
-
root: projectRoot,
|
|
1364
|
-
checks: checks ?? {},
|
|
1365
|
-
only: options.check,
|
|
1366
|
-
logger,
|
|
1367
|
-
validation: config?.resources?.validation,
|
|
1368
|
-
onProgress,
|
|
1369
|
-
});
|
|
1370
|
-
const { issues, costs, ...populated } = outcome;
|
|
1371
|
-
const payload = buildCheckOutputData({
|
|
1372
|
-
issues,
|
|
1373
|
-
costs,
|
|
1374
|
-
populated,
|
|
1375
|
-
root: projectRoot,
|
|
1376
|
-
durationMs: Date.now() - startTime,
|
|
1377
|
-
});
|
|
1378
|
-
emitCheckDocument(payload, options.format);
|
|
1379
|
-
process.exit(exitCodeForReport(payload));
|
|
1408
|
+
// A killed child is never OK and never decided here: its document carries
|
|
1409
|
+
// a RUN_INTEGRITY finding (exit 1) or the error branch (exit 2), and the
|
|
1410
|
+
// writer derives the code from it, as everywhere else.
|
|
1411
|
+
endWithReport('resources check', ending.payload, format);
|
|
1380
1412
|
}
|
|
1381
1413
|
catch (error) {
|
|
1382
|
-
|
|
1414
|
+
// `vat resources check` offers no `--strict`: warnings never fail it.
|
|
1415
|
+
endWithRefusal('resources check', refusalCodeOf(error), error, format, { strict: false }, NOTHING_FINISHED);
|
|
1383
1416
|
}
|
|
1384
1417
|
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Which notices the process running the checks prints.
|
|
1420
|
+
*
|
|
1421
|
+
* Any process that is not a supervised child prints every notice. A supervised child prints no
|
|
1422
|
+
* config warning — its invoking process loaded the same config and printed them — and prints the
|
|
1423
|
+
* store notice only when a standalone `vat resources check` started it: that supervisor opens no
|
|
1424
|
+
* store (keying one is a git snapshot, unbounded work it must not do before its watchdog exists),
|
|
1425
|
+
* while `vat validate` opened its store scope, and printed the notice, before any phase ran.
|
|
1426
|
+
*
|
|
1427
|
+
* @param child - The supervised child this process is, or undefined when it is not one
|
|
1428
|
+
* @returns The audience
|
|
1429
|
+
*/
|
|
1430
|
+
function noticeAudienceOf(child) {
|
|
1431
|
+
if (child === undefined)
|
|
1432
|
+
return EVERY_NOTICE;
|
|
1433
|
+
return { config: false, store: child.invoker === 'standalone' };
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Supervise the checks child for a standalone `vat resources check`.
|
|
1437
|
+
*
|
|
1438
|
+
* 🔑 Nothing unbounded runs here before the spawn: no store is opened and no tree is snapshotted,
|
|
1439
|
+
* so the watchdog exists before any work that could hang. The store notice is the child's to print
|
|
1440
|
+
* (see {@link noticeAudienceOf}).
|
|
1441
|
+
*
|
|
1442
|
+
* @param root - The project root this process resolved, which the child checks
|
|
1443
|
+
* @param options - Parsed command-line options
|
|
1444
|
+
* @param format - The document format the operator asked for
|
|
1445
|
+
* @param budgetSecs - The bound, in seconds
|
|
1446
|
+
* @returns What to publish
|
|
1447
|
+
*/
|
|
1448
|
+
function superviseStandalone(root, options, format, budgetSecs) {
|
|
1449
|
+
return superviseCheckRun({
|
|
1450
|
+
root,
|
|
1451
|
+
request: { check: options.check, format, debug: options.debug === true, invocation: 'standalone' },
|
|
1452
|
+
budgetSecs,
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* The project root a standalone `vat resources check` names, resolved SILENTLY.
|
|
1457
|
+
*
|
|
1458
|
+
* 🪤 Silent deliberately. `projectRootOrLoudCwd` warns on stderr when there is
|
|
1459
|
+
* no project ancestor, and the process that runs the checks (the child, or this
|
|
1460
|
+
* one under `--budget 0`) runs that policy for real — resolving loudly here too
|
|
1461
|
+
* would print the same warning twice for one run.
|
|
1462
|
+
*
|
|
1463
|
+
* @param pathArg - Where to look for the project, or omitted for the current directory
|
|
1464
|
+
* @returns The project root, or the resolved start directory when there is none
|
|
1465
|
+
*/
|
|
1466
|
+
function standaloneRoot(pathArg) {
|
|
1467
|
+
const startDir = pathArg ?? process.cwd();
|
|
1468
|
+
return projectRootOrNull(startDir) ?? safePath.resolve(startDir);
|
|
1469
|
+
}
|
|
1470
|
+
/**
|
|
1471
|
+
* Run the checks in this process and build the document.
|
|
1472
|
+
*
|
|
1473
|
+
* @param pathArg - Where to look for the project, or omitted for the current directory
|
|
1474
|
+
* @param options - Parsed command-line options
|
|
1475
|
+
* @param child - The supervised child this process is (its progress log), or undefined
|
|
1476
|
+
* @param logger - Where warnings go
|
|
1477
|
+
* @param startTime - When the command started (from Date.now())
|
|
1478
|
+
* @returns The document
|
|
1479
|
+
*/
|
|
1480
|
+
async function runChecksHere(pathArg, options, child, logger, startTime) {
|
|
1481
|
+
// 🔑 FIRST, before anything that touches the tree: the child has booted.
|
|
1482
|
+
// The watchdog's clock started at the spawn, so without this line Node's
|
|
1483
|
+
// startup and the CLI's import were charged to the population — the one
|
|
1484
|
+
// unit the budget is already a total bound for. See `StartedEntrySchema`.
|
|
1485
|
+
// And before that line: the child that outlives its supervisor ends itself — see
|
|
1486
|
+
// `endWhenSupervisorGone` for when that can and cannot be noticed.
|
|
1487
|
+
if (child !== undefined)
|
|
1488
|
+
endWhenSupervisorGone(child.supervisorPid, process.stdin);
|
|
1489
|
+
const onProgress = child === undefined
|
|
1490
|
+
? undefined
|
|
1491
|
+
: createProgressWriter(child);
|
|
1492
|
+
onProgress?.({ kind: 'started' });
|
|
1493
|
+
const projectRoot = projectRootOrLoudCwd(pathArg ?? process.cwd(), logger);
|
|
1494
|
+
const config = loadConfigCached(projectRoot, 'source');
|
|
1495
|
+
const checks = config?.resources?.checks;
|
|
1496
|
+
// Before the crawl: a mistyped flag is an operator error and pays nothing.
|
|
1497
|
+
requireKnownCheck(BUILTIN_CHECK_NAMES, checks ?? {}, options.check);
|
|
1498
|
+
// Also before the crawl, and for the same reason: an override that overrides
|
|
1499
|
+
// nothing is knowable from the config alone, and the operator should read it
|
|
1500
|
+
// beside the other config news rather than after a full population.
|
|
1501
|
+
warnUndeclaredOverrides(checks ?? {}, config?.resources?.validation, logger);
|
|
1502
|
+
const outcome = await runOutcome({
|
|
1503
|
+
root: projectRoot,
|
|
1504
|
+
checks: checks ?? {},
|
|
1505
|
+
only: options.check,
|
|
1506
|
+
logger,
|
|
1507
|
+
validation: config?.resources?.validation,
|
|
1508
|
+
onProgress,
|
|
1509
|
+
});
|
|
1510
|
+
const { issues, costs, ...populated } = outcome;
|
|
1511
|
+
// The checks ran synchronously: a supervisor lost meanwhile ends this child HERE, unpublished.
|
|
1512
|
+
if (child !== undefined)
|
|
1513
|
+
await letSupervisorLossSurface();
|
|
1514
|
+
return buildCheckOutputData({
|
|
1515
|
+
issues,
|
|
1516
|
+
costs,
|
|
1517
|
+
populated,
|
|
1518
|
+
root: projectRoot,
|
|
1519
|
+
durationMs: Date.now() - startTime,
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1385
1522
|
/**
|
|
1386
1523
|
* Populate once, run the checks, resolve their severities.
|
|
1387
1524
|
*
|
|
@@ -1395,7 +1532,7 @@ export async function checkCommand(pathArg, options) {
|
|
|
1395
1532
|
* outside this process, or undefined when nothing is watching
|
|
1396
1533
|
* @returns The findings and the provenance of the population behind them
|
|
1397
1534
|
*/
|
|
1398
|
-
|
|
1535
|
+
function runOutcome(options) {
|
|
1399
1536
|
const { root, checks, only, logger, validation, onProgress } = options;
|
|
1400
1537
|
// 🪤 **No `preflight` here, deliberately.** `withQueriedProjection` can compile
|
|
1401
1538
|
// statements against the empty schema before populating — `vat resources query`
|
|
@@ -1423,6 +1560,7 @@ async function runOutcome(options) {
|
|
|
1423
1560
|
onProgress?.({
|
|
1424
1561
|
kind: 'population',
|
|
1425
1562
|
population: provenance.population,
|
|
1563
|
+
lensPopulation: provenance.lensPopulation,
|
|
1426
1564
|
populationMs: provenance.populationMs,
|
|
1427
1565
|
lensMs: provenance.lensMs,
|
|
1428
1566
|
lensesEvaluated: [...provenance.lensesEvaluated],
|
|
@@ -1449,4 +1587,6 @@ async function runOutcome(options) {
|
|
|
1449
1587
|
return { ...ran, ...provenance, ...extent };
|
|
1450
1588
|
});
|
|
1451
1589
|
}
|
|
1590
|
+
/** The test-facing seam: helpers the unit tests reach that are not part of this module's API. */
|
|
1591
|
+
export const __internal = { noticeAudienceOf };
|
|
1452
1592
|
//# sourceMappingURL=check.js.map
|