@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,653 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-config doctor v2.
|
|
3
|
+
*
|
|
4
|
+
* True cross-reference graph validation. Same read-only contract as v1, but
|
|
5
|
+
* with a richer finding schema and additional checks the v1 walker did not
|
|
6
|
+
* perform:
|
|
7
|
+
*
|
|
8
|
+
* - agent-tests → helpers / commands / playbooks / policies
|
|
9
|
+
* - policies → rules / commands / paths
|
|
10
|
+
* - pipelines → templates / commands (via step.cliCommands)
|
|
11
|
+
* - playbooks → templates / helpers / commands / profiles
|
|
12
|
+
* - registration-hints → templates / conventions / profiles
|
|
13
|
+
* - decisions → related rules / commands / files / knowledge / templates / playbooks / policies / constructs
|
|
14
|
+
*
|
|
15
|
+
* The v1 schema (sharkcraft.self-config-doctor/v1) is kept; v2 is opt-in by
|
|
16
|
+
* default from the CLI but can be requested explicitly via `--schema v2`.
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync } from 'node:fs';
|
|
19
|
+
import * as nodePath from 'node:path';
|
|
20
|
+
import { listConventions } from "./convention-registry.js";
|
|
21
|
+
import { listPluginLifecycleProfiles } from "./plugin-lifecycle-profile-registry.js";
|
|
22
|
+
import { loadAllContractTemplates } from "./contract-template-registry.js";
|
|
23
|
+
import { listMigrationProfilesFromPacks } from "./migration-profile-registry.js";
|
|
24
|
+
import { listPackHelpers } from "./pack-helper-registry.js";
|
|
25
|
+
import { HELPERS } from "./helper-registry.js";
|
|
26
|
+
import { listTaskRoutingHints } from "./task-routing-hint-registry.js";
|
|
27
|
+
import { listRegistrationHints } from "./registration-hint-registry.js";
|
|
28
|
+
import { listDecisions } from "./decision-records.js";
|
|
29
|
+
import { listPlaybooks } from "./playbook-registry.js";
|
|
30
|
+
import { buildPackContributionsInventory } from "./pack-contributions-inventory.js";
|
|
31
|
+
export const SELF_CONFIG_DOCTOR_V2_SCHEMA = 'sharkcraft.self-config-doctor/v2';
|
|
32
|
+
export var SelfConfigSeverityV2;
|
|
33
|
+
(function (SelfConfigSeverityV2) {
|
|
34
|
+
SelfConfigSeverityV2["Info"] = "info";
|
|
35
|
+
SelfConfigSeverityV2["Warning"] = "warning";
|
|
36
|
+
SelfConfigSeverityV2["Error"] = "error";
|
|
37
|
+
})(SelfConfigSeverityV2 || (SelfConfigSeverityV2 = {}));
|
|
38
|
+
async function buildLookupsV2(inspection) {
|
|
39
|
+
const knowledge = new Set(inspection.knowledgeEntries.map((k) => k.id));
|
|
40
|
+
const rules = new Set((inspection.ruleService?.list?.() ?? []).map((r) => r.id));
|
|
41
|
+
const paths = new Set((inspection.pathService?.list?.() ?? []).map((p) => p.id));
|
|
42
|
+
const templates = new Set(inspection.templateRegistry?.list?.().map((t) => t.id) ?? []);
|
|
43
|
+
const pipelines = new Set(inspection.pipelineRegistry?.list?.().map((p) => p.id) ?? []);
|
|
44
|
+
const conventions = new Set((await listConventions(inspection)).map((e) => e.convention.id));
|
|
45
|
+
const lifecycleProfiles = new Set((await listPluginLifecycleProfiles(inspection)).map((e) => e.profile.id));
|
|
46
|
+
const contractTemplatesPair = await loadAllContractTemplates(inspection);
|
|
47
|
+
const contractTemplates = new Set(contractTemplatesPair.entries.map((e) => e.template.id));
|
|
48
|
+
const migrationProfiles = new Set((await listMigrationProfilesFromPacks(inspection)).map((p) => p.id));
|
|
49
|
+
const helpers = new Set([
|
|
50
|
+
...HELPERS.map((h) => h.id),
|
|
51
|
+
...(await listPackHelpers(inspection)).map((e) => e.helper.id),
|
|
52
|
+
]);
|
|
53
|
+
const routingHints = new Set((await listTaskRoutingHints(inspection)).map((e) => e.hint.id));
|
|
54
|
+
const registrationHints = new Set((await listRegistrationHints(inspection)).map((e) => e.hint.id));
|
|
55
|
+
let playbooks;
|
|
56
|
+
try {
|
|
57
|
+
const pb = await listPlaybooks(inspection);
|
|
58
|
+
playbooks = new Set(pb.map((p) => p.id));
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
playbooks = new Set();
|
|
62
|
+
}
|
|
63
|
+
// Policies surface through the pack contributions inventory; the policy
|
|
64
|
+
// engine itself runs side-effects we want to avoid here.
|
|
65
|
+
const policies = new Set();
|
|
66
|
+
try {
|
|
67
|
+
const inv = buildPackContributionsInventory(inspection);
|
|
68
|
+
for (const entry of inv.entriesByKind['policy'] ?? [])
|
|
69
|
+
policies.add(entry.id);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// ignore
|
|
73
|
+
}
|
|
74
|
+
const decisions = new Set();
|
|
75
|
+
try {
|
|
76
|
+
for (const d of listDecisions(inspection))
|
|
77
|
+
decisions.add(d.id);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// ignore
|
|
81
|
+
}
|
|
82
|
+
// Commands & MCP tools — taken from the catalog / repository commands
|
|
83
|
+
// surface. Best-effort; if registries are absent the sets stay empty and
|
|
84
|
+
// the corresponding checks degrade to info-level.
|
|
85
|
+
const commands = new Set();
|
|
86
|
+
const mcpTools = new Set();
|
|
87
|
+
try {
|
|
88
|
+
const repoCmds = inspection.repositoryCommands;
|
|
89
|
+
for (const c of repoCmds ?? [])
|
|
90
|
+
commands.add(c.id);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// ignore
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
knowledge,
|
|
97
|
+
rules,
|
|
98
|
+
paths,
|
|
99
|
+
templates,
|
|
100
|
+
pipelines,
|
|
101
|
+
policies,
|
|
102
|
+
playbooks,
|
|
103
|
+
conventions,
|
|
104
|
+
contractTemplates,
|
|
105
|
+
migrationProfiles,
|
|
106
|
+
pluginLifecycleProfiles: lifecycleProfiles,
|
|
107
|
+
helpers,
|
|
108
|
+
routingHints,
|
|
109
|
+
registrationHints,
|
|
110
|
+
decisions,
|
|
111
|
+
commands,
|
|
112
|
+
mcpTools,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function findingId(parts) {
|
|
116
|
+
return `${parts.sourceKind}:${parts.sourceId}|${parts.relation}|${parts.targetKind}:${parts.targetId}`;
|
|
117
|
+
}
|
|
118
|
+
function pushFinding(out, input) {
|
|
119
|
+
const entry = {
|
|
120
|
+
id: findingId(input),
|
|
121
|
+
severity: input.severity,
|
|
122
|
+
code: input.code,
|
|
123
|
+
sourceKind: input.sourceKind,
|
|
124
|
+
sourceId: input.sourceId,
|
|
125
|
+
targetKind: input.targetKind,
|
|
126
|
+
targetId: input.targetId,
|
|
127
|
+
relation: input.relation,
|
|
128
|
+
message: input.message,
|
|
129
|
+
confidence: input.confidence ?? 'high',
|
|
130
|
+
...(input.file !== undefined ? { file: input.file } : {}),
|
|
131
|
+
...(input.suggestedFix !== undefined ? { suggestedFix: input.suggestedFix } : {}),
|
|
132
|
+
...(input.nextCommand !== undefined ? { nextCommand: input.nextCommand } : {}),
|
|
133
|
+
};
|
|
134
|
+
out.push(entry);
|
|
135
|
+
}
|
|
136
|
+
// ─── 1. Knowledge → file references ───────────────────────────────────────
|
|
137
|
+
function checkKnowledgeFileRefs(inspection, findings) {
|
|
138
|
+
for (const k of inspection.knowledgeEntries) {
|
|
139
|
+
for (const ref of k.references ?? []) {
|
|
140
|
+
if (ref.kind !== 'file' || !ref.path)
|
|
141
|
+
continue;
|
|
142
|
+
const abs = nodePath.isAbsolute(ref.path)
|
|
143
|
+
? ref.path
|
|
144
|
+
: nodePath.join(inspection.projectRoot, ref.path);
|
|
145
|
+
if (existsSync(abs))
|
|
146
|
+
continue;
|
|
147
|
+
pushFinding(findings, {
|
|
148
|
+
severity: ref.required
|
|
149
|
+
? SelfConfigSeverityV2.Error
|
|
150
|
+
: SelfConfigSeverityV2.Warning,
|
|
151
|
+
code: 'knowledge-ref-missing-file',
|
|
152
|
+
sourceKind: 'knowledge',
|
|
153
|
+
sourceId: k.id,
|
|
154
|
+
targetKind: 'file',
|
|
155
|
+
targetId: ref.path,
|
|
156
|
+
relation: 'references',
|
|
157
|
+
file: k.source?.origin ?? undefined,
|
|
158
|
+
message: `Knowledge "${k.id}" references missing file "${ref.path}".`,
|
|
159
|
+
suggestedFix: `Create the file or update the knowledge reference.`,
|
|
160
|
+
nextCommand: 'shrk knowledge stale-check --ci',
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// ─── 2. Search-tuning targets ─────────────────────────────────────────────
|
|
166
|
+
async function checkSearchTuning(inspection, lookups, findings) {
|
|
167
|
+
const { listSearchTuning } = await import("./search-tuning-registry.js");
|
|
168
|
+
const entries = listSearchTuning(inspection);
|
|
169
|
+
for (const entry of entries) {
|
|
170
|
+
const boostMaps = [entry.boostIds, ...(entry.taskHints ?? []).map((h) => h.boostIds)];
|
|
171
|
+
for (const idMap of boostMaps) {
|
|
172
|
+
if (!idMap)
|
|
173
|
+
continue;
|
|
174
|
+
for (const targetId of Object.keys(idMap)) {
|
|
175
|
+
const found = lookups.knowledge.has(targetId) ||
|
|
176
|
+
lookups.rules.has(targetId) ||
|
|
177
|
+
lookups.templates.has(targetId) ||
|
|
178
|
+
lookups.pipelines.has(targetId) ||
|
|
179
|
+
lookups.contractTemplates.has(targetId) ||
|
|
180
|
+
lookups.pluginLifecycleProfiles.has(targetId) ||
|
|
181
|
+
lookups.conventions.has(targetId) ||
|
|
182
|
+
lookups.playbooks.has(targetId) ||
|
|
183
|
+
lookups.helpers.has(targetId) ||
|
|
184
|
+
lookups.commands.has(targetId);
|
|
185
|
+
if (found)
|
|
186
|
+
continue;
|
|
187
|
+
pushFinding(findings, {
|
|
188
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
189
|
+
code: 'search-tuning-target-missing',
|
|
190
|
+
sourceKind: 'unknown',
|
|
191
|
+
sourceId: entry.id,
|
|
192
|
+
targetKind: 'unknown',
|
|
193
|
+
targetId,
|
|
194
|
+
relation: 'tunes',
|
|
195
|
+
file: entry.sourceFile,
|
|
196
|
+
message: `Search tuning "${entry.id}" boosts unknown id "${targetId}".`,
|
|
197
|
+
suggestedFix: 'Register the target id or remove the boost entry.',
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// ─── 3. Agent-tests → helpers / commands / playbooks / policies ───────────
|
|
204
|
+
async function checkAgentTests(inspection, lookups, findings) {
|
|
205
|
+
let agentTests = [];
|
|
206
|
+
try {
|
|
207
|
+
const { loadAgentContractTests } = await import("./test-runner.js");
|
|
208
|
+
agentTests = (await loadAgentContractTests(inspection));
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const probe = (t, ids, targetKind, lookup, relation) => {
|
|
214
|
+
if (!ids)
|
|
215
|
+
return;
|
|
216
|
+
for (const id of ids) {
|
|
217
|
+
if (lookup.has(id))
|
|
218
|
+
continue;
|
|
219
|
+
pushFinding(findings, {
|
|
220
|
+
severity: SelfConfigSeverityV2.Error,
|
|
221
|
+
code: `agent-test-${targetKind}-missing`,
|
|
222
|
+
sourceKind: 'agent-test',
|
|
223
|
+
sourceId: t.id,
|
|
224
|
+
targetKind,
|
|
225
|
+
targetId: id,
|
|
226
|
+
relation,
|
|
227
|
+
message: `Agent test "${t.id}" expects unknown ${targetKind} id "${id}".`,
|
|
228
|
+
suggestedFix: `Register the ${targetKind} or drop the expectation.`,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
for (const t of agentTests) {
|
|
233
|
+
probe(t, t.expectedKnowledge, 'knowledge', lookups.knowledge, 'expects');
|
|
234
|
+
probe(t, t.expectedTemplates, 'template', lookups.templates, 'expects');
|
|
235
|
+
probe(t, t.expectedHelpers, 'helper', lookups.helpers, 'expects');
|
|
236
|
+
probe(t, t.expectedPlaybooks, 'playbook', lookups.playbooks, 'expects');
|
|
237
|
+
probe(t, t.expectedPolicies, 'policy', lookups.policies, 'expects');
|
|
238
|
+
probe(t, t.expectedCommands, 'command', lookups.commands, 'expects');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// ─── 4. Templates → conventions / helpers / profiles / registration hints ─
|
|
242
|
+
function checkTemplateMetadata(inspection, lookups, findings) {
|
|
243
|
+
const templates = (inspection.templates ?? []);
|
|
244
|
+
for (const t of templates) {
|
|
245
|
+
const m = t.metadata;
|
|
246
|
+
if (!m)
|
|
247
|
+
continue;
|
|
248
|
+
for (const id of m.requiredConventionIds ?? []) {
|
|
249
|
+
if (lookups.conventions.has(id))
|
|
250
|
+
continue;
|
|
251
|
+
pushFinding(findings, {
|
|
252
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
253
|
+
code: 'template-convention-missing',
|
|
254
|
+
sourceKind: 'template',
|
|
255
|
+
sourceId: t.id,
|
|
256
|
+
targetKind: 'convention',
|
|
257
|
+
targetId: id,
|
|
258
|
+
relation: 'requires',
|
|
259
|
+
message: `Template "${t.id}" requires convention "${id}" but it is not registered.`,
|
|
260
|
+
nextCommand: 'shrk conventions list --source pack',
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
for (const id of m.requiredHelperIds ?? []) {
|
|
264
|
+
if (lookups.helpers.has(id))
|
|
265
|
+
continue;
|
|
266
|
+
pushFinding(findings, {
|
|
267
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
268
|
+
code: 'template-helper-missing',
|
|
269
|
+
sourceKind: 'template',
|
|
270
|
+
sourceId: t.id,
|
|
271
|
+
targetKind: 'helper',
|
|
272
|
+
targetId: id,
|
|
273
|
+
relation: 'requires',
|
|
274
|
+
message: `Template "${t.id}" requires helper "${id}" but it is not registered.`,
|
|
275
|
+
nextCommand: 'shrk helper list --source pack',
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
for (const id of m.requiredProfileIds ?? []) {
|
|
279
|
+
if (lookups.pluginLifecycleProfiles.has(id))
|
|
280
|
+
continue;
|
|
281
|
+
pushFinding(findings, {
|
|
282
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
283
|
+
code: 'template-profile-missing',
|
|
284
|
+
sourceKind: 'template',
|
|
285
|
+
sourceId: t.id,
|
|
286
|
+
targetKind: 'plugin-lifecycle-profile',
|
|
287
|
+
targetId: id,
|
|
288
|
+
relation: 'requires',
|
|
289
|
+
message: `Template "${t.id}" requires plugin-lifecycle profile "${id}" but it is not registered.`,
|
|
290
|
+
nextCommand: 'shrk plugin lifecycle profiles',
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
for (const id of m.registrationHintIds ?? []) {
|
|
294
|
+
if (lookups.registrationHints.has(id))
|
|
295
|
+
continue;
|
|
296
|
+
pushFinding(findings, {
|
|
297
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
298
|
+
code: 'template-registration-hint-missing',
|
|
299
|
+
sourceKind: 'template',
|
|
300
|
+
sourceId: t.id,
|
|
301
|
+
targetKind: 'registration-hint',
|
|
302
|
+
targetId: id,
|
|
303
|
+
relation: 'requires',
|
|
304
|
+
message: `Template "${t.id}" references registration hint "${id}" but it is not registered.`,
|
|
305
|
+
nextCommand: 'shrk registrations list',
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
// ─── 5. Routing hints → commands / templates / helpers / playbooks / profiles ───
|
|
311
|
+
async function checkRoutingHints(inspection, lookups, findings) {
|
|
312
|
+
const entries = await listTaskRoutingHints(inspection);
|
|
313
|
+
for (const e of entries) {
|
|
314
|
+
const rec = e.hint.recommends;
|
|
315
|
+
const probe = (ids, kind, lookup) => {
|
|
316
|
+
if (!ids)
|
|
317
|
+
return;
|
|
318
|
+
for (const id of ids) {
|
|
319
|
+
if (lookup.has(id))
|
|
320
|
+
continue;
|
|
321
|
+
pushFinding(findings, {
|
|
322
|
+
severity: SelfConfigSeverityV2.Info,
|
|
323
|
+
code: `routing-hint-${kind}-missing`,
|
|
324
|
+
sourceKind: 'routing-hint',
|
|
325
|
+
sourceId: e.hint.id,
|
|
326
|
+
targetKind: kind,
|
|
327
|
+
targetId: id,
|
|
328
|
+
relation: 'routes-to',
|
|
329
|
+
message: `Routing hint "${e.hint.id}" recommends ${kind} "${id}" but it is not registered.`,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
probe(rec.templates, 'template', lookups.templates);
|
|
334
|
+
probe(rec.helpers, 'helper', lookups.helpers);
|
|
335
|
+
probe(rec.conventions, 'convention', lookups.conventions);
|
|
336
|
+
probe(rec.profiles, 'plugin-lifecycle-profile', lookups.pluginLifecycleProfiles);
|
|
337
|
+
probe(rec.commands, 'command', lookups.commands);
|
|
338
|
+
probe(rec.playbooks, 'playbook', lookups.playbooks);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
// ─── 6. Pipelines → templates / commands (via cliCommands) ────────────────
|
|
342
|
+
function checkPipelines(inspection, lookups, findings) {
|
|
343
|
+
const pipelines = inspection.pipelineRegistry?.list?.() ??
|
|
344
|
+
(inspection.pipelines ?? []);
|
|
345
|
+
for (const p of pipelines) {
|
|
346
|
+
for (const step of p.steps ?? []) {
|
|
347
|
+
// Templates referenced by id should resolve.
|
|
348
|
+
for (const ref of step.references ?? []) {
|
|
349
|
+
if (lookups.templates.has(ref) ||
|
|
350
|
+
lookups.knowledge.has(ref) ||
|
|
351
|
+
lookups.conventions.has(ref) ||
|
|
352
|
+
lookups.paths.has(ref) ||
|
|
353
|
+
lookups.helpers.has(ref))
|
|
354
|
+
continue;
|
|
355
|
+
pushFinding(findings, {
|
|
356
|
+
severity: SelfConfigSeverityV2.Info,
|
|
357
|
+
code: 'pipeline-reference-missing',
|
|
358
|
+
sourceKind: 'pipeline',
|
|
359
|
+
sourceId: p.id,
|
|
360
|
+
targetKind: 'unknown',
|
|
361
|
+
targetId: ref,
|
|
362
|
+
relation: 'references',
|
|
363
|
+
file: p.source?.origin ?? undefined,
|
|
364
|
+
message: `Pipeline "${p.id}" step "${step.id}" references unknown id "${ref}".`,
|
|
365
|
+
confidence: 'medium',
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
// ─── 7. Playbooks → templates / helpers / commands / profiles ─────────────
|
|
372
|
+
async function checkPlaybooks(inspection, lookups, findings) {
|
|
373
|
+
let playbooks;
|
|
374
|
+
try {
|
|
375
|
+
playbooks = (await listPlaybooks(inspection));
|
|
376
|
+
}
|
|
377
|
+
catch {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
for (const p of playbooks) {
|
|
381
|
+
for (const id of p.recommendedTemplateIds ?? []) {
|
|
382
|
+
if (lookups.templates.has(id))
|
|
383
|
+
continue;
|
|
384
|
+
pushFinding(findings, {
|
|
385
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
386
|
+
code: 'playbook-template-missing',
|
|
387
|
+
sourceKind: 'playbook',
|
|
388
|
+
sourceId: p.id,
|
|
389
|
+
targetKind: 'template',
|
|
390
|
+
targetId: id,
|
|
391
|
+
relation: 'requires',
|
|
392
|
+
file: p.sourceFile,
|
|
393
|
+
message: `Playbook "${p.id}" recommends template "${id}" but it is not registered.`,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
for (const id of p.recommendedPipelineIds ?? []) {
|
|
397
|
+
if (lookups.pipelines.has(id))
|
|
398
|
+
continue;
|
|
399
|
+
pushFinding(findings, {
|
|
400
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
401
|
+
code: 'playbook-pipeline-missing',
|
|
402
|
+
sourceKind: 'playbook',
|
|
403
|
+
sourceId: p.id,
|
|
404
|
+
targetKind: 'pipeline',
|
|
405
|
+
targetId: id,
|
|
406
|
+
relation: 'requires',
|
|
407
|
+
file: p.sourceFile,
|
|
408
|
+
message: `Playbook "${p.id}" recommends pipeline "${id}" but it is not registered.`,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
// ─── 8. Registration hints → templates / conventions / profiles ───────────
|
|
414
|
+
async function checkRegistrationHints(inspection, lookups, findings) {
|
|
415
|
+
const entries = await listRegistrationHints(inspection);
|
|
416
|
+
for (const e of entries) {
|
|
417
|
+
const h = e.hint;
|
|
418
|
+
const probe = (ids, kind, lookup) => {
|
|
419
|
+
if (!ids)
|
|
420
|
+
return;
|
|
421
|
+
for (const id of ids) {
|
|
422
|
+
if (lookup.has(id))
|
|
423
|
+
continue;
|
|
424
|
+
pushFinding(findings, {
|
|
425
|
+
severity: SelfConfigSeverityV2.Info,
|
|
426
|
+
code: `registration-hint-${kind}-missing`,
|
|
427
|
+
sourceKind: 'registration-hint',
|
|
428
|
+
sourceId: h.id,
|
|
429
|
+
targetKind: kind,
|
|
430
|
+
targetId: id,
|
|
431
|
+
relation: 'related',
|
|
432
|
+
file: e.sourceFile,
|
|
433
|
+
message: `Registration hint "${h.id}" references ${kind} "${id}" but it is not registered.`,
|
|
434
|
+
confidence: 'medium',
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
probe(h.relatedTemplateIds, 'template', lookups.templates);
|
|
439
|
+
probe(h.relatedConventionIds, 'convention', lookups.conventions);
|
|
440
|
+
probe(h.relatedProfileIds, 'plugin-lifecycle-profile', lookups.pluginLifecycleProfiles);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Decision records are parsed from Markdown via the heading text; the
|
|
445
|
+
* "Related ..." sections can contain prose ("(none directly — runtime gate)")
|
|
446
|
+
* instead of structured ids. Filter those out so the doctor doesn't report
|
|
447
|
+
* "missing policy '(none directly)'" as a broken link.
|
|
448
|
+
*/
|
|
449
|
+
function looksLikeId(value) {
|
|
450
|
+
if (!value)
|
|
451
|
+
return false;
|
|
452
|
+
if (value.length > 128)
|
|
453
|
+
return false;
|
|
454
|
+
// IDs are dotted/kebab identifiers, no spaces, parens, or punctuation.
|
|
455
|
+
return /^[A-Za-z_][\w.\-]*$/.test(value);
|
|
456
|
+
}
|
|
457
|
+
// ─── 9. Decisions → related rules / commands / files / knowledge / etc. ───
|
|
458
|
+
function checkDecisions(inspection, lookups, findings) {
|
|
459
|
+
let decisions = [];
|
|
460
|
+
try {
|
|
461
|
+
decisions = listDecisions(inspection);
|
|
462
|
+
}
|
|
463
|
+
catch {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
for (const d of decisions) {
|
|
467
|
+
for (const id of d.relatedRules) {
|
|
468
|
+
if (!looksLikeId(id) || lookups.rules.has(id))
|
|
469
|
+
continue;
|
|
470
|
+
pushFinding(findings, {
|
|
471
|
+
severity: SelfConfigSeverityV2.Info,
|
|
472
|
+
code: 'decision-rule-missing',
|
|
473
|
+
sourceKind: 'decision',
|
|
474
|
+
sourceId: d.id,
|
|
475
|
+
targetKind: 'rule',
|
|
476
|
+
targetId: id,
|
|
477
|
+
relation: 'related',
|
|
478
|
+
message: `Decision "${d.id}" references missing rule "${id}".`,
|
|
479
|
+
confidence: 'medium',
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
for (const id of d.relatedPolicies) {
|
|
483
|
+
if (!looksLikeId(id) || lookups.policies.has(id))
|
|
484
|
+
continue;
|
|
485
|
+
pushFinding(findings, {
|
|
486
|
+
severity: SelfConfigSeverityV2.Info,
|
|
487
|
+
code: 'decision-policy-missing',
|
|
488
|
+
sourceKind: 'decision',
|
|
489
|
+
sourceId: d.id,
|
|
490
|
+
targetKind: 'policy',
|
|
491
|
+
targetId: id,
|
|
492
|
+
relation: 'related',
|
|
493
|
+
message: `Decision "${d.id}" references missing policy "${id}".`,
|
|
494
|
+
confidence: 'medium',
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
for (const filePath of d.relatedFiles) {
|
|
498
|
+
// A "Related file" must look like a path. Skip prose.
|
|
499
|
+
if (!filePath || /\s/.test(filePath.trim()) || filePath.length > 240)
|
|
500
|
+
continue;
|
|
501
|
+
const abs = nodePath.isAbsolute(filePath)
|
|
502
|
+
? filePath
|
|
503
|
+
: nodePath.join(inspection.projectRoot, filePath);
|
|
504
|
+
if (existsSync(abs))
|
|
505
|
+
continue;
|
|
506
|
+
pushFinding(findings, {
|
|
507
|
+
severity: SelfConfigSeverityV2.Info,
|
|
508
|
+
code: 'decision-file-missing',
|
|
509
|
+
sourceKind: 'decision',
|
|
510
|
+
sourceId: d.id,
|
|
511
|
+
targetKind: 'file',
|
|
512
|
+
targetId: filePath,
|
|
513
|
+
relation: 'references',
|
|
514
|
+
message: `Decision "${d.id}" references missing file "${filePath}".`,
|
|
515
|
+
confidence: 'medium',
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
// ─── 10. Stale pack signatures (surface as warning) ───────────────────────
|
|
521
|
+
function checkStaleSignatures(inspection, findings) {
|
|
522
|
+
try {
|
|
523
|
+
const inv = buildPackContributionsInventory(inspection);
|
|
524
|
+
for (const c of inv.conflicts) {
|
|
525
|
+
if (c.kind !== 'stale-signature')
|
|
526
|
+
continue;
|
|
527
|
+
pushFinding(findings, {
|
|
528
|
+
severity: SelfConfigSeverityV2.Warning,
|
|
529
|
+
code: 'pack-signature-stale',
|
|
530
|
+
sourceKind: 'pack',
|
|
531
|
+
sourceId: c.id,
|
|
532
|
+
targetKind: 'schema',
|
|
533
|
+
targetId: 'sharkcraft.pack-manifest/v1',
|
|
534
|
+
relation: 'validates',
|
|
535
|
+
message: c.message,
|
|
536
|
+
...(c.nextCommand ? { nextCommand: c.nextCommand } : {}),
|
|
537
|
+
confidence: 'high',
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
// ignore
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
// ─── Public entry ─────────────────────────────────────────────────────────
|
|
546
|
+
export async function buildSelfConfigDoctorReportV2(inspection) {
|
|
547
|
+
const findings = [];
|
|
548
|
+
const lookups = await buildLookupsV2(inspection);
|
|
549
|
+
checkKnowledgeFileRefs(inspection, findings);
|
|
550
|
+
await checkSearchTuning(inspection, lookups, findings);
|
|
551
|
+
await checkAgentTests(inspection, lookups, findings);
|
|
552
|
+
checkTemplateMetadata(inspection, lookups, findings);
|
|
553
|
+
await checkRoutingHints(inspection, lookups, findings);
|
|
554
|
+
checkPipelines(inspection, lookups, findings);
|
|
555
|
+
await checkPlaybooks(inspection, lookups, findings);
|
|
556
|
+
await checkRegistrationHints(inspection, lookups, findings);
|
|
557
|
+
checkDecisions(inspection, lookups, findings);
|
|
558
|
+
checkStaleSignatures(inspection, findings);
|
|
559
|
+
const totals = computeTotalsV2(findings);
|
|
560
|
+
const verdict = totals.error > 0 ? 'errors' : totals.warning > 0 ? 'warnings' : 'ok';
|
|
561
|
+
const nextCommands = [];
|
|
562
|
+
if (totals.error > 0) {
|
|
563
|
+
nextCommands.push('Fix the errored ids first — agent-test expectations and template requirements are load-bearing.', 'shrk packs conflicts');
|
|
564
|
+
}
|
|
565
|
+
else if (totals.warning > 0) {
|
|
566
|
+
nextCommands.push('Review warnings — most resolve by registering the missing id or removing the stale link.');
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
nextCommands.push('shrk self-config doctor --schema v2 --json | jq .verdict');
|
|
570
|
+
}
|
|
571
|
+
return {
|
|
572
|
+
schema: SELF_CONFIG_DOCTOR_V2_SCHEMA,
|
|
573
|
+
generatedAt: new Date().toISOString(),
|
|
574
|
+
projectRoot: inspection.projectRoot,
|
|
575
|
+
findings,
|
|
576
|
+
totals,
|
|
577
|
+
verdict,
|
|
578
|
+
nextCommands,
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
function computeTotalsV2(findings) {
|
|
582
|
+
const byRelation = {};
|
|
583
|
+
const bySourceKind = {};
|
|
584
|
+
const byTargetKind = {};
|
|
585
|
+
let error = 0;
|
|
586
|
+
let warning = 0;
|
|
587
|
+
let info = 0;
|
|
588
|
+
for (const f of findings) {
|
|
589
|
+
byRelation[f.relation] = (byRelation[f.relation] ?? 0) + 1;
|
|
590
|
+
bySourceKind[f.sourceKind] = (bySourceKind[f.sourceKind] ?? 0) + 1;
|
|
591
|
+
byTargetKind[f.targetKind] = (byTargetKind[f.targetKind] ?? 0) + 1;
|
|
592
|
+
if (f.severity === SelfConfigSeverityV2.Error)
|
|
593
|
+
error += 1;
|
|
594
|
+
else if (f.severity === SelfConfigSeverityV2.Warning)
|
|
595
|
+
warning += 1;
|
|
596
|
+
else
|
|
597
|
+
info += 1;
|
|
598
|
+
}
|
|
599
|
+
return { error, warning, info, byRelation, bySourceKind, byTargetKind };
|
|
600
|
+
}
|
|
601
|
+
export function renderSelfConfigDoctorV2Text(report) {
|
|
602
|
+
const lines = [];
|
|
603
|
+
lines.push('=== Self-config doctor (v2) ===');
|
|
604
|
+
lines.push(` schema ${report.schema}`);
|
|
605
|
+
lines.push(` generatedAt ${report.generatedAt}`);
|
|
606
|
+
lines.push(` verdict ${report.verdict.toUpperCase()}`);
|
|
607
|
+
lines.push(` errors ${report.totals.error}`);
|
|
608
|
+
lines.push(` warnings ${report.totals.warning}`);
|
|
609
|
+
lines.push(` info ${report.totals.info}`);
|
|
610
|
+
lines.push('');
|
|
611
|
+
if (report.findings.length === 0) {
|
|
612
|
+
lines.push(' No cross-reference issues. ✓');
|
|
613
|
+
return lines.join('\n') + '\n';
|
|
614
|
+
}
|
|
615
|
+
for (const f of report.findings.slice(0, 200)) {
|
|
616
|
+
lines.push(` ${f.severity.padEnd(7)} [${f.code}] ${f.sourceKind}:${f.sourceId} ${f.relation} ${f.targetKind}:${f.targetId}`);
|
|
617
|
+
lines.push(` ${f.message}`);
|
|
618
|
+
if (f.suggestedFix)
|
|
619
|
+
lines.push(` fix: ${f.suggestedFix}`);
|
|
620
|
+
if (f.nextCommand)
|
|
621
|
+
lines.push(` next: ${f.nextCommand}`);
|
|
622
|
+
}
|
|
623
|
+
if (report.findings.length > 200) {
|
|
624
|
+
lines.push(` … (${report.findings.length - 200} more)`);
|
|
625
|
+
}
|
|
626
|
+
if (report.nextCommands.length > 0) {
|
|
627
|
+
lines.push('');
|
|
628
|
+
lines.push('Next:');
|
|
629
|
+
for (const c of report.nextCommands)
|
|
630
|
+
lines.push(` • ${c}`);
|
|
631
|
+
}
|
|
632
|
+
return lines.join('\n') + '\n';
|
|
633
|
+
}
|
|
634
|
+
export function renderSelfConfigDoctorV2Markdown(report) {
|
|
635
|
+
const lines = ['# Self-config doctor (v2)', ''];
|
|
636
|
+
lines.push(`- schema: ${report.schema}`);
|
|
637
|
+
lines.push(`- generatedAt: ${report.generatedAt}`);
|
|
638
|
+
lines.push(`- verdict: **${report.verdict.toUpperCase()}**`);
|
|
639
|
+
lines.push(`- errors: ${report.totals.error}`);
|
|
640
|
+
lines.push(`- warnings: ${report.totals.warning}`);
|
|
641
|
+
lines.push(`- info: ${report.totals.info}`);
|
|
642
|
+
lines.push('');
|
|
643
|
+
if (report.findings.length === 0) {
|
|
644
|
+
lines.push('No cross-reference issues. ✓');
|
|
645
|
+
return lines.join('\n') + '\n';
|
|
646
|
+
}
|
|
647
|
+
lines.push('| Severity | Source | Relation | Target | Message | Next |');
|
|
648
|
+
lines.push('| --- | --- | --- | --- | --- | --- |');
|
|
649
|
+
for (const f of report.findings) {
|
|
650
|
+
lines.push(`| ${f.severity} | \`${f.sourceKind}:${f.sourceId}\` | \`${f.relation}\` | \`${f.targetKind}:${f.targetId}\` | ${f.message} | ${f.nextCommand ?? ''} |`);
|
|
651
|
+
}
|
|
652
|
+
return lines.join('\n') + '\n';
|
|
653
|
+
}
|