@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,939 @@
|
|
|
1
|
+
import * as nodePath from 'node:path';
|
|
2
|
+
import { recommendPresets, } from '@shrkcrft/presets';
|
|
3
|
+
import { PackageManager } from '@shrkcrft/workspace';
|
|
4
|
+
import { buildOnboardingPlan, } from "./onboarding.js";
|
|
5
|
+
import { buildAreaMap, } from "./area-map.js";
|
|
6
|
+
import { listConstructs, loadConstructs } from "./construct-registry.js";
|
|
7
|
+
import { analyzeImportGraph } from "./import-graph-analysis.js";
|
|
8
|
+
import { buildGeneratedCodeReport, } from "./generated-code.js";
|
|
9
|
+
import { buildContradictionReport, } from "./contradictions.js";
|
|
10
|
+
import { buildStabilityMap, StabilityKind, } from "./stability-map.js";
|
|
11
|
+
import { GeneratedScanDepth, } from "./generated-code.js";
|
|
12
|
+
import { buildPolyglotBoundaryReport, computePolyglotTestImpact, detectLanguageProfiles, buildLanguageCommandReport, scanPolyglotDependencies, suggestLanguageBoundaries, LanguageId, } from "./languages/index.js";
|
|
13
|
+
export const REPOSITORY_KNOWLEDGE_MODEL_SCHEMA = 'sharkcraft.repository-knowledge-model/v1';
|
|
14
|
+
export var IngestDepth;
|
|
15
|
+
(function (IngestDepth) {
|
|
16
|
+
IngestDepth["Shallow"] = "shallow";
|
|
17
|
+
IngestDepth["Standard"] = "standard";
|
|
18
|
+
IngestDepth["Deep"] = "deep";
|
|
19
|
+
IngestDepth["Extreme"] = "extreme";
|
|
20
|
+
})(IngestDepth || (IngestDepth = {}));
|
|
21
|
+
export var IngestSection;
|
|
22
|
+
(function (IngestSection) {
|
|
23
|
+
IngestSection["RepositoryOverview"] = "repositoryOverview";
|
|
24
|
+
IngestSection["ArchitectureModel"] = "architectureModel";
|
|
25
|
+
IngestSection["BusinessLogicModel"] = "businessLogicModel";
|
|
26
|
+
IngestSection["RulesAndConventions"] = "rulesAndConventions";
|
|
27
|
+
IngestSection["DependencyBoundaries"] = "dependencyBoundaries";
|
|
28
|
+
IngestSection["DomainMap"] = "domainMap";
|
|
29
|
+
IngestSection["WorkflowMap"] = "workflowMap";
|
|
30
|
+
IngestSection["ChangeProtocol"] = "changeProtocol";
|
|
31
|
+
IngestSection["RiskAreas"] = "riskAreas";
|
|
32
|
+
IngestSection["Contradictions"] = "contradictions";
|
|
33
|
+
IngestSection["OpenQuestions"] = "openQuestions";
|
|
34
|
+
IngestSection["GeneratedVsHandwritten"] = "generatedVsHandwritten";
|
|
35
|
+
IngestSection["StableExperimentalDeprecated"] = "stableExperimentalDeprecated";
|
|
36
|
+
IngestSection["TaskContextHints"] = "taskContextHints";
|
|
37
|
+
IngestSection["RecommendedSharkCraftFiles"] = "recommendedSharkCraftFiles";
|
|
38
|
+
})(IngestSection || (IngestSection = {}));
|
|
39
|
+
export const ALL_INGEST_SECTIONS = Object.values(IngestSection);
|
|
40
|
+
export async function buildRepositoryKnowledgeModel(options) {
|
|
41
|
+
const inspection = options.inspection;
|
|
42
|
+
const projectRoot = inspection.projectRoot;
|
|
43
|
+
const depth = options.depth ?? IngestDepth.Standard;
|
|
44
|
+
const requested = new Set(options.selectedSections && options.selectedSections.length > 0
|
|
45
|
+
? options.selectedSections
|
|
46
|
+
: ALL_INGEST_SECTIONS);
|
|
47
|
+
for (const ex of options.excludedSections ?? [])
|
|
48
|
+
requested.delete(ex);
|
|
49
|
+
const sectionsArr = ALL_INGEST_SECTIONS.filter((s) => requested.has(s));
|
|
50
|
+
const limitations = [];
|
|
51
|
+
// 1) Onboarding plan (existing) — gives us rules/paths/templates/boundaries/pipelines.
|
|
52
|
+
let onboarding;
|
|
53
|
+
try {
|
|
54
|
+
onboarding = buildOnboardingPlan(inspection, {});
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
limitations.push(`onboarding plan build failed: ${err.message}`);
|
|
58
|
+
onboarding = emptyOnboardingPlan(projectRoot);
|
|
59
|
+
}
|
|
60
|
+
// 2) Forced presets — slot them ahead of recommendations and mark transformational intent.
|
|
61
|
+
const recRaw = recommendPresets(inspection.presetRegistry.list(), {
|
|
62
|
+
profiles: inspection.workspace.profiles ?? [],
|
|
63
|
+
limit: 20,
|
|
64
|
+
});
|
|
65
|
+
const transformationalIntents = [];
|
|
66
|
+
const presets = applyForcedPresets(recRaw, options.forcedPresetIds ?? [], inspection, transformationalIntents);
|
|
67
|
+
// 3) Architecture model.
|
|
68
|
+
const areaMap = buildAreaMap(inspection);
|
|
69
|
+
let importGraph;
|
|
70
|
+
if (depth !== IngestDepth.Shallow) {
|
|
71
|
+
try {
|
|
72
|
+
importGraph = analyzeImportGraph(projectRoot);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
limitations.push(`import graph analysis failed: ${err.message}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const architectureModel = buildArchitectureModel(inspection, areaMap, importGraph);
|
|
79
|
+
// 4) Business logic.
|
|
80
|
+
let constructs = listConstructs(inspection);
|
|
81
|
+
if (constructs.length === 0) {
|
|
82
|
+
try {
|
|
83
|
+
constructs = await loadConstructs(inspection);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
limitations.push(`construct load failed: ${err.message}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const businessLogicModel = buildBusinessLogicModel(inspection, constructs, areaMap);
|
|
90
|
+
// 5) Generated-code + stability + contradictions.
|
|
91
|
+
// Depth-aware generated-code scan + annotation-aware stability map.
|
|
92
|
+
let generatedDepth = GeneratedScanDepth.Standard;
|
|
93
|
+
if (depth === IngestDepth.Deep)
|
|
94
|
+
generatedDepth = GeneratedScanDepth.Deep;
|
|
95
|
+
if (depth === IngestDepth.Extreme)
|
|
96
|
+
generatedDepth = GeneratedScanDepth.Extreme;
|
|
97
|
+
const generatedReport = buildGeneratedCodeReport({ inspection, depth: generatedDepth });
|
|
98
|
+
const scanAnnotations = depth === IngestDepth.Deep || depth === IngestDepth.Extreme;
|
|
99
|
+
const annotationScanLimit = depth === IngestDepth.Extreme ? 5000 : 1500;
|
|
100
|
+
const stabilityMap = buildStabilityMap({
|
|
101
|
+
inspection,
|
|
102
|
+
areaMap,
|
|
103
|
+
importGraph,
|
|
104
|
+
generatedRoots: generatedReport.generatedRoots.map((r) => r.path),
|
|
105
|
+
scanAnnotations,
|
|
106
|
+
annotationScanLimit,
|
|
107
|
+
});
|
|
108
|
+
const contradictions = buildContradictionReport({ inspection });
|
|
109
|
+
// Language-aware sections. Detect language profiles once and reuse
|
|
110
|
+
// the result everywhere it is needed; on shallow/standard depth only
|
|
111
|
+
// profiles + commands are surfaced (cheap). Deep/extreme add the polyglot
|
|
112
|
+
// dependency summary, boundary report, suggestions and test-impact.
|
|
113
|
+
let languageProfiles;
|
|
114
|
+
let languageCommands;
|
|
115
|
+
let polyglotDependencySummary;
|
|
116
|
+
let polyglotTestImpactSummary;
|
|
117
|
+
let languageBoundarySuggestions;
|
|
118
|
+
let polyglotBoundaryReport;
|
|
119
|
+
let languageRiskNotes;
|
|
120
|
+
let languageGeneratedCodeSignals;
|
|
121
|
+
let languageStabilitySignals;
|
|
122
|
+
try {
|
|
123
|
+
languageProfiles = detectLanguageProfiles(projectRoot);
|
|
124
|
+
languageCommands = buildLanguageCommandReport(projectRoot, languageProfiles);
|
|
125
|
+
// Polyglot risk notes — extracted from each profile.
|
|
126
|
+
const polyglotLangs = languageProfiles.profiles.filter((p) => p.language !== LanguageId.TypeScript && p.language !== LanguageId.JavaScript);
|
|
127
|
+
languageRiskNotes = [];
|
|
128
|
+
for (const p of languageProfiles.profiles) {
|
|
129
|
+
for (const note of p.riskNotes) {
|
|
130
|
+
languageRiskNotes.push({ language: p.language, note });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (polyglotLangs.length > 0 && (depth === IngestDepth.Deep || depth === IngestDepth.Extreme)) {
|
|
134
|
+
polyglotDependencySummary = scanPolyglotDependencies(projectRoot, {
|
|
135
|
+
languages: polyglotLangs.map((p) => p.language),
|
|
136
|
+
});
|
|
137
|
+
try {
|
|
138
|
+
polyglotBoundaryReport = buildPolyglotBoundaryReport({
|
|
139
|
+
projectRoot,
|
|
140
|
+
cached: languageProfiles,
|
|
141
|
+
graph: polyglotDependencySummary,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
limitations.push(`polyglot boundary build failed: ${err.message}`);
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
languageBoundarySuggestions = suggestLanguageBoundaries(projectRoot);
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
limitations.push(`language boundary suggestions failed: ${err.message}`);
|
|
152
|
+
}
|
|
153
|
+
// Test impact uses an empty file list at the model build site — callers
|
|
154
|
+
// pass concrete files via `shrk understand-task`. We still surface the
|
|
155
|
+
// shape so downstream renderers know the language has impact data.
|
|
156
|
+
try {
|
|
157
|
+
polyglotTestImpactSummary = computePolyglotTestImpact(projectRoot, []);
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
limitations.push(`polyglot test impact failed: ${err.message}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Tag generated-code roots by language for the new section.
|
|
164
|
+
languageGeneratedCodeSignals = [];
|
|
165
|
+
for (const root of generatedReport.generatedRoots) {
|
|
166
|
+
let lang = 'unknown';
|
|
167
|
+
if (root.kind === 'java-generated')
|
|
168
|
+
lang = LanguageId.Java;
|
|
169
|
+
else if (root.kind === 'csharp-generated')
|
|
170
|
+
lang = LanguageId.CSharp;
|
|
171
|
+
else if (root.kind === 'python-generated')
|
|
172
|
+
lang = LanguageId.Python;
|
|
173
|
+
else if (root.kind === 'go-generated')
|
|
174
|
+
lang = LanguageId.Go;
|
|
175
|
+
else if (root.kind === 'rust-generated')
|
|
176
|
+
lang = LanguageId.Rust;
|
|
177
|
+
else if (root.kind === 'angular-environment' || root.kind === 'angular-router')
|
|
178
|
+
lang = LanguageId.TypeScript;
|
|
179
|
+
else if (root.kind === 'prisma-client')
|
|
180
|
+
lang = LanguageId.TypeScript;
|
|
181
|
+
else if (root.kind === 'openapi' || root.kind === 'graphql')
|
|
182
|
+
lang = 'multi';
|
|
183
|
+
if (lang !== 'unknown') {
|
|
184
|
+
languageGeneratedCodeSignals.push({ language: lang, signal: root.reason, paths: [root.path] });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Tag stability areas by language guess (uses file-extension priors).
|
|
188
|
+
languageStabilitySignals = [];
|
|
189
|
+
for (const area of stabilityMap.areas) {
|
|
190
|
+
const langs = new Set();
|
|
191
|
+
for (const f of inspection.sourceFiles) {
|
|
192
|
+
if (!f.startsWith(area.path + '/') && f !== area.path)
|
|
193
|
+
continue;
|
|
194
|
+
const ext = nodePath.extname(f).toLowerCase();
|
|
195
|
+
if (ext === '.ts' || ext === '.tsx')
|
|
196
|
+
langs.add(LanguageId.TypeScript);
|
|
197
|
+
else if (ext === '.js' || ext === '.jsx')
|
|
198
|
+
langs.add(LanguageId.JavaScript);
|
|
199
|
+
else if (ext === '.java')
|
|
200
|
+
langs.add(LanguageId.Java);
|
|
201
|
+
else if (ext === '.cs')
|
|
202
|
+
langs.add(LanguageId.CSharp);
|
|
203
|
+
else if (ext === '.py')
|
|
204
|
+
langs.add(LanguageId.Python);
|
|
205
|
+
else if (ext === '.go')
|
|
206
|
+
langs.add(LanguageId.Go);
|
|
207
|
+
else if (ext === '.rs')
|
|
208
|
+
langs.add(LanguageId.Rust);
|
|
209
|
+
}
|
|
210
|
+
for (const l of langs) {
|
|
211
|
+
languageStabilitySignals.push({ language: l, kind: area.kind, paths: [area.path] });
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
limitations.push(`language profiling failed: ${err.message}`);
|
|
217
|
+
}
|
|
218
|
+
// 6) Risk areas — high-fan-in or explicitly risky paths.
|
|
219
|
+
const riskAreas = buildRiskAreas(inspection, stabilityMap, importGraph);
|
|
220
|
+
// 7) Domain map.
|
|
221
|
+
const domainMap = {
|
|
222
|
+
areas: areaMap.areas.map((a) => ({
|
|
223
|
+
id: a.id,
|
|
224
|
+
paths: a.paths,
|
|
225
|
+
kind: a.kind,
|
|
226
|
+
fileCount: a.fileCount,
|
|
227
|
+
})),
|
|
228
|
+
constructs: constructs.map((c) => ({
|
|
229
|
+
id: c.id,
|
|
230
|
+
title: c.title,
|
|
231
|
+
paths: deriveConstructPaths(c),
|
|
232
|
+
})),
|
|
233
|
+
};
|
|
234
|
+
// 8) Workflow map — pulled from package scripts + pipelines + docs hints.
|
|
235
|
+
const workflowMap = buildWorkflowMap(inspection, onboarding);
|
|
236
|
+
// 9) Change protocol — built from rules + boundary fixes + safe-codegen.
|
|
237
|
+
const changeProtocol = buildChangeProtocol(inspection, onboarding);
|
|
238
|
+
// 10) Task context hints + open questions.
|
|
239
|
+
const taskContextHints = buildTaskContextHints(inspection, onboarding, generatedReport, contradictions, stabilityMap, options.task);
|
|
240
|
+
const openQuestions = buildOpenQuestions(onboarding, contradictions, generatedReport, stabilityMap);
|
|
241
|
+
// 11) Recommended SharkCraft files.
|
|
242
|
+
const recommendedSharkCraftFiles = buildRecommendedFiles({
|
|
243
|
+
onboarding,
|
|
244
|
+
generatedReport,
|
|
245
|
+
stabilityMap,
|
|
246
|
+
contradictions,
|
|
247
|
+
businessLogicModel,
|
|
248
|
+
domainMap,
|
|
249
|
+
});
|
|
250
|
+
// 12) Confidence.
|
|
251
|
+
const confidence = computeConfidence({
|
|
252
|
+
inspection,
|
|
253
|
+
onboarding,
|
|
254
|
+
generatedReport,
|
|
255
|
+
contradictions,
|
|
256
|
+
stabilityMap,
|
|
257
|
+
importGraph,
|
|
258
|
+
docsScanned: contradictions.filesScanned,
|
|
259
|
+
});
|
|
260
|
+
// 13) Repository overview.
|
|
261
|
+
const repositoryOverview = {
|
|
262
|
+
projectName: inspection.workspace.packageName ?? 'unknown-project',
|
|
263
|
+
...(inspection.workspace.description ? { description: inspection.workspace.description } : {}),
|
|
264
|
+
packageManager: inspection.workspace.packageManager.manager,
|
|
265
|
+
frameworks: inspection.workspace.frameworks.map((f) => f.name),
|
|
266
|
+
topLevelDirs: inspection.workspace.topLevelDirs,
|
|
267
|
+
knownScripts: Object.keys(inspection.workspace.scripts ?? {}),
|
|
268
|
+
hasSharkcraftFolder: inspection.hasSharkcraftFolder,
|
|
269
|
+
monorepo: detectMonorepo(inspection),
|
|
270
|
+
detectedLanguages: detectLanguages(inspection),
|
|
271
|
+
};
|
|
272
|
+
return {
|
|
273
|
+
schema: REPOSITORY_KNOWLEDGE_MODEL_SCHEMA,
|
|
274
|
+
projectRoot,
|
|
275
|
+
depth,
|
|
276
|
+
presets,
|
|
277
|
+
forcedPresetIds: options.forcedPresetIds ?? [],
|
|
278
|
+
transformationalIntents,
|
|
279
|
+
selectedSections: sectionsArr,
|
|
280
|
+
repositoryOverview,
|
|
281
|
+
...(languageProfiles ? { languageProfiles } : {}),
|
|
282
|
+
...(languageCommands ? { languageCommands } : {}),
|
|
283
|
+
...(polyglotDependencySummary ? { polyglotDependencySummary } : {}),
|
|
284
|
+
...(polyglotTestImpactSummary ? { polyglotTestImpactSummary } : {}),
|
|
285
|
+
...(languageBoundarySuggestions ? { languageBoundarySuggestions } : {}),
|
|
286
|
+
...(polyglotBoundaryReport ? { polyglotBoundaryReport } : {}),
|
|
287
|
+
...(languageRiskNotes ? { languageRiskNotes } : {}),
|
|
288
|
+
...(languageGeneratedCodeSignals ? { languageGeneratedCodeSignals } : {}),
|
|
289
|
+
...(languageStabilitySignals ? { languageStabilitySignals } : {}),
|
|
290
|
+
architectureModel,
|
|
291
|
+
businessLogicModel,
|
|
292
|
+
rulesAndConventions: {
|
|
293
|
+
rules: onboarding.inferredRules,
|
|
294
|
+
paths: onboarding.inferredPathConventions,
|
|
295
|
+
verificationCommands: onboarding.inferredVerificationCommands,
|
|
296
|
+
},
|
|
297
|
+
dependencyBoundaries: {
|
|
298
|
+
rules: onboarding.inferredBoundaryRules,
|
|
299
|
+
importGraphSummary: {
|
|
300
|
+
nodeCount: importGraph?.filesScanned ?? 0,
|
|
301
|
+
edgeCount: importGraph?.packageCount ?? 0,
|
|
302
|
+
cycles: (importGraph?.cycles ?? []).map((c) => c.nodes.join(' → ')),
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
domainMap,
|
|
306
|
+
workflowMap,
|
|
307
|
+
changeProtocol,
|
|
308
|
+
riskAreas,
|
|
309
|
+
contradictions,
|
|
310
|
+
openQuestions,
|
|
311
|
+
generatedVsHandwritten: generatedReport,
|
|
312
|
+
stableExperimentalDeprecated: stabilityMap,
|
|
313
|
+
taskContextHints,
|
|
314
|
+
recommendedSharkCraftFiles,
|
|
315
|
+
inferredPipelines: onboarding.inferredPipelines,
|
|
316
|
+
inferredTemplates: onboarding.inferredTemplateCandidates,
|
|
317
|
+
confidence,
|
|
318
|
+
limitations,
|
|
319
|
+
generatedAt: new Date().toISOString(),
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function emptyOnboardingPlan(projectRoot) {
|
|
323
|
+
return {
|
|
324
|
+
projectSummary: {
|
|
325
|
+
projectRoot,
|
|
326
|
+
packageManager: PackageManager.Unknown,
|
|
327
|
+
profiles: [],
|
|
328
|
+
hasSharkcraftFolder: false,
|
|
329
|
+
},
|
|
330
|
+
recommendedPresets: [],
|
|
331
|
+
suggestedFiles: [],
|
|
332
|
+
inferredPathConventions: [],
|
|
333
|
+
inferredVerificationCommands: [],
|
|
334
|
+
inferredBoundaryRules: [],
|
|
335
|
+
inferredTemplateCandidates: [],
|
|
336
|
+
inferredRules: [],
|
|
337
|
+
inferredPipelines: [],
|
|
338
|
+
detectedInstructionFiles: [],
|
|
339
|
+
risks: [],
|
|
340
|
+
nextCommands: [],
|
|
341
|
+
readiness: {
|
|
342
|
+
current: 'poor',
|
|
343
|
+
expected: 'poor',
|
|
344
|
+
currentScore: 0,
|
|
345
|
+
expectedScore: 0,
|
|
346
|
+
topImprovements: [],
|
|
347
|
+
},
|
|
348
|
+
monorepoSummary: null,
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function applyForcedPresets(raw, forced, inspection, transformationalIntents) {
|
|
352
|
+
if (forced.length === 0)
|
|
353
|
+
return raw;
|
|
354
|
+
const workspaceProfiles = new Set(inspection.workspace.profiles ?? []);
|
|
355
|
+
const byId = new Map(raw.map((r) => [r.preset.id, r]));
|
|
356
|
+
const out = [];
|
|
357
|
+
for (const id of forced) {
|
|
358
|
+
const found = byId.get(id);
|
|
359
|
+
if (found) {
|
|
360
|
+
out.push(found);
|
|
361
|
+
byId.delete(id);
|
|
362
|
+
// Even if the preset appears in the recommendation list, treat it as
|
|
363
|
+
// transformational intent when its `appliesTo` profiles do not overlap
|
|
364
|
+
// with the workspace's detected profiles.
|
|
365
|
+
const requirements = found.preset.appliesTo ?? [];
|
|
366
|
+
const matches = requirements.filter((p) => workspaceProfiles.has(p));
|
|
367
|
+
if (requirements.length > 0 && matches.length === 0) {
|
|
368
|
+
transformationalIntents.push(`forced preset "${id}" does not match repo profile yet — treat as adaptation guidance`);
|
|
369
|
+
}
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
const preset = inspection.presetRegistry.get(id);
|
|
373
|
+
if (preset) {
|
|
374
|
+
out.push({
|
|
375
|
+
preset,
|
|
376
|
+
score: 0,
|
|
377
|
+
confidence: 'low',
|
|
378
|
+
reasons: ['Forced preset — repo signals do not match yet (transformational intent).'],
|
|
379
|
+
});
|
|
380
|
+
transformationalIntents.push(`forced preset "${id}" does not match repo profile yet — treat as adaptation guidance`);
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
transformationalIntents.push(`unknown forced preset "${id}" — ignored`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
for (const remaining of byId.values())
|
|
387
|
+
out.push(remaining);
|
|
388
|
+
return out;
|
|
389
|
+
}
|
|
390
|
+
function buildArchitectureModel(inspection, areaMap, importGraph) {
|
|
391
|
+
const layers = areaMap.areas.map((a) => ({
|
|
392
|
+
id: a.id,
|
|
393
|
+
description: `Area "${a.id}" detected from ${a.paths.length} path(s).`,
|
|
394
|
+
paths: a.paths,
|
|
395
|
+
fileCount: a.fileCount,
|
|
396
|
+
}));
|
|
397
|
+
const publicApis = inspection.sourceFiles
|
|
398
|
+
.filter((f) => /(^|\/)src\/index\.(ts|tsx|js)$/.test(f) || /(^|\/)packages\/[^\/]+\/src\/index\.(ts|tsx)$/.test(f))
|
|
399
|
+
.map((f) => nodePath.dirname(f));
|
|
400
|
+
const notes = [];
|
|
401
|
+
if (importGraph && importGraph.cycles.length > 0) {
|
|
402
|
+
notes.push(`${importGraph.cycles.length} import cycle(s) detected; review before layering changes.`);
|
|
403
|
+
}
|
|
404
|
+
return { layers, publicApis, notes };
|
|
405
|
+
}
|
|
406
|
+
function buildBusinessLogicModel(inspection, constructs, _areaMap) {
|
|
407
|
+
const entities = constructs
|
|
408
|
+
.filter((c) => /entity|model|domain|value-object|record/i.test(c.type) || hasFacetKindLike(c, /entity|model|domain/))
|
|
409
|
+
.map((c) => ({
|
|
410
|
+
id: c.id,
|
|
411
|
+
title: c.title,
|
|
412
|
+
source: 'construct',
|
|
413
|
+
summary: c.description ?? c.title,
|
|
414
|
+
paths: deriveConstructPaths(c),
|
|
415
|
+
relatedWorkflows: [],
|
|
416
|
+
}));
|
|
417
|
+
const workflows = constructs
|
|
418
|
+
.filter((c) => /workflow|service|pipeline|playbook|use-?case|saga|flow/i.test(c.type) || hasFacetKindLike(c, /workflow|service|pipeline|playbook|usecase/))
|
|
419
|
+
.map((c) => ({
|
|
420
|
+
id: c.id,
|
|
421
|
+
title: c.title,
|
|
422
|
+
source: 'construct',
|
|
423
|
+
summary: c.description ?? c.title,
|
|
424
|
+
paths: deriveConstructPaths(c),
|
|
425
|
+
relatedWorkflows: [],
|
|
426
|
+
}));
|
|
427
|
+
const invariants = [];
|
|
428
|
+
// Infer some invariants from package.json + frameworks.
|
|
429
|
+
if (inspection.workspace.frameworks.some((f) => /angular/i.test(f.name))) {
|
|
430
|
+
invariants.push('Components/services follow Angular DI — do not instantiate services directly outside the injector.');
|
|
431
|
+
}
|
|
432
|
+
if (inspection.workspace.hasTypeScript) {
|
|
433
|
+
invariants.push('TypeScript strict mode is the contract — no any in public surfaces.');
|
|
434
|
+
}
|
|
435
|
+
if (inspection.workspace.frameworks.some((f) => /nx/i.test(f.name))) {
|
|
436
|
+
invariants.push('Nx project boundaries are enforced — verify tags/scope before adding cross-project imports.');
|
|
437
|
+
}
|
|
438
|
+
return { entities, workflows, invariants };
|
|
439
|
+
}
|
|
440
|
+
function buildWorkflowMap(inspection, onboarding) {
|
|
441
|
+
const workflows = [];
|
|
442
|
+
// Package scripts.
|
|
443
|
+
for (const [name, cmd] of Object.entries(inspection.workspace.scripts ?? {})) {
|
|
444
|
+
workflows.push({
|
|
445
|
+
id: `script:${name}`,
|
|
446
|
+
title: name,
|
|
447
|
+
source: 'scripts',
|
|
448
|
+
steps: [cmd],
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
// Inferred pipelines.
|
|
452
|
+
for (const p of onboarding.inferredPipelines) {
|
|
453
|
+
workflows.push({
|
|
454
|
+
id: `pipeline:${p.id}`,
|
|
455
|
+
title: p.title,
|
|
456
|
+
source: 'inferred',
|
|
457
|
+
steps: p.steps,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
return { workflows };
|
|
461
|
+
}
|
|
462
|
+
function buildChangeProtocol(inspection, onboarding) {
|
|
463
|
+
const entries = [];
|
|
464
|
+
entries.push({
|
|
465
|
+
id: 'change-protocol.feature',
|
|
466
|
+
title: 'Add a feature',
|
|
467
|
+
steps: [
|
|
468
|
+
'Read relevant rules + path conventions (`shrk context --task "<task>"`).',
|
|
469
|
+
'If a template exists for the construct, run `shrk gen <id> <name> --dry-run --save-plan`.',
|
|
470
|
+
'Review the plan (`shrk plan review`).',
|
|
471
|
+
'Apply with `shrk apply <plan> --verify-signature --validate`.',
|
|
472
|
+
'Run verification commands listed in the task packet.',
|
|
473
|
+
],
|
|
474
|
+
recommendedCommands: ['shrk task', 'shrk gen', 'shrk plan review', 'shrk apply'],
|
|
475
|
+
});
|
|
476
|
+
entries.push({
|
|
477
|
+
id: 'change-protocol.refactor',
|
|
478
|
+
title: 'Refactor existing code',
|
|
479
|
+
steps: [
|
|
480
|
+
'Map impact via `shrk impact <path>`.',
|
|
481
|
+
'Check boundaries with `shrk check boundaries`.',
|
|
482
|
+
'Plan + dry-run, then apply.',
|
|
483
|
+
'Re-run tests + boundary check after.',
|
|
484
|
+
],
|
|
485
|
+
recommendedCommands: ['shrk impact', 'shrk check boundaries', 'shrk gen', 'shrk apply'],
|
|
486
|
+
});
|
|
487
|
+
entries.push({
|
|
488
|
+
id: 'change-protocol.public-api',
|
|
489
|
+
title: 'Change a public API',
|
|
490
|
+
steps: [
|
|
491
|
+
'Verify export barrels (`packages/*/src/index.ts`).',
|
|
492
|
+
'Look up consumers via `shrk api report` and `shrk impact`.',
|
|
493
|
+
'Document the change in a decision record (`shrk decisions new`).',
|
|
494
|
+
'Run release-readiness + boundary checks.',
|
|
495
|
+
],
|
|
496
|
+
recommendedCommands: ['shrk api report', 'shrk impact', 'shrk decisions new', 'shrk release readiness'],
|
|
497
|
+
});
|
|
498
|
+
if (inspection.workspace.frameworks.some((f) => /angular/i.test(f.name))) {
|
|
499
|
+
entries.push({
|
|
500
|
+
id: 'change-protocol.angular-component',
|
|
501
|
+
title: 'Add an Angular component / directive / service',
|
|
502
|
+
steps: [
|
|
503
|
+
'Run `shrk context --task "add angular <kind>"` to pick up Modern Angular rules.',
|
|
504
|
+
'Use signals or RxJS deliberately — do not mirror them.',
|
|
505
|
+
'Avoid deep imports across libraries.',
|
|
506
|
+
'Add tests under the same library; respect Nx tags / boundaries.',
|
|
507
|
+
],
|
|
508
|
+
recommendedCommands: ['shrk context', 'shrk gen', 'shrk check boundaries'],
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
void onboarding;
|
|
512
|
+
return { entries };
|
|
513
|
+
}
|
|
514
|
+
function buildTaskContextHints(inspection, _onboarding, generatedReport, contradictions, stabilityMap, task) {
|
|
515
|
+
const hints = [];
|
|
516
|
+
hints.push({
|
|
517
|
+
trigger: 'before any task',
|
|
518
|
+
hint: 'Run `shrk understand-task "<task>"` to load relevant rules, paths, risks and recommended commands.',
|
|
519
|
+
recommendedCommand: 'shrk understand-task "<task>"',
|
|
520
|
+
});
|
|
521
|
+
hints.push({
|
|
522
|
+
trigger: 'when changing files',
|
|
523
|
+
hint: 'Run `shrk validate-change --staged` to detect missing tests, broken boundaries, and policy gates before submitting.',
|
|
524
|
+
recommendedCommand: 'shrk validate-change --staged',
|
|
525
|
+
});
|
|
526
|
+
if (generatedReport.generatedRoots.length > 0) {
|
|
527
|
+
hints.push({
|
|
528
|
+
trigger: 'when a task touches a generated root',
|
|
529
|
+
hint: `Generated roots detected (${generatedReport.generatedRoots.length}). Edit generator inputs, not the generated output.`,
|
|
530
|
+
recommendedCommand: 'shrk generated report',
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
if (stabilityMap.byKind[StabilityKind.Deprecated].length > 0 || stabilityMap.byKind[StabilityKind.Legacy].length > 0) {
|
|
534
|
+
hints.push({
|
|
535
|
+
trigger: 'when a task lands in deprecated/legacy areas',
|
|
536
|
+
hint: 'Deprecated or legacy areas exist — prefer the stable replacement when adding new code.',
|
|
537
|
+
recommendedCommand: 'shrk stability map',
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
if (contradictions.findings.length > 0) {
|
|
541
|
+
hints.push({
|
|
542
|
+
trigger: 'when documentation seems wrong',
|
|
543
|
+
hint: `${contradictions.findings.length} doc/code contradictions detected. Verify the doc before trusting it.`,
|
|
544
|
+
recommendedCommand: 'shrk contradictions',
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
if (task && /angular/i.test(task)) {
|
|
548
|
+
hints.push({
|
|
549
|
+
trigger: 'angular work',
|
|
550
|
+
hint: 'Use Modern Angular preset rules (signals/RxJS discipline, standalone components, OnPush).',
|
|
551
|
+
recommendedCommand: 'shrk presets get modern-angular',
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
if (inspection.workspace.hasTypeScript) {
|
|
555
|
+
hints.push({
|
|
556
|
+
trigger: 'before public API changes',
|
|
557
|
+
hint: 'Strict TypeScript: avoid any/unsafe assertions; prefer satisfies and discriminated unions.',
|
|
558
|
+
recommendedCommand: 'shrk presets get strict-typescript',
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
return hints;
|
|
562
|
+
}
|
|
563
|
+
function buildOpenQuestions(onboarding, contradictions, generatedReport, stabilityMap) {
|
|
564
|
+
const questions = [];
|
|
565
|
+
for (const r of onboarding.risks)
|
|
566
|
+
questions.push(`Onboarding risk — ${r}`);
|
|
567
|
+
if (contradictions.findings.length > 0) {
|
|
568
|
+
questions.push(`Resolve ${contradictions.findings.length} doc/code contradictions before relying on docs as authoritative.`);
|
|
569
|
+
}
|
|
570
|
+
if (generatedReport.generatedRoots.length === 0) {
|
|
571
|
+
questions.push('No generated roots were detected — is everything truly hand-written, or are markers missing?');
|
|
572
|
+
}
|
|
573
|
+
if (stabilityMap.byKind[StabilityKind.HighRisk].length > 0) {
|
|
574
|
+
questions.push(`${stabilityMap.byKind[StabilityKind.HighRisk].length} high-fan-in areas — confirm they are intentional.`);
|
|
575
|
+
}
|
|
576
|
+
return questions;
|
|
577
|
+
}
|
|
578
|
+
function buildRiskAreas(inspection, stabilityMap, importGraph) {
|
|
579
|
+
const out = [];
|
|
580
|
+
for (const area of stabilityMap.byKind[StabilityKind.HighRisk]) {
|
|
581
|
+
out.push({
|
|
582
|
+
id: `high-fan-in:${area.path}`,
|
|
583
|
+
path: area.path,
|
|
584
|
+
reason: area.note ?? 'High fan-in detected.',
|
|
585
|
+
recommendation: 'Add an explicit boundary or split the area before further large changes.',
|
|
586
|
+
score: 80,
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
for (const area of stabilityMap.byKind[StabilityKind.Deprecated]) {
|
|
590
|
+
out.push({
|
|
591
|
+
id: `deprecated:${area.path}`,
|
|
592
|
+
path: area.path,
|
|
593
|
+
reason: 'Folder marked deprecated.',
|
|
594
|
+
recommendation: 'Migrate consumers off and remove after deprecation window.',
|
|
595
|
+
score: 60,
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
void inspection;
|
|
599
|
+
void importGraph;
|
|
600
|
+
return out;
|
|
601
|
+
}
|
|
602
|
+
function deriveConstructPaths(c) {
|
|
603
|
+
const paths = [];
|
|
604
|
+
for (const file of c.files ?? [])
|
|
605
|
+
paths.push(file);
|
|
606
|
+
for (const api of c.publicApi ?? [])
|
|
607
|
+
paths.push(api);
|
|
608
|
+
for (const list of Object.values(c.facets ?? {})) {
|
|
609
|
+
for (const v of list) {
|
|
610
|
+
if (v.source && /[\\/.]/.test(v.source))
|
|
611
|
+
paths.push(v.source);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return Array.from(new Set(paths));
|
|
615
|
+
}
|
|
616
|
+
function hasFacetKindLike(c, re) {
|
|
617
|
+
for (const kind of Object.keys(c.facets ?? {})) {
|
|
618
|
+
if (re.test(kind))
|
|
619
|
+
return true;
|
|
620
|
+
}
|
|
621
|
+
return false;
|
|
622
|
+
}
|
|
623
|
+
function detectMonorepo(inspection) {
|
|
624
|
+
if (inspection.workspace.frameworks.some((f) => /nx|rush|lerna|turborepo|moon/i.test(f.name)))
|
|
625
|
+
return true;
|
|
626
|
+
if (inspection.workspace.topLevelDirs.includes('packages') && inspection.workspace.topLevelDirs.includes('apps'))
|
|
627
|
+
return true;
|
|
628
|
+
if (inspection.workspace.topLevelDirs.includes('packages'))
|
|
629
|
+
return true;
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
function detectLanguages(inspection) {
|
|
633
|
+
const langs = new Set();
|
|
634
|
+
if (inspection.workspace.hasTypeScript)
|
|
635
|
+
langs.add('typescript');
|
|
636
|
+
for (const f of inspection.sourceFiles) {
|
|
637
|
+
const ext = nodePath.extname(f).toLowerCase();
|
|
638
|
+
if (ext === '.ts' || ext === '.tsx')
|
|
639
|
+
langs.add('typescript');
|
|
640
|
+
if (ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs')
|
|
641
|
+
langs.add('javascript');
|
|
642
|
+
if (ext === '.py')
|
|
643
|
+
langs.add('python');
|
|
644
|
+
if (ext === '.go')
|
|
645
|
+
langs.add('go');
|
|
646
|
+
if (ext === '.rs')
|
|
647
|
+
langs.add('rust');
|
|
648
|
+
if (ext === '.java')
|
|
649
|
+
langs.add('java');
|
|
650
|
+
if (ext === '.kt')
|
|
651
|
+
langs.add('kotlin');
|
|
652
|
+
if (ext === '.cs')
|
|
653
|
+
langs.add('csharp');
|
|
654
|
+
if (ext === '.proto')
|
|
655
|
+
langs.add('protobuf');
|
|
656
|
+
if (ext === '.graphql' || ext === '.gql')
|
|
657
|
+
langs.add('graphql');
|
|
658
|
+
}
|
|
659
|
+
return Array.from(langs).sort();
|
|
660
|
+
}
|
|
661
|
+
function buildRecommendedFiles(input) {
|
|
662
|
+
const files = [];
|
|
663
|
+
files.push({
|
|
664
|
+
target: 'sharkcraft/knowledge.ts',
|
|
665
|
+
reason: 'Capture architecture/domain concepts and invariants surfaced by ingest.',
|
|
666
|
+
entries: [
|
|
667
|
+
...input.businessLogicModel.entities.map((e) => ({
|
|
668
|
+
id: `concept.${e.id}`,
|
|
669
|
+
kind: 'knowledge-entry',
|
|
670
|
+
reason: `Domain entity surfaced from construct registry (${e.paths.length} path(s)).`,
|
|
671
|
+
})),
|
|
672
|
+
...input.businessLogicModel.workflows.map((w) => ({
|
|
673
|
+
id: `workflow.${w.id}`,
|
|
674
|
+
kind: 'knowledge-entry',
|
|
675
|
+
reason: 'Workflow surfaced from construct registry.',
|
|
676
|
+
})),
|
|
677
|
+
...input.businessLogicModel.invariants.map((inv, i) => ({
|
|
678
|
+
id: `invariant.${i}`,
|
|
679
|
+
kind: 'knowledge-entry',
|
|
680
|
+
reason: inv,
|
|
681
|
+
})),
|
|
682
|
+
],
|
|
683
|
+
});
|
|
684
|
+
files.push({
|
|
685
|
+
target: 'sharkcraft/rules.ts',
|
|
686
|
+
reason: 'Persist inferred rules + preset-contributed rules as live SharkCraft rules.',
|
|
687
|
+
entries: input.onboarding.inferredRules.map((r) => ({
|
|
688
|
+
id: r.id,
|
|
689
|
+
kind: 'rule',
|
|
690
|
+
reason: r.reason,
|
|
691
|
+
})),
|
|
692
|
+
});
|
|
693
|
+
files.push({
|
|
694
|
+
target: 'sharkcraft/paths.ts',
|
|
695
|
+
reason: 'Persist inferred path conventions so the engine ranks correctly.',
|
|
696
|
+
entries: input.onboarding.inferredPathConventions.map((p) => ({
|
|
697
|
+
id: p.id,
|
|
698
|
+
kind: 'path',
|
|
699
|
+
reason: p.reason,
|
|
700
|
+
})),
|
|
701
|
+
});
|
|
702
|
+
files.push({
|
|
703
|
+
target: 'sharkcraft/boundaries.ts',
|
|
704
|
+
reason: 'Enforce dependency layers and forbid framework leaks.',
|
|
705
|
+
entries: input.onboarding.inferredBoundaryRules.map((b) => ({
|
|
706
|
+
id: b.id,
|
|
707
|
+
kind: 'boundary',
|
|
708
|
+
reason: b.reason,
|
|
709
|
+
})),
|
|
710
|
+
});
|
|
711
|
+
files.push({
|
|
712
|
+
target: 'sharkcraft/constructs.ts',
|
|
713
|
+
reason: 'Make discovered constructs first-class so templates/playbooks can reference them.',
|
|
714
|
+
entries: input.domainMap.constructs.map((c) => ({
|
|
715
|
+
id: c.id,
|
|
716
|
+
kind: 'construct',
|
|
717
|
+
reason: 'Construct discovered from source.',
|
|
718
|
+
})),
|
|
719
|
+
});
|
|
720
|
+
const policies = [];
|
|
721
|
+
if (input.generatedReport.recommendedPolicyRules.length > 0) {
|
|
722
|
+
for (const p of input.generatedReport.recommendedPolicyRules) {
|
|
723
|
+
policies.push({
|
|
724
|
+
id: p.suggestedId,
|
|
725
|
+
kind: 'policy',
|
|
726
|
+
reason: p.reason,
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if (input.stabilityMap.byKind[StabilityKind.Deprecated].length > 0) {
|
|
731
|
+
policies.push({
|
|
732
|
+
id: 'policy.deprecated-readonly',
|
|
733
|
+
kind: 'policy',
|
|
734
|
+
reason: 'Deprecated areas should require explicit migration intent before being modified.',
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
files.push({
|
|
738
|
+
target: 'sharkcraft/policies.ts',
|
|
739
|
+
reason: 'Governance gates inferred from generated-code and stability signals.',
|
|
740
|
+
entries: policies,
|
|
741
|
+
});
|
|
742
|
+
files.push({
|
|
743
|
+
target: 'sharkcraft/playbooks.ts',
|
|
744
|
+
reason: 'Common development workflows (add feature / refactor / public-API change).',
|
|
745
|
+
entries: [
|
|
746
|
+
{ id: 'add-feature', kind: 'playbook', reason: 'Standard add-feature flow.' },
|
|
747
|
+
{ id: 'refactor', kind: 'playbook', reason: 'Refactor with impact + boundary checks.' },
|
|
748
|
+
{ id: 'public-api-change', kind: 'playbook', reason: 'Gated public-API change flow.' },
|
|
749
|
+
],
|
|
750
|
+
});
|
|
751
|
+
files.push({
|
|
752
|
+
target: 'sharkcraft/templates.ts',
|
|
753
|
+
reason: 'Safe, scaffold-pattern-backed templates inferred from siblings.',
|
|
754
|
+
entries: input.onboarding.inferredTemplateCandidates
|
|
755
|
+
.filter((t) => t.confidence !== 'low')
|
|
756
|
+
.map((t) => ({
|
|
757
|
+
id: t.id,
|
|
758
|
+
kind: 'template',
|
|
759
|
+
reason: t.reason,
|
|
760
|
+
})),
|
|
761
|
+
});
|
|
762
|
+
files.push({
|
|
763
|
+
target: 'sharkcraft/pipelines.ts',
|
|
764
|
+
reason: 'Inferred pipelines (context-only / feature-dev / unit-test / safe-refactor).',
|
|
765
|
+
entries: input.onboarding.inferredPipelines.map((p) => ({
|
|
766
|
+
id: p.id,
|
|
767
|
+
kind: 'pipeline',
|
|
768
|
+
reason: p.reason,
|
|
769
|
+
})),
|
|
770
|
+
});
|
|
771
|
+
files.push({
|
|
772
|
+
target: 'sharkcraft/presets.ts',
|
|
773
|
+
reason: 'Local preset bundle binding the chosen baseline presets.',
|
|
774
|
+
entries: [
|
|
775
|
+
{ id: 'local.bundle', kind: 'preset', reason: 'Local preset bundle for this repo.' },
|
|
776
|
+
],
|
|
777
|
+
});
|
|
778
|
+
return files;
|
|
779
|
+
}
|
|
780
|
+
function computeConfidence(input) {
|
|
781
|
+
const notes = [];
|
|
782
|
+
const perSection = {
|
|
783
|
+
[IngestSection.RepositoryOverview]: 90,
|
|
784
|
+
[IngestSection.ArchitectureModel]: input.importGraph ? 80 : 55,
|
|
785
|
+
[IngestSection.BusinessLogicModel]: input.inspection.sourceFiles.length > 0 ? 50 : 20,
|
|
786
|
+
[IngestSection.RulesAndConventions]: input.onboarding.inferredRules.length > 0 ? 75 : 30,
|
|
787
|
+
[IngestSection.DependencyBoundaries]: input.onboarding.inferredBoundaryRules.length > 0 ? 70 : 35,
|
|
788
|
+
[IngestSection.DomainMap]: 60,
|
|
789
|
+
[IngestSection.WorkflowMap]: 70,
|
|
790
|
+
[IngestSection.ChangeProtocol]: 80,
|
|
791
|
+
[IngestSection.RiskAreas]: input.stabilityMap.areas.length > 0 ? 65 : 30,
|
|
792
|
+
[IngestSection.Contradictions]: input.docsScanned > 0 ? 70 : 30,
|
|
793
|
+
[IngestSection.OpenQuestions]: 85,
|
|
794
|
+
[IngestSection.GeneratedVsHandwritten]: input.generatedReport.filesScanned > 0 ? 80 : 40,
|
|
795
|
+
[IngestSection.StableExperimentalDeprecated]: input.stabilityMap.areas.length > 0 ? 75 : 40,
|
|
796
|
+
[IngestSection.TaskContextHints]: 80,
|
|
797
|
+
[IngestSection.RecommendedSharkCraftFiles]: 85,
|
|
798
|
+
};
|
|
799
|
+
const values = Object.values(perSection);
|
|
800
|
+
const overall = Math.round(values.reduce((a, b) => a + b, 0) / values.length);
|
|
801
|
+
if (!input.importGraph)
|
|
802
|
+
notes.push('Import graph unavailable — architecture/risk numbers are heuristic only.');
|
|
803
|
+
if (input.docsScanned === 0)
|
|
804
|
+
notes.push('No docs scanned — contradiction detection is conservative.');
|
|
805
|
+
if (input.inspection.sourceFiles.length === 0)
|
|
806
|
+
notes.push('No source files visible — many sections fall back to onboarding inference only.');
|
|
807
|
+
return { overall, perSection, notes };
|
|
808
|
+
}
|
|
809
|
+
export function renderRepositoryKnowledgeModelText(model) {
|
|
810
|
+
const lines = [];
|
|
811
|
+
lines.push('=== Repository knowledge model ===');
|
|
812
|
+
lines.push(` project ${model.repositoryOverview.projectName}`);
|
|
813
|
+
lines.push(` depth ${model.depth}`);
|
|
814
|
+
lines.push(` presets ${model.presets.slice(0, 6).map((p) => p.preset.id).join(', ') || '(none)'}`);
|
|
815
|
+
if (model.transformationalIntents.length > 0) {
|
|
816
|
+
lines.push('');
|
|
817
|
+
lines.push('Transformational intents:');
|
|
818
|
+
for (const t of model.transformationalIntents)
|
|
819
|
+
lines.push(` - ${t}`);
|
|
820
|
+
}
|
|
821
|
+
lines.push('');
|
|
822
|
+
lines.push('Sections:');
|
|
823
|
+
for (const s of model.selectedSections)
|
|
824
|
+
lines.push(` • ${s} (confidence ${model.confidence.perSection[s] ?? '-'})`);
|
|
825
|
+
lines.push('');
|
|
826
|
+
lines.push(`Risk areas: ${model.riskAreas.length}`);
|
|
827
|
+
lines.push(`Contradictions: ${model.contradictions.findings.length}`);
|
|
828
|
+
lines.push(`Generated roots: ${model.generatedVsHandwritten.generatedRoots.length}`);
|
|
829
|
+
lines.push(`Stability areas: ${model.stableExperimentalDeprecated.areas.length}`);
|
|
830
|
+
lines.push(`Open questions: ${model.openQuestions.length}`);
|
|
831
|
+
lines.push(`Confidence: ${model.confidence.overall}/100`);
|
|
832
|
+
if (model.languageProfiles && model.languageProfiles.profiles.length > 0) {
|
|
833
|
+
lines.push('');
|
|
834
|
+
lines.push(`Languages: ${model.languageProfiles.profiles.map((p) => `${p.language}(${p.fileCount})`).join(', ')}`);
|
|
835
|
+
if (model.polyglotBoundaryReport) {
|
|
836
|
+
lines.push(`Polyglot boundary violations: ${model.polyglotBoundaryReport.counts.violations} (errors=${model.polyglotBoundaryReport.counts.errors})`);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
if (model.limitations.length > 0) {
|
|
840
|
+
lines.push('');
|
|
841
|
+
lines.push('Limitations:');
|
|
842
|
+
for (const l of model.limitations)
|
|
843
|
+
lines.push(` - ${l}`);
|
|
844
|
+
}
|
|
845
|
+
return lines.join('\n');
|
|
846
|
+
}
|
|
847
|
+
export function renderRepositoryKnowledgeModelMarkdown(model) {
|
|
848
|
+
const lines = [];
|
|
849
|
+
lines.push(`# Repository knowledge model — ${model.repositoryOverview.projectName}`);
|
|
850
|
+
lines.push('');
|
|
851
|
+
lines.push(`- Depth: **${model.depth}**`);
|
|
852
|
+
lines.push(`- Generated at: ${model.generatedAt}`);
|
|
853
|
+
lines.push(`- Confidence: **${model.confidence.overall}/100**`);
|
|
854
|
+
if (model.transformationalIntents.length > 0) {
|
|
855
|
+
lines.push('');
|
|
856
|
+
lines.push('> Transformational intents:');
|
|
857
|
+
for (const t of model.transformationalIntents)
|
|
858
|
+
lines.push(`> - ${t}`);
|
|
859
|
+
}
|
|
860
|
+
lines.push('');
|
|
861
|
+
lines.push('## Selected sections');
|
|
862
|
+
lines.push('');
|
|
863
|
+
for (const s of model.selectedSections) {
|
|
864
|
+
lines.push(`- **${s}** — confidence ${model.confidence.perSection[s] ?? '-'}`);
|
|
865
|
+
}
|
|
866
|
+
lines.push('');
|
|
867
|
+
lines.push('## Risk areas');
|
|
868
|
+
lines.push('');
|
|
869
|
+
if (model.riskAreas.length === 0) {
|
|
870
|
+
lines.push('_None._');
|
|
871
|
+
}
|
|
872
|
+
else {
|
|
873
|
+
lines.push('| Path | Reason | Score |');
|
|
874
|
+
lines.push('|---|---|---|');
|
|
875
|
+
for (const r of model.riskAreas)
|
|
876
|
+
lines.push(`| \`${r.path}\` | ${r.reason} | ${r.score} |`);
|
|
877
|
+
}
|
|
878
|
+
lines.push('');
|
|
879
|
+
lines.push('## Recommended SharkCraft files');
|
|
880
|
+
lines.push('');
|
|
881
|
+
for (const f of model.recommendedSharkCraftFiles) {
|
|
882
|
+
lines.push(`### ${f.target}`);
|
|
883
|
+
lines.push('');
|
|
884
|
+
lines.push(f.reason);
|
|
885
|
+
lines.push('');
|
|
886
|
+
if (f.entries.length === 0) {
|
|
887
|
+
lines.push('_no entries_');
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
lines.push('| Entry | Kind | Why this goes here |');
|
|
891
|
+
lines.push('|---|---|---|');
|
|
892
|
+
for (const e of f.entries)
|
|
893
|
+
lines.push(`| \`${e.id}\` | ${e.kind} | ${e.reason} |`);
|
|
894
|
+
}
|
|
895
|
+
lines.push('');
|
|
896
|
+
}
|
|
897
|
+
if (model.languageProfiles && model.languageProfiles.profiles.length > 0) {
|
|
898
|
+
lines.push('## Languages');
|
|
899
|
+
lines.push('');
|
|
900
|
+
lines.push('| Language | Files | Confidence | Build | Test framework(s) |');
|
|
901
|
+
lines.push('|---|---|---|---|---|');
|
|
902
|
+
for (const p of model.languageProfiles.profiles) {
|
|
903
|
+
lines.push(`| \`${p.language}\` | ${p.fileCount} | ${p.confidence} | ${p.buildTool ?? '-'} | ${p.testFrameworks.join(', ') || '-'} |`);
|
|
904
|
+
}
|
|
905
|
+
lines.push('');
|
|
906
|
+
}
|
|
907
|
+
if (model.polyglotBoundaryReport && model.polyglotBoundaryReport.counts.violations > 0) {
|
|
908
|
+
lines.push('## Polyglot boundary violations');
|
|
909
|
+
lines.push('');
|
|
910
|
+
lines.push('| Severity | Rule | From | Import |');
|
|
911
|
+
lines.push('|---|---|---|---|');
|
|
912
|
+
for (const v of model.polyglotBoundaryReport.violations.slice(0, 30)) {
|
|
913
|
+
lines.push(`| ${v.severity} | \`${v.ruleId}\` | \`${v.fromFile}\` | \`${v.importSpecifier}\` |`);
|
|
914
|
+
}
|
|
915
|
+
lines.push('');
|
|
916
|
+
}
|
|
917
|
+
if (model.openQuestions.length > 0) {
|
|
918
|
+
lines.push('## Open questions');
|
|
919
|
+
lines.push('');
|
|
920
|
+
for (const q of model.openQuestions)
|
|
921
|
+
lines.push(`- ${q}`);
|
|
922
|
+
}
|
|
923
|
+
if (model.limitations.length > 0) {
|
|
924
|
+
lines.push('');
|
|
925
|
+
lines.push('## Limitations');
|
|
926
|
+
lines.push('');
|
|
927
|
+
for (const l of model.limitations)
|
|
928
|
+
lines.push(`- ${l}`);
|
|
929
|
+
}
|
|
930
|
+
return lines.join('\n');
|
|
931
|
+
}
|
|
932
|
+
export function renderRepositoryKnowledgeModelJson(model) {
|
|
933
|
+
return JSON.stringify(model, null, 2);
|
|
934
|
+
}
|
|
935
|
+
export function renderRepositoryKnowledgeModelHtml(model) {
|
|
936
|
+
const md = renderRepositoryKnowledgeModelMarkdown(model);
|
|
937
|
+
const body = md.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
938
|
+
return `<!doctype html><html><head><meta charset="utf-8"><title>Repository knowledge model</title><style>body{font-family:system-ui;max-width:960px;margin:32px auto;padding:0 16px}pre{white-space:pre-wrap}</style></head><body><pre>${body}</pre></body></html>`;
|
|
939
|
+
}
|