@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
package/dist/test-runner.js
CHANGED
|
@@ -5,57 +5,138 @@ import { buildTaskPacket } from "./task-packet.js";
|
|
|
5
5
|
import { rankKnowledgeEntries } from "./task-ranker.js";
|
|
6
6
|
import { contextTuningBoostFor } from "./context-tuning.js";
|
|
7
7
|
import { buildProjectOverview, renderOverviewText } from "./project-overview.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { importModuleViaLoader, RejectionCause } from '@shrkcrft/core';
|
|
9
|
+
import { CommandResolutionStatus } from "./command-resolution-status.js";
|
|
10
|
+
import { COMMAND_INDEX_NOT_INJECTED, isCacheBackedKind, isCommandResolved, isReferenceCacheWarm, referenceIdExists, referenceIdsFor, resolveShrkCommandReference, warmReferenceRegistries, } from "./reference-registry.js";
|
|
11
|
+
/** The `list` verb that prints each registry — named in every diagnostic. */
|
|
12
|
+
const LIST_VERBS = Object.freeze({
|
|
13
|
+
template: 'shrk templates list',
|
|
14
|
+
rule: 'shrk rules list',
|
|
15
|
+
pipeline: 'shrk pipelines list',
|
|
16
|
+
helper: 'shrk helper list',
|
|
17
|
+
playbook: 'shrk playbooks list',
|
|
18
|
+
policy: 'shrk policy list',
|
|
19
|
+
construct: 'shrk constructs list',
|
|
20
|
+
knowledge: 'shrk knowledge list',
|
|
21
|
+
command: 'shrk surface list',
|
|
22
|
+
});
|
|
23
|
+
function consulted(inspection, kind) {
|
|
24
|
+
return {
|
|
25
|
+
kind,
|
|
26
|
+
listVerb: LIST_VERBS[kind] ?? `shrk ${kind} list`,
|
|
27
|
+
size: kind === 'command' ? 0 : referenceIdsFor(inspection, kind).length,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* THE existence answer for a test expectation — the shared reference registry,
|
|
32
|
+
* never a private set. A cache-backed kind read before the registries were
|
|
33
|
+
* warmed is `unverifiable`, not "your correct id does not exist".
|
|
34
|
+
*/
|
|
35
|
+
function existence(inspection, kind, id) {
|
|
36
|
+
if (referenceIdExists(inspection, kind, id))
|
|
37
|
+
return 'exists';
|
|
38
|
+
if (isCacheBackedKind(kind) && !isReferenceCacheWarm(inspection))
|
|
39
|
+
return 'unverifiable';
|
|
40
|
+
return 'missing';
|
|
41
|
+
}
|
|
42
|
+
/** A test file's default array; `error` (first line) when the import threw. A missing file is `[]`. */
|
|
10
43
|
async function importDefaultArray(absPath) {
|
|
11
44
|
if (!existsSync(absPath))
|
|
12
|
-
return [];
|
|
45
|
+
return { items: [] };
|
|
13
46
|
try {
|
|
14
47
|
const mod = (await importModuleViaLoader(absPath));
|
|
15
|
-
return Array.isArray(mod.default) ? mod.default : [];
|
|
48
|
+
return { items: Array.isArray(mod.default) ? mod.default : [] };
|
|
16
49
|
}
|
|
17
|
-
catch {
|
|
18
|
-
return [];
|
|
50
|
+
catch (e) {
|
|
51
|
+
return { items: [], error: (e.message ?? String(e)).split('\n')[0].trim() };
|
|
19
52
|
}
|
|
20
53
|
}
|
|
21
54
|
/**
|
|
22
|
-
*
|
|
55
|
+
* THE context / agent-contract test acceptance predicate (round 12, 12.1): a
|
|
56
|
+
* non-empty string `id` and a string `task` — `[]` means accepted. Tests used
|
|
57
|
+
* to load with no per-entry validation (a test without a `task` ran against
|
|
58
|
+
* `undefined`), and a file that failed to import became `[]` in silence.
|
|
23
59
|
*/
|
|
24
|
-
export
|
|
60
|
+
export function testDefinitionRejectionReasons(raw) {
|
|
61
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
62
|
+
return ['(entry): must be an object'];
|
|
63
|
+
const t = raw;
|
|
64
|
+
const out = [];
|
|
65
|
+
if (typeof t.id !== 'string' || t.id.length === 0)
|
|
66
|
+
out.push('id: must be a non-empty string');
|
|
67
|
+
if (typeof t.task !== 'string')
|
|
68
|
+
out.push('task: must be a string');
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
async function loadTestDefinitions(inspection, localName, slot) {
|
|
25
72
|
const tests = [];
|
|
73
|
+
const entries = [];
|
|
74
|
+
const issues = [];
|
|
75
|
+
const rejected = [];
|
|
76
|
+
const readInto = async (file, packageName) => {
|
|
77
|
+
const r = await importDefaultArray(file);
|
|
78
|
+
const rel = nodePath.relative(inspection.projectRoot, file) || file;
|
|
79
|
+
if (r.error !== undefined) {
|
|
80
|
+
issues.push({
|
|
81
|
+
severity: 'warning',
|
|
82
|
+
code: 'load-failed',
|
|
83
|
+
message: `${packageName ? `Pack ${packageName} (${rel})` : `Failed to load ${rel}`}: ${r.error}`,
|
|
84
|
+
source: file,
|
|
85
|
+
...(packageName ? { packageName } : {}),
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
r.items.forEach((item, index) => {
|
|
90
|
+
const reasons = testDefinitionRejectionReasons(item);
|
|
91
|
+
if (reasons.length > 0) {
|
|
92
|
+
const id = item && typeof item === 'object' ? item.id : undefined;
|
|
93
|
+
rejected.push({
|
|
94
|
+
file,
|
|
95
|
+
index,
|
|
96
|
+
exportName: 'default',
|
|
97
|
+
...(typeof id === 'string' && id.length > 0 ? { entryId: id } : {}),
|
|
98
|
+
reasons,
|
|
99
|
+
cause: RejectionCause.Invalid,
|
|
100
|
+
});
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
tests.push(item);
|
|
104
|
+
entries.push({ id: item.id, file, ...(packageName ? { packageName } : {}) });
|
|
105
|
+
});
|
|
106
|
+
};
|
|
26
107
|
// Local config file.
|
|
27
108
|
if (inspection.sharkcraftDir) {
|
|
28
|
-
const local = nodePath.join(inspection.sharkcraftDir,
|
|
29
|
-
if (existsSync(local))
|
|
30
|
-
|
|
31
|
-
}
|
|
109
|
+
const local = nodePath.join(inspection.sharkcraftDir, localName);
|
|
110
|
+
if (existsSync(local))
|
|
111
|
+
await readInto(local);
|
|
32
112
|
}
|
|
33
113
|
// Pack contributions.
|
|
34
114
|
for (const pack of inspection.packs.validPacks) {
|
|
35
115
|
const c = pack.manifest.contributions;
|
|
36
|
-
for (const rel of c
|
|
37
|
-
|
|
38
|
-
tests.push(...(await importDefaultArray(full)));
|
|
39
|
-
}
|
|
116
|
+
for (const rel of c[slot] ?? [])
|
|
117
|
+
await readInto(nodePath.resolve(pack.packageRoot, rel), pack.packageName);
|
|
40
118
|
}
|
|
41
|
-
return tests;
|
|
119
|
+
return { tests, entries, issues, rejected };
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Context tests WITH what did not take effect (round 12, 12.1): files that
|
|
123
|
+
* failed to import and every declared test the loader refused.
|
|
124
|
+
*/
|
|
125
|
+
export async function loadContextTestsWithIssues(inspection) {
|
|
126
|
+
return loadTestDefinitions(inspection, 'context-tests.ts', 'contextTestFiles');
|
|
127
|
+
}
|
|
128
|
+
/** Agent-contract tests WITH what did not take effect (round 12, 12.1). */
|
|
129
|
+
export async function loadAgentContractTestsWithIssues(inspection) {
|
|
130
|
+
return loadTestDefinitions(inspection, 'agent-tests.ts', 'agentTestFiles');
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Load context tests from local sharkcraft config + any pack contributions.
|
|
134
|
+
*/
|
|
135
|
+
export async function loadContextTests(inspection) {
|
|
136
|
+
return [...(await loadContextTestsWithIssues(inspection)).tests];
|
|
42
137
|
}
|
|
43
138
|
export async function loadAgentContractTests(inspection) {
|
|
44
|
-
|
|
45
|
-
if (inspection.sharkcraftDir) {
|
|
46
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'agent-tests.ts');
|
|
47
|
-
if (existsSync(local)) {
|
|
48
|
-
tests.push(...(await importDefaultArray(local)));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
for (const pack of inspection.packs.validPacks) {
|
|
52
|
-
const c = pack.manifest.contributions;
|
|
53
|
-
for (const rel of c.agentTestFiles ?? []) {
|
|
54
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
55
|
-
tests.push(...(await importDefaultArray(full)));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return tests;
|
|
139
|
+
return [...(await loadAgentContractTestsWithIssues(inspection)).tests];
|
|
59
140
|
}
|
|
60
141
|
export function runContextTest(inspection, test) {
|
|
61
142
|
const overview = buildProjectOverview(inspection.workspace, inspection.config?.projectName);
|
|
@@ -88,29 +169,33 @@ export function runContextTest(inspection, test) {
|
|
|
88
169
|
// Diagnostics: only populate on failure. Show the top-ranked alternatives
|
|
89
170
|
// the ranker chose for the task, so the test author can see what beat the
|
|
90
171
|
// expected entry — and tighten the rule's appliesWhen/tags accordingly.
|
|
172
|
+
// `mustInclude` is a RANKER-SURFACED assertion; whether the id exists at all
|
|
173
|
+
// is answered by the shared registry, the set `shrk knowledge list` prints.
|
|
91
174
|
let diagnostics;
|
|
92
175
|
if (!passed) {
|
|
93
176
|
const ranked = rankKnowledgeEntries(inspection.knowledgeEntries, test.task);
|
|
177
|
+
const knowledgeRegistry = consulted(inspection, 'knowledge');
|
|
94
178
|
diagnostics = [];
|
|
95
179
|
for (const id of missingInclude) {
|
|
96
|
-
const exists = inspection
|
|
180
|
+
const exists = referenceIdExists(inspection, 'knowledge', id);
|
|
97
181
|
diagnostics.push({
|
|
98
182
|
id,
|
|
99
183
|
existsInRegistry: exists,
|
|
184
|
+
consulted: knowledgeRegistry,
|
|
100
185
|
topAlternatives: ranked.slice(0, 5).map((r) => ({
|
|
101
186
|
id: r.item.id,
|
|
102
187
|
score: r.score,
|
|
103
188
|
reasons: r.reasons,
|
|
104
189
|
})),
|
|
105
|
-
suggestions: buildMissingIncludeSuggestions(id, exists, test.task),
|
|
190
|
+
suggestions: buildMissingIncludeSuggestions(id, exists, test.task, knowledgeRegistry),
|
|
106
191
|
});
|
|
107
192
|
}
|
|
108
193
|
for (const id of unexpectedInclude) {
|
|
109
|
-
const entry = inspection.knowledgeEntries.find((e) => e.id === id);
|
|
110
194
|
const reasons = ranked.find((r) => r.item.id === id)?.reasons ?? [];
|
|
111
195
|
diagnostics.push({
|
|
112
196
|
id,
|
|
113
|
-
existsInRegistry:
|
|
197
|
+
existsInRegistry: referenceIdExists(inspection, 'knowledge', id),
|
|
198
|
+
consulted: knowledgeRegistry,
|
|
114
199
|
topAlternatives: reasons.length
|
|
115
200
|
? [{ id, score: ranked.find((r) => r.item.id === id)?.score ?? 0, reasons }]
|
|
116
201
|
: undefined,
|
|
@@ -138,10 +223,10 @@ export function runContextTest(inspection, test) {
|
|
|
138
223
|
result.diagnostics = diagnostics;
|
|
139
224
|
return result;
|
|
140
225
|
}
|
|
141
|
-
function buildMissingIncludeSuggestions(id, existsInRegistry, task) {
|
|
226
|
+
function buildMissingIncludeSuggestions(id, existsInRegistry, task, registry) {
|
|
142
227
|
if (!existsInRegistry) {
|
|
143
228
|
return [
|
|
144
|
-
`Entry "${id}"
|
|
229
|
+
`Entry "${id}" is not in the knowledge registry (the ${registry.size} ids \`${registry.listVerb}\` prints) — this expectation can never pass. Install the pack that ships it or correct the id.`,
|
|
145
230
|
`If the test expectation is wrong, update sharkcraft/context-tests.ts.`,
|
|
146
231
|
];
|
|
147
232
|
}
|
|
@@ -153,38 +238,91 @@ function buildMissingIncludeSuggestions(id, existsInRegistry, task) {
|
|
|
153
238
|
`Or raise its priority / shorten the title to include task-relevant tokens.`,
|
|
154
239
|
];
|
|
155
240
|
}
|
|
156
|
-
export function runAgentContractTest(inspection, test,
|
|
241
|
+
export function runAgentContractTest(inspection, test,
|
|
242
|
+
/** @deprecated Ignored — existence resolves through the shared reference registry. */
|
|
243
|
+
_registries) {
|
|
157
244
|
// Self-tests assert specific rules/templates appear for a task — they
|
|
158
245
|
// test semantics, not packet size. Opt out of the compact cap so the
|
|
159
246
|
// assertions see the full ranking.
|
|
160
247
|
const packet = buildTaskPacket(inspection, test.task, { maxTokens: 3500, compact: false });
|
|
161
248
|
const actualPipelines = packet.recommendedPipelines.map((p) => p.pipelineId);
|
|
249
|
+
// ── Ranker-SURFACED expectations (order-sensitive) ─────────────────────
|
|
162
250
|
const missingTemplates = (test.expectedTemplates ?? []).filter((id) => !packet.relevantTemplates.some((t) => t.id === id));
|
|
163
251
|
const missingRules = (test.expectedRules ?? []).filter((id) => !packet.relevantRules.some((r) => r.id === id));
|
|
164
252
|
const missingForbidden = (test.expectedForbiddenActions ?? []).filter((a) => !packet.forbiddenActions.includes(a));
|
|
165
253
|
const missingVerification = (test.expectedVerificationCommands ?? []).filter((c) => !packet.verificationCommands.includes(c));
|
|
166
|
-
//
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return
|
|
186
|
-
}
|
|
187
|
-
const
|
|
254
|
+
// ── Registry-EXISTENCE expectations (stable) ───────────────────────────
|
|
255
|
+
// One authority: the shared reference registry. The runner used to keep a
|
|
256
|
+
// parallel resolver (a `*Quietly` helper per kind) whose helper set missed
|
|
257
|
+
// pack helpers, and whose command set read a property no inspection has —
|
|
258
|
+
// so every correct `expectedCommands` entry failed.
|
|
259
|
+
const unverified = [];
|
|
260
|
+
const unverifiedIds = new Set();
|
|
261
|
+
const existsCheck = (kind, ids) => {
|
|
262
|
+
const missing = [];
|
|
263
|
+
for (const id of ids ?? []) {
|
|
264
|
+
const status = existence(inspection, kind, id);
|
|
265
|
+
if (status === 'exists')
|
|
266
|
+
continue;
|
|
267
|
+
missing.push(id);
|
|
268
|
+
if (status === 'unverifiable') {
|
|
269
|
+
unverified.push(`${kind}:${id}`);
|
|
270
|
+
unverifiedIds.add(`${kind}:${id}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return missing;
|
|
274
|
+
};
|
|
275
|
+
const missingHelpers = existsCheck('helper', test.expectedHelpers);
|
|
276
|
+
const missingPlaybooks = existsCheck('playbook', test.expectedPlaybooks);
|
|
277
|
+
const missingPolicies = existsCheck('policy', test.expectedPolicies);
|
|
278
|
+
const missingConstructs = existsCheck('construct', test.expectedConstructs);
|
|
279
|
+
const missingKnowledge = existsCheck('knowledge', test.expectedKnowledge);
|
|
280
|
+
// ── Commands: surfaced by the packet, OR a command that really resolves ─
|
|
281
|
+
const missingCommands = [];
|
|
282
|
+
const commandDiagnostics = [];
|
|
283
|
+
for (const cmd of test.expectedCommands ?? []) {
|
|
284
|
+
if (packet.recommendedCliCommands.includes(cmd))
|
|
285
|
+
continue;
|
|
286
|
+
// A command REFERENCE: the bare catalog form (`dev start`) is read as
|
|
287
|
+
// `shrk dev start` by the one resolver — no private normalisation here.
|
|
288
|
+
const resolution = resolveShrkCommandReference(inspection, cmd);
|
|
289
|
+
if (resolution.status === CommandResolutionStatus.Unverified) {
|
|
290
|
+
missingCommands.push(cmd);
|
|
291
|
+
unverified.push(`command:${cmd}`);
|
|
292
|
+
unverifiedIds.add(`command:${cmd}`);
|
|
293
|
+
commandDiagnostics.push({
|
|
294
|
+
id: cmd,
|
|
295
|
+
kind: 'command',
|
|
296
|
+
existsInRegistry: false,
|
|
297
|
+
assertion: 'exists',
|
|
298
|
+
code: 'unverifiable',
|
|
299
|
+
consulted: consulted(inspection, 'command'),
|
|
300
|
+
suggestions: [
|
|
301
|
+
`Command "${cmd}" was not surfaced for "${test.task}", and it could not be resolved: ${COMMAND_INDEX_NOT_INJECTED}.`,
|
|
302
|
+
'Run the test through the CLI (`shrk test agent`), which injects the live command index.',
|
|
303
|
+
],
|
|
304
|
+
});
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (isCommandResolved(resolution))
|
|
308
|
+
continue;
|
|
309
|
+
missingCommands.push(cmd);
|
|
310
|
+
commandDiagnostics.push({
|
|
311
|
+
id: cmd,
|
|
312
|
+
kind: 'command',
|
|
313
|
+
existsInRegistry: false,
|
|
314
|
+
assertion: 'exists',
|
|
315
|
+
code: 'unknown-command',
|
|
316
|
+
consulted: consulted(inspection, 'command'),
|
|
317
|
+
...(resolution.closest && resolution.closest.length > 0 ? { closest: resolution.closest } : {}),
|
|
318
|
+
suggestions: [
|
|
319
|
+
`Command "${cmd}" does not resolve (${resolution.status}${resolution.reason ? ` — ${resolution.reason}` : ''}) — this expectation can never pass.`,
|
|
320
|
+
resolution.closest && resolution.closest.length > 0
|
|
321
|
+
? `Did you mean \`${resolution.closest[0]}\`?`
|
|
322
|
+
: 'Run `shrk surface list` for every real command.',
|
|
323
|
+
],
|
|
324
|
+
});
|
|
325
|
+
}
|
|
188
326
|
// mustNotInclude — fail if any of these ids ended up surfaced in the packet.
|
|
189
327
|
const surfacedIds = new Set();
|
|
190
328
|
for (const t of packet.relevantTemplates)
|
|
@@ -199,77 +337,82 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
199
337
|
surfacedIds.add(p.preset.id);
|
|
200
338
|
const unexpectedlyIncluded = (test.mustNotInclude ?? []).filter((id) => surfacedIds.has(id));
|
|
201
339
|
const pipelineOk = !test.expectedPipeline || actualPipelines.includes(test.expectedPipeline);
|
|
202
|
-
const
|
|
203
|
-
missingTemplates.length
|
|
204
|
-
missingRules.length
|
|
205
|
-
missingForbidden.length
|
|
206
|
-
missingVerification.length
|
|
207
|
-
missingHelpers.length
|
|
208
|
-
missingPlaybooks.length
|
|
209
|
-
missingPolicies.length
|
|
210
|
-
missingConstructs.length
|
|
211
|
-
missingCommands.length
|
|
212
|
-
missingKnowledge.length
|
|
213
|
-
unexpectedlyIncluded.length
|
|
214
|
-
|
|
215
|
-
|
|
340
|
+
const failing = (pipelineOk ? 0 : 1) +
|
|
341
|
+
missingTemplates.length +
|
|
342
|
+
missingRules.length +
|
|
343
|
+
missingForbidden.length +
|
|
344
|
+
missingVerification.length +
|
|
345
|
+
missingHelpers.length +
|
|
346
|
+
missingPlaybooks.length +
|
|
347
|
+
missingPolicies.length +
|
|
348
|
+
missingConstructs.length +
|
|
349
|
+
missingCommands.length +
|
|
350
|
+
missingKnowledge.length +
|
|
351
|
+
unexpectedlyIncluded.length;
|
|
352
|
+
const passed = failing === 0;
|
|
353
|
+
const verdict = passed
|
|
354
|
+
? 'pass'
|
|
355
|
+
: failing === unverified.length
|
|
356
|
+
? 'not-verified'
|
|
357
|
+
: 'fail';
|
|
358
|
+
// Diagnostics on failure: per missing id, whether it exists, WHICH registry
|
|
359
|
+
// said so, and how to make it surface.
|
|
216
360
|
let diagnostics;
|
|
217
361
|
if (!passed) {
|
|
218
362
|
diagnostics = [];
|
|
219
|
-
|
|
220
|
-
const exists = inspection
|
|
221
|
-
|
|
363
|
+
const surfacedDiagnostic = (kind, id, whenExists) => {
|
|
364
|
+
const exists = referenceIdExists(inspection, kind, id);
|
|
365
|
+
const registry = consulted(inspection, kind);
|
|
366
|
+
const label = kind[0].toUpperCase() + kind.slice(1);
|
|
367
|
+
return {
|
|
222
368
|
id,
|
|
223
|
-
kind
|
|
369
|
+
kind,
|
|
224
370
|
existsInRegistry: exists,
|
|
371
|
+
assertion: 'surfaced',
|
|
372
|
+
code: exists ? 'not-surfaced' : 'unknown-id',
|
|
373
|
+
consulted: registry,
|
|
225
374
|
suggestions: exists
|
|
226
|
-
?
|
|
227
|
-
`Template "${id}" exists but the ranker did not place it in the top results.`,
|
|
228
|
-
'Add task-aligned tags/appliesWhen to the template (e.g. tags:["service"], appliesWhen:["generate-service"]).',
|
|
229
|
-
'Reference the template from a preset that matches the task profile (includes.templateIds).',
|
|
230
|
-
'Reference it from a pipeline step (`step.references`).',
|
|
231
|
-
]
|
|
375
|
+
? whenExists
|
|
232
376
|
: [
|
|
233
|
-
|
|
377
|
+
`${label} "${id}" is not registered — it is not among the ${registry.size} ids \`${registry.listVerb}\` prints, so this expectation can never pass.`,
|
|
378
|
+
'Install the pack that ships it or correct the id.',
|
|
234
379
|
],
|
|
235
|
-
}
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
for (const id of missingTemplates) {
|
|
383
|
+
diagnostics.push(surfacedDiagnostic('template', id, [
|
|
384
|
+
`Template "${id}" exists but the ranker did not place it in the top results.`,
|
|
385
|
+
'Add task-aligned tags/appliesWhen to the template (e.g. tags:["service"], appliesWhen:["generate-service"]).',
|
|
386
|
+
'Reference the template from a preset that matches the task profile (includes.templateIds).',
|
|
387
|
+
'Reference it from a pipeline step (`step.references`).',
|
|
388
|
+
]));
|
|
236
389
|
}
|
|
237
390
|
for (const id of missingRules) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
'Add domain tags (service / utility / route / pipeline).',
|
|
248
|
-
'Reference it from actionHints.relatedTemplates on a rule that *is* ranking, or include it in a preset.',
|
|
249
|
-
]
|
|
250
|
-
: [
|
|
251
|
-
`Rule "${id}" does not exist — install the pack that ships it or correct the id.`,
|
|
252
|
-
],
|
|
253
|
-
});
|
|
391
|
+
// The RULE registry (what `shrk rules list` prints) — it used to be the
|
|
392
|
+
// knowledge entries, so a knowledge-but-not-rule id was told "exists but
|
|
393
|
+
// not surfaced", a permanently red test with a false hint.
|
|
394
|
+
diagnostics.push(surfacedDiagnostic('rule', id, [
|
|
395
|
+
`Rule "${id}" exists but the ranker did not surface it for "${test.task}".`,
|
|
396
|
+
'Align its appliesWhen with the domain (e.g. generate-service / generate-utility / create-pipeline).',
|
|
397
|
+
'Add domain tags (service / utility / route / pipeline).',
|
|
398
|
+
'Reference it from actionHints.relatedTemplates on a rule that *is* ranking, or include it in a preset.',
|
|
399
|
+
]));
|
|
254
400
|
}
|
|
255
401
|
if (!pipelineOk && test.expectedPipeline) {
|
|
256
|
-
diagnostics.push(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
'Add domain-aligned tags to the pipeline (tags:["plugin"], …).',
|
|
263
|
-
'Add task tokens to its title / description so the ranker catches them.',
|
|
264
|
-
'Reference the pipeline from a preset that the task profile recommends.',
|
|
265
|
-
],
|
|
266
|
-
});
|
|
402
|
+
diagnostics.push(surfacedDiagnostic('pipeline', test.expectedPipeline, [
|
|
403
|
+
`Pipeline "${test.expectedPipeline}" did not rank in the top 3 for "${test.task}".`,
|
|
404
|
+
'Add domain-aligned tags to the pipeline (tags:["plugin"], …).',
|
|
405
|
+
'Add task tokens to its title / description so the ranker catches them.',
|
|
406
|
+
'Reference the pipeline from a preset that the task profile recommends.',
|
|
407
|
+
]));
|
|
267
408
|
}
|
|
268
409
|
for (const action of missingForbidden) {
|
|
269
410
|
diagnostics.push({
|
|
270
411
|
id: action,
|
|
271
412
|
kind: 'forbidden-action',
|
|
272
413
|
existsInRegistry: false,
|
|
414
|
+
assertion: 'surfaced',
|
|
415
|
+
code: 'not-aggregated',
|
|
273
416
|
suggestions: [
|
|
274
417
|
`No rule's actionHints.forbiddenActions contains "${action}" for this task's relevant set.`,
|
|
275
418
|
'Add the forbiddenAction to one of the high-priority rules that match this task.',
|
|
@@ -281,83 +424,58 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
281
424
|
id: cmd,
|
|
282
425
|
kind: 'verification-command',
|
|
283
426
|
existsInRegistry: false,
|
|
427
|
+
assertion: 'surfaced',
|
|
428
|
+
code: 'not-aggregated',
|
|
284
429
|
suggestions: [
|
|
285
430
|
`Verification command "${cmd}" is not aggregated for this task.`,
|
|
286
431
|
'Add it to a high-priority rule\'s actionHints.verificationCommands.',
|
|
287
432
|
],
|
|
288
433
|
});
|
|
289
434
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
435
|
+
const existsDiagnostic = (kind, id, hint) => {
|
|
436
|
+
const registry = consulted(inspection, kind);
|
|
437
|
+
const cold = unverifiedIds.has(`${kind}:${id}`);
|
|
438
|
+
return {
|
|
293
439
|
id,
|
|
294
|
-
kind
|
|
295
|
-
existsInRegistry:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
440
|
+
kind,
|
|
441
|
+
existsInRegistry: false,
|
|
442
|
+
assertion: 'exists',
|
|
443
|
+
code: cold ? 'unverifiable' : 'unknown-id',
|
|
444
|
+
consulted: registry,
|
|
445
|
+
suggestions: cold
|
|
446
|
+
? [
|
|
447
|
+
`The ${kind} registry was not warmed, so "${id}" could not be looked up — NOT VERIFIED.`,
|
|
448
|
+
'Call warmReferenceRegistries(inspection) before running agent tests.',
|
|
449
|
+
]
|
|
450
|
+
: [
|
|
451
|
+
`${kind[0].toUpperCase() + kind.slice(1)} "${id}" is not registered — it is not among the ${registry.size} ids \`${registry.listVerb}\` prints.`,
|
|
452
|
+
hint,
|
|
453
|
+
],
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
for (const id of missingHelpers) {
|
|
457
|
+
diagnostics.push(existsDiagnostic('helper', id, 'Register it in HELPERS (packages/inspector/src/helper-registry.ts) or ship it from a pack helperFiles contribution.'));
|
|
301
458
|
}
|
|
302
459
|
for (const id of missingPlaybooks) {
|
|
303
|
-
diagnostics.push(
|
|
304
|
-
id,
|
|
305
|
-
kind: 'playbook',
|
|
306
|
-
existsInRegistry: playbookList.has(id),
|
|
307
|
-
suggestions: [
|
|
308
|
-
`Playbook "${id}" not found in the playbook registry — install the pack that ships it or correct the id.`,
|
|
309
|
-
'Ensure the playbook file is referenced in sharkcraft.config.ts / pack contributions and exports a default array.',
|
|
310
|
-
],
|
|
311
|
-
});
|
|
460
|
+
diagnostics.push(existsDiagnostic('playbook', id, 'Ensure the playbook file is referenced in sharkcraft.config.ts / pack contributions and exports a default array.'));
|
|
312
461
|
}
|
|
313
462
|
for (const id of missingPolicies) {
|
|
314
|
-
diagnostics.push(
|
|
315
|
-
id,
|
|
316
|
-
kind: 'policy',
|
|
317
|
-
existsInRegistry: policyChecks.has(id),
|
|
318
|
-
suggestions: [
|
|
319
|
-
`Policy "${id}" not found in the policy-engine checks — install the pack that ships it or correct the id.`,
|
|
320
|
-
'Add it to sharkcraft/policies.ts or a pack policyCheckFile.',
|
|
321
|
-
],
|
|
322
|
-
});
|
|
463
|
+
diagnostics.push(existsDiagnostic('policy', id, 'Add it to sharkcraft/policies.ts or a pack policyCheckFile.'));
|
|
323
464
|
}
|
|
324
465
|
for (const id of missingConstructs) {
|
|
325
|
-
diagnostics.push(
|
|
326
|
-
id,
|
|
327
|
-
kind: 'construct',
|
|
328
|
-
existsInRegistry: constructList.has(id),
|
|
329
|
-
suggestions: [
|
|
330
|
-
`Construct "${id}" not found in the construct registry — install the pack that ships it or correct the id.`,
|
|
331
|
-
'Add a defineConstruct() entry in sharkcraft/constructs.ts or a pack constructFile.',
|
|
332
|
-
],
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
for (const id of missingCommands) {
|
|
336
|
-
diagnostics.push({
|
|
337
|
-
id,
|
|
338
|
-
kind: 'command',
|
|
339
|
-
existsInRegistry: commandCatalog.has(id) || commandCatalog.has(id.split(' ')[0]),
|
|
340
|
-
suggestions: [
|
|
341
|
-
`Command "${id}" was not surfaced for "${test.task}" and is not in the command catalog.`,
|
|
342
|
-
'Add it to a high-priority rule\'s actionHints.commands or check the command-catalog.ts entries.',
|
|
343
|
-
],
|
|
344
|
-
});
|
|
466
|
+
diagnostics.push(existsDiagnostic('construct', id, 'Add a defineConstruct() entry in sharkcraft/constructs.ts or a pack constructFile.'));
|
|
345
467
|
}
|
|
468
|
+
diagnostics.push(...commandDiagnostics);
|
|
346
469
|
for (const id of missingKnowledge) {
|
|
347
|
-
diagnostics.push(
|
|
348
|
-
id,
|
|
349
|
-
kind: 'knowledge',
|
|
350
|
-
existsInRegistry: knowledgeIds.has(id),
|
|
351
|
-
suggestions: [
|
|
352
|
-
`Knowledge entry "${id}" is not present in the inspection — install the pack that ships it or correct the id.`,
|
|
353
|
-
],
|
|
354
|
-
});
|
|
470
|
+
diagnostics.push(existsDiagnostic('knowledge', id, 'Install the pack that ships it or correct the id.'));
|
|
355
471
|
}
|
|
356
472
|
for (const id of unexpectedlyIncluded) {
|
|
357
473
|
diagnostics.push({
|
|
358
474
|
id,
|
|
359
475
|
kind: 'must-not-include',
|
|
360
476
|
existsInRegistry: true,
|
|
477
|
+
assertion: 'surfaced',
|
|
478
|
+
code: 'surfaced-but-forbidden',
|
|
361
479
|
suggestions: [
|
|
362
480
|
`"${id}" was surfaced by the ranker but the test forbids it.`,
|
|
363
481
|
'Narrow its appliesWhen / tags to avoid matching this task wording.',
|
|
@@ -369,6 +487,7 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
369
487
|
id: test.id,
|
|
370
488
|
task: test.task,
|
|
371
489
|
passed,
|
|
490
|
+
verdict,
|
|
372
491
|
actualPipelines,
|
|
373
492
|
missingTemplates,
|
|
374
493
|
missingRules,
|
|
@@ -382,6 +501,8 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
382
501
|
missingKnowledge,
|
|
383
502
|
unexpectedlyIncluded,
|
|
384
503
|
};
|
|
504
|
+
if (unverified.length > 0)
|
|
505
|
+
result.unverified = unverified;
|
|
385
506
|
if (test.expectedPipeline)
|
|
386
507
|
result.expectedPipeline = test.expectedPipeline;
|
|
387
508
|
if (!passed) {
|
|
@@ -397,162 +518,32 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
397
518
|
`missingKnowledge=${missingKnowledge.length}`,
|
|
398
519
|
`unexpectedlyIncluded=${unexpectedlyIncluded.length}`,
|
|
399
520
|
];
|
|
521
|
+
if (unverified.length > 0)
|
|
522
|
+
partsList.push(`unverified=${unverified.length}`);
|
|
400
523
|
result.failureSummary = partsList.join(' ');
|
|
401
524
|
}
|
|
402
525
|
if (diagnostics)
|
|
403
526
|
result.diagnostics = diagnostics;
|
|
404
527
|
return result;
|
|
405
528
|
}
|
|
406
|
-
// ── Registry helpers ────────────────────────────────────────────────
|
|
407
|
-
function loadHelperRegistryQuietly() {
|
|
408
|
-
try {
|
|
409
|
-
return new Set(HELPERS.map((h) => h.id));
|
|
410
|
-
}
|
|
411
|
-
catch {
|
|
412
|
-
return new Set();
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
function listPlaybookIdsQuietly(inspection) {
|
|
416
|
-
const reg = inspection
|
|
417
|
-
.playbookRegistry;
|
|
418
|
-
if (!reg || typeof reg.list !== 'function')
|
|
419
|
-
return new Set();
|
|
420
|
-
try {
|
|
421
|
-
return new Set(reg.list().map((p) => p.id));
|
|
422
|
-
}
|
|
423
|
-
catch {
|
|
424
|
-
return new Set();
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
function listPolicyIdsQuietly(inspection) {
|
|
428
|
-
const checks = inspection.policyChecks ?? [];
|
|
429
|
-
return new Set(checks.map((c) => c.id));
|
|
430
|
-
}
|
|
431
|
-
function listConstructIdsQuietly(inspection) {
|
|
432
|
-
const direct = inspection.constructs;
|
|
433
|
-
if (direct && direct.length > 0)
|
|
434
|
-
return new Set(direct.map((c) => c.id));
|
|
435
|
-
const reg = inspection
|
|
436
|
-
.constructRegistry;
|
|
437
|
-
if (reg && typeof reg.list === 'function') {
|
|
438
|
-
try {
|
|
439
|
-
return new Set(reg.list().map((c) => c.id));
|
|
440
|
-
}
|
|
441
|
-
catch {
|
|
442
|
-
return new Set();
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
return new Set();
|
|
446
|
-
}
|
|
447
|
-
function listCommandIdsQuietly(inspection) {
|
|
448
|
-
const cat = inspection.commandCatalog ?? [];
|
|
449
|
-
const out = new Set();
|
|
450
|
-
for (const c of cat) {
|
|
451
|
-
if (c.id)
|
|
452
|
-
out.add(c.id);
|
|
453
|
-
if (c.command)
|
|
454
|
-
out.add(c.command);
|
|
455
|
-
}
|
|
456
|
-
return out;
|
|
457
|
-
}
|
|
458
529
|
/**
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
*
|
|
530
|
+
* Warm the shared reference registry and return a snapshot of it.
|
|
531
|
+
*
|
|
532
|
+
* @deprecated Call `warmReferenceRegistries(inspection, options)` directly (the
|
|
533
|
+
* CLI: `warmCliReferenceRegistries`) — the runners read the registry itself.
|
|
534
|
+
* The snapshot is a projection of that one authority, never a second source:
|
|
535
|
+
* the old loader re-read policies / playbooks / constructs from its own file
|
|
536
|
+
* list and returned the built-in helpers only (no pack helpers).
|
|
463
537
|
*/
|
|
464
|
-
export async function loadAgentContractRegistries(inspection) {
|
|
538
|
+
export async function loadAgentContractRegistries(inspection, options = {}) {
|
|
539
|
+
await warmReferenceRegistries(inspection, options);
|
|
540
|
+
const ids = (kind) => new Set(referenceIdsFor(inspection, kind));
|
|
465
541
|
return {
|
|
466
|
-
helpers:
|
|
467
|
-
playbooks:
|
|
468
|
-
policies:
|
|
469
|
-
constructs:
|
|
470
|
-
commands:
|
|
471
|
-
knowledge:
|
|
542
|
+
helpers: ids('helper'),
|
|
543
|
+
playbooks: ids('playbook'),
|
|
544
|
+
policies: ids('policy'),
|
|
545
|
+
constructs: ids('construct'),
|
|
546
|
+
commands: new Set(),
|
|
547
|
+
knowledge: ids('knowledge'),
|
|
472
548
|
};
|
|
473
549
|
}
|
|
474
|
-
async function importDefaultIdsArray(absPath) {
|
|
475
|
-
if (!existsSync(absPath))
|
|
476
|
-
return [];
|
|
477
|
-
try {
|
|
478
|
-
const mod = (await importModuleViaLoader(absPath));
|
|
479
|
-
return Array.isArray(mod.default) ? mod.default : [];
|
|
480
|
-
}
|
|
481
|
-
catch {
|
|
482
|
-
return [];
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
async function loadPolicyIdsAsync(inspection) {
|
|
486
|
-
const out = new Set();
|
|
487
|
-
if (inspection.sharkcraftDir) {
|
|
488
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'policies.ts');
|
|
489
|
-
for (const entry of await importDefaultIdsArray(local)) {
|
|
490
|
-
if (entry?.id)
|
|
491
|
-
out.add(entry.id);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
for (const pack of inspection.packs.validPacks) {
|
|
495
|
-
const c = pack.manifest.contributions;
|
|
496
|
-
for (const rel of c.policyCheckFiles ?? []) {
|
|
497
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
498
|
-
for (const entry of await importDefaultIdsArray(full)) {
|
|
499
|
-
if (entry?.id)
|
|
500
|
-
out.add(entry.id);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
// Also include any policyChecks already on the inspection (sync fallback).
|
|
505
|
-
for (const id of listPolicyIdsQuietly(inspection))
|
|
506
|
-
out.add(id);
|
|
507
|
-
return out;
|
|
508
|
-
}
|
|
509
|
-
async function loadPlaybookIdsAsync(inspection) {
|
|
510
|
-
const out = new Set();
|
|
511
|
-
// Sync fallback from registry.
|
|
512
|
-
for (const id of listPlaybookIdsQuietly(inspection))
|
|
513
|
-
out.add(id);
|
|
514
|
-
// Local file.
|
|
515
|
-
if (inspection.sharkcraftDir) {
|
|
516
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'playbooks.ts');
|
|
517
|
-
for (const entry of await importDefaultIdsArray(local)) {
|
|
518
|
-
if (entry?.id)
|
|
519
|
-
out.add(entry.id);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
// Pack contributions.
|
|
523
|
-
for (const pack of inspection.packs.validPacks) {
|
|
524
|
-
const c = pack.manifest.contributions;
|
|
525
|
-
for (const rel of c.playbookFiles ?? []) {
|
|
526
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
527
|
-
for (const entry of await importDefaultIdsArray(full)) {
|
|
528
|
-
if (entry?.id)
|
|
529
|
-
out.add(entry.id);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
return out;
|
|
534
|
-
}
|
|
535
|
-
async function loadConstructIdsAsync(inspection) {
|
|
536
|
-
const out = new Set();
|
|
537
|
-
// Sync fallback first.
|
|
538
|
-
for (const id of listConstructIdsQuietly(inspection))
|
|
539
|
-
out.add(id);
|
|
540
|
-
if (inspection.sharkcraftDir) {
|
|
541
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'constructs.ts');
|
|
542
|
-
for (const entry of await importDefaultIdsArray(local)) {
|
|
543
|
-
if (entry?.id)
|
|
544
|
-
out.add(entry.id);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
for (const pack of inspection.packs.validPacks) {
|
|
548
|
-
const c = pack.manifest.contributions;
|
|
549
|
-
for (const rel of c.constructFiles ?? []) {
|
|
550
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
551
|
-
for (const entry of await importDefaultIdsArray(full)) {
|
|
552
|
-
if (entry?.id)
|
|
553
|
-
out.add(entry.id);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
return out;
|
|
558
|
-
}
|