@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,129 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { evaluateBoundaries, loadTsconfigPaths, scanImports } from '@shrkcrft/boundaries';
|
|
3
|
+
import { rankAll } from "./task-ranker.js";
|
|
4
|
+
function gitDiffFiles(cwd, opts) {
|
|
5
|
+
if (opts.files && opts.files.length > 0)
|
|
6
|
+
return [...opts.files];
|
|
7
|
+
const args = ['diff', '--name-only'];
|
|
8
|
+
if (opts.staged)
|
|
9
|
+
args.push('--cached');
|
|
10
|
+
if (opts.since)
|
|
11
|
+
args.push(opts.since);
|
|
12
|
+
const res = spawnSync('git', args, { cwd, encoding: 'utf8' });
|
|
13
|
+
if (res.status !== 0)
|
|
14
|
+
return [];
|
|
15
|
+
return (res.stdout ?? '')
|
|
16
|
+
.toString()
|
|
17
|
+
.split('\n')
|
|
18
|
+
.map((s) => s.trim())
|
|
19
|
+
.filter((s) => s.length > 0);
|
|
20
|
+
}
|
|
21
|
+
function buildPseudoTask(files) {
|
|
22
|
+
// Use the top-level dir of each file as a pseudo-task description so the
|
|
23
|
+
// ranker can latch onto path-aware tokens (e.g. "src services").
|
|
24
|
+
const tokens = new Set();
|
|
25
|
+
for (const f of files) {
|
|
26
|
+
for (const seg of f.split('/').slice(0, 4))
|
|
27
|
+
tokens.add(seg);
|
|
28
|
+
}
|
|
29
|
+
return [...tokens].join(' ');
|
|
30
|
+
}
|
|
31
|
+
function missingTestsHeuristic(files) {
|
|
32
|
+
const out = [];
|
|
33
|
+
const set = new Set(files);
|
|
34
|
+
for (const f of files) {
|
|
35
|
+
if (!f.endsWith('.ts') && !f.endsWith('.tsx'))
|
|
36
|
+
continue;
|
|
37
|
+
if (f.includes('/tests/') || f.endsWith('.spec.ts') || f.endsWith('.test.ts'))
|
|
38
|
+
continue;
|
|
39
|
+
if (!f.startsWith('src/'))
|
|
40
|
+
continue;
|
|
41
|
+
const candidate = f
|
|
42
|
+
.replace(/^src\//, 'tests/')
|
|
43
|
+
.replace(/\.tsx?$/, '.spec.ts');
|
|
44
|
+
if (!set.has(candidate))
|
|
45
|
+
out.push(`${f} → expected ${candidate}`);
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
export function buildReviewPacket(inspection, options = {}) {
|
|
50
|
+
const changedFiles = gitDiffFiles(inspection.projectRoot, options);
|
|
51
|
+
const pseudoTask = buildPseudoTask(changedFiles);
|
|
52
|
+
const ranking = rankAll(inspection, pseudoTask, 8);
|
|
53
|
+
// Affected paths: any path-convention whose title or content mentions any
|
|
54
|
+
// path segment from the changed files.
|
|
55
|
+
const segments = new Set();
|
|
56
|
+
for (const f of changedFiles) {
|
|
57
|
+
for (const seg of f.split('/'))
|
|
58
|
+
segments.add(seg.toLowerCase());
|
|
59
|
+
}
|
|
60
|
+
const affectedPaths = inspection.pathService
|
|
61
|
+
.list()
|
|
62
|
+
.filter((p) => [...segments].some((s) => (p.title + ' ' + p.content).toLowerCase().includes(s)))
|
|
63
|
+
.map((p) => p.id);
|
|
64
|
+
// Boundary violations restricted to changed files.
|
|
65
|
+
let boundaryViolations = [];
|
|
66
|
+
if (inspection.boundaryRegistry.size() > 0 && changedFiles.length > 0) {
|
|
67
|
+
const scan = scanImports({ projectRoot: inspection.projectRoot });
|
|
68
|
+
const tsconfigPaths = loadTsconfigPaths(inspection.projectRoot);
|
|
69
|
+
const evalResult = evaluateBoundaries(scan, inspection.boundaryRegistry.list(), {
|
|
70
|
+
...(tsconfigPaths.aliases.size > 0 ? { tsconfigPaths } : {}),
|
|
71
|
+
});
|
|
72
|
+
const changedSet = new Set(changedFiles);
|
|
73
|
+
boundaryViolations = evalResult.violations
|
|
74
|
+
.filter((v) => changedSet.has(v.file))
|
|
75
|
+
.map((v) => ({
|
|
76
|
+
ruleId: v.ruleId,
|
|
77
|
+
file: v.file,
|
|
78
|
+
importSpecifier: v.importSpecifier,
|
|
79
|
+
line: v.line,
|
|
80
|
+
severity: v.severity,
|
|
81
|
+
message: v.message,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
const verificationCommands = unique([
|
|
85
|
+
'shrk doctor',
|
|
86
|
+
'shrk check boundaries',
|
|
87
|
+
'bun x tsc -p tsconfig.base.json --noEmit',
|
|
88
|
+
'bun test',
|
|
89
|
+
]);
|
|
90
|
+
const reviewerInstructions = [
|
|
91
|
+
`# AI reviewer instructions`,
|
|
92
|
+
``,
|
|
93
|
+
`This PR touches ${changedFiles.length} file(s).`,
|
|
94
|
+
`Use the SharkCraft data below to focus your review:`,
|
|
95
|
+
``,
|
|
96
|
+
`1. Confirm the changed files respect the project's path conventions.`,
|
|
97
|
+
`2. Cross-check the listed rules — anything missing?`,
|
|
98
|
+
`3. Look at the boundary violations (if any) — those are objective.`,
|
|
99
|
+
`4. Look at the missing-tests heuristic — is each new src/ file tested?`,
|
|
100
|
+
`5. Run the verification commands before approving.`,
|
|
101
|
+
``,
|
|
102
|
+
`**Do not write code yourself.** Suggest changes to the human author; the`,
|
|
103
|
+
`human uses \`shrk apply\` for any writes.`,
|
|
104
|
+
].join('\n');
|
|
105
|
+
return {
|
|
106
|
+
changedFiles,
|
|
107
|
+
affectedPaths,
|
|
108
|
+
relevantRules: ranking.rules.slice(0, 6).map((r) => ({
|
|
109
|
+
id: r.item.id,
|
|
110
|
+
title: r.item.title,
|
|
111
|
+
reason: r.reasons.join('; '),
|
|
112
|
+
})),
|
|
113
|
+
relevantTemplates: ranking.templates.slice(0, 6).map((t) => ({
|
|
114
|
+
id: t.item.id,
|
|
115
|
+
name: t.item.name,
|
|
116
|
+
})),
|
|
117
|
+
relevantPipelines: ranking.pipelines.slice(0, 3).map((p) => ({
|
|
118
|
+
id: p.item.id,
|
|
119
|
+
title: p.item.title,
|
|
120
|
+
})),
|
|
121
|
+
boundaryViolations,
|
|
122
|
+
missingTestsHeuristic: missingTestsHeuristic(changedFiles),
|
|
123
|
+
verificationCommands,
|
|
124
|
+
reviewerInstructions,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function unique(xs) {
|
|
128
|
+
return [...new Set(xs)];
|
|
129
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
2
|
+
export declare const RISK_SIGNALS_SCHEMA = "sharkcraft.risk-signals/v1";
|
|
3
|
+
export declare enum RiskLevel {
|
|
4
|
+
Low = "low",
|
|
5
|
+
Medium = "medium",
|
|
6
|
+
High = "high",
|
|
7
|
+
Critical = "critical"
|
|
8
|
+
}
|
|
9
|
+
export interface IRiskSignals {
|
|
10
|
+
schema: typeof RISK_SIGNALS_SCHEMA;
|
|
11
|
+
generatedAt: string;
|
|
12
|
+
level: RiskLevel;
|
|
13
|
+
reasons: readonly string[];
|
|
14
|
+
inputs: {
|
|
15
|
+
boundaryViolationErrors: number;
|
|
16
|
+
boundaryViolationWarnings: number;
|
|
17
|
+
architectureRisks: number;
|
|
18
|
+
hasPacks: boolean;
|
|
19
|
+
packsUnsignedOrInvalid: number;
|
|
20
|
+
testsDetected: number;
|
|
21
|
+
ownershipDetected: number;
|
|
22
|
+
fileListTruncated: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function computeRiskSignals(inspection: ISharkcraftInspection, options?: {
|
|
26
|
+
withSignals?: boolean;
|
|
27
|
+
}): Promise<IRiskSignals>;
|
|
28
|
+
//# sourceMappingURL=risk-signals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-signals.d.ts","sourceRoot":"","sources":["../src/risk-signals.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE;QACN,uBAAuB,EAAE,MAAM,CAAC;QAChC,yBAAyB,EAAE,MAAM,CAAC;QAClC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,OAAO,CAAC;QAClB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,iBAAiB,EAAE,OAAO,CAAC;KAC5B,CAAC;CACH;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,OAAO,CAAC,YAAY,CAAC,CAkDvB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Risk-signal aggregator.
|
|
3
|
+
*
|
|
4
|
+
* Centralised, deterministic source of risk inputs used by orchestration,
|
|
5
|
+
* simulation, role views and the recommender. Read-only.
|
|
6
|
+
*/
|
|
7
|
+
import { buildArchitectureMap } from "./architecture-map.js";
|
|
8
|
+
export const RISK_SIGNALS_SCHEMA = 'sharkcraft.risk-signals/v1';
|
|
9
|
+
export var RiskLevel;
|
|
10
|
+
(function (RiskLevel) {
|
|
11
|
+
RiskLevel["Low"] = "low";
|
|
12
|
+
RiskLevel["Medium"] = "medium";
|
|
13
|
+
RiskLevel["High"] = "high";
|
|
14
|
+
RiskLevel["Critical"] = "critical";
|
|
15
|
+
})(RiskLevel || (RiskLevel = {}));
|
|
16
|
+
export async function computeRiskSignals(inspection, options = {}) {
|
|
17
|
+
const map = await buildArchitectureMap(inspection, { signals: options.withSignals ?? true });
|
|
18
|
+
const validPacks = inspection.packs.validPacks ?? [];
|
|
19
|
+
const packsUnsignedOrInvalid = validPacks.filter((p) => p.signatureStatus === 'invalid-signature' || p.signatureStatus === 'missing-signature').length;
|
|
20
|
+
const inputs = {
|
|
21
|
+
boundaryViolationErrors: map.boundaryViolationCounts.error,
|
|
22
|
+
boundaryViolationWarnings: map.boundaryViolationCounts.warning,
|
|
23
|
+
architectureRisks: map.risks.length,
|
|
24
|
+
hasPacks: validPacks.length > 0,
|
|
25
|
+
packsUnsignedOrInvalid,
|
|
26
|
+
testsDetected: map.graphSummary.tests,
|
|
27
|
+
ownershipDetected: map.graphSummary.ownership,
|
|
28
|
+
fileListTruncated: false,
|
|
29
|
+
};
|
|
30
|
+
const reasons = [];
|
|
31
|
+
let score = 0;
|
|
32
|
+
if (inputs.boundaryViolationErrors > 0) {
|
|
33
|
+
score += 3;
|
|
34
|
+
reasons.push(`${inputs.boundaryViolationErrors} boundary violation(s) at error severity.`);
|
|
35
|
+
}
|
|
36
|
+
if (inputs.boundaryViolationWarnings > 0) {
|
|
37
|
+
score += 1;
|
|
38
|
+
reasons.push(`${inputs.boundaryViolationWarnings} boundary violation(s) at warning severity.`);
|
|
39
|
+
}
|
|
40
|
+
if (inputs.architectureRisks > 0) {
|
|
41
|
+
score += 1;
|
|
42
|
+
reasons.push(`${inputs.architectureRisks} architecture risk finding(s).`);
|
|
43
|
+
}
|
|
44
|
+
if (inputs.packsUnsignedOrInvalid > 0) {
|
|
45
|
+
score += 2;
|
|
46
|
+
reasons.push(`${inputs.packsUnsignedOrInvalid} pack(s) with invalid/missing signature.`);
|
|
47
|
+
}
|
|
48
|
+
if (inputs.testsDetected === 0) {
|
|
49
|
+
score += 2;
|
|
50
|
+
reasons.push('No tests detected.');
|
|
51
|
+
}
|
|
52
|
+
let level = RiskLevel.Low;
|
|
53
|
+
if (score >= 5)
|
|
54
|
+
level = RiskLevel.Critical;
|
|
55
|
+
else if (score >= 3)
|
|
56
|
+
level = RiskLevel.High;
|
|
57
|
+
else if (score >= 1)
|
|
58
|
+
level = RiskLevel.Medium;
|
|
59
|
+
if (reasons.length === 0)
|
|
60
|
+
reasons.push('No elevated risk signals detected.');
|
|
61
|
+
return {
|
|
62
|
+
schema: RISK_SIGNALS_SCHEMA,
|
|
63
|
+
generatedAt: new Date().toISOString(),
|
|
64
|
+
level,
|
|
65
|
+
reasons,
|
|
66
|
+
inputs,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role-specific views.
|
|
3
|
+
* Task-aware extension — when a task is supplied, the view is
|
|
4
|
+
* personalised using intent classification + task risk + intent's
|
|
5
|
+
* suggested first command. No AI; deterministic.
|
|
6
|
+
*
|
|
7
|
+
* Read-only.
|
|
8
|
+
*/
|
|
9
|
+
import { ChangeIntentKind } from './change-intent.js';
|
|
10
|
+
import { TaskRiskLevel } from './task-risk.js';
|
|
11
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
12
|
+
export declare const ROLE_VIEW_SCHEMA = "sharkcraft.role-view/v1";
|
|
13
|
+
export declare enum RoleId {
|
|
14
|
+
Developer = "developer",
|
|
15
|
+
Reviewer = "reviewer",
|
|
16
|
+
Architect = "architect",
|
|
17
|
+
ReleaseManager = "release-manager",
|
|
18
|
+
Security = "security",
|
|
19
|
+
AiAgent = "ai-agent"
|
|
20
|
+
}
|
|
21
|
+
export interface IRoleView {
|
|
22
|
+
schema: typeof ROLE_VIEW_SCHEMA;
|
|
23
|
+
role: RoleId;
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
topCommands: readonly string[];
|
|
27
|
+
relevantReports: readonly string[];
|
|
28
|
+
relevantRisks: readonly string[];
|
|
29
|
+
suggestedNextAction: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IRoleViewTaskSpecific {
|
|
32
|
+
task: string;
|
|
33
|
+
intentKind: ChangeIntentKind;
|
|
34
|
+
intentConfidence: string;
|
|
35
|
+
taskRiskLevel: TaskRiskLevel;
|
|
36
|
+
taskCommands: readonly string[];
|
|
37
|
+
taskRisks: readonly string[];
|
|
38
|
+
taskReports: readonly string[];
|
|
39
|
+
whatNotToDo: readonly string[];
|
|
40
|
+
nextSafeAction: string;
|
|
41
|
+
humanApprovalPoints: readonly string[];
|
|
42
|
+
}
|
|
43
|
+
export interface ITaskAwareRoleView extends IRoleView {
|
|
44
|
+
taskSpecific?: IRoleViewTaskSpecific;
|
|
45
|
+
}
|
|
46
|
+
export declare function listRoleViews(): readonly IRoleView[];
|
|
47
|
+
export declare function getRoleView(role: string): IRoleView | undefined;
|
|
48
|
+
export declare function getTaskAwareRoleView(role: string, task: string, inspection: ISharkcraftInspection): Promise<ITaskAwareRoleView | undefined>;
|
|
49
|
+
export declare function renderTaskAwareRoleViewText(v: ITaskAwareRoleView): string;
|
|
50
|
+
//# sourceMappingURL=role-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role-views.d.ts","sourceRoot":"","sources":["../src/role-views.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAwB,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAuB,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAE1D,oBAAY,MAAM;IAChB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,cAAc,oBAAoB;IAClC,QAAQ,aAAa;IACrB,OAAO,aAAa;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,gBAAgB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,gBAAgB,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC;AAuGD,wBAAgB,aAAa,IAAI,SAAS,SAAS,EAAE,CAEpD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE/D;AA4ID,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CA8BzC;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAqCzE"}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role-specific views.
|
|
3
|
+
* Task-aware extension — when a task is supplied, the view is
|
|
4
|
+
* personalised using intent classification + task risk + intent's
|
|
5
|
+
* suggested first command. No AI; deterministic.
|
|
6
|
+
*
|
|
7
|
+
* Read-only.
|
|
8
|
+
*/
|
|
9
|
+
import { classifyChangeIntent, ChangeIntentKind } from "./change-intent.js";
|
|
10
|
+
import { buildTaskRiskReport, TaskRiskLevel } from "./task-risk.js";
|
|
11
|
+
export const ROLE_VIEW_SCHEMA = 'sharkcraft.role-view/v1';
|
|
12
|
+
export var RoleId;
|
|
13
|
+
(function (RoleId) {
|
|
14
|
+
RoleId["Developer"] = "developer";
|
|
15
|
+
RoleId["Reviewer"] = "reviewer";
|
|
16
|
+
RoleId["Architect"] = "architect";
|
|
17
|
+
RoleId["ReleaseManager"] = "release-manager";
|
|
18
|
+
RoleId["Security"] = "security";
|
|
19
|
+
RoleId["AiAgent"] = "ai-agent";
|
|
20
|
+
})(RoleId || (RoleId = {}));
|
|
21
|
+
const VIEWS = Object.freeze([
|
|
22
|
+
{
|
|
23
|
+
schema: ROLE_VIEW_SCHEMA,
|
|
24
|
+
role: RoleId.Developer,
|
|
25
|
+
title: 'Developer',
|
|
26
|
+
description: 'Daily work loop — brief, dev session, plan, apply, validate.',
|
|
27
|
+
topCommands: [
|
|
28
|
+
'shrk brief "<task>"',
|
|
29
|
+
'shrk dev start "<task>"',
|
|
30
|
+
'shrk gen <templateId> <name> --dry-run --save-plan /tmp/plan.json',
|
|
31
|
+
'shrk plan review /tmp/plan.json',
|
|
32
|
+
'shrk apply /tmp/plan.json --verify-signature --validate',
|
|
33
|
+
'shrk impact --since main',
|
|
34
|
+
'shrk tests missing --since main',
|
|
35
|
+
],
|
|
36
|
+
relevantReports: ['brief', 'impact', 'review packet', 'dev session report'],
|
|
37
|
+
relevantRisks: ['Forgotten dry-run', 'Apply without --verify-signature'],
|
|
38
|
+
suggestedNextAction: 'shrk brief "<your next task>"',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
schema: ROLE_VIEW_SCHEMA,
|
|
42
|
+
role: RoleId.Reviewer,
|
|
43
|
+
title: 'Reviewer',
|
|
44
|
+
description: 'PR review surface — impact, ownership, policy, review packet.',
|
|
45
|
+
topCommands: [
|
|
46
|
+
'shrk review packet --v3 --since main',
|
|
47
|
+
'shrk impact --since main',
|
|
48
|
+
'shrk owners impact --since main',
|
|
49
|
+
'shrk policy run',
|
|
50
|
+
'shrk report site --output /tmp/site',
|
|
51
|
+
],
|
|
52
|
+
relevantReports: ['review packet', 'impact', 'ownership', 'policy', 'report site'],
|
|
53
|
+
relevantRisks: ['Hidden boundary change', 'Missing owners', 'Policy override without reason'],
|
|
54
|
+
suggestedNextAction: 'shrk review packet --v3 --since main',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
schema: ROLE_VIEW_SCHEMA,
|
|
58
|
+
role: RoleId.Architect,
|
|
59
|
+
title: 'Architect',
|
|
60
|
+
description: 'Architecture surface — map, boundaries, drift, constructs.',
|
|
61
|
+
topCommands: [
|
|
62
|
+
'shrk architecture map',
|
|
63
|
+
'shrk check boundaries',
|
|
64
|
+
'shrk drift',
|
|
65
|
+
'shrk intelligence graph',
|
|
66
|
+
'shrk constructs list',
|
|
67
|
+
],
|
|
68
|
+
relevantReports: ['architecture map', 'drift report', 'boundary report', 'intelligence graph'],
|
|
69
|
+
relevantRisks: ['Layer violations', 'Public-API drift', 'Untested constructs'],
|
|
70
|
+
suggestedNextAction: 'shrk architecture map --risk',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
schema: ROLE_VIEW_SCHEMA,
|
|
74
|
+
role: RoleId.ReleaseManager,
|
|
75
|
+
title: 'Release manager',
|
|
76
|
+
description: 'Release surface — readiness, smoke, preflight, changelog.',
|
|
77
|
+
topCommands: [
|
|
78
|
+
'shrk release readiness --strict',
|
|
79
|
+
'shrk release smoke --scenario all',
|
|
80
|
+
'shrk release smoke --matrix',
|
|
81
|
+
'bun run release:preflight',
|
|
82
|
+
'shrk install smoke --tarball',
|
|
83
|
+
],
|
|
84
|
+
relevantReports: ['release readiness', 'release smoke', 'preflight'],
|
|
85
|
+
relevantRisks: ['Stale preflight summary', 'Smoke regression', 'Tarball install failure'],
|
|
86
|
+
suggestedNextAction: 'shrk release readiness --strict',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
schema: ROLE_VIEW_SCHEMA,
|
|
90
|
+
role: RoleId.Security,
|
|
91
|
+
title: 'Security',
|
|
92
|
+
description: 'Safety surface — audit, compliance, policy, MCP no-write.',
|
|
93
|
+
topCommands: [
|
|
94
|
+
'shrk safety audit --deep',
|
|
95
|
+
'shrk compliance check ai-safe-development',
|
|
96
|
+
'shrk compliance check signed-pack-workflow',
|
|
97
|
+
'shrk policy run --explain-overrides',
|
|
98
|
+
'shrk packs doctor --release --require-signatures',
|
|
99
|
+
],
|
|
100
|
+
relevantReports: ['safety audit', 'compliance report', 'policy report'],
|
|
101
|
+
relevantRisks: ['MCP write tool introduced', 'Unsigned pack', 'Destructive demo line'],
|
|
102
|
+
suggestedNextAction: 'shrk safety audit --deep',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
schema: ROLE_VIEW_SCHEMA,
|
|
106
|
+
role: RoleId.AiAgent,
|
|
107
|
+
title: 'AI agent',
|
|
108
|
+
description: 'Agent-facing surface — brief, handoff, MCP tools, forbidden actions.',
|
|
109
|
+
topCommands: [
|
|
110
|
+
'shrk brief "<task>"',
|
|
111
|
+
'shrk handoff "<task>"',
|
|
112
|
+
'shrk orchestrate "<task>"',
|
|
113
|
+
'shrk simulate "<task>"',
|
|
114
|
+
'shrk intent "<task>"',
|
|
115
|
+
],
|
|
116
|
+
relevantReports: ['brief', 'handoff', 'orchestration plan', 'workflow simulation'],
|
|
117
|
+
relevantRisks: ['Auto-apply', 'MCP write attempt', 'Untracked pack command'],
|
|
118
|
+
suggestedNextAction: 'shrk start-here',
|
|
119
|
+
},
|
|
120
|
+
]);
|
|
121
|
+
export function listRoleViews() {
|
|
122
|
+
return VIEWS;
|
|
123
|
+
}
|
|
124
|
+
export function getRoleView(role) {
|
|
125
|
+
return VIEWS.find((v) => v.role === role);
|
|
126
|
+
}
|
|
127
|
+
const FORBIDDEN_FOR_RELEASE = Object.freeze([
|
|
128
|
+
'Do not publish or tag without explicit human approval.',
|
|
129
|
+
'Do not skip preflight gates.',
|
|
130
|
+
]);
|
|
131
|
+
const FORBIDDEN_FOR_AI = Object.freeze([
|
|
132
|
+
'Do not call MCP write tools — MCP is read-only.',
|
|
133
|
+
'Do not run `shrk apply` from MCP.',
|
|
134
|
+
'Do not auto-apply plans.',
|
|
135
|
+
'Do not execute pack-contributed verification commands without explicit local opt-in.',
|
|
136
|
+
]);
|
|
137
|
+
function buildTaskCommands(role, intent, risk) {
|
|
138
|
+
const commands = [];
|
|
139
|
+
const risks = [];
|
|
140
|
+
const reports = [];
|
|
141
|
+
const forbidden = [];
|
|
142
|
+
const approvalPoints = [];
|
|
143
|
+
const t = JSON.stringify(intent.task);
|
|
144
|
+
// Always start with a task brief
|
|
145
|
+
commands.push(`shrk brief ${t}`);
|
|
146
|
+
commands.push(`shrk intent ${t}`);
|
|
147
|
+
// Per-role + intent
|
|
148
|
+
switch (role) {
|
|
149
|
+
case RoleId.Developer: {
|
|
150
|
+
commands.push(`shrk dev start ${t}`);
|
|
151
|
+
commands.push(`shrk gen <templateId> <name> --dry-run --save-plan /tmp/plan.json`);
|
|
152
|
+
commands.push(`shrk plan review /tmp/plan.json`);
|
|
153
|
+
if (intent.kind !== ChangeIntentKind.Docs) {
|
|
154
|
+
commands.push(`shrk impact --since main`);
|
|
155
|
+
commands.push(`shrk tests missing --since main`);
|
|
156
|
+
}
|
|
157
|
+
if (intent.kind === ChangeIntentKind.Bugfix)
|
|
158
|
+
commands.push('shrk diagnostics suggest "<error text>"');
|
|
159
|
+
reports.push('brief', 'task risk', 'impact', 'review packet');
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case RoleId.Reviewer: {
|
|
163
|
+
commands.push(`shrk review packet --v3 --since main`);
|
|
164
|
+
commands.push(`shrk impact --since main`);
|
|
165
|
+
commands.push(`shrk owners impact --since main`);
|
|
166
|
+
commands.push(`shrk policy run --explain-overrides`);
|
|
167
|
+
if (intent.kind === ChangeIntentKind.Architecture ||
|
|
168
|
+
intent.domains.includes('boundaries') ||
|
|
169
|
+
intent.domains.includes('plugin')) {
|
|
170
|
+
commands.push(`shrk architecture violations`);
|
|
171
|
+
}
|
|
172
|
+
if (intent.domains.includes('plugin') || intent.kind === ChangeIntentKind.Architecture) {
|
|
173
|
+
commands.push('shrk api report --all --public-only');
|
|
174
|
+
}
|
|
175
|
+
reports.push('review packet', 'task risk', 'ownership', 'policy', 'architecture violations');
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case RoleId.Architect: {
|
|
179
|
+
commands.push('shrk architecture map --risk --signals');
|
|
180
|
+
commands.push('shrk architecture violations');
|
|
181
|
+
commands.push('shrk intelligence graph --include-imports');
|
|
182
|
+
commands.push('shrk drift --json');
|
|
183
|
+
if (intent.kind === ChangeIntentKind.Architecture || intent.domains.includes('boundaries')) {
|
|
184
|
+
commands.push('shrk check boundaries --json');
|
|
185
|
+
}
|
|
186
|
+
reports.push('architecture map', 'task risk', 'drift report', 'intelligence graph');
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
case RoleId.ReleaseManager: {
|
|
190
|
+
commands.push('shrk release readiness --strict');
|
|
191
|
+
commands.push('shrk release smoke --scenario all');
|
|
192
|
+
commands.push('shrk release smoke --matrix');
|
|
193
|
+
commands.push('bun run release:preflight');
|
|
194
|
+
if (intent.kind === ChangeIntentKind.Release)
|
|
195
|
+
commands.push('shrk install smoke --tarball');
|
|
196
|
+
reports.push('release readiness', 'release smoke', 'task risk', 'preflight');
|
|
197
|
+
for (const f of FORBIDDEN_FOR_RELEASE)
|
|
198
|
+
forbidden.push(f);
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
case RoleId.Security: {
|
|
202
|
+
commands.push('shrk safety audit --deep');
|
|
203
|
+
commands.push('shrk policy run --explain-overrides');
|
|
204
|
+
commands.push('shrk compliance check ai-safe-development');
|
|
205
|
+
if (intent.kind === ChangeIntentKind.Policy || intent.domains.includes('safety')) {
|
|
206
|
+
commands.push('shrk compliance check signed-pack-workflow');
|
|
207
|
+
}
|
|
208
|
+
if (intent.kind === ChangeIntentKind.Release)
|
|
209
|
+
commands.push('shrk packs doctor --release --require-signatures');
|
|
210
|
+
reports.push('safety audit', 'task risk', 'compliance report', 'policy report');
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
case RoleId.AiAgent: {
|
|
214
|
+
commands.push(`shrk handoff ${t}`);
|
|
215
|
+
commands.push(`shrk orchestrate ${t} --risk-aware`);
|
|
216
|
+
commands.push(`shrk simulate ${t} --mode conservative`);
|
|
217
|
+
commands.push(`shrk recommend ${t}`);
|
|
218
|
+
reports.push('brief', 'handoff', 'orchestration plan', 'task risk', 'workflow simulation');
|
|
219
|
+
for (const f of FORBIDDEN_FOR_AI)
|
|
220
|
+
forbidden.push(f);
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Risk-driven extras
|
|
225
|
+
if (risk.riskLevel === TaskRiskLevel.High || risk.riskLevel === TaskRiskLevel.Critical) {
|
|
226
|
+
commands.push('shrk risk "' + intent.task + '" --explain');
|
|
227
|
+
commands.push('shrk architecture map --risk --signals');
|
|
228
|
+
commands.push('shrk policy run --explain-overrides');
|
|
229
|
+
risks.push(`Task risk level is ${risk.riskLevel} (score ${risk.score}).`);
|
|
230
|
+
approvalPoints.push('Risk review: a human must approve before any write step.');
|
|
231
|
+
}
|
|
232
|
+
for (const r of risk.reasons.slice(0, 5)) {
|
|
233
|
+
risks.push(`[${r.code}] ${r.message}`);
|
|
234
|
+
}
|
|
235
|
+
for (const c of risk.boundaryConcerns)
|
|
236
|
+
risks.push(c);
|
|
237
|
+
for (const c of risk.policyConcerns)
|
|
238
|
+
risks.push(c);
|
|
239
|
+
for (const f of risk.ownershipGaps)
|
|
240
|
+
risks.push(`Ownership gap: ${f}`);
|
|
241
|
+
// Intent-required review
|
|
242
|
+
if (intent.requiredHumanReview) {
|
|
243
|
+
approvalPoints.push('Intent flagged as requiring human review.');
|
|
244
|
+
}
|
|
245
|
+
// Universal forbidden for AI/agent contexts when intent is release
|
|
246
|
+
if (intent.kind === ChangeIntentKind.Release) {
|
|
247
|
+
forbidden.push('Do not run a publish step without explicit human approval.');
|
|
248
|
+
forbidden.push('Do not push tags from MCP.');
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
commands: [...new Set(commands)],
|
|
252
|
+
risks: [...new Set(risks)],
|
|
253
|
+
reports: [...new Set(reports)],
|
|
254
|
+
forbidden: [...new Set(forbidden)],
|
|
255
|
+
approvalPoints: [...new Set(approvalPoints)],
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
export async function getTaskAwareRoleView(role, task, inspection) {
|
|
259
|
+
const base = getRoleView(role);
|
|
260
|
+
if (!base)
|
|
261
|
+
return undefined;
|
|
262
|
+
const trimmed = task.trim();
|
|
263
|
+
if (!trimmed)
|
|
264
|
+
return { ...base };
|
|
265
|
+
const intent = await classifyChangeIntent(trimmed, inspection);
|
|
266
|
+
let risk;
|
|
267
|
+
try {
|
|
268
|
+
risk = await buildTaskRiskReport(trimmed, inspection, { includeMemory: true });
|
|
269
|
+
}
|
|
270
|
+
catch {
|
|
271
|
+
return { ...base };
|
|
272
|
+
}
|
|
273
|
+
const composed = buildTaskCommands(base.role, intent, risk);
|
|
274
|
+
const nextSafeAction = composed.commands[0] ?? intent.suggestedFirstCommand ?? base.suggestedNextAction;
|
|
275
|
+
return {
|
|
276
|
+
...base,
|
|
277
|
+
taskSpecific: {
|
|
278
|
+
task: trimmed,
|
|
279
|
+
intentKind: intent.kind,
|
|
280
|
+
intentConfidence: intent.confidence,
|
|
281
|
+
taskRiskLevel: risk.riskLevel,
|
|
282
|
+
taskCommands: composed.commands.slice(0, 10),
|
|
283
|
+
taskRisks: composed.risks.slice(0, 10),
|
|
284
|
+
taskReports: composed.reports.slice(0, 10),
|
|
285
|
+
whatNotToDo: composed.forbidden,
|
|
286
|
+
nextSafeAction,
|
|
287
|
+
humanApprovalPoints: composed.approvalPoints,
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
export function renderTaskAwareRoleViewText(v) {
|
|
292
|
+
const lines = [];
|
|
293
|
+
lines.push(`=== Role view: ${v.title} ===`);
|
|
294
|
+
lines.push(` description ${v.description}`);
|
|
295
|
+
if (v.taskSpecific) {
|
|
296
|
+
const t = v.taskSpecific;
|
|
297
|
+
lines.push('');
|
|
298
|
+
lines.push('--- Task-specific ---');
|
|
299
|
+
lines.push(` task ${t.task}`);
|
|
300
|
+
lines.push(` intent ${t.intentKind} (confidence ${t.intentConfidence})`);
|
|
301
|
+
lines.push(` task risk ${t.taskRiskLevel}`);
|
|
302
|
+
lines.push(` next safe ${t.nextSafeAction}`);
|
|
303
|
+
if (t.taskCommands.length > 0) {
|
|
304
|
+
lines.push('Top task commands:');
|
|
305
|
+
for (const c of t.taskCommands)
|
|
306
|
+
lines.push(` $ ${c}`);
|
|
307
|
+
}
|
|
308
|
+
if (t.taskRisks.length > 0) {
|
|
309
|
+
lines.push('Task risks:');
|
|
310
|
+
for (const r of t.taskRisks)
|
|
311
|
+
lines.push(` • ${r}`);
|
|
312
|
+
}
|
|
313
|
+
if (t.taskReports.length > 0) {
|
|
314
|
+
lines.push('Reports to consult: ' + t.taskReports.join(', '));
|
|
315
|
+
}
|
|
316
|
+
if (t.whatNotToDo.length > 0) {
|
|
317
|
+
lines.push('What NOT to do:');
|
|
318
|
+
for (const f of t.whatNotToDo)
|
|
319
|
+
lines.push(` • ${f}`);
|
|
320
|
+
}
|
|
321
|
+
if (t.humanApprovalPoints.length > 0) {
|
|
322
|
+
lines.push('Human approval points:');
|
|
323
|
+
for (const a of t.humanApprovalPoints)
|
|
324
|
+
lines.push(` • ${a}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
lines.push('Top commands:');
|
|
329
|
+
for (const c of v.topCommands)
|
|
330
|
+
lines.push(` $ ${c}`);
|
|
331
|
+
lines.push(`Suggested next: ${v.suggestedNextAction}`);
|
|
332
|
+
}
|
|
333
|
+
return lines.join('\n') + '\n';
|
|
334
|
+
}
|
package/dist/rounds.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const ROUND_SNAPSHOT_SCHEMA = "sharkcraft.round-snapshot/v1";
|
|
2
|
+
export declare const ROUNDS_DIFF_SCHEMA = "sharkcraft.rounds-diff/v1";
|
|
3
|
+
export interface IRoundCommandEntry {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IRoundToolEntry {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IRoundMeta {
|
|
12
|
+
id: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
capturedAt: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IRoundSnapshot {
|
|
17
|
+
schema: typeof ROUND_SNAPSHOT_SCHEMA;
|
|
18
|
+
id: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
capturedAt: string;
|
|
21
|
+
commands: readonly IRoundCommandEntry[];
|
|
22
|
+
mcpTools: readonly IRoundToolEntry[];
|
|
23
|
+
docs: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
export interface IRoundsDiff {
|
|
26
|
+
schema: typeof ROUNDS_DIFF_SCHEMA;
|
|
27
|
+
fromId: string;
|
|
28
|
+
toId: string;
|
|
29
|
+
commandsAdded: readonly IRoundCommandEntry[];
|
|
30
|
+
commandsRemoved: readonly IRoundCommandEntry[];
|
|
31
|
+
mcpToolsAdded: readonly IRoundToolEntry[];
|
|
32
|
+
mcpToolsRemoved: readonly IRoundToolEntry[];
|
|
33
|
+
docsAdded: readonly string[];
|
|
34
|
+
docsRemoved: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
export interface ICaptureInput {
|
|
37
|
+
projectRoot: string;
|
|
38
|
+
id: string;
|
|
39
|
+
title?: string;
|
|
40
|
+
commands: readonly IRoundCommandEntry[];
|
|
41
|
+
mcpTools: readonly IRoundToolEntry[];
|
|
42
|
+
}
|
|
43
|
+
export declare function captureRoundSnapshot(input: ICaptureInput): IRoundSnapshot;
|
|
44
|
+
export declare function writeRoundSnapshot(projectRoot: string, snapshot: IRoundSnapshot): {
|
|
45
|
+
snapshotFile: string;
|
|
46
|
+
metaFile: string;
|
|
47
|
+
};
|
|
48
|
+
export declare function loadRoundSnapshot(projectRoot: string, id: string): IRoundSnapshot | null;
|
|
49
|
+
export declare function listRoundIds(projectRoot: string): readonly string[];
|
|
50
|
+
export declare function diffRounds(fromSnapshot: IRoundSnapshot, toSnapshot: IRoundSnapshot): IRoundsDiff;
|
|
51
|
+
export declare function renderRoundsDiffMarkdown(diff: IRoundsDiff): string;
|
|
52
|
+
//# sourceMappingURL=rounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounds.d.ts","sourceRoot":"","sources":["../src/rounds.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AACpE,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,qBAAqB,CAAC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACxC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;IACrC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,kBAAkB,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC7C,eAAe,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC/C,aAAa,EAAE,SAAS,eAAe,EAAE,CAAC;IAC1C,eAAe,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACxC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;CACtC;AA2BD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,CAWzE;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,cAAc,GACvB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAa5C;AAED,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,GACT,cAAc,GAAG,IAAI,CAQvB;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAYnE;AA0BD,wBAAgB,UAAU,CACxB,YAAY,EAAE,cAAc,EAC5B,UAAU,EAAE,cAAc,GACzB,WAAW,CAeb;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CA+BlE"}
|