@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,279 @@
|
|
|
1
|
+
import { KnowledgeType, hasActionHints } from '@shrkcrft/knowledge';
|
|
2
|
+
import { diagnoseActionHints } from "./action-hint-diagnostics.js";
|
|
3
|
+
import { runDoctor } from "./sharkcraft-inspector.js";
|
|
4
|
+
function gradeOf(score) {
|
|
5
|
+
if (score >= 85)
|
|
6
|
+
return 'excellent';
|
|
7
|
+
if (score >= 70)
|
|
8
|
+
return 'good';
|
|
9
|
+
if (score >= 50)
|
|
10
|
+
return 'partial';
|
|
11
|
+
return 'poor';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Map a count into a 0..10 score with a soft cap. Once the count reaches
|
|
15
|
+
* `softCap`, further increases yield diminishing returns; the score levels
|
|
16
|
+
* off at `softCap * 1.5` so a repo with 1000 entries doesn't outscore one
|
|
17
|
+
* with focused 30.
|
|
18
|
+
*/
|
|
19
|
+
function softCapScore(count, softCap) {
|
|
20
|
+
if (count <= 0)
|
|
21
|
+
return 0;
|
|
22
|
+
if (count >= softCap * 1.5)
|
|
23
|
+
return 10;
|
|
24
|
+
if (count >= softCap) {
|
|
25
|
+
const extra = count - softCap;
|
|
26
|
+
const slack = softCap * 0.5;
|
|
27
|
+
return Math.min(10, 8 + Math.round((extra / slack) * 2));
|
|
28
|
+
}
|
|
29
|
+
return Math.min(8, Math.round((count / softCap) * 8));
|
|
30
|
+
}
|
|
31
|
+
const PLACEHOLDER_MARKERS = [/\bTODO\b/i, /\bTBD\b/i, /\bplaceholder\b/i, /\bfill\s*in\b/i];
|
|
32
|
+
const WORKFLOW_TYPES = new Set(['workflow', 'decision', 'convention']);
|
|
33
|
+
function isCriticalOrHighWorkflow(entry) {
|
|
34
|
+
if (!WORKFLOW_TYPES.has(String(entry.type)))
|
|
35
|
+
return false;
|
|
36
|
+
const p = String(entry.priority);
|
|
37
|
+
return p === 'critical' || p === 'high';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Deterministic 0..100 AI-readiness score. Penalties are explicit:
|
|
41
|
+
* - Quantity-only "stuff a registry full of entries" is capped via softCap.
|
|
42
|
+
* - Duplicate-id warnings reduce data-quality dimension.
|
|
43
|
+
* - Placeholder docs (TODO / TBD / "fill in") reduce docs dimension.
|
|
44
|
+
* - Critical/high workflow entries missing actionHints reduce safety dim.
|
|
45
|
+
* - Doctor health stays a hard gate.
|
|
46
|
+
*/
|
|
47
|
+
export function buildAiReadinessReport(inspection) {
|
|
48
|
+
const dims = [];
|
|
49
|
+
const recs = [];
|
|
50
|
+
// 1) Config present
|
|
51
|
+
dims.push({
|
|
52
|
+
id: 'config',
|
|
53
|
+
title: 'sharkcraft.config.ts present',
|
|
54
|
+
weight: 0.5,
|
|
55
|
+
score: inspection.configFile ? 10 : 0,
|
|
56
|
+
note: inspection.configFile
|
|
57
|
+
? `loaded from ${inspection.configFile}`
|
|
58
|
+
: 'missing — using defaults',
|
|
59
|
+
});
|
|
60
|
+
if (!inspection.configFile) {
|
|
61
|
+
recs.push('Create sharkcraft/sharkcraft.config.ts to opt in to project-specific config.');
|
|
62
|
+
}
|
|
63
|
+
// 2) Knowledge entries — softcap at 15 (focused) and full at 22.
|
|
64
|
+
const k = inspection.knowledgeEntries.length;
|
|
65
|
+
dims.push({
|
|
66
|
+
id: 'knowledge',
|
|
67
|
+
title: 'Knowledge entries loaded',
|
|
68
|
+
weight: 1.0,
|
|
69
|
+
score: softCapScore(k, 15),
|
|
70
|
+
note: `${k} entries (softcap 15, full at 22)`,
|
|
71
|
+
});
|
|
72
|
+
if (k < 10)
|
|
73
|
+
recs.push('Add more structured knowledge entries (target: 10+).');
|
|
74
|
+
// 3) Rules — softcap at 8.
|
|
75
|
+
const rules = inspection.knowledgeEntries.filter((e) => String(e.type) === KnowledgeType.Rule);
|
|
76
|
+
dims.push({
|
|
77
|
+
id: 'rules',
|
|
78
|
+
title: 'Rules',
|
|
79
|
+
weight: 1.0,
|
|
80
|
+
score: softCapScore(rules.length, 8),
|
|
81
|
+
note: `${rules.length} rules (softcap 8)`,
|
|
82
|
+
});
|
|
83
|
+
if (rules.length < 5)
|
|
84
|
+
recs.push('Add at least 5 rules describing coding/architecture conventions.');
|
|
85
|
+
// 4) Path conventions — softcap at 6.
|
|
86
|
+
const paths = inspection.pathService.list();
|
|
87
|
+
dims.push({
|
|
88
|
+
id: 'paths',
|
|
89
|
+
title: 'Path conventions',
|
|
90
|
+
weight: 0.8,
|
|
91
|
+
score: softCapScore(paths.length, 6),
|
|
92
|
+
note: `${paths.length} path conventions (softcap 6)`,
|
|
93
|
+
});
|
|
94
|
+
if (paths.length < 4)
|
|
95
|
+
recs.push('Add path conventions for src/, services/, utils/, tests/ etc.');
|
|
96
|
+
// 5) Templates — softcap at 4.
|
|
97
|
+
const t = inspection.templates.length;
|
|
98
|
+
dims.push({
|
|
99
|
+
id: 'templates',
|
|
100
|
+
title: 'Templates',
|
|
101
|
+
weight: 0.8,
|
|
102
|
+
score: softCapScore(t, 4),
|
|
103
|
+
note: `${t} templates (softcap 4)`,
|
|
104
|
+
});
|
|
105
|
+
if (t < 3)
|
|
106
|
+
recs.push('Define templates for the constructs you generate most often.');
|
|
107
|
+
// 6) Pipelines — softcap at 3.
|
|
108
|
+
const p = inspection.pipelines.length;
|
|
109
|
+
dims.push({
|
|
110
|
+
id: 'pipelines',
|
|
111
|
+
title: 'Pipelines',
|
|
112
|
+
weight: 0.8,
|
|
113
|
+
score: softCapScore(p, 3),
|
|
114
|
+
note: `${p} pipelines (softcap 3)`,
|
|
115
|
+
});
|
|
116
|
+
if (p < 2)
|
|
117
|
+
recs.push('Add at least one feature-dev or safe-generation pipeline.');
|
|
118
|
+
// 7) Action-hint coverage — fraction of entries that carry hints.
|
|
119
|
+
const withHints = inspection.knowledgeEntries.filter((e) => hasActionHints(e)).length;
|
|
120
|
+
const hintsScore = k === 0 ? 0 : Math.min(10, Math.round((withHints / Math.max(k, 1)) * 20));
|
|
121
|
+
dims.push({
|
|
122
|
+
id: 'action-hints',
|
|
123
|
+
title: 'Entries with action hints',
|
|
124
|
+
weight: 1.2,
|
|
125
|
+
score: hintsScore,
|
|
126
|
+
note: `${withHints} of ${k} entries carry actionHints`,
|
|
127
|
+
});
|
|
128
|
+
if (hintsScore < 7)
|
|
129
|
+
recs.push('Add actionHints to high-priority rules (commands, mcpTools, forbiddenActions).');
|
|
130
|
+
// 8) Verification commands
|
|
131
|
+
const haveVerify = inspection.knowledgeEntries.some((e) => (e.actionHints?.verificationCommands?.length ?? 0) > 0);
|
|
132
|
+
dims.push({
|
|
133
|
+
id: 'verification',
|
|
134
|
+
title: 'Verification commands defined',
|
|
135
|
+
weight: 0.6,
|
|
136
|
+
score: haveVerify ? 10 : 0,
|
|
137
|
+
note: haveVerify ? 'at least one entry lists verification commands' : 'no entry lists verification commands',
|
|
138
|
+
});
|
|
139
|
+
if (!haveVerify)
|
|
140
|
+
recs.push('Add verificationCommands to safety/generation rules (e.g. typecheck + tests).');
|
|
141
|
+
// 9) Forbidden actions
|
|
142
|
+
const haveForbidden = inspection.knowledgeEntries.some((e) => (e.actionHints?.forbiddenActions?.length ?? 0) > 0);
|
|
143
|
+
dims.push({
|
|
144
|
+
id: 'forbidden',
|
|
145
|
+
title: 'Forbidden actions declared',
|
|
146
|
+
weight: 0.6,
|
|
147
|
+
score: haveForbidden ? 10 : 0,
|
|
148
|
+
note: haveForbidden ? 'at least one entry lists forbiddenActions' : 'no entry lists forbiddenActions',
|
|
149
|
+
});
|
|
150
|
+
if (!haveForbidden)
|
|
151
|
+
recs.push('Add forbiddenActions to clarify what agents must NOT do.');
|
|
152
|
+
// 10) Docs — softcap at 4. Penalize placeholder docs.
|
|
153
|
+
const docFiles = inspection.sourceFiles.filter((s) => s.endsWith('.md'));
|
|
154
|
+
let placeholderDocCount = 0;
|
|
155
|
+
for (const entry of inspection.knowledgeEntries) {
|
|
156
|
+
if (!entry.source?.origin?.endsWith('.md'))
|
|
157
|
+
continue;
|
|
158
|
+
if (PLACEHOLDER_MARKERS.some((re) => re.test(entry.content))) {
|
|
159
|
+
placeholderDocCount += 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const docsRaw = softCapScore(docFiles.length, 4);
|
|
163
|
+
const docsPenalty = Math.min(docsRaw, placeholderDocCount * 2);
|
|
164
|
+
dims.push({
|
|
165
|
+
id: 'docs',
|
|
166
|
+
title: 'Docs / task files',
|
|
167
|
+
weight: 0.4,
|
|
168
|
+
score: Math.max(0, docsRaw - docsPenalty),
|
|
169
|
+
note: placeholderDocCount > 0
|
|
170
|
+
? `${docFiles.length} markdown files (-${docsPenalty} for ${placeholderDocCount} placeholder markers)`
|
|
171
|
+
: `${docFiles.length} markdown files`,
|
|
172
|
+
});
|
|
173
|
+
if (placeholderDocCount > 0) {
|
|
174
|
+
recs.push(`Replace TODO/placeholder markers in ${placeholderDocCount} doc/task file(s).`);
|
|
175
|
+
}
|
|
176
|
+
// 11) Doctor health — passes is a near-required gate.
|
|
177
|
+
//
|
|
178
|
+
// Action-hint quality warnings are also surfaced by the doctor, but the
|
|
179
|
+
// dedicated `hint-quality` dimension below already scores them. Counting
|
|
180
|
+
// them here too would punish the same warning twice and crush the score
|
|
181
|
+
// once a repo crosses ten hint warnings. Exclude them from this dimension.
|
|
182
|
+
const doctor = runDoctor(inspection);
|
|
183
|
+
const structuralWarnings = doctor.checks.filter((c) => c.severity === 'warning' &&
|
|
184
|
+
!c.id.startsWith('actionhints-')).length;
|
|
185
|
+
const doctorScore = doctor.passed ? Math.max(0, 10 - structuralWarnings) : 0;
|
|
186
|
+
dims.push({
|
|
187
|
+
id: 'doctor',
|
|
188
|
+
title: 'Doctor health',
|
|
189
|
+
weight: 1.0,
|
|
190
|
+
score: doctorScore,
|
|
191
|
+
note: doctor.passed
|
|
192
|
+
? `passed (${structuralWarnings} structural warnings, ${doctor.summary.warnings} total)`
|
|
193
|
+
: `${doctor.summary.errors} errors`,
|
|
194
|
+
});
|
|
195
|
+
if (!doctor.passed)
|
|
196
|
+
recs.push('Fix doctor errors before relying on agent workflows.');
|
|
197
|
+
// 12) Pack discovery health
|
|
198
|
+
const packs = inspection.packs;
|
|
199
|
+
const packsScore = packs.discoveredPacks.length === 0
|
|
200
|
+
? 5 // neutral when no packs are installed
|
|
201
|
+
: packs.invalidPacks.length === 0
|
|
202
|
+
? 10
|
|
203
|
+
: 4;
|
|
204
|
+
dims.push({
|
|
205
|
+
id: 'packs',
|
|
206
|
+
title: 'Pack discovery health',
|
|
207
|
+
weight: 0.4,
|
|
208
|
+
score: packsScore,
|
|
209
|
+
note: packs.discoveredPacks.length === 0
|
|
210
|
+
? 'no packs discovered'
|
|
211
|
+
: `${packs.validPacks.length}/${packs.discoveredPacks.length} packs valid`,
|
|
212
|
+
});
|
|
213
|
+
if (packs.invalidPacks.length > 0) {
|
|
214
|
+
recs.push('Fix invalid pack manifests (see `shrk packs doctor`).');
|
|
215
|
+
}
|
|
216
|
+
// 13) Generation safety — flagship cli-only write policy rule required.
|
|
217
|
+
const hasDryRunDefault = inspection.knowledgeEntries.some((e) => e.actionHints?.writePolicy === 'cli-only' ||
|
|
218
|
+
(e.actionHints?.forbiddenActions ?? []).some((f) => /write through mcp/i.test(f)));
|
|
219
|
+
// Additionally penalize when any critical/high workflow entry lacks hints.
|
|
220
|
+
const workflowMissingHints = inspection.knowledgeEntries.filter((e) => isCriticalOrHighWorkflow(e) && !hasActionHints(e)).length;
|
|
221
|
+
let safetyScore = hasDryRunDefault ? 10 : 3;
|
|
222
|
+
if (workflowMissingHints > 0) {
|
|
223
|
+
safetyScore = Math.max(0, safetyScore - Math.min(safetyScore, workflowMissingHints * 2));
|
|
224
|
+
}
|
|
225
|
+
dims.push({
|
|
226
|
+
id: 'safety',
|
|
227
|
+
title: 'Generation safety readiness',
|
|
228
|
+
weight: 1.0,
|
|
229
|
+
score: safetyScore,
|
|
230
|
+
note: hasDryRunDefault
|
|
231
|
+
? workflowMissingHints > 0
|
|
232
|
+
? `cli-only write policy present, but ${workflowMissingHints} critical/high workflow entry/entries lack actionHints`
|
|
233
|
+
: 'cli-only write policy + forbidden-actions present'
|
|
234
|
+
: 'no entry declares cli-only write policy',
|
|
235
|
+
});
|
|
236
|
+
if (!hasDryRunDefault) {
|
|
237
|
+
recs.push('Add a critical safety rule with writePolicy:"cli-only" and "do not write through MCP".');
|
|
238
|
+
}
|
|
239
|
+
if (workflowMissingHints > 0) {
|
|
240
|
+
recs.push(`Add actionHints to ${workflowMissingHints} critical/high workflow entry/entries.`);
|
|
241
|
+
}
|
|
242
|
+
// 14) Action-hint quality (delegates to diagnostics).
|
|
243
|
+
const hintReport = diagnoseActionHints(inspection.knowledgeEntries);
|
|
244
|
+
const hintIssueScore = hintReport.evaluatedEntryCount === 0
|
|
245
|
+
? 5
|
|
246
|
+
: Math.max(0, 10 -
|
|
247
|
+
Math.min(10, Math.round((hintReport.issues.length / hintReport.evaluatedEntryCount) * 5)));
|
|
248
|
+
dims.push({
|
|
249
|
+
id: 'hint-quality',
|
|
250
|
+
title: 'Action-hint quality',
|
|
251
|
+
weight: 0.6,
|
|
252
|
+
score: hintIssueScore,
|
|
253
|
+
note: `${hintReport.issues.length} quality warnings across ${hintReport.evaluatedEntryCount} relevant entries`,
|
|
254
|
+
});
|
|
255
|
+
// 15) Data quality — duplicate ids surface as warnings.
|
|
256
|
+
const dupCount = inspection.validationIssues.filter((v) => v.code === 'duplicate-id').length;
|
|
257
|
+
const dataQualityScore = Math.max(0, 10 - Math.min(10, dupCount * 2));
|
|
258
|
+
dims.push({
|
|
259
|
+
id: 'data-quality',
|
|
260
|
+
title: 'Data quality (no duplicates)',
|
|
261
|
+
weight: 0.5,
|
|
262
|
+
score: dataQualityScore,
|
|
263
|
+
note: dupCount === 0
|
|
264
|
+
? 'no duplicate knowledge ids'
|
|
265
|
+
: `${dupCount} duplicate id(s) — first occurrence kept`,
|
|
266
|
+
});
|
|
267
|
+
if (dupCount > 0)
|
|
268
|
+
recs.push(`Resolve ${dupCount} duplicate knowledge id(s).`);
|
|
269
|
+
// Aggregate.
|
|
270
|
+
const totalWeight = dims.reduce((sum, d) => sum + d.weight, 0);
|
|
271
|
+
const weightedSum = dims.reduce((sum, d) => sum + d.score * d.weight, 0);
|
|
272
|
+
const score = Math.round((weightedSum / totalWeight) * 10);
|
|
273
|
+
return {
|
|
274
|
+
score,
|
|
275
|
+
grade: gradeOf(score),
|
|
276
|
+
dimensions: dims,
|
|
277
|
+
topRecommendations: recs.slice(0, 5),
|
|
278
|
+
};
|
|
279
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
2
|
+
export declare const API_REPORT_SCHEMA = "sharkcraft.api-report/v1";
|
|
3
|
+
export interface IPackageApiEntry {
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
packageRoot: string;
|
|
7
|
+
hasReadme: boolean;
|
|
8
|
+
main?: string;
|
|
9
|
+
types?: string;
|
|
10
|
+
bin?: Record<string, string>;
|
|
11
|
+
exports?: Record<string, unknown>;
|
|
12
|
+
deprecatedReexports: readonly string[];
|
|
13
|
+
exportedSymbols: readonly string[];
|
|
14
|
+
notes: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
export interface IApiReport {
|
|
17
|
+
schema: typeof API_REPORT_SCHEMA;
|
|
18
|
+
generatedAt: string;
|
|
19
|
+
packages: readonly IPackageApiEntry[];
|
|
20
|
+
}
|
|
21
|
+
export interface IApiDiffEntry {
|
|
22
|
+
package: string;
|
|
23
|
+
added: readonly string[];
|
|
24
|
+
removed: readonly string[];
|
|
25
|
+
/** package metadata changes (version, bin, types, etc.) */
|
|
26
|
+
metadataChanges: readonly {
|
|
27
|
+
field: string;
|
|
28
|
+
from: unknown;
|
|
29
|
+
to: unknown;
|
|
30
|
+
}[];
|
|
31
|
+
/** Symbols that look like breaking-change suspects (removed from a public surface). */
|
|
32
|
+
breakingSuspects: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
export interface IApiDiffReport {
|
|
35
|
+
schema: 'sharkcraft.api-report-diff/v1';
|
|
36
|
+
generatedAt: string;
|
|
37
|
+
oldGeneratedAt?: string;
|
|
38
|
+
newGeneratedAt: string;
|
|
39
|
+
addedPackages: readonly string[];
|
|
40
|
+
removedPackages: readonly string[];
|
|
41
|
+
entries: readonly IApiDiffEntry[];
|
|
42
|
+
/** delta of total public-surface size across all packages. */
|
|
43
|
+
publicSurfaceDelta: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function diffApiReports(oldReport: IApiReport, newReport: IApiReport): IApiDiffReport;
|
|
46
|
+
export declare function renderApiDiffMarkdown(diff: IApiDiffReport): string;
|
|
47
|
+
export declare function renderApiDiffHtml(diff: IApiDiffReport): string;
|
|
48
|
+
export declare function buildApiReport(inspection: ISharkcraftInspection, options?: {
|
|
49
|
+
packageFilter?: string;
|
|
50
|
+
}): IApiReport;
|
|
51
|
+
//# sourceMappingURL=api-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-report.d.ts","sourceRoot":"","sources":["../src/api-report.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,iBAAiB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACvC;AAsED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,2DAA2D;IAC3D,eAAe,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC1E,uFAAuF;IACvF,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,+BAA+B,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,8DAA8D;IAC9D,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,cAAc,CAsD3F;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CA6BlE;AAMD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAgB9D;AAED,wBAAgB,cAAc,CAC5B,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,UAAU,CA4CZ"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API / package API report.
|
|
3
|
+
*
|
|
4
|
+
* For each @shrkcrft/* package, surface: name, version, main, types,
|
|
5
|
+
* exports, bin, README presence, deprecated re-exports if detectable.
|
|
6
|
+
*
|
|
7
|
+
* Read-only — just reads package.json + index files.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
10
|
+
import * as nodePath from 'node:path';
|
|
11
|
+
export const API_REPORT_SCHEMA = 'sharkcraft.api-report/v1';
|
|
12
|
+
function readPkg(dir) {
|
|
13
|
+
const pkgJson = nodePath.join(dir, 'package.json');
|
|
14
|
+
if (!existsSync(pkgJson))
|
|
15
|
+
return { meta: null, root: dir };
|
|
16
|
+
try {
|
|
17
|
+
return { meta: JSON.parse(readFileSync(pkgJson, 'utf8')), root: dir };
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return { meta: null, root: dir };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function listPackageDirs(projectRoot) {
|
|
24
|
+
const packagesDir = nodePath.join(projectRoot, 'packages');
|
|
25
|
+
if (!existsSync(packagesDir))
|
|
26
|
+
return [];
|
|
27
|
+
const out = [];
|
|
28
|
+
for (const d of readdirSync(packagesDir)) {
|
|
29
|
+
const full = nodePath.join(packagesDir, d);
|
|
30
|
+
try {
|
|
31
|
+
if (statSync(full).isDirectory())
|
|
32
|
+
out.push(full);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
function scanIndexExports(indexFile) {
|
|
41
|
+
if (!existsSync(indexFile))
|
|
42
|
+
return [];
|
|
43
|
+
try {
|
|
44
|
+
const t = readFileSync(indexFile, 'utf8');
|
|
45
|
+
const out = new Set();
|
|
46
|
+
const reExport = /export\s+(?:type\s+)?\*\s+from\s+['"]([^'"]+)['"]/g;
|
|
47
|
+
const namedExport = /export\s+(?:type\s+)?\{([^}]+)\}\s+from/g;
|
|
48
|
+
const inlineDecl = /export\s+(?:async\s+)?(?:const|let|var|function|class|interface|type|enum)\s+([A-Za-z0-9_$]+)/g;
|
|
49
|
+
let m;
|
|
50
|
+
while ((m = reExport.exec(t)) !== null) {
|
|
51
|
+
const ref = m[1] ?? '';
|
|
52
|
+
if (ref)
|
|
53
|
+
out.add(`re-export:${ref}`);
|
|
54
|
+
}
|
|
55
|
+
while ((m = namedExport.exec(t)) !== null) {
|
|
56
|
+
const body = m[1] ?? '';
|
|
57
|
+
for (const sym of body.split(',').map((s) => s.trim().split(/\s+as\s+/)[0] ?? '')) {
|
|
58
|
+
if (sym)
|
|
59
|
+
out.add(sym);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
while ((m = inlineDecl.exec(t)) !== null) {
|
|
63
|
+
const id = m[1] ?? '';
|
|
64
|
+
if (id)
|
|
65
|
+
out.add(id);
|
|
66
|
+
}
|
|
67
|
+
return [...out];
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function detectDeprecated(indexFile) {
|
|
74
|
+
if (!existsSync(indexFile))
|
|
75
|
+
return [];
|
|
76
|
+
try {
|
|
77
|
+
const t = readFileSync(indexFile, 'utf8');
|
|
78
|
+
const out = [];
|
|
79
|
+
const re = /@deprecated\s+([^\n]*)/g;
|
|
80
|
+
let m;
|
|
81
|
+
while ((m = re.exec(t)) !== null)
|
|
82
|
+
out.push((m[1] ?? '').trim());
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export function diffApiReports(oldReport, newReport) {
|
|
90
|
+
const oldByName = new Map(oldReport.packages.map((p) => [p.name, p]));
|
|
91
|
+
const newByName = new Map(newReport.packages.map((p) => [p.name, p]));
|
|
92
|
+
const addedPackages = [];
|
|
93
|
+
const removedPackages = [];
|
|
94
|
+
for (const name of newByName.keys())
|
|
95
|
+
if (!oldByName.has(name))
|
|
96
|
+
addedPackages.push(name);
|
|
97
|
+
for (const name of oldByName.keys())
|
|
98
|
+
if (!newByName.has(name))
|
|
99
|
+
removedPackages.push(name);
|
|
100
|
+
const entries = [];
|
|
101
|
+
let oldSize = 0;
|
|
102
|
+
let newSize = 0;
|
|
103
|
+
for (const p of oldReport.packages)
|
|
104
|
+
oldSize += p.exportedSymbols.length;
|
|
105
|
+
for (const p of newReport.packages)
|
|
106
|
+
newSize += p.exportedSymbols.length;
|
|
107
|
+
for (const [name, newPkg] of newByName.entries()) {
|
|
108
|
+
const oldPkg = oldByName.get(name);
|
|
109
|
+
if (!oldPkg) {
|
|
110
|
+
// newly added package
|
|
111
|
+
entries.push({
|
|
112
|
+
package: name,
|
|
113
|
+
added: newPkg.exportedSymbols,
|
|
114
|
+
removed: [],
|
|
115
|
+
metadataChanges: [],
|
|
116
|
+
breakingSuspects: [],
|
|
117
|
+
});
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const oldSet = new Set(oldPkg.exportedSymbols);
|
|
121
|
+
const newSet = new Set(newPkg.exportedSymbols);
|
|
122
|
+
const added = [...newSet].filter((s) => !oldSet.has(s));
|
|
123
|
+
const removed = [...oldSet].filter((s) => !newSet.has(s));
|
|
124
|
+
const metadataChanges = [];
|
|
125
|
+
if (oldPkg.version !== newPkg.version)
|
|
126
|
+
metadataChanges.push({ field: 'version', from: oldPkg.version, to: newPkg.version });
|
|
127
|
+
if (JSON.stringify(oldPkg.bin ?? {}) !== JSON.stringify(newPkg.bin ?? {}))
|
|
128
|
+
metadataChanges.push({ field: 'bin', from: oldPkg.bin ?? {}, to: newPkg.bin ?? {} });
|
|
129
|
+
if ((oldPkg.types ?? '') !== (newPkg.types ?? ''))
|
|
130
|
+
metadataChanges.push({ field: 'types', from: oldPkg.types ?? '', to: newPkg.types ?? '' });
|
|
131
|
+
if ((oldPkg.main ?? '') !== (newPkg.main ?? ''))
|
|
132
|
+
metadataChanges.push({ field: 'main', from: oldPkg.main ?? '', to: newPkg.main ?? '' });
|
|
133
|
+
const breakingSuspects = removed.filter((sym) => !sym.startsWith('re-export:') && !sym.startsWith('_'));
|
|
134
|
+
if (added.length === 0 && removed.length === 0 && metadataChanges.length === 0)
|
|
135
|
+
continue;
|
|
136
|
+
entries.push({ package: name, added, removed, metadataChanges, breakingSuspects });
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
schema: 'sharkcraft.api-report-diff/v1',
|
|
140
|
+
generatedAt: new Date().toISOString(),
|
|
141
|
+
...(oldReport.generatedAt ? { oldGeneratedAt: oldReport.generatedAt } : {}),
|
|
142
|
+
newGeneratedAt: newReport.generatedAt,
|
|
143
|
+
addedPackages,
|
|
144
|
+
removedPackages,
|
|
145
|
+
entries,
|
|
146
|
+
publicSurfaceDelta: newSize - oldSize,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export function renderApiDiffMarkdown(diff) {
|
|
150
|
+
const lines = [];
|
|
151
|
+
lines.push('# API report diff');
|
|
152
|
+
lines.push('');
|
|
153
|
+
lines.push(`- public surface delta: **${diff.publicSurfaceDelta >= 0 ? '+' : ''}${diff.publicSurfaceDelta}**`);
|
|
154
|
+
if (diff.addedPackages.length > 0)
|
|
155
|
+
lines.push(`- packages added: ${diff.addedPackages.join(', ')}`);
|
|
156
|
+
if (diff.removedPackages.length > 0)
|
|
157
|
+
lines.push(`- packages removed: ${diff.removedPackages.join(', ')}`);
|
|
158
|
+
for (const e of diff.entries) {
|
|
159
|
+
lines.push('');
|
|
160
|
+
lines.push(`## ${e.package}`);
|
|
161
|
+
if (e.added.length > 0) {
|
|
162
|
+
lines.push('### Added');
|
|
163
|
+
for (const s of e.added)
|
|
164
|
+
lines.push(`- \`${s}\``);
|
|
165
|
+
}
|
|
166
|
+
if (e.removed.length > 0) {
|
|
167
|
+
lines.push('### Removed');
|
|
168
|
+
for (const s of e.removed)
|
|
169
|
+
lines.push(`- \`${s}\``);
|
|
170
|
+
}
|
|
171
|
+
if (e.metadataChanges.length > 0) {
|
|
172
|
+
lines.push('### Metadata');
|
|
173
|
+
for (const m of e.metadataChanges)
|
|
174
|
+
lines.push(`- \`${m.field}\`: \`${JSON.stringify(m.from)}\` → \`${JSON.stringify(m.to)}\``);
|
|
175
|
+
}
|
|
176
|
+
if (e.breakingSuspects.length > 0) {
|
|
177
|
+
lines.push('### Breaking-change suspects');
|
|
178
|
+
for (const s of e.breakingSuspects)
|
|
179
|
+
lines.push(`- \`${s}\``);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return lines.join('\n') + '\n';
|
|
183
|
+
}
|
|
184
|
+
function escapeHtml(s) {
|
|
185
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
186
|
+
}
|
|
187
|
+
export function renderApiDiffHtml(diff) {
|
|
188
|
+
const body = [];
|
|
189
|
+
body.push('<h1>API report diff</h1>');
|
|
190
|
+
body.push(`<p>Public surface delta: <strong>${diff.publicSurfaceDelta}</strong></p>`);
|
|
191
|
+
if (diff.addedPackages.length > 0)
|
|
192
|
+
body.push(`<p>Added: ${escapeHtml(diff.addedPackages.join(', '))}</p>`);
|
|
193
|
+
if (diff.removedPackages.length > 0)
|
|
194
|
+
body.push(`<p>Removed: ${escapeHtml(diff.removedPackages.join(', '))}</p>`);
|
|
195
|
+
for (const e of diff.entries) {
|
|
196
|
+
body.push(`<h2>${escapeHtml(e.package)}</h2>`);
|
|
197
|
+
if (e.added.length > 0)
|
|
198
|
+
body.push('<p>Added: ' + e.added.map((s) => `<code>${escapeHtml(s)}</code>`).join(', ') + '</p>');
|
|
199
|
+
if (e.removed.length > 0)
|
|
200
|
+
body.push('<p>Removed: ' + e.removed.map((s) => `<code>${escapeHtml(s)}</code>`).join(', ') + '</p>');
|
|
201
|
+
if (e.breakingSuspects.length > 0)
|
|
202
|
+
body.push('<p>Breaking-change suspects: ' + e.breakingSuspects.map((s) => `<code>${escapeHtml(s)}</code>`).join(', ') + '</p>');
|
|
203
|
+
}
|
|
204
|
+
return `<!doctype html><meta charset="utf-8"><title>API diff</title>${body.join('\n')}`;
|
|
205
|
+
}
|
|
206
|
+
export function buildApiReport(inspection, options = {}) {
|
|
207
|
+
const dirs = listPackageDirs(inspection.projectRoot);
|
|
208
|
+
const packages = [];
|
|
209
|
+
for (const dir of dirs) {
|
|
210
|
+
const { meta } = readPkg(dir);
|
|
211
|
+
if (!meta)
|
|
212
|
+
continue;
|
|
213
|
+
const name = String(meta.name ?? '');
|
|
214
|
+
if (options.packageFilter && name !== options.packageFilter)
|
|
215
|
+
continue;
|
|
216
|
+
const version = String(meta.version ?? '0.0.0');
|
|
217
|
+
const main = typeof meta.main === 'string' ? meta.main : undefined;
|
|
218
|
+
const types = typeof meta.types === 'string' ? meta.types : undefined;
|
|
219
|
+
const bin = meta.bin && typeof meta.bin === 'object' ? meta.bin : undefined;
|
|
220
|
+
const exportsField = meta.exports && typeof meta.exports === 'object' ? meta.exports : undefined;
|
|
221
|
+
const indexCandidates = [
|
|
222
|
+
main && nodePath.resolve(dir, main),
|
|
223
|
+
nodePath.resolve(dir, 'src/index.ts'),
|
|
224
|
+
nodePath.resolve(dir, 'src/main.ts'),
|
|
225
|
+
].filter((s) => typeof s === 'string');
|
|
226
|
+
const indexFile = indexCandidates.find((f) => existsSync(f)) ?? indexCandidates[0];
|
|
227
|
+
const exportedSymbols = indexFile ? scanIndexExports(indexFile) : [];
|
|
228
|
+
const deprecatedReexports = indexFile ? detectDeprecated(indexFile) : [];
|
|
229
|
+
const readmeAbs = nodePath.join(dir, 'README.md');
|
|
230
|
+
const notes = [];
|
|
231
|
+
if (!existsSync(readmeAbs))
|
|
232
|
+
notes.push('README.md missing.');
|
|
233
|
+
if (!indexFile)
|
|
234
|
+
notes.push('No src/index.ts entry detected.');
|
|
235
|
+
packages.push({
|
|
236
|
+
name,
|
|
237
|
+
version,
|
|
238
|
+
packageRoot: dir,
|
|
239
|
+
hasReadme: existsSync(readmeAbs),
|
|
240
|
+
...(main ? { main } : {}),
|
|
241
|
+
...(types ? { types } : {}),
|
|
242
|
+
...(bin ? { bin } : {}),
|
|
243
|
+
...(exportsField ? { exports: exportsField } : {}),
|
|
244
|
+
exportedSymbols,
|
|
245
|
+
deprecatedReexports,
|
|
246
|
+
notes,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
schema: API_REPORT_SCHEMA,
|
|
251
|
+
generatedAt: new Date().toISOString(),
|
|
252
|
+
packages,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply dispatch trace.
|
|
3
|
+
*
|
|
4
|
+
* Builds an explanation of which dispatch path an apply / plan-review will
|
|
5
|
+
* take for a given saved plan: which kind of plan it is (template, helper,
|
|
6
|
+
* plugin-lifecycle, registration-hint, synthetic, unknown), which handler
|
|
7
|
+
* module would run, how many file/folder ops are involved, and which
|
|
8
|
+
* safety gates apply.
|
|
9
|
+
*
|
|
10
|
+
* Read-only. Never spawns the actual apply.
|
|
11
|
+
*/
|
|
12
|
+
import type { ISavedPlan } from '@shrkcrft/generator';
|
|
13
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
14
|
+
export declare const APPLY_DISPATCH_TRACE_SCHEMA = "sharkcraft.apply-dispatch-trace/v1";
|
|
15
|
+
export declare enum DispatchKind {
|
|
16
|
+
Template = "template",
|
|
17
|
+
Helper = "helper",
|
|
18
|
+
PluginLifecycle = "plugin-lifecycle",
|
|
19
|
+
RegistrationHint = "registration-hint",
|
|
20
|
+
Synthetic = "synthetic",
|
|
21
|
+
Unknown = "unknown"
|
|
22
|
+
}
|
|
23
|
+
export type DispatchSource = 'registry/template' | 'registry/helper' | 'registry/plugin-lifecycle-profile' | 'registry/registration-hint' | 'synthetic' | 'unknown';
|
|
24
|
+
export interface IDispatchFileOpCounts {
|
|
25
|
+
readonly create: number;
|
|
26
|
+
readonly update: number;
|
|
27
|
+
readonly append: number;
|
|
28
|
+
readonly insertBefore: number;
|
|
29
|
+
readonly insertAfter: number;
|
|
30
|
+
readonly replace: number;
|
|
31
|
+
readonly exportLine: number;
|
|
32
|
+
readonly skip: number;
|
|
33
|
+
readonly conflict: number;
|
|
34
|
+
}
|
|
35
|
+
export interface IDispatchFolderOpCounts {
|
|
36
|
+
readonly renameFolder: number;
|
|
37
|
+
readonly deleteFolder: number;
|
|
38
|
+
}
|
|
39
|
+
export interface IDispatchSafetyGate {
|
|
40
|
+
readonly id: 'signature' | 'divergence' | 'folder-ops-allow-flag' | 'folder-ops-safety' | 'delete-folder-allow-flag' | 'contract-gate';
|
|
41
|
+
readonly status: 'not-checked' | 'will-pass' | 'will-block' | 'requires-flag';
|
|
42
|
+
readonly detail?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface IApplyDispatchTrace {
|
|
45
|
+
readonly schema: typeof APPLY_DISPATCH_TRACE_SCHEMA;
|
|
46
|
+
readonly templateId: string;
|
|
47
|
+
readonly dispatchKind: DispatchKind;
|
|
48
|
+
readonly source: DispatchSource;
|
|
49
|
+
/** Best-effort handler description (module + symbol). */
|
|
50
|
+
readonly handler: string;
|
|
51
|
+
/** Whether the plan uses a synthetic templateId (prefix `__`). */
|
|
52
|
+
readonly synthetic: boolean;
|
|
53
|
+
/** Total file changes carried by the saved plan's expectedChanges. */
|
|
54
|
+
readonly totalFileOps: number;
|
|
55
|
+
/** Total folder operations carried by the saved plan. */
|
|
56
|
+
readonly totalFolderOps: number;
|
|
57
|
+
readonly fileOpCounts: IDispatchFileOpCounts;
|
|
58
|
+
readonly folderOpCounts: IDispatchFolderOpCounts;
|
|
59
|
+
/** Plan-v2 operation kinds (PlannedOperation.kind). */
|
|
60
|
+
readonly plannedOperationKinds: ReadonlyArray<string>;
|
|
61
|
+
/** Signature status as it would be after `--verify-signature`. */
|
|
62
|
+
readonly signatureStatus: 'not-checked' | 'verified' | 'unsigned' | 'invalid';
|
|
63
|
+
readonly signatureMessage?: string;
|
|
64
|
+
/** Gates the apply CLI would evaluate before writing. */
|
|
65
|
+
readonly safetyGates: ReadonlyArray<IDispatchSafetyGate>;
|
|
66
|
+
/** Flags the operator must pass for the apply to succeed. */
|
|
67
|
+
readonly requiredFlags: ReadonlyArray<string>;
|
|
68
|
+
/** Final action the apply would take in the current state. */
|
|
69
|
+
readonly finalAction: 'dry-run' | 'blocked' | 'would-apply';
|
|
70
|
+
/** When `blocked`, the reason(s). */
|
|
71
|
+
readonly blockReasons: ReadonlyArray<string>;
|
|
72
|
+
}
|
|
73
|
+
export interface IBuildDispatchTraceOptions {
|
|
74
|
+
/** Saved plan to trace. */
|
|
75
|
+
readonly plan: ISavedPlan;
|
|
76
|
+
/** Workspace inspection — used to look up template/helper/profile. */
|
|
77
|
+
readonly inspection: ISharkcraftInspection;
|
|
78
|
+
/** Pass `true` when the operator intends to use --dry-run. */
|
|
79
|
+
readonly dryRun?: boolean;
|
|
80
|
+
/** Pass `true` when --allow-folder-ops will be set. */
|
|
81
|
+
readonly allowFolderOps?: boolean;
|
|
82
|
+
/** Pass `true` when --allow-delete-folder will be set. */
|
|
83
|
+
readonly allowDeleteFolder?: boolean;
|
|
84
|
+
/** Pass `true` when --verify-signature will be set. */
|
|
85
|
+
readonly verifySignature?: boolean;
|
|
86
|
+
/** Pass `true` when the plan diverges from the live template output. */
|
|
87
|
+
readonly diverged?: boolean;
|
|
88
|
+
/** Optional contract gate status — when supplied, included as a gate. */
|
|
89
|
+
readonly contractGate?: 'pass' | 'fail' | 'not-applicable';
|
|
90
|
+
}
|
|
91
|
+
export declare function buildApplyDispatchTrace(options: IBuildDispatchTraceOptions): IApplyDispatchTrace;
|
|
92
|
+
export declare function renderApplyDispatchTraceText(trace: IApplyDispatchTrace): string;
|
|
93
|
+
//# sourceMappingURL=apply-dispatch-trace.d.ts.map
|