@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
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE contributions report (round 12, ONE-CHANGE) — `shrk packs contributions`'
|
|
3
|
+
* `By file:` section and MCP `get_pack_contributions`' `report`.
|
|
4
|
+
*
|
|
5
|
+
* "Did what I wrote take effect?" has three columns per contributed file:
|
|
6
|
+
* entries ACCEPTED (the inventory's structural entries — every loader-backed
|
|
7
|
+
* kind is structural since 12.1e), entries REJECTED with every reason (THE
|
|
8
|
+
* rejection channel, carried by the inventory), and references that could not
|
|
9
|
+
* be checked because their kind's registry is empty or undeclarable (the
|
|
10
|
+
* self-config doctor's own reference probes, `collectUnresolvableReferences`).
|
|
11
|
+
* Nothing here resolves or loads anything itself.
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync } from 'node:fs';
|
|
14
|
+
import * as nodePath from 'node:path';
|
|
15
|
+
import { CONTRIBUTION_FILE_KEYS } from '@shrkcrft/plugin-api';
|
|
16
|
+
import { ContributionKind } from "./contribution-kind.js";
|
|
17
|
+
import { contributionFileLabel, contributionKindOfLoader, formatEntryRejection } from "./contribution-load-failures.js";
|
|
18
|
+
import { buildPackContributionsInventoryAsync, contributionKindForSlot, } from "./pack-contributions-inventory.js";
|
|
19
|
+
import { collectUnresolvableReferences } from "./self-config-doctor-v2.js";
|
|
20
|
+
/** A reference-declaring asset kind → the contribution kind its file is, for a file no other evidence named. */
|
|
21
|
+
const SOURCE_KIND = {
|
|
22
|
+
'registration-hint': ContributionKind.RegistrationHint,
|
|
23
|
+
'routing-hint': ContributionKind.TaskRoutingHint,
|
|
24
|
+
convention: ContributionKind.Convention,
|
|
25
|
+
template: ContributionKind.Template,
|
|
26
|
+
knowledge: ContributionKind.Knowledge,
|
|
27
|
+
rule: ContributionKind.Rule,
|
|
28
|
+
'path-convention': ContributionKind.Path,
|
|
29
|
+
construct: ContributionKind.Construct,
|
|
30
|
+
'boundary-rule': ContributionKind.Boundary,
|
|
31
|
+
// Round 13: the scan covers search-tuning boost keys, as `search tuning doctor` does.
|
|
32
|
+
'search-tuning': ContributionKind.SearchTuning,
|
|
33
|
+
};
|
|
34
|
+
/** A load failure's loader `kind` → its contribution kind, through THE table (`contributionKindOfLoader`). */
|
|
35
|
+
function asKind(kind, fallback) {
|
|
36
|
+
return contributionKindOfLoader(kind) ?? fallback;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The report from an already-built inventory and reference scan — the pure
|
|
40
|
+
* half; {@link buildContributionsReport} gathers both.
|
|
41
|
+
*/
|
|
42
|
+
export function contributionsReportOf(inspection, inventory, references) {
|
|
43
|
+
const rows = new Map();
|
|
44
|
+
const rel = (abs) => contributionFileLabel(inspection.projectRoot, abs);
|
|
45
|
+
const posix = (file) => file.split(nodePath.sep).join('/');
|
|
46
|
+
const rowFor = (file, kind, packageName) => {
|
|
47
|
+
const key = posix(file);
|
|
48
|
+
let row = rows.get(key);
|
|
49
|
+
if (!row) {
|
|
50
|
+
row = {
|
|
51
|
+
file: key,
|
|
52
|
+
kind,
|
|
53
|
+
...(packageName ? { packageName } : {}),
|
|
54
|
+
status: 'loaded',
|
|
55
|
+
acceptedIds: new Set(),
|
|
56
|
+
rejected: [],
|
|
57
|
+
unresolvable: new Map(),
|
|
58
|
+
};
|
|
59
|
+
rows.set(key, row);
|
|
60
|
+
}
|
|
61
|
+
if (!row.packageName && packageName)
|
|
62
|
+
row.packageName = packageName;
|
|
63
|
+
return row;
|
|
64
|
+
};
|
|
65
|
+
// 1) Every file a pack manifest declares (a missing one is a `missing` row).
|
|
66
|
+
for (const pack of inspection.packs.validPacks ?? []) {
|
|
67
|
+
const contributions = (pack.manifest?.contributions ?? {});
|
|
68
|
+
for (const slot of CONTRIBUTION_FILE_KEYS) {
|
|
69
|
+
const kind = contributionKindForSlot(slot);
|
|
70
|
+
if (!kind)
|
|
71
|
+
continue;
|
|
72
|
+
for (const r of contributions[slot] ?? []) {
|
|
73
|
+
const abs = nodePath.resolve(pack.packageRoot, r);
|
|
74
|
+
const row = rowFor(rel(abs), kind, pack.packageName);
|
|
75
|
+
if (!existsSync(abs))
|
|
76
|
+
row.status = 'missing';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// 2) Accepted entries (structural) — and every file the inventory saw.
|
|
81
|
+
for (const e of inventory.entries) {
|
|
82
|
+
if (!e.sourceFile)
|
|
83
|
+
continue;
|
|
84
|
+
const row = rowFor(e.sourceFile, e.kind, e.packageName);
|
|
85
|
+
if (e.extractionMode === 'structural')
|
|
86
|
+
row.acceptedIds.add(e.id);
|
|
87
|
+
}
|
|
88
|
+
// 3) Rejected entries — THE rejection channel.
|
|
89
|
+
for (const r of inventory.rejections) {
|
|
90
|
+
rowFor(r.file, r.kind, r.packageName).rejected.push({
|
|
91
|
+
index: r.index,
|
|
92
|
+
...(r.exportName ? { exportName: r.exportName } : {}),
|
|
93
|
+
...(r.entryId !== undefined ? { entryId: r.entryId } : {}),
|
|
94
|
+
reasons: r.reasons,
|
|
95
|
+
cause: r.cause,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// 4) Files that failed to load.
|
|
99
|
+
for (const f of inventory.loadFailures) {
|
|
100
|
+
const row = rowFor(f.file, asKind(f.kind, ContributionKind.Knowledge), f.packageName);
|
|
101
|
+
row.status = 'failed';
|
|
102
|
+
row.loadError = f.message;
|
|
103
|
+
}
|
|
104
|
+
// 5) References that could not be checked, grouped per (source, field, kind, reason).
|
|
105
|
+
let unattributed = 0;
|
|
106
|
+
for (const u of references.references) {
|
|
107
|
+
if (!u.file) {
|
|
108
|
+
unattributed += 1;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const row = rowFor(rel(u.file), SOURCE_KIND[u.sourceKind] ?? ContributionKind.Knowledge, u.packageName);
|
|
112
|
+
const key = `${u.sourceId}|${u.field}|${u.kind}|${u.reason}`;
|
|
113
|
+
const g = row.unresolvable.get(key) ?? { sourceId: u.sourceId, field: u.field, kind: u.kind, ids: [], reason: u.reason };
|
|
114
|
+
g.ids.push(u.id);
|
|
115
|
+
row.unresolvable.set(key, g);
|
|
116
|
+
}
|
|
117
|
+
const files = [...rows.values()]
|
|
118
|
+
.map((r) => {
|
|
119
|
+
const accepted = r.acceptedIds.size;
|
|
120
|
+
return {
|
|
121
|
+
file: r.file,
|
|
122
|
+
kind: r.kind,
|
|
123
|
+
...(r.packageName ? { packageName: r.packageName } : {}),
|
|
124
|
+
source: r.packageName ? 'pack' : 'local',
|
|
125
|
+
status: r.status,
|
|
126
|
+
declared: accepted + r.rejected.length,
|
|
127
|
+
accepted,
|
|
128
|
+
acceptedIds: [...r.acceptedIds].sort(),
|
|
129
|
+
rejected: [...r.rejected].sort((a, b) => a.index - b.index),
|
|
130
|
+
...(r.loadError !== undefined ? { loadError: r.loadError } : {}),
|
|
131
|
+
unresolvableReferences: [...r.unresolvable.values()].map((g) => ({ ...g, ids: [...g.ids] })),
|
|
132
|
+
};
|
|
133
|
+
})
|
|
134
|
+
.sort((a, b) => a.file.localeCompare(b.file) || a.kind.localeCompare(b.kind));
|
|
135
|
+
return summarise(files, references.expected, unattributed);
|
|
136
|
+
}
|
|
137
|
+
/** Totals + THE reference coverage over `files` (`probed` = every reference probed in view). */
|
|
138
|
+
function summarise(files, probed, unattributed) {
|
|
139
|
+
const unresolvable = files.reduce((n, f) => n + f.unresolvableReferences.reduce((m, g) => m + g.ids.length, 0), 0) + unattributed;
|
|
140
|
+
const labels = files.flatMap((f) => f.unresolvableReferences.flatMap((g) => g.ids.map((id) => `${f.file}: ${g.sourceId} ${g.field} → ${g.kind} ${id}`)));
|
|
141
|
+
const referenceCoverage = probed > 0
|
|
142
|
+
? {
|
|
143
|
+
subject: 'contributed references',
|
|
144
|
+
unit: 'references',
|
|
145
|
+
expected: probed,
|
|
146
|
+
examined: Math.max(0, probed - unresolvable),
|
|
147
|
+
...(unresolvable > 0 ? { unexamined: labels.slice(0, 20), unexaminedTotal: unresolvable } : {}),
|
|
148
|
+
reason: "could not be checked — their kind's registry is empty in this workspace, or nothing can declare it",
|
|
149
|
+
}
|
|
150
|
+
: undefined;
|
|
151
|
+
return {
|
|
152
|
+
files,
|
|
153
|
+
totals: {
|
|
154
|
+
files: files.length,
|
|
155
|
+
declared: files.reduce((n, f) => n + f.declared, 0),
|
|
156
|
+
accepted: files.reduce((n, f) => n + f.accepted, 0),
|
|
157
|
+
rejected: files.reduce((n, f) => n + f.rejected.length, 0),
|
|
158
|
+
loadFailed: files.filter((f) => f.status === 'failed').length,
|
|
159
|
+
missing: files.filter((f) => f.status === 'missing').length,
|
|
160
|
+
unresolvable,
|
|
161
|
+
},
|
|
162
|
+
...(referenceCoverage ? { referenceCoverage } : {}),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The report narrowed to `--pack` / `--kind`. A narrowed view settles on the
|
|
167
|
+
* references IN VIEW: its coverage is the view's unresolvable references
|
|
168
|
+
* (examined 0 of them), so a filter can never borrow another file's pass.
|
|
169
|
+
*/
|
|
170
|
+
export function filterContributionsReport(report, filter) {
|
|
171
|
+
if (!filter.pack && !filter.kind)
|
|
172
|
+
return report;
|
|
173
|
+
const files = report.files.filter((f) => (!filter.pack || f.packageName === filter.pack) && (!filter.kind || f.kind === filter.kind));
|
|
174
|
+
const inView = files.reduce((n, f) => n + f.unresolvableReferences.reduce((m, g) => m + g.ids.length, 0), 0);
|
|
175
|
+
return summarise(files, inView, 0);
|
|
176
|
+
}
|
|
177
|
+
/** Every contributed file, accepted vs rejected vs unresolvable. */
|
|
178
|
+
export async function buildContributionsReport(inspection, options = {}) {
|
|
179
|
+
const inventory = options.inventory ?? (await buildPackContributionsInventoryAsync(inspection));
|
|
180
|
+
const references = options.references ?? (await collectUnresolvableReferences(inspection));
|
|
181
|
+
return contributionsReportOf(inspection, inventory, references);
|
|
182
|
+
}
|
|
183
|
+
function fileMark(f) {
|
|
184
|
+
if (f.status !== 'loaded' || f.rejected.length > 0)
|
|
185
|
+
return '✗';
|
|
186
|
+
return f.unresolvableReferences.length > 0 ? '~' : '✓';
|
|
187
|
+
}
|
|
188
|
+
function fileSummary(f) {
|
|
189
|
+
if (f.status === 'failed')
|
|
190
|
+
return `FAILED TO LOAD — ${f.loadError ?? 'import error'}`;
|
|
191
|
+
if (f.status === 'missing')
|
|
192
|
+
return 'MISSING on disk — nothing in it takes effect';
|
|
193
|
+
const parts = [`${f.declared} declared`, `${f.accepted} accepted`];
|
|
194
|
+
if (f.rejected.length > 0)
|
|
195
|
+
parts.push(`${f.rejected.length} rejected`);
|
|
196
|
+
const u = f.unresolvableReferences.reduce((n, g) => n + g.ids.length, 0);
|
|
197
|
+
if (u > 0)
|
|
198
|
+
parts.push(`${u} unresolvable reference(s)`);
|
|
199
|
+
return parts.join(' · ');
|
|
200
|
+
}
|
|
201
|
+
/** The `By file:` text section (after `By kind:`). */
|
|
202
|
+
export function renderContributionsByFileText(report) {
|
|
203
|
+
const lines = [];
|
|
204
|
+
const t = report.totals;
|
|
205
|
+
lines.push(`By file (${t.files}): ${t.declared} declared · ${t.accepted} accepted · ${t.rejected} rejected${t.loadFailed > 0 ? ` · ${t.loadFailed} failed to load` : ''}${t.missing > 0 ? ` · ${t.missing} missing` : ''}${t.unresolvable > 0 ? ` · ${t.unresolvable} unresolvable reference(s)` : ''}`);
|
|
206
|
+
for (const f of report.files) {
|
|
207
|
+
lines.push(` ${fileMark(f)} ${f.file} ${f.kind}${f.packageName ? ` [${f.packageName}]` : ''} ${fileSummary(f)}`);
|
|
208
|
+
for (const r of f.rejected)
|
|
209
|
+
lines.push(` rejected ${formatEntryRejection({ ...r, file: f.file })}`);
|
|
210
|
+
for (const g of f.unresolvableReferences) {
|
|
211
|
+
lines.push(` unresolvable ${g.sourceId} ${g.field} → ${g.kind} ${g.ids.map((id) => `'${id}'`).join(', ')} — ${g.reason === 'undeclarable-kind' ? 'no registry can ever hold this kind' : "this kind's registry is empty here"}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return lines.join('\n') + '\n';
|
|
215
|
+
}
|
|
216
|
+
/** The `## By file` markdown section. */
|
|
217
|
+
export function renderContributionsByFileMarkdown(report) {
|
|
218
|
+
const lines = ['## By file', ''];
|
|
219
|
+
if (report.files.length === 0) {
|
|
220
|
+
lines.push('None.');
|
|
221
|
+
return lines.join('\n') + '\n';
|
|
222
|
+
}
|
|
223
|
+
lines.push('| File | Kind | Pack | Status | Declared | Accepted | Rejected | Unresolvable |');
|
|
224
|
+
lines.push('| --- | --- | --- | --- | --- | --- | --- | --- |');
|
|
225
|
+
for (const f of report.files) {
|
|
226
|
+
const u = f.unresolvableReferences.reduce((n, g) => n + g.ids.length, 0);
|
|
227
|
+
lines.push(`| \`${f.file}\` | ${f.kind} | ${f.packageName ?? ''} | ${f.status} | ${f.declared} | ${f.accepted} | ${f.rejected.length} | ${u} |`);
|
|
228
|
+
}
|
|
229
|
+
const detail = report.files.filter((f) => f.rejected.length > 0 || f.unresolvableReferences.length > 0);
|
|
230
|
+
if (detail.length > 0) {
|
|
231
|
+
lines.push('');
|
|
232
|
+
for (const f of detail) {
|
|
233
|
+
lines.push(`- \`${f.file}\``);
|
|
234
|
+
for (const r of f.rejected)
|
|
235
|
+
lines.push(` - rejected: ${formatEntryRejection({ ...r, file: f.file })}`);
|
|
236
|
+
for (const g of f.unresolvableReferences) {
|
|
237
|
+
lines.push(` - unresolvable: ${g.sourceId} ${g.field} → ${g.kind} ${g.ids.join(', ')} (${g.reason})`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return lines.join('\n') + '\n';
|
|
242
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ConventionAppliesToFilter, type IConvention } from '@shrkcrft/plugin-api';
|
|
2
|
+
import { ConventionFilterLevel } from './convention-filter-level.js';
|
|
3
|
+
import type { IConventionApplicability } from './i-convention-applicability.js';
|
|
4
|
+
import type { IConventionScope } from './i-convention-scope.js';
|
|
5
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
6
|
+
/** Where each filter is decided — keyed by the enum, so a new filter without a level is a compile error. */
|
|
7
|
+
export declare const CONVENTION_FILTER_LEVELS: Readonly<Record<ConventionAppliesToFilter, ConventionFilterLevel>>;
|
|
8
|
+
/** The convention's declared values for `filter` — `[]` for an absent filter (or a non-list, which the loader refuses). */
|
|
9
|
+
export declare function declaredAppliesTo(convention: IConvention, filter: ConventionAppliesToFilter): readonly string[];
|
|
10
|
+
/**
|
|
11
|
+
* A file path as the per-file filters AND a rule's patterns read it:
|
|
12
|
+
* project-relative, `/`-separated, no leading `./`. `checkConventionsAgainstFiles`
|
|
13
|
+
* normalizes its file list through this once, so the scope test and every
|
|
14
|
+
* `filePattern` / `expectMatch` / `forbidMatch` regex see ONE spelling of a file
|
|
15
|
+
* (round 15 review: `--files ./src/a.ts` was covered by `fileGlobs: ['src/**']`
|
|
16
|
+
* here and then failed `filePattern: '^src/'` on the raw `./src/a.ts` — a false hit).
|
|
17
|
+
*
|
|
18
|
+
* The spelling is REALPATH-canonical (round 15 follow-up, F9): the file and the
|
|
19
|
+
* project root are both resolved through their symlinks before one is made
|
|
20
|
+
* relative to the other, so a symlinked absolute path (`/link/src/a.ts` with
|
|
21
|
+
* `/link → the project`, or macOS `/var/…` for a root at `/private/var/…`)
|
|
22
|
+
* behaves exactly like its target — it read `../link/src/a.ts`, which no
|
|
23
|
+
* `fileGlobs` selected, so the convention was silently not applicable. A path
|
|
24
|
+
* whose target lies OUTSIDE the project (an in-project symlink to a sibling
|
|
25
|
+
* checkout) keeps its lexical in-project spelling: that is where it is in scope.
|
|
26
|
+
*/
|
|
27
|
+
export declare function conventionFilePath(inspection: ISharkcraftInspection, file: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Does `convention` apply here — to the workspace, and (given `file`) to that
|
|
30
|
+
* file? Without `file` only the workspace filters decide; the per-file ones
|
|
31
|
+
* are listed as `decided per file`. See the module doc for the table.
|
|
32
|
+
*/
|
|
33
|
+
export declare function conventionApplicability(convention: IConvention, inspection: ISharkcraftInspection, file?: string): IConventionApplicability;
|
|
34
|
+
/**
|
|
35
|
+
* Which of `files` `convention` covers — per file through
|
|
36
|
+
* {@link conventionApplicability}, so `conventions check` and the rule-graph
|
|
37
|
+
* bridge (which both call this) cannot disagree.
|
|
38
|
+
*
|
|
39
|
+
* Not applicable when a workspace filter excludes it, or when `files` is
|
|
40
|
+
* non-empty and no file passes the per-file filters (the per-file reasons
|
|
41
|
+
* then count what each filter selected across the list). An EMPTY list keeps
|
|
42
|
+
* a workspace-applicable convention applicable over nothing — the caller's own
|
|
43
|
+
* empty-scope verdict decides that case.
|
|
44
|
+
*/
|
|
45
|
+
export declare function conventionScope(convention: IConvention, inspection: ISharkcraftInspection, files: readonly string[]): IConventionScope;
|
|
46
|
+
//# sourceMappingURL=convention-applicability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convention-applicability.d.ts","sourceRoot":"","sources":["../src/convention-applicability.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,yBAAyB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,4GAA4G;AAC5G,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,yBAAyB,EAAE,qBAAqB,CAAC,CAMtG,CAAC;AAWH,2HAA2H;AAC3H,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,yBAAyB,GAAG,SAAS,MAAM,EAAE,CAG/G;AAwCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAc1F;AAiED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,qBAAqB,EACjC,IAAI,CAAC,EAAE,MAAM,GACZ,wBAAwB,CAQ1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,gBAAgB,CAkDlB"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE convention applicability authority (round 15, 15.1).
|
|
3
|
+
*
|
|
4
|
+
* `IConventionAppliesTo` declares five filters; before this only `fileGlobs`
|
|
5
|
+
* was read — by two different matchers that disagreed (`conventions check`
|
|
6
|
+
* compiled `src/**\/*.ts` so it missed `src/a.ts` and ignored `!`; the
|
|
7
|
+
* rule-graph bridge dropped a convention with no `fileGlobs` that check
|
|
8
|
+
* enforced on every file). `profileIds`, `frameworks` and `languages` were
|
|
9
|
+
* validated, resolved by the doctor, and inert.
|
|
10
|
+
*
|
|
11
|
+
* Every surface now asks THIS module: `conventions check`, the rule-graph
|
|
12
|
+
* bridge, MCP `prepare_agent_task`, and the `conventions list / get / explain`
|
|
13
|
+
* display (which shows the answer and never hides an entry).
|
|
14
|
+
*
|
|
15
|
+
* Semantics — the pack-compatibility precedent (`pack-compatibility.ts`):
|
|
16
|
+
* - within a filter, ANY listed value matches;
|
|
17
|
+
* - EVERY declared filter must match;
|
|
18
|
+
* - an absent or empty filter imposes no constraint.
|
|
19
|
+
*
|
|
20
|
+
* | filter | level | matches when |
|
|
21
|
+
* |------------------|-----------|-----------------------------------------------------------|
|
|
22
|
+
* | `profileIds` | workspace | a listed id is in `inspection.workspace.profiles` |
|
|
23
|
+
* | `frameworks` | workspace | a listed id is in `inspection.workspace.frameworks[].id` |
|
|
24
|
+
* | `languages` | file | the file's language (`fileLanguageOf`) is listed |
|
|
25
|
+
* | `fileGlobs` | file | `globListSelects(file, globs)` — `**` spans zero+ segments, `!` subtracts |
|
|
26
|
+
* | `constructKinds` | reserved | always (not evaluated; the loader warns) |
|
|
27
|
+
*/
|
|
28
|
+
import { realpathSync } from 'node:fs';
|
|
29
|
+
import * as nodePath from 'node:path';
|
|
30
|
+
import { globListSelects } from '@shrkcrft/boundaries';
|
|
31
|
+
import { ConventionAppliesToFilter } from '@shrkcrft/plugin-api';
|
|
32
|
+
import { ConventionFilterLevel } from "./convention-filter-level.js";
|
|
33
|
+
import { fileLanguageOf } from "./file-languages.js";
|
|
34
|
+
/** Where each filter is decided — keyed by the enum, so a new filter without a level is a compile error. */
|
|
35
|
+
export const CONVENTION_FILTER_LEVELS = Object.freeze({
|
|
36
|
+
[ConventionAppliesToFilter.ProfileIds]: ConventionFilterLevel.Workspace,
|
|
37
|
+
[ConventionAppliesToFilter.Frameworks]: ConventionFilterLevel.Workspace,
|
|
38
|
+
[ConventionAppliesToFilter.Languages]: ConventionFilterLevel.File,
|
|
39
|
+
[ConventionAppliesToFilter.FileGlobs]: ConventionFilterLevel.File,
|
|
40
|
+
[ConventionAppliesToFilter.ConstructKinds]: ConventionFilterLevel.Reserved,
|
|
41
|
+
});
|
|
42
|
+
/** Reasons are listed workspace filters first, then per-file, then reserved. */
|
|
43
|
+
const FILTER_ORDER = [
|
|
44
|
+
ConventionAppliesToFilter.ProfileIds,
|
|
45
|
+
ConventionAppliesToFilter.Frameworks,
|
|
46
|
+
ConventionAppliesToFilter.Languages,
|
|
47
|
+
ConventionAppliesToFilter.FileGlobs,
|
|
48
|
+
ConventionAppliesToFilter.ConstructKinds,
|
|
49
|
+
];
|
|
50
|
+
/** The convention's declared values for `filter` — `[]` for an absent filter (or a non-list, which the loader refuses). */
|
|
51
|
+
export function declaredAppliesTo(convention, filter) {
|
|
52
|
+
const value = convention.appliesTo?.[filter];
|
|
53
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === 'string') : [];
|
|
54
|
+
}
|
|
55
|
+
/** One realpath per distinct file per inspection — `conventionScope` judges every file once per per-file filter. */
|
|
56
|
+
const SPELLINGS = new WeakMap();
|
|
57
|
+
/**
|
|
58
|
+
* `abs` with every symlink resolved. A path that does not exist (a file a diff
|
|
59
|
+
* deleted, a path a test names) resolves through its nearest existing ancestor,
|
|
60
|
+
* so `/var/…/gone.ts` and `/private/var/…/gone.ts` still agree.
|
|
61
|
+
*/
|
|
62
|
+
function canonicalPath(abs) {
|
|
63
|
+
let head = abs;
|
|
64
|
+
const tail = [];
|
|
65
|
+
for (;;) {
|
|
66
|
+
try {
|
|
67
|
+
const real = realpathSync(head);
|
|
68
|
+
return tail.length > 0 ? nodePath.join(real, ...tail.reverse()) : real;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
const parent = nodePath.dirname(head);
|
|
72
|
+
if (parent === head)
|
|
73
|
+
return abs;
|
|
74
|
+
tail.push(nodePath.basename(head));
|
|
75
|
+
head = parent;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** The lexical spelling: project-relative for an absolute path, `/`-separated, no leading `./`. */
|
|
80
|
+
function lexicalFilePath(projectRoot, file) {
|
|
81
|
+
let f = nodePath.isAbsolute(file) ? nodePath.relative(projectRoot, file) : file;
|
|
82
|
+
f = f.replace(/\\/g, '/');
|
|
83
|
+
while (f.startsWith('./'))
|
|
84
|
+
f = f.slice(2);
|
|
85
|
+
return f;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A file path as the per-file filters AND a rule's patterns read it:
|
|
89
|
+
* project-relative, `/`-separated, no leading `./`. `checkConventionsAgainstFiles`
|
|
90
|
+
* normalizes its file list through this once, so the scope test and every
|
|
91
|
+
* `filePattern` / `expectMatch` / `forbidMatch` regex see ONE spelling of a file
|
|
92
|
+
* (round 15 review: `--files ./src/a.ts` was covered by `fileGlobs: ['src/**']`
|
|
93
|
+
* here and then failed `filePattern: '^src/'` on the raw `./src/a.ts` — a false hit).
|
|
94
|
+
*
|
|
95
|
+
* The spelling is REALPATH-canonical (round 15 follow-up, F9): the file and the
|
|
96
|
+
* project root are both resolved through their symlinks before one is made
|
|
97
|
+
* relative to the other, so a symlinked absolute path (`/link/src/a.ts` with
|
|
98
|
+
* `/link → the project`, or macOS `/var/…` for a root at `/private/var/…`)
|
|
99
|
+
* behaves exactly like its target — it read `../link/src/a.ts`, which no
|
|
100
|
+
* `fileGlobs` selected, so the convention was silently not applicable. A path
|
|
101
|
+
* whose target lies OUTSIDE the project (an in-project symlink to a sibling
|
|
102
|
+
* checkout) keeps its lexical in-project spelling: that is where it is in scope.
|
|
103
|
+
*/
|
|
104
|
+
export function conventionFilePath(inspection, file) {
|
|
105
|
+
let cache = SPELLINGS.get(inspection);
|
|
106
|
+
if (!cache) {
|
|
107
|
+
cache = { realRoot: canonicalPath(nodePath.resolve(inspection.projectRoot)), files: new Map() };
|
|
108
|
+
SPELLINGS.set(inspection, cache);
|
|
109
|
+
}
|
|
110
|
+
const known = cache.files.get(file);
|
|
111
|
+
if (known !== undefined)
|
|
112
|
+
return known;
|
|
113
|
+
const real = canonicalPath(nodePath.resolve(inspection.projectRoot, file));
|
|
114
|
+
const rel = nodePath.relative(cache.realRoot, real);
|
|
115
|
+
const inside = rel.length > 0 && rel !== '..' && !rel.startsWith(`..${nodePath.sep}`) && !nodePath.isAbsolute(rel);
|
|
116
|
+
const spelled = inside ? rel.split(nodePath.sep).join('/') : lexicalFilePath(inspection.projectRoot, file);
|
|
117
|
+
cache.files.set(file, spelled);
|
|
118
|
+
return spelled;
|
|
119
|
+
}
|
|
120
|
+
function list(values) {
|
|
121
|
+
return `[${values.join(', ')}]`;
|
|
122
|
+
}
|
|
123
|
+
function reason(filter, declared, observed, matched, detail) {
|
|
124
|
+
return {
|
|
125
|
+
filter,
|
|
126
|
+
level: CONVENTION_FILTER_LEVELS[filter],
|
|
127
|
+
declared,
|
|
128
|
+
observed,
|
|
129
|
+
matched,
|
|
130
|
+
message: `appliesTo.${filter} ${list(declared)}: ${detail}`,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** A workspace filter: any declared id among the detected ones. */
|
|
134
|
+
function judgeWorkspace(filter, declared, detected, noun) {
|
|
135
|
+
const hit = declared.filter((d) => detected.includes(d));
|
|
136
|
+
if (hit.length > 0)
|
|
137
|
+
return reason(filter, declared, detected, true, `detected ${hit.join(', ')}`);
|
|
138
|
+
const seen = detected.length > 0 ? `detected: ${detected.join(', ')}` : `no ${noun} detected`;
|
|
139
|
+
return reason(filter, declared, detected, false, `none detected (${seen})`);
|
|
140
|
+
}
|
|
141
|
+
function judge(filter, declared, inspection, file) {
|
|
142
|
+
switch (filter) {
|
|
143
|
+
case ConventionAppliesToFilter.ProfileIds:
|
|
144
|
+
return judgeWorkspace(filter, declared, [...(inspection.workspace?.profiles ?? [])], 'profile');
|
|
145
|
+
case ConventionAppliesToFilter.Frameworks:
|
|
146
|
+
return judgeWorkspace(filter, declared, (inspection.workspace?.frameworks ?? []).map((f) => f.id), 'framework');
|
|
147
|
+
case ConventionAppliesToFilter.ConstructKinds:
|
|
148
|
+
return reason(filter, declared, [], true, 'reserved — not evaluated (the convention applies regardless)');
|
|
149
|
+
case ConventionAppliesToFilter.Languages: {
|
|
150
|
+
if (file === undefined)
|
|
151
|
+
return reason(filter, declared, [], true, 'decided per file');
|
|
152
|
+
const path = conventionFilePath(inspection, file);
|
|
153
|
+
const language = fileLanguageOf(path)?.id;
|
|
154
|
+
if (language === undefined)
|
|
155
|
+
return reason(filter, declared, [], false, `${path} has no known language`);
|
|
156
|
+
return reason(filter, declared, [language], declared.includes(language), `${path} is ${language}`);
|
|
157
|
+
}
|
|
158
|
+
case ConventionAppliesToFilter.FileGlobs: {
|
|
159
|
+
if (file === undefined)
|
|
160
|
+
return reason(filter, declared, [], true, 'decided per file');
|
|
161
|
+
const path = conventionFilePath(inspection, file);
|
|
162
|
+
const selected = globListSelects(path, declared);
|
|
163
|
+
return reason(filter, declared, [path], selected, `${selected ? 'selects' : 'does not select'} ${path}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Does `convention` apply here — to the workspace, and (given `file`) to that
|
|
169
|
+
* file? Without `file` only the workspace filters decide; the per-file ones
|
|
170
|
+
* are listed as `decided per file`. See the module doc for the table.
|
|
171
|
+
*/
|
|
172
|
+
export function conventionApplicability(convention, inspection, file) {
|
|
173
|
+
const reasons = [];
|
|
174
|
+
for (const filter of FILTER_ORDER) {
|
|
175
|
+
const declared = declaredAppliesTo(convention, filter);
|
|
176
|
+
if (declared.length === 0)
|
|
177
|
+
continue;
|
|
178
|
+
reasons.push(judge(filter, declared, inspection, file));
|
|
179
|
+
}
|
|
180
|
+
return { applicable: reasons.every((r) => r.matched), reasons };
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Which of `files` `convention` covers — per file through
|
|
184
|
+
* {@link conventionApplicability}, so `conventions check` and the rule-graph
|
|
185
|
+
* bridge (which both call this) cannot disagree.
|
|
186
|
+
*
|
|
187
|
+
* Not applicable when a workspace filter excludes it, or when `files` is
|
|
188
|
+
* non-empty and no file passes the per-file filters (the per-file reasons
|
|
189
|
+
* then count what each filter selected across the list). An EMPTY list keeps
|
|
190
|
+
* a workspace-applicable convention applicable over nothing — the caller's own
|
|
191
|
+
* empty-scope verdict decides that case.
|
|
192
|
+
*/
|
|
193
|
+
export function conventionScope(convention, inspection, files) {
|
|
194
|
+
const conventionId = convention.id;
|
|
195
|
+
const workspace = conventionApplicability(convention, inspection);
|
|
196
|
+
if (!workspace.applicable)
|
|
197
|
+
return { conventionId, applicable: false, files: [], reasons: workspace.reasons };
|
|
198
|
+
const perFile = FILTER_ORDER.filter((f) => CONVENTION_FILTER_LEVELS[f] === ConventionFilterLevel.File && declaredAppliesTo(convention, f).length > 0);
|
|
199
|
+
if (perFile.length === 0 || files.length === 0) {
|
|
200
|
+
return { conventionId, applicable: true, files: [...files], reasons: workspace.reasons };
|
|
201
|
+
}
|
|
202
|
+
const covered = [];
|
|
203
|
+
const admitted = new Map();
|
|
204
|
+
const seen = new Map();
|
|
205
|
+
for (const file of files) {
|
|
206
|
+
const verdict = conventionApplicability(convention, inspection, file);
|
|
207
|
+
if (verdict.applicable)
|
|
208
|
+
covered.push(file);
|
|
209
|
+
for (const r of verdict.reasons) {
|
|
210
|
+
if (r.level !== ConventionFilterLevel.File)
|
|
211
|
+
continue;
|
|
212
|
+
if (r.matched)
|
|
213
|
+
admitted.set(r.filter, (admitted.get(r.filter) ?? 0) + 1);
|
|
214
|
+
if (r.filter === ConventionAppliesToFilter.Languages) {
|
|
215
|
+
const s = seen.get(r.filter) ?? new Set();
|
|
216
|
+
for (const o of r.observed)
|
|
217
|
+
s.add(o);
|
|
218
|
+
seen.set(r.filter, s);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (covered.length > 0)
|
|
223
|
+
return { conventionId, applicable: true, files: covered, reasons: workspace.reasons };
|
|
224
|
+
// No file passed: say, per declared per-file filter, what it selected across
|
|
225
|
+
// the list. A filter that admitted NO file excluded the convention (matched:
|
|
226
|
+
// false); one that admitted some did not (matched: true) — unless EVERY
|
|
227
|
+
// per-file filter admitted some file and none passed them all: then the
|
|
228
|
+
// intersection excluded it, and each filter says so. So the excluding reasons
|
|
229
|
+
// are never empty and never name a filter that excluded nothing (round 15
|
|
230
|
+
// review: `fileGlobs` read "selects 1 of 1 file(s)" as an excluding reason).
|
|
231
|
+
const n = files.length;
|
|
232
|
+
const intersectionOnly = perFile.every((filter) => (admitted.get(filter) ?? 0) > 0);
|
|
233
|
+
const together = intersectionOnly ? ' — but no file in scope passes every per-file filter together' : '';
|
|
234
|
+
const aggregated = perFile.map((filter) => {
|
|
235
|
+
const declared = declaredAppliesTo(convention, filter);
|
|
236
|
+
const count = admitted.get(filter) ?? 0;
|
|
237
|
+
const matched = count > 0 && !intersectionOnly;
|
|
238
|
+
if (filter === ConventionAppliesToFilter.Languages) {
|
|
239
|
+
const langs = [...(seen.get(filter) ?? new Set())].sort();
|
|
240
|
+
const detail = `${count} of ${n} file(s) in scope ${count === 1 ? 'is' : 'are'} a listed language (seen: ${langs.length > 0 ? langs.join(', ') : 'none known'})${together}`;
|
|
241
|
+
return reason(filter, declared, langs, matched, detail);
|
|
242
|
+
}
|
|
243
|
+
return reason(filter, declared, [], matched, `selects ${count} of ${n} file(s) in scope${together}`);
|
|
244
|
+
});
|
|
245
|
+
const workspaceReasons = workspace.reasons.filter((r) => r.level !== ConventionFilterLevel.File);
|
|
246
|
+
return { conventionId, applicable: false, files: [], reasons: [...workspaceReasons, ...aggregated] };
|
|
247
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an `appliesTo` filter is decided (round 15, 15.1) — see
|
|
3
|
+
* `conventionApplicability`.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ConventionFilterLevel {
|
|
6
|
+
/** Decided once per workspace, from what the workspace detectors saw (`profileIds`, `frameworks`). */
|
|
7
|
+
Workspace = "workspace",
|
|
8
|
+
/** Decided per file (`fileGlobs`, `languages`). */
|
|
9
|
+
File = "file",
|
|
10
|
+
/** Loaded and never evaluated — the convention applies regardless (`constructKinds`). */
|
|
11
|
+
Reserved = "reserved"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=convention-filter-level.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convention-filter-level.d.ts","sourceRoot":"","sources":["../src/convention-filter-level.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,qBAAqB;IAC/B,sGAAsG;IACtG,SAAS,cAAc;IACvB,mDAAmD;IACnD,IAAI,SAAS;IACb,yFAAyF;IACzF,QAAQ,aAAa;CACtB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an `appliesTo` filter is decided (round 15, 15.1) — see
|
|
3
|
+
* `conventionApplicability`.
|
|
4
|
+
*/
|
|
5
|
+
export var ConventionFilterLevel;
|
|
6
|
+
(function (ConventionFilterLevel) {
|
|
7
|
+
/** Decided once per workspace, from what the workspace detectors saw (`profileIds`, `frameworks`). */
|
|
8
|
+
ConventionFilterLevel["Workspace"] = "workspace";
|
|
9
|
+
/** Decided per file (`fileGlobs`, `languages`). */
|
|
10
|
+
ConventionFilterLevel["File"] = "file";
|
|
11
|
+
/** Loaded and never evaluated — the convention applies regardless (`constructKinds`). */
|
|
12
|
+
ConventionFilterLevel["Reserved"] = "reserved";
|
|
13
|
+
})(ConventionFilterLevel || (ConventionFilterLevel = {}));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { type IConvention } from '@shrkcrft/plugin-api';
|
|
1
|
+
import { ConventionSeverity, type IConvention } from '@shrkcrft/plugin-api';
|
|
2
2
|
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
import type { INotApplicableConvention } from './i-not-applicable-convention.js';
|
|
4
|
+
import { type IRejectedEntry } from '@shrkcrft/core';
|
|
3
5
|
export declare const CONVENTION_REGISTRY_SCHEMA = "sharkcraft.convention-registry/v1";
|
|
4
6
|
export declare enum ConventionSource {
|
|
5
7
|
Local = "local",
|
|
@@ -13,15 +15,36 @@ export interface IConventionEntry {
|
|
|
13
15
|
readonly sourceFile: string;
|
|
14
16
|
}
|
|
15
17
|
export interface IConventionDoctorIssue {
|
|
16
|
-
readonly severity:
|
|
18
|
+
readonly severity: ConventionSeverity;
|
|
17
19
|
readonly code: string;
|
|
18
20
|
readonly message: string;
|
|
19
21
|
readonly conventionId?: string;
|
|
20
22
|
readonly source?: string;
|
|
21
23
|
}
|
|
24
|
+
/** The convention FILES a load discovered, and the ones it could not read — the doctor's coverage. */
|
|
25
|
+
export interface IConventionFileScan {
|
|
26
|
+
/** Every convention file the load tried (local defaults, `conventionFiles`, pack `conventionFiles`). */
|
|
27
|
+
readonly discovered: number;
|
|
28
|
+
/** Discovered but never read (missing, or failed to import) — `file — reason`, project-relative. */
|
|
29
|
+
readonly unread: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* THE convention acceptance predicate (round 12, 12.1): every error of
|
|
33
|
+
* `validateConvention`, `<field>: <message>` — `[]` means accepted. The
|
|
34
|
+
* loader and `packs test --load` refuse exactly the same entries.
|
|
35
|
+
*/
|
|
36
|
+
export declare function conventionRejectionReasons(raw: unknown): readonly string[];
|
|
22
37
|
export declare function loadConventions(inspection: ISharkcraftInspection): Promise<{
|
|
23
38
|
entries: readonly IConventionEntry[];
|
|
24
39
|
issues: readonly IConventionDoctorIssue[];
|
|
40
|
+
files: IConventionFileScan;
|
|
41
|
+
/**
|
|
42
|
+
* Every declared convention the loader refused (round 12, 12.1) — invalid
|
|
43
|
+
* or a duplicate id — with its position and every reason. The `issues`
|
|
44
|
+
* above still carry the per-field `invalid-convention` lines `conventions
|
|
45
|
+
* doctor` prints; this is the record THE rejection channel lifts.
|
|
46
|
+
*/
|
|
47
|
+
rejected: readonly IRejectedEntry[];
|
|
25
48
|
}>;
|
|
26
49
|
export declare function listConventions(inspection: ISharkcraftInspection): Promise<readonly IConventionEntry[]>;
|
|
27
50
|
export declare function findConvention(inspection: ISharkcraftInspection, id: string): Promise<IConventionEntry | null>;
|
|
@@ -31,7 +54,7 @@ export interface IConventionCheckHit {
|
|
|
31
54
|
readonly ruleId: string;
|
|
32
55
|
readonly file: string;
|
|
33
56
|
readonly line?: number;
|
|
34
|
-
readonly severity:
|
|
57
|
+
readonly severity: ConventionSeverity;
|
|
35
58
|
readonly message: string;
|
|
36
59
|
}
|
|
37
60
|
export interface IConventionCheckReport {
|
|
@@ -39,6 +62,30 @@ export interface IConventionCheckReport {
|
|
|
39
62
|
readonly filesScanned: number;
|
|
40
63
|
readonly hits: readonly IConventionCheckHit[];
|
|
41
64
|
readonly verdict: 'clean' | 'has-violations';
|
|
65
|
+
/**
|
|
66
|
+
* Conventions that do not apply here (round 15, 15.1) — never evaluated, each
|
|
67
|
+
* with the `appliesTo` filters that excluded it. `conventions check` prints
|
|
68
|
+
* every one and accepts it explicitly (`acceptedBy: 'appliesTo'`).
|
|
69
|
+
*/
|
|
70
|
+
readonly notApplicable: readonly INotApplicableConvention[];
|
|
71
|
+
/** How many files in scope each APPLICABLE convention covers, by id (round 15). */
|
|
72
|
+
readonly filesInScope: Readonly<Record<string, number>>;
|
|
42
73
|
}
|
|
43
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Run the loaded conventions against `files`. Which files a convention covers
|
|
76
|
+
* is `conventionScope` — THE applicability authority (round 15), the same one
|
|
77
|
+
* the rule-graph bridge reads — so every `appliesTo` filter scopes, `**`
|
|
78
|
+
* spans zero or more segments, and a `!` glob subtracts (a private matcher
|
|
79
|
+
* here missed `src/a.ts` under `src/**\/*.ts` and ignored `!`). A convention
|
|
80
|
+
* that does not apply is never evaluated and is reported in `notApplicable`.
|
|
81
|
+
*
|
|
82
|
+
* Per covered file, each rule: `filePattern` and `expectMatch` must match the
|
|
83
|
+
* path (a miss is a hit), `forbidMatch` must not (a match is a hit).
|
|
84
|
+
*
|
|
85
|
+
* Every file is read in ONE spelling — `conventionFilePath` (project-relative,
|
|
86
|
+
* `/`-separated, no `./`), the one the scope test reads — so a rule pattern
|
|
87
|
+
* never tests a spelling the glob did not, and a hit names that path (round 15
|
|
88
|
+
* review: `./src/a.ts` was covered by `src/**` and then failed `^src/`).
|
|
89
|
+
*/
|
|
90
|
+
export declare function checkConventionsAgainstFiles(inspection: ISharkcraftInspection, inputFiles: readonly string[]): Promise<IConventionCheckReport>;
|
|
44
91
|
//# sourceMappingURL=convention-registry.d.ts.map
|