@shrkcrft/cli 0.1.0-alpha.29 → 0.1.0-alpha.31
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/dist/asset-preview/apply-asset-preview.js +1 -1
- package/dist/authoring/authoring-kit.d.ts +9 -1
- package/dist/authoring/authoring-kit.d.ts.map +1 -1
- package/dist/authoring/authoring-kit.js +26 -13
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts +11 -0
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts.map +1 -0
- package/dist/bootstrap/unlinked-workspace-dependency.js +99 -0
- package/dist/command-registry.d.ts +100 -1
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +130 -3
- package/dist/commands/api-diff.command.d.ts.map +1 -1
- package/dist/commands/api-diff.command.js +12 -0
- package/dist/commands/apply.command.d.ts.map +1 -1
- package/dist/commands/apply.command.js +3 -0
- package/dist/commands/arch.command.d.ts.map +1 -1
- package/dist/commands/arch.command.js +26 -7
- package/dist/commands/architecture.command.d.ts.map +1 -1
- package/dist/commands/architecture.command.js +8 -2
- package/dist/commands/baseline.command.d.ts +76 -0
- package/dist/commands/baseline.command.d.ts.map +1 -1
- package/dist/commands/baseline.command.js +599 -75
- package/dist/commands/biome.command.d.ts.map +1 -1
- package/dist/commands/biome.command.js +20 -0
- package/dist/commands/boundaries.command.d.ts +9 -1
- package/dist/commands/boundaries.command.d.ts.map +1 -1
- package/dist/commands/boundaries.command.js +88 -20
- package/dist/commands/bundle.command.d.ts.map +1 -1
- package/dist/commands/bundle.command.js +57 -11
- package/dist/commands/cache-align.command.d.ts.map +1 -1
- package/dist/commands/cache-align.command.js +3 -1
- package/dist/commands/changelog-data.d.ts.map +1 -1
- package/dist/commands/changelog-data.js +164 -0
- package/dist/commands/changes.command.d.ts.map +1 -1
- package/dist/commands/changes.command.js +15 -0
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +1260 -324
- package/dist/commands/checks.command.d.ts.map +1 -1
- package/dist/commands/checks.command.js +188 -40
- package/dist/commands/ci.command.d.ts.map +1 -1
- package/dist/commands/ci.command.js +35 -2
- package/dist/commands/code-intel.command.d.ts.map +1 -1
- package/dist/commands/code-intel.command.js +8 -1
- package/dist/commands/command-catalog.d.ts +23 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +152 -35
- package/dist/commands/commands.command.d.ts +21 -3
- package/dist/commands/commands.command.d.ts.map +1 -1
- package/dist/commands/commands.command.js +172 -27
- package/dist/commands/compress.command.d.ts.map +1 -1
- package/dist/commands/compress.command.js +4 -0
- package/dist/commands/constructs.command.d.ts.map +1 -1
- package/dist/commands/constructs.command.js +50 -12
- package/dist/commands/context.command.d.ts.map +1 -1
- package/dist/commands/context.command.js +40 -5
- package/dist/commands/contract-templates.command.d.ts.map +1 -1
- package/dist/commands/contract-templates.command.js +9 -1
- package/dist/commands/contract.command.d.ts.map +1 -1
- package/dist/commands/contract.command.js +35 -0
- package/dist/commands/conventions.command.d.ts.map +1 -1
- package/dist/commands/conventions.command.js +189 -29
- package/dist/commands/coverage.command.d.ts.map +1 -1
- package/dist/commands/coverage.command.js +9 -0
- package/dist/commands/daily.commands.d.ts +0 -1
- package/dist/commands/daily.commands.d.ts.map +1 -1
- package/dist/commands/daily.commands.js +12 -76
- package/dist/commands/dashboard.command.d.ts.map +1 -1
- package/dist/commands/dashboard.command.js +10 -0
- package/dist/commands/dev.command.d.ts.map +1 -1
- package/dist/commands/dev.command.js +45 -2
- package/dist/commands/diagnostics.command.d.ts +0 -2
- package/dist/commands/diagnostics.command.d.ts.map +1 -1
- package/dist/commands/diagnostics.command.js +5 -78
- package/dist/commands/diff-check.command.d.ts +6 -4
- package/dist/commands/diff-check.command.d.ts.map +1 -1
- package/dist/commands/diff-check.command.js +190 -103
- package/dist/commands/docs-references.command.d.ts +20 -0
- package/dist/commands/docs-references.command.d.ts.map +1 -0
- package/dist/commands/docs-references.command.js +520 -0
- package/dist/commands/doctor.command.d.ts.map +1 -1
- package/dist/commands/doctor.command.js +60 -5
- package/dist/commands/drift.command.d.ts.map +1 -1
- package/dist/commands/drift.command.js +17 -4
- package/dist/commands/eslint.command.d.ts.map +1 -1
- package/dist/commands/eslint.command.js +20 -0
- package/dist/commands/export.command.d.ts.map +1 -1
- package/dist/commands/export.command.js +23 -1
- package/dist/commands/feedback-dispatch.command.d.ts.map +1 -1
- package/dist/commands/feedback-dispatch.command.js +29 -0
- package/dist/commands/feedback.command.d.ts.map +1 -1
- package/dist/commands/feedback.command.js +6 -1
- package/dist/commands/finish.command.d.ts.map +1 -1
- package/dist/commands/finish.command.js +32 -8
- package/dist/commands/fix.command.d.ts.map +1 -1
- package/dist/commands/fix.command.js +19 -0
- package/dist/commands/gate.command.d.ts +6 -1
- package/dist/commands/gate.command.d.ts.map +1 -1
- package/dist/commands/gate.command.js +50 -124
- package/dist/commands/gates.command.d.ts +54 -0
- package/dist/commands/gates.command.d.ts.map +1 -1
- package/dist/commands/gates.command.js +1314 -64
- package/dist/commands/gen.command.d.ts.map +1 -1
- package/dist/commands/gen.command.js +4 -0
- package/dist/commands/generated.command.d.ts +62 -0
- package/dist/commands/generated.command.d.ts.map +1 -1
- package/dist/commands/generated.command.js +639 -156
- package/dist/commands/graph-code-subverbs.d.ts +15 -0
- package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
- package/dist/commands/graph-code-subverbs.js +203 -25
- package/dist/commands/graph.command.d.ts.map +1 -1
- package/dist/commands/graph.command.js +79 -37
- package/dist/commands/help.command.d.ts +30 -6
- package/dist/commands/help.command.d.ts.map +1 -1
- package/dist/commands/help.command.js +323 -199
- package/dist/commands/helper.command.d.ts +1 -0
- package/dist/commands/helper.command.d.ts.map +1 -1
- package/dist/commands/helper.command.js +195 -56
- package/dist/commands/impact.command.d.ts.map +1 -1
- package/dist/commands/impact.command.js +115 -12
- package/dist/commands/infer.command.d.ts.map +1 -1
- package/dist/commands/infer.command.js +20 -45
- package/dist/commands/ingest.command.d.ts +0 -1
- package/dist/commands/ingest.command.d.ts.map +1 -1
- package/dist/commands/ingest.command.js +25 -41
- package/dist/commands/knowledge-author.command.d.ts +0 -3
- package/dist/commands/knowledge-author.command.d.ts.map +1 -1
- package/dist/commands/knowledge-author.command.js +10 -23
- package/dist/commands/knowledge.command.d.ts.map +1 -1
- package/dist/commands/knowledge.command.js +469 -129
- package/dist/commands/languages.command.d.ts.map +1 -1
- package/dist/commands/languages.command.js +27 -0
- package/dist/commands/lint.command.d.ts.map +1 -1
- package/dist/commands/lint.command.js +3 -0
- package/dist/commands/mcp.command.d.ts +18 -0
- package/dist/commands/mcp.command.d.ts.map +1 -1
- package/dist/commands/mcp.command.js +33 -8
- package/dist/commands/onboard.command.d.ts.map +1 -1
- package/dist/commands/onboard.command.js +20 -0
- package/dist/commands/owners.command.d.ts.map +1 -1
- package/dist/commands/owners.command.js +14 -2
- package/dist/commands/packs-new.d.ts +13 -1
- package/dist/commands/packs-new.d.ts.map +1 -1
- package/dist/commands/packs-new.js +500 -335
- package/dist/commands/packs.command.d.ts.map +1 -1
- package/dist/commands/packs.command.js +378 -36
- package/dist/commands/paths.command.d.ts.map +1 -1
- package/dist/commands/paths.command.js +9 -1
- package/dist/commands/pipelines.command.d.ts.map +1 -1
- package/dist/commands/pipelines.command.js +7 -1
- package/dist/commands/plan-check.command.d.ts.map +1 -1
- package/dist/commands/plan-check.command.js +3 -0
- package/dist/commands/plan.command.d.ts.map +1 -1
- package/dist/commands/plan.command.js +3 -0
- package/dist/commands/playbooks.command.d.ts.map +1 -1
- package/dist/commands/playbooks.command.js +7 -2
- package/dist/commands/policy-lint.command.d.ts +19 -2
- package/dist/commands/policy-lint.command.d.ts.map +1 -1
- package/dist/commands/policy-lint.command.js +224 -65
- package/dist/commands/policy.command.d.ts.map +1 -1
- package/dist/commands/policy.command.js +6 -1
- package/dist/commands/pr.command.d.ts.map +1 -1
- package/dist/commands/pr.command.js +14 -0
- package/dist/commands/presets.command.d.ts.map +1 -1
- package/dist/commands/presets.command.js +12 -27
- package/dist/commands/profiles.command.d.ts.map +1 -1
- package/dist/commands/profiles.command.js +94 -26
- package/dist/commands/provenance.command.js +1 -1
- package/dist/commands/quality.command.d.ts.map +1 -1
- package/dist/commands/quality.command.js +129 -33
- package/dist/commands/recommend.command.d.ts +20 -4
- package/dist/commands/recommend.command.d.ts.map +1 -1
- package/dist/commands/recommend.command.js +172 -278
- package/dist/commands/registrations.command.d.ts.map +1 -1
- package/dist/commands/registrations.command.js +138 -13
- package/dist/commands/registry-lifecycle-run.d.ts +14 -0
- package/dist/commands/registry-lifecycle-run.d.ts.map +1 -0
- package/dist/commands/registry-lifecycle-run.js +336 -0
- package/dist/commands/registry.command.d.ts.map +1 -1
- package/dist/commands/registry.command.js +235 -62
- package/dist/commands/release.command.d.ts.map +1 -1
- package/dist/commands/release.command.js +99 -20
- package/dist/commands/report.command.d.ts.map +1 -1
- package/dist/commands/report.command.js +38 -2
- package/dist/commands/reuse-coverage.command.d.ts +23 -0
- package/dist/commands/reuse-coverage.command.d.ts.map +1 -0
- package/dist/commands/reuse-coverage.command.js +536 -0
- package/dist/commands/reuse.command.d.ts +3 -18
- package/dist/commands/reuse.command.d.ts.map +1 -1
- package/dist/commands/reuse.command.js +395 -244
- package/dist/commands/review.command.d.ts.map +1 -1
- package/dist/commands/review.command.js +33 -1
- package/dist/commands/rounds.command.d.ts.map +1 -1
- package/dist/commands/rounds.command.js +5 -0
- package/dist/commands/safety.command.d.ts.map +1 -1
- package/dist/commands/safety.command.js +9 -0
- package/dist/commands/scaffolds.command.d.ts.map +1 -1
- package/dist/commands/scaffolds.command.js +97 -25
- package/dist/commands/search.command.d.ts +0 -8
- package/dist/commands/search.command.d.ts.map +1 -1
- package/dist/commands/search.command.js +136 -28
- package/dist/commands/self-config-xrefs.command.d.ts +24 -0
- package/dist/commands/self-config-xrefs.command.d.ts.map +1 -0
- package/dist/commands/self-config-xrefs.command.js +170 -0
- package/dist/commands/self-config.command.d.ts.map +1 -1
- package/dist/commands/self-config.command.js +261 -65
- package/dist/commands/smart-context.command.d.ts.map +1 -1
- package/dist/commands/smart-context.command.js +39 -3
- package/dist/commands/spec.command.d.ts.map +1 -1
- package/dist/commands/spec.command.js +3 -0
- package/dist/commands/stats.command.d.ts.map +1 -1
- package/dist/commands/stats.command.js +3 -0
- package/dist/commands/surface.command.d.ts +6 -1
- package/dist/commands/surface.command.d.ts.map +1 -1
- package/dist/commands/surface.command.js +256 -54
- package/dist/commands/task-context.command.js +1 -1
- package/dist/commands/task.command.d.ts.map +1 -1
- package/dist/commands/task.command.js +22 -1
- package/dist/commands/templates.command.d.ts +4 -0
- package/dist/commands/templates.command.d.ts.map +1 -1
- package/dist/commands/templates.command.js +109 -22
- package/dist/commands/test.command.d.ts.map +1 -1
- package/dist/commands/test.command.js +161 -33
- package/dist/commands/tests.command.d.ts.map +1 -1
- package/dist/commands/tests.command.js +29 -3
- package/dist/commands/trace.command.d.ts.map +1 -1
- package/dist/commands/trace.command.js +29 -4
- package/dist/commands/watch.command.d.ts.map +1 -1
- package/dist/commands/watch.command.js +3 -0
- package/dist/commands/why.command.d.ts.map +1 -1
- package/dist/commands/why.command.js +3 -0
- package/dist/commands/wiring.command.d.ts +18 -4
- package/dist/commands/wiring.command.d.ts.map +1 -1
- package/dist/commands/wiring.command.js +362 -74
- package/dist/dashboard/code-intelligence-data.js +4 -4
- package/dist/diff/deleted-orphan-coverage.d.ts +32 -0
- package/dist/diff/deleted-orphan-coverage.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-coverage.js +107 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts +23 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-scope-notes.js +49 -0
- package/dist/diff/deleted-orphans.d.ts +32 -0
- package/dist/diff/deleted-orphans.d.ts.map +1 -1
- package/dist/diff/deleted-orphans.js +42 -2
- package/dist/dispatch/closest-match.d.ts +15 -0
- package/dist/dispatch/closest-match.d.ts.map +1 -0
- package/dist/dispatch/closest-match.js +47 -0
- package/dist/dispatch/global-flags.d.ts +94 -0
- package/dist/dispatch/global-flags.d.ts.map +1 -0
- package/dist/dispatch/global-flags.js +123 -0
- package/dist/dispatch/guard-invocation-input.d.ts +24 -0
- package/dist/dispatch/guard-invocation-input.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation-input.js +1 -0
- package/dist/dispatch/guard-invocation.d.ts +33 -0
- package/dist/dispatch/guard-invocation.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation.js +183 -0
- package/dist/dispatch/help-intercept.d.ts +22 -0
- package/dist/dispatch/help-intercept.d.ts.map +1 -0
- package/dist/dispatch/help-intercept.js +42 -0
- package/dist/dispatch/i-declared-invocation.d.ts +17 -0
- package/dist/dispatch/i-declared-invocation.d.ts.map +1 -0
- package/dist/dispatch/i-declared-invocation.js +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts +28 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts.map +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.js +1 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts +15 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection-kind.js +15 -0
- package/dist/dispatch/invocation-rejection.d.ts +18 -0
- package/dist/dispatch/invocation-rejection.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection.js +1 -0
- package/dist/dispatch/judge-invocation.d.ts +24 -0
- package/dist/dispatch/judge-invocation.d.ts.map +1 -0
- package/dist/dispatch/judge-invocation.js +50 -0
- package/dist/dispatch/positional-mode.d.ts +18 -0
- package/dist/dispatch/positional-mode.d.ts.map +1 -0
- package/dist/dispatch/positional-mode.js +18 -0
- package/dist/dispatch/read-tracking-map.d.ts +28 -0
- package/dist/dispatch/read-tracking-map.d.ts.map +1 -0
- package/dist/dispatch/read-tracking-map.js +58 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts +30 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts.map +1 -0
- package/dist/dispatch/refuse-sibling-valve-flags.js +65 -0
- package/dist/dispatch/subverb-spec.d.ts +26 -0
- package/dist/dispatch/subverb-spec.d.ts.map +1 -0
- package/dist/dispatch/subverb-spec.js +1 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts +22 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts.map +1 -0
- package/dist/dispatch/undocumented-flag-reads.js +283 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts +13 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal-mode.js +13 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts +22 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal.js +57 -0
- package/dist/dispatch/unread-flags.d.ts +152 -0
- package/dist/dispatch/unread-flags.d.ts.map +1 -0
- package/dist/dispatch/unread-flags.js +295 -0
- package/dist/dispatch/verdict-valve-flag.d.ts +21 -0
- package/dist/dispatch/verdict-valve-flag.d.ts.map +1 -0
- package/dist/dispatch/verdict-valve-flag.js +21 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts +14 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts.map +1 -0
- package/dist/dispatch/walk-declared-subverbs.js +28 -0
- package/dist/exit-codes.d.ts +41 -3
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +153 -14
- package/dist/finish/run-finish.d.ts +72 -5
- package/dist/finish/run-finish.d.ts.map +1 -1
- package/dist/finish/run-finish.js +453 -104
- package/dist/gates/accepted-empty-note.d.ts +10 -0
- package/dist/gates/accepted-empty-note.d.ts.map +1 -0
- package/dist/gates/accepted-empty-note.js +11 -0
- package/dist/gates/allow-empty.d.ts +25 -0
- package/dist/gates/allow-empty.d.ts.map +1 -0
- package/dist/gates/allow-empty.js +27 -0
- package/dist/gates/asset-doctor-failing-units.d.ts +16 -0
- package/dist/gates/asset-doctor-failing-units.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failing-units.js +14 -0
- package/dist/gates/asset-doctor-failure-line.d.ts +16 -0
- package/dist/gates/asset-doctor-failure-line.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failure-line.js +28 -0
- package/dist/gates/empty-rule-advice-lines.d.ts +15 -0
- package/dist/gates/empty-rule-advice-lines.d.ts.map +1 -0
- package/dist/gates/empty-rule-advice-lines.js +20 -0
- package/dist/gates/gate-envelope.d.ts +85 -8
- package/dist/gates/gate-envelope.d.ts.map +1 -1
- package/dist/gates/gate-envelope.js +56 -7
- package/dist/gates/gate-rule-globs.d.ts +67 -0
- package/dist/gates/gate-rule-globs.d.ts.map +1 -0
- package/dist/gates/gate-rule-globs.js +139 -0
- package/dist/gates/gate-rule-view.d.ts +25 -6
- package/dist/gates/gate-rule-view.d.ts.map +1 -1
- package/dist/gates/gate-rule-view.js +105 -77
- package/dist/gates/i-coverage-dead-glob.d.ts +19 -0
- package/dist/gates/i-coverage-dead-glob.d.ts.map +1 -0
- package/dist/gates/i-coverage-dead-glob.js +1 -0
- package/dist/gates/i-coverage-negation.d.ts +13 -0
- package/dist/gates/i-coverage-negation.d.ts.map +1 -0
- package/dist/gates/i-coverage-negation.js +1 -0
- package/dist/gates/i-registration-query-settle-input.d.ts +18 -0
- package/dist/gates/i-registration-query-settle-input.d.ts.map +1 -0
- package/dist/gates/i-registration-query-settle-input.js +1 -0
- package/dist/gates/i-unit-state-note-row.d.ts +16 -0
- package/dist/gates/i-unit-state-note-row.d.ts.map +1 -0
- package/dist/gates/i-unit-state-note-row.js +1 -0
- package/dist/gates/i-unit-state-notes.d.ts +32 -0
- package/dist/gates/i-unit-state-notes.d.ts.map +1 -0
- package/dist/gates/i-unit-state-notes.js +1 -0
- package/dist/gates/incomplete-registry-inventory.d.ts +19 -0
- package/dist/gates/incomplete-registry-inventory.d.ts.map +1 -0
- package/dist/gates/incomplete-registry-inventory.js +63 -0
- package/dist/gates/measure-registration-roles.d.ts +10 -0
- package/dist/gates/measure-registration-roles.d.ts.map +1 -0
- package/dist/gates/measure-registration-roles.js +9 -0
- package/dist/gates/plane-verdict.d.ts +14 -0
- package/dist/gates/plane-verdict.d.ts.map +1 -0
- package/dist/gates/plane-verdict.js +22 -0
- package/dist/gates/qualify-clean-for-units.d.ts +12 -0
- package/dist/gates/qualify-clean-for-units.d.ts.map +1 -0
- package/dist/gates/qualify-clean-for-units.js +18 -0
- package/dist/gates/registration-graph-verdict.d.ts +34 -0
- package/dist/gates/registration-graph-verdict.d.ts.map +1 -0
- package/dist/gates/registration-graph-verdict.js +70 -0
- package/dist/gates/registration-roles.d.ts +9 -0
- package/dist/gates/registration-roles.d.ts.map +1 -0
- package/dist/gates/registration-roles.js +1 -0
- package/dist/gates/registry-liveness.d.ts +11 -0
- package/dist/gates/registry-liveness.d.ts.map +1 -0
- package/dist/gates/registry-liveness.js +13 -0
- package/dist/gates/rule-coverage.d.ts +225 -4
- package/dist/gates/rule-coverage.d.ts.map +1 -1
- package/dist/gates/rule-coverage.js +610 -43
- package/dist/gates/run-gate-planes.d.ts +58 -0
- package/dist/gates/run-gate-planes.d.ts.map +1 -0
- package/dist/gates/run-gate-planes.js +403 -0
- package/dist/gates/scaffold-selftest.d.ts +56 -0
- package/dist/gates/scaffold-selftest.d.ts.map +1 -0
- package/dist/gates/scaffold-selftest.js +119 -0
- package/dist/gates/seam-rejected-rules.d.ts +28 -0
- package/dist/gates/seam-rejected-rules.d.ts.map +1 -0
- package/dist/gates/seam-rejected-rules.js +95 -0
- package/dist/gates/self-test-check.d.ts +29 -0
- package/dist/gates/self-test-check.d.ts.map +1 -0
- package/dist/gates/self-test-check.js +1 -0
- package/dist/gates/self-test-subject.d.ts +28 -0
- package/dist/gates/self-test-subject.d.ts.map +1 -0
- package/dist/gates/self-test-subject.js +1 -0
- package/dist/gates/self-test.d.ts +20 -0
- package/dist/gates/self-test.d.ts.map +1 -0
- package/dist/gates/self-test.js +82 -0
- package/dist/gates/settle-verdict.d.ts +14 -0
- package/dist/gates/settle-verdict.d.ts.map +1 -0
- package/dist/gates/settle-verdict.js +13 -0
- package/dist/gates/settled-verdict.d.ts +8 -0
- package/dist/gates/settled-verdict.d.ts.map +1 -0
- package/dist/gates/settled-verdict.js +1 -0
- package/dist/gates/template-registry-coverage.d.ts +18 -0
- package/dist/gates/template-registry-coverage.d.ts.map +1 -0
- package/dist/gates/template-registry-coverage.js +24 -0
- package/dist/gates/unit-state-notes.d.ts +40 -0
- package/dist/gates/unit-state-notes.d.ts.map +1 -0
- package/dist/gates/unit-state-notes.js +71 -0
- package/dist/gates/verdict-line.d.ts +18 -0
- package/dist/gates/verdict-line.d.ts.map +1 -0
- package/dist/gates/verdict-line.js +40 -0
- package/dist/graph/graph-reuse-lookup.d.ts +10 -0
- package/dist/graph/graph-reuse-lookup.d.ts.map +1 -0
- package/dist/graph/graph-reuse-lookup.js +41 -0
- package/dist/graph/index-behind-hint.d.ts +11 -0
- package/dist/graph/index-behind-hint.d.ts.map +1 -0
- package/dist/graph/index-behind-hint.js +27 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts +10 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate.js +9 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +204 -83
- package/dist/output/failure-hints.d.ts.map +1 -1
- package/dist/output/failure-hints.js +11 -9
- package/dist/output/rejected-entries-note.d.ts +57 -0
- package/dist/output/rejected-entries-note.d.ts.map +1 -0
- package/dist/output/rejected-entries-note.js +103 -0
- package/dist/output/stdout-is-pipe.d.ts +13 -0
- package/dist/output/stdout-is-pipe.d.ts.map +1 -0
- package/dist/output/stdout-is-pipe.js +21 -0
- package/dist/packs/stale-build-warning.d.ts +11 -0
- package/dist/packs/stale-build-warning.d.ts.map +1 -0
- package/dist/packs/stale-build-warning.js +23 -0
- package/dist/quality/run-quality.d.ts +123 -0
- package/dist/quality/run-quality.d.ts.map +1 -0
- package/dist/quality/run-quality.js +442 -0
- package/dist/schemas/json-schemas.d.ts +184 -3
- package/dist/schemas/json-schemas.d.ts.map +1 -1
- package/dist/schemas/json-schemas.js +113 -2
- package/dist/shrk.d.ts +3 -0
- package/dist/shrk.d.ts.map +1 -0
- package/dist/shrk.js +30 -0
- package/dist/surface/audience-applicability.d.ts +26 -0
- package/dist/surface/audience-applicability.d.ts.map +1 -0
- package/dist/surface/audience-applicability.js +60 -0
- package/dist/surface/catalog-command-safety.d.ts +18 -0
- package/dist/surface/catalog-command-safety.d.ts.map +1 -0
- package/dist/surface/catalog-command-safety.js +62 -0
- package/dist/surface/cli-command-resolver.d.ts +21 -0
- package/dist/surface/cli-command-resolver.d.ts.map +1 -0
- package/dist/surface/cli-command-resolver.js +87 -0
- package/dist/surface/command-dispatch-kind.d.ts +20 -0
- package/dist/surface/command-dispatch-kind.d.ts.map +1 -0
- package/dist/surface/command-dispatch-kind.js +20 -0
- package/dist/surface/command-index-entry.d.ts +40 -0
- package/dist/surface/command-index-entry.d.ts.map +1 -0
- package/dist/surface/command-index-entry.js +1 -0
- package/dist/surface/command-index.d.ts +77 -0
- package/dist/surface/command-index.d.ts.map +1 -0
- package/dist/surface/command-index.js +323 -0
- package/dist/surface/i-command-index.d.ts +22 -0
- package/dist/surface/i-command-index.d.ts.map +1 -0
- package/dist/surface/i-command-index.js +1 -0
- package/dist/surface/i-command-string-context.d.ts +20 -0
- package/dist/surface/i-command-string-context.d.ts.map +1 -0
- package/dist/surface/i-command-string-context.js +1 -0
- package/dist/surface/i-surface-denial.d.ts +13 -0
- package/dist/surface/i-surface-denial.d.ts.map +1 -0
- package/dist/surface/i-surface-denial.js +1 -0
- package/dist/surface/load-surface-context.d.ts +17 -1
- package/dist/surface/load-surface-context.d.ts.map +1 -1
- package/dist/surface/load-surface-context.js +48 -10
- package/dist/surface/not-enabled-error.d.ts +38 -4
- package/dist/surface/not-enabled-error.d.ts.map +1 -1
- package/dist/surface/not-enabled-error.js +96 -6
- package/dist/surface/profiles.d.ts +7 -0
- package/dist/surface/profiles.d.ts.map +1 -1
- package/dist/surface/resolve-command-string.d.ts +10 -0
- package/dist/surface/resolve-command-string.d.ts.map +1 -0
- package/dist/surface/resolve-command-string.js +572 -0
- package/dist/surface/surface-config-writer.d.ts +7 -2
- package/dist/surface/surface-config-writer.d.ts.map +1 -1
- package/dist/surface/surface-config-writer.js +25 -6
- package/dist/surface/surface-layer.d.ts +11 -0
- package/dist/surface/surface-layer.d.ts.map +1 -0
- package/dist/surface/surface-layer.js +11 -0
- package/dist/surface/surface-refusal-reason.d.ts +16 -0
- package/dist/surface/surface-refusal-reason.d.ts.map +1 -0
- package/dist/surface/surface-refusal-reason.js +16 -0
- package/dist/surface/surface-selector.d.ts +26 -0
- package/dist/surface/surface-selector.d.ts.map +1 -0
- package/dist/surface/surface-selector.js +42 -0
- package/dist/surface/surface-summary.d.ts +61 -18
- package/dist/surface/surface-summary.d.ts.map +1 -1
- package/dist/surface/surface-summary.js +147 -60
- package/dist/surface/tier.d.ts +85 -22
- package/dist/surface/tier.d.ts.map +1 -1
- package/dist/surface/tier.js +132 -30
- package/dist/usage/usage-log.d.ts +6 -1
- package/dist/usage/usage-log.d.ts.map +1 -1
- package/dist/usage/usage-log.js +7 -2
- package/dist/validation/run-validation-loop.d.ts +9 -0
- package/dist/validation/run-validation-loop.d.ts.map +1 -1
- package/dist/validation/run-validation-loop.js +14 -11
- package/dist/validation/typecheck-emitted.d.ts +8 -9
- package/dist/validation/typecheck-emitted.d.ts.map +1 -1
- package/dist/validation/typecheck-emitted.js +17 -97
- package/package.json +34 -34
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { buildUniversalSearch,
|
|
2
|
+
import { buildUniversalSearch, classifyQueryIntent, countsTowardConfidence, describeSuppression, entrypointBanner, inspectSharkcraft, rankRecommendationCandidates, recommendationReportFromRanking, RECOMMEND_SOURCE_FLOORS, RecommendationSource, renderUncertaintyReportText, } from '@shrkcrft/inspector';
|
|
3
3
|
import { flagBool, flagNumber, flagString, resolveCwd, } from "../command-registry.js";
|
|
4
|
+
import { ExitCode } from "../exit-codes.js";
|
|
4
5
|
import { asJson } from "../output/format-output.js";
|
|
5
6
|
import { loadSurfaceContext } from "../surface/load-surface-context.js";
|
|
6
|
-
import {
|
|
7
|
+
import { catalogCommandSafety } from "../surface/catalog-command-safety.js";
|
|
8
|
+
import { dropNotApplicable, notApplicableHere, surfaceViewForCommand } from "../surface/audience-applicability.js";
|
|
9
|
+
import { buildSurfaceSummary } from "../surface/surface-summary.js";
|
|
10
|
+
/**
|
|
11
|
+
* `shrk recommend` renders THE ranked list (`rankRecommendationCandidates`,
|
|
12
|
+
* inspector). It used to re-rank it: a CLI-only grounding prepend, a
|
|
13
|
+
* routing-hint "R1" promotion gated on create/build wording, and a separate
|
|
14
|
+
* "engine match" block — three code paths answering "what do I run first?",
|
|
15
|
+
* each with its own thresholds, none reachable from MCP or `shrk context`.
|
|
16
|
+
* Now every row, its attribution, `nextCommand`, the confidence and the
|
|
17
|
+
* coverage-gap verdict come from the one list; the CLI only gates rows by
|
|
18
|
+
* surface tier and re-picks `nextCommand` over what it renders, by THE rule.
|
|
19
|
+
*/
|
|
7
20
|
export const recommendCommand = {
|
|
8
21
|
name: 'recommend',
|
|
9
22
|
description: 'Recommend commands based on a free-form query, role, or stderr blob. Deterministic — no AI.',
|
|
10
|
-
usage: 'shrk recommend "<what I want to do>" [--from-error <stderr-file>] [--role developer|reviewer|architect|release-manager|security|ai-agent] [--json]',
|
|
23
|
+
usage: 'shrk recommend "<what I want to do>" [--from-error <stderr-file>] [--role developer|reviewer|architect|release-manager|security|ai-agent] [--min-score <n>] [--require-confident] [--verbose] [--json]',
|
|
24
|
+
booleanFlags: new Set([
|
|
25
|
+
'json',
|
|
26
|
+
'machine-json',
|
|
27
|
+
'verbose',
|
|
28
|
+
'full',
|
|
29
|
+
'include-gated',
|
|
30
|
+
'commands-first',
|
|
31
|
+
'actions-only',
|
|
32
|
+
'require-confident',
|
|
33
|
+
]),
|
|
11
34
|
async run(args) {
|
|
12
35
|
const query = args.positional.join(' ').trim();
|
|
13
36
|
const fromErrorFile = flagString(args, 'from-error');
|
|
@@ -25,218 +48,181 @@ export const recommendCommand = {
|
|
|
25
48
|
process.stderr.write('Usage: shrk recommend "<query>" or --from-error <file>\n');
|
|
26
49
|
return 2;
|
|
27
50
|
}
|
|
51
|
+
let minScore;
|
|
52
|
+
if (args.flags.has('min-score')) {
|
|
53
|
+
minScore = flagNumber(args, 'min-score');
|
|
54
|
+
if (minScore === undefined || !(minScore > 0)) {
|
|
55
|
+
process.stderr.write(`--min-score takes a number > 0 (the floor multiplier; 1 = each source's own floor), got "${String(args.flags.get('min-score'))}".\n`);
|
|
56
|
+
return ExitCode.UsageError;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
28
59
|
const cwd = resolveCwd(args);
|
|
29
60
|
const inspection = await inspectSharkcraft({ cwd });
|
|
30
61
|
const role = flagString(args, 'role');
|
|
31
|
-
const
|
|
62
|
+
const ranked = await rankRecommendationCandidates(inspection, query || fromError, {
|
|
32
63
|
...(fromError ? { fromError } : {}),
|
|
33
|
-
...(
|
|
64
|
+
...(minScore !== undefined ? { minScore } : {}),
|
|
65
|
+
// THE declared safety (the command catalog) — labels and withholds a
|
|
66
|
+
// writer by what its row declares, never by the fallback regex.
|
|
67
|
+
safetyOf: (command) => catalogCommandSafety(command),
|
|
34
68
|
});
|
|
35
|
-
|
|
36
|
-
// verb at the start, or a "plan/design/review for X" shape), prepend
|
|
37
|
-
// `shrk grounding "<task>"` as the top recommendation. The existing
|
|
38
|
-
// recommender output slides down. Pure-text classifier; no LLM.
|
|
39
|
-
if (query.length > 0 && looksLikePlanning(query)) {
|
|
40
|
-
const groundingRec = {
|
|
41
|
-
command: `shrk grounding "${query.replace(/"/g, '\\"')}" --json`,
|
|
42
|
-
why: 'DX#2: query looks like planning — start with grounding (task-relevant rules / knowledge / templates / verification IDs) before picking a write verb.',
|
|
43
|
-
safetyLevel: 'read-only',
|
|
44
|
-
};
|
|
45
|
-
// Avoid duplicating if the recommender already surfaced grounding.
|
|
46
|
-
const alreadyHasGrounding = reportRaw.recommendations.some((r) => r.command.startsWith('shrk grounding') || r.command.startsWith('bun run shrk grounding'));
|
|
47
|
-
if (!alreadyHasGrounding) {
|
|
48
|
-
reportRaw.recommendations = [
|
|
49
|
-
groundingRec,
|
|
50
|
-
...reportRaw.recommendations,
|
|
51
|
-
];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
69
|
+
const reportRaw = recommendationReportFromRanking(ranked, role ? { role } : {});
|
|
54
70
|
// Gate by surface tier. Recommendations whose underlying command is
|
|
55
71
|
// experimental + not enabled get moved to a "gated" bucket with an
|
|
56
72
|
// enable hint. Callable ones stay in `recommendations`.
|
|
57
73
|
const { context: surfaceContext } = await loadSurfaceContext({ cwd, inspection });
|
|
58
74
|
const surface = buildSurfaceSummary(surfaceContext);
|
|
59
75
|
const includeGated = flagBool(args, 'include-gated');
|
|
60
|
-
const { keep, gated } = partitionByCallable(reportRaw.recommendations, surface, includeGated);
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
|
|
76
|
+
const { keep, gated, notApplicable } = partitionByCallable(reportRaw.recommendations, surface, includeGated);
|
|
77
|
+
// `nextCommand` is re-picked over the rows actually rendered — by THE rule,
|
|
78
|
+
// so it is row 1 whenever the answer is confident.
|
|
79
|
+
// THE audience filter (`dropNotApplicable`, shared with `shrk context`)
|
|
80
|
+
// reaches every row this command prints or emits — the ranked list and the
|
|
81
|
+
// uncertainty block's suggested commands (a recipe may name `release
|
|
82
|
+
// readiness`), not only the recommendations — and re-picks `nextCommand`
|
|
83
|
+
// over the rows actually rendered, by THE rule.
|
|
84
|
+
const report = dropNotApplicable({ ...reportRaw, recommendations: keep }, surface);
|
|
85
|
+
const requireConfident = flagBool(args, 'require-confident');
|
|
86
|
+
// `recommend` is not a gate: 0 by default. `--require-confident` makes "no
|
|
87
|
+
// confident match" a branchable 2 (ran, proved nothing); global `--strict`
|
|
88
|
+
// then promotes it to 1.
|
|
89
|
+
const exit = requireConfident && !report.confident ? ExitCode.NotVerified : ExitCode.VerifiedPass;
|
|
64
90
|
const actionsOnly = flagBool(args, 'actions-only');
|
|
65
91
|
const machineJson = flagBool(args, 'json') || flagBool(args, 'machine-json');
|
|
66
|
-
let routingMatches = [];
|
|
67
|
-
let searchReport = null;
|
|
68
|
-
// Reconcile with `brief`/`task`: those route through the SAME shared ranker
|
|
69
|
-
// (`rankAll`). Consult it here so `recommend` never claims a "coverage gap"
|
|
70
|
-
// for a task the rest of the engine confidently matches to a template/pipeline.
|
|
71
|
-
let ranking = null;
|
|
72
|
-
if (query.length > 0) {
|
|
73
|
-
try {
|
|
74
|
-
routingMatches = await explainTaskRouting(inspection, query);
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
// ignore
|
|
78
|
-
}
|
|
79
|
-
try {
|
|
80
|
-
searchReport = await buildUniversalSearch(inspection, query, {});
|
|
81
|
-
}
|
|
82
|
-
catch {
|
|
83
|
-
searchReport = null;
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
ranking = rankAll(inspection, query);
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
ranking = null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const topTemplate = ranking?.templates[0];
|
|
93
|
-
const topPipeline = ranking?.pipelines[0];
|
|
94
|
-
const engineHasMatch = (topTemplate?.score ?? 0) >= TEMPLATE_MATCH_THRESHOLD ||
|
|
95
|
-
(topPipeline?.score ?? 0) >= PIPELINE_MATCH_THRESHOLD;
|
|
96
|
-
// R1 — promote a strongly-matched task-routing hint's recommends.commands
|
|
97
|
-
// into the HEADLINE for create/build intents. Routing hints are scored by
|
|
98
|
-
// explainTaskRouting but were previously only shown under --verbose, so the
|
|
99
|
-
// headline fell back to generic review/report/impact commands even when the
|
|
100
|
-
// pack declared the right `shrk gen <template>` playbook. When the top hint
|
|
101
|
-
// clears the threshold AND the query looks like create/build work, its
|
|
102
|
-
// commands lead and the generic defaults slide to the tail. Deterministic.
|
|
103
|
-
const topHint = routingMatches[0];
|
|
104
|
-
const hintCommands = topHint?.hint.recommends.commands ?? [];
|
|
105
|
-
if (query.length > 0 &&
|
|
106
|
-
looksLikeCreateBuild(query) &&
|
|
107
|
-
topHint &&
|
|
108
|
-
topHint.score >= ROUTING_HINT_PROMOTE_THRESHOLD &&
|
|
109
|
-
hintCommands.length > 0) {
|
|
110
|
-
const promoted = hintCommands.map((command) => ({
|
|
111
|
-
command,
|
|
112
|
-
why: `Routing hint "${topHint.hint.id}" matched (score ${topHint.score}) — project playbook for this create/build task.`,
|
|
113
|
-
safetyLevel: promotedSafetyLevel(command),
|
|
114
|
-
}));
|
|
115
|
-
const promotedSet = new Set(promoted.map((p) => p.command));
|
|
116
|
-
const isGenericDefault = (c) => /^(bun run )?shrk (review|report|impact)\b/i.test(c);
|
|
117
|
-
// The recommender (inspector) already arbitrates the keyword recipe
|
|
118
|
-
// against the shared ranker and may have promoted a `shrk gen <template>`
|
|
119
|
-
// / `shrk task` headline (its `why` starts with "Ranker matched"). That
|
|
120
|
-
// ranker-confirmed scaffold is the engine's corrected route — keep it
|
|
121
|
-
// ahead of even the routing-hint promotion so the headline survives.
|
|
122
|
-
const isRankerPromoted = (r) => /^Ranker matched /.test(r.why);
|
|
123
|
-
const existing = report.recommendations;
|
|
124
|
-
const keptRankerPromoted = existing.filter((r) => !promotedSet.has(r.command) && isRankerPromoted(r));
|
|
125
|
-
const keptNonGeneric = existing.filter((r) => !promotedSet.has(r.command) && !isRankerPromoted(r) && !isGenericDefault(r.command));
|
|
126
|
-
const keptGeneric = existing.filter((r) => !promotedSet.has(r.command) && !isRankerPromoted(r) && isGenericDefault(r.command));
|
|
127
|
-
report.recommendations = [
|
|
128
|
-
...keptRankerPromoted,
|
|
129
|
-
...promoted,
|
|
130
|
-
...keptNonGeneric,
|
|
131
|
-
...keptGeneric,
|
|
132
|
-
];
|
|
133
|
-
}
|
|
134
92
|
if (machineJson) {
|
|
93
|
+
let searchReport = null;
|
|
94
|
+
if (query.length > 0) {
|
|
95
|
+
try {
|
|
96
|
+
searchReport = await buildUniversalSearch(inspection, query, {});
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
searchReport = null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
135
102
|
process.stdout.write(asJson({
|
|
136
103
|
...report,
|
|
137
|
-
routingMatches,
|
|
104
|
+
routingMatches: ranked.routingMatches,
|
|
138
105
|
search: searchReport,
|
|
139
106
|
gated,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
topPipeline: topPipeline ? { id: topPipeline.item.id, score: topPipeline.score } : null,
|
|
144
|
-
}
|
|
145
|
-
: null,
|
|
107
|
+
...(notApplicable.length > 0 ? { notApplicable } : {}),
|
|
108
|
+
rankerMatch: ranked.rankerTop,
|
|
109
|
+
...(requireConfident ? { exitCode: exit } : {}),
|
|
146
110
|
}) + '\n');
|
|
147
|
-
return
|
|
111
|
+
return exit;
|
|
148
112
|
}
|
|
113
|
+
const write = (s) => {
|
|
114
|
+
process.stdout.write(s);
|
|
115
|
+
};
|
|
149
116
|
// Default human output: verdict + top 3 commands + next command +
|
|
150
117
|
// details flag. `--verbose` / `--full` brings back the long form.
|
|
151
118
|
const verbose = flagBool(args, 'verbose') || flagBool(args, 'full');
|
|
152
119
|
const topN = flagNumber(args, 'top') ?? (verbose ? report.recommendations.length : 3);
|
|
153
120
|
const visibleRecs = report.recommendations.slice(0, topN);
|
|
121
|
+
const suppressed = report.ranked.filter((c) => c.suppressedReason !== undefined);
|
|
154
122
|
if (!actionsOnly) {
|
|
155
123
|
// Entrypoint banner: promote shrk recommend as the human entrypoint.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (verbose) {
|
|
160
|
-
process.stdout.write(` $ ${r.command}\n why: ${r.why}\n safety: ${r.safetyLevel}\n`);
|
|
161
|
-
if (r.docsLink)
|
|
162
|
-
process.stdout.write(` docs: ${r.docsLink}\n`);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
process.stdout.write(` $ ${r.command} [${r.safetyLevel}] — ${r.why}\n`);
|
|
166
|
-
}
|
|
124
|
+
write(`(${entrypointBanner('recommend')})\n\n`);
|
|
125
|
+
if (report.confident) {
|
|
126
|
+
write(`=== Recommended commands (top ${visibleRecs.length}) ===\n`);
|
|
167
127
|
}
|
|
168
|
-
|
|
169
|
-
|
|
128
|
+
else {
|
|
129
|
+
write(`=== ${noConfidentHeadline(report)} ===\n`);
|
|
130
|
+
if (visibleRecs.length > 0)
|
|
131
|
+
write('Weak candidates (not routed — verify before acting):\n');
|
|
170
132
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
process.stdout.write(` • ${m.hint.id} (score=${m.score}) ${m.hint.title}\n`);
|
|
133
|
+
for (const r of visibleRecs)
|
|
134
|
+
write(renderRow(r, report.confident, verbose));
|
|
135
|
+
if (report.recommendations.length > visibleRecs.length) {
|
|
136
|
+
write(` … (${report.recommendations.length - visibleRecs.length} more — pass --verbose to see all)\n`);
|
|
176
137
|
}
|
|
138
|
+
write(renderSuppressed(suppressed, ranked.intent, verbose));
|
|
177
139
|
}
|
|
178
|
-
if (
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
140
|
+
if (ranked.routingMatches.length > 0 && !actionsOnly && verbose) {
|
|
141
|
+
const hintFloor = RECOMMEND_SOURCE_FLOORS[RecommendationSource.RoutingHint];
|
|
142
|
+
write('\nRouting hints:\n');
|
|
143
|
+
for (const m of ranked.routingMatches.slice(0, 5)) {
|
|
144
|
+
write(` • ${m.hint.id} (score ${m.score}, floor ${hintFloor} → ${(m.score / hintFloor).toFixed(2)}) ${m.hint.title}\n`);
|
|
145
|
+
if (m.reasons.length > 0)
|
|
146
|
+
write(` matched: ${m.reasons.join(', ')}\n`);
|
|
147
|
+
const commands = m.hint.recommends?.commands ?? [];
|
|
148
|
+
write(` commands: ${commands.length > 0 ? commands.join(' · ') : '(none — this hint recommends no command)'}\n`);
|
|
187
149
|
}
|
|
188
150
|
}
|
|
189
|
-
// Coverage gap —
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
if (thinResult && !engineHasMatch) {
|
|
195
|
-
process.stdout.write(`\n⚠ Coverage gap — no recipe, no routing hint, and no helper/template matched "${query}".\n` +
|
|
151
|
+
// Coverage gap — exactly when nothing cleared its floor (THE confidence
|
|
152
|
+
// verdict). It used to key on "no routing hint fired", so any weak spurious
|
|
153
|
+
// hint hid it, and a strong one never lifted the verdict.
|
|
154
|
+
if (!report.confident && query.length > 0) {
|
|
155
|
+
write(`\n⚠ Coverage gap — nothing matched "${query}" with confidence (no routing hint, recipe or template cleared its floor).\n` +
|
|
196
156
|
` Suggest:\n` +
|
|
197
157
|
` shrk coverage scaffolds --task "${query}"\n` +
|
|
198
158
|
` shrk feedback actions\n` +
|
|
199
159
|
` (or contribute a pack template / helper / routing hint)\n`);
|
|
200
160
|
}
|
|
201
|
-
else if (thinResult && engineHasMatch && !actionsOnly) {
|
|
202
|
-
// The recipe/routing surface was thin, but the shared ranker DID match —
|
|
203
|
-
// surface that concrete next step instead of a misleading gap.
|
|
204
|
-
process.stdout.write('\nEngine match (shared ranker — same as `shrk task` / `shrk brief`):\n');
|
|
205
|
-
if (topTemplate && topTemplate.score >= TEMPLATE_MATCH_THRESHOLD) {
|
|
206
|
-
process.stdout.write(` $ shrk gen ${topTemplate.item.id} <name> --dry-run [writes-source] — template "${topTemplate.item.name}" matched (score ${topTemplate.score}).\n`);
|
|
207
|
-
}
|
|
208
|
-
if (topPipeline && topPipeline.score >= PIPELINE_MATCH_THRESHOLD) {
|
|
209
|
-
process.stdout.write(` Pipeline: ${topPipeline.item.id} — run \`shrk task "${query}"\` for the full packet.\n`);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
161
|
if (gated.length > 0 && !actionsOnly) {
|
|
213
|
-
|
|
162
|
+
write(`\nGated (experimental, not enabled in this repo):\n`);
|
|
214
163
|
for (const g of gated.slice(0, 3)) {
|
|
215
|
-
|
|
216
|
-
|
|
164
|
+
write(` $ ${g.command} — ${g.why}\n`);
|
|
165
|
+
write(` Enable: shrk surface enable ${g.viewCommand} --write\n`);
|
|
217
166
|
}
|
|
218
167
|
if (gated.length > 3) {
|
|
219
|
-
|
|
168
|
+
write(` … (${gated.length - 3} more — pass --include-gated --json to inspect)\n`);
|
|
220
169
|
}
|
|
221
170
|
}
|
|
222
|
-
|
|
171
|
+
write(`\nNext command:\n $ ${report.nextCommand}\n`);
|
|
223
172
|
if (!actionsOnly && verbose) {
|
|
224
|
-
|
|
173
|
+
write('\n' + renderUncertaintyReportText(report.uncertainty) + '\n');
|
|
225
174
|
}
|
|
226
175
|
else if (!actionsOnly) {
|
|
227
|
-
//
|
|
176
|
+
// Built from THE confidence authority only — never a second label.
|
|
228
177
|
const u = report.uncertainty;
|
|
229
178
|
const issues = u.missingSignals.length + u.conflictingSignals.length;
|
|
230
179
|
if (issues > 0) {
|
|
231
|
-
|
|
180
|
+
write(`\nUncertainty: ${u.confidence} confidence, ${issues} signal(s) — pass --verbose for the full report.\n`);
|
|
232
181
|
}
|
|
233
182
|
}
|
|
234
|
-
if (
|
|
235
|
-
|
|
183
|
+
if (requireConfident && !report.confident) {
|
|
184
|
+
write('\n(--require-confident: no confident match — exit 2)\n');
|
|
236
185
|
}
|
|
237
|
-
return
|
|
186
|
+
return exit;
|
|
238
187
|
},
|
|
239
188
|
};
|
|
189
|
+
/** "No confident match (best 0.67 of floor 1.00 — routing hint "x" (score 2, floor 3))". */
|
|
190
|
+
function noConfidentHeadline(report) {
|
|
191
|
+
const best = report.ranked.find((c) => !c.suppressedReason && countsTowardConfidence(c.source));
|
|
192
|
+
const floor = report.floor.toFixed(2);
|
|
193
|
+
if (!best) {
|
|
194
|
+
return report.ranked.some((c) => countsTowardConfidence(c.source))
|
|
195
|
+
? `No confident match (every matching candidate was suppressed; floor ${floor})`
|
|
196
|
+
: `No confident match (nothing matched; floor ${floor})`;
|
|
197
|
+
}
|
|
198
|
+
return `No confident match (best ${report.bestScore.toFixed(2)} of floor ${floor} — ${best.attribution})`;
|
|
199
|
+
}
|
|
200
|
+
function renderRow(r, confident, verbose) {
|
|
201
|
+
// `?` marks a weak candidate — below its floor, or nothing is confident.
|
|
202
|
+
const mark = !confident || r.weak === true ? '?' : '$';
|
|
203
|
+
const attribution = r.attribution ?? r.why;
|
|
204
|
+
if (!verbose)
|
|
205
|
+
return ` ${mark} ${r.command} [${r.safetyLevel}] — ${attribution}\n`;
|
|
206
|
+
let out = ` ${mark} ${r.command}\n why: ${r.why}\n source: ${attribution}${r.weak ? ' — weak (below the floor)' : ''}\n safety: ${r.safetyLevel}\n`;
|
|
207
|
+
if (r.docsLink)
|
|
208
|
+
out += ` docs: ${r.docsLink}\n`;
|
|
209
|
+
return out;
|
|
210
|
+
}
|
|
211
|
+
/** Suppressed candidates are never silent: one line by default, every one under --verbose. */
|
|
212
|
+
function renderSuppressed(suppressed, intent, verbose) {
|
|
213
|
+
if (suppressed.length === 0)
|
|
214
|
+
return '';
|
|
215
|
+
if (verbose) {
|
|
216
|
+
let out = `\nSuppressed (${suppressed.length}):\n`;
|
|
217
|
+
for (const c of suppressed) {
|
|
218
|
+
out += ` ✗ ${c.command} [${c.safetyLevel}] — ${c.attribution}: ${describeSuppression(c, intent)}\n`;
|
|
219
|
+
}
|
|
220
|
+
return out;
|
|
221
|
+
}
|
|
222
|
+
const first = suppressed[0];
|
|
223
|
+
const more = suppressed.length > 1 ? `; +${suppressed.length - 1} more` : '';
|
|
224
|
+
return ` (${suppressed.length} suppressed: ${first.command} — ${describeSuppression(first, intent)}${more}; --verbose)\n`;
|
|
225
|
+
}
|
|
240
226
|
/**
|
|
241
227
|
* Partition recommender output by whether the underlying CLI command is
|
|
242
228
|
* callable in this project's surface. Gated commands (experimental +
|
|
@@ -251,12 +237,22 @@ export const recommendCommand = {
|
|
|
251
237
|
function partitionByCallable(recs, summary, includeGated) {
|
|
252
238
|
const keep = [];
|
|
253
239
|
const gated = [];
|
|
240
|
+
const notApplicable = [];
|
|
254
241
|
for (const r of recs) {
|
|
255
|
-
const view =
|
|
242
|
+
const view = surfaceViewForCommand(r.command, summary);
|
|
256
243
|
if (!view || view.callable) {
|
|
257
244
|
keep.push(r);
|
|
258
245
|
continue;
|
|
259
246
|
}
|
|
247
|
+
// A tool-maintenance command outside SharkCraft's own repository (THE host
|
|
248
|
+
// authority behind the surface gate) is not "experimental, not enabled": it
|
|
249
|
+
// does not apply here, and enabling it would run SharkCraft's own docs /
|
|
250
|
+
// release contract on this repository. Never recommended, never offered an
|
|
251
|
+
// `Enable:` hint — only listed, in `--json`, as not applicable.
|
|
252
|
+
if (notApplicableHere(r.command, summary)) {
|
|
253
|
+
notApplicable.push(r.command);
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
260
256
|
if (includeGated)
|
|
261
257
|
keep.push(r);
|
|
262
258
|
gated.push({
|
|
@@ -266,127 +262,25 @@ function partitionByCallable(recs, summary, includeGated) {
|
|
|
266
262
|
enableHint: `shrk surface enable ${view.command} --write`,
|
|
267
263
|
});
|
|
268
264
|
}
|
|
269
|
-
return { keep, gated };
|
|
265
|
+
return { keep, gated, notApplicable };
|
|
270
266
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
return undefined;
|
|
275
|
-
// Drop leading `shrk` / `bun run shrk` / `$`
|
|
276
|
-
let i = 0;
|
|
277
|
-
if (tokens[i] === '$')
|
|
278
|
-
i += 1;
|
|
279
|
-
if (tokens[i] === 'bun' && tokens[i + 1] === 'run')
|
|
280
|
-
i += 2;
|
|
281
|
-
if (tokens[i] === 'shrk')
|
|
282
|
-
i += 1;
|
|
283
|
-
const verbTokens = [];
|
|
284
|
-
for (let j = i; j < tokens.length; j += 1) {
|
|
285
|
-
const t = tokens[j];
|
|
286
|
-
if (t.startsWith('-') || t.startsWith('<') || t.startsWith('"'))
|
|
287
|
-
break;
|
|
288
|
-
verbTokens.push(t);
|
|
289
|
-
if (verbTokens.length >= 2)
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
if (verbTokens.length === 0)
|
|
293
|
-
return undefined;
|
|
294
|
-
const fullPath = verbTokens.join(' ');
|
|
295
|
-
return findCommandInSummary(summary, fullPath) ?? findCommandInSummary(summary, verbTokens[0]);
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* DX#2 — detect "planning" intent in a task string.
|
|
299
|
-
*
|
|
300
|
-
* Triggers on:
|
|
301
|
-
* - a leading verb from the planning set (plan/design/review/audit/…)
|
|
302
|
-
* - the same verb appearing in "plan for X" / "design X" patterns
|
|
303
|
-
*
|
|
304
|
-
* Pure heuristic. No LLM. Conservative — false negatives are fine
|
|
305
|
-
* (the original ranker still fires); false positives just push an extra
|
|
306
|
-
* read-only suggestion that the user can ignore.
|
|
307
|
-
*/
|
|
308
|
-
const PLANNING_VERBS = new Set([
|
|
309
|
-
'plan',
|
|
310
|
-
'design',
|
|
311
|
-
'propose',
|
|
312
|
-
'review',
|
|
313
|
-
'audit',
|
|
314
|
-
'analyze',
|
|
315
|
-
'analyse',
|
|
316
|
-
'explore',
|
|
317
|
-
'consider',
|
|
318
|
-
'investigate',
|
|
319
|
-
'survey',
|
|
320
|
-
'compare',
|
|
321
|
-
'evaluate',
|
|
322
|
-
'assess',
|
|
323
|
-
]);
|
|
267
|
+
// The surface-view lookup and the audience rule live in
|
|
268
|
+
// `surface/audience-applicability.ts` — one authority for `recommend` and
|
|
269
|
+
// `context`.
|
|
324
270
|
/**
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
271
|
+
* DX#2 — does the query read like planning (a planning verb leading the query
|
|
272
|
+
* or in slots 1–3)? A thin wrapper over THE query-intent classifier
|
|
273
|
+
* (`classifyQueryIntent`, inspector), kept for its callers; the planning verb
|
|
274
|
+
* set lives there now.
|
|
329
275
|
*/
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
* match — used only to suppress a false "coverage gap" verdict (and surface the
|
|
334
|
-
* match) when the recipe/routing surface is thin but the shared ranker, which
|
|
335
|
-
* `brief`/`task` also use, found project coverage. Conservative: a single weak
|
|
336
|
-
* token hit scores below this.
|
|
337
|
-
*/
|
|
338
|
-
const TEMPLATE_MATCH_THRESHOLD = 3;
|
|
339
|
-
const PIPELINE_MATCH_THRESHOLD = 3;
|
|
340
|
-
const CREATE_BUILD_VERBS = new Set([
|
|
341
|
-
'create', 'build', 'add', 'generate', 'scaffold', 'implement', 'make', 'new', 'introduce', 'write',
|
|
342
|
-
]);
|
|
276
|
+
export function looksLikePlanning(query) {
|
|
277
|
+
return classifyQueryIntent(query).planVerb !== undefined;
|
|
278
|
+
}
|
|
343
279
|
/**
|
|
344
|
-
* Does the query
|
|
345
|
-
*
|
|
346
|
-
*
|
|
280
|
+
* Does the query read like create/build work? A thin wrapper over THE
|
|
281
|
+
* query-intent classifier — which now also refuses a create word used as a
|
|
282
|
+
* noun or adjective in a repair query ("fix the broken build").
|
|
347
283
|
*/
|
|
348
284
|
export function looksLikeCreateBuild(query) {
|
|
349
|
-
|
|
350
|
-
.toLowerCase()
|
|
351
|
-
.replace(/[^a-z0-9\s]/g, ' ')
|
|
352
|
-
.split(/\s+/)
|
|
353
|
-
.filter((t) => t.length > 0);
|
|
354
|
-
if (tokens.length === 0)
|
|
355
|
-
return false;
|
|
356
|
-
if (CREATE_BUILD_VERBS.has(tokens[0]))
|
|
357
|
-
return true;
|
|
358
|
-
for (let i = 1; i < Math.min(4, tokens.length); i++) {
|
|
359
|
-
if (CREATE_BUILD_VERBS.has(tokens[i]))
|
|
360
|
-
return true;
|
|
361
|
-
}
|
|
362
|
-
return false;
|
|
363
|
-
}
|
|
364
|
-
/** Conservative safety classification for a promoted routing-hint command. */
|
|
365
|
-
function promotedSafetyLevel(command) {
|
|
366
|
-
if (/^(bun run )?shrk (gen|init|apply|import)\b/i.test(command))
|
|
367
|
-
return 'writes-source';
|
|
368
|
-
if (/^(bun run )?shrk (brief|dev|onboard|simulate|orchestrate|spec)\b/i.test(command)) {
|
|
369
|
-
return 'writes-drafts';
|
|
370
|
-
}
|
|
371
|
-
if (/^(bun|bunx|npm|pnpm|node|git|nx) /i.test(command))
|
|
372
|
-
return 'runs-shell';
|
|
373
|
-
return 'read-only';
|
|
374
|
-
}
|
|
375
|
-
export function looksLikePlanning(query) {
|
|
376
|
-
const tokens = query
|
|
377
|
-
.toLowerCase()
|
|
378
|
-
.replace(/[^a-z0-9\s]/g, ' ')
|
|
379
|
-
.split(/\s+/)
|
|
380
|
-
.filter((t) => t.length > 0);
|
|
381
|
-
if (tokens.length === 0)
|
|
382
|
-
return false;
|
|
383
|
-
// Leading verb form: "plan a thing", "design the system".
|
|
384
|
-
if (PLANNING_VERBS.has(tokens[0]))
|
|
385
|
-
return true;
|
|
386
|
-
// "Help me plan X" / "I want to design Y" — verb in slots 1–3.
|
|
387
|
-
for (let i = 1; i < Math.min(4, tokens.length); i++) {
|
|
388
|
-
if (PLANNING_VERBS.has(tokens[i]))
|
|
389
|
-
return true;
|
|
390
|
-
}
|
|
391
|
-
return false;
|
|
285
|
+
return classifyQueryIntent(query).createVerb !== undefined;
|
|
392
286
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registrations.command.d.ts","sourceRoot":"","sources":["../../src/commands/registrations.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registrations.command.d.ts","sourceRoot":"","sources":["../../src/commands/registrations.command.ts"],"names":[],"mappings":"AA8BA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAoXhC,eAAO,MAAM,oBAAoB,EAAE,eAsDlC,CAAC"}
|