@shrkcrft/inspector 0.1.0-alpha.30 → 0.1.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acceptance-replay.js +1 -1
- package/dist/agent-contract-templates.js +6 -6
- package/dist/agent-contract.d.ts.map +1 -1
- package/dist/agent-contract.js +13 -8
- package/dist/agent-orchestration.js +2 -2
- package/dist/agent-task-prep.d.ts +16 -0
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +60 -5
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +21 -3
- package/dist/architecture-map.d.ts +16 -0
- package/dist/architecture-map.d.ts.map +1 -1
- package/dist/architecture-map.js +42 -26
- package/dist/area-explore.d.ts +2 -2
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +36 -16
- package/dist/area-map.d.ts +56 -11
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +106 -25
- package/dist/asset-doctor-proposed-exit.d.ts +21 -0
- package/dist/asset-doctor-proposed-exit.d.ts.map +1 -0
- package/dist/asset-doctor-proposed-exit.js +22 -0
- package/dist/asset-provenance.js +1 -1
- package/dist/boundaries-changed-only.d.ts +24 -1
- package/dist/boundaries-changed-only.d.ts.map +1 -1
- package/dist/boundaries-changed-only.js +12 -2
- package/dist/boundary-check-options.model.d.ts +40 -0
- package/dist/boundary-check-options.model.d.ts.map +1 -0
- package/dist/boundary-check-options.model.js +1 -0
- package/dist/boundary-check-result.model.d.ts +89 -0
- package/dist/boundary-check-result.model.d.ts.map +1 -0
- package/dist/boundary-check-result.model.js +1 -0
- package/dist/boundary-configuration-status.d.ts +38 -0
- package/dist/boundary-configuration-status.d.ts.map +1 -0
- package/dist/boundary-configuration-status.js +118 -0
- package/dist/boundary-configuration-status.model.d.ts +37 -0
- package/dist/boundary-configuration-status.model.d.ts.map +1 -0
- package/dist/boundary-configuration-status.model.js +1 -0
- package/dist/boundary-load-issue.model.d.ts +30 -0
- package/dist/boundary-load-issue.model.d.ts.map +1 -0
- package/dist/boundary-load-issue.model.js +1 -0
- package/dist/boundary-rule-check.model.d.ts +44 -0
- package/dist/boundary-rule-check.model.d.ts.map +1 -0
- package/dist/boundary-rule-check.model.js +1 -0
- package/dist/boundary-rule-invalidation.model.d.ts +31 -0
- package/dist/boundary-rule-invalidation.model.d.ts.map +1 -0
- package/dist/boundary-rule-invalidation.model.js +1 -0
- package/dist/boundary-rule-set-diff.model.d.ts +75 -0
- package/dist/boundary-rule-set-diff.model.d.ts.map +1 -0
- package/dist/boundary-rule-set-diff.model.js +1 -0
- package/dist/boundary-rule-sources.d.ts +28 -0
- package/dist/boundary-rule-sources.d.ts.map +1 -0
- package/dist/boundary-rule-sources.js +110 -0
- package/dist/boundary-stale-exception-finding.model.d.ts +12 -0
- package/dist/boundary-stale-exception-finding.model.d.ts.map +1 -0
- package/dist/boundary-stale-exception-finding.model.js +1 -0
- package/dist/boundary-unit-liveness.d.ts +35 -0
- package/dist/boundary-unit-liveness.d.ts.map +1 -0
- package/dist/boundary-unit-liveness.js +71 -0
- package/dist/change-intent.d.ts +3 -0
- package/dist/change-intent.d.ts.map +1 -1
- package/dist/change-intent.js +61 -27
- package/dist/changes-summary.d.ts.map +1 -1
- package/dist/changes-summary.js +19 -9
- package/dist/ci-integrity-report.js +1 -1
- package/dist/ci-predict.d.ts.map +1 -1
- package/dist/ci-predict.js +38 -5
- package/dist/code-intelligence-doctor.d.ts +6 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -1
- package/dist/code-intelligence-doctor.js +22 -7
- package/dist/codemod-assist.d.ts.map +1 -1
- package/dist/codemod-assist.js +3 -1
- package/dist/command-recommender.d.ts +45 -2
- package/dist/command-recommender.d.ts.map +1 -1
- package/dist/command-recommender.js +41 -263
- package/dist/command-resolution-status.d.ts +44 -0
- package/dist/command-resolution-status.d.ts.map +1 -0
- package/dist/command-resolution-status.js +44 -0
- package/dist/command-safety-level.d.ts +15 -0
- package/dist/command-safety-level.d.ts.map +1 -0
- package/dist/command-safety-level.js +43 -0
- package/dist/command-taxonomy.js +1 -1
- package/dist/comment-syntax.d.ts +15 -0
- package/dist/comment-syntax.d.ts.map +1 -0
- package/dist/comment-syntax.js +15 -0
- package/dist/compliance-evidence.js +1 -1
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-registry.d.ts +40 -0
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +186 -82
- package/dist/context-tuning.d.ts +4 -0
- package/dist/context-tuning.d.ts.map +1 -1
- package/dist/context-tuning.js +10 -7
- package/dist/contract-template-registry.d.ts +10 -0
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +59 -33
- package/dist/contribution-kind.d.ts +52 -0
- package/dist/contribution-kind.d.ts.map +1 -0
- package/dist/contribution-kind.js +52 -0
- package/dist/contribution-load-failures.d.ts +122 -0
- package/dist/contribution-load-failures.d.ts.map +1 -0
- package/dist/contribution-load-failures.js +592 -0
- package/dist/contributions-report.d.ts +28 -0
- package/dist/contributions-report.d.ts.map +1 -0
- package/dist/contributions-report.js +242 -0
- package/dist/convention-applicability.d.ts +46 -0
- package/dist/convention-applicability.d.ts.map +1 -0
- package/dist/convention-applicability.js +247 -0
- package/dist/convention-filter-level.d.ts +13 -0
- package/dist/convention-filter-level.d.ts.map +1 -0
- package/dist/convention-filter-level.js +13 -0
- package/dist/convention-registry.d.ts +51 -4
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +135 -60
- package/dist/coverage-report.d.ts.map +1 -1
- package/dist/coverage-report.js +6 -6
- package/dist/custom-checks.d.ts +60 -1
- package/dist/custom-checks.d.ts.map +1 -1
- package/dist/custom-checks.js +161 -6
- package/dist/dashboard/dashboard-data.d.ts +6 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -1
- package/dist/dashboard/dashboard-data.js +99 -8
- package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -1
- package/dist/dashboard/dashboard-knowledge.js +14 -2
- package/dist/decision-records.d.ts +24 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +231 -84
- package/dist/declared-cross-references.d.ts +61 -0
- package/dist/declared-cross-references.d.ts.map +1 -0
- package/dist/declared-cross-references.js +550 -0
- package/dist/declared-gate-plane-rules.d.ts +24 -0
- package/dist/declared-gate-plane-rules.d.ts.map +1 -0
- package/dist/declared-gate-plane-rules.js +39 -0
- package/dist/declared-reference-coverage.d.ts +27 -0
- package/dist/declared-reference-coverage.d.ts.map +1 -0
- package/dist/declared-reference-coverage.js +55 -0
- package/dist/declared-xref-status.d.ts +19 -0
- package/dist/declared-xref-status.d.ts.map +1 -0
- package/dist/declared-xref-status.js +19 -0
- package/dist/delegate-pack-recipes.d.ts +13 -2
- package/dist/delegate-pack-recipes.d.ts.map +1 -1
- package/dist/delegate-pack-recipes.js +45 -14
- package/dist/demo-package.js +2 -2
- package/dist/demo-script.js +2 -2
- package/dist/demo-workflow.js +3 -3
- package/dist/dev-cycle.js +1 -1
- package/dist/dev-session.js +1 -1
- package/dist/doc-references.d.ts +23 -2
- package/dist/doc-references.d.ts.map +1 -1
- package/dist/doc-references.js +96 -17
- package/dist/doctor-result.d.ts +8 -0
- package/dist/doctor-result.d.ts.map +1 -1
- package/dist/doctor-verdict-kind.d.ts +19 -0
- package/dist/doctor-verdict-kind.d.ts.map +1 -0
- package/dist/doctor-verdict-kind.js +19 -0
- package/dist/doctor-verdict.d.ts +18 -0
- package/dist/doctor-verdict.d.ts.map +1 -0
- package/dist/doctor-verdict.js +28 -0
- package/dist/drift.d.ts +17 -0
- package/dist/drift.d.ts.map +1 -1
- package/dist/drift.js +40 -10
- package/dist/entrypoint-matrix.d.ts.map +1 -1
- package/dist/entrypoint-matrix.js +4 -1
- package/dist/feedback-ingestion.d.ts +28 -2
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +75 -20
- package/dist/file-languages.d.ts +9 -0
- package/dist/file-languages.d.ts.map +1 -0
- package/dist/file-languages.js +91 -0
- package/dist/fix-preview.d.ts.map +1 -1
- package/dist/fix-preview.js +87 -22
- package/dist/framework-extractor-outcomes.d.ts +27 -0
- package/dist/framework-extractor-outcomes.d.ts.map +1 -0
- package/dist/framework-extractor-outcomes.js +83 -0
- package/dist/fuzzy-impact.d.ts.map +1 -1
- package/dist/fuzzy-impact.js +3 -2
- package/dist/git-helpers.d.ts +29 -4
- package/dist/git-helpers.d.ts.map +1 -1
- package/dist/git-helpers.js +69 -10
- package/dist/healing-plan.d.ts.map +1 -1
- package/dist/healing-plan.js +3 -4
- package/dist/helper-catalog.d.ts +25 -0
- package/dist/helper-catalog.d.ts.map +1 -0
- package/dist/helper-catalog.js +91 -0
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +17 -1
- package/dist/helper-view.d.ts +33 -0
- package/dist/helper-view.d.ts.map +1 -0
- package/dist/helper-view.js +1 -0
- package/dist/i-asset-doctor-flags.d.ts +16 -0
- package/dist/i-asset-doctor-flags.d.ts.map +1 -0
- package/dist/i-asset-doctor-flags.js +1 -0
- package/dist/i-command-resolution.d.ts +22 -0
- package/dist/i-command-resolution.d.ts.map +1 -0
- package/dist/i-command-resolution.js +1 -0
- package/dist/i-command-resolve-options.d.ts +24 -0
- package/dist/i-command-resolve-options.d.ts.map +1 -0
- package/dist/i-command-resolve-options.js +1 -0
- package/dist/i-command-safety.d.ts +13 -0
- package/dist/i-command-safety.d.ts.map +1 -0
- package/dist/i-command-safety.js +1 -0
- package/dist/i-contribution-accepted-entry.d.ts +18 -0
- package/dist/i-contribution-accepted-entry.d.ts.map +1 -0
- package/dist/i-contribution-accepted-entry.js +1 -0
- package/dist/i-contribution-entry-rejection.d.ts +21 -0
- package/dist/i-contribution-entry-rejection.d.ts.map +1 -0
- package/dist/i-contribution-entry-rejection.js +1 -0
- package/dist/i-contribution-file-issue.d.ts +18 -0
- package/dist/i-contribution-file-issue.d.ts.map +1 -0
- package/dist/i-contribution-file-issue.js +1 -0
- package/dist/i-contribution-file-report.d.ts +40 -0
- package/dist/i-contribution-file-report.d.ts.map +1 -0
- package/dist/i-contribution-file-report.js +1 -0
- package/dist/i-contribution-file-validation.d.ts +32 -0
- package/dist/i-contribution-file-validation.d.ts.map +1 -0
- package/dist/i-contribution-file-validation.js +1 -0
- package/dist/i-contributions-report.d.ts +31 -0
- package/dist/i-contributions-report.d.ts.map +1 -0
- package/dist/i-contributions-report.js +1 -0
- package/dist/i-convention-applicability-reason.d.ts +29 -0
- package/dist/i-convention-applicability-reason.d.ts.map +1 -0
- package/dist/i-convention-applicability-reason.js +1 -0
- package/dist/i-convention-applicability.d.ts +9 -0
- package/dist/i-convention-applicability.d.ts.map +1 -0
- package/dist/i-convention-applicability.js +1 -0
- package/dist/i-convention-scope.d.ts +19 -0
- package/dist/i-convention-scope.d.ts.map +1 -0
- package/dist/i-convention-scope.js +1 -0
- package/dist/i-declared-xref-field.d.ts +25 -0
- package/dist/i-declared-xref-field.d.ts.map +1 -0
- package/dist/i-declared-xref-field.js +1 -0
- package/dist/i-declared-xref-issue.d.ts +25 -0
- package/dist/i-declared-xref-issue.d.ts.map +1 -0
- package/dist/i-declared-xref-issue.js +1 -0
- package/dist/i-declared-xref-report.d.ts +48 -0
- package/dist/i-declared-xref-report.d.ts.map +1 -0
- package/dist/i-declared-xref-report.js +1 -0
- package/dist/i-declared-xref-row.d.ts +29 -0
- package/dist/i-declared-xref-row.d.ts.map +1 -0
- package/dist/i-declared-xref-row.js +1 -0
- package/dist/i-doctor-verdict.d.ts +10 -0
- package/dist/i-doctor-verdict.d.ts.map +1 -0
- package/dist/i-doctor-verdict.js +1 -0
- package/dist/i-file-language.d.ts +11 -0
- package/dist/i-file-language.d.ts.map +1 -0
- package/dist/i-file-language.js +1 -0
- package/dist/i-kind-outcomes.d.ts +13 -0
- package/dist/i-kind-outcomes.d.ts.map +1 -0
- package/dist/i-kind-outcomes.js +1 -0
- package/dist/i-not-applicable-convention.d.ts +17 -0
- package/dist/i-not-applicable-convention.d.ts.map +1 -0
- package/dist/i-not-applicable-convention.js +1 -0
- package/dist/i-pack-doctor-verdict.d.ts +15 -0
- package/dist/i-pack-doctor-verdict.d.ts.map +1 -0
- package/dist/i-pack-doctor-verdict.js +1 -0
- package/dist/i-probed-id-field.d.ts +17 -0
- package/dist/i-probed-id-field.d.ts.map +1 -0
- package/dist/i-probed-id-field.js +1 -0
- package/dist/i-reference-kind-declaration.d.ts +38 -0
- package/dist/i-reference-kind-declaration.d.ts.map +1 -0
- package/dist/i-reference-kind-declaration.js +1 -0
- package/dist/i-reference-pack-origin.d.ts +13 -0
- package/dist/i-reference-pack-origin.d.ts.map +1 -0
- package/dist/i-reference-pack-origin.js +1 -0
- package/dist/i-reference-warm-options.d.ts +21 -0
- package/dist/i-reference-warm-options.d.ts.map +1 -0
- package/dist/i-reference-warm-options.js +1 -0
- package/dist/i-registry-outcomes.d.ts +16 -0
- package/dist/i-registry-outcomes.d.ts.map +1 -0
- package/dist/i-registry-outcomes.js +1 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts +35 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/i-scaffold-pattern-doctor-report.js +1 -0
- package/dist/i-search-tuning-key-probe.d.ts +30 -0
- package/dist/i-search-tuning-key-probe.d.ts.map +1 -0
- package/dist/i-search-tuning-key-probe.js +1 -0
- package/dist/i-search-tuning-lint-issue.d.ts +61 -0
- package/dist/i-search-tuning-lint-issue.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-issue.js +1 -0
- package/dist/i-search-tuning-lint-report.d.ts +38 -0
- package/dist/i-search-tuning-lint-report.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-report.js +1 -0
- package/dist/i-stale-path-hint-input.d.ts +18 -0
- package/dist/i-stale-path-hint-input.d.ts.map +1 -0
- package/dist/i-stale-path-hint-input.js +1 -0
- package/dist/i-unresolvable-reference-scan.d.ts +14 -0
- package/dist/i-unresolvable-reference-scan.d.ts.map +1 -0
- package/dist/i-unresolvable-reference-scan.js +1 -0
- package/dist/i-unresolvable-reference.d.ts +29 -0
- package/dist/i-unresolvable-reference.d.ts.map +1 -0
- package/dist/i-unresolvable-reference.js +1 -0
- package/dist/i-unverifiable-remedy-group.d.ts +10 -0
- package/dist/i-unverifiable-remedy-group.d.ts.map +1 -0
- package/dist/i-unverifiable-remedy-group.js +1 -0
- package/dist/i-workspace-profile-payload.d.ts +12 -0
- package/dist/i-workspace-profile-payload.d.ts.map +1 -0
- package/dist/i-workspace-profile-payload.js +1 -0
- package/dist/impact-analysis.d.ts +15 -0
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +58 -13
- package/dist/impact-render.d.ts.map +1 -1
- package/dist/impact-render.js +22 -0
- package/dist/import-hygiene.d.ts +35 -1
- package/dist/import-hygiene.d.ts.map +1 -1
- package/dist/import-hygiene.js +107 -13
- package/dist/index.d.ts +158 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +197 -0
- package/dist/inspection-discovery.d.ts +45 -0
- package/dist/inspection-discovery.d.ts.map +1 -0
- package/dist/inspection-discovery.js +70 -0
- package/dist/knowledge-advisory-code.d.ts +17 -0
- package/dist/knowledge-advisory-code.d.ts.map +1 -0
- package/dist/knowledge-advisory-code.js +17 -0
- package/dist/knowledge-aged-entry.d.ts +10 -0
- package/dist/knowledge-aged-entry.d.ts.map +1 -0
- package/dist/knowledge-aged-entry.js +1 -0
- package/dist/knowledge-authoring.d.ts +25 -2
- package/dist/knowledge-authoring.d.ts.map +1 -1
- package/dist/knowledge-authoring.js +53 -13
- package/dist/knowledge-contribution-slots.d.ts +18 -0
- package/dist/knowledge-contribution-slots.d.ts.map +1 -0
- package/dist/knowledge-contribution-slots.js +25 -0
- package/dist/knowledge-entry-rejections.d.ts +17 -0
- package/dist/knowledge-entry-rejections.d.ts.map +1 -0
- package/dist/knowledge-entry-rejections.js +79 -0
- package/dist/knowledge-entry-verdict-record.d.ts +34 -0
- package/dist/knowledge-entry-verdict-record.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict-record.js +1 -0
- package/dist/knowledge-entry-verdict.d.ts +17 -0
- package/dist/knowledge-entry-verdict.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict.js +17 -0
- package/dist/knowledge-graph.d.ts +6 -0
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +18 -7
- package/dist/knowledge-kind-bucket.d.ts +19 -0
- package/dist/knowledge-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-kind-bucket.js +1 -0
- package/dist/knowledge-load-failure.d.ts +23 -0
- package/dist/knowledge-load-failure.d.ts.map +1 -0
- package/dist/knowledge-load-failure.js +1 -0
- package/dist/knowledge-min-referenced-valve.d.ts +12 -0
- package/dist/knowledge-min-referenced-valve.d.ts.map +1 -0
- package/dist/knowledge-min-referenced-valve.js +12 -0
- package/dist/knowledge-reference-kind-bucket.d.ts +11 -0
- package/dist/knowledge-reference-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-reference-kind-bucket.js +1 -0
- package/dist/knowledge-rejected-entry.d.ts +28 -0
- package/dist/knowledge-rejected-entry.d.ts.map +1 -0
- package/dist/knowledge-rejected-entry.js +1 -0
- package/dist/knowledge-rename-command.d.ts +20 -0
- package/dist/knowledge-rename-command.d.ts.map +1 -0
- package/dist/knowledge-rename-command.js +34 -0
- package/dist/knowledge-rename-verb.d.ts +11 -0
- package/dist/knowledge-rename-verb.d.ts.map +1 -0
- package/dist/knowledge-rename-verb.js +11 -0
- package/dist/knowledge-rename.d.ts +1 -1
- package/dist/knowledge-rename.d.ts.map +1 -1
- package/dist/knowledge-rename.js +6 -5
- package/dist/knowledge-stale-advisory.d.ts +14 -0
- package/dist/knowledge-stale-advisory.d.ts.map +1 -0
- package/dist/knowledge-stale-advisory.js +1 -0
- package/dist/knowledge-stale-coverage.d.ts +19 -0
- package/dist/knowledge-stale-coverage.d.ts.map +1 -0
- package/dist/knowledge-stale-coverage.js +1 -0
- package/dist/knowledge-stale-gate-flags.d.ts +33 -0
- package/dist/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge-stale-gate-input.d.ts +46 -0
- package/dist/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge-stale-gate-result.d.ts +33 -0
- package/dist/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge-stale-gate-rule.d.ts +33 -0
- package/dist/knowledge-stale-gate-rule.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-rule.js +1 -0
- package/dist/knowledge-stale-gate-violation.d.ts +13 -0
- package/dist/knowledge-stale-gate-violation.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-violation.js +1 -0
- package/dist/knowledge-stale-gate.d.ts +85 -0
- package/dist/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-gate.js +501 -0
- package/dist/knowledge-stale-quality-gate.d.ts +26 -0
- package/dist/knowledge-stale-quality-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-quality-gate.js +140 -0
- package/dist/knowledge-stale.d.ts +132 -9
- package/dist/knowledge-stale.d.ts.map +1 -1
- package/dist/knowledge-stale.js +1193 -294
- package/dist/knowledge-unverifiable-reason.d.ts +12 -0
- package/dist/knowledge-unverifiable-reason.d.ts.map +1 -0
- package/dist/knowledge-unverifiable-reason.js +12 -0
- package/dist/knowledge-unverifiable-remedy.d.ts +56 -0
- package/dist/knowledge-unverifiable-remedy.d.ts.map +1 -0
- package/dist/knowledge-unverifiable-remedy.js +0 -0
- package/dist/loader-diagnostics.d.ts +14 -2
- package/dist/loader-diagnostics.d.ts.map +1 -1
- package/dist/match-terms.d.ts +48 -0
- package/dist/match-terms.d.ts.map +1 -0
- package/dist/match-terms.js +155 -0
- package/dist/migration-profile-registry.d.ts +10 -0
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +57 -34
- package/dist/migration-readiness.d.ts.map +1 -1
- package/dist/migration-readiness.js +1 -3
- package/dist/nearest-id.d.ts +10 -26
- package/dist/nearest-id.d.ts.map +1 -1
- package/dist/nearest-id.js +9 -59
- package/dist/pack-asset-freshness.d.ts +65 -0
- package/dist/pack-asset-freshness.d.ts.map +1 -0
- package/dist/pack-asset-freshness.js +340 -0
- package/dist/pack-author-ux.d.ts +24 -3
- package/dist/pack-author-ux.d.ts.map +1 -1
- package/dist/pack-author-ux.js +87 -93
- package/dist/pack-contributions-inventory.d.ts +79 -39
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +445 -286
- package/dist/pack-doctor-verdict.d.ts +29 -0
- package/dist/pack-doctor-verdict.d.ts.map +1 -0
- package/dist/pack-doctor-verdict.js +45 -0
- package/dist/pack-doctor.d.ts +74 -1
- package/dist/pack-doctor.d.ts.map +1 -1
- package/dist/pack-doctor.js +281 -1
- package/dist/pack-helper-plan.d.ts +24 -0
- package/dist/pack-helper-plan.d.ts.map +1 -0
- package/dist/pack-helper-plan.js +77 -0
- package/dist/pack-helper-registry.d.ts +14 -0
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +76 -37
- package/dist/pack-manifest-reader.d.ts +8 -0
- package/dist/pack-manifest-reader.d.ts.map +1 -0
- package/dist/pack-manifest-reader.js +79 -0
- package/dist/pack-release-check.d.ts +14 -1
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +23 -1
- package/dist/pack-signature-status.d.ts +18 -6
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +59 -105
- package/dist/pack-test-runner.d.ts +27 -5
- package/dist/pack-test-runner.d.ts.map +1 -1
- package/dist/pack-test-runner.js +91 -35
- package/dist/pack-typecheck.d.ts +8 -0
- package/dist/pack-typecheck.d.ts.map +1 -0
- package/dist/pack-typecheck.js +76 -0
- package/dist/plan-review.d.ts +2 -0
- package/dist/plan-review.d.ts.map +1 -1
- package/dist/plan-review.js +17 -5
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +16 -5
- package/dist/playbook-load-issue.d.ts +16 -0
- package/dist/playbook-load-issue.d.ts.map +1 -0
- package/dist/playbook-load-issue.js +1 -0
- package/dist/playbook-registry.d.ts +32 -1
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +144 -55
- package/dist/policy-declaration.d.ts +18 -0
- package/dist/policy-declaration.d.ts.map +1 -0
- package/dist/policy-declaration.js +1 -0
- package/dist/policy-engine.d.ts +8 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +26 -9
- package/dist/policy-overrides.d.ts.map +1 -1
- package/dist/policy-overrides.js +4 -4
- package/dist/policy-registry.d.ts +27 -0
- package/dist/policy-registry.d.ts.map +1 -1
- package/dist/policy-registry.js +87 -20
- package/dist/probed-id-fields.d.ts +21 -0
- package/dist/probed-id-fields.d.ts.map +1 -0
- package/dist/probed-id-fields.js +25 -0
- package/dist/probed-id-source.d.ts +11 -0
- package/dist/probed-id-source.d.ts.map +1 -0
- package/dist/probed-id-source.js +11 -0
- package/dist/profile-registry.d.ts +25 -2
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +59 -6
- package/dist/propose-knowledge.js +3 -2
- package/dist/quality-gate-examination.d.ts +15 -0
- package/dist/quality-gate-examination.d.ts.map +1 -0
- package/dist/quality-gate-examination.js +15 -0
- package/dist/quality-gate-row-status.d.ts +19 -0
- package/dist/quality-gate-row-status.d.ts.map +1 -0
- package/dist/quality-gate-row-status.js +28 -0
- package/dist/quality-gate-status.d.ts +16 -0
- package/dist/quality-gate-status.d.ts.map +1 -0
- package/dist/quality-gate-status.js +16 -0
- package/dist/quality-html.d.ts.map +1 -1
- package/dist/quality-html.js +14 -3
- package/dist/quality-report-coverage.d.ts +26 -0
- package/dist/quality-report-coverage.d.ts.map +1 -0
- package/dist/quality-report-coverage.js +48 -0
- package/dist/quality-report.d.ts +28 -1
- package/dist/quality-report.d.ts.map +1 -1
- package/dist/quality-report.js +263 -35
- package/dist/query-intent-kind.d.ts +18 -0
- package/dist/query-intent-kind.d.ts.map +1 -0
- package/dist/query-intent-kind.js +18 -0
- package/dist/query-intent-result.d.ts +23 -0
- package/dist/query-intent-result.d.ts.map +1 -0
- package/dist/query-intent-result.js +1 -0
- package/dist/query-intent.d.ts +18 -0
- package/dist/query-intent.d.ts.map +1 -0
- package/dist/query-intent.js +336 -0
- package/dist/query-resolver.d.ts +18 -0
- package/dist/query-resolver.d.ts.map +1 -1
- package/dist/query-resolver.js +7 -4
- package/dist/ranked-recommendations.d.ts +36 -0
- package/dist/ranked-recommendations.d.ts.map +1 -0
- package/dist/ranked-recommendations.js +1 -0
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +38 -10
- package/dist/recommend-recipe.d.ts +17 -0
- package/dist/recommend-recipe.d.ts.map +1 -0
- package/dist/recommend-recipe.js +1 -0
- package/dist/recommend-recipes.d.ts +9 -0
- package/dist/recommend-recipes.d.ts.map +1 -0
- package/dist/recommend-recipes.js +106 -0
- package/dist/recommendation-candidate.d.ts +30 -0
- package/dist/recommendation-candidate.d.ts.map +1 -0
- package/dist/recommendation-candidate.js +1 -0
- package/dist/recommendation-confidence.d.ts +27 -0
- package/dist/recommendation-confidence.d.ts.map +1 -0
- package/dist/recommendation-confidence.js +1 -0
- package/dist/recommendation-ranking-options.d.ts +24 -0
- package/dist/recommendation-ranking-options.d.ts.map +1 -0
- package/dist/recommendation-ranking-options.js +1 -0
- package/dist/recommendation-ranking.d.ts +50 -0
- package/dist/recommendation-ranking.d.ts.map +1 -0
- package/dist/recommendation-ranking.js +527 -0
- package/dist/recommendation-source.d.ts +23 -0
- package/dist/recommendation-source.d.ts.map +1 -0
- package/dist/recommendation-source.js +23 -0
- package/dist/recommendation-suppression.d.ts +14 -0
- package/dist/recommendation-suppression.d.ts.map +1 -0
- package/dist/recommendation-suppression.js +14 -0
- package/dist/reference-asset-kind.d.ts +14 -0
- package/dist/reference-asset-kind.d.ts.map +1 -0
- package/dist/reference-asset-kind.js +14 -0
- package/dist/reference-content-check.d.ts +32 -0
- package/dist/reference-content-check.d.ts.map +1 -0
- package/dist/reference-content-check.js +143 -0
- package/dist/reference-failure.d.ts +31 -0
- package/dist/reference-failure.d.ts.map +1 -0
- package/dist/reference-failure.js +31 -0
- package/dist/reference-id-status.d.ts +15 -0
- package/dist/reference-id-status.d.ts.map +1 -0
- package/dist/reference-id-status.js +15 -0
- package/dist/reference-kind-declarations.d.ts +42 -0
- package/dist/reference-kind-declarations.d.ts.map +1 -0
- package/dist/reference-kind-declarations.js +142 -0
- package/dist/reference-lookup.d.ts +6 -0
- package/dist/reference-lookup.d.ts.map +1 -1
- package/dist/reference-lookup.js +13 -5
- package/dist/reference-pack-origin.d.ts +18 -0
- package/dist/reference-pack-origin.d.ts.map +1 -0
- package/dist/reference-pack-origin.js +38 -0
- package/dist/reference-registry.d.ts +109 -11
- package/dist/reference-registry.d.ts.map +1 -1
- package/dist/reference-registry.js +186 -30
- package/dist/reference-subject.d.ts +20 -0
- package/dist/reference-subject.d.ts.map +1 -0
- package/dist/reference-subject.js +1 -0
- package/dist/registration-hint-discovery-status.d.ts +25 -0
- package/dist/registration-hint-discovery-status.d.ts.map +1 -0
- package/dist/registration-hint-discovery-status.js +25 -0
- package/dist/registration-hint-registry.d.ts +80 -0
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +356 -138
- package/dist/registry-lifecycle.d.ts +200 -19
- package/dist/registry-lifecycle.d.ts.map +1 -1
- package/dist/registry-lifecycle.js +526 -136
- package/dist/release-readiness.d.ts.map +1 -1
- package/dist/release-readiness.js +10 -7
- package/dist/release-smoke.d.ts.map +1 -1
- package/dist/release-smoke.js +11 -7
- package/dist/report-site.d.ts.map +1 -1
- package/dist/report-site.js +25 -7
- package/dist/repository-intelligence.d.ts.map +1 -1
- package/dist/repository-intelligence.js +3 -2
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/repository-knowledge-model.js +18 -5
- package/dist/repository-stats.d.ts.map +1 -1
- package/dist/repository-stats.js +3 -77
- package/dist/resolve-project-config.d.ts +64 -0
- package/dist/resolve-project-config.d.ts.map +1 -1
- package/dist/resolve-project-config.js +250 -33
- package/dist/reuse/compute-reuse-coverage.d.ts +29 -0
- package/dist/reuse/compute-reuse-coverage.d.ts.map +1 -0
- package/dist/reuse/compute-reuse-coverage.js +198 -0
- package/dist/reuse/rank-reuse-candidates.d.ts +38 -0
- package/dist/reuse/rank-reuse-candidates.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-candidates.js +212 -0
- package/dist/reuse/rank-reuse-options.d.ts +20 -0
- package/dist/reuse/rank-reuse-options.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-options.js +1 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts +15 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-suggestions.js +31 -0
- package/dist/reuse/resolve-curated-reuse.d.ts +43 -0
- package/dist/reuse/resolve-curated-reuse.d.ts.map +1 -0
- package/dist/reuse/resolve-curated-reuse.js +115 -0
- package/dist/reuse/reuse-candidate.d.ts +29 -0
- package/dist/reuse/reuse-candidate.d.ts.map +1 -0
- package/dist/reuse/reuse-candidate.js +1 -0
- package/dist/reuse/reuse-coverage-report.d.ts +74 -0
- package/dist/reuse/reuse-coverage-report.d.ts.map +1 -0
- package/dist/reuse/reuse-coverage-report.js +1 -0
- package/dist/reuse/reuse-curated-coverage.d.ts +36 -0
- package/dist/reuse/reuse-curated-coverage.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-coverage.js +1 -0
- package/dist/reuse/reuse-curated-resolution.d.ts +36 -0
- package/dist/reuse/reuse-curated-resolution.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-resolution.js +1 -0
- package/dist/reuse/reuse-curated-status.d.ts +21 -0
- package/dist/reuse/reuse-curated-status.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-status.js +21 -0
- package/dist/reuse/reuse-match-detail.d.ts +15 -0
- package/dist/reuse/reuse-match-detail.d.ts.map +1 -0
- package/dist/reuse/reuse-match-detail.js +1 -0
- package/dist/reuse/reuse-ranking.d.ts +37 -0
- package/dist/reuse/reuse-ranking.d.ts.map +1 -0
- package/dist/reuse/reuse-ranking.js +1 -0
- package/dist/reuse/reuse-suggestion.d.ts +19 -0
- package/dist/reuse/reuse-suggestion.d.ts.map +1 -0
- package/dist/reuse/reuse-suggestion.js +1 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts +28 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts.map +1 -0
- package/dist/reuse/reuse-symbol-lookup.js +1 -0
- package/dist/reuse/reuse-tokenize.d.ts +11 -0
- package/dist/reuse/reuse-tokenize.d.ts.map +1 -0
- package/dist/reuse/reuse-tokenize.js +26 -0
- package/dist/reuse/score-reuse-name.d.ts +16 -0
- package/dist/reuse/score-reuse-name.d.ts.map +1 -0
- package/dist/reuse/score-reuse-name.js +35 -0
- package/dist/reuse/score-reuse-primitive.d.ts +33 -0
- package/dist/reuse/score-reuse-primitive.d.ts.map +1 -0
- package/dist/reuse/score-reuse-primitive.js +92 -0
- package/dist/review-packet.d.ts +2 -0
- package/dist/review-packet.d.ts.map +1 -1
- package/dist/review-packet.js +13 -6
- package/dist/role-views.d.ts.map +1 -1
- package/dist/role-views.js +16 -16
- package/dist/routing-recommends-channels.d.ts +24 -0
- package/dist/routing-recommends-channels.d.ts.map +1 -0
- package/dist/routing-recommends-channels.js +19 -0
- package/dist/run-boundary-check.d.ts +118 -0
- package/dist/run-boundary-check.d.ts.map +1 -0
- package/dist/run-boundary-check.js +592 -0
- package/dist/safety-audit.js +1 -1
- package/dist/scaffold-coverage.js +1 -1
- package/dist/scaffold-pattern-doctor-report.d.ts +19 -0
- package/dist/scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/scaffold-pattern-doctor-report.js +54 -0
- package/dist/scaffold-patterns.d.ts +75 -1
- package/dist/scaffold-patterns.d.ts.map +1 -1
- package/dist/scaffold-patterns.js +375 -84
- package/dist/schema-inventory.d.ts.map +1 -1
- package/dist/schema-inventory.js +4 -3
- package/dist/search-document-id.d.ts +52 -0
- package/dist/search-document-id.d.ts.map +1 -0
- package/dist/search-document-id.js +72 -0
- package/dist/search-document-prefix.d.ts +7 -0
- package/dist/search-document-prefix.d.ts.map +1 -0
- package/dist/search-document-prefix.js +1 -0
- package/dist/search-index.d.ts.map +1 -1
- package/dist/search-index.js +20 -23
- package/dist/search-tuning-explain.d.ts +6 -0
- package/dist/search-tuning-explain.d.ts.map +1 -1
- package/dist/search-tuning-explain.js +19 -17
- package/dist/search-tuning-key-probes.d.ts +16 -0
- package/dist/search-tuning-key-probes.d.ts.map +1 -0
- package/dist/search-tuning-key-probes.js +65 -0
- package/dist/search-tuning-key-resolution.d.ts +25 -0
- package/dist/search-tuning-key-resolution.d.ts.map +1 -0
- package/dist/search-tuning-key-resolution.js +1 -0
- package/dist/search-tuning-key-resolver.d.ts +4 -0
- package/dist/search-tuning-key-resolver.d.ts.map +1 -0
- package/dist/search-tuning-key-resolver.js +107 -0
- package/dist/search-tuning-key-status.d.ts +24 -0
- package/dist/search-tuning-key-status.d.ts.map +1 -0
- package/dist/search-tuning-key-status.js +24 -0
- package/dist/search-tuning-lint.d.ts +9 -0
- package/dist/search-tuning-lint.d.ts.map +1 -0
- package/dist/search-tuning-lint.js +468 -0
- package/dist/search-tuning-registry.d.ts +43 -0
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +214 -49
- package/dist/self-audit.d.ts +12 -0
- package/dist/self-audit.d.ts.map +1 -1
- package/dist/self-audit.js +36 -10
- package/dist/self-config-doctor-v2.d.ts +145 -3
- package/dist/self-config-doctor-v2.d.ts.map +1 -1
- package/dist/self-config-doctor-v2.js +1369 -182
- package/dist/self-config-doctor.d.ts +20 -1
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +55 -281
- package/dist/settled-unit-states.d.ts +9 -0
- package/dist/settled-unit-states.d.ts.map +1 -0
- package/dist/settled-unit-states.js +14 -0
- package/dist/sharkcraft-inspector.d.ts +34 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +314 -27
- package/dist/spec/spec-evidence.d.ts.map +1 -1
- package/dist/spec/spec-evidence.js +14 -20
- package/dist/split-identifier.d.ts +21 -0
- package/dist/split-identifier.d.ts.map +1 -0
- package/dist/split-identifier.js +27 -0
- package/dist/stale-path-hint.d.ts +3 -0
- package/dist/stale-path-hint.d.ts.map +1 -0
- package/dist/stale-path-hint.js +47 -0
- package/dist/start-here.d.ts.map +1 -1
- package/dist/start-here.js +1 -2
- package/dist/substitute-placeholders.d.ts +8 -0
- package/dist/substitute-placeholders.d.ts.map +1 -0
- package/dist/substitute-placeholders.js +9 -0
- package/dist/symbol-index.d.ts +33 -0
- package/dist/symbol-index.d.ts.map +1 -1
- package/dist/symbol-index.js +241 -3
- package/dist/symbol-member-entry.d.ts +26 -0
- package/dist/symbol-member-entry.d.ts.map +1 -0
- package/dist/symbol-member-entry.js +1 -0
- package/dist/symbol-member-kind.d.ts +14 -0
- package/dist/symbol-member-kind.d.ts.map +1 -0
- package/dist/symbol-member-kind.js +14 -0
- package/dist/task-packet.d.ts.map +1 -1
- package/dist/task-packet.js +52 -9
- package/dist/task-ranker.d.ts +8 -0
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +25 -13
- package/dist/task-risk.js +1 -1
- package/dist/task-routing-hint-registry.d.ts +20 -1
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +186 -42
- package/dist/template-authoring.d.ts +1 -1
- package/dist/template-authoring.d.ts.map +1 -1
- package/dist/template-authoring.js +2 -1
- package/dist/template-drift.d.ts.map +1 -1
- package/dist/template-drift.js +30 -9
- package/dist/template-lint.d.ts.map +1 -1
- package/dist/template-lint.js +160 -2
- package/dist/term-query.d.ts +10 -0
- package/dist/term-query.d.ts.map +1 -0
- package/dist/term-query.js +1 -0
- package/dist/test-definitions.d.ts +6 -3
- package/dist/test-definitions.d.ts.map +1 -1
- package/dist/test-runner.d.ts +95 -10
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +309 -308
- package/dist/tuning-query-tokens.d.ts +29 -0
- package/dist/tuning-query-tokens.d.ts.map +1 -0
- package/dist/tuning-query-tokens.js +51 -0
- package/dist/typecheck-files.d.ts +36 -0
- package/dist/typecheck-files.d.ts.map +1 -0
- package/dist/typecheck-files.js +158 -0
- package/dist/uncertainty.js +1 -1
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +5 -3
- package/dist/unregistered-exports.d.ts +19 -0
- package/dist/unregistered-exports.d.ts.map +1 -0
- package/dist/unregistered-exports.js +141 -0
- package/dist/unresolvable-reason.d.ts +11 -0
- package/dist/unresolvable-reason.d.ts.map +1 -0
- package/dist/unresolvable-reason.js +11 -0
- package/dist/upgrade-advisor.d.ts.map +1 -1
- package/dist/upgrade-advisor.js +16 -9
- package/dist/validate-contribution-file.d.ts +4 -0
- package/dist/validate-contribution-file.d.ts.map +1 -0
- package/dist/validate-contribution-file.js +233 -0
- package/dist/why-file.d.ts +3 -0
- package/dist/why-file.d.ts.map +1 -1
- package/dist/why-file.js +12 -7
- package/package.json +17 -17
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import { ruleVerdictRecords, settleVerdict } from '@shrkcrft/core';
|
|
2
|
+
import { formatKnowledgeReference } from '@shrkcrft/knowledge';
|
|
3
|
+
import { declaredReferenceCoverage } from "./declared-reference-coverage.js";
|
|
4
|
+
import { KnowledgeEntryVerdict } from "./knowledge-entry-verdict.js";
|
|
5
|
+
import { ReferenceCheckOutcome } from "./knowledge-stale.js";
|
|
6
|
+
import { KnowledgeMinReferencedValve } from "./knowledge-min-referenced-valve.js";
|
|
7
|
+
import { REJECTED_AT_LOAD } from "./knowledge-entry-rejections.js";
|
|
8
|
+
import { unverifiableEntryRemedy, unverifiableRemedy } from "./knowledge-unverifiable-remedy.js";
|
|
9
|
+
import { ReferenceFailure } from "./reference-failure.js";
|
|
10
|
+
/** The stale-check rule of the knowledge entries the loader refused (round 15 follow-up, F3). */
|
|
11
|
+
export const KNOWLEDGE_REJECTED_RULE_ID = 'knowledge-rejected-entries';
|
|
12
|
+
/** The proposed exits (the CLI's `ExitCode` values; the inspector cannot import the CLI). */
|
|
13
|
+
const VERIFIED_PASS = 0;
|
|
14
|
+
const FAILURE = 1;
|
|
15
|
+
const NOT_VERIFIED = 2;
|
|
16
|
+
/**
|
|
17
|
+
* Every `--fail-on` category. `all` keeps its historical meaning (any stale or
|
|
18
|
+
* missing reference); the round-11 categories are opt-in BY NAME, so no
|
|
19
|
+
* existing `--fail-on all` pipeline changes behaviour. (A MALFORMED reference
|
|
20
|
+
* is never a pass in any mode — it is a coverage shortfall, exit 2;
|
|
21
|
+
* `--fail-on invalid` makes it a failure, exit 1.)
|
|
22
|
+
*/
|
|
23
|
+
export const KNOWLEDGE_FAIL_ON_CATEGORIES = [
|
|
24
|
+
'required',
|
|
25
|
+
'stale',
|
|
26
|
+
'missing',
|
|
27
|
+
'all',
|
|
28
|
+
'unverifiable',
|
|
29
|
+
'invalid',
|
|
30
|
+
'path-missing',
|
|
31
|
+
'anchor-missing',
|
|
32
|
+
'content',
|
|
33
|
+
'count',
|
|
34
|
+
'aged',
|
|
35
|
+
'implicit',
|
|
36
|
+
];
|
|
37
|
+
/** Unexamined entry ids carried on the coverage record (the full list is in the JSON). */
|
|
38
|
+
const COVERAGE_LABEL_CAP = 20;
|
|
39
|
+
/** Parse `--min-referenced`: a ratio `0..1` or a percentage `NN%`. `null` when malformed. */
|
|
40
|
+
export function parseMinReferenced(raw) {
|
|
41
|
+
const s = raw.trim();
|
|
42
|
+
const pct = /^(\d+(?:\.\d+)?)%$/.exec(s);
|
|
43
|
+
const n = pct ? Number(pct[1]) / 100 : /^(?:\d+(?:\.\d*)?|\.\d+)$/.test(s) ? Number(s) : Number.NaN;
|
|
44
|
+
return Number.isFinite(n) && n >= 0 && n <= 1 ? n : null;
|
|
45
|
+
}
|
|
46
|
+
/** `0.266…` → `26.7%`, `1` → `100%`. */
|
|
47
|
+
export function formatPct(ratio) {
|
|
48
|
+
const v = Math.round(ratio * 1000) / 10;
|
|
49
|
+
return `${Number.isInteger(v) ? v.toFixed(0) : v.toFixed(1)}%`;
|
|
50
|
+
}
|
|
51
|
+
function isFailing(o) {
|
|
52
|
+
return o === ReferenceCheckOutcome.Stale || o === ReferenceCheckOutcome.Missing;
|
|
53
|
+
}
|
|
54
|
+
function plural(n, one, many) {
|
|
55
|
+
return `${n} ${n === 1 ? one : many}`;
|
|
56
|
+
}
|
|
57
|
+
/** Load failures named in prose before the rest are summarised. */
|
|
58
|
+
const LOAD_FAILURES_NAMED = 3;
|
|
59
|
+
/** `sharkcraft/rules.ts (failed: SyntaxError …)` / `sharkcraft/k.ts (missing)`. */
|
|
60
|
+
function loadFailureLabel(f) {
|
|
61
|
+
return `${f.file} (${f.status === 'missing' ? 'missing' : `${f.status}: ${f.message}`})`;
|
|
62
|
+
}
|
|
63
|
+
/** The first few failed knowledge files, `; `-joined, with `(+N more)`. */
|
|
64
|
+
function loadFailureList(failures) {
|
|
65
|
+
const named = failures.slice(0, LOAD_FAILURES_NAMED).map(loadFailureLabel).join('; ');
|
|
66
|
+
return failures.length > LOAD_FAILURES_NAMED ? `${named} (+${failures.length - LOAD_FAILURES_NAMED} more)` : named;
|
|
67
|
+
}
|
|
68
|
+
/** Why the scope is empty — the run coverage's reason, in the reader's terms. */
|
|
69
|
+
function emptyScopeReason(report, input) {
|
|
70
|
+
const d = input.discovery;
|
|
71
|
+
if (d.sharkcraftDir === null) {
|
|
72
|
+
return d.configuredAncestor
|
|
73
|
+
? `no sharkcraft/ folder at the resolved root — ${d.configuredAncestor} has one: rerun with --cwd ${d.configuredAncestor}`
|
|
74
|
+
: 'no sharkcraft/ folder at the resolved root';
|
|
75
|
+
}
|
|
76
|
+
if (d.configError !== undefined) {
|
|
77
|
+
return `sharkcraft.config.ts failed to load (${d.configError}), so no knowledge was loaded`;
|
|
78
|
+
}
|
|
79
|
+
const failed = d.knowledgeLoadFailures;
|
|
80
|
+
if (report.entries === 0 && failed.length > 0) {
|
|
81
|
+
return `${plural(failed.length, 'knowledge file', 'knowledge files')} never loaded — ${loadFailureList(failed)} — so no knowledge was loaded`;
|
|
82
|
+
}
|
|
83
|
+
// Round 15 follow-up (F3): entries WERE declared — the loader refused them all.
|
|
84
|
+
if (report.entries === 0 && report.rejectedEntries.length > 0) {
|
|
85
|
+
return `every declared knowledge entry (${report.rejectedEntries.length}) was rejected at load, so none was checked`;
|
|
86
|
+
}
|
|
87
|
+
if (report.entries === 0)
|
|
88
|
+
return 'no knowledge entries are declared';
|
|
89
|
+
const alsoFailed = failed.length > 0 ? `, and ${plural(failed.length, 'knowledge file', 'knowledge files')} never loaded (${loadFailureList(failed)})` : '';
|
|
90
|
+
return `none of the ${report.entries} knowledge entries references the changed files${alsoFailed}`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Decide the stale-check verdict inputs. Pure: the report, the flags, the
|
|
94
|
+
* discovery — nothing else.
|
|
95
|
+
*/
|
|
96
|
+
export function evaluateKnowledgeStaleGate(report, input) {
|
|
97
|
+
const cov = report.coverage;
|
|
98
|
+
const failOn = input.failOn;
|
|
99
|
+
const consider = (cat) => failOn.has(cat) || failOn.has('all');
|
|
100
|
+
let requiredStale = 0;
|
|
101
|
+
let requiredMissing = 0;
|
|
102
|
+
for (const c of report.referenceChecks) {
|
|
103
|
+
if (c.reference.required !== true)
|
|
104
|
+
continue;
|
|
105
|
+
if (c.outcome === ReferenceCheckOutcome.Stale)
|
|
106
|
+
requiredStale += 1;
|
|
107
|
+
if (c.outcome === ReferenceCheckOutcome.Missing)
|
|
108
|
+
requiredMissing += 1;
|
|
109
|
+
}
|
|
110
|
+
const requiredFailing = requiredStale + requiredMissing;
|
|
111
|
+
// Declared references on boundary rules / policy checks count like a
|
|
112
|
+
// knowledge entry's. Implicit ones (a scope glob's dead prefix) are advisory
|
|
113
|
+
// unless `--fail-on implicit`.
|
|
114
|
+
const assetFailing = report.assetReferenceChecks.filter((c) => !c.implicit && isFailing(c.outcome));
|
|
115
|
+
const implicitFailing = report.assetReferenceChecks.filter((c) => c.implicit === true && isFailing(c.outcome));
|
|
116
|
+
// Every DECLARED reference (knowledge, anchor, boundary rule, policy) is one
|
|
117
|
+
// population: checkable ones were examined, malformed ones never were.
|
|
118
|
+
const declaredRefs = [...report.referenceChecks, ...report.assetReferenceChecks.filter((c) => !c.implicit)];
|
|
119
|
+
const invalidRefs = declaredRefs.filter((c) => c.outcome === ReferenceCheckOutcome.Invalid);
|
|
120
|
+
const invalidAnchors = report.anchorChecks.filter((a) => a.outcome === ReferenceCheckOutcome.Invalid);
|
|
121
|
+
const invalidCount = invalidRefs.length + invalidAnchors.length;
|
|
122
|
+
// Round 15 follow-up (F3): entries the LOADER refused. INVALID-class: never
|
|
123
|
+
// in scope, never checked — a coverage shortfall of their own rule (exit 2),
|
|
124
|
+
// a failure under `--fail-on invalid` (exit 1). No valve accepts them:
|
|
125
|
+
// `--min-referenced` accepts the run's unverifiable remainder and
|
|
126
|
+
// `--allow-empty` an empty scope, never this rule.
|
|
127
|
+
const rejected = report.rejectedEntries;
|
|
128
|
+
const reasons = [];
|
|
129
|
+
// The historical modes, unchanged (they are mutually exclusive by design).
|
|
130
|
+
if (input.ci) {
|
|
131
|
+
if (requiredFailing > 0)
|
|
132
|
+
reasons.push(`${requiredFailing} required references failing in --ci mode`);
|
|
133
|
+
}
|
|
134
|
+
else if (input.strict) {
|
|
135
|
+
if (requiredFailing > 0)
|
|
136
|
+
reasons.push(`${requiredFailing} required references failing in --strict mode`);
|
|
137
|
+
}
|
|
138
|
+
else if (failOn.size > 0) {
|
|
139
|
+
if (consider('required') && requiredFailing > 0) {
|
|
140
|
+
reasons.push(`${requiredFailing} required reference issues (--fail-on=required)`);
|
|
141
|
+
}
|
|
142
|
+
if (consider('stale') && report.counts.stale > 0) {
|
|
143
|
+
reasons.push(`${report.counts.stale} stale references (--fail-on=stale)`);
|
|
144
|
+
}
|
|
145
|
+
if (consider('missing') && report.counts.missing > 0) {
|
|
146
|
+
reasons.push(`${report.counts.missing} missing references (--fail-on=missing)`);
|
|
147
|
+
}
|
|
148
|
+
if (failOn.has('all') && assetFailing.length > 0) {
|
|
149
|
+
reasons.push(`${assetFailing.length} stale boundary-rule / policy references (--fail-on=all)`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
const n = report.counts.missing + report.counts.stale + assetFailing.length;
|
|
154
|
+
if (n > 0)
|
|
155
|
+
reasons.push(`${n} stale or missing references (legacy default)`);
|
|
156
|
+
}
|
|
157
|
+
// The round-11 categories — each opt-in by name.
|
|
158
|
+
const byFailure = (f) => report.failureCounts[f] ?? 0;
|
|
159
|
+
if (failOn.has('path-missing') && byFailure(ReferenceFailure.PathMissing) > 0) {
|
|
160
|
+
reasons.push(`${byFailure(ReferenceFailure.PathMissing)} path-missing references (--fail-on=path-missing)`);
|
|
161
|
+
}
|
|
162
|
+
if (failOn.has('anchor-missing') && byFailure(ReferenceFailure.AnchorMissing) > 0) {
|
|
163
|
+
reasons.push(`${byFailure(ReferenceFailure.AnchorMissing)} anchor-missing references (--fail-on=anchor-missing)`);
|
|
164
|
+
}
|
|
165
|
+
if (failOn.has('content') && byFailure(ReferenceFailure.ContentMismatch) > 0) {
|
|
166
|
+
reasons.push(`${byFailure(ReferenceFailure.ContentMismatch)} content assertions no longer hold (--fail-on=content)`);
|
|
167
|
+
}
|
|
168
|
+
if (failOn.has('count') && byFailure(ReferenceFailure.CountMismatch) > 0) {
|
|
169
|
+
reasons.push(`${byFailure(ReferenceFailure.CountMismatch)} counts re-derived to a different number (--fail-on=count)`);
|
|
170
|
+
}
|
|
171
|
+
if (failOn.has('aged') && (report.age?.aged.length ?? 0) > 0) {
|
|
172
|
+
reasons.push(`${report.age.aged.length} entries not verified within ${report.age.staleAfterDays}d (--fail-on=aged)`);
|
|
173
|
+
}
|
|
174
|
+
if (failOn.has('implicit') && implicitFailing.length > 0) {
|
|
175
|
+
reasons.push(`${implicitFailing.length} boundary-rule scope globs point at nothing (--fail-on=implicit)`);
|
|
176
|
+
}
|
|
177
|
+
if (failOn.has('invalid') && invalidCount > 0) {
|
|
178
|
+
reasons.push(`${plural(invalidCount, 'malformed reference', 'malformed references')} (--fail-on=invalid)`);
|
|
179
|
+
}
|
|
180
|
+
if (failOn.has('invalid') && rejected.length > 0) {
|
|
181
|
+
reasons.push(`${plural(rejected.length, 'knowledge entry', 'knowledge entries')} rejected at load (--fail-on=invalid)`);
|
|
182
|
+
}
|
|
183
|
+
const requireRefs = input.requireReferences || failOn.has('unverifiable');
|
|
184
|
+
if (requireRefs && cov.unverifiable > 0) {
|
|
185
|
+
reasons.push(`${plural(cov.unverifiable, 'entry declares', 'entries declare')} no checkable reference (--require-references)`);
|
|
186
|
+
}
|
|
187
|
+
if (input.minReferenced && cov.entriesInScope > 0 && cov.referencedRatio < input.minReferenced.ratio) {
|
|
188
|
+
reasons.push(`reference coverage ${formatPct(cov.referencedRatio)} < ${formatPct(input.minReferenced.ratio)} (${input.minReferenced.acceptedBy})`);
|
|
189
|
+
}
|
|
190
|
+
const d = input.discovery;
|
|
191
|
+
const loadFailures = d.knowledgeLoadFailures;
|
|
192
|
+
// A load failure is a discovery failure at ANY corpus size: the entries of a
|
|
193
|
+
// file that never loaded were never checked, so neither a clean sweep of the
|
|
194
|
+
// rest nor `--allow-empty` can make the run a pass.
|
|
195
|
+
const discoveryFailed = (d.entriesLoaded === 0 && (d.sharkcraftDir === null || d.configError !== undefined)) || loadFailures.length > 0;
|
|
196
|
+
const examined = cov.verified + cov.stale;
|
|
197
|
+
// Propose from what was found. An EMPTY scope proposes 0 and lets the run
|
|
198
|
+
// coverage (expected 0) settle it — that is what keeps `--allow-empty`
|
|
199
|
+
// reachable. A non-empty scope that examined nothing proposes 2 outright.
|
|
200
|
+
const proposed = reasons.length > 0
|
|
201
|
+
? FAILURE
|
|
202
|
+
: cov.entriesInScope > 0 && examined === 0
|
|
203
|
+
? NOT_VERIFIED
|
|
204
|
+
: VERIFIED_PASS;
|
|
205
|
+
const acceptance = cov.entriesInScope === 0
|
|
206
|
+
? discoveryFailed
|
|
207
|
+
? {}
|
|
208
|
+
: input.emptyAcceptance
|
|
209
|
+
: input.minReferenced
|
|
210
|
+
? { acceptedBy: input.minReferenced.acceptedBy, acceptedRatio: input.minReferenced.ratio }
|
|
211
|
+
: {};
|
|
212
|
+
const runCoverage = {
|
|
213
|
+
unit: 'knowledge entries',
|
|
214
|
+
expected: cov.entriesInScope,
|
|
215
|
+
examined,
|
|
216
|
+
...(report.unverifiableIds.length > 0
|
|
217
|
+
? {
|
|
218
|
+
unexamined: report.unverifiableIds.slice(0, COVERAGE_LABEL_CAP),
|
|
219
|
+
unexaminedTotal: report.unverifiableIds.length,
|
|
220
|
+
}
|
|
221
|
+
: {}),
|
|
222
|
+
root: d.resolvedRoot,
|
|
223
|
+
reason: cov.entriesInScope === 0
|
|
224
|
+
? emptyScopeReason(report, input)
|
|
225
|
+
: 'declare no checkable references[] or anchors[], so they were never checked',
|
|
226
|
+
...acceptance,
|
|
227
|
+
};
|
|
228
|
+
// THE waiver (round 13): references that FAIL (stale / missing) but block
|
|
229
|
+
// nothing in this mode — `required: false` under --ci / --strict (they fail on
|
|
230
|
+
// required references only), or outside the chosen --fail-on categories. They
|
|
231
|
+
// are printed as STALE / MISSING rows, and the ✓ line used to stand over them
|
|
232
|
+
// in silence ("no stale or missing references"). Recorded as an acceptance
|
|
233
|
+
// next to the rule's coverage, so it is printed in `accepted` at exit 0 —
|
|
234
|
+
// never a shortfall, never a failure.
|
|
235
|
+
const failingLabels = [
|
|
236
|
+
...[...report.referenceChecks, ...assetFailing]
|
|
237
|
+
.filter((c) => isFailing(c.outcome))
|
|
238
|
+
.map((c) => `${c.entryId} → ${formatKnowledgeReference(c.reference)}`),
|
|
239
|
+
...report.anchorChecks.filter((a) => isFailing(a.outcome)).map((a) => `${a.entryId} anchor ${a.anchor.id}`),
|
|
240
|
+
];
|
|
241
|
+
const waivedBy = reasons.length > 0 || failingLabels.length === 0
|
|
242
|
+
? undefined
|
|
243
|
+
: input.ci
|
|
244
|
+
? 'required: false (--ci fails on required references only)'
|
|
245
|
+
: input.strict
|
|
246
|
+
? 'required: false (--strict fails on required references only)'
|
|
247
|
+
: failOn.size > 0
|
|
248
|
+
? `the fail-on categories (${[...failOn].join(', ')})`
|
|
249
|
+
: 'the legacy default (it fails on stale or missing references, not on anchors)';
|
|
250
|
+
const waiver = waivedBy === undefined
|
|
251
|
+
? undefined
|
|
252
|
+
: {
|
|
253
|
+
unit: 'failing references',
|
|
254
|
+
expected: failingLabels.length,
|
|
255
|
+
examined: 0,
|
|
256
|
+
unexamined: failingLabels.slice(0, COVERAGE_LABEL_CAP),
|
|
257
|
+
unexaminedTotal: failingLabels.length,
|
|
258
|
+
reason: 'stale or missing, and waived — this mode does not fail on them',
|
|
259
|
+
acceptedBy: waivedBy,
|
|
260
|
+
};
|
|
261
|
+
const rules = [];
|
|
262
|
+
if (cov.entriesInScope > 0) {
|
|
263
|
+
const violations = [];
|
|
264
|
+
// The file declaring each knowledge entry — a violation names the file to
|
|
265
|
+
// edit (round 15: a Markdown entry's, its .md).
|
|
266
|
+
const declaredIn = new Map(report.entryVerdicts.map((v) => [v.entryId, v.source]));
|
|
267
|
+
for (const c of [...report.referenceChecks, ...assetFailing, ...(failOn.has('implicit') ? implicitFailing : [])]) {
|
|
268
|
+
if (!isFailing(c.outcome))
|
|
269
|
+
continue;
|
|
270
|
+
const file = c.assetKind ? undefined : declaredIn.get(c.entryId);
|
|
271
|
+
violations.push({
|
|
272
|
+
id: c.entryId,
|
|
273
|
+
...(file !== undefined ? { file } : {}),
|
|
274
|
+
message: `${formatKnowledgeReference(c.reference)} — ${c.message}`,
|
|
275
|
+
...(c.suggestion ? { hint: c.suggestion } : {}),
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
for (const a of report.anchorChecks) {
|
|
279
|
+
if (!isFailing(a.outcome))
|
|
280
|
+
continue;
|
|
281
|
+
violations.push({ id: a.entryId, message: `anchor ${a.anchor.id} (${a.anchor.kind}) — ${a.message}` });
|
|
282
|
+
}
|
|
283
|
+
if (failOn.has('invalid')) {
|
|
284
|
+
for (const c of invalidRefs) {
|
|
285
|
+
violations.push({ id: c.entryId, message: `MALFORMED ${formatKnowledgeReference(c.reference)} — ${c.message}` });
|
|
286
|
+
}
|
|
287
|
+
for (const a of invalidAnchors) {
|
|
288
|
+
violations.push({ id: a.entryId, message: `MALFORMED anchor ${a.anchor.id} — ${a.message}` });
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (requireRefs) {
|
|
292
|
+
for (const v of report.entryVerdicts) {
|
|
293
|
+
if (v.verdict !== KnowledgeEntryVerdict.Unverifiable)
|
|
294
|
+
continue;
|
|
295
|
+
violations.push({
|
|
296
|
+
id: v.entryId,
|
|
297
|
+
file: v.source,
|
|
298
|
+
// THE per-entry remedy (round 15 closing, A4): an entry whose
|
|
299
|
+
// references exist but are malformed read "declare references[]".
|
|
300
|
+
message: `UNVERIFIABLE (${v.reason ?? 'no checkable reference'}) — ${unverifiableEntryRemedy(v)}`,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
rules.push({
|
|
305
|
+
id: 'knowledge-references',
|
|
306
|
+
type: 'knowledge',
|
|
307
|
+
status: reasons.length > 0 ? 'failed' : examined === 0 ? 'skipped' : 'passed',
|
|
308
|
+
severity: 'error',
|
|
309
|
+
counts: {
|
|
310
|
+
entries: cov.entriesInScope,
|
|
311
|
+
verified: cov.verified,
|
|
312
|
+
stale: cov.stale,
|
|
313
|
+
unverifiable: cov.unverifiable,
|
|
314
|
+
references: report.totalReferences,
|
|
315
|
+
anchors: report.totalAnchors,
|
|
316
|
+
},
|
|
317
|
+
violations,
|
|
318
|
+
...(examined === 0
|
|
319
|
+
? {
|
|
320
|
+
skipReason: `no entry in scope declares a checkable reference (${plural(cov.unverifiable, 'entry', 'entries')} unverifiable)`,
|
|
321
|
+
}
|
|
322
|
+
: {}),
|
|
323
|
+
// THE declared-reference fold (`declaredReferenceCoverage`, shared with
|
|
324
|
+
// the `shrk gate` knowledge-symbol gate): a malformed reference was
|
|
325
|
+
// declared to be checked and never was — expected, not examined — so a
|
|
326
|
+
// run with one is never a clean pass.
|
|
327
|
+
coverage: declaredReferenceCoverage({ references: declaredRefs, anchors: report.anchorChecks }),
|
|
328
|
+
...(waiver !== undefined ? { unitAcceptance: waiver } : {}),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
// Round 15 follow-up (F3): knowledge entries the loader REFUSED — their own
|
|
332
|
+
// rule, pushed at ANY scope and corpus size (a clean sweep of the rest, a
|
|
333
|
+
// changeset, `--allow-empty` or `--min-referenced` never covers them). By
|
|
334
|
+
// default `skipped` — nothing was checked, the shortfall settles the run to
|
|
335
|
+
// 2 — and `failed` under `--fail-on invalid`, the INVALID-class contract of a
|
|
336
|
+
// malformed reference.
|
|
337
|
+
if (rejected.length > 0) {
|
|
338
|
+
const failing = failOn.has('invalid');
|
|
339
|
+
rules.push({
|
|
340
|
+
id: KNOWLEDGE_REJECTED_RULE_ID,
|
|
341
|
+
type: 'knowledge',
|
|
342
|
+
status: failing ? 'failed' : 'skipped',
|
|
343
|
+
severity: 'error',
|
|
344
|
+
counts: { rejected: rejected.length },
|
|
345
|
+
violations: failing
|
|
346
|
+
? rejected.map((r) => ({
|
|
347
|
+
id: r.label,
|
|
348
|
+
file: r.source,
|
|
349
|
+
message: `REJECTED AT LOAD${r.pack !== undefined ? ` (pack ${r.pack})` : ''} — ${r.message}`,
|
|
350
|
+
}))
|
|
351
|
+
: [],
|
|
352
|
+
...(failing
|
|
353
|
+
? {}
|
|
354
|
+
: { skipReason: `${plural(rejected.length, 'knowledge entry was', 'knowledge entries were')} rejected at load — never checked` }),
|
|
355
|
+
coverage: {
|
|
356
|
+
unit: 'knowledge entries',
|
|
357
|
+
expected: rejected.length,
|
|
358
|
+
examined: 0,
|
|
359
|
+
unexamined: rejected.slice(0, COVERAGE_LABEL_CAP).map((r) => r.label),
|
|
360
|
+
unexaminedTotal: rejected.length,
|
|
361
|
+
reason: `${REJECTED_AT_LOAD} — the loader refused them (\`shrk self-config doctor\` names why); no valve accepts them`,
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
// Knowledge-bearing files that never loaded: their own rule, so the envelope
|
|
366
|
+
// names each one and the shortfall rides into the settled verdict whatever
|
|
367
|
+
// the rest of the corpus proved. `error` — a source that could not be read is
|
|
368
|
+
// never `evaluated`.
|
|
369
|
+
if (loadFailures.length > 0) {
|
|
370
|
+
const attempted = Math.max(d.knowledgeFilesAttempted, loadFailures.length);
|
|
371
|
+
rules.push({
|
|
372
|
+
id: 'knowledge-files',
|
|
373
|
+
type: 'knowledge',
|
|
374
|
+
status: 'error',
|
|
375
|
+
severity: 'error',
|
|
376
|
+
counts: { files: attempted, loaded: attempted - loadFailures.length, failed: loadFailures.length },
|
|
377
|
+
violations: loadFailures.map((f) => ({
|
|
378
|
+
id: f.file,
|
|
379
|
+
file: f.file,
|
|
380
|
+
message: `${f.kind} file ${f.status === 'missing' ? 'MISSING' : 'FAILED TO LOAD'}${f.packName ? ` (pack ${f.packName})` : ''} — ${f.message}`,
|
|
381
|
+
})),
|
|
382
|
+
error: `${plural(loadFailures.length, 'knowledge file', 'knowledge files')} never loaded: ${loadFailureList(loadFailures)}`,
|
|
383
|
+
coverage: {
|
|
384
|
+
unit: 'knowledge files',
|
|
385
|
+
expected: attempted,
|
|
386
|
+
examined: attempted - loadFailures.length,
|
|
387
|
+
unexamined: loadFailures.slice(0, COVERAGE_LABEL_CAP).map((f) => f.file),
|
|
388
|
+
unexaminedTotal: loadFailures.length,
|
|
389
|
+
reason: 'failed to load (or are declared and missing), so their entries were never checked',
|
|
390
|
+
},
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
// A refused entry's sentence rides next to whichever lead the run has — it is
|
|
394
|
+
// never the whole story, and never dropped from it (round 15 follow-up, F3).
|
|
395
|
+
const rejectedLead = rejected.length > 0
|
|
396
|
+
? `${plural(rejected.length, 'knowledge entry was', 'knowledge entries were')} rejected at load and never checked (listed above as INVALID): ${rejected
|
|
397
|
+
.slice(0, LOAD_FAILURES_NAMED)
|
|
398
|
+
.map((r) => r.label)
|
|
399
|
+
.join(', ')}${rejected.length > LOAD_FAILURES_NAMED ? ` (+${rejected.length - LOAD_FAILURES_NAMED} more)` : ''} — fix each (\`shrk self-config doctor\` names why); \`--fail-on invalid\` makes this a failure, and no valve accepts it.`
|
|
400
|
+
: undefined;
|
|
401
|
+
const loadLead = loadFailures.length > 0
|
|
402
|
+
? `${plural(loadFailures.length, 'knowledge file', 'knowledge files')} never loaded, so ${loadFailures.length === 1 ? 'its entries were' : 'their entries were'} never checked: ${loadFailureList(loadFailures)}. Fix the file (\`shrk doctor\` names the error) — --allow-empty never accepts a load failure.`
|
|
403
|
+
: undefined;
|
|
404
|
+
const restLead = loadFailures.length > 0
|
|
405
|
+
? undefined
|
|
406
|
+
: discoveryFailed
|
|
407
|
+
? `Loaded 0 knowledge entries from ${d.resolvedRoot} — nothing was checked.`
|
|
408
|
+
: cov.entriesInScope > 0 && cov.unverifiable > 0
|
|
409
|
+
? `${plural(cov.unverifiable, 'entry', 'entries')} of ${cov.entriesInScope} (${formatPct(cov.unverifiable / cov.entriesInScope)}) ${cov.unverifiable === 1 ? 'declares' : 'declare'} no checkable reference, so ${cov.unverifiable === 1 ? 'it was' : 'they were'} never checked. ${unverifiableRemedy(report.entryVerdicts, KnowledgeMinReferencedValve.Flag)}`
|
|
410
|
+
: invalidCount > 0
|
|
411
|
+
? `${plural(invalidCount, 'reference is', 'references are')} MALFORMED (listed above as INVALID) and ${invalidCount === 1 ? 'was' : 'were'} never checked — fix the kind or the missing field; \`--fail-on invalid\` makes this a failure.`
|
|
412
|
+
: undefined;
|
|
413
|
+
const leads = [loadLead, rejectedLead, restLead].filter((l) => l !== undefined);
|
|
414
|
+
const notVerifiedLead = leads.length > 0 ? leads.join(' ') : undefined;
|
|
415
|
+
return {
|
|
416
|
+
proposed,
|
|
417
|
+
reasons,
|
|
418
|
+
requiredStale,
|
|
419
|
+
requiredMissing,
|
|
420
|
+
rules,
|
|
421
|
+
runCoverage,
|
|
422
|
+
discoveryFailed,
|
|
423
|
+
waived: cov.entriesInScope > 0 && waiver !== undefined ? waiver.expected : 0,
|
|
424
|
+
...(notVerifiedLead ? { notVerifiedLead } : {}),
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* A request whose `aged` category (or `--as-of`) has no `--stale-after` window
|
|
429
|
+
* to measure against can never fire — the vacuous-category class `--fail-on
|
|
430
|
+
* bogus` is refused for. `undefined` when the request is well-formed.
|
|
431
|
+
*/
|
|
432
|
+
export function knowledgeStaleWindowProblem(failOn, agedFromConfig, staleAfterDays, asOf) {
|
|
433
|
+
if (staleAfterDays !== undefined)
|
|
434
|
+
return undefined;
|
|
435
|
+
if (asOf !== undefined) {
|
|
436
|
+
return '--as-of dates the --stale-after window; without --stale-after <Nd|Nw|Nm|Ny> it measures nothing.';
|
|
437
|
+
}
|
|
438
|
+
if (!failOn.has('aged'))
|
|
439
|
+
return undefined;
|
|
440
|
+
return agedFromConfig
|
|
441
|
+
? "knowledgeCheck.failOn includes 'aged', which needs a --stale-after <Nd|Nw|Nm|Ny> window — without one no entry can be aged, so the category could never fail. Pass --stale-after, or drop 'aged' from knowledgeCheck.failOn."
|
|
442
|
+
: '--fail-on aged needs --stale-after <Nd|Nw|Nm|Ny>: without a window no entry can be aged, so the category could never fail.';
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* THE stale-check input — the verb's flags folded over the config's
|
|
446
|
+
* `knowledgeCheck` block. `shrk knowledge stale-check`, `shrk quality`, `shrk
|
|
447
|
+
* release readiness` and `buildQualityReport` all build their input here, so
|
|
448
|
+
* for a config-only request the verb's exit, the quality gate and
|
|
449
|
+
* `knowledgeCheck.ready` are one answer (they used to read the block three
|
|
450
|
+
* different ways).
|
|
451
|
+
*
|
|
452
|
+
* Precedence (a flag wins):
|
|
453
|
+
* - `--fail-on` replaces `knowledgeCheck.failOn` wholesale;
|
|
454
|
+
* - `knowledgeCheck.strict: true` ("promote any stale to a failure") adds
|
|
455
|
+
* `all` to the config's list; the verb's `--strict` / `--ci` (the R30
|
|
456
|
+
* required-only modes) take precedence over any `failOn`;
|
|
457
|
+
* - `--min-referenced` over `knowledgeCheck.minReferenced` (each printed as
|
|
458
|
+
* its own acceptance);
|
|
459
|
+
* - `--require-references` OR `knowledgeCheck.requireReferences`;
|
|
460
|
+
* - `--allow-empty` is a flag only — never read from config.
|
|
461
|
+
*/
|
|
462
|
+
export function knowledgeStaleGateInput(o) {
|
|
463
|
+
const f = o.flags;
|
|
464
|
+
const cfg = o.knowledgeCheck;
|
|
465
|
+
const flagFailOn = f.failOn ?? [];
|
|
466
|
+
const fromConfig = flagFailOn.length === 0;
|
|
467
|
+
const configFailOn = cfg?.failOn ?? [];
|
|
468
|
+
const failOn = new Set(fromConfig ? configFailOn : flagFailOn);
|
|
469
|
+
if (fromConfig && cfg?.strict === true)
|
|
470
|
+
failOn.add('all');
|
|
471
|
+
const minReferenced = f.minReferenced ??
|
|
472
|
+
(cfg?.minReferenced !== undefined
|
|
473
|
+
? { ratio: cfg.minReferenced, acceptedBy: `knowledgeCheck.minReferenced: ${cfg.minReferenced}` }
|
|
474
|
+
: undefined);
|
|
475
|
+
const usageProblem = knowledgeStaleWindowProblem(failOn, fromConfig && configFailOn.includes('aged'), f.staleAfterDays, f.asOf);
|
|
476
|
+
return {
|
|
477
|
+
ci: f.ci === true,
|
|
478
|
+
strict: f.strict === true,
|
|
479
|
+
failOn,
|
|
480
|
+
...(minReferenced ? { minReferenced } : {}),
|
|
481
|
+
requireReferences: f.requireReferences === true || cfg?.requireReferences === true,
|
|
482
|
+
emptyAcceptance: f.emptyAcceptance ?? {},
|
|
483
|
+
scoped: o.scoped,
|
|
484
|
+
discovery: o.discovery,
|
|
485
|
+
...(usageProblem ? { usageProblem } : {}),
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Settle a stale-check verdict WITHOUT an envelope (`shrk quality`, `shrk
|
|
490
|
+
* release readiness`, `buildQualityReport`) — exactly the fold
|
|
491
|
+
* `buildGateEnvelope` applies for the verb: the run coverage plus every rule's
|
|
492
|
+
* coverage, subject = rule id.
|
|
493
|
+
*/
|
|
494
|
+
export function settleKnowledgeStaleGate(gate) {
|
|
495
|
+
return settleVerdict(gate.proposed, [
|
|
496
|
+
gate.runCoverage,
|
|
497
|
+
// THE fold the envelope applies (round 13): a rule's acceptance rides next
|
|
498
|
+
// to its coverage (`ruleVerdictRecords`), so quality prints the same waiver.
|
|
499
|
+
...gate.rules.flatMap((r) => ruleVerdictRecords(r.coverage, r.unitAcceptance).map((c) => ({ ...c, subject: c.subject ?? r.id }))),
|
|
500
|
+
]);
|
|
501
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IQualityGateResult } from './quality-report.js';
|
|
2
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
/** The quality-bundle gate id of the knowledge stale-check. */
|
|
4
|
+
export declare const KNOWLEDGE_STALE_GATE_ID = "knowledge-stale";
|
|
5
|
+
/**
|
|
6
|
+
* The knowledge stale-check as ONE quality gate — decided by THE gate the verb
|
|
7
|
+
* settles (`evaluateKnowledgeStaleGate` + `settleKnowledgeStaleGate`), with the
|
|
8
|
+
* config's `knowledgeCheck` block standing in for the verb's flags.
|
|
9
|
+
*
|
|
10
|
+
* `buildQualityReport` pushes it for every consumer (MCP `get_quality_report`,
|
|
11
|
+
* the dashboard, the report site), and `shrk quality` maps this same row onto
|
|
12
|
+
* its bundle item instead of re-deriving it — so the MCP report can no longer
|
|
13
|
+
* read `pass` over a stale corpus `shrk quality` fails.
|
|
14
|
+
*
|
|
15
|
+
* - an empty corpus, or a changeset no entry references → a DELIBERATE skip
|
|
16
|
+
* (`examinedNothing`, non-blocking; `data.skip` names which);
|
|
17
|
+
* - a request that can never be evaluated as configured, or a throw →
|
|
18
|
+
* `executed: false` (never a pass);
|
|
19
|
+
* - settled 1 → blocking failure; settled 2 → `data.partial` (NOT VERIFIED);
|
|
20
|
+
* settled 0 → pass.
|
|
21
|
+
*
|
|
22
|
+
* `data.settledExit` carries the settled exit so the CLI item's status is the
|
|
23
|
+
* repro command's exit, by construction.
|
|
24
|
+
*/
|
|
25
|
+
export declare function knowledgeStaleQualityGate(inspection: ISharkcraftInspection, changedFiles?: readonly string[]): Promise<IQualityGateResult>;
|
|
26
|
+
//# sourceMappingURL=knowledge-stale-quality-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-stale-quality-gate.d.ts","sourceRoot":"","sources":["../src/knowledge-stale-quality-gate.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,+DAA+D;AAC/D,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAQzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,qBAAqB,EACjC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CA2G7B"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { describeInspectionDiscovery } from "./inspection-discovery.js";
|
|
2
|
+
import { knowledgeRejectedEntries } from "./knowledge-entry-rejections.js";
|
|
3
|
+
import { buildKnowledgeStaleReport } from "./knowledge-stale.js";
|
|
4
|
+
import { evaluateKnowledgeStaleGate, formatPct, knowledgeStaleGateInput, settleKnowledgeStaleGate, } from "./knowledge-stale-gate.js";
|
|
5
|
+
import { KnowledgeMinReferencedValve } from "./knowledge-min-referenced-valve.js";
|
|
6
|
+
import { unverifiableFileRemedies, unverifiableRemedy } from "./knowledge-unverifiable-remedy.js";
|
|
7
|
+
import { warmReferenceRegistries } from "./reference-registry.js";
|
|
8
|
+
/** The quality-bundle gate id of the knowledge stale-check. */
|
|
9
|
+
export const KNOWLEDGE_STALE_GATE_ID = 'knowledge-stale';
|
|
10
|
+
/** Unverifiable entry ids carried in the gate's data (the verb's JSON has all of them). */
|
|
11
|
+
const UNVERIFIABLE_IDS_SHOWN = 20;
|
|
12
|
+
/** Refused entries named in the notes before the rest are summarised. */
|
|
13
|
+
const REJECTED_NOTES_SHOWN = 5;
|
|
14
|
+
/**
|
|
15
|
+
* The knowledge stale-check as ONE quality gate — decided by THE gate the verb
|
|
16
|
+
* settles (`evaluateKnowledgeStaleGate` + `settleKnowledgeStaleGate`), with the
|
|
17
|
+
* config's `knowledgeCheck` block standing in for the verb's flags.
|
|
18
|
+
*
|
|
19
|
+
* `buildQualityReport` pushes it for every consumer (MCP `get_quality_report`,
|
|
20
|
+
* the dashboard, the report site), and `shrk quality` maps this same row onto
|
|
21
|
+
* its bundle item instead of re-deriving it — so the MCP report can no longer
|
|
22
|
+
* read `pass` over a stale corpus `shrk quality` fails.
|
|
23
|
+
*
|
|
24
|
+
* - an empty corpus, or a changeset no entry references → a DELIBERATE skip
|
|
25
|
+
* (`examinedNothing`, non-blocking; `data.skip` names which);
|
|
26
|
+
* - a request that can never be evaluated as configured, or a throw →
|
|
27
|
+
* `executed: false` (never a pass);
|
|
28
|
+
* - settled 1 → blocking failure; settled 2 → `data.partial` (NOT VERIFIED);
|
|
29
|
+
* settled 0 → pass.
|
|
30
|
+
*
|
|
31
|
+
* `data.settledExit` carries the settled exit so the CLI item's status is the
|
|
32
|
+
* repro command's exit, by construction.
|
|
33
|
+
*/
|
|
34
|
+
export async function knowledgeStaleQualityGate(inspection, changedFiles) {
|
|
35
|
+
const base = { id: KNOWLEDGE_STALE_GATE_ID, label: 'Knowledge stale-check', runsShell: false };
|
|
36
|
+
const discovery = describeInspectionDiscovery(inspection);
|
|
37
|
+
// A knowledge file that failed to load is never a deliberate skip — the
|
|
38
|
+
// corpus is partial (or gone), and the gate says so. Neither is a corpus
|
|
39
|
+
// whose entries the loader REFUSED (round 15 follow-up, F3): they were
|
|
40
|
+
// declared, and nothing they claim was checked.
|
|
41
|
+
const loadFailed = discovery.knowledgeLoadFailures.length > 0;
|
|
42
|
+
const refused = knowledgeRejectedEntries(inspection).length > 0;
|
|
43
|
+
if (inspection.knowledgeEntries.length === 0 && !loadFailed && !refused) {
|
|
44
|
+
return {
|
|
45
|
+
...base,
|
|
46
|
+
passed: true,
|
|
47
|
+
blocking: false,
|
|
48
|
+
executed: true,
|
|
49
|
+
notes: ['no knowledge entries declared — nothing to check'],
|
|
50
|
+
data: { examinedNothing: true, skip: 'empty-corpus' },
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
// A bare warm keeps any command resolver a CLI caller already injected.
|
|
55
|
+
await warmReferenceRegistries(inspection);
|
|
56
|
+
const report = buildKnowledgeStaleReport(inspection, changedFiles ? { changedFiles } : {});
|
|
57
|
+
if (changedFiles && report.entriesInScope === 0 && !loadFailed && report.rejectedEntries.length === 0) {
|
|
58
|
+
return {
|
|
59
|
+
...base,
|
|
60
|
+
passed: true,
|
|
61
|
+
blocking: false,
|
|
62
|
+
executed: true,
|
|
63
|
+
notes: ['no knowledge entry references the changeset'],
|
|
64
|
+
data: { examinedNothing: true, skip: 'out-of-changeset' },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const gateInput = knowledgeStaleGateInput({
|
|
68
|
+
flags: {},
|
|
69
|
+
knowledgeCheck: inspection.config?.knowledgeCheck,
|
|
70
|
+
discovery,
|
|
71
|
+
scoped: changedFiles !== undefined,
|
|
72
|
+
});
|
|
73
|
+
if (gateInput.usageProblem) {
|
|
74
|
+
return {
|
|
75
|
+
...base,
|
|
76
|
+
passed: false,
|
|
77
|
+
blocking: false,
|
|
78
|
+
executed: false,
|
|
79
|
+
notes: [`could not run as configured: ${gateInput.usageProblem}`],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const gate = evaluateKnowledgeStaleGate(report, gateInput);
|
|
83
|
+
const settled = settleKnowledgeStaleGate(gate);
|
|
84
|
+
const c = report.coverage;
|
|
85
|
+
const share = c.entriesInScope > 0 ? formatPct(c.unverifiable / c.entriesInScope) : '0%';
|
|
86
|
+
const rejected = report.rejectedEntries;
|
|
87
|
+
return {
|
|
88
|
+
...base,
|
|
89
|
+
// 1 fails; 2 "passed" over PART of its scope (`partial`), which the one
|
|
90
|
+
// classification (`examineQualityGate`) reads as unexamined — never a pass.
|
|
91
|
+
passed: settled.exit !== 1,
|
|
92
|
+
blocking: true,
|
|
93
|
+
executed: true,
|
|
94
|
+
notes: [
|
|
95
|
+
`entries in scope ${c.entriesInScope} · verified ${c.verified} · stale ${c.stale} · unverifiable ${c.unverifiable} (${share})${rejected.length > 0 ? ` · rejected at load ${rejected.length}` : ''}`,
|
|
96
|
+
...gate.reasons,
|
|
97
|
+
...settled.shortfalls.map((s) => `NOT VERIFIED — ${s}`),
|
|
98
|
+
// Round 15 follow-up (F3): each entry the loader refused, named with the
|
|
99
|
+
// file to fix — the same wording as the stale-check's INVALID row.
|
|
100
|
+
...rejected
|
|
101
|
+
.slice(0, REJECTED_NOTES_SHOWN)
|
|
102
|
+
.map((r) => `${r.label} (${r.source}${r.pack !== undefined ? `, pack ${r.pack}` : ''}) — ${r.message}`),
|
|
103
|
+
...(rejected.length > REJECTED_NOTES_SHOWN
|
|
104
|
+
? [`… ${rejected.length - REJECTED_NOTES_SHOWN} more rejected at load (\`shrk knowledge stale-check\` lists all)`]
|
|
105
|
+
: []),
|
|
106
|
+
// Round 15: the fix, in THIS surface's terms — quality refuses
|
|
107
|
+
// `--min-referenced`, so the valve it names is the config key.
|
|
108
|
+
...(settled.exit === 2 && c.unverifiable > 0
|
|
109
|
+
? [
|
|
110
|
+
`remedy: ${unverifiableRemedy(report.entryVerdicts, KnowledgeMinReferencedValve.Config)}`,
|
|
111
|
+
...unverifiableFileRemedies(report.entryVerdicts),
|
|
112
|
+
]
|
|
113
|
+
: []),
|
|
114
|
+
...settled.accepted,
|
|
115
|
+
],
|
|
116
|
+
data: {
|
|
117
|
+
coverage: c,
|
|
118
|
+
unverifiableIds: report.unverifiableIds.slice(0, UNVERIFIABLE_IDS_SHOWN),
|
|
119
|
+
// Round 15 follow-up (F3): refused entries, capped like the ids above.
|
|
120
|
+
rejectedEntries: rejected.slice(0, UNVERIFIABLE_IDS_SHOWN),
|
|
121
|
+
failureCounts: report.failureCounts,
|
|
122
|
+
settledExit: settled.exit,
|
|
123
|
+
shortfalls: settled.shortfalls,
|
|
124
|
+
// What an explicit valve accepted (`knowledgeCheck.minReferenced`, a
|
|
125
|
+
// waiver) — `shrk quality` hoists it into the run's `accepted`.
|
|
126
|
+
accepted: settled.accepted,
|
|
127
|
+
...(settled.exit === 2 ? { partial: true } : {}),
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
return {
|
|
133
|
+
...base,
|
|
134
|
+
passed: false,
|
|
135
|
+
blocking: false,
|
|
136
|
+
executed: false,
|
|
137
|
+
notes: [`could not run: ${e.message}`],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|