@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,11 +1,16 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { AssetKind, AssetProvenanceOperation, AssetProvenanceSource, buildTemplateAuthoringPreview, buildTemplateDriftReport, inspectSharkcraft, recordProvenance, TemplateAuthoringOperation, TemplateDriftStatus, } from '@shrkcrft/inspector';
|
|
3
|
+
import { AssetKind, AssetProvenanceOperation, AssetProvenanceSource, buildTemplateAuthoringPreview, buildTemplateDriftReport, ContributionKind, inspectSharkcraft, lintTemplates, recordProvenance, TemplateAuthoringOperation, TemplateDriftStatus, } from '@shrkcrft/inspector';
|
|
4
|
+
import { ALLOW_EMPTY_FLAG, allowEmptyValve } from "../gates/allow-empty.js";
|
|
5
|
+
import { settleVerdict } from "../gates/settle-verdict.js";
|
|
6
|
+
import { templateRegistryCoverage } from "../gates/template-registry-coverage.js";
|
|
7
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
8
|
+
import { writeRejectedEntriesNote } from "../output/rejected-entries-note.js";
|
|
4
9
|
import { detectAuthoringSource, multiFlagValues, writeAuthoringDrafts, } from "../authoring/authoring-kit.js";
|
|
5
10
|
import { applyTemplateUpdate } from "../asset-preview/apply-template-update.js";
|
|
6
|
-
import { previewTemplate } from '@shrkcrft/templates';
|
|
11
|
+
import { previewTemplate, templateRemainderFields, templateRemainderLines } from '@shrkcrft/templates';
|
|
7
12
|
import { buildNameVariables } from '@shrkcrft/generator';
|
|
8
|
-
import { flagBool, flagList, flagString, flagVars, resolveCwd, } from "../command-registry.js";
|
|
13
|
+
import { flagBool, flagList, flagString, flagVars, requireInputSelector, resolveCwd, } from "../command-registry.js";
|
|
9
14
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
10
15
|
import { maybeRunInWatchMode } from "../output/watch-loop.js";
|
|
11
16
|
import { renderFailureHints, templateDriftHints } from "../output/failure-hints.js";
|
|
@@ -80,17 +85,24 @@ export const templatesListCommand = {
|
|
|
80
85
|
async run(args) {
|
|
81
86
|
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
82
87
|
const list = inspection.templateRegistry.list();
|
|
88
|
+
// A template its loader refused (no `name`, a duplicate id) is named
|
|
89
|
+
// (round 12, 12.1) — it used to appear on no surface at all.
|
|
90
|
+
const note = { next: 'shrk templates doctor' };
|
|
83
91
|
if (flagBool(args, 'json')) {
|
|
84
|
-
process.stdout.write(asJson(list.map((t) => ({ id: t.id, name: t.name, description: t.description, tags: t.tags }))) + '\n');
|
|
92
|
+
process.stdout.write(asJson(list.map((t) => ({ id: t.id, name: t.name, description: t.description, tags: t.tags ?? [] }))) + '\n');
|
|
93
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Template], { ...note, json: true });
|
|
85
94
|
return 0;
|
|
86
95
|
}
|
|
87
96
|
process.stdout.write(header(`Templates (${list.length})`));
|
|
88
97
|
for (const t of list) {
|
|
89
98
|
process.stdout.write(` ${t.id.padEnd(28)} — ${t.name}\n`);
|
|
90
|
-
process.stdout.write(` ${t.description}\n`);
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
process.stdout.write(` ${t.description ?? ''}\n`);
|
|
100
|
+
// The loader normalises a missing `tags` to []; guard a frozen literal anyway (12.1d).
|
|
101
|
+
const tags = Array.isArray(t.tags) ? t.tags : [];
|
|
102
|
+
if (tags.length)
|
|
103
|
+
process.stdout.write(` tags: ${tags.join(', ')}\n`);
|
|
93
104
|
}
|
|
105
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Template], note);
|
|
94
106
|
return 0;
|
|
95
107
|
},
|
|
96
108
|
};
|
|
@@ -120,6 +132,9 @@ export const templatesGetCommand = {
|
|
|
120
132
|
appliesWhen: template.appliesWhen,
|
|
121
133
|
variables: template.variables,
|
|
122
134
|
postGenerationNotes: template.postGenerationNotes ?? [],
|
|
135
|
+
// The one remainder shape MCP `get_template` carries too.
|
|
136
|
+
...templateRemainderFields(template),
|
|
137
|
+
remainderLines: templateRemainderLines(template),
|
|
123
138
|
related: template.related ?? [],
|
|
124
139
|
};
|
|
125
140
|
process.stdout.write(asJson(safe) + '\n');
|
|
@@ -140,6 +155,9 @@ export const templatesGetCommand = {
|
|
|
140
155
|
process.stdout.write(` - ${v.name}${v.required ? ' (required)' : ''}${v.default ? ` = ${v.default}` : ''}${v.description ? ` — ${v.description}` : ''}\n`);
|
|
141
156
|
}
|
|
142
157
|
}
|
|
158
|
+
const remainder = templateRemainderLines(template);
|
|
159
|
+
if (remainder.length > 0)
|
|
160
|
+
process.stdout.write(remainder.join('\n') + '\n');
|
|
143
161
|
return 0;
|
|
144
162
|
},
|
|
145
163
|
};
|
|
@@ -148,6 +166,10 @@ export const templatesSearchCommand = {
|
|
|
148
166
|
description: 'Search templates.',
|
|
149
167
|
usage: 'shrk templates search <query>',
|
|
150
168
|
async run(args) {
|
|
169
|
+
// No query is a usage error (3), never `Templates (N)` over nothing asked.
|
|
170
|
+
const noSelector = requireInputSelector(args, { flags: [], positional: true, usage: 'shrk templates search <query>' });
|
|
171
|
+
if (noSelector !== null)
|
|
172
|
+
return noSelector;
|
|
151
173
|
const query = args.positional.join(' ');
|
|
152
174
|
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
153
175
|
const results = inspection.templateRegistry.search(query);
|
|
@@ -205,6 +227,9 @@ export const templatesPreviewCommand = {
|
|
|
205
227
|
process.stdout.write(` • ${note}\n`);
|
|
206
228
|
}
|
|
207
229
|
}
|
|
230
|
+
const remainder = templateRemainderLines(template);
|
|
231
|
+
if (remainder.length > 0)
|
|
232
|
+
process.stdout.write('\n' + remainder.join('\n') + '\n');
|
|
208
233
|
return 0;
|
|
209
234
|
},
|
|
210
235
|
};
|
|
@@ -222,6 +247,9 @@ export const templatesDriftCommand = {
|
|
|
222
247
|
async function templatesDriftImpl(args) {
|
|
223
248
|
const cwd = resolveCwd(args);
|
|
224
249
|
const inspection = await inspectSharkcraft({ cwd });
|
|
250
|
+
// `related` ids resolve against EVERY registry; a cold construct / playbook
|
|
251
|
+
// registry would report them NOT VERIFIED instead of resolving them.
|
|
252
|
+
await (await import("../surface/cli-command-resolver.js")).warmCliReferenceRegistries(inspection);
|
|
225
253
|
const report = buildTemplateDriftReport(inspection, {
|
|
226
254
|
...(flagString(args, 'template') ? { templateId: flagString(args, 'template') } : {}),
|
|
227
255
|
...(flagString(args, 'pack') ? { packId: flagString(args, 'pack') } : {}),
|
|
@@ -415,6 +443,7 @@ export const templatesVerifyPathsCommand = {
|
|
|
415
443
|
usage: 'shrk templates verify-paths [--template <id>] [--json]',
|
|
416
444
|
async run(args) {
|
|
417
445
|
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
446
|
+
await (await import("../surface/cli-command-resolver.js")).warmCliReferenceRegistries(inspection);
|
|
418
447
|
const report = buildTemplateDriftReport(inspection, {
|
|
419
448
|
...(flagString(args, 'template') ? { templateId: flagString(args, 'template') } : {}),
|
|
420
449
|
});
|
|
@@ -627,6 +656,19 @@ export const templatesAddCommand = {
|
|
|
627
656
|
name: 'add',
|
|
628
657
|
description: 'Alias of `templates scaffold` — preview-only TS draft for a new template.',
|
|
629
658
|
};
|
|
659
|
+
/** Drift status rank — a folded lint finding can only raise a template's status. */
|
|
660
|
+
const DRIFT_STATUS_RANK = {
|
|
661
|
+
[TemplateDriftStatus.Pass]: 0,
|
|
662
|
+
[TemplateDriftStatus.Warn]: 1,
|
|
663
|
+
[TemplateDriftStatus.Fail]: 2,
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* The lint findings the doctor folds in: every error (`templates lint` exits 1
|
|
667
|
+
* on them — an invalid change operation, a malformed remainder, an unsafe
|
|
668
|
+
* target), plus `render-threw`, the one that means the operations were never
|
|
669
|
+
* checked (it is what the doctor's coverage counts as unexamined).
|
|
670
|
+
*/
|
|
671
|
+
const FOLDED_LINT_WARNINGS = new Set(['render-threw']);
|
|
630
672
|
/**
|
|
631
673
|
* `shrk templates doctor` aggregates the existing drift + lint
|
|
632
674
|
* signals into one structured report. Read-only.
|
|
@@ -634,46 +676,91 @@ export const templatesAddCommand = {
|
|
|
634
676
|
* Distinct from `templates lint` (which surfaces test-style findings)
|
|
635
677
|
* and `templates drift` (which compares declared vs. rendered output)
|
|
636
678
|
* by combining them with a clean/dirty verdict + per-template summary.
|
|
679
|
+
* Lint is READ, never re-derived: a template `templates lint` fails can
|
|
680
|
+
* never read "Clean" here. Settled against coverage — 0 templates, or a
|
|
681
|
+
* template whose `changes()` threw with sample variables (its operations
|
|
682
|
+
* were never checked), is NOT VERIFIED (2), never a pass.
|
|
637
683
|
*/
|
|
638
684
|
export const templatesDoctorCommand = {
|
|
639
685
|
name: 'doctor',
|
|
640
|
-
description: 'Template-quality doctor — combines drift + lint signals into one clean/dirty verdict per template. Read-only.',
|
|
641
|
-
usage: 'shrk templates doctor [--strict] [--json]',
|
|
686
|
+
description: 'Template-quality doctor — combines drift + lint signals into one clean/dirty verdict per template. A lint error (an invalid change operation, a malformed remainder) fails the template, as `templates lint` does. Exit 0 clean · 1 a failing template (or a warning under --strict) · 2 nothing verified (no template registered — `--allow-empty` accepts that — or a changes() that threw with sample variables). Read-only.',
|
|
687
|
+
usage: 'shrk templates doctor [--strict] [--allow-empty] [--json]',
|
|
688
|
+
booleanFlags: new Set(['strict', 'json', ALLOW_EMPTY_FLAG]),
|
|
642
689
|
async run(args) {
|
|
643
690
|
const cwd = resolveCwd(args);
|
|
644
691
|
const inspection = await inspectSharkcraft({ cwd });
|
|
692
|
+
await (await import("../surface/cli-command-resolver.js")).warmCliReferenceRegistries(inspection);
|
|
645
693
|
const drift = buildTemplateDriftReport(inspection);
|
|
694
|
+
// Both read the one template set (`templateRegistry` is built from
|
|
695
|
+
// `inspection.templates`), so every lint result has a drift entry.
|
|
696
|
+
const lint = lintTemplates(inspection);
|
|
697
|
+
const lintById = new Map(lint.results.map((r) => [r.templateId, r.issues]));
|
|
698
|
+
const entries = drift.entries.map((e) => {
|
|
699
|
+
const folded = (lintById.get(e.templateId) ?? [])
|
|
700
|
+
.filter((i) => i.severity === 'error' || FOLDED_LINT_WARNINGS.has(i.code))
|
|
701
|
+
.map((i) => ({
|
|
702
|
+
severity: i.severity,
|
|
703
|
+
code: i.code,
|
|
704
|
+
message: `[lint ${i.code}] ${i.message}`,
|
|
705
|
+
...(i.suggestion ? { suggestedFix: i.suggestion } : {}),
|
|
706
|
+
}));
|
|
707
|
+
if (folded.length === 0)
|
|
708
|
+
return e;
|
|
709
|
+
const lintStatus = folded.some((i) => i.severity === 'error') ? TemplateDriftStatus.Fail : TemplateDriftStatus.Warn;
|
|
710
|
+
const status = DRIFT_STATUS_RANK[lintStatus] > DRIFT_STATUS_RANK[e.status] ? lintStatus : e.status;
|
|
711
|
+
return { ...e, status, issues: [...e.issues, ...folded] };
|
|
712
|
+
});
|
|
646
713
|
const totals = {
|
|
647
|
-
total:
|
|
648
|
-
pass:
|
|
649
|
-
warn:
|
|
650
|
-
fail:
|
|
714
|
+
total: entries.length,
|
|
715
|
+
pass: entries.filter((e) => e.status === TemplateDriftStatus.Pass).length,
|
|
716
|
+
warn: entries.filter((e) => e.status === TemplateDriftStatus.Warn).length,
|
|
717
|
+
fail: entries.filter((e) => e.status === TemplateDriftStatus.Fail).length,
|
|
651
718
|
};
|
|
719
|
+
const unchecked = entries
|
|
720
|
+
.filter((e) => e.issues.some((i) => FOLDED_LINT_WARNINGS.has(i.code)))
|
|
721
|
+
.map((e) => e.templateId);
|
|
722
|
+
// THE template-registry coverage record — `check templates` settles on it too.
|
|
723
|
+
const coverage = templateRegistryCoverage({
|
|
724
|
+
total: totals.total,
|
|
725
|
+
unchecked,
|
|
726
|
+
root: inspection.projectRoot,
|
|
727
|
+
acceptance: allowEmptyValve(args, totals.total),
|
|
728
|
+
});
|
|
652
729
|
const strict = flagBool(args, 'strict');
|
|
653
|
-
const
|
|
730
|
+
const settled = settleVerdict(totals.fail > 0 || (strict && totals.warn > 0) ? 1 : 0, [coverage]);
|
|
654
731
|
if (flagBool(args, 'json')) {
|
|
655
732
|
process.stdout.write(asJson({
|
|
656
733
|
schema: 'sharkcraft.templates-doctor/v1',
|
|
657
734
|
generatedAt: new Date().toISOString(),
|
|
658
735
|
totals,
|
|
659
|
-
entries
|
|
736
|
+
entries,
|
|
737
|
+
coverage,
|
|
738
|
+
exitCode: settled.exit,
|
|
739
|
+
verdict: settled.verdict,
|
|
740
|
+
shortfalls: settled.shortfalls,
|
|
741
|
+
accepted: settled.accepted,
|
|
660
742
|
}) + '\n');
|
|
661
|
-
return exit;
|
|
743
|
+
return settled.exit;
|
|
662
744
|
}
|
|
663
745
|
process.stdout.write(header('Templates doctor'));
|
|
664
746
|
process.stdout.write(kv('totals', `${totals.pass} pass, ${totals.warn} warn, ${totals.fail} fail`) + '\n\n');
|
|
665
|
-
for (const e of
|
|
747
|
+
for (const e of entries) {
|
|
666
748
|
const label = (e.templateName ?? e.templateId);
|
|
667
749
|
process.stdout.write(` ${e.status.toUpperCase().padEnd(8)} ${label}\n`);
|
|
668
750
|
for (const issue of e.issues) {
|
|
669
751
|
process.stdout.write(` [${issue.severity}] ${issue.message}\n`);
|
|
670
752
|
}
|
|
671
753
|
}
|
|
672
|
-
if (exit ===
|
|
673
|
-
process.stdout.write('\
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
754
|
+
if (settled.exit === 1) {
|
|
755
|
+
process.stdout.write('\nIssues found. Run `shrk templates lint` and `shrk templates drift --min-severity warning` for detail.\n');
|
|
756
|
+
}
|
|
757
|
+
const line = verdictLine(settled, '\nClean. ✓');
|
|
758
|
+
if (line)
|
|
759
|
+
process.stdout.write(`${settled.exit === 0 ? '' : '\n'}${line}\n`);
|
|
760
|
+
if (settled.exit === 2 && totals.total === 0) {
|
|
761
|
+
process.stdout.write('Pass --allow-empty to accept a project with no templates explicitly.\n');
|
|
762
|
+
}
|
|
763
|
+
return settled.exit;
|
|
677
764
|
},
|
|
678
765
|
};
|
|
679
766
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.command.d.ts","sourceRoot":"","sources":["../../src/commands/test.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test.command.d.ts","sourceRoot":"","sources":["../../src/commands/test.command.ts"],"names":[],"mappings":"AAWA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAuahC,eAAO,MAAM,WAAW,EAAE,eA6CzB,CAAC"}
|
|
@@ -1,29 +1,105 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { buildTaskPacket, inspectSharkcraft, loadAgentContractTests, loadContextTests, runAgentContractTest, runContextTest, } from '@shrkcrft/inspector';
|
|
3
|
+
import { buildTaskPacket, inspectSharkcraft, loadAgentContractTests, loadContextTests, nearestIds, runAgentContractTest, runContextTest, } from '@shrkcrft/inspector';
|
|
4
4
|
import { flagBool, flagList, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
5
6
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
6
7
|
import { agentTestMissingExpectedHints, renderFailureHints } from "../output/failure-hints.js";
|
|
7
8
|
import { maybeRunInWatchMode } from "../output/watch-loop.js";
|
|
9
|
+
import { warmCliReferenceRegistries } from "../surface/cli-command-resolver.js";
|
|
10
|
+
import { ExitCode } from "../exit-codes.js";
|
|
11
|
+
import { ALLOW_EMPTY_FLAG, allowEmptyValve } from "../gates/allow-empty.js";
|
|
12
|
+
import { settleVerdict } from "../gates/settle-verdict.js";
|
|
13
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
14
|
+
/**
|
|
15
|
+
* The `--id` selection. An id that selects NOTHING is a usage error (3) — a
|
|
16
|
+
* typo'd id used to print "No … tests configured." and exit 0, a green run
|
|
17
|
+
* over an empty selection.
|
|
18
|
+
*/
|
|
19
|
+
function selectById(all, args, kind) {
|
|
20
|
+
const filter = flagString(args, 'id');
|
|
21
|
+
if (filter === undefined)
|
|
22
|
+
return { tests: all };
|
|
23
|
+
const tests = all.filter((t) => t.id === filter);
|
|
24
|
+
if (tests.length > 0)
|
|
25
|
+
return { tests };
|
|
26
|
+
// An unknown DECLARED id — the same `nearestIds` every other id site uses
|
|
27
|
+
// (`checks --rule`, `checks run`, `self-config resolve`), never the
|
|
28
|
+
// command-typo scorer.
|
|
29
|
+
const near = nearestIds(filter, all.map((t) => t.id)).map((n) => n.id);
|
|
30
|
+
return {
|
|
31
|
+
tests,
|
|
32
|
+
usageError: `no ${kind} test with id '${filter}' (${all.length} configured)${near.length > 0 ? ` — did you mean ${near.map((n) => `'${n}'`).join(', ')}?` : ''}`,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Print (or JSON-encode) the `--id` usage error and return 3. */
|
|
36
|
+
function writeUsageError(args, message) {
|
|
37
|
+
if (flagBool(args, 'json')) {
|
|
38
|
+
process.stdout.write(asJson({ tests: 0, results: [], exitCode: ExitCode.UsageError, verdict: 'usage-error', error: message }) + '\n');
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
process.stderr.write(`\`shrk test\`: ${message}\n`);
|
|
42
|
+
}
|
|
43
|
+
return ExitCode.UsageError;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Zero tests configured examined nothing — NOT VERIFIED (2), the verdict
|
|
47
|
+
* `shrk quality` gives the same empty gate, unless `--allow-empty` accepts it.
|
|
48
|
+
*/
|
|
49
|
+
function settleEmptySet(args, unit, reason, root) {
|
|
50
|
+
return settleVerdict(ExitCode.VerifiedPass, [
|
|
51
|
+
{ unit, expected: 0, examined: 0, root, reason, ...allowEmptyValve(args, 0) },
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
function writeEmptySet(args, title, none, settled) {
|
|
55
|
+
if (flagBool(args, 'json')) {
|
|
56
|
+
process.stdout.write(asJson({
|
|
57
|
+
tests: 0,
|
|
58
|
+
results: [],
|
|
59
|
+
exitCode: settled.exit,
|
|
60
|
+
verdict: settled.verdict,
|
|
61
|
+
shortfalls: settled.shortfalls,
|
|
62
|
+
accepted: settled.accepted,
|
|
63
|
+
}) + '\n');
|
|
64
|
+
return settled.exit;
|
|
65
|
+
}
|
|
66
|
+
process.stdout.write(header(title));
|
|
67
|
+
process.stdout.write(`${none}\n`);
|
|
68
|
+
const line = verdictLine(settled, 'Nothing to test — accepted.');
|
|
69
|
+
if (line)
|
|
70
|
+
process.stdout.write(line + '\n');
|
|
71
|
+
if (settled.exit === ExitCode.NotVerified) {
|
|
72
|
+
process.stdout.write(`Pass --${ALLOW_EMPTY_FLAG} to accept an empty test set explicitly.\n`);
|
|
73
|
+
}
|
|
74
|
+
return settled.exit;
|
|
75
|
+
}
|
|
8
76
|
async function runContextTests(args) {
|
|
9
77
|
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
78
|
+
// Existence answers come from the shared reference registry — warm it.
|
|
79
|
+
await warmCliReferenceRegistries(inspection);
|
|
10
80
|
const all = await loadContextTests(inspection);
|
|
11
|
-
const
|
|
12
|
-
|
|
81
|
+
const { tests, usageError } = selectById(all, args, 'context');
|
|
82
|
+
if (usageError)
|
|
83
|
+
return writeUsageError(args, usageError);
|
|
13
84
|
if (tests.length === 0) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return 0;
|
|
17
|
-
}
|
|
18
|
-
process.stdout.write(header('Context tests'));
|
|
19
|
-
process.stdout.write('No context tests configured.\n');
|
|
20
|
-
return 0;
|
|
85
|
+
const settled = settleEmptySet(args, 'context tests', 'no context tests configured (sharkcraft/context-tests.ts, or a pack `contextTestFiles` contribution)', inspection.projectRoot);
|
|
86
|
+
return writeEmptySet(args, 'Context tests', 'No context tests configured.', settled);
|
|
21
87
|
}
|
|
22
88
|
const results = tests.map((t) => runContextTest(inspection, t));
|
|
23
89
|
const failed = results.filter((r) => !r.passed);
|
|
90
|
+
const settled = settleVerdict(failed.length > 0 ? ExitCode.Failure : ExitCode.VerifiedPass, [
|
|
91
|
+
{ unit: 'context tests', expected: results.length, examined: results.length },
|
|
92
|
+
]);
|
|
24
93
|
if (flagBool(args, 'json')) {
|
|
25
|
-
process.stdout.write(asJson({
|
|
26
|
-
|
|
94
|
+
process.stdout.write(asJson({
|
|
95
|
+
total: results.length,
|
|
96
|
+
failed: failed.length,
|
|
97
|
+
exitCode: settled.exit,
|
|
98
|
+
verdict: settled.verdict,
|
|
99
|
+
shortfalls: settled.shortfalls,
|
|
100
|
+
results,
|
|
101
|
+
}) + '\n');
|
|
102
|
+
return settled.exit;
|
|
27
103
|
}
|
|
28
104
|
process.stdout.write(header(`Context tests (${results.length})`));
|
|
29
105
|
for (const r of results) {
|
|
@@ -50,37 +126,65 @@ async function runContextTests(args) {
|
|
|
50
126
|
}
|
|
51
127
|
}
|
|
52
128
|
process.stdout.write(`\nSummary: ${results.length - failed.length}/${results.length} passed.\n`);
|
|
53
|
-
|
|
129
|
+
const line = verdictLine(settled, '');
|
|
130
|
+
if (line)
|
|
131
|
+
process.stdout.write(line + '\n');
|
|
132
|
+
return settled.exit;
|
|
54
133
|
}
|
|
55
134
|
async function runAgentTests(args) {
|
|
56
135
|
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
57
136
|
const all = await loadAgentContractTests(inspection);
|
|
58
|
-
const
|
|
59
|
-
|
|
137
|
+
const { tests, usageError } = selectById(all, args, 'agent');
|
|
138
|
+
if (usageError)
|
|
139
|
+
return writeUsageError(args, usageError);
|
|
60
140
|
if (tests.length === 0) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return 0;
|
|
64
|
-
}
|
|
65
|
-
process.stdout.write(header('Agent contract tests'));
|
|
66
|
-
process.stdout.write('No agent contract tests configured.\n');
|
|
67
|
-
return 0;
|
|
141
|
+
const settled = settleEmptySet(args, 'agent tests', 'no agent contract tests configured (sharkcraft/agent-tests.ts, or a pack `agentTestFiles` contribution)', inspection.projectRoot);
|
|
142
|
+
return writeEmptySet(args, 'Agent contract tests', 'No agent contract tests configured.', settled);
|
|
68
143
|
}
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const results = tests.map((t) => runAgentContractTest(inspection, t
|
|
144
|
+
// Warm the shared reference registry WITH the command resolver: existence
|
|
145
|
+
// expectations read the registry `shrk <kind> list` prints, and
|
|
146
|
+
// `expectedCommands` resolve against the live command index.
|
|
147
|
+
await warmCliReferenceRegistries(inspection);
|
|
148
|
+
const results = tests.map((t) => runAgentContractTest(inspection, t));
|
|
74
149
|
const failed = results.filter((r) => !r.passed);
|
|
150
|
+
// A test whose every failing expectation could not be evaluated is NOT
|
|
151
|
+
// VERIFIED — an unexamined unit, never a pass and never a plain failure.
|
|
152
|
+
const notVerified = results.filter((r) => r.verdict === 'not-verified');
|
|
153
|
+
const anyFailed = results.some((r) => r.verdict === 'fail');
|
|
154
|
+
const settled = settleVerdict(anyFailed ? ExitCode.Failure : ExitCode.VerifiedPass, [
|
|
155
|
+
{
|
|
156
|
+
unit: 'agent tests',
|
|
157
|
+
expected: results.length,
|
|
158
|
+
examined: results.length - notVerified.length,
|
|
159
|
+
...(notVerified.length > 0
|
|
160
|
+
? {
|
|
161
|
+
unexamined: notVerified.slice(0, 20).map((r) => r.id),
|
|
162
|
+
unexaminedTotal: notVerified.length,
|
|
163
|
+
reason: 'an expectation could not be evaluated',
|
|
164
|
+
}
|
|
165
|
+
: {}),
|
|
166
|
+
},
|
|
167
|
+
]);
|
|
168
|
+
const exit = settled.exit;
|
|
75
169
|
if (flagBool(args, 'json')) {
|
|
76
|
-
process.stdout.write(asJson({
|
|
77
|
-
|
|
170
|
+
process.stdout.write(asJson({
|
|
171
|
+
total: results.length,
|
|
172
|
+
failed: failed.length,
|
|
173
|
+
notVerified: notVerified.length,
|
|
174
|
+
exitCode: exit,
|
|
175
|
+
verdict: settled.verdict,
|
|
176
|
+
shortfalls: settled.shortfalls,
|
|
177
|
+
results,
|
|
178
|
+
}) + '\n');
|
|
179
|
+
return exit;
|
|
78
180
|
}
|
|
79
181
|
process.stdout.write(header(`Agent contract tests (${results.length})`));
|
|
80
182
|
for (const r of results) {
|
|
81
|
-
const tag = r.passed ? 'PASS' : 'FAIL';
|
|
183
|
+
const tag = r.passed ? 'PASS' : r.verdict === 'not-verified' ? 'N/V ' : 'FAIL';
|
|
82
184
|
process.stdout.write(` ${tag} ${r.id.padEnd(36)} task: ${r.task}\n`);
|
|
83
185
|
if (!r.passed) {
|
|
186
|
+
if ((r.unverified ?? []).length)
|
|
187
|
+
process.stdout.write(` NOT VERIFIED: ${r.unverified.join(', ')}\n`);
|
|
84
188
|
if (r.expectedPipeline) {
|
|
85
189
|
process.stdout.write(` expected pipeline: ${r.expectedPipeline}\n`);
|
|
86
190
|
process.stdout.write(` actual pipelines: ${r.actualPipelines?.join(', ') ?? '(none)'}\n`);
|
|
@@ -108,7 +212,11 @@ async function runAgentTests(args) {
|
|
|
108
212
|
if ((r.unexpectedlyIncluded ?? []).length)
|
|
109
213
|
process.stdout.write(` unexpectedly included: ${r.unexpectedlyIncluded.join(', ')}\n`);
|
|
110
214
|
for (const d of r.diagnostics ?? []) {
|
|
111
|
-
|
|
215
|
+
const why = d.code ?? (d.existsInRegistry ? 'exists' : 'missing from registry');
|
|
216
|
+
const where = d.consulted
|
|
217
|
+
? ` — ${d.assertion ?? 'check'} · consulted ${d.consulted.kind} (${d.consulted.listVerb}${d.consulted.kind === 'command' ? '' : `, ${d.consulted.size} ids`})`
|
|
218
|
+
: '';
|
|
219
|
+
process.stdout.write(` · ${d.kind}: ${d.id} (${why})${where}:\n`);
|
|
112
220
|
for (const s of d.suggestions)
|
|
113
221
|
process.stdout.write(` - ${s}\n`);
|
|
114
222
|
}
|
|
@@ -131,7 +239,10 @@ async function runAgentTests(args) {
|
|
|
131
239
|
if (anyMissingExpected) {
|
|
132
240
|
process.stdout.write(renderFailureHints(agentTestMissingExpectedHints()));
|
|
133
241
|
}
|
|
134
|
-
|
|
242
|
+
const line = verdictLine(settled, '', exit === ExitCode.NotVerified ? 'Some expectations could not be evaluated (see NOT VERIFIED above).' : undefined);
|
|
243
|
+
if (line)
|
|
244
|
+
process.stdout.write(line + '\n');
|
|
245
|
+
return exit;
|
|
135
246
|
}
|
|
136
247
|
async function generateContextTest(args) {
|
|
137
248
|
const task = args.positional.join(' ').trim();
|
|
@@ -250,8 +361,25 @@ function slug(s) {
|
|
|
250
361
|
}
|
|
251
362
|
export const testCommand = {
|
|
252
363
|
name: 'test',
|
|
364
|
+
positionals: PositionalMode.None,
|
|
365
|
+
subverbs: [
|
|
366
|
+
{ name: 'context', description: 'Run the context regression tests.', usage: 'shrk test context [--id <id>] [--allow-empty] [--json]' },
|
|
367
|
+
{ name: 'agent', description: 'Run the agent-contract tests.', usage: 'shrk test agent [--id <id>] [--allow-empty] [--watch] [--json]' },
|
|
368
|
+
{
|
|
369
|
+
name: 'generate',
|
|
370
|
+
description: 'Generate a context or agent test from a task.',
|
|
371
|
+
usage: 'shrk test generate <context|agent> "<task>" [--write]',
|
|
372
|
+
positionals: PositionalMode.None,
|
|
373
|
+
subverbs: [
|
|
374
|
+
{ name: 'context', description: 'Generate a context test.', usage: 'shrk test generate context "<task>" [--write]', positionals: PositionalMode.Free },
|
|
375
|
+
{ name: 'agent', description: 'Generate an agent test.', usage: 'shrk test generate agent "<task>" [--write]', positionals: PositionalMode.Free },
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
],
|
|
253
379
|
description: 'Run or generate SharkCraft regression tests: `test context` / `test agent`, or `test generate context|agent "<task>"`.',
|
|
254
|
-
usage: 'shrk [--cwd <dir>] test <context|agent|generate> [args...] [--id <id>] [--json]',
|
|
380
|
+
usage: 'shrk [--cwd <dir>] test <context|agent|generate> [args...] [--id <id>] [--allow-empty] [--json]',
|
|
381
|
+
// `--allow-empty` never swallows a following positional.
|
|
382
|
+
booleanFlags: new Set(['json', ALLOW_EMPTY_FLAG]),
|
|
255
383
|
async run(args) {
|
|
256
384
|
const sub = args.positional[0];
|
|
257
385
|
const sliced = { ...args, positional: args.positional.slice(1) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests.command.d.ts","sourceRoot":"","sources":["../../src/commands/tests.command.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"tests.command.d.ts","sourceRoot":"","sources":["../../src/commands/tests.command.ts"],"names":[],"mappings":"AASA,OAAO,EAOL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA+ChC,eAAO,MAAM,kBAAkB,EAAE,eAiChC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAajC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eA0BjC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
3
|
import { analyzeTestImpact, getChangedFiles, inspectSharkcraft, readFeatureBundle, suggestTestPathFor, } from '@shrkcrft/inspector';
|
|
4
|
-
import { flagBool, flagString, flagList, resolveCwd, } from "../command-registry.js";
|
|
4
|
+
import { emptySelectionExit, flagBool, flagString, flagList, requireInputSelector, resolveCwd, } from "../command-registry.js";
|
|
5
5
|
import { asJson, header } from "../output/format-output.js";
|
|
6
6
|
function collectFiles(cwd, args) {
|
|
7
7
|
const files = flagList(args, 'files');
|
|
@@ -46,15 +46,29 @@ function collectFiles(cwd, args) {
|
|
|
46
46
|
}
|
|
47
47
|
return [...new Set(out)];
|
|
48
48
|
}
|
|
49
|
+
/** The input selectors `tests impact` / `tests missing` accept — at least one is required. */
|
|
50
|
+
const TEST_SELECTORS = ['files', 'since', 'staged', 'plan', 'bundle'];
|
|
51
|
+
const TESTS_IMPACT_USAGE = 'shrk tests impact [--files a,b] [--since <ref>] [--staged] [--plan <plan>] [--bundle <id>] "<task>"';
|
|
52
|
+
const TESTS_MISSING_USAGE = 'shrk tests missing --files a,b | --since <ref> | --staged | --plan <plan> | --bundle <id>';
|
|
49
53
|
export const testsImpactCommand = {
|
|
50
54
|
name: 'impact',
|
|
51
55
|
description: 'Test impact analysis for changed files / plan / bundle.',
|
|
52
|
-
usage:
|
|
56
|
+
usage: TESTS_IMPACT_USAGE,
|
|
57
|
+
booleanFlags: new Set(['json', 'staged']),
|
|
53
58
|
async run(args) {
|
|
59
|
+
const noSelector = requireInputSelector(args, {
|
|
60
|
+
flags: TEST_SELECTORS,
|
|
61
|
+
positional: true,
|
|
62
|
+
usage: TESTS_IMPACT_USAGE,
|
|
63
|
+
});
|
|
64
|
+
if (noSelector !== null)
|
|
65
|
+
return noSelector;
|
|
54
66
|
const cwd = resolveCwd(args);
|
|
55
67
|
const inspection = await inspectSharkcraft({ cwd });
|
|
56
68
|
const task = args.positional.join(' ').trim() || undefined;
|
|
57
69
|
const files = collectFiles(cwd, args);
|
|
70
|
+
if (files.length === 0 && !task)
|
|
71
|
+
return emptySelectionExit(flagBool(args, 'json'));
|
|
58
72
|
const result = analyzeTestImpact(inspection, {
|
|
59
73
|
...(task ? { task } : {}),
|
|
60
74
|
files,
|
|
@@ -91,16 +105,28 @@ export const testsSuggestCommand = {
|
|
|
91
105
|
export const testsMissingCommand = {
|
|
92
106
|
name: 'missing',
|
|
93
107
|
description: 'Show missing test files for the given inputs.',
|
|
94
|
-
usage:
|
|
108
|
+
usage: TESTS_MISSING_USAGE,
|
|
109
|
+
booleanFlags: new Set(['json', 'staged']),
|
|
95
110
|
async run(args) {
|
|
111
|
+
// The selector is REQUIRED: without one this printed zero bytes and exit 0
|
|
112
|
+
// — "you gave me nothing" rendered as "I found nothing".
|
|
113
|
+
const noSelector = requireInputSelector(args, { flags: TEST_SELECTORS, usage: TESTS_MISSING_USAGE });
|
|
114
|
+
if (noSelector !== null)
|
|
115
|
+
return noSelector;
|
|
96
116
|
const cwd = resolveCwd(args);
|
|
97
117
|
const inspection = await inspectSharkcraft({ cwd });
|
|
98
118
|
const files = collectFiles(cwd, args);
|
|
119
|
+
if (files.length === 0)
|
|
120
|
+
return emptySelectionExit(flagBool(args, 'json'));
|
|
99
121
|
const r = analyzeTestImpact(inspection, { files });
|
|
100
122
|
if (flagBool(args, 'json')) {
|
|
101
123
|
process.stdout.write(asJson({ missing: r.missingTestFiles }) + '\n');
|
|
102
124
|
return 0;
|
|
103
125
|
}
|
|
126
|
+
if (r.missingTestFiles.length === 0) {
|
|
127
|
+
// Never zero bytes on a verified run.
|
|
128
|
+
process.stdout.write(`No missing tests for ${files.length} file(s).\n`);
|
|
129
|
+
}
|
|
104
130
|
for (const f of r.missingTestFiles)
|
|
105
131
|
process.stdout.write(f + '\n');
|
|
106
132
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.command.d.ts","sourceRoot":"","sources":["../../src/commands/trace.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trace.command.d.ts","sourceRoot":"","sources":["../../src/commands/trace.command.ts"],"names":[],"mappings":"AAoBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAuFhC,eAAO,MAAM,YAAY,EAAE,eAgJ1B,CAAC"}
|