@shrkcrft/inspector 0.1.0-alpha.1
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +57 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +214 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +382 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +38 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +173 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +422 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +224 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +234 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +42 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +268 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +73 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +519 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +81 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +65 -0
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic pack contributions inventory + conflict detector.
|
|
3
|
+
*
|
|
4
|
+
* Reads each pack's manifest, enumerates the contribution slots, and reports:
|
|
5
|
+
* - one row per (kind, id, source) — the inventory
|
|
6
|
+
* - one row per detected collision — the conflicts
|
|
7
|
+
*
|
|
8
|
+
* Both outputs are deterministic and read-only.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
11
|
+
import * as nodePath from 'node:path';
|
|
12
|
+
// Structural loaders used to replace regex-fallback noise per kind.
|
|
13
|
+
import { HELPERS } from "./helper-registry.js";
|
|
14
|
+
import { listConventions } from "./convention-registry.js";
|
|
15
|
+
import { listPluginLifecycleProfiles } from "./plugin-lifecycle-profile-registry.js";
|
|
16
|
+
import { listPackHelpers } from "./pack-helper-registry.js";
|
|
17
|
+
import { listTaskRoutingHints } from "./task-routing-hint-registry.js";
|
|
18
|
+
import { listRegistrationHints } from "./registration-hint-registry.js";
|
|
19
|
+
import { listPlaybooks } from "./playbook-registry.js";
|
|
20
|
+
import { loadAllContractTemplates } from "./contract-template-registry.js";
|
|
21
|
+
import { listMigrationProfilesFromPacks } from "./migration-profile-registry.js";
|
|
22
|
+
export const PACK_CONTRIBUTIONS_INVENTORY_SCHEMA = 'sharkcraft.pack-contributions-inventory/v1';
|
|
23
|
+
export var ContributionSource;
|
|
24
|
+
(function (ContributionSource) {
|
|
25
|
+
ContributionSource["Builtin"] = "builtin";
|
|
26
|
+
ContributionSource["Local"] = "local";
|
|
27
|
+
ContributionSource["Pack"] = "pack";
|
|
28
|
+
ContributionSource["Fixture"] = "fixture";
|
|
29
|
+
})(ContributionSource || (ContributionSource = {}));
|
|
30
|
+
export var ContributionKind;
|
|
31
|
+
(function (ContributionKind) {
|
|
32
|
+
ContributionKind["Knowledge"] = "knowledge";
|
|
33
|
+
ContributionKind["Rule"] = "rule";
|
|
34
|
+
ContributionKind["Path"] = "path";
|
|
35
|
+
ContributionKind["PathConvention"] = "path-convention";
|
|
36
|
+
ContributionKind["Template"] = "template";
|
|
37
|
+
ContributionKind["Pipeline"] = "pipeline";
|
|
38
|
+
ContributionKind["Preset"] = "preset";
|
|
39
|
+
ContributionKind["Boundary"] = "boundary";
|
|
40
|
+
ContributionKind["ScaffoldPattern"] = "scaffold-pattern";
|
|
41
|
+
ContributionKind["Policy"] = "policy";
|
|
42
|
+
ContributionKind["Construct"] = "construct";
|
|
43
|
+
ContributionKind["Playbook"] = "playbook";
|
|
44
|
+
ContributionKind["SearchTuning"] = "search-tuning";
|
|
45
|
+
ContributionKind["FeedbackRule"] = "feedback-rule";
|
|
46
|
+
ContributionKind["Decision"] = "decision";
|
|
47
|
+
ContributionKind["ContractTemplate"] = "contract-template";
|
|
48
|
+
ContributionKind["MigrationProfile"] = "migration-profile";
|
|
49
|
+
ContributionKind["PluginLifecycleProfile"] = "plugin-lifecycle-profile";
|
|
50
|
+
ContributionKind["ContextTest"] = "context-test";
|
|
51
|
+
ContributionKind["AgentTest"] = "agent-test";
|
|
52
|
+
ContributionKind["Helper"] = "helper";
|
|
53
|
+
ContributionKind["TaskRoutingHint"] = "task-routing-hint";
|
|
54
|
+
ContributionKind["Convention"] = "convention";
|
|
55
|
+
ContributionKind["Docs"] = "docs";
|
|
56
|
+
})(ContributionKind || (ContributionKind = {}));
|
|
57
|
+
export var ConflictKind;
|
|
58
|
+
(function (ConflictKind) {
|
|
59
|
+
ConflictKind["DuplicateIdSameKind"] = "duplicate-id-same-kind";
|
|
60
|
+
ConflictKind["DuplicateIdDifferentSource"] = "duplicate-id-different-source";
|
|
61
|
+
ConflictKind["ShadowedLocalConfig"] = "shadowed-local-config";
|
|
62
|
+
ConflictKind["ShadowedPackConfig"] = "shadowed-pack-config";
|
|
63
|
+
ConflictKind["InvalidContribution"] = "invalid-contribution";
|
|
64
|
+
ConflictKind["MissingReferencedId"] = "missing-referenced-id";
|
|
65
|
+
ConflictKind["StaleSignature"] = "stale-signature";
|
|
66
|
+
ConflictKind["IncompatibleSchema"] = "incompatible-schema";
|
|
67
|
+
ConflictKind["MissingLoader"] = "missing-loader";
|
|
68
|
+
})(ConflictKind || (ConflictKind = {}));
|
|
69
|
+
const KIND_TO_SLOT = {
|
|
70
|
+
[ContributionKind.Knowledge]: 'knowledgeFiles',
|
|
71
|
+
[ContributionKind.Rule]: 'ruleFiles',
|
|
72
|
+
[ContributionKind.Path]: 'pathFiles',
|
|
73
|
+
[ContributionKind.PathConvention]: 'pathConventionFiles',
|
|
74
|
+
[ContributionKind.Template]: 'templateFiles',
|
|
75
|
+
[ContributionKind.Pipeline]: 'pipelineFiles',
|
|
76
|
+
[ContributionKind.Preset]: 'presetFiles',
|
|
77
|
+
[ContributionKind.Boundary]: 'boundaryFiles',
|
|
78
|
+
[ContributionKind.ScaffoldPattern]: 'scaffoldPatternFiles',
|
|
79
|
+
[ContributionKind.Policy]: 'policyCheckFiles',
|
|
80
|
+
[ContributionKind.Construct]: 'constructFiles',
|
|
81
|
+
[ContributionKind.Playbook]: 'playbookFiles',
|
|
82
|
+
[ContributionKind.SearchTuning]: 'searchTuningFiles',
|
|
83
|
+
[ContributionKind.FeedbackRule]: 'feedbackRuleFiles',
|
|
84
|
+
[ContributionKind.Decision]: 'decisionFiles',
|
|
85
|
+
[ContributionKind.ContractTemplate]: 'contractTemplateFiles',
|
|
86
|
+
[ContributionKind.MigrationProfile]: 'migrationProfileFiles',
|
|
87
|
+
[ContributionKind.PluginLifecycleProfile]: 'pluginLifecycleProfileFiles',
|
|
88
|
+
[ContributionKind.ContextTest]: 'contextTestFiles',
|
|
89
|
+
[ContributionKind.AgentTest]: 'agentTestFiles',
|
|
90
|
+
[ContributionKind.Helper]: 'helperFiles',
|
|
91
|
+
[ContributionKind.TaskRoutingHint]: 'taskRoutingHintFiles',
|
|
92
|
+
[ContributionKind.Convention]: 'conventionFiles',
|
|
93
|
+
[ContributionKind.Docs]: 'docsFiles',
|
|
94
|
+
};
|
|
95
|
+
function safeRead(file) {
|
|
96
|
+
try {
|
|
97
|
+
return readFileSync(file, 'utf8');
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Lightweight static extractor — looks for `id: '...'` and `title: '...'`
|
|
105
|
+
* occurrences inside a contribution file. This works without importing the
|
|
106
|
+
* file (the engine already has dedicated loaders that do this; the inventory
|
|
107
|
+
* is intentionally a fast surface-level reporter that doesn't re-run them).
|
|
108
|
+
*/
|
|
109
|
+
function extractIdsFromFile(content) {
|
|
110
|
+
const entries = [];
|
|
111
|
+
const idRe = /\bid\s*:\s*['"]([A-Za-z_][\w.-]*)['"]/g;
|
|
112
|
+
let match;
|
|
113
|
+
while ((match = idRe.exec(content)) !== null) {
|
|
114
|
+
const id = match[1];
|
|
115
|
+
// Look ahead a bit for a title within the next ~200 chars.
|
|
116
|
+
const lookahead = content.slice(match.index, match.index + 400);
|
|
117
|
+
const titleMatch = /\btitle\s*:\s*['"]([^'"]+)['"]/.exec(lookahead);
|
|
118
|
+
const entry = { id };
|
|
119
|
+
if (titleMatch)
|
|
120
|
+
entry.title = titleMatch[1] ?? undefined;
|
|
121
|
+
entries.push(entry);
|
|
122
|
+
}
|
|
123
|
+
return entries;
|
|
124
|
+
}
|
|
125
|
+
function buildContribFileEntries(inspection) {
|
|
126
|
+
const out = [];
|
|
127
|
+
// Local contributions inferred from sharkcraft.config + conventional file
|
|
128
|
+
// names. (The engine doesn't have a single canonical list; we use the same
|
|
129
|
+
// file-name conventions the loaders accept.)
|
|
130
|
+
const dir = inspection.sharkcraftDir;
|
|
131
|
+
if (dir) {
|
|
132
|
+
const localConventions = [
|
|
133
|
+
{ kind: ContributionKind.Knowledge, relCandidates: ['knowledge.ts'] },
|
|
134
|
+
{ kind: ContributionKind.Rule, relCandidates: ['rules.ts'] },
|
|
135
|
+
{ kind: ContributionKind.Path, relCandidates: ['paths.ts'] },
|
|
136
|
+
{ kind: ContributionKind.PathConvention, relCandidates: ['path-conventions.ts'] },
|
|
137
|
+
{ kind: ContributionKind.Template, relCandidates: ['templates.ts'] },
|
|
138
|
+
{ kind: ContributionKind.Pipeline, relCandidates: ['pipelines.ts'] },
|
|
139
|
+
{ kind: ContributionKind.ScaffoldPattern, relCandidates: ['scaffold-patterns.ts'] },
|
|
140
|
+
{ kind: ContributionKind.Policy, relCandidates: ['policies.ts'] },
|
|
141
|
+
{ kind: ContributionKind.Playbook, relCandidates: ['playbooks.ts'] },
|
|
142
|
+
{ kind: ContributionKind.SearchTuning, relCandidates: ['search-tuning.ts'] },
|
|
143
|
+
{ kind: ContributionKind.FeedbackRule, relCandidates: ['feedback-rules.ts'] },
|
|
144
|
+
{ kind: ContributionKind.Decision, relCandidates: ['decisions.ts'] },
|
|
145
|
+
{ kind: ContributionKind.AgentTest, relCandidates: ['agent-tests.ts'] },
|
|
146
|
+
{
|
|
147
|
+
kind: ContributionKind.PluginLifecycleProfile,
|
|
148
|
+
relCandidates: ['plugin-lifecycle-profiles.ts'],
|
|
149
|
+
},
|
|
150
|
+
{ kind: ContributionKind.ContractTemplate, relCandidates: ['contract-templates.ts'] },
|
|
151
|
+
{ kind: ContributionKind.MigrationProfile, relCandidates: ['migration-profiles.ts'] },
|
|
152
|
+
{ kind: ContributionKind.Helper, relCandidates: ['helpers.ts'] },
|
|
153
|
+
{ kind: ContributionKind.TaskRoutingHint, relCandidates: ['task-routing-hints.ts'] },
|
|
154
|
+
{ kind: ContributionKind.Convention, relCandidates: ['conventions.ts'] },
|
|
155
|
+
];
|
|
156
|
+
for (const c of localConventions) {
|
|
157
|
+
const files = c.relCandidates
|
|
158
|
+
.map((rel) => nodePath.join(dir, rel))
|
|
159
|
+
.filter((abs) => existsSync(abs));
|
|
160
|
+
if (files.length > 0) {
|
|
161
|
+
out.push({ kind: c.kind, files, source: ContributionSource.Local });
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Pack contributions from manifests.
|
|
166
|
+
for (const pack of inspection.packs.validPacks ?? []) {
|
|
167
|
+
const contributions = (pack.manifest?.contributions ?? {});
|
|
168
|
+
for (const kind of Object.values(ContributionKind)) {
|
|
169
|
+
const slot = KIND_TO_SLOT[kind];
|
|
170
|
+
const rels = contributions[slot];
|
|
171
|
+
if (!rels || rels.length === 0)
|
|
172
|
+
continue;
|
|
173
|
+
const abs = rels.map((rel) => nodePath.resolve(pack.packageRoot, rel)).filter((f) => existsSync(f));
|
|
174
|
+
out.push({
|
|
175
|
+
kind,
|
|
176
|
+
packageName: pack.packageName,
|
|
177
|
+
packageRoot: pack.packageRoot,
|
|
178
|
+
files: abs,
|
|
179
|
+
source: ContributionSource.Pack,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return out;
|
|
184
|
+
}
|
|
185
|
+
async function loadStructuralEntries(inspection) {
|
|
186
|
+
const byKindAndFile = new Map();
|
|
187
|
+
const structuralFiles = new Map();
|
|
188
|
+
const structuralIds = new Map();
|
|
189
|
+
const projectRoot = inspection.projectRoot;
|
|
190
|
+
const rel = (abs) => abs ? nodePath.relative(projectRoot, abs) || abs : undefined;
|
|
191
|
+
const record = (kind, file, entry) => {
|
|
192
|
+
if (!file)
|
|
193
|
+
return;
|
|
194
|
+
const relPath = rel(file);
|
|
195
|
+
const kindKey = kind;
|
|
196
|
+
let m = byKindAndFile.get(kindKey);
|
|
197
|
+
if (!m) {
|
|
198
|
+
m = new Map();
|
|
199
|
+
byKindAndFile.set(kindKey, m);
|
|
200
|
+
}
|
|
201
|
+
let arr = m.get(relPath);
|
|
202
|
+
if (!arr) {
|
|
203
|
+
arr = [];
|
|
204
|
+
m.set(relPath, arr);
|
|
205
|
+
}
|
|
206
|
+
arr.push(entry);
|
|
207
|
+
let fileSet = structuralFiles.get(kindKey);
|
|
208
|
+
if (!fileSet) {
|
|
209
|
+
fileSet = new Set();
|
|
210
|
+
structuralFiles.set(kindKey, fileSet);
|
|
211
|
+
}
|
|
212
|
+
fileSet.add(relPath);
|
|
213
|
+
// Track `(kind, packageName||local, id)` so regex fallback can
|
|
214
|
+
// dedupe across multiple physical paths.
|
|
215
|
+
let idSet = structuralIds.get(kindKey);
|
|
216
|
+
if (!idSet) {
|
|
217
|
+
idSet = new Set();
|
|
218
|
+
structuralIds.set(kindKey, idSet);
|
|
219
|
+
}
|
|
220
|
+
const pkg = entry.packageName ?? '__local__';
|
|
221
|
+
idSet.add(`${pkg}:${entry.id}`);
|
|
222
|
+
};
|
|
223
|
+
// Knowledge / rules / paths / templates / pipelines come from inspection.
|
|
224
|
+
for (const k of inspection.knowledgeEntries) {
|
|
225
|
+
record(ContributionKind.Knowledge, k.source?.origin, {
|
|
226
|
+
id: k.id,
|
|
227
|
+
...(k.title ? { title: k.title } : {}),
|
|
228
|
+
source: ContributionSource.Local,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
try {
|
|
232
|
+
const rules = inspection.ruleService?.list?.() ?? [];
|
|
233
|
+
for (const r of rules) {
|
|
234
|
+
record(ContributionKind.Rule, r.source?.origin, {
|
|
235
|
+
id: r.id,
|
|
236
|
+
...(r.title ? { title: r.title } : {}),
|
|
237
|
+
source: ContributionSource.Local,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
// ignore
|
|
243
|
+
}
|
|
244
|
+
try {
|
|
245
|
+
const paths = inspection.pathService?.list?.() ?? [];
|
|
246
|
+
for (const p of paths) {
|
|
247
|
+
record(ContributionKind.Path, p.source?.origin, {
|
|
248
|
+
id: p.id,
|
|
249
|
+
...(p.title ? { title: p.title } : {}),
|
|
250
|
+
source: ContributionSource.Local,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
// ignore
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
const templates = inspection.templateRegistry?.list?.() ?? [];
|
|
259
|
+
for (const t of templates) {
|
|
260
|
+
record(ContributionKind.Template, t.source?.origin, {
|
|
261
|
+
id: t.id,
|
|
262
|
+
...(t.description ? { title: t.description } : {}),
|
|
263
|
+
source: ContributionSource.Local,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
// ignore
|
|
269
|
+
}
|
|
270
|
+
try {
|
|
271
|
+
const pipelines = inspection.pipelineRegistry?.list?.() ?? [];
|
|
272
|
+
for (const p of pipelines) {
|
|
273
|
+
record(ContributionKind.Pipeline, p.source?.origin, {
|
|
274
|
+
id: p.id,
|
|
275
|
+
...(p.title ? { title: p.title } : {}),
|
|
276
|
+
source: ContributionSource.Local,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
// ignore
|
|
282
|
+
}
|
|
283
|
+
// Playbooks — these were a major source of nested step.id false positives.
|
|
284
|
+
try {
|
|
285
|
+
const playbooks = await listPlaybooks(inspection);
|
|
286
|
+
for (const p of playbooks) {
|
|
287
|
+
record(ContributionKind.Playbook, p.sourceFile, {
|
|
288
|
+
id: p.id,
|
|
289
|
+
...(p.title ? { title: p.title } : {}),
|
|
290
|
+
source: p.source === 'pack' ? ContributionSource.Pack : ContributionSource.Local,
|
|
291
|
+
...(p.packageName ? { packageName: p.packageName } : {}),
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
// ignore
|
|
297
|
+
}
|
|
298
|
+
// Plugin-lifecycle profiles — same problem (sub-object ids).
|
|
299
|
+
try {
|
|
300
|
+
const entries = await listPluginLifecycleProfiles(inspection);
|
|
301
|
+
for (const e of entries) {
|
|
302
|
+
record(ContributionKind.PluginLifecycleProfile, e.sourceFile, {
|
|
303
|
+
id: e.profile.id,
|
|
304
|
+
...(e.profile.title ? { title: e.profile.title } : {}),
|
|
305
|
+
source: e.source === 'pack'
|
|
306
|
+
? ContributionSource.Pack
|
|
307
|
+
: ContributionSource.Local,
|
|
308
|
+
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
// ignore
|
|
314
|
+
}
|
|
315
|
+
// Conventions, helpers, routing hints, registration hints, contract templates,
|
|
316
|
+
// migration profiles — all loader-backed today.
|
|
317
|
+
try {
|
|
318
|
+
const entries = await listConventions(inspection);
|
|
319
|
+
for (const e of entries) {
|
|
320
|
+
record(ContributionKind.Convention, e.sourceFile, {
|
|
321
|
+
id: e.convention.id,
|
|
322
|
+
...(e.convention.title
|
|
323
|
+
? { title: e.convention.title }
|
|
324
|
+
: {}),
|
|
325
|
+
source: e.source === 'pack'
|
|
326
|
+
? ContributionSource.Pack
|
|
327
|
+
: ContributionSource.Local,
|
|
328
|
+
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
catch {
|
|
333
|
+
// ignore
|
|
334
|
+
}
|
|
335
|
+
try {
|
|
336
|
+
const builtIns = HELPERS;
|
|
337
|
+
for (const h of builtIns) {
|
|
338
|
+
// Built-in helpers don't have a file; skip the structural mapping.
|
|
339
|
+
void h;
|
|
340
|
+
}
|
|
341
|
+
const packHelpers = await listPackHelpers(inspection);
|
|
342
|
+
for (const e of packHelpers) {
|
|
343
|
+
record(ContributionKind.Helper, e.sourceFile, {
|
|
344
|
+
id: e.helper.id,
|
|
345
|
+
...(e.helper.description
|
|
346
|
+
? { title: e.helper.description }
|
|
347
|
+
: {}),
|
|
348
|
+
source: ContributionSource.Pack,
|
|
349
|
+
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
// ignore
|
|
355
|
+
}
|
|
356
|
+
try {
|
|
357
|
+
const entries = await listTaskRoutingHints(inspection);
|
|
358
|
+
for (const e of entries) {
|
|
359
|
+
record(ContributionKind.TaskRoutingHint, e.sourceFile, {
|
|
360
|
+
id: e.hint.id,
|
|
361
|
+
...(e.hint.title ? { title: e.hint.title } : {}),
|
|
362
|
+
source: e.source === 'pack'
|
|
363
|
+
? ContributionSource.Pack
|
|
364
|
+
: ContributionSource.Local,
|
|
365
|
+
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
// ignore
|
|
371
|
+
}
|
|
372
|
+
// Registration hints don't have a dedicated `ContributionKind` today — they
|
|
373
|
+
// ship through templates' metadata + the registration-hint registry — so
|
|
374
|
+
// we deliberately skip them in the structural map. The self-config doctor
|
|
375
|
+
// surfaces broken registration-hint refs via its own check.
|
|
376
|
+
await Promise.resolve();
|
|
377
|
+
void listRegistrationHints;
|
|
378
|
+
try {
|
|
379
|
+
const pair = await loadAllContractTemplates(inspection);
|
|
380
|
+
for (const e of pair.entries) {
|
|
381
|
+
record(ContributionKind.ContractTemplate, e.sourceFile, {
|
|
382
|
+
id: e.template.id,
|
|
383
|
+
...(e.template.title
|
|
384
|
+
? { title: e.template.title }
|
|
385
|
+
: {}),
|
|
386
|
+
source: e.source === 'pack'
|
|
387
|
+
? ContributionSource.Pack
|
|
388
|
+
: ContributionSource.Local,
|
|
389
|
+
...(e.packageName ? { packageName: e.packageName } : {}),
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
catch {
|
|
394
|
+
// ignore
|
|
395
|
+
}
|
|
396
|
+
try {
|
|
397
|
+
const profiles = await listMigrationProfilesFromPacks(inspection);
|
|
398
|
+
for (const p of profiles) {
|
|
399
|
+
record(ContributionKind.MigrationProfile, p.sourceFile, {
|
|
400
|
+
id: p.id,
|
|
401
|
+
...(p.title ? { title: p.title } : {}),
|
|
402
|
+
source: ContributionSource.Pack,
|
|
403
|
+
...(p.packageName ? { packageName: p.packageName } : {}),
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
catch {
|
|
408
|
+
// ignore
|
|
409
|
+
}
|
|
410
|
+
return {
|
|
411
|
+
byKindAndFile: byKindAndFile,
|
|
412
|
+
structuralFiles: structuralFiles,
|
|
413
|
+
structuralIds: structuralIds,
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Build the inventory. Read-only. Never imports pack code beyond the
|
|
418
|
+
* registry loaders that already do.
|
|
419
|
+
*
|
|
420
|
+
* Structural-first extraction. For kinds with a dedicated loader, the
|
|
421
|
+
* inventory uses the loader's authoritative ids and **suppresses the
|
|
422
|
+
* regex fallback** for those same source files. This eliminates the
|
|
423
|
+
* nested-step-id false positives that previously produced duplicate /
|
|
424
|
+
* conflict noise.
|
|
425
|
+
*/
|
|
426
|
+
export function buildPackContributionsInventory(inspection) {
|
|
427
|
+
return buildPackContributionsInventorySync(inspection, null);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Async variant that loads structural per-kind entries first.
|
|
431
|
+
*
|
|
432
|
+
* Production callers should prefer this over the sync wrapper since it
|
|
433
|
+
* provides the noise-free output. The sync wrapper exists for backward
|
|
434
|
+
* compatibility with callers that haven't been awaited yet.
|
|
435
|
+
*/
|
|
436
|
+
export async function buildPackContributionsInventoryAsync(inspection) {
|
|
437
|
+
const structural = await loadStructuralEntries(inspection);
|
|
438
|
+
return buildPackContributionsInventorySync(inspection, structural);
|
|
439
|
+
}
|
|
440
|
+
function buildPackContributionsInventorySync(inspection, structural) {
|
|
441
|
+
const entriesByKind = {};
|
|
442
|
+
const entries = [];
|
|
443
|
+
const fileGroups = buildContribFileEntries(inspection);
|
|
444
|
+
// First, emit structural entries (authoritative ids).
|
|
445
|
+
if (structural) {
|
|
446
|
+
for (const [kindKey, files] of structural.byKindAndFile) {
|
|
447
|
+
for (const [relPath, list] of files) {
|
|
448
|
+
for (const s of list) {
|
|
449
|
+
const entry = {
|
|
450
|
+
kind: kindKey,
|
|
451
|
+
id: s.id,
|
|
452
|
+
...(s.title ? { title: s.title } : {}),
|
|
453
|
+
source: s.source,
|
|
454
|
+
...(s.packageName ? { packageName: s.packageName } : {}),
|
|
455
|
+
sourceFile: relPath,
|
|
456
|
+
validation: 'ok',
|
|
457
|
+
extractionMode: 'structural',
|
|
458
|
+
confidence: 'high',
|
|
459
|
+
};
|
|
460
|
+
(entriesByKind[kindKey] ??= []).push(entry);
|
|
461
|
+
entries.push(entry);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
const ingestFile = (group, file) => {
|
|
467
|
+
const rel = nodePath.relative(inspection.projectRoot, file) || file;
|
|
468
|
+
// Skip regex extraction when the structural loader already covered
|
|
469
|
+
// this (kind, file) pair. Otherwise nested step.id / anchor.id / sub-object
|
|
470
|
+
// ids re-appear as top-level contribution ids, producing duplicate noise.
|
|
471
|
+
const handled = structural?.structuralFiles.get(group.kind)?.has(rel);
|
|
472
|
+
if (handled)
|
|
473
|
+
return;
|
|
474
|
+
const content = safeRead(file);
|
|
475
|
+
if (content === null) {
|
|
476
|
+
const entry = {
|
|
477
|
+
kind: group.kind,
|
|
478
|
+
id: rel,
|
|
479
|
+
source: group.source,
|
|
480
|
+
...(group.packageName ? { packageName: group.packageName } : {}),
|
|
481
|
+
sourceFile: rel,
|
|
482
|
+
validation: 'error',
|
|
483
|
+
validationMessage: 'file unreadable',
|
|
484
|
+
};
|
|
485
|
+
(entriesByKind[group.kind] ??= []).push(entry);
|
|
486
|
+
entries.push(entry);
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const extracted = extractIdsFromFile(content);
|
|
490
|
+
if (extracted.length === 0) {
|
|
491
|
+
const entry = {
|
|
492
|
+
kind: group.kind,
|
|
493
|
+
id: rel,
|
|
494
|
+
source: group.source,
|
|
495
|
+
...(group.packageName ? { packageName: group.packageName } : {}),
|
|
496
|
+
sourceFile: rel,
|
|
497
|
+
validation: 'warning',
|
|
498
|
+
validationMessage: 'no `id:` extracted; loader may still see entries',
|
|
499
|
+
extractionMode: 'file-only',
|
|
500
|
+
confidence: 'low',
|
|
501
|
+
};
|
|
502
|
+
(entriesByKind[group.kind] ??= []).push(entry);
|
|
503
|
+
entries.push(entry);
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
// Skip regex entries whose (kind, packageName||local, id) triple
|
|
507
|
+
// already came in through the structural loader. This dedupes the same
|
|
508
|
+
// logical pack contribution reachable from multiple physical paths
|
|
509
|
+
// (e.g. `node_modules/@example/sharkcraft-pack/...` vs the dev source).
|
|
510
|
+
const idsHandled = structural?.structuralIds.get(group.kind);
|
|
511
|
+
const groupPkg = group.packageName ?? '__local__';
|
|
512
|
+
for (const ex of extracted) {
|
|
513
|
+
if (idsHandled && idsHandled.has(`${groupPkg}:${ex.id}`))
|
|
514
|
+
continue;
|
|
515
|
+
const entry = {
|
|
516
|
+
kind: group.kind,
|
|
517
|
+
id: ex.id,
|
|
518
|
+
...(ex.title ? { title: ex.title } : {}),
|
|
519
|
+
source: group.source,
|
|
520
|
+
...(group.packageName ? { packageName: group.packageName } : {}),
|
|
521
|
+
sourceFile: rel,
|
|
522
|
+
validation: 'ok',
|
|
523
|
+
// Regex-based id extraction can pick up nested step.id / anchor.id /
|
|
524
|
+
// ref.id values. Tag these entries clearly so the conflict detector
|
|
525
|
+
// downgrades same-file collisions to info. The structural loader is
|
|
526
|
+
// preferred where available; this fallback fires only for kinds
|
|
527
|
+
// without a dedicated registry.
|
|
528
|
+
extractionMode: 'regex-fallback',
|
|
529
|
+
confidence: 'medium',
|
|
530
|
+
};
|
|
531
|
+
(entriesByKind[group.kind] ??= []).push(entry);
|
|
532
|
+
entries.push(entry);
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
for (const group of fileGroups) {
|
|
536
|
+
for (const f of group.files)
|
|
537
|
+
ingestFile(group, f);
|
|
538
|
+
}
|
|
539
|
+
const totals = {};
|
|
540
|
+
for (const [kind, list] of Object.entries(entriesByKind))
|
|
541
|
+
totals[kind] = list.length;
|
|
542
|
+
const conflicts = [];
|
|
543
|
+
for (const [kind, list] of Object.entries(entriesByKind)) {
|
|
544
|
+
const byId = new Map();
|
|
545
|
+
for (const e of list) {
|
|
546
|
+
const arr = byId.get(e.id) ?? [];
|
|
547
|
+
arr.push(e);
|
|
548
|
+
byId.set(e.id, arr);
|
|
549
|
+
}
|
|
550
|
+
for (const [id, arr] of byId) {
|
|
551
|
+
if (arr.length < 2)
|
|
552
|
+
continue;
|
|
553
|
+
const sourceVariants = new Set(arr.map((e) => e.source));
|
|
554
|
+
const conflictKind = sourceVariants.size > 1
|
|
555
|
+
? ConflictKind.DuplicateIdDifferentSource
|
|
556
|
+
: ConflictKind.DuplicateIdSameKind;
|
|
557
|
+
// If a local entry shadows a pack entry, mark it as shadowed pack/local
|
|
558
|
+
// (informational; the loader behavior is documented per-kind).
|
|
559
|
+
const hasLocal = arr.some((e) => e.source === ContributionSource.Local);
|
|
560
|
+
const hasPack = arr.some((e) => e.source === ContributionSource.Pack);
|
|
561
|
+
if (hasLocal && hasPack) {
|
|
562
|
+
conflicts.push({
|
|
563
|
+
kind: ConflictKind.ShadowedPackConfig,
|
|
564
|
+
contributionKind: kind,
|
|
565
|
+
id,
|
|
566
|
+
sources: arr.map((e) => {
|
|
567
|
+
const src = {
|
|
568
|
+
source: e.source,
|
|
569
|
+
};
|
|
570
|
+
if (e.packageName)
|
|
571
|
+
src.packageName = e.packageName;
|
|
572
|
+
if (e.sourceFile)
|
|
573
|
+
src.sourceFile = e.sourceFile;
|
|
574
|
+
return src;
|
|
575
|
+
}),
|
|
576
|
+
severity: 'info',
|
|
577
|
+
message: `Local "${kind}" "${id}" shadows pack contribution. Local entries win on duplicate ids.`,
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
// Downgrade conflicts that come from a single source file
|
|
582
|
+
// when ALL participating entries are regex-fallback extractions.
|
|
583
|
+
// These are almost certainly nested `id:` fields (e.g.
|
|
584
|
+
// playbook.steps[].id, pipeline.steps[].id) masquerading as
|
|
585
|
+
// separate top-level contribution ids.
|
|
586
|
+
const allRegexFallback = arr.every((e) => e.extractionMode === 'regex-fallback');
|
|
587
|
+
const sourceFiles = new Set(arr.map((e) => e.sourceFile).filter((s) => Boolean(s)));
|
|
588
|
+
const singleSourceFile = sourceFiles.size === 1;
|
|
589
|
+
const nestedIdFalsePositive = allRegexFallback && singleSourceFile;
|
|
590
|
+
conflicts.push({
|
|
591
|
+
kind: conflictKind,
|
|
592
|
+
contributionKind: kind,
|
|
593
|
+
id,
|
|
594
|
+
sources: arr.map((e) => {
|
|
595
|
+
const src = {
|
|
596
|
+
source: e.source,
|
|
597
|
+
};
|
|
598
|
+
if (e.packageName)
|
|
599
|
+
src.packageName = e.packageName;
|
|
600
|
+
if (e.sourceFile)
|
|
601
|
+
src.sourceFile = e.sourceFile;
|
|
602
|
+
return src;
|
|
603
|
+
}),
|
|
604
|
+
severity: nestedIdFalsePositive ? 'info' : 'error',
|
|
605
|
+
message: nestedIdFalsePositive
|
|
606
|
+
? `${arr.length} "${kind}" entries with id "${id}" extracted from a single source file via regex fallback — likely nested step.id fields, not real top-level duplicates.`
|
|
607
|
+
: `Duplicate "${kind}" id "${id}" loaded from ${arr.length} sources.`,
|
|
608
|
+
nextCommand: `shrk packs contributions --json | jq '.entries[] | select(.id=="${id}" and .kind=="${kind}")'`,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
// Stale-signature warning: surfaced as a conflict so a single doctor view
|
|
614
|
+
// can highlight unsigned-by-secret manifests.
|
|
615
|
+
for (const pack of inspection.packs.validPacks ?? []) {
|
|
616
|
+
const sig = pack.manifest?.signature;
|
|
617
|
+
if (!sig)
|
|
618
|
+
continue;
|
|
619
|
+
// The loader already validates HMAC strictly; we only surface stale
|
|
620
|
+
// when the manifest content has obviously been edited without re-signing.
|
|
621
|
+
// Heuristic: signature timestamp older than any contribution file mtime.
|
|
622
|
+
let staleSummary = null;
|
|
623
|
+
try {
|
|
624
|
+
const sigMs = new Date(sig.signedAt).getTime();
|
|
625
|
+
const contributions = pack.manifest?.contributions ?? {};
|
|
626
|
+
for (const slot of Object.values(KIND_TO_SLOT)) {
|
|
627
|
+
const rels = contributions[slot] ?? [];
|
|
628
|
+
for (const rel of rels) {
|
|
629
|
+
const abs = nodePath.resolve(pack.packageRoot, rel);
|
|
630
|
+
try {
|
|
631
|
+
const stat = statSync(abs);
|
|
632
|
+
if (stat.mtimeMs > sigMs + 1000) {
|
|
633
|
+
staleSummary = `${rel} (mtime ${new Date(stat.mtimeMs).toISOString()}) is newer than signature (${sig.signedAt})`;
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
catch {
|
|
638
|
+
continue;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (staleSummary)
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
catch {
|
|
646
|
+
// ignore
|
|
647
|
+
}
|
|
648
|
+
if (staleSummary) {
|
|
649
|
+
conflicts.push({
|
|
650
|
+
kind: ConflictKind.StaleSignature,
|
|
651
|
+
contributionKind: ContributionKind.Docs,
|
|
652
|
+
id: pack.packageName,
|
|
653
|
+
sources: [{ source: ContributionSource.Pack, packageName: pack.packageName, sourceFile: pack.packageRoot }],
|
|
654
|
+
severity: 'warning',
|
|
655
|
+
message: `Pack ${pack.packageName} signature is stale: ${staleSummary}`,
|
|
656
|
+
nextCommand: `SHARKCRAFT_PACK_SECRET=<secret> shrk packs sign ${nodePath.relative(inspection.projectRoot, pack.packageRoot)}`,
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
return {
|
|
661
|
+
schema: PACK_CONTRIBUTIONS_INVENTORY_SCHEMA,
|
|
662
|
+
generatedAt: new Date().toISOString(),
|
|
663
|
+
projectRoot: inspection.projectRoot,
|
|
664
|
+
entriesByKind,
|
|
665
|
+
totals,
|
|
666
|
+
entries,
|
|
667
|
+
conflicts,
|
|
668
|
+
packs: (inspection.packs.validPacks ?? []).map((p) => ({
|
|
669
|
+
name: p.packageName,
|
|
670
|
+
version: p.packageVersion,
|
|
671
|
+
root: p.packageRoot,
|
|
672
|
+
signaturePresent: Boolean(p.manifest?.signature),
|
|
673
|
+
})),
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
export function renderInventoryText(inv) {
|
|
677
|
+
const lines = [];
|
|
678
|
+
lines.push(`=== Pack contributions inventory (${inv.entries.length} entries) ===`);
|
|
679
|
+
lines.push(` generatedAt ${inv.generatedAt}`);
|
|
680
|
+
lines.push(` packs ${inv.packs.length}`);
|
|
681
|
+
for (const p of inv.packs)
|
|
682
|
+
lines.push(` • ${p.name}@${p.version} (sig: ${p.signaturePresent ? 'present' : 'absent'})`);
|
|
683
|
+
lines.push('');
|
|
684
|
+
lines.push(`By kind:`);
|
|
685
|
+
for (const [k, n] of Object.entries(inv.totals).sort())
|
|
686
|
+
lines.push(` ${k.padEnd(28)} ${n}`);
|
|
687
|
+
lines.push('');
|
|
688
|
+
if (inv.conflicts.length > 0) {
|
|
689
|
+
lines.push(`Conflicts (${inv.conflicts.length}):`);
|
|
690
|
+
for (const c of inv.conflicts.slice(0, 50)) {
|
|
691
|
+
lines.push(` ${c.severity.padEnd(7)} [${c.kind}] ${c.contributionKind} "${c.id}" — ${c.message}`);
|
|
692
|
+
if (c.nextCommand)
|
|
693
|
+
lines.push(` next: ${c.nextCommand}`);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
lines.push('No conflicts detected.');
|
|
698
|
+
}
|
|
699
|
+
return lines.join('\n') + '\n';
|
|
700
|
+
}
|
|
701
|
+
export function renderInventoryMarkdown(inv) {
|
|
702
|
+
const lines = [];
|
|
703
|
+
lines.push('# Pack contributions inventory');
|
|
704
|
+
lines.push('');
|
|
705
|
+
lines.push(`- generatedAt: ${inv.generatedAt}`);
|
|
706
|
+
lines.push(`- packs: ${inv.packs.length}`);
|
|
707
|
+
for (const p of inv.packs) {
|
|
708
|
+
lines.push(` - **${p.name}** \`${p.version}\` (signature ${p.signaturePresent ? 'present' : 'absent'})`);
|
|
709
|
+
}
|
|
710
|
+
lines.push('');
|
|
711
|
+
lines.push('## By kind');
|
|
712
|
+
lines.push('| Kind | Count |');
|
|
713
|
+
lines.push('| --- | --- |');
|
|
714
|
+
for (const [k, n] of Object.entries(inv.totals).sort())
|
|
715
|
+
lines.push(`| \`${k}\` | ${n} |`);
|
|
716
|
+
lines.push('');
|
|
717
|
+
lines.push('## Conflicts');
|
|
718
|
+
if (inv.conflicts.length === 0) {
|
|
719
|
+
lines.push('None.');
|
|
720
|
+
}
|
|
721
|
+
else {
|
|
722
|
+
lines.push('| Severity | Kind | Contribution | Id | Message |');
|
|
723
|
+
lines.push('| --- | --- | --- | --- | --- |');
|
|
724
|
+
for (const c of inv.conflicts) {
|
|
725
|
+
lines.push(`| ${c.severity} | \`${c.kind}\` | \`${c.contributionKind}\` | \`${c.id}\` | ${c.message} |`);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return lines.join('\n') + '\n';
|
|
729
|
+
}
|
|
730
|
+
export function selectConflicts(inv) {
|
|
731
|
+
return inv.conflicts;
|
|
732
|
+
}
|