@shrkcrft/inspector 0.1.0-alpha.2
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 +43 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +197 -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 +201 -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 +26 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +110 -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 +413 -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 +223 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +233 -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.d.ts +28 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +234 -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 +60 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +371 -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 +71 -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 +66 -0
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { scanImports, loadTsconfigPaths } from '@shrkcrft/boundaries';
|
|
4
|
+
import { AreaKind, buildAreaMap } from "./area-map.js";
|
|
5
|
+
import { rankAll } from "./task-ranker.js";
|
|
6
|
+
import { loadOwnershipRules, impactFor } from "./ownership.js";
|
|
7
|
+
export const IMPACT_ANALYSIS_SCHEMA = 'sharkcraft.impact-analysis/v2';
|
|
8
|
+
export var ImpactRisk;
|
|
9
|
+
(function (ImpactRisk) {
|
|
10
|
+
ImpactRisk["Low"] = "low";
|
|
11
|
+
ImpactRisk["Medium"] = "medium";
|
|
12
|
+
ImpactRisk["High"] = "high";
|
|
13
|
+
ImpactRisk["Critical"] = "critical";
|
|
14
|
+
})(ImpactRisk || (ImpactRisk = {}));
|
|
15
|
+
export var ImpactInputKind;
|
|
16
|
+
(function (ImpactInputKind) {
|
|
17
|
+
ImpactInputKind["File"] = "file";
|
|
18
|
+
ImpactInputKind["Files"] = "files";
|
|
19
|
+
ImpactInputKind["Specifier"] = "specifier";
|
|
20
|
+
ImpactInputKind["Since"] = "since";
|
|
21
|
+
ImpactInputKind["Staged"] = "staged";
|
|
22
|
+
ImpactInputKind["Plan"] = "plan";
|
|
23
|
+
ImpactInputKind["Bundle"] = "bundle";
|
|
24
|
+
ImpactInputKind["Task"] = "task";
|
|
25
|
+
ImpactInputKind["Mixed"] = "mixed";
|
|
26
|
+
ImpactInputKind["Empty"] = "empty";
|
|
27
|
+
})(ImpactInputKind || (ImpactInputKind = {}));
|
|
28
|
+
const DEFAULT_MAX_DEPTH = 5;
|
|
29
|
+
const DEFAULT_LIMIT = 200;
|
|
30
|
+
function unique(xs) {
|
|
31
|
+
return [...new Set(xs)];
|
|
32
|
+
}
|
|
33
|
+
function inferInputKind(input) {
|
|
34
|
+
if (input.inputKind)
|
|
35
|
+
return input.inputKind;
|
|
36
|
+
if (input.specifier)
|
|
37
|
+
return ImpactInputKind.Specifier;
|
|
38
|
+
if (input.planTargets && input.planTargets.length > 0 && (!input.files || input.files.length === 0)) {
|
|
39
|
+
return ImpactInputKind.Plan;
|
|
40
|
+
}
|
|
41
|
+
if (input.files && input.files.length > 0)
|
|
42
|
+
return ImpactInputKind.Files;
|
|
43
|
+
if (input.task)
|
|
44
|
+
return ImpactInputKind.Task;
|
|
45
|
+
return ImpactInputKind.Empty;
|
|
46
|
+
}
|
|
47
|
+
function normalizeRel(projectRoot, p) {
|
|
48
|
+
if (!p)
|
|
49
|
+
return p;
|
|
50
|
+
if (nodePath.isAbsolute(p)) {
|
|
51
|
+
const rel = nodePath.relative(projectRoot, p);
|
|
52
|
+
return rel.split(nodePath.sep).join('/');
|
|
53
|
+
}
|
|
54
|
+
// Strip leading ./ noise.
|
|
55
|
+
return p.replace(/^\.\/?/, '').split(nodePath.sep).join('/');
|
|
56
|
+
}
|
|
57
|
+
function buildReverseGraph(projectRoot) {
|
|
58
|
+
let scan;
|
|
59
|
+
try {
|
|
60
|
+
scan = scanImports({ projectRoot });
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return { importers: new Map(), edgeCount: 0, aliasMap: new Map() };
|
|
64
|
+
}
|
|
65
|
+
let aliasMap;
|
|
66
|
+
try {
|
|
67
|
+
aliasMap = loadTsconfigPaths(projectRoot).aliases;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
aliasMap = new Map();
|
|
71
|
+
}
|
|
72
|
+
const importers = new Map();
|
|
73
|
+
for (const e of scan.edges) {
|
|
74
|
+
const targets = resolveTargets(projectRoot, e.from, e.importSpecifier, aliasMap);
|
|
75
|
+
for (const t of targets) {
|
|
76
|
+
const set = importers.get(t) ?? new Set();
|
|
77
|
+
set.add(e.from);
|
|
78
|
+
importers.set(t, set);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { importers, edgeCount: scan.edges.length, aliasMap };
|
|
82
|
+
}
|
|
83
|
+
function resolveTargets(projectRoot, from, spec, aliasMap) {
|
|
84
|
+
const out = [];
|
|
85
|
+
if (spec.startsWith('.')) {
|
|
86
|
+
const dir = nodePath.posix.dirname(from);
|
|
87
|
+
const joined = nodePath.posix.normalize(nodePath.posix.join(dir, spec));
|
|
88
|
+
out.push(joined);
|
|
89
|
+
out.push(joined + '.ts');
|
|
90
|
+
out.push(joined + '.tsx');
|
|
91
|
+
out.push(joined + '/index.ts');
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
for (const [pattern, paths] of aliasMap.entries()) {
|
|
95
|
+
if (pattern.endsWith('*')) {
|
|
96
|
+
const prefix = pattern.slice(0, -1);
|
|
97
|
+
if (!spec.startsWith(prefix))
|
|
98
|
+
continue;
|
|
99
|
+
const rest = spec.slice(prefix.length);
|
|
100
|
+
for (const targetPattern of paths) {
|
|
101
|
+
const resolved = targetPattern.replace(/\*/g, rest);
|
|
102
|
+
out.push(resolved);
|
|
103
|
+
out.push(resolved + '.ts');
|
|
104
|
+
out.push(resolved + '.tsx');
|
|
105
|
+
out.push(resolved + '/index.ts');
|
|
106
|
+
}
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (pattern === spec) {
|
|
110
|
+
for (const t of paths) {
|
|
111
|
+
out.push(t);
|
|
112
|
+
out.push(t + '.ts');
|
|
113
|
+
out.push(t + '.tsx');
|
|
114
|
+
out.push(t + '/index.ts');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
function matchTargetsBySpecifier(spec, aliasMap) {
|
|
121
|
+
// Returns possible files the specifier could resolve to, regardless of
|
|
122
|
+
// the importing file. Used by --specifier.
|
|
123
|
+
if (spec.startsWith('.'))
|
|
124
|
+
return [];
|
|
125
|
+
const out = [];
|
|
126
|
+
for (const [pattern, paths] of aliasMap.entries()) {
|
|
127
|
+
if (pattern.endsWith('*')) {
|
|
128
|
+
const prefix = pattern.slice(0, -1);
|
|
129
|
+
if (!spec.startsWith(prefix))
|
|
130
|
+
continue;
|
|
131
|
+
const rest = spec.slice(prefix.length);
|
|
132
|
+
for (const targetPattern of paths) {
|
|
133
|
+
const resolved = targetPattern.replace(/\*/g, rest);
|
|
134
|
+
out.push(resolved);
|
|
135
|
+
out.push(resolved + '.ts');
|
|
136
|
+
out.push(resolved + '/index.ts');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else if (pattern === spec) {
|
|
140
|
+
for (const t of paths) {
|
|
141
|
+
out.push(t);
|
|
142
|
+
out.push(t + '.ts');
|
|
143
|
+
out.push(t + '/index.ts');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
149
|
+
function closeDependents(reverse, seeds, maxDepth) {
|
|
150
|
+
const direct = new Set();
|
|
151
|
+
const all = new Set();
|
|
152
|
+
const paths = [];
|
|
153
|
+
const visited = new Map();
|
|
154
|
+
// BFS from each seed.
|
|
155
|
+
for (const seed of seeds) {
|
|
156
|
+
const queue = [
|
|
157
|
+
{ node: seed, depth: 0, via: [], root: seed },
|
|
158
|
+
];
|
|
159
|
+
const seenLocal = new Set([seed]);
|
|
160
|
+
while (queue.length > 0) {
|
|
161
|
+
const cur = queue.shift();
|
|
162
|
+
const importers = reverse.importers.get(cur.node);
|
|
163
|
+
if (!importers)
|
|
164
|
+
continue;
|
|
165
|
+
for (const importer of importers) {
|
|
166
|
+
if (cur.depth === 0)
|
|
167
|
+
direct.add(importer);
|
|
168
|
+
all.add(importer);
|
|
169
|
+
if (paths.length < 25 && cur.via.length < 4) {
|
|
170
|
+
paths.push({
|
|
171
|
+
from: importer,
|
|
172
|
+
to: cur.root,
|
|
173
|
+
via: [...cur.via, cur.node],
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const prevDepth = visited.get(importer);
|
|
177
|
+
if (prevDepth !== undefined && prevDepth <= cur.depth + 1)
|
|
178
|
+
continue;
|
|
179
|
+
visited.set(importer, cur.depth + 1);
|
|
180
|
+
if (cur.depth + 1 >= maxDepth)
|
|
181
|
+
continue;
|
|
182
|
+
if (seenLocal.has(importer))
|
|
183
|
+
continue;
|
|
184
|
+
seenLocal.add(importer);
|
|
185
|
+
queue.push({
|
|
186
|
+
node: importer,
|
|
187
|
+
depth: cur.depth + 1,
|
|
188
|
+
via: [...cur.via, cur.node],
|
|
189
|
+
root: cur.root,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return { direct: [...direct].sort(), transitive: [...all].sort(), paths };
|
|
195
|
+
}
|
|
196
|
+
function detectWorkspaces(ctx) {
|
|
197
|
+
const pkgPath = nodePath.join(ctx.inspection.projectRoot, 'package.json');
|
|
198
|
+
if (!existsSync(pkgPath))
|
|
199
|
+
return [];
|
|
200
|
+
let workspaces = [];
|
|
201
|
+
try {
|
|
202
|
+
const json = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
203
|
+
if (Array.isArray(json.workspaces))
|
|
204
|
+
workspaces = [...json.workspaces];
|
|
205
|
+
else
|
|
206
|
+
workspaces =
|
|
207
|
+
json.workspaces?.packages?.slice() ??
|
|
208
|
+
[];
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
return [];
|
|
212
|
+
}
|
|
213
|
+
const out = new Map();
|
|
214
|
+
for (const w of workspaces) {
|
|
215
|
+
const dir = w.replace(/\/\*?$/, '');
|
|
216
|
+
for (const f of ctx.files) {
|
|
217
|
+
if (!f.startsWith(dir + '/'))
|
|
218
|
+
continue;
|
|
219
|
+
const rest = f.slice(dir.length + 1);
|
|
220
|
+
const pkgName = rest.split('/')[0];
|
|
221
|
+
if (!pkgName)
|
|
222
|
+
continue;
|
|
223
|
+
const pkgFile = nodePath.join(ctx.inspection.projectRoot, dir, pkgName, 'package.json');
|
|
224
|
+
if (!existsSync(pkgFile))
|
|
225
|
+
continue;
|
|
226
|
+
const key = `${dir}/${pkgName}`;
|
|
227
|
+
const existing = out.get(key);
|
|
228
|
+
let name = pkgName;
|
|
229
|
+
try {
|
|
230
|
+
name =
|
|
231
|
+
JSON.parse(readFileSync(pkgFile, 'utf8')).name ?? pkgName;
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
/* ignore */
|
|
235
|
+
}
|
|
236
|
+
if (existing) {
|
|
237
|
+
existing.fileCount += 1;
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
out.set(key, { name, directory: key, fileCount: 1 });
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return [...out.values()].sort((a, b) => b.fileCount - a.fileCount);
|
|
245
|
+
}
|
|
246
|
+
function affectedAreaSummary(ctx) {
|
|
247
|
+
const allTouched = unique([...ctx.files]);
|
|
248
|
+
const out = new Map();
|
|
249
|
+
for (const a of ctx.areaMap.areas) {
|
|
250
|
+
const hitCount = allTouched.filter((f) => a.paths.some((p) => f === p || f.startsWith(p + '/') || f.startsWith(p))).length;
|
|
251
|
+
if (hitCount > 0) {
|
|
252
|
+
out.set(a.id, { id: a.id, kind: a.kind, fileCount: hitCount });
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return [...out.values()].sort((a, b) => b.fileCount - a.fileCount);
|
|
256
|
+
}
|
|
257
|
+
function boundaryRisks(ctx, affected) {
|
|
258
|
+
const risks = [];
|
|
259
|
+
const seen = new Set();
|
|
260
|
+
for (const a of affected) {
|
|
261
|
+
const area = ctx.areaMap.areas.find((x) => x.id === a.id);
|
|
262
|
+
if (!area)
|
|
263
|
+
continue;
|
|
264
|
+
for (const ruleId of area.boundaryRuleIds) {
|
|
265
|
+
const rule = ctx.inspection.boundaryRegistry.get(ruleId);
|
|
266
|
+
if (!rule)
|
|
267
|
+
continue;
|
|
268
|
+
const key = `${a.id}:${ruleId}`;
|
|
269
|
+
if (seen.has(key))
|
|
270
|
+
continue;
|
|
271
|
+
seen.add(key);
|
|
272
|
+
risks.push({
|
|
273
|
+
ruleId,
|
|
274
|
+
reason: `Affects area ${a.id}; rule ${ruleId} guards that area.`,
|
|
275
|
+
severity: (rule.severity ?? 'warning'),
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return risks;
|
|
280
|
+
}
|
|
281
|
+
function affectedTemplates(ctx) {
|
|
282
|
+
const out = [];
|
|
283
|
+
const seen = new Set();
|
|
284
|
+
for (const t of ctx.inspection.templateRegistry.list()) {
|
|
285
|
+
const tp = t.targetPath;
|
|
286
|
+
const path = typeof tp === 'string' ? tp : '';
|
|
287
|
+
if (!path)
|
|
288
|
+
continue;
|
|
289
|
+
if (ctx.files.some((f) => f.includes(path) || path.includes(f.split('/').pop() ?? ''))) {
|
|
290
|
+
if (seen.has(t.id))
|
|
291
|
+
continue;
|
|
292
|
+
seen.add(t.id);
|
|
293
|
+
out.push({ id: t.id, name: t.name });
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return out;
|
|
297
|
+
}
|
|
298
|
+
function affectedPipelines(ctx) {
|
|
299
|
+
const out = [];
|
|
300
|
+
for (const p of ctx.inspection.pipelineRegistry.list()) {
|
|
301
|
+
const stepsString = JSON.stringify(p.steps ?? []).toLowerCase();
|
|
302
|
+
if (ctx.files.some((f) => stepsString.includes(f.toLowerCase()))) {
|
|
303
|
+
out.push({ id: p.id, title: p.title ?? p.id });
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return out;
|
|
307
|
+
}
|
|
308
|
+
function affectedPresets(ctx) {
|
|
309
|
+
const out = [];
|
|
310
|
+
try {
|
|
311
|
+
const presets = ctx.inspection.presetRegistry.list();
|
|
312
|
+
for (const p of presets) {
|
|
313
|
+
if (!p.id)
|
|
314
|
+
continue;
|
|
315
|
+
const blob = JSON.stringify(p).toLowerCase();
|
|
316
|
+
if (ctx.files.some((f) => blob.includes(f.toLowerCase().split('/').pop() ?? ''))) {
|
|
317
|
+
out.push({ id: p.id, name: p.name ?? p.id });
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
/* ignore */
|
|
323
|
+
}
|
|
324
|
+
return out;
|
|
325
|
+
}
|
|
326
|
+
function affectedConstructs(ctx) {
|
|
327
|
+
// Constructs come from the project's construct registry (loaded at inspection time).
|
|
328
|
+
// We probe the inspection object for an optional `constructs` field.
|
|
329
|
+
const list = ctx.inspection.constructs;
|
|
330
|
+
if (!list)
|
|
331
|
+
return [];
|
|
332
|
+
const out = [];
|
|
333
|
+
const allTouched = new Set(ctx.files);
|
|
334
|
+
for (const c of list) {
|
|
335
|
+
const cf = c.files ?? [];
|
|
336
|
+
if (cf.some((f) => allTouched.has(f) || ctx.files.some((tf) => tf.startsWith(f) || f.startsWith(tf)))) {
|
|
337
|
+
out.push({ id: c.id, type: c.type, title: c.title });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return out;
|
|
341
|
+
}
|
|
342
|
+
function affectedPolicies(ctx, affected, boundary) {
|
|
343
|
+
// Lightweight: surface policies whose ids hint at boundaries / public-api / ownership
|
|
344
|
+
// when those domains are in play. The full policy run is a separate command.
|
|
345
|
+
const concerns = [];
|
|
346
|
+
const hasPublicApi = ctx.files.some((f) => f.includes('index.ts') || f.includes('plugin-api') || f.includes('public-api'));
|
|
347
|
+
const touchesPolicy = ctx.files.some((f) => f.includes('policy') || f.includes('policy-engine'));
|
|
348
|
+
if (boundary.length > 0) {
|
|
349
|
+
concerns.push({
|
|
350
|
+
policyId: 'policy.boundary-impact',
|
|
351
|
+
reason: 'Touches files governed by boundary rules; run `shrk policy run`.',
|
|
352
|
+
severity: 'warning',
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (hasPublicApi) {
|
|
356
|
+
concerns.push({
|
|
357
|
+
policyId: 'plugin-api.public-entrypoint',
|
|
358
|
+
reason: 'Touches a public entrypoint; downstream consumers may be affected.',
|
|
359
|
+
severity: 'warning',
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
if (touchesPolicy) {
|
|
363
|
+
concerns.push({
|
|
364
|
+
policyId: 'policy.engine',
|
|
365
|
+
reason: 'Modifies the policy engine itself; run policy tests with fixtures.',
|
|
366
|
+
severity: 'warning',
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
if (affected.some((a) => a.kind === AreaKind.Core || a.kind === AreaKind.Kernel)) {
|
|
370
|
+
concerns.push({
|
|
371
|
+
policyId: 'core.protected-area',
|
|
372
|
+
reason: 'Core / kernel area touched; requires elevated review.',
|
|
373
|
+
severity: 'error',
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
return concerns;
|
|
377
|
+
}
|
|
378
|
+
async function ownershipImpactFor(ctx) {
|
|
379
|
+
try {
|
|
380
|
+
const cfg = ctx.inspection.config;
|
|
381
|
+
const sources = cfg?.ownership?.sources;
|
|
382
|
+
const { rules } = await loadOwnershipRules(ctx.inspection.projectRoot, sources);
|
|
383
|
+
if (rules.length === 0)
|
|
384
|
+
return null;
|
|
385
|
+
return impactFor(ctx.files, rules);
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function pathConventionsTouched(ctx) {
|
|
392
|
+
const out = new Set();
|
|
393
|
+
const list = ctx.inspection.pathService.list();
|
|
394
|
+
for (const p of list) {
|
|
395
|
+
const meta = (p.metadata ?? {});
|
|
396
|
+
const segment = (meta.path ?? p.id ?? '').replace(/\*+/g, '');
|
|
397
|
+
if (!segment)
|
|
398
|
+
continue;
|
|
399
|
+
if (ctx.files.some((f) => f.includes(segment)))
|
|
400
|
+
out.add(p.id);
|
|
401
|
+
}
|
|
402
|
+
return [...out].sort();
|
|
403
|
+
}
|
|
404
|
+
function classifyRisk(input) {
|
|
405
|
+
const reasons = [];
|
|
406
|
+
let score = 0;
|
|
407
|
+
if (input.directCount === 0 && input.transitiveCount === 0) {
|
|
408
|
+
reasons.push({ code: 'no-dependents', message: 'No dependents detected.' });
|
|
409
|
+
}
|
|
410
|
+
if (input.directCount > 5) {
|
|
411
|
+
score += 10;
|
|
412
|
+
reasons.push({
|
|
413
|
+
code: 'many-direct-dependents',
|
|
414
|
+
message: `${input.directCount} direct dependents.`,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
else if (input.directCount > 0) {
|
|
418
|
+
score += 4;
|
|
419
|
+
reasons.push({
|
|
420
|
+
code: 'direct-dependents',
|
|
421
|
+
message: `${input.directCount} direct dependents.`,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
if (input.transitiveCount > 25) {
|
|
425
|
+
score += 18;
|
|
426
|
+
reasons.push({
|
|
427
|
+
code: 'large-transitive-closure',
|
|
428
|
+
message: `${input.transitiveCount} transitive dependents.`,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
else if (input.transitiveCount > 10) {
|
|
432
|
+
score += 10;
|
|
433
|
+
}
|
|
434
|
+
if (input.publicApi) {
|
|
435
|
+
score += 15;
|
|
436
|
+
reasons.push({
|
|
437
|
+
code: 'public-api',
|
|
438
|
+
message: 'Touches a public-API entry-point or re-export.',
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
if (input.hitsCore) {
|
|
442
|
+
score += 18;
|
|
443
|
+
reasons.push({
|
|
444
|
+
code: 'core-area',
|
|
445
|
+
message: 'Touches core / kernel area.',
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
if (input.boundaryCount > 0) {
|
|
449
|
+
score += 10;
|
|
450
|
+
reasons.push({
|
|
451
|
+
code: 'boundary-rules',
|
|
452
|
+
message: `${input.boundaryCount} boundary rule(s) potentially impacted.`,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
if (input.packCount > 1) {
|
|
456
|
+
score += 6;
|
|
457
|
+
reasons.push({
|
|
458
|
+
code: 'cross-package',
|
|
459
|
+
message: `Spans ${input.packCount} workspace packages.`,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
if (input.ownershipReview) {
|
|
463
|
+
score += 8;
|
|
464
|
+
reasons.push({
|
|
465
|
+
code: 'ownership-review',
|
|
466
|
+
message: 'Affects ownership-protected files; reviewer required.',
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
if (input.missingTests) {
|
|
470
|
+
score += 6;
|
|
471
|
+
reasons.push({
|
|
472
|
+
code: 'missing-tests',
|
|
473
|
+
message: 'Some target files have no co-located tests.',
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
if (input.hitsPolicy) {
|
|
477
|
+
score += 10;
|
|
478
|
+
reasons.push({
|
|
479
|
+
code: 'policy-impact',
|
|
480
|
+
message: 'Policy-engine surface or policy-governed area touched.',
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
if (input.hitsTemplates) {
|
|
484
|
+
score += 4;
|
|
485
|
+
reasons.push({
|
|
486
|
+
code: 'template-impact',
|
|
487
|
+
message: 'Templates / pipelines reference these paths.',
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
if (input.affectedAreaCount > 4) {
|
|
491
|
+
score += 6;
|
|
492
|
+
reasons.push({
|
|
493
|
+
code: 'spans-areas',
|
|
494
|
+
message: `Spans ${input.affectedAreaCount} repo areas.`,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
let risk = ImpactRisk.Low;
|
|
498
|
+
if (score >= 35)
|
|
499
|
+
risk = ImpactRisk.Critical;
|
|
500
|
+
else if (score >= 22)
|
|
501
|
+
risk = ImpactRisk.High;
|
|
502
|
+
else if (score >= 10)
|
|
503
|
+
risk = ImpactRisk.Medium;
|
|
504
|
+
return { risk, reasons };
|
|
505
|
+
}
|
|
506
|
+
function findLikelyTests(projectRoot, files) {
|
|
507
|
+
const existing = new Set();
|
|
508
|
+
const missing = [];
|
|
509
|
+
for (const f of files) {
|
|
510
|
+
if (/\.(spec|test)\.[jt]sx?$/.test(f)) {
|
|
511
|
+
existing.add(f);
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
if (!/\.(ts|tsx|js|jsx)$/.test(f))
|
|
515
|
+
continue;
|
|
516
|
+
const candidates = [
|
|
517
|
+
f.replace(/\.(ts|tsx|js|jsx)$/, '.spec.$1'),
|
|
518
|
+
f.replace(/\.(ts|tsx|js|jsx)$/, '.test.$1'),
|
|
519
|
+
f.replace(/^src\//, 'tests/').replace(/\.(ts|tsx|js|jsx)$/, '.spec.$1'),
|
|
520
|
+
(() => {
|
|
521
|
+
const parsed = nodePath.parse(f);
|
|
522
|
+
return nodePath.join(parsed.dir, '__tests__', `${parsed.name}.test${parsed.ext}`);
|
|
523
|
+
})(),
|
|
524
|
+
];
|
|
525
|
+
let anyExists = false;
|
|
526
|
+
for (const c of candidates) {
|
|
527
|
+
if (existsSync(nodePath.join(projectRoot, c))) {
|
|
528
|
+
existing.add(c);
|
|
529
|
+
anyExists = true;
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
if (!anyExists)
|
|
534
|
+
missing.push(candidates[0]);
|
|
535
|
+
}
|
|
536
|
+
return { existing: [...existing].sort(), missing };
|
|
537
|
+
}
|
|
538
|
+
export async function analyzeImpact(inspection, input) {
|
|
539
|
+
const maxDepth = input.maxDepth ?? DEFAULT_MAX_DEPTH;
|
|
540
|
+
const limit = input.limit ?? DEFAULT_LIMIT;
|
|
541
|
+
const inputKind = inferInputKind(input);
|
|
542
|
+
const areaMap = input.areaMap ?? buildAreaMap(inspection);
|
|
543
|
+
const explicitFiles = (input.files ?? []).map((f) => normalizeRel(inspection.projectRoot, f));
|
|
544
|
+
const planTargets = (input.planTargets ?? []).map((f) => normalizeRel(inspection.projectRoot, f));
|
|
545
|
+
const reverse = buildReverseGraph(inspection.projectRoot);
|
|
546
|
+
// Resolve specifier to a candidate file set, if applicable.
|
|
547
|
+
let specifierTargets = [];
|
|
548
|
+
if (input.specifier) {
|
|
549
|
+
specifierTargets = matchTargetsBySpecifier(input.specifier, reverse.aliasMap)
|
|
550
|
+
.filter((f) => existsSync(nodePath.join(inspection.projectRoot, f)))
|
|
551
|
+
.map((f) => normalizeRel(inspection.projectRoot, f));
|
|
552
|
+
}
|
|
553
|
+
const files = unique([...explicitFiles, ...planTargets, ...specifierTargets]);
|
|
554
|
+
const task = (input.task ?? '').trim() || files.join(' ') || (input.specifier ?? '');
|
|
555
|
+
const ctx = {
|
|
556
|
+
inspection,
|
|
557
|
+
files,
|
|
558
|
+
inputKind,
|
|
559
|
+
task,
|
|
560
|
+
...(input.specifier ? { specifier: input.specifier } : {}),
|
|
561
|
+
maxDepth,
|
|
562
|
+
limit,
|
|
563
|
+
areaMap,
|
|
564
|
+
};
|
|
565
|
+
const { direct, transitive, paths } = closeDependents(reverse, files, maxDepth);
|
|
566
|
+
const directDependents = direct.slice(0, limit);
|
|
567
|
+
const transitiveDependents = transitive.slice(0, limit);
|
|
568
|
+
// Expand context with dependents for area / boundary / policy computation.
|
|
569
|
+
const expandedFiles = unique([...files, ...directDependents.slice(0, 50), ...transitiveDependents.slice(0, 50)]);
|
|
570
|
+
const expandedCtx = { ...ctx, files: expandedFiles };
|
|
571
|
+
const affectedAreas = affectedAreaSummary(expandedCtx);
|
|
572
|
+
const affectedPackages = detectWorkspaces(expandedCtx);
|
|
573
|
+
const pathConventions = pathConventionsTouched(expandedCtx);
|
|
574
|
+
const boundaryConcerns = boundaryRisks(expandedCtx, affectedAreas);
|
|
575
|
+
const policyConcerns = affectedPolicies(expandedCtx, affectedAreas, boundaryConcerns);
|
|
576
|
+
const ownership = await ownershipImpactFor(expandedCtx);
|
|
577
|
+
const templates = affectedTemplates(expandedCtx);
|
|
578
|
+
const pipelines = affectedPipelines(expandedCtx);
|
|
579
|
+
const presets = affectedPresets(expandedCtx);
|
|
580
|
+
const constructs = affectedConstructs(expandedCtx);
|
|
581
|
+
const { existing: likelyTests, missing: missingTests } = findLikelyTests(inspection.projectRoot, files);
|
|
582
|
+
// Per-target test suggestion (minimal commands).
|
|
583
|
+
const suggestedTestCommands = unique([
|
|
584
|
+
...(likelyTests.length > 0 ? [`bun test ${likelyTests.slice(0, 6).join(' ')}`] : []),
|
|
585
|
+
'bun test',
|
|
586
|
+
]);
|
|
587
|
+
const suggestedFullTestCommands = unique([
|
|
588
|
+
'bun test',
|
|
589
|
+
'bun x tsc -p tsconfig.base.json --noEmit',
|
|
590
|
+
]);
|
|
591
|
+
const suggestedValidationCommands = unique([
|
|
592
|
+
'shrk check boundaries',
|
|
593
|
+
'shrk policy run',
|
|
594
|
+
'bun x tsc -p tsconfig.base.json --noEmit',
|
|
595
|
+
'bun test',
|
|
596
|
+
]);
|
|
597
|
+
const suggestedReviewCommands = unique([
|
|
598
|
+
'shrk review packet --v3',
|
|
599
|
+
'shrk impact ' + files.slice(0, 3).join(','),
|
|
600
|
+
'shrk owners impact --files ' + files.slice(0, 3).join(','),
|
|
601
|
+
]);
|
|
602
|
+
const ranking = rankAll(inspection, task || files.join(' '), 6);
|
|
603
|
+
const relatedRules = ranking.rules.slice(0, 5).map((r) => ({
|
|
604
|
+
id: r.item.id,
|
|
605
|
+
title: r.item.title,
|
|
606
|
+
}));
|
|
607
|
+
const relatedTemplates = ranking.templates.slice(0, 5).map((t) => ({
|
|
608
|
+
id: t.item.id,
|
|
609
|
+
name: t.item.name,
|
|
610
|
+
}));
|
|
611
|
+
const publicApi = files.some((f) => f.endsWith('/index.ts') ||
|
|
612
|
+
f.endsWith('main.ts') ||
|
|
613
|
+
f.includes('plugin-api/') ||
|
|
614
|
+
f.includes('public-api/'));
|
|
615
|
+
const hitsCore = affectedAreas.some((a) => a.kind === AreaKind.Core || a.kind === AreaKind.Kernel || a.kind === AreaKind.Common);
|
|
616
|
+
const hitsPolicy = files.some((f) => f.includes('policy') || f.includes('policy-engine'));
|
|
617
|
+
const hitsTemplates = templates.length > 0 || pipelines.length > 0;
|
|
618
|
+
const ownershipReview = (ownership?.requiredReviewFiles.length ?? 0) > 0;
|
|
619
|
+
const { risk, reasons: riskReasons } = classifyRisk({
|
|
620
|
+
directCount: direct.length,
|
|
621
|
+
transitiveCount: transitive.length,
|
|
622
|
+
boundaryCount: boundaryConcerns.length,
|
|
623
|
+
affectedAreaCount: affectedAreas.length,
|
|
624
|
+
publicApi,
|
|
625
|
+
packCount: affectedPackages.length,
|
|
626
|
+
ownershipReview,
|
|
627
|
+
missingTests: missingTests.length > 0,
|
|
628
|
+
hitsCore,
|
|
629
|
+
hitsPolicy,
|
|
630
|
+
hitsTemplates,
|
|
631
|
+
});
|
|
632
|
+
const truncations = [];
|
|
633
|
+
if (direct.length > limit) {
|
|
634
|
+
truncations.push({ list: 'directDependents', total: direct.length, shown: limit });
|
|
635
|
+
}
|
|
636
|
+
if (transitive.length > limit) {
|
|
637
|
+
truncations.push({
|
|
638
|
+
list: 'transitiveDependents',
|
|
639
|
+
total: transitive.length,
|
|
640
|
+
shown: limit,
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
if (paths.length > 25) {
|
|
644
|
+
truncations.push({ list: 'dependencyPathExamples', total: paths.length, shown: 25 });
|
|
645
|
+
}
|
|
646
|
+
const explanation = buildExplanation(risk, direct.length, transitive.length, boundaryConcerns.length, affectedAreas.length);
|
|
647
|
+
const diagnostics = [];
|
|
648
|
+
if (reverse.edgeCount === 0) {
|
|
649
|
+
diagnostics.push('Import-graph scan returned no edges — reverse closure unavailable.');
|
|
650
|
+
}
|
|
651
|
+
if (files.length === 0) {
|
|
652
|
+
diagnostics.push('No target files derived from input.');
|
|
653
|
+
}
|
|
654
|
+
const result = {
|
|
655
|
+
schema: IMPACT_ANALYSIS_SCHEMA,
|
|
656
|
+
task,
|
|
657
|
+
inputKind,
|
|
658
|
+
normalizedTargets: files,
|
|
659
|
+
affectedFiles: files,
|
|
660
|
+
directDependents,
|
|
661
|
+
transitiveDependents,
|
|
662
|
+
dependencyPathExamples: paths.slice(0, 25),
|
|
663
|
+
affectedAreas,
|
|
664
|
+
affectedPackages,
|
|
665
|
+
affectedPathConventions: pathConventions,
|
|
666
|
+
potentialBoundaryRisks: boundaryConcerns,
|
|
667
|
+
affectedPolicies: policyConcerns,
|
|
668
|
+
affectedOwnership: ownership,
|
|
669
|
+
affectedTemplates: templates,
|
|
670
|
+
affectedPipelines: pipelines,
|
|
671
|
+
affectedPresets: presets,
|
|
672
|
+
affectedConstructs: constructs,
|
|
673
|
+
likelyTests,
|
|
674
|
+
suggestedTestCommands,
|
|
675
|
+
suggestedFullTestCommands,
|
|
676
|
+
suggestedValidationCommands,
|
|
677
|
+
suggestedReviewCommands,
|
|
678
|
+
relatedRules,
|
|
679
|
+
relatedTemplates,
|
|
680
|
+
risk,
|
|
681
|
+
riskReasons,
|
|
682
|
+
explanation,
|
|
683
|
+
truncations,
|
|
684
|
+
diagnostics,
|
|
685
|
+
};
|
|
686
|
+
if (input.specifier) {
|
|
687
|
+
result.specifier = input.specifier;
|
|
688
|
+
}
|
|
689
|
+
return result;
|
|
690
|
+
}
|
|
691
|
+
function buildExplanation(risk, directCount, transitiveCount, boundaryCount, areaCount) {
|
|
692
|
+
return [
|
|
693
|
+
`Risk: ${risk}.`,
|
|
694
|
+
`${directCount} direct + ${transitiveCount} transitive dependent(s);`,
|
|
695
|
+
`${areaCount} area(s); ${boundaryCount} boundary rule(s).`,
|
|
696
|
+
].join(' ');
|
|
697
|
+
}
|