@shrkcrft/inspector 0.1.0-alpha.30 → 0.1.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +51 -4
- 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/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/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 +106 -0
- package/dist/contribution-load-failures.d.ts.map +1 -0
- package/dist/contribution-load-failures.js +575 -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-registry.d.ts +22 -0
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +79 -39
- 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 +159 -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 +20 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +68 -20
- 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 +50 -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 +68 -19
- package/dist/fix-preview.d.ts.map +1 -1
- package/dist/fix-preview.js +9 -5
- 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.js +1 -1
- 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 +24 -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-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-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-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-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-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-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 +141 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +172 -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 +24 -1
- package/dist/knowledge-authoring.d.ts.map +1 -1
- package/dist/knowledge-authoring.js +46 -7
- package/dist/knowledge-entry-verdict-record.d.ts +22 -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-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-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 +83 -0
- package/dist/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-gate.js +429 -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 +110 -0
- package/dist/knowledge-stale.d.ts +122 -9
- package/dist/knowledge-stale.d.ts.map +1 -1
- package/dist/knowledge-stale.js +996 -291
- 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/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 +443 -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/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-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/resolve-project-config.d.ts +64 -0
- package/dist/resolve-project-config.d.ts.map +1 -1
- package/dist/resolve-project-config.js +240 -32
- 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 +1304 -181
- 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 +53 -280
- 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 +273 -26
- 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/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-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 +228 -0
- package/dist/why-file.d.ts +3 -0
- package/dist/why-file.d.ts.map +1 -1
- package/dist/why-file.js +7 -3
- package/package.json +17 -17
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IVerdictCoverage } from '@shrkcrft/core';
|
|
2
|
+
import type { IKnowledgeRefResolution } from '@shrkcrft/knowledge';
|
|
3
|
+
import type { IDeclaredXrefField } from './i-declared-xref-field.js';
|
|
4
|
+
import type { IDeclaredXrefReport } from './i-declared-xref-report.js';
|
|
5
|
+
import type { IDeclaredXrefRow } from './i-declared-xref-row.js';
|
|
6
|
+
import { type ReferenceKind } from './reference-registry.js';
|
|
7
|
+
import type { ISelfConfigGraph } from './self-config-doctor.js';
|
|
8
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
9
|
+
export declare const DECLARED_XREF_SCHEMA: "sharkcraft.declared-xrefs/v1";
|
|
10
|
+
/**
|
|
11
|
+
* THE table of declared fields that carry cross-reference ids.
|
|
12
|
+
*
|
|
13
|
+
* Severity: a dangling `related`-style id shrinks a result silently but does
|
|
14
|
+
* not misroute anyone, so it is a warning (`--strict` makes it fail);
|
|
15
|
+
* `supersededBy` ROUTES a reader to the current entry, so a dangling one is an
|
|
16
|
+
* error. Another cluster that validates ids inside an asset field adds a row
|
|
17
|
+
* here — it never writes its own loop.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DECLARED_XREF_FIELDS: readonly IDeclaredXrefField[];
|
|
20
|
+
/** Knowledge-backed kinds: removing a knowledge entry removes the rule / path it also is. */
|
|
21
|
+
export declare const KNOWLEDGE_BACKED_KINDS: readonly ReferenceKind[];
|
|
22
|
+
/**
|
|
23
|
+
* Resolve every declared cross-reference id. Synchronous: call it AFTER
|
|
24
|
+
* `warmReferenceRegistries` (or use {@link buildDeclaredXrefReport}). On a cold
|
|
25
|
+
* cache the cache-backed kinds cannot be looked up, so an id that might live
|
|
26
|
+
* in one is `unverified` — never `dangling` — and constructs are reported in
|
|
27
|
+
* `examined.unreadSources`. Never throws: a registry that will not load is its
|
|
28
|
+
* own surface's problem.
|
|
29
|
+
*/
|
|
30
|
+
export declare function collectDeclaredXrefs(inspection: ISharkcraftInspection): IDeclaredXrefReport;
|
|
31
|
+
/** Warm the async registries, then {@link collectDeclaredXrefs}. */
|
|
32
|
+
export declare function buildDeclaredXrefReport(inspection: ISharkcraftInspection): Promise<IDeclaredXrefReport>;
|
|
33
|
+
/** True for a row a reader following it would find broken: dangling or wrong-kind. */
|
|
34
|
+
export declare function isBrokenXref(row: IDeclaredXrefRow): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Who points at `targetId` — the reverse direction. With `asKinds`, only rows
|
|
37
|
+
* whose field could mean an id of one of those kinds (a construct's
|
|
38
|
+
* `relatedTemplates: ['x']` is not a reference to a knowledge entry `x`).
|
|
39
|
+
*/
|
|
40
|
+
export declare function reverseXrefs(report: IDeclaredXrefReport, targetId: string, asKinds?: readonly ReferenceKind[]): readonly IDeclaredXrefRow[];
|
|
41
|
+
/**
|
|
42
|
+
* The collector's coverage: every declared id must have been LOOKED UP. An
|
|
43
|
+
* unverified id (or a source that could not be enumerated) is an unexamined
|
|
44
|
+
* unit, so a verdict over it can never settle to a pass.
|
|
45
|
+
*/
|
|
46
|
+
export declare function declaredXrefCoverage(report: IDeclaredXrefReport): IVerdictCoverage;
|
|
47
|
+
/** The one-line summary every renderer prints (`N ids across M fields · …`). */
|
|
48
|
+
export declare function declaredXrefSummaryLine(report: IDeclaredXrefReport): string;
|
|
49
|
+
/**
|
|
50
|
+
* The self-config graph plus one edge per declared cross-reference; dangling
|
|
51
|
+
* and wrong-kind ones are also `brokenEdges`, so `self-config broken-links`
|
|
52
|
+
* agrees with the doctor instead of printing ✓ over dead ids.
|
|
53
|
+
*/
|
|
54
|
+
export declare function withDeclaredXrefEdges(graph: ISelfConfigGraph, report: IDeclaredXrefReport): ISelfConfigGraph;
|
|
55
|
+
/**
|
|
56
|
+
* The resolver `formatEntryFull` renders cross-references with (the knowledge
|
|
57
|
+
* package sits below this layer and cannot resolve ids itself). Warm first: on
|
|
58
|
+
* a cold cache an unresolvable id is `unverified`, never "unresolved".
|
|
59
|
+
*/
|
|
60
|
+
export declare function buildKnowledgeRefResolver(inspection: ISharkcraftInspection): (id: string) => IKnowledgeRefResolution;
|
|
61
|
+
//# sourceMappingURL=declared-cross-references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-cross-references.d.ts","sourceRoot":"","sources":["../src/declared-cross-references.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAGnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAe,MAAM,2BAA2B,CAAC;AAEpF,eAAO,MAAM,oBAAoB,EAAG,8BAAuC,CAAC;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,kBAAkB,EAkBpB,CAAC;AAS3C,6FAA6F;AAC7F,eAAO,MAAM,sBAAsB,EAAE,SAAS,aAAa,EAItB,CAAC;AAuYtC;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,qBAAqB,GAAG,mBAAmB,CAqE3F;AAED,oEAAoE;AACpE,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAG9B;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,SAAS,aAAa,EAAE,GACjC,SAAS,gBAAgB,EAAE,CAM7B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,gBAAgB,CAkBlF;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAO3E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,mBAAmB,GAC1B,gBAAgB,CAalB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,qBAAqB,GAChC,CAAC,EAAE,EAAE,MAAM,KAAK,uBAAuB,CASzC"}
|
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declared cross-references — the ids assets name in `related`-style fields.
|
|
3
|
+
*
|
|
4
|
+
* Assets point at each other by id across every namespace: a knowledge entry's
|
|
5
|
+
* `related` / `seeAlso` / `supersededBy` and its action hints, a construct's
|
|
6
|
+
* `related*` fields and its facets, a boundary rule's `related*`, a template's
|
|
7
|
+
* `related`. None of it used to be resolved by anything: a renamed or deleted
|
|
8
|
+
* asset left dangling ids behind, and every doctor still printed ✓ while the
|
|
9
|
+
* dead link produced a silently smaller result for whoever followed it.
|
|
10
|
+
*
|
|
11
|
+
* This module is the ONE answer to "which declared asset fields carry ids"
|
|
12
|
+
* ({@link DECLARED_XREF_FIELDS}); every id is resolved through the ONE resolver
|
|
13
|
+
* (`reference-registry.ts`). The self-config doctor, `self-config
|
|
14
|
+
* broken-links|resolve|xrefs`, `packs doctor`, `templates drift`, `knowledge
|
|
15
|
+
* remove` and `shrk quality` all read this collector rather than walking the
|
|
16
|
+
* fields themselves — a second walker would drift from this one, and the one
|
|
17
|
+
* nobody runs would be the wrong one.
|
|
18
|
+
*
|
|
19
|
+
* The prose twin is `doc-references.ts` (ids cited in free text).
|
|
20
|
+
*/
|
|
21
|
+
import * as nodePath from 'node:path';
|
|
22
|
+
import { listConstructs } from "./construct-registry.js";
|
|
23
|
+
import { DeclaredXrefStatus } from "./declared-xref-status.js";
|
|
24
|
+
import { nearestIds } from "./nearest-id.js";
|
|
25
|
+
import { ALL_ID_REFERENCE_KINDS, isCacheBackedKind, isReferenceCacheWarm, referenceIdPool, referenceIdSets, warmReferenceRegistries, } from "./reference-registry.js";
|
|
26
|
+
export const DECLARED_XREF_SCHEMA = 'sharkcraft.declared-xrefs/v1';
|
|
27
|
+
/**
|
|
28
|
+
* THE table of declared fields that carry cross-reference ids.
|
|
29
|
+
*
|
|
30
|
+
* Severity: a dangling `related`-style id shrinks a result silently but does
|
|
31
|
+
* not misroute anyone, so it is a warning (`--strict` makes it fail);
|
|
32
|
+
* `supersededBy` ROUTES a reader to the current entry, so a dangling one is an
|
|
33
|
+
* error. Another cluster that validates ids inside an asset field adds a row
|
|
34
|
+
* here — it never writes its own loop.
|
|
35
|
+
*/
|
|
36
|
+
export const DECLARED_XREF_FIELDS = Object.freeze([
|
|
37
|
+
{ sourceKind: 'knowledge', field: 'related', accepts: 'any', severity: 'warning', relation: 'related' },
|
|
38
|
+
{ sourceKind: 'knowledge', field: 'seeAlso', accepts: 'any', severity: 'warning', relation: 'related' },
|
|
39
|
+
{ sourceKind: 'knowledge', field: 'supersededBy', accepts: ['knowledge'], severity: 'error', relation: 'supersedes' },
|
|
40
|
+
{ sourceKind: 'knowledge', field: 'actionHints.relatedKnowledge', accepts: ['knowledge'], severity: 'warning', relation: 'related' },
|
|
41
|
+
{ sourceKind: 'knowledge', field: 'actionHints.relatedTemplates', accepts: ['template'], severity: 'warning', relation: 'related' },
|
|
42
|
+
{ sourceKind: 'knowledge', field: 'actionHints.relatedPathConventions', accepts: ['path-convention'], severity: 'warning', relation: 'related' },
|
|
43
|
+
{ sourceKind: 'construct', field: 'relatedKnowledge', accepts: ['knowledge'], severity: 'warning', relation: 'related' },
|
|
44
|
+
{ sourceKind: 'construct', field: 'relatedRules', accepts: ['rule', 'boundary-rule'], severity: 'warning', relation: 'related' },
|
|
45
|
+
{ sourceKind: 'construct', field: 'relatedTemplates', accepts: ['template'], severity: 'warning', relation: 'related' },
|
|
46
|
+
{ sourceKind: 'construct', field: 'relatedPipelines', accepts: ['pipeline'], severity: 'warning', relation: 'related' },
|
|
47
|
+
{ sourceKind: 'construct', field: 'relatedPathConventions', accepts: ['path-convention'], severity: 'warning', relation: 'related' },
|
|
48
|
+
// Facet values are free-form (an event topic, a token name) unless the value
|
|
49
|
+
// DECLARES what it names via `resolvesAs` — only those are resolved.
|
|
50
|
+
{ sourceKind: 'construct', field: 'facets', accepts: 'declared', severity: 'warning', relation: 'related' },
|
|
51
|
+
{ sourceKind: 'boundary-rule', field: 'relatedRules', accepts: ['rule', 'boundary-rule'], severity: 'warning', relation: 'related' },
|
|
52
|
+
{ sourceKind: 'boundary-rule', field: 'relatedPathConventions', accepts: ['path-convention'], severity: 'warning', relation: 'related' },
|
|
53
|
+
{ sourceKind: 'template', field: 'related', accepts: 'any', severity: 'warning', relation: 'related' },
|
|
54
|
+
]);
|
|
55
|
+
/**
|
|
56
|
+
* Knowledge fields whose SHAPE is validated at load (`validateKnowledgeEntries`,
|
|
57
|
+
* code `invalid-cross-reference`). The collector does not re-report a malformed
|
|
58
|
+
* member there — one code path per question.
|
|
59
|
+
*/
|
|
60
|
+
const LOAD_VALIDATED_KNOWLEDGE_FIELDS = new Set(['related', 'seeAlso', 'supersededBy']);
|
|
61
|
+
/** Knowledge-backed kinds: removing a knowledge entry removes the rule / path it also is. */
|
|
62
|
+
export const KNOWLEDGE_BACKED_KINDS = Object.freeze([
|
|
63
|
+
'knowledge',
|
|
64
|
+
'rule',
|
|
65
|
+
'path-convention',
|
|
66
|
+
]);
|
|
67
|
+
function relativeFile(projectRoot, file) {
|
|
68
|
+
if (!file)
|
|
69
|
+
return undefined;
|
|
70
|
+
if (!nodePath.isAbsolute(file))
|
|
71
|
+
return file;
|
|
72
|
+
const rel = nodePath.relative(projectRoot, file);
|
|
73
|
+
return rel.startsWith('..') ? file : rel;
|
|
74
|
+
}
|
|
75
|
+
function packOf(info) {
|
|
76
|
+
return info?.type === 'pack' && info.packageName ? { packageName: info.packageName } : {};
|
|
77
|
+
}
|
|
78
|
+
function listOf(reg) {
|
|
79
|
+
const list = reg?.list;
|
|
80
|
+
return typeof list === 'function' ? (list.call(reg) ?? []) : [];
|
|
81
|
+
}
|
|
82
|
+
/** Every asset that can declare a cross-reference, with where it lives. */
|
|
83
|
+
function collectSources(inspection, warm) {
|
|
84
|
+
const root = inspection.projectRoot;
|
|
85
|
+
const sources = [];
|
|
86
|
+
const unread = [];
|
|
87
|
+
for (const e of inspection.knowledgeEntries) {
|
|
88
|
+
const info = inspection.entrySources.get(e.id);
|
|
89
|
+
const file = relativeFile(root, info?.file ?? e.source?.origin);
|
|
90
|
+
sources.push({ kind: 'knowledge', id: e.id, asset: e, ...(file ? { file } : {}), ...packOf(info) });
|
|
91
|
+
}
|
|
92
|
+
const constructs = listConstructs(inspection);
|
|
93
|
+
// Constructs load asynchronously; on a cold cache there is nothing to walk,
|
|
94
|
+
// which must read as "could not look", never as "no constructs declare ids".
|
|
95
|
+
if (!warm && constructs.length === 0)
|
|
96
|
+
unread.push('construct');
|
|
97
|
+
for (const c of constructs) {
|
|
98
|
+
sources.push({
|
|
99
|
+
kind: 'construct',
|
|
100
|
+
id: c.id,
|
|
101
|
+
asset: c,
|
|
102
|
+
...(c.sourceFile ? { file: c.sourceFile } : {}),
|
|
103
|
+
...(c.source === 'pack' && c.packageName ? { packageName: c.packageName } : {}),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
for (const r of listOf(inspection.boundaryRegistry)) {
|
|
107
|
+
const info = inspection.boundarySources.get(r.id);
|
|
108
|
+
const file = relativeFile(root, info?.file);
|
|
109
|
+
sources.push({ kind: 'boundary-rule', id: r.id, asset: r, ...(file ? { file } : {}), ...packOf(info) });
|
|
110
|
+
}
|
|
111
|
+
// `templateRegistry`, not `inspection.templates`: the same source `shrk
|
|
112
|
+
// templates list` (and the reference registry) reads.
|
|
113
|
+
for (const t of listOf(inspection.templateRegistry)) {
|
|
114
|
+
const info = inspection.templateSources.get(t.id);
|
|
115
|
+
const file = relativeFile(root, info?.file);
|
|
116
|
+
sources.push({ kind: 'template', id: t.id, asset: t, ...(file ? { file } : {}), ...packOf(info) });
|
|
117
|
+
}
|
|
118
|
+
return { sources, unread };
|
|
119
|
+
}
|
|
120
|
+
function readPath(asset, path) {
|
|
121
|
+
let cur = asset;
|
|
122
|
+
for (const key of path.split('.')) {
|
|
123
|
+
if (!cur || typeof cur !== 'object')
|
|
124
|
+
return undefined;
|
|
125
|
+
cur = cur[key];
|
|
126
|
+
}
|
|
127
|
+
return cur;
|
|
128
|
+
}
|
|
129
|
+
/** The string ids a field value holds, deduped, plus why it is malformed (if it is). */
|
|
130
|
+
function idsOf(value) {
|
|
131
|
+
if (value === undefined || value === null)
|
|
132
|
+
return { ids: [] };
|
|
133
|
+
// A scalar where a list belongs is the common authoring typo — honoured, as
|
|
134
|
+
// the action-hint formatter honours it, rather than walked as characters.
|
|
135
|
+
if (typeof value === 'string') {
|
|
136
|
+
return value.trim().length > 0 ? { ids: [value] } : { ids: [], malformed: 'is an empty string' };
|
|
137
|
+
}
|
|
138
|
+
if (!Array.isArray(value))
|
|
139
|
+
return { ids: [], malformed: `is a ${typeof value}, not a list of ids` };
|
|
140
|
+
const ids = [];
|
|
141
|
+
let bad = 0;
|
|
142
|
+
for (const m of value) {
|
|
143
|
+
if (typeof m === 'string' && m.trim().length > 0) {
|
|
144
|
+
if (!ids.includes(m))
|
|
145
|
+
ids.push(m);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
bad += 1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return bad > 0 ? { ids, malformed: `has ${bad} member(s) that are not non-empty string ids` } : { ids };
|
|
152
|
+
}
|
|
153
|
+
function acceptsLabel(accepts) {
|
|
154
|
+
return accepts === 'any' ? 'any kind' : accepts.join(' | ');
|
|
155
|
+
}
|
|
156
|
+
function resolveId(ctx, source, field, accepts, severity, relation, targetId, facetId) {
|
|
157
|
+
const resolvedAs = ALL_ID_REFERENCE_KINDS.filter((k) => ctx.sets.get(k)?.has(targetId) === true);
|
|
158
|
+
const acceptedKinds = accepts === 'any' ? ALL_ID_REFERENCE_KINDS : accepts;
|
|
159
|
+
const where = `${source.kind} "${source.id}" ${field}${facetId ? ` [${facetId}]` : ''}`;
|
|
160
|
+
let status;
|
|
161
|
+
let reason = '';
|
|
162
|
+
if (resolvedAs.some((k) => acceptedKinds.includes(k))) {
|
|
163
|
+
status = DeclaredXrefStatus.Ok;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
// A negative answer is only trustworthy when every registry the id could
|
|
167
|
+
// live in was actually looked at.
|
|
168
|
+
const cold = ctx.warm ? [] : acceptedKinds.filter(isCacheBackedKind);
|
|
169
|
+
const emptyTyped = ctx.warm &&
|
|
170
|
+
accepts !== 'any' &&
|
|
171
|
+
acceptedKinds.every((k) => isCacheBackedKind(k) && (ctx.sets.get(k)?.size ?? 0) === 0);
|
|
172
|
+
if (cold.length > 0) {
|
|
173
|
+
status = DeclaredXrefStatus.Unverified;
|
|
174
|
+
reason = `the ${cold.join(' / ')} registr${cold.length === 1 ? 'y was' : 'ies were'} not warmed (warmReferenceRegistries), so it could not be looked up`;
|
|
175
|
+
}
|
|
176
|
+
else if (emptyTyped) {
|
|
177
|
+
status = DeclaredXrefStatus.Unverified;
|
|
178
|
+
reason = `the ${acceptedKinds.join(' / ')} registry is empty — it may have failed to load, so the id could not be looked up`;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
status = resolvedAs.length === 0 ? DeclaredXrefStatus.Dangling : DeclaredXrefStatus.WrongKind;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
let didYouMean = [];
|
|
185
|
+
if (status === DeclaredXrefStatus.Dangling || status === DeclaredXrefStatus.WrongKind) {
|
|
186
|
+
const key = acceptedKinds.join(',');
|
|
187
|
+
let pool = ctx.pools.get(key);
|
|
188
|
+
if (!pool) {
|
|
189
|
+
pool = referenceIdPool(ctx.inspection, acceptedKinds);
|
|
190
|
+
ctx.pools.set(key, pool);
|
|
191
|
+
}
|
|
192
|
+
// Never suggest the source's own id: following that advice writes a
|
|
193
|
+
// self-reference (a self-supersession the validator rejects as an error).
|
|
194
|
+
didYouMean = nearestIds(targetId, pool)
|
|
195
|
+
.map((n) => n.id)
|
|
196
|
+
.filter((id) => id !== source.id);
|
|
197
|
+
}
|
|
198
|
+
const hint = didYouMean.length > 0 ? ` — did you mean "${didYouMean[0]}"?` : '';
|
|
199
|
+
const message = status === DeclaredXrefStatus.Ok
|
|
200
|
+
? `${where} → "${targetId}" resolves as ${resolvedAs.join(' | ')}`
|
|
201
|
+
: status === DeclaredXrefStatus.Dangling
|
|
202
|
+
? `${where} names "${targetId}", which no registry has (the field accepts ${acceptsLabel(accepts)})${hint}`
|
|
203
|
+
: status === DeclaredXrefStatus.WrongKind
|
|
204
|
+
? `${where} names "${targetId}", which is a ${resolvedAs.join(' | ')} — the field accepts ${acceptsLabel(accepts)}${hint}`
|
|
205
|
+
: `${where} names "${targetId}" — NOT VERIFIED: ${reason}`;
|
|
206
|
+
return {
|
|
207
|
+
sourceKind: source.kind,
|
|
208
|
+
sourceId: source.id,
|
|
209
|
+
field,
|
|
210
|
+
...(facetId !== undefined ? { facetId } : {}),
|
|
211
|
+
targetId,
|
|
212
|
+
...(source.file ? { file: source.file } : {}),
|
|
213
|
+
...(source.packageName ? { packageName: source.packageName } : {}),
|
|
214
|
+
accepts,
|
|
215
|
+
resolvedAs,
|
|
216
|
+
status,
|
|
217
|
+
severity: status === DeclaredXrefStatus.Dangling || status === DeclaredXrefStatus.WrongKind ? severity : 'info',
|
|
218
|
+
relation,
|
|
219
|
+
message,
|
|
220
|
+
didYouMean,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function issueAt(source, field, code, severity, message, targetId, facetId) {
|
|
224
|
+
return {
|
|
225
|
+
code,
|
|
226
|
+
severity,
|
|
227
|
+
sourceKind: source.kind,
|
|
228
|
+
sourceId: source.id,
|
|
229
|
+
field,
|
|
230
|
+
...(targetId !== undefined ? { targetId } : {}),
|
|
231
|
+
...(facetId !== undefined ? { facetId } : {}),
|
|
232
|
+
...(source.file ? { file: source.file } : {}),
|
|
233
|
+
...(source.packageName ? { packageName: source.packageName } : {}),
|
|
234
|
+
message,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
const KNOWN_KINDS = new Set(ALL_ID_REFERENCE_KINDS);
|
|
238
|
+
/** Resolve every facet value that declares what it names; count the rest. */
|
|
239
|
+
function collectFacetRows(ctx, source, spec, rows, issues) {
|
|
240
|
+
let undeclared = 0;
|
|
241
|
+
const facets = readPath(source.asset, 'facets');
|
|
242
|
+
if (!facets || typeof facets !== 'object')
|
|
243
|
+
return 0;
|
|
244
|
+
for (const [name, values] of Object.entries(facets)) {
|
|
245
|
+
if (!Array.isArray(values))
|
|
246
|
+
continue;
|
|
247
|
+
const field = `facets.${name}`;
|
|
248
|
+
for (const v of values) {
|
|
249
|
+
if (!v || typeof v !== 'object')
|
|
250
|
+
continue;
|
|
251
|
+
const fv = v;
|
|
252
|
+
const facetId = typeof fv.id === 'string' ? fv.id : undefined;
|
|
253
|
+
if (fv.resolvesAs === undefined) {
|
|
254
|
+
undeclared += 1;
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
const declared = Array.isArray(fv.resolvesAs)
|
|
258
|
+
? fv.resolvesAs
|
|
259
|
+
: [fv.resolvesAs];
|
|
260
|
+
const unknown = declared.filter((k) => typeof k !== 'string' || !KNOWN_KINDS.has(k));
|
|
261
|
+
for (const k of unknown) {
|
|
262
|
+
// A typo'd kind is the `$use` failure shape: the value would otherwise
|
|
263
|
+
// resolve against nothing and read as "not an id".
|
|
264
|
+
issues.push(issueAt(source, field, 'xref-unknown-kind', 'error', `${source.kind} "${source.id}" ${field}${facetId ? ` [${facetId}]` : ''} declares resolvesAs "${String(k)}", which is not a reference kind (expected one of: ${ALL_ID_REFERENCE_KINDS.join(', ')}).`, typeof fv.value === 'string' ? fv.value : undefined, facetId));
|
|
265
|
+
}
|
|
266
|
+
const accepts = declared.filter((k) => typeof k === 'string' && KNOWN_KINDS.has(k));
|
|
267
|
+
if (accepts.length === 0)
|
|
268
|
+
continue;
|
|
269
|
+
if (typeof fv.value !== 'string' || fv.value.trim().length === 0) {
|
|
270
|
+
issues.push(issueAt(source, field, 'xref-malformed', 'warning', `${source.kind} "${source.id}" ${field}${facetId ? ` [${facetId}]` : ''} declares resolvesAs but its value is not a non-empty string id.`, undefined, facetId));
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
rows.push(resolveId(ctx, source, field, accepts, spec.severity, spec.relation, fv.value, facetId));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return undeclared;
|
|
277
|
+
}
|
|
278
|
+
/** Strongly-connected components of size > 1 — each one a supersession cycle. */
|
|
279
|
+
function supersessionCycles(succ) {
|
|
280
|
+
let counter = 0;
|
|
281
|
+
const index = new Map();
|
|
282
|
+
const low = new Map();
|
|
283
|
+
const stack = [];
|
|
284
|
+
const onStack = new Set();
|
|
285
|
+
const out = [];
|
|
286
|
+
const visit = (v) => {
|
|
287
|
+
index.set(v, counter);
|
|
288
|
+
low.set(v, counter);
|
|
289
|
+
counter += 1;
|
|
290
|
+
stack.push(v);
|
|
291
|
+
onStack.add(v);
|
|
292
|
+
for (const w of succ.get(v) ?? []) {
|
|
293
|
+
if (!index.has(w)) {
|
|
294
|
+
visit(w);
|
|
295
|
+
low.set(v, Math.min(low.get(v) ?? 0, low.get(w) ?? 0));
|
|
296
|
+
}
|
|
297
|
+
else if (onStack.has(w)) {
|
|
298
|
+
low.set(v, Math.min(low.get(v) ?? 0, index.get(w) ?? 0));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
if (low.get(v) === index.get(v)) {
|
|
302
|
+
const comp = [];
|
|
303
|
+
let w;
|
|
304
|
+
do {
|
|
305
|
+
w = stack.pop();
|
|
306
|
+
if (w === undefined)
|
|
307
|
+
break;
|
|
308
|
+
onStack.delete(w);
|
|
309
|
+
comp.push(w);
|
|
310
|
+
} while (w !== v);
|
|
311
|
+
if (comp.length > 1)
|
|
312
|
+
out.push(comp.sort());
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
for (const v of [...succ.keys()].sort())
|
|
316
|
+
if (!index.has(v))
|
|
317
|
+
visit(v);
|
|
318
|
+
return out;
|
|
319
|
+
}
|
|
320
|
+
/** The current (non-superseded) entries reachable from `start`, cycle-safe. */
|
|
321
|
+
function terminalSuccessors(start, succ, inCycle) {
|
|
322
|
+
const terminals = new Set();
|
|
323
|
+
const seen = new Set();
|
|
324
|
+
const queue = [start];
|
|
325
|
+
while (queue.length > 0) {
|
|
326
|
+
const cur = queue.shift();
|
|
327
|
+
if (cur === undefined || seen.has(cur) || inCycle.has(cur))
|
|
328
|
+
continue;
|
|
329
|
+
seen.add(cur);
|
|
330
|
+
const next = succ.get(cur);
|
|
331
|
+
if (!next || next.length === 0)
|
|
332
|
+
terminals.add(cur);
|
|
333
|
+
else
|
|
334
|
+
queue.push(...next);
|
|
335
|
+
}
|
|
336
|
+
return [...terminals].sort();
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* `supersededBy` graph checks: a cycle has no current entry (error); a target
|
|
340
|
+
* that is itself superseded makes a reader hop twice (warning, naming the
|
|
341
|
+
* terminal successor). Existence of each target is the row check's job.
|
|
342
|
+
*/
|
|
343
|
+
function checkSupersession(ctx, sources, issues) {
|
|
344
|
+
const knowledge = ctx.sets.get('knowledge') ?? new Set();
|
|
345
|
+
const byId = new Map();
|
|
346
|
+
const succ = new Map();
|
|
347
|
+
for (const s of sources) {
|
|
348
|
+
if (s.kind !== 'knowledge')
|
|
349
|
+
continue;
|
|
350
|
+
byId.set(s.id, s);
|
|
351
|
+
// Self-supersession is a load-time error (`invalid-cross-reference`).
|
|
352
|
+
const next = idsOf(readPath(s.asset, 'supersededBy')).ids.filter((t) => t !== s.id && knowledge.has(t));
|
|
353
|
+
if (next.length > 0)
|
|
354
|
+
succ.set(s.id, next);
|
|
355
|
+
}
|
|
356
|
+
if (succ.size === 0)
|
|
357
|
+
return;
|
|
358
|
+
const inCycle = new Set();
|
|
359
|
+
for (const cycle of supersessionCycles(succ)) {
|
|
360
|
+
for (const m of cycle)
|
|
361
|
+
inCycle.add(m);
|
|
362
|
+
const first = byId.get(cycle[0] ?? '');
|
|
363
|
+
if (!first)
|
|
364
|
+
continue;
|
|
365
|
+
issues.push(issueAt(first, 'supersededBy', 'xref-superseded-cycle', 'error', `supersededBy forms a cycle among ${cycle.map((c) => `"${c}"`).join(', ')} — none of them is current, so a reader following the chain never arrives.`, (succ.get(first.id) ?? []).find((t) => cycle.includes(t))));
|
|
366
|
+
}
|
|
367
|
+
for (const [from, next] of succ) {
|
|
368
|
+
if (inCycle.has(from))
|
|
369
|
+
continue;
|
|
370
|
+
const source = byId.get(from);
|
|
371
|
+
if (!source)
|
|
372
|
+
continue;
|
|
373
|
+
for (const target of next) {
|
|
374
|
+
if (!succ.has(target) || inCycle.has(target))
|
|
375
|
+
continue;
|
|
376
|
+
const terminals = terminalSuccessors(target, succ, inCycle);
|
|
377
|
+
issues.push(issueAt(source, 'supersededBy', 'xref-superseded-chain', 'warning', `knowledge "${from}" is superseded by "${target}", which is itself superseded — point it at the current entr${terminals.length === 1 ? 'y' : 'ies'}: ${terminals.map((t) => `"${t}"`).join(', ') || '(none — the chain ends in a cycle)'}.`, target));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Resolve every declared cross-reference id. Synchronous: call it AFTER
|
|
383
|
+
* `warmReferenceRegistries` (or use {@link buildDeclaredXrefReport}). On a cold
|
|
384
|
+
* cache the cache-backed kinds cannot be looked up, so an id that might live
|
|
385
|
+
* in one is `unverified` — never `dangling` — and constructs are reported in
|
|
386
|
+
* `examined.unreadSources`. Never throws: a registry that will not load is its
|
|
387
|
+
* own surface's problem.
|
|
388
|
+
*/
|
|
389
|
+
export function collectDeclaredXrefs(inspection) {
|
|
390
|
+
const warm = isReferenceCacheWarm(inspection);
|
|
391
|
+
const ctx = { inspection, sets: referenceIdSets(inspection), warm, pools: new Map() };
|
|
392
|
+
const { sources, unread } = collectSources(inspection, warm);
|
|
393
|
+
const rows = [];
|
|
394
|
+
const issues = [];
|
|
395
|
+
let facetValuesUndeclared = 0;
|
|
396
|
+
const sourcesByKind = {};
|
|
397
|
+
for (const source of sources) {
|
|
398
|
+
sourcesByKind[source.kind] = (sourcesByKind[source.kind] ?? 0) + 1;
|
|
399
|
+
for (const spec of DECLARED_XREF_FIELDS) {
|
|
400
|
+
if (spec.sourceKind !== source.kind)
|
|
401
|
+
continue;
|
|
402
|
+
if (spec.accepts === 'declared') {
|
|
403
|
+
facetValuesUndeclared += collectFacetRows(ctx, source, spec, rows, issues);
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
const { ids, malformed } = idsOf(readPath(source.asset, spec.field));
|
|
407
|
+
if (malformed && !(source.kind === 'knowledge' && LOAD_VALIDATED_KNOWLEDGE_FIELDS.has(spec.field))) {
|
|
408
|
+
issues.push(issueAt(source, spec.field, 'xref-malformed', 'warning', `${source.kind} "${source.id}" ${spec.field} ${malformed}.`));
|
|
409
|
+
}
|
|
410
|
+
for (const id of ids) {
|
|
411
|
+
rows.push(resolveId(ctx, source, spec.field, spec.accepts, spec.severity, spec.relation, id));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
checkSupersession(ctx, sources, issues);
|
|
416
|
+
const byField = {};
|
|
417
|
+
const counts = { ids: rows.length, ok: 0, dangling: 0, wrongKind: 0, unverified: 0, errors: 0, warnings: 0 };
|
|
418
|
+
for (const r of rows) {
|
|
419
|
+
const key = `${r.sourceKind}.${r.field.startsWith('facets.') ? 'facets' : r.field}`;
|
|
420
|
+
const f = (byField[key] ??= { ids: 0, dangling: 0, wrongKind: 0, unverified: 0 });
|
|
421
|
+
f.ids += 1;
|
|
422
|
+
if (r.status === DeclaredXrefStatus.Ok)
|
|
423
|
+
counts.ok += 1;
|
|
424
|
+
else if (r.status === DeclaredXrefStatus.Dangling) {
|
|
425
|
+
counts.dangling += 1;
|
|
426
|
+
f.dangling += 1;
|
|
427
|
+
}
|
|
428
|
+
else if (r.status === DeclaredXrefStatus.WrongKind) {
|
|
429
|
+
counts.wrongKind += 1;
|
|
430
|
+
f.wrongKind += 1;
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
counts.unverified += 1;
|
|
434
|
+
f.unverified += 1;
|
|
435
|
+
}
|
|
436
|
+
if (r.severity === 'error')
|
|
437
|
+
counts.errors += 1;
|
|
438
|
+
else if (r.severity === 'warning')
|
|
439
|
+
counts.warnings += 1;
|
|
440
|
+
}
|
|
441
|
+
for (const i of issues) {
|
|
442
|
+
if (i.severity === 'error')
|
|
443
|
+
counts.errors += 1;
|
|
444
|
+
else
|
|
445
|
+
counts.warnings += 1;
|
|
446
|
+
}
|
|
447
|
+
return {
|
|
448
|
+
schema: DECLARED_XREF_SCHEMA,
|
|
449
|
+
rows,
|
|
450
|
+
issues,
|
|
451
|
+
counts,
|
|
452
|
+
examined: {
|
|
453
|
+
sources: sources.length,
|
|
454
|
+
sourcesByKind,
|
|
455
|
+
ids: rows.length,
|
|
456
|
+
fields: Object.keys(byField).length,
|
|
457
|
+
byField,
|
|
458
|
+
facetValuesUndeclared,
|
|
459
|
+
cacheWarm: warm,
|
|
460
|
+
unreadSources: unread,
|
|
461
|
+
},
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/** Warm the async registries, then {@link collectDeclaredXrefs}. */
|
|
465
|
+
export async function buildDeclaredXrefReport(inspection) {
|
|
466
|
+
await warmReferenceRegistries(inspection);
|
|
467
|
+
return collectDeclaredXrefs(inspection);
|
|
468
|
+
}
|
|
469
|
+
/** True for a row a reader following it would find broken: dangling or wrong-kind. */
|
|
470
|
+
export function isBrokenXref(row) {
|
|
471
|
+
return row.status === DeclaredXrefStatus.Dangling || row.status === DeclaredXrefStatus.WrongKind;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Who points at `targetId` — the reverse direction. With `asKinds`, only rows
|
|
475
|
+
* whose field could mean an id of one of those kinds (a construct's
|
|
476
|
+
* `relatedTemplates: ['x']` is not a reference to a knowledge entry `x`).
|
|
477
|
+
*/
|
|
478
|
+
export function reverseXrefs(report, targetId, asKinds) {
|
|
479
|
+
return report.rows.filter((r) => r.targetId === targetId &&
|
|
480
|
+
(!asKinds || r.accepts === 'any' || r.accepts.some((k) => asKinds.includes(k))));
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* The collector's coverage: every declared id must have been LOOKED UP. An
|
|
484
|
+
* unverified id (or a source that could not be enumerated) is an unexamined
|
|
485
|
+
* unit, so a verdict over it can never settle to a pass.
|
|
486
|
+
*/
|
|
487
|
+
export function declaredXrefCoverage(report) {
|
|
488
|
+
const unread = report.examined.unreadSources.map((k) => `${k} assets (registry not warmed)`);
|
|
489
|
+
const unverified = report.rows
|
|
490
|
+
.filter((r) => r.status === DeclaredXrefStatus.Unverified)
|
|
491
|
+
.map((r) => `${r.sourceKind}:${r.sourceId} ${r.field} → ${r.targetId}`);
|
|
492
|
+
const labels = [...unread, ...unverified];
|
|
493
|
+
return {
|
|
494
|
+
unit: 'declared cross-reference ids',
|
|
495
|
+
expected: report.counts.ids + unread.length,
|
|
496
|
+
examined: report.counts.ids - report.counts.unverified,
|
|
497
|
+
...(labels.length > 0
|
|
498
|
+
? {
|
|
499
|
+
unexamined: labels.slice(0, 20),
|
|
500
|
+
unexaminedTotal: labels.length,
|
|
501
|
+
reason: 'could not be looked up (registry not warmed, or empty)',
|
|
502
|
+
}
|
|
503
|
+
: {}),
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
/** The one-line summary every renderer prints (`N ids across M fields · …`). */
|
|
507
|
+
export function declaredXrefSummaryLine(report) {
|
|
508
|
+
const c = report.counts;
|
|
509
|
+
if (c.ids === 0 && report.issues.length === 0) {
|
|
510
|
+
return `none declared — nothing examined (${report.examined.sources} asset(s) walked)`;
|
|
511
|
+
}
|
|
512
|
+
const issues = report.issues.length > 0 ? ` · ${report.issues.length} declaration issue(s)` : '';
|
|
513
|
+
return `${c.ids} id(s) across ${report.examined.fields} field(s) · ${c.dangling} dangling · ${c.wrongKind} wrong-kind · ${c.unverified} unverified${issues}`;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* The self-config graph plus one edge per declared cross-reference; dangling
|
|
517
|
+
* and wrong-kind ones are also `brokenEdges`, so `self-config broken-links`
|
|
518
|
+
* agrees with the doctor instead of printing ✓ over dead ids.
|
|
519
|
+
*/
|
|
520
|
+
export function withDeclaredXrefEdges(graph, report) {
|
|
521
|
+
const edges = [...graph.edges];
|
|
522
|
+
const brokenEdges = [...graph.brokenEdges];
|
|
523
|
+
for (const r of report.rows) {
|
|
524
|
+
const edge = {
|
|
525
|
+
from: { id: r.sourceId, kind: r.sourceKind, ...(r.file ? { source: r.file } : {}) },
|
|
526
|
+
to: { id: r.targetId, kind: r.resolvedAs[0] ?? (r.accepts === 'any' ? 'unknown' : (r.accepts[0] ?? 'unknown')) },
|
|
527
|
+
relation: r.field,
|
|
528
|
+
};
|
|
529
|
+
edges.push(edge);
|
|
530
|
+
if (isBrokenXref(r))
|
|
531
|
+
brokenEdges.push(edge);
|
|
532
|
+
}
|
|
533
|
+
return { ...graph, edges, brokenEdges };
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* The resolver `formatEntryFull` renders cross-references with (the knowledge
|
|
537
|
+
* package sits below this layer and cannot resolve ids itself). Warm first: on
|
|
538
|
+
* a cold cache an unresolvable id is `unverified`, never "unresolved".
|
|
539
|
+
*/
|
|
540
|
+
export function buildKnowledgeRefResolver(inspection) {
|
|
541
|
+
const sets = referenceIdSets(inspection);
|
|
542
|
+
const warm = isReferenceCacheWarm(inspection);
|
|
543
|
+
return (id) => {
|
|
544
|
+
const kinds = ALL_ID_REFERENCE_KINDS.filter((k) => sets.get(k)?.has(id) === true);
|
|
545
|
+
if (kinds.length === 0)
|
|
546
|
+
return warm ? { kinds } : { kinds, unverified: true };
|
|
547
|
+
const title = inspection.index.get(id)?.title ?? inspection.templateRegistry.get(id)?.name;
|
|
548
|
+
return { kinds, ...(title ? { title } : {}) };
|
|
549
|
+
};
|
|
550
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How many data-defined gate-plane rules the project declares, per plane —
|
|
3
|
+
* read through `resolveProjectConfig` (THE config reader that sees
|
|
4
|
+
* pack-contributed planes) under THE plane → config-key list beside the config
|
|
5
|
+
* schema (`GATE_PLANE_CONFIG_KEY`), the one the CLI's `collectGateRules` reads.
|
|
6
|
+
*
|
|
7
|
+
* Two "no config was read" answers, kept apart (round 11 review R12-REG-2):
|
|
8
|
+
* - NO config — the loader found no `sharkcraft/` folder
|
|
9
|
+
* (`isProjectConfigAbsent`, the answer `finish` reads as "gate not
|
|
10
|
+
* applicable"): zero rules and no `loadError`; there are no planes to run;
|
|
11
|
+
* - a config that EXISTS but failed to load: `loadError` is set, since
|
|
12
|
+
* nothing can be said about what it declares.
|
|
13
|
+
*
|
|
14
|
+
* `buildQualityReport` consumers other than `shrk quality` (MCP, the
|
|
15
|
+
* dashboard, the report site) do not run the planes — some spawn shells — so
|
|
16
|
+
* they report a not-run `gate-planes` row from this count; `shrk quality`
|
|
17
|
+
* runs them.
|
|
18
|
+
*/
|
|
19
|
+
export declare function declaredGatePlaneRules(projectRoot: string): Promise<{
|
|
20
|
+
readonly total: number;
|
|
21
|
+
readonly byPlane: Readonly<Record<string, number>>;
|
|
22
|
+
readonly loadError?: string;
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=declared-gate-plane-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-gate-plane-rules.d.ts","sourceRoot":"","sources":["../src/declared-gate-plane-rules.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAiBtH"}
|