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