@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":"drift.command.d.ts","sourceRoot":"","sources":["../../src/commands/drift.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drift.command.d.ts","sourceRoot":"","sources":["../../src/commands/drift.command.ts"],"names":[],"mappings":"AAWA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAOhC,eAAO,MAAM,YAAY,EAAE,eAuF1B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
1
2
|
import { buildDriftReport, classifyChangedScope, classifyRuleDrift, inspectSharkcraft, resolveChangedFiles, RuleEnforcementState, summariseChangedScope, } from '@shrkcrft/inspector';
|
|
2
3
|
import { flagBool, flagString, flagList, resolveCwd, } from "../command-registry.js";
|
|
3
4
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
@@ -52,16 +53,25 @@ export const driftCommand = {
|
|
|
52
53
|
: null;
|
|
53
54
|
if (flagBool(args, 'json')) {
|
|
54
55
|
process.stdout.write(asJson({ ...report, ...(classification ? { changedScope: classification } : {}) }) + '\n');
|
|
55
|
-
|
|
56
|
+
// THE drift verdict (settled in the inspector over the boundary
|
|
57
|
+
// orchestrator's coverage): 2 when a boundary rule's scope was never
|
|
58
|
+
// fully examined — never a clean 0 over an unreadable governed file.
|
|
59
|
+
return report.exitCode;
|
|
56
60
|
}
|
|
57
61
|
process.stdout.write(header('Drift report'));
|
|
58
62
|
process.stdout.write(kv('totals', `${report.counts.error} errors, ${report.counts.warning} warnings, ${report.counts.info} info`) + '\n\n');
|
|
59
63
|
if (classification) {
|
|
60
64
|
process.stdout.write(`changed-scope: ${summariseChangedScope(classification)}\n\n`);
|
|
61
65
|
}
|
|
66
|
+
const settled = {
|
|
67
|
+
exit: report.exitCode,
|
|
68
|
+
verdict: report.verdict,
|
|
69
|
+
shortfalls: report.shortfalls,
|
|
70
|
+
accepted: report.accepted ?? [],
|
|
71
|
+
};
|
|
62
72
|
if (report.findings.length === 0) {
|
|
63
|
-
process.stdout.write('No drift detected
|
|
64
|
-
return
|
|
73
|
+
process.stdout.write(`${verdictLine(settled, 'No drift detected.')}\n`);
|
|
74
|
+
return report.exitCode;
|
|
65
75
|
}
|
|
66
76
|
for (const f of report.findings) {
|
|
67
77
|
const tag = f.severity.toUpperCase().padEnd(8);
|
|
@@ -69,7 +79,10 @@ export const driftCommand = {
|
|
|
69
79
|
if (f.suggestedFix)
|
|
70
80
|
process.stdout.write(` ↳ ${f.suggestedFix}\n`);
|
|
71
81
|
}
|
|
72
|
-
|
|
82
|
+
const tail = verdictLine(settled, '');
|
|
83
|
+
if (tail)
|
|
84
|
+
process.stdout.write(`\n${tail}\n`);
|
|
85
|
+
return report.exitCode;
|
|
73
86
|
},
|
|
74
87
|
};
|
|
75
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.command.d.ts","sourceRoot":"","sources":["../../src/commands/eslint.command.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"eslint.command.d.ts","sourceRoot":"","sources":["../../src/commands/eslint.command.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA4DhC,eAAO,MAAM,qBAAqB,EAAE,eA8DnC,CAAC;AAiCF,eAAO,MAAM,mBAAmB,EAAE,eAiFjC,CAAC;AAgFF,eAAO,MAAM,kBAAkB,EAAE,eAsDhC,CAAC;AAkCF,eAAO,MAAM,+BAA+B,EAAE,eAyC7C,CAAC;AAmBF,eAAO,MAAM,aAAa,EAAE,eA0D3B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
3
|
import { inspectSharkcraft } from '@shrkcrft/inspector';
|
|
4
4
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
5
6
|
import { asJson, bullet, header } from "../output/format-output.js";
|
|
6
7
|
/**
|
|
7
8
|
* ESLint bridge. NOT a full ESLint plugin: a thin adapter that
|
|
@@ -387,6 +388,25 @@ function renderEslintReportText(files) {
|
|
|
387
388
|
}
|
|
388
389
|
export const eslintCommand = {
|
|
389
390
|
name: 'eslint',
|
|
391
|
+
// positional[0] is the bridge verb — `run` refuses anything else. Each spec
|
|
392
|
+
// reuses its verb handler's usage, so the flags the verb reads (`--force`,
|
|
393
|
+
// `--output`, `--from`, …) are documented for the post-run flag detector.
|
|
394
|
+
positionals: PositionalMode.None,
|
|
395
|
+
subverbs: [
|
|
396
|
+
{
|
|
397
|
+
name: 'scaffold',
|
|
398
|
+
aliases: ['config'],
|
|
399
|
+
description: eslintScaffoldCommand.description,
|
|
400
|
+
usage: eslintScaffoldCommand.usage,
|
|
401
|
+
},
|
|
402
|
+
{ name: 'report', description: eslintReportCommand.description, usage: eslintReportCommand.usage },
|
|
403
|
+
{ name: 'rules', description: eslintRulesCommand.description, usage: eslintRulesCommand.usage },
|
|
404
|
+
{
|
|
405
|
+
name: 'explain-limitations',
|
|
406
|
+
description: eslintExplainLimitationsCommand.description,
|
|
407
|
+
usage: eslintExplainLimitationsCommand.usage,
|
|
408
|
+
},
|
|
409
|
+
],
|
|
390
410
|
description: 'ESLint bridge. `scaffold` emits a flat-config snippet that ignores SharkCraft generated paths; `report` re-emits boundary violations in the ESLint result format; `rules` inventories what is bridgeable; `explain-limitations` documents what cannot be bridged. `config` is an alias for `scaffold`.',
|
|
391
411
|
usage: 'shrk eslint <scaffold|config|report|rules|explain-limitations> [...flags]',
|
|
392
412
|
async run(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.command.d.ts","sourceRoot":"","sources":["../../src/commands/export.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"export.command.d.ts","sourceRoot":"","sources":["../../src/commands/export.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAiBhC,eAAO,MAAM,aAAa,EAAE,eA4G3B,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { inspectSharkcraft } from '@shrkcrft/inspector';
|
|
|
4
4
|
import { ALL_EXPORT_FORMATS, isExportFormat, renderExport, } from "../export/export-formats.js";
|
|
5
5
|
import { buildClaudeCommands } from "../export/claude-commands-export.js";
|
|
6
6
|
import { flagBool, flagNumber, flagString, resolveCwd, } from "../command-registry.js";
|
|
7
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
7
8
|
import { asJson, bullet, header } from "../output/format-output.js";
|
|
8
9
|
import { exportBundleCommand, exportSessionCommand, exportQualityCommand, exportReviewCommand, } from "./export-bundle.command.js";
|
|
9
10
|
const ARCHIVE_SUBCOMMANDS = {
|
|
@@ -14,8 +15,29 @@ const ARCHIVE_SUBCOMMANDS = {
|
|
|
14
15
|
};
|
|
15
16
|
export const exportCommand = {
|
|
16
17
|
name: 'export',
|
|
18
|
+
// positional[0] is the FORMAT (or an archive verb): every other token is
|
|
19
|
+
// refused with the list, as `run` already did — now before anything runs.
|
|
20
|
+
positionals: PositionalMode.None,
|
|
21
|
+
subverbs: [
|
|
22
|
+
...ALL_EXPORT_FORMATS.map((format) => ({
|
|
23
|
+
name: format,
|
|
24
|
+
description: `Render the ${format} export (dry-run unless --write).`,
|
|
25
|
+
usage: `shrk export ${format} [--write [--force]] [--output <path>] [--task "<task>"] [--max-rules N] [--max-paths N] [--json]`,
|
|
26
|
+
})),
|
|
27
|
+
{
|
|
28
|
+
name: 'claude-commands',
|
|
29
|
+
description: 'Per-project slash commands under .claude/commands/ (dry-run unless --write).',
|
|
30
|
+
usage: 'shrk export claude-commands [--write [--force]] [--output <path>] [--json]',
|
|
31
|
+
},
|
|
32
|
+
...Object.entries(ARCHIVE_SUBCOMMANDS).map(([name, handler]) => ({
|
|
33
|
+
name,
|
|
34
|
+
description: handler.description,
|
|
35
|
+
usage: handler.usage,
|
|
36
|
+
positionals: PositionalMode.Free,
|
|
37
|
+
})),
|
|
38
|
+
],
|
|
17
39
|
description: 'Inversion — pull SharkCraft rules into the agent\'s prompt instead of the agent calling back to shrk. Single-file outputs: claude-skill (.claude/skills/<name>/SKILL.md, recommended), agents-md (AGENTS.md), claude-md (CLAUDE.md), cursor-rules (.cursor/rules/*.mdc), copilot-instructions. Multi-file output: claude-commands (.claude/commands/*.md — per-project slash commands like /new-service, /check-changes, /follow-shrk). Dry-run by default; pass --write to save.',
|
|
18
|
-
usage: 'shrk [--cwd <dir>] export <format> [--write] [--output <path>] [--task "<task>"] [--max-rules N] [--max-paths N] [--json]',
|
|
40
|
+
usage: 'shrk [--cwd <dir>] export <format> [--write [--force]] [--output <path>] [--task "<task>"] [--max-rules N] [--max-paths N] [--json]',
|
|
19
41
|
async run(args) {
|
|
20
42
|
const format = args.positional[0];
|
|
21
43
|
if (!format) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-dispatch.command.d.ts","sourceRoot":"","sources":["../../src/commands/feedback-dispatch.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"feedback-dispatch.command.d.ts","sourceRoot":"","sources":["../../src/commands/feedback-dispatch.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,wBAAwB,CAAC;AA8B1E,eAAO,MAAM,eAAe,EAAE,eA+E7B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
1
2
|
import { feedbackActionsCommand, feedbackBacklogCommand, feedbackConvertToBacklogCommand, feedbackIngestCommand, feedbackPlanCommand, feedbackPromptCommand, feedbackRulesDoctorCommand, feedbackRulesListCommand, feedbackSummarizeCommand, } from "./feedback.command.js";
|
|
2
3
|
const VERBS = {
|
|
3
4
|
ingest: feedbackIngestCommand,
|
|
@@ -15,6 +16,34 @@ const RULES_VERBS = {
|
|
|
15
16
|
};
|
|
16
17
|
export const feedbackCommand = {
|
|
17
18
|
name: 'feedback',
|
|
19
|
+
// positional[0] is a verb or the feedback FILE (`feedback <file>` ingests):
|
|
20
|
+
// a verb-shaped token that is neither is refused before it becomes a path.
|
|
21
|
+
positionals: PositionalMode.Path,
|
|
22
|
+
subverbs: [
|
|
23
|
+
{ name: 'ingest', description: 'Parse a feedback file into structured findings.', usage: 'shrk feedback ingest <file> [--with-pack-rules] [--json]', positionals: PositionalMode.Path },
|
|
24
|
+
{ name: 'summarize', description: 'Summarize a feedback file.', usage: 'shrk feedback summarize <file> [--json]', positionals: PositionalMode.Path },
|
|
25
|
+
{ name: 'actions', description: 'The actions a feedback file implies.', usage: 'shrk feedback actions <file> [--json]', positionals: PositionalMode.Path },
|
|
26
|
+
{
|
|
27
|
+
name: 'convert-to-backlog',
|
|
28
|
+
description: 'Convert a feedback file into backlog items.',
|
|
29
|
+
usage: 'shrk feedback convert-to-backlog <file> [--output <path>]',
|
|
30
|
+
positionals: PositionalMode.Path,
|
|
31
|
+
},
|
|
32
|
+
{ name: 'backlog', description: 'The backlog view of a feedback file.', usage: 'shrk feedback backlog <file>', positionals: PositionalMode.Path },
|
|
33
|
+
{ name: 'prompt', description: 'An agent prompt from a feedback file.', usage: 'shrk feedback prompt <file>', positionals: PositionalMode.Path },
|
|
34
|
+
{ name: 'plan', description: 'A plan from a feedback file.', usage: 'shrk feedback plan <file>', positionals: PositionalMode.Path },
|
|
35
|
+
{
|
|
36
|
+
name: 'rules',
|
|
37
|
+
description: 'The feedback rules (`list` is the default).',
|
|
38
|
+
usage: 'shrk feedback rules <list|doctor> [--json]',
|
|
39
|
+
// An unknown token used to fall through to `list` at exit 0.
|
|
40
|
+
positionals: PositionalMode.None,
|
|
41
|
+
subverbs: [
|
|
42
|
+
{ name: 'list', description: 'List the feedback rules.', usage: 'shrk feedback rules list [--json]' },
|
|
43
|
+
{ name: 'doctor', description: 'Validate the feedback rules.', usage: 'shrk feedback rules doctor [--json]' },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
18
47
|
description: 'Parse freeform feedback markdown into structured findings. Subcommands: ingest|summarize|actions|convert-to-backlog|rules. Read-only.',
|
|
19
48
|
usage: 'shrk feedback <ingest|summarize|actions|convert-to-backlog> <file> [--with-pack-rules] [--json]\n shrk feedback rules <list|doctor> [--json]',
|
|
20
49
|
async run(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.command.d.ts","sourceRoot":"","sources":["../../src/commands/feedback.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feedback.command.d.ts","sourceRoot":"","sources":["../../src/commands/feedback.command.ts"],"names":[],"mappings":"AAkBA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAkBhC,eAAO,MAAM,qBAAqB,EAAE,eAiCnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eA0CtC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAyDpC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,eAwB7C,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,eAyBtC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAoDxC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,eAqBpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAqBnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eA6BjC,CAAC"}
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
9
9
|
import * as nodePath from 'node:path';
|
|
10
|
-
import { FeedbackBucket, ingestFeedbackFile, inspectSharkcraft, loadFeedbackRules, renderFeedbackBacklog, } from '@shrkcrft/inspector';
|
|
10
|
+
import { ContributionKind, FeedbackBucket, ingestFeedbackFile, inspectSharkcraft, loadFeedbackRules, renderFeedbackBacklog, } from '@shrkcrft/inspector';
|
|
11
11
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
12
12
|
import { asJson, header } from "../output/format-output.js";
|
|
13
13
|
import { feedbackRulesDoctorHints, renderFailureHints } from "../output/failure-hints.js";
|
|
14
|
+
import { writeRejectedEntriesNote } from "../output/rejected-entries-note.js";
|
|
14
15
|
function ingestPositional(args) {
|
|
15
16
|
return args.positional[0];
|
|
16
17
|
}
|
|
@@ -194,8 +195,11 @@ export const feedbackRulesListCommand = {
|
|
|
194
195
|
const cwd = resolveCwd(args);
|
|
195
196
|
const inspection = await inspectSharkcraft({ cwd });
|
|
196
197
|
const rules = await loadFeedbackRules(inspection);
|
|
198
|
+
// A rule its loader refused (no id, a reused id) is named (round 12, 12.1).
|
|
199
|
+
const note = { next: 'shrk packs contributions' };
|
|
197
200
|
if (flagBool(args, 'json')) {
|
|
198
201
|
process.stdout.write(asJson({ count: rules.length, rules }) + '\n');
|
|
202
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.FeedbackRule], { ...note, json: true });
|
|
199
203
|
return 0;
|
|
200
204
|
}
|
|
201
205
|
process.stdout.write(header(`Feedback rules (${rules.length})`));
|
|
@@ -207,6 +211,7 @@ export const feedbackRulesListCommand = {
|
|
|
207
211
|
if (r.targetArea)
|
|
208
212
|
process.stdout.write(` target: ${r.targetArea}\n`);
|
|
209
213
|
}
|
|
214
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.FeedbackRule], note);
|
|
210
215
|
return 0;
|
|
211
216
|
},
|
|
212
217
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finish.command.d.ts","sourceRoot":"","sources":["../../src/commands/finish.command.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"finish.command.d.ts","sourceRoot":"","sources":["../../src/commands/finish.command.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAqFhC,eAAO,MAAM,aAAa,EAAE,eA0B3B,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
2
2
|
import { asJson, bullet, header, kv } from "../output/format-output.js";
|
|
3
|
-
import { runFinishGates } from "../finish/run-finish.js";
|
|
3
|
+
import { runFinishGates, } from "../finish/run-finish.js";
|
|
4
|
+
import { ExitCode } from "../exit-codes.js";
|
|
5
|
+
import { ALLOW_EMPTY_FLAG, allowEmptyValve } from "../gates/allow-empty.js";
|
|
6
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
4
7
|
function resolveScope(args, cwd) {
|
|
5
8
|
const staged = flagBool(args, 'staged');
|
|
6
9
|
const since = flagString(args, 'since');
|
|
@@ -20,12 +23,16 @@ const STATUS_GLYPH = {
|
|
|
20
23
|
pass: '✓',
|
|
21
24
|
fail: '✗',
|
|
22
25
|
skipped: '–',
|
|
26
|
+
// A pass over part of its scope is not a pass (round 11).
|
|
27
|
+
partial: '~',
|
|
23
28
|
};
|
|
24
29
|
function renderText(report) {
|
|
25
30
|
process.stdout.write(header('Finish — is this changeset safe to complete?'));
|
|
26
31
|
process.stdout.write(kv('scope', `${report.scope.mode} (${report.scope.fileCount} file${report.scope.fileCount === 1 ? '' : 's'})`) +
|
|
27
32
|
'\n');
|
|
28
33
|
for (const g of report.gates) {
|
|
34
|
+
// The status is settled once in runFinishGates (`partial` for a pass over
|
|
35
|
+
// part of its scope), so this line and --json say the same word.
|
|
29
36
|
process.stdout.write(` ${STATUS_GLYPH[g.status]} ${g.name.padEnd(11)} ${g.status.padEnd(8)} ${g.detail}\n`);
|
|
30
37
|
}
|
|
31
38
|
if (report.impact.ran) {
|
|
@@ -35,8 +42,9 @@ function renderText(report) {
|
|
|
35
42
|
else if (report.impact.note) {
|
|
36
43
|
process.stdout.write(kv('impact', `(skipped — ${report.impact.note})`) + '\n');
|
|
37
44
|
}
|
|
38
|
-
process.stdout.write(kv('verdict', `${report.verdict} (exit ${report.exit})`) + '\n
|
|
39
|
-
|
|
45
|
+
process.stdout.write(kv('verdict', `${report.verdict} (exit ${report.exit})`) + '\n');
|
|
46
|
+
if (report.exit === ExitCode.Failure)
|
|
47
|
+
process.stdout.write(`\n${report.summary}\n`);
|
|
40
48
|
const failing = report.gates.filter((g) => g.status === 'fail');
|
|
41
49
|
for (const g of failing) {
|
|
42
50
|
process.stdout.write(`\n${g.name} — failing items:\n`);
|
|
@@ -48,20 +56,36 @@ function renderText(report) {
|
|
|
48
56
|
process.stdout.write(` … and ${g.items.length - 15} more (pass --json for the full list).\n`);
|
|
49
57
|
}
|
|
50
58
|
}
|
|
59
|
+
// The final line comes from the SETTLED envelope: the "Safe to finish ✓"
|
|
60
|
+
// sentence exists only at exit 0; at 2 the summary leads a NOT VERIFIED line
|
|
61
|
+
// naming every sub-gate that fell short.
|
|
62
|
+
const line = verdictLine(report.gate, `${report.summary} ✓`, report.exit === ExitCode.NotVerified ? report.summary : undefined);
|
|
63
|
+
if (line)
|
|
64
|
+
process.stdout.write(`\n${line}\n`);
|
|
65
|
+
if (report.exit === ExitCode.NotVerified && report.gate.coverage.expected === 0) {
|
|
66
|
+
process.stdout.write(` Pass --${ALLOW_EMPTY_FLAG} to accept an empty changeset explicitly.\n`);
|
|
67
|
+
}
|
|
51
68
|
process.stdout.write(`\nNext: ${report.nextAction}\n`);
|
|
52
69
|
}
|
|
53
70
|
export const finishCommand = {
|
|
54
71
|
name: 'finish',
|
|
55
|
-
description: 'Composite "is this changeset safe to finish?" gate: EXECUTES every deterministic changed-only check inline — boundaries + import-hygiene + wiring + unprovided (DI graph) + policy + deleted-orphans + arch (advisory cycles) — over tracked AND untracked changes, and returns ONE honest 0/1/2 verdict (0 pass · 1 fail · 2 not-verified — "evaluated nothing"
|
|
56
|
-
usage: 'shrk [--cwd <dir>] finish [files... | --files a.ts,b.ts | --staged | --since <ref>] [--json]',
|
|
57
|
-
|
|
72
|
+
description: 'Composite "is this changeset safe to finish?" gate: EXECUTES every deterministic changed-only check inline — boundaries (with rule-edit escalation) + import-hygiene + wiring + unprovided (DI graph) + policy + deleted-orphans + arch (advisory cycles) — over tracked AND untracked changes, and returns ONE honest 0/1/2 verdict (0 pass · 1 fail · 2 not-verified — "evaluated nothing" and "passed over part of its scope" are 2, never a green 0). The single trustworthy "done?" call after editing (superset of `diff-check`). --json carries the shared gate envelope. Read-only.',
|
|
73
|
+
usage: 'shrk [--cwd <dir>] finish [files... | --files a.ts,b.ts | --staged | --since <ref>] [--allow-empty] [--json]',
|
|
74
|
+
// `--allow-empty` is the shared verdict valve — declared boolean so it can
|
|
75
|
+
// never swallow a following positional file.
|
|
76
|
+
booleanFlags: new Set(['json', 'staged', ALLOW_EMPTY_FLAG]),
|
|
58
77
|
async run(args) {
|
|
59
78
|
const cwd = resolveCwd(args);
|
|
60
79
|
const wantJson = flagBool(args, 'json');
|
|
61
80
|
const { mode, options } = resolveScope(args, cwd);
|
|
62
|
-
const report = await runFinishGates({
|
|
81
|
+
const report = await runFinishGates({
|
|
82
|
+
cwd,
|
|
83
|
+
mode,
|
|
84
|
+
scope: options,
|
|
85
|
+
emptyValve: (expected) => allowEmptyValve(args, expected),
|
|
86
|
+
});
|
|
63
87
|
if (wantJson) {
|
|
64
|
-
process.stdout.write(asJson(report) + '\n');
|
|
88
|
+
process.stdout.write(asJson({ ...report, exitCode: report.exit }) + '\n');
|
|
65
89
|
return report.exit;
|
|
66
90
|
}
|
|
67
91
|
renderText(report);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix.command.d.ts","sourceRoot":"","sources":["../../src/commands/fix.command.ts"],"names":[],"mappings":"AAwBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"fix.command.d.ts","sourceRoot":"","sources":["../../src/commands/fix.command.ts"],"names":[],"mappings":"AAwBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA2PhC,eAAO,MAAM,UAAU,EAAE,eAmCxB,CAAC"}
|
|
@@ -13,6 +13,7 @@ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
|
13
13
|
import * as nodePath from 'node:path';
|
|
14
14
|
import { AssetKind, AssetProvenanceOperation, buildFixPreview, FixKind, inspectSharkcraft, listFixKinds, recordProvenance, renderFixPreviewMarkdown, } from '@shrkcrft/inspector';
|
|
15
15
|
import { flagBool, flagString, flagList, resolveCwd, } from "../command-registry.js";
|
|
16
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
16
17
|
import { asJson, header } from "../output/format-output.js";
|
|
17
18
|
import { applyActionHintStub, } from "../asset-preview/apply-action-hint-stub.js";
|
|
18
19
|
import { applyKnowledgeStaleFix } from "../asset-preview/apply-knowledge-stale-fix.js";
|
|
@@ -259,6 +260,16 @@ async function runActionHintApply(cwd, inspection, report, args) {
|
|
|
259
260
|
}
|
|
260
261
|
export const fixCommand = {
|
|
261
262
|
name: 'fix',
|
|
263
|
+
positionals: PositionalMode.None,
|
|
264
|
+
subverbs: [
|
|
265
|
+
{ name: 'list', description: 'List the fixable findings.', usage: 'shrk fix list [--kinds <a,b>] [--json]' },
|
|
266
|
+
{ name: 'doctor', description: 'Fix-system health.', usage: 'shrk fix doctor [--json]' },
|
|
267
|
+
{
|
|
268
|
+
name: 'preview',
|
|
269
|
+
description: 'Preview the fixes (the default).',
|
|
270
|
+
usage: 'shrk fix preview [--action-hints|--knowledge-stale|--template-drift] [--kinds <a,b>] [--target <id>] [--write-preview] [--apply [--allow-divergent] [--drop-stale] [--drop-missing] [--rename-strategy strict|wide]] [--json]',
|
|
271
|
+
},
|
|
272
|
+
],
|
|
262
273
|
description: 'Fix preview system. Preview-only by default. `--write-preview` writes drafts to .sharkcraft/fixes/. `--action-hints --apply` splices stubbed actionHints. `--knowledge-stale --apply [--drop-stale] [--drop-missing]` removes the offending reference in place. `--rename-strategy=wide` surfaces multi-candidate rename suggestions that strict mode silently drops.',
|
|
263
274
|
usage: 'shrk fix [list|doctor|preview] [--action-hints|--knowledge-stale|--template-drift] [--kinds <a,b>] [--target <id>] [--write-preview] [--apply [--allow-divergent] [--drop-stale] [--drop-missing] [--rename-strategy strict|wide]] [--json]',
|
|
264
275
|
async run(args) {
|
|
@@ -309,6 +320,9 @@ async function runKnowledgeStaleApply(cwd, inspection, _report, args) {
|
|
|
309
320
|
// Rebuild the stale report directly so we have full IKnowledgeReferenceCheck
|
|
310
321
|
// shape (the FixKind suggestions are stringy and lose the kind/path/symbol/id).
|
|
311
322
|
const { buildKnowledgeStaleReport, ReferenceCheckOutcome, RenameStrategy } = await import('@shrkcrft/inspector');
|
|
323
|
+
// Warm before resolving, or a correct playbook / policy id reads as broken
|
|
324
|
+
// and a --drop-stale would delete a TRUE reference.
|
|
325
|
+
await (await import("../surface/cli-command-resolver.js")).warmCliReferenceRegistries(inspection);
|
|
312
326
|
const stale = buildKnowledgeStaleReport(inspection, {
|
|
313
327
|
renameStrategy: useWide ? RenameStrategy.Wide : RenameStrategy.Strict,
|
|
314
328
|
});
|
|
@@ -514,6 +528,9 @@ async function runKnowledgeStaleApply(cwd, inspection, _report, args) {
|
|
|
514
528
|
async function runTemplateDriftApply(cwd, inspection, _report, args) {
|
|
515
529
|
const wantJson = flagBool(args, 'json');
|
|
516
530
|
const { buildTemplateDriftReport } = await import('@shrkcrft/inspector');
|
|
531
|
+
// Warm first: an unwarmed related id is NOT VERIFIED (never "unresolved"), so
|
|
532
|
+
// without it this fix would find nothing — and must never drop a real id.
|
|
533
|
+
await (await import("../surface/cli-command-resolver.js")).warmCliReferenceRegistries(inspection);
|
|
517
534
|
const drift = buildTemplateDriftReport(inspection, {});
|
|
518
535
|
// Pull related-id-unresolved findings and pair each with its source.
|
|
519
536
|
const templateSources = inspection.templateSources;
|
|
@@ -750,6 +767,8 @@ function runFixList(args) {
|
|
|
750
767
|
async function runFixDoctor(args) {
|
|
751
768
|
const cwd = resolveCwd(args);
|
|
752
769
|
const inspection = await inspectSharkcraft({ cwd });
|
|
770
|
+
// The preview folds in the stale report — warm before it resolves any id.
|
|
771
|
+
await (await import("../surface/cli-command-resolver.js")).warmCliReferenceRegistries(inspection);
|
|
753
772
|
const report = buildFixPreview(inspection);
|
|
754
773
|
const errors = report.suggestions.filter((s) => s.severity === 'error').length;
|
|
755
774
|
const warnings = report.suggestions.filter((s) => s.severity === 'warning').length;
|
|
@@ -8,8 +8,13 @@ import { type ICommandHandler } from '../command-registry.js';
|
|
|
8
8
|
* - 0 if overall status is `pass` (no failures, no warnings)
|
|
9
9
|
* - 0 if overall is `warn` (default — opt-in to fail via --strict)
|
|
10
10
|
* - 1 if overall is `fail`
|
|
11
|
+
* - 2 if nothing failed but a gate examined only PART of what it was asked
|
|
12
|
+
* to (e.g. a wiring rule that passed over part of its scope, or a config
|
|
13
|
+
* that did not load): its `coverage` settles the proposed 0 to NOT
|
|
14
|
+
* VERIFIED through the CLI's one guard (`settleVerdict`) — a `warn` that
|
|
15
|
+
* says "this is not a pass" never exits 0.
|
|
11
16
|
*
|
|
12
|
-
* Pass `--strict` to treat `warn` as failure.
|
|
17
|
+
* Pass `--strict` to treat `warn` as failure (1).
|
|
13
18
|
*/
|
|
14
19
|
export declare const gateCommand: ICommandHandler;
|
|
15
20
|
//# sourceMappingURL=gate.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.command.d.ts","sourceRoot":"","sources":["../../src/commands/gate.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gate.command.d.ts","sourceRoot":"","sources":["../../src/commands/gate.command.ts"],"names":[],"mappings":"AAUA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,EAAE,eAiJzB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { QualityGateReportStore, renderGateReportMarkdown, runQualityGates, } from '@shrkcrft/quality-gates';
|
|
2
|
-
import { ArchReportStore, runArchCheck } from '@shrkcrft/architecture-guard';
|
|
3
|
-
import { inspectSharkcraft, resolveChangedFiles, resolveProjectConfig, } from '@shrkcrft/inspector';
|
|
1
|
+
import { prepareQualityGateRun, QualityGateReportStore, renderGateReportMarkdown, runQualityGates, settleQualityGateReport, } from '@shrkcrft/quality-gates';
|
|
2
|
+
import { ArchReportStore, archStoreMissing, runArchCheck } from '@shrkcrft/architecture-guard';
|
|
4
3
|
import { chmodSync, existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
5
4
|
import * as nodePath from 'node:path';
|
|
6
5
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
7
6
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
7
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
8
8
|
/**
|
|
9
9
|
* `shrk gate` — run all code-intelligence quality gates and emit one
|
|
10
10
|
* pass/fail report. Designed as the single command CI should call
|
|
@@ -14,8 +14,13 @@ import { asJson, header, kv } from "../output/format-output.js";
|
|
|
14
14
|
* - 0 if overall status is `pass` (no failures, no warnings)
|
|
15
15
|
* - 0 if overall is `warn` (default — opt-in to fail via --strict)
|
|
16
16
|
* - 1 if overall is `fail`
|
|
17
|
+
* - 2 if nothing failed but a gate examined only PART of what it was asked
|
|
18
|
+
* to (e.g. a wiring rule that passed over part of its scope, or a config
|
|
19
|
+
* that did not load): its `coverage` settles the proposed 0 to NOT
|
|
20
|
+
* VERIFIED through the CLI's one guard (`settleVerdict`) — a `warn` that
|
|
21
|
+
* says "this is not a pass" never exits 0.
|
|
17
22
|
*
|
|
18
|
-
* Pass `--strict` to treat `warn` as failure.
|
|
23
|
+
* Pass `--strict` to treat `warn` as failure (1).
|
|
19
24
|
*/
|
|
20
25
|
export const gateCommand = {
|
|
21
26
|
name: 'gate',
|
|
@@ -73,116 +78,30 @@ export const gateCommand = {
|
|
|
73
78
|
const staged = flagBool(args, 'staged');
|
|
74
79
|
const filesRaw = flagString(args, 'files');
|
|
75
80
|
const fileList = filesRaw ? filesRaw.split(',').map((s) => s.trim()).filter(Boolean) : [];
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const loadedConfig = await resolveProjectConfig(cwd);
|
|
95
|
-
const wiringRules = loadedConfig.ok ? loadedConfig.value.config.wiringRules ?? [] : [];
|
|
96
|
-
const policyRules = loadedConfig.ok ? loadedConfig.value.config.policyRules ?? [] : [];
|
|
97
|
-
const configError = loadedConfig.ok ? undefined : loadedConfig.error.message;
|
|
81
|
+
// THE gate-run assembly (`prepareQualityGateRun`, @shrkcrft/quality-gates):
|
|
82
|
+
// the project's wiring + policy rules (an INVALID config surfaced, never a
|
|
83
|
+
// silent disable), THE plane scan scope, the knowledge inspection, the
|
|
84
|
+
// change-scoped arch gate and the advisory impact gate. MCP
|
|
85
|
+
// `get_quality_gate` calls the same one, so the two run the same gate set
|
|
86
|
+
// (round 11 review: MCP passed the impact options only and read `pass`
|
|
87
|
+
// where this verb exited 1).
|
|
88
|
+
const prepared = await prepareQualityGateRun({
|
|
89
|
+
cwd,
|
|
90
|
+
...(sinceRef ? { sinceRef } : {}),
|
|
91
|
+
...(changedOnly ? { changedOnly: true } : {}),
|
|
92
|
+
...(staged ? { staged: true } : {}),
|
|
93
|
+
...(fileList.length > 0 ? { files: fileList } : {}),
|
|
94
|
+
...(failOn ? { failOn } : {}),
|
|
95
|
+
...(archAll ? { archAll: true } : {}),
|
|
96
|
+
...(disable ? { disable } : {}),
|
|
97
|
+
...(apiBaseline ? { apiDiff: { baselinePath: apiBaseline, failOnBreaking: !noFailOnBreaking } } : {}),
|
|
98
|
+
});
|
|
98
99
|
// Pack-plane merge notes (missing/invalid pack rule files, dropped
|
|
99
100
|
// collisions) go to stderr so they never pollute the JSON/markdown report
|
|
100
101
|
// on stdout that CI consumes.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
const scopeOpts = wantChangedScope
|
|
107
|
-
? { changedOnly: true, changedFiles: changedFiles ?? [] }
|
|
108
|
-
: {};
|
|
109
|
-
// §3.1 — the architecture gate's "NEW" is ALWAYS change-scoped: a NEW error
|
|
110
|
-
// means one introduced by the working change (diff vs HEAD), never drift
|
|
111
|
-
// against a frozen (possibly months-old) baseline in a file the change never
|
|
112
|
-
// touched. When an explicit scope flag is passed we reuse its resolution;
|
|
113
|
-
// otherwise we default to the worktree diff vs HEAD — empty in a clean tree,
|
|
114
|
-
// so pre-existing baseline drift stays informational and can't red the gate
|
|
115
|
-
// on its own. `--arch-all` (baselineRelative:false) ignores this and fails
|
|
116
|
-
// on total errors, keeping a clean-tree CI demand expressible.
|
|
117
|
-
const archChangedFiles = wantChangedScope
|
|
118
|
-
? changedFiles ?? []
|
|
119
|
-
: resolveChangedFiles({ projectRoot: cwd, includeWorktree: true }).files;
|
|
120
|
-
// Knowledge symbol-ref integrity needs the loaded knowledge entries. The
|
|
121
|
-
// inspection is async, so we build it here and inject it; the gate stays
|
|
122
|
-
// synchronous and resolves the code graph itself. Best-effort — a failed
|
|
123
|
-
// inspection just skips the gate rather than failing `shrk gate`.
|
|
124
|
-
let inspection;
|
|
125
|
-
if (!disable?.includes('knowledge-symbol')) {
|
|
126
|
-
try {
|
|
127
|
-
inspection = await inspectSharkcraft({ cwd });
|
|
128
|
-
}
|
|
129
|
-
catch {
|
|
130
|
-
inspection = undefined;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
const report = runQualityGates({
|
|
134
|
-
projectRoot: cwd,
|
|
135
|
-
arch: {
|
|
136
|
-
...(archAll ? { baselineRelative: false } : {}),
|
|
137
|
-
changedFiles: archChangedFiles,
|
|
138
|
-
},
|
|
139
|
-
wiring: {
|
|
140
|
-
...(configError
|
|
141
|
-
? { configError }
|
|
142
|
-
: wiringRules.length > 0
|
|
143
|
-
? { rules: wiringRules }
|
|
144
|
-
: {}),
|
|
145
|
-
...scopeOpts,
|
|
146
|
-
},
|
|
147
|
-
policy: {
|
|
148
|
-
...(configError
|
|
149
|
-
? { configError }
|
|
150
|
-
: policyRules.length > 0
|
|
151
|
-
? { rules: policyRules }
|
|
152
|
-
: {}),
|
|
153
|
-
...scopeOpts,
|
|
154
|
-
},
|
|
155
|
-
...(inspection
|
|
156
|
-
? {
|
|
157
|
-
knowledgeSymbol: {
|
|
158
|
-
inspection,
|
|
159
|
-
...(wantChangedScope ? { changedFiles: changedFiles ?? [] } : {}),
|
|
160
|
-
},
|
|
161
|
-
}
|
|
162
|
-
: {}),
|
|
163
|
-
impact: {
|
|
164
|
-
...(sinceRef ? { sinceRef } : {}),
|
|
165
|
-
// Blast-radius risk is inherently PRE-EXISTING structure (touching a hub
|
|
166
|
-
// is risky but not a new failure this change introduced), so the composite
|
|
167
|
-
// gate treats it as ADVISORY by default — `failOn: []` warns instead of
|
|
168
|
-
// redding, keeping the verdict change-attributable. `--fail-on critical`
|
|
169
|
-
// opts into a hard fail; `--strict` escalates the advisory warn.
|
|
170
|
-
failOn: failOn ?? [],
|
|
171
|
-
// Scope the impact gate to the changeset too: with `--since` we keep the
|
|
172
|
-
// gitref diff; with `--changed-only` / `--staged` / `--files` (and no
|
|
173
|
-
// `--since`) we analyze the resolved changed-file set directly.
|
|
174
|
-
...(wantChangedScope && !sinceRef ? { files: changedFiles ?? [] } : {}),
|
|
175
|
-
},
|
|
176
|
-
...(apiBaseline
|
|
177
|
-
? {
|
|
178
|
-
apiDiff: {
|
|
179
|
-
baselinePath: apiBaseline,
|
|
180
|
-
failOnBreaking: !noFailOnBreaking,
|
|
181
|
-
},
|
|
182
|
-
}
|
|
183
|
-
: {}),
|
|
184
|
-
...(disable ? { disable } : {}),
|
|
185
|
-
});
|
|
102
|
+
for (const d of prepared.planeDiagnostics)
|
|
103
|
+
process.stderr.write(`plane: ${d}\n`);
|
|
104
|
+
const report = runQualityGates(prepared.options);
|
|
186
105
|
// Persist the report so dashboards and follow-up tooling can read
|
|
187
106
|
// it without re-running every gate. Opt out with `--no-persist`.
|
|
188
107
|
if (!flagBool(args, 'no-persist')) {
|
|
@@ -194,8 +113,14 @@ export const gateCommand = {
|
|
|
194
113
|
// disk-write error.
|
|
195
114
|
}
|
|
196
115
|
}
|
|
116
|
+
// Settle first, render second: the proposed exit (from `overall`) is vetoed
|
|
117
|
+
// by any gate coverage with a shortfall, for text, --json and --markdown alike.
|
|
118
|
+
// THE settle (`settleQualityGateReport`) MCP `get_quality_gate` returns too.
|
|
119
|
+
const settled = settleQualityGateReport(report, strict);
|
|
120
|
+
const exit = settled.exit;
|
|
121
|
+
const line = verdictLine(settled, '');
|
|
197
122
|
if (wantMarkdown) {
|
|
198
|
-
const md = renderGateReportMarkdown(report);
|
|
123
|
+
const md = renderGateReportMarkdown(report) + (line ? `\n${line}\n` : '');
|
|
199
124
|
if (outputPath) {
|
|
200
125
|
const abs = nodePath.isAbsolute(outputPath)
|
|
201
126
|
? outputPath
|
|
@@ -206,11 +131,17 @@ export const gateCommand = {
|
|
|
206
131
|
else {
|
|
207
132
|
process.stdout.write(md);
|
|
208
133
|
}
|
|
209
|
-
return
|
|
134
|
+
return exit;
|
|
210
135
|
}
|
|
211
136
|
if (wantJson) {
|
|
212
|
-
process.stdout.write(asJson(
|
|
213
|
-
|
|
137
|
+
process.stdout.write(asJson({
|
|
138
|
+
...report,
|
|
139
|
+
exitCode: exit,
|
|
140
|
+
verdict: settled.verdict,
|
|
141
|
+
shortfalls: settled.shortfalls,
|
|
142
|
+
accepted: settled.accepted,
|
|
143
|
+
}) + '\n');
|
|
144
|
+
return exit;
|
|
214
145
|
}
|
|
215
146
|
process.stdout.write(header(`Quality gates: ${report.overall.toUpperCase()}`));
|
|
216
147
|
process.stdout.write(kv('total duration', `${report.totalDurationMs}ms`) + '\n');
|
|
@@ -225,16 +156,11 @@ export const gateCommand = {
|
|
|
225
156
|
process.stdout.write(` → ${c}\n`);
|
|
226
157
|
}
|
|
227
158
|
}
|
|
228
|
-
|
|
159
|
+
if (line)
|
|
160
|
+
process.stdout.write(`\n${line}\n`);
|
|
161
|
+
return exit;
|
|
229
162
|
},
|
|
230
163
|
};
|
|
231
|
-
function exitCode(overall, strict) {
|
|
232
|
-
if (overall === 'fail')
|
|
233
|
-
return 1;
|
|
234
|
-
if (overall === 'warn' && strict)
|
|
235
|
-
return 1;
|
|
236
|
-
return 0;
|
|
237
|
-
}
|
|
238
164
|
const GITHUB_WORKFLOW = `name: shrk gate
|
|
239
165
|
|
|
240
166
|
on:
|
|
@@ -441,7 +367,7 @@ async function runGateBaseline(args) {
|
|
|
441
367
|
return 2;
|
|
442
368
|
}
|
|
443
369
|
const report = runArchCheck({ projectRoot: cwd });
|
|
444
|
-
if (report
|
|
370
|
+
if (archStoreMissing(report)) {
|
|
445
371
|
process.stderr.write('Cannot refreeze — graph index missing. Run `shrk graph index` first.\n');
|
|
446
372
|
return 2;
|
|
447
373
|
}
|