@shrkcrft/inspector 0.1.0-alpha.30 → 0.1.0-alpha.32
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/acceptance-replay.js +1 -1
- package/dist/agent-contract-templates.js +6 -6
- package/dist/agent-contract.d.ts.map +1 -1
- package/dist/agent-contract.js +13 -8
- package/dist/agent-orchestration.js +2 -2
- package/dist/agent-task-prep.d.ts +16 -0
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +60 -5
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +21 -3
- package/dist/architecture-map.d.ts +16 -0
- package/dist/architecture-map.d.ts.map +1 -1
- package/dist/architecture-map.js +42 -26
- package/dist/area-explore.d.ts +2 -2
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +36 -16
- package/dist/area-map.d.ts +56 -11
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +106 -25
- package/dist/asset-doctor-proposed-exit.d.ts +21 -0
- package/dist/asset-doctor-proposed-exit.d.ts.map +1 -0
- package/dist/asset-doctor-proposed-exit.js +22 -0
- package/dist/asset-provenance.js +1 -1
- package/dist/boundaries-changed-only.d.ts +24 -1
- package/dist/boundaries-changed-only.d.ts.map +1 -1
- package/dist/boundaries-changed-only.js +12 -2
- package/dist/boundary-check-options.model.d.ts +40 -0
- package/dist/boundary-check-options.model.d.ts.map +1 -0
- package/dist/boundary-check-options.model.js +1 -0
- package/dist/boundary-check-result.model.d.ts +89 -0
- package/dist/boundary-check-result.model.d.ts.map +1 -0
- package/dist/boundary-check-result.model.js +1 -0
- package/dist/boundary-configuration-status.d.ts +38 -0
- package/dist/boundary-configuration-status.d.ts.map +1 -0
- package/dist/boundary-configuration-status.js +118 -0
- package/dist/boundary-configuration-status.model.d.ts +37 -0
- package/dist/boundary-configuration-status.model.d.ts.map +1 -0
- package/dist/boundary-configuration-status.model.js +1 -0
- package/dist/boundary-load-issue.model.d.ts +30 -0
- package/dist/boundary-load-issue.model.d.ts.map +1 -0
- package/dist/boundary-load-issue.model.js +1 -0
- package/dist/boundary-rule-check.model.d.ts +44 -0
- package/dist/boundary-rule-check.model.d.ts.map +1 -0
- package/dist/boundary-rule-check.model.js +1 -0
- package/dist/boundary-rule-invalidation.model.d.ts +31 -0
- package/dist/boundary-rule-invalidation.model.d.ts.map +1 -0
- package/dist/boundary-rule-invalidation.model.js +1 -0
- package/dist/boundary-rule-set-diff.model.d.ts +75 -0
- package/dist/boundary-rule-set-diff.model.d.ts.map +1 -0
- package/dist/boundary-rule-set-diff.model.js +1 -0
- package/dist/boundary-rule-sources.d.ts +28 -0
- package/dist/boundary-rule-sources.d.ts.map +1 -0
- package/dist/boundary-rule-sources.js +110 -0
- package/dist/boundary-stale-exception-finding.model.d.ts +12 -0
- package/dist/boundary-stale-exception-finding.model.d.ts.map +1 -0
- package/dist/boundary-stale-exception-finding.model.js +1 -0
- package/dist/boundary-unit-liveness.d.ts +35 -0
- package/dist/boundary-unit-liveness.d.ts.map +1 -0
- package/dist/boundary-unit-liveness.js +71 -0
- package/dist/change-intent.d.ts +3 -0
- package/dist/change-intent.d.ts.map +1 -1
- package/dist/change-intent.js +61 -27
- package/dist/changes-summary.d.ts.map +1 -1
- package/dist/changes-summary.js +19 -9
- package/dist/ci-integrity-report.js +1 -1
- package/dist/ci-predict.d.ts.map +1 -1
- package/dist/ci-predict.js +38 -5
- package/dist/code-intelligence-doctor.d.ts +6 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -1
- package/dist/code-intelligence-doctor.js +22 -7
- package/dist/codemod-assist.d.ts.map +1 -1
- package/dist/codemod-assist.js +3 -1
- package/dist/command-recommender.d.ts +45 -2
- package/dist/command-recommender.d.ts.map +1 -1
- package/dist/command-recommender.js +41 -263
- package/dist/command-resolution-status.d.ts +44 -0
- package/dist/command-resolution-status.d.ts.map +1 -0
- package/dist/command-resolution-status.js +44 -0
- package/dist/command-safety-level.d.ts +15 -0
- package/dist/command-safety-level.d.ts.map +1 -0
- package/dist/command-safety-level.js +43 -0
- package/dist/command-taxonomy.js +1 -1
- package/dist/comment-syntax.d.ts +15 -0
- package/dist/comment-syntax.d.ts.map +1 -0
- package/dist/comment-syntax.js +15 -0
- package/dist/compliance-evidence.js +1 -1
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-registry.d.ts +40 -0
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +186 -82
- package/dist/context-tuning.d.ts +4 -0
- package/dist/context-tuning.d.ts.map +1 -1
- package/dist/context-tuning.js +10 -7
- package/dist/contract-template-registry.d.ts +10 -0
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +59 -33
- package/dist/contribution-kind.d.ts +52 -0
- package/dist/contribution-kind.d.ts.map +1 -0
- package/dist/contribution-kind.js +52 -0
- package/dist/contribution-load-failures.d.ts +122 -0
- package/dist/contribution-load-failures.d.ts.map +1 -0
- package/dist/contribution-load-failures.js +592 -0
- package/dist/contributions-report.d.ts +28 -0
- package/dist/contributions-report.d.ts.map +1 -0
- package/dist/contributions-report.js +242 -0
- package/dist/convention-applicability.d.ts +46 -0
- package/dist/convention-applicability.d.ts.map +1 -0
- package/dist/convention-applicability.js +247 -0
- package/dist/convention-filter-level.d.ts +13 -0
- package/dist/convention-filter-level.d.ts.map +1 -0
- package/dist/convention-filter-level.js +13 -0
- package/dist/convention-registry.d.ts +51 -4
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +135 -60
- package/dist/coverage-report.d.ts.map +1 -1
- package/dist/coverage-report.js +6 -6
- package/dist/custom-checks.d.ts +60 -1
- package/dist/custom-checks.d.ts.map +1 -1
- package/dist/custom-checks.js +161 -6
- package/dist/dashboard/dashboard-data.d.ts +6 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -1
- package/dist/dashboard/dashboard-data.js +99 -8
- package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -1
- package/dist/dashboard/dashboard-knowledge.js +14 -2
- package/dist/decision-records.d.ts +24 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +231 -84
- package/dist/declared-cross-references.d.ts +61 -0
- package/dist/declared-cross-references.d.ts.map +1 -0
- package/dist/declared-cross-references.js +550 -0
- package/dist/declared-gate-plane-rules.d.ts +24 -0
- package/dist/declared-gate-plane-rules.d.ts.map +1 -0
- package/dist/declared-gate-plane-rules.js +39 -0
- package/dist/declared-reference-coverage.d.ts +27 -0
- package/dist/declared-reference-coverage.d.ts.map +1 -0
- package/dist/declared-reference-coverage.js +55 -0
- package/dist/declared-xref-status.d.ts +19 -0
- package/dist/declared-xref-status.d.ts.map +1 -0
- package/dist/declared-xref-status.js +19 -0
- package/dist/delegate-pack-recipes.d.ts +13 -2
- package/dist/delegate-pack-recipes.d.ts.map +1 -1
- package/dist/delegate-pack-recipes.js +45 -14
- package/dist/demo-package.js +2 -2
- package/dist/demo-script.js +2 -2
- package/dist/demo-workflow.js +3 -3
- package/dist/dev-cycle.js +1 -1
- package/dist/dev-session.js +1 -1
- package/dist/doc-references.d.ts +23 -2
- package/dist/doc-references.d.ts.map +1 -1
- package/dist/doc-references.js +96 -17
- package/dist/doctor-result.d.ts +8 -0
- package/dist/doctor-result.d.ts.map +1 -1
- package/dist/doctor-verdict-kind.d.ts +19 -0
- package/dist/doctor-verdict-kind.d.ts.map +1 -0
- package/dist/doctor-verdict-kind.js +19 -0
- package/dist/doctor-verdict.d.ts +18 -0
- package/dist/doctor-verdict.d.ts.map +1 -0
- package/dist/doctor-verdict.js +28 -0
- package/dist/drift.d.ts +17 -0
- package/dist/drift.d.ts.map +1 -1
- package/dist/drift.js +40 -10
- package/dist/entrypoint-matrix.d.ts.map +1 -1
- package/dist/entrypoint-matrix.js +4 -1
- package/dist/feedback-ingestion.d.ts +28 -2
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +75 -20
- package/dist/file-languages.d.ts +9 -0
- package/dist/file-languages.d.ts.map +1 -0
- package/dist/file-languages.js +91 -0
- package/dist/fix-preview.d.ts.map +1 -1
- package/dist/fix-preview.js +87 -22
- package/dist/framework-extractor-outcomes.d.ts +27 -0
- package/dist/framework-extractor-outcomes.d.ts.map +1 -0
- package/dist/framework-extractor-outcomes.js +83 -0
- package/dist/fuzzy-impact.d.ts.map +1 -1
- package/dist/fuzzy-impact.js +3 -2
- package/dist/git-helpers.d.ts +29 -4
- package/dist/git-helpers.d.ts.map +1 -1
- package/dist/git-helpers.js +69 -10
- package/dist/healing-plan.d.ts.map +1 -1
- package/dist/healing-plan.js +3 -4
- package/dist/helper-catalog.d.ts +25 -0
- package/dist/helper-catalog.d.ts.map +1 -0
- package/dist/helper-catalog.js +91 -0
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +17 -1
- package/dist/helper-view.d.ts +33 -0
- package/dist/helper-view.d.ts.map +1 -0
- package/dist/helper-view.js +1 -0
- package/dist/i-asset-doctor-flags.d.ts +16 -0
- package/dist/i-asset-doctor-flags.d.ts.map +1 -0
- package/dist/i-asset-doctor-flags.js +1 -0
- package/dist/i-command-resolution.d.ts +22 -0
- package/dist/i-command-resolution.d.ts.map +1 -0
- package/dist/i-command-resolution.js +1 -0
- package/dist/i-command-resolve-options.d.ts +24 -0
- package/dist/i-command-resolve-options.d.ts.map +1 -0
- package/dist/i-command-resolve-options.js +1 -0
- package/dist/i-command-safety.d.ts +13 -0
- package/dist/i-command-safety.d.ts.map +1 -0
- package/dist/i-command-safety.js +1 -0
- package/dist/i-contribution-accepted-entry.d.ts +18 -0
- package/dist/i-contribution-accepted-entry.d.ts.map +1 -0
- package/dist/i-contribution-accepted-entry.js +1 -0
- package/dist/i-contribution-entry-rejection.d.ts +21 -0
- package/dist/i-contribution-entry-rejection.d.ts.map +1 -0
- package/dist/i-contribution-entry-rejection.js +1 -0
- package/dist/i-contribution-file-issue.d.ts +18 -0
- package/dist/i-contribution-file-issue.d.ts.map +1 -0
- package/dist/i-contribution-file-issue.js +1 -0
- package/dist/i-contribution-file-report.d.ts +40 -0
- package/dist/i-contribution-file-report.d.ts.map +1 -0
- package/dist/i-contribution-file-report.js +1 -0
- package/dist/i-contribution-file-validation.d.ts +32 -0
- package/dist/i-contribution-file-validation.d.ts.map +1 -0
- package/dist/i-contribution-file-validation.js +1 -0
- package/dist/i-contributions-report.d.ts +31 -0
- package/dist/i-contributions-report.d.ts.map +1 -0
- package/dist/i-contributions-report.js +1 -0
- package/dist/i-convention-applicability-reason.d.ts +29 -0
- package/dist/i-convention-applicability-reason.d.ts.map +1 -0
- package/dist/i-convention-applicability-reason.js +1 -0
- package/dist/i-convention-applicability.d.ts +9 -0
- package/dist/i-convention-applicability.d.ts.map +1 -0
- package/dist/i-convention-applicability.js +1 -0
- package/dist/i-convention-scope.d.ts +19 -0
- package/dist/i-convention-scope.d.ts.map +1 -0
- package/dist/i-convention-scope.js +1 -0
- package/dist/i-declared-xref-field.d.ts +25 -0
- package/dist/i-declared-xref-field.d.ts.map +1 -0
- package/dist/i-declared-xref-field.js +1 -0
- package/dist/i-declared-xref-issue.d.ts +25 -0
- package/dist/i-declared-xref-issue.d.ts.map +1 -0
- package/dist/i-declared-xref-issue.js +1 -0
- package/dist/i-declared-xref-report.d.ts +48 -0
- package/dist/i-declared-xref-report.d.ts.map +1 -0
- package/dist/i-declared-xref-report.js +1 -0
- package/dist/i-declared-xref-row.d.ts +29 -0
- package/dist/i-declared-xref-row.d.ts.map +1 -0
- package/dist/i-declared-xref-row.js +1 -0
- package/dist/i-doctor-verdict.d.ts +10 -0
- package/dist/i-doctor-verdict.d.ts.map +1 -0
- package/dist/i-doctor-verdict.js +1 -0
- package/dist/i-file-language.d.ts +11 -0
- package/dist/i-file-language.d.ts.map +1 -0
- package/dist/i-file-language.js +1 -0
- package/dist/i-kind-outcomes.d.ts +13 -0
- package/dist/i-kind-outcomes.d.ts.map +1 -0
- package/dist/i-kind-outcomes.js +1 -0
- package/dist/i-not-applicable-convention.d.ts +17 -0
- package/dist/i-not-applicable-convention.d.ts.map +1 -0
- package/dist/i-not-applicable-convention.js +1 -0
- package/dist/i-pack-doctor-verdict.d.ts +15 -0
- package/dist/i-pack-doctor-verdict.d.ts.map +1 -0
- package/dist/i-pack-doctor-verdict.js +1 -0
- package/dist/i-probed-id-field.d.ts +17 -0
- package/dist/i-probed-id-field.d.ts.map +1 -0
- package/dist/i-probed-id-field.js +1 -0
- package/dist/i-reference-kind-declaration.d.ts +38 -0
- package/dist/i-reference-kind-declaration.d.ts.map +1 -0
- package/dist/i-reference-kind-declaration.js +1 -0
- package/dist/i-reference-pack-origin.d.ts +13 -0
- package/dist/i-reference-pack-origin.d.ts.map +1 -0
- package/dist/i-reference-pack-origin.js +1 -0
- package/dist/i-reference-warm-options.d.ts +21 -0
- package/dist/i-reference-warm-options.d.ts.map +1 -0
- package/dist/i-reference-warm-options.js +1 -0
- package/dist/i-registry-outcomes.d.ts +16 -0
- package/dist/i-registry-outcomes.d.ts.map +1 -0
- package/dist/i-registry-outcomes.js +1 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts +35 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/i-scaffold-pattern-doctor-report.js +1 -0
- package/dist/i-search-tuning-key-probe.d.ts +30 -0
- package/dist/i-search-tuning-key-probe.d.ts.map +1 -0
- package/dist/i-search-tuning-key-probe.js +1 -0
- package/dist/i-search-tuning-lint-issue.d.ts +61 -0
- package/dist/i-search-tuning-lint-issue.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-issue.js +1 -0
- package/dist/i-search-tuning-lint-report.d.ts +38 -0
- package/dist/i-search-tuning-lint-report.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-report.js +1 -0
- package/dist/i-stale-path-hint-input.d.ts +18 -0
- package/dist/i-stale-path-hint-input.d.ts.map +1 -0
- package/dist/i-stale-path-hint-input.js +1 -0
- package/dist/i-unresolvable-reference-scan.d.ts +14 -0
- package/dist/i-unresolvable-reference-scan.d.ts.map +1 -0
- package/dist/i-unresolvable-reference-scan.js +1 -0
- package/dist/i-unresolvable-reference.d.ts +29 -0
- package/dist/i-unresolvable-reference.d.ts.map +1 -0
- package/dist/i-unresolvable-reference.js +1 -0
- package/dist/i-unverifiable-remedy-group.d.ts +10 -0
- package/dist/i-unverifiable-remedy-group.d.ts.map +1 -0
- package/dist/i-unverifiable-remedy-group.js +1 -0
- package/dist/i-workspace-profile-payload.d.ts +12 -0
- package/dist/i-workspace-profile-payload.d.ts.map +1 -0
- package/dist/i-workspace-profile-payload.js +1 -0
- package/dist/impact-analysis.d.ts +15 -0
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +58 -13
- package/dist/impact-render.d.ts.map +1 -1
- package/dist/impact-render.js +22 -0
- package/dist/import-hygiene.d.ts +35 -1
- package/dist/import-hygiene.d.ts.map +1 -1
- package/dist/import-hygiene.js +107 -13
- package/dist/index.d.ts +158 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +197 -0
- package/dist/inspection-discovery.d.ts +45 -0
- package/dist/inspection-discovery.d.ts.map +1 -0
- package/dist/inspection-discovery.js +70 -0
- package/dist/knowledge-advisory-code.d.ts +17 -0
- package/dist/knowledge-advisory-code.d.ts.map +1 -0
- package/dist/knowledge-advisory-code.js +17 -0
- package/dist/knowledge-aged-entry.d.ts +10 -0
- package/dist/knowledge-aged-entry.d.ts.map +1 -0
- package/dist/knowledge-aged-entry.js +1 -0
- package/dist/knowledge-authoring.d.ts +25 -2
- package/dist/knowledge-authoring.d.ts.map +1 -1
- package/dist/knowledge-authoring.js +53 -13
- package/dist/knowledge-contribution-slots.d.ts +18 -0
- package/dist/knowledge-contribution-slots.d.ts.map +1 -0
- package/dist/knowledge-contribution-slots.js +25 -0
- package/dist/knowledge-entry-rejections.d.ts +17 -0
- package/dist/knowledge-entry-rejections.d.ts.map +1 -0
- package/dist/knowledge-entry-rejections.js +79 -0
- package/dist/knowledge-entry-verdict-record.d.ts +34 -0
- package/dist/knowledge-entry-verdict-record.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict-record.js +1 -0
- package/dist/knowledge-entry-verdict.d.ts +17 -0
- package/dist/knowledge-entry-verdict.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict.js +17 -0
- package/dist/knowledge-graph.d.ts +6 -0
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +18 -7
- package/dist/knowledge-kind-bucket.d.ts +19 -0
- package/dist/knowledge-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-kind-bucket.js +1 -0
- package/dist/knowledge-load-failure.d.ts +23 -0
- package/dist/knowledge-load-failure.d.ts.map +1 -0
- package/dist/knowledge-load-failure.js +1 -0
- package/dist/knowledge-min-referenced-valve.d.ts +12 -0
- package/dist/knowledge-min-referenced-valve.d.ts.map +1 -0
- package/dist/knowledge-min-referenced-valve.js +12 -0
- package/dist/knowledge-reference-kind-bucket.d.ts +11 -0
- package/dist/knowledge-reference-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-reference-kind-bucket.js +1 -0
- package/dist/knowledge-rejected-entry.d.ts +28 -0
- package/dist/knowledge-rejected-entry.d.ts.map +1 -0
- package/dist/knowledge-rejected-entry.js +1 -0
- package/dist/knowledge-rename-command.d.ts +20 -0
- package/dist/knowledge-rename-command.d.ts.map +1 -0
- package/dist/knowledge-rename-command.js +34 -0
- package/dist/knowledge-rename-verb.d.ts +11 -0
- package/dist/knowledge-rename-verb.d.ts.map +1 -0
- package/dist/knowledge-rename-verb.js +11 -0
- package/dist/knowledge-rename.d.ts +1 -1
- package/dist/knowledge-rename.d.ts.map +1 -1
- package/dist/knowledge-rename.js +6 -5
- package/dist/knowledge-stale-advisory.d.ts +14 -0
- package/dist/knowledge-stale-advisory.d.ts.map +1 -0
- package/dist/knowledge-stale-advisory.js +1 -0
- package/dist/knowledge-stale-coverage.d.ts +19 -0
- package/dist/knowledge-stale-coverage.d.ts.map +1 -0
- package/dist/knowledge-stale-coverage.js +1 -0
- package/dist/knowledge-stale-gate-flags.d.ts +33 -0
- package/dist/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge-stale-gate-input.d.ts +46 -0
- package/dist/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge-stale-gate-result.d.ts +33 -0
- package/dist/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge-stale-gate-rule.d.ts +33 -0
- package/dist/knowledge-stale-gate-rule.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-rule.js +1 -0
- package/dist/knowledge-stale-gate-violation.d.ts +13 -0
- package/dist/knowledge-stale-gate-violation.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-violation.js +1 -0
- package/dist/knowledge-stale-gate.d.ts +85 -0
- package/dist/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-gate.js +501 -0
- package/dist/knowledge-stale-quality-gate.d.ts +26 -0
- package/dist/knowledge-stale-quality-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-quality-gate.js +140 -0
- package/dist/knowledge-stale.d.ts +132 -9
- package/dist/knowledge-stale.d.ts.map +1 -1
- package/dist/knowledge-stale.js +1193 -294
- package/dist/knowledge-unverifiable-reason.d.ts +12 -0
- package/dist/knowledge-unverifiable-reason.d.ts.map +1 -0
- package/dist/knowledge-unverifiable-reason.js +12 -0
- package/dist/knowledge-unverifiable-remedy.d.ts +56 -0
- package/dist/knowledge-unverifiable-remedy.d.ts.map +1 -0
- package/dist/knowledge-unverifiable-remedy.js +0 -0
- package/dist/loader-diagnostics.d.ts +14 -2
- package/dist/loader-diagnostics.d.ts.map +1 -1
- package/dist/match-terms.d.ts +48 -0
- package/dist/match-terms.d.ts.map +1 -0
- package/dist/match-terms.js +155 -0
- package/dist/migration-profile-registry.d.ts +10 -0
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +57 -34
- package/dist/migration-readiness.d.ts.map +1 -1
- package/dist/migration-readiness.js +1 -3
- package/dist/nearest-id.d.ts +10 -26
- package/dist/nearest-id.d.ts.map +1 -1
- package/dist/nearest-id.js +9 -59
- package/dist/pack-asset-freshness.d.ts +65 -0
- package/dist/pack-asset-freshness.d.ts.map +1 -0
- package/dist/pack-asset-freshness.js +340 -0
- package/dist/pack-author-ux.d.ts +24 -3
- package/dist/pack-author-ux.d.ts.map +1 -1
- package/dist/pack-author-ux.js +87 -93
- package/dist/pack-contributions-inventory.d.ts +79 -39
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +445 -286
- package/dist/pack-doctor-verdict.d.ts +29 -0
- package/dist/pack-doctor-verdict.d.ts.map +1 -0
- package/dist/pack-doctor-verdict.js +45 -0
- package/dist/pack-doctor.d.ts +74 -1
- package/dist/pack-doctor.d.ts.map +1 -1
- package/dist/pack-doctor.js +281 -1
- package/dist/pack-helper-plan.d.ts +24 -0
- package/dist/pack-helper-plan.d.ts.map +1 -0
- package/dist/pack-helper-plan.js +77 -0
- package/dist/pack-helper-registry.d.ts +14 -0
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +76 -37
- package/dist/pack-manifest-reader.d.ts +8 -0
- package/dist/pack-manifest-reader.d.ts.map +1 -0
- package/dist/pack-manifest-reader.js +79 -0
- package/dist/pack-release-check.d.ts +14 -1
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +23 -1
- package/dist/pack-signature-status.d.ts +18 -6
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +59 -105
- package/dist/pack-test-runner.d.ts +27 -5
- package/dist/pack-test-runner.d.ts.map +1 -1
- package/dist/pack-test-runner.js +91 -35
- package/dist/pack-typecheck.d.ts +8 -0
- package/dist/pack-typecheck.d.ts.map +1 -0
- package/dist/pack-typecheck.js +76 -0
- package/dist/plan-review.d.ts +2 -0
- package/dist/plan-review.d.ts.map +1 -1
- package/dist/plan-review.js +17 -5
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +16 -5
- package/dist/playbook-load-issue.d.ts +16 -0
- package/dist/playbook-load-issue.d.ts.map +1 -0
- package/dist/playbook-load-issue.js +1 -0
- package/dist/playbook-registry.d.ts +32 -1
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +144 -55
- package/dist/policy-declaration.d.ts +18 -0
- package/dist/policy-declaration.d.ts.map +1 -0
- package/dist/policy-declaration.js +1 -0
- package/dist/policy-engine.d.ts +8 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +26 -9
- package/dist/policy-overrides.d.ts.map +1 -1
- package/dist/policy-overrides.js +4 -4
- package/dist/policy-registry.d.ts +27 -0
- package/dist/policy-registry.d.ts.map +1 -1
- package/dist/policy-registry.js +87 -20
- package/dist/probed-id-fields.d.ts +21 -0
- package/dist/probed-id-fields.d.ts.map +1 -0
- package/dist/probed-id-fields.js +25 -0
- package/dist/probed-id-source.d.ts +11 -0
- package/dist/probed-id-source.d.ts.map +1 -0
- package/dist/probed-id-source.js +11 -0
- package/dist/profile-registry.d.ts +25 -2
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +59 -6
- package/dist/propose-knowledge.js +3 -2
- package/dist/quality-gate-examination.d.ts +15 -0
- package/dist/quality-gate-examination.d.ts.map +1 -0
- package/dist/quality-gate-examination.js +15 -0
- package/dist/quality-gate-row-status.d.ts +19 -0
- package/dist/quality-gate-row-status.d.ts.map +1 -0
- package/dist/quality-gate-row-status.js +28 -0
- package/dist/quality-gate-status.d.ts +16 -0
- package/dist/quality-gate-status.d.ts.map +1 -0
- package/dist/quality-gate-status.js +16 -0
- package/dist/quality-html.d.ts.map +1 -1
- package/dist/quality-html.js +14 -3
- package/dist/quality-report-coverage.d.ts +26 -0
- package/dist/quality-report-coverage.d.ts.map +1 -0
- package/dist/quality-report-coverage.js +48 -0
- package/dist/quality-report.d.ts +28 -1
- package/dist/quality-report.d.ts.map +1 -1
- package/dist/quality-report.js +263 -35
- package/dist/query-intent-kind.d.ts +18 -0
- package/dist/query-intent-kind.d.ts.map +1 -0
- package/dist/query-intent-kind.js +18 -0
- package/dist/query-intent-result.d.ts +23 -0
- package/dist/query-intent-result.d.ts.map +1 -0
- package/dist/query-intent-result.js +1 -0
- package/dist/query-intent.d.ts +18 -0
- package/dist/query-intent.d.ts.map +1 -0
- package/dist/query-intent.js +336 -0
- package/dist/query-resolver.d.ts +18 -0
- package/dist/query-resolver.d.ts.map +1 -1
- package/dist/query-resolver.js +7 -4
- package/dist/ranked-recommendations.d.ts +36 -0
- package/dist/ranked-recommendations.d.ts.map +1 -0
- package/dist/ranked-recommendations.js +1 -0
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +38 -10
- package/dist/recommend-recipe.d.ts +17 -0
- package/dist/recommend-recipe.d.ts.map +1 -0
- package/dist/recommend-recipe.js +1 -0
- package/dist/recommend-recipes.d.ts +9 -0
- package/dist/recommend-recipes.d.ts.map +1 -0
- package/dist/recommend-recipes.js +106 -0
- package/dist/recommendation-candidate.d.ts +30 -0
- package/dist/recommendation-candidate.d.ts.map +1 -0
- package/dist/recommendation-candidate.js +1 -0
- package/dist/recommendation-confidence.d.ts +27 -0
- package/dist/recommendation-confidence.d.ts.map +1 -0
- package/dist/recommendation-confidence.js +1 -0
- package/dist/recommendation-ranking-options.d.ts +24 -0
- package/dist/recommendation-ranking-options.d.ts.map +1 -0
- package/dist/recommendation-ranking-options.js +1 -0
- package/dist/recommendation-ranking.d.ts +50 -0
- package/dist/recommendation-ranking.d.ts.map +1 -0
- package/dist/recommendation-ranking.js +527 -0
- package/dist/recommendation-source.d.ts +23 -0
- package/dist/recommendation-source.d.ts.map +1 -0
- package/dist/recommendation-source.js +23 -0
- package/dist/recommendation-suppression.d.ts +14 -0
- package/dist/recommendation-suppression.d.ts.map +1 -0
- package/dist/recommendation-suppression.js +14 -0
- package/dist/reference-asset-kind.d.ts +14 -0
- package/dist/reference-asset-kind.d.ts.map +1 -0
- package/dist/reference-asset-kind.js +14 -0
- package/dist/reference-content-check.d.ts +32 -0
- package/dist/reference-content-check.d.ts.map +1 -0
- package/dist/reference-content-check.js +143 -0
- package/dist/reference-failure.d.ts +31 -0
- package/dist/reference-failure.d.ts.map +1 -0
- package/dist/reference-failure.js +31 -0
- package/dist/reference-id-status.d.ts +15 -0
- package/dist/reference-id-status.d.ts.map +1 -0
- package/dist/reference-id-status.js +15 -0
- package/dist/reference-kind-declarations.d.ts +42 -0
- package/dist/reference-kind-declarations.d.ts.map +1 -0
- package/dist/reference-kind-declarations.js +142 -0
- package/dist/reference-lookup.d.ts +6 -0
- package/dist/reference-lookup.d.ts.map +1 -1
- package/dist/reference-lookup.js +13 -5
- package/dist/reference-pack-origin.d.ts +18 -0
- package/dist/reference-pack-origin.d.ts.map +1 -0
- package/dist/reference-pack-origin.js +38 -0
- package/dist/reference-registry.d.ts +109 -11
- package/dist/reference-registry.d.ts.map +1 -1
- package/dist/reference-registry.js +186 -30
- package/dist/reference-subject.d.ts +20 -0
- package/dist/reference-subject.d.ts.map +1 -0
- package/dist/reference-subject.js +1 -0
- package/dist/registration-hint-discovery-status.d.ts +25 -0
- package/dist/registration-hint-discovery-status.d.ts.map +1 -0
- package/dist/registration-hint-discovery-status.js +25 -0
- package/dist/registration-hint-registry.d.ts +80 -0
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +356 -138
- package/dist/registry-lifecycle.d.ts +200 -19
- package/dist/registry-lifecycle.d.ts.map +1 -1
- package/dist/registry-lifecycle.js +526 -136
- package/dist/release-readiness.d.ts.map +1 -1
- package/dist/release-readiness.js +10 -7
- package/dist/release-smoke.d.ts.map +1 -1
- package/dist/release-smoke.js +11 -7
- package/dist/report-site.d.ts.map +1 -1
- package/dist/report-site.js +25 -7
- package/dist/repository-intelligence.d.ts.map +1 -1
- package/dist/repository-intelligence.js +3 -2
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/repository-knowledge-model.js +18 -5
- package/dist/repository-stats.d.ts.map +1 -1
- package/dist/repository-stats.js +3 -77
- package/dist/resolve-project-config.d.ts +64 -0
- package/dist/resolve-project-config.d.ts.map +1 -1
- package/dist/resolve-project-config.js +250 -33
- package/dist/reuse/compute-reuse-coverage.d.ts +29 -0
- package/dist/reuse/compute-reuse-coverage.d.ts.map +1 -0
- package/dist/reuse/compute-reuse-coverage.js +198 -0
- package/dist/reuse/rank-reuse-candidates.d.ts +38 -0
- package/dist/reuse/rank-reuse-candidates.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-candidates.js +212 -0
- package/dist/reuse/rank-reuse-options.d.ts +20 -0
- package/dist/reuse/rank-reuse-options.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-options.js +1 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts +15 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-suggestions.js +31 -0
- package/dist/reuse/resolve-curated-reuse.d.ts +43 -0
- package/dist/reuse/resolve-curated-reuse.d.ts.map +1 -0
- package/dist/reuse/resolve-curated-reuse.js +115 -0
- package/dist/reuse/reuse-candidate.d.ts +29 -0
- package/dist/reuse/reuse-candidate.d.ts.map +1 -0
- package/dist/reuse/reuse-candidate.js +1 -0
- package/dist/reuse/reuse-coverage-report.d.ts +74 -0
- package/dist/reuse/reuse-coverage-report.d.ts.map +1 -0
- package/dist/reuse/reuse-coverage-report.js +1 -0
- package/dist/reuse/reuse-curated-coverage.d.ts +36 -0
- package/dist/reuse/reuse-curated-coverage.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-coverage.js +1 -0
- package/dist/reuse/reuse-curated-resolution.d.ts +36 -0
- package/dist/reuse/reuse-curated-resolution.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-resolution.js +1 -0
- package/dist/reuse/reuse-curated-status.d.ts +21 -0
- package/dist/reuse/reuse-curated-status.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-status.js +21 -0
- package/dist/reuse/reuse-match-detail.d.ts +15 -0
- package/dist/reuse/reuse-match-detail.d.ts.map +1 -0
- package/dist/reuse/reuse-match-detail.js +1 -0
- package/dist/reuse/reuse-ranking.d.ts +37 -0
- package/dist/reuse/reuse-ranking.d.ts.map +1 -0
- package/dist/reuse/reuse-ranking.js +1 -0
- package/dist/reuse/reuse-suggestion.d.ts +19 -0
- package/dist/reuse/reuse-suggestion.d.ts.map +1 -0
- package/dist/reuse/reuse-suggestion.js +1 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts +28 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts.map +1 -0
- package/dist/reuse/reuse-symbol-lookup.js +1 -0
- package/dist/reuse/reuse-tokenize.d.ts +11 -0
- package/dist/reuse/reuse-tokenize.d.ts.map +1 -0
- package/dist/reuse/reuse-tokenize.js +26 -0
- package/dist/reuse/score-reuse-name.d.ts +16 -0
- package/dist/reuse/score-reuse-name.d.ts.map +1 -0
- package/dist/reuse/score-reuse-name.js +35 -0
- package/dist/reuse/score-reuse-primitive.d.ts +33 -0
- package/dist/reuse/score-reuse-primitive.d.ts.map +1 -0
- package/dist/reuse/score-reuse-primitive.js +92 -0
- package/dist/review-packet.d.ts +2 -0
- package/dist/review-packet.d.ts.map +1 -1
- package/dist/review-packet.js +13 -6
- package/dist/role-views.d.ts.map +1 -1
- package/dist/role-views.js +16 -16
- package/dist/routing-recommends-channels.d.ts +24 -0
- package/dist/routing-recommends-channels.d.ts.map +1 -0
- package/dist/routing-recommends-channels.js +19 -0
- package/dist/run-boundary-check.d.ts +118 -0
- package/dist/run-boundary-check.d.ts.map +1 -0
- package/dist/run-boundary-check.js +592 -0
- package/dist/safety-audit.js +1 -1
- package/dist/scaffold-coverage.js +1 -1
- package/dist/scaffold-pattern-doctor-report.d.ts +19 -0
- package/dist/scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/scaffold-pattern-doctor-report.js +54 -0
- package/dist/scaffold-patterns.d.ts +75 -1
- package/dist/scaffold-patterns.d.ts.map +1 -1
- package/dist/scaffold-patterns.js +375 -84
- package/dist/schema-inventory.d.ts.map +1 -1
- package/dist/schema-inventory.js +4 -3
- package/dist/search-document-id.d.ts +52 -0
- package/dist/search-document-id.d.ts.map +1 -0
- package/dist/search-document-id.js +72 -0
- package/dist/search-document-prefix.d.ts +7 -0
- package/dist/search-document-prefix.d.ts.map +1 -0
- package/dist/search-document-prefix.js +1 -0
- package/dist/search-index.d.ts.map +1 -1
- package/dist/search-index.js +20 -23
- package/dist/search-tuning-explain.d.ts +6 -0
- package/dist/search-tuning-explain.d.ts.map +1 -1
- package/dist/search-tuning-explain.js +19 -17
- package/dist/search-tuning-key-probes.d.ts +16 -0
- package/dist/search-tuning-key-probes.d.ts.map +1 -0
- package/dist/search-tuning-key-probes.js +65 -0
- package/dist/search-tuning-key-resolution.d.ts +25 -0
- package/dist/search-tuning-key-resolution.d.ts.map +1 -0
- package/dist/search-tuning-key-resolution.js +1 -0
- package/dist/search-tuning-key-resolver.d.ts +4 -0
- package/dist/search-tuning-key-resolver.d.ts.map +1 -0
- package/dist/search-tuning-key-resolver.js +107 -0
- package/dist/search-tuning-key-status.d.ts +24 -0
- package/dist/search-tuning-key-status.d.ts.map +1 -0
- package/dist/search-tuning-key-status.js +24 -0
- package/dist/search-tuning-lint.d.ts +9 -0
- package/dist/search-tuning-lint.d.ts.map +1 -0
- package/dist/search-tuning-lint.js +468 -0
- package/dist/search-tuning-registry.d.ts +43 -0
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +214 -49
- package/dist/self-audit.d.ts +12 -0
- package/dist/self-audit.d.ts.map +1 -1
- package/dist/self-audit.js +36 -10
- package/dist/self-config-doctor-v2.d.ts +145 -3
- package/dist/self-config-doctor-v2.d.ts.map +1 -1
- package/dist/self-config-doctor-v2.js +1369 -182
- package/dist/self-config-doctor.d.ts +20 -1
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +55 -281
- package/dist/settled-unit-states.d.ts +9 -0
- package/dist/settled-unit-states.d.ts.map +1 -0
- package/dist/settled-unit-states.js +14 -0
- package/dist/sharkcraft-inspector.d.ts +34 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +314 -27
- package/dist/spec/spec-evidence.d.ts.map +1 -1
- package/dist/spec/spec-evidence.js +14 -20
- package/dist/split-identifier.d.ts +21 -0
- package/dist/split-identifier.d.ts.map +1 -0
- package/dist/split-identifier.js +27 -0
- package/dist/stale-path-hint.d.ts +3 -0
- package/dist/stale-path-hint.d.ts.map +1 -0
- package/dist/stale-path-hint.js +47 -0
- package/dist/start-here.d.ts.map +1 -1
- package/dist/start-here.js +1 -2
- package/dist/substitute-placeholders.d.ts +8 -0
- package/dist/substitute-placeholders.d.ts.map +1 -0
- package/dist/substitute-placeholders.js +9 -0
- package/dist/symbol-index.d.ts +33 -0
- package/dist/symbol-index.d.ts.map +1 -1
- package/dist/symbol-index.js +241 -3
- package/dist/symbol-member-entry.d.ts +26 -0
- package/dist/symbol-member-entry.d.ts.map +1 -0
- package/dist/symbol-member-entry.js +1 -0
- package/dist/symbol-member-kind.d.ts +14 -0
- package/dist/symbol-member-kind.d.ts.map +1 -0
- package/dist/symbol-member-kind.js +14 -0
- package/dist/task-packet.d.ts.map +1 -1
- package/dist/task-packet.js +52 -9
- package/dist/task-ranker.d.ts +8 -0
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +25 -13
- package/dist/task-risk.js +1 -1
- package/dist/task-routing-hint-registry.d.ts +20 -1
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +186 -42
- package/dist/template-authoring.d.ts +1 -1
- package/dist/template-authoring.d.ts.map +1 -1
- package/dist/template-authoring.js +2 -1
- package/dist/template-drift.d.ts.map +1 -1
- package/dist/template-drift.js +30 -9
- package/dist/template-lint.d.ts.map +1 -1
- package/dist/template-lint.js +160 -2
- package/dist/term-query.d.ts +10 -0
- package/dist/term-query.d.ts.map +1 -0
- package/dist/term-query.js +1 -0
- package/dist/test-definitions.d.ts +6 -3
- package/dist/test-definitions.d.ts.map +1 -1
- package/dist/test-runner.d.ts +95 -10
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +309 -308
- package/dist/tuning-query-tokens.d.ts +29 -0
- package/dist/tuning-query-tokens.d.ts.map +1 -0
- package/dist/tuning-query-tokens.js +51 -0
- package/dist/typecheck-files.d.ts +36 -0
- package/dist/typecheck-files.d.ts.map +1 -0
- package/dist/typecheck-files.js +158 -0
- package/dist/uncertainty.js +1 -1
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +5 -3
- package/dist/unregistered-exports.d.ts +19 -0
- package/dist/unregistered-exports.d.ts.map +1 -0
- package/dist/unregistered-exports.js +141 -0
- package/dist/unresolvable-reason.d.ts +11 -0
- package/dist/unresolvable-reason.d.ts.map +1 -0
- package/dist/unresolvable-reason.js +11 -0
- package/dist/upgrade-advisor.d.ts.map +1 -1
- package/dist/upgrade-advisor.js +16 -9
- package/dist/validate-contribution-file.d.ts +4 -0
- package/dist/validate-contribution-file.d.ts.map +1 -0
- package/dist/validate-contribution-file.js +233 -0
- package/dist/why-file.d.ts +3 -0
- package/dist/why-file.d.ts.map +1 -1
- package/dist/why-file.js +12 -7
- package/package.json +17 -17
|
@@ -19,20 +19,75 @@
|
|
|
19
19
|
* dropped with a diagnostic. Pack elements are validated with the SAME exported
|
|
20
20
|
* zod schemas the config loader uses, so a malformed pack element is skipped
|
|
21
21
|
* (with a diagnostic) rather than crashing config resolution.
|
|
22
|
+
*
|
|
23
|
+
* Round 12 (12.1): every pack element the merge refuses — schema-invalid, a
|
|
24
|
+
* vetoed shell command, a key collision, an unresolvable `$use` — is also a
|
|
25
|
+
* structured rejection in {@link IResolvedProjectConfig.planeOutcomes}, and
|
|
26
|
+
* every adopted one an accepted entry, so THE contribution rejection channel
|
|
27
|
+
* reports gate-plane contributions like every other kind.
|
|
22
28
|
*/
|
|
23
29
|
import { existsSync } from 'node:fs';
|
|
24
30
|
import * as nodePath from 'node:path';
|
|
25
|
-
import { importModuleViaLoader, ok, resolvePlaneExtractors, } from '@shrkcrft/core';
|
|
26
|
-
import { BaselineRuleSchema, DocReferenceRuleSchema, GeneratedArtifactRuleSchema, loadProjectConfig, PolicyRuleSchema, RegistrationIdiomSchema, RegistryDeclarationSchema, ReusePrimitiveSchema, WiringRuleSchema, } from '@shrkcrft/config';
|
|
31
|
+
import { ERROR_CODES, importModuleViaLoader, ok, RejectionCause, resolvePlaneExtractors, unitProblemsOf, validateResolvedPlaneSources, } from '@shrkcrft/core';
|
|
32
|
+
import { BaselineRuleSchema, DocReferenceRuleSchema, GeneratedArtifactRuleSchema, loadProjectConfig, normalizePlaneRule, PolicyRuleSchema, RegistrationIdiomSchema, RegistryDeclarationSchema, ReusePrimitiveSchema, WiringRuleSchema, } from '@shrkcrft/config';
|
|
27
33
|
import { discoverPacks } from '@shrkcrft/packs';
|
|
34
|
+
import { ContributionKind } from "./contribution-kind.js";
|
|
35
|
+
/**
|
|
36
|
+
* The gate plane a `mergePlane` label merges (round 13), so the seam
|
|
37
|
+
* normalises a pack element's markable lists through the ONE per-plane
|
|
38
|
+
* normaliser the loader uses (`normalizePlaneRule`). `reusePrimitive` is not a
|
|
39
|
+
* gate plane and has no markable list.
|
|
40
|
+
*/
|
|
41
|
+
function gatePlaneOfLabel(planeLabel) {
|
|
42
|
+
const planes = {
|
|
43
|
+
wiringRule: 'wiring',
|
|
44
|
+
registry: 'registry',
|
|
45
|
+
registrationIdiom: 'registration',
|
|
46
|
+
policyRule: 'policy',
|
|
47
|
+
baseline: 'baseline',
|
|
48
|
+
generatedArtifact: 'generated',
|
|
49
|
+
docReference: 'doc-reference',
|
|
50
|
+
};
|
|
51
|
+
return planes[planeLabel];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* THE "is there no SharkCraft config at all?" answer for a failed
|
|
55
|
+
* {@link resolveProjectConfig}: the loader found no `sharkcraft/` folder. A
|
|
56
|
+
* config that EXISTS but failed to load is a different answer — an error.
|
|
57
|
+
* `finish` (the plane gates are "not applicable") and the quality report's
|
|
58
|
+
* plane row (no row) both read this, so the two cannot disagree about one
|
|
59
|
+
* repo (round 11 review R12-REG-2).
|
|
60
|
+
*/
|
|
61
|
+
export function isProjectConfigAbsent(error) {
|
|
62
|
+
return error.code === ERROR_CODES.SHARKCRAFT_FOLDER_NOT_FOUND;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* THE per-element validation of a gate-plane pack contribution: one
|
|
66
|
+
* `<path>: <message>` per zod issue, `[]` when accepted. The merge below and
|
|
67
|
+
* `packs test --load` (`validateContributionFile`) both call it with the SAME
|
|
68
|
+
* exported schema the config loader validates a local element with.
|
|
69
|
+
*/
|
|
70
|
+
export function planeElementRejectionReasons(schema, raw) {
|
|
71
|
+
const parsed = schema.safeParse(raw);
|
|
72
|
+
if (parsed.success)
|
|
73
|
+
return [];
|
|
74
|
+
const issues = parsed.error?.issues ?? [];
|
|
75
|
+
return issues.length > 0
|
|
76
|
+
? issues.map((iss) => `${iss.path.join('.') || '(entry)'}: ${iss.message}`)
|
|
77
|
+
: ['(entry): invalid element'];
|
|
78
|
+
}
|
|
28
79
|
/**
|
|
29
80
|
* Generic per-plane load + validate + merge. Seeds the merged map from the
|
|
30
81
|
* LOCAL array (keyed by `keyOf`), then folds in pack elements only when their
|
|
31
82
|
* key is free. Missing files, non-array default exports, schema-invalid
|
|
32
83
|
* elements, and key collisions all become diagnostics and are skipped — never a
|
|
33
|
-
* throw.
|
|
84
|
+
* throw. A file that failed to import or whose default export is not an array
|
|
85
|
+
* is also a load failure (its rules are unknown); a refused element is a
|
|
86
|
+
* rejection.
|
|
34
87
|
*/
|
|
35
88
|
async function mergePlane(localArr, packContribs, schema, keyOf, planeLabel, diagnostics,
|
|
89
|
+
/** Where the structured outcome is recorded — absent for a plane with no manifest slot. */
|
|
90
|
+
outcome,
|
|
36
91
|
/**
|
|
37
92
|
* Optional per-item veto applied to PACK elements only. Returns the
|
|
38
93
|
* diagnostic to record when the element must not be adopted (used by the
|
|
@@ -41,6 +96,9 @@ async function mergePlane(localArr, packContribs, schema, keyOf, planeLabel, dia
|
|
|
41
96
|
packGuard) {
|
|
42
97
|
const merged = new Map();
|
|
43
98
|
const localKeys = new Set();
|
|
99
|
+
// A plane with no manifest slot records into a sink nobody reads.
|
|
100
|
+
const kind = outcome?.kind ?? ContributionKind.PolicyRule;
|
|
101
|
+
const sink = outcome?.sink ?? { accepted: [], rejected: [], loadFailures: [], adopted: new Map() };
|
|
44
102
|
for (const item of localArr) {
|
|
45
103
|
const key = keyOf(item);
|
|
46
104
|
merged.set(key, item);
|
|
@@ -57,41 +115,102 @@ packGuard) {
|
|
|
57
115
|
mod = await importModuleViaLoader(full);
|
|
58
116
|
}
|
|
59
117
|
catch (e) {
|
|
60
|
-
|
|
118
|
+
const message = e.message;
|
|
119
|
+
diagnostics.push(`pack ${contrib.packageName}: failed to load ${planeLabel} file ${contrib.rel} — ${message}`);
|
|
120
|
+
sink.loadFailures.push({
|
|
121
|
+
file: full,
|
|
122
|
+
kind,
|
|
123
|
+
packageName: contrib.packageName,
|
|
124
|
+
message: (message.split('\n')[0] ?? message).trim(),
|
|
125
|
+
});
|
|
61
126
|
continue;
|
|
62
127
|
}
|
|
63
128
|
const arr = mod.default;
|
|
64
129
|
if (!Array.isArray(arr)) {
|
|
65
130
|
diagnostics.push(`pack ${contrib.packageName}: ${planeLabel} file ${contrib.rel} default export is not an array — skipped`);
|
|
131
|
+
// Its rules are unknown, exactly as for a file that failed to import: one
|
|
132
|
+
// load failure, so every plane reader shows an ERRORED row and `packs
|
|
133
|
+
// contributions` counts it. It was a diagnostic line only, and `gates
|
|
134
|
+
// check` / `policy-lint` printed ✓ at exit 0 over a pack rule file none of
|
|
135
|
+
// whose rules ran (round 15 lane B review; `packs test --load` already
|
|
136
|
+
// refused the file with this message).
|
|
137
|
+
sink.loadFailures.push({ file: full, kind, packageName: contrib.packageName, message: 'default export is not an array' });
|
|
66
138
|
continue;
|
|
67
139
|
}
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
140
|
+
arr.forEach((raw, index) => {
|
|
141
|
+
const reject = (reasons, cause, entryId) => {
|
|
142
|
+
const id = entryId ?? planeElementKey(raw);
|
|
143
|
+
sink.rejected.push({
|
|
144
|
+
file: full,
|
|
145
|
+
index,
|
|
146
|
+
exportName: 'default',
|
|
147
|
+
...(id !== undefined ? { entryId: id } : {}),
|
|
148
|
+
reasons,
|
|
149
|
+
cause,
|
|
150
|
+
kind,
|
|
151
|
+
packageName: contrib.packageName,
|
|
152
|
+
via: 'config-plane',
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
const reasons = planeElementRejectionReasons(schema, raw);
|
|
156
|
+
if (reasons.length > 0) {
|
|
157
|
+
diagnostics.push(`pack ${contrib.packageName}: invalid ${planeLabel} element in ${contrib.rel} — ${reasons.join('; ')} — skipped`);
|
|
158
|
+
reject(reasons, RejectionCause.Invalid);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const parsedItem = schema.safeParse(raw).data;
|
|
162
|
+
// Round 13: normalise the element's markable lists the way the loader
|
|
163
|
+
// normalises a local rule (`normalizePlaneRule`) — plain string lists
|
|
164
|
+
// plus `expectEmptyUnits` — and STAMP every marker with the contributing
|
|
165
|
+
// pack, so a pack marker that went live reads as INFO and never fails the
|
|
166
|
+
// consumer. The schema above already refused a malformed marker (the
|
|
167
|
+
// round-12 rejection channel); a failure here is refused the same way.
|
|
168
|
+
const plane = gatePlaneOfLabel(planeLabel);
|
|
169
|
+
const normalized = plane !== undefined ? normalizePlaneRule(plane, parsedItem, contrib.packageName) : undefined;
|
|
170
|
+
if (normalized !== undefined && !normalized.ok) {
|
|
171
|
+
const problems = unitProblemsOf(normalized.error);
|
|
172
|
+
diagnostics.push(`pack ${contrib.packageName}: invalid ${planeLabel} element in ${contrib.rel} — ${problems.join('; ')} — skipped`);
|
|
173
|
+
reject(problems, RejectionCause.Invalid);
|
|
174
|
+
return;
|
|
76
175
|
}
|
|
77
|
-
const item =
|
|
176
|
+
const item = normalized !== undefined ? normalized.value : parsedItem;
|
|
78
177
|
const veto = packGuard?.(item, contrib.packageName);
|
|
79
178
|
if (veto !== undefined) {
|
|
80
|
-
diagnostics.push(veto);
|
|
81
|
-
|
|
179
|
+
diagnostics.push(veto.diagnostic);
|
|
180
|
+
reject([veto.reason], RejectionCause.Invalid, keyOf(item));
|
|
181
|
+
return;
|
|
82
182
|
}
|
|
83
183
|
const key = keyOf(item);
|
|
84
184
|
if (merged.has(key)) {
|
|
85
|
-
|
|
185
|
+
const local = localKeys.has(key);
|
|
186
|
+
diagnostics.push(local
|
|
86
187
|
? `pack ${contrib.packageName}: ${planeLabel} "${key}" already provided by local config — skipped`
|
|
87
188
|
: `pack ${contrib.packageName}: ${planeLabel} "${key}" already provided — skipped`);
|
|
88
|
-
|
|
189
|
+
reject([`id: "${key}" is already provided by ${local ? 'the local config' : 'an earlier pack'} — local wins`], RejectionCause.DuplicateId, key);
|
|
190
|
+
return;
|
|
89
191
|
}
|
|
90
192
|
merged.set(key, item);
|
|
91
|
-
|
|
193
|
+
const entry = { kind, file: full, packageName: contrib.packageName, id: key };
|
|
194
|
+
sink.accepted.push(entry);
|
|
195
|
+
sink.adopted.set(`${kind}:${key}`, { entry, index });
|
|
196
|
+
});
|
|
92
197
|
}
|
|
93
198
|
return [...merged.values()];
|
|
94
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* THE id of a raw gate-plane element — its `id` / `name` / `symbol`, whichever
|
|
202
|
+
* string it carries first — for a rejection record. The merge seam and `packs
|
|
203
|
+
* test --load` (`validateContributionFile`) both name a refused element by it.
|
|
204
|
+
*/
|
|
205
|
+
export function planeElementKey(raw) {
|
|
206
|
+
if (!raw || typeof raw !== 'object')
|
|
207
|
+
return undefined;
|
|
208
|
+
const r = raw;
|
|
209
|
+
for (const k of ['id', 'name', 'symbol'])
|
|
210
|
+
if (typeof r[k] === 'string')
|
|
211
|
+
return r[k];
|
|
212
|
+
return undefined;
|
|
213
|
+
}
|
|
95
214
|
/** Collect every pack contribution file for one manifest slot across valid packs. */
|
|
96
215
|
function gatherPackContribs(validPacks, slot) {
|
|
97
216
|
const out = [];
|
|
@@ -106,6 +225,63 @@ function gatherPackContribs(validPacks, slot) {
|
|
|
106
225
|
}
|
|
107
226
|
return out;
|
|
108
227
|
}
|
|
228
|
+
/** The shell-command veto of a pack-contributed baseline: `compute.run` is never auto-run. */
|
|
229
|
+
function baselinePackVeto(item, packName) {
|
|
230
|
+
return item.compute?.kind === 'command'
|
|
231
|
+
? {
|
|
232
|
+
diagnostic: `pack ${packName}: baseline "${item.id}" declares a shell \`compute.run\` — pack-contributed commands are never auto-run — skipped`,
|
|
233
|
+
reason: 'compute.run: a pack-contributed shell command is never auto-run',
|
|
234
|
+
}
|
|
235
|
+
: undefined;
|
|
236
|
+
}
|
|
237
|
+
/** The shell-command veto of a pack-contributed generated artifact: `regen` is never auto-run. */
|
|
238
|
+
function generatedPackVeto(item, packName) {
|
|
239
|
+
return item.regen !== undefined
|
|
240
|
+
? {
|
|
241
|
+
diagnostic: `pack ${packName}: generatedArtifact "${item.id}" declares a \`regen\` command — pack-contributed commands are never auto-run — skipped`,
|
|
242
|
+
reason: 'regen: a pack-contributed shell command is never auto-run',
|
|
243
|
+
}
|
|
244
|
+
: undefined;
|
|
245
|
+
}
|
|
246
|
+
/** Each gate-plane manifest slot → THE schema its elements validate against, and its pack veto. */
|
|
247
|
+
const PACK_PLANE_SLOTS = {
|
|
248
|
+
wiringRuleFiles: { schema: WiringRuleSchema },
|
|
249
|
+
registryFiles: { schema: RegistryDeclarationSchema },
|
|
250
|
+
registrationGraphFiles: { schema: RegistrationIdiomSchema },
|
|
251
|
+
policyRuleFiles: { schema: PolicyRuleSchema },
|
|
252
|
+
reusePrimitiveFiles: { schema: ReusePrimitiveSchema },
|
|
253
|
+
baselineFiles: { schema: BaselineRuleSchema, veto: baselinePackVeto },
|
|
254
|
+
generatedArtifactFiles: {
|
|
255
|
+
schema: GeneratedArtifactRuleSchema,
|
|
256
|
+
veto: generatedPackVeto,
|
|
257
|
+
},
|
|
258
|
+
// Round 13 (P3): no shell, so no veto — only the plane's schema.
|
|
259
|
+
docReferenceFiles: { schema: DocReferenceRuleSchema },
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Why a PACK element of a gate-plane slot would be refused by the merge seam
|
|
263
|
+
* — THE same schema + shell veto `resolveProjectConfig` applies — or
|
|
264
|
+
* `undefined` for a slot that is not a gate plane. `packs test --load` reads
|
|
265
|
+
* it (`validateContributionFile`). A `$use` reference is resolved against the
|
|
266
|
+
* CONSUMING repo's extractors, so it cannot be judged from the pack alone.
|
|
267
|
+
*/
|
|
268
|
+
export function packPlaneElementRejectionReasons(slot, raw) {
|
|
269
|
+
const spec = PACK_PLANE_SLOTS[slot];
|
|
270
|
+
if (!spec)
|
|
271
|
+
return undefined;
|
|
272
|
+
const reasons = planeElementRejectionReasons(spec.schema, raw);
|
|
273
|
+
if (reasons.length > 0)
|
|
274
|
+
return reasons;
|
|
275
|
+
const veto = spec.veto?.(spec.schema.safeParse(raw).data, '(pack)');
|
|
276
|
+
return veto ? [veto.reason] : [];
|
|
277
|
+
}
|
|
278
|
+
/** The plane a `$use` resolution error path names (`wiringRules[<id>]…`) → its contribution kind. */
|
|
279
|
+
const EXTRACTOR_PLANE_KIND = {
|
|
280
|
+
wiringRules: ContributionKind.WiringRule,
|
|
281
|
+
registries: ContributionKind.Registry,
|
|
282
|
+
registrationGraph: ContributionKind.RegistrationIdiom,
|
|
283
|
+
baselines: ContributionKind.Baseline,
|
|
284
|
+
};
|
|
109
285
|
/**
|
|
110
286
|
* Load the project config, then merge pack-contributed `wiringRules` /
|
|
111
287
|
* `registries` / `policyRules` / `reusePrimitives` over the local config
|
|
@@ -119,6 +295,7 @@ export async function resolveProjectConfig(cwd) {
|
|
|
119
295
|
if (!loaded.ok)
|
|
120
296
|
return loaded;
|
|
121
297
|
const diagnostics = [];
|
|
298
|
+
const sink = { accepted: [], rejected: [], loadFailures: [], adopted: new Map() };
|
|
122
299
|
const base = loaded.value;
|
|
123
300
|
let validPacks = [];
|
|
124
301
|
try {
|
|
@@ -128,10 +305,10 @@ export async function resolveProjectConfig(cwd) {
|
|
|
128
305
|
catch (e) {
|
|
129
306
|
diagnostics.push(`pack discovery failed — pack-contributed planes skipped: ${e.message}`);
|
|
130
307
|
}
|
|
131
|
-
const wiringRules = await mergePlane(base.config.wiringRules ?? [], gatherPackContribs(validPacks, 'wiringRuleFiles'), WiringRuleSchema, (r) => r.id, 'wiringRule', diagnostics);
|
|
132
|
-
const registries = await mergePlane(base.config.registries ?? [], gatherPackContribs(validPacks, 'registryFiles'), RegistryDeclarationSchema, (r) => r.name, 'registry', diagnostics);
|
|
133
|
-
const registrationGraph = await mergePlane(base.config.registrationGraph ?? [], gatherPackContribs(validPacks, 'registrationGraphFiles'), RegistrationIdiomSchema, (r) => r.name, 'registrationIdiom', diagnostics);
|
|
134
|
-
const policyRules = await mergePlane(base.config.policyRules ?? [], gatherPackContribs(validPacks, 'policyRuleFiles'), PolicyRuleSchema, (r) => r.id, 'policyRule', diagnostics);
|
|
308
|
+
const wiringRules = await mergePlane(base.config.wiringRules ?? [], gatherPackContribs(validPacks, 'wiringRuleFiles'), WiringRuleSchema, (r) => r.id, 'wiringRule', diagnostics, { kind: ContributionKind.WiringRule, sink });
|
|
309
|
+
const registries = await mergePlane(base.config.registries ?? [], gatherPackContribs(validPacks, 'registryFiles'), RegistryDeclarationSchema, (r) => r.name, 'registry', diagnostics, { kind: ContributionKind.Registry, sink });
|
|
310
|
+
const registrationGraph = await mergePlane(base.config.registrationGraph ?? [], gatherPackContribs(validPacks, 'registrationGraphFiles'), RegistrationIdiomSchema, (r) => r.name, 'registrationIdiom', diagnostics, { kind: ContributionKind.RegistrationIdiom, sink });
|
|
311
|
+
const policyRules = await mergePlane(base.config.policyRules ?? [], gatherPackContribs(validPacks, 'policyRuleFiles'), PolicyRuleSchema, (r) => r.id, 'policyRule', diagnostics, { kind: ContributionKind.PolicyRule, sink });
|
|
135
312
|
// The two SHELL-EXECUTING planes. A pack ships code the repo did not write;
|
|
136
313
|
// letting it also ship a command that `shrk baseline check` would then RUN is
|
|
137
314
|
// the same hazard the "pack-contributed verification commands are NOT
|
|
@@ -139,16 +316,16 @@ export async function resolveProjectConfig(cwd) {
|
|
|
139
316
|
// extractor computes and header-only generated rules — and drops the rest
|
|
140
317
|
// with a diagnostic. The guarantee is structural: no downstream caller has to
|
|
141
318
|
// remember to re-check provenance.
|
|
142
|
-
const baselines = await mergePlane(base.config.baselines ?? [], gatherPackContribs(validPacks, 'baselineFiles'), BaselineRuleSchema, (r) => r.id, 'baseline', diagnostics,
|
|
143
|
-
|
|
144
|
-
: undefined);
|
|
145
|
-
const generatedArtifacts = await mergePlane(base.config.generatedArtifacts ?? [], gatherPackContribs(validPacks, 'generatedArtifactFiles'), GeneratedArtifactRuleSchema, (r) => r.id, 'generatedArtifact', diagnostics, (item, packName) => item.regen !== undefined
|
|
146
|
-
? `pack ${packName}: generatedArtifact "${item.id}" declares a \`regen\` command — pack-contributed commands are never auto-run — skipped`
|
|
147
|
-
: undefined);
|
|
319
|
+
const baselines = await mergePlane(base.config.baselines ?? [], gatherPackContribs(validPacks, 'baselineFiles'), BaselineRuleSchema, (r) => r.id, 'baseline', diagnostics, { kind: ContributionKind.Baseline, sink }, baselinePackVeto);
|
|
320
|
+
const generatedArtifacts = await mergePlane(base.config.generatedArtifacts ?? [], gatherPackContribs(validPacks, 'generatedArtifactFiles'), GeneratedArtifactRuleSchema, (r) => r.id, 'generatedArtifact', diagnostics, { kind: ContributionKind.GeneratedArtifact, sink }, generatedPackVeto);
|
|
148
321
|
// No shell, no writes — a pack may contribute a prose-reference rule freely,
|
|
149
|
-
// unlike the two shell-executing planes above.
|
|
150
|
-
|
|
151
|
-
|
|
322
|
+
// unlike the two shell-executing planes above. Round 13 (P3):
|
|
323
|
+
// `docReferenceFiles` is a DECLARED manifest slot, so its outcome joins the
|
|
324
|
+
// round-12 channel — a refused element is a structured rejection (`packs
|
|
325
|
+
// contributions`, `packs list`, the gates ERRORED row), never only a
|
|
326
|
+
// diagnostic string, and an adopted one is an accepted entry.
|
|
327
|
+
const docReferences = await mergePlane(base.config.docReferences ?? [], gatherPackContribs(validPacks, 'docReferenceFiles'), DocReferenceRuleSchema, (r) => r.id, 'docReference', diagnostics, { kind: ContributionKind.DocReference, sink });
|
|
328
|
+
const reusePrimitives = await mergePlane(base.config.reusePrimitives ?? [], gatherPackContribs(validPacks, 'reusePrimitiveFiles'), ReusePrimitiveSchema, (r) => r.symbol, 'reusePrimitive', diagnostics, { kind: ContributionKind.ReusePrimitive, sink });
|
|
152
329
|
// Pack-contributed elements have NOT been through the loader's `$use`
|
|
153
330
|
// resolution (that ran on the local config only), so resolve the merged
|
|
154
331
|
// planes here. A pack rule referencing an extractor this repo does not
|
|
@@ -158,9 +335,48 @@ export async function resolveProjectConfig(cwd) {
|
|
|
158
335
|
// to a pack element by construction.
|
|
159
336
|
const resolvedPlanes = resolvePlaneExtractors({ wiringRules, registries, registrationGraph, baselines }, base.config.extractors);
|
|
160
337
|
const dropped = new Set();
|
|
338
|
+
/** Drop the pack element a source `path` belongs to; the adopted entry becomes a rejection. */
|
|
339
|
+
const dropPackElement = (path, diagnostic, reason) => {
|
|
340
|
+
const prefix = path.slice(0, path.indexOf(']') + 1);
|
|
341
|
+
diagnostics.push(diagnostic);
|
|
342
|
+
if (dropped.has(prefix))
|
|
343
|
+
return;
|
|
344
|
+
dropped.add(prefix);
|
|
345
|
+
// The adopted pack element becomes a rejection — it never takes effect.
|
|
346
|
+
const m = /^(\w+)\[(.*)\]$/.exec(prefix);
|
|
347
|
+
const kind = m ? EXTRACTOR_PLANE_KIND[m[1]] : undefined;
|
|
348
|
+
const adopted = kind !== undefined ? sink.adopted.get(`${kind}:${m[2]}`) : undefined;
|
|
349
|
+
if (!adopted)
|
|
350
|
+
return;
|
|
351
|
+
const at = sink.accepted.indexOf(adopted.entry);
|
|
352
|
+
if (at >= 0)
|
|
353
|
+
sink.accepted.splice(at, 1);
|
|
354
|
+
sink.rejected.push({
|
|
355
|
+
file: adopted.entry.file,
|
|
356
|
+
index: adopted.index,
|
|
357
|
+
exportName: 'default',
|
|
358
|
+
entryId: adopted.entry.id,
|
|
359
|
+
reasons: [reason],
|
|
360
|
+
cause: RejectionCause.Invalid,
|
|
361
|
+
kind: adopted.entry.kind,
|
|
362
|
+
...(adopted.entry.packageName ? { packageName: adopted.entry.packageName } : {}),
|
|
363
|
+
via: 'config-plane',
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
const fieldOf = (path) => path.slice(path.indexOf(']') + 1).replace(/^\./, '');
|
|
161
367
|
for (const e of resolvedPlanes.errors) {
|
|
162
|
-
|
|
163
|
-
|
|
368
|
+
dropPackElement(e.path, `${e.path}: ${e.message} — rule skipped`, `${fieldOf(e.path) || '$use'}: ${e.message}`);
|
|
369
|
+
}
|
|
370
|
+
// Then THE post-resolution check the loader runs on a local rule (core's
|
|
371
|
+
// `validateResolvedPlaneSources`): a `$use` source is judged on its MERGED
|
|
372
|
+
// shape. Without it a pack rule overriding an extractor with a negation-only
|
|
373
|
+
// `files` was adopted — `packs contributions` said accepted, `check wiring`
|
|
374
|
+
// said misconfigured (round 12 review, R12-X3). Local rules passed the
|
|
375
|
+
// loader's identical check, so a problem here is a pack element's.
|
|
376
|
+
for (const p of validateResolvedPlaneSources(resolvedPlanes)) {
|
|
377
|
+
if (dropped.has(p.path.slice(0, p.path.indexOf(']') + 1)))
|
|
378
|
+
continue;
|
|
379
|
+
dropPackElement(p.path, `${p.path} ${p.message} — rule skipped`, `${fieldOf(p.path)} ${p.message}`);
|
|
164
380
|
}
|
|
165
381
|
const keep = (items, plane, keyOf) => dropped.size === 0 ? items : items.filter((i) => !dropped.has(`${plane}[${keyOf(i)}]`));
|
|
166
382
|
return ok({
|
|
@@ -177,5 +393,6 @@ export async function resolveProjectConfig(cwd) {
|
|
|
177
393
|
reusePrimitives,
|
|
178
394
|
},
|
|
179
395
|
planeDiagnostics: diagnostics,
|
|
396
|
+
planeOutcomes: { accepted: sink.accepted, rejected: sink.rejected, loadFailures: sink.loadFailures },
|
|
180
397
|
});
|
|
181
398
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IPublicExportSurface, IReusePrimitive } from '@shrkcrft/core';
|
|
2
|
+
import type { IReuseCoverageReport } from './reuse-coverage-report.js';
|
|
3
|
+
import type { IReuseSymbolLookup } from './reuse-symbol-lookup.js';
|
|
4
|
+
/** Default cap on the listed uncovered exports (`--all` lifts it). */
|
|
5
|
+
export declare const REUSE_UNCOVERED_CAP = 50;
|
|
6
|
+
/**
|
|
7
|
+
* Measure the curated `reusePrimitives[]` against the public export surface.
|
|
8
|
+
*
|
|
9
|
+
* Pure: the surface and the graph lookups are INJECTED. Every question is
|
|
10
|
+
* answered by an existing authority, the SAME one the lookup uses:
|
|
11
|
+
* - the surface by the graph's `enumeratePublicSurface`;
|
|
12
|
+
* - which construct a curated entry names, its import line, and whether that
|
|
13
|
+
* import compiles by `resolveCuratedReuse` — the record `shrk reuse`
|
|
14
|
+
* prints the entry's row from;
|
|
15
|
+
* - which exports a curated entry already covers by `isCuratedExport` over
|
|
16
|
+
* `curatedDeclarationMap` — the exclusion `rankReuseCandidates` applies;
|
|
17
|
+
* - a curation gap by `isReuseCurationGap` over the lookup's own ranker —
|
|
18
|
+
* exactly what `shrk reuse "<the export's words>"` reports as `curationGap`.
|
|
19
|
+
*
|
|
20
|
+
* `packageFilter` narrows deliberately: only those packages' exports count,
|
|
21
|
+
* and a curated entry is in scope when its `importPath` is one of them or a
|
|
22
|
+
* declaration lives in one of them.
|
|
23
|
+
*/
|
|
24
|
+
export declare function computeReuseCoverage(primitives: readonly IReusePrimitive[], surface: IPublicExportSurface, lookup: IReuseSymbolLookup, opts?: {
|
|
25
|
+
readonly includeTypes?: boolean;
|
|
26
|
+
readonly packageFilter?: readonly string[];
|
|
27
|
+
readonly all?: boolean;
|
|
28
|
+
}): IReuseCoverageReport;
|
|
29
|
+
//# sourceMappingURL=compute-reuse-coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-reuse-coverage.d.ts","sourceRoot":"","sources":["../../src/reuse/compute-reuse-coverage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAU3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,GAAE;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAO,GACjH,oBAAoB,CA0KtB"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { splitIdentifierTokens } from "../split-identifier.js";
|
|
2
|
+
import { isReuseCurationGap, isReuseTestPath, isReuseTypeKind, rankReuseCandidates, reuseNameAnswers, } from "./rank-reuse-candidates.js";
|
|
3
|
+
import { curatedDeclarationMap, isCuratedExport, resolveCuratedReuse } from "./resolve-curated-reuse.js";
|
|
4
|
+
import { ReuseCuratedStatus } from "./reuse-curated-status.js";
|
|
5
|
+
import { scoreReuseName } from "./score-reuse-name.js";
|
|
6
|
+
/** Default cap on the listed uncovered exports (`--all` lifts it). */
|
|
7
|
+
export const REUSE_UNCOVERED_CAP = 50;
|
|
8
|
+
/**
|
|
9
|
+
* Measure the curated `reusePrimitives[]` against the public export surface.
|
|
10
|
+
*
|
|
11
|
+
* Pure: the surface and the graph lookups are INJECTED. Every question is
|
|
12
|
+
* answered by an existing authority, the SAME one the lookup uses:
|
|
13
|
+
* - the surface by the graph's `enumeratePublicSurface`;
|
|
14
|
+
* - which construct a curated entry names, its import line, and whether that
|
|
15
|
+
* import compiles by `resolveCuratedReuse` — the record `shrk reuse`
|
|
16
|
+
* prints the entry's row from;
|
|
17
|
+
* - which exports a curated entry already covers by `isCuratedExport` over
|
|
18
|
+
* `curatedDeclarationMap` — the exclusion `rankReuseCandidates` applies;
|
|
19
|
+
* - a curation gap by `isReuseCurationGap` over the lookup's own ranker —
|
|
20
|
+
* exactly what `shrk reuse "<the export's words>"` reports as `curationGap`.
|
|
21
|
+
*
|
|
22
|
+
* `packageFilter` narrows deliberately: only those packages' exports count,
|
|
23
|
+
* and a curated entry is in scope when its `importPath` is one of them or a
|
|
24
|
+
* declaration lives in one of them.
|
|
25
|
+
*/
|
|
26
|
+
export function computeReuseCoverage(primitives, surface, lookup, opts = {}) {
|
|
27
|
+
const selected = opts.packageFilter !== undefined && opts.packageFilter.length > 0 ? new Set(opts.packageFilter) : undefined;
|
|
28
|
+
const inScope = (pkg) => selected === undefined || selected.has(pkg);
|
|
29
|
+
const packageDirs = [...surface.roots, ...surface.packagesWithoutEntry]
|
|
30
|
+
.map((p) => ({ package: p.package, dir: p.dir.replace(/\/+$/, '') }))
|
|
31
|
+
.filter((p) => p.dir.length > 0)
|
|
32
|
+
.sort((a, b) => b.dir.length - a.dir.length);
|
|
33
|
+
const packageOf = (path) => packageDirs.find((p) => path === p.dir || path.startsWith(`${p.dir}/`))?.package;
|
|
34
|
+
const withoutEntry = new Set(surface.packagesWithoutEntry.map((w) => w.package));
|
|
35
|
+
const exports = surface.exports.filter((e) => inScope(e.package) && !isReuseTestPath(e.declaredIn));
|
|
36
|
+
// ONE resolution per curated entry — every entry, in or out of scope, since
|
|
37
|
+
// an out-of-scope entry still covers its own construct.
|
|
38
|
+
const resolutions = primitives.map((p) => resolveCuratedReuse(p, surface, lookup));
|
|
39
|
+
const curatedNames = new Set(primitives.map((p) => p.symbol));
|
|
40
|
+
const curatedDeclaredIn = curatedDeclarationMap(primitives, resolutions);
|
|
41
|
+
// ── curated entries ───────────────────────────────────────────────────
|
|
42
|
+
const curated = [];
|
|
43
|
+
/** The construct each reported entry names (parallel to `curated`). */
|
|
44
|
+
const curatedSymbolIds = [];
|
|
45
|
+
let curatedOutOfScope = 0;
|
|
46
|
+
primitives.forEach((p, i) => {
|
|
47
|
+
const res = resolutions[i];
|
|
48
|
+
const decls = lookup.declarationsOf(p.symbol);
|
|
49
|
+
if (selected !== undefined) {
|
|
50
|
+
const declaredInScope = decls.some((d) => {
|
|
51
|
+
const pkg = packageOf(d.path);
|
|
52
|
+
return pkg !== undefined && selected.has(pkg);
|
|
53
|
+
});
|
|
54
|
+
if (!declaredInScope && !(p.importPath !== undefined && selected.has(p.importPath))) {
|
|
55
|
+
curatedOutOfScope += 1;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Only the construct the entry NAMES is "this entry on the surface": a
|
|
60
|
+
// same-named export of a different construct in another package is not.
|
|
61
|
+
const self = res.declaration?.symbolId;
|
|
62
|
+
const publicHits = surface.exports.filter((e) => e.name === p.symbol && (self === undefined || e.symbolId === self));
|
|
63
|
+
const publicIn = [...new Set(publicHits.map((e) => e.package))].sort(compare);
|
|
64
|
+
const exported = decls.filter((d) => d.isExported);
|
|
65
|
+
let status;
|
|
66
|
+
let statusNote;
|
|
67
|
+
if (publicIn.length > 0)
|
|
68
|
+
status = ReuseCuratedStatus.Public;
|
|
69
|
+
// Its importPath module exports it (checked), yet no package root does.
|
|
70
|
+
else if (res.importPathAgrees === true)
|
|
71
|
+
status = ReuseCuratedStatus.ExportedNotPublic;
|
|
72
|
+
else if (decls.length === 0)
|
|
73
|
+
status = ReuseCuratedStatus.NotFound;
|
|
74
|
+
else if (exported.length === 0)
|
|
75
|
+
status = ReuseCuratedStatus.NotExported;
|
|
76
|
+
else
|
|
77
|
+
status = exported.length > 1 ? ReuseCuratedStatus.Ambiguous : ReuseCuratedStatus.ExportedNotPublic;
|
|
78
|
+
if (status === ReuseCuratedStatus.ExportedNotPublic || status === ReuseCuratedStatus.Ambiguous) {
|
|
79
|
+
const unmeasured = [
|
|
80
|
+
...new Set(exported.map((d) => packageOf(d.path)).filter((pkg) => pkg !== undefined && withoutEntry.has(pkg))),
|
|
81
|
+
].sort(compare);
|
|
82
|
+
if (unmeasured.length > 0) {
|
|
83
|
+
statusNote = `declared in ${unmeasured.join(', ')}, which has no resolved entry — whether it is public was not measured`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const declKind = res.declaration?.declKind ?? publicHits[0]?.declKind;
|
|
87
|
+
const consumers = self !== undefined && lookup.consumerCount !== undefined ? lookup.consumerCount(self) : undefined;
|
|
88
|
+
curated.push({
|
|
89
|
+
symbol: p.symbol,
|
|
90
|
+
status,
|
|
91
|
+
statusMeasured: statusNote === undefined,
|
|
92
|
+
...(statusNote !== undefined ? { statusNote } : {}),
|
|
93
|
+
publicIn,
|
|
94
|
+
declaredIn: [...new Set(decls.map((d) => d.path))].sort(compare),
|
|
95
|
+
...(declKind !== undefined ? { declKind } : {}),
|
|
96
|
+
...(consumers !== undefined ? { consumers } : {}),
|
|
97
|
+
...(p.importPath !== undefined ? { importPath: p.importPath } : {}),
|
|
98
|
+
...(res.importPathAgrees !== undefined ? { importPathAgrees: res.importPathAgrees } : {}),
|
|
99
|
+
...(res.importPathNote !== undefined ? { importPathNote: res.importPathNote } : {}),
|
|
100
|
+
...(res.importStyle !== undefined ? { importStyle: res.importStyle } : {}),
|
|
101
|
+
...(res.importLine !== undefined ? { importLine: res.importLine } : {}),
|
|
102
|
+
});
|
|
103
|
+
curatedSymbolIds.push(self);
|
|
104
|
+
});
|
|
105
|
+
// ── the surface ───────────────────────────────────────────────────────
|
|
106
|
+
const byKind = {};
|
|
107
|
+
for (const e of exports)
|
|
108
|
+
byKind[e.declKind] = (byKind[e.declKind] ?? 0) + 1;
|
|
109
|
+
const valueExports = exports.filter((e) => !isReuseTypeKind(e.declKind));
|
|
110
|
+
let curatedPublic = 0;
|
|
111
|
+
let curatedPublicValue = 0;
|
|
112
|
+
curated.forEach((c, i) => {
|
|
113
|
+
if (c.status !== ReuseCuratedStatus.Public || !c.publicIn.some(inScope))
|
|
114
|
+
return;
|
|
115
|
+
curatedPublic += 1;
|
|
116
|
+
const self = curatedSymbolIds[i];
|
|
117
|
+
if (valueExports.some((e) => e.name === c.symbol && (self === undefined || e.symbolId === self))) {
|
|
118
|
+
curatedPublicValue += 1;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
// ── uncovered, superseded, shadowed ──────────────────────────────────
|
|
122
|
+
const supersededBy = new Map();
|
|
123
|
+
for (const p of primitives) {
|
|
124
|
+
for (const name of p.supersedes ?? []) {
|
|
125
|
+
const by = supersededBy.get(name);
|
|
126
|
+
if (by)
|
|
127
|
+
by.push(p.symbol);
|
|
128
|
+
else
|
|
129
|
+
supersededBy.set(name, [p.symbol]);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const uncovered = [];
|
|
133
|
+
const superseded = [];
|
|
134
|
+
const shadowed = [];
|
|
135
|
+
for (const e of exports) {
|
|
136
|
+
if (isCuratedExport(e, curatedNames, curatedDeclaredIn))
|
|
137
|
+
continue;
|
|
138
|
+
if (opts.includeTypes !== true && isReuseTypeKind(e.declKind))
|
|
139
|
+
continue;
|
|
140
|
+
const by = supersededBy.get(e.name);
|
|
141
|
+
if (by) {
|
|
142
|
+
superseded.push({ export: e.name, package: e.package, supersededBy: by });
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
uncovered.push(e);
|
|
146
|
+
// The lookup's own ranker (curated-only: its best curated candidate) and
|
|
147
|
+
// its own gap predicate — what `shrk reuse "<e's words>"` reports as its
|
|
148
|
+
// `curationGap`, with `e` the uncurated export that answers by name.
|
|
149
|
+
const ranking = rankReuseCandidates(primitives, undefined, splitIdentifierTokens(e.name).join(' '), {
|
|
150
|
+
curatedOnly: true,
|
|
151
|
+
limit: 1,
|
|
152
|
+
});
|
|
153
|
+
const answer = ranking.results[0];
|
|
154
|
+
const selfAnswers = reuseNameAnswers(scoreReuseName(e.name, ranking.tokens)) ? 1 : 0;
|
|
155
|
+
if (answer !== undefined && isReuseCurationGap(answer.nameMatch, selfAnswers)) {
|
|
156
|
+
shadowed.push({
|
|
157
|
+
export: e.name,
|
|
158
|
+
package: e.package,
|
|
159
|
+
declaredIn: e.declaredIn,
|
|
160
|
+
answeredBy: answer.symbol,
|
|
161
|
+
matchedVia: answer.matchedVia,
|
|
162
|
+
nameMatch: answer.nameMatch,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const cap = opts.all === true ? uncovered.length : REUSE_UNCOVERED_CAP;
|
|
167
|
+
const unfollowedReExports = surface.unfollowedReExports.filter((u) => inScope(u.package));
|
|
168
|
+
return {
|
|
169
|
+
curated,
|
|
170
|
+
curatedOutOfScope,
|
|
171
|
+
surface: {
|
|
172
|
+
roots: surface.roots.filter((r) => inScope(r.package)),
|
|
173
|
+
packagesWithoutEntry: surface.packagesWithoutEntry.filter((w) => inScope(w.package)),
|
|
174
|
+
all: exports.length,
|
|
175
|
+
value: valueExports.length,
|
|
176
|
+
byKind,
|
|
177
|
+
unresolvedReExports: unfollowedReExports.length,
|
|
178
|
+
unfollowedReExports,
|
|
179
|
+
},
|
|
180
|
+
curatedPublic,
|
|
181
|
+
curatedPublicValue,
|
|
182
|
+
...(valueExports.length > 0 ? { ratioValue: curatedPublicValue / valueExports.length } : {}),
|
|
183
|
+
...(exports.length > 0 ? { ratioAll: curatedPublic / exports.length } : {}),
|
|
184
|
+
uncovered: uncovered.slice(0, cap).map((e) => ({
|
|
185
|
+
name: e.name,
|
|
186
|
+
package: e.package,
|
|
187
|
+
declaredIn: e.declaredIn,
|
|
188
|
+
declKind: e.declKind,
|
|
189
|
+
})),
|
|
190
|
+
uncoveredTotal: uncovered.length,
|
|
191
|
+
shadowed,
|
|
192
|
+
superseded,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/** Locale-independent ordering, so a report is byte-stable across machines. */
|
|
196
|
+
function compare(a, b) {
|
|
197
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
198
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReuseNameMatch, type IPublicExportSurface, type IReusePrimitive } from '@shrkcrft/core';
|
|
2
|
+
import type { IRankReuseOptions } from './rank-reuse-options.js';
|
|
3
|
+
import type { IReuseRanking } from './reuse-ranking.js';
|
|
4
|
+
/** A type-only export (interface / type alias) — excluded from reuse answers unless asked for. */
|
|
5
|
+
export declare function isReuseTypeKind(declKind: string): boolean;
|
|
6
|
+
/** A test file never holds a construct to reuse. */
|
|
7
|
+
export declare function isReuseTestPath(path: string): boolean;
|
|
8
|
+
/** A NAME that answers the intent: every intent token is one of its name tokens (exact / covers). */
|
|
9
|
+
export declare function reuseNameAnswers(m: ReuseNameMatch): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* THE curation-gap predicate. The lookup's `curationGap` and `shrk reuse
|
|
12
|
+
* coverage`'s `shadowed` both call it, so the two agree by construction: an
|
|
13
|
+
* uncurated export answers the intent by NAME (exact / covers) while the best
|
|
14
|
+
* curated candidate names it only in part, or not at all (it matched through
|
|
15
|
+
* its roles / keywords / description).
|
|
16
|
+
*/
|
|
17
|
+
export declare function isReuseCurationGap(bestCuratedNameMatch: ReuseNameMatch | undefined, uncuratedNameAnswers: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Intent → the construct to reuse, ranked over the curated `reusePrimitives[]`
|
|
20
|
+
* AND (when a surface is given) the workspace's public export surface.
|
|
21
|
+
*
|
|
22
|
+
* Pure: the surface is INJECTED (the CLI reads it from the code graph), so the
|
|
23
|
+
* engine stays callable from a read-only MCP tool and the inspector never
|
|
24
|
+
* imports the graph.
|
|
25
|
+
*
|
|
26
|
+
* Tiers (lower wins; see `IReuseCandidate.tier`): curated whose NAME answers
|
|
27
|
+
* the intent (exact / covers) → uncurated exact name → uncurated name covering
|
|
28
|
+
* the intent → curated that names it only in part, or only through metadata.
|
|
29
|
+
* Within a tier: score desc, then the closer name (fewer extra name tokens),
|
|
30
|
+
* then symbol, then declaring file. An uncurated PARTIAL name match never
|
|
31
|
+
* becomes an answer; it is offered as a did-you-mean only when nothing is.
|
|
32
|
+
*
|
|
33
|
+
* The export pool excludes constructs already curated (name AND declaring
|
|
34
|
+
* file, see `curatedDeclaredIn`), names a curated entry `supersedes` (reported
|
|
35
|
+
* in `superseded`), type-level kinds unless `includeTypes`, and test files.
|
|
36
|
+
*/
|
|
37
|
+
export declare function rankReuseCandidates(primitives: readonly IReusePrimitive[], surface: IPublicExportSurface | undefined, intent: string, opts?: IRankReuseOptions): IReuseRanking;
|
|
38
|
+
//# sourceMappingURL=rank-reuse-candidates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rank-reuse-candidates.d.ts","sourceRoot":"","sources":["../../src/reuse/rank-reuse-candidates.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,cAAc,EAEd,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcxD,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIrD;AAED,qGAAqG;AACrG,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,GAAG,OAAO,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,oBAAoB,EAAE,cAAc,GAAG,SAAS,EAChD,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAET;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,iBAAsB,GAC3B,aAAa,CAuIf"}
|