@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
|
@@ -2,11 +2,48 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
3
|
import { buildAdoptionReport, buildCoverageReport, buildDriftReport, buildOnboardingAdoptionPlan, buildOnboardingPlan, buildQualityReport, buildReportSite, buildSafetyAudit, inspectSharkcraft, readAdoptionState, renderAdoptionReportHtml, renderAdoptionReportMarkdown, renderAdoptionReportText, renderDevSessionHtml, renderDevSessionFinalReport, renderImpactGraph, renderImpactHtml, renderImpactMarkdown, renderImpactText, renderReviewComment, renderReviewHtml, renderQualityHtml, renderSafetyHtml, scanDevSession, } from '@shrkcrft/inspector';
|
|
4
4
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
5
6
|
import { asJson } from "../output/format-output.js";
|
|
6
7
|
import { COMMAND_CATALOG } from "./command-catalog.js";
|
|
7
8
|
const VALID_FORMATS = new Set(['text', 'markdown', 'html', 'json']);
|
|
9
|
+
/** The render flags every `report` subverb shares (the handler usage's tail). */
|
|
10
|
+
const REPORT_FLAGS = '[--format text|markdown|html|json] [--output <path>] [--collapse-long-sections] [--max-items N] [--json]';
|
|
8
11
|
export const reportCommand = {
|
|
9
12
|
name: 'report',
|
|
13
|
+
positionals: PositionalMode.None,
|
|
14
|
+
subverbs: [
|
|
15
|
+
{ name: 'adoption', description: 'Adoption report.', usage: `shrk report adoption ${REPORT_FLAGS}` },
|
|
16
|
+
{
|
|
17
|
+
name: 'session',
|
|
18
|
+
description: 'Render one dev session.',
|
|
19
|
+
usage: 'shrk report session <id> [--format html|markdown|json]',
|
|
20
|
+
positionals: PositionalMode.Free,
|
|
21
|
+
},
|
|
22
|
+
{ name: 'quality', description: 'Quality-gate report.', usage: `shrk report quality ${REPORT_FLAGS}` },
|
|
23
|
+
{ name: 'safety', description: 'Safety-model report.', usage: `shrk report safety ${REPORT_FLAGS}` },
|
|
24
|
+
{
|
|
25
|
+
name: 'review',
|
|
26
|
+
description: 'Render a saved review packet.',
|
|
27
|
+
usage: 'shrk report review <packet.json> [--format html|markdown|json]',
|
|
28
|
+
positionals: PositionalMode.Path,
|
|
29
|
+
},
|
|
30
|
+
{ name: 'coverage', description: 'Coverage report.', usage: `shrk report coverage ${REPORT_FLAGS}` },
|
|
31
|
+
{ name: 'drift', description: 'Drift report.', usage: `shrk report drift ${REPORT_FLAGS}` },
|
|
32
|
+
{ name: 'graph', description: 'Knowledge-graph report.', usage: `shrk report graph ${REPORT_FLAGS}` },
|
|
33
|
+
{ name: 'site', description: 'Write the static report site (under .sharkcraft/reports/site).', usage: `shrk report site ${REPORT_FLAGS}` },
|
|
34
|
+
{
|
|
35
|
+
name: 'impact',
|
|
36
|
+
description: 'Render a saved impact report.',
|
|
37
|
+
usage: 'shrk report impact <impact-report.json> [--format html|markdown|text|json] [--include-graph [--graph-format mermaid|dot]]',
|
|
38
|
+
positionals: PositionalMode.Path,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'language',
|
|
42
|
+
aliases: ['languages'],
|
|
43
|
+
description: 'Polyglot language report.',
|
|
44
|
+
usage: `shrk report language ${REPORT_FLAGS}`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
10
47
|
description: 'Render runtime reports in text / markdown / html / json. Subcommands: adoption / session / quality / safety / review / coverage / drift / graph.',
|
|
11
48
|
usage: 'shrk report <adoption|session <id>|quality|safety|review <packet.json>|coverage|drift|graph> [--format text|markdown|html|json] [--output <path>] [--collapse-long-sections] [--max-items N] [--json]',
|
|
12
49
|
async run(args) {
|
|
@@ -265,8 +302,7 @@ async function reportSession(args) {
|
|
|
265
302
|
async function reportQuality(args) {
|
|
266
303
|
const cwd = resolveCwd(args);
|
|
267
304
|
const inspection = await inspectSharkcraft({ cwd });
|
|
268
|
-
const
|
|
269
|
-
const cfg = cfgUnknown?.qualityGates ?? {};
|
|
305
|
+
const cfg = inspection.config?.qualityGates ?? {};
|
|
270
306
|
const report = await buildQualityReport({
|
|
271
307
|
inspection,
|
|
272
308
|
config: cfg,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const REUSE_COVERAGE_SCHEMA: "sharkcraft.reuse-coverage/v1";
|
|
3
|
+
/**
|
|
4
|
+
* `shrk reuse coverage` — curated `reusePrimitives[]` vs the real public export
|
|
5
|
+
* surface, so curation drift is a number instead of a silence.
|
|
6
|
+
*
|
|
7
|
+
* Every number comes from an existing authority: the surface from the graph
|
|
8
|
+
* (`GraphQueryApi.publicExportSurface()`), freshness from
|
|
9
|
+
* `detectGraphFreshness` (source files AND workspace package entries), each
|
|
10
|
+
* curated entry's construct, import line and "would it compile?" from
|
|
11
|
+
* `resolveCuratedReuse` (the record `shrk reuse` prints the row from), and
|
|
12
|
+
* "is this a curation gap?" from the lookup's own ranker and gap predicate — so
|
|
13
|
+
* this report and `shrk reuse` cannot disagree.
|
|
14
|
+
*
|
|
15
|
+
* Exit: 0 clean (curation gaps and off-surface entries are warnings) · 1 a dead
|
|
16
|
+
* curated entry, an `importPath` that does not expose its symbol,
|
|
17
|
+
* `--min-coverage` unmet, or `--strict` with any warning · 2 nothing measured
|
|
18
|
+
* (no or stale index — a changed file or a changed package entry —, a package
|
|
19
|
+
* with no resolved entry or a local re-export the index could not follow,
|
|
20
|
+
* nothing to measure) · 3 usage.
|
|
21
|
+
*/
|
|
22
|
+
export declare const reuseCoverageCommand: ICommandHandler;
|
|
23
|
+
//# sourceMappingURL=reuse-coverage.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reuse-coverage.command.d.ts","sourceRoot":"","sources":["../../src/commands/reuse-coverage.command.ts"],"names":[],"mappings":"AAgBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAWhC,eAAO,MAAM,qBAAqB,EAAG,8BAAuC,CAAC;AAyB7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAoUlC,CAAC"}
|
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
import { GraphQueryApi, detectGraphFreshness, detectWorkspacePackages } from '@shrkcrft/graph';
|
|
2
|
+
import { computeReuseCoverage, resolveProjectConfig, ReuseCuratedStatus, } from '@shrkcrft/inspector';
|
|
3
|
+
import { ReuseMatchSource, ReuseNameMatch, UnfollowedReExportKind, } from '@shrkcrft/core';
|
|
4
|
+
import { firstUnknownFlag, flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { GLOBAL_FLAGS, IMPLICIT_FLAGS } from "../dispatch/global-flags.js";
|
|
6
|
+
import { unknownFlagRefusal } from "../dispatch/unknown-flag-refusal.js";
|
|
7
|
+
import { ExitCode } from "../exit-codes.js";
|
|
8
|
+
import { ALLOW_EMPTY_FLAG, allowEmptyValve } from "../gates/allow-empty.js";
|
|
9
|
+
import { buildGateEnvelope } from "../gates/gate-envelope.js";
|
|
10
|
+
import { planeVerdictForExit } from "../gates/plane-verdict.js";
|
|
11
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
12
|
+
import { graphReuseLookup } from "../graph/graph-reuse-lookup.js";
|
|
13
|
+
import { asJson, header } from "../output/format-output.js";
|
|
14
|
+
export const REUSE_COVERAGE_SCHEMA = 'sharkcraft.reuse-coverage/v1';
|
|
15
|
+
const REUSE_COVERAGE_FLAGS = new Set([
|
|
16
|
+
'json',
|
|
17
|
+
'all',
|
|
18
|
+
'include-types',
|
|
19
|
+
'min-coverage',
|
|
20
|
+
'package',
|
|
21
|
+
'strict',
|
|
22
|
+
ALLOW_EMPTY_FLAG,
|
|
23
|
+
// Every dispatcher global (THE list) — a direct handler call may carry them.
|
|
24
|
+
...GLOBAL_FLAGS,
|
|
25
|
+
]);
|
|
26
|
+
const USAGE = 'shrk reuse coverage [--json] [--all] [--include-types] [--min-coverage <pct>] [--package <name>[,<name>…]] [--strict] [--allow-empty]';
|
|
27
|
+
/** Hints per off-surface status: what to change so the entry is importable. */
|
|
28
|
+
const OFF_SURFACE_HINT = {
|
|
29
|
+
[ReuseCuratedStatus.ExportedNotPublic]: 'Re-export it from its package entry, or point importPath at the module that exports it.',
|
|
30
|
+
[ReuseCuratedStatus.NotExported]: 'Export it, or remove the entry.',
|
|
31
|
+
[ReuseCuratedStatus.Ambiguous]: 'Set importPath so the entry names one declaration.',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* `shrk reuse coverage` — curated `reusePrimitives[]` vs the real public export
|
|
35
|
+
* surface, so curation drift is a number instead of a silence.
|
|
36
|
+
*
|
|
37
|
+
* Every number comes from an existing authority: the surface from the graph
|
|
38
|
+
* (`GraphQueryApi.publicExportSurface()`), freshness from
|
|
39
|
+
* `detectGraphFreshness` (source files AND workspace package entries), each
|
|
40
|
+
* curated entry's construct, import line and "would it compile?" from
|
|
41
|
+
* `resolveCuratedReuse` (the record `shrk reuse` prints the row from), and
|
|
42
|
+
* "is this a curation gap?" from the lookup's own ranker and gap predicate — so
|
|
43
|
+
* this report and `shrk reuse` cannot disagree.
|
|
44
|
+
*
|
|
45
|
+
* Exit: 0 clean (curation gaps and off-surface entries are warnings) · 1 a dead
|
|
46
|
+
* curated entry, an `importPath` that does not expose its symbol,
|
|
47
|
+
* `--min-coverage` unmet, or `--strict` with any warning · 2 nothing measured
|
|
48
|
+
* (no or stale index — a changed file or a changed package entry —, a package
|
|
49
|
+
* with no resolved entry or a local re-export the index could not follow,
|
|
50
|
+
* nothing to measure) · 3 usage.
|
|
51
|
+
*/
|
|
52
|
+
export const reuseCoverageCommand = {
|
|
53
|
+
name: 'coverage',
|
|
54
|
+
description: 'Curated reusePrimitives[] vs the real public export surface: curated count against exported count, dead curated entries (symbol declared nowhere), importPaths that do not expose their symbol, curated entries no package entry exposes, and curation GAPS — exported names the reuse lookup answers with a different curated entry. NOT VERIFIED (exit 2) over a missing/stale graph index (a changed file or package.json entry) or a package whose exports were not fully walked. Read-only; no AI.',
|
|
55
|
+
usage: USAGE,
|
|
56
|
+
booleanFlags: new Set(['json', 'all', 'include-types', 'strict', ALLOW_EMPTY_FLAG]),
|
|
57
|
+
async run(args) {
|
|
58
|
+
const bad = firstUnknownFlag(args, REUSE_COVERAGE_FLAGS);
|
|
59
|
+
if (bad !== undefined) {
|
|
60
|
+
// THE one refusal format (round 13) — the dispatcher's own wording.
|
|
61
|
+
const listed = [...REUSE_COVERAGE_FLAGS].filter((f) => !IMPLICIT_FLAGS.has(f));
|
|
62
|
+
const refusal = unknownFlagRefusal({
|
|
63
|
+
label: 'reuse coverage',
|
|
64
|
+
flags: [bad],
|
|
65
|
+
known: listed,
|
|
66
|
+
accepts: listed,
|
|
67
|
+
...(args.argv !== undefined ? { argv: args.argv } : {}),
|
|
68
|
+
exitCode: ExitCode.UsageError,
|
|
69
|
+
});
|
|
70
|
+
process.stderr.write(refusal.message);
|
|
71
|
+
return refusal.exitCode;
|
|
72
|
+
}
|
|
73
|
+
if (args.positional.length > 0) {
|
|
74
|
+
process.stderr.write(`'shrk reuse coverage' takes no positional argument (got "${args.positional[0]}"). Usage: ${USAGE}\n` +
|
|
75
|
+
' (To look up an intent that starts with the word "coverage", add words: shrk reuse "coverage chart widget".)\n');
|
|
76
|
+
return ExitCode.UsageError;
|
|
77
|
+
}
|
|
78
|
+
let minCoverage;
|
|
79
|
+
if (args.flags.has('min-coverage')) {
|
|
80
|
+
const raw = (flagString(args, 'min-coverage') ?? '').replace(/%$/, '').trim();
|
|
81
|
+
const n = raw.length > 0 ? Number(raw) : Number.NaN;
|
|
82
|
+
if (!Number.isFinite(n) || n < 0 || n > 100) {
|
|
83
|
+
process.stderr.write(`--min-coverage takes a percentage between 0 and 100 (got "${flagString(args, 'min-coverage') ?? ''}").\n`);
|
|
84
|
+
return ExitCode.UsageError;
|
|
85
|
+
}
|
|
86
|
+
minCoverage = n;
|
|
87
|
+
}
|
|
88
|
+
let packageFilter;
|
|
89
|
+
if (args.flags.has('package')) {
|
|
90
|
+
const raw = flagString(args, 'package') ?? '';
|
|
91
|
+
packageFilter = raw.split(',').map((s) => s.trim()).filter((s) => s.length > 0);
|
|
92
|
+
if (packageFilter.length === 0) {
|
|
93
|
+
process.stderr.write('--package takes one or more workspace package names (comma-separated).\n');
|
|
94
|
+
return ExitCode.UsageError;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const cwd = resolveCwd(args);
|
|
98
|
+
const wantJson = flagBool(args, 'json');
|
|
99
|
+
const strict = flagBool(args, 'strict');
|
|
100
|
+
const loaded = await resolveProjectConfig(cwd);
|
|
101
|
+
if (!loaded.ok) {
|
|
102
|
+
const msg = loaded.error.message;
|
|
103
|
+
if (wantJson) {
|
|
104
|
+
process.stdout.write(asJson({ schema: REUSE_COVERAGE_SCHEMA, error: msg, exitCode: ExitCode.UsageError }) + '\n');
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
process.stderr.write(`Could not load config: ${msg}\nRun \`shrk doctor\` for details.\n`);
|
|
108
|
+
}
|
|
109
|
+
return ExitCode.UsageError;
|
|
110
|
+
}
|
|
111
|
+
const primitives = loaded.value.config.reusePrimitives ?? [];
|
|
112
|
+
if (packageFilter !== undefined) {
|
|
113
|
+
// Validated against the workspace itself (the source the index's package
|
|
114
|
+
// nodes come from), so a typo is a usage error even with no index — a
|
|
115
|
+
// narrowing that names nothing must never read as "nothing to measure".
|
|
116
|
+
const known = new Set(detectWorkspacePackages(cwd).map((p) => p.name));
|
|
117
|
+
const unknown = packageFilter.filter((p) => !known.has(p));
|
|
118
|
+
if (unknown.length > 0) {
|
|
119
|
+
process.stderr.write(`Unknown workspace package(s) in --package: ${unknown.join(', ')}. Known: ${[...known].sort().join(', ') || '(none)'}.\n`);
|
|
120
|
+
return ExitCode.UsageError;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// ── Freshness first: a number derived from a stale index is not printed. ──
|
|
124
|
+
const fresh = detectGraphFreshness(cwd);
|
|
125
|
+
if (!fresh.hasIndex) {
|
|
126
|
+
return writeNotMeasured(args, primitives, wantJson, {
|
|
127
|
+
why: 'no graph index',
|
|
128
|
+
lead: 'There is no code-graph index (or it could not be read), so the public export surface was never measured — run `shrk graph index` and re-run.',
|
|
129
|
+
coverage: {
|
|
130
|
+
unit: 'graph index',
|
|
131
|
+
expected: 1,
|
|
132
|
+
examined: 0,
|
|
133
|
+
reason: 'no graph index (or one that could not be read) — run `shrk graph index`',
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
const changed = [...fresh.modified, ...fresh.added, ...fresh.deleted];
|
|
138
|
+
if (changed.length > 0) {
|
|
139
|
+
return writeNotMeasured(args, primitives, wantJson, {
|
|
140
|
+
why: `stale graph index (${changed.length} file(s) changed since it was built)`,
|
|
141
|
+
lead: `The code-graph index is ${changed.length} file(s) behind, so every count and percentage derived from it would be stale — run \`shrk graph index\` and re-run.`,
|
|
142
|
+
coverage: {
|
|
143
|
+
unit: 'changed files',
|
|
144
|
+
expected: changed.length,
|
|
145
|
+
examined: 0,
|
|
146
|
+
unexamined: changed.slice(0, 20),
|
|
147
|
+
unexaminedTotal: changed.length,
|
|
148
|
+
reason: 'not re-read since the graph index was built (run `shrk graph index`)',
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
// The package entries are the surface's ROOTS, and they come from
|
|
153
|
+
// package.json — which no source-file fingerprint covers. A main/module/types
|
|
154
|
+
// edit (or a package added/removed) moves the surface with every source file
|
|
155
|
+
// byte-identical, so it is checked on its own.
|
|
156
|
+
if (fresh.packagesChanged.length > 0) {
|
|
157
|
+
const pkgs = fresh.packagesChanged;
|
|
158
|
+
const shown = pkgs.slice(0, 5).join(', ') + (pkgs.length > 5 ? `, +${pkgs.length - 5} more` : '');
|
|
159
|
+
return writeNotMeasured(args, primitives, wantJson, {
|
|
160
|
+
why: `stale graph index (${pkgs.length} workspace package(s) changed since it was built)`,
|
|
161
|
+
lead: `The workspace packages changed since the code-graph index was built (${shown}) — a package.json entry ` +
|
|
162
|
+
'(main/module/types), the workspaces list, or a package added or removed — so the public surface the index ' +
|
|
163
|
+
'records is stale. Run `shrk graph index` and re-run.',
|
|
164
|
+
coverage: {
|
|
165
|
+
unit: 'workspace packages',
|
|
166
|
+
expected: pkgs.length,
|
|
167
|
+
examined: 0,
|
|
168
|
+
unexamined: pkgs.slice(0, 20),
|
|
169
|
+
unexaminedTotal: pkgs.length,
|
|
170
|
+
reason: 'changed since the graph index was built (a package.json entry, or the package set) — run `shrk graph index`',
|
|
171
|
+
},
|
|
172
|
+
details: { packagesChanged: pkgs },
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
const api = GraphQueryApi.fromStore(cwd);
|
|
176
|
+
const surface = api.publicExportSurface();
|
|
177
|
+
const report = computeReuseCoverage(primitives, surface, graphReuseLookup(api), {
|
|
178
|
+
includeTypes: flagBool(args, 'include-types'),
|
|
179
|
+
all: flagBool(args, 'all'),
|
|
180
|
+
...(packageFilter !== undefined ? { packageFilter } : {}),
|
|
181
|
+
});
|
|
182
|
+
// ── One rule per curated entry (+ the --min-coverage bar) ─────────────
|
|
183
|
+
const shadowsByAnswer = new Map();
|
|
184
|
+
for (const s of report.shadowed) {
|
|
185
|
+
const list = shadowsByAnswer.get(s.answeredBy);
|
|
186
|
+
if (list)
|
|
187
|
+
list.push(s);
|
|
188
|
+
else
|
|
189
|
+
shadowsByAnswer.set(s.answeredBy, [s]);
|
|
190
|
+
}
|
|
191
|
+
const rules = report.curated.map((c) => {
|
|
192
|
+
const violations = [];
|
|
193
|
+
let blocking = false;
|
|
194
|
+
if (c.status === ReuseCuratedStatus.NotFound) {
|
|
195
|
+
blocking = true;
|
|
196
|
+
violations.push({
|
|
197
|
+
id: c.symbol,
|
|
198
|
+
message: `curated symbol ${c.symbol} is declared nowhere in the index — a dead entry every \`shrk reuse\` answer still recommends`,
|
|
199
|
+
hint: 'Fix reusePrimitives[].symbol (a rename or a typo?) or remove the entry.',
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (c.importPathAgrees === false) {
|
|
203
|
+
blocking = true;
|
|
204
|
+
violations.push({
|
|
205
|
+
id: c.symbol,
|
|
206
|
+
message: `importPath '${c.importPath}' does not expose ${c.symbol} — the import line \`shrk reuse\` prints would not compile`,
|
|
207
|
+
...(c.publicIn.length > 0 ? { hint: `It is exported by: ${c.publicIn.join(', ')}.` } : {}),
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const offSurface = isOffSurface(c);
|
|
211
|
+
if (offSurface) {
|
|
212
|
+
const hint = OFF_SURFACE_HINT[c.status];
|
|
213
|
+
violations.push({
|
|
214
|
+
id: c.symbol,
|
|
215
|
+
message: `curated ${c.symbol} is ${c.status} — no workspace package entry exposes it, so the construct \`shrk reuse\` recommends cannot be imported from a package root`,
|
|
216
|
+
...(hint !== undefined ? { hint } : {}),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
const shadows = shadowsByAnswer.get(c.symbol) ?? [];
|
|
220
|
+
for (const s of shadows) {
|
|
221
|
+
violations.push({
|
|
222
|
+
id: s.export,
|
|
223
|
+
file: s.declaredIn,
|
|
224
|
+
message: `curation gap: the reuse lookup answers ${c.symbol} (${gapHow(s)}) for the name of ${s.export}, which ${s.package} exports`,
|
|
225
|
+
hint: `Add ${s.export} to reusePrimitives[], or list it in ${c.symbol}'s \`supersedes\`.`,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
const expected = 1 + (c.importPath !== undefined ? 1 : 0);
|
|
229
|
+
const examined = (c.statusMeasured ? 1 : 0) + (c.importPath !== undefined && c.importPathNote === undefined ? 1 : 0);
|
|
230
|
+
const notes = [c.statusNote, c.importPathNote].filter((n) => n !== undefined);
|
|
231
|
+
const coverage = {
|
|
232
|
+
unit: 'checks',
|
|
233
|
+
expected,
|
|
234
|
+
examined,
|
|
235
|
+
...(notes.length > 0 ? { reason: notes.join('; ') } : {}),
|
|
236
|
+
};
|
|
237
|
+
// Advisory (a curation gap, an entry no package root exposes) — unless
|
|
238
|
+
// `--strict` promotes warnings to failures.
|
|
239
|
+
const advisory = shadows.length > 0 || offSurface;
|
|
240
|
+
return {
|
|
241
|
+
id: c.symbol,
|
|
242
|
+
type: 'reuse',
|
|
243
|
+
status: violations.length > 0 ? 'failed' : 'passed',
|
|
244
|
+
severity: blocking || (strict && advisory) ? 'error' : advisory ? 'warning' : 'error',
|
|
245
|
+
counts: { public: c.publicIn.length, consumers: c.consumers ?? 0 },
|
|
246
|
+
violations,
|
|
247
|
+
coverage,
|
|
248
|
+
};
|
|
249
|
+
});
|
|
250
|
+
if (minCoverage !== undefined) {
|
|
251
|
+
const met = report.ratioValue !== undefined && report.ratioValue * 100 >= minCoverage;
|
|
252
|
+
rules.push({
|
|
253
|
+
id: 'min-coverage',
|
|
254
|
+
type: 'reuse',
|
|
255
|
+
status: met ? 'passed' : 'failed',
|
|
256
|
+
severity: 'error',
|
|
257
|
+
counts: { curatedPublicValue: report.curatedPublicValue, value: report.surface.value },
|
|
258
|
+
violations: met
|
|
259
|
+
? []
|
|
260
|
+
: [
|
|
261
|
+
{
|
|
262
|
+
id: 'min-coverage',
|
|
263
|
+
message: report.ratioValue === undefined
|
|
264
|
+
? `no value exports to measure a ratio over (--min-coverage ${minCoverage}%)`
|
|
265
|
+
: `coverage ${formatPct(report.ratioValue)} of value exports is below --min-coverage ${minCoverage}%`,
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
coverage: {
|
|
269
|
+
unit: 'value exports',
|
|
270
|
+
expected: report.surface.value,
|
|
271
|
+
examined: report.surface.value,
|
|
272
|
+
...(report.surface.value === 0 ? { reason: 'no value exports to measure a ratio over' } : {}),
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
// ── Run coverage: the packages whose exports were FULLY walked ─────────
|
|
277
|
+
// A package with no resolved entry was not walked at all; one whose walk met
|
|
278
|
+
// a local re-export the index could not follow was walked only in part.
|
|
279
|
+
const packagesInScope = report.surface.roots.length + report.surface.packagesWithoutEntry.length;
|
|
280
|
+
const nothingToMeasure = report.curated.length === 0 && report.surface.all === 0;
|
|
281
|
+
const noEntry = report.surface.packagesWithoutEntry.map((p) => p.package);
|
|
282
|
+
const partlyWalked = localUnfollowedByPackage(report.surface.unfollowedReExports);
|
|
283
|
+
const unexamined = [
|
|
284
|
+
...noEntry,
|
|
285
|
+
...[...partlyWalked].map(([pkg, list]) => `${pkg} (${describeUnfollowed(list)})`),
|
|
286
|
+
];
|
|
287
|
+
const runCoverage = nothingToMeasure
|
|
288
|
+
? {
|
|
289
|
+
unit: 'curated entries and public exports',
|
|
290
|
+
expected: 0,
|
|
291
|
+
examined: 0,
|
|
292
|
+
reason: 'no curated reusePrimitives[] and no public export under a resolved package entry',
|
|
293
|
+
...allowEmptyValve(args, 0),
|
|
294
|
+
}
|
|
295
|
+
: {
|
|
296
|
+
unit: 'workspace packages',
|
|
297
|
+
expected: packagesInScope,
|
|
298
|
+
examined: report.surface.roots.length - partlyWalked.size,
|
|
299
|
+
...(unexamined.length > 0
|
|
300
|
+
? {
|
|
301
|
+
unexamined: unexamined.slice(0, 20),
|
|
302
|
+
unexaminedTotal: unexamined.length,
|
|
303
|
+
reason: noEntry.length > 0 && partlyWalked.size > 0
|
|
304
|
+
? 'have no resolved entry, or re-export a local module or name the index could not follow, so (part of) their exports were not measured'
|
|
305
|
+
: noEntry.length > 0
|
|
306
|
+
? 'have no resolved entry, so their exports were not measured'
|
|
307
|
+
: 're-export a local module or name the index could not follow, so part of their exports was not measured',
|
|
308
|
+
}
|
|
309
|
+
: {}),
|
|
310
|
+
...(packagesInScope === 0 ? { reason: 'no workspace packages (package.json `workspaces`)' } : {}),
|
|
311
|
+
...allowEmptyValve(args, packagesInScope),
|
|
312
|
+
};
|
|
313
|
+
const blocking = rules.some((r) => r.status === 'failed' && r.severity === 'error');
|
|
314
|
+
const proposed = blocking ? ExitCode.Failure : ExitCode.VerifiedPass;
|
|
315
|
+
const env = buildGateEnvelope('reuse coverage', proposed, rules, runCoverage);
|
|
316
|
+
const exit = env.exit;
|
|
317
|
+
const warned = report.shadowed.length > 0 || report.curated.some(isOffSurface);
|
|
318
|
+
if (wantJson) {
|
|
319
|
+
process.stdout.write(asJson({
|
|
320
|
+
schema: REUSE_COVERAGE_SCHEMA,
|
|
321
|
+
measured: true,
|
|
322
|
+
...report,
|
|
323
|
+
...(minCoverage !== undefined ? { minCoverage } : {}),
|
|
324
|
+
exitCode: exit,
|
|
325
|
+
verdict: planeVerdictForExit(exit, warned ? 'warnings' : undefined),
|
|
326
|
+
gate: env,
|
|
327
|
+
}) + '\n');
|
|
328
|
+
return exit;
|
|
329
|
+
}
|
|
330
|
+
writeReport(report, minCoverage);
|
|
331
|
+
if (exit === ExitCode.NotVerified) {
|
|
332
|
+
if (nothingToMeasure) {
|
|
333
|
+
process.stdout.write('\nNothing to measure: no curated reusePrimitives[] and no public exports.\n' +
|
|
334
|
+
'Pass --allow-empty to accept an empty scope explicitly.\n');
|
|
335
|
+
}
|
|
336
|
+
else if (packagesInScope === 0) {
|
|
337
|
+
process.stdout.write('\nNo workspace packages: there is no package root to measure a public surface from.\n' +
|
|
338
|
+
'Pass --allow-empty to accept an empty scope explicitly.\n');
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
if (noEntry.length > 0) {
|
|
342
|
+
process.stdout.write(`\n${noEntry.length} workspace package(s) have no resolved entry, so their exports were NOT measured and every ratio above is partial —\n` +
|
|
343
|
+
'give them an entry (package.json main, or src/index.ts), re-run `shrk graph index`, or narrow with --package.\n');
|
|
344
|
+
}
|
|
345
|
+
if (partlyWalked.size > 0) {
|
|
346
|
+
process.stdout.write(`\n${partlyWalked.size} workspace package(s) re-export a local module or name the index could not follow (listed above), so part of their exports was NOT measured —\n` +
|
|
347
|
+
'fix the specifier (or make the target indexable), re-run `shrk graph index`, or narrow with --package.\n');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const line = verdictLine(env, cleanSentence(report));
|
|
352
|
+
if (line)
|
|
353
|
+
process.stdout.write('\n' + line + '\n');
|
|
354
|
+
return exit;
|
|
355
|
+
},
|
|
356
|
+
};
|
|
357
|
+
/** How a gap's curated answer matched: a partial name hit, or metadata only. */
|
|
358
|
+
function gapHow(g) {
|
|
359
|
+
const via = g.matchedVia.filter((v) => v !== ReuseMatchSource.Symbol).join(', ');
|
|
360
|
+
return g.nameMatch === ReuseNameMatch.Partial
|
|
361
|
+
? `only part of its name${via ? `, plus ${via}` : ''}`
|
|
362
|
+
: `via ${via || 'metadata'} — not its name`;
|
|
363
|
+
}
|
|
364
|
+
/** A measured curated entry that exists but no package root exposes (a warning, not a dead entry). */
|
|
365
|
+
function isOffSurface(c) {
|
|
366
|
+
return c.statusMeasured && c.status !== ReuseCuratedStatus.Public && c.status !== ReuseCuratedStatus.NotFound;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* The exit-0 sentence, built from the report. The ✓ is earned only when every
|
|
370
|
+
* in-scope curated entry is public and nothing advisory was found — never over
|
|
371
|
+
* an empty curated set, and never over entries the report just listed as off
|
|
372
|
+
* the surface.
|
|
373
|
+
*/
|
|
374
|
+
function cleanSentence(report) {
|
|
375
|
+
const qualifiers = [];
|
|
376
|
+
if (report.shadowed.length > 0)
|
|
377
|
+
qualifiers.push(`${report.shadowed.length} curation gap(s)`);
|
|
378
|
+
const off = report.curated.filter((c) => c.status !== ReuseCuratedStatus.Public).length;
|
|
379
|
+
if (off > 0)
|
|
380
|
+
qualifiers.push(`${off} curated entr${off === 1 ? 'y' : 'ies'} not on the public surface`);
|
|
381
|
+
if (report.curated.length === 0) {
|
|
382
|
+
const scope = report.curatedOutOfScope > 0 ? ' in the --package scope' : '';
|
|
383
|
+
return `No curated reusePrimitives[]${scope} — 0 of ${report.surface.value} value export(s) curated.`;
|
|
384
|
+
}
|
|
385
|
+
if (qualifiers.length > 0)
|
|
386
|
+
return `No blocking reuse coverage problems — ${qualifiers.join(', ')} (listed above).`;
|
|
387
|
+
return 'Every curated reuse entry resolves on the public surface. ✓';
|
|
388
|
+
}
|
|
389
|
+
/** Local (not external) unfollowed re-exports, grouped by the package whose walk met them. */
|
|
390
|
+
function localUnfollowedByPackage(unfollowed) {
|
|
391
|
+
const out = new Map();
|
|
392
|
+
for (const u of unfollowed) {
|
|
393
|
+
if (u.kind !== UnfollowedReExportKind.Unresolved)
|
|
394
|
+
continue;
|
|
395
|
+
const list = out.get(u.package);
|
|
396
|
+
if (list)
|
|
397
|
+
list.push(u);
|
|
398
|
+
else
|
|
399
|
+
out.set(u.package, [u]);
|
|
400
|
+
}
|
|
401
|
+
return out;
|
|
402
|
+
}
|
|
403
|
+
function describeUnfollowed(list) {
|
|
404
|
+
const shown = list.slice(0, 2).map(formatUnfollowed).join(', ');
|
|
405
|
+
return `${list.length} re-export(s) not followed: ${shown}${list.length > 2 ? `, +${list.length - 2} more` : ''}`;
|
|
406
|
+
}
|
|
407
|
+
function formatUnfollowed(u) {
|
|
408
|
+
return `${u.file} → '${u.specifier}'${u.name === '*' ? ' (export *)' : ` { ${u.name} }`}`;
|
|
409
|
+
}
|
|
410
|
+
/** No (or a stale) index: every rule is skipped, no number is printed, exit settles to 2. */
|
|
411
|
+
function writeNotMeasured(args, primitives, wantJson, o) {
|
|
412
|
+
const rules = primitives.map((p) => ({
|
|
413
|
+
id: p.symbol,
|
|
414
|
+
type: 'reuse',
|
|
415
|
+
status: 'skipped',
|
|
416
|
+
severity: 'error',
|
|
417
|
+
counts: { public: 0, consumers: 0 },
|
|
418
|
+
violations: [],
|
|
419
|
+
skipReason: o.why,
|
|
420
|
+
coverage: {
|
|
421
|
+
unit: 'checks',
|
|
422
|
+
expected: 1 + (p.importPath !== undefined ? 1 : 0),
|
|
423
|
+
examined: 0,
|
|
424
|
+
reason: o.why,
|
|
425
|
+
},
|
|
426
|
+
}));
|
|
427
|
+
// Rule #4 of the keystone: propose 2 only when something SELECTED went
|
|
428
|
+
// unexamined; an empty selection proposes 0 and the run coverage settles it.
|
|
429
|
+
const proposed = rules.length > 0 ? ExitCode.NotVerified : ExitCode.VerifiedPass;
|
|
430
|
+
const env = buildGateEnvelope('reuse coverage', proposed, rules, {
|
|
431
|
+
...o.coverage,
|
|
432
|
+
...allowEmptyValve(args, o.coverage.expected),
|
|
433
|
+
});
|
|
434
|
+
const exit = env.exit;
|
|
435
|
+
if (wantJson) {
|
|
436
|
+
process.stdout.write(asJson({
|
|
437
|
+
schema: REUSE_COVERAGE_SCHEMA,
|
|
438
|
+
measured: false,
|
|
439
|
+
reason: o.why,
|
|
440
|
+
...(o.details ?? {}),
|
|
441
|
+
curatedCount: primitives.length,
|
|
442
|
+
exitCode: exit,
|
|
443
|
+
verdict: planeVerdictForExit(exit),
|
|
444
|
+
gate: env,
|
|
445
|
+
}) + '\n');
|
|
446
|
+
return exit;
|
|
447
|
+
}
|
|
448
|
+
process.stdout.write(header('Reuse coverage'));
|
|
449
|
+
process.stdout.write(` curated ${primitives.length} · public exports NOT VERIFIED · coverage NOT VERIFIED — ${o.why}\n`);
|
|
450
|
+
// verdictLine already leads the NOT VERIFIED line with `o.lead`.
|
|
451
|
+
const line = verdictLine(env, '', o.lead);
|
|
452
|
+
if (line)
|
|
453
|
+
process.stdout.write('\n' + line + '\n');
|
|
454
|
+
return exit;
|
|
455
|
+
}
|
|
456
|
+
function writeReport(report, minCoverage) {
|
|
457
|
+
const s = report.surface;
|
|
458
|
+
const localUnfollowed = s.unfollowedReExports.filter((u) => u.kind === UnfollowedReExportKind.Unresolved);
|
|
459
|
+
const partial = s.packagesWithoutEntry.length > 0 || localUnfollowed.length > 0 ? ' (partial)' : '';
|
|
460
|
+
const ratio = report.ratioValue === undefined
|
|
461
|
+
? 'coverage n/a (no value exports)'
|
|
462
|
+
: `coverage ${report.curatedPublicValue}/${s.value} value (${formatPct(report.ratioValue)})${partial}`;
|
|
463
|
+
process.stdout.write(header('Reuse coverage'));
|
|
464
|
+
process.stdout.write(` curated ${report.curated.length} · public exports ${s.all} (value ${s.value}) · ${ratio} · ` +
|
|
465
|
+
`${s.packagesWithoutEntry.length} package(s) without a resolved entry` +
|
|
466
|
+
`${s.unfollowedReExports.length > 0 ? ` · ${s.unfollowedReExports.length} re-export(s) not followed` : ''}\n`);
|
|
467
|
+
if (report.curatedOutOfScope > 0) {
|
|
468
|
+
process.stdout.write(` (${report.curatedOutOfScope} curated entr${report.curatedOutOfScope === 1 ? 'y' : 'ies'} outside --package, not checked)\n`);
|
|
469
|
+
}
|
|
470
|
+
if (minCoverage !== undefined)
|
|
471
|
+
process.stdout.write(` --min-coverage ${minCoverage}%\n`);
|
|
472
|
+
const dead = report.curated.filter((c) => c.status === ReuseCuratedStatus.NotFound);
|
|
473
|
+
if (dead.length > 0) {
|
|
474
|
+
process.stdout.write(`\nDead curated entries — the symbol is declared nowhere (${dead.length}):\n`);
|
|
475
|
+
for (const c of dead)
|
|
476
|
+
process.stdout.write(` ✗ ${c.symbol}\n`);
|
|
477
|
+
}
|
|
478
|
+
const mismatched = report.curated.filter((c) => c.importPathAgrees === false);
|
|
479
|
+
if (mismatched.length > 0) {
|
|
480
|
+
process.stdout.write(`\nimportPath mismatches — the printed import would not compile (${mismatched.length}):\n`);
|
|
481
|
+
for (const c of mismatched) {
|
|
482
|
+
process.stdout.write(` ✗ ${c.symbol} — '${c.importPath}' does not expose it${c.publicIn.length > 0 ? ` (exported by ${c.publicIn.join(', ')})` : ''}\n`);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
const unverified = report.curated.filter((c) => c.statusNote !== undefined || c.importPathNote !== undefined);
|
|
486
|
+
if (unverified.length > 0) {
|
|
487
|
+
process.stdout.write(`\nNot verified (${unverified.length}):\n`);
|
|
488
|
+
for (const c of unverified) {
|
|
489
|
+
for (const n of [c.statusNote, c.importPathNote])
|
|
490
|
+
if (n)
|
|
491
|
+
process.stdout.write(` ~ ${c.symbol} — ${n}\n`);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
const offSurface = report.curated.filter((c) => c.status !== ReuseCuratedStatus.Public && c.status !== ReuseCuratedStatus.NotFound);
|
|
495
|
+
if (offSurface.length > 0) {
|
|
496
|
+
process.stdout.write(`\nCurated entries not on the public surface (${offSurface.length}):\n`);
|
|
497
|
+
for (const c of offSurface) {
|
|
498
|
+
process.stdout.write(` • ${c.symbol} — ${c.status}${c.declaredIn.length > 0 ? ` (${c.declaredIn.join(', ')})` : ''}\n`);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
if (report.shadowed.length > 0) {
|
|
502
|
+
process.stdout.write(`\nCuration gaps — an exported name the reuse lookup answers with a curated entry that names it only in part, or not at all (${report.shadowed.length}):\n`);
|
|
503
|
+
for (const g of report.shadowed) {
|
|
504
|
+
process.stdout.write(` ! ${g.export} (${g.package}) → answered by ${g.answeredBy} (${gapHow(g)})\n`);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
if (report.superseded.length > 0) {
|
|
508
|
+
process.stdout.write(`\nSuperseded on purpose (${report.superseded.length}):\n`);
|
|
509
|
+
for (const x of report.superseded) {
|
|
510
|
+
process.stdout.write(` • ${x.export} (${x.package}) → ${x.supersededBy.join(', ')}\n`);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (report.uncoveredTotal > 0) {
|
|
514
|
+
const shown = report.uncovered.length;
|
|
515
|
+
process.stdout.write(`\nUncovered public exports (${shown === report.uncoveredTotal ? report.uncoveredTotal : `${shown} of ${report.uncoveredTotal} shown; --all for every one`}):\n`);
|
|
516
|
+
for (const u of report.uncovered)
|
|
517
|
+
process.stdout.write(` • ${u.name} (${u.package} · ${u.declKind})\n`);
|
|
518
|
+
}
|
|
519
|
+
if (s.packagesWithoutEntry.length > 0) {
|
|
520
|
+
process.stdout.write(`\nPackages without a resolved entry — NOT measured (${s.packagesWithoutEntry.length}):\n`);
|
|
521
|
+
for (const p of s.packagesWithoutEntry)
|
|
522
|
+
process.stdout.write(` ~ ${p.package} — ${p.reason}\n`);
|
|
523
|
+
}
|
|
524
|
+
if (s.unfollowedReExports.length > 0) {
|
|
525
|
+
const external = s.unfollowedReExports.length - localUnfollowed.length;
|
|
526
|
+
process.stdout.write(`\n${s.unfollowedReExports.length} re-export(s) not followed — ${localUnfollowed.length} local (part of the surface NOT measured), ${external} external (outside the workspace):\n`);
|
|
527
|
+
for (const u of s.unfollowedReExports.slice(0, 20)) {
|
|
528
|
+
process.stdout.write(` ${u.kind === UnfollowedReExportKind.Unresolved ? '~' : '•'} ${formatUnfollowed(u)} — ${u.kind} (${u.package})\n`);
|
|
529
|
+
}
|
|
530
|
+
if (s.unfollowedReExports.length > 20)
|
|
531
|
+
process.stdout.write(` … +${s.unfollowedReExports.length - 20} more\n`);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function formatPct(ratio) {
|
|
535
|
+
return `${Math.round(ratio * 1000) / 10}%`;
|
|
536
|
+
}
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import type { IReusePrimitive } from '@shrkcrft/core';
|
|
2
1
|
import { type ICommandHandler } from '../command-registry.js';
|
|
3
|
-
/** A weak (below-confidence) candidate offered as a did-you-mean, never as an answer. */
|
|
4
|
-
interface IReuseSuggestion {
|
|
5
|
-
symbol: string;
|
|
6
|
-
score: number;
|
|
7
|
-
confidence: number;
|
|
8
|
-
matched: readonly string[];
|
|
9
|
-
roles: readonly string[];
|
|
10
|
-
}
|
|
11
2
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* did-you-mean suggestions. Pure — no graph, no IO — so it is directly
|
|
15
|
-
* unit-testable. When every candidate scores 0 (a nonsense intent that shares no
|
|
16
|
-
* term) the result is the alphabetically-first `k` primitives, each with
|
|
17
|
-
* `score: 0`; the caller states "no candidate shares any term" in that case
|
|
18
|
-
* rather than dumping the whole catalog.
|
|
3
|
+
* The did-you-mean ranker. The engine lives in `@shrkcrft/inspector` (pure, so
|
|
4
|
+
* a read-only MCP tool can call it); re-exported here for existing importers.
|
|
19
5
|
*/
|
|
20
|
-
export
|
|
6
|
+
export { rankReuseSuggestions } from '@shrkcrft/inspector';
|
|
21
7
|
export declare const reuseCommand: ICommandHandler;
|
|
22
|
-
export {};
|
|
23
8
|
//# sourceMappingURL=reuse.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reuse.command.d.ts","sourceRoot":"","sources":["../../src/commands/reuse.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reuse.command.d.ts","sourceRoot":"","sources":["../../src/commands/reuse.command.ts"],"names":[],"mappings":"AAuBA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAOhC;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AA2F3D,eAAO,MAAM,YAAY,EAAE,eAkR1B,CAAC"}
|