@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
|
@@ -6,18 +6,29 @@
|
|
|
6
6
|
* - one row per detected collision — the conflicts
|
|
7
7
|
*
|
|
8
8
|
* Both outputs are deterministic and read-only.
|
|
9
|
+
*
|
|
10
|
+
* Honesty contract (round 11): an id the inventory could only SCRAPE is never
|
|
11
|
+
* reported as a healthy contribution. A file the module loader cannot import is
|
|
12
|
+
* a load failure — its scraped ids are `validation: 'error'` and the file is an
|
|
13
|
+
* `invalid-contribution` error conflict. A regex id from a kind whose loader
|
|
14
|
+
* returned nothing for that file is a `warning`. Every text/markdown render
|
|
15
|
+
* prints the extraction mode, so a fallback is never invisible.
|
|
16
|
+
*
|
|
17
|
+
* Round 12 (12.1e): EVERY loader-backed slot is a kind and is listed
|
|
18
|
+
* structurally (registration hints, presets, boundaries, scaffold patterns,
|
|
19
|
+
* constructs + facets, search tuning, decisions, policy checks, feedback rules,
|
|
20
|
+
* tests, delegate recipes, framework extractors and the gate planes were
|
|
21
|
+
* scraped by regex, or not listed at all), and an entry its loader REFUSED is
|
|
22
|
+
* in `rejections` — a scraped id matching one is `error` "rejected by the
|
|
23
|
+
* loader", never the `ok` a regex id of an unloaded kind used to get.
|
|
9
24
|
*/
|
|
10
|
-
import {
|
|
25
|
+
import { readFileSync } from 'node:fs';
|
|
11
26
|
import * as nodePath from 'node:path';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
import { listRegistrationHints } from "./registration-hint-registry.js";
|
|
18
|
-
import { listPlaybooks } from "./playbook-registry.js";
|
|
19
|
-
import { loadAllContractTemplates } from "./contract-template-registry.js";
|
|
20
|
-
import { listMigrationProfilesFromPacks } from "./migration-profile-registry.js";
|
|
27
|
+
import { CONTRIBUTION_FILE_KEYS } from '@shrkcrft/plugin-api';
|
|
28
|
+
import { collectContributionLoadFailures, collectContributionRejections, collectRegistryOutcomes, formatEntryRejection, } from "./contribution-load-failures.js";
|
|
29
|
+
import { ContributionKind } from "./contribution-kind.js";
|
|
30
|
+
import { describePackAssetFreshness, detectPackAssetFreshness } from "./pack-asset-freshness.js";
|
|
31
|
+
export { ContributionKind } from "./contribution-kind.js";
|
|
21
32
|
export const PACK_CONTRIBUTIONS_INVENTORY_SCHEMA = 'sharkcraft.pack-contributions-inventory/v1';
|
|
22
33
|
export var ContributionSource;
|
|
23
34
|
(function (ContributionSource) {
|
|
@@ -26,32 +37,6 @@ export var ContributionSource;
|
|
|
26
37
|
ContributionSource["Pack"] = "pack";
|
|
27
38
|
ContributionSource["Fixture"] = "fixture";
|
|
28
39
|
})(ContributionSource || (ContributionSource = {}));
|
|
29
|
-
export var ContributionKind;
|
|
30
|
-
(function (ContributionKind) {
|
|
31
|
-
ContributionKind["Knowledge"] = "knowledge";
|
|
32
|
-
ContributionKind["Rule"] = "rule";
|
|
33
|
-
ContributionKind["Path"] = "path";
|
|
34
|
-
ContributionKind["PathConvention"] = "path-convention";
|
|
35
|
-
ContributionKind["Template"] = "template";
|
|
36
|
-
ContributionKind["Pipeline"] = "pipeline";
|
|
37
|
-
ContributionKind["Preset"] = "preset";
|
|
38
|
-
ContributionKind["Boundary"] = "boundary";
|
|
39
|
-
ContributionKind["ScaffoldPattern"] = "scaffold-pattern";
|
|
40
|
-
ContributionKind["Policy"] = "policy";
|
|
41
|
-
ContributionKind["Construct"] = "construct";
|
|
42
|
-
ContributionKind["Playbook"] = "playbook";
|
|
43
|
-
ContributionKind["SearchTuning"] = "search-tuning";
|
|
44
|
-
ContributionKind["FeedbackRule"] = "feedback-rule";
|
|
45
|
-
ContributionKind["Decision"] = "decision";
|
|
46
|
-
ContributionKind["ContractTemplate"] = "contract-template";
|
|
47
|
-
ContributionKind["MigrationProfile"] = "migration-profile";
|
|
48
|
-
ContributionKind["ContextTest"] = "context-test";
|
|
49
|
-
ContributionKind["AgentTest"] = "agent-test";
|
|
50
|
-
ContributionKind["Helper"] = "helper";
|
|
51
|
-
ContributionKind["TaskRoutingHint"] = "task-routing-hint";
|
|
52
|
-
ContributionKind["Convention"] = "convention";
|
|
53
|
-
ContributionKind["Docs"] = "docs";
|
|
54
|
-
})(ContributionKind || (ContributionKind = {}));
|
|
55
40
|
export var ConflictKind;
|
|
56
41
|
(function (ConflictKind) {
|
|
57
42
|
ConflictKind["DuplicateIdSameKind"] = "duplicate-id-same-kind";
|
|
@@ -64,7 +49,12 @@ export var ConflictKind;
|
|
|
64
49
|
ConflictKind["IncompatibleSchema"] = "incompatible-schema";
|
|
65
50
|
ConflictKind["MissingLoader"] = "missing-loader";
|
|
66
51
|
})(ConflictKind || (ConflictKind = {}));
|
|
67
|
-
|
|
52
|
+
/**
|
|
53
|
+
* THE contribution kind → manifest slot table. A `Record` over the enum: a kind
|
|
54
|
+
* without a slot is a compile error, and the r76 census holds every
|
|
55
|
+
* loader-backed `CONTRIBUTION_FILE_KEYS` slot to exactly one kind here.
|
|
56
|
+
*/
|
|
57
|
+
export const CONTRIBUTION_KIND_SLOT = Object.freeze({
|
|
68
58
|
[ContributionKind.Knowledge]: 'knowledgeFiles',
|
|
69
59
|
[ContributionKind.Rule]: 'ruleFiles',
|
|
70
60
|
[ContributionKind.Path]: 'pathFiles',
|
|
@@ -76,6 +66,7 @@ const KIND_TO_SLOT = {
|
|
|
76
66
|
[ContributionKind.ScaffoldPattern]: 'scaffoldPatternFiles',
|
|
77
67
|
[ContributionKind.Policy]: 'policyCheckFiles',
|
|
78
68
|
[ContributionKind.Construct]: 'constructFiles',
|
|
69
|
+
[ContributionKind.ConstructFacet]: 'constructFacetFiles',
|
|
79
70
|
[ContributionKind.Playbook]: 'playbookFiles',
|
|
80
71
|
[ContributionKind.SearchTuning]: 'searchTuningFiles',
|
|
81
72
|
[ContributionKind.FeedbackRule]: 'feedbackRuleFiles',
|
|
@@ -86,8 +77,35 @@ const KIND_TO_SLOT = {
|
|
|
86
77
|
[ContributionKind.AgentTest]: 'agentTestFiles',
|
|
87
78
|
[ContributionKind.Helper]: 'helperFiles',
|
|
88
79
|
[ContributionKind.TaskRoutingHint]: 'taskRoutingHintFiles',
|
|
80
|
+
[ContributionKind.RegistrationHint]: 'registrationHintFiles',
|
|
89
81
|
[ContributionKind.Convention]: 'conventionFiles',
|
|
90
82
|
[ContributionKind.Docs]: 'docsFiles',
|
|
83
|
+
[ContributionKind.DelegateRecipe]: 'delegateRecipeFiles',
|
|
84
|
+
[ContributionKind.FrameworkExtractor]: 'frameworkExtractorFiles',
|
|
85
|
+
[ContributionKind.WiringRule]: 'wiringRuleFiles',
|
|
86
|
+
[ContributionKind.Registry]: 'registryFiles',
|
|
87
|
+
[ContributionKind.RegistrationIdiom]: 'registrationGraphFiles',
|
|
88
|
+
[ContributionKind.PolicyRule]: 'policyRuleFiles',
|
|
89
|
+
[ContributionKind.ReusePrimitive]: 'reusePrimitiveFiles',
|
|
90
|
+
[ContributionKind.Baseline]: 'baselineFiles',
|
|
91
|
+
[ContributionKind.GeneratedArtifact]: 'generatedArtifactFiles',
|
|
92
|
+
[ContributionKind.DocReference]: 'docReferenceFiles',
|
|
93
|
+
});
|
|
94
|
+
/** The contribution kind a manifest slot's files are loaded as, or `undefined` for a slot no loader reads. */
|
|
95
|
+
export function contributionKindForSlot(slot) {
|
|
96
|
+
for (const [kind, s] of Object.entries(CONTRIBUTION_KIND_SLOT))
|
|
97
|
+
if (s === slot)
|
|
98
|
+
return kind;
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A slot whose files are loaded under a DIFFERENT kind: `pathConventionFiles`
|
|
103
|
+
* feed the path loader, `docsFiles` the markdown knowledge loader. A file the
|
|
104
|
+
* other kind handled structurally is handled for this slot too.
|
|
105
|
+
*/
|
|
106
|
+
const ALSO_HANDLED_BY = {
|
|
107
|
+
[ContributionKind.PathConvention]: [ContributionKind.Path],
|
|
108
|
+
[ContributionKind.Docs]: [ContributionKind.Knowledge],
|
|
91
109
|
};
|
|
92
110
|
function safeRead(file) {
|
|
93
111
|
try {
|
|
@@ -99,9 +117,9 @@ function safeRead(file) {
|
|
|
99
117
|
}
|
|
100
118
|
/**
|
|
101
119
|
* Lightweight static extractor — looks for `id: '...'` and `title: '...'`
|
|
102
|
-
* occurrences inside a contribution file.
|
|
103
|
-
* file
|
|
104
|
-
*
|
|
120
|
+
* occurrences inside a contribution file. Used ONLY where no loader answered
|
|
121
|
+
* for a file; its ids are tagged `regex-fallback` and never reported as a
|
|
122
|
+
* verified contribution.
|
|
105
123
|
*/
|
|
106
124
|
function extractIdsFromFile(content) {
|
|
107
125
|
const entries = [];
|
|
@@ -135,21 +153,25 @@ function buildContribFileEntries(inspection) {
|
|
|
135
153
|
{ kind: ContributionKind.Pipeline, relCandidates: ['pipelines.ts'] },
|
|
136
154
|
{ kind: ContributionKind.ScaffoldPattern, relCandidates: ['scaffold-patterns.ts'] },
|
|
137
155
|
{ kind: ContributionKind.Policy, relCandidates: ['policies.ts'] },
|
|
156
|
+
{ kind: ContributionKind.Construct, relCandidates: ['constructs.ts'] },
|
|
157
|
+
{ kind: ContributionKind.ConstructFacet, relCandidates: ['construct-facets.ts'] },
|
|
138
158
|
{ kind: ContributionKind.Playbook, relCandidates: ['playbooks.ts'] },
|
|
139
159
|
{ kind: ContributionKind.SearchTuning, relCandidates: ['search-tuning.ts'] },
|
|
140
160
|
{ kind: ContributionKind.FeedbackRule, relCandidates: ['feedback-rules.ts'] },
|
|
141
161
|
{ kind: ContributionKind.Decision, relCandidates: ['decisions.ts'] },
|
|
162
|
+
{ kind: ContributionKind.ContextTest, relCandidates: ['context-tests.ts'] },
|
|
142
163
|
{ kind: ContributionKind.AgentTest, relCandidates: ['agent-tests.ts'] },
|
|
143
164
|
{ kind: ContributionKind.ContractTemplate, relCandidates: ['contract-templates.ts'] },
|
|
144
165
|
{ kind: ContributionKind.MigrationProfile, relCandidates: ['migration-profiles.ts'] },
|
|
145
166
|
{ kind: ContributionKind.Helper, relCandidates: ['helpers.ts'] },
|
|
146
167
|
{ kind: ContributionKind.TaskRoutingHint, relCandidates: ['task-routing-hints.ts'] },
|
|
168
|
+
{ kind: ContributionKind.RegistrationHint, relCandidates: ['registration-hints.ts'] },
|
|
147
169
|
{ kind: ContributionKind.Convention, relCandidates: ['conventions.ts'] },
|
|
148
170
|
];
|
|
149
171
|
for (const c of localConventions) {
|
|
150
172
|
const files = c.relCandidates
|
|
151
173
|
.map((rel) => nodePath.join(dir, rel))
|
|
152
|
-
.filter((abs) =>
|
|
174
|
+
.filter((abs) => safeRead(abs) !== null);
|
|
153
175
|
if (files.length > 0) {
|
|
154
176
|
out.push({ kind: c.kind, files, source: ContributionSource.Local });
|
|
155
177
|
}
|
|
@@ -159,11 +181,11 @@ function buildContribFileEntries(inspection) {
|
|
|
159
181
|
for (const pack of inspection.packs.validPacks ?? []) {
|
|
160
182
|
const contributions = (pack.manifest?.contributions ?? {});
|
|
161
183
|
for (const kind of Object.values(ContributionKind)) {
|
|
162
|
-
const slot =
|
|
184
|
+
const slot = CONTRIBUTION_KIND_SLOT[kind];
|
|
163
185
|
const rels = contributions[slot];
|
|
164
186
|
if (!rels || rels.length === 0)
|
|
165
187
|
continue;
|
|
166
|
-
const abs = rels.map((rel) => nodePath.resolve(pack.packageRoot, rel)).filter((f) =>
|
|
188
|
+
const abs = rels.map((rel) => nodePath.resolve(pack.packageRoot, rel)).filter((f) => safeRead(f) !== null);
|
|
167
189
|
out.push({
|
|
168
190
|
kind,
|
|
169
191
|
packageName: pack.packageName,
|
|
@@ -175,16 +197,33 @@ function buildContribFileEntries(inspection) {
|
|
|
175
197
|
}
|
|
176
198
|
return out;
|
|
177
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Where a registry `sourceFile` lives, as a project-relative path. Registries
|
|
202
|
+
* report a PACK-relative path for pack entries and a PROJECT-relative one for
|
|
203
|
+
* local entries; resolving either against `process.cwd()` (as this used to)
|
|
204
|
+
* made the inventory cwd-dependent and broke nested-id suppression.
|
|
205
|
+
*/
|
|
206
|
+
function sourceFileResolver(inspection) {
|
|
207
|
+
const projectRoot = inspection.projectRoot;
|
|
208
|
+
const packRoots = new Map();
|
|
209
|
+
for (const p of inspection.packs.validPacks ?? [])
|
|
210
|
+
packRoots.set(p.packageName, p.packageRoot);
|
|
211
|
+
return (file, packageName) => {
|
|
212
|
+
const abs = nodePath.isAbsolute(file)
|
|
213
|
+
? file
|
|
214
|
+
: nodePath.resolve((packageName && packRoots.get(packageName)) || projectRoot, file);
|
|
215
|
+
return nodePath.relative(projectRoot, abs) || abs;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
178
218
|
async function loadStructuralEntries(inspection) {
|
|
179
219
|
const byKindAndFile = new Map();
|
|
180
220
|
const structuralFiles = new Map();
|
|
181
221
|
const structuralIds = new Map();
|
|
182
|
-
const
|
|
183
|
-
const rel = (abs) => abs ? nodePath.relative(projectRoot, abs) || abs : undefined;
|
|
222
|
+
const toRel = sourceFileResolver(inspection);
|
|
184
223
|
const record = (kind, file, entry) => {
|
|
185
224
|
if (!file)
|
|
186
225
|
return;
|
|
187
|
-
const relPath =
|
|
226
|
+
const relPath = toRel(file, entry.packageName);
|
|
188
227
|
const kindKey = kind;
|
|
189
228
|
let m = byKindAndFile.get(kindKey);
|
|
190
229
|
if (!m) {
|
|
@@ -213,12 +252,16 @@ async function loadStructuralEntries(inspection) {
|
|
|
213
252
|
const pkg = entry.packageName ?? '__local__';
|
|
214
253
|
idSet.add(`${pkg}:${entry.id}`);
|
|
215
254
|
};
|
|
255
|
+
/** Source attribution for an inspection-backed id (knowledge/rule/path/template/pipeline/preset/boundary). */
|
|
256
|
+
const attribution = (src) => src?.type === 'pack'
|
|
257
|
+
? { source: ContributionSource.Pack, ...(src.packageName ? { packageName: src.packageName } : {}) }
|
|
258
|
+
: { source: ContributionSource.Local };
|
|
216
259
|
// Knowledge / rules / paths / templates / pipelines come from inspection.
|
|
217
260
|
for (const k of inspection.knowledgeEntries) {
|
|
218
261
|
record(ContributionKind.Knowledge, k.source?.origin, {
|
|
219
262
|
id: k.id,
|
|
220
263
|
...(k.title ? { title: k.title } : {}),
|
|
221
|
-
|
|
264
|
+
...attribution(inspection.entrySources.get(k.id)),
|
|
222
265
|
});
|
|
223
266
|
}
|
|
224
267
|
try {
|
|
@@ -227,7 +270,7 @@ async function loadStructuralEntries(inspection) {
|
|
|
227
270
|
record(ContributionKind.Rule, r.source?.origin, {
|
|
228
271
|
id: r.id,
|
|
229
272
|
...(r.title ? { title: r.title } : {}),
|
|
230
|
-
|
|
273
|
+
...attribution(inspection.entrySources.get(r.id)),
|
|
231
274
|
});
|
|
232
275
|
}
|
|
233
276
|
}
|
|
@@ -240,7 +283,7 @@ async function loadStructuralEntries(inspection) {
|
|
|
240
283
|
record(ContributionKind.Path, p.source?.origin, {
|
|
241
284
|
id: p.id,
|
|
242
285
|
...(p.title ? { title: p.title } : {}),
|
|
243
|
-
|
|
286
|
+
...attribution(inspection.entrySources.get(p.id)),
|
|
244
287
|
});
|
|
245
288
|
}
|
|
246
289
|
}
|
|
@@ -250,10 +293,11 @@ async function loadStructuralEntries(inspection) {
|
|
|
250
293
|
try {
|
|
251
294
|
const templates = inspection.templateRegistry?.list?.() ?? [];
|
|
252
295
|
for (const t of templates) {
|
|
253
|
-
|
|
296
|
+
const src = inspection.templateSources.get(t.id);
|
|
297
|
+
record(ContributionKind.Template, src?.file, {
|
|
254
298
|
id: t.id,
|
|
255
299
|
...(t.description ? { title: t.description } : {}),
|
|
256
|
-
|
|
300
|
+
...attribution(src),
|
|
257
301
|
});
|
|
258
302
|
}
|
|
259
303
|
}
|
|
@@ -263,151 +307,77 @@ async function loadStructuralEntries(inspection) {
|
|
|
263
307
|
try {
|
|
264
308
|
const pipelines = inspection.pipelineRegistry?.list?.() ?? [];
|
|
265
309
|
for (const p of pipelines) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
...(p.title ? { title: p.title } : {}),
|
|
269
|
-
source: ContributionSource.Local,
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
catch {
|
|
274
|
-
// ignore
|
|
275
|
-
}
|
|
276
|
-
// Playbooks — these were a major source of nested step.id false positives.
|
|
277
|
-
try {
|
|
278
|
-
const playbooks = await listPlaybooks(inspection);
|
|
279
|
-
for (const p of playbooks) {
|
|
280
|
-
record(ContributionKind.Playbook, p.sourceFile, {
|
|
310
|
+
const src = inspection.pipelineSources.get(p.id);
|
|
311
|
+
record(ContributionKind.Pipeline, src?.file ?? p.source?.origin, {
|
|
281
312
|
id: p.id,
|
|
282
313
|
...(p.title ? { title: p.title } : {}),
|
|
283
|
-
|
|
284
|
-
...(p.packageName ? { packageName: p.packageName } : {}),
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
catch {
|
|
289
|
-
// ignore
|
|
290
|
-
}
|
|
291
|
-
// Conventions, helpers, routing hints, registration hints, contract templates,
|
|
292
|
-
// migration profiles — all loader-backed today.
|
|
293
|
-
try {
|
|
294
|
-
const entries = await listConventions(inspection);
|
|
295
|
-
for (const e of entries) {
|
|
296
|
-
record(ContributionKind.Convention, e.sourceFile, {
|
|
297
|
-
id: e.convention.id,
|
|
298
|
-
...(e.convention.title
|
|
299
|
-
? { title: e.convention.title }
|
|
300
|
-
: {}),
|
|
301
|
-
source: e.source === 'pack'
|
|
302
|
-
? ContributionSource.Pack
|
|
303
|
-
: ContributionSource.Local,
|
|
304
|
-
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
314
|
+
...attribution(src),
|
|
305
315
|
});
|
|
306
316
|
}
|
|
307
317
|
}
|
|
308
318
|
catch {
|
|
309
319
|
// ignore
|
|
310
320
|
}
|
|
321
|
+
// Presets and boundary rules: inspection-time registries with a source map.
|
|
322
|
+
// A built-in preset is not a contribution (its source file reads `builtin`).
|
|
311
323
|
try {
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const packHelpers = await listPackHelpers(inspection);
|
|
318
|
-
for (const e of packHelpers) {
|
|
319
|
-
record(ContributionKind.Helper, e.sourceFile, {
|
|
320
|
-
id: e.helper.id,
|
|
321
|
-
...(e.helper.description
|
|
322
|
-
? { title: e.helper.description }
|
|
323
|
-
: {}),
|
|
324
|
-
source: ContributionSource.Pack,
|
|
325
|
-
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
catch {
|
|
330
|
-
// ignore
|
|
331
|
-
}
|
|
332
|
-
try {
|
|
333
|
-
const entries = await listTaskRoutingHints(inspection);
|
|
334
|
-
for (const e of entries) {
|
|
335
|
-
record(ContributionKind.TaskRoutingHint, e.sourceFile, {
|
|
336
|
-
id: e.hint.id,
|
|
337
|
-
...(e.hint.title ? { title: e.hint.title } : {}),
|
|
338
|
-
source: e.source === 'pack'
|
|
339
|
-
? ContributionSource.Pack
|
|
340
|
-
: ContributionSource.Local,
|
|
341
|
-
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
342
|
-
});
|
|
324
|
+
for (const p of inspection.presetRegistry?.list?.() ?? []) {
|
|
325
|
+
const src = inspection.presetSources.get(p.id);
|
|
326
|
+
if (!src?.file || src.file === 'builtin')
|
|
327
|
+
continue;
|
|
328
|
+
record(ContributionKind.Preset, src.file, { id: p.id, ...(p.title ? { title: p.title } : {}), ...attribution(src) });
|
|
343
329
|
}
|
|
344
330
|
}
|
|
345
331
|
catch {
|
|
346
332
|
// ignore
|
|
347
333
|
}
|
|
348
|
-
// Registration hints don't have a dedicated `ContributionKind` today — they
|
|
349
|
-
// ship through templates' metadata + the registration-hint registry — so
|
|
350
|
-
// we deliberately skip them in the structural map. The self-config doctor
|
|
351
|
-
// surfaces broken registration-hint refs via its own check.
|
|
352
|
-
await Promise.resolve();
|
|
353
|
-
void listRegistrationHints;
|
|
354
334
|
try {
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
? { title: e.template.title }
|
|
361
|
-
: {}),
|
|
362
|
-
source: e.source === 'pack'
|
|
363
|
-
? ContributionSource.Pack
|
|
364
|
-
: ContributionSource.Local,
|
|
365
|
-
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
366
|
-
});
|
|
335
|
+
for (const r of inspection.boundaryRegistry?.list?.() ?? []) {
|
|
336
|
+
const src = inspection.boundarySources.get(r.id);
|
|
337
|
+
if (!src?.file)
|
|
338
|
+
continue;
|
|
339
|
+
record(ContributionKind.Boundary, src.file, { id: r.id, ...(r.title ? { title: r.title } : {}), ...attribution(src) });
|
|
367
340
|
}
|
|
368
341
|
}
|
|
369
342
|
catch {
|
|
370
343
|
// ignore
|
|
371
344
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
345
|
+
// Every REGISTRY kind — helpers, conventions, routing / registration hints,
|
|
346
|
+
// contract templates, migration profiles, scaffold patterns, playbooks,
|
|
347
|
+
// constructs + facets, search tuning, decisions, policy checks, feedback
|
|
348
|
+
// rules, tests, delegate recipes, framework extractors, the gate planes — in
|
|
349
|
+
// ONE run of THE registry-outcome table, which also reports what each loader
|
|
350
|
+
// refused and which files failed to load.
|
|
351
|
+
const outcomes = await collectRegistryOutcomes(inspection);
|
|
352
|
+
for (const a of outcomes.accepted) {
|
|
353
|
+
record(a.kind, a.file, {
|
|
354
|
+
id: a.id,
|
|
355
|
+
...(a.title ? { title: a.title } : {}),
|
|
356
|
+
source: a.packageName ? ContributionSource.Pack : ContributionSource.Local,
|
|
357
|
+
...(a.packageName ? { packageName: a.packageName } : {}),
|
|
358
|
+
});
|
|
385
359
|
}
|
|
386
360
|
return {
|
|
387
361
|
byKindAndFile: byKindAndFile,
|
|
388
362
|
structuralFiles: structuralFiles,
|
|
389
363
|
structuralIds: structuralIds,
|
|
364
|
+
loadFailures: outcomes.loadFailures,
|
|
365
|
+
rejections: outcomes.rejections,
|
|
390
366
|
};
|
|
391
367
|
}
|
|
392
368
|
/**
|
|
393
|
-
* Build the inventory
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
* regex fallback** for those same source files. This eliminates the
|
|
399
|
-
* nested-step-id false positives that previously produced duplicate /
|
|
400
|
-
* conflict noise.
|
|
369
|
+
* Build the inventory WITHOUT consulting the structural loaders — a regex-only
|
|
370
|
+
* compatibility wrapper. Every regex id is marked `warning`
|
|
371
|
+
* ("unverified: loader not consulted") unless the inspection-time loader
|
|
372
|
+
* already imported that file cleanly; known load failures are still `error`.
|
|
373
|
+
* Prefer {@link buildPackContributionsInventoryAsync}.
|
|
401
374
|
*/
|
|
402
375
|
export function buildPackContributionsInventory(inspection) {
|
|
403
376
|
return buildPackContributionsInventorySync(inspection, null);
|
|
404
377
|
}
|
|
405
378
|
/**
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
* Production callers should prefer this over the sync wrapper since it
|
|
409
|
-
* provides the noise-free output. The sync wrapper exists for backward
|
|
410
|
-
* compatibility with callers that haven't been awaited yet.
|
|
379
|
+
* The inventory with structural per-kind entries loaded first — the
|
|
380
|
+
* noise-free, honest variant every surface should use.
|
|
411
381
|
*/
|
|
412
382
|
export async function buildPackContributionsInventoryAsync(inspection) {
|
|
413
383
|
const structural = await loadStructuralEntries(inspection);
|
|
@@ -416,13 +386,53 @@ export async function buildPackContributionsInventoryAsync(inspection) {
|
|
|
416
386
|
function buildPackContributionsInventorySync(inspection, structural) {
|
|
417
387
|
const entriesByKind = {};
|
|
418
388
|
const entries = [];
|
|
389
|
+
const conflicts = [];
|
|
419
390
|
const fileGroups = buildContribFileEntries(inspection);
|
|
391
|
+
const failures = collectContributionLoadFailures(inspection, structural?.loadFailures ?? []);
|
|
392
|
+
// THE rejection channel: inspection-time loaders ∪ registry loaders.
|
|
393
|
+
const rejections = collectContributionRejections(inspection, structural?.rejections ?? []);
|
|
394
|
+
const rejectedIdsByFile = new Map();
|
|
395
|
+
for (const r of rejections) {
|
|
396
|
+
if (r.entryId === undefined)
|
|
397
|
+
continue;
|
|
398
|
+
const m = rejectedIdsByFile.get(r.file) ?? new Map();
|
|
399
|
+
if (!m.has(r.entryId))
|
|
400
|
+
m.set(r.entryId, r);
|
|
401
|
+
rejectedIdsByFile.set(r.file, m);
|
|
402
|
+
}
|
|
403
|
+
// THE files a loader READ, per kind (async only): every file it accepted an
|
|
404
|
+
// entry from AND every file it refused an entry of. The regex never runs on
|
|
405
|
+
// a file its loader already judged — a file whose every entry was rejected
|
|
406
|
+
// used to be scraped, its refused ids counted as contributions (`By kind`,
|
|
407
|
+
// `totals`, the header) and grouped across packs into a false error-level
|
|
408
|
+
// duplicate (round 12 review, A-2).
|
|
409
|
+
const judgedFiles = new Map();
|
|
410
|
+
if (structural) {
|
|
411
|
+
for (const [kindKey, files] of structural.structuralFiles)
|
|
412
|
+
judgedFiles.set(kindKey, new Set(files));
|
|
413
|
+
for (const r of rejections) {
|
|
414
|
+
const rel = nodePath.relative(inspection.projectRoot, r.file) || r.file;
|
|
415
|
+
const set = judgedFiles.get(r.kind) ?? new Set();
|
|
416
|
+
set.add(rel);
|
|
417
|
+
judgedFiles.set(r.kind, set);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
const scrapedByFile = new Map();
|
|
421
|
+
const failedFilesReported = new Set();
|
|
422
|
+
// Files the inspection-time loaders imported cleanly (used by the sync wrapper).
|
|
423
|
+
const loadedOk = new Set((inspection.loaderDiagnostics ?? [])
|
|
424
|
+
.filter((d) => d.status === 'ok')
|
|
425
|
+
.map((d) => nodePath.resolve(d.filePath)));
|
|
426
|
+
const push = (entry) => {
|
|
427
|
+
(entriesByKind[entry.kind] ??= []).push(entry);
|
|
428
|
+
entries.push(entry);
|
|
429
|
+
};
|
|
420
430
|
// First, emit structural entries (authoritative ids).
|
|
421
431
|
if (structural) {
|
|
422
432
|
for (const [kindKey, files] of structural.byKindAndFile) {
|
|
423
433
|
for (const [relPath, list] of files) {
|
|
424
434
|
for (const s of list) {
|
|
425
|
-
|
|
435
|
+
push({
|
|
426
436
|
kind: kindKey,
|
|
427
437
|
id: s.id,
|
|
428
438
|
...(s.title ? { title: s.title } : {}),
|
|
@@ -432,51 +442,68 @@ function buildPackContributionsInventorySync(inspection, structural) {
|
|
|
432
442
|
validation: 'ok',
|
|
433
443
|
extractionMode: 'structural',
|
|
434
444
|
confidence: 'high',
|
|
435
|
-
};
|
|
436
|
-
(entriesByKind[kindKey] ??= []).push(entry);
|
|
437
|
-
entries.push(entry);
|
|
445
|
+
});
|
|
438
446
|
}
|
|
439
447
|
}
|
|
440
448
|
}
|
|
441
449
|
}
|
|
442
450
|
const ingestFile = (group, file) => {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
// this (kind, file) pair
|
|
446
|
-
//
|
|
447
|
-
|
|
448
|
-
|
|
451
|
+
const abs = nodePath.resolve(file);
|
|
452
|
+
const rel = nodePath.relative(inspection.projectRoot, abs) || abs;
|
|
453
|
+
// Skip regex extraction when a loader already READ this (kind, file) pair
|
|
454
|
+
// — accepted or refused an entry of it. Otherwise nested step.id /
|
|
455
|
+
// anchor.id / sub-object ids re-appear as top-level contribution ids, and a
|
|
456
|
+
// fully-rejected file's refused ids read as contributions.
|
|
457
|
+
const handledKinds = [group.kind, ...(ALSO_HANDLED_BY[group.kind] ?? [])];
|
|
458
|
+
if (handledKinds.some((k) => judgedFiles.get(k)?.has(rel)))
|
|
449
459
|
return;
|
|
460
|
+
const failure = failures.get(abs);
|
|
461
|
+
const src = {
|
|
462
|
+
source: group.source,
|
|
463
|
+
...(group.packageName ? { packageName: group.packageName } : {}),
|
|
464
|
+
sourceFile: rel,
|
|
465
|
+
};
|
|
466
|
+
if (failure && !failedFilesReported.has(abs)) {
|
|
467
|
+
failedFilesReported.add(abs);
|
|
468
|
+
conflicts.push({
|
|
469
|
+
kind: ConflictKind.InvalidContribution,
|
|
470
|
+
contributionKind: group.kind,
|
|
471
|
+
id: rel,
|
|
472
|
+
sources: [src],
|
|
473
|
+
severity: 'error',
|
|
474
|
+
message: `${rel} failed to load (${failure.message}) — nothing in it takes effect; any id listed for it was scraped by regex.`,
|
|
475
|
+
nextCommand: group.packageRoot
|
|
476
|
+
? `shrk packs release-check ${nodePath.relative(inspection.projectRoot, group.packageRoot) || '.'}`
|
|
477
|
+
: 'shrk doctor',
|
|
478
|
+
});
|
|
479
|
+
}
|
|
450
480
|
const content = safeRead(file);
|
|
451
481
|
if (content === null) {
|
|
452
|
-
|
|
482
|
+
push({
|
|
453
483
|
kind: group.kind,
|
|
454
484
|
id: rel,
|
|
455
|
-
|
|
456
|
-
...(group.packageName ? { packageName: group.packageName } : {}),
|
|
457
|
-
sourceFile: rel,
|
|
485
|
+
...src,
|
|
458
486
|
validation: 'error',
|
|
459
487
|
validationMessage: 'file unreadable',
|
|
460
|
-
};
|
|
461
|
-
(entriesByKind[group.kind] ??= []).push(entry);
|
|
462
|
-
entries.push(entry);
|
|
488
|
+
});
|
|
463
489
|
return;
|
|
464
490
|
}
|
|
465
491
|
const extracted = extractIdsFromFile(content);
|
|
492
|
+
const rejectedHere = rejectedIdsByFile.get(abs);
|
|
466
493
|
if (extracted.length === 0) {
|
|
467
|
-
|
|
494
|
+
push({
|
|
468
495
|
kind: group.kind,
|
|
469
496
|
id: rel,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
497
|
+
...src,
|
|
498
|
+
validation: failure || rejectedHere ? 'error' : 'warning',
|
|
499
|
+
validationMessage: failure
|
|
500
|
+
? `file failed to load (${failure.message})`
|
|
501
|
+
: rejectedHere
|
|
502
|
+
? 'every entry the file declares was rejected by its loader (see rejections)'
|
|
503
|
+
: 'no `id:` extracted; loader may still see entries',
|
|
475
504
|
extractionMode: 'file-only',
|
|
476
505
|
confidence: 'low',
|
|
477
|
-
};
|
|
478
|
-
(entriesByKind[group.kind] ??= []).push(entry);
|
|
479
|
-
entries.push(entry);
|
|
506
|
+
});
|
|
480
507
|
return;
|
|
481
508
|
}
|
|
482
509
|
// Skip regex entries whose (kind, packageName||local, id) triple
|
|
@@ -488,24 +515,48 @@ function buildPackContributionsInventorySync(inspection, structural) {
|
|
|
488
515
|
for (const ex of extracted) {
|
|
489
516
|
if (idsHandled && idsHandled.has(`${groupPkg}:${ex.id}`))
|
|
490
517
|
continue;
|
|
491
|
-
const
|
|
518
|
+
const rejection = rejectedHere?.get(ex.id);
|
|
519
|
+
let validation;
|
|
520
|
+
let validationMessage;
|
|
521
|
+
if (failure) {
|
|
522
|
+
validation = 'error';
|
|
523
|
+
validationMessage = `file failed to load (${failure.message}); id scraped by regex — this contribution does NOT take effect`;
|
|
524
|
+
(scrapedByFile.get(abs) ?? scrapedByFile.set(abs, []).get(abs)).push(ex.id);
|
|
525
|
+
}
|
|
526
|
+
else if (rejection) {
|
|
527
|
+
// The loader read this entry and REFUSED it — never `ok`, never merely
|
|
528
|
+
// unverified. With the loaders consulted it is in `rejections`, and a
|
|
529
|
+
// refused id is no contribution row at all (round 12 review, A-2).
|
|
530
|
+
if (structural)
|
|
531
|
+
continue;
|
|
532
|
+
validation = 'error';
|
|
533
|
+
validationMessage = `rejected by the ${rejection.kind} loader — ${rejection.reasons.join('; ')}; this contribution does NOT take effect`;
|
|
534
|
+
}
|
|
535
|
+
else if (!structural) {
|
|
536
|
+
validation = loadedOk.has(abs) ? 'ok' : 'warning';
|
|
537
|
+
validationMessage = loadedOk.has(abs)
|
|
538
|
+
? undefined
|
|
539
|
+
: 'unverified: loader not consulted (use the async inventory)';
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
// Every kind is loader-backed (round 12): a regex id means the loader
|
|
543
|
+
// returned no entry for it — unverified, never `ok`.
|
|
544
|
+
validation = 'warning';
|
|
545
|
+
validationMessage = 'regex-derived; the loader returned no entries for this file';
|
|
546
|
+
}
|
|
547
|
+
push({
|
|
492
548
|
kind: group.kind,
|
|
493
549
|
id: ex.id,
|
|
494
550
|
...(ex.title ? { title: ex.title } : {}),
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
validation: 'ok',
|
|
551
|
+
...src,
|
|
552
|
+
validation,
|
|
553
|
+
...(validationMessage ? { validationMessage } : {}),
|
|
499
554
|
// Regex-based id extraction can pick up nested step.id / anchor.id /
|
|
500
555
|
// ref.id values. Tag these entries clearly so the conflict detector
|
|
501
|
-
// downgrades same-file collisions to info.
|
|
502
|
-
// preferred where available; this fallback fires only for kinds
|
|
503
|
-
// without a dedicated registry.
|
|
556
|
+
// downgrades same-file collisions to info.
|
|
504
557
|
extractionMode: 'regex-fallback',
|
|
505
|
-
confidence: 'medium',
|
|
506
|
-
};
|
|
507
|
-
(entriesByKind[group.kind] ??= []).push(entry);
|
|
508
|
-
entries.push(entry);
|
|
558
|
+
confidence: failure ? 'low' : 'medium',
|
|
559
|
+
});
|
|
509
560
|
}
|
|
510
561
|
};
|
|
511
562
|
for (const group of fileGroups) {
|
|
@@ -515,10 +566,14 @@ function buildPackContributionsInventorySync(inspection, structural) {
|
|
|
515
566
|
const totals = {};
|
|
516
567
|
for (const [kind, list] of Object.entries(entriesByKind))
|
|
517
568
|
totals[kind] = list.length;
|
|
518
|
-
const conflicts = [];
|
|
519
569
|
for (const [kind, list] of Object.entries(entriesByKind)) {
|
|
520
570
|
const byId = new Map();
|
|
521
571
|
for (const e of list) {
|
|
572
|
+
// An id that does not take effect — scraped from a file that failed to
|
|
573
|
+
// load, or refused by its loader — cannot collide at runtime: its own
|
|
574
|
+
// load failure / rejection is already the error (round 12 review, A-2).
|
|
575
|
+
if (e.validation === 'error')
|
|
576
|
+
continue;
|
|
522
577
|
const arr = byId.get(e.id) ?? [];
|
|
523
578
|
arr.push(e);
|
|
524
579
|
byId.set(e.id, arr);
|
|
@@ -534,34 +589,27 @@ function buildPackContributionsInventorySync(inspection, structural) {
|
|
|
534
589
|
// (informational; the loader behavior is documented per-kind).
|
|
535
590
|
const hasLocal = arr.some((e) => e.source === ContributionSource.Local);
|
|
536
591
|
const hasPack = arr.some((e) => e.source === ContributionSource.Pack);
|
|
592
|
+
const sources = arr.map((e) => {
|
|
593
|
+
const s = {
|
|
594
|
+
source: e.source,
|
|
595
|
+
};
|
|
596
|
+
if (e.packageName)
|
|
597
|
+
s.packageName = e.packageName;
|
|
598
|
+
if (e.sourceFile)
|
|
599
|
+
s.sourceFile = e.sourceFile;
|
|
600
|
+
return s;
|
|
601
|
+
});
|
|
537
602
|
if (hasLocal && hasPack) {
|
|
538
603
|
conflicts.push({
|
|
539
604
|
kind: ConflictKind.ShadowedPackConfig,
|
|
540
605
|
contributionKind: kind,
|
|
541
606
|
id,
|
|
542
|
-
sources
|
|
543
|
-
const src = {
|
|
544
|
-
source: e.source,
|
|
545
|
-
};
|
|
546
|
-
if (e.packageName)
|
|
547
|
-
src.packageName = e.packageName;
|
|
548
|
-
if (e.sourceFile)
|
|
549
|
-
src.sourceFile = e.sourceFile;
|
|
550
|
-
return src;
|
|
551
|
-
}),
|
|
607
|
+
sources,
|
|
552
608
|
severity: 'info',
|
|
553
609
|
message: `Local "${kind}" "${id}" shadows pack contribution. Local entries win on duplicate ids.`,
|
|
554
610
|
});
|
|
555
611
|
}
|
|
556
612
|
else {
|
|
557
|
-
// Downgrade conflicts that come from a single source file
|
|
558
|
-
// when ALL participating entries are regex-fallback extractions.
|
|
559
|
-
// These are almost certainly nested `id:` fields (e.g.
|
|
560
|
-
// playbook.steps[].id, pipeline.steps[].id) masquerading as
|
|
561
|
-
// separate top-level contribution ids.
|
|
562
|
-
const allRegexFallback = arr.every((e) => e.extractionMode === 'regex-fallback');
|
|
563
|
-
const sourceFiles = new Set(arr.map((e) => e.sourceFile).filter((s) => Boolean(s)));
|
|
564
|
-
const singleSourceFile = sourceFiles.size === 1;
|
|
565
613
|
// Self-acknowledged false positive: when ALL participating entries come
|
|
566
614
|
// from a SINGLE source file via regex fallback, the "duplicate" is
|
|
567
615
|
// almost certainly nested `id:` fields (playbook.steps[].id /
|
|
@@ -569,22 +617,15 @@ function buildPackContributionsInventorySync(inspection, structural) {
|
|
|
569
617
|
// contribution ids. Don't emit noise for it — a genuine duplicate would
|
|
570
618
|
// span multiple files or include a non-regex-fallback entry and still
|
|
571
619
|
// surface as an error below.
|
|
572
|
-
|
|
620
|
+
const allRegexFallback = arr.every((e) => e.extractionMode === 'regex-fallback');
|
|
621
|
+
const sourceFiles = new Set(arr.map((e) => e.sourceFile).filter((s) => Boolean(s)));
|
|
622
|
+
if (allRegexFallback && sourceFiles.size === 1)
|
|
573
623
|
continue;
|
|
574
624
|
conflicts.push({
|
|
575
625
|
kind: conflictKind,
|
|
576
626
|
contributionKind: kind,
|
|
577
627
|
id,
|
|
578
|
-
sources
|
|
579
|
-
const src = {
|
|
580
|
-
source: e.source,
|
|
581
|
-
};
|
|
582
|
-
if (e.packageName)
|
|
583
|
-
src.packageName = e.packageName;
|
|
584
|
-
if (e.sourceFile)
|
|
585
|
-
src.sourceFile = e.sourceFile;
|
|
586
|
-
return src;
|
|
587
|
-
}),
|
|
628
|
+
sources,
|
|
588
629
|
severity: 'error',
|
|
589
630
|
message: `Duplicate "${kind}" id "${id}" loaded from ${arr.length} sources.`,
|
|
590
631
|
nextCommand: `shrk packs contributions --json | jq '.entries[] | select(.id=="${id}" and .kind=="${kind}")'`,
|
|
@@ -592,59 +633,41 @@ function buildPackContributionsInventorySync(inspection, structural) {
|
|
|
592
633
|
}
|
|
593
634
|
}
|
|
594
635
|
}
|
|
595
|
-
// Stale-signature
|
|
596
|
-
//
|
|
636
|
+
// Stale-signature: read from THE pack-asset freshness authority (content
|
|
637
|
+
// digests recorded at sign time), never from mtimes. Dev-signed packs are
|
|
638
|
+
// re-staled by every local build and load fine locally, so their divergence
|
|
639
|
+
// is not a conflict (mirrors pack-signature-status's dev downgrade).
|
|
597
640
|
for (const pack of inspection.packs.validPacks ?? []) {
|
|
598
|
-
|
|
599
|
-
if (!sig)
|
|
641
|
+
if (!pack.manifest?.signature)
|
|
600
642
|
continue;
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
// dev-aware downgrade in pack-signature-status.ts). Production signed packs
|
|
604
|
-
// still surface as stale.
|
|
605
|
-
if (sig.dev === true)
|
|
643
|
+
const freshness = detectPackAssetFreshness(pack);
|
|
644
|
+
if (freshness.signature.state !== 'diverged' || freshness.signature.dev)
|
|
606
645
|
continue;
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
for (const rel of rels) {
|
|
617
|
-
const abs = nodePath.resolve(pack.packageRoot, rel);
|
|
618
|
-
try {
|
|
619
|
-
const stat = statSync(abs);
|
|
620
|
-
if (stat.mtimeMs > sigMs + 1000) {
|
|
621
|
-
staleSummary = `${rel} (mtime ${new Date(stat.mtimeMs).toISOString()}) is newer than signature (${sig.signedAt})`;
|
|
622
|
-
break;
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
catch {
|
|
626
|
-
continue;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
if (staleSummary)
|
|
630
|
-
break;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
catch {
|
|
634
|
-
// ignore
|
|
635
|
-
}
|
|
636
|
-
if (staleSummary) {
|
|
637
|
-
conflicts.push({
|
|
638
|
-
kind: ConflictKind.StaleSignature,
|
|
639
|
-
contributionKind: ContributionKind.Docs,
|
|
640
|
-
id: pack.packageName,
|
|
641
|
-
sources: [{ source: ContributionSource.Pack, packageName: pack.packageName, sourceFile: pack.packageRoot }],
|
|
642
|
-
severity: 'warning',
|
|
643
|
-
message: `Pack ${pack.packageName} signature is stale: ${staleSummary}`,
|
|
644
|
-
nextCommand: `SHARKCRAFT_PACK_SECRET=<secret> shrk packs sign ${nodePath.relative(inspection.projectRoot, pack.packageRoot)}`,
|
|
645
|
-
});
|
|
646
|
-
}
|
|
646
|
+
conflicts.push({
|
|
647
|
+
kind: ConflictKind.StaleSignature,
|
|
648
|
+
contributionKind: ContributionKind.Docs,
|
|
649
|
+
id: pack.packageName,
|
|
650
|
+
sources: [{ source: ContributionSource.Pack, packageName: pack.packageName, sourceFile: pack.packageRoot }],
|
|
651
|
+
severity: 'warning',
|
|
652
|
+
message: describePackAssetFreshness(freshness).signature ?? `Pack ${pack.packageName} signature is stale.`,
|
|
653
|
+
nextCommand: `SHARKCRAFT_PACK_SECRET=<secret> shrk packs sign ${nodePath.relative(inspection.projectRoot, pack.packageRoot)}`,
|
|
654
|
+
});
|
|
647
655
|
}
|
|
656
|
+
const extractionTotals = {
|
|
657
|
+
structural: entries.filter((e) => e.extractionMode === 'structural').length,
|
|
658
|
+
regexFallback: entries.filter((e) => e.extractionMode === 'regex-fallback').length,
|
|
659
|
+
fileOnly: entries.filter((e) => e.extractionMode === 'file-only').length,
|
|
660
|
+
rejected: rejections.length,
|
|
661
|
+
};
|
|
662
|
+
const loadFailures = [...failures.values()]
|
|
663
|
+
.map((f) => ({
|
|
664
|
+
file: nodePath.relative(inspection.projectRoot, f.file) || f.file,
|
|
665
|
+
kind: f.kind,
|
|
666
|
+
...(f.packageName ? { packageName: f.packageName } : {}),
|
|
667
|
+
message: f.message,
|
|
668
|
+
scrapedIds: [...(scrapedByFile.get(f.file) ?? [])],
|
|
669
|
+
}))
|
|
670
|
+
.sort((a, b) => a.file.localeCompare(b.file));
|
|
648
671
|
return {
|
|
649
672
|
schema: PACK_CONTRIBUTIONS_INVENTORY_SCHEMA,
|
|
650
673
|
generatedAt: new Date().toISOString(),
|
|
@@ -659,20 +682,93 @@ function buildPackContributionsInventorySync(inspection, structural) {
|
|
|
659
682
|
root: p.packageRoot,
|
|
660
683
|
signaturePresent: Boolean(p.manifest?.signature),
|
|
661
684
|
})),
|
|
685
|
+
extractionTotals,
|
|
686
|
+
loadFailures,
|
|
687
|
+
rejections: rejections.map((r) => ({
|
|
688
|
+
file: nodePath.relative(inspection.projectRoot, r.file) || r.file,
|
|
689
|
+
kind: r.kind,
|
|
690
|
+
...(r.packageName ? { packageName: r.packageName } : {}),
|
|
691
|
+
index: r.index,
|
|
692
|
+
...(r.exportName ? { exportName: r.exportName } : {}),
|
|
693
|
+
...(r.entryId !== undefined ? { entryId: r.entryId } : {}),
|
|
694
|
+
reasons: r.reasons,
|
|
695
|
+
cause: r.cause,
|
|
696
|
+
})),
|
|
697
|
+
mode: structural ? 'async' : 'sync',
|
|
662
698
|
};
|
|
663
699
|
}
|
|
700
|
+
/** Per-kind extraction-mode counts over `entries` (so a filtered view renders its own numbers). */
|
|
701
|
+
function modeCountsByKind(entries) {
|
|
702
|
+
const out = new Map();
|
|
703
|
+
for (const e of entries) {
|
|
704
|
+
const c = out.get(e.kind) ?? { total: 0, structural: 0, regexFallback: 0, fileOnly: 0 };
|
|
705
|
+
c.total += 1;
|
|
706
|
+
if (e.extractionMode === 'structural')
|
|
707
|
+
c.structural += 1;
|
|
708
|
+
else if (e.extractionMode === 'regex-fallback')
|
|
709
|
+
c.regexFallback += 1;
|
|
710
|
+
else if (e.extractionMode === 'file-only')
|
|
711
|
+
c.fileOnly += 1;
|
|
712
|
+
out.set(e.kind, c);
|
|
713
|
+
}
|
|
714
|
+
return out;
|
|
715
|
+
}
|
|
716
|
+
function modeClause(c) {
|
|
717
|
+
const parts = [];
|
|
718
|
+
if (c.structural > 0)
|
|
719
|
+
parts.push(`structural ${c.structural}`);
|
|
720
|
+
if (c.regexFallback > 0)
|
|
721
|
+
parts.push(`regex-fallback ${c.regexFallback}`);
|
|
722
|
+
if (c.fileOnly > 0)
|
|
723
|
+
parts.push(`file-only ${c.fileOnly}`);
|
|
724
|
+
return parts.length > 0 ? `(${parts.join(' · ')})` : '';
|
|
725
|
+
}
|
|
726
|
+
function extractionLine(entries, rejected) {
|
|
727
|
+
const s = entries.filter((e) => e.extractionMode === 'structural').length;
|
|
728
|
+
const r = entries.filter((e) => e.extractionMode === 'regex-fallback').length;
|
|
729
|
+
const f = entries.filter((e) => e.extractionMode === 'file-only').length;
|
|
730
|
+
return `${s} structural · ${r} regex-fallback (unverified) · ${f} file-only${rejected > 0 ? ` · ${rejected} REJECTED` : ''}`;
|
|
731
|
+
}
|
|
664
732
|
export function renderInventoryText(inv) {
|
|
665
733
|
const lines = [];
|
|
734
|
+
const rejections = inv.rejections ?? [];
|
|
666
735
|
lines.push(`=== Pack contributions inventory (${inv.entries.length} entries) ===`);
|
|
667
736
|
lines.push(` generatedAt ${inv.generatedAt}`);
|
|
668
737
|
lines.push(` packs ${inv.packs.length}`);
|
|
669
738
|
for (const p of inv.packs)
|
|
670
739
|
lines.push(` • ${p.name}@${p.version} (sig: ${p.signaturePresent ? 'present' : 'absent'})`);
|
|
740
|
+
lines.push(` extraction ${extractionLine(inv.entries, rejections.length)}`);
|
|
741
|
+
if (inv.mode === 'sync')
|
|
742
|
+
lines.push(' mode sync — loaders NOT consulted; regex ids are unverified');
|
|
671
743
|
lines.push('');
|
|
672
744
|
lines.push(`By kind:`);
|
|
673
|
-
|
|
674
|
-
|
|
745
|
+
const byKind = modeCountsByKind(inv.entries);
|
|
746
|
+
for (const k of [...byKind.keys()].sort()) {
|
|
747
|
+
const c = byKind.get(k);
|
|
748
|
+
lines.push(` ${k.padEnd(28)} ${String(c.total).padStart(4)} ${modeClause(c)}`.trimEnd());
|
|
749
|
+
}
|
|
675
750
|
lines.push('');
|
|
751
|
+
const failures = inv.loadFailures ?? [];
|
|
752
|
+
if (failures.length > 0) {
|
|
753
|
+
lines.push(`Load failures (${failures.length}):`);
|
|
754
|
+
for (const f of failures) {
|
|
755
|
+
lines.push(` ✗ ${f.file} [${f.kind}${f.packageName ? `, ${f.packageName}` : ''}] — ${f.message}`);
|
|
756
|
+
lines.push(` regex-scraped ids NOT loaded: ${f.scrapedIds.length > 0 ? f.scrapedIds.join(', ') : '(none)'}`);
|
|
757
|
+
}
|
|
758
|
+
lines.push('');
|
|
759
|
+
}
|
|
760
|
+
if (rejections.length > 0) {
|
|
761
|
+
lines.push(`Rejected entries (${rejections.length}) — refused by their loader, NOT in effect:`);
|
|
762
|
+
let lastFile = '';
|
|
763
|
+
for (const r of rejections) {
|
|
764
|
+
if (r.file !== lastFile) {
|
|
765
|
+
lines.push(` ✗ ${r.file} [${r.kind}${r.packageName ? `, ${r.packageName}` : ''}]`);
|
|
766
|
+
lastFile = r.file;
|
|
767
|
+
}
|
|
768
|
+
lines.push(` ${formatEntryRejection(r)}`);
|
|
769
|
+
}
|
|
770
|
+
lines.push('');
|
|
771
|
+
}
|
|
676
772
|
if (inv.conflicts.length > 0) {
|
|
677
773
|
lines.push(`Conflicts (${inv.conflicts.length}):`);
|
|
678
774
|
for (const c of inv.conflicts.slice(0, 50)) {
|
|
@@ -688,6 +784,7 @@ export function renderInventoryText(inv) {
|
|
|
688
784
|
}
|
|
689
785
|
export function renderInventoryMarkdown(inv) {
|
|
690
786
|
const lines = [];
|
|
787
|
+
const rejections = inv.rejections ?? [];
|
|
691
788
|
lines.push('# Pack contributions inventory');
|
|
692
789
|
lines.push('');
|
|
693
790
|
lines.push(`- generatedAt: ${inv.generatedAt}`);
|
|
@@ -695,12 +792,43 @@ export function renderInventoryMarkdown(inv) {
|
|
|
695
792
|
for (const p of inv.packs) {
|
|
696
793
|
lines.push(` - **${p.name}** \`${p.version}\` (signature ${p.signaturePresent ? 'present' : 'absent'})`);
|
|
697
794
|
}
|
|
795
|
+
lines.push(`- extraction: ${extractionLine(inv.entries, rejections.length)}`);
|
|
796
|
+
if (inv.mode === 'sync')
|
|
797
|
+
lines.push('- mode: sync — loaders NOT consulted; regex ids are unverified');
|
|
698
798
|
lines.push('');
|
|
699
799
|
lines.push('## By kind');
|
|
700
|
-
lines.push('| Kind | Count |');
|
|
701
|
-
lines.push('| --- | --- |');
|
|
702
|
-
|
|
703
|
-
|
|
800
|
+
lines.push('| Kind | Count | Structural | Regex-fallback | File-only |');
|
|
801
|
+
lines.push('| --- | --- | --- | --- | --- |');
|
|
802
|
+
const byKind = modeCountsByKind(inv.entries);
|
|
803
|
+
for (const k of [...byKind.keys()].sort()) {
|
|
804
|
+
const c = byKind.get(k);
|
|
805
|
+
lines.push(`| \`${k}\` | ${c.total} | ${c.structural} | ${c.regexFallback} | ${c.fileOnly} |`);
|
|
806
|
+
}
|
|
807
|
+
lines.push('');
|
|
808
|
+
lines.push('## Load failures');
|
|
809
|
+
const failures = inv.loadFailures ?? [];
|
|
810
|
+
if (failures.length === 0) {
|
|
811
|
+
lines.push('None.');
|
|
812
|
+
}
|
|
813
|
+
else {
|
|
814
|
+
lines.push('| File | Kind | Pack | Error | Regex-scraped ids NOT loaded |');
|
|
815
|
+
lines.push('| --- | --- | --- | --- | --- |');
|
|
816
|
+
for (const f of failures) {
|
|
817
|
+
lines.push(`| \`${f.file}\` | ${f.kind} | ${f.packageName ?? ''} | ${f.message} | ${f.scrapedIds.join(', ')} |`);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
lines.push('');
|
|
821
|
+
lines.push('## Rejected entries');
|
|
822
|
+
if (rejections.length === 0) {
|
|
823
|
+
lines.push('None.');
|
|
824
|
+
}
|
|
825
|
+
else {
|
|
826
|
+
lines.push('| File | Kind | Pack | Entry | Reasons |');
|
|
827
|
+
lines.push('| --- | --- | --- | --- | --- |');
|
|
828
|
+
for (const r of rejections) {
|
|
829
|
+
lines.push(`| \`${r.file}\` | ${r.kind} | ${r.packageName ?? ''} | ${r.entryId !== undefined ? `\`${r.entryId}\`` : '(no id)'} ${r.exportName ?? ''}[${r.index}] | ${r.reasons.join('; ')} |`);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
704
832
|
lines.push('');
|
|
705
833
|
lines.push('## Conflicts');
|
|
706
834
|
if (inv.conflicts.length === 0) {
|
|
@@ -718,3 +846,32 @@ export function renderInventoryMarkdown(inv) {
|
|
|
718
846
|
export function selectConflicts(inv) {
|
|
719
847
|
return inv.conflicts;
|
|
720
848
|
}
|
|
849
|
+
/**
|
|
850
|
+
* Per contribution kind, a pack's declared FILES, ACCEPTED entries and
|
|
851
|
+
* REJECTED entries — THE projection of this inventory that `packs list`,
|
|
852
|
+
* `packs get` and MCP `list_packs` / `get_pack` print (round 12, 12.1b), so
|
|
853
|
+
* a partially-loaded file never looks like a fully-loaded one and every
|
|
854
|
+
* surface counts what `packs contributions` counts. A kind with nothing
|
|
855
|
+
* declared, accepted or rejected is absent.
|
|
856
|
+
*/
|
|
857
|
+
export function packEntryCounts(inv, pack) {
|
|
858
|
+
const out = {};
|
|
859
|
+
const row = (kind) => (out[kind] ??= { files: 0, accepted: 0, rejected: 0 });
|
|
860
|
+
for (const slot of CONTRIBUTION_FILE_KEYS) {
|
|
861
|
+
const n = pack.contributionCounts[slot] ?? 0;
|
|
862
|
+
if (n === 0)
|
|
863
|
+
continue;
|
|
864
|
+
row(contributionKindForSlot(slot) ?? slot).files += n;
|
|
865
|
+
}
|
|
866
|
+
for (const e of inv?.entries ?? []) {
|
|
867
|
+
if (e.packageName !== pack.packageName || e.extractionMode !== 'structural')
|
|
868
|
+
continue;
|
|
869
|
+
row(e.kind).accepted += 1;
|
|
870
|
+
}
|
|
871
|
+
for (const r of inv?.rejections ?? []) {
|
|
872
|
+
if (r.packageName !== pack.packageName)
|
|
873
|
+
continue;
|
|
874
|
+
row(r.kind).rejected += 1;
|
|
875
|
+
}
|
|
876
|
+
return out;
|
|
877
|
+
}
|