@shrkcrft/cli 0.1.0-alpha.29 → 0.1.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset-preview/apply-asset-preview.js +1 -1
- package/dist/authoring/authoring-kit.d.ts +9 -1
- package/dist/authoring/authoring-kit.d.ts.map +1 -1
- package/dist/authoring/authoring-kit.js +26 -13
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts +11 -0
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts.map +1 -0
- package/dist/bootstrap/unlinked-workspace-dependency.js +99 -0
- package/dist/command-registry.d.ts +100 -1
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +130 -3
- package/dist/commands/api-diff.command.d.ts.map +1 -1
- package/dist/commands/api-diff.command.js +12 -0
- package/dist/commands/apply.command.d.ts.map +1 -1
- package/dist/commands/apply.command.js +3 -0
- package/dist/commands/arch.command.d.ts.map +1 -1
- package/dist/commands/arch.command.js +26 -7
- package/dist/commands/architecture.command.d.ts.map +1 -1
- package/dist/commands/architecture.command.js +8 -2
- package/dist/commands/baseline.command.d.ts +76 -0
- package/dist/commands/baseline.command.d.ts.map +1 -1
- package/dist/commands/baseline.command.js +599 -75
- package/dist/commands/biome.command.d.ts.map +1 -1
- package/dist/commands/biome.command.js +20 -0
- package/dist/commands/boundaries.command.d.ts +9 -1
- package/dist/commands/boundaries.command.d.ts.map +1 -1
- package/dist/commands/boundaries.command.js +88 -20
- package/dist/commands/bundle.command.d.ts.map +1 -1
- package/dist/commands/bundle.command.js +57 -11
- package/dist/commands/cache-align.command.d.ts.map +1 -1
- package/dist/commands/cache-align.command.js +3 -1
- package/dist/commands/changelog-data.d.ts.map +1 -1
- package/dist/commands/changelog-data.js +164 -0
- package/dist/commands/changes.command.d.ts.map +1 -1
- package/dist/commands/changes.command.js +15 -0
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +1260 -324
- package/dist/commands/checks.command.d.ts.map +1 -1
- package/dist/commands/checks.command.js +188 -40
- package/dist/commands/ci.command.d.ts.map +1 -1
- package/dist/commands/ci.command.js +35 -2
- package/dist/commands/code-intel.command.d.ts.map +1 -1
- package/dist/commands/code-intel.command.js +8 -1
- package/dist/commands/command-catalog.d.ts +23 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +152 -35
- package/dist/commands/commands.command.d.ts +21 -3
- package/dist/commands/commands.command.d.ts.map +1 -1
- package/dist/commands/commands.command.js +172 -27
- package/dist/commands/compress.command.d.ts.map +1 -1
- package/dist/commands/compress.command.js +4 -0
- package/dist/commands/constructs.command.d.ts.map +1 -1
- package/dist/commands/constructs.command.js +50 -12
- package/dist/commands/context.command.d.ts.map +1 -1
- package/dist/commands/context.command.js +40 -5
- package/dist/commands/contract-templates.command.d.ts.map +1 -1
- package/dist/commands/contract-templates.command.js +9 -1
- package/dist/commands/contract.command.d.ts.map +1 -1
- package/dist/commands/contract.command.js +35 -0
- package/dist/commands/conventions.command.d.ts.map +1 -1
- package/dist/commands/conventions.command.js +189 -29
- package/dist/commands/coverage.command.d.ts.map +1 -1
- package/dist/commands/coverage.command.js +9 -0
- package/dist/commands/daily.commands.d.ts +0 -1
- package/dist/commands/daily.commands.d.ts.map +1 -1
- package/dist/commands/daily.commands.js +12 -76
- package/dist/commands/dashboard.command.d.ts.map +1 -1
- package/dist/commands/dashboard.command.js +10 -0
- package/dist/commands/dev.command.d.ts.map +1 -1
- package/dist/commands/dev.command.js +45 -2
- package/dist/commands/diagnostics.command.d.ts +0 -2
- package/dist/commands/diagnostics.command.d.ts.map +1 -1
- package/dist/commands/diagnostics.command.js +5 -78
- package/dist/commands/diff-check.command.d.ts +6 -4
- package/dist/commands/diff-check.command.d.ts.map +1 -1
- package/dist/commands/diff-check.command.js +190 -103
- package/dist/commands/docs-references.command.d.ts +20 -0
- package/dist/commands/docs-references.command.d.ts.map +1 -0
- package/dist/commands/docs-references.command.js +520 -0
- package/dist/commands/doctor.command.d.ts.map +1 -1
- package/dist/commands/doctor.command.js +60 -5
- package/dist/commands/drift.command.d.ts.map +1 -1
- package/dist/commands/drift.command.js +17 -4
- package/dist/commands/eslint.command.d.ts.map +1 -1
- package/dist/commands/eslint.command.js +20 -0
- package/dist/commands/export.command.d.ts.map +1 -1
- package/dist/commands/export.command.js +23 -1
- package/dist/commands/feedback-dispatch.command.d.ts.map +1 -1
- package/dist/commands/feedback-dispatch.command.js +29 -0
- package/dist/commands/feedback.command.d.ts.map +1 -1
- package/dist/commands/feedback.command.js +6 -1
- package/dist/commands/finish.command.d.ts.map +1 -1
- package/dist/commands/finish.command.js +32 -8
- package/dist/commands/fix.command.d.ts.map +1 -1
- package/dist/commands/fix.command.js +19 -0
- package/dist/commands/gate.command.d.ts +6 -1
- package/dist/commands/gate.command.d.ts.map +1 -1
- package/dist/commands/gate.command.js +50 -124
- package/dist/commands/gates.command.d.ts +54 -0
- package/dist/commands/gates.command.d.ts.map +1 -1
- package/dist/commands/gates.command.js +1314 -64
- package/dist/commands/gen.command.d.ts.map +1 -1
- package/dist/commands/gen.command.js +4 -0
- package/dist/commands/generated.command.d.ts +62 -0
- package/dist/commands/generated.command.d.ts.map +1 -1
- package/dist/commands/generated.command.js +639 -156
- package/dist/commands/graph-code-subverbs.d.ts +15 -0
- package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
- package/dist/commands/graph-code-subverbs.js +203 -25
- package/dist/commands/graph.command.d.ts.map +1 -1
- package/dist/commands/graph.command.js +79 -37
- package/dist/commands/help.command.d.ts +30 -6
- package/dist/commands/help.command.d.ts.map +1 -1
- package/dist/commands/help.command.js +323 -199
- package/dist/commands/helper.command.d.ts +1 -0
- package/dist/commands/helper.command.d.ts.map +1 -1
- package/dist/commands/helper.command.js +195 -56
- package/dist/commands/impact.command.d.ts.map +1 -1
- package/dist/commands/impact.command.js +115 -12
- package/dist/commands/infer.command.d.ts.map +1 -1
- package/dist/commands/infer.command.js +20 -45
- package/dist/commands/ingest.command.d.ts +0 -1
- package/dist/commands/ingest.command.d.ts.map +1 -1
- package/dist/commands/ingest.command.js +25 -41
- package/dist/commands/knowledge-author.command.d.ts +0 -3
- package/dist/commands/knowledge-author.command.d.ts.map +1 -1
- package/dist/commands/knowledge-author.command.js +10 -23
- package/dist/commands/knowledge.command.d.ts.map +1 -1
- package/dist/commands/knowledge.command.js +469 -129
- package/dist/commands/languages.command.d.ts.map +1 -1
- package/dist/commands/languages.command.js +27 -0
- package/dist/commands/lint.command.d.ts.map +1 -1
- package/dist/commands/lint.command.js +3 -0
- package/dist/commands/mcp.command.d.ts +18 -0
- package/dist/commands/mcp.command.d.ts.map +1 -1
- package/dist/commands/mcp.command.js +33 -8
- package/dist/commands/onboard.command.d.ts.map +1 -1
- package/dist/commands/onboard.command.js +20 -0
- package/dist/commands/owners.command.d.ts.map +1 -1
- package/dist/commands/owners.command.js +14 -2
- package/dist/commands/packs-new.d.ts +13 -1
- package/dist/commands/packs-new.d.ts.map +1 -1
- package/dist/commands/packs-new.js +500 -335
- package/dist/commands/packs.command.d.ts.map +1 -1
- package/dist/commands/packs.command.js +378 -36
- package/dist/commands/paths.command.d.ts.map +1 -1
- package/dist/commands/paths.command.js +9 -1
- package/dist/commands/pipelines.command.d.ts.map +1 -1
- package/dist/commands/pipelines.command.js +7 -1
- package/dist/commands/plan-check.command.d.ts.map +1 -1
- package/dist/commands/plan-check.command.js +3 -0
- package/dist/commands/plan.command.d.ts.map +1 -1
- package/dist/commands/plan.command.js +3 -0
- package/dist/commands/playbooks.command.d.ts.map +1 -1
- package/dist/commands/playbooks.command.js +7 -2
- package/dist/commands/policy-lint.command.d.ts +19 -2
- package/dist/commands/policy-lint.command.d.ts.map +1 -1
- package/dist/commands/policy-lint.command.js +224 -65
- package/dist/commands/policy.command.d.ts.map +1 -1
- package/dist/commands/policy.command.js +6 -1
- package/dist/commands/pr.command.d.ts.map +1 -1
- package/dist/commands/pr.command.js +14 -0
- package/dist/commands/presets.command.d.ts.map +1 -1
- package/dist/commands/presets.command.js +12 -27
- package/dist/commands/profiles.command.d.ts.map +1 -1
- package/dist/commands/profiles.command.js +94 -26
- package/dist/commands/provenance.command.js +1 -1
- package/dist/commands/quality.command.d.ts.map +1 -1
- package/dist/commands/quality.command.js +129 -33
- package/dist/commands/recommend.command.d.ts +20 -4
- package/dist/commands/recommend.command.d.ts.map +1 -1
- package/dist/commands/recommend.command.js +172 -278
- package/dist/commands/registrations.command.d.ts.map +1 -1
- package/dist/commands/registrations.command.js +138 -13
- package/dist/commands/registry-lifecycle-run.d.ts +14 -0
- package/dist/commands/registry-lifecycle-run.d.ts.map +1 -0
- package/dist/commands/registry-lifecycle-run.js +336 -0
- package/dist/commands/registry.command.d.ts.map +1 -1
- package/dist/commands/registry.command.js +235 -62
- package/dist/commands/release.command.d.ts.map +1 -1
- package/dist/commands/release.command.js +99 -20
- package/dist/commands/report.command.d.ts.map +1 -1
- package/dist/commands/report.command.js +38 -2
- package/dist/commands/reuse-coverage.command.d.ts +23 -0
- package/dist/commands/reuse-coverage.command.d.ts.map +1 -0
- package/dist/commands/reuse-coverage.command.js +536 -0
- package/dist/commands/reuse.command.d.ts +3 -18
- package/dist/commands/reuse.command.d.ts.map +1 -1
- package/dist/commands/reuse.command.js +395 -244
- package/dist/commands/review.command.d.ts.map +1 -1
- package/dist/commands/review.command.js +33 -1
- package/dist/commands/rounds.command.d.ts.map +1 -1
- package/dist/commands/rounds.command.js +5 -0
- package/dist/commands/safety.command.d.ts.map +1 -1
- package/dist/commands/safety.command.js +9 -0
- package/dist/commands/scaffolds.command.d.ts.map +1 -1
- package/dist/commands/scaffolds.command.js +97 -25
- package/dist/commands/search.command.d.ts +0 -8
- package/dist/commands/search.command.d.ts.map +1 -1
- package/dist/commands/search.command.js +136 -28
- package/dist/commands/self-config-xrefs.command.d.ts +24 -0
- package/dist/commands/self-config-xrefs.command.d.ts.map +1 -0
- package/dist/commands/self-config-xrefs.command.js +170 -0
- package/dist/commands/self-config.command.d.ts.map +1 -1
- package/dist/commands/self-config.command.js +261 -65
- package/dist/commands/smart-context.command.d.ts.map +1 -1
- package/dist/commands/smart-context.command.js +39 -3
- package/dist/commands/spec.command.d.ts.map +1 -1
- package/dist/commands/spec.command.js +3 -0
- package/dist/commands/stats.command.d.ts.map +1 -1
- package/dist/commands/stats.command.js +3 -0
- package/dist/commands/surface.command.d.ts +6 -1
- package/dist/commands/surface.command.d.ts.map +1 -1
- package/dist/commands/surface.command.js +256 -54
- package/dist/commands/task-context.command.js +1 -1
- package/dist/commands/task.command.d.ts.map +1 -1
- package/dist/commands/task.command.js +22 -1
- package/dist/commands/templates.command.d.ts +4 -0
- package/dist/commands/templates.command.d.ts.map +1 -1
- package/dist/commands/templates.command.js +109 -22
- package/dist/commands/test.command.d.ts.map +1 -1
- package/dist/commands/test.command.js +161 -33
- package/dist/commands/tests.command.d.ts.map +1 -1
- package/dist/commands/tests.command.js +29 -3
- package/dist/commands/trace.command.d.ts.map +1 -1
- package/dist/commands/trace.command.js +29 -4
- package/dist/commands/watch.command.d.ts.map +1 -1
- package/dist/commands/watch.command.js +3 -0
- package/dist/commands/why.command.d.ts.map +1 -1
- package/dist/commands/why.command.js +3 -0
- package/dist/commands/wiring.command.d.ts +18 -4
- package/dist/commands/wiring.command.d.ts.map +1 -1
- package/dist/commands/wiring.command.js +362 -74
- package/dist/dashboard/code-intelligence-data.js +4 -4
- package/dist/diff/deleted-orphan-coverage.d.ts +32 -0
- package/dist/diff/deleted-orphan-coverage.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-coverage.js +107 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts +23 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-scope-notes.js +49 -0
- package/dist/diff/deleted-orphans.d.ts +32 -0
- package/dist/diff/deleted-orphans.d.ts.map +1 -1
- package/dist/diff/deleted-orphans.js +42 -2
- package/dist/dispatch/closest-match.d.ts +15 -0
- package/dist/dispatch/closest-match.d.ts.map +1 -0
- package/dist/dispatch/closest-match.js +47 -0
- package/dist/dispatch/global-flags.d.ts +94 -0
- package/dist/dispatch/global-flags.d.ts.map +1 -0
- package/dist/dispatch/global-flags.js +123 -0
- package/dist/dispatch/guard-invocation-input.d.ts +24 -0
- package/dist/dispatch/guard-invocation-input.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation-input.js +1 -0
- package/dist/dispatch/guard-invocation.d.ts +33 -0
- package/dist/dispatch/guard-invocation.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation.js +183 -0
- package/dist/dispatch/help-intercept.d.ts +22 -0
- package/dist/dispatch/help-intercept.d.ts.map +1 -0
- package/dist/dispatch/help-intercept.js +42 -0
- package/dist/dispatch/i-declared-invocation.d.ts +17 -0
- package/dist/dispatch/i-declared-invocation.d.ts.map +1 -0
- package/dist/dispatch/i-declared-invocation.js +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts +28 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts.map +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.js +1 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts +15 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection-kind.js +15 -0
- package/dist/dispatch/invocation-rejection.d.ts +18 -0
- package/dist/dispatch/invocation-rejection.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection.js +1 -0
- package/dist/dispatch/judge-invocation.d.ts +24 -0
- package/dist/dispatch/judge-invocation.d.ts.map +1 -0
- package/dist/dispatch/judge-invocation.js +50 -0
- package/dist/dispatch/positional-mode.d.ts +18 -0
- package/dist/dispatch/positional-mode.d.ts.map +1 -0
- package/dist/dispatch/positional-mode.js +18 -0
- package/dist/dispatch/read-tracking-map.d.ts +28 -0
- package/dist/dispatch/read-tracking-map.d.ts.map +1 -0
- package/dist/dispatch/read-tracking-map.js +58 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts +30 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts.map +1 -0
- package/dist/dispatch/refuse-sibling-valve-flags.js +65 -0
- package/dist/dispatch/subverb-spec.d.ts +26 -0
- package/dist/dispatch/subverb-spec.d.ts.map +1 -0
- package/dist/dispatch/subverb-spec.js +1 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts +22 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts.map +1 -0
- package/dist/dispatch/undocumented-flag-reads.js +283 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts +13 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal-mode.js +13 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts +22 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal.js +57 -0
- package/dist/dispatch/unread-flags.d.ts +152 -0
- package/dist/dispatch/unread-flags.d.ts.map +1 -0
- package/dist/dispatch/unread-flags.js +295 -0
- package/dist/dispatch/verdict-valve-flag.d.ts +21 -0
- package/dist/dispatch/verdict-valve-flag.d.ts.map +1 -0
- package/dist/dispatch/verdict-valve-flag.js +21 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts +14 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts.map +1 -0
- package/dist/dispatch/walk-declared-subverbs.js +28 -0
- package/dist/exit-codes.d.ts +41 -3
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +153 -14
- package/dist/finish/run-finish.d.ts +72 -5
- package/dist/finish/run-finish.d.ts.map +1 -1
- package/dist/finish/run-finish.js +453 -104
- package/dist/gates/accepted-empty-note.d.ts +10 -0
- package/dist/gates/accepted-empty-note.d.ts.map +1 -0
- package/dist/gates/accepted-empty-note.js +11 -0
- package/dist/gates/allow-empty.d.ts +25 -0
- package/dist/gates/allow-empty.d.ts.map +1 -0
- package/dist/gates/allow-empty.js +27 -0
- package/dist/gates/asset-doctor-failing-units.d.ts +16 -0
- package/dist/gates/asset-doctor-failing-units.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failing-units.js +14 -0
- package/dist/gates/asset-doctor-failure-line.d.ts +16 -0
- package/dist/gates/asset-doctor-failure-line.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failure-line.js +28 -0
- package/dist/gates/empty-rule-advice-lines.d.ts +15 -0
- package/dist/gates/empty-rule-advice-lines.d.ts.map +1 -0
- package/dist/gates/empty-rule-advice-lines.js +20 -0
- package/dist/gates/gate-envelope.d.ts +85 -8
- package/dist/gates/gate-envelope.d.ts.map +1 -1
- package/dist/gates/gate-envelope.js +56 -7
- package/dist/gates/gate-rule-globs.d.ts +67 -0
- package/dist/gates/gate-rule-globs.d.ts.map +1 -0
- package/dist/gates/gate-rule-globs.js +139 -0
- package/dist/gates/gate-rule-view.d.ts +25 -6
- package/dist/gates/gate-rule-view.d.ts.map +1 -1
- package/dist/gates/gate-rule-view.js +105 -77
- package/dist/gates/i-coverage-dead-glob.d.ts +19 -0
- package/dist/gates/i-coverage-dead-glob.d.ts.map +1 -0
- package/dist/gates/i-coverage-dead-glob.js +1 -0
- package/dist/gates/i-coverage-negation.d.ts +13 -0
- package/dist/gates/i-coverage-negation.d.ts.map +1 -0
- package/dist/gates/i-coverage-negation.js +1 -0
- package/dist/gates/i-registration-query-settle-input.d.ts +18 -0
- package/dist/gates/i-registration-query-settle-input.d.ts.map +1 -0
- package/dist/gates/i-registration-query-settle-input.js +1 -0
- package/dist/gates/i-unit-state-note-row.d.ts +16 -0
- package/dist/gates/i-unit-state-note-row.d.ts.map +1 -0
- package/dist/gates/i-unit-state-note-row.js +1 -0
- package/dist/gates/i-unit-state-notes.d.ts +32 -0
- package/dist/gates/i-unit-state-notes.d.ts.map +1 -0
- package/dist/gates/i-unit-state-notes.js +1 -0
- package/dist/gates/incomplete-registry-inventory.d.ts +19 -0
- package/dist/gates/incomplete-registry-inventory.d.ts.map +1 -0
- package/dist/gates/incomplete-registry-inventory.js +63 -0
- package/dist/gates/measure-registration-roles.d.ts +10 -0
- package/dist/gates/measure-registration-roles.d.ts.map +1 -0
- package/dist/gates/measure-registration-roles.js +9 -0
- package/dist/gates/plane-verdict.d.ts +14 -0
- package/dist/gates/plane-verdict.d.ts.map +1 -0
- package/dist/gates/plane-verdict.js +22 -0
- package/dist/gates/qualify-clean-for-units.d.ts +12 -0
- package/dist/gates/qualify-clean-for-units.d.ts.map +1 -0
- package/dist/gates/qualify-clean-for-units.js +18 -0
- package/dist/gates/registration-graph-verdict.d.ts +34 -0
- package/dist/gates/registration-graph-verdict.d.ts.map +1 -0
- package/dist/gates/registration-graph-verdict.js +70 -0
- package/dist/gates/registration-roles.d.ts +9 -0
- package/dist/gates/registration-roles.d.ts.map +1 -0
- package/dist/gates/registration-roles.js +1 -0
- package/dist/gates/registry-liveness.d.ts +11 -0
- package/dist/gates/registry-liveness.d.ts.map +1 -0
- package/dist/gates/registry-liveness.js +13 -0
- package/dist/gates/rule-coverage.d.ts +225 -4
- package/dist/gates/rule-coverage.d.ts.map +1 -1
- package/dist/gates/rule-coverage.js +610 -43
- package/dist/gates/run-gate-planes.d.ts +58 -0
- package/dist/gates/run-gate-planes.d.ts.map +1 -0
- package/dist/gates/run-gate-planes.js +403 -0
- package/dist/gates/scaffold-selftest.d.ts +56 -0
- package/dist/gates/scaffold-selftest.d.ts.map +1 -0
- package/dist/gates/scaffold-selftest.js +119 -0
- package/dist/gates/seam-rejected-rules.d.ts +28 -0
- package/dist/gates/seam-rejected-rules.d.ts.map +1 -0
- package/dist/gates/seam-rejected-rules.js +95 -0
- package/dist/gates/self-test-check.d.ts +29 -0
- package/dist/gates/self-test-check.d.ts.map +1 -0
- package/dist/gates/self-test-check.js +1 -0
- package/dist/gates/self-test-subject.d.ts +28 -0
- package/dist/gates/self-test-subject.d.ts.map +1 -0
- package/dist/gates/self-test-subject.js +1 -0
- package/dist/gates/self-test.d.ts +20 -0
- package/dist/gates/self-test.d.ts.map +1 -0
- package/dist/gates/self-test.js +82 -0
- package/dist/gates/settle-verdict.d.ts +14 -0
- package/dist/gates/settle-verdict.d.ts.map +1 -0
- package/dist/gates/settle-verdict.js +13 -0
- package/dist/gates/settled-verdict.d.ts +8 -0
- package/dist/gates/settled-verdict.d.ts.map +1 -0
- package/dist/gates/settled-verdict.js +1 -0
- package/dist/gates/template-registry-coverage.d.ts +18 -0
- package/dist/gates/template-registry-coverage.d.ts.map +1 -0
- package/dist/gates/template-registry-coverage.js +24 -0
- package/dist/gates/unit-state-notes.d.ts +40 -0
- package/dist/gates/unit-state-notes.d.ts.map +1 -0
- package/dist/gates/unit-state-notes.js +71 -0
- package/dist/gates/verdict-line.d.ts +18 -0
- package/dist/gates/verdict-line.d.ts.map +1 -0
- package/dist/gates/verdict-line.js +40 -0
- package/dist/graph/graph-reuse-lookup.d.ts +10 -0
- package/dist/graph/graph-reuse-lookup.d.ts.map +1 -0
- package/dist/graph/graph-reuse-lookup.js +41 -0
- package/dist/graph/index-behind-hint.d.ts +11 -0
- package/dist/graph/index-behind-hint.d.ts.map +1 -0
- package/dist/graph/index-behind-hint.js +27 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts +10 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate.js +9 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +204 -83
- package/dist/output/failure-hints.d.ts.map +1 -1
- package/dist/output/failure-hints.js +11 -9
- package/dist/output/rejected-entries-note.d.ts +57 -0
- package/dist/output/rejected-entries-note.d.ts.map +1 -0
- package/dist/output/rejected-entries-note.js +103 -0
- package/dist/output/stdout-is-pipe.d.ts +13 -0
- package/dist/output/stdout-is-pipe.d.ts.map +1 -0
- package/dist/output/stdout-is-pipe.js +21 -0
- package/dist/packs/stale-build-warning.d.ts +11 -0
- package/dist/packs/stale-build-warning.d.ts.map +1 -0
- package/dist/packs/stale-build-warning.js +23 -0
- package/dist/quality/run-quality.d.ts +123 -0
- package/dist/quality/run-quality.d.ts.map +1 -0
- package/dist/quality/run-quality.js +442 -0
- package/dist/schemas/json-schemas.d.ts +184 -3
- package/dist/schemas/json-schemas.d.ts.map +1 -1
- package/dist/schemas/json-schemas.js +113 -2
- package/dist/shrk.d.ts +3 -0
- package/dist/shrk.d.ts.map +1 -0
- package/dist/shrk.js +30 -0
- package/dist/surface/audience-applicability.d.ts +26 -0
- package/dist/surface/audience-applicability.d.ts.map +1 -0
- package/dist/surface/audience-applicability.js +60 -0
- package/dist/surface/catalog-command-safety.d.ts +18 -0
- package/dist/surface/catalog-command-safety.d.ts.map +1 -0
- package/dist/surface/catalog-command-safety.js +62 -0
- package/dist/surface/cli-command-resolver.d.ts +21 -0
- package/dist/surface/cli-command-resolver.d.ts.map +1 -0
- package/dist/surface/cli-command-resolver.js +87 -0
- package/dist/surface/command-dispatch-kind.d.ts +20 -0
- package/dist/surface/command-dispatch-kind.d.ts.map +1 -0
- package/dist/surface/command-dispatch-kind.js +20 -0
- package/dist/surface/command-index-entry.d.ts +40 -0
- package/dist/surface/command-index-entry.d.ts.map +1 -0
- package/dist/surface/command-index-entry.js +1 -0
- package/dist/surface/command-index.d.ts +77 -0
- package/dist/surface/command-index.d.ts.map +1 -0
- package/dist/surface/command-index.js +323 -0
- package/dist/surface/i-command-index.d.ts +22 -0
- package/dist/surface/i-command-index.d.ts.map +1 -0
- package/dist/surface/i-command-index.js +1 -0
- package/dist/surface/i-command-string-context.d.ts +20 -0
- package/dist/surface/i-command-string-context.d.ts.map +1 -0
- package/dist/surface/i-command-string-context.js +1 -0
- package/dist/surface/i-surface-denial.d.ts +13 -0
- package/dist/surface/i-surface-denial.d.ts.map +1 -0
- package/dist/surface/i-surface-denial.js +1 -0
- package/dist/surface/load-surface-context.d.ts +17 -1
- package/dist/surface/load-surface-context.d.ts.map +1 -1
- package/dist/surface/load-surface-context.js +48 -10
- package/dist/surface/not-enabled-error.d.ts +38 -4
- package/dist/surface/not-enabled-error.d.ts.map +1 -1
- package/dist/surface/not-enabled-error.js +96 -6
- package/dist/surface/profiles.d.ts +7 -0
- package/dist/surface/profiles.d.ts.map +1 -1
- package/dist/surface/resolve-command-string.d.ts +10 -0
- package/dist/surface/resolve-command-string.d.ts.map +1 -0
- package/dist/surface/resolve-command-string.js +572 -0
- package/dist/surface/surface-config-writer.d.ts +7 -2
- package/dist/surface/surface-config-writer.d.ts.map +1 -1
- package/dist/surface/surface-config-writer.js +25 -6
- package/dist/surface/surface-layer.d.ts +11 -0
- package/dist/surface/surface-layer.d.ts.map +1 -0
- package/dist/surface/surface-layer.js +11 -0
- package/dist/surface/surface-refusal-reason.d.ts +16 -0
- package/dist/surface/surface-refusal-reason.d.ts.map +1 -0
- package/dist/surface/surface-refusal-reason.js +16 -0
- package/dist/surface/surface-selector.d.ts +26 -0
- package/dist/surface/surface-selector.d.ts.map +1 -0
- package/dist/surface/surface-selector.js +42 -0
- package/dist/surface/surface-summary.d.ts +61 -18
- package/dist/surface/surface-summary.d.ts.map +1 -1
- package/dist/surface/surface-summary.js +147 -60
- package/dist/surface/tier.d.ts +85 -22
- package/dist/surface/tier.d.ts.map +1 -1
- package/dist/surface/tier.js +132 -30
- package/dist/usage/usage-log.d.ts +6 -1
- package/dist/usage/usage-log.d.ts.map +1 -1
- package/dist/usage/usage-log.js +7 -2
- package/dist/validation/run-validation-loop.d.ts +9 -0
- package/dist/validation/run-validation-loop.d.ts.map +1 -1
- package/dist/validation/run-validation-loop.js +14 -11
- package/dist/validation/typecheck-emitted.d.ts +8 -9
- package/dist/validation/typecheck-emitted.d.ts.map +1 -1
- package/dist/validation/typecheck-emitted.js +17 -97
- package/package.json +34 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs.command.d.ts","sourceRoot":"","sources":["../../src/commands/packs.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"packs.command.d.ts","sourceRoot":"","sources":["../../src/commands/packs.command.ts"],"names":[],"mappings":"AAoCA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA+BhC,eAAO,MAAM,yBAAyB,EAAE,eAwIvC,CAAC;AAkCF,eAAO,MAAM,2BAA2B,EAAE,eAkJzC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eA+CnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eAoF9B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eA8F7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAqDjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eA+JhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eA2IhC,CAAC;AAwEF,eAAO,MAAM,gBAAgB,EAAE,eAuL9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAmEtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAmFhC,CAAC;AAMF,eAAO,MAAM,qBAAqB,EAAE,eA4BnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eA+E/B,CAAC"}
|
|
@@ -1,49 +1,192 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { buildPackContributionsInventoryAsync, buildPackDoctorReportAsync, ContributionKind, contributionKindForSlot, contributionKindOfLoader, formatEntryRejection, nearestIds, packDoctorCoverage, packEntryCounts, buildPackSignatureStatusReport, checkPackSymbolCompat, computePackContentDigests, describePackAssetFreshness, explainPackSignatureStatus, inspectSharkcraft, mergePackReleaseChecks, runPackReleaseCheck, runPackReleaseChecksForReport, } from '@shrkcrft/inspector';
|
|
4
|
+
import { usageExitFor } from "../exit-codes.js";
|
|
5
|
+
import { ALLOW_EMPTY_FLAG, allowEmptyValve } from "../gates/allow-empty.js";
|
|
6
|
+
import { settleVerdict } from "../gates/settle-verdict.js";
|
|
7
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
8
|
+
import { CONTRIBUTION_FILE_KEYS, PACK_SECRET_ENV, signPackManifest, validatePackManifest, verifyPackManifest, } from '@shrkcrft/plugin-api';
|
|
5
9
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
6
10
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
7
11
|
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
8
12
|
function statusLabel(valid) {
|
|
9
13
|
return valid ? 'OK ' : 'INVALID';
|
|
10
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Refuse a `--kind` / `--pack` that names no contribution kind / no discovered
|
|
17
|
+
* pack (or carries no value): a usage error naming the known values and the
|
|
18
|
+
* nearest, exit `usageExitFor` (3 — `packs contributions` is a verdict verb).
|
|
19
|
+
* It used to narrow the view to nothing and settle a ✓ over it at exit 0 — a
|
|
20
|
+
* flag that could not fail (round 12 review, A-1). `undefined` when the flag
|
|
21
|
+
* is absent or names a known value.
|
|
22
|
+
*/
|
|
23
|
+
function refuseUnknownFilter(args, flag, known) {
|
|
24
|
+
if (!args.flags.has(flag))
|
|
25
|
+
return undefined;
|
|
26
|
+
const raw = args.flags.get(flag);
|
|
27
|
+
if (typeof raw === 'string' && known.includes(raw))
|
|
28
|
+
return undefined;
|
|
29
|
+
const near = typeof raw === 'string' ? nearestIds(raw, known, 3).map((n) => n.id) : [];
|
|
30
|
+
const knownText = known.length > 0 ? `known: ${known.join(', ')}` : flag === 'pack' ? 'no pack was discovered' : 'none is known';
|
|
31
|
+
process.stderr.write(`unknown --${flag} ${typeof raw === 'string' ? `"${raw}"` : '(no value)'} — ${knownText}.${near.length > 0 ? ` Did you mean: ${near.join(', ')}?` : ''}\n`);
|
|
32
|
+
return usageExitFor('packs contributions');
|
|
33
|
+
}
|
|
11
34
|
export const packsContributionsCommand = {
|
|
12
35
|
name: 'contributions',
|
|
13
|
-
description: '
|
|
14
|
-
usage: 'shrk packs contributions [--pack <name>] [--kind <kind>] [--format text|markdown|json] [--output <file>]',
|
|
36
|
+
description: 'THE contributions report: every pack/local contribution across every loader-backed kind (how each id was derived — structural / regex-fallback / file-only), every file that failed to load, every entry a loader REJECTED with its reasons, and — per contributed file (`By file:`) — entries declared · accepted · rejected plus references that cannot be checked because their kind\'s registry is empty or undeclarable. Exit 0 · 1 an error-severity conflict, a load failure or a rejected entry · 2 only unresolvable references remain, or no contributed file is in view (NOT VERIFIED; --allow-empty accepts an empty view explicitly) · 3 an unknown --kind or --pack.',
|
|
37
|
+
usage: 'shrk packs contributions [--pack <name>] [--kind <kind>] [--allow-empty] [--format text|markdown|json] [--output <file>]',
|
|
38
|
+
booleanFlags: new Set(['json', ALLOW_EMPTY_FLAG]),
|
|
15
39
|
async run(args) {
|
|
16
|
-
const {
|
|
40
|
+
const { collectUnresolvableReferences, contributionsReportOf, filterContributionsReport, renderContributionsByFileMarkdown, renderContributionsByFileText, renderInventoryMarkdown, renderInventoryText, inspectSharkcraft, } = await import('@shrkcrft/inspector');
|
|
41
|
+
// A filter naming no kind is refused before anything loads; a pack name
|
|
42
|
+
// is checked against the packs discovery found.
|
|
43
|
+
const kindRefused = refuseUnknownFilter(args, 'kind', Object.values(ContributionKind));
|
|
44
|
+
if (kindRefused !== undefined)
|
|
45
|
+
return kindRefused;
|
|
17
46
|
const cwd = resolveCwd(args);
|
|
18
47
|
const inspection = await inspectSharkcraft({ cwd });
|
|
48
|
+
const packRefused = refuseUnknownFilter(args, 'pack', [...new Set(inspection.packs.discoveredPacks.map((p) => p.packageName))].sort());
|
|
49
|
+
if (packRefused !== undefined)
|
|
50
|
+
return packRefused;
|
|
19
51
|
// Use the async/structural-first variant so nested step.id and
|
|
20
52
|
// sub-object ids don't show up as separate contribution ids.
|
|
21
53
|
const inv = await buildPackContributionsInventoryAsync(inspection);
|
|
22
54
|
const filterPack = flagString(args, 'pack');
|
|
23
55
|
const filterKind = flagString(args, 'kind');
|
|
56
|
+
// THE per-file report (round 12, ONE-CHANGE): the inventory, THE rejection
|
|
57
|
+
// channel it carries, and the self-config doctor's own reference probes.
|
|
58
|
+
const report = filterContributionsReport(contributionsReportOf(inspection, inv, await collectUnresolvableReferences(inspection)), { ...(filterPack ? { pack: filterPack } : {}), ...(filterKind ? { kind: filterKind } : {}) });
|
|
24
59
|
let entries = inv.entries;
|
|
25
|
-
|
|
60
|
+
let conflicts = inv.conflicts;
|
|
61
|
+
let loadFailures = inv.loadFailures;
|
|
62
|
+
let rejections = inv.rejections;
|
|
63
|
+
if (filterPack) {
|
|
26
64
|
entries = entries.filter((e) => e.packageName === filterPack);
|
|
27
|
-
|
|
65
|
+
conflicts = conflicts.filter((c) => c.sources.some((s) => s.packageName === filterPack));
|
|
66
|
+
loadFailures = loadFailures.filter((f) => f.packageName === filterPack);
|
|
67
|
+
rejections = rejections.filter((r) => r.packageName === filterPack);
|
|
68
|
+
}
|
|
69
|
+
if (filterKind) {
|
|
28
70
|
entries = entries.filter((e) => e.kind === filterKind);
|
|
29
|
-
|
|
71
|
+
conflicts = conflicts.filter((c) => c.contributionKind === filterKind);
|
|
72
|
+
// The printed failures follow the same filter as the conflicts the exit
|
|
73
|
+
// reads — never a failure listed next to an exit that ignores it. A
|
|
74
|
+
// failure's loader `kind` maps through THE table the report's rows use
|
|
75
|
+
// (`contributionKindOfLoader`), so the row and the exit read one answer.
|
|
76
|
+
loadFailures = loadFailures.filter((f) => contributionKindOfLoader(f.kind) === filterKind);
|
|
77
|
+
rejections = rejections.filter((r) => r.kind === filterKind);
|
|
78
|
+
}
|
|
79
|
+
const filtered = { ...inv, entries, conflicts, loadFailures, rejections };
|
|
80
|
+
// THE verdict (round 12): 1 on an error-severity conflict, a file that
|
|
81
|
+
// failed to load, or an entry a loader rejected (none of them takes
|
|
82
|
+
// effect); settled against the references the view could not check, so
|
|
83
|
+
// unresolvable references alone are 2 NOT VERIFIED — never a pass.
|
|
84
|
+
const errorConflicts = conflicts.filter((c) => c.severity === 'error').length;
|
|
85
|
+
const proposed = errorConflicts > 0 || loadFailures.length > 0 || rejections.length > 0 ? 1 : 0;
|
|
86
|
+
// The contributed files in view are the run's unit (round 12 review,
|
|
87
|
+
// A-1): an empty view — no contribution at all, or a filter selecting
|
|
88
|
+
// none — examined nothing, so it is 2 NOT VERIFIED and never a ✓, unless
|
|
89
|
+
// `--allow-empty` accepts it explicitly.
|
|
90
|
+
const inView = report.totals.files;
|
|
91
|
+
const narrowed = [filterPack ? `--pack ${filterPack}` : '', filterKind ? `--kind ${filterKind}` : '']
|
|
92
|
+
.filter((s) => s.length > 0)
|
|
93
|
+
.join(' ');
|
|
94
|
+
const fileCoverage = {
|
|
95
|
+
unit: 'contributed files',
|
|
96
|
+
expected: inView,
|
|
97
|
+
examined: inView,
|
|
98
|
+
...(inView === 0
|
|
99
|
+
? {
|
|
100
|
+
reason: narrowed
|
|
101
|
+
? `no contributed file matches ${narrowed}`
|
|
102
|
+
: 'no contributed file (local or pack) was discovered',
|
|
103
|
+
}
|
|
104
|
+
: {}),
|
|
105
|
+
...allowEmptyValve(args, inView),
|
|
106
|
+
};
|
|
107
|
+
const settled = settleVerdict(proposed, [
|
|
108
|
+
fileCoverage,
|
|
109
|
+
...(report.referenceCoverage ? [report.referenceCoverage] : []),
|
|
110
|
+
]);
|
|
111
|
+
const exit = settled.exit;
|
|
30
112
|
const format = flagString(args, 'format') ?? 'text';
|
|
31
113
|
if (flagBool(args, 'json') || format === 'json') {
|
|
32
|
-
process.stdout.write(asJson(
|
|
33
|
-
|
|
114
|
+
process.stdout.write(asJson({
|
|
115
|
+
...filtered,
|
|
116
|
+
report,
|
|
117
|
+
exitCode: exit,
|
|
118
|
+
verdict: settled.verdict,
|
|
119
|
+
shortfalls: settled.shortfalls,
|
|
120
|
+
accepted: settled.accepted,
|
|
121
|
+
}) + '\n');
|
|
122
|
+
return exit;
|
|
34
123
|
}
|
|
124
|
+
const t = report.totals;
|
|
125
|
+
const clean = `${t.accepted} of ${t.declared} declared entr${t.declared === 1 ? 'y' : 'ies'} accepted across ${t.files} contributed file(s); no rejected entry, load failure or error conflict. ✓`;
|
|
126
|
+
const lead = t.files === 0
|
|
127
|
+
? 'Nothing was examined — no contributed file is in view.'
|
|
128
|
+
: `No rejected entry, load failure or error conflict — but ${t.unresolvable} declared reference(s) could not be checked.`;
|
|
129
|
+
const line = verdictLine(settled, clean, lead);
|
|
130
|
+
const emptyHint = exit === 2 && t.files === 0 ? `Pass --${ALLOW_EMPTY_FLAG} to accept an empty view explicitly.\n` : '';
|
|
131
|
+
const attention = exit === 1
|
|
132
|
+
? `Contributions need attention: ${rejections.length} rejected entr${rejections.length === 1 ? 'y' : 'ies'}, ${loadFailures.length} load failure(s), ${errorConflicts} error conflict(s).`
|
|
133
|
+
: '';
|
|
35
134
|
if (format === 'markdown') {
|
|
36
135
|
process.stdout.write(renderInventoryMarkdown(filtered));
|
|
37
|
-
|
|
136
|
+
process.stdout.write('\n' + renderContributionsByFileMarkdown(report));
|
|
137
|
+
if (attention)
|
|
138
|
+
process.stdout.write(`\n**${attention}**\n`);
|
|
139
|
+
if (line)
|
|
140
|
+
process.stdout.write(`\n${line}\n`);
|
|
141
|
+
process.stdout.write(emptyHint);
|
|
142
|
+
return exit;
|
|
38
143
|
}
|
|
39
144
|
process.stdout.write(renderInventoryText(filtered));
|
|
40
|
-
|
|
145
|
+
process.stdout.write('\n' + renderContributionsByFileText(report));
|
|
146
|
+
if (attention)
|
|
147
|
+
process.stdout.write(`\n${attention}\n`);
|
|
148
|
+
if (line)
|
|
149
|
+
process.stdout.write(`\n${line}\n`);
|
|
150
|
+
process.stdout.write(emptyHint);
|
|
151
|
+
return exit;
|
|
41
152
|
},
|
|
42
153
|
};
|
|
154
|
+
/** `convention 8 accepted · 2 REJECTED · helper 1 accepted` — kinds sorted, REJECTED only when > 0. */
|
|
155
|
+
function entryCountsLine(counts) {
|
|
156
|
+
const parts = Object.keys(counts)
|
|
157
|
+
.sort()
|
|
158
|
+
.filter((k) => counts[k].accepted > 0 || counts[k].rejected > 0)
|
|
159
|
+
.map((k) => {
|
|
160
|
+
const c = counts[k];
|
|
161
|
+
return `${k} ${c.accepted} accepted${c.rejected > 0 ? ` · ${c.rejected} REJECTED` : ''}`;
|
|
162
|
+
});
|
|
163
|
+
return parts.length > 0 ? parts.join(' · ') : '(no entry loaded)';
|
|
164
|
+
}
|
|
165
|
+
/** The `files:` tokens: the six classic ones always, then every other non-zero slot as `<kind>=<n>`. */
|
|
166
|
+
const CLASSIC_FILE_SLOTS = new Set([
|
|
167
|
+
'knowledgeFiles',
|
|
168
|
+
'ruleFiles',
|
|
169
|
+
'pathFiles',
|
|
170
|
+
'templateFiles',
|
|
171
|
+
'pipelineFiles',
|
|
172
|
+
'docsFiles',
|
|
173
|
+
]);
|
|
174
|
+
function extraFileTokens(counts) {
|
|
175
|
+
const parts = [];
|
|
176
|
+
for (const slot of CONTRIBUTION_FILE_KEYS) {
|
|
177
|
+
if (CLASSIC_FILE_SLOTS.has(slot))
|
|
178
|
+
continue;
|
|
179
|
+
const n = counts[slot] ?? 0;
|
|
180
|
+
if (n > 0)
|
|
181
|
+
parts.push(`${contributionKindForSlot(slot) ?? slot}=${n}`);
|
|
182
|
+
}
|
|
183
|
+
return parts.length > 0 ? ` ${parts.join(' ')}` : '';
|
|
184
|
+
}
|
|
43
185
|
export const packsSignatureStatusCommand = {
|
|
44
186
|
name: 'signature-status',
|
|
45
187
|
description: 'Report pack signature freshness (present/stale/missing). Never fake-signs; never requires the secret. `--release-readiness` annotates each pack with whether it would block release:preflight (dev signature + no SHARKCRAFT_PACK_SECRET = blocking).',
|
|
46
|
-
usage: 'shrk packs signature-status [<pack>] [--release-readiness] [--format text|markdown|json]',
|
|
188
|
+
usage: 'shrk packs signature-status [<pack>] [--release-readiness] [--allow-empty] [--format text|markdown|json]',
|
|
189
|
+
booleanFlags: new Set(['release-readiness', 'json', ALLOW_EMPTY_FLAG]),
|
|
47
190
|
async run(args) {
|
|
48
191
|
const { buildPackSignatureStatusReport, inspectSharkcraft } = await import('@shrkcrft/inspector');
|
|
49
192
|
const cwd = resolveCwd(args);
|
|
@@ -87,16 +230,47 @@ export const packsSignatureStatusCommand = {
|
|
|
87
230
|
: { enabled: false },
|
|
88
231
|
};
|
|
89
232
|
const format = flagString(args, 'format') ?? 'text';
|
|
90
|
-
|
|
233
|
+
// Freshness comes from the one authority (content digests recorded at
|
|
234
|
+
// signing). A signed pack whose signature records no digests is NOT
|
|
235
|
+
// verified — never a pass: settle it as 2 when nothing is stale.
|
|
236
|
+
const signed = annotated.filter((p) => p.status !== 'missing');
|
|
237
|
+
const unverifiedPacks = annotated.filter((p) => p.status === 'unverified');
|
|
238
|
+
const coverage = signed.length > 0
|
|
239
|
+
? [
|
|
240
|
+
{
|
|
241
|
+
unit: 'signed packs',
|
|
242
|
+
expected: signed.length,
|
|
243
|
+
examined: signed.length - unverifiedPacks.length,
|
|
244
|
+
...(unverifiedPacks.length > 0
|
|
245
|
+
? {
|
|
246
|
+
unexamined: unverifiedPacks.map((p) => p.packageName),
|
|
247
|
+
reason: 'their signature records no content digests — re-sign to verify freshness',
|
|
248
|
+
}
|
|
249
|
+
: {}),
|
|
250
|
+
},
|
|
251
|
+
]
|
|
252
|
+
: [
|
|
253
|
+
// Zero signed packs is not "every signature is fresh": nothing was
|
|
254
|
+
// verified. 2, unless --allow-empty accepts the empty set explicitly.
|
|
255
|
+
{
|
|
256
|
+
unit: 'signed packs',
|
|
257
|
+
expected: 0,
|
|
258
|
+
examined: 0,
|
|
259
|
+
reason: annotated.length === 0 ? 'no pack discovered' : 'no discovered pack carries a signature',
|
|
260
|
+
...allowEmptyValve(args, 0),
|
|
261
|
+
},
|
|
262
|
+
];
|
|
263
|
+
const settled = settleVerdict(filtered.summary.stale > 0 || (releaseReadiness && blockingCount > 0) ? 1 : 0, coverage);
|
|
264
|
+
const exitCode = settled.exit;
|
|
91
265
|
if (flagBool(args, 'json') || format === 'json') {
|
|
92
|
-
process.stdout.write(asJson(filtered) + '\n');
|
|
266
|
+
process.stdout.write(asJson({ ...filtered, exitCode, verdict: settled.verdict, shortfalls: settled.shortfalls }) + '\n');
|
|
93
267
|
return exitCode;
|
|
94
268
|
}
|
|
95
269
|
if (format === 'markdown') {
|
|
96
270
|
const lines = ['# Pack signature status', ''];
|
|
97
271
|
lines.push(`- generatedAt: ${filtered.generatedAt}`);
|
|
98
272
|
lines.push(`- secret available: ${filtered.secretAvailable}`);
|
|
99
|
-
lines.push(`- total: ${filtered.summary.total} (present ${filtered.summary.present} / stale ${filtered.summary.stale} / missing ${filtered.summary.missing})`);
|
|
273
|
+
lines.push(`- total: ${filtered.summary.total} (present ${filtered.summary.present} / stale ${filtered.summary.stale} / unverified ${filtered.summary.unverified} / missing ${filtered.summary.missing})`);
|
|
100
274
|
if (releaseReadiness) {
|
|
101
275
|
lines.push(`- dev-signed: ${devCount}`);
|
|
102
276
|
lines.push(`- release-blocking: ${blockingCount}`);
|
|
@@ -114,6 +288,7 @@ export const packsSignatureStatusCommand = {
|
|
|
114
288
|
process.stdout.write(` total ${filtered.summary.total}\n`);
|
|
115
289
|
process.stdout.write(` present ${filtered.summary.present}\n`);
|
|
116
290
|
process.stdout.write(` stale ${filtered.summary.stale}\n`);
|
|
291
|
+
process.stdout.write(` unverified ${filtered.summary.unverified}\n`);
|
|
117
292
|
process.stdout.write(` missing ${filtered.summary.missing}\n`);
|
|
118
293
|
process.stdout.write(` secret env ${filtered.secretAvailable ? 'set' : 'NOT set (no fake-signing — re-sign manually)'}\n`);
|
|
119
294
|
if (releaseReadiness) {
|
|
@@ -135,6 +310,12 @@ export const packsSignatureStatusCommand = {
|
|
|
135
310
|
if (releaseReadiness && blockingCount > 0) {
|
|
136
311
|
process.stdout.write(`\nRelease would FAIL CLOSED — set SHARKCRAFT_PACK_SECRET and run \`shrk packs sign <pack>\` for each dev-signed pack.\n`);
|
|
137
312
|
}
|
|
313
|
+
const line = verdictLine(settled, '');
|
|
314
|
+
if (line)
|
|
315
|
+
process.stdout.write(`\n${line}\n`);
|
|
316
|
+
if (signed.length === 0 && exitCode === 2) {
|
|
317
|
+
process.stdout.write(`Pass --${ALLOW_EMPTY_FLAG} to accept a project with no signed pack explicitly.\n`);
|
|
318
|
+
}
|
|
138
319
|
return exitCode;
|
|
139
320
|
},
|
|
140
321
|
};
|
|
@@ -191,6 +372,13 @@ export const packsListCommand = {
|
|
|
191
372
|
async run(args) {
|
|
192
373
|
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
193
374
|
const packs = inspection.packs.discoveredPacks;
|
|
375
|
+
// Compiled-build freshness, from the one pack-asset freshness authority
|
|
376
|
+
// (computed at inspection for packs serving compiled contributions).
|
|
377
|
+
const freshnessByRoot = new Map((inspection.packAssetFreshness ?? []).map((f) => [f.packageRoot, f]));
|
|
378
|
+
// Per-kind accepted / REJECTED entries, from THE contributions inventory
|
|
379
|
+
// (round 12, 12.1b): a conventions-only pack printed all zeros, and a
|
|
380
|
+
// partially-loaded file looked identical to a fully-loaded one.
|
|
381
|
+
const inv = inspection.packs.validPacks.length > 0 ? await buildPackContributionsInventoryAsync(inspection) : null;
|
|
194
382
|
if (flagBool(args, 'json')) {
|
|
195
383
|
process.stdout.write(asJson(packs.map((p) => ({
|
|
196
384
|
packageName: p.packageName,
|
|
@@ -199,11 +387,13 @@ export const packsListCommand = {
|
|
|
199
387
|
manifestPath: p.manifestPath,
|
|
200
388
|
contributionCounts: p.contributionCounts,
|
|
201
389
|
resolvedCounts: p.resolvedCounts,
|
|
390
|
+
entryCounts: packEntryCounts(inv, p),
|
|
202
391
|
signatureStatus: p.signatureStatus,
|
|
203
392
|
signatureMessage: p.signatureMessage,
|
|
204
393
|
signatureDev: p.signatureDev,
|
|
205
394
|
loadError: p.loadError,
|
|
206
395
|
validationIssues: p.validationIssues,
|
|
396
|
+
buildFreshness: freshnessByRoot.get(p.packageRoot)?.build.state ?? 'not-compiled',
|
|
207
397
|
}))) + '\n');
|
|
208
398
|
return 0;
|
|
209
399
|
}
|
|
@@ -215,12 +405,31 @@ export const packsListCommand = {
|
|
|
215
405
|
for (const p of packs) {
|
|
216
406
|
const c = p.contributionCounts;
|
|
217
407
|
const r = p.resolvedCounts;
|
|
218
|
-
|
|
219
|
-
|
|
408
|
+
const counts = packEntryCounts(inv, p);
|
|
409
|
+
const rejected = Object.values(counts).reduce((n, x) => n + x.rejected, 0);
|
|
410
|
+
const freshness = freshnessByRoot.get(p.packageRoot);
|
|
411
|
+
const buildMark = freshness?.build.state === 'stale'
|
|
412
|
+
? ' STALE-BUILD'
|
|
413
|
+
: freshness?.build.state === 'unrecorded'
|
|
414
|
+
? ' BUILD-UNVERIFIED'
|
|
415
|
+
: '';
|
|
416
|
+
process.stdout.write(` ${statusLabel(p.valid)} ${p.packageName}@${p.packageVersion}${buildMark}${rejected > 0 ? ' REJECTED-ENTRIES' : ''}\n`);
|
|
417
|
+
if (freshness && buildMark) {
|
|
418
|
+
const said = describePackAssetFreshness(freshness).build;
|
|
419
|
+
if (said)
|
|
420
|
+
process.stdout.write(` ${said}\n`);
|
|
421
|
+
}
|
|
422
|
+
process.stdout.write(` files: k=${c.knowledgeFiles} r=${c.ruleFiles} p=${c.pathFiles} t=${c.templateFiles} pl=${c.pipelineFiles} d=${c.docsFiles}${extraFileTokens(c)}\n`);
|
|
220
423
|
if (r) {
|
|
221
424
|
const totalEntries = r.knowledgeEntries + r.rules + r.pathConventions;
|
|
222
425
|
process.stdout.write(` resolved: entries=${totalEntries} templates=${r.templates} pipelines=${r.pipelines} docs=${r.docs}\n`);
|
|
223
426
|
}
|
|
427
|
+
if (p.valid) {
|
|
428
|
+
process.stdout.write(` entries: ${entryCountsLine(counts)}\n`);
|
|
429
|
+
if (rejected > 0) {
|
|
430
|
+
process.stdout.write(` ↳ shrk packs contributions --pack ${p.packageName} names every rejected entry\n`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
224
433
|
if (!p.valid) {
|
|
225
434
|
if (p.loadError)
|
|
226
435
|
process.stdout.write(` error: ${p.loadError}\n`);
|
|
@@ -248,8 +457,12 @@ export const packsGetCommand = {
|
|
|
248
457
|
process.stderr.write(`No pack with name "${id}" was discovered.\n`);
|
|
249
458
|
return 1;
|
|
250
459
|
}
|
|
460
|
+
// Every slot and every entry, from THE contributions inventory (round 12, 12.1b).
|
|
461
|
+
const inv = pack.valid ? await buildPackContributionsInventoryAsync(inspection) : null;
|
|
462
|
+
const counts = packEntryCounts(inv, pack);
|
|
463
|
+
const rejections = (inv?.rejections ?? []).filter((r) => r.packageName === pack.packageName);
|
|
251
464
|
if (flagBool(args, 'json')) {
|
|
252
|
-
process.stdout.write(asJson(pack) + '\n');
|
|
465
|
+
process.stdout.write(asJson({ ...pack, entryCounts: counts, rejections }) + '\n');
|
|
253
466
|
return 0;
|
|
254
467
|
}
|
|
255
468
|
process.stdout.write(header(`Pack: ${pack.packageName}`));
|
|
@@ -269,6 +482,25 @@ export const packsGetCommand = {
|
|
|
269
482
|
process.stdout.write(` pipeline files: ${c.pipelineFiles}\n`);
|
|
270
483
|
process.stdout.write(` docs files: ${c.docsFiles}\n`);
|
|
271
484
|
process.stdout.write(` scaffold pattern files: ${c.scaffoldPatternFiles}\n`);
|
|
485
|
+
// Every other declared slot (round 12, 12.1b) — conventions, helpers,
|
|
486
|
+
// hints, gate planes, … were never shown.
|
|
487
|
+
for (const slot of CONTRIBUTION_FILE_KEYS) {
|
|
488
|
+
if (CLASSIC_FILE_SLOTS.has(slot) || slot === 'scaffoldPatternFiles')
|
|
489
|
+
continue;
|
|
490
|
+
const n = c[slot] ?? 0;
|
|
491
|
+
if (n > 0)
|
|
492
|
+
process.stdout.write(` ${`${slot}:`.padEnd(24)}${n}\n`);
|
|
493
|
+
}
|
|
494
|
+
if (Object.keys(counts).length > 0) {
|
|
495
|
+
process.stdout.write('\nEntries (accepted / rejected by their loader):\n');
|
|
496
|
+
for (const k of Object.keys(counts).sort()) {
|
|
497
|
+
const x = counts[k];
|
|
498
|
+
process.stdout.write(` ${`${k}:`.padEnd(24)}${x.accepted} accepted${x.rejected > 0 ? ` · ${x.rejected} REJECTED` : ''}\n`);
|
|
499
|
+
}
|
|
500
|
+
for (const r of rejections) {
|
|
501
|
+
process.stdout.write(` ✗ ${r.file} ${formatEntryRejection(r)}\n`);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
272
504
|
if (pack.resolvedCounts) {
|
|
273
505
|
const r = pack.resolvedCounts;
|
|
274
506
|
process.stdout.write('\nResolved (after dedup against local):\n');
|
|
@@ -358,8 +590,19 @@ export const packsInspectCommand = {
|
|
|
358
590
|
};
|
|
359
591
|
export const packsDoctorCommand = {
|
|
360
592
|
name: 'doctor',
|
|
361
|
-
description: 'Validate pack discovery: invalid manifests, missing files, empty contributions, duplicates, template/pipeline quality, action-hint coverage, signatures. `--release` folds pack-release-check findings into the report. `--signature-explain` adds per-pack signature explanation.',
|
|
362
|
-
usage: 'shrk [--cwd <dir>] packs doctor [--verify-signatures] [--require-signatures] [--allow-dev-signature] [--release] [--strict] [--secret <secret>] [--signature-explain] [--json]',
|
|
593
|
+
description: 'Validate pack discovery: invalid manifests, missing files, contribution files that failed to load, partially-resolved / empty contributions, stale compiled builds, unregistered group exports, duplicates, template/pipeline quality, action-hint coverage, signatures. `--release` folds pack-release-check findings into the report. `--typecheck` type-checks each pack\'s TS assets (exit 2 when nothing could be checked). `--signature-explain` adds per-pack signature explanation.',
|
|
594
|
+
usage: 'shrk [--cwd <dir>] packs doctor [--verify-signatures] [--require-signatures] [--allow-dev-signature] [--release] [--strict] [--typecheck] [--allow-empty] [--secret <secret>] [--signature-explain] [--json]',
|
|
595
|
+
booleanFlags: new Set([
|
|
596
|
+
'verify-signatures',
|
|
597
|
+
'require-signatures',
|
|
598
|
+
'allow-dev-signature',
|
|
599
|
+
'release',
|
|
600
|
+
'strict',
|
|
601
|
+
'typecheck',
|
|
602
|
+
ALLOW_EMPTY_FLAG,
|
|
603
|
+
'signature-explain',
|
|
604
|
+
'json',
|
|
605
|
+
]),
|
|
363
606
|
async run(args) {
|
|
364
607
|
const signatureExplain = flagBool(args, 'signature-explain');
|
|
365
608
|
// `--signature-explain` implies signature verification so the lifecycle
|
|
@@ -379,9 +622,15 @@ export const packsDoctorCommand = {
|
|
|
379
622
|
...(verify ? { verifyPackSignatures: true } : {}),
|
|
380
623
|
...(secret !== undefined ? { packSecret: secret } : {}),
|
|
381
624
|
});
|
|
382
|
-
const
|
|
625
|
+
const typecheck = flagBool(args, 'typecheck');
|
|
626
|
+
// The async doctor: registry load failures, unregistered group exports and
|
|
627
|
+
// (opt-in) a typecheck of every pack's TS assets are gathered first.
|
|
628
|
+
const report = await buildPackDoctorReportAsync(inspection, {
|
|
383
629
|
requireSignatures: required,
|
|
384
630
|
...(allowDev ? { allowDevSignatures: true } : {}),
|
|
631
|
+
...(release ? { release: true } : {}),
|
|
632
|
+
...(strict ? { strict: true } : {}),
|
|
633
|
+
...(typecheck ? { typecheck: true } : {}),
|
|
385
634
|
});
|
|
386
635
|
if (release) {
|
|
387
636
|
const releaseChecks = await runPackReleaseChecksForReport(inspection);
|
|
@@ -391,9 +640,41 @@ export const packsDoctorCommand = {
|
|
|
391
640
|
if (signatureExplain) {
|
|
392
641
|
signatureExplanation = explainPackSignatureStatus(inspection, { requireSignatures: required });
|
|
393
642
|
}
|
|
643
|
+
// The run examines the discovered packs. Zero is an empty selection — NOT
|
|
644
|
+
// VERIFIED (2) unless --allow-empty says a pack-less project is expected.
|
|
645
|
+
const discovered = inspection.packs.discoveredPacks.length;
|
|
646
|
+
// THE pack-doctor coverage (`packDoctorCoverage`, which `packDoctorVerdict`
|
|
647
|
+
// — MCP doctor_packs, the quality gate, bare `check` — settles on): the
|
|
648
|
+
// discovered packs, with this verb's `--allow-empty` valve, and compiled
|
|
649
|
+
// artifacts with no build record (never compared to their source).
|
|
650
|
+
const coverage = packDoctorCoverage(report, inspection, allowEmptyValve(args, discovered));
|
|
651
|
+
// `--typecheck` is a verdict over TS files: a pack with none to check
|
|
652
|
+
// examined nothing — never a pass. (Zero packs is the run record's case.)
|
|
653
|
+
if (typecheck && discovered > 0) {
|
|
654
|
+
const packCount = inspection.packs.validPacks.length;
|
|
655
|
+
coverage.push({
|
|
656
|
+
unit: 'packs',
|
|
657
|
+
expected: packCount,
|
|
658
|
+
examined: packCount,
|
|
659
|
+
reason: 'no valid pack discovered to type-check',
|
|
660
|
+
...allowEmptyValve(args, packCount),
|
|
661
|
+
});
|
|
662
|
+
for (const t of report.typecheckResults ?? []) {
|
|
663
|
+
coverage.push({
|
|
664
|
+
unit: 'TS files',
|
|
665
|
+
expected: t.result.checkedFiles.length,
|
|
666
|
+
examined: t.result.ran ? t.result.checkedFiles.length : 0,
|
|
667
|
+
subject: t.packageName,
|
|
668
|
+
...(t.result.note ? { reason: t.result.note } : {}),
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
const settled = settleVerdict(report.passed ? 0 : 1, coverage);
|
|
394
673
|
if (flagBool(args, 'json')) {
|
|
395
674
|
process.stdout.write(asJson({
|
|
396
|
-
|
|
675
|
+
// The settled verdict, never the pre-settlement report flag: a run
|
|
676
|
+
// that verified nothing (exit 2) is not `passed`.
|
|
677
|
+
passed: settled.exit === 0,
|
|
397
678
|
packsChecked: report.packsChecked,
|
|
398
679
|
summary: report.summary,
|
|
399
680
|
discoveredPackCount: inspection.packs.discoveredPacks.length,
|
|
@@ -401,9 +682,13 @@ export const packsDoctorCommand = {
|
|
|
401
682
|
invalidPackCount: inspection.packs.invalidPacks.length,
|
|
402
683
|
issues: report.issues,
|
|
403
684
|
...(report.releaseChecks ? { releaseChecks: report.releaseChecks } : {}),
|
|
685
|
+
...(report.typecheckResults ? { typecheckResults: report.typecheckResults } : {}),
|
|
404
686
|
...(signatureExplanation ? { signatureExplanation } : {}),
|
|
687
|
+
exitCode: settled.exit,
|
|
688
|
+
verdict: settled.verdict,
|
|
689
|
+
shortfalls: settled.shortfalls,
|
|
405
690
|
}) + '\n');
|
|
406
|
-
return
|
|
691
|
+
return settled.exit;
|
|
407
692
|
}
|
|
408
693
|
process.stdout.write(header('Pack doctor'));
|
|
409
694
|
process.stdout.write(kv('discovered', String(inspection.packs.discoveredPacks.length)) + '\n');
|
|
@@ -418,6 +703,8 @@ export const packsDoctorCommand = {
|
|
|
418
703
|
modeParts.push('structure only');
|
|
419
704
|
if (release)
|
|
420
705
|
modeParts.push('release-check');
|
|
706
|
+
if (typecheck)
|
|
707
|
+
modeParts.push('typecheck');
|
|
421
708
|
if (strict)
|
|
422
709
|
modeParts.push('strict');
|
|
423
710
|
process.stdout.write(kv('mode', modeParts.join(' + ')) + '\n\n');
|
|
@@ -436,7 +723,14 @@ export const packsDoctorCommand = {
|
|
|
436
723
|
}
|
|
437
724
|
}
|
|
438
725
|
process.stdout.write(`\nSummary: ${report.summary.errors} errors, ${report.summary.warnings} warnings, ${report.summary.info} info\n`);
|
|
439
|
-
|
|
726
|
+
if (settled.exit === 1)
|
|
727
|
+
process.stdout.write(`\nVerdict: pack issues need attention\n`);
|
|
728
|
+
const verdict = verdictLine(settled, '\nVerdict: OK ✓');
|
|
729
|
+
if (verdict)
|
|
730
|
+
process.stdout.write(`${settled.exit === 0 ? '' : '\n'}${verdict}\n`);
|
|
731
|
+
if (settled.exit === 2 && discovered === 0) {
|
|
732
|
+
process.stdout.write('Pass --allow-empty to accept a project with no packs explicitly.\n');
|
|
733
|
+
}
|
|
440
734
|
if (signatureExplanation) {
|
|
441
735
|
process.stdout.write('\n--- Signature explanation ---\n');
|
|
442
736
|
process.stdout.write(`secret env: ${signatureExplanation.secretAvailable ? 'set' : 'NOT set'}\n`);
|
|
@@ -448,7 +742,7 @@ export const packsDoctorCommand = {
|
|
|
448
742
|
process.stdout.write(` next: ${p.nextCommand}\n`);
|
|
449
743
|
}
|
|
450
744
|
}
|
|
451
|
-
return
|
|
745
|
+
return settled.exit;
|
|
452
746
|
},
|
|
453
747
|
};
|
|
454
748
|
export const packsVerifyCommand = {
|
|
@@ -619,6 +913,19 @@ function resolveManifestInput(input) {
|
|
|
619
913
|
}
|
|
620
914
|
return { manifestPath };
|
|
621
915
|
}
|
|
916
|
+
/** The package root a manifest belongs to: the nearest ancestor with a package.json. */
|
|
917
|
+
function findPackRoot(manifestPath) {
|
|
918
|
+
let dir = nodePath.dirname(manifestPath);
|
|
919
|
+
for (let i = 0; i < 8; i += 1) {
|
|
920
|
+
if (existsSync(nodePath.join(dir, 'package.json')))
|
|
921
|
+
return dir;
|
|
922
|
+
const up = nodePath.dirname(dir);
|
|
923
|
+
if (up === dir)
|
|
924
|
+
break;
|
|
925
|
+
dir = up;
|
|
926
|
+
}
|
|
927
|
+
return nodePath.dirname(manifestPath);
|
|
928
|
+
}
|
|
622
929
|
async function loadManifestFromPath(manifestPath) {
|
|
623
930
|
if (manifestPath.endsWith('.json')) {
|
|
624
931
|
return JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
@@ -734,10 +1041,15 @@ export const packsSignCommand = {
|
|
|
734
1041
|
const secret = flagString(args, 'secret');
|
|
735
1042
|
const keyId = flagString(args, 'key-id');
|
|
736
1043
|
const dev = flagBool(args, 'dev');
|
|
1044
|
+
// Record what was signed — sha256 of every contribution file (and each
|
|
1045
|
+
// compiled artifact's mapped source) — with the ONE digest function pack
|
|
1046
|
+
// freshness compares against. Freshness is content divergence, never age.
|
|
1047
|
+
const contentDigests = computePackContentDigests(findPackRoot(manifestPath), manifest);
|
|
737
1048
|
const result = signPackManifest(manifest, {
|
|
738
1049
|
...(secret !== undefined ? { secret } : {}),
|
|
739
1050
|
...(keyId !== undefined ? { keyId } : {}),
|
|
740
1051
|
...(dev ? { dev: true } : {}),
|
|
1052
|
+
contentDigests,
|
|
741
1053
|
});
|
|
742
1054
|
if (!result.ok) {
|
|
743
1055
|
process.stderr.write(result.message + '\n');
|
|
@@ -775,6 +1087,7 @@ export const packsSignCommand = {
|
|
|
775
1087
|
process.stdout.write(kv('output', outPath) + '\n');
|
|
776
1088
|
process.stdout.write(kv('algo', result.signature.algo) + '\n');
|
|
777
1089
|
process.stdout.write(kv('signed at', result.signature.signedAt) + '\n');
|
|
1090
|
+
process.stdout.write(kv('content digests', `${Object.keys(result.signature.contentDigests ?? {}).length} file(s) recorded`) + '\n');
|
|
778
1091
|
if (result.signature.keyId)
|
|
779
1092
|
process.stdout.write(kv('key id', result.signature.keyId) + '\n');
|
|
780
1093
|
if (verifyOutcome !== 'skipped') {
|
|
@@ -788,8 +1101,9 @@ export const packsSignCommand = {
|
|
|
788
1101
|
};
|
|
789
1102
|
export const packsReleaseCheckCommand = {
|
|
790
1103
|
name: 'release-check',
|
|
791
|
-
description: 'Run a deterministic release-readiness check on a pack: manifest validation, contribution loading, signature, files whitelist.',
|
|
792
|
-
usage: 'shrk packs release-check <path-to-pack> [--json]',
|
|
1104
|
+
description: 'Run a deterministic release-readiness check on a pack: manifest validation, contribution loading, signature, files whitelist. `--typecheck` also type-checks the pack\'s TS assets (exit 2 when no TS file could be checked).',
|
|
1105
|
+
usage: 'shrk packs release-check <path-to-pack> [--typecheck] [--json]',
|
|
1106
|
+
booleanFlags: new Set(['typecheck', 'json']),
|
|
793
1107
|
async run(args) {
|
|
794
1108
|
const target = args.positional[0];
|
|
795
1109
|
if (!target) {
|
|
@@ -798,19 +1112,44 @@ export const packsReleaseCheckCommand = {
|
|
|
798
1112
|
}
|
|
799
1113
|
const cwd = resolveCwd(args);
|
|
800
1114
|
const abs = nodePath.isAbsolute(target) ? target : nodePath.resolve(cwd, target);
|
|
801
|
-
const
|
|
1115
|
+
const typecheck = flagBool(args, 'typecheck');
|
|
1116
|
+
const result = await runPackReleaseCheck(abs, { typecheck });
|
|
1117
|
+
const coverage = typecheck && result.typecheck
|
|
1118
|
+
? [
|
|
1119
|
+
{
|
|
1120
|
+
unit: 'TS files',
|
|
1121
|
+
expected: result.typecheck.checkedFiles,
|
|
1122
|
+
examined: result.typecheck.ran ? result.typecheck.checkedFiles : 0,
|
|
1123
|
+
...(result.typecheck.note ? { reason: result.typecheck.note } : {}),
|
|
1124
|
+
},
|
|
1125
|
+
]
|
|
1126
|
+
: [];
|
|
1127
|
+
const settled = settleVerdict(result.passed ? 0 : 1, coverage);
|
|
802
1128
|
if (flagBool(args, 'json')) {
|
|
803
|
-
process.stdout.write(asJson(
|
|
804
|
-
|
|
1129
|
+
process.stdout.write(asJson({
|
|
1130
|
+
...result,
|
|
1131
|
+
// The settled verdict: a --typecheck that checked nothing (exit 2)
|
|
1132
|
+
// is not `passed`, whatever the findings list says.
|
|
1133
|
+
passed: settled.exit === 0,
|
|
1134
|
+
exitCode: settled.exit,
|
|
1135
|
+
verdict: settled.verdict,
|
|
1136
|
+
shortfalls: settled.shortfalls,
|
|
1137
|
+
}) + '\n');
|
|
1138
|
+
return settled.exit;
|
|
805
1139
|
}
|
|
806
1140
|
process.stdout.write(header(`Pack release check`));
|
|
807
1141
|
process.stdout.write(kv('pack', result.packPath) + '\n');
|
|
808
1142
|
process.stdout.write(kv('manifest', result.manifestFile ?? '(none)') + '\n');
|
|
809
1143
|
process.stdout.write(kv('contributions', String(result.contributionsFound)) + '\n');
|
|
810
|
-
|
|
1144
|
+
if (result.typecheck) {
|
|
1145
|
+
process.stdout.write(kv('typecheck', `${result.typecheck.ran ? result.typecheck.checkedFiles : 0} TS file(s) checked, ${result.typecheck.errors} error(s)`) + '\n');
|
|
1146
|
+
}
|
|
1147
|
+
process.stdout.write(kv('passed', String(settled.exit === 0)) + '\n\n');
|
|
811
1148
|
if (result.findings.length === 0) {
|
|
812
|
-
|
|
813
|
-
|
|
1149
|
+
const line = verdictLine(settled, 'No issues.');
|
|
1150
|
+
if (line)
|
|
1151
|
+
process.stdout.write(line + '\n');
|
|
1152
|
+
return settled.exit;
|
|
814
1153
|
}
|
|
815
1154
|
for (const f of result.findings) {
|
|
816
1155
|
process.stdout.write(` ${f.severity.toUpperCase().padEnd(8)} ${f.code.padEnd(28)} ${f.message}\n`);
|
|
@@ -821,7 +1160,10 @@ export const packsReleaseCheckCommand = {
|
|
|
821
1160
|
if (f.suggestedCommand)
|
|
822
1161
|
process.stdout.write(` $ ${f.suggestedCommand}\n`);
|
|
823
1162
|
}
|
|
824
|
-
|
|
1163
|
+
const line = verdictLine(settled, '');
|
|
1164
|
+
if (line)
|
|
1165
|
+
process.stdout.write(`\n${line}\n`);
|
|
1166
|
+
return settled.exit;
|
|
825
1167
|
},
|
|
826
1168
|
};
|
|
827
1169
|
export const packsCompatCommand = {
|
|
@@ -928,7 +1270,7 @@ export const packsDevStatusCommand = {
|
|
|
928
1270
|
const consumerAbs = consumer
|
|
929
1271
|
? (nodePath.isAbsolute(consumer) ? consumer : nodePath.resolve(resolveCwd(args), consumer))
|
|
930
1272
|
: undefined;
|
|
931
|
-
const status = buildPackDevStatus({
|
|
1273
|
+
const status = await buildPackDevStatus({
|
|
932
1274
|
packPath: abs,
|
|
933
1275
|
...(consumerAbs ? { consumerPath: consumerAbs } : {}),
|
|
934
1276
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.command.d.ts","sourceRoot":"","sources":["../../src/commands/paths.command.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"paths.command.d.ts","sourceRoot":"","sources":["../../src/commands/paths.command.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,gBAAgB,EAAE,eAmB9B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAuB7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eA6BhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eAiC9B,CAAC"}
|