@shrkcrft/inspector 0.1.0-alpha.30 → 0.1.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acceptance-replay.js +1 -1
- package/dist/agent-contract-templates.js +6 -6
- package/dist/agent-contract.d.ts.map +1 -1
- package/dist/agent-contract.js +13 -8
- package/dist/agent-orchestration.js +2 -2
- package/dist/agent-task-prep.d.ts +16 -0
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +51 -4
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +21 -3
- package/dist/architecture-map.d.ts +16 -0
- package/dist/architecture-map.d.ts.map +1 -1
- package/dist/architecture-map.js +42 -26
- package/dist/area-explore.d.ts +2 -2
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +36 -16
- package/dist/area-map.d.ts +56 -11
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +106 -25
- package/dist/asset-doctor-proposed-exit.d.ts +21 -0
- package/dist/asset-doctor-proposed-exit.d.ts.map +1 -0
- package/dist/asset-doctor-proposed-exit.js +22 -0
- package/dist/asset-provenance.js +1 -1
- package/dist/boundaries-changed-only.d.ts +24 -1
- package/dist/boundaries-changed-only.d.ts.map +1 -1
- package/dist/boundaries-changed-only.js +12 -2
- package/dist/boundary-check-options.model.d.ts +40 -0
- package/dist/boundary-check-options.model.d.ts.map +1 -0
- package/dist/boundary-check-options.model.js +1 -0
- package/dist/boundary-check-result.model.d.ts +89 -0
- package/dist/boundary-check-result.model.d.ts.map +1 -0
- package/dist/boundary-check-result.model.js +1 -0
- package/dist/boundary-configuration-status.d.ts +38 -0
- package/dist/boundary-configuration-status.d.ts.map +1 -0
- package/dist/boundary-configuration-status.js +118 -0
- package/dist/boundary-configuration-status.model.d.ts +37 -0
- package/dist/boundary-configuration-status.model.d.ts.map +1 -0
- package/dist/boundary-configuration-status.model.js +1 -0
- package/dist/boundary-load-issue.model.d.ts +30 -0
- package/dist/boundary-load-issue.model.d.ts.map +1 -0
- package/dist/boundary-load-issue.model.js +1 -0
- package/dist/boundary-rule-check.model.d.ts +44 -0
- package/dist/boundary-rule-check.model.d.ts.map +1 -0
- package/dist/boundary-rule-check.model.js +1 -0
- package/dist/boundary-rule-invalidation.model.d.ts +31 -0
- package/dist/boundary-rule-invalidation.model.d.ts.map +1 -0
- package/dist/boundary-rule-invalidation.model.js +1 -0
- package/dist/boundary-rule-set-diff.model.d.ts +75 -0
- package/dist/boundary-rule-set-diff.model.d.ts.map +1 -0
- package/dist/boundary-rule-set-diff.model.js +1 -0
- package/dist/boundary-rule-sources.d.ts +28 -0
- package/dist/boundary-rule-sources.d.ts.map +1 -0
- package/dist/boundary-rule-sources.js +110 -0
- package/dist/boundary-stale-exception-finding.model.d.ts +12 -0
- package/dist/boundary-stale-exception-finding.model.d.ts.map +1 -0
- package/dist/boundary-stale-exception-finding.model.js +1 -0
- package/dist/boundary-unit-liveness.d.ts +35 -0
- package/dist/boundary-unit-liveness.d.ts.map +1 -0
- package/dist/boundary-unit-liveness.js +71 -0
- package/dist/change-intent.d.ts +3 -0
- package/dist/change-intent.d.ts.map +1 -1
- package/dist/change-intent.js +61 -27
- package/dist/changes-summary.d.ts.map +1 -1
- package/dist/changes-summary.js +19 -9
- package/dist/ci-integrity-report.js +1 -1
- package/dist/ci-predict.d.ts.map +1 -1
- package/dist/ci-predict.js +38 -5
- package/dist/code-intelligence-doctor.d.ts +6 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -1
- package/dist/code-intelligence-doctor.js +22 -7
- package/dist/command-recommender.d.ts +45 -2
- package/dist/command-recommender.d.ts.map +1 -1
- package/dist/command-recommender.js +41 -263
- package/dist/command-resolution-status.d.ts +44 -0
- package/dist/command-resolution-status.d.ts.map +1 -0
- package/dist/command-resolution-status.js +44 -0
- package/dist/command-safety-level.d.ts +15 -0
- package/dist/command-safety-level.d.ts.map +1 -0
- package/dist/command-safety-level.js +43 -0
- package/dist/command-taxonomy.js +1 -1
- package/dist/compliance-evidence.js +1 -1
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-registry.d.ts +40 -0
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +186 -82
- package/dist/context-tuning.d.ts +4 -0
- package/dist/context-tuning.d.ts.map +1 -1
- package/dist/context-tuning.js +10 -7
- package/dist/contract-template-registry.d.ts +10 -0
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +59 -33
- package/dist/contribution-kind.d.ts +52 -0
- package/dist/contribution-kind.d.ts.map +1 -0
- package/dist/contribution-kind.js +52 -0
- package/dist/contribution-load-failures.d.ts +106 -0
- package/dist/contribution-load-failures.d.ts.map +1 -0
- package/dist/contribution-load-failures.js +575 -0
- package/dist/contributions-report.d.ts +28 -0
- package/dist/contributions-report.d.ts.map +1 -0
- package/dist/contributions-report.js +242 -0
- package/dist/convention-registry.d.ts +22 -0
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +79 -39
- package/dist/coverage-report.d.ts.map +1 -1
- package/dist/coverage-report.js +6 -6
- package/dist/custom-checks.d.ts +60 -1
- package/dist/custom-checks.d.ts.map +1 -1
- package/dist/custom-checks.js +159 -6
- package/dist/dashboard/dashboard-data.d.ts +6 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -1
- package/dist/dashboard/dashboard-data.js +99 -8
- package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -1
- package/dist/dashboard/dashboard-knowledge.js +14 -2
- package/dist/decision-records.d.ts +20 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +68 -20
- package/dist/declared-cross-references.d.ts +61 -0
- package/dist/declared-cross-references.d.ts.map +1 -0
- package/dist/declared-cross-references.js +550 -0
- package/dist/declared-gate-plane-rules.d.ts +24 -0
- package/dist/declared-gate-plane-rules.d.ts.map +1 -0
- package/dist/declared-gate-plane-rules.js +39 -0
- package/dist/declared-reference-coverage.d.ts +27 -0
- package/dist/declared-reference-coverage.d.ts.map +1 -0
- package/dist/declared-reference-coverage.js +50 -0
- package/dist/declared-xref-status.d.ts +19 -0
- package/dist/declared-xref-status.d.ts.map +1 -0
- package/dist/declared-xref-status.js +19 -0
- package/dist/delegate-pack-recipes.d.ts +13 -2
- package/dist/delegate-pack-recipes.d.ts.map +1 -1
- package/dist/delegate-pack-recipes.js +45 -14
- package/dist/demo-package.js +2 -2
- package/dist/demo-script.js +2 -2
- package/dist/demo-workflow.js +3 -3
- package/dist/dev-cycle.js +1 -1
- package/dist/dev-session.js +1 -1
- package/dist/doc-references.d.ts +23 -2
- package/dist/doc-references.d.ts.map +1 -1
- package/dist/doc-references.js +96 -17
- package/dist/doctor-result.d.ts +8 -0
- package/dist/doctor-result.d.ts.map +1 -1
- package/dist/doctor-verdict-kind.d.ts +19 -0
- package/dist/doctor-verdict-kind.d.ts.map +1 -0
- package/dist/doctor-verdict-kind.js +19 -0
- package/dist/doctor-verdict.d.ts +18 -0
- package/dist/doctor-verdict.d.ts.map +1 -0
- package/dist/doctor-verdict.js +28 -0
- package/dist/drift.d.ts +17 -0
- package/dist/drift.d.ts.map +1 -1
- package/dist/drift.js +40 -10
- package/dist/entrypoint-matrix.d.ts.map +1 -1
- package/dist/entrypoint-matrix.js +4 -1
- package/dist/feedback-ingestion.d.ts +28 -2
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +68 -19
- package/dist/fix-preview.d.ts.map +1 -1
- package/dist/fix-preview.js +9 -5
- package/dist/framework-extractor-outcomes.d.ts +27 -0
- package/dist/framework-extractor-outcomes.d.ts.map +1 -0
- package/dist/framework-extractor-outcomes.js +83 -0
- package/dist/fuzzy-impact.js +1 -1
- package/dist/healing-plan.d.ts.map +1 -1
- package/dist/healing-plan.js +3 -4
- package/dist/helper-catalog.d.ts +25 -0
- package/dist/helper-catalog.d.ts.map +1 -0
- package/dist/helper-catalog.js +91 -0
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +17 -1
- package/dist/helper-view.d.ts +33 -0
- package/dist/helper-view.d.ts.map +1 -0
- package/dist/helper-view.js +1 -0
- package/dist/i-asset-doctor-flags.d.ts +16 -0
- package/dist/i-asset-doctor-flags.d.ts.map +1 -0
- package/dist/i-asset-doctor-flags.js +1 -0
- package/dist/i-command-resolution.d.ts +22 -0
- package/dist/i-command-resolution.d.ts.map +1 -0
- package/dist/i-command-resolution.js +1 -0
- package/dist/i-command-resolve-options.d.ts +24 -0
- package/dist/i-command-resolve-options.d.ts.map +1 -0
- package/dist/i-command-resolve-options.js +1 -0
- package/dist/i-command-safety.d.ts +13 -0
- package/dist/i-command-safety.d.ts.map +1 -0
- package/dist/i-command-safety.js +1 -0
- package/dist/i-contribution-accepted-entry.d.ts +18 -0
- package/dist/i-contribution-accepted-entry.d.ts.map +1 -0
- package/dist/i-contribution-accepted-entry.js +1 -0
- package/dist/i-contribution-entry-rejection.d.ts +21 -0
- package/dist/i-contribution-entry-rejection.d.ts.map +1 -0
- package/dist/i-contribution-entry-rejection.js +1 -0
- package/dist/i-contribution-file-issue.d.ts +18 -0
- package/dist/i-contribution-file-issue.d.ts.map +1 -0
- package/dist/i-contribution-file-issue.js +1 -0
- package/dist/i-contribution-file-report.d.ts +40 -0
- package/dist/i-contribution-file-report.d.ts.map +1 -0
- package/dist/i-contribution-file-report.js +1 -0
- package/dist/i-contribution-file-validation.d.ts +24 -0
- package/dist/i-contribution-file-validation.d.ts.map +1 -0
- package/dist/i-contribution-file-validation.js +1 -0
- package/dist/i-contributions-report.d.ts +31 -0
- package/dist/i-contributions-report.d.ts.map +1 -0
- package/dist/i-contributions-report.js +1 -0
- package/dist/i-declared-xref-field.d.ts +25 -0
- package/dist/i-declared-xref-field.d.ts.map +1 -0
- package/dist/i-declared-xref-field.js +1 -0
- package/dist/i-declared-xref-issue.d.ts +25 -0
- package/dist/i-declared-xref-issue.d.ts.map +1 -0
- package/dist/i-declared-xref-issue.js +1 -0
- package/dist/i-declared-xref-report.d.ts +48 -0
- package/dist/i-declared-xref-report.d.ts.map +1 -0
- package/dist/i-declared-xref-report.js +1 -0
- package/dist/i-declared-xref-row.d.ts +29 -0
- package/dist/i-declared-xref-row.d.ts.map +1 -0
- package/dist/i-declared-xref-row.js +1 -0
- package/dist/i-doctor-verdict.d.ts +10 -0
- package/dist/i-doctor-verdict.d.ts.map +1 -0
- package/dist/i-doctor-verdict.js +1 -0
- package/dist/i-kind-outcomes.d.ts +13 -0
- package/dist/i-kind-outcomes.d.ts.map +1 -0
- package/dist/i-kind-outcomes.js +1 -0
- package/dist/i-pack-doctor-verdict.d.ts +15 -0
- package/dist/i-pack-doctor-verdict.d.ts.map +1 -0
- package/dist/i-pack-doctor-verdict.js +1 -0
- package/dist/i-probed-id-field.d.ts +17 -0
- package/dist/i-probed-id-field.d.ts.map +1 -0
- package/dist/i-probed-id-field.js +1 -0
- package/dist/i-reference-kind-declaration.d.ts +38 -0
- package/dist/i-reference-kind-declaration.d.ts.map +1 -0
- package/dist/i-reference-kind-declaration.js +1 -0
- package/dist/i-reference-warm-options.d.ts +21 -0
- package/dist/i-reference-warm-options.d.ts.map +1 -0
- package/dist/i-reference-warm-options.js +1 -0
- package/dist/i-registry-outcomes.d.ts +16 -0
- package/dist/i-registry-outcomes.d.ts.map +1 -0
- package/dist/i-registry-outcomes.js +1 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts +35 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/i-scaffold-pattern-doctor-report.js +1 -0
- package/dist/i-search-tuning-key-probe.d.ts +30 -0
- package/dist/i-search-tuning-key-probe.d.ts.map +1 -0
- package/dist/i-search-tuning-key-probe.js +1 -0
- package/dist/i-search-tuning-lint-issue.d.ts +61 -0
- package/dist/i-search-tuning-lint-issue.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-issue.js +1 -0
- package/dist/i-search-tuning-lint-report.d.ts +38 -0
- package/dist/i-search-tuning-lint-report.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-report.js +1 -0
- package/dist/i-unresolvable-reference-scan.d.ts +14 -0
- package/dist/i-unresolvable-reference-scan.d.ts.map +1 -0
- package/dist/i-unresolvable-reference-scan.js +1 -0
- package/dist/i-unresolvable-reference.d.ts +29 -0
- package/dist/i-unresolvable-reference.d.ts.map +1 -0
- package/dist/i-unresolvable-reference.js +1 -0
- package/dist/i-workspace-profile-payload.d.ts +12 -0
- package/dist/i-workspace-profile-payload.d.ts.map +1 -0
- package/dist/i-workspace-profile-payload.js +1 -0
- package/dist/impact-analysis.d.ts +15 -0
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +58 -13
- package/dist/impact-render.d.ts.map +1 -1
- package/dist/impact-render.js +22 -0
- package/dist/import-hygiene.d.ts +35 -1
- package/dist/import-hygiene.d.ts.map +1 -1
- package/dist/import-hygiene.js +107 -13
- package/dist/index.d.ts +141 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +172 -0
- package/dist/inspection-discovery.d.ts +45 -0
- package/dist/inspection-discovery.d.ts.map +1 -0
- package/dist/inspection-discovery.js +70 -0
- package/dist/knowledge-advisory-code.d.ts +17 -0
- package/dist/knowledge-advisory-code.d.ts.map +1 -0
- package/dist/knowledge-advisory-code.js +17 -0
- package/dist/knowledge-aged-entry.d.ts +10 -0
- package/dist/knowledge-aged-entry.d.ts.map +1 -0
- package/dist/knowledge-aged-entry.js +1 -0
- package/dist/knowledge-authoring.d.ts +24 -1
- package/dist/knowledge-authoring.d.ts.map +1 -1
- package/dist/knowledge-authoring.js +46 -7
- package/dist/knowledge-entry-verdict-record.d.ts +22 -0
- package/dist/knowledge-entry-verdict-record.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict-record.js +1 -0
- package/dist/knowledge-entry-verdict.d.ts +17 -0
- package/dist/knowledge-entry-verdict.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict.js +17 -0
- package/dist/knowledge-graph.d.ts +6 -0
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +18 -7
- package/dist/knowledge-kind-bucket.d.ts +19 -0
- package/dist/knowledge-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-kind-bucket.js +1 -0
- package/dist/knowledge-load-failure.d.ts +23 -0
- package/dist/knowledge-load-failure.d.ts.map +1 -0
- package/dist/knowledge-load-failure.js +1 -0
- package/dist/knowledge-reference-kind-bucket.d.ts +11 -0
- package/dist/knowledge-reference-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-reference-kind-bucket.js +1 -0
- package/dist/knowledge-stale-advisory.d.ts +14 -0
- package/dist/knowledge-stale-advisory.d.ts.map +1 -0
- package/dist/knowledge-stale-advisory.js +1 -0
- package/dist/knowledge-stale-coverage.d.ts +19 -0
- package/dist/knowledge-stale-coverage.d.ts.map +1 -0
- package/dist/knowledge-stale-coverage.js +1 -0
- package/dist/knowledge-stale-gate-flags.d.ts +33 -0
- package/dist/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge-stale-gate-input.d.ts +46 -0
- package/dist/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge-stale-gate-result.d.ts +33 -0
- package/dist/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge-stale-gate-rule.d.ts +33 -0
- package/dist/knowledge-stale-gate-rule.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-rule.js +1 -0
- package/dist/knowledge-stale-gate-violation.d.ts +13 -0
- package/dist/knowledge-stale-gate-violation.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-violation.js +1 -0
- package/dist/knowledge-stale-gate.d.ts +83 -0
- package/dist/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-gate.js +429 -0
- package/dist/knowledge-stale-quality-gate.d.ts +26 -0
- package/dist/knowledge-stale-quality-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-quality-gate.js +110 -0
- package/dist/knowledge-stale.d.ts +122 -9
- package/dist/knowledge-stale.d.ts.map +1 -1
- package/dist/knowledge-stale.js +996 -291
- package/dist/knowledge-unverifiable-reason.d.ts +12 -0
- package/dist/knowledge-unverifiable-reason.d.ts.map +1 -0
- package/dist/knowledge-unverifiable-reason.js +12 -0
- package/dist/loader-diagnostics.d.ts +14 -2
- package/dist/loader-diagnostics.d.ts.map +1 -1
- package/dist/match-terms.d.ts +48 -0
- package/dist/match-terms.d.ts.map +1 -0
- package/dist/match-terms.js +155 -0
- package/dist/migration-profile-registry.d.ts +10 -0
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +57 -34
- package/dist/migration-readiness.d.ts.map +1 -1
- package/dist/migration-readiness.js +1 -3
- package/dist/nearest-id.d.ts +10 -26
- package/dist/nearest-id.d.ts.map +1 -1
- package/dist/nearest-id.js +9 -59
- package/dist/pack-asset-freshness.d.ts +65 -0
- package/dist/pack-asset-freshness.d.ts.map +1 -0
- package/dist/pack-asset-freshness.js +340 -0
- package/dist/pack-author-ux.d.ts +24 -3
- package/dist/pack-author-ux.d.ts.map +1 -1
- package/dist/pack-author-ux.js +87 -93
- package/dist/pack-contributions-inventory.d.ts +79 -39
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +443 -286
- package/dist/pack-doctor-verdict.d.ts +29 -0
- package/dist/pack-doctor-verdict.d.ts.map +1 -0
- package/dist/pack-doctor-verdict.js +45 -0
- package/dist/pack-doctor.d.ts +74 -1
- package/dist/pack-doctor.d.ts.map +1 -1
- package/dist/pack-doctor.js +281 -1
- package/dist/pack-helper-plan.d.ts +24 -0
- package/dist/pack-helper-plan.d.ts.map +1 -0
- package/dist/pack-helper-plan.js +77 -0
- package/dist/pack-helper-registry.d.ts +14 -0
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +76 -37
- package/dist/pack-manifest-reader.d.ts +8 -0
- package/dist/pack-manifest-reader.d.ts.map +1 -0
- package/dist/pack-manifest-reader.js +79 -0
- package/dist/pack-release-check.d.ts +14 -1
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +23 -1
- package/dist/pack-signature-status.d.ts +18 -6
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +59 -105
- package/dist/pack-test-runner.d.ts +27 -5
- package/dist/pack-test-runner.d.ts.map +1 -1
- package/dist/pack-test-runner.js +91 -35
- package/dist/pack-typecheck.d.ts +8 -0
- package/dist/pack-typecheck.d.ts.map +1 -0
- package/dist/pack-typecheck.js +76 -0
- package/dist/plan-review.d.ts +2 -0
- package/dist/plan-review.d.ts.map +1 -1
- package/dist/plan-review.js +17 -5
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +16 -5
- package/dist/playbook-load-issue.d.ts +16 -0
- package/dist/playbook-load-issue.d.ts.map +1 -0
- package/dist/playbook-load-issue.js +1 -0
- package/dist/playbook-registry.d.ts +32 -1
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +144 -55
- package/dist/policy-declaration.d.ts +18 -0
- package/dist/policy-declaration.d.ts.map +1 -0
- package/dist/policy-declaration.js +1 -0
- package/dist/policy-engine.d.ts +8 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +26 -9
- package/dist/policy-overrides.d.ts.map +1 -1
- package/dist/policy-overrides.js +4 -4
- package/dist/policy-registry.d.ts +27 -0
- package/dist/policy-registry.d.ts.map +1 -1
- package/dist/policy-registry.js +87 -20
- package/dist/probed-id-fields.d.ts +21 -0
- package/dist/probed-id-fields.d.ts.map +1 -0
- package/dist/probed-id-fields.js +25 -0
- package/dist/probed-id-source.d.ts +11 -0
- package/dist/probed-id-source.d.ts.map +1 -0
- package/dist/probed-id-source.js +11 -0
- package/dist/profile-registry.d.ts +25 -2
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +59 -6
- package/dist/quality-gate-examination.d.ts +15 -0
- package/dist/quality-gate-examination.d.ts.map +1 -0
- package/dist/quality-gate-examination.js +15 -0
- package/dist/quality-gate-row-status.d.ts +19 -0
- package/dist/quality-gate-row-status.d.ts.map +1 -0
- package/dist/quality-gate-row-status.js +28 -0
- package/dist/quality-gate-status.d.ts +16 -0
- package/dist/quality-gate-status.d.ts.map +1 -0
- package/dist/quality-gate-status.js +16 -0
- package/dist/quality-html.d.ts.map +1 -1
- package/dist/quality-html.js +14 -3
- package/dist/quality-report-coverage.d.ts +26 -0
- package/dist/quality-report-coverage.d.ts.map +1 -0
- package/dist/quality-report-coverage.js +48 -0
- package/dist/quality-report.d.ts +28 -1
- package/dist/quality-report.d.ts.map +1 -1
- package/dist/quality-report.js +263 -35
- package/dist/query-intent-kind.d.ts +18 -0
- package/dist/query-intent-kind.d.ts.map +1 -0
- package/dist/query-intent-kind.js +18 -0
- package/dist/query-intent-result.d.ts +23 -0
- package/dist/query-intent-result.d.ts.map +1 -0
- package/dist/query-intent-result.js +1 -0
- package/dist/query-intent.d.ts +18 -0
- package/dist/query-intent.d.ts.map +1 -0
- package/dist/query-intent.js +336 -0
- package/dist/query-resolver.d.ts +18 -0
- package/dist/query-resolver.d.ts.map +1 -1
- package/dist/query-resolver.js +7 -4
- package/dist/ranked-recommendations.d.ts +36 -0
- package/dist/ranked-recommendations.d.ts.map +1 -0
- package/dist/ranked-recommendations.js +1 -0
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +38 -10
- package/dist/recommend-recipe.d.ts +17 -0
- package/dist/recommend-recipe.d.ts.map +1 -0
- package/dist/recommend-recipe.js +1 -0
- package/dist/recommend-recipes.d.ts +9 -0
- package/dist/recommend-recipes.d.ts.map +1 -0
- package/dist/recommend-recipes.js +106 -0
- package/dist/recommendation-candidate.d.ts +30 -0
- package/dist/recommendation-candidate.d.ts.map +1 -0
- package/dist/recommendation-candidate.js +1 -0
- package/dist/recommendation-confidence.d.ts +27 -0
- package/dist/recommendation-confidence.d.ts.map +1 -0
- package/dist/recommendation-confidence.js +1 -0
- package/dist/recommendation-ranking-options.d.ts +24 -0
- package/dist/recommendation-ranking-options.d.ts.map +1 -0
- package/dist/recommendation-ranking-options.js +1 -0
- package/dist/recommendation-ranking.d.ts +50 -0
- package/dist/recommendation-ranking.d.ts.map +1 -0
- package/dist/recommendation-ranking.js +527 -0
- package/dist/recommendation-source.d.ts +23 -0
- package/dist/recommendation-source.d.ts.map +1 -0
- package/dist/recommendation-source.js +23 -0
- package/dist/recommendation-suppression.d.ts +14 -0
- package/dist/recommendation-suppression.d.ts.map +1 -0
- package/dist/recommendation-suppression.js +14 -0
- package/dist/reference-asset-kind.d.ts +14 -0
- package/dist/reference-asset-kind.d.ts.map +1 -0
- package/dist/reference-asset-kind.js +14 -0
- package/dist/reference-content-check.d.ts +32 -0
- package/dist/reference-content-check.d.ts.map +1 -0
- package/dist/reference-content-check.js +143 -0
- package/dist/reference-failure.d.ts +31 -0
- package/dist/reference-failure.d.ts.map +1 -0
- package/dist/reference-failure.js +31 -0
- package/dist/reference-id-status.d.ts +15 -0
- package/dist/reference-id-status.d.ts.map +1 -0
- package/dist/reference-id-status.js +15 -0
- package/dist/reference-kind-declarations.d.ts +42 -0
- package/dist/reference-kind-declarations.d.ts.map +1 -0
- package/dist/reference-kind-declarations.js +142 -0
- package/dist/reference-lookup.d.ts +6 -0
- package/dist/reference-lookup.d.ts.map +1 -1
- package/dist/reference-lookup.js +13 -5
- package/dist/reference-registry.d.ts +109 -11
- package/dist/reference-registry.d.ts.map +1 -1
- package/dist/reference-registry.js +186 -30
- package/dist/reference-subject.d.ts +20 -0
- package/dist/reference-subject.d.ts.map +1 -0
- package/dist/reference-subject.js +1 -0
- package/dist/registration-hint-discovery-status.d.ts +25 -0
- package/dist/registration-hint-discovery-status.d.ts.map +1 -0
- package/dist/registration-hint-discovery-status.js +25 -0
- package/dist/registration-hint-registry.d.ts +80 -0
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +356 -138
- package/dist/registry-lifecycle.d.ts +200 -19
- package/dist/registry-lifecycle.d.ts.map +1 -1
- package/dist/registry-lifecycle.js +526 -136
- package/dist/release-readiness.d.ts.map +1 -1
- package/dist/release-readiness.js +10 -7
- package/dist/release-smoke.d.ts.map +1 -1
- package/dist/release-smoke.js +11 -7
- package/dist/report-site.d.ts.map +1 -1
- package/dist/report-site.js +25 -7
- package/dist/repository-intelligence.d.ts.map +1 -1
- package/dist/repository-intelligence.js +3 -2
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/repository-knowledge-model.js +18 -5
- package/dist/resolve-project-config.d.ts +64 -0
- package/dist/resolve-project-config.d.ts.map +1 -1
- package/dist/resolve-project-config.js +240 -32
- package/dist/reuse/compute-reuse-coverage.d.ts +29 -0
- package/dist/reuse/compute-reuse-coverage.d.ts.map +1 -0
- package/dist/reuse/compute-reuse-coverage.js +198 -0
- package/dist/reuse/rank-reuse-candidates.d.ts +38 -0
- package/dist/reuse/rank-reuse-candidates.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-candidates.js +212 -0
- package/dist/reuse/rank-reuse-options.d.ts +20 -0
- package/dist/reuse/rank-reuse-options.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-options.js +1 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts +15 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-suggestions.js +31 -0
- package/dist/reuse/resolve-curated-reuse.d.ts +43 -0
- package/dist/reuse/resolve-curated-reuse.d.ts.map +1 -0
- package/dist/reuse/resolve-curated-reuse.js +115 -0
- package/dist/reuse/reuse-candidate.d.ts +29 -0
- package/dist/reuse/reuse-candidate.d.ts.map +1 -0
- package/dist/reuse/reuse-candidate.js +1 -0
- package/dist/reuse/reuse-coverage-report.d.ts +74 -0
- package/dist/reuse/reuse-coverage-report.d.ts.map +1 -0
- package/dist/reuse/reuse-coverage-report.js +1 -0
- package/dist/reuse/reuse-curated-coverage.d.ts +36 -0
- package/dist/reuse/reuse-curated-coverage.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-coverage.js +1 -0
- package/dist/reuse/reuse-curated-resolution.d.ts +36 -0
- package/dist/reuse/reuse-curated-resolution.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-resolution.js +1 -0
- package/dist/reuse/reuse-curated-status.d.ts +21 -0
- package/dist/reuse/reuse-curated-status.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-status.js +21 -0
- package/dist/reuse/reuse-match-detail.d.ts +15 -0
- package/dist/reuse/reuse-match-detail.d.ts.map +1 -0
- package/dist/reuse/reuse-match-detail.js +1 -0
- package/dist/reuse/reuse-ranking.d.ts +37 -0
- package/dist/reuse/reuse-ranking.d.ts.map +1 -0
- package/dist/reuse/reuse-ranking.js +1 -0
- package/dist/reuse/reuse-suggestion.d.ts +19 -0
- package/dist/reuse/reuse-suggestion.d.ts.map +1 -0
- package/dist/reuse/reuse-suggestion.js +1 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts +28 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts.map +1 -0
- package/dist/reuse/reuse-symbol-lookup.js +1 -0
- package/dist/reuse/reuse-tokenize.d.ts +11 -0
- package/dist/reuse/reuse-tokenize.d.ts.map +1 -0
- package/dist/reuse/reuse-tokenize.js +26 -0
- package/dist/reuse/score-reuse-name.d.ts +16 -0
- package/dist/reuse/score-reuse-name.d.ts.map +1 -0
- package/dist/reuse/score-reuse-name.js +35 -0
- package/dist/reuse/score-reuse-primitive.d.ts +33 -0
- package/dist/reuse/score-reuse-primitive.d.ts.map +1 -0
- package/dist/reuse/score-reuse-primitive.js +92 -0
- package/dist/review-packet.d.ts +2 -0
- package/dist/review-packet.d.ts.map +1 -1
- package/dist/review-packet.js +13 -6
- package/dist/role-views.d.ts.map +1 -1
- package/dist/role-views.js +16 -16
- package/dist/routing-recommends-channels.d.ts +24 -0
- package/dist/routing-recommends-channels.d.ts.map +1 -0
- package/dist/routing-recommends-channels.js +19 -0
- package/dist/run-boundary-check.d.ts +118 -0
- package/dist/run-boundary-check.d.ts.map +1 -0
- package/dist/run-boundary-check.js +592 -0
- package/dist/safety-audit.js +1 -1
- package/dist/scaffold-coverage.js +1 -1
- package/dist/scaffold-pattern-doctor-report.d.ts +19 -0
- package/dist/scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/scaffold-pattern-doctor-report.js +54 -0
- package/dist/scaffold-patterns.d.ts +75 -1
- package/dist/scaffold-patterns.d.ts.map +1 -1
- package/dist/scaffold-patterns.js +375 -84
- package/dist/schema-inventory.d.ts.map +1 -1
- package/dist/schema-inventory.js +4 -3
- package/dist/search-document-id.d.ts +52 -0
- package/dist/search-document-id.d.ts.map +1 -0
- package/dist/search-document-id.js +72 -0
- package/dist/search-document-prefix.d.ts +7 -0
- package/dist/search-document-prefix.d.ts.map +1 -0
- package/dist/search-document-prefix.js +1 -0
- package/dist/search-index.d.ts.map +1 -1
- package/dist/search-index.js +20 -23
- package/dist/search-tuning-explain.d.ts +6 -0
- package/dist/search-tuning-explain.d.ts.map +1 -1
- package/dist/search-tuning-explain.js +19 -17
- package/dist/search-tuning-key-probes.d.ts +16 -0
- package/dist/search-tuning-key-probes.d.ts.map +1 -0
- package/dist/search-tuning-key-probes.js +65 -0
- package/dist/search-tuning-key-resolution.d.ts +25 -0
- package/dist/search-tuning-key-resolution.d.ts.map +1 -0
- package/dist/search-tuning-key-resolution.js +1 -0
- package/dist/search-tuning-key-resolver.d.ts +4 -0
- package/dist/search-tuning-key-resolver.d.ts.map +1 -0
- package/dist/search-tuning-key-resolver.js +107 -0
- package/dist/search-tuning-key-status.d.ts +24 -0
- package/dist/search-tuning-key-status.d.ts.map +1 -0
- package/dist/search-tuning-key-status.js +24 -0
- package/dist/search-tuning-lint.d.ts +9 -0
- package/dist/search-tuning-lint.d.ts.map +1 -0
- package/dist/search-tuning-lint.js +468 -0
- package/dist/search-tuning-registry.d.ts +43 -0
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +214 -49
- package/dist/self-audit.d.ts +12 -0
- package/dist/self-audit.d.ts.map +1 -1
- package/dist/self-audit.js +36 -10
- package/dist/self-config-doctor-v2.d.ts +145 -3
- package/dist/self-config-doctor-v2.d.ts.map +1 -1
- package/dist/self-config-doctor-v2.js +1304 -181
- package/dist/self-config-doctor.d.ts +20 -1
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +53 -280
- package/dist/settled-unit-states.d.ts +9 -0
- package/dist/settled-unit-states.d.ts.map +1 -0
- package/dist/settled-unit-states.js +14 -0
- package/dist/sharkcraft-inspector.d.ts +34 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +273 -26
- package/dist/spec/spec-evidence.d.ts.map +1 -1
- package/dist/spec/spec-evidence.js +14 -20
- package/dist/split-identifier.d.ts +21 -0
- package/dist/split-identifier.d.ts.map +1 -0
- package/dist/split-identifier.js +27 -0
- package/dist/start-here.d.ts.map +1 -1
- package/dist/start-here.js +1 -2
- package/dist/substitute-placeholders.d.ts +8 -0
- package/dist/substitute-placeholders.d.ts.map +1 -0
- package/dist/substitute-placeholders.js +9 -0
- package/dist/symbol-index.d.ts +33 -0
- package/dist/symbol-index.d.ts.map +1 -1
- package/dist/symbol-index.js +241 -3
- package/dist/symbol-member-entry.d.ts +26 -0
- package/dist/symbol-member-entry.d.ts.map +1 -0
- package/dist/symbol-member-entry.js +1 -0
- package/dist/symbol-member-kind.d.ts +14 -0
- package/dist/symbol-member-kind.d.ts.map +1 -0
- package/dist/symbol-member-kind.js +14 -0
- package/dist/task-packet.d.ts.map +1 -1
- package/dist/task-packet.js +52 -9
- package/dist/task-ranker.d.ts +8 -0
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +25 -13
- package/dist/task-risk.js +1 -1
- package/dist/task-routing-hint-registry.d.ts +20 -1
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +186 -42
- package/dist/template-drift.d.ts.map +1 -1
- package/dist/template-drift.js +30 -9
- package/dist/template-lint.d.ts.map +1 -1
- package/dist/template-lint.js +160 -2
- package/dist/term-query.d.ts +10 -0
- package/dist/term-query.d.ts.map +1 -0
- package/dist/term-query.js +1 -0
- package/dist/test-definitions.d.ts +6 -3
- package/dist/test-definitions.d.ts.map +1 -1
- package/dist/test-runner.d.ts +95 -10
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +309 -308
- package/dist/tuning-query-tokens.d.ts +29 -0
- package/dist/tuning-query-tokens.d.ts.map +1 -0
- package/dist/tuning-query-tokens.js +51 -0
- package/dist/typecheck-files.d.ts +36 -0
- package/dist/typecheck-files.d.ts.map +1 -0
- package/dist/typecheck-files.js +158 -0
- package/dist/uncertainty.js +1 -1
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +5 -3
- package/dist/unregistered-exports.d.ts +19 -0
- package/dist/unregistered-exports.d.ts.map +1 -0
- package/dist/unregistered-exports.js +141 -0
- package/dist/unresolvable-reason.d.ts +11 -0
- package/dist/unresolvable-reason.d.ts.map +1 -0
- package/dist/unresolvable-reason.js +11 -0
- package/dist/upgrade-advisor.d.ts.map +1 -1
- package/dist/upgrade-advisor.js +16 -9
- package/dist/validate-contribution-file.d.ts +4 -0
- package/dist/validate-contribution-file.d.ts.map +1 -0
- package/dist/validate-contribution-file.js +228 -0
- package/dist/why-file.d.ts +3 -0
- package/dist/why-file.d.ts.map +1 -1
- package/dist/why-file.js +7 -3
- package/package.json +17 -17
package/dist/test-runner.js
CHANGED
|
@@ -1,64 +1,142 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
3
|
import { buildContext } from '@shrkcrft/context';
|
|
4
|
-
import { listConstructs } from "./construct-registry.js";
|
|
5
|
-
import { listPolicyIds } from "./policy-registry.js";
|
|
6
|
-
import { listPlaybooks } from "./playbook-registry.js";
|
|
7
4
|
import { buildTaskPacket } from "./task-packet.js";
|
|
8
5
|
import { rankKnowledgeEntries } from "./task-ranker.js";
|
|
9
6
|
import { contextTuningBoostFor } from "./context-tuning.js";
|
|
10
7
|
import { buildProjectOverview, renderOverviewText } from "./project-overview.js";
|
|
11
|
-
import {
|
|
12
|
-
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 `[]`. */
|
|
13
43
|
async function importDefaultArray(absPath) {
|
|
14
44
|
if (!existsSync(absPath))
|
|
15
|
-
return [];
|
|
45
|
+
return { items: [] };
|
|
16
46
|
try {
|
|
17
47
|
const mod = (await importModuleViaLoader(absPath));
|
|
18
|
-
return Array.isArray(mod.default) ? mod.default : [];
|
|
48
|
+
return { items: Array.isArray(mod.default) ? mod.default : [] };
|
|
19
49
|
}
|
|
20
|
-
catch {
|
|
21
|
-
return [];
|
|
50
|
+
catch (e) {
|
|
51
|
+
return { items: [], error: (e.message ?? String(e)).split('\n')[0].trim() };
|
|
22
52
|
}
|
|
23
53
|
}
|
|
24
54
|
/**
|
|
25
|
-
*
|
|
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.
|
|
26
59
|
*/
|
|
27
|
-
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) {
|
|
28
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
|
+
};
|
|
29
107
|
// Local config file.
|
|
30
108
|
if (inspection.sharkcraftDir) {
|
|
31
|
-
const local = nodePath.join(inspection.sharkcraftDir,
|
|
32
|
-
if (existsSync(local))
|
|
33
|
-
|
|
34
|
-
}
|
|
109
|
+
const local = nodePath.join(inspection.sharkcraftDir, localName);
|
|
110
|
+
if (existsSync(local))
|
|
111
|
+
await readInto(local);
|
|
35
112
|
}
|
|
36
113
|
// Pack contributions.
|
|
37
114
|
for (const pack of inspection.packs.validPacks) {
|
|
38
115
|
const c = pack.manifest.contributions;
|
|
39
|
-
for (const rel of c
|
|
40
|
-
|
|
41
|
-
tests.push(...(await importDefaultArray(full)));
|
|
42
|
-
}
|
|
116
|
+
for (const rel of c[slot] ?? [])
|
|
117
|
+
await readInto(nodePath.resolve(pack.packageRoot, rel), pack.packageName);
|
|
43
118
|
}
|
|
44
|
-
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];
|
|
45
137
|
}
|
|
46
138
|
export async function loadAgentContractTests(inspection) {
|
|
47
|
-
|
|
48
|
-
if (inspection.sharkcraftDir) {
|
|
49
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'agent-tests.ts');
|
|
50
|
-
if (existsSync(local)) {
|
|
51
|
-
tests.push(...(await importDefaultArray(local)));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
for (const pack of inspection.packs.validPacks) {
|
|
55
|
-
const c = pack.manifest.contributions;
|
|
56
|
-
for (const rel of c.agentTestFiles ?? []) {
|
|
57
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
58
|
-
tests.push(...(await importDefaultArray(full)));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return tests;
|
|
139
|
+
return [...(await loadAgentContractTestsWithIssues(inspection)).tests];
|
|
62
140
|
}
|
|
63
141
|
export function runContextTest(inspection, test) {
|
|
64
142
|
const overview = buildProjectOverview(inspection.workspace, inspection.config?.projectName);
|
|
@@ -91,29 +169,33 @@ export function runContextTest(inspection, test) {
|
|
|
91
169
|
// Diagnostics: only populate on failure. Show the top-ranked alternatives
|
|
92
170
|
// the ranker chose for the task, so the test author can see what beat the
|
|
93
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.
|
|
94
174
|
let diagnostics;
|
|
95
175
|
if (!passed) {
|
|
96
176
|
const ranked = rankKnowledgeEntries(inspection.knowledgeEntries, test.task);
|
|
177
|
+
const knowledgeRegistry = consulted(inspection, 'knowledge');
|
|
97
178
|
diagnostics = [];
|
|
98
179
|
for (const id of missingInclude) {
|
|
99
|
-
const exists = inspection
|
|
180
|
+
const exists = referenceIdExists(inspection, 'knowledge', id);
|
|
100
181
|
diagnostics.push({
|
|
101
182
|
id,
|
|
102
183
|
existsInRegistry: exists,
|
|
184
|
+
consulted: knowledgeRegistry,
|
|
103
185
|
topAlternatives: ranked.slice(0, 5).map((r) => ({
|
|
104
186
|
id: r.item.id,
|
|
105
187
|
score: r.score,
|
|
106
188
|
reasons: r.reasons,
|
|
107
189
|
})),
|
|
108
|
-
suggestions: buildMissingIncludeSuggestions(id, exists, test.task),
|
|
190
|
+
suggestions: buildMissingIncludeSuggestions(id, exists, test.task, knowledgeRegistry),
|
|
109
191
|
});
|
|
110
192
|
}
|
|
111
193
|
for (const id of unexpectedInclude) {
|
|
112
|
-
const entry = inspection.knowledgeEntries.find((e) => e.id === id);
|
|
113
194
|
const reasons = ranked.find((r) => r.item.id === id)?.reasons ?? [];
|
|
114
195
|
diagnostics.push({
|
|
115
196
|
id,
|
|
116
|
-
existsInRegistry:
|
|
197
|
+
existsInRegistry: referenceIdExists(inspection, 'knowledge', id),
|
|
198
|
+
consulted: knowledgeRegistry,
|
|
117
199
|
topAlternatives: reasons.length
|
|
118
200
|
? [{ id, score: ranked.find((r) => r.item.id === id)?.score ?? 0, reasons }]
|
|
119
201
|
: undefined,
|
|
@@ -141,10 +223,10 @@ export function runContextTest(inspection, test) {
|
|
|
141
223
|
result.diagnostics = diagnostics;
|
|
142
224
|
return result;
|
|
143
225
|
}
|
|
144
|
-
function buildMissingIncludeSuggestions(id, existsInRegistry, task) {
|
|
226
|
+
function buildMissingIncludeSuggestions(id, existsInRegistry, task, registry) {
|
|
145
227
|
if (!existsInRegistry) {
|
|
146
228
|
return [
|
|
147
|
-
`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.`,
|
|
148
230
|
`If the test expectation is wrong, update sharkcraft/context-tests.ts.`,
|
|
149
231
|
];
|
|
150
232
|
}
|
|
@@ -156,38 +238,91 @@ function buildMissingIncludeSuggestions(id, existsInRegistry, task) {
|
|
|
156
238
|
`Or raise its priority / shorten the title to include task-relevant tokens.`,
|
|
157
239
|
];
|
|
158
240
|
}
|
|
159
|
-
export function runAgentContractTest(inspection, test,
|
|
241
|
+
export function runAgentContractTest(inspection, test,
|
|
242
|
+
/** @deprecated Ignored — existence resolves through the shared reference registry. */
|
|
243
|
+
_registries) {
|
|
160
244
|
// Self-tests assert specific rules/templates appear for a task — they
|
|
161
245
|
// test semantics, not packet size. Opt out of the compact cap so the
|
|
162
246
|
// assertions see the full ranking.
|
|
163
247
|
const packet = buildTaskPacket(inspection, test.task, { maxTokens: 3500, compact: false });
|
|
164
248
|
const actualPipelines = packet.recommendedPipelines.map((p) => p.pipelineId);
|
|
249
|
+
// ── Ranker-SURFACED expectations (order-sensitive) ─────────────────────
|
|
165
250
|
const missingTemplates = (test.expectedTemplates ?? []).filter((id) => !packet.relevantTemplates.some((t) => t.id === id));
|
|
166
251
|
const missingRules = (test.expectedRules ?? []).filter((id) => !packet.relevantRules.some((r) => r.id === id));
|
|
167
252
|
const missingForbidden = (test.expectedForbiddenActions ?? []).filter((a) => !packet.forbiddenActions.includes(a));
|
|
168
253
|
const missingVerification = (test.expectedVerificationCommands ?? []).filter((c) => !packet.verificationCommands.includes(c));
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
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
|
+
}
|
|
191
326
|
// mustNotInclude — fail if any of these ids ended up surfaced in the packet.
|
|
192
327
|
const surfacedIds = new Set();
|
|
193
328
|
for (const t of packet.relevantTemplates)
|
|
@@ -202,77 +337,82 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
202
337
|
surfacedIds.add(p.preset.id);
|
|
203
338
|
const unexpectedlyIncluded = (test.mustNotInclude ?? []).filter((id) => surfacedIds.has(id));
|
|
204
339
|
const pipelineOk = !test.expectedPipeline || actualPipelines.includes(test.expectedPipeline);
|
|
205
|
-
const
|
|
206
|
-
missingTemplates.length
|
|
207
|
-
missingRules.length
|
|
208
|
-
missingForbidden.length
|
|
209
|
-
missingVerification.length
|
|
210
|
-
missingHelpers.length
|
|
211
|
-
missingPlaybooks.length
|
|
212
|
-
missingPolicies.length
|
|
213
|
-
missingConstructs.length
|
|
214
|
-
missingCommands.length
|
|
215
|
-
missingKnowledge.length
|
|
216
|
-
unexpectedlyIncluded.length
|
|
217
|
-
|
|
218
|
-
|
|
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.
|
|
219
360
|
let diagnostics;
|
|
220
361
|
if (!passed) {
|
|
221
362
|
diagnostics = [];
|
|
222
|
-
|
|
223
|
-
const exists = inspection
|
|
224
|
-
|
|
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 {
|
|
225
368
|
id,
|
|
226
|
-
kind
|
|
369
|
+
kind,
|
|
227
370
|
existsInRegistry: exists,
|
|
371
|
+
assertion: 'surfaced',
|
|
372
|
+
code: exists ? 'not-surfaced' : 'unknown-id',
|
|
373
|
+
consulted: registry,
|
|
228
374
|
suggestions: exists
|
|
229
|
-
?
|
|
230
|
-
`Template "${id}" exists but the ranker did not place it in the top results.`,
|
|
231
|
-
'Add task-aligned tags/appliesWhen to the template (e.g. tags:["service"], appliesWhen:["generate-service"]).',
|
|
232
|
-
'Reference the template from a preset that matches the task profile (includes.templateIds).',
|
|
233
|
-
'Reference it from a pipeline step (`step.references`).',
|
|
234
|
-
]
|
|
375
|
+
? whenExists
|
|
235
376
|
: [
|
|
236
|
-
|
|
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.',
|
|
237
379
|
],
|
|
238
|
-
}
|
|
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
|
+
]));
|
|
239
389
|
}
|
|
240
390
|
for (const id of missingRules) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
'Add domain tags (service / utility / route / pipeline).',
|
|
251
|
-
'Reference it from actionHints.relatedTemplates on a rule that *is* ranking, or include it in a preset.',
|
|
252
|
-
]
|
|
253
|
-
: [
|
|
254
|
-
`Rule "${id}" does not exist — install the pack that ships it or correct the id.`,
|
|
255
|
-
],
|
|
256
|
-
});
|
|
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
|
+
]));
|
|
257
400
|
}
|
|
258
401
|
if (!pipelineOk && test.expectedPipeline) {
|
|
259
|
-
diagnostics.push(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
'Add domain-aligned tags to the pipeline (tags:["plugin"], …).',
|
|
266
|
-
'Add task tokens to its title / description so the ranker catches them.',
|
|
267
|
-
'Reference the pipeline from a preset that the task profile recommends.',
|
|
268
|
-
],
|
|
269
|
-
});
|
|
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
|
+
]));
|
|
270
408
|
}
|
|
271
409
|
for (const action of missingForbidden) {
|
|
272
410
|
diagnostics.push({
|
|
273
411
|
id: action,
|
|
274
412
|
kind: 'forbidden-action',
|
|
275
413
|
existsInRegistry: false,
|
|
414
|
+
assertion: 'surfaced',
|
|
415
|
+
code: 'not-aggregated',
|
|
276
416
|
suggestions: [
|
|
277
417
|
`No rule's actionHints.forbiddenActions contains "${action}" for this task's relevant set.`,
|
|
278
418
|
'Add the forbiddenAction to one of the high-priority rules that match this task.',
|
|
@@ -284,83 +424,58 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
284
424
|
id: cmd,
|
|
285
425
|
kind: 'verification-command',
|
|
286
426
|
existsInRegistry: false,
|
|
427
|
+
assertion: 'surfaced',
|
|
428
|
+
code: 'not-aggregated',
|
|
287
429
|
suggestions: [
|
|
288
430
|
`Verification command "${cmd}" is not aggregated for this task.`,
|
|
289
431
|
'Add it to a high-priority rule\'s actionHints.verificationCommands.',
|
|
290
432
|
],
|
|
291
433
|
});
|
|
292
434
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
435
|
+
const existsDiagnostic = (kind, id, hint) => {
|
|
436
|
+
const registry = consulted(inspection, kind);
|
|
437
|
+
const cold = unverifiedIds.has(`${kind}:${id}`);
|
|
438
|
+
return {
|
|
296
439
|
id,
|
|
297
|
-
kind
|
|
298
|
-
existsInRegistry:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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.'));
|
|
304
458
|
}
|
|
305
459
|
for (const id of missingPlaybooks) {
|
|
306
|
-
diagnostics.push(
|
|
307
|
-
id,
|
|
308
|
-
kind: 'playbook',
|
|
309
|
-
existsInRegistry: playbookList.has(id),
|
|
310
|
-
suggestions: [
|
|
311
|
-
`Playbook "${id}" not found in the playbook registry — install the pack that ships it or correct the id.`,
|
|
312
|
-
'Ensure the playbook file is referenced in sharkcraft.config.ts / pack contributions and exports a default array.',
|
|
313
|
-
],
|
|
314
|
-
});
|
|
460
|
+
diagnostics.push(existsDiagnostic('playbook', id, 'Ensure the playbook file is referenced in sharkcraft.config.ts / pack contributions and exports a default array.'));
|
|
315
461
|
}
|
|
316
462
|
for (const id of missingPolicies) {
|
|
317
|
-
diagnostics.push(
|
|
318
|
-
id,
|
|
319
|
-
kind: 'policy',
|
|
320
|
-
existsInRegistry: policyChecks.has(id),
|
|
321
|
-
suggestions: [
|
|
322
|
-
`Policy "${id}" not found in the policy-engine checks — install the pack that ships it or correct the id.`,
|
|
323
|
-
'Add it to sharkcraft/policies.ts or a pack policyCheckFile.',
|
|
324
|
-
],
|
|
325
|
-
});
|
|
463
|
+
diagnostics.push(existsDiagnostic('policy', id, 'Add it to sharkcraft/policies.ts or a pack policyCheckFile.'));
|
|
326
464
|
}
|
|
327
465
|
for (const id of missingConstructs) {
|
|
328
|
-
diagnostics.push(
|
|
329
|
-
id,
|
|
330
|
-
kind: 'construct',
|
|
331
|
-
existsInRegistry: constructList.has(id),
|
|
332
|
-
suggestions: [
|
|
333
|
-
`Construct "${id}" not found in the construct registry — install the pack that ships it or correct the id.`,
|
|
334
|
-
'Add a defineConstruct() entry in sharkcraft/constructs.ts or a pack constructFile.',
|
|
335
|
-
],
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
for (const id of missingCommands) {
|
|
339
|
-
diagnostics.push({
|
|
340
|
-
id,
|
|
341
|
-
kind: 'command',
|
|
342
|
-
existsInRegistry: commandCatalog.has(id) || commandCatalog.has(id.split(' ')[0]),
|
|
343
|
-
suggestions: [
|
|
344
|
-
`Command "${id}" was not surfaced for "${test.task}" and is not in the command catalog.`,
|
|
345
|
-
'Add it to a high-priority rule\'s actionHints.commands or check the command-catalog.ts entries.',
|
|
346
|
-
],
|
|
347
|
-
});
|
|
466
|
+
diagnostics.push(existsDiagnostic('construct', id, 'Add a defineConstruct() entry in sharkcraft/constructs.ts or a pack constructFile.'));
|
|
348
467
|
}
|
|
468
|
+
diagnostics.push(...commandDiagnostics);
|
|
349
469
|
for (const id of missingKnowledge) {
|
|
350
|
-
diagnostics.push(
|
|
351
|
-
id,
|
|
352
|
-
kind: 'knowledge',
|
|
353
|
-
existsInRegistry: knowledgeIds.has(id),
|
|
354
|
-
suggestions: [
|
|
355
|
-
`Knowledge entry "${id}" is not present in the inspection — install the pack that ships it or correct the id.`,
|
|
356
|
-
],
|
|
357
|
-
});
|
|
470
|
+
diagnostics.push(existsDiagnostic('knowledge', id, 'Install the pack that ships it or correct the id.'));
|
|
358
471
|
}
|
|
359
472
|
for (const id of unexpectedlyIncluded) {
|
|
360
473
|
diagnostics.push({
|
|
361
474
|
id,
|
|
362
475
|
kind: 'must-not-include',
|
|
363
476
|
existsInRegistry: true,
|
|
477
|
+
assertion: 'surfaced',
|
|
478
|
+
code: 'surfaced-but-forbidden',
|
|
364
479
|
suggestions: [
|
|
365
480
|
`"${id}" was surfaced by the ranker but the test forbids it.`,
|
|
366
481
|
'Narrow its appliesWhen / tags to avoid matching this task wording.',
|
|
@@ -372,6 +487,7 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
372
487
|
id: test.id,
|
|
373
488
|
task: test.task,
|
|
374
489
|
passed,
|
|
490
|
+
verdict,
|
|
375
491
|
actualPipelines,
|
|
376
492
|
missingTemplates,
|
|
377
493
|
missingRules,
|
|
@@ -385,6 +501,8 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
385
501
|
missingKnowledge,
|
|
386
502
|
unexpectedlyIncluded,
|
|
387
503
|
};
|
|
504
|
+
if (unverified.length > 0)
|
|
505
|
+
result.unverified = unverified;
|
|
388
506
|
if (test.expectedPipeline)
|
|
389
507
|
result.expectedPipeline = test.expectedPipeline;
|
|
390
508
|
if (!passed) {
|
|
@@ -400,149 +518,32 @@ export function runAgentContractTest(inspection, test, registries) {
|
|
|
400
518
|
`missingKnowledge=${missingKnowledge.length}`,
|
|
401
519
|
`unexpectedlyIncluded=${unexpectedlyIncluded.length}`,
|
|
402
520
|
];
|
|
521
|
+
if (unverified.length > 0)
|
|
522
|
+
partsList.push(`unverified=${unverified.length}`);
|
|
403
523
|
result.failureSummary = partsList.join(' ');
|
|
404
524
|
}
|
|
405
525
|
if (diagnostics)
|
|
406
526
|
result.diagnostics = diagnostics;
|
|
407
527
|
return result;
|
|
408
528
|
}
|
|
409
|
-
// ── Registry helpers ────────────────────────────────────────────────
|
|
410
|
-
function loadHelperRegistryQuietly() {
|
|
411
|
-
try {
|
|
412
|
-
return new Set(HELPERS.map((h) => h.id));
|
|
413
|
-
}
|
|
414
|
-
catch {
|
|
415
|
-
return new Set();
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
function listPlaybookIdsQuietly(inspection) {
|
|
419
|
-
try {
|
|
420
|
-
return new Set(listPlaybooks(inspection).map((p) => p.id));
|
|
421
|
-
}
|
|
422
|
-
catch {
|
|
423
|
-
return new Set();
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
function listPolicyIdsQuietly(inspection) {
|
|
427
|
-
return new Set(listPolicyIds(inspection));
|
|
428
|
-
}
|
|
429
|
-
function listConstructIdsQuietly(inspection) {
|
|
430
|
-
try {
|
|
431
|
-
return new Set(listConstructs(inspection).map((c) => c.id));
|
|
432
|
-
}
|
|
433
|
-
catch {
|
|
434
|
-
return new Set();
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
function listCommandIdsQuietly(inspection) {
|
|
438
|
-
const cat = inspection.commandCatalog ?? [];
|
|
439
|
-
const out = new Set();
|
|
440
|
-
for (const c of cat) {
|
|
441
|
-
if (c.id)
|
|
442
|
-
out.add(c.id);
|
|
443
|
-
if (c.command)
|
|
444
|
-
out.add(c.command);
|
|
445
|
-
}
|
|
446
|
-
return out;
|
|
447
|
-
}
|
|
448
529
|
/**
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
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).
|
|
453
537
|
*/
|
|
454
|
-
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));
|
|
455
541
|
return {
|
|
456
|
-
helpers:
|
|
457
|
-
playbooks:
|
|
458
|
-
policies:
|
|
459
|
-
constructs:
|
|
460
|
-
commands:
|
|
461
|
-
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'),
|
|
462
548
|
};
|
|
463
549
|
}
|
|
464
|
-
async function importDefaultIdsArray(absPath) {
|
|
465
|
-
if (!existsSync(absPath))
|
|
466
|
-
return [];
|
|
467
|
-
try {
|
|
468
|
-
const mod = (await importModuleViaLoader(absPath));
|
|
469
|
-
return Array.isArray(mod.default) ? mod.default : [];
|
|
470
|
-
}
|
|
471
|
-
catch {
|
|
472
|
-
return [];
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
async function loadPolicyIdsAsync(inspection) {
|
|
476
|
-
const out = new Set();
|
|
477
|
-
if (inspection.sharkcraftDir) {
|
|
478
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'policies.ts');
|
|
479
|
-
for (const entry of await importDefaultIdsArray(local)) {
|
|
480
|
-
if (entry?.id)
|
|
481
|
-
out.add(entry.id);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
for (const pack of inspection.packs.validPacks) {
|
|
485
|
-
const c = pack.manifest.contributions;
|
|
486
|
-
for (const rel of c.policyCheckFiles ?? []) {
|
|
487
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
488
|
-
for (const entry of await importDefaultIdsArray(full)) {
|
|
489
|
-
if (entry?.id)
|
|
490
|
-
out.add(entry.id);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
// Also include any policyChecks already on the inspection (sync fallback).
|
|
495
|
-
for (const id of listPolicyIdsQuietly(inspection))
|
|
496
|
-
out.add(id);
|
|
497
|
-
return out;
|
|
498
|
-
}
|
|
499
|
-
async function loadPlaybookIdsAsync(inspection) {
|
|
500
|
-
const out = new Set();
|
|
501
|
-
// Sync fallback from registry.
|
|
502
|
-
for (const id of listPlaybookIdsQuietly(inspection))
|
|
503
|
-
out.add(id);
|
|
504
|
-
// Local file.
|
|
505
|
-
if (inspection.sharkcraftDir) {
|
|
506
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'playbooks.ts');
|
|
507
|
-
for (const entry of await importDefaultIdsArray(local)) {
|
|
508
|
-
if (entry?.id)
|
|
509
|
-
out.add(entry.id);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
// Pack contributions.
|
|
513
|
-
for (const pack of inspection.packs.validPacks) {
|
|
514
|
-
const c = pack.manifest.contributions;
|
|
515
|
-
for (const rel of c.playbookFiles ?? []) {
|
|
516
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
517
|
-
for (const entry of await importDefaultIdsArray(full)) {
|
|
518
|
-
if (entry?.id)
|
|
519
|
-
out.add(entry.id);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
return out;
|
|
524
|
-
}
|
|
525
|
-
async function loadConstructIdsAsync(inspection) {
|
|
526
|
-
const out = new Set();
|
|
527
|
-
// Sync fallback first.
|
|
528
|
-
for (const id of listConstructIdsQuietly(inspection))
|
|
529
|
-
out.add(id);
|
|
530
|
-
if (inspection.sharkcraftDir) {
|
|
531
|
-
const local = nodePath.join(inspection.sharkcraftDir, 'constructs.ts');
|
|
532
|
-
for (const entry of await importDefaultIdsArray(local)) {
|
|
533
|
-
if (entry?.id)
|
|
534
|
-
out.add(entry.id);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
for (const pack of inspection.packs.validPacks) {
|
|
538
|
-
const c = pack.manifest.contributions;
|
|
539
|
-
for (const rel of c.constructFiles ?? []) {
|
|
540
|
-
const full = nodePath.resolve(pack.packageRoot, rel);
|
|
541
|
-
for (const entry of await importDefaultIdsArray(full)) {
|
|
542
|
-
if (entry?.id)
|
|
543
|
-
out.add(entry.id);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
return out;
|
|
548
|
-
}
|