@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
|
@@ -2,58 +2,36 @@
|
|
|
2
2
|
* Pack signature freshness inspector.
|
|
3
3
|
*
|
|
4
4
|
* Reports each discovered pack's signature state without ever computing or
|
|
5
|
-
* faking HMAC.
|
|
5
|
+
* faking HMAC. Freshness is read from THE pack-asset freshness authority
|
|
6
|
+
* (`detectPackAssetFreshness`): content digests recorded at sign time, never an
|
|
7
|
+
* mtime. Statuses:
|
|
6
8
|
*
|
|
7
|
-
* present
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* stale
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* present — signed, and every recorded contribution file still has the
|
|
10
|
+
* content that was signed (real HMAC validation happens in
|
|
11
|
+
* pack-doctor / packs verify).
|
|
12
|
+
* stale — signed, but a recorded contribution file changed since.
|
|
13
|
+
* unverified — signed, but the signature records no content digest for some
|
|
14
|
+
* file (signed before digests existed) — freshness NOT verified.
|
|
15
|
+
* missing — manifest has no signature block.
|
|
13
16
|
*
|
|
14
17
|
* The check is deterministic, read-only, and never requires the pack secret.
|
|
15
18
|
*/
|
|
16
|
-
import { existsSync, statSync } from 'node:fs';
|
|
17
19
|
import * as nodePath from 'node:path';
|
|
20
|
+
import { describePackAssetFreshness, detectPackAssetFreshness } from "./pack-asset-freshness.js";
|
|
18
21
|
export const PACK_SIGNATURE_STATUS_SCHEMA = 'sharkcraft.pack-signature-status/v1';
|
|
19
22
|
export var PackSignatureStatusKind;
|
|
20
23
|
(function (PackSignatureStatusKind) {
|
|
21
24
|
PackSignatureStatusKind["Present"] = "present";
|
|
22
25
|
PackSignatureStatusKind["Stale"] = "stale";
|
|
26
|
+
PackSignatureStatusKind["Unverified"] = "unverified";
|
|
23
27
|
PackSignatureStatusKind["Missing"] = "missing";
|
|
24
28
|
})(PackSignatureStatusKind || (PackSignatureStatusKind = {}));
|
|
25
|
-
const CONTRIB_SLOTS = [
|
|
26
|
-
'knowledgeFiles',
|
|
27
|
-
'ruleFiles',
|
|
28
|
-
'pathFiles',
|
|
29
|
-
'pathConventionFiles',
|
|
30
|
-
'templateFiles',
|
|
31
|
-
'pipelineFiles',
|
|
32
|
-
'presetFiles',
|
|
33
|
-
'boundaryFiles',
|
|
34
|
-
'contextTestFiles',
|
|
35
|
-
'agentTestFiles',
|
|
36
|
-
'scaffoldPatternFiles',
|
|
37
|
-
'policyCheckFiles',
|
|
38
|
-
'constructFiles',
|
|
39
|
-
'constructFacetFiles',
|
|
40
|
-
'playbookFiles',
|
|
41
|
-
'searchTuningFiles',
|
|
42
|
-
'feedbackRuleFiles',
|
|
43
|
-
'decisionFiles',
|
|
44
|
-
'mcpToolFiles',
|
|
45
|
-
'aiProviderFiles',
|
|
46
|
-
'docsFiles',
|
|
47
|
-
'contractTemplateFiles',
|
|
48
|
-
'migrationProfileFiles',
|
|
49
|
-
'conventionFiles',
|
|
50
|
-
'helperFiles',
|
|
51
|
-
'taskRoutingHintFiles',
|
|
52
|
-
];
|
|
53
29
|
export function buildPackSignatureStatusReport(inspection) {
|
|
54
30
|
const secret = Boolean(process.env['SHARKCRAFT_PACK_SECRET']);
|
|
55
31
|
const out = [];
|
|
56
32
|
for (const pack of inspection.packs.validPacks ?? []) {
|
|
33
|
+
const rel = nodePath.relative(inspection.projectRoot, pack.packageRoot);
|
|
34
|
+
const signCmd = secret ? `shrk packs sign ${rel}` : `SHARKCRAFT_PACK_SECRET=<secret> shrk packs sign ${rel}`;
|
|
57
35
|
const sig = pack.manifest?.signature;
|
|
58
36
|
if (!sig) {
|
|
59
37
|
out.push({
|
|
@@ -63,87 +41,57 @@ export function buildPackSignatureStatusReport(inspection) {
|
|
|
63
41
|
status: PackSignatureStatusKind.Missing,
|
|
64
42
|
reason: 'no signature block on manifest',
|
|
65
43
|
secretAvailable: secret,
|
|
66
|
-
nextCommand:
|
|
67
|
-
? `shrk packs sign ${nodePath.relative(inspection.projectRoot, pack.packageRoot)}`
|
|
68
|
-
: `SHARKCRAFT_PACK_SECRET=<secret> shrk packs sign ${nodePath.relative(inspection.projectRoot, pack.packageRoot)}`,
|
|
44
|
+
nextCommand: signCmd,
|
|
69
45
|
});
|
|
70
46
|
continue;
|
|
71
47
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
continue;
|
|
87
|
-
for (const rel of rels) {
|
|
88
|
-
const abs = nodePath.resolve(pack.packageRoot, rel);
|
|
89
|
-
if (!existsSync(abs))
|
|
90
|
-
continue;
|
|
91
|
-
try {
|
|
92
|
-
const st = statSync(abs);
|
|
93
|
-
if (st.mtimeMs > sigMs + 1000) {
|
|
94
|
-
newerFile = rel;
|
|
95
|
-
newerMtime = new Date(st.mtimeMs).toISOString();
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (newerFile)
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
if (newerFile && sig.dev === true) {
|
|
48
|
+
const freshness = detectPackAssetFreshness(pack);
|
|
49
|
+
const said = describePackAssetFreshness(freshness).signature;
|
|
50
|
+
const base = {
|
|
51
|
+
packageName: pack.packageName,
|
|
52
|
+
packageVersion: pack.packageVersion,
|
|
53
|
+
packageRoot: pack.packageRoot,
|
|
54
|
+
signatureSignedAt: sig.signedAt,
|
|
55
|
+
secretAvailable: secret,
|
|
56
|
+
...(freshness.signature.diverged.length > 0
|
|
57
|
+
? { divergedFiles: freshness.signature.diverged, newerContributionFile: freshness.signature.diverged[0] }
|
|
58
|
+
: {}),
|
|
59
|
+
...(freshness.signature.unrecorded.length > 0 ? { unrecordedFiles: freshness.signature.unrecorded } : {}),
|
|
60
|
+
};
|
|
61
|
+
if (freshness.signature.state === 'diverged' && sig.dev === true) {
|
|
107
62
|
// Dev packs are signed with the well-known PACK_DEV_SECRET and load fine
|
|
108
|
-
// locally
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
63
|
+
// locally — every local build re-stales them, so a standing "stale" is
|
|
64
|
+
// pure noise during pack development. Keep them out of the stale bucket
|
|
65
|
+
// (still counted under summary.dev) and soften the reason. Production
|
|
66
|
+
// (non-dev) signed packs are untouched.
|
|
112
67
|
out.push({
|
|
113
|
-
|
|
114
|
-
packageVersion: pack.packageVersion,
|
|
115
|
-
packageRoot: pack.packageRoot,
|
|
68
|
+
...base,
|
|
116
69
|
status: PackSignatureStatusKind.Present,
|
|
117
|
-
signatureSignedAt: sig.signedAt,
|
|
118
|
-
secretAvailable: secret,
|
|
119
70
|
dev: true,
|
|
120
|
-
reason: `dev signature re-staled by a local build ("${
|
|
71
|
+
reason: `dev signature re-staled by a local build ("${freshness.signature.diverged[0]}" changed since signing) — dev packs load fine locally; re-sign before release`,
|
|
121
72
|
});
|
|
122
73
|
}
|
|
123
|
-
else if (
|
|
74
|
+
else if (freshness.signature.state === 'diverged') {
|
|
124
75
|
out.push({
|
|
125
|
-
|
|
126
|
-
packageVersion: pack.packageVersion,
|
|
127
|
-
packageRoot: pack.packageRoot,
|
|
76
|
+
...base,
|
|
128
77
|
status: PackSignatureStatusKind.Stale,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
78
|
+
...(said ? { reason: said } : {}),
|
|
79
|
+
nextCommand: signCmd,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else if (freshness.signature.state === 'unrecorded') {
|
|
83
|
+
out.push({
|
|
84
|
+
...base,
|
|
85
|
+
status: PackSignatureStatusKind.Unverified,
|
|
86
|
+
...(said ? { reason: said } : {}),
|
|
87
|
+
...(sig.dev === true ? { dev: true } : {}),
|
|
88
|
+
nextCommand: signCmd,
|
|
137
89
|
});
|
|
138
90
|
}
|
|
139
91
|
else {
|
|
140
92
|
out.push({
|
|
141
|
-
|
|
142
|
-
packageVersion: pack.packageVersion,
|
|
143
|
-
packageRoot: pack.packageRoot,
|
|
93
|
+
...base,
|
|
144
94
|
status: PackSignatureStatusKind.Present,
|
|
145
|
-
signatureSignedAt: sig.signedAt,
|
|
146
|
-
secretAvailable: secret,
|
|
147
95
|
...(sig.dev === true ? { dev: true } : {}),
|
|
148
96
|
});
|
|
149
97
|
}
|
|
@@ -156,6 +104,7 @@ export function buildPackSignatureStatusReport(inspection) {
|
|
|
156
104
|
total: out.length,
|
|
157
105
|
present: out.filter((p) => p.status === PackSignatureStatusKind.Present).length,
|
|
158
106
|
stale: out.filter((p) => p.status === PackSignatureStatusKind.Stale).length,
|
|
107
|
+
unverified: out.filter((p) => p.status === PackSignatureStatusKind.Unverified).length,
|
|
159
108
|
missing: out.filter((p) => p.status === PackSignatureStatusKind.Missing).length,
|
|
160
109
|
dev: out.filter((p) => p.dev === true).length,
|
|
161
110
|
},
|
|
@@ -209,16 +158,21 @@ export function explainPackSignatureStatus(inspection, options = {}) {
|
|
|
209
158
|
}
|
|
210
159
|
else if (fresh?.status === 'stale') {
|
|
211
160
|
state = 'stale';
|
|
212
|
-
explanation = `${fresh.reason ?? '
|
|
161
|
+
explanation = `${fresh.reason ?? 'A contribution file changed since the signature was made.'}`;
|
|
162
|
+
nextCommand = signCmd;
|
|
163
|
+
}
|
|
164
|
+
else if (fresh?.status === 'unverified') {
|
|
165
|
+
state = 'freshness-unverified';
|
|
166
|
+
explanation = `${fresh.reason ?? 'The signature records no content digests, so freshness is NOT verified.'}`;
|
|
213
167
|
nextCommand = signCmd;
|
|
214
168
|
}
|
|
215
169
|
else if (fresh?.status === 'present') {
|
|
216
170
|
// Freshness only — the HMAC was NOT checked this run. Reserve `valid`
|
|
217
|
-
// strictly for a real verifier pass so a bogus-HMAC-but-fresh
|
|
218
|
-
//
|
|
171
|
+
// strictly for a real verifier pass so a bogus-HMAC-but-fresh pack is
|
|
172
|
+
// never mislabelled as verified.
|
|
219
173
|
state = 'present-unverified';
|
|
220
174
|
explanation =
|
|
221
|
-
'Signature present and
|
|
175
|
+
'Signature present and every contribution file still matches its signed content digest, but the HMAC was NOT checked this run.';
|
|
222
176
|
nextCommand = 'shrk packs verify --required';
|
|
223
177
|
}
|
|
224
178
|
else {
|
|
@@ -8,10 +8,19 @@
|
|
|
8
8
|
*
|
|
9
9
|
* The runner:
|
|
10
10
|
* 1. Loads the pack tests via dynamic import (Bun handles TS natively).
|
|
11
|
-
* 2.
|
|
12
|
-
* 3.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* 2. Inspects the pack once and warms the shared reference registry.
|
|
12
|
+
* 3. For each test case, builds a task packet and checks the expectations —
|
|
13
|
+
* two classes of assertion, reported separately:
|
|
14
|
+
* - ranker-SURFACED (`expectKnowledgeIds` / `expectRuleIds` /
|
|
15
|
+
* `expectTemplateIds` / `expectPipelineIds`): the id is in the packet.
|
|
16
|
+
* Order-sensitive; an unrelated content edit can flip it.
|
|
17
|
+
* - registry-EXISTENCE (`expectPlaybookIds` / `expectConstructIds`): the
|
|
18
|
+
* id is registered. Stable. These were declared but never evaluated
|
|
19
|
+
* (the packet summary hard-coded both lists to []), so a typo'd id
|
|
20
|
+
* passed silently.
|
|
21
|
+
* 4. Emits a structured diagnostic report. A surfaced-class miss says whether
|
|
22
|
+
* the id exists at all (`unknown-id` — can never pass) or merely did not
|
|
23
|
+
* rank (`not-surfaced`), and names the registry it consulted.
|
|
15
24
|
*/
|
|
16
25
|
export interface IPackTestCase {
|
|
17
26
|
id: string;
|
|
@@ -32,8 +41,21 @@ export interface IPackTestResult {
|
|
|
32
41
|
task: string;
|
|
33
42
|
passed: boolean;
|
|
34
43
|
diagnostics: ReadonlyArray<{
|
|
35
|
-
|
|
44
|
+
/**
|
|
45
|
+
* `unknown-id` — not registered at all (can never pass); `not-surfaced` —
|
|
46
|
+
* registered but not in the packet; `unexpected-id` — a mustNotInclude id
|
|
47
|
+
* was surfaced.
|
|
48
|
+
*/
|
|
49
|
+
code: 'unknown-id' | 'not-surfaced' | 'unexpected-id' | 'token-budget' | 'load-error';
|
|
36
50
|
field?: string;
|
|
51
|
+
/** `surfaced` (in the task packet) or `exists` (registered). */
|
|
52
|
+
assertion?: 'surfaced' | 'exists';
|
|
53
|
+
/** The registry the existence answer came from. */
|
|
54
|
+
consulted?: {
|
|
55
|
+
kind: string;
|
|
56
|
+
listVerb: string;
|
|
57
|
+
size: number;
|
|
58
|
+
};
|
|
37
59
|
expected?: string;
|
|
38
60
|
actual?: string;
|
|
39
61
|
suggestion?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-test-runner.d.ts","sourceRoot":"","sources":["../src/pack-test-runner.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pack-test-runner.d.ts","sourceRoot":"","sources":["../src/pack-test-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAcH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,kBAAkB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,iBAAiB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE1C,iBAAiB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,kBAAkB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3C,iBAAiB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAE/D;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,aAAa,CAAC;QACzB;;;;WAIG;QACH,IAAI,EAAE,YAAY,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,GAAG,YAAY,CAAC;QACtF,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gEAAgE;QAChE,SAAS,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;QAClC,mDAAmD;QACnD,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,gCAAgC,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACvC;AAsKD,wBAAsB,YAAY,CAAC,KAAK,EAAE;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CAAC,eAAe,CAAC,CAsE3B;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAoBxE"}
|
package/dist/pack-test-runner.js
CHANGED
|
@@ -8,16 +8,26 @@
|
|
|
8
8
|
*
|
|
9
9
|
* The runner:
|
|
10
10
|
* 1. Loads the pack tests via dynamic import (Bun handles TS natively).
|
|
11
|
-
* 2.
|
|
12
|
-
* 3.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* 2. Inspects the pack once and warms the shared reference registry.
|
|
12
|
+
* 3. For each test case, builds a task packet and checks the expectations —
|
|
13
|
+
* two classes of assertion, reported separately:
|
|
14
|
+
* - ranker-SURFACED (`expectKnowledgeIds` / `expectRuleIds` /
|
|
15
|
+
* `expectTemplateIds` / `expectPipelineIds`): the id is in the packet.
|
|
16
|
+
* Order-sensitive; an unrelated content edit can flip it.
|
|
17
|
+
* - registry-EXISTENCE (`expectPlaybookIds` / `expectConstructIds`): the
|
|
18
|
+
* id is registered. Stable. These were declared but never evaluated
|
|
19
|
+
* (the packet summary hard-coded both lists to []), so a typo'd id
|
|
20
|
+
* passed silently.
|
|
21
|
+
* 4. Emits a structured diagnostic report. A surfaced-class miss says whether
|
|
22
|
+
* the id exists at all (`unknown-id` — can never pass) or merely did not
|
|
23
|
+
* rank (`not-surfaced`), and names the registry it consulted.
|
|
15
24
|
*/
|
|
16
25
|
import { existsSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
17
26
|
import { join } from 'node:path';
|
|
18
27
|
import { inspectSharkcraft } from "./sharkcraft-inspector.js";
|
|
19
28
|
import { buildTaskPacket } from "./task-packet.js";
|
|
20
29
|
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
30
|
+
import { referenceIdExists, referenceIdsFor, warmReferenceRegistries, } from "./reference-registry.js";
|
|
21
31
|
export function definePackTest(t) {
|
|
22
32
|
return t;
|
|
23
33
|
}
|
|
@@ -26,6 +36,14 @@ const TEST_FILE_CANDIDATES = [
|
|
|
26
36
|
'src/assets/pack-tests.ts',
|
|
27
37
|
'pack-tests.ts',
|
|
28
38
|
];
|
|
39
|
+
const LIST_VERBS = Object.freeze({
|
|
40
|
+
knowledge: 'shrk knowledge list',
|
|
41
|
+
rule: 'shrk rules list',
|
|
42
|
+
template: 'shrk templates list',
|
|
43
|
+
pipeline: 'shrk pipelines list',
|
|
44
|
+
playbook: 'shrk playbooks list',
|
|
45
|
+
construct: 'shrk constructs list',
|
|
46
|
+
});
|
|
29
47
|
function findTestsFile(packPath) {
|
|
30
48
|
for (const rel of TEST_FILE_CANDIDATES) {
|
|
31
49
|
const abs = join(packPath, rel);
|
|
@@ -42,45 +60,73 @@ async function loadTestCases(file) {
|
|
|
42
60
|
function unique(arr) {
|
|
43
61
|
return [...new Set(arr)];
|
|
44
62
|
}
|
|
45
|
-
|
|
46
|
-
const inspection = await inspectSharkcraft({ cwd: packPath });
|
|
63
|
+
function summariseTaskPacket(inspection, task) {
|
|
47
64
|
const packet = buildTaskPacket(inspection, task);
|
|
48
|
-
const knowledgeIds = unique(packet.context.sections.flatMap((s) => [...s.entryIds]));
|
|
49
|
-
const ruleIds = unique(packet.relevantRules.map((r) => r.id));
|
|
50
|
-
const templateIds = unique(packet.relevantTemplates.map((t) => t.id));
|
|
51
|
-
const pipelineIds = unique(packet.recommendedPipelines.map((p) => p.pipelineId));
|
|
52
65
|
return {
|
|
53
|
-
knowledgeIds,
|
|
54
|
-
ruleIds,
|
|
55
|
-
templateIds,
|
|
56
|
-
pipelineIds,
|
|
57
|
-
playbookIds: [],
|
|
58
|
-
constructIds: [],
|
|
66
|
+
knowledgeIds: unique(packet.context.sections.flatMap((s) => [...s.entryIds])),
|
|
67
|
+
ruleIds: unique(packet.relevantRules.map((r) => r.id)),
|
|
68
|
+
templateIds: unique(packet.relevantTemplates.map((t) => t.id)),
|
|
69
|
+
pipelineIds: unique(packet.recommendedPipelines.map((p) => p.pipelineId)),
|
|
59
70
|
tokenEstimate: packet.tokenEstimate,
|
|
60
71
|
};
|
|
61
72
|
}
|
|
62
|
-
function
|
|
73
|
+
function consultedRegistry(inspection, kind) {
|
|
74
|
+
return {
|
|
75
|
+
kind,
|
|
76
|
+
listVerb: LIST_VERBS[kind] ?? `shrk ${kind} list`,
|
|
77
|
+
size: referenceIdsFor(inspection, kind).length,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function evaluateCase(testCase, packet, inspection) {
|
|
63
81
|
const diagnostics = [];
|
|
64
|
-
const
|
|
65
|
-
{ field: 'knowledgeIds', expected: testCase.expectKnowledgeIds },
|
|
66
|
-
{ field: 'ruleIds', expected: testCase.expectRuleIds },
|
|
67
|
-
{ field: 'templateIds', expected: testCase.expectTemplateIds },
|
|
68
|
-
{ field: 'pipelineIds', expected: testCase.expectPipelineIds },
|
|
82
|
+
const surfaced = [
|
|
83
|
+
{ field: 'knowledgeIds', kind: 'knowledge', expected: testCase.expectKnowledgeIds },
|
|
84
|
+
{ field: 'ruleIds', kind: 'rule', expected: testCase.expectRuleIds },
|
|
85
|
+
{ field: 'templateIds', kind: 'template', expected: testCase.expectTemplateIds },
|
|
86
|
+
{ field: 'pipelineIds', kind: 'pipeline', expected: testCase.expectPipelineIds },
|
|
69
87
|
];
|
|
70
|
-
for (const c of
|
|
88
|
+
for (const c of surfaced) {
|
|
71
89
|
if (!c.expected)
|
|
72
90
|
continue;
|
|
73
91
|
const actualList = packet[c.field];
|
|
74
92
|
for (const id of c.expected) {
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
if (actualList.includes(id))
|
|
94
|
+
continue;
|
|
95
|
+
const registry = consultedRegistry(inspection, c.kind);
|
|
96
|
+
const exists = referenceIdExists(inspection, c.kind, id);
|
|
97
|
+
diagnostics.push({
|
|
98
|
+
code: exists ? 'not-surfaced' : 'unknown-id',
|
|
99
|
+
field: c.field,
|
|
100
|
+
assertion: 'surfaced',
|
|
101
|
+
consulted: registry,
|
|
102
|
+
expected: id,
|
|
103
|
+
suggestion: exists
|
|
104
|
+
? `Tune ${id}'s tags / appliesWhen, or reference it from a preset, so the recommender surfaces it for "${testCase.task}".`
|
|
105
|
+
: `Correct the id or ship the ${c.kind} — it is not among the ${registry.size} ids \`${registry.listVerb}\` prints.`,
|
|
106
|
+
message: exists
|
|
107
|
+
? `Expected ${c.field} to include "${id}" for task "${testCase.task}": it is registered but was not surfaced.`
|
|
108
|
+
: `Expected ${c.field} to include "${id}", but no ${c.kind} "${id}" is registered — this expectation can never pass.`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const existence = [
|
|
113
|
+
{ field: 'playbookIds', kind: 'playbook', expected: testCase.expectPlaybookIds },
|
|
114
|
+
{ field: 'constructIds', kind: 'construct', expected: testCase.expectConstructIds },
|
|
115
|
+
];
|
|
116
|
+
for (const c of existence) {
|
|
117
|
+
for (const id of c.expected ?? []) {
|
|
118
|
+
if (referenceIdExists(inspection, c.kind, id))
|
|
119
|
+
continue;
|
|
120
|
+
const registry = consultedRegistry(inspection, c.kind);
|
|
121
|
+
diagnostics.push({
|
|
122
|
+
code: 'unknown-id',
|
|
123
|
+
field: c.field,
|
|
124
|
+
assertion: 'exists',
|
|
125
|
+
consulted: registry,
|
|
126
|
+
expected: id,
|
|
127
|
+
suggestion: `Correct the id or ship the ${c.kind} — it is not among the ${registry.size} ids \`${registry.listVerb}\` prints.`,
|
|
128
|
+
message: `Expected ${c.kind} "${id}" to be registered, but it is not.`,
|
|
129
|
+
});
|
|
84
130
|
}
|
|
85
131
|
}
|
|
86
132
|
if (testCase.mustNotIncludeIds && testCase.mustNotIncludeIds.length > 0) {
|
|
@@ -94,6 +140,7 @@ function evaluateCase(testCase, packet) {
|
|
|
94
140
|
if (allIds.includes(id)) {
|
|
95
141
|
diagnostics.push({
|
|
96
142
|
code: 'unexpected-id',
|
|
143
|
+
assertion: 'surfaced',
|
|
97
144
|
expected: id,
|
|
98
145
|
actual: id,
|
|
99
146
|
message: `"${id}" should not have been included in the packet for task "${testCase.task}".`,
|
|
@@ -159,9 +206,15 @@ export async function runPackTests(input) {
|
|
|
159
206
|
if (caseId)
|
|
160
207
|
cases = cases.filter((c) => c.id === caseId);
|
|
161
208
|
const results = [];
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
209
|
+
if (cases.length > 0) {
|
|
210
|
+
// One inspection, warmed once: every existence answer comes from the
|
|
211
|
+
// shared reference registry (the playbook / construct kinds are
|
|
212
|
+
// cache-backed and read empty until warmed).
|
|
213
|
+
const inspection = await inspectSharkcraft({ cwd: packPath });
|
|
214
|
+
await warmReferenceRegistries(inspection);
|
|
215
|
+
for (const tc of cases) {
|
|
216
|
+
results.push(evaluateCase(tc, summariseTaskPacket(inspection, tc.task), inspection));
|
|
217
|
+
}
|
|
165
218
|
}
|
|
166
219
|
if (input.updateSnapshots) {
|
|
167
220
|
const snapsDir = join(packPath, 'sharkcraft', 'pack-test-snapshots');
|
|
@@ -195,6 +248,9 @@ export function renderPackTestReportText(report) {
|
|
|
195
248
|
lines.push(` ${c.passed ? '✓' : '✗'} ${c.id} ${c.task}`);
|
|
196
249
|
for (const d of c.diagnostics) {
|
|
197
250
|
lines.push(` - [${d.code}] ${d.message}`);
|
|
251
|
+
if (d.consulted) {
|
|
252
|
+
lines.push(` consulted: ${d.consulted.kind} registry (${d.consulted.size} ids, \`${d.consulted.listVerb}\`)`);
|
|
253
|
+
}
|
|
198
254
|
if (d.suggestion)
|
|
199
255
|
lines.push(` ↳ ${d.suggestion}`);
|
|
200
256
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ISharkCraftPackManifest } from '@shrkcrft/plugin-api';
|
|
2
|
+
import { type ITypecheckFilesResult } from './typecheck-files.js';
|
|
3
|
+
export declare function typecheckPackAssets(pack: {
|
|
4
|
+
readonly packageRoot: string;
|
|
5
|
+
readonly manifestPath?: string | null;
|
|
6
|
+
readonly manifest?: ISharkCraftPackManifest | null;
|
|
7
|
+
}): ITypecheckFilesResult;
|
|
8
|
+
//# sourceMappingURL=pack-typecheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-typecheck.d.ts","sourceRoot":"","sources":["../src/pack-typecheck.ts"],"names":[],"mappings":"AAiBA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIlF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACpD,GAAG,qBAAqB,CAoBxB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-check a pack's own TypeScript assets — the manifest file plus every
|
|
3
|
+
* `.ts`/`.tsx` contribution the manifest declares — with the ONE in-process
|
|
4
|
+
* check (`typecheckFiles`). Pack loading is transpile-only, so this is the
|
|
5
|
+
* only place an implicit-any parameter or a misspelled field in an asset is
|
|
6
|
+
* caught before it ships.
|
|
7
|
+
*
|
|
8
|
+
* Opt-in (`--typecheck` on `packs test | doctor | release-check`): it is
|
|
9
|
+
* costly, and default loading must not change behaviour. The pack's own
|
|
10
|
+
* `tsconfig.json` applies when present; otherwise strict defaults with `.ts`
|
|
11
|
+
* import specifiers allowed (Bun loads them). Every diagnostic in a file under
|
|
12
|
+
* the pack root is reported (so a group module an asset imports is checked
|
|
13
|
+
* too). `ran: false` — no TS files, or TypeScript could not run — is a
|
|
14
|
+
* not-verified outcome for callers, never a pass.
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync } from 'node:fs';
|
|
17
|
+
import { resolve } from 'node:path';
|
|
18
|
+
import { CONTRIBUTION_FILE_KEYS, FUTURE_CONTRIBUTION_FILE_KEYS, } from '@shrkcrft/plugin-api';
|
|
19
|
+
import { typecheckFiles } from "./typecheck-files.js";
|
|
20
|
+
const TS_SOURCE = /\.(?:[cm]?ts|tsx)$/;
|
|
21
|
+
export function typecheckPackAssets(pack) {
|
|
22
|
+
const roots = new Set();
|
|
23
|
+
if (pack.manifestPath && TS_SOURCE.test(pack.manifestPath) && existsSync(pack.manifestPath)) {
|
|
24
|
+
roots.add(resolve(pack.manifestPath));
|
|
25
|
+
}
|
|
26
|
+
const contributions = (pack.manifest?.contributions ?? {});
|
|
27
|
+
for (const key of [...CONTRIBUTION_FILE_KEYS, ...FUTURE_CONTRIBUTION_FILE_KEYS]) {
|
|
28
|
+
for (const rel of contributions[key] ?? []) {
|
|
29
|
+
if (typeof rel !== 'string' || !TS_SOURCE.test(rel))
|
|
30
|
+
continue;
|
|
31
|
+
const abs = resolve(pack.packageRoot, rel);
|
|
32
|
+
if (existsSync(abs))
|
|
33
|
+
roots.add(abs);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const result = typecheckFiles(pack.packageRoot, {
|
|
37
|
+
rootNames: [...roots].sort(),
|
|
38
|
+
reportOnlyUnder: pack.packageRoot,
|
|
39
|
+
allowTsExtensionsByDefault: true,
|
|
40
|
+
includeGlobalDiagnostics: true,
|
|
41
|
+
});
|
|
42
|
+
return sdkUnresolved(result, pack.packageRoot) ?? result;
|
|
43
|
+
}
|
|
44
|
+
/** "Cannot find module" — 2307, and 2792 (its moduleResolution-hint variant). */
|
|
45
|
+
const MODULE_NOT_FOUND = new Set([2307, 2792]);
|
|
46
|
+
const SDK_SPECIFIER = /['"](@shrkcrft\/[^'"]+)['"]/;
|
|
47
|
+
/**
|
|
48
|
+
* A pack that imports the SharkCraft SDK (`@shrkcrft/*`) from a tree where it
|
|
49
|
+
* is not installed (a fresh `packs new` scaffold before `npm install`) cannot
|
|
50
|
+
* be type-checked: every SDK type is unresolved, so the diagnostics are the
|
|
51
|
+
* missing devDependency — cascading into implicit-any errors — not defects in
|
|
52
|
+
* the pack. That run examined nothing trustworthy: report it as NOT run (a
|
|
53
|
+
* not-verified outcome for every caller), never as pack errors.
|
|
54
|
+
*/
|
|
55
|
+
function sdkUnresolved(result, packageRoot) {
|
|
56
|
+
if (!result.ran)
|
|
57
|
+
return undefined;
|
|
58
|
+
const missing = new Set();
|
|
59
|
+
for (const e of result.errors) {
|
|
60
|
+
if (!MODULE_NOT_FOUND.has(e.code))
|
|
61
|
+
continue;
|
|
62
|
+
const m = SDK_SPECIFIER.exec(e.message);
|
|
63
|
+
if (m)
|
|
64
|
+
missing.add(m[1]);
|
|
65
|
+
}
|
|
66
|
+
if (missing.size === 0)
|
|
67
|
+
return undefined;
|
|
68
|
+
return {
|
|
69
|
+
ran: false,
|
|
70
|
+
errors: [],
|
|
71
|
+
checkedFiles: result.checkedFiles,
|
|
72
|
+
tsconfigPath: result.tsconfigPath,
|
|
73
|
+
note: `SDK not installed — ${[...missing].sort().join(', ')} cannot be resolved from ${packageRoot}, so the ` +
|
|
74
|
+
`${result.errors.length} diagnostic(s) it produced are withheld; run \`npm install\` in the pack and re-run — typecheck NOT verified`,
|
|
75
|
+
};
|
|
76
|
+
}
|
package/dist/plan-review.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ export interface IPlanReviewReport {
|
|
|
56
56
|
* scanning its imports against the boundary rules.
|
|
57
57
|
*/
|
|
58
58
|
planIntroducedBoundaryConcerns: readonly IPlanIntroducedBoundaryConcern[];
|
|
59
|
+
/** Why `potentialBoundaryConcerns` is not the full answer for the targets (THE boundary verdict's shortfalls). */
|
|
60
|
+
boundaryShortfalls?: readonly string[];
|
|
59
61
|
/** Verification commands recommended to run after apply. */
|
|
60
62
|
verificationCommands: readonly string[];
|
|
61
63
|
humanApprovalReminder: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-review.d.ts","sourceRoot":"","sources":["../src/plan-review.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan-review.d.ts","sourceRoot":"","sources":["../src/plan-review.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC9B,8FAA8F;IAC9F,IAAI,EACA,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,eAAe,GACf,SAAS,GACT,QAAQ,GACR,MAAM,GACN,UAAU,GACV,SAAS,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,8BAA8B;IAC7C,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mFAAmF;IACnF,iBAAiB,EAAE,kBAAkB,GAAG,sCAAsC,CAAC;CAChF;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,6CAA6C;IAC7C,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC1C,oDAAoD;IACpD,SAAS,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,iEAAiE;IACjE,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,8EAA8E;IAC9E,yBAAyB,EAAE,SAAS;QAClC,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;IACJ;;;;OAIG;IACH,8BAA8B,EAAE,SAAS,8BAA8B,EAAE,CAAC;IAC1E,kHAAkH;IAClH,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,4DAA4D;IAC5D,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,EACjC,QAAQ,EAAE,MAAM,GACf,iBAAiB,CAwLnB"}
|
package/dist/plan-review.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { evaluateBoundaries, loadTsconfigPaths,
|
|
2
|
+
import { evaluateBoundaries, loadTsconfigPaths, } from '@shrkcrft/boundaries';
|
|
3
|
+
import { ChangedScopeMode } from "./boundaries-changed-only.js";
|
|
4
|
+
import { runBoundaryCheck } from "./run-boundary-check.js";
|
|
3
5
|
import { checkFolderOpSafety, FolderOpSafety, planGeneration, verifyPlan, } from '@shrkcrft/generator';
|
|
4
6
|
import { matchAffectedConventions } from '@shrkcrft/paths';
|
|
5
7
|
export function reviewSavedPlan(inspection, planPath) {
|
|
@@ -88,14 +90,20 @@ export function reviewSavedPlan(inspection, planPath) {
|
|
|
88
90
|
missingTestsHeuristic.push(`${f.relativePath} → expected ${candidate}`);
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
|
-
// Current-state boundary scan on the target paths
|
|
93
|
+
// Current-state boundary scan on the target paths — through THE boundary
|
|
94
|
+
// orchestrator, scoped to the planned paths (round 11 review R11-GAP-3): a
|
|
95
|
+
// governed target it could not read is named in `boundaryShortfalls`.
|
|
92
96
|
let potentialBoundaryConcerns = [];
|
|
97
|
+
let boundaryShortfalls = [];
|
|
93
98
|
const tsconfigPaths = loadTsconfigPaths(inspection.projectRoot);
|
|
94
99
|
const aliasOpts = tsconfigPaths.aliases.size > 0 ? { tsconfigPaths } : {};
|
|
95
100
|
if (inspection.boundaryRegistry.size() > 0 && files.length > 0) {
|
|
96
|
-
const
|
|
97
|
-
const evalResult =
|
|
98
|
-
|
|
101
|
+
const targets = files.map((f) => f.relativePath);
|
|
102
|
+
const evalResult = runBoundaryCheck(inspection, { changed: { mode: ChangedScopeMode.Files, files: targets } });
|
|
103
|
+
if (evalResult.verdict === 'not-verified' && evalResult.selectedRuleIds.length > 0) {
|
|
104
|
+
boundaryShortfalls = evalResult.shortfalls;
|
|
105
|
+
}
|
|
106
|
+
const targetSet = new Set(targets);
|
|
99
107
|
potentialBoundaryConcerns = evalResult.violations
|
|
100
108
|
.filter((v) => targetSet.has(v.file))
|
|
101
109
|
.map((v) => ({
|
|
@@ -111,6 +119,9 @@ export function reviewSavedPlan(inspection, planPath) {
|
|
|
111
119
|
// planned paths.
|
|
112
120
|
const planIntroducedBoundaryConcerns = [];
|
|
113
121
|
if (inspection.boundaryRegistry.size() > 0 && liveChanges.length > 0) {
|
|
122
|
+
// PLANNED contents are not on disk, so the orchestrator cannot scan them:
|
|
123
|
+
// a sanctioned direct `evaluateBoundaries` over planned edges only (the
|
|
124
|
+
// r75 one-boundary-authority lock names this call site).
|
|
114
125
|
const plannedEdges = collectPlannedEdges(liveChanges);
|
|
115
126
|
const evalResult = evaluateBoundaries({ filesScanned: liveChanges.length, edges: plannedEdges, warnings: [] }, inspection.boundaryRegistry.list(), aliasOpts);
|
|
116
127
|
for (const v of evalResult.violations) {
|
|
@@ -157,6 +168,7 @@ export function reviewSavedPlan(inspection, planPath) {
|
|
|
157
168
|
missingTestsHeuristic,
|
|
158
169
|
potentialBoundaryConcerns,
|
|
159
170
|
planIntroducedBoundaryConcerns,
|
|
171
|
+
...(boundaryShortfalls.length > 0 ? { boundaryShortfalls } : {}),
|
|
160
172
|
verificationCommands: [
|
|
161
173
|
'shrk doctor',
|
|
162
174
|
'shrk check boundaries',
|