@shrkcrft/inspector 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +57 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +214 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +382 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +38 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +173 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +422 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +224 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +234 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +42 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +268 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +73 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +519 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +81 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +65 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
export const CONTRADICTIONS_SCHEMA = 'sharkcraft.contradictions/v1';
|
|
4
|
+
export var ContradictionKind;
|
|
5
|
+
(function (ContradictionKind) {
|
|
6
|
+
ContradictionKind["MissingPath"] = "missing-path";
|
|
7
|
+
ContradictionKind["MissingCommand"] = "missing-command";
|
|
8
|
+
ContradictionKind["StalePath"] = "stale-path";
|
|
9
|
+
ContradictionKind["OldCliPath"] = "old-cli-path";
|
|
10
|
+
ContradictionKind["MissingExport"] = "missing-export";
|
|
11
|
+
ContradictionKind["DocVsConfigConflict"] = "doc-vs-config-conflict";
|
|
12
|
+
ContradictionKind["DeprecatedRecommendation"] = "deprecated-recommendation";
|
|
13
|
+
})(ContradictionKind || (ContradictionKind = {}));
|
|
14
|
+
export var ContradictionSeverity;
|
|
15
|
+
(function (ContradictionSeverity) {
|
|
16
|
+
ContradictionSeverity["Error"] = "error";
|
|
17
|
+
ContradictionSeverity["Warning"] = "warning";
|
|
18
|
+
ContradictionSeverity["Info"] = "info";
|
|
19
|
+
})(ContradictionSeverity || (ContradictionSeverity = {}));
|
|
20
|
+
const DEFAULT_DOC_SCAN_LIMIT = 80;
|
|
21
|
+
const DEFAULT_BYTES_PER_DOC = 200_000;
|
|
22
|
+
const DOC_EXTS = new Set(['.md', '.mdx', '.rst', '.txt']);
|
|
23
|
+
const DOC_DIR_NAMES = new Set(['docs', 'documentation', 'doc']);
|
|
24
|
+
const DEPRECATED_CLI_HINTS = [
|
|
25
|
+
{ re: /\bsharkcraft\s+/i, replacement: 'shrk ' },
|
|
26
|
+
{ re: /\b@shrkcrft\/cli\s+/i, replacement: 'shrk ' },
|
|
27
|
+
];
|
|
28
|
+
const DEPRECATED_RECOMMENDATION_HINTS = [
|
|
29
|
+
{ re: /TSLint/i, reason: 'TSLint has been deprecated in favour of ESLint.' },
|
|
30
|
+
{ re: /\bvar\s+[A-Za-z_$]/g, reason: 'Prefer `const` / `let` over `var` in modern code.' },
|
|
31
|
+
];
|
|
32
|
+
const CODE_FENCE_RE = /^```([a-zA-Z0-9_-]*)\s*$/;
|
|
33
|
+
const COMMAND_FENCE_LANGS = new Set(['sh', 'bash', 'shell', 'zsh', 'console']);
|
|
34
|
+
const REL_PATH_HINT_RE = /(?:^|[\s`(\[])(?:\.\/|src\/|packages\/|libs\/|apps\/|examples\/|docs\/|scripts\/|tools\/|tests?\/|e2e\/|sharkcraft\/)[\w@\/_.\-+]+/g;
|
|
35
|
+
const INLINE_CODE_PATH_RE = /`([^`]+)`/g;
|
|
36
|
+
const SOURCE_PREFIX_RE = /^(\.\/|src\/|packages\/|libs\/|apps\/|examples\/|docs\/|scripts\/|tools\/|tests?\/|e2e\/|sharkcraft\/|\.github\/)/;
|
|
37
|
+
const SCHEMA_ID_RE = /^[a-z][\w.-]*\.[\w.-]*\/v\d+$/;
|
|
38
|
+
const GH_ACTION_RE = /^[\w.-]+\/[\w.-]+(@[\w.\-+~]+)?$/;
|
|
39
|
+
export function buildContradictionReport(options) {
|
|
40
|
+
const inspection = options.inspection;
|
|
41
|
+
const projectRoot = inspection.projectRoot;
|
|
42
|
+
const docLimit = options.docScanLimit ?? DEFAULT_DOC_SCAN_LIMIT;
|
|
43
|
+
const byteLimit = options.bytesPerDoc ?? DEFAULT_BYTES_PER_DOC;
|
|
44
|
+
const limitations = [];
|
|
45
|
+
const findings = [];
|
|
46
|
+
const docs = collectDocs(projectRoot, docLimit);
|
|
47
|
+
if (docs.length >= docLimit) {
|
|
48
|
+
limitations.push(`Doc scan limited to ${docLimit} files; deeper trees may not be covered.`);
|
|
49
|
+
}
|
|
50
|
+
const knownScripts = new Set();
|
|
51
|
+
for (const script of Object.keys(inspection.workspace.scripts ?? {}))
|
|
52
|
+
knownScripts.add(script);
|
|
53
|
+
const cliCommandNames = collectShrkCommandNames();
|
|
54
|
+
for (const doc of docs) {
|
|
55
|
+
let body = '';
|
|
56
|
+
try {
|
|
57
|
+
body = readFileSync(doc.abs, 'utf8');
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (body.length > byteLimit) {
|
|
63
|
+
body = body.slice(0, byteLimit);
|
|
64
|
+
limitations.push(`Doc ${doc.rel} truncated at ${byteLimit} bytes.`);
|
|
65
|
+
}
|
|
66
|
+
const lines = body.split(/\r?\n/);
|
|
67
|
+
let inFence = false;
|
|
68
|
+
let fenceLang = null;
|
|
69
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
70
|
+
const line = lines[i] ?? '';
|
|
71
|
+
const fenceMatch = line.match(CODE_FENCE_RE);
|
|
72
|
+
if (fenceMatch) {
|
|
73
|
+
if (inFence) {
|
|
74
|
+
inFence = false;
|
|
75
|
+
fenceLang = null;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
inFence = true;
|
|
79
|
+
fenceLang = fenceMatch[1]?.toLowerCase() ?? '';
|
|
80
|
+
}
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
// Missing paths — only check inline-coded paths and well-known relative path forms.
|
|
84
|
+
const refs = extractPathReferences(line);
|
|
85
|
+
const seenOnLine = new Set();
|
|
86
|
+
for (const ref of refs) {
|
|
87
|
+
if (!looksLikePath(ref))
|
|
88
|
+
continue;
|
|
89
|
+
const cleaned = ref.replace(/[.,;:!\)\]`]+$/g, '').replace(/^[`(\[]+/, '');
|
|
90
|
+
if (!cleaned)
|
|
91
|
+
continue;
|
|
92
|
+
if (cleaned.startsWith('http://') || cleaned.startsWith('https://'))
|
|
93
|
+
continue;
|
|
94
|
+
const probe = cleaned.startsWith('./') ? cleaned.slice(2) : cleaned;
|
|
95
|
+
if (seenOnLine.has(probe))
|
|
96
|
+
continue;
|
|
97
|
+
seenOnLine.add(probe);
|
|
98
|
+
const abs = nodePath.join(projectRoot, probe);
|
|
99
|
+
if (!existsSync(abs)) {
|
|
100
|
+
findings.push({
|
|
101
|
+
id: `missing-path:${doc.rel}:${i + 1}:${probe}`,
|
|
102
|
+
kind: ContradictionKind.MissingPath,
|
|
103
|
+
severity: ContradictionSeverity.Warning,
|
|
104
|
+
message: `Doc references missing path \`${probe}\`.`,
|
|
105
|
+
source: doc.rel,
|
|
106
|
+
line: i + 1,
|
|
107
|
+
reference: probe,
|
|
108
|
+
suggestion: 'Update the doc or restore the file.',
|
|
109
|
+
reason: 'Doc-vs-tree consistency.',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Commands referenced inside a shell fence.
|
|
114
|
+
if (inFence && fenceLang && COMMAND_FENCE_LANGS.has(fenceLang)) {
|
|
115
|
+
const trimmed = line.trim();
|
|
116
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
117
|
+
continue;
|
|
118
|
+
const tokens = trimmed.split(/\s+/);
|
|
119
|
+
if (tokens.length === 0)
|
|
120
|
+
continue;
|
|
121
|
+
const head = tokens[0];
|
|
122
|
+
const next = tokens[1] ?? '';
|
|
123
|
+
// Old `sharkcraft <verb>` patterns.
|
|
124
|
+
if (head === 'sharkcraft' && next) {
|
|
125
|
+
findings.push({
|
|
126
|
+
id: `old-cli-path:${doc.rel}:${i + 1}`,
|
|
127
|
+
kind: ContradictionKind.OldCliPath,
|
|
128
|
+
severity: ContradictionSeverity.Warning,
|
|
129
|
+
message: `Doc uses deprecated CLI prefix \`sharkcraft ${next}\` (now \`shrk ${next}\`).`,
|
|
130
|
+
source: doc.rel,
|
|
131
|
+
line: i + 1,
|
|
132
|
+
reference: trimmed,
|
|
133
|
+
suggestion: `Replace with \`shrk ${next}\`.`,
|
|
134
|
+
reason: 'CLI renamed from sharkcraft to shrk.',
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
// `shrk <verb>` — verify verb exists in command catalogue.
|
|
138
|
+
if (head === 'shrk' && next && !next.startsWith('-')) {
|
|
139
|
+
if (cliCommandNames.size > 0 && !cliCommandNames.has(next)) {
|
|
140
|
+
findings.push({
|
|
141
|
+
id: `missing-command:${doc.rel}:${i + 1}:${next}`,
|
|
142
|
+
kind: ContradictionKind.MissingCommand,
|
|
143
|
+
severity: ContradictionSeverity.Warning,
|
|
144
|
+
message: `Doc references CLI command \`shrk ${next}\` which is not in the catalogue.`,
|
|
145
|
+
source: doc.rel,
|
|
146
|
+
line: i + 1,
|
|
147
|
+
reference: `shrk ${next}`,
|
|
148
|
+
suggestion: 'Update the doc or add the command.',
|
|
149
|
+
reason: 'Doc-vs-CLI consistency.',
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// npm/bun script references.
|
|
154
|
+
if ((head === 'bun' || head === 'npm' || head === 'pnpm' || head === 'yarn') && (next === 'run' || next === 'x')) {
|
|
155
|
+
const script = tokens[2];
|
|
156
|
+
if (script && !script.startsWith('-') && next === 'run' && knownScripts.size > 0 && !knownScripts.has(script)) {
|
|
157
|
+
findings.push({
|
|
158
|
+
id: `missing-command:${doc.rel}:${i + 1}:${script}`,
|
|
159
|
+
kind: ContradictionKind.MissingCommand,
|
|
160
|
+
severity: ContradictionSeverity.Warning,
|
|
161
|
+
message: `Doc references package-script \`${head} run ${script}\` which is not defined in package.json.`,
|
|
162
|
+
source: doc.rel,
|
|
163
|
+
line: i + 1,
|
|
164
|
+
reference: `${head} run ${script}`,
|
|
165
|
+
suggestion: 'Add the script or update the doc.',
|
|
166
|
+
reason: 'Doc-vs-scripts consistency.',
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Deprecated CLI hints (inline mentions, even outside fences).
|
|
172
|
+
if (!inFence) {
|
|
173
|
+
for (const hint of DEPRECATED_CLI_HINTS) {
|
|
174
|
+
const m = line.match(/\bsharkcraft\s+([\w-]+)/);
|
|
175
|
+
if (m && !line.includes('shrk ')) {
|
|
176
|
+
findings.push({
|
|
177
|
+
id: `deprecated:${doc.rel}:${i + 1}`,
|
|
178
|
+
kind: ContradictionKind.OldCliPath,
|
|
179
|
+
severity: ContradictionSeverity.Info,
|
|
180
|
+
message: `Doc mentions \`sharkcraft ${m[1] ?? ''}\` (now \`shrk ${m[1] ?? ''}\`).`,
|
|
181
|
+
source: doc.rel,
|
|
182
|
+
line: i + 1,
|
|
183
|
+
reference: m[0],
|
|
184
|
+
suggestion: `Use \`shrk ${m[1] ?? ''}\`.`,
|
|
185
|
+
reason: 'CLI rename.',
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Marker — uses the imported hint to satisfy lint.
|
|
189
|
+
void hint;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
schema: CONTRADICTIONS_SCHEMA,
|
|
196
|
+
projectRoot,
|
|
197
|
+
findings,
|
|
198
|
+
filesScanned: docs.length,
|
|
199
|
+
limitations,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function collectDocs(projectRoot, limit) {
|
|
203
|
+
const found = [];
|
|
204
|
+
const visit = (dir) => {
|
|
205
|
+
if (found.length >= limit)
|
|
206
|
+
return;
|
|
207
|
+
let entries;
|
|
208
|
+
try {
|
|
209
|
+
entries = readdirSync(dir);
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
for (const entry of entries) {
|
|
215
|
+
if (found.length >= limit)
|
|
216
|
+
return;
|
|
217
|
+
if (entry.startsWith('.') && entry !== '.cursor')
|
|
218
|
+
continue;
|
|
219
|
+
if (entry === 'node_modules' || entry === 'dist' || entry === 'build' || entry === 'coverage' || entry === '.angular' || entry === '.next' || entry === '.nuxt')
|
|
220
|
+
continue;
|
|
221
|
+
const abs = nodePath.join(dir, entry);
|
|
222
|
+
let st;
|
|
223
|
+
try {
|
|
224
|
+
st = statSync(abs);
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (st.isDirectory()) {
|
|
230
|
+
visit(abs);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
const ext = nodePath.extname(entry).toLowerCase();
|
|
234
|
+
const base = entry.toLowerCase();
|
|
235
|
+
const isTopReadme = dir === projectRoot && /^readme\.(md|mdx|rst)$/i.test(entry);
|
|
236
|
+
const isChangelog = /^changelog\./i.test(entry);
|
|
237
|
+
const isDocsDir = DOC_DIR_NAMES.has(nodePath.basename(dir).toLowerCase());
|
|
238
|
+
if (isTopReadme || isChangelog || (DOC_EXTS.has(ext) && (isDocsDir || base.includes('readme') || base.includes('guide')))) {
|
|
239
|
+
const rel = nodePath.relative(projectRoot, abs);
|
|
240
|
+
found.push({ rel, abs });
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
visit(projectRoot);
|
|
245
|
+
return found;
|
|
246
|
+
}
|
|
247
|
+
function extractPathReferences(line) {
|
|
248
|
+
const refs = [];
|
|
249
|
+
let m;
|
|
250
|
+
const re1 = new RegExp(INLINE_CODE_PATH_RE.source, 'g');
|
|
251
|
+
while ((m = re1.exec(line)) !== null) {
|
|
252
|
+
const captured = m[1];
|
|
253
|
+
if (captured && captured.length > 0 && captured.length < 200)
|
|
254
|
+
refs.push(captured);
|
|
255
|
+
}
|
|
256
|
+
const re2 = new RegExp(REL_PATH_HINT_RE.source, 'g');
|
|
257
|
+
while ((m = re2.exec(line)) !== null) {
|
|
258
|
+
refs.push(m[0].trim());
|
|
259
|
+
}
|
|
260
|
+
return refs;
|
|
261
|
+
}
|
|
262
|
+
function looksLikePath(s) {
|
|
263
|
+
if (!s)
|
|
264
|
+
return false;
|
|
265
|
+
if (s.startsWith('http'))
|
|
266
|
+
return false;
|
|
267
|
+
if (s.includes(' '))
|
|
268
|
+
return false;
|
|
269
|
+
if (/[<>{}]/.test(s))
|
|
270
|
+
return false; // placeholders / brace-expansions
|
|
271
|
+
if (s.endsWith('/'))
|
|
272
|
+
return false; // generic dir reference
|
|
273
|
+
if (s.startsWith('@'))
|
|
274
|
+
return false; // npm package
|
|
275
|
+
if (SCHEMA_ID_RE.test(s))
|
|
276
|
+
return false; // sharkcraft.foo/v1
|
|
277
|
+
if (GH_ACTION_RE.test(s))
|
|
278
|
+
return false; // org/repo style
|
|
279
|
+
// Require either a specific source-tree prefix and a `.ext`, or a fully-qualified path with extension.
|
|
280
|
+
const hasSlash = s.includes('/');
|
|
281
|
+
const hasExt = /\.(md|mdx|ts|tsx|js|jsx|mjs|cjs|json|yaml|yml|toml|svg|png|css|scss|html|sh|py|go|rs|java|kt|cs)$/i.test(s);
|
|
282
|
+
if (!hasSlash)
|
|
283
|
+
return false;
|
|
284
|
+
if (!SOURCE_PREFIX_RE.test(s) && !hasExt)
|
|
285
|
+
return false;
|
|
286
|
+
// Reject pseudo-paths that contain literal globs/wildcards.
|
|
287
|
+
if (/[*?]/.test(s))
|
|
288
|
+
return false;
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
function collectShrkCommandNames() {
|
|
292
|
+
// Hard-coded list of well-known top-level commands. Importing the CLI here
|
|
293
|
+
// would create a layering violation (inspector → cli) — instead we mirror
|
|
294
|
+
// the catalogue that `shrk commands` would print. Missing entries simply
|
|
295
|
+
// suppress contradiction findings for those commands, which is the safe
|
|
296
|
+
// failure mode.
|
|
297
|
+
return new Set([
|
|
298
|
+
'init', 'inspect', 'doctor', 'context', 'gen', 'apply', 'export', 'import',
|
|
299
|
+
'task', 'next', 'find', 'explain', 'check', 'watch', 'drift', 'graph',
|
|
300
|
+
'coverage', 'review', 'onboard', 'test', 'plan', 'session', 'dev', 'ask',
|
|
301
|
+
'mcp', 'version', 'quality', 'ci', 'commands', 'safety', 'infer', 'report',
|
|
302
|
+
'dashboard', 'bundle', 'impact', 'search', 'brief', 'demo', 'release',
|
|
303
|
+
'start-here', 'handoff', 'map', 'intent', 'orchestrate', 'simulate', 'view',
|
|
304
|
+
'recommend', 'risk', 'migration', 'contract', 'languages', 'help',
|
|
305
|
+
'memory', 'heal', 'agent', 'docs', 'examples', 'self', 'install',
|
|
306
|
+
'diagnostics', 'intelligence', 'architecture', 'decisions', 'compliance',
|
|
307
|
+
'policy', 'product', 'reposet', 'packs', 'upgrade', 'api', 'boundaries',
|
|
308
|
+
'repo', 'owners', 'ownership', 'runtime', 'constructs', 'playbooks',
|
|
309
|
+
'presets', 'pipelines', 'paths', 'rules', 'templates', 'knowledge',
|
|
310
|
+
'schemas', 'scaffolds', 'tests',
|
|
311
|
+
// Additions
|
|
312
|
+
'ingest', 'understand-task', 'validate-change', 'contradictions', 'generated', 'stability',
|
|
313
|
+
]);
|
|
314
|
+
}
|
|
315
|
+
export function renderContradictionReportText(report) {
|
|
316
|
+
const lines = [];
|
|
317
|
+
lines.push('=== Contradictions report ===');
|
|
318
|
+
lines.push(` findings ${report.findings.length}`);
|
|
319
|
+
lines.push(` docs scanned ${report.filesScanned}`);
|
|
320
|
+
if (report.findings.length === 0) {
|
|
321
|
+
lines.push('');
|
|
322
|
+
lines.push('No contradictions found.');
|
|
323
|
+
return lines.join('\n');
|
|
324
|
+
}
|
|
325
|
+
const grouped = new Map();
|
|
326
|
+
for (const f of report.findings) {
|
|
327
|
+
const arr = grouped.get(f.kind) ?? [];
|
|
328
|
+
arr.push(f);
|
|
329
|
+
grouped.set(f.kind, arr);
|
|
330
|
+
}
|
|
331
|
+
for (const [kind, arr] of grouped) {
|
|
332
|
+
lines.push('');
|
|
333
|
+
lines.push(`${kind} (${arr.length}):`);
|
|
334
|
+
for (const f of arr.slice(0, 20)) {
|
|
335
|
+
const loc = f.line ? `${f.source}:${f.line}` : f.source;
|
|
336
|
+
lines.push(` - [${f.severity}] ${loc} — ${f.message}`);
|
|
337
|
+
if (f.suggestion)
|
|
338
|
+
lines.push(` suggestion: ${f.suggestion}`);
|
|
339
|
+
}
|
|
340
|
+
if (arr.length > 20)
|
|
341
|
+
lines.push(` ... ${arr.length - 20} more`);
|
|
342
|
+
}
|
|
343
|
+
if (report.limitations.length > 0) {
|
|
344
|
+
lines.push('');
|
|
345
|
+
lines.push('Limitations:');
|
|
346
|
+
for (const l of report.limitations)
|
|
347
|
+
lines.push(` - ${l}`);
|
|
348
|
+
}
|
|
349
|
+
return lines.join('\n');
|
|
350
|
+
}
|
|
351
|
+
export function renderContradictionReportMarkdown(report) {
|
|
352
|
+
const lines = [];
|
|
353
|
+
lines.push('# Contradictions report');
|
|
354
|
+
lines.push('');
|
|
355
|
+
lines.push(`- Findings: **${report.findings.length}**`);
|
|
356
|
+
lines.push(`- Docs scanned: **${report.filesScanned}**`);
|
|
357
|
+
if (report.findings.length === 0) {
|
|
358
|
+
lines.push('');
|
|
359
|
+
lines.push('_No contradictions found._');
|
|
360
|
+
return lines.join('\n');
|
|
361
|
+
}
|
|
362
|
+
lines.push('');
|
|
363
|
+
lines.push('## Findings');
|
|
364
|
+
lines.push('');
|
|
365
|
+
lines.push('| Severity | Kind | Source | Reference | Message | Suggestion |');
|
|
366
|
+
lines.push('|---|---|---|---|---|---|');
|
|
367
|
+
for (const f of report.findings) {
|
|
368
|
+
const loc = f.line ? `${f.source}:${f.line}` : f.source;
|
|
369
|
+
lines.push(`| ${f.severity} | ${f.kind} | \`${loc}\` | \`${f.reference}\` | ${f.message} | ${f.suggestion ?? '-'} |`);
|
|
370
|
+
}
|
|
371
|
+
if (report.limitations.length > 0) {
|
|
372
|
+
lines.push('');
|
|
373
|
+
lines.push('## Limitations');
|
|
374
|
+
lines.push('');
|
|
375
|
+
for (const l of report.limitations)
|
|
376
|
+
lines.push(`- ${l}`);
|
|
377
|
+
}
|
|
378
|
+
return lines.join('\n');
|
|
379
|
+
}
|
|
380
|
+
export function renderContradictionReportHtml(report) {
|
|
381
|
+
const rows = report.findings
|
|
382
|
+
.map((f) => `<tr><td>${f.severity}</td><td>${f.kind}</td><td><code>${esc(f.source)}${f.line ? `:${f.line}` : ''}</code></td><td><code>${esc(f.reference)}</code></td><td>${esc(f.message)}</td><td>${esc(f.suggestion ?? '')}</td></tr>`)
|
|
383
|
+
.join('\n');
|
|
384
|
+
return `<!doctype html><html><head><meta charset="utf-8"><title>Contradictions</title><style>body{font-family:system-ui;max-width:920px;margin:32px auto;padding:0 16px}table{width:100%;border-collapse:collapse}th,td{border:1px solid #ddd;padding:6px;font-size:13px;text-align:left}th{background:#f6f6f6}code{font-size:12px}</style></head><body><h1>Contradictions report</h1><p>Findings: <strong>${report.findings.length}</strong> · Docs scanned: <strong>${report.filesScanned}</strong></p><table><thead><tr><th>Severity</th><th>Kind</th><th>Source</th><th>Reference</th><th>Message</th><th>Suggestion</th></tr></thead><tbody>${rows}</tbody></table></body></html>`;
|
|
385
|
+
}
|
|
386
|
+
function esc(s) {
|
|
387
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
388
|
+
}
|
|
389
|
+
export function renderContradictionReportJson(report) {
|
|
390
|
+
return JSON.stringify(report, null, 2);
|
|
391
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type IConvention } from '@shrkcrft/plugin-api';
|
|
2
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
export declare const CONVENTION_REGISTRY_SCHEMA = "sharkcraft.convention-registry/v1";
|
|
4
|
+
export declare enum ConventionSource {
|
|
5
|
+
Local = "local",
|
|
6
|
+
Pack = "pack",
|
|
7
|
+
Fixture = "fixture"
|
|
8
|
+
}
|
|
9
|
+
export interface IConventionEntry {
|
|
10
|
+
readonly convention: IConvention;
|
|
11
|
+
readonly source: ConventionSource;
|
|
12
|
+
readonly packageName?: string;
|
|
13
|
+
readonly sourceFile: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IConventionDoctorIssue {
|
|
16
|
+
readonly severity: 'info' | 'warning' | 'error';
|
|
17
|
+
readonly code: string;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly conventionId?: string;
|
|
20
|
+
readonly source?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function loadConventions(inspection: ISharkcraftInspection): Promise<{
|
|
23
|
+
entries: readonly IConventionEntry[];
|
|
24
|
+
issues: readonly IConventionDoctorIssue[];
|
|
25
|
+
}>;
|
|
26
|
+
export declare function listConventions(inspection: ISharkcraftInspection): Promise<readonly IConventionEntry[]>;
|
|
27
|
+
export declare function findConvention(inspection: ISharkcraftInspection, id: string): Promise<IConventionEntry | null>;
|
|
28
|
+
export declare function listConventionIssues(inspection: ISharkcraftInspection): Promise<readonly IConventionDoctorIssue[]>;
|
|
29
|
+
export interface IConventionCheckHit {
|
|
30
|
+
readonly conventionId: string;
|
|
31
|
+
readonly ruleId: string;
|
|
32
|
+
readonly file: string;
|
|
33
|
+
readonly line?: number;
|
|
34
|
+
readonly severity: 'info' | 'warning' | 'error';
|
|
35
|
+
readonly message: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IConventionCheckReport {
|
|
38
|
+
readonly schema: 'sharkcraft.convention-check/v1';
|
|
39
|
+
readonly filesScanned: number;
|
|
40
|
+
readonly hits: readonly IConventionCheckHit[];
|
|
41
|
+
readonly verdict: 'clean' | 'has-violations';
|
|
42
|
+
}
|
|
43
|
+
export declare function checkConventionsAgainstFiles(inspection: ISharkcraftInspection, files: readonly string[]): Promise<IConventionCheckReport>;
|
|
44
|
+
//# sourceMappingURL=convention-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convention-registry.d.ts","sourceRoot":"","sources":["../src/convention-registry.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAE9E,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AA4BD,wBAAsB,eAAe,CACnC,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAAC,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAA;CAAE,CAAC,CAoF9F;AAED,wBAAsB,eAAe,CACnC,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAGtC;AAED,wBAAsB,cAAc,CAClC,UAAU,EAAE,qBAAqB,EACjC,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAGlC;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,SAAS,sBAAsB,EAAE,CAAC,CAG5C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,gCAAgC,CAAC;IAClD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAAC;CAC9C;AAiBD,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,sBAAsB,CAAC,CAqCjC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Convention registry. Loads pack + local conventions and validates
|
|
11
|
+
* them. Engine has no built-in conventions; everything comes from
|
|
12
|
+
* contributions.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync } from 'node:fs';
|
|
15
|
+
import * as nodePath from 'node:path';
|
|
16
|
+
import { pathToFileURL } from 'node:url';
|
|
17
|
+
import { validateConvention, } from '@shrkcrft/plugin-api';
|
|
18
|
+
export const CONVENTION_REGISTRY_SCHEMA = 'sharkcraft.convention-registry/v1';
|
|
19
|
+
export var ConventionSource;
|
|
20
|
+
(function (ConventionSource) {
|
|
21
|
+
ConventionSource["Local"] = "local";
|
|
22
|
+
ConventionSource["Pack"] = "pack";
|
|
23
|
+
ConventionSource["Fixture"] = "fixture";
|
|
24
|
+
})(ConventionSource || (ConventionSource = {}));
|
|
25
|
+
async function importDefault(file) {
|
|
26
|
+
const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(file).href)));
|
|
27
|
+
if (Array.isArray(mod.default))
|
|
28
|
+
return mod.default;
|
|
29
|
+
if (mod.default && typeof mod.default === 'object')
|
|
30
|
+
return [mod.default];
|
|
31
|
+
if (Array.isArray(mod.conventions))
|
|
32
|
+
return mod.conventions;
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
function localFiles(inspection) {
|
|
36
|
+
const out = [];
|
|
37
|
+
const dir = inspection.sharkcraftDir;
|
|
38
|
+
if (!dir)
|
|
39
|
+
return [];
|
|
40
|
+
for (const name of ['conventions.ts', 'conventions/index.ts']) {
|
|
41
|
+
const abs = nodePath.join(dir, name);
|
|
42
|
+
if (existsSync(abs))
|
|
43
|
+
out.push(abs);
|
|
44
|
+
}
|
|
45
|
+
const cfg = inspection.config;
|
|
46
|
+
for (const rel of cfg?.conventionFiles ?? []) {
|
|
47
|
+
out.push(nodePath.isAbsolute(rel) ? rel : nodePath.join(dir, rel));
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
export async function loadConventions(inspection) {
|
|
52
|
+
const entries = [];
|
|
53
|
+
const issues = [];
|
|
54
|
+
const seen = new Set();
|
|
55
|
+
const ingest = (raw, source, packageName, sourceFile) => {
|
|
56
|
+
const v = validateConvention(raw);
|
|
57
|
+
if (!v.valid) {
|
|
58
|
+
for (const i of v.issues) {
|
|
59
|
+
issues.push({
|
|
60
|
+
severity: 'error',
|
|
61
|
+
code: 'invalid-convention',
|
|
62
|
+
message: `${i.field}: ${i.message}`,
|
|
63
|
+
conventionId: typeof raw.id === 'string' ? raw.id : undefined,
|
|
64
|
+
source: sourceFile,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (seen.has(raw.id)) {
|
|
70
|
+
issues.push({
|
|
71
|
+
severity: 'error',
|
|
72
|
+
code: 'duplicate-id',
|
|
73
|
+
message: `Convention "${raw.id}" already loaded; skipping ${sourceFile}.`,
|
|
74
|
+
conventionId: raw.id,
|
|
75
|
+
source: sourceFile,
|
|
76
|
+
});
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
seen.add(raw.id);
|
|
80
|
+
entries.push({
|
|
81
|
+
convention: raw,
|
|
82
|
+
source,
|
|
83
|
+
...(packageName ? { packageName } : {}),
|
|
84
|
+
sourceFile,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
for (const file of localFiles(inspection)) {
|
|
88
|
+
try {
|
|
89
|
+
const list = await importDefault(file);
|
|
90
|
+
const rel = nodePath.relative(inspection.projectRoot, file) || file;
|
|
91
|
+
for (const c of list)
|
|
92
|
+
ingest(c, ConventionSource.Local, undefined, rel);
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
issues.push({
|
|
96
|
+
severity: 'warning',
|
|
97
|
+
code: 'load-failed',
|
|
98
|
+
message: `Failed to load ${file}: ${e.message}`,
|
|
99
|
+
source: file,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
for (const pack of inspection.packs.validPacks ?? []) {
|
|
104
|
+
const contributions = (pack.manifest?.contributions ?? {});
|
|
105
|
+
for (const rel of contributions.conventionFiles ?? []) {
|
|
106
|
+
const file = nodePath.resolve(pack.packageRoot, rel);
|
|
107
|
+
if (!existsSync(file)) {
|
|
108
|
+
issues.push({
|
|
109
|
+
severity: 'warning',
|
|
110
|
+
code: 'missing-file',
|
|
111
|
+
message: `Pack ${pack.packageName} declares ${rel} but file is missing.`,
|
|
112
|
+
source: file,
|
|
113
|
+
});
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
const list = await importDefault(file);
|
|
118
|
+
for (const c of list)
|
|
119
|
+
ingest(c, ConventionSource.Pack, pack.packageName, rel);
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
issues.push({
|
|
123
|
+
severity: 'warning',
|
|
124
|
+
code: 'load-failed',
|
|
125
|
+
message: `Pack ${pack.packageName} (${rel}): ${e.message}`,
|
|
126
|
+
source: file,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return { entries, issues };
|
|
132
|
+
}
|
|
133
|
+
export async function listConventions(inspection) {
|
|
134
|
+
const { entries } = await loadConventions(inspection);
|
|
135
|
+
return entries;
|
|
136
|
+
}
|
|
137
|
+
export async function findConvention(inspection, id) {
|
|
138
|
+
const entries = await listConventions(inspection);
|
|
139
|
+
return entries.find((e) => e.convention.id === id) ?? null;
|
|
140
|
+
}
|
|
141
|
+
export async function listConventionIssues(inspection) {
|
|
142
|
+
const { issues } = await loadConventions(inspection);
|
|
143
|
+
return issues;
|
|
144
|
+
}
|
|
145
|
+
function globMatch(file, pattern) {
|
|
146
|
+
// very small POSIX-style matcher: ** = any path, * = any segment chars
|
|
147
|
+
const re = new RegExp('^' +
|
|
148
|
+
pattern
|
|
149
|
+
.replace(/[.+^$()|]/g, (m) => '\\' + m)
|
|
150
|
+
.replace(/\*\*/g, '__DOUBLE__')
|
|
151
|
+
.replace(/\*/g, '[^/]*')
|
|
152
|
+
.replace(/__DOUBLE__/g, '.*')
|
|
153
|
+
.replace(/\?/g, '.') +
|
|
154
|
+
'$');
|
|
155
|
+
return re.test(file);
|
|
156
|
+
}
|
|
157
|
+
export async function checkConventionsAgainstFiles(inspection, files) {
|
|
158
|
+
const entries = await listConventions(inspection);
|
|
159
|
+
const hits = [];
|
|
160
|
+
for (const f of files) {
|
|
161
|
+
for (const entry of entries) {
|
|
162
|
+
const c = entry.convention;
|
|
163
|
+
const globs = c.appliesTo?.fileGlobs ?? [];
|
|
164
|
+
if (globs.length > 0 && !globs.some((g) => globMatch(f, g)))
|
|
165
|
+
continue;
|
|
166
|
+
for (const r of c.rules) {
|
|
167
|
+
const sev = r.severity ?? c.severity;
|
|
168
|
+
if (r.filePattern && !new RegExp(r.filePattern).test(f)) {
|
|
169
|
+
hits.push({
|
|
170
|
+
conventionId: c.id,
|
|
171
|
+
ruleId: r.id,
|
|
172
|
+
file: f,
|
|
173
|
+
severity: sev,
|
|
174
|
+
message: `File "${f}" does not match convention "${c.id}" rule "${r.id}": ${r.description}`,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
if (r.forbidMatch && new RegExp(r.forbidMatch).test(f)) {
|
|
178
|
+
hits.push({
|
|
179
|
+
conventionId: c.id,
|
|
180
|
+
ruleId: r.id,
|
|
181
|
+
file: f,
|
|
182
|
+
severity: sev,
|
|
183
|
+
message: `File "${f}" matches forbidden pattern from convention "${c.id}" rule "${r.id}": ${r.description}`,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
schema: 'sharkcraft.convention-check/v1',
|
|
191
|
+
filesScanned: files.length,
|
|
192
|
+
hits,
|
|
193
|
+
verdict: hits.some((h) => h.severity === 'error') ? 'has-violations' : 'clean',
|
|
194
|
+
};
|
|
195
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
2
|
+
export interface ICoverageCategory {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
total: number;
|
|
6
|
+
covered: number;
|
|
7
|
+
/** 0..100 percentage. */
|
|
8
|
+
score: number;
|
|
9
|
+
/** Detail lines for items missing coverage. */
|
|
10
|
+
missing: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface ICoverageReport {
|
|
13
|
+
categories: ICoverageCategory[];
|
|
14
|
+
/** Overall average score (0..100). */
|
|
15
|
+
overall: number;
|
|
16
|
+
/** Free-form suggestions. */
|
|
17
|
+
suggestions: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Deterministic coverage report. Different from AI-readiness — focuses on
|
|
21
|
+
* **relationships**: do entries link to each other in a way that lets an
|
|
22
|
+
* agent traverse the project intelligence?
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildCoverageReport(inspection: ISharkcraftInspection): ICoverageReport;
|
|
25
|
+
//# sourceMappingURL=coverage-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-report.d.ts","sourceRoot":"","sources":["../src/coverage-report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAOD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,qBAAqB,GAAG,eAAe,CAiLtF"}
|