@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,178 @@
|
|
|
1
|
+
export function renderReviewCommentV2Html(packet, options = {}) {
|
|
2
|
+
const maxFiles = options.maxFiles ?? 25;
|
|
3
|
+
const maxItems = options.maxItems ?? 10;
|
|
4
|
+
const esc = (s) => s
|
|
5
|
+
.replace(/&/g, '&')
|
|
6
|
+
.replace(/</g, '<')
|
|
7
|
+
.replace(/>/g, '>')
|
|
8
|
+
.replace(/"/g, '"');
|
|
9
|
+
const parts = [];
|
|
10
|
+
parts.push('<!doctype html>');
|
|
11
|
+
parts.push('<html><head><meta charset="utf-8"><title>SharkCraft review</title>');
|
|
12
|
+
parts.push('<style>');
|
|
13
|
+
parts.push('body{font:14px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;max-width:960px;margin:24px auto;padding:0 16px;color:#1f2328;}');
|
|
14
|
+
parts.push('h1{font-size:20px;border-bottom:1px solid #d0d7de;padding-bottom:8px;}');
|
|
15
|
+
parts.push('h2{font-size:16px;margin-top:24px;}');
|
|
16
|
+
parts.push('code,pre{background:#f6f8fa;padding:1px 4px;border-radius:4px;font-size:12px;}');
|
|
17
|
+
parts.push('.risk{display:inline-block;padding:2px 8px;border-radius:9999px;font-size:12px;font-weight:600;}');
|
|
18
|
+
parts.push('.risk.low{background:#dafbe1;color:#1a7f37;}');
|
|
19
|
+
parts.push('.risk.medium{background:#fff8c5;color:#9a6700;}');
|
|
20
|
+
parts.push('.risk.high{background:#ffebe9;color:#cf222e;}');
|
|
21
|
+
parts.push('.risk.critical{background:#cf222e;color:#fff;}');
|
|
22
|
+
parts.push('ul{padding-left:18px;}');
|
|
23
|
+
parts.push('</style></head><body>');
|
|
24
|
+
parts.push(`<h1>SharkCraft review</h1>`);
|
|
25
|
+
parts.push(`<p><strong>Risk score:</strong> ${packet.riskScore}/100 — <span class="risk ${esc(packet.impact.risk)}">${esc(packet.impact.risk)}</span></p>`);
|
|
26
|
+
parts.push(`<p>${packet.base.changedFiles.length} file(s), ${packet.impact.affectedAreas.length} area(s)</p>`);
|
|
27
|
+
parts.push(`<h2>Summary</h2>`);
|
|
28
|
+
parts.push(`<p>${esc(packet.impact.explanation)}</p>`);
|
|
29
|
+
if (packet.impact.affectedAreas.length > 0) {
|
|
30
|
+
parts.push(`<h2>Changed areas</h2><ul>`);
|
|
31
|
+
for (const a of packet.impact.affectedAreas.slice(0, maxItems)) {
|
|
32
|
+
parts.push(`<li><code>${esc(a.kind)}</code> (${a.fileCount} files)</li>`);
|
|
33
|
+
}
|
|
34
|
+
parts.push(`</ul>`);
|
|
35
|
+
}
|
|
36
|
+
parts.push(`<h2>Changed files (${packet.base.changedFiles.length})</h2><ul>`);
|
|
37
|
+
for (const f of packet.base.changedFiles.slice(0, maxFiles)) {
|
|
38
|
+
parts.push(`<li>${esc(f)}</li>`);
|
|
39
|
+
}
|
|
40
|
+
if (packet.base.changedFiles.length > maxFiles) {
|
|
41
|
+
parts.push(`<li><em>…${packet.base.changedFiles.length - maxFiles} more</em></li>`);
|
|
42
|
+
}
|
|
43
|
+
parts.push(`</ul>`);
|
|
44
|
+
if (packet.suggestedReviewers.length > 0) {
|
|
45
|
+
parts.push(`<h2>Suggested reviewers</h2><ul>`);
|
|
46
|
+
for (const r of packet.suggestedReviewers.slice(0, maxItems))
|
|
47
|
+
parts.push(`<li>${esc(r)}</li>`);
|
|
48
|
+
parts.push(`</ul>`);
|
|
49
|
+
}
|
|
50
|
+
const policyErrs = packet.policy.checks.filter((c) => c.severity === 'error' || c.severity === 'critical');
|
|
51
|
+
if (packet.base.boundaryViolations.length > 0 || policyErrs.length > 0) {
|
|
52
|
+
parts.push(`<h2>Boundary / policy concerns</h2><ul>`);
|
|
53
|
+
for (const v of packet.base.boundaryViolations.slice(0, maxItems)) {
|
|
54
|
+
parts.push(`<li><code>${esc(v.file)}:${v.line}</code> — ${esc(v.message)} (${esc(v.ruleId)})</li>`);
|
|
55
|
+
}
|
|
56
|
+
for (const c of policyErrs.slice(0, maxItems)) {
|
|
57
|
+
parts.push(`<li><strong>${esc(c.title)}</strong>: ${esc(c.message)}</li>`);
|
|
58
|
+
}
|
|
59
|
+
parts.push(`</ul>`);
|
|
60
|
+
}
|
|
61
|
+
parts.push(`<h2>Test impact</h2>`);
|
|
62
|
+
parts.push(`<p>Likely tests: ${packet.testImpact.likelyTestFiles.length}</p>`);
|
|
63
|
+
if (packet.testImpact.missingTestFiles.length > 0) {
|
|
64
|
+
parts.push(`<p>Missing tests:</p><ul>`);
|
|
65
|
+
for (const m of packet.testImpact.missingTestFiles.slice(0, maxItems))
|
|
66
|
+
parts.push(`<li>${esc(m)}</li>`);
|
|
67
|
+
parts.push(`</ul>`);
|
|
68
|
+
}
|
|
69
|
+
if (packet.qualityComparison && packet.qualityComparison.regressions.length > 0) {
|
|
70
|
+
parts.push(`<h2>Quality regressions</h2><ul>`);
|
|
71
|
+
for (const r of packet.qualityComparison.regressions.slice(0, maxItems)) {
|
|
72
|
+
parts.push(`<li>${esc(r.metric)}: ${r.baseline} → ${r.current} (Δ ${r.delta})</li>`);
|
|
73
|
+
}
|
|
74
|
+
parts.push(`</ul>`);
|
|
75
|
+
}
|
|
76
|
+
parts.push(`<h2>Suggested commands</h2><ul>`);
|
|
77
|
+
for (const c of packet.testImpact.testCommands.slice(0, maxItems))
|
|
78
|
+
parts.push(`<li><code>${esc(c)}</code></li>`);
|
|
79
|
+
for (const c of packet.impact.suggestedValidationCommands.slice(0, maxItems))
|
|
80
|
+
parts.push(`<li><code>${esc(c)}</code></li>`);
|
|
81
|
+
parts.push(`</ul>`);
|
|
82
|
+
parts.push(`<h2>AI reviewer instructions</h2>`);
|
|
83
|
+
parts.push(`<pre>${esc(packet.base.reviewerInstructions)}</pre>`);
|
|
84
|
+
parts.push(`<p><em>Generated by SharkCraft review packet v2.</em></p>`);
|
|
85
|
+
parts.push('</body></html>');
|
|
86
|
+
return parts.join('\n') + '\n';
|
|
87
|
+
}
|
|
88
|
+
export function renderReviewCommentV2(packet, options = {}) {
|
|
89
|
+
if (options.format === 'html') {
|
|
90
|
+
const opts = {};
|
|
91
|
+
if (options.maxFiles !== undefined)
|
|
92
|
+
opts.maxFiles = options.maxFiles;
|
|
93
|
+
if (options.maxItems !== undefined)
|
|
94
|
+
opts.maxItems = options.maxItems;
|
|
95
|
+
return renderReviewCommentV2Html(packet, opts);
|
|
96
|
+
}
|
|
97
|
+
const fmt = options.format ?? 'github';
|
|
98
|
+
const maxFiles = options.maxFiles ?? 25;
|
|
99
|
+
const maxItems = options.maxItems ?? 10;
|
|
100
|
+
const lines = [];
|
|
101
|
+
const heading = fmt === 'gitlab' ? '##' : '##';
|
|
102
|
+
const detailsOpen = (s) => (fmt === 'markdown' ? `\n${s}\n` : `<details><summary>${s}</summary>\n`);
|
|
103
|
+
const detailsClose = fmt === 'markdown' ? '\n' : '\n</details>';
|
|
104
|
+
lines.push(`# SharkCraft review`);
|
|
105
|
+
lines.push('');
|
|
106
|
+
lines.push(`**Risk score:** ${packet.riskScore}/100 — impact ${packet.impact.risk}`);
|
|
107
|
+
lines.push('');
|
|
108
|
+
lines.push(`${packet.base.changedFiles.length} file(s), ${packet.impact.affectedAreas.length} area(s)`);
|
|
109
|
+
lines.push('');
|
|
110
|
+
// Summary
|
|
111
|
+
lines.push(`${heading} Summary`);
|
|
112
|
+
lines.push(packet.impact.explanation);
|
|
113
|
+
lines.push('');
|
|
114
|
+
// Changed areas
|
|
115
|
+
lines.push(`${heading} Changed areas`);
|
|
116
|
+
if (packet.impact.affectedAreas.length === 0)
|
|
117
|
+
lines.push('_None detected_');
|
|
118
|
+
for (const a of packet.impact.affectedAreas.slice(0, maxItems)) {
|
|
119
|
+
lines.push(`- \`${a.kind}\` (${a.fileCount} files)`);
|
|
120
|
+
}
|
|
121
|
+
lines.push('');
|
|
122
|
+
// Files
|
|
123
|
+
lines.push(detailsOpen(`Changed files (${packet.base.changedFiles.length})`));
|
|
124
|
+
for (const f of packet.base.changedFiles.slice(0, maxFiles))
|
|
125
|
+
lines.push(`- ${f}`);
|
|
126
|
+
if (packet.base.changedFiles.length > maxFiles)
|
|
127
|
+
lines.push(`- _…${packet.base.changedFiles.length - maxFiles} more_`);
|
|
128
|
+
lines.push(detailsClose);
|
|
129
|
+
// Ownership
|
|
130
|
+
if (packet.suggestedReviewers.length > 0) {
|
|
131
|
+
lines.push(`${heading} Suggested reviewers`);
|
|
132
|
+
for (const r of packet.suggestedReviewers.slice(0, maxItems))
|
|
133
|
+
lines.push(`- ${r}`);
|
|
134
|
+
lines.push('');
|
|
135
|
+
}
|
|
136
|
+
// Boundary / policy
|
|
137
|
+
if (packet.base.boundaryViolations.length > 0 || packet.policy.summary.error > 0) {
|
|
138
|
+
lines.push(`${heading} Boundary / policy concerns`);
|
|
139
|
+
for (const v of packet.base.boundaryViolations.slice(0, maxItems)) {
|
|
140
|
+
lines.push(`- \`${v.file}:${v.line}\` — ${v.message} (${v.ruleId})`);
|
|
141
|
+
}
|
|
142
|
+
const errs = packet.policy.checks.filter((c) => c.severity === 'error' || c.severity === 'critical');
|
|
143
|
+
for (const c of errs.slice(0, maxItems))
|
|
144
|
+
lines.push(`- ${c.title}: ${c.message}`);
|
|
145
|
+
lines.push('');
|
|
146
|
+
}
|
|
147
|
+
// Test impact
|
|
148
|
+
lines.push(`${heading} Test impact`);
|
|
149
|
+
lines.push(`Likely tests: ${packet.testImpact.likelyTestFiles.length}`);
|
|
150
|
+
if (packet.testImpact.missingTestFiles.length > 0) {
|
|
151
|
+
lines.push('Missing tests:');
|
|
152
|
+
for (const m of packet.testImpact.missingTestFiles.slice(0, maxItems))
|
|
153
|
+
lines.push(`- ${m}`);
|
|
154
|
+
}
|
|
155
|
+
lines.push('');
|
|
156
|
+
// Quality regressions
|
|
157
|
+
if (packet.qualityComparison && packet.qualityComparison.regressions.length > 0) {
|
|
158
|
+
lines.push(`${heading} Quality regressions`);
|
|
159
|
+
for (const r of packet.qualityComparison.regressions.slice(0, maxItems)) {
|
|
160
|
+
lines.push(`- ${r.metric}: ${r.baseline} → ${r.current} (Δ ${r.delta})`);
|
|
161
|
+
}
|
|
162
|
+
lines.push('');
|
|
163
|
+
}
|
|
164
|
+
// Commands
|
|
165
|
+
lines.push(`${heading} Suggested commands`);
|
|
166
|
+
for (const c of packet.testImpact.testCommands.slice(0, maxItems))
|
|
167
|
+
lines.push(`- \`${c}\``);
|
|
168
|
+
for (const c of packet.impact.suggestedValidationCommands.slice(0, maxItems))
|
|
169
|
+
lines.push(`- \`${c}\``);
|
|
170
|
+
lines.push('');
|
|
171
|
+
// AI reviewer instructions
|
|
172
|
+
lines.push(`${heading} AI reviewer instructions`);
|
|
173
|
+
lines.push(packet.base.reviewerInstructions);
|
|
174
|
+
lines.push('');
|
|
175
|
+
// Artifacts
|
|
176
|
+
lines.push(`_Generated by SharkCraft review packet v2._`);
|
|
177
|
+
return lines.join('\n') + '\n';
|
|
178
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-contained HTML rendering for review packets. Dark-mode aware, no
|
|
3
|
+
* external assets. Optional collapsible long sections via <details>.
|
|
4
|
+
*/
|
|
5
|
+
import type { IReviewPacket } from './review-packet.js';
|
|
6
|
+
export interface IRenderReviewHtmlOptions {
|
|
7
|
+
/** Render long sections (e.g. >12 entries) inside collapsible <details>. */
|
|
8
|
+
collapseLongSections?: boolean;
|
|
9
|
+
/** Cap rendered list length per section. Default unlimited. */
|
|
10
|
+
maxItems?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function renderReviewHtml(packet: IReviewPacket, options?: IRenderReviewHtmlOptions): string;
|
|
13
|
+
//# sourceMappingURL=review-html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-html.d.ts","sourceRoot":"","sources":["../src/review-html.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,wBAAwB;IACvC,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkCD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,wBAA6B,GACrC,MAAM,CA+DR"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const CSS = `
|
|
2
|
+
*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;margin:0;background:#0f1419;color:#e6e1cf;padding:2rem;line-height:1.55}
|
|
3
|
+
h1,h2,h3{margin-top:1.4rem;color:#bae67e}
|
|
4
|
+
table{border-collapse:collapse;width:100%;margin:.8rem 0}
|
|
5
|
+
th,td{text-align:left;padding:.4rem .6rem;border-bottom:1px solid #2a3138}
|
|
6
|
+
th{background:#1c2329;color:#9aa5b0}
|
|
7
|
+
.badge{display:inline-block;padding:.1rem .5rem;border-radius:.25rem;font-size:.75rem;font-weight:600;text-transform:uppercase}
|
|
8
|
+
.b-info{background:#2e3a4a;color:#7fd0ff}.b-warn{background:#3a3a2e;color:#ffd580}.b-bad{background:#5a1f1f;color:#ff9f9f}
|
|
9
|
+
pre{background:#1c2329;padding:.8rem;border-radius:.4rem;overflow-x:auto}
|
|
10
|
+
code{background:#1c2329;padding:.05rem .3rem;border-radius:.2rem}
|
|
11
|
+
details > summary{cursor:pointer;font-weight:600}
|
|
12
|
+
@media (prefers-color-scheme: light){body{background:#fafaf7;color:#1f2329}h1,h2,h3{color:#266a2e}th{background:#eee;color:#222}pre,code{background:#eee}}
|
|
13
|
+
`;
|
|
14
|
+
function escapeHtml(s) {
|
|
15
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
16
|
+
}
|
|
17
|
+
function listSection(title, items, collapse, threshold = 12) {
|
|
18
|
+
if (items.length === 0)
|
|
19
|
+
return '';
|
|
20
|
+
const inner = `<ul>${items.map((i) => `<li><code>${escapeHtml(i)}</code></li>`).join('')}</ul>`;
|
|
21
|
+
if (collapse && items.length > threshold) {
|
|
22
|
+
return `<h2>${escapeHtml(title)} (${items.length})</h2><details><summary>Show ${items.length} entries</summary>${inner}</details>`;
|
|
23
|
+
}
|
|
24
|
+
return `<h2>${escapeHtml(title)} (${items.length})</h2>${inner}`;
|
|
25
|
+
}
|
|
26
|
+
export function renderReviewHtml(packet, options = {}) {
|
|
27
|
+
const maxItems = options.maxItems ?? Infinity;
|
|
28
|
+
const collapse = options.collapseLongSections ?? false;
|
|
29
|
+
const slice = (arr) => (maxItems === Infinity ? arr : arr.slice(0, maxItems));
|
|
30
|
+
const out = [];
|
|
31
|
+
out.push('<!doctype html>');
|
|
32
|
+
out.push('<html lang="en"><head><meta charset="utf-8"><title>SharkCraft review packet</title>');
|
|
33
|
+
out.push(`<style>${CSS}</style></head><body>`);
|
|
34
|
+
out.push('<h1>SharkCraft PR review packet</h1>');
|
|
35
|
+
out.push(`<p>Changed files: <strong>${packet.changedFiles.length}</strong>; Boundary issues: <strong>${packet.boundaryViolations.length}</strong>; Recommended checks: <strong>${packet.verificationCommands.length}</strong></p>`);
|
|
36
|
+
out.push(listSection('Changed files', slice(packet.changedFiles), collapse));
|
|
37
|
+
out.push(listSection('Affected path conventions', slice(packet.affectedPaths), collapse));
|
|
38
|
+
if (packet.relevantRules.length > 0) {
|
|
39
|
+
out.push('<h2>Relevant rules</h2>');
|
|
40
|
+
out.push('<table><thead><tr><th>Id</th><th>Title</th><th>Reason</th></tr></thead><tbody>');
|
|
41
|
+
for (const r of slice(packet.relevantRules)) {
|
|
42
|
+
out.push(`<tr><td><code>${escapeHtml(r.id)}</code></td><td>${escapeHtml(r.title)}</td><td>${escapeHtml(r.reason)}</td></tr>`);
|
|
43
|
+
}
|
|
44
|
+
out.push('</tbody></table>');
|
|
45
|
+
}
|
|
46
|
+
if (packet.relevantTemplates.length > 0) {
|
|
47
|
+
out.push('<h2>Relevant templates</h2>');
|
|
48
|
+
out.push('<ul>');
|
|
49
|
+
for (const t of slice(packet.relevantTemplates))
|
|
50
|
+
out.push(`<li><code>${escapeHtml(t.id)}</code> — ${escapeHtml(t.name)}</li>`);
|
|
51
|
+
out.push('</ul>');
|
|
52
|
+
}
|
|
53
|
+
if (packet.boundaryViolations.length > 0) {
|
|
54
|
+
out.push('<h2>Boundary violations</h2>');
|
|
55
|
+
out.push('<table><thead><tr><th>Rule</th><th>File</th><th>Import</th><th>Severity</th><th>Message</th></tr></thead><tbody>');
|
|
56
|
+
for (const b of slice(packet.boundaryViolations)) {
|
|
57
|
+
const cls = b.severity === 'error' ? 'b-bad' : 'b-warn';
|
|
58
|
+
out.push(`<tr><td><code>${escapeHtml(b.ruleId)}</code></td>` +
|
|
59
|
+
`<td><code>${escapeHtml(b.file)}:${b.line}</code></td>` +
|
|
60
|
+
`<td><code>${escapeHtml(b.importSpecifier)}</code></td>` +
|
|
61
|
+
`<td><span class="badge ${cls}">${escapeHtml(b.severity)}</span></td>` +
|
|
62
|
+
`<td>${escapeHtml(b.message)}</td></tr>`);
|
|
63
|
+
}
|
|
64
|
+
out.push('</tbody></table>');
|
|
65
|
+
}
|
|
66
|
+
if (packet.missingTestsHeuristic.length > 0) {
|
|
67
|
+
out.push(listSection('Possibly missing tests', slice(packet.missingTestsHeuristic), collapse));
|
|
68
|
+
}
|
|
69
|
+
if (packet.verificationCommands.length > 0) {
|
|
70
|
+
out.push('<h2>Recommended checks</h2><pre>');
|
|
71
|
+
for (const c of packet.verificationCommands)
|
|
72
|
+
out.push(escapeHtml(c));
|
|
73
|
+
out.push('</pre>');
|
|
74
|
+
}
|
|
75
|
+
out.push('<h2>AI reviewer instructions</h2>');
|
|
76
|
+
out.push(`<pre>${escapeHtml(packet.reviewerInstructions)}</pre>`);
|
|
77
|
+
out.push('</body></html>');
|
|
78
|
+
return out.join('\n') + '\n';
|
|
79
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type IBuildReviewPacketOptions, type IReviewPacket } from './review-packet.js';
|
|
2
|
+
import { type IImpactAnalysis } from './impact-analysis.js';
|
|
3
|
+
import { type ITestImpact } from './test-impact.js';
|
|
4
|
+
import { type IAreaMap } from './area-map.js';
|
|
5
|
+
import { type IOwnershipImpact } from './ownership.js';
|
|
6
|
+
import { type IPolicyReport } from './policy-engine.js';
|
|
7
|
+
import { type IQualityBaselineComparison } from './quality-baseline.js';
|
|
8
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
9
|
+
export declare const REVIEW_PACKET_V2_SCHEMA = "sharkcraft.review-packet-v2/v1";
|
|
10
|
+
export interface IReviewPacketV2 {
|
|
11
|
+
schema: typeof REVIEW_PACKET_V2_SCHEMA;
|
|
12
|
+
/** Original v1 packet (back-compat). */
|
|
13
|
+
base: IReviewPacket;
|
|
14
|
+
areaMap: IAreaMap;
|
|
15
|
+
impact: IImpactAnalysis;
|
|
16
|
+
testImpact: ITestImpact;
|
|
17
|
+
ownership: IOwnershipImpact;
|
|
18
|
+
policy: IPolicyReport;
|
|
19
|
+
qualityComparison?: IQualityBaselineComparison;
|
|
20
|
+
suggestedReviewers: readonly string[];
|
|
21
|
+
riskScore: number;
|
|
22
|
+
}
|
|
23
|
+
export interface IBuildReviewPacketV2Options extends IBuildReviewPacketOptions {
|
|
24
|
+
ownershipFiles?: readonly string[];
|
|
25
|
+
/** Optional file path to a quality baseline json — when present compare it. */
|
|
26
|
+
qualityBaselineFile?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildReviewPacketV2(inspection: ISharkcraftInspection, options?: IBuildReviewPacketV2Options): Promise<IReviewPacketV2>;
|
|
29
|
+
//# sourceMappingURL=review-packet-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-packet-v2.d.ts","sourceRoot":"","sources":["../src/review-packet-v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,yBAAyB,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAiC,KAAK,gBAAgB,EAAuB,MAAM,gBAAgB,CAAC;AAC3G,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAA0B,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,uBAAuB,mCAAmC,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,uBAAuB,CAAC;IACvC,wCAAwC;IACxC,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,iBAAiB,CAAC,EAAE,0BAA0B,CAAC;IAC/C,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,2BAA4B,SAAQ,yBAAyB;IAC5E,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,+EAA+E;IAC/E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,eAAe,CAAC,CAyC1B"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { buildReviewPacket } from "./review-packet.js";
|
|
2
|
+
import { analyzeImpact } from "./impact-analysis.js";
|
|
3
|
+
import { analyzeTestImpact } from "./test-impact.js";
|
|
4
|
+
import { buildAreaMap } from "./area-map.js";
|
|
5
|
+
import { impactFor, loadOwnershipRules } from "./ownership.js";
|
|
6
|
+
import { evaluatePolicy } from "./policy-engine.js";
|
|
7
|
+
import { compareQualityBaseline } from "./quality-baseline.js";
|
|
8
|
+
export const REVIEW_PACKET_V2_SCHEMA = 'sharkcraft.review-packet-v2/v1';
|
|
9
|
+
export async function buildReviewPacketV2(inspection, options = {}) {
|
|
10
|
+
const base = buildReviewPacket(inspection, options);
|
|
11
|
+
const areaMap = buildAreaMap(inspection);
|
|
12
|
+
const impact = await analyzeImpact(inspection, {
|
|
13
|
+
files: base.changedFiles,
|
|
14
|
+
areaMap,
|
|
15
|
+
});
|
|
16
|
+
const testImpact = analyzeTestImpact(inspection, { files: base.changedFiles });
|
|
17
|
+
const { rules } = await loadOwnershipRules(inspection.projectRoot, options.ownershipFiles);
|
|
18
|
+
const ownership = impactFor(base.changedFiles, rules);
|
|
19
|
+
const policy = await evaluatePolicy(inspection);
|
|
20
|
+
let qualityComparison;
|
|
21
|
+
if (options.qualityBaselineFile) {
|
|
22
|
+
const cmp = await compareQualityBaseline(inspection, options.qualityBaselineFile);
|
|
23
|
+
if (cmp)
|
|
24
|
+
qualityComparison = cmp;
|
|
25
|
+
}
|
|
26
|
+
const suggestedReviewers = mergeReviewers(rules, ownership);
|
|
27
|
+
const riskScore = computeRiskScore({
|
|
28
|
+
impactRisk: impact.risk,
|
|
29
|
+
boundaryViolations: base.boundaryViolations.length,
|
|
30
|
+
missingTests: base.missingTestsHeuristic.length,
|
|
31
|
+
policyErrors: policy.summary.error + policy.summary.critical,
|
|
32
|
+
qualityRegressions: qualityComparison?.regressions.length ?? 0,
|
|
33
|
+
});
|
|
34
|
+
const out = {
|
|
35
|
+
schema: REVIEW_PACKET_V2_SCHEMA,
|
|
36
|
+
base,
|
|
37
|
+
areaMap,
|
|
38
|
+
impact,
|
|
39
|
+
testImpact,
|
|
40
|
+
ownership,
|
|
41
|
+
policy,
|
|
42
|
+
suggestedReviewers,
|
|
43
|
+
riskScore,
|
|
44
|
+
};
|
|
45
|
+
if (qualityComparison)
|
|
46
|
+
out.qualityComparison = qualityComparison;
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
function mergeReviewers(rules, impact) {
|
|
50
|
+
const out = new Set(impact.reviewers);
|
|
51
|
+
for (const r of rules)
|
|
52
|
+
for (const rev of r.reviewers)
|
|
53
|
+
out.add(rev);
|
|
54
|
+
return [...out].sort();
|
|
55
|
+
}
|
|
56
|
+
function computeRiskScore(input) {
|
|
57
|
+
let s = 0;
|
|
58
|
+
if (input.impactRisk === 'critical')
|
|
59
|
+
s += 60;
|
|
60
|
+
else if (input.impactRisk === 'high')
|
|
61
|
+
s += 40;
|
|
62
|
+
else if (input.impactRisk === 'medium')
|
|
63
|
+
s += 20;
|
|
64
|
+
else
|
|
65
|
+
s += 5;
|
|
66
|
+
s += Math.min(20, input.boundaryViolations * 3);
|
|
67
|
+
s += Math.min(15, input.missingTests * 1);
|
|
68
|
+
s += Math.min(20, input.policyErrors * 5);
|
|
69
|
+
s += Math.min(15, input.qualityRegressions * 3);
|
|
70
|
+
return Math.min(100, s);
|
|
71
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type IBuildReviewPacketV2Options, type IReviewPacketV2 } from './review-packet-v2.js';
|
|
2
|
+
import { type IPolicyReport } from './policy-engine.js';
|
|
3
|
+
import { type IFeatureBundle } from './feature-bundle.js';
|
|
4
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
5
|
+
export declare const REVIEW_PACKET_V3_SCHEMA = "sharkcraft.review-packet-v3/v1";
|
|
6
|
+
export interface IBuildReviewPacketV3Options extends IBuildReviewPacketV2Options {
|
|
7
|
+
bundleId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IReviewPacketV3 {
|
|
10
|
+
schema: typeof REVIEW_PACKET_V3_SCHEMA;
|
|
11
|
+
v2: IReviewPacketV2;
|
|
12
|
+
policy: IPolicyReport;
|
|
13
|
+
bundle?: IFeatureBundle | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function buildReviewPacketV3(inspection: ISharkcraftInspection, options?: IBuildReviewPacketV3Options): Promise<IReviewPacketV3>;
|
|
16
|
+
export interface IRenderReviewCommentV3Options {
|
|
17
|
+
format?: 'markdown' | 'html';
|
|
18
|
+
maxFiles?: number;
|
|
19
|
+
maxItems?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function renderReviewCommentV3(packet: IReviewPacketV3, options?: IRenderReviewCommentV3Options): string;
|
|
22
|
+
//# sourceMappingURL=review-packet-v3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-packet-v3.d.ts","sourceRoot":"","sources":["../src/review-packet-v3.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,uBAAuB,mCAAmC,CAAC;AAExE,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,uBAAuB,CAAC;IACvC,EAAE,EAAE,eAAe,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC;AAED,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,eAAe,CAAC,CAyB1B;AAUD,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,6BAAkC,GAC1C,MAAM,CAGR"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { buildReviewPacketV2, } from "./review-packet-v2.js";
|
|
2
|
+
import { evaluatePolicy } from "./policy-engine.js";
|
|
3
|
+
import { readFeatureBundle } from "./feature-bundle.js";
|
|
4
|
+
export const REVIEW_PACKET_V3_SCHEMA = 'sharkcraft.review-packet-v3/v1';
|
|
5
|
+
export async function buildReviewPacketV3(inspection, options = {}) {
|
|
6
|
+
const v2Options = {};
|
|
7
|
+
if (options.since !== undefined)
|
|
8
|
+
v2Options.since = options.since;
|
|
9
|
+
if (options.staged !== undefined)
|
|
10
|
+
v2Options.staged = options.staged;
|
|
11
|
+
if (options.files !== undefined)
|
|
12
|
+
v2Options.files = options.files;
|
|
13
|
+
if (options.ownershipFiles !== undefined)
|
|
14
|
+
v2Options.ownershipFiles = options.ownershipFiles;
|
|
15
|
+
if (options.qualityBaselineFile !== undefined)
|
|
16
|
+
v2Options.qualityBaselineFile = options.qualityBaselineFile;
|
|
17
|
+
const v2 = await buildReviewPacketV2(inspection, v2Options);
|
|
18
|
+
const policyInput = {};
|
|
19
|
+
if (options.bundleId)
|
|
20
|
+
policyInput.bundleId = options.bundleId;
|
|
21
|
+
const policy = await evaluatePolicy(inspection, policyInput);
|
|
22
|
+
let bundle = null;
|
|
23
|
+
if (options.bundleId) {
|
|
24
|
+
bundle = readFeatureBundle(inspection.projectRoot, options.bundleId);
|
|
25
|
+
}
|
|
26
|
+
const out = {
|
|
27
|
+
schema: REVIEW_PACKET_V3_SCHEMA,
|
|
28
|
+
v2,
|
|
29
|
+
policy,
|
|
30
|
+
};
|
|
31
|
+
if (bundle !== null)
|
|
32
|
+
out.bundle = bundle;
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
function esc(s) {
|
|
36
|
+
return s
|
|
37
|
+
.replace(/&/g, '&')
|
|
38
|
+
.replace(/</g, '<')
|
|
39
|
+
.replace(/>/g, '>')
|
|
40
|
+
.replace(/"/g, '"');
|
|
41
|
+
}
|
|
42
|
+
export function renderReviewCommentV3(packet, options = {}) {
|
|
43
|
+
if (options.format === 'html')
|
|
44
|
+
return renderReviewCommentV3Html(packet, options);
|
|
45
|
+
return renderReviewCommentV3Markdown(packet, options);
|
|
46
|
+
}
|
|
47
|
+
function renderReviewCommentV3Markdown(packet, options) {
|
|
48
|
+
const maxItems = options.maxItems ?? 10;
|
|
49
|
+
const maxFiles = options.maxFiles ?? 25;
|
|
50
|
+
const v2 = packet.v2;
|
|
51
|
+
const lines = [];
|
|
52
|
+
lines.push('# SharkCraft review (v3)');
|
|
53
|
+
lines.push('');
|
|
54
|
+
lines.push(`**Risk score:** ${v2.riskScore}/100 — impact ${v2.impact.risk}`);
|
|
55
|
+
lines.push(`${v2.base.changedFiles.length} file(s), ${v2.impact.affectedAreas.length} area(s).`);
|
|
56
|
+
lines.push('');
|
|
57
|
+
if (packet.bundle) {
|
|
58
|
+
lines.push(`## Bundle: \`${packet.bundle.id}\``);
|
|
59
|
+
lines.push(`**Task:** ${packet.bundle.task}`);
|
|
60
|
+
lines.push(`**Status:** ${packet.bundle.status}`);
|
|
61
|
+
lines.push(`Plans: ${packet.bundle.plans.length}; dependencies: ${packet.bundle.dependencies.length}`);
|
|
62
|
+
lines.push('');
|
|
63
|
+
}
|
|
64
|
+
lines.push('## Ownership hints');
|
|
65
|
+
if (v2.suggestedReviewers.length === 0) {
|
|
66
|
+
lines.push('_No ownership rules matched._');
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
for (const r of v2.suggestedReviewers.slice(0, maxItems))
|
|
70
|
+
lines.push(`- ${r}`);
|
|
71
|
+
}
|
|
72
|
+
lines.push('');
|
|
73
|
+
lines.push('## Test impact');
|
|
74
|
+
lines.push(`- Likely tests: ${v2.testImpact.likelyTestFiles.length}`);
|
|
75
|
+
lines.push(`- Missing tests: ${v2.testImpact.missingTestFiles.length}`);
|
|
76
|
+
if (v2.testImpact.missingTestFiles.length > 0) {
|
|
77
|
+
for (const m of v2.testImpact.missingTestFiles.slice(0, maxItems))
|
|
78
|
+
lines.push(` - ${m}`);
|
|
79
|
+
}
|
|
80
|
+
if ('minimalCommands' in v2.testImpact && v2.testImpact.minimalCommands.length > 0) {
|
|
81
|
+
lines.push('Minimal commands:');
|
|
82
|
+
for (const c of v2.testImpact.minimalCommands)
|
|
83
|
+
lines.push(`- \`${c}\``);
|
|
84
|
+
}
|
|
85
|
+
lines.push('');
|
|
86
|
+
lines.push('## Policy');
|
|
87
|
+
lines.push(`Registered: ${packet.policy.registrations.length}; findings: ${packet.policy.checks.length}; passed=${packet.policy.summary.passed}`);
|
|
88
|
+
for (const c of packet.policy.checks.slice(0, maxItems)) {
|
|
89
|
+
lines.push(`- [${c.severity}] \`${c.id}\` — ${c.message}`);
|
|
90
|
+
}
|
|
91
|
+
lines.push('');
|
|
92
|
+
if (v2.qualityComparison) {
|
|
93
|
+
lines.push('## Quality regression');
|
|
94
|
+
lines.push(`Regressions: ${v2.qualityComparison.regressions.length}, improvements: ${v2.qualityComparison.improvements.length}`);
|
|
95
|
+
for (const r of v2.qualityComparison.regressions.slice(0, maxItems)) {
|
|
96
|
+
lines.push(`- ${r.metric}: ${r.baseline} → ${r.current} (Δ${r.delta})`);
|
|
97
|
+
}
|
|
98
|
+
lines.push('');
|
|
99
|
+
}
|
|
100
|
+
lines.push('## Changed files');
|
|
101
|
+
for (const f of v2.base.changedFiles.slice(0, maxFiles))
|
|
102
|
+
lines.push(`- ${f}`);
|
|
103
|
+
lines.push('');
|
|
104
|
+
lines.push(`## Suggested commands`);
|
|
105
|
+
for (const c of v2.testImpact.testCommands.slice(0, maxItems))
|
|
106
|
+
lines.push(`- \`${c}\``);
|
|
107
|
+
for (const c of v2.impact.suggestedValidationCommands.slice(0, maxItems))
|
|
108
|
+
lines.push(`- \`${c}\``);
|
|
109
|
+
lines.push('');
|
|
110
|
+
lines.push('## AI reviewer instructions');
|
|
111
|
+
lines.push(v2.base.reviewerInstructions);
|
|
112
|
+
return lines.join('\n') + '\n';
|
|
113
|
+
}
|
|
114
|
+
function renderReviewCommentV3Html(packet, options) {
|
|
115
|
+
const v2 = packet.v2;
|
|
116
|
+
const maxFiles = options.maxFiles ?? 25;
|
|
117
|
+
const maxItems = options.maxItems ?? 10;
|
|
118
|
+
const parts = [];
|
|
119
|
+
parts.push('<!doctype html><html><head><meta charset="utf-8">');
|
|
120
|
+
parts.push('<title>SharkCraft review v3</title>');
|
|
121
|
+
parts.push('<style>body{font:14px/1.4 -apple-system,sans-serif;max-width:1080px;margin:24px auto;padding:0 16px;color:#1f2328}');
|
|
122
|
+
parts.push('h1{font-size:20px;border-bottom:1px solid #d0d7de;padding-bottom:8px}h2{font-size:16px;margin-top:24px}');
|
|
123
|
+
parts.push('table{border-collapse:collapse;width:100%;margin:8px 0}th,td{border:1px solid #d0d7de;padding:6px 10px;text-align:left}th{background:#f6f8fa}');
|
|
124
|
+
parts.push('.tag{display:inline-block;padding:2px 8px;border-radius:9999px;font-size:11px;font-weight:600}');
|
|
125
|
+
parts.push('.tag.low{background:#dafbe1;color:#1a7f37}.tag.medium{background:#fff8c5;color:#9a6700}.tag.high{background:#ffebe9;color:#cf222e}.tag.critical{background:#cf222e;color:#fff}');
|
|
126
|
+
parts.push('code,pre{background:#f6f8fa;padding:1px 4px;border-radius:4px;font-size:12px}</style></head><body>');
|
|
127
|
+
parts.push('<h1>SharkCraft review (v3)</h1>');
|
|
128
|
+
parts.push(`<p><strong>Risk score:</strong> ${v2.riskScore}/100 — <span class="tag ${esc(v2.impact.risk)}">${esc(v2.impact.risk)}</span></p>`);
|
|
129
|
+
parts.push(`<p>${v2.base.changedFiles.length} file(s), ${v2.impact.affectedAreas.length} area(s)</p>`);
|
|
130
|
+
if (packet.bundle) {
|
|
131
|
+
parts.push(`<h2>Bundle</h2>`);
|
|
132
|
+
parts.push(`<p><strong>${esc(packet.bundle.id)}</strong> — ${esc(packet.bundle.task)}</p>`);
|
|
133
|
+
parts.push(`<p>Status: ${esc(packet.bundle.status)} · Plans: ${packet.bundle.plans.length} · Dependencies: ${packet.bundle.dependencies.length}</p>`);
|
|
134
|
+
}
|
|
135
|
+
parts.push('<h2>Ownership</h2>');
|
|
136
|
+
if (v2.suggestedReviewers.length === 0)
|
|
137
|
+
parts.push('<p><em>No ownership rules matched.</em></p>');
|
|
138
|
+
else {
|
|
139
|
+
parts.push('<ul>');
|
|
140
|
+
for (const r of v2.suggestedReviewers.slice(0, maxItems))
|
|
141
|
+
parts.push(`<li>${esc(r)}</li>`);
|
|
142
|
+
parts.push('</ul>');
|
|
143
|
+
}
|
|
144
|
+
parts.push('<h2>Test impact</h2>');
|
|
145
|
+
parts.push(`<p>Likely tests: ${v2.testImpact.likelyTestFiles.length}; Missing tests: ${v2.testImpact.missingTestFiles.length}</p>`);
|
|
146
|
+
if (v2.testImpact.missingTestFiles.length > 0) {
|
|
147
|
+
parts.push('<ul>');
|
|
148
|
+
for (const m of v2.testImpact.missingTestFiles.slice(0, maxItems))
|
|
149
|
+
parts.push(`<li>${esc(m)}</li>`);
|
|
150
|
+
parts.push('</ul>');
|
|
151
|
+
}
|
|
152
|
+
const minimal = 'minimalCommands' in v2.testImpact ? v2.testImpact.minimalCommands : [];
|
|
153
|
+
if (minimal.length > 0) {
|
|
154
|
+
parts.push('<p>Minimal commands:</p><ul>');
|
|
155
|
+
for (const c of minimal)
|
|
156
|
+
parts.push(`<li><code>${esc(c)}</code></li>`);
|
|
157
|
+
parts.push('</ul>');
|
|
158
|
+
}
|
|
159
|
+
parts.push('<h2>Policy</h2>');
|
|
160
|
+
parts.push(`<p>Registered: ${packet.policy.registrations.length}; findings: ${packet.policy.checks.length}; passed=${packet.policy.summary.passed}</p>`);
|
|
161
|
+
if (packet.policy.checks.length > 0) {
|
|
162
|
+
parts.push('<ul>');
|
|
163
|
+
for (const c of packet.policy.checks.slice(0, maxItems)) {
|
|
164
|
+
parts.push(`<li>[${esc(c.severity)}] <code>${esc(c.id)}</code> — ${esc(c.message)}</li>`);
|
|
165
|
+
}
|
|
166
|
+
parts.push('</ul>');
|
|
167
|
+
}
|
|
168
|
+
if (v2.qualityComparison) {
|
|
169
|
+
parts.push('<h2>Quality regression</h2>');
|
|
170
|
+
parts.push(`<p>Regressions: ${v2.qualityComparison.regressions.length}, improvements: ${v2.qualityComparison.improvements.length}</p>`);
|
|
171
|
+
}
|
|
172
|
+
parts.push('<h2>Changed files</h2><ul>');
|
|
173
|
+
for (const f of v2.base.changedFiles.slice(0, maxFiles))
|
|
174
|
+
parts.push(`<li>${esc(f)}</li>`);
|
|
175
|
+
parts.push('</ul>');
|
|
176
|
+
parts.push('<h2>AI reviewer instructions</h2>');
|
|
177
|
+
parts.push(`<pre>${esc(v2.base.reviewerInstructions)}</pre>`);
|
|
178
|
+
parts.push('<p><em>Generated by SharkCraft review packet v3.</em></p>');
|
|
179
|
+
parts.push('</body></html>');
|
|
180
|
+
return parts.join('\n') + '\n';
|
|
181
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
2
|
+
export interface IReviewPacket {
|
|
3
|
+
changedFiles: readonly string[];
|
|
4
|
+
/** Affected path-convention ids (best-effort substring match). */
|
|
5
|
+
affectedPaths: readonly string[];
|
|
6
|
+
/** Rules likely relevant to these changes. */
|
|
7
|
+
relevantRules: readonly {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
reason: string;
|
|
11
|
+
}[];
|
|
12
|
+
/** Pipelines/templates likely relevant. */
|
|
13
|
+
relevantTemplates: readonly {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}[];
|
|
17
|
+
relevantPipelines: readonly {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
}[];
|
|
21
|
+
/** Boundary violations restricted to the changed files. */
|
|
22
|
+
boundaryViolations: readonly {
|
|
23
|
+
ruleId: string;
|
|
24
|
+
file: string;
|
|
25
|
+
importSpecifier: string;
|
|
26
|
+
line: number;
|
|
27
|
+
severity: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}[];
|
|
30
|
+
/** Heuristic: missing tests for any changed `src/**` files. */
|
|
31
|
+
missingTestsHeuristic: readonly string[];
|
|
32
|
+
/** Verification commands recommended for the change set. */
|
|
33
|
+
verificationCommands: readonly string[];
|
|
34
|
+
/** Free-form instructions block intended for an AI PR reviewer. */
|
|
35
|
+
reviewerInstructions: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IBuildReviewPacketOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Mode of selecting changed files:
|
|
40
|
+
* - { since: 'HEAD' } → git diff --name-only HEAD
|
|
41
|
+
* - { staged: true } → git diff --name-only --cached
|
|
42
|
+
* - { files: [...] } → explicit list (paths relative to project root)
|
|
43
|
+
*/
|
|
44
|
+
since?: string;
|
|
45
|
+
staged?: boolean;
|
|
46
|
+
files?: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
export declare function buildReviewPacket(inspection: ISharkcraftInspection, options?: IBuildReviewPacketOptions): IReviewPacket;
|
|
49
|
+
//# sourceMappingURL=review-packet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-packet.d.ts","sourceRoot":"","sources":["../src/review-packet.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,kEAAkE;IAClE,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,8CAA8C;IAC9C,aAAa,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxE,2CAA2C;IAC3C,iBAAiB,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3D,iBAAiB,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5D,2DAA2D;IAC3D,kBAAkB,EAAE,SAAS;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,+DAA+D;IAC/D,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,4DAA4D;IAC5D,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,mEAAmE;IACnE,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B;AAyCD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE,yBAA8B,GACtC,aAAa,CAqFf"}
|