@shrkcrft/cli 0.1.0-alpha.30 → 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 +54 -3
- package/dist/commands/baseline.command.d.ts.map +1 -1
- package/dist/commands/baseline.command.js +582 -74
- 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 +138 -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 +1241 -322
- 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 +3 -0
- 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 +13 -0
- package/dist/commands/docs-references.command.d.ts.map +1 -1
- package/dist/commands/docs-references.command.js +269 -72
- package/dist/commands/doctor.command.d.ts.map +1 -1
- package/dist/commands/doctor.command.js +58 -4
- 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 +52 -0
- package/dist/commands/gates.command.d.ts.map +1 -1
- package/dist/commands/gates.command.js +811 -185
- 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 +33 -3
- package/dist/commands/generated.command.d.ts.map +1 -1
- package/dist/commands/generated.command.js +499 -147
- 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 +198 -24
- 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 +360 -73
- 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 +37 -3
- package/dist/gates/gate-rule-globs.d.ts.map +1 -1
- package/dist/gates/gate-rule-globs.js +78 -40
- package/dist/gates/gate-rule-view.d.ts +17 -4
- package/dist/gates/gate-rule-view.d.ts.map +1 -1
- package/dist/gates/gate-rule-view.js +105 -90
- 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 +187 -4
- package/dist/gates/rule-coverage.d.ts.map +1 -1
- package/dist/gates/rule-coverage.js +501 -49
- package/dist/gates/run-gate-planes.d.ts +14 -0
- package/dist/gates/run-gate-planes.d.ts.map +1 -1
- package/dist/gates/run-gate-planes.js +172 -30
- 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 +200 -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,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { flagBool, flagString, flagList, } from "../command-registry.js";
|
|
1
|
+
import { listDiagnostics } from '@shrkcrft/inspector';
|
|
2
|
+
import { flagBool } from "../command-registry.js";
|
|
4
3
|
import { asJson, header } from "../output/format-output.js";
|
|
4
|
+
// `diagnostics get` / `diagnostics suggest` were pruned from the surface (r48);
|
|
5
|
+
// their handlers lingered here unregistered, still printing usage for commands
|
|
6
|
+
// that exit 2. `list` is the one registered verb.
|
|
5
7
|
export const diagnosticsListCommand = {
|
|
6
8
|
name: 'list',
|
|
7
9
|
description: 'List known SharkCraft failure diagnostics. Read-only.',
|
|
@@ -20,78 +22,3 @@ export const diagnosticsListCommand = {
|
|
|
20
22
|
return 0;
|
|
21
23
|
},
|
|
22
24
|
};
|
|
23
|
-
export const diagnosticsGetCommand = {
|
|
24
|
-
name: 'get',
|
|
25
|
-
description: 'Look up a SharkCraft failure diagnostic by code. Read-only.',
|
|
26
|
-
usage: 'shrk diagnostics get <code> [--ctx key=value ...] [--json]',
|
|
27
|
-
async run(args) {
|
|
28
|
-
const code = args.positional[0];
|
|
29
|
-
if (!code) {
|
|
30
|
-
process.stderr.write('Usage: shrk diagnostics get <code> [--ctx key=value ...]\n');
|
|
31
|
-
return 2;
|
|
32
|
-
}
|
|
33
|
-
const entry = getDiagnosticEntry(code);
|
|
34
|
-
if (!entry) {
|
|
35
|
-
process.stderr.write(`Unknown diagnostic code "${code}". Try \`shrk diagnostics list\`.\n`);
|
|
36
|
-
return 2;
|
|
37
|
-
}
|
|
38
|
-
const ctx = {};
|
|
39
|
-
for (const raw of flagList(args, 'ctx')) {
|
|
40
|
-
const i = raw.indexOf('=');
|
|
41
|
-
if (i < 0)
|
|
42
|
-
continue;
|
|
43
|
-
const key = raw.slice(0, i).trim();
|
|
44
|
-
const value = raw.slice(i + 1);
|
|
45
|
-
ctx[key] = value;
|
|
46
|
-
}
|
|
47
|
-
const diagnostic = buildDiagnosticByCode(entry.code, ctx);
|
|
48
|
-
if (flagBool(args, 'json')) {
|
|
49
|
-
process.stdout.write(asJson(diagnostic) + '\n');
|
|
50
|
-
return 0;
|
|
51
|
-
}
|
|
52
|
-
process.stdout.write(renderDiagnosticText(diagnostic));
|
|
53
|
-
return 0;
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
export const diagnosticsSuggestCommand = {
|
|
57
|
-
name: 'suggest',
|
|
58
|
-
description: 'Suggest the most likely diagnostic for a stderr blob. Read-only.',
|
|
59
|
-
usage: 'shrk diagnostics suggest "<error text>" | --from-file <file> [--json]',
|
|
60
|
-
async run(args) {
|
|
61
|
-
const fromFile = flagString(args, 'from-file');
|
|
62
|
-
let input = args.positional.join(' ').trim();
|
|
63
|
-
if (fromFile) {
|
|
64
|
-
try {
|
|
65
|
-
input = readFileSync(fromFile, 'utf8');
|
|
66
|
-
}
|
|
67
|
-
catch (err) {
|
|
68
|
-
process.stderr.write(`Failed to read --from-file: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
69
|
-
return 1;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (!input) {
|
|
73
|
-
process.stderr.write('Usage: shrk diagnostics suggest "<error text>" or --from-file <file>\n');
|
|
74
|
-
return 2;
|
|
75
|
-
}
|
|
76
|
-
const r = suggestDiagnostic(input);
|
|
77
|
-
if (flagBool(args, 'json')) {
|
|
78
|
-
process.stdout.write(asJson(r) + '\n');
|
|
79
|
-
return 0;
|
|
80
|
-
}
|
|
81
|
-
if (!r.topSuggestion) {
|
|
82
|
-
process.stdout.write('No matching diagnostic found.\n');
|
|
83
|
-
return 1;
|
|
84
|
-
}
|
|
85
|
-
process.stdout.write(`Top suggestion: ${r.topSuggestion.code} (${r.topSuggestion.confidence})\n`);
|
|
86
|
-
process.stdout.write(` title: ${r.topSuggestion.title}\n`);
|
|
87
|
-
process.stdout.write(` next: ${r.topSuggestion.nextCommand}\n`);
|
|
88
|
-
if (r.topSuggestion.docsLink)
|
|
89
|
-
process.stdout.write(` docs: ${r.topSuggestion.docsLink}\n`);
|
|
90
|
-
if (r.candidates.length > 1) {
|
|
91
|
-
process.stdout.write('Other candidates:\n');
|
|
92
|
-
for (const c of r.candidates.slice(1))
|
|
93
|
-
process.stdout.write(` ${c.code} (${c.confidence})\n`);
|
|
94
|
-
}
|
|
95
|
-
return 0;
|
|
96
|
-
},
|
|
97
|
-
};
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* import-hygiene check to only the files the agent touched in the
|
|
9
9
|
* current git diff.
|
|
10
10
|
* 4. The output is a single agent-friendly JSON envelope with a
|
|
11
|
-
* verdict (ok / warnings / errors) and a one-line next
|
|
11
|
+
* verdict (ok / warnings / errors / not-verified) and a one-line next
|
|
12
|
+
* action.
|
|
12
13
|
*
|
|
13
14
|
* Why a new command instead of "just run `shrk check boundaries
|
|
14
15
|
* --changed-only` and `shrk check imports --changed-only`":
|
|
@@ -21,9 +22,10 @@
|
|
|
21
22
|
* - Concrete `nextAction` line — the agent knows exactly what to do
|
|
22
23
|
* next (declare done, fix N things, or re-run after a manual fix).
|
|
23
24
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* Round 11: the boundary half goes through THE boundary orchestrator (a rule
|
|
26
|
+
* edit escalates to the whole tree; a change no rule governs is NOT a pass),
|
|
27
|
+
* and the verdict is settled by the shared gate envelope — an empty diff, or a
|
|
28
|
+
* diff nothing examined, is `not-verified` (2), never "Diff passes the gate".
|
|
27
29
|
*/
|
|
28
30
|
import { type ICommandHandler } from '../command-registry.js';
|
|
29
31
|
export declare const diffCheckCommand: ICommandHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-check.command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-check.command.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"diff-check.command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-check.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAcH,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA6EhC,eAAO,MAAM,gBAAgB,EAAE,eAiP9B,CAAC"}
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* import-hygiene check to only the files the agent touched in the
|
|
9
9
|
* current git diff.
|
|
10
10
|
* 4. The output is a single agent-friendly JSON envelope with a
|
|
11
|
-
* verdict (ok / warnings / errors) and a one-line next
|
|
11
|
+
* verdict (ok / warnings / errors / not-verified) and a one-line next
|
|
12
|
+
* action.
|
|
12
13
|
*
|
|
13
14
|
* Why a new command instead of "just run `shrk check boundaries
|
|
14
15
|
* --changed-only` and `shrk check imports --changed-only`":
|
|
@@ -21,14 +22,19 @@
|
|
|
21
22
|
* - Concrete `nextAction` line — the agent knows exactly what to do
|
|
22
23
|
* next (declare done, fix N things, or re-run after a manual fix).
|
|
23
24
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* Round 11: the boundary half goes through THE boundary orchestrator (a rule
|
|
26
|
+
* edit escalates to the whole tree; a change no rule governs is NOT a pass),
|
|
27
|
+
* and the verdict is settled by the shared gate envelope — an empty diff, or a
|
|
28
|
+
* diff nothing examined, is `not-verified` (2), never "Diff passes the gate".
|
|
27
29
|
*/
|
|
28
|
-
import { buildImportHygieneReport,
|
|
29
|
-
import { evaluateBoundaries, loadTsconfigPaths, scanImports, } from '@shrkcrft/boundaries';
|
|
30
|
+
import { boundaryRulesEvaluated, buildImportHygieneReport, describeBoundaryConfiguration, importHygieneCoverage, importHygieneSubjects, inspectSharkcraft, resolveChangedFiles, runBoundaryCheck, } from '@shrkcrft/inspector';
|
|
30
31
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
31
32
|
import { asJson, bullet, header, kv } from "../output/format-output.js";
|
|
33
|
+
import { ExitCode } from "../exit-codes.js";
|
|
34
|
+
import { buildGateEnvelope } from "../gates/gate-envelope.js";
|
|
35
|
+
import { ALLOW_EMPTY_FLAG, allowEmptyValve } from "../gates/allow-empty.js";
|
|
36
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
37
|
+
import { ruleSetCoverage } from "../finish/run-finish.js";
|
|
32
38
|
const SCHEMA = 'sharkcraft.diff-check/v1';
|
|
33
39
|
function resolveScope(args, cwd) {
|
|
34
40
|
const staged = flagBool(args, 'staged');
|
|
@@ -55,53 +61,14 @@ function resolveScope(args, cwd) {
|
|
|
55
61
|
options: { projectRoot: cwd, includeWorktree: true },
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
const bWarn = env.boundaries.counts.warning;
|
|
61
|
-
const iErr = env.imports.verdict === 'errors' ? (env.imports.counts.error ?? env.imports.findings.length) : 0;
|
|
62
|
-
const iWarn = env.imports.verdict === 'warnings' ? (env.imports.counts.warning ?? env.imports.findings.length) : 0;
|
|
63
|
-
if (env.scope.fileCount === 0) {
|
|
64
|
-
return {
|
|
65
|
-
verdict: 'ok',
|
|
66
|
-
summary: 'No files changed in the current diff scope.',
|
|
67
|
-
nextAction: 'Nothing to check. If you expected changes, verify your `--staged` / `--since <ref>` flag or save your edits first.',
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
if (bErr > 0 || iErr > 0) {
|
|
71
|
-
const parts = [];
|
|
72
|
-
if (bErr > 0)
|
|
73
|
-
parts.push(`${bErr} boundary violation${bErr === 1 ? '' : 's'}`);
|
|
74
|
-
if (iErr > 0)
|
|
75
|
-
parts.push(`${iErr} import-hygiene error${iErr === 1 ? '' : 's'}`);
|
|
76
|
-
return {
|
|
77
|
-
verdict: 'errors',
|
|
78
|
-
summary: `Diff fails the gate: ${parts.join(', ')}.`,
|
|
79
|
-
nextAction: 'Fix every error in `boundaries.violations` and `imports.findings` (look at each entry\'s `suggestedFix` line), then re-run `shrk diff-check`.',
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (bWarn > 0 || iWarn > 0) {
|
|
83
|
-
const parts = [];
|
|
84
|
-
if (bWarn > 0)
|
|
85
|
-
parts.push(`${bWarn} boundary warning${bWarn === 1 ? '' : 's'}`);
|
|
86
|
-
if (iWarn > 0)
|
|
87
|
-
parts.push(`${iWarn} import-hygiene warning${iWarn === 1 ? '' : 's'}`);
|
|
88
|
-
return {
|
|
89
|
-
verdict: 'warnings',
|
|
90
|
-
summary: `Diff passes the gate with ${parts.join(', ')}.`,
|
|
91
|
-
nextAction: 'Safe to declare done. Review warnings if the diff touches a sensitive area; otherwise these are non-blocking.',
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
verdict: 'ok',
|
|
96
|
-
summary: `Diff passes the gate (${env.scope.fileCount} file${env.scope.fileCount === 1 ? '' : 's'}, 0 violations).`,
|
|
97
|
-
nextAction: 'Safe to declare done.',
|
|
98
|
-
};
|
|
64
|
+
function plural(n, word) {
|
|
65
|
+
return `${n} ${word}${n === 1 ? '' : 's'}`;
|
|
99
66
|
}
|
|
100
67
|
export const diffCheckCommand = {
|
|
101
68
|
name: 'diff-check',
|
|
102
|
-
description: 'Self-check the current git diff against this project\'s boundary + import-hygiene rules. Single-call composite of `shrk check boundaries --changed-only` + `shrk check imports --changed-only`, with one verdict and one nextAction line. Designed for AI agents to run after editing — pass --json for the structured envelope.',
|
|
103
|
-
usage: 'shrk [--cwd <dir>] diff-check [files... | --files a.ts,b.ts | --staged | --since <ref>] [--json]',
|
|
104
|
-
booleanFlags: new Set(['json', 'staged']),
|
|
69
|
+
description: 'Self-check the current git diff against this project\'s boundary + import-hygiene rules. Single-call composite of `shrk check boundaries --changed-only` (rule edits escalate to the whole tree) + `shrk check imports --changed-only`, with one verdict and one nextAction line. An empty diff, or one nothing examined, is not-verified (exit 2). Designed for AI agents to run after editing — pass --json for the structured envelope.',
|
|
70
|
+
usage: 'shrk [--cwd <dir>] diff-check [files... | --files a.ts,b.ts | --staged | --since <ref>] [--allow-empty] [--json]',
|
|
71
|
+
booleanFlags: new Set(['json', 'staged', ALLOW_EMPTY_FLAG]),
|
|
105
72
|
async run(args) {
|
|
106
73
|
const cwd = resolveCwd(args);
|
|
107
74
|
const wantJson = flagBool(args, 'json');
|
|
@@ -109,44 +76,78 @@ export const diffCheckCommand = {
|
|
|
109
76
|
// 1. Resolve the changed file set once. Both engines re-use it.
|
|
110
77
|
const changed = resolveChangedFiles(scopeOptions);
|
|
111
78
|
const changedFiles = changed.files;
|
|
112
|
-
// 2. Boundary engine — only if rules exist.
|
|
113
79
|
const inspection = await inspectSharkcraft({ cwd });
|
|
114
|
-
const
|
|
80
|
+
const rows = [];
|
|
81
|
+
// 2. Boundary engine — THE orchestrator, escalation included.
|
|
115
82
|
let boundaryBlock = {
|
|
116
83
|
ran: false,
|
|
117
84
|
rulesEvaluated: 0,
|
|
118
85
|
counts: { error: 0, warning: 0, info: 0 },
|
|
119
86
|
violations: [],
|
|
120
87
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
...(tsconfigPaths.aliases.size > 0 ? { tsconfigPaths } : {}),
|
|
126
|
-
});
|
|
127
|
-
const filtered = filterViolationsToChangedScope(evalResult.violations, scopeOptions);
|
|
128
|
-
boundaryBlock = {
|
|
129
|
-
ran: true,
|
|
130
|
-
rulesEvaluated: evalResult.rulesEvaluated,
|
|
131
|
-
counts: {
|
|
132
|
-
error: filtered.includedViolations.filter((v) => v.severity === 'error').length,
|
|
133
|
-
warning: filtered.includedViolations.filter((v) => v.severity === 'warning').length,
|
|
134
|
-
info: filtered.includedViolations.filter((v) => v.severity === 'info').length,
|
|
135
|
-
},
|
|
136
|
-
violations: filtered.includedViolations,
|
|
137
|
-
};
|
|
88
|
+
const loadIssues = inspection.boundaryLoadIssues ?? [];
|
|
89
|
+
if (inspection.boundaryRegistry.size() === 0 && loadIssues.length === 0) {
|
|
90
|
+
boundaryBlock.reason =
|
|
91
|
+
describeBoundaryConfiguration(inspection).diagnostics[0] ?? 'no boundary rules configured';
|
|
138
92
|
}
|
|
139
|
-
else if (
|
|
140
|
-
boundaryBlock =
|
|
93
|
+
else if (changedFiles.length === 0 && loadIssues.length === 0) {
|
|
94
|
+
boundaryBlock.reason = 'no changed files in the diff scope';
|
|
141
95
|
}
|
|
142
|
-
|
|
96
|
+
else {
|
|
97
|
+
const r = runBoundaryCheck(inspection, { changed: { mode: changed.mode, files: changedFiles } });
|
|
98
|
+
if (r.selectedRuleIds.length === 0 && r.loadIssues.length === 0) {
|
|
99
|
+
boundaryBlock.reason = 'no changed source file is governed by a boundary rule';
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const { coverage } = ruleSetCoverage('boundary rules', r.rules.map((x) => ({ ruleId: x.ruleId, coverage: x.coverage })), 'passed over part of their scope or checked nothing');
|
|
103
|
+
const escalated = r.changed?.escalatedRuleIds ?? [];
|
|
104
|
+
boundaryBlock = {
|
|
105
|
+
ran: true,
|
|
106
|
+
rulesEvaluated: boundaryRulesEvaluated(r),
|
|
107
|
+
counts: r.counts,
|
|
108
|
+
violations: r.violations,
|
|
109
|
+
...(escalated.length > 0
|
|
110
|
+
? {
|
|
111
|
+
escalation: {
|
|
112
|
+
ruleIds: escalated,
|
|
113
|
+
files: [...new Set(r.changed?.escalation.reasons.map((x) => x.file) ?? [])],
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
: {}),
|
|
117
|
+
...(r.loadIssues.length > 0
|
|
118
|
+
? { loadIssues: r.loadIssues }
|
|
119
|
+
: {}),
|
|
120
|
+
...(r.staleExceptions.length > 0
|
|
121
|
+
? { staleExceptions: r.staleExceptions }
|
|
122
|
+
: {}),
|
|
123
|
+
coverage,
|
|
124
|
+
};
|
|
125
|
+
rows.push({
|
|
126
|
+
id: 'boundaries',
|
|
127
|
+
type: 'diff',
|
|
128
|
+
status: r.proposedExit === ExitCode.Failure ? 'failed' : 'passed',
|
|
129
|
+
severity: 'error',
|
|
130
|
+
counts: { errors: r.counts.error, warnings: r.counts.warning, rules: r.selectedRuleIds.length },
|
|
131
|
+
violations: r.violations.map((v) => ({ id: v.importSpecifier, file: v.file, line: v.line, message: v.message })),
|
|
132
|
+
coverage,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// 3. Import-hygiene engine — over the changed sources it actually reads.
|
|
143
137
|
let importsBlock = {
|
|
144
138
|
ran: false,
|
|
145
139
|
verdict: 'skipped',
|
|
146
140
|
counts: {},
|
|
147
141
|
findings: [],
|
|
148
142
|
};
|
|
149
|
-
|
|
143
|
+
const hygieneFiles = changedFiles.length > 0 ? importHygieneSubjects(cwd, changedFiles) : [];
|
|
144
|
+
if (changedFiles.length === 0) {
|
|
145
|
+
importsBlock.reason = 'no changed files in the diff scope';
|
|
146
|
+
}
|
|
147
|
+
else if (hygieneFiles.length === 0) {
|
|
148
|
+
importsBlock.reason = 'no changed .ts/.tsx source for import hygiene to read';
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
150
151
|
const report = buildImportHygieneReport(cwd, { files: changedFiles });
|
|
151
152
|
importsBlock = {
|
|
152
153
|
ran: true,
|
|
@@ -154,61 +155,147 @@ export const diffCheckCommand = {
|
|
|
154
155
|
counts: report.counts ?? {},
|
|
155
156
|
findings: report.findings,
|
|
156
157
|
};
|
|
158
|
+
rows.push({
|
|
159
|
+
id: 'imports',
|
|
160
|
+
type: 'diff',
|
|
161
|
+
status: report.verdict === 'errors' ? 'failed' : 'passed',
|
|
162
|
+
severity: 'error',
|
|
163
|
+
counts: { findings: report.findings.length },
|
|
164
|
+
violations: report.findings
|
|
165
|
+
.filter((f) => f.severity === 'error')
|
|
166
|
+
.map((f) => ({ id: f.kind, file: f.file, line: f.line })),
|
|
167
|
+
// THE hygiene coverage fold — an unreadable changed source is unexamined.
|
|
168
|
+
coverage: importHygieneCoverage(report, 'changed source files'),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
// 4. Settle the verdict through the shared envelope.
|
|
172
|
+
const runCoverage = {
|
|
173
|
+
unit: 'sub-checks',
|
|
174
|
+
expected: rows.length,
|
|
175
|
+
examined: rows.length,
|
|
176
|
+
...(rows.length === 0
|
|
177
|
+
? {
|
|
178
|
+
reason: changedFiles.length === 0
|
|
179
|
+
? 'no changed files in the diff scope'
|
|
180
|
+
: 'nothing in the diff is governed by a boundary rule or read by import hygiene',
|
|
181
|
+
}
|
|
182
|
+
: {}),
|
|
183
|
+
...allowEmptyValve(args, rows.length),
|
|
184
|
+
};
|
|
185
|
+
const proposed = rows.some((r) => r.status === 'failed') ? ExitCode.Failure : ExitCode.VerifiedPass;
|
|
186
|
+
const env = buildGateEnvelope('diff-check', proposed, rows, runCoverage);
|
|
187
|
+
const exit = env.exit;
|
|
188
|
+
const bErr = boundaryBlock.counts.error;
|
|
189
|
+
const bWarn = boundaryBlock.counts.warning;
|
|
190
|
+
const bErrored = (boundaryBlock.loadIssues?.length ?? 0) + (boundaryBlock.staleExceptions?.length ?? 0);
|
|
191
|
+
const iErr = importsBlock.verdict === 'errors' ? (importsBlock.counts.error ?? importsBlock.findings.length) : 0;
|
|
192
|
+
const iWarn = importsBlock.verdict === 'warnings' ? (importsBlock.counts.warning ?? importsBlock.findings.length) : 0;
|
|
193
|
+
let verdict;
|
|
194
|
+
let summary;
|
|
195
|
+
let nextAction;
|
|
196
|
+
if (exit === ExitCode.Failure) {
|
|
197
|
+
const parts = [];
|
|
198
|
+
if (bErr > 0)
|
|
199
|
+
parts.push(plural(bErr, 'boundary violation'));
|
|
200
|
+
if (bErrored > 0)
|
|
201
|
+
parts.push(plural(bErrored, 'errored boundary rule / stale exception'));
|
|
202
|
+
if (iErr > 0)
|
|
203
|
+
parts.push(plural(iErr, 'import-hygiene error'));
|
|
204
|
+
verdict = 'errors';
|
|
205
|
+
summary = `Diff fails the gate: ${parts.join(', ') || 'see the failing check'}.`;
|
|
206
|
+
nextAction =
|
|
207
|
+
'Fix every error in `boundaries.violations` and `imports.findings` (look at each entry\'s `suggestedFix` line), then re-run `shrk diff-check`.';
|
|
208
|
+
}
|
|
209
|
+
else if (exit !== ExitCode.VerifiedPass) {
|
|
210
|
+
verdict = 'not-verified';
|
|
211
|
+
summary =
|
|
212
|
+
rows.length === 0
|
|
213
|
+
? changedFiles.length === 0
|
|
214
|
+
? 'No files changed in the current diff scope — nothing was checked (this is not a pass).'
|
|
215
|
+
: 'Nothing in the diff is governed by a boundary rule or read by import hygiene — nothing was checked (this is not a pass).'
|
|
216
|
+
: `Not verified: ${env.shortfalls.slice(0, 3).join('; ')} — this is NOT a pass.`;
|
|
217
|
+
nextAction =
|
|
218
|
+
rows.length === 0
|
|
219
|
+
? `Nothing was verified. If you expected changes, check your \`--staged\` / \`--since <ref>\` flag or save your edits first; pass --${ALLOW_EMPTY_FLAG} to accept an empty diff explicitly.`
|
|
220
|
+
: 'Part of the scope was never examined — fix the rule scope named above, then re-run `shrk diff-check`.';
|
|
221
|
+
}
|
|
222
|
+
else if (rows.length === 0) {
|
|
223
|
+
verdict = 'ok';
|
|
224
|
+
summary = 'Nothing to check — the empty diff was accepted explicitly.';
|
|
225
|
+
nextAction = 'Nothing was gated.';
|
|
226
|
+
}
|
|
227
|
+
else if (bWarn > 0 || iWarn > 0) {
|
|
228
|
+
const parts = [];
|
|
229
|
+
if (bWarn > 0)
|
|
230
|
+
parts.push(plural(bWarn, 'boundary warning'));
|
|
231
|
+
if (iWarn > 0)
|
|
232
|
+
parts.push(plural(iWarn, 'import-hygiene warning'));
|
|
233
|
+
verdict = 'warnings';
|
|
234
|
+
summary = `Diff passes the gate with ${parts.join(', ')}.`;
|
|
235
|
+
nextAction =
|
|
236
|
+
'Safe to declare done. Review warnings if the diff touches a sensitive area; otherwise these are non-blocking.';
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
verdict = 'ok';
|
|
240
|
+
summary = `Diff passes the gate (${plural(changedFiles.length, 'file')}, 0 violations).`;
|
|
241
|
+
nextAction = 'Safe to declare done.';
|
|
157
242
|
}
|
|
158
|
-
|
|
159
|
-
const partial = {
|
|
243
|
+
const envelope = {
|
|
160
244
|
schema: SCHEMA,
|
|
161
245
|
generatedAt: new Date().toISOString(),
|
|
162
|
-
scope: {
|
|
163
|
-
mode,
|
|
164
|
-
files: changedFiles,
|
|
165
|
-
fileCount: changedFiles.length,
|
|
166
|
-
},
|
|
246
|
+
scope: { mode, files: changedFiles, fileCount: changedFiles.length },
|
|
167
247
|
boundaries: boundaryBlock,
|
|
168
248
|
imports: importsBlock,
|
|
249
|
+
verdict,
|
|
250
|
+
summary,
|
|
251
|
+
nextAction,
|
|
252
|
+
exitCode: exit,
|
|
253
|
+
gate: env,
|
|
169
254
|
};
|
|
170
|
-
const { verdict, summary, nextAction } = deriveVerdict(partial);
|
|
171
|
-
const envelope = { ...partial, verdict, summary, nextAction };
|
|
172
255
|
// 5. Render.
|
|
173
256
|
if (wantJson) {
|
|
174
257
|
process.stdout.write(asJson(envelope) + '\n');
|
|
175
|
-
return
|
|
258
|
+
return exit;
|
|
176
259
|
}
|
|
177
260
|
process.stdout.write(header('Diff check'));
|
|
178
|
-
process.stdout.write(kv('scope', `${envelope.scope.mode} (${envelope.scope.fileCount
|
|
179
|
-
process.stdout.write(kv('boundaries',
|
|
180
|
-
? `${
|
|
181
|
-
:
|
|
182
|
-
process.stdout.write(kv('imports',
|
|
183
|
-
? `verdict=${
|
|
184
|
-
:
|
|
185
|
-
process.stdout.write(kv('verdict', envelope.verdict) + '\n');
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (
|
|
261
|
+
process.stdout.write(kv('scope', `${envelope.scope.mode} (${plural(envelope.scope.fileCount, 'file')})`) + '\n');
|
|
262
|
+
process.stdout.write(kv('boundaries', boundaryBlock.ran
|
|
263
|
+
? `${bErr} errors, ${bWarn} warnings${boundaryBlock.escalation ? ` — ${boundaryBlock.escalation.ruleIds.length} rule(s) escalated (${boundaryBlock.escalation.files.join(', ')} changed)` : ''}`
|
|
264
|
+
: `(not run — ${boundaryBlock.reason ?? 'nothing to check'})`) + '\n');
|
|
265
|
+
process.stdout.write(kv('imports', importsBlock.ran
|
|
266
|
+
? `verdict=${importsBlock.verdict} (${plural(importsBlock.findings.length, 'finding')})`
|
|
267
|
+
: `(not run — ${importsBlock.reason ?? 'nothing to check'})`) + '\n');
|
|
268
|
+
process.stdout.write(kv('verdict', `${envelope.verdict} (exit ${exit})`) + '\n');
|
|
269
|
+
if (exit === ExitCode.Failure)
|
|
270
|
+
process.stdout.write(`\n${summary}\n`);
|
|
271
|
+
if (boundaryBlock.violations.length > 0) {
|
|
189
272
|
process.stdout.write('\nBoundary violations:\n');
|
|
190
|
-
for (const v of
|
|
273
|
+
for (const v of boundaryBlock.violations.slice(0, 10)) {
|
|
191
274
|
const file = String(v.file ?? '');
|
|
192
275
|
const rule = String(v.ruleId ?? '');
|
|
193
276
|
const fix = v.suggestedFix ? ` — ${String(v.suggestedFix)}` : '';
|
|
194
277
|
process.stdout.write(bullet(`${rule} in ${file}${fix}`) + '\n');
|
|
195
278
|
}
|
|
196
|
-
if (
|
|
197
|
-
process.stdout.write(` … and ${
|
|
279
|
+
if (boundaryBlock.violations.length > 10) {
|
|
280
|
+
process.stdout.write(` … and ${boundaryBlock.violations.length - 10} more (pass --json for full list).\n`);
|
|
198
281
|
}
|
|
199
282
|
}
|
|
200
|
-
if (
|
|
283
|
+
if (importsBlock.findings.length > 0) {
|
|
201
284
|
process.stdout.write('\nImport findings:\n');
|
|
202
|
-
for (const f of
|
|
285
|
+
for (const f of importsBlock.findings.slice(0, 10)) {
|
|
203
286
|
const file = String(f.path ?? f.file ?? '');
|
|
204
287
|
const kind = String(f.kind ?? '');
|
|
205
288
|
process.stdout.write(bullet(`${kind} in ${file}`) + '\n');
|
|
206
289
|
}
|
|
207
|
-
if (
|
|
208
|
-
process.stdout.write(` … and ${
|
|
290
|
+
if (importsBlock.findings.length > 10) {
|
|
291
|
+
process.stdout.write(` … and ${importsBlock.findings.length - 10} more (pass --json for full list).\n`);
|
|
209
292
|
}
|
|
210
293
|
}
|
|
211
|
-
|
|
212
|
-
|
|
294
|
+
// The final line comes from the SETTLED verdict — the clean sentence only at 0.
|
|
295
|
+
const line = verdictLine(env, `${summary} ✓`, exit === ExitCode.NotVerified ? summary : undefined);
|
|
296
|
+
if (line)
|
|
297
|
+
process.stdout.write(`\n${line}\n`);
|
|
298
|
+
process.stdout.write(`\nNext: ${nextAction}\n`);
|
|
299
|
+
return exit;
|
|
213
300
|
},
|
|
214
301
|
};
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
import { type IDocReferenceResult } from '@shrkcrft/inspector';
|
|
1
2
|
import { type ICommandHandler } from '../command-registry.js';
|
|
3
|
+
import type { IVerdictCoverage } from '@shrkcrft/core';
|
|
4
|
+
/**
|
|
5
|
+
* What one doc-reference rule examined — shared by `docs references check` and
|
|
6
|
+
* the aggregate (`gates check`, `quality`), so both report the same scope.
|
|
7
|
+
*
|
|
8
|
+
* The unit is the id-shaped tokens the rule matched. Tokens it did NOT check
|
|
9
|
+
* were skipped by the rule's own config — an `exempt` id, an in-file
|
|
10
|
+
* `exemptMarker`, the `requireContext` gate — which is a deliberate narrowing,
|
|
11
|
+
* so it is accepted by that config and printed as such rather than silently
|
|
12
|
+
* shrinking the denominator.
|
|
13
|
+
*/
|
|
14
|
+
export declare function docReferenceCoverage(r: IDocReferenceResult): IVerdictCoverage;
|
|
2
15
|
export declare const docsReferencesCheckCommand: ICommandHandler;
|
|
3
16
|
export declare const docsReferencesExplainCommand: ICommandHandler;
|
|
4
17
|
export declare const docsReferencesListCommand: ICommandHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-references.command.d.ts","sourceRoot":"","sources":["../../src/commands/docs-references.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs-references.command.d.ts","sourceRoot":"","sources":["../../src/commands/docs-references.command.ts"],"names":[],"mappings":"AAmBA,OAAO,EAIL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAahC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,mBAAmB,GAAG,gBAAgB,CAQ7E;AAqLD,eAAO,MAAM,0BAA0B,EAAE,eA4LxC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,eAiF1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,eAoCvC,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,EAAE,eA2CnC,CAAC"}
|