@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,459 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release smoke harness.
|
|
3
|
+
*
|
|
4
|
+
* Runs a safe, local, deterministic smoke suite against SharkCraft's own
|
|
5
|
+
* surfaces. The harness does NOT execute external commands itself — it
|
|
6
|
+
* declares the scenarios in a structured form so the CLI can run them
|
|
7
|
+
* with the inherited environment, and validates expected artifacts.
|
|
8
|
+
*
|
|
9
|
+
* This module is the planner. The CLI command wires it to actual `bun`
|
|
10
|
+
* subprocess invocations under a temp fixture root.
|
|
11
|
+
*
|
|
12
|
+
* Constraints (must hold):
|
|
13
|
+
* - never publishes
|
|
14
|
+
* - never calls the network
|
|
15
|
+
* - never calls external APIs
|
|
16
|
+
* - never runs `rm -rf`, `dd`, `mkfs`
|
|
17
|
+
* - writes only under the per-scenario temp dir (or the user-specified --temp-dir)
|
|
18
|
+
*/
|
|
19
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
20
|
+
import { tmpdir } from 'node:os';
|
|
21
|
+
import * as nodePath from 'node:path';
|
|
22
|
+
export const RELEASE_SMOKE_SCHEMA = 'sharkcraft.release-smoke/v1';
|
|
23
|
+
const SCENARIOS = {
|
|
24
|
+
'unconfigured-repo': {
|
|
25
|
+
id: 'unconfigured-repo',
|
|
26
|
+
title: 'Unconfigured repo onboarding',
|
|
27
|
+
description: 'Create a minimal Bun/TS repo and onboard SharkCraft.',
|
|
28
|
+
setup: [
|
|
29
|
+
{
|
|
30
|
+
title: 'Initialise fixture package.json',
|
|
31
|
+
command: ['__fixture__:init-unconfigured'],
|
|
32
|
+
notes: 'Inline fixture step (no external command).',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
steps: [
|
|
36
|
+
{
|
|
37
|
+
title: 'Onboard dry-run',
|
|
38
|
+
command: ['shrk', 'onboard', '--dry-run'],
|
|
39
|
+
assertions: [
|
|
40
|
+
{ type: 'stdout-contains', value: 'onboard', required: false, note: 'onboard ran' },
|
|
41
|
+
{ type: 'output-not-empty', required: true },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: 'Doctor',
|
|
46
|
+
command: ['shrk', 'doctor'],
|
|
47
|
+
// doctor exits non-zero in an unconfigured repo by design; both 0 and 1 are OK here.
|
|
48
|
+
allowedExitCodes: [0, 1],
|
|
49
|
+
assertions: [
|
|
50
|
+
{ type: 'stdout-contains', value: 'doctor', required: false },
|
|
51
|
+
{ type: 'output-not-empty', required: true },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
expectArtifacts: ['package.json'],
|
|
56
|
+
},
|
|
57
|
+
'dev-workflow': {
|
|
58
|
+
id: 'dev-workflow',
|
|
59
|
+
title: 'Dev workflow',
|
|
60
|
+
description: 'Start a dev session against the dogfood fixture and produce a report.',
|
|
61
|
+
setup: [
|
|
62
|
+
{
|
|
63
|
+
title: 'Initialise fixture from dogfood-target',
|
|
64
|
+
command: ['__fixture__:copy-dogfood'],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
steps: [
|
|
68
|
+
{
|
|
69
|
+
title: 'Brief',
|
|
70
|
+
command: ['shrk', 'brief', 'smoke-test-task'],
|
|
71
|
+
assertions: [
|
|
72
|
+
{ type: 'output-not-empty', required: true },
|
|
73
|
+
{ type: 'stdout-contains', value: 'smoke-test-task', required: false },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: 'Doctor',
|
|
78
|
+
command: ['shrk', 'doctor'],
|
|
79
|
+
assertions: [
|
|
80
|
+
{ type: 'stdout-contains', value: 'Verdict', required: false },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
expectArtifacts: ['sharkcraft'],
|
|
85
|
+
},
|
|
86
|
+
'pr-review': {
|
|
87
|
+
id: 'pr-review',
|
|
88
|
+
title: 'PR review',
|
|
89
|
+
description: 'Render impact + review surfaces against the dogfood fixture.',
|
|
90
|
+
setup: [
|
|
91
|
+
{
|
|
92
|
+
title: 'Initialise fixture from dogfood-target',
|
|
93
|
+
command: ['__fixture__:copy-dogfood'],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
steps: [
|
|
97
|
+
{
|
|
98
|
+
title: 'Impact (JSON)',
|
|
99
|
+
command: ['shrk', 'impact', '--format', 'json'],
|
|
100
|
+
assertions: [
|
|
101
|
+
{ type: 'json-path-exists', jsonPath: 'schema', fromStdoutJson: true, required: false },
|
|
102
|
+
{ type: 'output-not-empty', required: true },
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: 'Report site',
|
|
107
|
+
command: ['shrk', 'report', 'site', '--output', '.sharkcraft/reports/site'],
|
|
108
|
+
expectArtifacts: ['.sharkcraft/reports/site/index.html'],
|
|
109
|
+
assertions: [
|
|
110
|
+
{ type: 'file-exists', file: '.sharkcraft/reports/site/index.html', required: true },
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
expectArtifacts: ['.sharkcraft'],
|
|
115
|
+
},
|
|
116
|
+
governance: {
|
|
117
|
+
id: 'governance',
|
|
118
|
+
title: 'Governance',
|
|
119
|
+
description: 'Run quality, commands doctor, runtime doctor, safety audit, release readiness.',
|
|
120
|
+
setup: [
|
|
121
|
+
{
|
|
122
|
+
title: 'Initialise fixture from dogfood-target',
|
|
123
|
+
command: ['__fixture__:copy-dogfood'],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
steps: [
|
|
127
|
+
{ title: 'Quality', command: ['shrk', 'quality'], assertions: [{ type: 'output-not-empty', required: true }] },
|
|
128
|
+
{
|
|
129
|
+
title: 'Commands doctor',
|
|
130
|
+
command: ['shrk', 'commands', 'doctor'],
|
|
131
|
+
assertions: [
|
|
132
|
+
{ type: 'stdout-contains', value: 'errors:', required: false, note: 'doctor mentions error count' },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{ title: 'Safety audit', command: ['shrk', 'safety', 'audit'], assertions: [{ type: 'output-not-empty', required: false }] },
|
|
136
|
+
{
|
|
137
|
+
title: 'Release readiness',
|
|
138
|
+
command: ['shrk', 'release', 'readiness'],
|
|
139
|
+
assertions: [
|
|
140
|
+
{ type: 'stdout-contains', value: 'Verdict', required: false },
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
expectArtifacts: [],
|
|
145
|
+
},
|
|
146
|
+
'pack-authoring': {
|
|
147
|
+
id: 'pack-authoring',
|
|
148
|
+
title: 'Pack authoring',
|
|
149
|
+
description: 'Scaffold a demo pack and run release-check + compat against it.',
|
|
150
|
+
setup: [
|
|
151
|
+
{
|
|
152
|
+
title: 'Initialise empty fixture',
|
|
153
|
+
command: ['__fixture__:init-empty-pack-root'],
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
steps: [
|
|
157
|
+
{
|
|
158
|
+
title: 'Pack release check (smoke)',
|
|
159
|
+
command: ['shrk', 'packs', 'doctor', '--release'],
|
|
160
|
+
allowedExitCodes: [0, 1],
|
|
161
|
+
assertions: [
|
|
162
|
+
{ type: 'stdout-contains', value: 'Pack', required: false },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
expectArtifacts: [],
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
export function listSmokeScenarios() {
|
|
170
|
+
return Object.keys(SCENARIOS);
|
|
171
|
+
}
|
|
172
|
+
export function getSmokeScenario(id) {
|
|
173
|
+
const s = SCENARIOS[id];
|
|
174
|
+
if (!s)
|
|
175
|
+
throw new Error(`Unknown smoke scenario: ${id}`);
|
|
176
|
+
return s;
|
|
177
|
+
}
|
|
178
|
+
export function pickScenarios(scope) {
|
|
179
|
+
if (scope === 'all')
|
|
180
|
+
return listSmokeScenarios().map((id) => SCENARIOS[id]);
|
|
181
|
+
return [getSmokeScenario(scope)];
|
|
182
|
+
}
|
|
183
|
+
export function createFixtureRoot(input) {
|
|
184
|
+
const base = input.baseDir ?? tmpdir();
|
|
185
|
+
const ts = new Date().toISOString().replace(/[:.]/g, '-');
|
|
186
|
+
const root = nodePath.join(base, `sharkcraft-smoke-${input.scenarioId}-${ts}`);
|
|
187
|
+
mkdirSync(root, { recursive: true });
|
|
188
|
+
return { fixtureRoot: root, keep: input.keep ?? false };
|
|
189
|
+
}
|
|
190
|
+
/** Recursively collect file paths inside a fixture (deterministic order). */
|
|
191
|
+
export function collectFixtureFiles(root) {
|
|
192
|
+
const out = [];
|
|
193
|
+
const walk = (dir) => {
|
|
194
|
+
let entries;
|
|
195
|
+
try {
|
|
196
|
+
entries = readdirSync(dir).sort();
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
for (const entry of entries) {
|
|
202
|
+
const full = nodePath.join(dir, entry);
|
|
203
|
+
let stat;
|
|
204
|
+
try {
|
|
205
|
+
stat = statSync(full);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
if (stat.isDirectory())
|
|
211
|
+
walk(full);
|
|
212
|
+
else
|
|
213
|
+
out.push(nodePath.relative(root, full));
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
walk(root);
|
|
217
|
+
return out;
|
|
218
|
+
}
|
|
219
|
+
/** Source-write safety: assert no files were written outside allowed prefixes. */
|
|
220
|
+
const ALLOWED_WRITE_PREFIXES = [
|
|
221
|
+
'.sharkcraft',
|
|
222
|
+
'sharkcraft',
|
|
223
|
+
'examples',
|
|
224
|
+
'package.json',
|
|
225
|
+
'README.md',
|
|
226
|
+
'tsconfig.json',
|
|
227
|
+
'bun.lock',
|
|
228
|
+
'bun.lockb',
|
|
229
|
+
];
|
|
230
|
+
export function assertSafeWrites(files) {
|
|
231
|
+
const violations = [];
|
|
232
|
+
for (const f of files) {
|
|
233
|
+
const allowed = ALLOWED_WRITE_PREFIXES.some((p) => f === p || f.startsWith(p + nodePath.sep) || f.startsWith(p + '/'));
|
|
234
|
+
if (!allowed)
|
|
235
|
+
violations.push(f);
|
|
236
|
+
}
|
|
237
|
+
return violations;
|
|
238
|
+
}
|
|
239
|
+
/** Render the smoke report as plain text. */
|
|
240
|
+
export function renderSmokeReportText(report) {
|
|
241
|
+
const lines = [];
|
|
242
|
+
lines.push(`# Release smoke — ${report.passed ? 'PASS ✓' : 'FAIL ✕'}`);
|
|
243
|
+
lines.push(`Total: ${report.scenarios.length} scenario(s), ${report.totalDurationMs}ms`);
|
|
244
|
+
for (const s of report.scenarios) {
|
|
245
|
+
lines.push('');
|
|
246
|
+
lines.push(`## ${s.scenarioId} [${s.status}] (${s.durationMs}ms)`);
|
|
247
|
+
lines.push(`fixture: ${s.fixtureRoot}`);
|
|
248
|
+
for (const step of s.steps) {
|
|
249
|
+
lines.push(` • ${step.step.title} [${step.status}] exit=${step.exitCode ?? '?'} (${step.durationMs}ms)`);
|
|
250
|
+
if (step.artifactsMissing.length > 0) {
|
|
251
|
+
lines.push(` missing artifacts: ${step.artifactsMissing.join(', ')}`);
|
|
252
|
+
}
|
|
253
|
+
if (step.forbiddenArtifactsFound.length > 0) {
|
|
254
|
+
lines.push(` ⚠ forbidden artifacts present: ${step.forbiddenArtifactsFound.join(', ')}`);
|
|
255
|
+
}
|
|
256
|
+
if (step.assertionResults && step.assertionResults.length > 0) {
|
|
257
|
+
const passed = step.assertionResults.filter((a) => a.status === 'pass').length;
|
|
258
|
+
const failed = step.assertionResults.filter((a) => a.status === 'fail').length;
|
|
259
|
+
lines.push(` assertions: ${passed}/${step.assertionResults.length} passed${failed > 0 ? ` (${failed} failed)` : ''}`);
|
|
260
|
+
for (const a of step.assertionResults) {
|
|
261
|
+
if (a.status === 'fail') {
|
|
262
|
+
lines.push(` ✗ ${a.assertion.type}: ${a.detail ?? ''}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (step.status === 'fail') {
|
|
267
|
+
const tail = (step.stderrTail || step.stdoutTail).split(/\r?\n/).slice(-6).join('\n ');
|
|
268
|
+
if (tail)
|
|
269
|
+
lines.push(` last output:\n ${tail}`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return lines.join('\n') + '\n';
|
|
274
|
+
}
|
|
275
|
+
export function renderSmokeReportMarkdown(report) {
|
|
276
|
+
const lines = [];
|
|
277
|
+
lines.push(`# Release smoke — ${report.passed ? 'PASS' : 'FAIL'}`);
|
|
278
|
+
lines.push('');
|
|
279
|
+
lines.push(`Generated: ${report.generatedAt}`);
|
|
280
|
+
lines.push(`Scenarios: ${report.scenarios.length} · Duration: ${report.totalDurationMs}ms`);
|
|
281
|
+
lines.push('');
|
|
282
|
+
for (const s of report.scenarios) {
|
|
283
|
+
lines.push(`## \`${s.scenarioId}\` — ${s.status.toUpperCase()}`);
|
|
284
|
+
lines.push('');
|
|
285
|
+
lines.push(`Fixture: \`${s.fixtureRoot}\``);
|
|
286
|
+
lines.push('');
|
|
287
|
+
lines.push('| Step | Status | Exit | Duration | Notes |');
|
|
288
|
+
lines.push('|------|--------|------|----------|-------|');
|
|
289
|
+
for (const step of s.steps) {
|
|
290
|
+
const notes = [];
|
|
291
|
+
if (step.artifactsMissing.length > 0)
|
|
292
|
+
notes.push(`missing: ${step.artifactsMissing.join(', ')}`);
|
|
293
|
+
if (step.forbiddenArtifactsFound.length > 0)
|
|
294
|
+
notes.push(`⚠ ${step.forbiddenArtifactsFound.join(', ')}`);
|
|
295
|
+
lines.push(`| ${step.step.title} | ${step.status} | ${step.exitCode ?? '?'} | ${step.durationMs}ms | ${notes.join('; ') || ''} |`);
|
|
296
|
+
}
|
|
297
|
+
lines.push('');
|
|
298
|
+
}
|
|
299
|
+
return lines.join('\n') + '\n';
|
|
300
|
+
}
|
|
301
|
+
function escHtml(s) {
|
|
302
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
303
|
+
}
|
|
304
|
+
export function renderSmokeReportHtml(report) {
|
|
305
|
+
const out = [];
|
|
306
|
+
out.push(`<!doctype html><html><head><meta charset="utf-8"><title>Release smoke — ${report.passed ? 'PASS' : 'FAIL'}</title>`);
|
|
307
|
+
out.push('<style>body{font:14px/1.5 -apple-system,system-ui,sans-serif;max-width:920px;margin:24px auto;padding:0 16px}h1{font-size:22px}h2{font-size:16px;margin-top:24px;border-bottom:1px solid #e1e4e8;padding-bottom:4px}table{border-collapse:collapse;width:100%}th,td{border:1px solid #d0d7de;padding:6px 10px;text-align:left}.pass{color:#1a7f37}.fail{color:#b31d28}.muted{color:#586069}@media (prefers-color-scheme: dark){body{background:#0d1117;color:#c9d1d9}th{background:#161b22}.muted{color:#8b949e}}</style></head><body>');
|
|
308
|
+
out.push(`<h1>Release smoke <span class="${report.passed ? 'pass' : 'fail'}">${report.passed ? 'PASS' : 'FAIL'}</span></h1>`);
|
|
309
|
+
out.push(`<p class="muted">${escHtml(report.generatedAt)} · scenarios ${report.scenarios.length} · ${report.totalDurationMs}ms</p>`);
|
|
310
|
+
for (const s of report.scenarios) {
|
|
311
|
+
out.push(`<h2>${escHtml(s.scenarioId)} — <span class="${s.status === 'pass' ? 'pass' : 'fail'}">${escHtml(s.status)}</span></h2>`);
|
|
312
|
+
out.push(`<p class="muted">${escHtml(s.fixtureRoot)} · ${s.durationMs}ms</p>`);
|
|
313
|
+
out.push('<table><thead><tr><th>Step</th><th>Status</th><th>Exit</th><th>Duration</th><th>Notes</th></tr></thead><tbody>');
|
|
314
|
+
for (const step of s.steps) {
|
|
315
|
+
const notes = [];
|
|
316
|
+
if (step.artifactsMissing.length > 0)
|
|
317
|
+
notes.push(`missing: ${step.artifactsMissing.join(', ')}`);
|
|
318
|
+
if (step.forbiddenArtifactsFound.length > 0)
|
|
319
|
+
notes.push(`⚠ ${step.forbiddenArtifactsFound.join(', ')}`);
|
|
320
|
+
out.push(`<tr><td>${escHtml(step.step.title)}</td><td class="${step.status === 'pass' ? 'pass' : 'fail'}">${escHtml(step.status)}</td><td>${step.exitCode ?? '?'}</td><td>${step.durationMs}ms</td><td>${escHtml(notes.join('; '))}</td></tr>`);
|
|
321
|
+
}
|
|
322
|
+
out.push('</tbody></table>');
|
|
323
|
+
}
|
|
324
|
+
out.push('</body></html>');
|
|
325
|
+
return out.join('\n') + '\n';
|
|
326
|
+
}
|
|
327
|
+
export function renderSmokeReport(report, format) {
|
|
328
|
+
if (format === 'json')
|
|
329
|
+
return JSON.stringify(report, null, 2) + '\n';
|
|
330
|
+
if (format === 'markdown')
|
|
331
|
+
return renderSmokeReportMarkdown(report);
|
|
332
|
+
if (format === 'html')
|
|
333
|
+
return renderSmokeReportHtml(report);
|
|
334
|
+
return renderSmokeReportText(report);
|
|
335
|
+
}
|
|
336
|
+
/** Used by the CLI to confirm the fixture dir was prepared cleanly. */
|
|
337
|
+
export function fixtureSummary(root) {
|
|
338
|
+
if (!existsSync(root))
|
|
339
|
+
return { exists: false, fileCount: 0, files: [] };
|
|
340
|
+
const files = collectFixtureFiles(root);
|
|
341
|
+
return { exists: true, fileCount: files.length, files };
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Walk a dotted JSON path and report whether the leaf exists.
|
|
345
|
+
* `a.b.c` walks into nested objects; numeric segments index arrays.
|
|
346
|
+
*/
|
|
347
|
+
function hasJsonPath(value, path) {
|
|
348
|
+
if (!path)
|
|
349
|
+
return value !== undefined;
|
|
350
|
+
const parts = path.split('.');
|
|
351
|
+
let cursor = value;
|
|
352
|
+
for (const part of parts) {
|
|
353
|
+
if (cursor === null || cursor === undefined)
|
|
354
|
+
return false;
|
|
355
|
+
if (typeof cursor !== 'object')
|
|
356
|
+
return false;
|
|
357
|
+
const idx = Number(part);
|
|
358
|
+
if (Number.isInteger(idx) && Array.isArray(cursor)) {
|
|
359
|
+
cursor = cursor[idx];
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
cursor = cursor[part];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return cursor !== undefined;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Evaluate a single assertion. Pure — uses fs only for `file-*` types.
|
|
369
|
+
*/
|
|
370
|
+
export function evaluateSmokeAssertion(input) {
|
|
371
|
+
const a = input.assertion;
|
|
372
|
+
const required = a.required ?? true;
|
|
373
|
+
const pass = (detail) => ({
|
|
374
|
+
assertion: a,
|
|
375
|
+
status: 'pass',
|
|
376
|
+
...(detail ? { detail } : {}),
|
|
377
|
+
});
|
|
378
|
+
const fail = (detail) => ({
|
|
379
|
+
assertion: a,
|
|
380
|
+
status: required ? 'fail' : 'skipped',
|
|
381
|
+
detail,
|
|
382
|
+
});
|
|
383
|
+
switch (a.type) {
|
|
384
|
+
case 'stdout-contains': {
|
|
385
|
+
if (!a.value)
|
|
386
|
+
return fail('stdout-contains requires `value`');
|
|
387
|
+
return input.stdout.includes(a.value)
|
|
388
|
+
? pass()
|
|
389
|
+
: fail(`stdout did not contain "${a.value.slice(0, 80)}"`);
|
|
390
|
+
}
|
|
391
|
+
case 'stderr-not-contains': {
|
|
392
|
+
if (!a.value)
|
|
393
|
+
return pass();
|
|
394
|
+
return input.stderr.includes(a.value)
|
|
395
|
+
? fail(`stderr contained "${a.value.slice(0, 80)}"`)
|
|
396
|
+
: pass();
|
|
397
|
+
}
|
|
398
|
+
case 'output-not-empty': {
|
|
399
|
+
const combined = (input.stdout + input.stderr).trim();
|
|
400
|
+
return combined.length > 0 ? pass() : fail('combined output was empty');
|
|
401
|
+
}
|
|
402
|
+
case 'file-exists': {
|
|
403
|
+
if (!a.file)
|
|
404
|
+
return fail('file-exists requires `file`');
|
|
405
|
+
const full = nodePath.join(input.fixtureRoot, a.file);
|
|
406
|
+
return existsSync(full) ? pass(full) : fail(`missing file: ${a.file}`);
|
|
407
|
+
}
|
|
408
|
+
case 'file-contains': {
|
|
409
|
+
if (!a.file || !a.value)
|
|
410
|
+
return fail('file-contains requires `file` and `value`');
|
|
411
|
+
const full = nodePath.join(input.fixtureRoot, a.file);
|
|
412
|
+
if (!existsSync(full))
|
|
413
|
+
return fail(`missing file: ${a.file}`);
|
|
414
|
+
try {
|
|
415
|
+
const body = readFileSync(full, 'utf8');
|
|
416
|
+
return body.includes(a.value) ? pass() : fail(`file did not contain "${a.value.slice(0, 60)}"`);
|
|
417
|
+
}
|
|
418
|
+
catch (e) {
|
|
419
|
+
return fail(`could not read ${a.file}: ${e.message}`);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
case 'json-path-exists': {
|
|
423
|
+
if (!a.jsonPath)
|
|
424
|
+
return fail('json-path-exists requires `jsonPath`');
|
|
425
|
+
if (a.fromStdoutJson) {
|
|
426
|
+
try {
|
|
427
|
+
// Some CLI commands prepend a banner (`$ ...`) before the JSON body.
|
|
428
|
+
const candidate = input.stdout.trim();
|
|
429
|
+
const start = candidate.indexOf('{');
|
|
430
|
+
if (start < 0)
|
|
431
|
+
return fail('stdout did not contain a JSON object');
|
|
432
|
+
const parsed = JSON.parse(candidate.slice(start));
|
|
433
|
+
return hasJsonPath(parsed, a.jsonPath)
|
|
434
|
+
? pass()
|
|
435
|
+
: fail(`stdout JSON did not have path "${a.jsonPath}"`);
|
|
436
|
+
}
|
|
437
|
+
catch (e) {
|
|
438
|
+
return fail(`stdout was not JSON: ${e.message}`);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if (!a.file)
|
|
442
|
+
return fail('json-path-exists requires `file` or `fromStdoutJson`');
|
|
443
|
+
const full = nodePath.join(input.fixtureRoot, a.file);
|
|
444
|
+
if (!existsSync(full))
|
|
445
|
+
return fail(`missing file: ${a.file}`);
|
|
446
|
+
try {
|
|
447
|
+
const parsed = JSON.parse(readFileSync(full, 'utf8'));
|
|
448
|
+
return hasJsonPath(parsed, a.jsonPath)
|
|
449
|
+
? pass()
|
|
450
|
+
: fail(`file JSON did not have path "${a.jsonPath}"`);
|
|
451
|
+
}
|
|
452
|
+
catch (e) {
|
|
453
|
+
return fail(`could not parse ${a.file}: ${e.message}`);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
default:
|
|
457
|
+
return fail(`unknown assertion type ${a.type}`);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const RELEASE_TRAIN_SCHEMA = "sharkcraft.release-train/v1";
|
|
2
|
+
export declare enum ReleaseTrainStatus {
|
|
3
|
+
Planning = "planning",
|
|
4
|
+
InProgress = "in-progress",
|
|
5
|
+
ReadyToTag = "ready-to-tag",
|
|
6
|
+
Released = "released",
|
|
7
|
+
Cancelled = "cancelled"
|
|
8
|
+
}
|
|
9
|
+
export interface IReleaseTrain {
|
|
10
|
+
schema: typeof RELEASE_TRAIN_SCHEMA;
|
|
11
|
+
id: string;
|
|
12
|
+
version: string;
|
|
13
|
+
targetDate: string;
|
|
14
|
+
goals: readonly string[];
|
|
15
|
+
includedBundles: readonly string[];
|
|
16
|
+
requiredChecks: readonly string[];
|
|
17
|
+
status: ReleaseTrainStatus;
|
|
18
|
+
}
|
|
19
|
+
export declare function releaseTrainDir(projectRoot: string): string;
|
|
20
|
+
export declare function listReleaseTrains(projectRoot: string): readonly IReleaseTrain[];
|
|
21
|
+
export declare function getReleaseTrain(projectRoot: string, id: string): IReleaseTrain | undefined;
|
|
22
|
+
export declare function buildReleaseTrainDraft(version: string, opts?: {
|
|
23
|
+
goals?: readonly string[];
|
|
24
|
+
}): IReleaseTrain;
|
|
25
|
+
export declare function writeReleaseTrainDraft(projectRoot: string, train: IReleaseTrain): string;
|
|
26
|
+
export interface IReleaseTrainReadiness {
|
|
27
|
+
trainId: string;
|
|
28
|
+
ready: boolean;
|
|
29
|
+
missingBundles: readonly string[];
|
|
30
|
+
pendingChecks: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
export declare function computeReleaseTrainReadiness(projectRoot: string, train: IReleaseTrain): IReleaseTrainReadiness;
|
|
33
|
+
//# sourceMappingURL=release-train.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-train.d.ts","sourceRoot":"","sources":["../src/release-train.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAElE,oBAAY,kBAAkB;IAC5B,QAAQ,aAAa;IACrB,UAAU,gBAAgB;IAC1B,UAAU,iBAAiB;IAC3B,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,oBAAoB,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AASD,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE,CA8B/E;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAE1F;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAO,GAAG,aAAa,CAY/G;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAMxF;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,aAAa,GACnB,sBAAsB,CAaxB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local release train model.
|
|
3
|
+
*
|
|
4
|
+
* A release train groups bundles + checks under a target version. Teams
|
|
5
|
+
* use it to plan grouped releases without ever auto-publishing or
|
|
6
|
+
* tagging.
|
|
7
|
+
*
|
|
8
|
+
* Source: `sharkcraft/release-trains/<version>.json`. Read-only at the
|
|
9
|
+
* inspector layer; the CLI handles dry-run writes.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
12
|
+
import * as nodePath from 'node:path';
|
|
13
|
+
export const RELEASE_TRAIN_SCHEMA = 'sharkcraft.release-train/v1';
|
|
14
|
+
export var ReleaseTrainStatus;
|
|
15
|
+
(function (ReleaseTrainStatus) {
|
|
16
|
+
ReleaseTrainStatus["Planning"] = "planning";
|
|
17
|
+
ReleaseTrainStatus["InProgress"] = "in-progress";
|
|
18
|
+
ReleaseTrainStatus["ReadyToTag"] = "ready-to-tag";
|
|
19
|
+
ReleaseTrainStatus["Released"] = "released";
|
|
20
|
+
ReleaseTrainStatus["Cancelled"] = "cancelled";
|
|
21
|
+
})(ReleaseTrainStatus || (ReleaseTrainStatus = {}));
|
|
22
|
+
const DEFAULT_REQUIRED_CHECKS = [
|
|
23
|
+
'typecheck',
|
|
24
|
+
'tests',
|
|
25
|
+
'shrk release readiness --strict',
|
|
26
|
+
'shrk release smoke --scenario all',
|
|
27
|
+
];
|
|
28
|
+
export function releaseTrainDir(projectRoot) {
|
|
29
|
+
return nodePath.join(projectRoot, 'sharkcraft', 'release-trains');
|
|
30
|
+
}
|
|
31
|
+
export function listReleaseTrains(projectRoot) {
|
|
32
|
+
const dir = releaseTrainDir(projectRoot);
|
|
33
|
+
if (!existsSync(dir))
|
|
34
|
+
return [];
|
|
35
|
+
let files = [];
|
|
36
|
+
try {
|
|
37
|
+
files = readdirSync(dir);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const f of files) {
|
|
44
|
+
if (!f.endsWith('.json'))
|
|
45
|
+
continue;
|
|
46
|
+
try {
|
|
47
|
+
const parsed = JSON.parse(readFileSync(nodePath.join(dir, f), 'utf8'));
|
|
48
|
+
if (!parsed.id || !parsed.version)
|
|
49
|
+
continue;
|
|
50
|
+
out.push({
|
|
51
|
+
schema: RELEASE_TRAIN_SCHEMA,
|
|
52
|
+
id: parsed.id,
|
|
53
|
+
version: parsed.version,
|
|
54
|
+
targetDate: parsed.targetDate ?? '',
|
|
55
|
+
goals: parsed.goals ?? [],
|
|
56
|
+
includedBundles: parsed.includedBundles ?? [],
|
|
57
|
+
requiredChecks: parsed.requiredChecks ?? DEFAULT_REQUIRED_CHECKS,
|
|
58
|
+
status: parsed.status ?? ReleaseTrainStatus.Planning,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
export function getReleaseTrain(projectRoot, id) {
|
|
68
|
+
return listReleaseTrains(projectRoot).find((t) => t.id === id);
|
|
69
|
+
}
|
|
70
|
+
export function buildReleaseTrainDraft(version, opts = {}) {
|
|
71
|
+
const id = `train-${version.replace(/[^a-zA-Z0-9]+/g, '-')}`;
|
|
72
|
+
return {
|
|
73
|
+
schema: RELEASE_TRAIN_SCHEMA,
|
|
74
|
+
id,
|
|
75
|
+
version,
|
|
76
|
+
targetDate: '',
|
|
77
|
+
goals: opts.goals ?? [],
|
|
78
|
+
includedBundles: [],
|
|
79
|
+
requiredChecks: DEFAULT_REQUIRED_CHECKS,
|
|
80
|
+
status: ReleaseTrainStatus.Planning,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export function writeReleaseTrainDraft(projectRoot, train) {
|
|
84
|
+
const dir = releaseTrainDir(projectRoot);
|
|
85
|
+
mkdirSync(dir, { recursive: true });
|
|
86
|
+
const file = nodePath.join(dir, `${train.id}.json`);
|
|
87
|
+
writeFileSync(file, JSON.stringify(train, null, 2), 'utf8');
|
|
88
|
+
return file;
|
|
89
|
+
}
|
|
90
|
+
export function computeReleaseTrainReadiness(projectRoot, train) {
|
|
91
|
+
const missingBundles = [];
|
|
92
|
+
for (const b of train.includedBundles) {
|
|
93
|
+
const path = nodePath.join(projectRoot, '.sharkcraft', 'bundles', b);
|
|
94
|
+
if (!existsSync(path))
|
|
95
|
+
missingBundles.push(b);
|
|
96
|
+
}
|
|
97
|
+
// Pending checks are advisory only — the user runs them locally.
|
|
98
|
+
return {
|
|
99
|
+
trainId: train.id,
|
|
100
|
+
ready: missingBundles.length === 0,
|
|
101
|
+
missingBundles,
|
|
102
|
+
pendingChecks: train.requiredChecks,
|
|
103
|
+
};
|
|
104
|
+
}
|