@shrkcrft/cli 0.1.0-alpha.30 → 0.1.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset-preview/apply-asset-preview.js +1 -1
- package/dist/authoring/authoring-kit.d.ts +9 -1
- package/dist/authoring/authoring-kit.d.ts.map +1 -1
- package/dist/authoring/authoring-kit.js +26 -13
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts +11 -0
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts.map +1 -0
- package/dist/bootstrap/unlinked-workspace-dependency.js +99 -0
- package/dist/command-registry.d.ts +100 -1
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +130 -3
- package/dist/commands/api-diff.command.d.ts.map +1 -1
- package/dist/commands/api-diff.command.js +12 -0
- package/dist/commands/apply.command.d.ts.map +1 -1
- package/dist/commands/apply.command.js +3 -0
- package/dist/commands/arch.command.d.ts.map +1 -1
- package/dist/commands/arch.command.js +26 -7
- package/dist/commands/architecture.command.d.ts.map +1 -1
- package/dist/commands/architecture.command.js +8 -2
- package/dist/commands/baseline.command.d.ts +54 -3
- package/dist/commands/baseline.command.d.ts.map +1 -1
- package/dist/commands/baseline.command.js +582 -74
- package/dist/commands/biome.command.d.ts.map +1 -1
- package/dist/commands/biome.command.js +20 -0
- package/dist/commands/boundaries.command.d.ts +9 -1
- package/dist/commands/boundaries.command.d.ts.map +1 -1
- package/dist/commands/boundaries.command.js +88 -20
- package/dist/commands/bundle.command.d.ts.map +1 -1
- package/dist/commands/bundle.command.js +57 -11
- package/dist/commands/cache-align.command.d.ts.map +1 -1
- package/dist/commands/cache-align.command.js +3 -1
- package/dist/commands/changelog-data.d.ts.map +1 -1
- package/dist/commands/changelog-data.js +138 -0
- package/dist/commands/changes.command.d.ts.map +1 -1
- package/dist/commands/changes.command.js +15 -0
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +1241 -322
- package/dist/commands/checks.command.d.ts.map +1 -1
- package/dist/commands/checks.command.js +188 -40
- package/dist/commands/ci.command.d.ts.map +1 -1
- package/dist/commands/ci.command.js +35 -2
- package/dist/commands/code-intel.command.d.ts.map +1 -1
- package/dist/commands/code-intel.command.js +3 -0
- package/dist/commands/command-catalog.d.ts +23 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +152 -35
- package/dist/commands/commands.command.d.ts +21 -3
- package/dist/commands/commands.command.d.ts.map +1 -1
- package/dist/commands/commands.command.js +172 -27
- package/dist/commands/compress.command.d.ts.map +1 -1
- package/dist/commands/compress.command.js +4 -0
- package/dist/commands/constructs.command.d.ts.map +1 -1
- package/dist/commands/constructs.command.js +50 -12
- package/dist/commands/context.command.d.ts.map +1 -1
- package/dist/commands/context.command.js +40 -5
- package/dist/commands/contract-templates.command.d.ts.map +1 -1
- package/dist/commands/contract-templates.command.js +9 -1
- package/dist/commands/contract.command.d.ts.map +1 -1
- package/dist/commands/contract.command.js +35 -0
- package/dist/commands/conventions.command.d.ts.map +1 -1
- package/dist/commands/conventions.command.js +189 -29
- package/dist/commands/coverage.command.d.ts.map +1 -1
- package/dist/commands/coverage.command.js +9 -0
- package/dist/commands/daily.commands.d.ts +0 -1
- package/dist/commands/daily.commands.d.ts.map +1 -1
- package/dist/commands/daily.commands.js +12 -76
- package/dist/commands/dashboard.command.d.ts.map +1 -1
- package/dist/commands/dashboard.command.js +10 -0
- package/dist/commands/dev.command.d.ts.map +1 -1
- package/dist/commands/dev.command.js +45 -2
- package/dist/commands/diagnostics.command.d.ts +0 -2
- package/dist/commands/diagnostics.command.d.ts.map +1 -1
- package/dist/commands/diagnostics.command.js +5 -78
- package/dist/commands/diff-check.command.d.ts +6 -4
- package/dist/commands/diff-check.command.d.ts.map +1 -1
- package/dist/commands/diff-check.command.js +190 -103
- package/dist/commands/docs-references.command.d.ts +13 -0
- package/dist/commands/docs-references.command.d.ts.map +1 -1
- package/dist/commands/docs-references.command.js +269 -72
- package/dist/commands/doctor.command.d.ts.map +1 -1
- package/dist/commands/doctor.command.js +58 -4
- package/dist/commands/drift.command.d.ts.map +1 -1
- package/dist/commands/drift.command.js +17 -4
- package/dist/commands/eslint.command.d.ts.map +1 -1
- package/dist/commands/eslint.command.js +20 -0
- package/dist/commands/export.command.d.ts.map +1 -1
- package/dist/commands/export.command.js +23 -1
- package/dist/commands/feedback-dispatch.command.d.ts.map +1 -1
- package/dist/commands/feedback-dispatch.command.js +29 -0
- package/dist/commands/feedback.command.d.ts.map +1 -1
- package/dist/commands/feedback.command.js +6 -1
- package/dist/commands/finish.command.d.ts.map +1 -1
- package/dist/commands/finish.command.js +32 -8
- package/dist/commands/fix.command.d.ts.map +1 -1
- package/dist/commands/fix.command.js +19 -0
- package/dist/commands/gate.command.d.ts +6 -1
- package/dist/commands/gate.command.d.ts.map +1 -1
- package/dist/commands/gate.command.js +50 -124
- package/dist/commands/gates.command.d.ts +52 -0
- package/dist/commands/gates.command.d.ts.map +1 -1
- package/dist/commands/gates.command.js +811 -185
- package/dist/commands/gen.command.d.ts.map +1 -1
- package/dist/commands/gen.command.js +4 -0
- package/dist/commands/generated.command.d.ts +33 -3
- package/dist/commands/generated.command.d.ts.map +1 -1
- package/dist/commands/generated.command.js +499 -147
- package/dist/commands/graph-code-subverbs.d.ts +15 -0
- package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
- package/dist/commands/graph-code-subverbs.js +198 -24
- package/dist/commands/graph.command.d.ts.map +1 -1
- package/dist/commands/graph.command.js +79 -37
- package/dist/commands/help.command.d.ts +30 -6
- package/dist/commands/help.command.d.ts.map +1 -1
- package/dist/commands/help.command.js +323 -199
- package/dist/commands/helper.command.d.ts +1 -0
- package/dist/commands/helper.command.d.ts.map +1 -1
- package/dist/commands/helper.command.js +195 -56
- package/dist/commands/impact.command.d.ts.map +1 -1
- package/dist/commands/impact.command.js +115 -12
- package/dist/commands/infer.command.d.ts.map +1 -1
- package/dist/commands/infer.command.js +20 -45
- package/dist/commands/ingest.command.d.ts +0 -1
- package/dist/commands/ingest.command.d.ts.map +1 -1
- package/dist/commands/ingest.command.js +25 -41
- package/dist/commands/knowledge-author.command.d.ts +0 -3
- package/dist/commands/knowledge-author.command.d.ts.map +1 -1
- package/dist/commands/knowledge-author.command.js +10 -23
- package/dist/commands/knowledge.command.d.ts.map +1 -1
- package/dist/commands/knowledge.command.js +469 -129
- package/dist/commands/languages.command.d.ts.map +1 -1
- package/dist/commands/languages.command.js +27 -0
- package/dist/commands/lint.command.d.ts.map +1 -1
- package/dist/commands/lint.command.js +3 -0
- package/dist/commands/mcp.command.d.ts +18 -0
- package/dist/commands/mcp.command.d.ts.map +1 -1
- package/dist/commands/mcp.command.js +33 -8
- package/dist/commands/onboard.command.d.ts.map +1 -1
- package/dist/commands/onboard.command.js +20 -0
- package/dist/commands/owners.command.d.ts.map +1 -1
- package/dist/commands/owners.command.js +14 -2
- package/dist/commands/packs-new.d.ts +13 -1
- package/dist/commands/packs-new.d.ts.map +1 -1
- package/dist/commands/packs-new.js +500 -335
- package/dist/commands/packs.command.d.ts.map +1 -1
- package/dist/commands/packs.command.js +378 -36
- package/dist/commands/paths.command.d.ts.map +1 -1
- package/dist/commands/paths.command.js +9 -1
- package/dist/commands/pipelines.command.d.ts.map +1 -1
- package/dist/commands/pipelines.command.js +7 -1
- package/dist/commands/plan-check.command.d.ts.map +1 -1
- package/dist/commands/plan-check.command.js +3 -0
- package/dist/commands/plan.command.d.ts.map +1 -1
- package/dist/commands/plan.command.js +3 -0
- package/dist/commands/playbooks.command.d.ts.map +1 -1
- package/dist/commands/playbooks.command.js +7 -2
- package/dist/commands/policy-lint.command.d.ts +19 -2
- package/dist/commands/policy-lint.command.d.ts.map +1 -1
- package/dist/commands/policy-lint.command.js +224 -65
- package/dist/commands/policy.command.d.ts.map +1 -1
- package/dist/commands/policy.command.js +6 -1
- package/dist/commands/pr.command.d.ts.map +1 -1
- package/dist/commands/pr.command.js +14 -0
- package/dist/commands/presets.command.d.ts.map +1 -1
- package/dist/commands/presets.command.js +12 -27
- package/dist/commands/profiles.command.d.ts.map +1 -1
- package/dist/commands/profiles.command.js +94 -26
- package/dist/commands/provenance.command.js +1 -1
- package/dist/commands/quality.command.d.ts.map +1 -1
- package/dist/commands/quality.command.js +129 -33
- package/dist/commands/recommend.command.d.ts +20 -4
- package/dist/commands/recommend.command.d.ts.map +1 -1
- package/dist/commands/recommend.command.js +172 -278
- package/dist/commands/registrations.command.d.ts.map +1 -1
- package/dist/commands/registrations.command.js +138 -13
- package/dist/commands/registry-lifecycle-run.d.ts +14 -0
- package/dist/commands/registry-lifecycle-run.d.ts.map +1 -0
- package/dist/commands/registry-lifecycle-run.js +336 -0
- package/dist/commands/registry.command.d.ts.map +1 -1
- package/dist/commands/registry.command.js +235 -62
- package/dist/commands/release.command.d.ts.map +1 -1
- package/dist/commands/release.command.js +99 -20
- package/dist/commands/report.command.d.ts.map +1 -1
- package/dist/commands/report.command.js +38 -2
- package/dist/commands/reuse-coverage.command.d.ts +23 -0
- package/dist/commands/reuse-coverage.command.d.ts.map +1 -0
- package/dist/commands/reuse-coverage.command.js +536 -0
- package/dist/commands/reuse.command.d.ts +3 -18
- package/dist/commands/reuse.command.d.ts.map +1 -1
- package/dist/commands/reuse.command.js +395 -244
- package/dist/commands/review.command.d.ts.map +1 -1
- package/dist/commands/review.command.js +33 -1
- package/dist/commands/rounds.command.d.ts.map +1 -1
- package/dist/commands/rounds.command.js +5 -0
- package/dist/commands/safety.command.d.ts.map +1 -1
- package/dist/commands/safety.command.js +9 -0
- package/dist/commands/scaffolds.command.d.ts.map +1 -1
- package/dist/commands/scaffolds.command.js +97 -25
- package/dist/commands/search.command.d.ts +0 -8
- package/dist/commands/search.command.d.ts.map +1 -1
- package/dist/commands/search.command.js +136 -28
- package/dist/commands/self-config-xrefs.command.d.ts +24 -0
- package/dist/commands/self-config-xrefs.command.d.ts.map +1 -0
- package/dist/commands/self-config-xrefs.command.js +170 -0
- package/dist/commands/self-config.command.d.ts.map +1 -1
- package/dist/commands/self-config.command.js +261 -65
- package/dist/commands/smart-context.command.d.ts.map +1 -1
- package/dist/commands/smart-context.command.js +39 -3
- package/dist/commands/spec.command.d.ts.map +1 -1
- package/dist/commands/spec.command.js +3 -0
- package/dist/commands/stats.command.d.ts.map +1 -1
- package/dist/commands/stats.command.js +3 -0
- package/dist/commands/surface.command.d.ts +6 -1
- package/dist/commands/surface.command.d.ts.map +1 -1
- package/dist/commands/surface.command.js +256 -54
- package/dist/commands/task-context.command.js +1 -1
- package/dist/commands/task.command.d.ts.map +1 -1
- package/dist/commands/task.command.js +22 -1
- package/dist/commands/templates.command.d.ts +4 -0
- package/dist/commands/templates.command.d.ts.map +1 -1
- package/dist/commands/templates.command.js +109 -22
- package/dist/commands/test.command.d.ts.map +1 -1
- package/dist/commands/test.command.js +161 -33
- package/dist/commands/tests.command.d.ts.map +1 -1
- package/dist/commands/tests.command.js +29 -3
- package/dist/commands/trace.command.d.ts.map +1 -1
- package/dist/commands/trace.command.js +29 -4
- package/dist/commands/watch.command.d.ts.map +1 -1
- package/dist/commands/watch.command.js +3 -0
- package/dist/commands/why.command.d.ts.map +1 -1
- package/dist/commands/why.command.js +3 -0
- package/dist/commands/wiring.command.d.ts +18 -4
- package/dist/commands/wiring.command.d.ts.map +1 -1
- package/dist/commands/wiring.command.js +360 -73
- package/dist/dashboard/code-intelligence-data.js +4 -4
- package/dist/diff/deleted-orphan-coverage.d.ts +32 -0
- package/dist/diff/deleted-orphan-coverage.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-coverage.js +107 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts +23 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-scope-notes.js +49 -0
- package/dist/diff/deleted-orphans.d.ts +32 -0
- package/dist/diff/deleted-orphans.d.ts.map +1 -1
- package/dist/diff/deleted-orphans.js +42 -2
- package/dist/dispatch/closest-match.d.ts +15 -0
- package/dist/dispatch/closest-match.d.ts.map +1 -0
- package/dist/dispatch/closest-match.js +47 -0
- package/dist/dispatch/global-flags.d.ts +94 -0
- package/dist/dispatch/global-flags.d.ts.map +1 -0
- package/dist/dispatch/global-flags.js +123 -0
- package/dist/dispatch/guard-invocation-input.d.ts +24 -0
- package/dist/dispatch/guard-invocation-input.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation-input.js +1 -0
- package/dist/dispatch/guard-invocation.d.ts +33 -0
- package/dist/dispatch/guard-invocation.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation.js +183 -0
- package/dist/dispatch/help-intercept.d.ts +22 -0
- package/dist/dispatch/help-intercept.d.ts.map +1 -0
- package/dist/dispatch/help-intercept.js +42 -0
- package/dist/dispatch/i-declared-invocation.d.ts +17 -0
- package/dist/dispatch/i-declared-invocation.d.ts.map +1 -0
- package/dist/dispatch/i-declared-invocation.js +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts +28 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts.map +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.js +1 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts +15 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection-kind.js +15 -0
- package/dist/dispatch/invocation-rejection.d.ts +18 -0
- package/dist/dispatch/invocation-rejection.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection.js +1 -0
- package/dist/dispatch/judge-invocation.d.ts +24 -0
- package/dist/dispatch/judge-invocation.d.ts.map +1 -0
- package/dist/dispatch/judge-invocation.js +50 -0
- package/dist/dispatch/positional-mode.d.ts +18 -0
- package/dist/dispatch/positional-mode.d.ts.map +1 -0
- package/dist/dispatch/positional-mode.js +18 -0
- package/dist/dispatch/read-tracking-map.d.ts +28 -0
- package/dist/dispatch/read-tracking-map.d.ts.map +1 -0
- package/dist/dispatch/read-tracking-map.js +58 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts +30 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts.map +1 -0
- package/dist/dispatch/refuse-sibling-valve-flags.js +65 -0
- package/dist/dispatch/subverb-spec.d.ts +26 -0
- package/dist/dispatch/subverb-spec.d.ts.map +1 -0
- package/dist/dispatch/subverb-spec.js +1 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts +22 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts.map +1 -0
- package/dist/dispatch/undocumented-flag-reads.js +283 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts +13 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal-mode.js +13 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts +22 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal.js +57 -0
- package/dist/dispatch/unread-flags.d.ts +152 -0
- package/dist/dispatch/unread-flags.d.ts.map +1 -0
- package/dist/dispatch/unread-flags.js +295 -0
- package/dist/dispatch/verdict-valve-flag.d.ts +21 -0
- package/dist/dispatch/verdict-valve-flag.d.ts.map +1 -0
- package/dist/dispatch/verdict-valve-flag.js +21 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts +14 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts.map +1 -0
- package/dist/dispatch/walk-declared-subverbs.js +28 -0
- package/dist/exit-codes.d.ts +41 -3
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +153 -14
- package/dist/finish/run-finish.d.ts +72 -5
- package/dist/finish/run-finish.d.ts.map +1 -1
- package/dist/finish/run-finish.js +453 -104
- package/dist/gates/accepted-empty-note.d.ts +10 -0
- package/dist/gates/accepted-empty-note.d.ts.map +1 -0
- package/dist/gates/accepted-empty-note.js +11 -0
- package/dist/gates/allow-empty.d.ts +25 -0
- package/dist/gates/allow-empty.d.ts.map +1 -0
- package/dist/gates/allow-empty.js +27 -0
- package/dist/gates/asset-doctor-failing-units.d.ts +16 -0
- package/dist/gates/asset-doctor-failing-units.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failing-units.js +14 -0
- package/dist/gates/asset-doctor-failure-line.d.ts +16 -0
- package/dist/gates/asset-doctor-failure-line.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failure-line.js +28 -0
- package/dist/gates/empty-rule-advice-lines.d.ts +15 -0
- package/dist/gates/empty-rule-advice-lines.d.ts.map +1 -0
- package/dist/gates/empty-rule-advice-lines.js +20 -0
- package/dist/gates/gate-envelope.d.ts +85 -8
- package/dist/gates/gate-envelope.d.ts.map +1 -1
- package/dist/gates/gate-envelope.js +56 -7
- package/dist/gates/gate-rule-globs.d.ts +37 -3
- package/dist/gates/gate-rule-globs.d.ts.map +1 -1
- package/dist/gates/gate-rule-globs.js +78 -40
- package/dist/gates/gate-rule-view.d.ts +17 -4
- package/dist/gates/gate-rule-view.d.ts.map +1 -1
- package/dist/gates/gate-rule-view.js +105 -90
- package/dist/gates/i-coverage-dead-glob.d.ts +19 -0
- package/dist/gates/i-coverage-dead-glob.d.ts.map +1 -0
- package/dist/gates/i-coverage-dead-glob.js +1 -0
- package/dist/gates/i-coverage-negation.d.ts +13 -0
- package/dist/gates/i-coverage-negation.d.ts.map +1 -0
- package/dist/gates/i-coverage-negation.js +1 -0
- package/dist/gates/i-registration-query-settle-input.d.ts +18 -0
- package/dist/gates/i-registration-query-settle-input.d.ts.map +1 -0
- package/dist/gates/i-registration-query-settle-input.js +1 -0
- package/dist/gates/i-unit-state-note-row.d.ts +16 -0
- package/dist/gates/i-unit-state-note-row.d.ts.map +1 -0
- package/dist/gates/i-unit-state-note-row.js +1 -0
- package/dist/gates/i-unit-state-notes.d.ts +32 -0
- package/dist/gates/i-unit-state-notes.d.ts.map +1 -0
- package/dist/gates/i-unit-state-notes.js +1 -0
- package/dist/gates/incomplete-registry-inventory.d.ts +19 -0
- package/dist/gates/incomplete-registry-inventory.d.ts.map +1 -0
- package/dist/gates/incomplete-registry-inventory.js +63 -0
- package/dist/gates/measure-registration-roles.d.ts +10 -0
- package/dist/gates/measure-registration-roles.d.ts.map +1 -0
- package/dist/gates/measure-registration-roles.js +9 -0
- package/dist/gates/plane-verdict.d.ts +14 -0
- package/dist/gates/plane-verdict.d.ts.map +1 -0
- package/dist/gates/plane-verdict.js +22 -0
- package/dist/gates/qualify-clean-for-units.d.ts +12 -0
- package/dist/gates/qualify-clean-for-units.d.ts.map +1 -0
- package/dist/gates/qualify-clean-for-units.js +18 -0
- package/dist/gates/registration-graph-verdict.d.ts +34 -0
- package/dist/gates/registration-graph-verdict.d.ts.map +1 -0
- package/dist/gates/registration-graph-verdict.js +70 -0
- package/dist/gates/registration-roles.d.ts +9 -0
- package/dist/gates/registration-roles.d.ts.map +1 -0
- package/dist/gates/registration-roles.js +1 -0
- package/dist/gates/registry-liveness.d.ts +11 -0
- package/dist/gates/registry-liveness.d.ts.map +1 -0
- package/dist/gates/registry-liveness.js +13 -0
- package/dist/gates/rule-coverage.d.ts +187 -4
- package/dist/gates/rule-coverage.d.ts.map +1 -1
- package/dist/gates/rule-coverage.js +501 -49
- package/dist/gates/run-gate-planes.d.ts +14 -0
- package/dist/gates/run-gate-planes.d.ts.map +1 -1
- package/dist/gates/run-gate-planes.js +172 -30
- package/dist/gates/scaffold-selftest.d.ts +56 -0
- package/dist/gates/scaffold-selftest.d.ts.map +1 -0
- package/dist/gates/scaffold-selftest.js +119 -0
- package/dist/gates/seam-rejected-rules.d.ts +28 -0
- package/dist/gates/seam-rejected-rules.d.ts.map +1 -0
- package/dist/gates/seam-rejected-rules.js +95 -0
- package/dist/gates/self-test-check.d.ts +29 -0
- package/dist/gates/self-test-check.d.ts.map +1 -0
- package/dist/gates/self-test-check.js +1 -0
- package/dist/gates/self-test-subject.d.ts +28 -0
- package/dist/gates/self-test-subject.d.ts.map +1 -0
- package/dist/gates/self-test-subject.js +1 -0
- package/dist/gates/self-test.d.ts +20 -0
- package/dist/gates/self-test.d.ts.map +1 -0
- package/dist/gates/self-test.js +82 -0
- package/dist/gates/settle-verdict.d.ts +14 -0
- package/dist/gates/settle-verdict.d.ts.map +1 -0
- package/dist/gates/settle-verdict.js +13 -0
- package/dist/gates/settled-verdict.d.ts +8 -0
- package/dist/gates/settled-verdict.d.ts.map +1 -0
- package/dist/gates/settled-verdict.js +1 -0
- package/dist/gates/template-registry-coverage.d.ts +18 -0
- package/dist/gates/template-registry-coverage.d.ts.map +1 -0
- package/dist/gates/template-registry-coverage.js +24 -0
- package/dist/gates/unit-state-notes.d.ts +40 -0
- package/dist/gates/unit-state-notes.d.ts.map +1 -0
- package/dist/gates/unit-state-notes.js +71 -0
- package/dist/gates/verdict-line.d.ts +18 -0
- package/dist/gates/verdict-line.d.ts.map +1 -0
- package/dist/gates/verdict-line.js +40 -0
- package/dist/graph/graph-reuse-lookup.d.ts +10 -0
- package/dist/graph/graph-reuse-lookup.d.ts.map +1 -0
- package/dist/graph/graph-reuse-lookup.js +41 -0
- package/dist/graph/index-behind-hint.d.ts +11 -0
- package/dist/graph/index-behind-hint.d.ts.map +1 -0
- package/dist/graph/index-behind-hint.js +27 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts +10 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate.js +9 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +200 -83
- package/dist/output/failure-hints.d.ts.map +1 -1
- package/dist/output/failure-hints.js +11 -9
- package/dist/output/rejected-entries-note.d.ts +57 -0
- package/dist/output/rejected-entries-note.d.ts.map +1 -0
- package/dist/output/rejected-entries-note.js +103 -0
- package/dist/output/stdout-is-pipe.d.ts +13 -0
- package/dist/output/stdout-is-pipe.d.ts.map +1 -0
- package/dist/output/stdout-is-pipe.js +21 -0
- package/dist/packs/stale-build-warning.d.ts +11 -0
- package/dist/packs/stale-build-warning.d.ts.map +1 -0
- package/dist/packs/stale-build-warning.js +23 -0
- package/dist/quality/run-quality.d.ts +123 -0
- package/dist/quality/run-quality.d.ts.map +1 -0
- package/dist/quality/run-quality.js +442 -0
- package/dist/schemas/json-schemas.d.ts +184 -3
- package/dist/schemas/json-schemas.d.ts.map +1 -1
- package/dist/schemas/json-schemas.js +113 -2
- package/dist/shrk.d.ts +3 -0
- package/dist/shrk.d.ts.map +1 -0
- package/dist/shrk.js +30 -0
- package/dist/surface/audience-applicability.d.ts +26 -0
- package/dist/surface/audience-applicability.d.ts.map +1 -0
- package/dist/surface/audience-applicability.js +60 -0
- package/dist/surface/catalog-command-safety.d.ts +18 -0
- package/dist/surface/catalog-command-safety.d.ts.map +1 -0
- package/dist/surface/catalog-command-safety.js +62 -0
- package/dist/surface/cli-command-resolver.d.ts +21 -0
- package/dist/surface/cli-command-resolver.d.ts.map +1 -0
- package/dist/surface/cli-command-resolver.js +87 -0
- package/dist/surface/command-dispatch-kind.d.ts +20 -0
- package/dist/surface/command-dispatch-kind.d.ts.map +1 -0
- package/dist/surface/command-dispatch-kind.js +20 -0
- package/dist/surface/command-index-entry.d.ts +40 -0
- package/dist/surface/command-index-entry.d.ts.map +1 -0
- package/dist/surface/command-index-entry.js +1 -0
- package/dist/surface/command-index.d.ts +77 -0
- package/dist/surface/command-index.d.ts.map +1 -0
- package/dist/surface/command-index.js +323 -0
- package/dist/surface/i-command-index.d.ts +22 -0
- package/dist/surface/i-command-index.d.ts.map +1 -0
- package/dist/surface/i-command-index.js +1 -0
- package/dist/surface/i-command-string-context.d.ts +20 -0
- package/dist/surface/i-command-string-context.d.ts.map +1 -0
- package/dist/surface/i-command-string-context.js +1 -0
- package/dist/surface/i-surface-denial.d.ts +13 -0
- package/dist/surface/i-surface-denial.d.ts.map +1 -0
- package/dist/surface/i-surface-denial.js +1 -0
- package/dist/surface/load-surface-context.d.ts +17 -1
- package/dist/surface/load-surface-context.d.ts.map +1 -1
- package/dist/surface/load-surface-context.js +48 -10
- package/dist/surface/not-enabled-error.d.ts +38 -4
- package/dist/surface/not-enabled-error.d.ts.map +1 -1
- package/dist/surface/not-enabled-error.js +96 -6
- package/dist/surface/profiles.d.ts +7 -0
- package/dist/surface/profiles.d.ts.map +1 -1
- package/dist/surface/resolve-command-string.d.ts +10 -0
- package/dist/surface/resolve-command-string.d.ts.map +1 -0
- package/dist/surface/resolve-command-string.js +572 -0
- package/dist/surface/surface-config-writer.d.ts +7 -2
- package/dist/surface/surface-config-writer.d.ts.map +1 -1
- package/dist/surface/surface-config-writer.js +25 -6
- package/dist/surface/surface-layer.d.ts +11 -0
- package/dist/surface/surface-layer.d.ts.map +1 -0
- package/dist/surface/surface-layer.js +11 -0
- package/dist/surface/surface-refusal-reason.d.ts +16 -0
- package/dist/surface/surface-refusal-reason.d.ts.map +1 -0
- package/dist/surface/surface-refusal-reason.js +16 -0
- package/dist/surface/surface-selector.d.ts +26 -0
- package/dist/surface/surface-selector.d.ts.map +1 -0
- package/dist/surface/surface-selector.js +42 -0
- package/dist/surface/surface-summary.d.ts +61 -18
- package/dist/surface/surface-summary.d.ts.map +1 -1
- package/dist/surface/surface-summary.js +147 -60
- package/dist/surface/tier.d.ts +85 -22
- package/dist/surface/tier.d.ts.map +1 -1
- package/dist/surface/tier.js +132 -30
- package/dist/usage/usage-log.d.ts +6 -1
- package/dist/usage/usage-log.d.ts.map +1 -1
- package/dist/usage/usage-log.js +7 -2
- package/dist/validation/run-validation-loop.d.ts +9 -0
- package/dist/validation/run-validation-loop.d.ts.map +1 -1
- package/dist/validation/run-validation-loop.js +14 -11
- package/dist/validation/typecheck-emitted.d.ts +8 -9
- package/dist/validation/typecheck-emitted.d.ts.map +1 -1
- package/dist/validation/typecheck-emitted.js +17 -97
- package/package.json +34 -34
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inspectSharkcraft } from '@shrkcrft/inspector';
|
|
2
2
|
import { formatEntryCompact, formatEntryFull } from '@shrkcrft/knowledge';
|
|
3
|
-
import { flagBool, flagNumber, flagString, flagList, resolveCwd, } from "../command-registry.js";
|
|
3
|
+
import { flagBool, flagNumber, flagString, flagList, requireInputSelector, resolveCwd, } from "../command-registry.js";
|
|
4
4
|
import { asJson, header } from "../output/format-output.js";
|
|
5
5
|
export const pathsListCommand = {
|
|
6
6
|
name: 'list',
|
|
@@ -51,6 +51,14 @@ export const pathsSearchCommand = {
|
|
|
51
51
|
description: 'Search path conventions.',
|
|
52
52
|
usage: 'shrk paths search <query> [--scope x,y] [--limit 10]',
|
|
53
53
|
async run(args) {
|
|
54
|
+
// No query and no scope is a usage error (3), never `Results (0)` at exit 0.
|
|
55
|
+
const noSelector = requireInputSelector(args, {
|
|
56
|
+
flags: ['scope'],
|
|
57
|
+
positional: true,
|
|
58
|
+
usage: 'shrk paths search <query> [--scope x,y] [--limit 10]',
|
|
59
|
+
});
|
|
60
|
+
if (noSelector !== null)
|
|
61
|
+
return noSelector;
|
|
54
62
|
const query = args.positional.join(' ').trim();
|
|
55
63
|
const scope = flagList(args, 'scope');
|
|
56
64
|
const limit = flagNumber(args, 'limit') ?? 10;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelines.command.d.ts","sourceRoot":"","sources":["../../src/commands/pipelines.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipelines.command.d.ts","sourceRoot":"","sources":["../../src/commands/pipelines.command.ts"],"names":[],"mappings":"AAgBA,OAAO,EAOL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC,eAAO,MAAM,oBAAoB,EAAE,eAgClC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAuBjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAuDrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eA+DlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAoCpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eA6ClC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAiElC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { inspectSharkcraft, buildProjectOverview, renderOverviewText, contextTuningBoostFor, } from '@shrkcrft/inspector';
|
|
1
|
+
import { ContributionKind, inspectSharkcraft, buildProjectOverview, renderOverviewText, contextTuningBoostFor, } from '@shrkcrft/inspector';
|
|
2
2
|
import { buildContext } from '@shrkcrft/context';
|
|
3
3
|
import { findNextStep, formatPipelineCompact, formatPipelineFull, interpolatePipeline, renderPipelineScript, } from '@shrkcrft/pipelines';
|
|
4
4
|
import { flagBool, flagNumber, flagString, flagList, flagVars, resolveCwd, } from "../command-registry.js";
|
|
5
5
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
6
|
+
import { writeRejectedEntriesNote } from "../output/rejected-entries-note.js";
|
|
6
7
|
export const pipelinesListCommand = {
|
|
7
8
|
name: 'list',
|
|
8
9
|
description: 'List available pipelines.',
|
|
@@ -10,6 +11,9 @@ export const pipelinesListCommand = {
|
|
|
10
11
|
async run(args) {
|
|
11
12
|
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
12
13
|
const list = inspection.pipelineRegistry.list();
|
|
14
|
+
// A pipeline its loader refused (no `description`, a duplicate id) is named
|
|
15
|
+
// (round 12, 12.1) — it used to vanish from every surface.
|
|
16
|
+
const note = { next: 'shrk packs contributions' };
|
|
13
17
|
if (flagBool(args, 'json')) {
|
|
14
18
|
process.stdout.write(asJson(list.map((p) => ({
|
|
15
19
|
id: p.id,
|
|
@@ -20,11 +24,13 @@ export const pipelinesListCommand = {
|
|
|
20
24
|
appliesWhen: p.appliesWhen ?? [],
|
|
21
25
|
stepCount: p.steps.length,
|
|
22
26
|
}))) + '\n');
|
|
27
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Pipeline], { ...note, json: true });
|
|
23
28
|
return 0;
|
|
24
29
|
}
|
|
25
30
|
process.stdout.write(header(`Pipelines (${list.length})`));
|
|
26
31
|
for (const p of list)
|
|
27
32
|
process.stdout.write(formatPipelineCompact(p) + '\n');
|
|
33
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Pipeline], note);
|
|
28
34
|
return 0;
|
|
29
35
|
},
|
|
30
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-check.command.d.ts","sourceRoot":"","sources":["../../src/commands/plan-check.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"plan-check.command.d.ts","sourceRoot":"","sources":["../../src/commands/plan-check.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,EAAE;QACZ,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,EAAE,eA2E9B,CAAC"}
|
|
@@ -12,10 +12,13 @@ import * as nodePath from 'node:path';
|
|
|
12
12
|
import { getExtractorById, pickExtractor, } from '@shrkcrft/generator';
|
|
13
13
|
import { inspectSharkcraft, loadNxProjects, mapFilesToProjects, validateExtractedPlan, } from '@shrkcrft/inspector';
|
|
14
14
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
15
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
15
16
|
import { asJson, header } from "../output/format-output.js";
|
|
16
17
|
export const PLAN_CHECK_SCHEMA = 'sharkcraft.plan-check/v1';
|
|
17
18
|
export const planCheckCommand = {
|
|
18
19
|
name: 'check',
|
|
20
|
+
// positional[0] is the plan / spec FILE; a verb-shaped non-file is refused.
|
|
21
|
+
positionals: PositionalMode.Path,
|
|
19
22
|
description: 'Validate an external plan/spec file against the live workspace. Read-only — the input file is never modified. Supports two built-in extractors and an optional --field-map.',
|
|
20
23
|
usage: 'shrk plan check <path> [--extractor sharkcraft.spec/v1|markdown-frontmatter-loose] [--field-map <json>] [--json] [--strict]',
|
|
21
24
|
async run(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.command.d.ts","sourceRoot":"","sources":["../../src/commands/plan.command.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.command.d.ts","sourceRoot":"","sources":["../../src/commands/plan.command.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,iBAAiB,EAAE,eAkH/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAuB/B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import * as nodePath from 'node:path';
|
|
|
2
2
|
import { buildApplyDispatchTrace, inspectSharkcraft, renderApplyDispatchTraceText, reviewSavedPlan, } from '@shrkcrft/inspector';
|
|
3
3
|
import { readPlanFromFile } from '@shrkcrft/generator';
|
|
4
4
|
import { flagBool, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
5
6
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
6
7
|
import { planSimulateCommand } from "./plan-simulate.command.js";
|
|
7
8
|
export const planReviewCommand = {
|
|
@@ -117,6 +118,8 @@ export const planReviewCommand = {
|
|
|
117
118
|
*/
|
|
118
119
|
export const planParentCommand = {
|
|
119
120
|
name: 'plan',
|
|
121
|
+
// Mixed-mode: review / simulate / check are trie children.
|
|
122
|
+
positionals: PositionalMode.None,
|
|
120
123
|
description: 'Inspect generation plans. Subcommand required.',
|
|
121
124
|
usage: 'shrk plan review|simulate <plan.json>',
|
|
122
125
|
async run(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playbooks.command.d.ts","sourceRoot":"","sources":["../../src/commands/playbooks.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playbooks.command.d.ts","sourceRoot":"","sources":["../../src/commands/playbooks.command.ts"],"names":[],"mappings":"AAcA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAchC,eAAO,MAAM,oBAAoB,EAAE,eAqBlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eA4BjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,eA4BvC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eA6CrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eA6BnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAoCpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eA6CrC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAiCtC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { buildAgentBrief, buildPlaybookPreview, buildPlaybookScript, buildRunbook, inspectSharkcraft, loadPlaybooks, recommendPlaybooks, validatePlaybook, } from '@shrkcrft/inspector';
|
|
3
|
+
import { buildAgentBrief, buildPlaybookPreview, buildPlaybookScript, buildRunbook, ContributionKind, inspectSharkcraft, loadPlaybooks, recommendPlaybooks, validatePlaybook, } from '@shrkcrft/inspector';
|
|
4
4
|
import { flagBool, flagNumber, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
5
|
import { asJson, header } from "../output/format-output.js";
|
|
6
|
+
import { writeRejectedEntriesNote } from "../output/rejected-entries-note.js";
|
|
6
7
|
async function loadAll(args) {
|
|
7
8
|
const cwd = resolveCwd(args);
|
|
8
9
|
const inspection = await inspectSharkcraft({ cwd });
|
|
@@ -14,9 +15,12 @@ export const playbooksListCommand = {
|
|
|
14
15
|
description: 'List registered playbooks.',
|
|
15
16
|
usage: 'shrk playbooks list [--json]',
|
|
16
17
|
async run(args) {
|
|
17
|
-
const { playbooks } = await loadAll(args);
|
|
18
|
+
const { playbooks, inspection } = await loadAll(args);
|
|
19
|
+
// A playbook its loader refused (no id, no `steps`) is named (round 12, 12.1).
|
|
20
|
+
const note = { next: 'shrk packs contributions' };
|
|
18
21
|
if (flagBool(args, 'json')) {
|
|
19
22
|
process.stdout.write(asJson(playbooks) + '\n');
|
|
23
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Playbook], { ...note, json: true });
|
|
20
24
|
return 0;
|
|
21
25
|
}
|
|
22
26
|
process.stdout.write(header(`Playbooks (${playbooks.length})`));
|
|
@@ -25,6 +29,7 @@ export const playbooksListCommand = {
|
|
|
25
29
|
for (const p of playbooks) {
|
|
26
30
|
process.stdout.write(` ${p.id.padEnd(36)} ${p.title}\n`);
|
|
27
31
|
}
|
|
32
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Playbook], note);
|
|
28
33
|
return 0;
|
|
29
34
|
},
|
|
30
35
|
};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type IPolicyFinding, type IPolicySuppression } from '@shrkcrft/boundaries';
|
|
1
|
+
import { type IPolicyRule, type IVerdictCoverage, type PolicySurface } from '@shrkcrft/core';
|
|
2
|
+
import { type IPolicyFinding, type IPolicyReport, type IPolicySuppression } from '@shrkcrft/boundaries';
|
|
3
3
|
import { type ICommandHandler } from '../command-registry.js';
|
|
4
|
+
/**
|
|
5
|
+
* What one policy rule examined — the ENGINE's record
|
|
6
|
+
* (`IPolicyRuleResult.coverage`, @shrkcrft/boundaries), read here and never
|
|
7
|
+
* recomputed, so `policy-lint`, the aggregate (`gates check`, `quality`), `shrk
|
|
8
|
+
* gate` and `finish` all report one scope for one rule. A policy rule examines
|
|
9
|
+
* every content unit its globs matched; one that scanned nothing (or could not
|
|
10
|
+
* run) examined nothing.
|
|
11
|
+
*/
|
|
12
|
+
export declare function policyRuleCoverage(r: {
|
|
13
|
+
readonly coverage: IVerdictCoverage;
|
|
14
|
+
}): IVerdictCoverage;
|
|
4
15
|
export declare const POLICY_EXPLAIN_SCHEMA: "sharkcraft.policy-explain/v1";
|
|
5
16
|
/** What ONE policy rule resolved to against the live tree. */
|
|
6
17
|
export interface IPolicyExplain {
|
|
@@ -23,6 +34,12 @@ export interface IPolicyExplain {
|
|
|
23
34
|
readonly diagnostics: readonly string[];
|
|
24
35
|
/** Why the rule scanned nothing, when it did. */
|
|
25
36
|
readonly skipReason?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The rule's non-live `files` units as the engine settled them (round 13
|
|
39
|
+
* review) — the explain view prints a dead unit and a went-live marker
|
|
40
|
+
* through THE shared unit-state renderer, as `policy-lint` does.
|
|
41
|
+
*/
|
|
42
|
+
readonly unitLiveness?: IPolicyReport['rules'][number]['unitLiveness'];
|
|
26
43
|
}
|
|
27
44
|
/**
|
|
28
45
|
* Dry-run ONE policy rule and return everything it saw — including the hits an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy-lint.command.d.ts","sourceRoot":"","sources":["../../src/commands/policy-lint.command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"policy-lint.command.d.ts","sourceRoot":"","sources":["../../src/commands/policy-lint.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAgBhC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,GAAG,gBAAgB,CAE/F;AAGD,eAAO,MAAM,qBAAqB,EAAG,8BAAuC,CAAC;AAE7E,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,qBAAqB,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;CACxE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,cAAc,CAsBhB;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CA2DtF;AAGD,eAAO,MAAM,wBAAwB,EAAE,eA6BtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eA6Y/B,CAAC"}
|
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { runPolicyLint, } from '@shrkcrft/boundaries';
|
|
1
|
+
import { formatEmptyRuleAdvice } from '@shrkcrft/core';
|
|
2
|
+
import { planeScanExcludeDirs, runPolicyLint, } from '@shrkcrft/boundaries';
|
|
3
3
|
import { classifyChangedScope, resolveChangedFiles, resolveProjectConfig } from '@shrkcrft/inspector';
|
|
4
4
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
5
6
|
import { ExitCode } from "../exit-codes.js";
|
|
6
7
|
import { buildGateEnvelope } from "../gates/gate-envelope.js";
|
|
8
|
+
import { ALLOW_EMPTY_FLAG, allowEmptyValve } from "../gates/allow-empty.js";
|
|
9
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
10
|
+
import { acceptedEmptyNote } from "../gates/accepted-empty-note.js";
|
|
11
|
+
import { emptyRuleAdviceLines } from "../gates/empty-rule-advice-lines.js";
|
|
12
|
+
import { qualifyCleanForUnits } from "../gates/qualify-clean-for-units.js";
|
|
13
|
+
import { unitStateNotes } from "../gates/unit-state-notes.js";
|
|
14
|
+
import { planeVerdictForExit } from "../gates/plane-verdict.js";
|
|
15
|
+
import { seamRejectedRules } from "../gates/seam-rejected-rules.js";
|
|
7
16
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
8
17
|
const VALID_SURFACES = new Set(['template', 'style', 'ts']);
|
|
18
|
+
/**
|
|
19
|
+
* What one policy rule examined — the ENGINE's record
|
|
20
|
+
* (`IPolicyRuleResult.coverage`, @shrkcrft/boundaries), read here and never
|
|
21
|
+
* recomputed, so `policy-lint`, the aggregate (`gates check`, `quality`), `shrk
|
|
22
|
+
* gate` and `finish` all report one scope for one rule. A policy rule examines
|
|
23
|
+
* every content unit its globs matched; one that scanned nothing (or could not
|
|
24
|
+
* run) examined nothing.
|
|
25
|
+
*/
|
|
26
|
+
export function policyRuleCoverage(r) {
|
|
27
|
+
return r.coverage;
|
|
28
|
+
}
|
|
9
29
|
export const POLICY_EXPLAIN_SCHEMA = 'sharkcraft.policy-explain/v1';
|
|
10
30
|
/**
|
|
11
31
|
* Dry-run ONE policy rule and return everything it saw — including the hits an
|
|
@@ -35,6 +55,7 @@ export function runPolicyExplain(cwd, rule, excludeDirs) {
|
|
|
35
55
|
...(rule.exemptLines ? { exemptLines: rule.exemptLines } : {}),
|
|
36
56
|
diagnostics: report.diagnostics,
|
|
37
57
|
...(skip ? { skipReason: skip.reason } : {}),
|
|
58
|
+
...(result?.unitLiveness !== undefined ? { unitLiveness: result.unitLiveness } : {}),
|
|
38
59
|
};
|
|
39
60
|
}
|
|
40
61
|
/** Render an {@link IPolicyExplain}. Always returns 0 — explain is informational. */
|
|
@@ -73,8 +94,21 @@ export function renderPolicyExplain(explain, wantJson) {
|
|
|
73
94
|
}
|
|
74
95
|
if (explain.skipReason) {
|
|
75
96
|
process.stdout.write(`\n! SKIPPED — ${explain.skipReason}. A rule that scans nothing is a bug in the rule,\n` +
|
|
76
|
-
|
|
97
|
+
` not a pass. ${formatEmptyRuleAdvice({ fails: explain.status === 'failed' })}.\n`);
|
|
77
98
|
}
|
|
99
|
+
// THE shared unit-state block (round 13 review): a dead `files` glob, a
|
|
100
|
+
// LOCAL marker whose target appeared and a pack marker (INFO) — as
|
|
101
|
+
// `policy-lint` prints them; explain said `status passed` over a went-live one.
|
|
102
|
+
process.stdout.write(unitStateNotes([
|
|
103
|
+
{
|
|
104
|
+
id: explain.ruleId,
|
|
105
|
+
...(explain.unitLiveness !== undefined ? { unitLiveness: explain.unitLiveness } : {}),
|
|
106
|
+
reportedEmpty: explain.skipReason !== undefined,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
// An explain view names every unit state — the intended-empty ones too
|
|
110
|
+
// (round 13, K6), as the registry / registration explain views do.
|
|
111
|
+
{ intendedEmpty: true }).text);
|
|
78
112
|
for (const d of explain.diagnostics)
|
|
79
113
|
process.stdout.write(` ! ${d}\n`);
|
|
80
114
|
return 0;
|
|
@@ -102,16 +136,17 @@ export const policyLintExplainCommand = {
|
|
|
102
136
|
process.stderr.write(`No policy rule "${id}". Configured: ${rules.map((r) => r.id).join(', ') || '(none)'}\n`);
|
|
103
137
|
return ExitCode.UsageError;
|
|
104
138
|
}
|
|
105
|
-
const
|
|
106
|
-
const excludeDirs = rel && !rel.startsWith('..') ? [rel] : [];
|
|
139
|
+
const excludeDirs = planeScanExcludeDirs(cwd, loaded.value.sharkcraftDir);
|
|
107
140
|
return renderPolicyExplain(runPolicyExplain(cwd, rule, excludeDirs), flagBool(args, 'json'));
|
|
108
141
|
},
|
|
109
142
|
};
|
|
110
143
|
export const policyLintCommand = {
|
|
111
144
|
name: 'policy-lint',
|
|
145
|
+
// Flag-driven; `explain` is a trie child. A bare token used to be ignored.
|
|
146
|
+
positionals: PositionalMode.None,
|
|
112
147
|
description: 'Lint template/markup, stylesheet, and AOT-invisible TS surfaces against data-defined policyRules[] (e.g. flag raw markup when a primitive exists). Sees `.html` files AND inline `template:` strings — surfaces tsc/AOT cannot. Deterministic; no AI.',
|
|
113
|
-
usage: 'shrk [--cwd <dir>] policy-lint [--surface template|style|ts] [--changed-only] [--new-only] [--since <ref>] [--only <ids>] [--json]\n (--changed-only SCANS just the changed files; --new-only scans the whole tree but shows only findings the change introduced, hiding pre-existing baseline debt)',
|
|
114
|
-
booleanFlags: new Set(['json', 'changed-only', 'new-only']),
|
|
148
|
+
usage: 'shrk [--cwd <dir>] policy-lint [--surface template|style|ts] [--changed-only] [--new-only] [--since <ref>] [--only <ids>] [--allow-empty] [--json]\n (--changed-only SCANS just the changed files; --new-only scans the whole tree but shows only findings the change introduced, hiding pre-existing baseline debt)',
|
|
149
|
+
booleanFlags: new Set(['json', 'changed-only', 'new-only', ALLOW_EMPTY_FLAG]),
|
|
115
150
|
async run(args) {
|
|
116
151
|
const cwd = resolveCwd(args);
|
|
117
152
|
const wantJson = flagBool(args, 'json');
|
|
@@ -148,26 +183,54 @@ export const policyLintCommand = {
|
|
|
148
183
|
}
|
|
149
184
|
const rules = loaded.value.config.policyRules ?? [];
|
|
150
185
|
const planeDiagnostics = loaded.value.planeDiagnostics;
|
|
151
|
-
|
|
186
|
+
// A pack policy rule the merge seam rejected is a configured rule that did
|
|
187
|
+
// NOT run — an errored row, exit 1 (round 12 review, R12-X1). It used to be
|
|
188
|
+
// an advisory diagnostic under "No policy violations ✓".
|
|
189
|
+
const rejectedAll = seamRejectedRules(loaded.value, ['policy']);
|
|
190
|
+
if (rules.length === 0 && rejectedAll.length === 0) {
|
|
191
|
+
// Nothing declared is NOT a pass — the request covered zero rules, so it
|
|
192
|
+
// proved nothing: `2`, unless the caller accepts the empty set explicitly.
|
|
193
|
+
const emptyEnv = buildGateEnvelope('policy-lint', ExitCode.VerifiedPass, [], {
|
|
194
|
+
unit: 'policy rules',
|
|
195
|
+
expected: 0,
|
|
196
|
+
examined: 0,
|
|
197
|
+
reason: 'no policyRules[] declared',
|
|
198
|
+
...allowEmptyValve(args, 0),
|
|
199
|
+
});
|
|
152
200
|
if (wantJson) {
|
|
153
|
-
process.stdout.write(asJson({
|
|
154
|
-
|
|
201
|
+
process.stdout.write(asJson({
|
|
202
|
+
schema: 'sharkcraft.policy-lint/v1',
|
|
203
|
+
rules: [],
|
|
204
|
+
findings: [],
|
|
205
|
+
diagnostics: [],
|
|
206
|
+
evaluated: 0,
|
|
207
|
+
verdict: emptyEnv.exit === ExitCode.VerifiedPass ? 'pass' : 'not-verified',
|
|
208
|
+
exitCode: emptyEnv.exit,
|
|
209
|
+
gate: emptyEnv,
|
|
210
|
+
}) + '\n');
|
|
211
|
+
return emptyEnv.exit;
|
|
155
212
|
}
|
|
156
213
|
process.stdout.write(header('Policy lint'));
|
|
157
214
|
process.stdout.write(' No policy rules configured. Declare `policyRules[]` in sharkcraft.config.ts to lint\n' +
|
|
158
215
|
' templates / styles / AOT-invisible TS shapes (see docs/policy-lint.md).\n');
|
|
159
|
-
|
|
216
|
+
process.stdout.write(`\n${verdictLine(emptyEnv, 'Nothing declared — accepted.')}\n`);
|
|
217
|
+
if (emptyEnv.exit !== ExitCode.VerifiedPass) {
|
|
218
|
+
process.stdout.write(` Pass --${ALLOW_EMPTY_FLAG} to accept an empty rule set explicitly.\n`);
|
|
219
|
+
}
|
|
220
|
+
return emptyEnv.exit;
|
|
160
221
|
}
|
|
161
|
-
// A typo'd --only id must not silently select nothing and report green.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const
|
|
222
|
+
// A typo'd --only id must not silently select nothing and report green. A
|
|
223
|
+
// rejected rule's id is a declared one: `--only` selects its errored row.
|
|
224
|
+
const onlyIds = only ? only.split(',').map((s) => s.trim()).filter(Boolean) : undefined;
|
|
225
|
+
if (onlyIds) {
|
|
226
|
+
const known = new Set([...rules.map((r) => r.id), ...rejectedAll.map((r) => r.id)]);
|
|
227
|
+
const unknown = onlyIds.filter((id) => !known.has(id));
|
|
166
228
|
if (unknown.length > 0) {
|
|
167
229
|
process.stderr.write(`Unknown --only rule id(s): ${unknown.join(', ')}. Configured: ${[...known].join(', ') || '(none)'}\n`);
|
|
168
230
|
return ExitCode.UsageError;
|
|
169
231
|
}
|
|
170
232
|
}
|
|
233
|
+
const rejected = onlyIds ? rejectedAll.filter((r) => onlyIds.includes(r.id)) : rejectedAll;
|
|
171
234
|
let changedFiles;
|
|
172
235
|
if (changedOnly || newOnly || since) {
|
|
173
236
|
changedFiles = resolveChangedFiles({
|
|
@@ -178,8 +241,9 @@ export const policyLintCommand = {
|
|
|
178
241
|
}
|
|
179
242
|
// Don't lint SharkCraft's own asset/config dir by default (its .ts files
|
|
180
243
|
// hold the rule definitions themselves, which can self-match).
|
|
181
|
-
|
|
182
|
-
|
|
244
|
+
// THE plane scan scope — the same authority `gates check`, `quality`,
|
|
245
|
+
// `finish` and `shrk gate` read for this rule.
|
|
246
|
+
const excludeDirs = planeScanExcludeDirs(cwd, loaded.value.sharkcraftDir);
|
|
183
247
|
const reportRaw = runPolicyLint(cwd, rules, {
|
|
184
248
|
...(surfaces ? { surfaces } : {}),
|
|
185
249
|
// --changed-only narrows the SCAN; --new-only scans the full tree so it can
|
|
@@ -220,58 +284,121 @@ export const policyLintCommand = {
|
|
|
220
284
|
: 'pass';
|
|
221
285
|
report = { ...report, findings: newFindings, verdict };
|
|
222
286
|
}
|
|
287
|
+
// Settle first, render second: ONE proposed exit for text and JSON (the two
|
|
288
|
+
// used to disagree when a rule skipped next to a warning finding), settled
|
|
289
|
+
// against what each rule actually scanned.
|
|
290
|
+
//
|
|
291
|
+
// An EMPTY selection (no rule's globs intersect the changeset, or --only
|
|
292
|
+
// picked nothing) proposes 0 and lets the run coverage decide: expected 0
|
|
293
|
+
// is a shortfall (2) unless --allow-empty accepted it. Proposing 2 here
|
|
294
|
+
// would make the valve unreachable on exactly the case it exists for.
|
|
295
|
+
const proposed = report.verdict === 'errors' || report.skipped.some((sk) => sk.failed) || rejected.length > 0
|
|
296
|
+
? ExitCode.Failure
|
|
297
|
+
: (report.evaluated === 0 && report.rules.length > 0) || report.skipped.length > 0
|
|
298
|
+
? ExitCode.NotVerified
|
|
299
|
+
: ExitCode.VerifiedPass;
|
|
300
|
+
const unexaminedRules = [
|
|
301
|
+
...report.skipped.map((s) => s.ruleId),
|
|
302
|
+
...report.rules.filter((r) => r.status === 'error').map((r) => r.ruleId),
|
|
303
|
+
...rejected.map((r) => r.id),
|
|
304
|
+
];
|
|
305
|
+
const inScope = report.rules.length + rejected.length;
|
|
306
|
+
const env = buildGateEnvelope('policy-lint', proposed, [...report.rules.map((r) => {
|
|
307
|
+
const skip = report.skipped.find((s) => s.ruleId === r.ruleId);
|
|
308
|
+
return {
|
|
309
|
+
id: r.ruleId,
|
|
310
|
+
type: 'policy',
|
|
311
|
+
status: r.status,
|
|
312
|
+
severity: r.severity,
|
|
313
|
+
counts: {
|
|
314
|
+
units: r.unitsScanned,
|
|
315
|
+
findings: r.findingCount,
|
|
316
|
+
suppressed: r.suppressedCount,
|
|
317
|
+
},
|
|
318
|
+
violations: report.findings
|
|
319
|
+
.filter((f) => f.ruleId === r.ruleId)
|
|
320
|
+
.map((f) => ({
|
|
321
|
+
id: f.match,
|
|
322
|
+
file: f.file,
|
|
323
|
+
line: f.line,
|
|
324
|
+
message: f.message,
|
|
325
|
+
...(f.suggest ? { hint: f.suggest } : {}),
|
|
326
|
+
})),
|
|
327
|
+
...(skip ? { skipReason: skip.reason } : {}),
|
|
328
|
+
...(r.error ? { error: r.error } : {}),
|
|
329
|
+
coverage: policyRuleCoverage(r),
|
|
330
|
+
// The rule's `expectEmpty` acceptance and unit lines (round 13),
|
|
331
|
+
// folded into the envelope's one settle — the accepted line comes from it.
|
|
332
|
+
...(r.unitAcceptance !== undefined ? { unitAcceptance: r.unitAcceptance } : {}),
|
|
333
|
+
...(r.units !== undefined ? { units: r.units } : {}),
|
|
334
|
+
};
|
|
335
|
+
}), ...rejected], {
|
|
336
|
+
unit: 'policy rules',
|
|
337
|
+
expected: inScope,
|
|
338
|
+
examined: inScope - unexaminedRules.length,
|
|
339
|
+
...(unexaminedRules.length > 0
|
|
340
|
+
? { unexamined: unexaminedRules, reason: 'scanned nothing or could not run' }
|
|
341
|
+
: {}),
|
|
342
|
+
...(inScope === 0
|
|
343
|
+
? {
|
|
344
|
+
reason: changedOnly || since
|
|
345
|
+
? "no rule's globs match content in the changeset (a deleted file, or one with nothing on the rule's surface, puts nothing in scope)"
|
|
346
|
+
: 'no rule selected',
|
|
347
|
+
}
|
|
348
|
+
: {}),
|
|
349
|
+
...allowEmptyValve(args, inScope),
|
|
350
|
+
});
|
|
351
|
+
const exit = env.exit;
|
|
223
352
|
if (wantJson) {
|
|
224
|
-
const exit = report.verdict === 'errors' || report.skipped.some((sk) => sk.failed)
|
|
225
|
-
? ExitCode.Failure
|
|
226
|
-
: report.evaluated === 0 || report.skipped.length > 0
|
|
227
|
-
? ExitCode.NotVerified
|
|
228
|
-
: ExitCode.VerifiedPass;
|
|
229
353
|
process.stdout.write(asJson({
|
|
230
354
|
...report,
|
|
355
|
+
// Pack policy rules the merge seam refused — errored rows in `gate.rules`.
|
|
356
|
+
rejected: rejected.map((r) => ({ id: r.id, error: r.error ?? null })),
|
|
231
357
|
...(newOnly ? { newOnly: true, hiddenBaseline } : {}),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
status: r.status,
|
|
238
|
-
severity: r.severity,
|
|
239
|
-
counts: {
|
|
240
|
-
units: r.unitsScanned,
|
|
241
|
-
findings: r.findingCount,
|
|
242
|
-
suppressed: r.suppressedCount,
|
|
243
|
-
},
|
|
244
|
-
violations: report.findings
|
|
245
|
-
.filter((f) => f.ruleId === r.ruleId)
|
|
246
|
-
.map((f) => ({
|
|
247
|
-
id: f.match,
|
|
248
|
-
file: f.file,
|
|
249
|
-
line: f.line,
|
|
250
|
-
message: f.message,
|
|
251
|
-
...(f.suggest ? { hint: f.suggest } : {}),
|
|
252
|
-
})),
|
|
253
|
-
...(skip ? { skipReason: skip.reason } : {}),
|
|
254
|
-
...(r.error ? { error: r.error } : {}),
|
|
255
|
-
};
|
|
256
|
-
})),
|
|
358
|
+
// The plane verdict derives from the SETTLED exit — never `warnings`
|
|
359
|
+
// / `pass` next to exitCode 2.
|
|
360
|
+
verdict: planeVerdictForExit(exit, report.verdict),
|
|
361
|
+
exitCode: exit,
|
|
362
|
+
gate: env,
|
|
257
363
|
}) + '\n');
|
|
258
364
|
return exit;
|
|
259
365
|
}
|
|
260
366
|
process.stdout.write(header('Policy lint'));
|
|
367
|
+
if (rejected.length > 0) {
|
|
368
|
+
process.stdout.write(` ✗ ${rejected.length} pack policy rule(s) failed validation at the pack-plane merge seam — NOT evaluated, FAILED:\n`);
|
|
369
|
+
for (const r of rejected)
|
|
370
|
+
process.stdout.write(` ✗ ${r.id} — ${r.error ?? 'failed validation'}\n`);
|
|
371
|
+
process.stdout.write(' `shrk packs contributions` names every rejected entry.\n');
|
|
372
|
+
}
|
|
261
373
|
// `evaluated` counts rules that actually scanned ≥1 file. When 0 rules
|
|
262
|
-
// evaluated
|
|
263
|
-
//
|
|
374
|
+
// evaluated, say so loudly — "scanned nothing" must never read as the green
|
|
375
|
+
// "no policy violations" pass. `2` (or `1` when a `failOnEmpty` rule
|
|
376
|
+
// promotes it), unless --allow-empty accepted an empty scope explicitly.
|
|
264
377
|
if (report.evaluated === 0) {
|
|
265
|
-
process.stdout.write(` ! Nothing evaluated — ${
|
|
378
|
+
process.stdout.write(` ! Nothing evaluated — ${rules.length} rule(s) configured, ${report.rules.length} in scope, none matched files` +
|
|
266
379
|
(changedOnly || since ? ' (changed-only).\n' : '.\n'));
|
|
267
380
|
for (const sk of report.skipped) {
|
|
268
381
|
process.stdout.write(` – ${sk.ruleId}: ${sk.reason}${sk.failed ? ' (failOnEmpty → FAILED)' : ''}\n`);
|
|
269
382
|
}
|
|
270
|
-
//
|
|
271
|
-
//
|
|
272
|
-
|
|
383
|
+
// THE empty-rule advice (round 13) — this branch returned before the only
|
|
384
|
+
// advice site, so a rule that matched nothing got none.
|
|
385
|
+
for (const a of emptyRuleAdviceLines(report.skipped.map((sk) => ({ fails: sk.failed === true })))) {
|
|
386
|
+
process.stdout.write(` ${a}.\n`);
|
|
387
|
+
}
|
|
388
|
+
const line = verdictLine(env, 'Nothing in scope — accepted.');
|
|
389
|
+
if (line)
|
|
390
|
+
process.stdout.write(`\n${line}\n`);
|
|
391
|
+
if (report.rules.length === 0 && exit === ExitCode.NotVerified) {
|
|
392
|
+
process.stdout.write(` Pass --${ALLOW_EMPTY_FLAG} to accept an empty changeset explicitly.\n`);
|
|
393
|
+
}
|
|
394
|
+
return exit;
|
|
273
395
|
}
|
|
274
|
-
|
|
396
|
+
// Round 13 (K6): a rule accepted as intended-empty examined 0 files, so the
|
|
397
|
+
// printed count leaves it out and names it apart (`IPolicyReport.evaluated`
|
|
398
|
+
// keeps counting it only so the `evaluated === 0` guard above never reads
|
|
399
|
+
// an accepted plan as "nothing ran").
|
|
400
|
+
const acceptedNote = acceptedEmptyNote(report.acceptedEmpty);
|
|
401
|
+
process.stdout.write(kv('rules evaluated', `${report.evaluated - report.acceptedEmpty} of ${inScope}${acceptedNote}`) + '\n');
|
|
275
402
|
const errors = report.findings.filter((f) => f.severity === 'error').length;
|
|
276
403
|
const warnings = report.findings.filter((f) => f.severity === 'warning').length;
|
|
277
404
|
process.stdout.write(kv('findings', `${errors} error(s), ${warnings} warning(s)`) + '\n');
|
|
@@ -289,21 +416,43 @@ export const policyLintCommand = {
|
|
|
289
416
|
for (const d of report.diagnostics)
|
|
290
417
|
process.stdout.write(` ! ${d}\n`);
|
|
291
418
|
}
|
|
419
|
+
// THE shared unit-state block (round 13, K2): a dead `files` glob of a
|
|
420
|
+
// rule that still matched, and a LOCAL expectEmpty marker whose target
|
|
421
|
+
// appeared, withhold the ✓ (exit unchanged); a pack marker is INFO.
|
|
422
|
+
const unitNotes = unitStateNotes(report.rules.map((r) => ({
|
|
423
|
+
id: r.ruleId,
|
|
424
|
+
...(r.unitLiveness !== undefined ? { unitLiveness: r.unitLiveness } : {}),
|
|
425
|
+
reportedEmpty: report.skipped.some((s) => s.ruleId === r.ruleId),
|
|
426
|
+
})));
|
|
427
|
+
process.stdout.write(unitNotes.text);
|
|
428
|
+
if (report.skipped.length > 0) {
|
|
429
|
+
// THE empty-rule advice (round 13) — one sentence per REAL `fails`
|
|
430
|
+
// value, from the shared renderer: a soft skip was told nothing.
|
|
431
|
+
process.stdout.write('\nA rule that matched nothing is a bug in the rule, not a pass.\n');
|
|
432
|
+
for (const a of emptyRuleAdviceLines(report.skipped.map((sk) => ({ fails: sk.failed === true })))) {
|
|
433
|
+
process.stdout.write(` ${a}.\n`);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
292
436
|
if (report.skipped.some((sk) => sk.failed)) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
437
|
+
const line = verdictLine(env, '');
|
|
438
|
+
if (line)
|
|
439
|
+
process.stdout.write(`${line}\n`);
|
|
440
|
+
return exit;
|
|
296
441
|
}
|
|
297
442
|
// A non-failing skip still means "partially verified" — never a green 0.
|
|
298
443
|
if (report.skipped.length > 0 && report.findings.length === 0) {
|
|
299
|
-
|
|
300
|
-
|
|
444
|
+
const line = verdictLine(env, '', `${report.skipped.length} rule(s) scanned nothing — partially verified, not a full green.`);
|
|
445
|
+
if (line)
|
|
446
|
+
process.stdout.write(`\n${line}\n`);
|
|
447
|
+
return exit;
|
|
301
448
|
}
|
|
302
449
|
if (report.findings.length === 0 && report.diagnostics.length === 0) {
|
|
303
|
-
|
|
304
|
-
?
|
|
305
|
-
: '
|
|
306
|
-
|
|
450
|
+
const line = verdictLine(env, qualifyCleanForUnits(newOnly
|
|
451
|
+
? `No NEW policy violations from this change${hiddenBaseline > 0 ? ` (${hiddenBaseline} pre-existing hidden)` : ''}. ✓`
|
|
452
|
+
: 'No policy violations on the scanned surfaces. ✓', unitNotes));
|
|
453
|
+
if (line)
|
|
454
|
+
process.stdout.write(`\n${line}\n`);
|
|
455
|
+
return exit;
|
|
307
456
|
}
|
|
308
457
|
// Group findings by rule.
|
|
309
458
|
const byRule = new Map();
|
|
@@ -327,6 +476,16 @@ export const policyLintCommand = {
|
|
|
327
476
|
if (suggest)
|
|
328
477
|
process.stdout.write(` → ${suggest}\n`);
|
|
329
478
|
}
|
|
330
|
-
|
|
479
|
+
// The final line and the exit come from the SETTLED verdict — the same
|
|
480
|
+
// `exit` the JSON returns. A warning finding next to a rule that scanned
|
|
481
|
+
// nothing used to exit 0 here (no verdict line) while --json said 2.
|
|
482
|
+
const tail = verdictLine(env, warnings > 0
|
|
483
|
+
? `No blocking policy violations — ${warnings} warning(s) reported above.`
|
|
484
|
+
: 'No policy violations on the scanned surfaces (see the diagnostics above).', report.skipped.length > 0
|
|
485
|
+
? `${report.skipped.length} rule(s) scanned nothing — partially verified, not a full green.`
|
|
486
|
+
: undefined);
|
|
487
|
+
if (tail)
|
|
488
|
+
process.stdout.write(`\n${tail}\n`);
|
|
489
|
+
return exit;
|
|
331
490
|
},
|
|
332
491
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.command.d.ts","sourceRoot":"","sources":["../../src/commands/policy.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"policy.command.d.ts","sourceRoot":"","sources":["../../src/commands/policy.command.ts"],"names":[],"mappings":"AAqBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAmBhC,eAAO,MAAM,iBAAiB,EAAE,eA4B/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eA6B9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAsI/B,CAAC;AAiBF,eAAO,MAAM,gBAAgB,EAAE,eA6F9B,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,eAsJnC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,eAKhC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { appendPolicyOverrideAudit, applyPolicyOverrides, ChangedScopeMode, classifyChangedScope, evaluatePolicy, inspectSharkcraft, listPolicyOverrides, PolicySeverity, resolveChangedFiles, runPolicySnapshot, runPolicyTest, runPolicyTestsForAll, summariseChangedScope, } from '@shrkcrft/inspector';
|
|
3
|
+
import { appendPolicyOverrideAudit, applyPolicyOverrides, ChangedScopeMode, classifyChangedScope, ContributionKind, evaluatePolicy, inspectSharkcraft, listPolicyOverrides, PolicySeverity, resolveChangedFiles, runPolicySnapshot, runPolicyTest, runPolicyTestsForAll, summariseChangedScope, } from '@shrkcrft/inspector';
|
|
4
4
|
import { flagBool, flagString, flagList, resolveCwd, } from "../command-registry.js";
|
|
5
5
|
import { asJson, header } from "../output/format-output.js";
|
|
6
|
+
import { writeRejectedEntriesNote } from "../output/rejected-entries-note.js";
|
|
6
7
|
function buildEvaluateInput(args) {
|
|
7
8
|
const out = {};
|
|
8
9
|
const plan = flagString(args, 'plan');
|
|
@@ -35,14 +36,18 @@ export const policyListCommand = {
|
|
|
35
36
|
onlyId: '__none__', // skip predicate execution; we only want registrations
|
|
36
37
|
});
|
|
37
38
|
const regs = report.registrations;
|
|
39
|
+
// A policy declaration its loader refused (no id) is named (round 12, 12.1).
|
|
40
|
+
const note = { next: 'shrk packs contributions' };
|
|
38
41
|
if (flagBool(args, 'json')) {
|
|
39
42
|
process.stdout.write(asJson(regs) + '\n');
|
|
43
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Policy], { ...note, json: true });
|
|
40
44
|
return 0;
|
|
41
45
|
}
|
|
42
46
|
process.stdout.write(header(`Policy checks (${regs.length})`));
|
|
43
47
|
for (const r of regs) {
|
|
44
48
|
process.stdout.write(` [${r.source}] ${r.severity.padEnd(7)} ${r.id.padEnd(40)} ${r.title}\n`);
|
|
45
49
|
}
|
|
50
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.Policy], note);
|
|
46
51
|
return 0;
|
|
47
52
|
},
|
|
48
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../src/commands/pr.command.ts"],"names":[],"mappings":"AAgBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../src/commands/pr.command.ts"],"names":[],"mappings":"AAgBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAiGhC,eAAO,MAAM,SAAS,EAAE,eA6BvB,CAAC"}
|