@shrkcrft/inspector 0.1.0-alpha.29 → 0.1.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acceptance-replay.js +1 -1
- package/dist/agent-contract-templates.js +6 -6
- package/dist/agent-contract.d.ts.map +1 -1
- package/dist/agent-contract.js +13 -8
- package/dist/agent-orchestration.js +2 -2
- package/dist/agent-task-prep.d.ts +16 -0
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +51 -4
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +21 -3
- package/dist/architecture-map.d.ts +16 -0
- package/dist/architecture-map.d.ts.map +1 -1
- package/dist/architecture-map.js +42 -26
- package/dist/area-explore.d.ts +2 -2
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +36 -16
- package/dist/area-map.d.ts +56 -11
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +106 -25
- package/dist/asset-doctor-proposed-exit.d.ts +21 -0
- package/dist/asset-doctor-proposed-exit.d.ts.map +1 -0
- package/dist/asset-doctor-proposed-exit.js +22 -0
- package/dist/asset-provenance.js +1 -1
- package/dist/boundaries-changed-only.d.ts +24 -1
- package/dist/boundaries-changed-only.d.ts.map +1 -1
- package/dist/boundaries-changed-only.js +12 -2
- package/dist/boundary-check-options.model.d.ts +40 -0
- package/dist/boundary-check-options.model.d.ts.map +1 -0
- package/dist/boundary-check-options.model.js +1 -0
- package/dist/boundary-check-result.model.d.ts +89 -0
- package/dist/boundary-check-result.model.d.ts.map +1 -0
- package/dist/boundary-check-result.model.js +1 -0
- package/dist/boundary-configuration-status.d.ts +38 -0
- package/dist/boundary-configuration-status.d.ts.map +1 -0
- package/dist/boundary-configuration-status.js +118 -0
- package/dist/boundary-configuration-status.model.d.ts +37 -0
- package/dist/boundary-configuration-status.model.d.ts.map +1 -0
- package/dist/boundary-configuration-status.model.js +1 -0
- package/dist/boundary-load-issue.model.d.ts +30 -0
- package/dist/boundary-load-issue.model.d.ts.map +1 -0
- package/dist/boundary-load-issue.model.js +1 -0
- package/dist/boundary-rule-check.model.d.ts +44 -0
- package/dist/boundary-rule-check.model.d.ts.map +1 -0
- package/dist/boundary-rule-check.model.js +1 -0
- package/dist/boundary-rule-invalidation.model.d.ts +31 -0
- package/dist/boundary-rule-invalidation.model.d.ts.map +1 -0
- package/dist/boundary-rule-invalidation.model.js +1 -0
- package/dist/boundary-rule-set-diff.model.d.ts +75 -0
- package/dist/boundary-rule-set-diff.model.d.ts.map +1 -0
- package/dist/boundary-rule-set-diff.model.js +1 -0
- package/dist/boundary-rule-sources.d.ts +28 -0
- package/dist/boundary-rule-sources.d.ts.map +1 -0
- package/dist/boundary-rule-sources.js +110 -0
- package/dist/boundary-stale-exception-finding.model.d.ts +12 -0
- package/dist/boundary-stale-exception-finding.model.d.ts.map +1 -0
- package/dist/boundary-stale-exception-finding.model.js +1 -0
- package/dist/boundary-unit-liveness.d.ts +35 -0
- package/dist/boundary-unit-liveness.d.ts.map +1 -0
- package/dist/boundary-unit-liveness.js +71 -0
- package/dist/change-intent.d.ts +3 -0
- package/dist/change-intent.d.ts.map +1 -1
- package/dist/change-intent.js +61 -27
- package/dist/changes-summary.d.ts.map +1 -1
- package/dist/changes-summary.js +19 -9
- package/dist/ci-integrity-report.js +1 -1
- package/dist/ci-predict.d.ts.map +1 -1
- package/dist/ci-predict.js +38 -5
- package/dist/code-intelligence-doctor.d.ts +40 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -1
- package/dist/code-intelligence-doctor.js +86 -12
- package/dist/command-recommender.d.ts +45 -2
- package/dist/command-recommender.d.ts.map +1 -1
- package/dist/command-recommender.js +41 -263
- package/dist/command-resolution-status.d.ts +44 -0
- package/dist/command-resolution-status.d.ts.map +1 -0
- package/dist/command-resolution-status.js +44 -0
- package/dist/command-safety-level.d.ts +15 -0
- package/dist/command-safety-level.d.ts.map +1 -0
- package/dist/command-safety-level.js +43 -0
- package/dist/command-taxonomy.js +1 -1
- package/dist/compliance-evidence.js +1 -1
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-registry.d.ts +40 -0
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +186 -82
- package/dist/context-tuning.d.ts +4 -0
- package/dist/context-tuning.d.ts.map +1 -1
- package/dist/context-tuning.js +10 -7
- package/dist/contract-template-registry.d.ts +10 -0
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +59 -33
- package/dist/contribution-kind.d.ts +52 -0
- package/dist/contribution-kind.d.ts.map +1 -0
- package/dist/contribution-kind.js +52 -0
- package/dist/contribution-load-failures.d.ts +106 -0
- package/dist/contribution-load-failures.d.ts.map +1 -0
- package/dist/contribution-load-failures.js +575 -0
- package/dist/contributions-report.d.ts +28 -0
- package/dist/contributions-report.d.ts.map +1 -0
- package/dist/contributions-report.js +242 -0
- package/dist/convention-registry.d.ts +22 -0
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +79 -39
- package/dist/coverage-report.d.ts.map +1 -1
- package/dist/coverage-report.js +6 -6
- package/dist/custom-checks.d.ts +60 -1
- package/dist/custom-checks.d.ts.map +1 -1
- package/dist/custom-checks.js +159 -6
- package/dist/dashboard/dashboard-data.d.ts +6 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -1
- package/dist/dashboard/dashboard-data.js +99 -8
- package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -1
- package/dist/dashboard/dashboard-knowledge.js +14 -2
- package/dist/decision-records.d.ts +20 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +68 -20
- package/dist/declared-cross-references.d.ts +61 -0
- package/dist/declared-cross-references.d.ts.map +1 -0
- package/dist/declared-cross-references.js +550 -0
- package/dist/declared-gate-plane-rules.d.ts +24 -0
- package/dist/declared-gate-plane-rules.d.ts.map +1 -0
- package/dist/declared-gate-plane-rules.js +39 -0
- package/dist/declared-reference-coverage.d.ts +27 -0
- package/dist/declared-reference-coverage.d.ts.map +1 -0
- package/dist/declared-reference-coverage.js +50 -0
- package/dist/declared-xref-status.d.ts +19 -0
- package/dist/declared-xref-status.d.ts.map +1 -0
- package/dist/declared-xref-status.js +19 -0
- package/dist/delegate-pack-recipes.d.ts +13 -2
- package/dist/delegate-pack-recipes.d.ts.map +1 -1
- package/dist/delegate-pack-recipes.js +45 -14
- package/dist/demo-package.js +2 -2
- package/dist/demo-script.js +2 -2
- package/dist/demo-workflow.js +3 -3
- package/dist/dev-cycle.js +1 -1
- package/dist/dev-session.js +1 -1
- package/dist/doc-references.d.ts +80 -0
- package/dist/doc-references.d.ts.map +1 -0
- package/dist/doc-references.js +269 -0
- package/dist/doctor-result.d.ts +8 -0
- package/dist/doctor-result.d.ts.map +1 -1
- package/dist/doctor-verdict-kind.d.ts +19 -0
- package/dist/doctor-verdict-kind.d.ts.map +1 -0
- package/dist/doctor-verdict-kind.js +19 -0
- package/dist/doctor-verdict.d.ts +18 -0
- package/dist/doctor-verdict.d.ts.map +1 -0
- package/dist/doctor-verdict.js +28 -0
- package/dist/drift.d.ts +17 -0
- package/dist/drift.d.ts.map +1 -1
- package/dist/drift.js +40 -10
- package/dist/entrypoint-matrix.d.ts.map +1 -1
- package/dist/entrypoint-matrix.js +4 -1
- package/dist/feedback-ingestion.d.ts +28 -2
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +68 -19
- package/dist/fix-preview.d.ts.map +1 -1
- package/dist/fix-preview.js +9 -5
- package/dist/framework-extractor-outcomes.d.ts +27 -0
- package/dist/framework-extractor-outcomes.d.ts.map +1 -0
- package/dist/framework-extractor-outcomes.js +83 -0
- package/dist/fuzzy-impact.d.ts.map +1 -1
- package/dist/fuzzy-impact.js +12 -21
- package/dist/healing-plan.d.ts.map +1 -1
- package/dist/healing-plan.js +3 -4
- package/dist/helper-catalog.d.ts +25 -0
- package/dist/helper-catalog.d.ts.map +1 -0
- package/dist/helper-catalog.js +91 -0
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +17 -1
- package/dist/helper-view.d.ts +33 -0
- package/dist/helper-view.d.ts.map +1 -0
- package/dist/helper-view.js +1 -0
- package/dist/i-asset-doctor-flags.d.ts +16 -0
- package/dist/i-asset-doctor-flags.d.ts.map +1 -0
- package/dist/i-asset-doctor-flags.js +1 -0
- package/dist/i-command-resolution.d.ts +22 -0
- package/dist/i-command-resolution.d.ts.map +1 -0
- package/dist/i-command-resolution.js +1 -0
- package/dist/i-command-resolve-options.d.ts +24 -0
- package/dist/i-command-resolve-options.d.ts.map +1 -0
- package/dist/i-command-resolve-options.js +1 -0
- package/dist/i-command-safety.d.ts +13 -0
- package/dist/i-command-safety.d.ts.map +1 -0
- package/dist/i-command-safety.js +1 -0
- package/dist/i-contribution-accepted-entry.d.ts +18 -0
- package/dist/i-contribution-accepted-entry.d.ts.map +1 -0
- package/dist/i-contribution-accepted-entry.js +1 -0
- package/dist/i-contribution-entry-rejection.d.ts +21 -0
- package/dist/i-contribution-entry-rejection.d.ts.map +1 -0
- package/dist/i-contribution-entry-rejection.js +1 -0
- package/dist/i-contribution-file-issue.d.ts +18 -0
- package/dist/i-contribution-file-issue.d.ts.map +1 -0
- package/dist/i-contribution-file-issue.js +1 -0
- package/dist/i-contribution-file-report.d.ts +40 -0
- package/dist/i-contribution-file-report.d.ts.map +1 -0
- package/dist/i-contribution-file-report.js +1 -0
- package/dist/i-contribution-file-validation.d.ts +24 -0
- package/dist/i-contribution-file-validation.d.ts.map +1 -0
- package/dist/i-contribution-file-validation.js +1 -0
- package/dist/i-contributions-report.d.ts +31 -0
- package/dist/i-contributions-report.d.ts.map +1 -0
- package/dist/i-contributions-report.js +1 -0
- package/dist/i-declared-xref-field.d.ts +25 -0
- package/dist/i-declared-xref-field.d.ts.map +1 -0
- package/dist/i-declared-xref-field.js +1 -0
- package/dist/i-declared-xref-issue.d.ts +25 -0
- package/dist/i-declared-xref-issue.d.ts.map +1 -0
- package/dist/i-declared-xref-issue.js +1 -0
- package/dist/i-declared-xref-report.d.ts +48 -0
- package/dist/i-declared-xref-report.d.ts.map +1 -0
- package/dist/i-declared-xref-report.js +1 -0
- package/dist/i-declared-xref-row.d.ts +29 -0
- package/dist/i-declared-xref-row.d.ts.map +1 -0
- package/dist/i-declared-xref-row.js +1 -0
- package/dist/i-doctor-verdict.d.ts +10 -0
- package/dist/i-doctor-verdict.d.ts.map +1 -0
- package/dist/i-doctor-verdict.js +1 -0
- package/dist/i-kind-outcomes.d.ts +13 -0
- package/dist/i-kind-outcomes.d.ts.map +1 -0
- package/dist/i-kind-outcomes.js +1 -0
- package/dist/i-pack-doctor-verdict.d.ts +15 -0
- package/dist/i-pack-doctor-verdict.d.ts.map +1 -0
- package/dist/i-pack-doctor-verdict.js +1 -0
- package/dist/i-probed-id-field.d.ts +17 -0
- package/dist/i-probed-id-field.d.ts.map +1 -0
- package/dist/i-probed-id-field.js +1 -0
- package/dist/i-reference-kind-declaration.d.ts +38 -0
- package/dist/i-reference-kind-declaration.d.ts.map +1 -0
- package/dist/i-reference-kind-declaration.js +1 -0
- package/dist/i-reference-warm-options.d.ts +21 -0
- package/dist/i-reference-warm-options.d.ts.map +1 -0
- package/dist/i-reference-warm-options.js +1 -0
- package/dist/i-registry-outcomes.d.ts +16 -0
- package/dist/i-registry-outcomes.d.ts.map +1 -0
- package/dist/i-registry-outcomes.js +1 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts +35 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/i-scaffold-pattern-doctor-report.js +1 -0
- package/dist/i-search-tuning-key-probe.d.ts +30 -0
- package/dist/i-search-tuning-key-probe.d.ts.map +1 -0
- package/dist/i-search-tuning-key-probe.js +1 -0
- package/dist/i-search-tuning-lint-issue.d.ts +61 -0
- package/dist/i-search-tuning-lint-issue.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-issue.js +1 -0
- package/dist/i-search-tuning-lint-report.d.ts +38 -0
- package/dist/i-search-tuning-lint-report.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-report.js +1 -0
- package/dist/i-unresolvable-reference-scan.d.ts +14 -0
- package/dist/i-unresolvable-reference-scan.d.ts.map +1 -0
- package/dist/i-unresolvable-reference-scan.js +1 -0
- package/dist/i-unresolvable-reference.d.ts +29 -0
- package/dist/i-unresolvable-reference.d.ts.map +1 -0
- package/dist/i-unresolvable-reference.js +1 -0
- package/dist/i-workspace-profile-payload.d.ts +12 -0
- package/dist/i-workspace-profile-payload.d.ts.map +1 -0
- package/dist/i-workspace-profile-payload.js +1 -0
- package/dist/impact-analysis.d.ts +15 -0
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +58 -13
- package/dist/impact-render.d.ts.map +1 -1
- package/dist/impact-render.js +22 -0
- package/dist/import-hygiene.d.ts +35 -1
- package/dist/import-hygiene.d.ts.map +1 -1
- package/dist/import-hygiene.js +107 -13
- package/dist/index.d.ts +145 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +176 -0
- package/dist/inspection-discovery.d.ts +45 -0
- package/dist/inspection-discovery.d.ts.map +1 -0
- package/dist/inspection-discovery.js +70 -0
- package/dist/knowledge-advisory-code.d.ts +17 -0
- package/dist/knowledge-advisory-code.d.ts.map +1 -0
- package/dist/knowledge-advisory-code.js +17 -0
- package/dist/knowledge-aged-entry.d.ts +10 -0
- package/dist/knowledge-aged-entry.d.ts.map +1 -0
- package/dist/knowledge-aged-entry.js +1 -0
- package/dist/knowledge-authoring.d.ts +24 -1
- package/dist/knowledge-authoring.d.ts.map +1 -1
- package/dist/knowledge-authoring.js +46 -7
- package/dist/knowledge-entry-verdict-record.d.ts +22 -0
- package/dist/knowledge-entry-verdict-record.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict-record.js +1 -0
- package/dist/knowledge-entry-verdict.d.ts +17 -0
- package/dist/knowledge-entry-verdict.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict.js +17 -0
- package/dist/knowledge-graph.d.ts +6 -0
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +18 -7
- package/dist/knowledge-kind-bucket.d.ts +19 -0
- package/dist/knowledge-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-kind-bucket.js +1 -0
- package/dist/knowledge-load-failure.d.ts +23 -0
- package/dist/knowledge-load-failure.d.ts.map +1 -0
- package/dist/knowledge-load-failure.js +1 -0
- package/dist/knowledge-reference-kind-bucket.d.ts +11 -0
- package/dist/knowledge-reference-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-reference-kind-bucket.js +1 -0
- package/dist/knowledge-stale-advisory.d.ts +14 -0
- package/dist/knowledge-stale-advisory.d.ts.map +1 -0
- package/dist/knowledge-stale-advisory.js +1 -0
- package/dist/knowledge-stale-coverage.d.ts +19 -0
- package/dist/knowledge-stale-coverage.d.ts.map +1 -0
- package/dist/knowledge-stale-coverage.js +1 -0
- package/dist/knowledge-stale-gate-flags.d.ts +33 -0
- package/dist/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge-stale-gate-input.d.ts +46 -0
- package/dist/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge-stale-gate-result.d.ts +33 -0
- package/dist/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge-stale-gate-rule.d.ts +33 -0
- package/dist/knowledge-stale-gate-rule.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-rule.js +1 -0
- package/dist/knowledge-stale-gate-violation.d.ts +13 -0
- package/dist/knowledge-stale-gate-violation.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-violation.js +1 -0
- package/dist/knowledge-stale-gate.d.ts +83 -0
- package/dist/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-gate.js +429 -0
- package/dist/knowledge-stale-quality-gate.d.ts +26 -0
- package/dist/knowledge-stale-quality-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-quality-gate.js +110 -0
- package/dist/knowledge-stale.d.ts +122 -9
- package/dist/knowledge-stale.d.ts.map +1 -1
- package/dist/knowledge-stale.js +1002 -316
- package/dist/knowledge-unverifiable-reason.d.ts +12 -0
- package/dist/knowledge-unverifiable-reason.d.ts.map +1 -0
- package/dist/knowledge-unverifiable-reason.js +12 -0
- package/dist/loader-diagnostics.d.ts +14 -2
- package/dist/loader-diagnostics.d.ts.map +1 -1
- package/dist/match-terms.d.ts +48 -0
- package/dist/match-terms.d.ts.map +1 -0
- package/dist/match-terms.js +155 -0
- package/dist/migration-profile-registry.d.ts +10 -0
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +57 -34
- package/dist/migration-readiness.d.ts.map +1 -1
- package/dist/migration-readiness.js +1 -3
- package/dist/nearest-id.d.ts +14 -0
- package/dist/nearest-id.d.ts.map +1 -0
- package/dist/nearest-id.js +12 -0
- package/dist/pack-asset-freshness.d.ts +65 -0
- package/dist/pack-asset-freshness.d.ts.map +1 -0
- package/dist/pack-asset-freshness.js +340 -0
- package/dist/pack-author-ux.d.ts +24 -3
- package/dist/pack-author-ux.d.ts.map +1 -1
- package/dist/pack-author-ux.js +87 -93
- package/dist/pack-contributions-inventory.d.ts +79 -39
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +443 -286
- package/dist/pack-doctor-verdict.d.ts +29 -0
- package/dist/pack-doctor-verdict.d.ts.map +1 -0
- package/dist/pack-doctor-verdict.js +45 -0
- package/dist/pack-doctor.d.ts +74 -1
- package/dist/pack-doctor.d.ts.map +1 -1
- package/dist/pack-doctor.js +281 -1
- package/dist/pack-helper-plan.d.ts +24 -0
- package/dist/pack-helper-plan.d.ts.map +1 -0
- package/dist/pack-helper-plan.js +77 -0
- package/dist/pack-helper-registry.d.ts +14 -0
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +76 -37
- package/dist/pack-manifest-reader.d.ts +8 -0
- package/dist/pack-manifest-reader.d.ts.map +1 -0
- package/dist/pack-manifest-reader.js +79 -0
- package/dist/pack-release-check.d.ts +14 -1
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +23 -1
- package/dist/pack-signature-status.d.ts +18 -6
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +59 -105
- package/dist/pack-test-runner.d.ts +27 -5
- package/dist/pack-test-runner.d.ts.map +1 -1
- package/dist/pack-test-runner.js +91 -35
- package/dist/pack-typecheck.d.ts +8 -0
- package/dist/pack-typecheck.d.ts.map +1 -0
- package/dist/pack-typecheck.js +76 -0
- package/dist/plan-review.d.ts +2 -0
- package/dist/plan-review.d.ts.map +1 -1
- package/dist/plan-review.js +17 -5
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +16 -5
- package/dist/playbook-load-issue.d.ts +16 -0
- package/dist/playbook-load-issue.d.ts.map +1 -0
- package/dist/playbook-load-issue.js +1 -0
- package/dist/playbook-registry.d.ts +32 -1
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +144 -55
- package/dist/policy-declaration.d.ts +18 -0
- package/dist/policy-declaration.d.ts.map +1 -0
- package/dist/policy-declaration.js +1 -0
- package/dist/policy-engine.d.ts +8 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +26 -9
- package/dist/policy-overrides.d.ts.map +1 -1
- package/dist/policy-overrides.js +4 -4
- package/dist/policy-registry.d.ts +42 -0
- package/dist/policy-registry.d.ts.map +1 -0
- package/dist/policy-registry.js +131 -0
- package/dist/probed-id-fields.d.ts +21 -0
- package/dist/probed-id-fields.d.ts.map +1 -0
- package/dist/probed-id-fields.js +25 -0
- package/dist/probed-id-source.d.ts +11 -0
- package/dist/probed-id-source.d.ts.map +1 -0
- package/dist/probed-id-source.js +11 -0
- package/dist/profile-registry.d.ts +25 -2
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +59 -6
- package/dist/quality-gate-examination.d.ts +15 -0
- package/dist/quality-gate-examination.d.ts.map +1 -0
- package/dist/quality-gate-examination.js +15 -0
- package/dist/quality-gate-row-status.d.ts +19 -0
- package/dist/quality-gate-row-status.d.ts.map +1 -0
- package/dist/quality-gate-row-status.js +28 -0
- package/dist/quality-gate-status.d.ts +16 -0
- package/dist/quality-gate-status.d.ts.map +1 -0
- package/dist/quality-gate-status.js +16 -0
- package/dist/quality-html.d.ts.map +1 -1
- package/dist/quality-html.js +14 -3
- package/dist/quality-report-coverage.d.ts +26 -0
- package/dist/quality-report-coverage.d.ts.map +1 -0
- package/dist/quality-report-coverage.js +48 -0
- package/dist/quality-report.d.ts +28 -1
- package/dist/quality-report.d.ts.map +1 -1
- package/dist/quality-report.js +263 -35
- package/dist/query-intent-kind.d.ts +18 -0
- package/dist/query-intent-kind.d.ts.map +1 -0
- package/dist/query-intent-kind.js +18 -0
- package/dist/query-intent-result.d.ts +23 -0
- package/dist/query-intent-result.d.ts.map +1 -0
- package/dist/query-intent-result.js +1 -0
- package/dist/query-intent.d.ts +18 -0
- package/dist/query-intent.d.ts.map +1 -0
- package/dist/query-intent.js +336 -0
- package/dist/query-resolver.d.ts +18 -0
- package/dist/query-resolver.d.ts.map +1 -1
- package/dist/query-resolver.js +15 -12
- package/dist/ranked-recommendations.d.ts +36 -0
- package/dist/ranked-recommendations.d.ts.map +1 -0
- package/dist/ranked-recommendations.js +1 -0
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +38 -10
- package/dist/recommend-recipe.d.ts +17 -0
- package/dist/recommend-recipe.d.ts.map +1 -0
- package/dist/recommend-recipe.js +1 -0
- package/dist/recommend-recipes.d.ts +9 -0
- package/dist/recommend-recipes.d.ts.map +1 -0
- package/dist/recommend-recipes.js +106 -0
- package/dist/recommendation-candidate.d.ts +30 -0
- package/dist/recommendation-candidate.d.ts.map +1 -0
- package/dist/recommendation-candidate.js +1 -0
- package/dist/recommendation-confidence.d.ts +27 -0
- package/dist/recommendation-confidence.d.ts.map +1 -0
- package/dist/recommendation-confidence.js +1 -0
- package/dist/recommendation-ranking-options.d.ts +24 -0
- package/dist/recommendation-ranking-options.d.ts.map +1 -0
- package/dist/recommendation-ranking-options.js +1 -0
- package/dist/recommendation-ranking.d.ts +50 -0
- package/dist/recommendation-ranking.d.ts.map +1 -0
- package/dist/recommendation-ranking.js +527 -0
- package/dist/recommendation-source.d.ts +23 -0
- package/dist/recommendation-source.d.ts.map +1 -0
- package/dist/recommendation-source.js +23 -0
- package/dist/recommendation-suppression.d.ts +14 -0
- package/dist/recommendation-suppression.d.ts.map +1 -0
- package/dist/recommendation-suppression.js +14 -0
- package/dist/reference-asset-kind.d.ts +14 -0
- package/dist/reference-asset-kind.d.ts.map +1 -0
- package/dist/reference-asset-kind.js +14 -0
- package/dist/reference-content-check.d.ts +32 -0
- package/dist/reference-content-check.d.ts.map +1 -0
- package/dist/reference-content-check.js +143 -0
- package/dist/reference-failure.d.ts +31 -0
- package/dist/reference-failure.d.ts.map +1 -0
- package/dist/reference-failure.js +31 -0
- package/dist/reference-id-status.d.ts +15 -0
- package/dist/reference-id-status.d.ts.map +1 -0
- package/dist/reference-id-status.js +15 -0
- package/dist/reference-kind-declarations.d.ts +42 -0
- package/dist/reference-kind-declarations.d.ts.map +1 -0
- package/dist/reference-kind-declarations.js +142 -0
- package/dist/reference-lookup.d.ts +6 -0
- package/dist/reference-lookup.d.ts.map +1 -1
- package/dist/reference-lookup.js +13 -5
- package/dist/reference-registry.d.ts +210 -0
- package/dist/reference-registry.d.ts.map +1 -0
- package/dist/reference-registry.js +395 -0
- package/dist/reference-subject.d.ts +20 -0
- package/dist/reference-subject.d.ts.map +1 -0
- package/dist/reference-subject.js +1 -0
- package/dist/registration-hint-discovery-status.d.ts +25 -0
- package/dist/registration-hint-discovery-status.d.ts.map +1 -0
- package/dist/registration-hint-discovery-status.js +25 -0
- package/dist/registration-hint-registry.d.ts +80 -0
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +356 -138
- package/dist/registry-lifecycle.d.ts +200 -19
- package/dist/registry-lifecycle.d.ts.map +1 -1
- package/dist/registry-lifecycle.js +526 -136
- package/dist/release-readiness.d.ts.map +1 -1
- package/dist/release-readiness.js +10 -7
- package/dist/release-smoke.d.ts.map +1 -1
- package/dist/release-smoke.js +11 -7
- package/dist/report-site.d.ts.map +1 -1
- package/dist/report-site.js +25 -7
- package/dist/repository-intelligence.d.ts.map +1 -1
- package/dist/repository-intelligence.js +3 -2
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/repository-knowledge-model.js +18 -5
- package/dist/resolve-project-config.d.ts +64 -0
- package/dist/resolve-project-config.d.ts.map +1 -1
- package/dist/resolve-project-config.js +258 -32
- package/dist/reuse/compute-reuse-coverage.d.ts +29 -0
- package/dist/reuse/compute-reuse-coverage.d.ts.map +1 -0
- package/dist/reuse/compute-reuse-coverage.js +198 -0
- package/dist/reuse/rank-reuse-candidates.d.ts +38 -0
- package/dist/reuse/rank-reuse-candidates.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-candidates.js +212 -0
- package/dist/reuse/rank-reuse-options.d.ts +20 -0
- package/dist/reuse/rank-reuse-options.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-options.js +1 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts +15 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-suggestions.js +31 -0
- package/dist/reuse/resolve-curated-reuse.d.ts +43 -0
- package/dist/reuse/resolve-curated-reuse.d.ts.map +1 -0
- package/dist/reuse/resolve-curated-reuse.js +115 -0
- package/dist/reuse/reuse-candidate.d.ts +29 -0
- package/dist/reuse/reuse-candidate.d.ts.map +1 -0
- package/dist/reuse/reuse-candidate.js +1 -0
- package/dist/reuse/reuse-coverage-report.d.ts +74 -0
- package/dist/reuse/reuse-coverage-report.d.ts.map +1 -0
- package/dist/reuse/reuse-coverage-report.js +1 -0
- package/dist/reuse/reuse-curated-coverage.d.ts +36 -0
- package/dist/reuse/reuse-curated-coverage.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-coverage.js +1 -0
- package/dist/reuse/reuse-curated-resolution.d.ts +36 -0
- package/dist/reuse/reuse-curated-resolution.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-resolution.js +1 -0
- package/dist/reuse/reuse-curated-status.d.ts +21 -0
- package/dist/reuse/reuse-curated-status.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-status.js +21 -0
- package/dist/reuse/reuse-match-detail.d.ts +15 -0
- package/dist/reuse/reuse-match-detail.d.ts.map +1 -0
- package/dist/reuse/reuse-match-detail.js +1 -0
- package/dist/reuse/reuse-ranking.d.ts +37 -0
- package/dist/reuse/reuse-ranking.d.ts.map +1 -0
- package/dist/reuse/reuse-ranking.js +1 -0
- package/dist/reuse/reuse-suggestion.d.ts +19 -0
- package/dist/reuse/reuse-suggestion.d.ts.map +1 -0
- package/dist/reuse/reuse-suggestion.js +1 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts +28 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts.map +1 -0
- package/dist/reuse/reuse-symbol-lookup.js +1 -0
- package/dist/reuse/reuse-tokenize.d.ts +11 -0
- package/dist/reuse/reuse-tokenize.d.ts.map +1 -0
- package/dist/reuse/reuse-tokenize.js +26 -0
- package/dist/reuse/score-reuse-name.d.ts +16 -0
- package/dist/reuse/score-reuse-name.d.ts.map +1 -0
- package/dist/reuse/score-reuse-name.js +35 -0
- package/dist/reuse/score-reuse-primitive.d.ts +33 -0
- package/dist/reuse/score-reuse-primitive.d.ts.map +1 -0
- package/dist/reuse/score-reuse-primitive.js +92 -0
- package/dist/review-packet.d.ts +2 -0
- package/dist/review-packet.d.ts.map +1 -1
- package/dist/review-packet.js +13 -6
- package/dist/role-views.d.ts.map +1 -1
- package/dist/role-views.js +16 -16
- package/dist/routing-recommends-channels.d.ts +24 -0
- package/dist/routing-recommends-channels.d.ts.map +1 -0
- package/dist/routing-recommends-channels.js +19 -0
- package/dist/run-boundary-check.d.ts +118 -0
- package/dist/run-boundary-check.d.ts.map +1 -0
- package/dist/run-boundary-check.js +592 -0
- package/dist/safety-audit.js +1 -1
- package/dist/scaffold-coverage.js +1 -1
- package/dist/scaffold-pattern-doctor-report.d.ts +19 -0
- package/dist/scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/scaffold-pattern-doctor-report.js +54 -0
- package/dist/scaffold-patterns.d.ts +75 -1
- package/dist/scaffold-patterns.d.ts.map +1 -1
- package/dist/scaffold-patterns.js +375 -84
- package/dist/schema-inventory.d.ts.map +1 -1
- package/dist/schema-inventory.js +4 -3
- package/dist/search-document-id.d.ts +52 -0
- package/dist/search-document-id.d.ts.map +1 -0
- package/dist/search-document-id.js +72 -0
- package/dist/search-document-prefix.d.ts +7 -0
- package/dist/search-document-prefix.d.ts.map +1 -0
- package/dist/search-document-prefix.js +1 -0
- package/dist/search-index.d.ts.map +1 -1
- package/dist/search-index.js +20 -23
- package/dist/search-tuning-explain.d.ts +6 -0
- package/dist/search-tuning-explain.d.ts.map +1 -1
- package/dist/search-tuning-explain.js +19 -17
- package/dist/search-tuning-key-probes.d.ts +16 -0
- package/dist/search-tuning-key-probes.d.ts.map +1 -0
- package/dist/search-tuning-key-probes.js +65 -0
- package/dist/search-tuning-key-resolution.d.ts +25 -0
- package/dist/search-tuning-key-resolution.d.ts.map +1 -0
- package/dist/search-tuning-key-resolution.js +1 -0
- package/dist/search-tuning-key-resolver.d.ts +4 -0
- package/dist/search-tuning-key-resolver.d.ts.map +1 -0
- package/dist/search-tuning-key-resolver.js +107 -0
- package/dist/search-tuning-key-status.d.ts +24 -0
- package/dist/search-tuning-key-status.d.ts.map +1 -0
- package/dist/search-tuning-key-status.js +24 -0
- package/dist/search-tuning-lint.d.ts +9 -0
- package/dist/search-tuning-lint.d.ts.map +1 -0
- package/dist/search-tuning-lint.js +468 -0
- package/dist/search-tuning-registry.d.ts +43 -0
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +214 -49
- package/dist/self-audit.d.ts +12 -0
- package/dist/self-audit.d.ts.map +1 -1
- package/dist/self-audit.js +36 -10
- package/dist/self-config-doctor-v2.d.ts +145 -3
- package/dist/self-config-doctor-v2.d.ts.map +1 -1
- package/dist/self-config-doctor-v2.js +1329 -255
- package/dist/self-config-doctor.d.ts +20 -1
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +65 -309
- package/dist/settled-unit-states.d.ts +9 -0
- package/dist/settled-unit-states.d.ts.map +1 -0
- package/dist/settled-unit-states.js +14 -0
- package/dist/sharkcraft-inspector.d.ts +47 -1
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +278 -29
- package/dist/spec/spec-evidence.d.ts.map +1 -1
- package/dist/spec/spec-evidence.js +14 -20
- package/dist/split-identifier.d.ts +21 -0
- package/dist/split-identifier.d.ts.map +1 -0
- package/dist/split-identifier.js +27 -0
- package/dist/start-here.d.ts.map +1 -1
- package/dist/start-here.js +1 -2
- package/dist/substitute-placeholders.d.ts +8 -0
- package/dist/substitute-placeholders.d.ts.map +1 -0
- package/dist/substitute-placeholders.js +9 -0
- package/dist/symbol-index.d.ts +33 -0
- package/dist/symbol-index.d.ts.map +1 -1
- package/dist/symbol-index.js +241 -3
- package/dist/symbol-member-entry.d.ts +26 -0
- package/dist/symbol-member-entry.d.ts.map +1 -0
- package/dist/symbol-member-entry.js +1 -0
- package/dist/symbol-member-kind.d.ts +14 -0
- package/dist/symbol-member-kind.d.ts.map +1 -0
- package/dist/symbol-member-kind.js +14 -0
- package/dist/task-packet.d.ts.map +1 -1
- package/dist/task-packet.js +52 -9
- package/dist/task-ranker.d.ts +8 -0
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +25 -13
- package/dist/task-risk.js +1 -1
- package/dist/task-routing-hint-registry.d.ts +20 -1
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +186 -42
- package/dist/template-drift.d.ts.map +1 -1
- package/dist/template-drift.js +30 -9
- package/dist/template-lint.d.ts.map +1 -1
- package/dist/template-lint.js +160 -2
- package/dist/term-query.d.ts +10 -0
- package/dist/term-query.d.ts.map +1 -0
- package/dist/term-query.js +1 -0
- package/dist/test-definitions.d.ts +6 -3
- package/dist/test-definitions.d.ts.map +1 -1
- package/dist/test-runner.d.ts +95 -10
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +309 -318
- package/dist/tuning-query-tokens.d.ts +29 -0
- package/dist/tuning-query-tokens.d.ts.map +1 -0
- package/dist/tuning-query-tokens.js +51 -0
- package/dist/typecheck-files.d.ts +36 -0
- package/dist/typecheck-files.d.ts.map +1 -0
- package/dist/typecheck-files.js +158 -0
- package/dist/uncertainty.js +1 -1
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +5 -3
- package/dist/unregistered-exports.d.ts +19 -0
- package/dist/unregistered-exports.d.ts.map +1 -0
- package/dist/unregistered-exports.js +141 -0
- package/dist/unresolvable-reason.d.ts +11 -0
- package/dist/unresolvable-reason.d.ts.map +1 -0
- package/dist/unresolvable-reason.js +11 -0
- package/dist/upgrade-advisor.d.ts.map +1 -1
- package/dist/upgrade-advisor.js +16 -9
- package/dist/validate-contribution-file.d.ts +4 -0
- package/dist/validate-contribution-file.d.ts.map +1 -0
- package/dist/validate-contribution-file.js +228 -0
- package/dist/why-file.d.ts +3 -0
- package/dist/why-file.d.ts.map +1 -1
- package/dist/why-file.js +7 -3
- package/package.json +17 -17
|
@@ -1,18 +1,115 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
3
|
+
import { describeEntryValue, importModuleViaLoader, indexListPath, isMarkerObject, MARKABLE_UNIT_LISTS, MarkableUnitList, normalizeUnitMap, readContributionExport, RejectionCause, stampUnitMarks, unitProblemsOf, } from '@shrkcrft/core';
|
|
4
|
+
import { isSearchDocumentPrefix, parseSearchDocumentId, SEARCH_DOCUMENT_PREFIXES, searchKindForPrefix, } from "./search-document-id.js";
|
|
4
5
|
export const SEARCH_TUNING_SCHEMA = 'sharkcraft.search-tuning-registry/v1';
|
|
5
6
|
const CACHE = new Map();
|
|
6
7
|
const MAX_BOOST = 5;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
/** The per-boost clamp: every single boost value is clamped to ±this. */
|
|
9
|
+
export const SEARCH_TUNING_BOOST_CLAMP = MAX_BOOST;
|
|
10
|
+
/** The global cap: the total tuning delta on ONE document is clamped to ±this. */
|
|
11
|
+
export const SEARCH_TUNING_TOTAL_CAP = MAX_BOOST * 2;
|
|
12
|
+
async function importTunings(file) {
|
|
13
|
+
return readContributionExport(await importModuleViaLoader(file), { namedKeys: ['searchTuning'] });
|
|
14
|
+
}
|
|
15
|
+
/** THE list paths of the markable boost maps — the loader's marks and the lint's observations share them. */
|
|
16
|
+
export const SEARCH_TUNING_BOOST_IDS = MARKABLE_UNIT_LISTS[MarkableUnitList.SearchTuningBoostIds].listPath;
|
|
17
|
+
const TASK_HINT_BOOST_IDS = MARKABLE_UNIT_LISTS[MarkableUnitList.SearchTuningTaskHintBoostIds].listPath;
|
|
18
|
+
/** `taskHints[<i>].boostIds` — THE path a task hint's marks and observations are keyed by. */
|
|
19
|
+
export function searchTuningTaskHintBoostIdsPath(index) {
|
|
20
|
+
return indexListPath(TASK_HINT_BOOST_IDS, index);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A markable boost map (`boostIds`, `taskHints[i].boostIds`): THE core parser's
|
|
24
|
+
* problems (a value neither a number nor a `{ weight, expectEmpty: true }`
|
|
25
|
+
* marker — alpha.30 silently clamped such a value to 0), plus a marker on a key
|
|
26
|
+
* that can NEVER fire (no `<kind>:` search-document prefix, or a kind the
|
|
27
|
+
* entry's `appliesToKinds` excludes): those are defects, and an expectEmpty
|
|
28
|
+
* marker accepts only a target that does not exist yet.
|
|
29
|
+
*/
|
|
30
|
+
function markableBoostProblems(record, listPath, appliesToKinds) {
|
|
31
|
+
const n = normalizeUnitMap(record, listPath);
|
|
32
|
+
if (!n.ok)
|
|
33
|
+
return [...unitProblemsOf(n.error)];
|
|
34
|
+
const out = [];
|
|
35
|
+
for (const m of n.value.marks) {
|
|
36
|
+
const at = `${listPath}[${JSON.stringify(m.unit)}]`;
|
|
37
|
+
const parsed = parseSearchDocumentId(m.unit);
|
|
38
|
+
if (!parsed || !isSearchDocumentPrefix(parsed.prefix)) {
|
|
39
|
+
out.push(`${at}: an expectEmpty marker on a key that can never fire — a boost key is a search-document id \`<kind>:<id>\` (${SEARCH_DOCUMENT_PREFIXES.join(', ')}); fix the key (a marker accepts only a target that does not exist yet)`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const kind = searchKindForPrefix(parsed.prefix) ?? parsed.prefix;
|
|
43
|
+
if (Array.isArray(appliesToKinds) && !appliesToKinds.includes(kind)) {
|
|
44
|
+
out.push(`${at}: an expectEmpty marker on a ${kind} key its entry's appliesToKinds [${appliesToKinds.join(', ')}] excludes, so the boost can never fire — fix the key or appliesToKinds`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
/** A plain boost map (`boostTags`, `boostSources`, `taskHints[i].boostTags|boostKinds`): numbers only. */
|
|
50
|
+
function plainBoostProblems(record, field) {
|
|
51
|
+
if (!isMarkerObject(record))
|
|
52
|
+
return [`${field}: must be a map of name → number (got ${describeEntryValue(record)})`];
|
|
53
|
+
const out = [];
|
|
54
|
+
for (const [key, value] of Object.entries(record)) {
|
|
55
|
+
if (typeof value === 'number')
|
|
56
|
+
continue;
|
|
57
|
+
out.push(`${field}[${JSON.stringify(key)}]: must be a number (got ${describeEntryValue(value)})${isMarkerObject(value)
|
|
58
|
+
? ' — an expectEmpty marker is accepted only in boostIds and taskHints[].boostIds, whose keys name documents'
|
|
59
|
+
: ''}`);
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* THE search-tuning acceptance predicate (round 12, 12.1; round 13): a
|
|
65
|
+
* non-empty string `id`, and — so an older engine's silent clamp-to-0 can never
|
|
66
|
+
* recur here — every boost value a number (or, in `boostIds` /
|
|
67
|
+
* `taskHints[].boostIds`, a well-formed `{ weight, expectEmpty: true, reason? }`
|
|
68
|
+
* marker on a key that can fire), `taskHints` an array of objects with string
|
|
69
|
+
* `whenTokens`, and no authored `expectEmptyUnits` (the loader derives it).
|
|
70
|
+
* `[]` means accepted.
|
|
71
|
+
*/
|
|
72
|
+
export function searchTuningRejectionReasons(raw) {
|
|
73
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
74
|
+
return ['(entry): must be an object'];
|
|
75
|
+
const o = raw;
|
|
76
|
+
const out = [];
|
|
77
|
+
if (!(typeof o.id === 'string' && o.id.length > 0))
|
|
78
|
+
out.push('id: must be a non-empty string');
|
|
79
|
+
if ('expectEmptyUnits' in o) {
|
|
80
|
+
out.push(`expectEmptyUnits: derived by the loader — mark the boost itself: boostIds: { '<kind>:<id>': { weight, expectEmpty: true } }`);
|
|
81
|
+
}
|
|
82
|
+
if (o.boostIds !== undefined)
|
|
83
|
+
out.push(...markableBoostProblems(o.boostIds, SEARCH_TUNING_BOOST_IDS, o.appliesToKinds));
|
|
84
|
+
for (const field of ['boostTags', 'boostSources']) {
|
|
85
|
+
if (o[field] !== undefined)
|
|
86
|
+
out.push(...plainBoostProblems(o[field], field));
|
|
87
|
+
}
|
|
88
|
+
if (o.taskHints !== undefined) {
|
|
89
|
+
if (!Array.isArray(o.taskHints)) {
|
|
90
|
+
out.push(`taskHints: must be an array (got ${describeEntryValue(o.taskHints)})`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
o.taskHints.forEach((h, i) => {
|
|
94
|
+
if (!isMarkerObject(h)) {
|
|
95
|
+
out.push(`taskHints[${i}]: must be an object (got ${describeEntryValue(h)})`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const tokens = h['whenTokens'];
|
|
99
|
+
if (tokens !== undefined && (!Array.isArray(tokens) || tokens.some((t) => typeof t !== 'string'))) {
|
|
100
|
+
out.push(`taskHints[${i}].whenTokens: must be an array of strings (got ${describeEntryValue(tokens)})`);
|
|
101
|
+
}
|
|
102
|
+
if (h['boostIds'] !== undefined) {
|
|
103
|
+
out.push(...markableBoostProblems(h['boostIds'], searchTuningTaskHintBoostIdsPath(i), o.appliesToKinds));
|
|
104
|
+
}
|
|
105
|
+
for (const field of ['boostTags', 'boostKinds']) {
|
|
106
|
+
if (h[field] !== undefined)
|
|
107
|
+
out.push(...plainBoostProblems(h[field], `taskHints[${i}].${field}`));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return out;
|
|
16
113
|
}
|
|
17
114
|
function localTuningFiles(inspection) {
|
|
18
115
|
const out = [];
|
|
@@ -24,10 +121,9 @@ function localTuningFiles(inspection) {
|
|
|
24
121
|
if (existsSync(full))
|
|
25
122
|
out.push(full);
|
|
26
123
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
124
|
+
// More tuning files come from pack manifests (`contributions.searchTuningFiles`,
|
|
125
|
+
// loaded below; docs/search-tuning.md) — there is no local-config key for
|
|
126
|
+
// them; the strict config schema rejects one, so a local read could never run.
|
|
31
127
|
return out;
|
|
32
128
|
}
|
|
33
129
|
function clampBoost(value) {
|
|
@@ -39,14 +135,62 @@ function clampBoost(value) {
|
|
|
39
135
|
return -MAX_BOOST;
|
|
40
136
|
return value;
|
|
41
137
|
}
|
|
42
|
-
function sanitize(
|
|
43
|
-
|
|
138
|
+
function sanitize(input, source, packageName, sourceFile, issues, rejected, at) {
|
|
139
|
+
const reasons = searchTuningRejectionReasons(input);
|
|
140
|
+
if (reasons.length > 0) {
|
|
141
|
+
// `search tuning doctor` keeps its `missing-id` warning; THE rejection
|
|
142
|
+
// channel carries the structured record every other surface reads. An
|
|
143
|
+
// entry refused for anything else (round 13: a boost value that is neither
|
|
144
|
+
// a number nor a well-formed marker, a marker on a key that can never
|
|
145
|
+
// fire) is an ERROR — it used to load with the value clamped to 0.
|
|
146
|
+
const rawId = input.id;
|
|
147
|
+
const entryId = typeof rawId === 'string' && rawId.length > 0 ? rawId : undefined;
|
|
148
|
+
const where = `${sourceFile} (${at.exportName ?? 'default'}[${at.index}])`;
|
|
149
|
+
issues.push(entryId === undefined
|
|
150
|
+
? { severity: 'warning', code: 'missing-id', message: `Tuning entry ${where} has no id; skipped.`, source: sourceFile }
|
|
151
|
+
: {
|
|
152
|
+
severity: 'error',
|
|
153
|
+
code: 'invalid-entry',
|
|
154
|
+
message: `Tuning entry "${entryId}" in ${where} was rejected — ${reasons.join('; ')}.`,
|
|
155
|
+
tuningId: entryId,
|
|
156
|
+
source: sourceFile,
|
|
157
|
+
});
|
|
158
|
+
rejected.push({ ...at, ...(entryId !== undefined ? { entryId } : {}), reasons, cause: RejectionCause.Invalid });
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
const raw = input;
|
|
162
|
+
// THE value-form parser BEFORE the clamp (round 13): a `{ weight, expectEmpty }`
|
|
163
|
+
// value keeps its weight and joins the ledger — it is never clamped to 0 again.
|
|
164
|
+
const marks = [];
|
|
165
|
+
const idMaps = [];
|
|
166
|
+
const idMapProblems = [];
|
|
167
|
+
for (const [record, listPath] of [
|
|
168
|
+
[raw.boostIds, SEARCH_TUNING_BOOST_IDS],
|
|
169
|
+
...(raw.taskHints ?? []).map((h, i) => [h.boostIds, searchTuningTaskHintBoostIdsPath(i)]),
|
|
170
|
+
]) {
|
|
171
|
+
if (record === undefined) {
|
|
172
|
+
idMaps.push(undefined);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
const n = normalizeUnitMap(record, listPath);
|
|
176
|
+
if (!n.ok) {
|
|
177
|
+
idMapProblems.push(...unitProblemsOf(n.error));
|
|
178
|
+
idMaps.push(undefined);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
marks.push(...n.value.marks);
|
|
182
|
+
idMaps.push({ ...n.value.values });
|
|
183
|
+
}
|
|
184
|
+
if (idMapProblems.length > 0) {
|
|
185
|
+
// Unreachable past the predicate; a refusal, never a silent clamp.
|
|
44
186
|
issues.push({
|
|
45
|
-
severity: '
|
|
46
|
-
code: '
|
|
47
|
-
message:
|
|
187
|
+
severity: 'error',
|
|
188
|
+
code: 'invalid-entry',
|
|
189
|
+
message: `Tuning entry "${raw.id}" in ${sourceFile} was rejected — ${idMapProblems.join('; ')}.`,
|
|
190
|
+
tuningId: raw.id,
|
|
48
191
|
source: sourceFile,
|
|
49
192
|
});
|
|
193
|
+
rejected.push({ ...at, entryId: raw.id, reasons: idMapProblems, cause: RejectionCause.Invalid });
|
|
50
194
|
return null;
|
|
51
195
|
}
|
|
52
196
|
const out = {
|
|
@@ -55,12 +199,17 @@ function sanitize(raw, source, packageName, sourceFile, issues) {
|
|
|
55
199
|
...(packageName ? { packageName } : {}),
|
|
56
200
|
sourceFile,
|
|
57
201
|
};
|
|
202
|
+
const stamped = stampUnitMarks(marks, packageName);
|
|
203
|
+
if (stamped.length > 0)
|
|
204
|
+
out.expectEmptyUnits = stamped;
|
|
58
205
|
if (raw.appliesToKinds)
|
|
59
206
|
out.appliesToKinds = raw.appliesToKinds;
|
|
60
207
|
if (raw.mergeStrategy === 'sum' || raw.mergeStrategy === 'max') {
|
|
61
208
|
out.mergeStrategy = raw.mergeStrategy;
|
|
62
209
|
}
|
|
63
|
-
|
|
210
|
+
// `field` names the map a clamped key came from, so a consumer can tell a
|
|
211
|
+
// search-document id (`boostIds`) from a tag / source / kind name.
|
|
212
|
+
const sanitizeRecord = (rec, field) => {
|
|
64
213
|
if (!rec)
|
|
65
214
|
return undefined;
|
|
66
215
|
const result = {};
|
|
@@ -73,28 +222,35 @@ function sanitize(raw, source, packageName, sourceFile, issues) {
|
|
|
73
222
|
message: `Boost for "${k}" clamped to ${clamped} (was ${v}).`,
|
|
74
223
|
tuningId: raw.id,
|
|
75
224
|
source: sourceFile,
|
|
225
|
+
key: k,
|
|
226
|
+
field,
|
|
227
|
+
original: v,
|
|
228
|
+
clamped,
|
|
76
229
|
});
|
|
77
230
|
}
|
|
78
231
|
result[k] = clamped;
|
|
79
232
|
}
|
|
80
233
|
return result;
|
|
81
234
|
};
|
|
82
|
-
const boostTags = sanitizeRecord(raw.boostTags);
|
|
235
|
+
const boostTags = sanitizeRecord(raw.boostTags, 'boostTags');
|
|
83
236
|
if (boostTags)
|
|
84
237
|
out.boostTags = boostTags;
|
|
85
|
-
const boostIds = sanitizeRecord(
|
|
238
|
+
const boostIds = sanitizeRecord(idMaps[0], SEARCH_TUNING_BOOST_IDS);
|
|
86
239
|
if (boostIds)
|
|
87
240
|
out.boostIds = boostIds;
|
|
88
|
-
const boostSources = sanitizeRecord(raw.boostSources);
|
|
241
|
+
const boostSources = sanitizeRecord(raw.boostSources, 'boostSources');
|
|
89
242
|
if (boostSources)
|
|
90
243
|
out.boostSources = boostSources;
|
|
91
244
|
if (raw.taskHints) {
|
|
92
|
-
out.taskHints = raw.taskHints.map((h) =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
245
|
+
out.taskHints = raw.taskHints.map((h, i) => {
|
|
246
|
+
const ids = idMaps[i + 1];
|
|
247
|
+
return {
|
|
248
|
+
...(h.whenTokens ? { whenTokens: h.whenTokens.map((t) => t.toLowerCase()) } : {}),
|
|
249
|
+
...(h.boostTags ? { boostTags: sanitizeRecord(h.boostTags, `taskHints[${i}].boostTags`) } : {}),
|
|
250
|
+
...(h.boostKinds ? { boostKinds: sanitizeRecord(h.boostKinds, `taskHints[${i}].boostKinds`) } : {}),
|
|
251
|
+
...(ids ? { boostIds: sanitizeRecord(ids, searchTuningTaskHintBoostIdsPath(i)) } : {}),
|
|
252
|
+
};
|
|
253
|
+
});
|
|
98
254
|
}
|
|
99
255
|
return out;
|
|
100
256
|
}
|
|
@@ -104,18 +260,25 @@ export async function loadSearchTuning(inspection) {
|
|
|
104
260
|
.join(',')}`;
|
|
105
261
|
const cached = CACHE.get(inspection.projectRoot);
|
|
106
262
|
if (cached && cached.cacheKey === cacheKey) {
|
|
107
|
-
return { entries: cached.entries, issues: cached.issues };
|
|
263
|
+
return { entries: cached.entries, issues: cached.issues, rejected: cached.rejected };
|
|
108
264
|
}
|
|
109
265
|
const entries = [];
|
|
110
266
|
const issues = [];
|
|
267
|
+
const rejected = [];
|
|
268
|
+
const ingestAll = (exp, file, source, packageName, sourceFile) => {
|
|
269
|
+
exp.items.forEach((raw, i) => {
|
|
270
|
+
const ent = sanitize(raw, source, packageName, sourceFile, issues, rejected, {
|
|
271
|
+
file,
|
|
272
|
+
index: exp.single ? -1 : i,
|
|
273
|
+
...(exp.exportName ? { exportName: exp.exportName } : {}),
|
|
274
|
+
});
|
|
275
|
+
if (ent)
|
|
276
|
+
entries.push(ent);
|
|
277
|
+
});
|
|
278
|
+
};
|
|
111
279
|
for (const file of localTuningFiles(inspection)) {
|
|
112
280
|
try {
|
|
113
|
-
|
|
114
|
-
for (const raw of list) {
|
|
115
|
-
const ent = sanitize(raw, 'local', undefined, nodePath.relative(inspection.projectRoot, file), issues);
|
|
116
|
-
if (ent)
|
|
117
|
-
entries.push(ent);
|
|
118
|
-
}
|
|
281
|
+
ingestAll(await importTunings(file), file, 'local', undefined, nodePath.relative(inspection.projectRoot, file));
|
|
119
282
|
}
|
|
120
283
|
catch (e) {
|
|
121
284
|
issues.push({
|
|
@@ -140,12 +303,7 @@ export async function loadSearchTuning(inspection) {
|
|
|
140
303
|
continue;
|
|
141
304
|
}
|
|
142
305
|
try {
|
|
143
|
-
|
|
144
|
-
for (const raw of list) {
|
|
145
|
-
const ent = sanitize(raw, 'pack', pack.packageName, rel, issues);
|
|
146
|
-
if (ent)
|
|
147
|
-
entries.push(ent);
|
|
148
|
-
}
|
|
306
|
+
ingestAll(await importTunings(file), file, 'pack', pack.packageName, rel);
|
|
149
307
|
}
|
|
150
308
|
catch (e) {
|
|
151
309
|
issues.push({
|
|
@@ -157,8 +315,8 @@ export async function loadSearchTuning(inspection) {
|
|
|
157
315
|
}
|
|
158
316
|
}
|
|
159
317
|
}
|
|
160
|
-
CACHE.set(inspection.projectRoot, { cacheKey, entries, issues });
|
|
161
|
-
return { entries, issues };
|
|
318
|
+
CACHE.set(inspection.projectRoot, { cacheKey, entries, issues, rejected });
|
|
319
|
+
return { entries, issues, rejected };
|
|
162
320
|
}
|
|
163
321
|
export function listSearchTuning(inspection) {
|
|
164
322
|
const cached = CACHE.get(inspection.projectRoot);
|
|
@@ -286,10 +444,17 @@ export function tuningBoostFor(doc, tokens, entries) {
|
|
|
286
444
|
reasons.push(`tuning:${c.tuningId} ${key} ${c.value > 0 ? '+' : ''}${c.value}${contributors.length > 1 ? ' (strategy=' + strategy + ')' : ''}`);
|
|
287
445
|
}
|
|
288
446
|
}
|
|
289
|
-
// Global cap so tuning can't dominate the natural signal
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
if (delta
|
|
293
|
-
delta =
|
|
447
|
+
// Global cap so tuning can't dominate the natural signal — reported, never
|
|
448
|
+
// silent: the reason names what was discarded.
|
|
449
|
+
const raw = delta;
|
|
450
|
+
if (delta > SEARCH_TUNING_TOTAL_CAP)
|
|
451
|
+
delta = SEARCH_TUNING_TOTAL_CAP;
|
|
452
|
+
if (delta < -SEARCH_TUNING_TOTAL_CAP)
|
|
453
|
+
delta = -SEARCH_TUNING_TOTAL_CAP;
|
|
454
|
+
if (delta !== raw) {
|
|
455
|
+
const signed = (n) => `${n > 0 ? '+' : ''}${n}`;
|
|
456
|
+
reasons.push(`tuning-cap: raw ${signed(raw)} -> ${signed(delta)}`);
|
|
457
|
+
return { delta, reasons, composition, capped: { raw, applied: delta } };
|
|
458
|
+
}
|
|
294
459
|
return { delta, reasons, composition };
|
|
295
460
|
}
|
package/dist/self-audit.d.ts
CHANGED
|
@@ -35,6 +35,18 @@ export interface ISelfAuditReport {
|
|
|
35
35
|
findings: readonly ISelfAuditFinding[];
|
|
36
36
|
ok: boolean;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* THE host authority: is `projectRoot` SharkCraft's OWN repository? Every
|
|
40
|
+
* "is this the tool repo" decision reads it — `self audit`, `install smoke`,
|
|
41
|
+
* the MCP self-audit tool, and the surface tier resolver that gates
|
|
42
|
+
* tool-maintenance commands (round 11 §5.1) everywhere else.
|
|
43
|
+
*
|
|
44
|
+
* The tool's identity is its CLI package: `packages/cli/package.json` named
|
|
45
|
+
* `@shrkcrft/cli`, plus either the root package named `sharkcraft` or the
|
|
46
|
+
* sibling inspector + mcp-server packages. Directory markers alone would
|
|
47
|
+
* misfire on any consumer monorepo that happens to have `packages/cli`,
|
|
48
|
+
* `packages/inspector` and `packages/mcp-server`.
|
|
49
|
+
*/
|
|
38
50
|
export declare function detectSharkcraftRepo(projectRoot: string): boolean;
|
|
39
51
|
export interface ISelfAuditInput {
|
|
40
52
|
/** Caller can pass pre-computed verdicts. */
|
package/dist/self-audit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-audit.d.ts","sourceRoot":"","sources":["../src/self-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,iBAAiB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,EAAE,EAAE,OAAO,CAAC;CACb;
|
|
1
|
+
{"version":3,"file":"self-audit.d.ts","sourceRoot":"","sources":["../src/self-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,iBAAiB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,EAAE,EAAE,OAAO,CAAC;CACb;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAYjE;AAYD,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,GAAE,eAAoB,GAAG,gBAAgB,CAkIjG;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAWpE"}
|
package/dist/self-audit.js
CHANGED
|
@@ -21,20 +21,44 @@
|
|
|
21
21
|
import { existsSync, readFileSync } from 'node:fs';
|
|
22
22
|
import * as nodePath from 'node:path';
|
|
23
23
|
export const SELF_AUDIT_SCHEMA = 'sharkcraft.self-audit/v1';
|
|
24
|
+
/** The package name of the CLI inside SharkCraft's own repository. */
|
|
25
|
+
const TOOL_CLI_PACKAGE = '@shrkcrft/cli';
|
|
26
|
+
/**
|
|
27
|
+
* THE host authority: is `projectRoot` SharkCraft's OWN repository? Every
|
|
28
|
+
* "is this the tool repo" decision reads it — `self audit`, `install smoke`,
|
|
29
|
+
* the MCP self-audit tool, and the surface tier resolver that gates
|
|
30
|
+
* tool-maintenance commands (round 11 §5.1) everywhere else.
|
|
31
|
+
*
|
|
32
|
+
* The tool's identity is its CLI package: `packages/cli/package.json` named
|
|
33
|
+
* `@shrkcrft/cli`, plus either the root package named `sharkcraft` or the
|
|
34
|
+
* sibling inspector + mcp-server packages. Directory markers alone would
|
|
35
|
+
* misfire on any consumer monorepo that happens to have `packages/cli`,
|
|
36
|
+
* `packages/inspector` and `packages/mcp-server`.
|
|
37
|
+
*/
|
|
24
38
|
export function detectSharkcraftRepo(projectRoot) {
|
|
25
39
|
const pkgFile = nodePath.join(projectRoot, 'package.json');
|
|
26
40
|
if (!existsSync(pkgFile))
|
|
27
41
|
return false;
|
|
28
42
|
try {
|
|
29
43
|
const pkg = JSON.parse(readFileSync(pkgFile, 'utf8'));
|
|
44
|
+
if (!hasToolCliPackage(projectRoot))
|
|
45
|
+
return false;
|
|
30
46
|
if (pkg.name === 'sharkcraft')
|
|
31
47
|
return true;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
const markers = ['packages/inspector', 'packages/mcp-server'];
|
|
49
|
+
return markers.every((m) => existsSync(nodePath.join(projectRoot, m)));
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
36
52
|
return false;
|
|
37
53
|
}
|
|
54
|
+
}
|
|
55
|
+
function hasToolCliPackage(projectRoot) {
|
|
56
|
+
const cliPkg = nodePath.join(projectRoot, 'packages', 'cli', 'package.json');
|
|
57
|
+
if (!existsSync(cliPkg))
|
|
58
|
+
return false;
|
|
59
|
+
try {
|
|
60
|
+
return JSON.parse(readFileSync(cliPkg, 'utf8')).name === TOOL_CLI_PACKAGE;
|
|
61
|
+
}
|
|
38
62
|
catch {
|
|
39
63
|
return false;
|
|
40
64
|
}
|
|
@@ -52,8 +76,10 @@ export function buildSelfAudit(projectRoot, input = {}) {
|
|
|
52
76
|
id: 'not-sharkcraft-repo',
|
|
53
77
|
title: 'Self audit applies only to the SharkCraft monorepo',
|
|
54
78
|
status: 'skipped',
|
|
55
|
-
|
|
56
|
-
|
|
79
|
+
// `release readiness` is itself a tool-maintenance command (gated
|
|
80
|
+
// outside the tool repo); `quality` is the consumer's own gate.
|
|
81
|
+
message: 'Run `shrk quality` instead for this repository\'s own pre-push verdict.',
|
|
82
|
+
nextCommand: 'shrk quality',
|
|
57
83
|
},
|
|
58
84
|
],
|
|
59
85
|
ok: true,
|
|
@@ -129,8 +155,8 @@ export function buildSelfAudit(projectRoot, input = {}) {
|
|
|
129
155
|
id: 'mcp-audit',
|
|
130
156
|
title: 'MCP audit — no write tools',
|
|
131
157
|
status: 'skipped',
|
|
132
|
-
message: 'No verdict supplied — run `shrk
|
|
133
|
-
nextCommand: 'shrk
|
|
158
|
+
message: 'No verdict supplied — run `shrk safety audit`.',
|
|
159
|
+
nextCommand: 'shrk safety audit',
|
|
134
160
|
});
|
|
135
161
|
}
|
|
136
162
|
else if (input.mcpAuditWriteToolCount === 0) {
|
|
@@ -147,7 +173,7 @@ export function buildSelfAudit(projectRoot, input = {}) {
|
|
|
147
173
|
title: 'MCP audit — no write tools',
|
|
148
174
|
status: 'fail',
|
|
149
175
|
message: `${input.mcpAuditWriteToolCount} MCP tool(s) report write capability — this breaks the safety contract.`,
|
|
150
|
-
nextCommand: 'shrk
|
|
176
|
+
nextCommand: 'shrk safety audit',
|
|
151
177
|
});
|
|
152
178
|
}
|
|
153
179
|
const flag = (id, title, ok, nextCommand) => {
|
|
@@ -166,7 +192,7 @@ export function buildSelfAudit(projectRoot, input = {}) {
|
|
|
166
192
|
flag('runtime-doctor', 'Runtime doctor', input.runtimeDoctorOk ?? null, 'shrk runtime doctor');
|
|
167
193
|
flag('compat-node', 'compat:node', input.compatNodeOk ?? null, 'bun run compat:node');
|
|
168
194
|
flag('packs-doctor', 'Packs doctor', input.packsDoctorOk ?? null, 'shrk packs doctor --release');
|
|
169
|
-
flag('demo-package-validate', 'Demo package validate', input.demoPackageValidateOk ?? null, 'shrk
|
|
195
|
+
flag('demo-package-validate', 'Demo package validate', input.demoPackageValidateOk ?? null, 'shrk release smoke');
|
|
170
196
|
const ok = findings.filter((f) => f.status === 'fail').length === 0;
|
|
171
197
|
return {
|
|
172
198
|
schema: SELF_AUDIT_SCHEMA,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { RejectionCause, type IUnitLiveness } from '@shrkcrft/core';
|
|
2
|
+
import { ContributionKind } from './contribution-kind.js';
|
|
3
|
+
import type { IUnresolvableReference } from './i-unresolvable-reference.js';
|
|
4
|
+
import type { IUnresolvableReferenceScan } from './i-unresolvable-reference-scan.js';
|
|
5
|
+
import type { IVerdictCoverage } from '@shrkcrft/core';
|
|
6
|
+
import type { IDeclaredXrefReport } from './i-declared-xref-report.js';
|
|
1
7
|
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
2
8
|
export declare const SELF_CONFIG_DOCTOR_V2_SCHEMA = "sharkcraft.self-config-doctor/v2";
|
|
3
9
|
export declare enum SelfConfigSeverityV2 {
|
|
@@ -7,9 +13,23 @@ export declare enum SelfConfigSeverityV2 {
|
|
|
7
13
|
}
|
|
8
14
|
/**
|
|
9
15
|
* Source / target kind taxonomy. Open string for forward-compat with
|
|
10
|
-
* pack-contributed kinds, but the engine emits one of these values
|
|
16
|
+
* pack-contributed kinds, but the engine emits one of these values:
|
|
17
|
+
*
|
|
18
|
+
* - every reference kind maps onto ITSELF (THE table behind `selfKindOf`);
|
|
19
|
+
* - `search-document` — a `<prefix>:<id>` search document whose prefix has no
|
|
20
|
+
* id registry (`doc:README.md`), or the cap summary's "N more document(s)":
|
|
21
|
+
* it exists (or cannot be checked) — it is never "unknown";
|
|
22
|
+
* - `schema` — a declaration-shape finding (relation `validates`) whose target
|
|
23
|
+
* id is the field path (`taskHints[1].whenTokens`, `facets.bad-kind[k1]`);
|
|
24
|
+
* - `self-config` — the doctor itself (its own probe summaries);
|
|
25
|
+
* - every contribution kind maps onto a finding kind (THE table behind
|
|
26
|
+
* `rejectionFindingOf`), so a rejected entry of any loader-backed slot —
|
|
27
|
+
* a construct facet, a feedback rule, a gate-plane rule — has a kind;
|
|
28
|
+
* - `unknown` — RESERVED for a target id that resolves in NO registry, as THE
|
|
29
|
+
* id resolver / THE key resolver answered. Only `selfKindOf(undefined)`
|
|
30
|
+
* produces it (a source lock holds that; round 12, 12.4).
|
|
11
31
|
*/
|
|
12
|
-
export type SelfConfigKind = 'knowledge' | 'command' | 'helper' | 'template' | 'playbook' | 'pipeline' | 'policy' | 'rule' | 'path' | 'convention' | 'registration-hint' | 'routing-hint' | 'agent-test' | 'decision' | '
|
|
32
|
+
export type SelfConfigKind = 'knowledge' | 'command' | 'helper' | 'template' | 'playbook' | 'pipeline' | 'policy' | 'rule' | 'path' | 'convention' | 'registration-hint' | 'routing-hint' | 'agent-test' | 'decision' | 'construct' | 'preset' | 'migration-profile' | 'workspace-profile' | 'contract-template' | 'pack' | 'schema' | 'file' | 'directory' | 'symbol' | 'package' | 'url' | 'path-convention' | 'boundary-rule' | 'scaffold-pattern' | 'search-tuning' | 'search-document' | 'self-config' | 'construct-facet' | 'feedback-rule' | 'context-test' | 'docs' | 'delegate-recipe' | 'framework-extractor' | 'wiring-rule' | 'registry' | 'registration-idiom' | 'policy-rule' | 'reuse-primitive' | 'baseline' | 'generated-artifact' | 'doc-reference' | 'unknown';
|
|
13
33
|
/**
|
|
14
34
|
* Edge relation taxonomy. Open string to allow future relations.
|
|
15
35
|
*/
|
|
@@ -34,6 +54,11 @@ export interface ISelfConfigFindingV2 {
|
|
|
34
54
|
* - low — derived from regex / fallback parsing
|
|
35
55
|
*/
|
|
36
56
|
readonly confidence: 'high' | 'medium' | 'low';
|
|
57
|
+
/**
|
|
58
|
+
* How many times the same (source, relation, target, code) was found — one
|
|
59
|
+
* finding per repeat, never N identical ones sharing a "unique" id.
|
|
60
|
+
*/
|
|
61
|
+
readonly occurrences?: number;
|
|
37
62
|
}
|
|
38
63
|
export interface ISelfConfigDoctorReportV2 {
|
|
39
64
|
readonly schema: typeof SELF_CONFIG_DOCTOR_V2_SCHEMA;
|
|
@@ -48,10 +73,127 @@ export interface ISelfConfigDoctorReportV2 {
|
|
|
48
73
|
bySourceKind: Readonly<Record<string, number>>;
|
|
49
74
|
byTargetKind: Readonly<Record<string, number>>;
|
|
50
75
|
}>;
|
|
51
|
-
|
|
76
|
+
/**
|
|
77
|
+
* `errors` when any error finding; else `unverified` when any `coverage`
|
|
78
|
+
* record has a shortfall (a dead or unverifiable unit — the CLI exits 2);
|
|
79
|
+
* else `warnings` / `ok`.
|
|
80
|
+
*/
|
|
81
|
+
readonly verdict: 'ok' | 'warnings' | 'errors' | 'unverified';
|
|
52
82
|
readonly nextCommands: readonly string[];
|
|
83
|
+
/**
|
|
84
|
+
* Per-unit coverage of every probe family — the ONE list both the verdict
|
|
85
|
+
* above and the CLI's settled exit are derived from (core's
|
|
86
|
+
* `coverageShortfall`): `command strings`, `search tuning` boost keys and
|
|
87
|
+
* task hints, `routing hints` and their recommended ids, `registration
|
|
88
|
+
* hints` discovery selectors and related ids, `scaffold patterns` globs and
|
|
89
|
+
* patterns. A family with no units contributes no record.
|
|
90
|
+
*/
|
|
91
|
+
readonly coverage: readonly IVerdictCoverage[];
|
|
92
|
+
/** Every UNMARKED dead unit (a selector that matches nothing, a boost that never fires), labelled — THE families' settled `dead`. */
|
|
93
|
+
readonly deadUnits: readonly string[];
|
|
94
|
+
/**
|
|
95
|
+
* Round 13: every selector unit THE families' settles did not find live —
|
|
96
|
+
* dead, intended-empty (its acceptance rides in {@link coverage}), went-live
|
|
97
|
+
* (a stale `expectEmpty` marker) or unproven — with its state and marker.
|
|
98
|
+
* What `--fail-on-dead-units` decides on (`selectorUnitFails`, through
|
|
99
|
+
* `assetDoctorProposedExit`), so a stale LOCAL marker fails there too.
|
|
100
|
+
*/
|
|
101
|
+
readonly selectorUnits: readonly IUnitLiveness[];
|
|
102
|
+
/**
|
|
103
|
+
* Every declared reference the REFERENCE probes could not check — its kind's
|
|
104
|
+
* registry is empty here (`registry-empty`), or nothing can ever fill it
|
|
105
|
+
* (`undeclarable-kind`) — attributed to its file and field (round 12,
|
|
106
|
+
* ONE-CHANGE). Each is an unexamined unit of a coverage record above; `shrk
|
|
107
|
+
* packs contributions` groups the same list per contributed file.
|
|
108
|
+
*/
|
|
109
|
+
readonly unresolvableReferences: readonly IUnresolvableReference[];
|
|
110
|
+
/**
|
|
111
|
+
* What the probe passes looked at. `command` covers every command string an
|
|
112
|
+
* asset prescribes (agent tests, routing / registration hints, pipeline
|
|
113
|
+
* steps, playbooks, constructs, presets, knowledge action hints and
|
|
114
|
+
* references, decisions), deduped per (asset, command), each resolved
|
|
115
|
+
* through the injected command resolver. `unverified > 0` means no resolver
|
|
116
|
+
* was injected (outside the CLI): those strings were NOT checked.
|
|
117
|
+
*/
|
|
118
|
+
readonly probes: Readonly<{
|
|
119
|
+
command: Readonly<{
|
|
120
|
+
probed: number;
|
|
121
|
+
/** Resolved to a real command (`ok`). */
|
|
122
|
+
exists: number;
|
|
123
|
+
/** Verb proven, internally-dispatched tail not provable — counted, never flagged. */
|
|
124
|
+
prefixOnly: number;
|
|
125
|
+
/** Not a command this engine checks (git, tsc, …) — skipped, counted. */
|
|
126
|
+
notShrk: number;
|
|
127
|
+
/** Did not resolve — one `unknown-command` finding each. */
|
|
128
|
+
unknown: number;
|
|
129
|
+
/** Not checked: no command resolver injected. */
|
|
130
|
+
unverified: number;
|
|
131
|
+
}>;
|
|
132
|
+
/**
|
|
133
|
+
* Distinct search-tuning boost keys (`<kind>:<id>` search-document ids),
|
|
134
|
+
* resolved within the named kind through THE key resolver.
|
|
135
|
+
*/
|
|
136
|
+
'search-tuning-target': Readonly<{
|
|
137
|
+
probed: number;
|
|
138
|
+
resolved: number;
|
|
139
|
+
missing: number;
|
|
140
|
+
unprefixed: number;
|
|
141
|
+
unknownKind: number;
|
|
142
|
+
unverified: number;
|
|
143
|
+
}>;
|
|
144
|
+
/** Non-command routing-hint `recommends` ids, one per (hint, channel, id). */
|
|
145
|
+
'routing-hint-target': Readonly<{
|
|
146
|
+
probed: number;
|
|
147
|
+
resolved: number;
|
|
148
|
+
missing: number;
|
|
149
|
+
unverified: number;
|
|
150
|
+
}>;
|
|
151
|
+
}>;
|
|
152
|
+
/**
|
|
153
|
+
* The declared cross-reference pass (round 11, 4.2): every id in a
|
|
154
|
+
* `related`-style asset field, resolved through the reference registry by
|
|
155
|
+
* THE collector (`declared-cross-references.ts`). What it examined is
|
|
156
|
+
* reported even when nothing dangles, so a pass over zero ids never reads as
|
|
157
|
+
* a clean one; its coverage record rides in {@link coverage}.
|
|
158
|
+
*/
|
|
159
|
+
readonly crossReferences?: Readonly<{
|
|
160
|
+
examined: IDeclaredXrefReport['examined'];
|
|
161
|
+
counts: IDeclaredXrefReport['counts'];
|
|
162
|
+
summary: string;
|
|
163
|
+
}>;
|
|
53
164
|
}
|
|
165
|
+
/** A rejected entry's finding kind and code — THE table above, never a fallback. */
|
|
166
|
+
export declare function rejectionFindingOf(kind: ContributionKind, cause: RejectionCause): {
|
|
167
|
+
readonly kind: SelfConfigKind;
|
|
168
|
+
readonly code: string;
|
|
169
|
+
readonly doctor: string;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* THE "this finding reports a reference that resolved nowhere" predicate: a
|
|
173
|
+
* `*-missing` code (an id, or a referenced file), any severity — the family
|
|
174
|
+
* r73 reads as "unknown id". The CLI's exit-0 line counts the INFO-severity
|
|
175
|
+
* ones instead of certifying "every checked probe resolved" over them.
|
|
176
|
+
*/
|
|
177
|
+
export declare function isUnresolvedReferenceFinding(finding: Pick<ISelfConfigFindingV2, 'code'>): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* THE "this reference resolved, but only as a kind its field does not accept"
|
|
180
|
+
* predicate: a `*-wrong-kind` code (`xref-wrong-kind`, a pipeline step naming a
|
|
181
|
+
* construct). Not unresolved — `unknown:` is reserved for that — and not a
|
|
182
|
+
* clean resolution either, so the CLI's exit-0 line counts an info-severity one
|
|
183
|
+
* instead of certifying "every checked probe resolved".
|
|
184
|
+
*/
|
|
185
|
+
export declare function isWrongKindReferenceFinding(finding: Pick<ISelfConfigFindingV2, 'code'>): boolean;
|
|
54
186
|
export declare function buildSelfConfigDoctorReportV2(inspection: ISharkcraftInspection): Promise<ISelfConfigDoctorReportV2>;
|
|
187
|
+
/**
|
|
188
|
+
* Every declared reference that could not be resolved because its kind's
|
|
189
|
+
* registry is empty here, or can never be filled (round 12, ONE-CHANGE) —
|
|
190
|
+
* running EXACTLY the doctor's reference probes (template metadata, routing
|
|
191
|
+
* `recommends`, registration-hint and convention id fields, declared
|
|
192
|
+
* cross-references) over a warmed inspection, without the rest of the doctor.
|
|
193
|
+
* `buildSelfConfigDoctorReportV2` carries the same list, so the doctor and
|
|
194
|
+
* `shrk packs contributions` cannot disagree.
|
|
195
|
+
*/
|
|
196
|
+
export declare function collectUnresolvableReferences(inspection: ISharkcraftInspection): Promise<IUnresolvableReferenceScan>;
|
|
55
197
|
export declare function renderSelfConfigDoctorV2Text(report: ISelfConfigDoctorReportV2): string;
|
|
56
198
|
export declare function renderSelfConfigDoctorV2Markdown(report: ISelfConfigDoctorReportV2): string;
|
|
57
199
|
//# sourceMappingURL=self-config-doctor-v2.d.ts.map
|