@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,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Failure diagnostics.
|
|
3
|
+
*
|
|
4
|
+
* Common error surfaces should not just say "X failed" — they should say
|
|
5
|
+
* "X failed, probable cause is Y, try Z next". This module is a curated set
|
|
6
|
+
* of diagnostic helpers callers can use to enrich the human-facing message
|
|
7
|
+
* without re-implementing the dispatch in every command.
|
|
8
|
+
*
|
|
9
|
+
* Pure data — no I/O, no shell calls, no writes. Safe to call from MCP.
|
|
10
|
+
*/
|
|
11
|
+
export const FAILURE_DIAGNOSTIC_SCHEMA = 'sharkcraft.failure-diagnostic/v1';
|
|
12
|
+
function make(code, problem, likelyCause, nextCommand, docsLink, extra) {
|
|
13
|
+
return {
|
|
14
|
+
schema: FAILURE_DIAGNOSTIC_SCHEMA,
|
|
15
|
+
code,
|
|
16
|
+
problem,
|
|
17
|
+
likelyCause,
|
|
18
|
+
nextCommand,
|
|
19
|
+
...(docsLink ? { docsLink } : {}),
|
|
20
|
+
...(extra ? { extra } : {}),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function diagnoseMissingSharkcraftConfig(projectRoot) {
|
|
24
|
+
return make('missing-sharkcraft-config', `No sharkcraft/ directory at ${projectRoot}.`, 'SharkCraft is not initialised here yet.', 'shrk onboard --dry-run', 'docs/onboarding.md');
|
|
25
|
+
}
|
|
26
|
+
export function diagnoseMissingNodeModules() {
|
|
27
|
+
return make('missing-node-modules', 'node_modules/ not found — Bun cannot resolve workspace packages.', 'Dependencies have not been installed yet.', 'bun install', 'docs/quickstart.md');
|
|
28
|
+
}
|
|
29
|
+
export function diagnosePackHelperMissing(symbol, packName) {
|
|
30
|
+
return make('pack-helper-missing', `Pack "${packName}" imports "${symbol}" from @shrkcrft/plugin-api which is not exported.`, 'The pack expects a newer plugin-api than the consumer has installed.', `shrk packs compat ${packName} --consumer-root <consumer-path>`, 'docs/pack-authoring.md', { symbol, packName });
|
|
31
|
+
}
|
|
32
|
+
export function diagnoseMcpCacheMiss(briefId) {
|
|
33
|
+
return make('mcp-cache-miss', `MCP brief cache miss for id "${briefId}".`, 'The server restarted or the brief expired.', 'Re-run start_agent_brief_chunks with the same input — briefIds are deterministic.', 'docs/brief.md', { briefId });
|
|
34
|
+
}
|
|
35
|
+
export function diagnoseAdoptionCheckpointStale(reason) {
|
|
36
|
+
return make('adoption-checkpoint-stale', `Adoption checkpoint is stale: ${reason}.`, 'Drafts, targets or the rendered diff changed since the checkpoint was recorded.', 'shrk onboard adopt diff --record-checkpoint', 'docs/adoption-checkpoints.md');
|
|
37
|
+
}
|
|
38
|
+
export function diagnoseUnknownCommand(command, suggestions) {
|
|
39
|
+
return make('unknown-command', `Unknown command "${command}".`, suggestions.length > 0
|
|
40
|
+
? `Closest known commands: ${suggestions.slice(0, 3).join(', ')}`
|
|
41
|
+
: 'No close match in the command catalog.', 'shrk commands primary', 'docs/start-here.md', { command, suggestions });
|
|
42
|
+
}
|
|
43
|
+
export function diagnoseMissingTemplateVariables(templateId, missing) {
|
|
44
|
+
return make('missing-template-variables', `Template "${templateId}" is missing variables: ${missing.join(', ')}.`, 'The template expects these variables to be passed via --var key=value.', `shrk gen ${templateId} <name> ${missing.map((m) => `--var ${m}=<value>`).join(' ')}`, 'docs/templates.md', { templateId, missing });
|
|
45
|
+
}
|
|
46
|
+
export function diagnoseUnsafePathRefused(target) {
|
|
47
|
+
return make('unsafe-path-refused', `Path "${target}" is outside the project root or in a protected location.`, 'SharkCraft refuses to write outside the project root, into node_modules, or dist.', 'shrk doctor', 'docs/safety-model.md', { target });
|
|
48
|
+
}
|
|
49
|
+
export function diagnoseFailedVerification(verificationId, exitCode) {
|
|
50
|
+
return make('failed-verification', `Verification "${verificationId}" failed (exit code ${exitCode}).`, 'A configured verification command in sharkcraft.config.ts returned non-zero.', `Run the verification command manually and inspect the output, then re-apply the plan.`, 'docs/safety-model.md', { verificationId, exitCode });
|
|
51
|
+
}
|
|
52
|
+
export function diagnoseReleaseReadinessBlocker(blockerId, message) {
|
|
53
|
+
return make('release-readiness-blocker', `Release readiness blocker: ${blockerId}.`, message, 'shrk release readiness --json', 'docs/release-readiness.md', { blockerId });
|
|
54
|
+
}
|
|
55
|
+
export function diagnosePlanSignatureMismatch(planFile) {
|
|
56
|
+
return make('plan-signature-mismatch', `Plan signature did not verify for ${planFile}.`, 'The plan has been edited after it was signed, or the signing secret has changed.', `shrk plan review ${planFile}`, 'docs/security.md', { planFile });
|
|
57
|
+
}
|
|
58
|
+
export function diagnoseWorkflowFileNotFound(file) {
|
|
59
|
+
return make('workflow-file-not-found', `Workflow file not found: ${file}.`, 'The path may be wrong or the workflow has not been scaffolded yet.', 'shrk ci scaffold github-actions', 'docs/ci-scaffold.md', { file });
|
|
60
|
+
}
|
|
61
|
+
// ─── Polyglot diagnostics ────────────────────────────────────────────────────
|
|
62
|
+
export function diagnoseJavaCannotFindSymbol(symbol) {
|
|
63
|
+
return make('java-cannot-find-symbol', `Java compiler reports "cannot find symbol${symbol ? `: ${symbol}` : ''}".`, 'Missing import, typo, or a dependency that is not on the classpath.', 'mvn dependency:tree | grep -i <symbol> # then add the missing import or dependency', 'docs/healing-plans.md', { symbol });
|
|
64
|
+
}
|
|
65
|
+
export function diagnoseJavaPackageDoesNotExist(pkg) {
|
|
66
|
+
return make('java-package-does-not-exist', `Java reports "package ${pkg || '<name>'} does not exist".`, 'Dependency not declared in pom.xml / build.gradle, or build cache out of date.', 'mvn -U test # or `./gradlew --refresh-dependencies test`', 'docs/healing-plans.md', { pkg });
|
|
67
|
+
}
|
|
68
|
+
export function diagnoseCSharpCs0246(typeName) {
|
|
69
|
+
return make('csharp-cs0246', `CS0246: the type or namespace "${typeName || '(unknown)'}" could not be found.`, 'Missing `using` directive or NuGet package not restored.', 'dotnet restore # then check the using directives in the failing file', 'docs/healing-plans.md', { typeName });
|
|
70
|
+
}
|
|
71
|
+
export function diagnoseCSharpNu1101(packageName) {
|
|
72
|
+
return make('csharp-nu1101', `NU1101: package "${packageName || '(unknown)'}" not found.`, 'NuGet feed misconfigured or package id misspelled.', 'dotnet nuget list source # verify the feed; then `dotnet restore --force-evaluate`', 'docs/healing-plans.md', { packageName });
|
|
73
|
+
}
|
|
74
|
+
export function diagnosePythonModuleNotFound(moduleName) {
|
|
75
|
+
return make('python-module-not-found', `ModuleNotFoundError: No module named "${moduleName || '(unknown)'}".`, 'Dependency not installed in the active env, or import path is wrong.', 'python -m pip install -r requirements.txt # or `uv sync` / `poetry install`', 'docs/healing-plans.md', { moduleName });
|
|
76
|
+
}
|
|
77
|
+
export function diagnosePythonPytestCollectionError(detail) {
|
|
78
|
+
return make('python-pytest-collection-error', `pytest collection error: ${detail || '(see traceback above)'}.`, 'Test file imports something missing, or a fixture / conftest fails to import.', 'python -m pytest --collect-only # narrow down the failing module', 'docs/healing-plans.md', { detail });
|
|
79
|
+
}
|
|
80
|
+
export function diagnoseGoCannotFindModule(moduleName) {
|
|
81
|
+
return make('go-cannot-find-module', `Go build reports "no required module provides package ${moduleName || '<name>'}".`, 'go.mod is out of date — module not declared or not pulled.', 'go mod tidy # then `go test ./...`', 'docs/healing-plans.md', { moduleName });
|
|
82
|
+
}
|
|
83
|
+
export function diagnoseGoImportCycle(detail) {
|
|
84
|
+
return make('go-import-cycle', `Go build reports import cycle: ${detail || '(see error)'}.`, 'Two packages import each other directly or transitively.', 'go list -deps ./... # then refactor: extract shared types into a new package', 'docs/healing-plans.md', { detail });
|
|
85
|
+
}
|
|
86
|
+
export function diagnoseRustE0432(detail) {
|
|
87
|
+
return make('rust-e0432', `Rust E0432: unresolved import (${detail || 'see compiler output'}).`, 'Crate not declared in Cargo.toml, or `mod` declaration missing.', 'cargo build # then add the missing dependency to Cargo.toml or declare the mod', 'docs/healing-plans.md', { detail });
|
|
88
|
+
}
|
|
89
|
+
export function diagnoseRustE0308(detail) {
|
|
90
|
+
return make('rust-e0308', `Rust E0308: mismatched types (${detail || 'see compiler output'}).`, 'Borrow / move / lifetime mismatch, or the expression returns a different type than expected.', 'cargo check --message-format=short # then inspect the offending expression', 'docs/healing-plans.md', { detail });
|
|
91
|
+
}
|
|
92
|
+
export function renderDiagnosticText(d) {
|
|
93
|
+
const lines = [];
|
|
94
|
+
lines.push(`⚠️ ${d.problem}`);
|
|
95
|
+
lines.push(` Likely cause: ${d.likelyCause}`);
|
|
96
|
+
lines.push(` Try next: ${d.nextCommand}`);
|
|
97
|
+
if (d.docsLink)
|
|
98
|
+
lines.push(` Docs: ${d.docsLink}`);
|
|
99
|
+
return lines.join('\n') + '\n';
|
|
100
|
+
}
|
|
101
|
+
const REGISTRY = Object.freeze([
|
|
102
|
+
{
|
|
103
|
+
code: 'missing-sharkcraft-config',
|
|
104
|
+
description: 'No sharkcraft/ directory in the project root.',
|
|
105
|
+
contextKeys: ['projectRoot'],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
code: 'missing-node-modules',
|
|
109
|
+
description: 'node_modules/ is absent — dependencies not installed yet.',
|
|
110
|
+
contextKeys: [],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
code: 'pack-helper-missing',
|
|
114
|
+
description: 'Pack imports a plugin-api symbol the consumer does not export.',
|
|
115
|
+
contextKeys: ['symbol', 'packName'],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
code: 'mcp-cache-miss',
|
|
119
|
+
description: 'MCP brief cache miss — the briefId is no longer cached.',
|
|
120
|
+
contextKeys: ['briefId'],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
code: 'adoption-checkpoint-stale',
|
|
124
|
+
description: 'Adoption checkpoint is stale (drafts / targets / diff hash changed, or age > max-age-days).',
|
|
125
|
+
contextKeys: ['reason'],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
code: 'unknown-command',
|
|
129
|
+
description: 'The user invoked a `shrk` command that is not in the catalog.',
|
|
130
|
+
contextKeys: ['command'],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
code: 'missing-template-variables',
|
|
134
|
+
description: 'Template generation is missing one or more required variables.',
|
|
135
|
+
contextKeys: ['templateId', 'missing'],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
code: 'unsafe-path-refused',
|
|
139
|
+
description: 'A target path resolved outside the project root or into a protected location.',
|
|
140
|
+
contextKeys: ['target'],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
code: 'failed-verification',
|
|
144
|
+
description: 'A `sharkcraft.config` verification command returned non-zero.',
|
|
145
|
+
contextKeys: ['verificationId', 'exitCode'],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
code: 'release-readiness-blocker',
|
|
149
|
+
description: 'Release readiness reported a blocker.',
|
|
150
|
+
contextKeys: ['blockerId', 'message'],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
code: 'plan-signature-mismatch',
|
|
154
|
+
description: 'A signed plan did not verify (the plan was edited or the secret rotated).',
|
|
155
|
+
contextKeys: ['planFile'],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
code: 'workflow-file-not-found',
|
|
159
|
+
description: 'A CI workflow file path was missing during audit.',
|
|
160
|
+
contextKeys: ['file'],
|
|
161
|
+
},
|
|
162
|
+
// Polyglot
|
|
163
|
+
{ code: 'java-cannot-find-symbol', description: 'Java compiler "cannot find symbol".', contextKeys: ['symbol'] },
|
|
164
|
+
{ code: 'java-package-does-not-exist', description: 'Java compiler "package X does not exist".', contextKeys: ['pkg'] },
|
|
165
|
+
{ code: 'csharp-cs0246', description: 'CS0246 — type or namespace not found.', contextKeys: ['typeName'] },
|
|
166
|
+
{ code: 'csharp-nu1101', description: 'NU1101 — NuGet package not found.', contextKeys: ['packageName'] },
|
|
167
|
+
{ code: 'python-module-not-found', description: 'Python ModuleNotFoundError.', contextKeys: ['moduleName'] },
|
|
168
|
+
{ code: 'python-pytest-collection-error', description: 'pytest collection error.', contextKeys: ['detail'] },
|
|
169
|
+
{ code: 'go-cannot-find-module', description: 'Go "no required module provides package".', contextKeys: ['moduleName'] },
|
|
170
|
+
{ code: 'go-import-cycle', description: 'Go import cycle.', contextKeys: ['detail'] },
|
|
171
|
+
{ code: 'rust-e0432', description: 'Rust E0432 — unresolved import.', contextKeys: ['detail'] },
|
|
172
|
+
{ code: 'rust-e0308', description: 'Rust E0308 — mismatched types.', contextKeys: ['detail'] },
|
|
173
|
+
]);
|
|
174
|
+
export function listDiagnostics() {
|
|
175
|
+
return REGISTRY;
|
|
176
|
+
}
|
|
177
|
+
export function getDiagnosticEntry(code) {
|
|
178
|
+
return REGISTRY.find((e) => e.code === code) ?? null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Produce a diagnostic by code using a context bag. Missing context fields
|
|
182
|
+
* fall back to `(unknown)` so the diagnostic remains useful as documentation.
|
|
183
|
+
*/
|
|
184
|
+
export function buildDiagnosticByCode(code, context = {}) {
|
|
185
|
+
const s = (k, fallback = '(unknown)') => {
|
|
186
|
+
const v = context[k];
|
|
187
|
+
return typeof v === 'string' || typeof v === 'number' ? String(v) : fallback;
|
|
188
|
+
};
|
|
189
|
+
switch (code) {
|
|
190
|
+
case 'missing-sharkcraft-config':
|
|
191
|
+
return diagnoseMissingSharkcraftConfig(s('projectRoot', '(unknown)'));
|
|
192
|
+
case 'missing-node-modules':
|
|
193
|
+
return diagnoseMissingNodeModules();
|
|
194
|
+
case 'pack-helper-missing':
|
|
195
|
+
return diagnosePackHelperMissing(s('symbol'), s('packName'));
|
|
196
|
+
case 'mcp-cache-miss':
|
|
197
|
+
return diagnoseMcpCacheMiss(s('briefId'));
|
|
198
|
+
case 'adoption-checkpoint-stale':
|
|
199
|
+
return diagnoseAdoptionCheckpointStale(s('reason', 'unknown'));
|
|
200
|
+
case 'unknown-command': {
|
|
201
|
+
const suggestions = Array.isArray(context['suggestions'])
|
|
202
|
+
? context['suggestions']
|
|
203
|
+
: [];
|
|
204
|
+
return diagnoseUnknownCommand(s('command'), suggestions);
|
|
205
|
+
}
|
|
206
|
+
case 'missing-template-variables': {
|
|
207
|
+
const missing = Array.isArray(context['missing']) ? context['missing'] : [];
|
|
208
|
+
return diagnoseMissingTemplateVariables(s('templateId'), missing);
|
|
209
|
+
}
|
|
210
|
+
case 'unsafe-path-refused':
|
|
211
|
+
return diagnoseUnsafePathRefused(s('target'));
|
|
212
|
+
case 'failed-verification':
|
|
213
|
+
return diagnoseFailedVerification(s('verificationId'), Number(context['exitCode'] ?? -1));
|
|
214
|
+
case 'release-readiness-blocker':
|
|
215
|
+
return diagnoseReleaseReadinessBlocker(s('blockerId'), s('message', 'see release readiness output'));
|
|
216
|
+
case 'plan-signature-mismatch':
|
|
217
|
+
return diagnosePlanSignatureMismatch(s('planFile'));
|
|
218
|
+
case 'workflow-file-not-found':
|
|
219
|
+
return diagnoseWorkflowFileNotFound(s('file'));
|
|
220
|
+
case 'java-cannot-find-symbol':
|
|
221
|
+
return diagnoseJavaCannotFindSymbol(s('symbol', ''));
|
|
222
|
+
case 'java-package-does-not-exist':
|
|
223
|
+
return diagnoseJavaPackageDoesNotExist(s('pkg', ''));
|
|
224
|
+
case 'csharp-cs0246':
|
|
225
|
+
return diagnoseCSharpCs0246(s('typeName', ''));
|
|
226
|
+
case 'csharp-nu1101':
|
|
227
|
+
return diagnoseCSharpNu1101(s('packageName', ''));
|
|
228
|
+
case 'python-module-not-found':
|
|
229
|
+
return diagnosePythonModuleNotFound(s('moduleName', ''));
|
|
230
|
+
case 'python-pytest-collection-error':
|
|
231
|
+
return diagnosePythonPytestCollectionError(s('detail', ''));
|
|
232
|
+
case 'go-cannot-find-module':
|
|
233
|
+
return diagnoseGoCannotFindModule(s('moduleName', ''));
|
|
234
|
+
case 'go-import-cycle':
|
|
235
|
+
return diagnoseGoImportCycle(s('detail', ''));
|
|
236
|
+
case 'rust-e0432':
|
|
237
|
+
return diagnoseRustE0432(s('detail', ''));
|
|
238
|
+
case 'rust-e0308':
|
|
239
|
+
return diagnoseRustE0308(s('detail', ''));
|
|
240
|
+
default:
|
|
241
|
+
return make(code, `Unknown diagnostic code "${code}".`, 'The code may be misspelled.', 'shrk diagnostics list', 'docs/start-here.md');
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ITaskPacket } from './task-packet.js';
|
|
2
|
+
import type { ITaskDecomposition } from './task-decompose.js';
|
|
3
|
+
export declare const FEATURE_BUNDLE_SCHEMA = "sharkcraft.feature-bundle/v1";
|
|
4
|
+
export declare enum FeatureBundleStatus {
|
|
5
|
+
Draft = "draft",
|
|
6
|
+
Planned = "planned",
|
|
7
|
+
PartiallyApplied = "partially-applied",
|
|
8
|
+
Applied = "applied",
|
|
9
|
+
Validated = "validated",
|
|
10
|
+
Failed = "failed",
|
|
11
|
+
Completed = "completed"
|
|
12
|
+
}
|
|
13
|
+
export declare enum BundleRiskLevel {
|
|
14
|
+
Low = "low",
|
|
15
|
+
Medium = "medium",
|
|
16
|
+
High = "high",
|
|
17
|
+
Critical = "critical"
|
|
18
|
+
}
|
|
19
|
+
export interface IFeatureBundlePlan {
|
|
20
|
+
/** Stable name within the bundle (basename without extension). */
|
|
21
|
+
name: string;
|
|
22
|
+
templateId: string;
|
|
23
|
+
generatedName?: string;
|
|
24
|
+
variables: Record<string, string>;
|
|
25
|
+
missingVariables: readonly string[];
|
|
26
|
+
/** Plans file under `plans/<name>.json` or `plans/<name>.intent.md`. */
|
|
27
|
+
file: string;
|
|
28
|
+
status: 'intent' | 'saved' | 'reviewed' | 'applied' | 'failed';
|
|
29
|
+
reviewReportFile?: string;
|
|
30
|
+
signed?: boolean;
|
|
31
|
+
/** Files this plan is expected to write (best-effort). */
|
|
32
|
+
expectedTargets: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
export interface IFeatureBundlePlanGroup {
|
|
35
|
+
/** Ordering group: plans in the same group can be applied in any order. */
|
|
36
|
+
id: string;
|
|
37
|
+
planNames: readonly string[];
|
|
38
|
+
description?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IFeatureBundleDependency {
|
|
41
|
+
from: string;
|
|
42
|
+
to: string;
|
|
43
|
+
reason: string;
|
|
44
|
+
}
|
|
45
|
+
export interface IFeatureBundleValidation {
|
|
46
|
+
startedAt: string;
|
|
47
|
+
finishedAt: string;
|
|
48
|
+
passed: boolean;
|
|
49
|
+
warnings: number;
|
|
50
|
+
commandsRun: {
|
|
51
|
+
command: string;
|
|
52
|
+
passed: boolean;
|
|
53
|
+
note?: string;
|
|
54
|
+
}[];
|
|
55
|
+
boundaryViolations: number;
|
|
56
|
+
reportFile: string;
|
|
57
|
+
}
|
|
58
|
+
export interface IFeatureBundle {
|
|
59
|
+
schema: typeof FEATURE_BUNDLE_SCHEMA;
|
|
60
|
+
id: string;
|
|
61
|
+
task: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
projectRoot: string;
|
|
65
|
+
sessionId?: string;
|
|
66
|
+
pipelineId?: string;
|
|
67
|
+
status: FeatureBundleStatus;
|
|
68
|
+
plans: readonly IFeatureBundlePlan[];
|
|
69
|
+
planGroups: readonly IFeatureBundlePlanGroup[];
|
|
70
|
+
dependencies: readonly IFeatureBundleDependency[];
|
|
71
|
+
validations: readonly IFeatureBundleValidation[];
|
|
72
|
+
reports: readonly string[];
|
|
73
|
+
affectedFiles: readonly string[];
|
|
74
|
+
affectedAreas: readonly string[];
|
|
75
|
+
riskLevel: BundleRiskLevel;
|
|
76
|
+
nextAction: string | null;
|
|
77
|
+
commandHints: readonly string[];
|
|
78
|
+
warnings: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
export declare function getBundlesRoot(cwd: string): string;
|
|
81
|
+
export declare function getBundleDir(cwd: string, id: string): string;
|
|
82
|
+
export interface ICreateFeatureBundleInput {
|
|
83
|
+
id: string;
|
|
84
|
+
task: string;
|
|
85
|
+
projectRoot: string;
|
|
86
|
+
packet: ITaskPacket;
|
|
87
|
+
decomposition?: ITaskDecomposition;
|
|
88
|
+
sessionId?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function createFeatureBundleState(input: ICreateFeatureBundleInput): IFeatureBundle;
|
|
91
|
+
export declare function writeFeatureBundle(cwd: string, bundle: IFeatureBundle): IFeatureBundle;
|
|
92
|
+
export declare function readFeatureBundle(cwd: string, id: string): IFeatureBundle | null;
|
|
93
|
+
export declare function listFeatureBundles(cwd: string): IFeatureBundle[];
|
|
94
|
+
export declare function upsertBundlePlan(bundle: IFeatureBundle, plan: IFeatureBundlePlan): IFeatureBundle;
|
|
95
|
+
export declare function recomputeBundleStatus(bundle: IFeatureBundle): IFeatureBundle;
|
|
96
|
+
export declare function setBundleNextAction(bundle: IFeatureBundle, nextAction: string | null): IFeatureBundle;
|
|
97
|
+
export declare function recordBundleReport(bundle: IFeatureBundle, file: string): IFeatureBundle;
|
|
98
|
+
export declare function recordBundleValidation(bundle: IFeatureBundle, v: IFeatureBundleValidation): IFeatureBundle;
|
|
99
|
+
/**
|
|
100
|
+
* Mark a plan as applied (status='applied') after a human ran `shrk apply`.
|
|
101
|
+
* Returns the updated bundle without touching validations.
|
|
102
|
+
*/
|
|
103
|
+
export declare function markBundlePlanApplied(bundle: IFeatureBundle, planName: string, note?: string): IFeatureBundle;
|
|
104
|
+
/**
|
|
105
|
+
* Persist graph-derived dependencies onto the bundle so MCP / read-only
|
|
106
|
+
* consumers can see the order without rebuilding the graph from the
|
|
107
|
+
* registries. `planGroups` are derived from the topological order: every plan
|
|
108
|
+
* whose predecessors are already in an earlier group becomes a new group.
|
|
109
|
+
*/
|
|
110
|
+
export declare function setBundleDependencies(bundle: IFeatureBundle, edges: readonly IFeatureBundleDependency[], order: readonly string[]): IFeatureBundle;
|
|
111
|
+
//# sourceMappingURL=feature-bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-bundle.d.ts","sourceRoot":"","sources":["../src/feature-bundle.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,OAAO,YAAY;IACn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E,MAAM,CAAC;CACpB;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,yBAAyB,GAAG,cAAc,CA8BzF;AAUD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,cAAc,CAatF;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAQhF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE,CAsBhE;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,kBAAkB,GACvB,cAAc,CAGhB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAa5E;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,cAAc,CAEhB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAGvF;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc,EACtB,CAAC,EAAE,wBAAwB,GAC1B,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,cAAc,CAKhB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,SAAS,wBAAwB,EAAE,EAC1C,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,cAAc,CAqChB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync, } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
export const FEATURE_BUNDLE_SCHEMA = 'sharkcraft.feature-bundle/v1';
|
|
4
|
+
export var FeatureBundleStatus;
|
|
5
|
+
(function (FeatureBundleStatus) {
|
|
6
|
+
FeatureBundleStatus["Draft"] = "draft";
|
|
7
|
+
FeatureBundleStatus["Planned"] = "planned";
|
|
8
|
+
FeatureBundleStatus["PartiallyApplied"] = "partially-applied";
|
|
9
|
+
FeatureBundleStatus["Applied"] = "applied";
|
|
10
|
+
FeatureBundleStatus["Validated"] = "validated";
|
|
11
|
+
FeatureBundleStatus["Failed"] = "failed";
|
|
12
|
+
FeatureBundleStatus["Completed"] = "completed";
|
|
13
|
+
})(FeatureBundleStatus || (FeatureBundleStatus = {}));
|
|
14
|
+
export var BundleRiskLevel;
|
|
15
|
+
(function (BundleRiskLevel) {
|
|
16
|
+
BundleRiskLevel["Low"] = "low";
|
|
17
|
+
BundleRiskLevel["Medium"] = "medium";
|
|
18
|
+
BundleRiskLevel["High"] = "high";
|
|
19
|
+
BundleRiskLevel["Critical"] = "critical";
|
|
20
|
+
})(BundleRiskLevel || (BundleRiskLevel = {}));
|
|
21
|
+
export function getBundlesRoot(cwd) {
|
|
22
|
+
return nodePath.join(cwd, '.sharkcraft', 'bundles');
|
|
23
|
+
}
|
|
24
|
+
export function getBundleDir(cwd, id) {
|
|
25
|
+
return nodePath.join(getBundlesRoot(cwd), id);
|
|
26
|
+
}
|
|
27
|
+
function nowIso() {
|
|
28
|
+
return new Date().toISOString();
|
|
29
|
+
}
|
|
30
|
+
export function createFeatureBundleState(input) {
|
|
31
|
+
const created = nowIso();
|
|
32
|
+
const pipelineId = input.packet.recommendedPipelines[0]?.pipelineId;
|
|
33
|
+
const commandHints = [...input.packet.recommendedCliCommands].slice(0, 6);
|
|
34
|
+
const dec = input.decomposition;
|
|
35
|
+
const initialPlans = [];
|
|
36
|
+
const out = {
|
|
37
|
+
schema: FEATURE_BUNDLE_SCHEMA,
|
|
38
|
+
id: input.id,
|
|
39
|
+
task: input.task,
|
|
40
|
+
createdAt: created,
|
|
41
|
+
updatedAt: created,
|
|
42
|
+
projectRoot: input.projectRoot,
|
|
43
|
+
status: FeatureBundleStatus.Draft,
|
|
44
|
+
plans: initialPlans,
|
|
45
|
+
planGroups: [],
|
|
46
|
+
dependencies: [],
|
|
47
|
+
validations: [],
|
|
48
|
+
reports: [],
|
|
49
|
+
affectedFiles: [],
|
|
50
|
+
affectedAreas: dec?.riskAreas ?? [],
|
|
51
|
+
riskLevel: assessRisk(input.packet, dec),
|
|
52
|
+
nextAction: `shrk bundle plan ${input.id}`,
|
|
53
|
+
commandHints,
|
|
54
|
+
warnings: [],
|
|
55
|
+
};
|
|
56
|
+
if (input.sessionId)
|
|
57
|
+
out.sessionId = input.sessionId;
|
|
58
|
+
if (pipelineId)
|
|
59
|
+
out.pipelineId = pipelineId;
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
function assessRisk(packet, dec) {
|
|
63
|
+
const subtasks = dec?.subtasks ?? [];
|
|
64
|
+
if (subtasks.some((s) => s.riskLevel === 'high'))
|
|
65
|
+
return BundleRiskLevel.High;
|
|
66
|
+
if (packet.forbiddenActions.length > 5)
|
|
67
|
+
return BundleRiskLevel.Medium;
|
|
68
|
+
if (subtasks.some((s) => s.riskLevel === 'medium'))
|
|
69
|
+
return BundleRiskLevel.Medium;
|
|
70
|
+
return BundleRiskLevel.Low;
|
|
71
|
+
}
|
|
72
|
+
export function writeFeatureBundle(cwd, bundle) {
|
|
73
|
+
const dir = getBundleDir(cwd, bundle.id);
|
|
74
|
+
mkdirSync(dir, { recursive: true });
|
|
75
|
+
mkdirSync(nodePath.join(dir, 'plans'), { recursive: true });
|
|
76
|
+
mkdirSync(nodePath.join(dir, 'reviews'), { recursive: true });
|
|
77
|
+
mkdirSync(nodePath.join(dir, 'reports'), { recursive: true });
|
|
78
|
+
const next = { ...bundle, updatedAt: nowIso() };
|
|
79
|
+
writeFileSync(nodePath.join(dir, 'bundle.json'), JSON.stringify(next, null, 2) + '\n', 'utf8');
|
|
80
|
+
return next;
|
|
81
|
+
}
|
|
82
|
+
export function readFeatureBundle(cwd, id) {
|
|
83
|
+
const file = nodePath.join(getBundleDir(cwd, id), 'bundle.json');
|
|
84
|
+
if (!existsSync(file))
|
|
85
|
+
return null;
|
|
86
|
+
try {
|
|
87
|
+
return JSON.parse(readFileSync(file, 'utf8'));
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export function listFeatureBundles(cwd) {
|
|
94
|
+
const root = getBundlesRoot(cwd);
|
|
95
|
+
if (!existsSync(root))
|
|
96
|
+
return [];
|
|
97
|
+
const ids = [];
|
|
98
|
+
try {
|
|
99
|
+
for (const e of readdirSync(root)) {
|
|
100
|
+
try {
|
|
101
|
+
if (statSync(nodePath.join(root, e)).isDirectory())
|
|
102
|
+
ids.push(e);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
/* ignore */
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
ids.sort();
|
|
113
|
+
const out = [];
|
|
114
|
+
for (const id of ids) {
|
|
115
|
+
const b = readFeatureBundle(cwd, id);
|
|
116
|
+
if (b)
|
|
117
|
+
out.push(b);
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
export function upsertBundlePlan(bundle, plan) {
|
|
122
|
+
const plans = bundle.plans.filter((p) => p.name !== plan.name);
|
|
123
|
+
return { ...bundle, plans: [...plans, plan] };
|
|
124
|
+
}
|
|
125
|
+
export function recomputeBundleStatus(bundle) {
|
|
126
|
+
if (bundle.plans.length === 0)
|
|
127
|
+
return { ...bundle, status: FeatureBundleStatus.Draft };
|
|
128
|
+
const allApplied = bundle.plans.every((p) => p.status === 'applied');
|
|
129
|
+
const someApplied = bundle.plans.some((p) => p.status === 'applied');
|
|
130
|
+
const allReviewed = bundle.plans.every((p) => p.status === 'reviewed' || p.status === 'applied' || p.status === 'intent');
|
|
131
|
+
const validatedOk = bundle.validations.length > 0 && bundle.validations.every((v) => v.passed);
|
|
132
|
+
let status = FeatureBundleStatus.Draft;
|
|
133
|
+
if (allReviewed && !someApplied)
|
|
134
|
+
status = FeatureBundleStatus.Planned;
|
|
135
|
+
if (someApplied && !allApplied)
|
|
136
|
+
status = FeatureBundleStatus.PartiallyApplied;
|
|
137
|
+
if (allApplied)
|
|
138
|
+
status = FeatureBundleStatus.Applied;
|
|
139
|
+
if (allApplied && validatedOk)
|
|
140
|
+
status = FeatureBundleStatus.Validated;
|
|
141
|
+
if (bundle.validations.some((v) => !v.passed))
|
|
142
|
+
status = FeatureBundleStatus.Failed;
|
|
143
|
+
return { ...bundle, status };
|
|
144
|
+
}
|
|
145
|
+
export function setBundleNextAction(bundle, nextAction) {
|
|
146
|
+
return { ...bundle, nextAction };
|
|
147
|
+
}
|
|
148
|
+
export function recordBundleReport(bundle, file) {
|
|
149
|
+
if (bundle.reports.includes(file))
|
|
150
|
+
return bundle;
|
|
151
|
+
return { ...bundle, reports: [...bundle.reports, file] };
|
|
152
|
+
}
|
|
153
|
+
export function recordBundleValidation(bundle, v) {
|
|
154
|
+
return { ...bundle, validations: [...bundle.validations, v] };
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Mark a plan as applied (status='applied') after a human ran `shrk apply`.
|
|
158
|
+
* Returns the updated bundle without touching validations.
|
|
159
|
+
*/
|
|
160
|
+
export function markBundlePlanApplied(bundle, planName, note) {
|
|
161
|
+
const plans = bundle.plans.map((p) => p.name === planName ? { ...p, status: 'applied', ...(note ? { note } : {}) } : p);
|
|
162
|
+
return { ...bundle, plans };
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Persist graph-derived dependencies onto the bundle so MCP / read-only
|
|
166
|
+
* consumers can see the order without rebuilding the graph from the
|
|
167
|
+
* registries. `planGroups` are derived from the topological order: every plan
|
|
168
|
+
* whose predecessors are already in an earlier group becomes a new group.
|
|
169
|
+
*/
|
|
170
|
+
export function setBundleDependencies(bundle, edges, order) {
|
|
171
|
+
const incoming = new Map();
|
|
172
|
+
for (const e of edges) {
|
|
173
|
+
const s = incoming.get(e.to) ?? new Set();
|
|
174
|
+
s.add(e.from);
|
|
175
|
+
incoming.set(e.to, s);
|
|
176
|
+
}
|
|
177
|
+
const placed = new Set();
|
|
178
|
+
const groups = [];
|
|
179
|
+
let remaining = [...order];
|
|
180
|
+
let idx = 0;
|
|
181
|
+
while (remaining.length > 0) {
|
|
182
|
+
const wave = remaining.filter((n) => {
|
|
183
|
+
const deps = incoming.get(n) ?? new Set();
|
|
184
|
+
for (const d of deps)
|
|
185
|
+
if (!placed.has(d))
|
|
186
|
+
return false;
|
|
187
|
+
return true;
|
|
188
|
+
});
|
|
189
|
+
if (wave.length === 0) {
|
|
190
|
+
// Cycle remnant — pack everything left into a final group so the
|
|
191
|
+
// bundle stays writable.
|
|
192
|
+
groups.push({
|
|
193
|
+
id: `group-${idx + 1}`,
|
|
194
|
+
planNames: remaining,
|
|
195
|
+
description: 'unresolved dependency cycle',
|
|
196
|
+
});
|
|
197
|
+
for (const n of remaining)
|
|
198
|
+
placed.add(n);
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
groups.push({
|
|
202
|
+
id: `group-${idx + 1}`,
|
|
203
|
+
planNames: wave,
|
|
204
|
+
});
|
|
205
|
+
for (const n of wave)
|
|
206
|
+
placed.add(n);
|
|
207
|
+
remaining = remaining.filter((n) => !placed.has(n));
|
|
208
|
+
idx += 1;
|
|
209
|
+
}
|
|
210
|
+
return { ...bundle, dependencies: edges, planGroups: groups };
|
|
211
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
2
|
+
export declare const FEEDBACK_ACTIONS_V2_SCHEMA = "sharkcraft.feedback-actions/v2";
|
|
3
|
+
export declare enum FeedbackActionCategory {
|
|
4
|
+
Good = "good",
|
|
5
|
+
Bad = "bad",
|
|
6
|
+
Missing = "missing",
|
|
7
|
+
Confusion = "confusion",
|
|
8
|
+
Friction = "friction",
|
|
9
|
+
Bug = "bug",
|
|
10
|
+
Feature = "feature",
|
|
11
|
+
Docs = "docs",
|
|
12
|
+
Safety = "safety"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Improvement classification: where the fix should land. The spec
|
|
16
|
+
* asks for an explicit 4-bucket split, distinct from category (type of
|
|
17
|
+
* feedback) and origin (where the feedback came from).
|
|
18
|
+
*/
|
|
19
|
+
export type FeedbackImprovementKind = 'engine' | 'pack' | 'local-config' | 'docs' | 'unknown';
|
|
20
|
+
export interface IFeedbackAction {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly originalExcerpt: string;
|
|
23
|
+
readonly paraphrase?: string;
|
|
24
|
+
readonly category: FeedbackActionCategory;
|
|
25
|
+
readonly targetArea: string;
|
|
26
|
+
readonly origin: 'engine-generic' | 'pack-specific' | 'project-specific' | 'unknown';
|
|
27
|
+
/** Where the resulting fix should land. */
|
|
28
|
+
readonly improvementKind: FeedbackImprovementKind;
|
|
29
|
+
readonly severity: 'info' | 'minor' | 'major' | 'blocker';
|
|
30
|
+
readonly priority: 'p0' | 'p1' | 'p2' | 'p3';
|
|
31
|
+
readonly confidence: 'high' | 'medium' | 'low';
|
|
32
|
+
readonly recommendedCommands: readonly string[];
|
|
33
|
+
readonly suggestedImplementationCategory: string;
|
|
34
|
+
readonly suggestedTests: readonly string[];
|
|
35
|
+
readonly alreadyCoveredBy?: string;
|
|
36
|
+
readonly suggestedPromptSection?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IFeedbackActionsReport {
|
|
39
|
+
readonly schema: typeof FEEDBACK_ACTIONS_V2_SCHEMA;
|
|
40
|
+
readonly generatedAt: string;
|
|
41
|
+
readonly sourceFile: string;
|
|
42
|
+
readonly actions: readonly IFeedbackAction[];
|
|
43
|
+
}
|
|
44
|
+
export interface IFeedbackBacklogReport {
|
|
45
|
+
readonly schema: 'sharkcraft.feedback-backlog/v1';
|
|
46
|
+
readonly generatedAt: string;
|
|
47
|
+
readonly grouped: Readonly<Record<string, readonly IFeedbackAction[]>>;
|
|
48
|
+
readonly markdown: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IFeedbackPromptReport {
|
|
51
|
+
readonly schema: 'sharkcraft.feedback-prompt/v1';
|
|
52
|
+
readonly generatedAt: string;
|
|
53
|
+
readonly markdown: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IFeedbackPlanReport {
|
|
56
|
+
readonly schema: 'sharkcraft.feedback-plan/v1';
|
|
57
|
+
readonly generatedAt: string;
|
|
58
|
+
readonly orderedActions: readonly IFeedbackAction[];
|
|
59
|
+
readonly validationGates: readonly string[];
|
|
60
|
+
}
|
|
61
|
+
export declare function buildFeedbackActionsReport(inspection: ISharkcraftInspection, sourceFile: string): IFeedbackActionsReport;
|
|
62
|
+
export declare function buildFeedbackBacklogReport(inspection: ISharkcraftInspection, sourceFile: string): IFeedbackBacklogReport;
|
|
63
|
+
export declare function buildFeedbackPromptReport(inspection: ISharkcraftInspection, sourceFile: string): IFeedbackPromptReport;
|
|
64
|
+
export declare function buildFeedbackPlanReport(inspection: ISharkcraftInspection, sourceFile: string): IFeedbackPlanReport;
|
|
65
|
+
//# sourceMappingURL=feedback-actions-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-actions-v2.d.ts","sourceRoot":"","sources":["../src/feedback-actions-v2.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,OAAO,YAAY;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