@shrkcrft/inspector 0.1.0-alpha.29 → 0.1.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +40 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -1
- package/dist/code-intelligence-doctor.js +86 -12
- 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 +80 -0
- package/dist/doc-references.d.ts.map +1 -0
- package/dist/doc-references.js +269 -0
- 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.d.ts.map +1 -1
- package/dist/fuzzy-impact.js +12 -21
- 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 +145 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +176 -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 +1002 -316
- 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 +14 -0
- package/dist/nearest-id.d.ts.map +1 -0
- package/dist/nearest-id.js +12 -0
- 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 +42 -0
- package/dist/policy-registry.d.ts.map +1 -0
- package/dist/policy-registry.js +131 -0
- 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 +15 -12
- 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 +210 -0
- package/dist/reference-registry.d.ts.map +1 -0
- package/dist/reference-registry.js +395 -0
- 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 +258 -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 +1329 -255
- 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 +65 -309
- 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 +47 -1
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +278 -29
- 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 -318
- 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,210 @@
|
|
|
1
|
+
import type { KnowledgeReferenceKind } from '@shrkcrft/knowledge';
|
|
2
|
+
import type { ICommandResolution } from './i-command-resolution.js';
|
|
3
|
+
import type { ICommandResolveOptions } from './i-command-resolve-options.js';
|
|
4
|
+
import type { IReferenceWarmOptions } from './i-reference-warm-options.js';
|
|
5
|
+
import { ReferenceIdStatus } from './reference-id-status.js';
|
|
6
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
7
|
+
/**
|
|
8
|
+
* The id sets a knowledge/doc reference can resolve against.
|
|
9
|
+
*
|
|
10
|
+
* `knowledge-stale` already answered "does this id exist?" per kind, one
|
|
11
|
+
* private `*Exists` helper at a time. The doc-reference linter needs the same
|
|
12
|
+
* answer AND the candidate LIST (to suggest what the author meant), so the
|
|
13
|
+
* lookup moves here and both consume it. Two implementations of "which
|
|
14
|
+
* template ids exist" would eventually disagree, and the one nobody runs would
|
|
15
|
+
* be the wrong one.
|
|
16
|
+
*
|
|
17
|
+
* Every list is read defensively off the inspection: these registries are
|
|
18
|
+
* populated by different layers and a repo may legitimately have none of a
|
|
19
|
+
* given kind, which must read as "no candidates", never as a crash.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Kinds a DOC reference may resolve against.
|
|
23
|
+
*
|
|
24
|
+
* A superset of `KnowledgeReferenceKind`: `pipeline` is a real registry that
|
|
25
|
+
* prose cites constantly (`the spine pipelines (engine.feature-dev, …)`) but
|
|
26
|
+
* that a knowledge entry has never had a structured reference kind for. The
|
|
27
|
+
* doc plane owns its own list rather than widening the knowledge contract for
|
|
28
|
+
* a need only this surface has.
|
|
29
|
+
*/
|
|
30
|
+
export type DocReferenceKind = KnowledgeReferenceKind | 'pipeline';
|
|
31
|
+
/**
|
|
32
|
+
* EVERY kind this engine can answer "does this id exist?" for.
|
|
33
|
+
*
|
|
34
|
+
* A superset of `DocReferenceKind`: the self-config doctor cross-references
|
|
35
|
+
* kinds prose never cites (a decision record, a scaffold pattern, a routing
|
|
36
|
+
* hint). It used to answer for them from its OWN lookup sets, built from its
|
|
37
|
+
* own sources — so "one definition of does-this-id-exist" was a doc claim, not
|
|
38
|
+
* a property of the code, and the two answers agreed only by coincidence. They
|
|
39
|
+
* did not always: `sharkcraft.mcp-read-only` is a declared policy that the
|
|
40
|
+
* doctor's pack-only policy set reported as unknown.
|
|
41
|
+
*
|
|
42
|
+
* `docReferences[].resolvesAs` is unchanged — it still accepts exactly the
|
|
43
|
+
* `DocReferenceKind`s. Widening the RESOLVER is not widening the config.
|
|
44
|
+
*/
|
|
45
|
+
export type ReferenceKind = DocReferenceKind | 'knowledge' | 'rule' | 'decision' | 'convention' | 'contract-template' | 'migration-profile' | 'workspace-profile' | 'routing-hint' | 'registration-hint' | 'scaffold-pattern';
|
|
46
|
+
/**
|
|
47
|
+
* Every kind that resolves against a registry of ids.
|
|
48
|
+
*
|
|
49
|
+
* `command` is deliberately absent: the command index lives in the CLI
|
|
50
|
+
* package, ABOVE this layer, so it resolves through the resolver the CLI
|
|
51
|
+
* injects ({@link resolveCommandReference}) — never by shape, and never by a
|
|
52
|
+
* list this layer cannot see. `file` / `directory` / `symbol` / `package` /
|
|
53
|
+
* `url` are not id registries at all.
|
|
54
|
+
*
|
|
55
|
+
* **List order is SPECIFICITY.** A rule and a path convention are knowledge
|
|
56
|
+
* entries filtered by type, so `knowledge` is a SUPERSET of both and must come
|
|
57
|
+
* after them: {@link referenceKindsOf} returns kinds in this order, so its first
|
|
58
|
+
* element names the most specific registry. With `knowledge` listed first,
|
|
59
|
+
* every rule id used to report `knowledge` as "the" kind it resolved as.
|
|
60
|
+
*
|
|
61
|
+
* **Every kind here is DECLARABLE** (round 12): `REFERENCE_KIND_DECLARATIONS`
|
|
62
|
+
* is a `Record<IdReferenceKind, …>`, so a kind added here without a row saying
|
|
63
|
+
* how its ids come to exist is a compile error, and the r76 declarability lock
|
|
64
|
+
* proves every path in that row fills this resolver. `workspace-profile` is
|
|
65
|
+
* the builtin WorkspaceProfile vocabulary — the applicability filters'
|
|
66
|
+
* `profileIds` resolve against it (they were bound to `migration-profile`, a
|
|
67
|
+
* readiness registry, and sat at NOT VERIFIED forever).
|
|
68
|
+
*/
|
|
69
|
+
export declare const ALL_ID_REFERENCE_KINDS: readonly ["template", "pipeline", "playbook", "policy", "construct", "helper", "boundary-rule", "path-convention", "rule", "knowledge", "decision", "convention", "contract-template", "migration-profile", "workspace-profile", "routing-hint", "registration-hint", "scaffold-pattern"];
|
|
70
|
+
/** A kind that resolves against a registry of ids — a member of {@link ALL_ID_REFERENCE_KINDS}. */
|
|
71
|
+
export type IdReferenceKind = (typeof ALL_ID_REFERENCE_KINDS)[number];
|
|
72
|
+
/** The loud-skip message every consumer prints for an un-injected command index. */
|
|
73
|
+
export declare const COMMAND_INDEX_NOT_INJECTED = "command index not injected \u2014 NOT VERIFIED";
|
|
74
|
+
/**
|
|
75
|
+
* Populate the snapshot the synchronous accessors read.
|
|
76
|
+
*
|
|
77
|
+
* Call this once, from the async layer that owns the inspection, before
|
|
78
|
+
* resolving anything. Without it a correct playbook — or convention, or
|
|
79
|
+
* scaffold pattern — resolves to nothing, which is exactly how a correct id got
|
|
80
|
+
* reported as an error twice.
|
|
81
|
+
*
|
|
82
|
+
* `options.commandResolver` is the CLI's command-string resolver (the command
|
|
83
|
+
* index lives above this layer). Without one, every `command` reference is
|
|
84
|
+
* `Unverifiable` — see {@link resolveCommandReference}.
|
|
85
|
+
*/
|
|
86
|
+
export declare function warmReferenceRegistries(inspection: ISharkcraftInspection, options?: IReferenceWarmOptions): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Every registered id of `kind`, for existence checks and for suggesting what
|
|
89
|
+
* an unresolved token might have meant.
|
|
90
|
+
*
|
|
91
|
+
* **The invariant:** each kind reads the SAME source its `list` verb reads.
|
|
92
|
+
* `template` goes through `templateRegistry` because that is what `shrk
|
|
93
|
+
* templates list` prints — not the `templates` array it happens to be built
|
|
94
|
+
* from today, which would agree only until someone filters one of them.
|
|
95
|
+
*/
|
|
96
|
+
export declare function referenceIdsFor(inspection: ISharkcraftInspection, kind: ReferenceKind): readonly string[];
|
|
97
|
+
/**
|
|
98
|
+
* Kinds among `kinds` whose registry is EMPTY in this repo.
|
|
99
|
+
*
|
|
100
|
+
* This is the generalisation of the bug that prompted it: resolving against an
|
|
101
|
+
* empty registry cannot succeed, so every id checked against it is reported
|
|
102
|
+
* wrong — a gate confidently flagging CORRECT usage, which is the fastest way
|
|
103
|
+
* to get a gate switched off. Emptiness is repo-dependent (a project may simply
|
|
104
|
+
* have no playbooks), so it cannot be a config-time error; the caller surfaces
|
|
105
|
+
* it as a loud refusal at run time instead.
|
|
106
|
+
*
|
|
107
|
+
* `command` has no list; it can resolve exactly when a resolver was injected.
|
|
108
|
+
* Without one it is reported here — nothing could resolve, so every command
|
|
109
|
+
* would be reported wrong (or, before round 11, every `shrk …` string right).
|
|
110
|
+
*/
|
|
111
|
+
export declare function emptyReferenceKinds(inspection: ISharkcraftInspection, kinds: readonly ReferenceKind[]): readonly ReferenceKind[];
|
|
112
|
+
/** True when the CLI injected its command resolver for this inspection. */
|
|
113
|
+
export declare function hasCommandResolver(inspection: ISharkcraftInspection): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* True once {@link warmReferenceRegistries} ran for this inspection's root.
|
|
116
|
+
*
|
|
117
|
+
* The cache-backed kinds read EMPTY until then, so a consumer that resolves
|
|
118
|
+
* them (a test runner checking `expectedPlaybooks`) can report "could not look"
|
|
119
|
+
* instead of "your correct id does not exist".
|
|
120
|
+
*/
|
|
121
|
+
export declare function isReferenceCacheWarm(inspection: ISharkcraftInspection): boolean;
|
|
122
|
+
/** Ok / PrefixOnly / NotShrk: the string resolves (or is not ours to judge). */
|
|
123
|
+
export declare function isCommandResolved(resolution: ICommandResolution): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* THE function every consumer calls to resolve a command string: knowledge
|
|
126
|
+
* `command` references and anchors, the self-config doctor's command probes,
|
|
127
|
+
* agent-test `expectedCommands`, the query resolver.
|
|
128
|
+
*
|
|
129
|
+
* The command index lives in the CLI, above this layer, so the answer comes
|
|
130
|
+
* from the resolver the CLI injected via `warmReferenceRegistries(inspection,
|
|
131
|
+
* { commandResolver })`. Without one the answer is `Unverified` — the string
|
|
132
|
+
* was NOT checked. It used to be `id.startsWith('shrk ')`, which certified
|
|
133
|
+
* every `shrk …` string (including three dead ones in shrk's own knowledge) as
|
|
134
|
+
* a real command, forever.
|
|
135
|
+
*/
|
|
136
|
+
export declare function resolveCommandReference(inspection: ISharkcraftInspection, raw: string, options?: ICommandResolveOptions): ICommandResolution;
|
|
137
|
+
/**
|
|
138
|
+
* THE reading of a `command` REFERENCE — a knowledge `command` reference or
|
|
139
|
+
* anchor, an agent test's `expectedCommands`, the `command` reference kind.
|
|
140
|
+
*
|
|
141
|
+
* Such a string names a shrk command, so a bare form is read as one: `doctor`
|
|
142
|
+
* resolves, `frobnicate` is an unknown verb (see {@link ICommandResolveOptions}).
|
|
143
|
+
* knowledge-stale, the self-config doctor's reference probes and the agent-test
|
|
144
|
+
* runner all call THIS — they used to normalise the same string three ways
|
|
145
|
+
* (`frobnicate` was `ok` in one, `not-shrk` in another and `unknown-verb` in
|
|
146
|
+
* the third). Free shell text (a playbook step) goes through
|
|
147
|
+
* {@link resolveCommandReference} without the assumption.
|
|
148
|
+
*/
|
|
149
|
+
export declare function resolveShrkCommandReference(inspection: ISharkcraftInspection, command: string): ICommandResolution;
|
|
150
|
+
/**
|
|
151
|
+
* Tri-state existence: `Exists` / `Missing` / `Unverifiable`.
|
|
152
|
+
*
|
|
153
|
+
* For `command`: Ok, PrefixOnly and NotShrk are `Exists`; every Unknown* is
|
|
154
|
+
* `Missing`; no injected resolver is `Unverifiable` (report it as NOT VERIFIED,
|
|
155
|
+
* never as Ok). Read as a command REFERENCE ({@link resolveShrkCommandReference}).
|
|
156
|
+
* Every other kind is `Exists` / `Missing` against its registry.
|
|
157
|
+
*/
|
|
158
|
+
export declare function referenceIdStatus(inspection: ISharkcraftInspection, kind: ReferenceKind, id: string): ReferenceIdStatus;
|
|
159
|
+
/** True when `kind`'s ids come from an async-populated cache. */
|
|
160
|
+
export declare function isCacheBackedKind(kind: ReferenceKind): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Whether `id` is registered under `kind` — `true` only for
|
|
163
|
+
* {@link ReferenceIdStatus.Exists}.
|
|
164
|
+
*
|
|
165
|
+
* For `command` this is `false` when no resolver was injected: an unverifiable
|
|
166
|
+
* command is not an existing one. A caller that must tell "missing" from
|
|
167
|
+
* "could not look" reads {@link referenceIdStatus} instead.
|
|
168
|
+
*/
|
|
169
|
+
export declare function referenceIdExists(inspection: ISharkcraftInspection, kind: ReferenceKind, id: string): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* The union of candidate ids across `kinds`, deduped and sorted.
|
|
172
|
+
*
|
|
173
|
+
* A doc token is checked against several registries at once (a `nge.foo` might
|
|
174
|
+
* be a template OR a playbook), so the suggester needs one pool rather than
|
|
175
|
+
* per-kind lists that would each propose their own nearest miss.
|
|
176
|
+
*/
|
|
177
|
+
export declare function referenceIdPool(inspection: ISharkcraftInspection, kinds: readonly ReferenceKind[]): readonly string[];
|
|
178
|
+
/**
|
|
179
|
+
* Whether `id` is registered under ANY kind.
|
|
180
|
+
*
|
|
181
|
+
* For cross-references that do not name a kind — a search-tuning entry boosts
|
|
182
|
+
* "some id", a decision record relates to "some id". That union used to be
|
|
183
|
+
* hand-written as a chain of `lookups.x.has(id) || lookups.y.has(id) || …`,
|
|
184
|
+
* which is a list that silently goes stale: it omitted policies, decisions and
|
|
185
|
+
* scaffold patterns, so seven of shrk's own correctly-registered ids were
|
|
186
|
+
* reported unknown. Reading the kind list means adding a kind widens the union
|
|
187
|
+
* automatically.
|
|
188
|
+
*/
|
|
189
|
+
export declare function referenceIdExistsInAnyKind(inspection: ISharkcraftInspection, id: string): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* EVERY kind whose registry lists `id`, most specific first (the order of
|
|
192
|
+
* {@link ALL_ID_REFERENCE_KINDS}) — empty when nothing does.
|
|
193
|
+
*
|
|
194
|
+
* Ids carry no namespace prefix, so one id can legitimately live in several
|
|
195
|
+
* registries: a rule is also a knowledge entry, and a template may share an id
|
|
196
|
+
* with a construct. "Which namespace did this resolve into?" therefore has a
|
|
197
|
+
* LIST as its honest answer; {@link referenceKindOf} is its first element.
|
|
198
|
+
*/
|
|
199
|
+
export declare function referenceKindsOf(inspection: ISharkcraftInspection, id: string): readonly ReferenceKind[];
|
|
200
|
+
/** The most specific kind that accepted `id`, or `undefined` — for "resolved as what?" output. */
|
|
201
|
+
export declare function referenceKindOf(inspection: ISharkcraftInspection, id: string): ReferenceKind | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* One-shot projection of {@link referenceIdsFor} over every kind, for O(1)
|
|
204
|
+
* membership when a caller resolves many ids at once (the declared
|
|
205
|
+
* cross-reference collector walks every asset). Not a second source: each set
|
|
206
|
+
* is built from `referenceIdsFor`, so list ≡ resolve still holds per kind.
|
|
207
|
+
* Snapshot semantics — rebuild it after a warm.
|
|
208
|
+
*/
|
|
209
|
+
export declare function referenceIdSets(inspection: ISharkcraftInspection): ReadonlyMap<ReferenceKind, ReadonlySet<string>>;
|
|
210
|
+
//# sourceMappingURL=reference-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-registry.d.ts","sourceRoot":"","sources":["../src/reference-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAa7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,UAAU,CAAC;AAEnE;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GACrB,gBAAgB,GAChB,WAAW,GACX,MAAM,GACN,UAAU,GACV,YAAY,GACZ,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,GACd,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,sBAAsB,2RAmBU,CAAC;AAE9C,mGAAmG;AACnG,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AA2DtE,oFAAoF;AACpF,eAAO,MAAM,0BAA0B,mDAA8C,CAAC;AActF;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CA+Cf;AAMD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,EACjC,IAAI,EAAE,aAAa,GAClB,SAAS,MAAM,EAAE,CAmDnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,SAAS,aAAa,EAAE,CAM1B;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAE7E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAE/E;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAMzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,qBAAqB,EACjC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,sBAA2B,GACnC,kBAAkB,CAMpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,qBAAqB,EACjC,OAAO,EAAE,MAAM,GACd,kBAAkB,CAEpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,qBAAqB,EACjC,IAAI,EAAE,aAAa,EACnB,EAAE,EAAE,MAAM,GACT,iBAAiB,CAWnB;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,qBAAqB,EACjC,IAAI,EAAE,aAAa,EACnB,EAAE,EAAE,MAAM,GACT,OAAO,CAET;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,SAAS,MAAM,EAAE,CAMnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,qBAAqB,EACjC,EAAE,EAAE,MAAM,GACT,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,qBAAqB,EACjC,EAAE,EAAE,MAAM,GACT,SAAS,aAAa,EAAE,CAE1B;AAED,kGAAkG;AAClG,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,EACjC,EAAE,EAAE,MAAM,GACT,aAAa,GAAG,SAAS,CAE3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,GAChC,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAIjD"}
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { CommandResolutionStatus } from "./command-resolution-status.js";
|
|
2
|
+
import { ReferenceIdStatus } from "./reference-id-status.js";
|
|
3
|
+
import { listConstructs, warmConstructCache } from "./construct-registry.js";
|
|
4
|
+
import { listConventions } from "./convention-registry.js";
|
|
5
|
+
import { loadAllContractTemplates } from "./contract-template-registry.js";
|
|
6
|
+
import { listDecisions, loadTsDecisions } from "./decision-records.js";
|
|
7
|
+
import { listAllHelpers } from "./helper-catalog.js";
|
|
8
|
+
import { listMigrationProfilesFromPacks } from "./migration-profile-registry.js";
|
|
9
|
+
import { listPlaybooks, warmPlaybookCache } from "./playbook-registry.js";
|
|
10
|
+
import { listPolicyIds, warmPolicyCache } from "./policy-registry.js";
|
|
11
|
+
import { listWorkspaceProfileEntries } from "./profile-registry.js";
|
|
12
|
+
import { listRegistrationHints } from "./registration-hint-registry.js";
|
|
13
|
+
import { loadScaffoldPatternsFromInspection } from "./scaffold-patterns.js";
|
|
14
|
+
import { listTaskRoutingHints } from "./task-routing-hint-registry.js";
|
|
15
|
+
/**
|
|
16
|
+
* Every kind that resolves against a registry of ids.
|
|
17
|
+
*
|
|
18
|
+
* `command` is deliberately absent: the command index lives in the CLI
|
|
19
|
+
* package, ABOVE this layer, so it resolves through the resolver the CLI
|
|
20
|
+
* injects ({@link resolveCommandReference}) — never by shape, and never by a
|
|
21
|
+
* list this layer cannot see. `file` / `directory` / `symbol` / `package` /
|
|
22
|
+
* `url` are not id registries at all.
|
|
23
|
+
*
|
|
24
|
+
* **List order is SPECIFICITY.** A rule and a path convention are knowledge
|
|
25
|
+
* entries filtered by type, so `knowledge` is a SUPERSET of both and must come
|
|
26
|
+
* after them: {@link referenceKindsOf} returns kinds in this order, so its first
|
|
27
|
+
* element names the most specific registry. With `knowledge` listed first,
|
|
28
|
+
* every rule id used to report `knowledge` as "the" kind it resolved as.
|
|
29
|
+
*
|
|
30
|
+
* **Every kind here is DECLARABLE** (round 12): `REFERENCE_KIND_DECLARATIONS`
|
|
31
|
+
* is a `Record<IdReferenceKind, …>`, so a kind added here without a row saying
|
|
32
|
+
* how its ids come to exist is a compile error, and the r76 declarability lock
|
|
33
|
+
* proves every path in that row fills this resolver. `workspace-profile` is
|
|
34
|
+
* the builtin WorkspaceProfile vocabulary — the applicability filters'
|
|
35
|
+
* `profileIds` resolve against it (they were bound to `migration-profile`, a
|
|
36
|
+
* readiness registry, and sat at NOT VERIFIED forever).
|
|
37
|
+
*/
|
|
38
|
+
export const ALL_ID_REFERENCE_KINDS = [
|
|
39
|
+
'template',
|
|
40
|
+
'pipeline',
|
|
41
|
+
'playbook',
|
|
42
|
+
'policy',
|
|
43
|
+
'construct',
|
|
44
|
+
'helper',
|
|
45
|
+
'boundary-rule',
|
|
46
|
+
'path-convention',
|
|
47
|
+
'rule',
|
|
48
|
+
'knowledge',
|
|
49
|
+
'decision',
|
|
50
|
+
'convention',
|
|
51
|
+
'contract-template',
|
|
52
|
+
'migration-profile',
|
|
53
|
+
'workspace-profile',
|
|
54
|
+
'routing-hint',
|
|
55
|
+
'registration-hint',
|
|
56
|
+
'scaffold-pattern',
|
|
57
|
+
];
|
|
58
|
+
function listIds(reg) {
|
|
59
|
+
if (!reg || typeof reg.list !== 'function')
|
|
60
|
+
return [];
|
|
61
|
+
return (reg.list() ?? []).map((r) => r.id);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Kinds whose ids only exist after an ASYNC load.
|
|
65
|
+
*
|
|
66
|
+
* The resolver is synchronous — a doc linter walks lines, and a lookup set is
|
|
67
|
+
* built once — so these are read from a snapshot that {@link
|
|
68
|
+
* warmReferenceRegistries} fills. An unwarmed snapshot is empty, which reads as
|
|
69
|
+
* "no such id" for every id; {@link emptyReferenceKinds} is the safety net for
|
|
70
|
+
* when a caller forgets.
|
|
71
|
+
*/
|
|
72
|
+
const CACHE_BACKED_KINDS = [
|
|
73
|
+
'playbook',
|
|
74
|
+
'construct',
|
|
75
|
+
'policy',
|
|
76
|
+
'helper',
|
|
77
|
+
'convention',
|
|
78
|
+
'contract-template',
|
|
79
|
+
'migration-profile',
|
|
80
|
+
'routing-hint',
|
|
81
|
+
'registration-hint',
|
|
82
|
+
'scaffold-pattern',
|
|
83
|
+
// TS decisions (`sharkcraft/decisions.ts`, pack `decisionFiles`) reach the
|
|
84
|
+
// sync `listDecisions` only after the warm loads them, so an unwarmed lookup
|
|
85
|
+
// of a declared decision reads "missing" — a cache-backed kind, covered by
|
|
86
|
+
// the same "could not look" safety net (round 12 review, R12-DOC-5).
|
|
87
|
+
'decision',
|
|
88
|
+
];
|
|
89
|
+
/** Snapshot of the async-loaded kinds, per project root. */
|
|
90
|
+
const ASYNC_IDS = new Map();
|
|
91
|
+
/**
|
|
92
|
+
* The injected command resolver, per inspection OBJECT.
|
|
93
|
+
*
|
|
94
|
+
* Keyed by the inspection rather than the project root so a resolver injected
|
|
95
|
+
* for one run can never leak into an unrelated inspection of the same root —
|
|
96
|
+
* an engine call that was never given one must stay `Unverifiable`. A later
|
|
97
|
+
* warm WITHOUT a resolver (an inner engine call re-warming the same
|
|
98
|
+
* inspection) keeps the one already injected.
|
|
99
|
+
*/
|
|
100
|
+
const COMMAND_RESOLVERS = new WeakMap();
|
|
101
|
+
/** The command-REFERENCE reading: a bare command-word head names a shrk verb. */
|
|
102
|
+
const SHRK_COMMAND_REFERENCE = Object.freeze({ assumeShrk: true });
|
|
103
|
+
/** The loud-skip message every consumer prints for an un-injected command index. */
|
|
104
|
+
export const COMMAND_INDEX_NOT_INJECTED = 'command index not injected — NOT VERIFIED';
|
|
105
|
+
async function safeIds(load) {
|
|
106
|
+
try {
|
|
107
|
+
return await load();
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
// A registry that will not load is its OWN surface's problem to report.
|
|
111
|
+
// Resolution must degrade to "no candidates", never to a crash — but never
|
|
112
|
+
// silently to "your id is wrong" either, which is what the empty-kind guard
|
|
113
|
+
// is for.
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Populate the snapshot the synchronous accessors read.
|
|
119
|
+
*
|
|
120
|
+
* Call this once, from the async layer that owns the inspection, before
|
|
121
|
+
* resolving anything. Without it a correct playbook — or convention, or
|
|
122
|
+
* scaffold pattern — resolves to nothing, which is exactly how a correct id got
|
|
123
|
+
* reported as an error twice.
|
|
124
|
+
*
|
|
125
|
+
* `options.commandResolver` is the CLI's command-string resolver (the command
|
|
126
|
+
* index lives above this layer). Without one, every `command` reference is
|
|
127
|
+
* `Unverifiable` — see {@link resolveCommandReference}.
|
|
128
|
+
*/
|
|
129
|
+
export async function warmReferenceRegistries(inspection, options = {}) {
|
|
130
|
+
if (options.commandResolver)
|
|
131
|
+
COMMAND_RESOLVERS.set(inspection, options.commandResolver);
|
|
132
|
+
await Promise.all([
|
|
133
|
+
warmPlaybookCache(inspection),
|
|
134
|
+
warmConstructCache(inspection),
|
|
135
|
+
warmPolicyCache(inspection),
|
|
136
|
+
// TS decisions (`sharkcraft/decisions.ts`, pack `decisionFiles`) reach the
|
|
137
|
+
// sync `listDecisions` only through this cache. Unwarmed, a declared
|
|
138
|
+
// decision resolved as nothing — the r76 declarability lock found it.
|
|
139
|
+
loadTsDecisions(inspection).catch(() => []),
|
|
140
|
+
]);
|
|
141
|
+
const [packHelpers, conventions, contractTemplates, migrationProfiles, routingHints, registrationHints, scaffoldPatterns,] = await Promise.all([
|
|
142
|
+
// THE helper catalog — the same list `shrk helper list` prints.
|
|
143
|
+
safeIds(async () => (await listAllHelpers(inspection)).entries.map((h) => h.id)),
|
|
144
|
+
safeIds(async () => (await listConventions(inspection)).map((e) => e.convention.id)),
|
|
145
|
+
safeIds(async () => (await loadAllContractTemplates(inspection)).entries.map((e) => e.template.id)),
|
|
146
|
+
safeIds(async () => (await listMigrationProfilesFromPacks(inspection)).map((p) => p.id)),
|
|
147
|
+
safeIds(async () => (await listTaskRoutingHints(inspection)).map((e) => e.hint.id)),
|
|
148
|
+
safeIds(async () => (await listRegistrationHints(inspection)).map((e) => e.hint.id)),
|
|
149
|
+
safeIds(async () => (await loadScaffoldPatternsFromInspection(inspection)).patterns.map((e) => e.pattern.id)),
|
|
150
|
+
]);
|
|
151
|
+
ASYNC_IDS.set(inspection.projectRoot, new Map([
|
|
152
|
+
// Built-ins ∪ pack/local helpers, from the one catalog `helper
|
|
153
|
+
// list|get|plan` read — so list ≡ resolve by construction. (The doc
|
|
154
|
+
// resolver used to see only the built-ins while the doctor saw both,
|
|
155
|
+
// and `helper get` saw neither.)
|
|
156
|
+
['helper', packHelpers],
|
|
157
|
+
['convention', conventions],
|
|
158
|
+
['contract-template', contractTemplates],
|
|
159
|
+
['migration-profile', migrationProfiles],
|
|
160
|
+
['routing-hint', routingHints],
|
|
161
|
+
['registration-hint', registrationHints],
|
|
162
|
+
['scaffold-pattern', scaffoldPatterns],
|
|
163
|
+
]));
|
|
164
|
+
}
|
|
165
|
+
function asyncIds(inspection, kind) {
|
|
166
|
+
return ASYNC_IDS.get(inspection.projectRoot)?.get(kind) ?? [];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Every registered id of `kind`, for existence checks and for suggesting what
|
|
170
|
+
* an unresolved token might have meant.
|
|
171
|
+
*
|
|
172
|
+
* **The invariant:** each kind reads the SAME source its `list` verb reads.
|
|
173
|
+
* `template` goes through `templateRegistry` because that is what `shrk
|
|
174
|
+
* templates list` prints — not the `templates` array it happens to be built
|
|
175
|
+
* from today, which would agree only until someone filters one of them.
|
|
176
|
+
*/
|
|
177
|
+
export function referenceIdsFor(inspection, kind) {
|
|
178
|
+
switch (kind) {
|
|
179
|
+
case 'template':
|
|
180
|
+
return listIds(inspection.templateRegistry);
|
|
181
|
+
case 'pipeline':
|
|
182
|
+
return listIds(inspection.pipelineRegistry);
|
|
183
|
+
case 'rule':
|
|
184
|
+
return listIds(inspection.ruleService);
|
|
185
|
+
case 'boundary-rule':
|
|
186
|
+
return listIds(inspection.boundaryRegistry);
|
|
187
|
+
case 'path-convention':
|
|
188
|
+
return listIds(inspection.pathService);
|
|
189
|
+
case 'knowledge':
|
|
190
|
+
return inspection.knowledgeEntries.map((k) => k.id);
|
|
191
|
+
case 'decision':
|
|
192
|
+
try {
|
|
193
|
+
return listDecisions(inspection).map((d) => d.id);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
198
|
+
case 'playbook':
|
|
199
|
+
return listPlaybooks(inspection).map((p) => p.id);
|
|
200
|
+
case 'construct':
|
|
201
|
+
return listConstructs(inspection).map((c) => c.id);
|
|
202
|
+
case 'policy':
|
|
203
|
+
// Declarations only — `evaluatePolicy` is the one that RUNS them.
|
|
204
|
+
return listPolicyIds(inspection);
|
|
205
|
+
case 'workspace-profile':
|
|
206
|
+
// THE builtin WorkspaceProfile vocabulary — the same function `shrk
|
|
207
|
+
// profiles list --kind workspace` prints, so list ≡ resolve by
|
|
208
|
+
// construction. Sync and never empty: it can never loud-skip.
|
|
209
|
+
return listWorkspaceProfileEntries(inspection).map((e) => e.id);
|
|
210
|
+
case 'helper':
|
|
211
|
+
case 'convention':
|
|
212
|
+
case 'contract-template':
|
|
213
|
+
case 'migration-profile':
|
|
214
|
+
case 'routing-hint':
|
|
215
|
+
case 'registration-hint':
|
|
216
|
+
case 'scaffold-pattern':
|
|
217
|
+
return asyncIds(inspection, kind);
|
|
218
|
+
case 'command':
|
|
219
|
+
// The command index lives in the CLI package, ABOVE this layer, so it
|
|
220
|
+
// cannot be listed here. Existence goes through the injected resolver
|
|
221
|
+
// (`resolveCommandReference`) — never through a list this layer cannot
|
|
222
|
+
// see, and never through the shape of the string.
|
|
223
|
+
return [];
|
|
224
|
+
default:
|
|
225
|
+
// `file` / `directory` / `symbol` / `package` / `url` are not id
|
|
226
|
+
// registries; they resolve against the filesystem or not at all.
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Kinds among `kinds` whose registry is EMPTY in this repo.
|
|
232
|
+
*
|
|
233
|
+
* This is the generalisation of the bug that prompted it: resolving against an
|
|
234
|
+
* empty registry cannot succeed, so every id checked against it is reported
|
|
235
|
+
* wrong — a gate confidently flagging CORRECT usage, which is the fastest way
|
|
236
|
+
* to get a gate switched off. Emptiness is repo-dependent (a project may simply
|
|
237
|
+
* have no playbooks), so it cannot be a config-time error; the caller surfaces
|
|
238
|
+
* it as a loud refusal at run time instead.
|
|
239
|
+
*
|
|
240
|
+
* `command` has no list; it can resolve exactly when a resolver was injected.
|
|
241
|
+
* Without one it is reported here — nothing could resolve, so every command
|
|
242
|
+
* would be reported wrong (or, before round 11, every `shrk …` string right).
|
|
243
|
+
*/
|
|
244
|
+
export function emptyReferenceKinds(inspection, kinds) {
|
|
245
|
+
return kinds.filter((kind) => kind === 'command'
|
|
246
|
+
? !hasCommandResolver(inspection)
|
|
247
|
+
: referenceIdsFor(inspection, kind).length === 0);
|
|
248
|
+
}
|
|
249
|
+
/** True when the CLI injected its command resolver for this inspection. */
|
|
250
|
+
export function hasCommandResolver(inspection) {
|
|
251
|
+
return COMMAND_RESOLVERS.has(inspection);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* True once {@link warmReferenceRegistries} ran for this inspection's root.
|
|
255
|
+
*
|
|
256
|
+
* The cache-backed kinds read EMPTY until then, so a consumer that resolves
|
|
257
|
+
* them (a test runner checking `expectedPlaybooks`) can report "could not look"
|
|
258
|
+
* instead of "your correct id does not exist".
|
|
259
|
+
*/
|
|
260
|
+
export function isReferenceCacheWarm(inspection) {
|
|
261
|
+
return ASYNC_IDS.has(inspection.projectRoot);
|
|
262
|
+
}
|
|
263
|
+
/** Ok / PrefixOnly / NotShrk: the string resolves (or is not ours to judge). */
|
|
264
|
+
export function isCommandResolved(resolution) {
|
|
265
|
+
return (resolution.status === CommandResolutionStatus.Ok ||
|
|
266
|
+
resolution.status === CommandResolutionStatus.PrefixOnly ||
|
|
267
|
+
resolution.status === CommandResolutionStatus.NotShrk);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* THE function every consumer calls to resolve a command string: knowledge
|
|
271
|
+
* `command` references and anchors, the self-config doctor's command probes,
|
|
272
|
+
* agent-test `expectedCommands`, the query resolver.
|
|
273
|
+
*
|
|
274
|
+
* The command index lives in the CLI, above this layer, so the answer comes
|
|
275
|
+
* from the resolver the CLI injected via `warmReferenceRegistries(inspection,
|
|
276
|
+
* { commandResolver })`. Without one the answer is `Unverified` — the string
|
|
277
|
+
* was NOT checked. It used to be `id.startsWith('shrk ')`, which certified
|
|
278
|
+
* every `shrk …` string (including three dead ones in shrk's own knowledge) as
|
|
279
|
+
* a real command, forever.
|
|
280
|
+
*/
|
|
281
|
+
export function resolveCommandReference(inspection, raw, options = {}) {
|
|
282
|
+
const resolver = COMMAND_RESOLVERS.get(inspection);
|
|
283
|
+
if (!resolver) {
|
|
284
|
+
return { status: CommandResolutionStatus.Unverified, reason: COMMAND_INDEX_NOT_INJECTED };
|
|
285
|
+
}
|
|
286
|
+
return resolver(raw, options);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* THE reading of a `command` REFERENCE — a knowledge `command` reference or
|
|
290
|
+
* anchor, an agent test's `expectedCommands`, the `command` reference kind.
|
|
291
|
+
*
|
|
292
|
+
* Such a string names a shrk command, so a bare form is read as one: `doctor`
|
|
293
|
+
* resolves, `frobnicate` is an unknown verb (see {@link ICommandResolveOptions}).
|
|
294
|
+
* knowledge-stale, the self-config doctor's reference probes and the agent-test
|
|
295
|
+
* runner all call THIS — they used to normalise the same string three ways
|
|
296
|
+
* (`frobnicate` was `ok` in one, `not-shrk` in another and `unknown-verb` in
|
|
297
|
+
* the third). Free shell text (a playbook step) goes through
|
|
298
|
+
* {@link resolveCommandReference} without the assumption.
|
|
299
|
+
*/
|
|
300
|
+
export function resolveShrkCommandReference(inspection, command) {
|
|
301
|
+
return resolveCommandReference(inspection, command, SHRK_COMMAND_REFERENCE);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Tri-state existence: `Exists` / `Missing` / `Unverifiable`.
|
|
305
|
+
*
|
|
306
|
+
* For `command`: Ok, PrefixOnly and NotShrk are `Exists`; every Unknown* is
|
|
307
|
+
* `Missing`; no injected resolver is `Unverifiable` (report it as NOT VERIFIED,
|
|
308
|
+
* never as Ok). Read as a command REFERENCE ({@link resolveShrkCommandReference}).
|
|
309
|
+
* Every other kind is `Exists` / `Missing` against its registry.
|
|
310
|
+
*/
|
|
311
|
+
export function referenceIdStatus(inspection, kind, id) {
|
|
312
|
+
if (kind === 'command') {
|
|
313
|
+
const resolution = resolveShrkCommandReference(inspection, id);
|
|
314
|
+
if (resolution.status === CommandResolutionStatus.Unverified) {
|
|
315
|
+
return ReferenceIdStatus.Unverifiable;
|
|
316
|
+
}
|
|
317
|
+
return isCommandResolved(resolution) ? ReferenceIdStatus.Exists : ReferenceIdStatus.Missing;
|
|
318
|
+
}
|
|
319
|
+
return referenceIdsFor(inspection, kind).includes(id)
|
|
320
|
+
? ReferenceIdStatus.Exists
|
|
321
|
+
: ReferenceIdStatus.Missing;
|
|
322
|
+
}
|
|
323
|
+
/** True when `kind`'s ids come from an async-populated cache. */
|
|
324
|
+
export function isCacheBackedKind(kind) {
|
|
325
|
+
return CACHE_BACKED_KINDS.includes(kind);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Whether `id` is registered under `kind` — `true` only for
|
|
329
|
+
* {@link ReferenceIdStatus.Exists}.
|
|
330
|
+
*
|
|
331
|
+
* For `command` this is `false` when no resolver was injected: an unverifiable
|
|
332
|
+
* command is not an existing one. A caller that must tell "missing" from
|
|
333
|
+
* "could not look" reads {@link referenceIdStatus} instead.
|
|
334
|
+
*/
|
|
335
|
+
export function referenceIdExists(inspection, kind, id) {
|
|
336
|
+
return referenceIdStatus(inspection, kind, id) === ReferenceIdStatus.Exists;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* The union of candidate ids across `kinds`, deduped and sorted.
|
|
340
|
+
*
|
|
341
|
+
* A doc token is checked against several registries at once (a `nge.foo` might
|
|
342
|
+
* be a template OR a playbook), so the suggester needs one pool rather than
|
|
343
|
+
* per-kind lists that would each propose their own nearest miss.
|
|
344
|
+
*/
|
|
345
|
+
export function referenceIdPool(inspection, kinds) {
|
|
346
|
+
const pool = new Set();
|
|
347
|
+
for (const kind of kinds) {
|
|
348
|
+
for (const id of referenceIdsFor(inspection, kind))
|
|
349
|
+
pool.add(id);
|
|
350
|
+
}
|
|
351
|
+
return [...pool].sort();
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Whether `id` is registered under ANY kind.
|
|
355
|
+
*
|
|
356
|
+
* For cross-references that do not name a kind — a search-tuning entry boosts
|
|
357
|
+
* "some id", a decision record relates to "some id". That union used to be
|
|
358
|
+
* hand-written as a chain of `lookups.x.has(id) || lookups.y.has(id) || …`,
|
|
359
|
+
* which is a list that silently goes stale: it omitted policies, decisions and
|
|
360
|
+
* scaffold patterns, so seven of shrk's own correctly-registered ids were
|
|
361
|
+
* reported unknown. Reading the kind list means adding a kind widens the union
|
|
362
|
+
* automatically.
|
|
363
|
+
*/
|
|
364
|
+
export function referenceIdExistsInAnyKind(inspection, id) {
|
|
365
|
+
return ALL_ID_REFERENCE_KINDS.some((kind) => referenceIdsFor(inspection, kind).includes(id));
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* EVERY kind whose registry lists `id`, most specific first (the order of
|
|
369
|
+
* {@link ALL_ID_REFERENCE_KINDS}) — empty when nothing does.
|
|
370
|
+
*
|
|
371
|
+
* Ids carry no namespace prefix, so one id can legitimately live in several
|
|
372
|
+
* registries: a rule is also a knowledge entry, and a template may share an id
|
|
373
|
+
* with a construct. "Which namespace did this resolve into?" therefore has a
|
|
374
|
+
* LIST as its honest answer; {@link referenceKindOf} is its first element.
|
|
375
|
+
*/
|
|
376
|
+
export function referenceKindsOf(inspection, id) {
|
|
377
|
+
return ALL_ID_REFERENCE_KINDS.filter((kind) => referenceIdsFor(inspection, kind).includes(id));
|
|
378
|
+
}
|
|
379
|
+
/** The most specific kind that accepted `id`, or `undefined` — for "resolved as what?" output. */
|
|
380
|
+
export function referenceKindOf(inspection, id) {
|
|
381
|
+
return referenceKindsOf(inspection, id)[0];
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* One-shot projection of {@link referenceIdsFor} over every kind, for O(1)
|
|
385
|
+
* membership when a caller resolves many ids at once (the declared
|
|
386
|
+
* cross-reference collector walks every asset). Not a second source: each set
|
|
387
|
+
* is built from `referenceIdsFor`, so list ≡ resolve still holds per kind.
|
|
388
|
+
* Snapshot semantics — rebuild it after a warm.
|
|
389
|
+
*/
|
|
390
|
+
export function referenceIdSets(inspection) {
|
|
391
|
+
const out = new Map();
|
|
392
|
+
for (const kind of ALL_ID_REFERENCE_KINDS)
|
|
393
|
+
out.set(kind, new Set(referenceIdsFor(inspection, kind)));
|
|
394
|
+
return out;
|
|
395
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IAssetReference } from '@shrkcrft/core';
|
|
2
|
+
import type { IKnowledgeAnchor } from '@shrkcrft/knowledge';
|
|
3
|
+
import type { ReferenceAssetKind } from './reference-asset-kind.js';
|
|
4
|
+
/**
|
|
5
|
+
* Anything the staleness sweep verifies references for: a knowledge entry, a
|
|
6
|
+
* boundary rule, or a declared policy check. The sweep's per-subject loop is
|
|
7
|
+
* written once against this shape, so every asset kind is checked by the same
|
|
8
|
+
* reference checker — never a second one that drifts.
|
|
9
|
+
*/
|
|
10
|
+
export interface IReferenceSubject {
|
|
11
|
+
readonly assetKind: ReferenceAssetKind;
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** Where it is declared, relative to the project root, when known. */
|
|
14
|
+
readonly source?: string;
|
|
15
|
+
/** Knowledge `type`, for knowledge subjects. */
|
|
16
|
+
readonly type?: string;
|
|
17
|
+
readonly references: readonly IAssetReference[];
|
|
18
|
+
readonly anchors?: readonly IKnowledgeAnchor[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=reference-subject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-subject.d.ts","sourceRoot":"","sources":["../src/reference-subject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a registration hint's discovery found on the live file system — the
|
|
3
|
+
* same answer `registrations preview` acts on.
|
|
4
|
+
*
|
|
5
|
+
* A doctor's "0 issues" used to be read as "every hint verified", while glob
|
|
6
|
+
* discovery was never checked at all: the hints whose author was LEAST sure of
|
|
7
|
+
* the target got the LEAST verification.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum RegistrationHintDiscoveryStatus {
|
|
10
|
+
/** Exactly one target file (a fixed `targetFile` that exists, or a glob matching one file). */
|
|
11
|
+
Verified = "verified",
|
|
12
|
+
/** A glob matched more than one file — preview refuses to guess. */
|
|
13
|
+
Ambiguous = "ambiguous",
|
|
14
|
+
/** No file: a missing fixed target, a glob matching nothing, or no discovery at all. */
|
|
15
|
+
Dead = "dead",
|
|
16
|
+
/** The discovery walk hit its directory cap, so the candidate set is incomplete. */
|
|
17
|
+
Unverified = "unverified",
|
|
18
|
+
/**
|
|
19
|
+
* No file yet, and every selector that matched nothing is marked
|
|
20
|
+
* `{ pattern, expectEmpty: true }` (round 13): the hint targets what the
|
|
21
|
+
* adopting app does not have yet — accepted (printed), never `dead`.
|
|
22
|
+
*/
|
|
23
|
+
IntendedEmpty = "intended-empty"
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=registration-hint-discovery-status.d.ts.map
|