@shrkcrft/inspector 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +43 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +197 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +201 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +26 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +110 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +413 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +223 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +233 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts.d.ts +28 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +234 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +60 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +371 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +71 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +66 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universal check-result protocol (`sharkcraft.check-result/v1`).
|
|
3
|
+
*
|
|
4
|
+
* A single schema any tool can emit so SharkCraft can aggregate
|
|
5
|
+
* results from itself + ESLint + Biome + custom project checks into
|
|
6
|
+
* one rollup. Distinct from `sharkcraft.custom-check/v1` (which is
|
|
7
|
+
* descriptor-driven, one-check-at-a-time).
|
|
8
|
+
*
|
|
9
|
+
* Design rules (from feature_47.md):
|
|
10
|
+
* - status: pass | warn | fail | unknown.
|
|
11
|
+
* - findings carry severity / file / optional line/column / ruleId /
|
|
12
|
+
* message / suggestedAction / safeToAutoFix.
|
|
13
|
+
* - schema string + tool + command + generatedAt + sourceReportPath
|
|
14
|
+
* stay alongside so reproducibility is not lost.
|
|
15
|
+
* - Conversion is round-trippable but not lossy: ESLint's `endLine`
|
|
16
|
+
* / `endColumn` etc. live under `metadata` so they survive the
|
|
17
|
+
* trip without bloating the canonical shape.
|
|
18
|
+
*
|
|
19
|
+
* This module is pure and read-only. No spawning, no writes — the CLI
|
|
20
|
+
* surface (`shrk checks import/aggregate/report/convert`) handles I/O.
|
|
21
|
+
*/
|
|
22
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
23
|
+
export const CHECK_RESULT_SCHEMA = 'sharkcraft.check-result/v1';
|
|
24
|
+
export const CHECK_AGGREGATE_SCHEMA = 'sharkcraft.check-aggregate/v1';
|
|
25
|
+
export var CheckResultStatus;
|
|
26
|
+
(function (CheckResultStatus) {
|
|
27
|
+
CheckResultStatus["Pass"] = "pass";
|
|
28
|
+
CheckResultStatus["Warn"] = "warn";
|
|
29
|
+
CheckResultStatus["Fail"] = "fail";
|
|
30
|
+
CheckResultStatus["Unknown"] = "unknown";
|
|
31
|
+
})(CheckResultStatus || (CheckResultStatus = {}));
|
|
32
|
+
export var CheckFindingSeverity;
|
|
33
|
+
(function (CheckFindingSeverity) {
|
|
34
|
+
CheckFindingSeverity["Error"] = "error";
|
|
35
|
+
CheckFindingSeverity["Warning"] = "warning";
|
|
36
|
+
CheckFindingSeverity["Info"] = "info";
|
|
37
|
+
})(CheckFindingSeverity || (CheckFindingSeverity = {}));
|
|
38
|
+
function isPlainObject(v) {
|
|
39
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
40
|
+
}
|
|
41
|
+
function severityFromUnknown(raw) {
|
|
42
|
+
if (raw === 2 || raw === 'error' || raw === 'fatal')
|
|
43
|
+
return CheckFindingSeverity.Error;
|
|
44
|
+
if (raw === 1 || raw === 'warning' || raw === 'warn')
|
|
45
|
+
return CheckFindingSeverity.Warning;
|
|
46
|
+
return CheckFindingSeverity.Info;
|
|
47
|
+
}
|
|
48
|
+
function summarize(findings) {
|
|
49
|
+
let errors = 0;
|
|
50
|
+
let warnings = 0;
|
|
51
|
+
let infos = 0;
|
|
52
|
+
for (const f of findings) {
|
|
53
|
+
if (f.severity === CheckFindingSeverity.Error)
|
|
54
|
+
errors += 1;
|
|
55
|
+
else if (f.severity === CheckFindingSeverity.Warning)
|
|
56
|
+
warnings += 1;
|
|
57
|
+
else
|
|
58
|
+
infos += 1;
|
|
59
|
+
}
|
|
60
|
+
return { errors, warnings, infos, total: findings.length };
|
|
61
|
+
}
|
|
62
|
+
function statusFor(summary) {
|
|
63
|
+
if (summary.errors > 0)
|
|
64
|
+
return CheckResultStatus.Fail;
|
|
65
|
+
if (summary.warnings > 0)
|
|
66
|
+
return CheckResultStatus.Warn;
|
|
67
|
+
return CheckResultStatus.Pass;
|
|
68
|
+
}
|
|
69
|
+
export function buildCheckResult(input) {
|
|
70
|
+
const summary = summarize(input.findings);
|
|
71
|
+
const status = input.status ?? statusFor(summary);
|
|
72
|
+
const result = {
|
|
73
|
+
schema: CHECK_RESULT_SCHEMA,
|
|
74
|
+
tool: input.tool,
|
|
75
|
+
generatedAt: new Date().toISOString(),
|
|
76
|
+
status,
|
|
77
|
+
findings: input.findings,
|
|
78
|
+
summary,
|
|
79
|
+
};
|
|
80
|
+
if (input.command !== undefined)
|
|
81
|
+
result.command = input.command;
|
|
82
|
+
if (input.sourceReportPath !== undefined)
|
|
83
|
+
result.sourceReportPath = input.sourceReportPath;
|
|
84
|
+
if (input.metadata !== undefined)
|
|
85
|
+
result.metadata = input.metadata;
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
export function parseCheckResult(raw) {
|
|
89
|
+
let parsed;
|
|
90
|
+
try {
|
|
91
|
+
parsed = JSON.parse(raw);
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
return { ok: false, reason: `invalid JSON: ${e.message}` };
|
|
95
|
+
}
|
|
96
|
+
if (!isPlainObject(parsed))
|
|
97
|
+
return { ok: false, reason: 'top-level value must be an object' };
|
|
98
|
+
if (parsed.schema !== CHECK_RESULT_SCHEMA) {
|
|
99
|
+
return {
|
|
100
|
+
ok: false,
|
|
101
|
+
reason: `expected schema ${CHECK_RESULT_SCHEMA}, got ${String(parsed.schema)}`,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
if (typeof parsed.tool !== 'string' || parsed.tool === '') {
|
|
105
|
+
return { ok: false, reason: 'missing tool string' };
|
|
106
|
+
}
|
|
107
|
+
if (typeof parsed.generatedAt !== 'string') {
|
|
108
|
+
return { ok: false, reason: 'missing generatedAt' };
|
|
109
|
+
}
|
|
110
|
+
if (!Array.isArray(parsed.findings)) {
|
|
111
|
+
return { ok: false, reason: 'findings must be an array' };
|
|
112
|
+
}
|
|
113
|
+
const findings = [];
|
|
114
|
+
for (const rawF of parsed.findings) {
|
|
115
|
+
if (!isPlainObject(rawF)) {
|
|
116
|
+
return { ok: false, reason: 'finding must be an object' };
|
|
117
|
+
}
|
|
118
|
+
if (typeof rawF.message !== 'string' || rawF.message === '') {
|
|
119
|
+
return { ok: false, reason: 'finding.message must be a non-empty string' };
|
|
120
|
+
}
|
|
121
|
+
const f = {
|
|
122
|
+
severity: severityFromUnknown(rawF.severity),
|
|
123
|
+
message: rawF.message,
|
|
124
|
+
};
|
|
125
|
+
if (typeof rawF.file === 'string')
|
|
126
|
+
f.file = rawF.file;
|
|
127
|
+
if (typeof rawF.line === 'number')
|
|
128
|
+
f.line = rawF.line;
|
|
129
|
+
if (typeof rawF.column === 'number')
|
|
130
|
+
f.column = rawF.column;
|
|
131
|
+
if (typeof rawF.ruleId === 'string')
|
|
132
|
+
f.ruleId = rawF.ruleId;
|
|
133
|
+
if (typeof rawF.suggestedAction === 'string')
|
|
134
|
+
f.suggestedAction = rawF.suggestedAction;
|
|
135
|
+
if (typeof rawF.safeToAutoFix === 'boolean')
|
|
136
|
+
f.safeToAutoFix = rawF.safeToAutoFix;
|
|
137
|
+
if (isPlainObject(rawF.metadata))
|
|
138
|
+
f.metadata = rawF.metadata;
|
|
139
|
+
findings.push(f);
|
|
140
|
+
}
|
|
141
|
+
const summary = summarize(findings);
|
|
142
|
+
const statusRaw = parsed.status;
|
|
143
|
+
const status = statusRaw === CheckResultStatus.Pass ||
|
|
144
|
+
statusRaw === CheckResultStatus.Warn ||
|
|
145
|
+
statusRaw === CheckResultStatus.Fail ||
|
|
146
|
+
statusRaw === CheckResultStatus.Unknown
|
|
147
|
+
? statusRaw
|
|
148
|
+
: statusFor(summary);
|
|
149
|
+
const result = {
|
|
150
|
+
schema: CHECK_RESULT_SCHEMA,
|
|
151
|
+
tool: parsed.tool,
|
|
152
|
+
generatedAt: parsed.generatedAt,
|
|
153
|
+
status,
|
|
154
|
+
findings,
|
|
155
|
+
summary,
|
|
156
|
+
};
|
|
157
|
+
if (typeof parsed.command === 'string')
|
|
158
|
+
result.command = parsed.command;
|
|
159
|
+
if (typeof parsed.sourceReportPath === 'string') {
|
|
160
|
+
result.sourceReportPath = parsed.sourceReportPath;
|
|
161
|
+
}
|
|
162
|
+
if (isPlainObject(parsed.metadata))
|
|
163
|
+
result.metadata = parsed.metadata;
|
|
164
|
+
return { ok: true, result };
|
|
165
|
+
}
|
|
166
|
+
export function parseCheckResultFromFile(path) {
|
|
167
|
+
if (!existsSync(path))
|
|
168
|
+
return { ok: false, reason: `file not found: ${path}` };
|
|
169
|
+
let raw;
|
|
170
|
+
try {
|
|
171
|
+
raw = readFileSync(path, 'utf8');
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
return { ok: false, reason: `read error: ${e.message}` };
|
|
175
|
+
}
|
|
176
|
+
return parseCheckResult(raw);
|
|
177
|
+
}
|
|
178
|
+
export function convertEslintToCheckResult(raw, sourceReportPath) {
|
|
179
|
+
let parsed;
|
|
180
|
+
try {
|
|
181
|
+
parsed = JSON.parse(raw);
|
|
182
|
+
}
|
|
183
|
+
catch (e) {
|
|
184
|
+
return { ok: false, reason: `invalid ESLint JSON: ${e.message}` };
|
|
185
|
+
}
|
|
186
|
+
if (!Array.isArray(parsed)) {
|
|
187
|
+
return { ok: false, reason: 'ESLint JSON must be a top-level array of file results' };
|
|
188
|
+
}
|
|
189
|
+
const findings = [];
|
|
190
|
+
for (const rawFile of parsed) {
|
|
191
|
+
if (!isPlainObject(rawFile))
|
|
192
|
+
continue;
|
|
193
|
+
const file = rawFile;
|
|
194
|
+
const filePath = typeof file.filePath === 'string' ? file.filePath : undefined;
|
|
195
|
+
const msgs = Array.isArray(file.messages) ? file.messages : [];
|
|
196
|
+
for (const msg of msgs) {
|
|
197
|
+
if (!isPlainObject(msg))
|
|
198
|
+
continue;
|
|
199
|
+
if (typeof msg.message !== 'string')
|
|
200
|
+
continue;
|
|
201
|
+
const f = {
|
|
202
|
+
severity: severityFromUnknown(msg.severity),
|
|
203
|
+
message: msg.message,
|
|
204
|
+
};
|
|
205
|
+
if (filePath)
|
|
206
|
+
f.file = filePath;
|
|
207
|
+
if (typeof msg.line === 'number')
|
|
208
|
+
f.line = msg.line;
|
|
209
|
+
if (typeof msg.column === 'number')
|
|
210
|
+
f.column = msg.column;
|
|
211
|
+
if (typeof msg.ruleId === 'string')
|
|
212
|
+
f.ruleId = msg.ruleId;
|
|
213
|
+
if (msg.fix !== undefined)
|
|
214
|
+
f.safeToAutoFix = Boolean(msg.fix);
|
|
215
|
+
const meta = {};
|
|
216
|
+
if (typeof msg.endLine === 'number')
|
|
217
|
+
meta.endLine = msg.endLine;
|
|
218
|
+
if (typeof msg.endColumn === 'number')
|
|
219
|
+
meta.endColumn = msg.endColumn;
|
|
220
|
+
if (Object.keys(meta).length > 0)
|
|
221
|
+
f.metadata = meta;
|
|
222
|
+
findings.push(f);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
ok: true,
|
|
227
|
+
result: buildCheckResult({
|
|
228
|
+
tool: 'eslint',
|
|
229
|
+
command: 'eslint --format json',
|
|
230
|
+
findings,
|
|
231
|
+
...(sourceReportPath !== undefined ? { sourceReportPath } : {}),
|
|
232
|
+
}),
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Biome's JSON output is not a stable contract. We accept either:
|
|
237
|
+
* - the adjacent shape: { diagnostics: [{ category, severity, description, location: { path, line?, column? } }] }
|
|
238
|
+
* - native Biome `--reporter github`-ish: { diagnostics: [{ severity, description, location }] }
|
|
239
|
+
* Anything else returns a clear reason.
|
|
240
|
+
*/
|
|
241
|
+
export function convertBiomeToCheckResult(raw, sourceReportPath) {
|
|
242
|
+
let parsed;
|
|
243
|
+
try {
|
|
244
|
+
parsed = JSON.parse(raw);
|
|
245
|
+
}
|
|
246
|
+
catch (e) {
|
|
247
|
+
return { ok: false, reason: `invalid Biome JSON: ${e.message}` };
|
|
248
|
+
}
|
|
249
|
+
if (!isPlainObject(parsed) || !Array.isArray(parsed.diagnostics)) {
|
|
250
|
+
return { ok: false, reason: 'expected { diagnostics: [...] } shape' };
|
|
251
|
+
}
|
|
252
|
+
const findings = [];
|
|
253
|
+
for (const rawDiag of parsed.diagnostics) {
|
|
254
|
+
if (!isPlainObject(rawDiag))
|
|
255
|
+
continue;
|
|
256
|
+
const d = rawDiag;
|
|
257
|
+
const message = typeof d.description === 'string'
|
|
258
|
+
? d.description
|
|
259
|
+
: typeof d.message === 'string'
|
|
260
|
+
? d.message
|
|
261
|
+
: isPlainObject(d.message) && typeof d.message.content === 'string'
|
|
262
|
+
? (d.message.content)
|
|
263
|
+
: null;
|
|
264
|
+
if (!message)
|
|
265
|
+
continue;
|
|
266
|
+
const f = {
|
|
267
|
+
severity: severityFromUnknown(d.severity),
|
|
268
|
+
message,
|
|
269
|
+
};
|
|
270
|
+
if (typeof d.category === 'string')
|
|
271
|
+
f.ruleId = d.category;
|
|
272
|
+
const loc = d.location;
|
|
273
|
+
if (loc) {
|
|
274
|
+
if (typeof loc.path === 'string')
|
|
275
|
+
f.file = loc.path;
|
|
276
|
+
else if (isPlainObject(loc.path) && typeof loc.path.file === 'string') {
|
|
277
|
+
f.file = loc.path.file;
|
|
278
|
+
}
|
|
279
|
+
if (typeof loc.line === 'number')
|
|
280
|
+
f.line = loc.line;
|
|
281
|
+
if (typeof loc.column === 'number')
|
|
282
|
+
f.column = loc.column;
|
|
283
|
+
}
|
|
284
|
+
findings.push(f);
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
ok: true,
|
|
288
|
+
result: buildCheckResult({
|
|
289
|
+
tool: 'biome',
|
|
290
|
+
command: 'biome check --reporter json',
|
|
291
|
+
findings,
|
|
292
|
+
...(sourceReportPath !== undefined ? { sourceReportPath } : {}),
|
|
293
|
+
}),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
function combineStatus(a, b) {
|
|
297
|
+
// Worst wins. Fail > Warn > Pass > Unknown (Unknown only "wins" if there
|
|
298
|
+
// are no other results — handled by initial accumulator).
|
|
299
|
+
if (a === CheckResultStatus.Fail || b === CheckResultStatus.Fail)
|
|
300
|
+
return CheckResultStatus.Fail;
|
|
301
|
+
if (a === CheckResultStatus.Warn || b === CheckResultStatus.Warn)
|
|
302
|
+
return CheckResultStatus.Warn;
|
|
303
|
+
if (a === CheckResultStatus.Pass || b === CheckResultStatus.Pass)
|
|
304
|
+
return CheckResultStatus.Pass;
|
|
305
|
+
return CheckResultStatus.Unknown;
|
|
306
|
+
}
|
|
307
|
+
export function buildCheckAggregate(results) {
|
|
308
|
+
const findings = [];
|
|
309
|
+
const entries = [];
|
|
310
|
+
let overall = CheckResultStatus.Unknown;
|
|
311
|
+
const total = { errors: 0, warnings: 0, infos: 0, total: 0 };
|
|
312
|
+
for (const item of results) {
|
|
313
|
+
overall = combineStatus(overall, item.result.status);
|
|
314
|
+
total.errors += item.result.summary.errors;
|
|
315
|
+
total.warnings += item.result.summary.warnings;
|
|
316
|
+
total.infos += item.result.summary.infos;
|
|
317
|
+
total.total += item.result.summary.total;
|
|
318
|
+
entries.push({
|
|
319
|
+
tool: item.result.tool,
|
|
320
|
+
status: item.result.status,
|
|
321
|
+
summary: item.result.summary,
|
|
322
|
+
sourceReportPath: item.sourceReportPath,
|
|
323
|
+
});
|
|
324
|
+
for (const f of item.result.findings)
|
|
325
|
+
findings.push(f);
|
|
326
|
+
}
|
|
327
|
+
return {
|
|
328
|
+
schema: CHECK_AGGREGATE_SCHEMA,
|
|
329
|
+
generatedAt: new Date().toISOString(),
|
|
330
|
+
overall,
|
|
331
|
+
total,
|
|
332
|
+
entries,
|
|
333
|
+
findings,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const CI_INTEGRITY_SCHEMA = "sharkcraft.ci-integrity/v1";
|
|
2
|
+
export declare enum GateStatus {
|
|
3
|
+
Pass = "pass",
|
|
4
|
+
Warn = "warn",
|
|
5
|
+
Fail = "fail",
|
|
6
|
+
Unknown = "unknown"
|
|
7
|
+
}
|
|
8
|
+
export interface ICiGate {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
/** File name (relative) the gate was read from, when applicable. */
|
|
12
|
+
source?: string;
|
|
13
|
+
status: GateStatus;
|
|
14
|
+
errors: number;
|
|
15
|
+
warnings: number;
|
|
16
|
+
/** Short headline. */
|
|
17
|
+
summary: string;
|
|
18
|
+
/** Concrete next command to investigate. */
|
|
19
|
+
nextCommand?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ICiIntegrityReport {
|
|
22
|
+
schema: typeof CI_INTEGRITY_SCHEMA;
|
|
23
|
+
generatedAt: string;
|
|
24
|
+
reportsDir: string;
|
|
25
|
+
gates: readonly ICiGate[];
|
|
26
|
+
overall: GateStatus;
|
|
27
|
+
totalErrors: number;
|
|
28
|
+
totalWarnings: number;
|
|
29
|
+
topActionableFailures: readonly string[];
|
|
30
|
+
nextCommands: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
export interface ICiIntegrityOptions {
|
|
33
|
+
reportsDir?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function buildCiIntegrityReport(projectRoot: string, options?: ICiIntegrityOptions): ICiIntegrityReport;
|
|
36
|
+
export declare function renderCiIntegrityMarkdown(report: ICiIntegrityReport): string;
|
|
37
|
+
export declare function renderCiIntegrityHtml(report: ICiIntegrityReport): string;
|
|
38
|
+
//# sourceMappingURL=ci-integrity-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-integrity-report.d.ts","sourceRoot":"","sources":["../src/ci-integrity-report.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,OAAO,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAoLD,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CA0EpB;AAeD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CA0B5E;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAexE"}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CI integrity report aggregator.
|
|
3
|
+
*
|
|
4
|
+
* Aggregates the JSON reports written by the SharkCraft CI scaffold steps
|
|
5
|
+
* (knowledge-stale.json, template-drift.json, boundaries.json, agent tests,
|
|
6
|
+
* safety audit, product check, release readiness, etc.) into a single
|
|
7
|
+
* "is the PR healthy?" verdict + PR-comment-ready markdown.
|
|
8
|
+
*
|
|
9
|
+
* Schema: sharkcraft.ci-integrity/v1
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
12
|
+
import * as nodePath from 'node:path';
|
|
13
|
+
export const CI_INTEGRITY_SCHEMA = 'sharkcraft.ci-integrity/v1';
|
|
14
|
+
export var GateStatus;
|
|
15
|
+
(function (GateStatus) {
|
|
16
|
+
GateStatus["Pass"] = "pass";
|
|
17
|
+
GateStatus["Warn"] = "warn";
|
|
18
|
+
GateStatus["Fail"] = "fail";
|
|
19
|
+
GateStatus["Unknown"] = "unknown";
|
|
20
|
+
})(GateStatus || (GateStatus = {}));
|
|
21
|
+
function asObj(raw) {
|
|
22
|
+
return raw && typeof raw === 'object' ? raw : {};
|
|
23
|
+
}
|
|
24
|
+
function num(o, key) {
|
|
25
|
+
const v = o[key];
|
|
26
|
+
return typeof v === 'number' ? v : 0;
|
|
27
|
+
}
|
|
28
|
+
const PROBES = [
|
|
29
|
+
{
|
|
30
|
+
filenameStartsWith: 'knowledge-stale',
|
|
31
|
+
id: 'knowledge-stale',
|
|
32
|
+
title: 'Knowledge stale-check',
|
|
33
|
+
pickStatus: (raw) => {
|
|
34
|
+
const o = asObj(raw);
|
|
35
|
+
const counts = asObj(o.summary ?? o);
|
|
36
|
+
const stale = num(counts, 'stale');
|
|
37
|
+
const missing = num(counts, 'missing');
|
|
38
|
+
const errors = num(counts, 'requiredStale') + num(counts, 'requiredMissing');
|
|
39
|
+
const warnings = stale + missing - errors;
|
|
40
|
+
const status = errors > 0 ? GateStatus.Fail : warnings > 0 ? GateStatus.Warn : GateStatus.Pass;
|
|
41
|
+
return {
|
|
42
|
+
status,
|
|
43
|
+
errors,
|
|
44
|
+
warnings: warnings < 0 ? 0 : warnings,
|
|
45
|
+
summary: `stale=${stale} missing=${missing}`,
|
|
46
|
+
nextCommand: 'shrk knowledge stale-check --strict',
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
filenameStartsWith: 'template-drift',
|
|
52
|
+
id: 'template-drift',
|
|
53
|
+
title: 'Template drift',
|
|
54
|
+
pickStatus: (raw) => {
|
|
55
|
+
const o = asObj(raw);
|
|
56
|
+
const fail = num(o, 'fail');
|
|
57
|
+
const warn = num(o, 'warn');
|
|
58
|
+
const pass = num(o, 'pass');
|
|
59
|
+
const status = fail > 0 ? GateStatus.Fail : warn > 0 ? GateStatus.Warn : GateStatus.Pass;
|
|
60
|
+
return {
|
|
61
|
+
status,
|
|
62
|
+
errors: fail,
|
|
63
|
+
warnings: warn,
|
|
64
|
+
summary: `pass=${pass} warn=${warn} fail=${fail}`,
|
|
65
|
+
nextCommand: 'shrk templates drift --min-severity warning',
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
filenameStartsWith: 'boundaries',
|
|
71
|
+
id: 'boundaries',
|
|
72
|
+
title: 'Boundary check',
|
|
73
|
+
pickStatus: (raw) => {
|
|
74
|
+
const o = asObj(raw);
|
|
75
|
+
const violations = Array.isArray(o.violations) ? o.violations.length : num(o, 'violations');
|
|
76
|
+
const status = violations > 0 ? GateStatus.Fail : GateStatus.Pass;
|
|
77
|
+
return {
|
|
78
|
+
status,
|
|
79
|
+
errors: violations,
|
|
80
|
+
warnings: 0,
|
|
81
|
+
summary: `violations=${violations}`,
|
|
82
|
+
nextCommand: 'shrk check boundaries --changed-only',
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
filenameStartsWith: 'safety-audit',
|
|
88
|
+
id: 'safety-audit',
|
|
89
|
+
title: 'Safety audit',
|
|
90
|
+
pickStatus: (raw) => {
|
|
91
|
+
const o = asObj(raw);
|
|
92
|
+
const passed = o.passed === true;
|
|
93
|
+
const errors = num(o, 'errors');
|
|
94
|
+
const warnings = num(o, 'warnings');
|
|
95
|
+
const status = !passed || errors > 0 ? GateStatus.Fail : warnings > 0 ? GateStatus.Warn : GateStatus.Pass;
|
|
96
|
+
return {
|
|
97
|
+
status,
|
|
98
|
+
errors,
|
|
99
|
+
warnings,
|
|
100
|
+
summary: passed ? 'safety audit passed' : 'safety audit failed',
|
|
101
|
+
nextCommand: 'shrk safety audit --deep',
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
filenameStartsWith: 'agent-tests',
|
|
107
|
+
id: 'agent-tests',
|
|
108
|
+
title: 'Agent contract tests',
|
|
109
|
+
pickStatus: (raw) => {
|
|
110
|
+
const o = asObj(raw);
|
|
111
|
+
const total = Array.isArray(o.results) ? o.results.length : num(o, 'total');
|
|
112
|
+
const passed = num(o, 'passed');
|
|
113
|
+
const failed = num(o, 'failed') || (total - passed);
|
|
114
|
+
const status = failed > 0 ? GateStatus.Fail : GateStatus.Pass;
|
|
115
|
+
return {
|
|
116
|
+
status,
|
|
117
|
+
errors: failed,
|
|
118
|
+
warnings: 0,
|
|
119
|
+
summary: `passed=${passed} failed=${failed} total=${total}`,
|
|
120
|
+
nextCommand: 'shrk test agent',
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
filenameStartsWith: 'product',
|
|
126
|
+
id: 'product-check',
|
|
127
|
+
title: 'Product coherence check',
|
|
128
|
+
pickStatus: (raw) => {
|
|
129
|
+
const o = asObj(raw);
|
|
130
|
+
const errors = num(o, 'errors');
|
|
131
|
+
const warnings = num(o, 'warnings');
|
|
132
|
+
const status = errors > 0 ? GateStatus.Fail : warnings > 0 ? GateStatus.Warn : GateStatus.Pass;
|
|
133
|
+
return {
|
|
134
|
+
status,
|
|
135
|
+
errors,
|
|
136
|
+
warnings,
|
|
137
|
+
summary: `errors=${errors} warnings=${warnings}`,
|
|
138
|
+
nextCommand: 'shrk product check',
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
filenameStartsWith: 'commands-doctor',
|
|
144
|
+
id: 'commands-doctor',
|
|
145
|
+
title: 'Commands doctor',
|
|
146
|
+
pickStatus: (raw) => {
|
|
147
|
+
const o = asObj(raw);
|
|
148
|
+
const passed = o.passed === true;
|
|
149
|
+
const errors = num(asObj(o.summary), 'errors') || num(o, 'errors');
|
|
150
|
+
const warnings = num(asObj(o.summary), 'warnings') || num(o, 'warnings');
|
|
151
|
+
const status = !passed || errors > 0 ? GateStatus.Fail : warnings > 0 ? GateStatus.Warn : GateStatus.Pass;
|
|
152
|
+
return {
|
|
153
|
+
status,
|
|
154
|
+
errors,
|
|
155
|
+
warnings,
|
|
156
|
+
summary: passed ? 'catalog OK' : 'catalog issues',
|
|
157
|
+
nextCommand: 'shrk commands doctor',
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
filenameStartsWith: 'release-readiness',
|
|
163
|
+
id: 'release-readiness',
|
|
164
|
+
title: 'Release readiness',
|
|
165
|
+
pickStatus: (raw) => {
|
|
166
|
+
const o = asObj(raw);
|
|
167
|
+
const passed = o.passed === true || o.ready === true;
|
|
168
|
+
const errors = num(o, 'errors');
|
|
169
|
+
const status = !passed ? GateStatus.Fail : errors > 0 ? GateStatus.Fail : GateStatus.Pass;
|
|
170
|
+
return {
|
|
171
|
+
status,
|
|
172
|
+
errors,
|
|
173
|
+
warnings: 0,
|
|
174
|
+
summary: passed ? 'release ready' : 'release not ready',
|
|
175
|
+
nextCommand: 'shrk release readiness --strict',
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
function loadJson(file) {
|
|
181
|
+
if (!existsSync(file))
|
|
182
|
+
return null;
|
|
183
|
+
try {
|
|
184
|
+
return JSON.parse(readFileSync(file, 'utf8'));
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export function buildCiIntegrityReport(projectRoot, options = {}) {
|
|
191
|
+
const reportsDir = nodePath.isAbsolute(options.reportsDir ?? '.sharkcraft/reports')
|
|
192
|
+
? (options.reportsDir ?? '.sharkcraft/reports')
|
|
193
|
+
: nodePath.join(projectRoot, options.reportsDir ?? '.sharkcraft/reports');
|
|
194
|
+
const gates = [];
|
|
195
|
+
let totalErrors = 0;
|
|
196
|
+
let totalWarnings = 0;
|
|
197
|
+
if (!existsSync(reportsDir)) {
|
|
198
|
+
return {
|
|
199
|
+
schema: CI_INTEGRITY_SCHEMA,
|
|
200
|
+
generatedAt: new Date().toISOString(),
|
|
201
|
+
reportsDir,
|
|
202
|
+
gates: [],
|
|
203
|
+
overall: GateStatus.Unknown,
|
|
204
|
+
totalErrors: 0,
|
|
205
|
+
totalWarnings: 0,
|
|
206
|
+
topActionableFailures: [],
|
|
207
|
+
nextCommands: [`Run \`shrk ci scaffold --with-integrity\` to populate ${reportsDir}`],
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const files = readdirSync(reportsDir).filter((n) => n.endsWith('.json'));
|
|
211
|
+
for (const probe of PROBES) {
|
|
212
|
+
const file = files.find((f) => f.startsWith(probe.filenameStartsWith));
|
|
213
|
+
if (!file) {
|
|
214
|
+
gates.push({
|
|
215
|
+
id: probe.id,
|
|
216
|
+
title: probe.title,
|
|
217
|
+
status: GateStatus.Unknown,
|
|
218
|
+
errors: 0,
|
|
219
|
+
warnings: 0,
|
|
220
|
+
summary: 'no report file present',
|
|
221
|
+
});
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const full = nodePath.join(reportsDir, file);
|
|
225
|
+
const raw = loadJson(full);
|
|
226
|
+
const evaluated = probe.pickStatus(raw);
|
|
227
|
+
totalErrors += evaluated.errors;
|
|
228
|
+
totalWarnings += evaluated.warnings;
|
|
229
|
+
gates.push({
|
|
230
|
+
id: probe.id,
|
|
231
|
+
title: probe.title,
|
|
232
|
+
source: nodePath.relative(projectRoot, full),
|
|
233
|
+
status: evaluated.status,
|
|
234
|
+
errors: evaluated.errors,
|
|
235
|
+
warnings: evaluated.warnings,
|
|
236
|
+
summary: evaluated.summary,
|
|
237
|
+
...(evaluated.nextCommand ? { nextCommand: evaluated.nextCommand } : {}),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
// Overall verdict.
|
|
241
|
+
let overall = GateStatus.Pass;
|
|
242
|
+
let sawFail = false;
|
|
243
|
+
for (const g of gates) {
|
|
244
|
+
if (g.status === GateStatus.Fail) {
|
|
245
|
+
sawFail = true;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
if (g.status === GateStatus.Warn)
|
|
249
|
+
overall = GateStatus.Warn;
|
|
250
|
+
if (g.status === GateStatus.Unknown && overall === GateStatus.Pass)
|
|
251
|
+
overall = GateStatus.Unknown;
|
|
252
|
+
}
|
|
253
|
+
if (sawFail)
|
|
254
|
+
overall = GateStatus.Fail;
|
|
255
|
+
const failing = gates.filter((g) => g.status === GateStatus.Fail);
|
|
256
|
+
return {
|
|
257
|
+
schema: CI_INTEGRITY_SCHEMA,
|
|
258
|
+
generatedAt: new Date().toISOString(),
|
|
259
|
+
reportsDir,
|
|
260
|
+
gates,
|
|
261
|
+
overall,
|
|
262
|
+
totalErrors,
|
|
263
|
+
totalWarnings,
|
|
264
|
+
topActionableFailures: failing.slice(0, 5).map((g) => `${g.title}: ${g.summary}`),
|
|
265
|
+
nextCommands: failing.slice(0, 5).map((g) => g.nextCommand ?? '').filter(Boolean),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function badge(status) {
|
|
269
|
+
switch (status) {
|
|
270
|
+
case GateStatus.Pass:
|
|
271
|
+
return '✓ pass';
|
|
272
|
+
case GateStatus.Warn:
|
|
273
|
+
return '⚠ warn';
|
|
274
|
+
case GateStatus.Fail:
|
|
275
|
+
return '✗ fail';
|
|
276
|
+
case GateStatus.Unknown:
|
|
277
|
+
return '— unknown';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
export function renderCiIntegrityMarkdown(report) {
|
|
281
|
+
const lines = [];
|
|
282
|
+
lines.push('# SharkCraft CI integrity');
|
|
283
|
+
lines.push(`Generated: ${report.generatedAt}`);
|
|
284
|
+
lines.push(`Reports dir: \`${report.reportsDir}\``);
|
|
285
|
+
lines.push('');
|
|
286
|
+
lines.push(`Overall: **${badge(report.overall)}**`);
|
|
287
|
+
lines.push(`Totals: errors=${report.totalErrors}, warnings=${report.totalWarnings}`);
|
|
288
|
+
lines.push('');
|
|
289
|
+
lines.push('| Gate | Status | Summary | Next command |');
|
|
290
|
+
lines.push('| --- | --- | --- | --- |');
|
|
291
|
+
for (const g of report.gates) {
|
|
292
|
+
const next = g.nextCommand ? `\`${g.nextCommand}\`` : '—';
|
|
293
|
+
lines.push(`| ${g.title} | ${badge(g.status)} | ${g.summary} | ${next} |`);
|
|
294
|
+
}
|
|
295
|
+
if (report.topActionableFailures.length > 0) {
|
|
296
|
+
lines.push('');
|
|
297
|
+
lines.push('## Top failing gates');
|
|
298
|
+
for (const f of report.topActionableFailures)
|
|
299
|
+
lines.push(`- ${f}`);
|
|
300
|
+
}
|
|
301
|
+
if (report.nextCommands.length > 0) {
|
|
302
|
+
lines.push('');
|
|
303
|
+
lines.push('## Next commands');
|
|
304
|
+
for (const c of report.nextCommands)
|
|
305
|
+
lines.push(`- \`${c}\``);
|
|
306
|
+
}
|
|
307
|
+
return lines.join('\n') + '\n';
|
|
308
|
+
}
|
|
309
|
+
export function renderCiIntegrityHtml(report) {
|
|
310
|
+
const esc = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
311
|
+
const rows = report.gates
|
|
312
|
+
.map((g) => `<tr><td>${esc(g.title)}</td><td>${badge(g.status)}</td><td>${esc(g.summary)}</td><td>${g.nextCommand ? `<code>${esc(g.nextCommand)}</code>` : ''}</td></tr>`)
|
|
313
|
+
.join('');
|
|
314
|
+
return [
|
|
315
|
+
'<!doctype html><html><head><meta charset="utf-8">',
|
|
316
|
+
'<title>SharkCraft — CI integrity</title>',
|
|
317
|
+
'<style>body{font:14px/1.5 -apple-system,sans-serif;max-width:960px;margin:24px auto;padding:0 16px}table{border-collapse:collapse;width:100%}th,td{border:1px solid #d0d7de;padding:6px 10px}th{background:#f6f8fa}</style>',
|
|
318
|
+
'</head><body>',
|
|
319
|
+
`<h1>SharkCraft CI integrity</h1>`,
|
|
320
|
+
`<p>Overall: <strong>${badge(report.overall)}</strong></p>`,
|
|
321
|
+
`<table><thead><tr><th>Gate</th><th>Status</th><th>Summary</th><th>Next</th></tr></thead><tbody>${rows}</tbody></table>`,
|
|
322
|
+
'</body></html>',
|
|
323
|
+
].join('\n');
|
|
324
|
+
}
|