@bloomreach/brxm-upgrade 0.1.1
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/README.md +217 -0
- package/dist/ai/index.d.ts +3 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +2 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/providers.d.ts +27 -0
- package/dist/ai/providers.d.ts.map +1 -0
- package/dist/ai/providers.js +105 -0
- package/dist/ai/providers.js.map +1 -0
- package/dist/ai/types.d.ts +47 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/capture/change-scanner.d.ts +20 -0
- package/dist/capture/change-scanner.d.ts.map +1 -0
- package/dist/capture/change-scanner.js +71 -0
- package/dist/capture/change-scanner.js.map +1 -0
- package/dist/capture/conflict-resolver.d.ts +21 -0
- package/dist/capture/conflict-resolver.d.ts.map +1 -0
- package/dist/capture/conflict-resolver.js +45 -0
- package/dist/capture/conflict-resolver.js.map +1 -0
- package/dist/capture/critique-types.d.ts +60 -0
- package/dist/capture/critique-types.d.ts.map +1 -0
- package/dist/capture/critique-types.js +2 -0
- package/dist/capture/critique-types.js.map +1 -0
- package/dist/capture/entry-critique.d.ts +30 -0
- package/dist/capture/entry-critique.d.ts.map +1 -0
- package/dist/capture/entry-critique.js +137 -0
- package/dist/capture/entry-critique.js.map +1 -0
- package/dist/capture/entry-generator.d.ts +32 -0
- package/dist/capture/entry-generator.d.ts.map +1 -0
- package/dist/capture/entry-generator.js +209 -0
- package/dist/capture/entry-generator.js.map +1 -0
- package/dist/capture/entry-qa.d.ts +28 -0
- package/dist/capture/entry-qa.d.ts.map +1 -0
- package/dist/capture/entry-qa.js +84 -0
- package/dist/capture/entry-qa.js.map +1 -0
- package/dist/capture/entry-regeneration.d.ts +29 -0
- package/dist/capture/entry-regeneration.d.ts.map +1 -0
- package/dist/capture/entry-regeneration.js +164 -0
- package/dist/capture/entry-regeneration.js.map +1 -0
- package/dist/capture/entry-validator.d.ts +18 -0
- package/dist/capture/entry-validator.d.ts.map +1 -0
- package/dist/capture/entry-validator.js +47 -0
- package/dist/capture/entry-validator.js.map +1 -0
- package/dist/capture/heuristics.d.ts +30 -0
- package/dist/capture/heuristics.d.ts.map +1 -0
- package/dist/capture/heuristics.js +223 -0
- package/dist/capture/heuristics.js.map +1 -0
- package/dist/capture/index.d.ts +7 -0
- package/dist/capture/index.d.ts.map +1 -0
- package/dist/capture/index.js +11 -0
- package/dist/capture/index.js.map +1 -0
- package/dist/capture/quality-report.d.ts +19 -0
- package/dist/capture/quality-report.d.ts.map +1 -0
- package/dist/capture/quality-report.js +161 -0
- package/dist/capture/quality-report.js.map +1 -0
- package/dist/capture/review-flow.d.ts +37 -0
- package/dist/capture/review-flow.d.ts.map +1 -0
- package/dist/capture/review-flow.js +212 -0
- package/dist/capture/review-flow.js.map +1 -0
- package/dist/capture/types.d.ts +114 -0
- package/dist/capture/types.d.ts.map +1 -0
- package/dist/capture/types.js +2 -0
- package/dist/capture/types.js.map +1 -0
- package/dist/commands/discover.d.ts +6 -0
- package/dist/commands/discover.d.ts.map +1 -0
- package/dist/commands/discover.js +147 -0
- package/dist/commands/discover.js.map +1 -0
- package/dist/commands/execute.d.ts +12 -0
- package/dist/commands/execute.d.ts.map +1 -0
- package/dist/commands/execute.js +113 -0
- package/dist/commands/execute.js.map +1 -0
- package/dist/commands/export.d.ts +26 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +291 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/finalize.d.ts +12 -0
- package/dist/commands/finalize.d.ts.map +1 -0
- package/dist/commands/finalize.js +225 -0
- package/dist/commands/finalize.js.map +1 -0
- package/dist/commands/guide.d.ts +12 -0
- package/dist/commands/guide.d.ts.map +1 -0
- package/dist/commands/guide.js +28 -0
- package/dist/commands/guide.js.map +1 -0
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +22 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/log-change.d.ts +14 -0
- package/dist/commands/log-change.d.ts.map +1 -0
- package/dist/commands/log-change.js +243 -0
- package/dist/commands/log-change.js.map +1 -0
- package/dist/commands/plan.d.ts +12 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +162 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/review-manifest.d.ts +39 -0
- package/dist/commands/review-manifest.d.ts.map +1 -0
- package/dist/commands/review-manifest.js +178 -0
- package/dist/commands/review-manifest.js.map +1 -0
- package/dist/commands/setup-manifests.d.ts +12 -0
- package/dist/commands/setup-manifests.d.ts.map +1 -0
- package/dist/commands/setup-manifests.js +229 -0
- package/dist/commands/setup-manifests.js.map +1 -0
- package/dist/config/defaults.d.ts +15 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +36 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +17 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +104 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/schema.d.ts +33 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +110 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/phase-manager.d.ts +53 -0
- package/dist/core/phase-manager.d.ts.map +1 -0
- package/dist/core/phase-manager.js +124 -0
- package/dist/core/phase-manager.js.map +1 -0
- package/dist/core/upgrade-state.d.ts +24 -0
- package/dist/core/upgrade-state.d.ts.map +1 -0
- package/dist/core/upgrade-state.js +32 -0
- package/dist/core/upgrade-state.js.map +1 -0
- package/dist/discovery/index.d.ts +5 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +4 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/discovery/orchestrator.d.ts +46 -0
- package/dist/discovery/orchestrator.d.ts.map +1 -0
- package/dist/discovery/orchestrator.js +124 -0
- package/dist/discovery/orchestrator.js.map +1 -0
- package/dist/discovery/scanners/config-detector.d.ts +24 -0
- package/dist/discovery/scanners/config-detector.d.ts.map +1 -0
- package/dist/discovery/scanners/config-detector.js +82 -0
- package/dist/discovery/scanners/config-detector.js.map +1 -0
- package/dist/discovery/scanners/cv-scanner.d.ts +30 -0
- package/dist/discovery/scanners/cv-scanner.d.ts.map +1 -0
- package/dist/discovery/scanners/cv-scanner.js +85 -0
- package/dist/discovery/scanners/cv-scanner.js.map +1 -0
- package/dist/discovery/scanners/index.d.ts +6 -0
- package/dist/discovery/scanners/index.d.ts.map +1 -0
- package/dist/discovery/scanners/index.js +6 -0
- package/dist/discovery/scanners/index.js.map +1 -0
- package/dist/discovery/scanners/maven-scanner.d.ts +33 -0
- package/dist/discovery/scanners/maven-scanner.d.ts.map +1 -0
- package/dist/discovery/scanners/maven-scanner.js +96 -0
- package/dist/discovery/scanners/maven-scanner.js.map +1 -0
- package/dist/discovery/scanners/repo-scanner.d.ts +9 -0
- package/dist/discovery/scanners/repo-scanner.d.ts.map +1 -0
- package/dist/discovery/scanners/repo-scanner.js +80 -0
- package/dist/discovery/scanners/repo-scanner.js.map +1 -0
- package/dist/discovery/scanners/version-resolver.d.ts +45 -0
- package/dist/discovery/scanners/version-resolver.d.ts.map +1 -0
- package/dist/discovery/scanners/version-resolver.js +119 -0
- package/dist/discovery/scanners/version-resolver.js.map +1 -0
- package/dist/discovery/types.d.ts +156 -0
- package/dist/discovery/types.d.ts.map +1 -0
- package/dist/discovery/types.js +2 -0
- package/dist/discovery/types.js.map +1 -0
- package/dist/discovery/validators/index.d.ts +2 -0
- package/dist/discovery/validators/index.d.ts.map +1 -0
- package/dist/discovery/validators/index.js +2 -0
- package/dist/discovery/validators/index.js.map +1 -0
- package/dist/discovery/validators/upgrade-validator.d.ts +34 -0
- package/dist/discovery/validators/upgrade-validator.d.ts.map +1 -0
- package/dist/discovery/validators/upgrade-validator.js +135 -0
- package/dist/discovery/validators/upgrade-validator.js.map +1 -0
- package/dist/docs/docs-client.d.ts +44 -0
- package/dist/docs/docs-client.d.ts.map +1 -0
- package/dist/docs/docs-client.js +161 -0
- package/dist/docs/docs-client.js.map +1 -0
- package/dist/docs/docs-context.d.ts +23 -0
- package/dist/docs/docs-context.d.ts.map +1 -0
- package/dist/docs/docs-context.js +41 -0
- package/dist/docs/docs-context.js.map +1 -0
- package/dist/docs/index.d.ts +4 -0
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +3 -0
- package/dist/docs/index.js.map +1 -0
- package/dist/docs/types.d.ts +27 -0
- package/dist/docs/types.d.ts.map +1 -0
- package/dist/docs/types.js +2 -0
- package/dist/docs/types.js.map +1 -0
- package/dist/execution/diff-presenter.d.ts +52 -0
- package/dist/execution/diff-presenter.d.ts.map +1 -0
- package/dist/execution/diff-presenter.js +148 -0
- package/dist/execution/diff-presenter.js.map +1 -0
- package/dist/execution/executors/ai-assisted.d.ts +28 -0
- package/dist/execution/executors/ai-assisted.d.ts.map +1 -0
- package/dist/execution/executors/ai-assisted.js +226 -0
- package/dist/execution/executors/ai-assisted.js.map +1 -0
- package/dist/execution/executors/automated.d.ts +15 -0
- package/dist/execution/executors/automated.d.ts.map +1 -0
- package/dist/execution/executors/automated.js +37 -0
- package/dist/execution/executors/automated.js.map +1 -0
- package/dist/execution/executors/cv-gate.d.ts +23 -0
- package/dist/execution/executors/cv-gate.d.ts.map +1 -0
- package/dist/execution/executors/cv-gate.js +63 -0
- package/dist/execution/executors/cv-gate.js.map +1 -0
- package/dist/execution/executors/index.d.ts +7 -0
- package/dist/execution/executors/index.d.ts.map +1 -0
- package/dist/execution/executors/index.js +7 -0
- package/dist/execution/executors/index.js.map +1 -0
- package/dist/execution/executors/manual.d.ts +18 -0
- package/dist/execution/executors/manual.d.ts.map +1 -0
- package/dist/execution/executors/manual.js +31 -0
- package/dist/execution/executors/manual.js.map +1 -0
- package/dist/execution/executors/override-resolution.d.ts +27 -0
- package/dist/execution/executors/override-resolution.d.ts.map +1 -0
- package/dist/execution/executors/override-resolution.js +79 -0
- package/dist/execution/executors/override-resolution.js.map +1 -0
- package/dist/execution/executors/version-bump.d.ts +20 -0
- package/dist/execution/executors/version-bump.d.ts.map +1 -0
- package/dist/execution/executors/version-bump.js +65 -0
- package/dist/execution/executors/version-bump.js.map +1 -0
- package/dist/execution/file-transformer.d.ts +25 -0
- package/dist/execution/file-transformer.d.ts.map +1 -0
- package/dist/execution/file-transformer.js +74 -0
- package/dist/execution/file-transformer.js.map +1 -0
- package/dist/execution/index.d.ts +7 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +9 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/state-manager.d.ts +27 -0
- package/dist/execution/state-manager.d.ts.map +1 -0
- package/dist/execution/state-manager.js +48 -0
- package/dist/execution/state-manager.js.map +1 -0
- package/dist/execution/step-executor.d.ts +68 -0
- package/dist/execution/step-executor.d.ts.map +1 -0
- package/dist/execution/step-executor.js +243 -0
- package/dist/execution/step-executor.js.map +1 -0
- package/dist/execution/types.d.ts +92 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/execution/types.js +2 -0
- package/dist/execution/types.js.map +1 -0
- package/dist/guide/GuideRunner.d.ts +62 -0
- package/dist/guide/GuideRunner.d.ts.map +1 -0
- package/dist/guide/GuideRunner.js +390 -0
- package/dist/guide/GuideRunner.js.map +1 -0
- package/dist/guide/chat/ChatContextBuilder.d.ts +44 -0
- package/dist/guide/chat/ChatContextBuilder.d.ts.map +1 -0
- package/dist/guide/chat/ChatContextBuilder.js +121 -0
- package/dist/guide/chat/ChatContextBuilder.js.map +1 -0
- package/dist/guide/chat/ChatLoop.d.ts +18 -0
- package/dist/guide/chat/ChatLoop.d.ts.map +1 -0
- package/dist/guide/chat/ChatLoop.js +59 -0
- package/dist/guide/chat/ChatLoop.js.map +1 -0
- package/dist/guide/chat/StepCoach.d.ts +22 -0
- package/dist/guide/chat/StepCoach.d.ts.map +1 -0
- package/dist/guide/chat/StepCoach.js +39 -0
- package/dist/guide/chat/StepCoach.js.map +1 -0
- package/dist/guide/chat/index.d.ts +4 -0
- package/dist/guide/chat/index.d.ts.map +1 -0
- package/dist/guide/chat/index.js +4 -0
- package/dist/guide/chat/index.js.map +1 -0
- package/dist/guide/index.d.ts +3 -0
- package/dist/guide/index.d.ts.map +1 -0
- package/dist/guide/index.js +2 -0
- package/dist/guide/index.js.map +1 -0
- package/dist/guide/phases/DiscoveryPhase.d.ts +30 -0
- package/dist/guide/phases/DiscoveryPhase.d.ts.map +1 -0
- package/dist/guide/phases/DiscoveryPhase.js +238 -0
- package/dist/guide/phases/DiscoveryPhase.js.map +1 -0
- package/dist/guide/phases/ExecutionPhase.d.ts +80 -0
- package/dist/guide/phases/ExecutionPhase.d.ts.map +1 -0
- package/dist/guide/phases/ExecutionPhase.js +574 -0
- package/dist/guide/phases/ExecutionPhase.js.map +1 -0
- package/dist/guide/phases/PlanPhase.d.ts +22 -0
- package/dist/guide/phases/PlanPhase.d.ts.map +1 -0
- package/dist/guide/phases/PlanPhase.js +200 -0
- package/dist/guide/phases/PlanPhase.js.map +1 -0
- package/dist/guide/phases/index.d.ts +4 -0
- package/dist/guide/phases/index.d.ts.map +1 -0
- package/dist/guide/phases/index.js +4 -0
- package/dist/guide/phases/index.js.map +1 -0
- package/dist/guide/rendering/formatters.d.ts +126 -0
- package/dist/guide/rendering/formatters.d.ts.map +1 -0
- package/dist/guide/rendering/formatters.js +340 -0
- package/dist/guide/rendering/formatters.js.map +1 -0
- package/dist/guide/rendering/index.d.ts +2 -0
- package/dist/guide/rendering/index.d.ts.map +1 -0
- package/dist/guide/rendering/index.js +2 -0
- package/dist/guide/rendering/index.js.map +1 -0
- package/dist/guide/rendering/platform-changes.d.ts +18 -0
- package/dist/guide/rendering/platform-changes.d.ts.map +1 -0
- package/dist/guide/rendering/platform-changes.js +86 -0
- package/dist/guide/rendering/platform-changes.js.map +1 -0
- package/dist/guide/types.d.ts +100 -0
- package/dist/guide/types.d.ts.map +1 -0
- package/dist/guide/types.js +2 -0
- package/dist/guide/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +138 -0
- package/dist/index.js.map +1 -0
- package/dist/manifests/maven-settings.d.ts +7 -0
- package/dist/manifests/maven-settings.d.ts.map +1 -0
- package/dist/manifests/maven-settings.js +33 -0
- package/dist/manifests/maven-settings.js.map +1 -0
- package/dist/manifests/parent-properties.d.ts +12 -0
- package/dist/manifests/parent-properties.d.ts.map +1 -0
- package/dist/manifests/parent-properties.js +28 -0
- package/dist/manifests/parent-properties.js.map +1 -0
- package/dist/manifests/schema.json +198 -0
- package/dist/manifests/unreleased.yaml +3 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +13 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/resources/index.d.ts +32 -0
- package/dist/mcp/resources/index.d.ts.map +1 -0
- package/dist/mcp/resources/index.js +55 -0
- package/dist/mcp/resources/index.js.map +1 -0
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +162 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/complete-step.d.ts +26 -0
- package/dist/mcp/tools/complete-step.d.ts.map +1 -0
- package/dist/mcp/tools/complete-step.js +73 -0
- package/dist/mcp/tools/complete-step.js.map +1 -0
- package/dist/mcp/tools/create-upgrade-plan.d.ts +36 -0
- package/dist/mcp/tools/create-upgrade-plan.d.ts.map +1 -0
- package/dist/mcp/tools/create-upgrade-plan.js +143 -0
- package/dist/mcp/tools/create-upgrade-plan.js.map +1 -0
- package/dist/mcp/tools/discover-project.d.ts +33 -0
- package/dist/mcp/tools/discover-project.d.ts.map +1 -0
- package/dist/mcp/tools/discover-project.js +96 -0
- package/dist/mcp/tools/discover-project.js.map +1 -0
- package/dist/mcp/tools/get-next-step.d.ts +54 -0
- package/dist/mcp/tools/get-next-step.d.ts.map +1 -0
- package/dist/mcp/tools/get-next-step.js +110 -0
- package/dist/mcp/tools/get-next-step.js.map +1 -0
- package/dist/mcp/tools/get-upgrade-status.d.ts +25 -0
- package/dist/mcp/tools/get-upgrade-status.d.ts.map +1 -0
- package/dist/mcp/tools/get-upgrade-status.js +79 -0
- package/dist/mcp/tools/get-upgrade-status.js.map +1 -0
- package/dist/mcp/tools/upgrade-targets.d.ts +19 -0
- package/dist/mcp/tools/upgrade-targets.d.ts.map +1 -0
- package/dist/mcp/tools/upgrade-targets.js +132 -0
- package/dist/mcp/tools/upgrade-targets.js.map +1 -0
- package/dist/planning/ai-analyzer.d.ts +20 -0
- package/dist/planning/ai-analyzer.d.ts.map +1 -0
- package/dist/planning/ai-analyzer.js +97 -0
- package/dist/planning/ai-analyzer.js.map +1 -0
- package/dist/planning/index.d.ts +8 -0
- package/dist/planning/index.d.ts.map +1 -0
- package/dist/planning/index.js +13 -0
- package/dist/planning/index.js.map +1 -0
- package/dist/planning/manifest-loader.d.ts +54 -0
- package/dist/planning/manifest-loader.d.ts.map +1 -0
- package/dist/planning/manifest-loader.js +233 -0
- package/dist/planning/manifest-loader.js.map +1 -0
- package/dist/planning/manifest-schema.d.ts +41 -0
- package/dist/planning/manifest-schema.d.ts.map +1 -0
- package/dist/planning/manifest-schema.js +71 -0
- package/dist/planning/manifest-schema.js.map +1 -0
- package/dist/planning/override-analyzer.d.ts +12 -0
- package/dist/planning/override-analyzer.d.ts.map +1 -0
- package/dist/planning/override-analyzer.js +42 -0
- package/dist/planning/override-analyzer.js.map +1 -0
- package/dist/planning/plan-generator.d.ts +15 -0
- package/dist/planning/plan-generator.d.ts.map +1 -0
- package/dist/planning/plan-generator.js +250 -0
- package/dist/planning/plan-generator.js.map +1 -0
- package/dist/planning/project-matcher.d.ts +65 -0
- package/dist/planning/project-matcher.d.ts.map +1 -0
- package/dist/planning/project-matcher.js +265 -0
- package/dist/planning/project-matcher.js.map +1 -0
- package/dist/planning/types.d.ts +237 -0
- package/dist/planning/types.d.ts.map +1 -0
- package/dist/planning/types.js +2 -0
- package/dist/planning/types.js.map +1 -0
- package/dist/types/index.d.ts +90 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/command-helpers.d.ts +14 -0
- package/dist/utils/command-helpers.d.ts.map +1 -0
- package/dist/utils/command-helpers.js +18 -0
- package/dist/utils/command-helpers.js.map +1 -0
- package/dist/utils/diff.d.ts +42 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/diff.js +80 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/error.d.ts +5 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +8 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/fs.d.ts +50 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +117 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +31 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +62 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/output-writer.d.ts +26 -0
- package/dist/utils/output-writer.d.ts.map +1 -0
- package/dist/utils/output-writer.js +62 -0
- package/dist/utils/output-writer.js.map +1 -0
- package/dist/utils/pom-parser.d.ts +94 -0
- package/dist/utils/pom-parser.d.ts.map +1 -0
- package/dist/utils/pom-parser.js +120 -0
- package/dist/utils/pom-parser.js.map +1 -0
- package/dist/utils/spinner.d.ts +35 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +46 -0
- package/dist/utils/spinner.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Categories of quality issues found during manifest entry critique.
|
|
3
|
+
*/
|
|
4
|
+
export type CritiqueCategory = 'file_targeting' | 'decomposition' | 'guidance_quality' | 'automation_level' | 'pattern_quality' | 'informational_classification';
|
|
5
|
+
/**
|
|
6
|
+
* Severity of a critique issue.
|
|
7
|
+
* - error: entry should be regenerated
|
|
8
|
+
* - warning: entry is kept but flagged in report
|
|
9
|
+
* - info: minor note, no action needed
|
|
10
|
+
*/
|
|
11
|
+
export type CritiqueSeverity = 'error' | 'warning' | 'info';
|
|
12
|
+
/**
|
|
13
|
+
* A single quality issue found during critique.
|
|
14
|
+
*/
|
|
15
|
+
export interface CritiqueIssue {
|
|
16
|
+
severity: CritiqueSeverity;
|
|
17
|
+
category: CritiqueCategory;
|
|
18
|
+
description: string;
|
|
19
|
+
suggestion: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Overall quality assessment of a manifest entry.
|
|
23
|
+
*/
|
|
24
|
+
export type OverallQuality = 'good' | 'needs_improvement' | 'regenerate';
|
|
25
|
+
/**
|
|
26
|
+
* Result of the AI critique stage.
|
|
27
|
+
*/
|
|
28
|
+
export interface CritiqueResult {
|
|
29
|
+
issues: CritiqueIssue[];
|
|
30
|
+
overallQuality: OverallQuality;
|
|
31
|
+
shouldSplit: boolean;
|
|
32
|
+
suggestedSplits?: string[];
|
|
33
|
+
shouldBeInformational: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Tracking record for a single entry through the QA pipeline.
|
|
37
|
+
*/
|
|
38
|
+
export interface QARecord {
|
|
39
|
+
entryId: string;
|
|
40
|
+
originalEntry: unknown;
|
|
41
|
+
critique: CritiqueResult;
|
|
42
|
+
regenerated: boolean;
|
|
43
|
+
split: boolean;
|
|
44
|
+
splitCount?: number;
|
|
45
|
+
heuristicFixes: string[];
|
|
46
|
+
finalQuality: OverallQuality;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Summary of a quality report for one manifest.
|
|
50
|
+
*/
|
|
51
|
+
export interface QualityReportSummary {
|
|
52
|
+
entriesProcessed: number;
|
|
53
|
+
passed: number;
|
|
54
|
+
improved: number;
|
|
55
|
+
regenerated: number;
|
|
56
|
+
splitCount: number;
|
|
57
|
+
finalEntryCount: number;
|
|
58
|
+
informationalReclassifications: number;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=critique-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critique-types.d.ts","sourceRoot":"","sources":["../../src/capture/critique-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,8BAA8B,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,mBAAmB,GAAG,YAAY,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,cAAc,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,8BAA8B,EAAE,MAAM,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critique-types.js","sourceRoot":"","sources":["../../src/capture/critique-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AIClient } from '../ai/types.js';
|
|
2
|
+
import type { ManifestEntry } from '../planning/types.js';
|
|
3
|
+
import type { CritiqueResult } from './critique-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the AI critique prompt for a manifest entry.
|
|
6
|
+
*
|
|
7
|
+
* @param entry - The manifest entry to critique
|
|
8
|
+
* @param changeDocContent - The original change document content
|
|
9
|
+
* @returns A prompt string for the AI critique model
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildCritiquePrompt(entry: ManifestEntry, changeDocContent: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Safely parses an AI critique response into a CritiqueResult.
|
|
14
|
+
* Strips markdown code fences, parses JSON, and validates the structure.
|
|
15
|
+
* Returns a safe default on any parse or validation failure.
|
|
16
|
+
*
|
|
17
|
+
* @param text - Raw AI response text
|
|
18
|
+
* @returns A validated CritiqueResult
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseCritiqueResult(text: string): CritiqueResult;
|
|
21
|
+
/**
|
|
22
|
+
* Runs an AI self-critique of a manifest entry against its source change document.
|
|
23
|
+
*
|
|
24
|
+
* @param entry - The manifest entry to critique
|
|
25
|
+
* @param changeDocContent - The original change document content
|
|
26
|
+
* @param aiClient - The AI client to use
|
|
27
|
+
* @returns A CritiqueResult with quality issues and overall assessment
|
|
28
|
+
*/
|
|
29
|
+
export declare function critiqueEntry(entry: ManifestEntry, changeDocContent: string, aiClient: AIClient): Promise<CritiqueResult>;
|
|
30
|
+
//# sourceMappingURL=entry-critique.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-critique.d.ts","sourceRoot":"","sources":["../../src/capture/entry-critique.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAW1E;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAwD1F;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAsDhE;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,aAAa,EACpB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,cAAc,CAAC,CASzB"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
const VALID_OVERALL_QUALITY = ['good', 'needs_improvement', 'regenerate'];
|
|
2
|
+
const SAFE_DEFAULT = {
|
|
3
|
+
issues: [],
|
|
4
|
+
overallQuality: 'good',
|
|
5
|
+
shouldSplit: false,
|
|
6
|
+
shouldBeInformational: false,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Builds the AI critique prompt for a manifest entry.
|
|
10
|
+
*
|
|
11
|
+
* @param entry - The manifest entry to critique
|
|
12
|
+
* @param changeDocContent - The original change document content
|
|
13
|
+
* @returns A prompt string for the AI critique model
|
|
14
|
+
*/
|
|
15
|
+
export function buildCritiquePrompt(entry, changeDocContent) {
|
|
16
|
+
const entryJson = JSON.stringify(entry, null, 2);
|
|
17
|
+
return `You are a quality reviewer for brXM upgrade manifest entries. Critique the given manifest entry against the original change document and return a structured quality assessment.
|
|
18
|
+
|
|
19
|
+
## Manifest Entry
|
|
20
|
+
\`\`\`json
|
|
21
|
+
${entryJson}
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
## Original Change Document
|
|
25
|
+
${changeDocContent}
|
|
26
|
+
|
|
27
|
+
## Critique Checklist
|
|
28
|
+
|
|
29
|
+
Evaluate the entry against each of the following 6 checks:
|
|
30
|
+
|
|
31
|
+
1. **File Targeting** (file_targeting): Are the file_globs or detection_patterns precise enough? Too-broad globs (e.g. \`**/*.java\`) risk false positives; too-narrow globs miss affected files.
|
|
32
|
+
|
|
33
|
+
2. **Pattern Quality** (pattern_quality): For automatable entries, are the match/replace patterns correct and safe? Check for regex escaping, unintended replacements, and edge cases.
|
|
34
|
+
|
|
35
|
+
3. **Decomposition** (decomposition): Does this entry cover multiple independent concerns that should be separate entries? Flag if the change could be meaningfully split into smaller, focused steps.
|
|
36
|
+
|
|
37
|
+
4. **Guidance Coherence** (guidance_coherence): For partial/manual entries, is the ai_guidance or manual_steps clear, actionable, and consistent with the change document?
|
|
38
|
+
|
|
39
|
+
5. **Automation Level** (automation_level): Is the automatable level correct? Flag if a manual entry could be automated, or if an automated entry requires human judgment.
|
|
40
|
+
|
|
41
|
+
6. **Informational Classification** (informational_classification): Should this entry be marked informational (i.e. no direct code action needed, just awareness)? Flag if the change is purely informational but missing the informational flag.
|
|
42
|
+
|
|
43
|
+
## Quality Thresholds
|
|
44
|
+
|
|
45
|
+
- Any issue with severity **error** → overallQuality must be **regenerate**
|
|
46
|
+
- Only issues with severity **warning** (no errors) → overallQuality must be **needs_improvement**
|
|
47
|
+
- No issues, or only **info** severity → overallQuality must be **good**
|
|
48
|
+
|
|
49
|
+
## Output Format
|
|
50
|
+
|
|
51
|
+
Respond with ONLY a JSON object matching this structure:
|
|
52
|
+
\`\`\`json
|
|
53
|
+
{
|
|
54
|
+
"issues": [
|
|
55
|
+
{
|
|
56
|
+
"severity": "error" | "warning" | "info",
|
|
57
|
+
"category": "file_targeting" | "pattern_quality" | "decomposition" | "guidance_coherence" | "automation_level" | "informational_classification",
|
|
58
|
+
"description": "What is wrong",
|
|
59
|
+
"suggestion": "How to fix it"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"overallQuality": "good" | "needs_improvement" | "regenerate",
|
|
63
|
+
"shouldSplit": true | false,
|
|
64
|
+
"suggestedSplits": ["description of split 1", "description of split 2"],
|
|
65
|
+
"shouldBeInformational": true | false
|
|
66
|
+
}
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
Include \`suggestedSplits\` only when \`shouldSplit\` is true. Respond with ONLY the JSON object, no explanation or markdown fences.`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Safely parses an AI critique response into a CritiqueResult.
|
|
73
|
+
* Strips markdown code fences, parses JSON, and validates the structure.
|
|
74
|
+
* Returns a safe default on any parse or validation failure.
|
|
75
|
+
*
|
|
76
|
+
* @param text - Raw AI response text
|
|
77
|
+
* @returns A validated CritiqueResult
|
|
78
|
+
*/
|
|
79
|
+
export function parseCritiqueResult(text) {
|
|
80
|
+
try {
|
|
81
|
+
// Strip wrapping markdown code fences (e.g. ```json ... ```)
|
|
82
|
+
const fenceMatch = /^\s*```(?:json)?\s*\n([\s\S]*?)\n\s*```\s*$/.exec(text);
|
|
83
|
+
const jsonText = fenceMatch?.[1]?.trim() ?? text.trim();
|
|
84
|
+
const parsed = JSON.parse(jsonText);
|
|
85
|
+
// Validate required fields
|
|
86
|
+
if (!Array.isArray(parsed.issues)) {
|
|
87
|
+
return { ...SAFE_DEFAULT };
|
|
88
|
+
}
|
|
89
|
+
if (typeof parsed.overallQuality !== 'string' ||
|
|
90
|
+
!VALID_OVERALL_QUALITY.includes(parsed.overallQuality)) {
|
|
91
|
+
return { ...SAFE_DEFAULT };
|
|
92
|
+
}
|
|
93
|
+
if (typeof parsed.shouldSplit !== 'boolean') {
|
|
94
|
+
return { ...SAFE_DEFAULT };
|
|
95
|
+
}
|
|
96
|
+
if (typeof parsed.shouldBeInformational !== 'boolean') {
|
|
97
|
+
return { ...SAFE_DEFAULT };
|
|
98
|
+
}
|
|
99
|
+
// Validate individual issue objects have the required shape
|
|
100
|
+
const validatedIssues = parsed.issues.filter((item) => typeof item === 'object' &&
|
|
101
|
+
item !== null &&
|
|
102
|
+
typeof item.severity === 'string' &&
|
|
103
|
+
typeof item.category === 'string' &&
|
|
104
|
+
typeof item.description === 'string' &&
|
|
105
|
+
typeof item.suggestion === 'string');
|
|
106
|
+
const result = {
|
|
107
|
+
issues: validatedIssues,
|
|
108
|
+
overallQuality: parsed.overallQuality,
|
|
109
|
+
shouldSplit: parsed.shouldSplit,
|
|
110
|
+
shouldBeInformational: parsed.shouldBeInformational,
|
|
111
|
+
};
|
|
112
|
+
if (parsed.shouldSplit && Array.isArray(parsed.suggestedSplits)) {
|
|
113
|
+
result.suggestedSplits = parsed.suggestedSplits;
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return { ...SAFE_DEFAULT };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Runs an AI self-critique of a manifest entry against its source change document.
|
|
123
|
+
*
|
|
124
|
+
* @param entry - The manifest entry to critique
|
|
125
|
+
* @param changeDocContent - The original change document content
|
|
126
|
+
* @param aiClient - The AI client to use
|
|
127
|
+
* @returns A CritiqueResult with quality issues and overall assessment
|
|
128
|
+
*/
|
|
129
|
+
export async function critiqueEntry(entry, changeDocContent, aiClient) {
|
|
130
|
+
const prompt = buildCritiquePrompt(entry, changeDocContent);
|
|
131
|
+
const result = await aiClient.generate(prompt, {
|
|
132
|
+
maxTokens: 2048,
|
|
133
|
+
temperature: 0.2,
|
|
134
|
+
});
|
|
135
|
+
return parseCritiqueResult(result.text);
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=entry-critique.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-critique.js","sourceRoot":"","sources":["../../src/capture/entry-critique.ts"],"names":[],"mappings":"AAIA,MAAM,qBAAqB,GAAqB,CAAC,MAAM,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAAC;AAE5F,MAAM,YAAY,GAAmB;IACnC,MAAM,EAAE,EAAE;IACV,cAAc,EAAE,MAAM;IACtB,WAAW,EAAE,KAAK;IAClB,qBAAqB,EAAE,KAAK;CAC7B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAoB,EAAE,gBAAwB;IAChF,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEjD,OAAO;;;;EAIP,SAAS;;;;EAIT,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qIA4CmH,CAAC;AACtI,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,CAAC;QACH,6DAA6D;QAC7D,MAAM,UAAU,GAAG,6CAA6C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5E,MAAM,QAAQ,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAExD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAA4B,CAAC;QAE/D,2BAA2B;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAA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AAC,MAAM,CAAC;QACP,OAAO,EAAE,GAAG,YAAY,EAAE,CAAC;IAC7B,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAoB,EACpB,gBAAwB,EACxB,QAAkB;IAElB,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAE5D,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE;QAC7C,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,GAAG;KACjB,CAAC,CAAC;IAEH,OAAO,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AIClient } from '../ai/types.js';
|
|
2
|
+
import type { ManifestEntry } from '../planning/types.js';
|
|
3
|
+
import type { ChangeDocument } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds a structured prompt for AI to generate a ManifestEntry from a change document.
|
|
6
|
+
*
|
|
7
|
+
* @param doc - The parsed change document to build a prompt for
|
|
8
|
+
* @returns The prompt string for the AI client
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildEntryPrompt(doc: ChangeDocument): string;
|
|
11
|
+
/**
|
|
12
|
+
* Uses an AI client to generate a ManifestEntry from a change document.
|
|
13
|
+
* The generated entry is validated against the ManifestEntry JSON schema.
|
|
14
|
+
*
|
|
15
|
+
* @param doc - The change document to generate an entry for
|
|
16
|
+
* @param aiClient - The AI client to use for generation
|
|
17
|
+
* @returns A validated ManifestEntry
|
|
18
|
+
* @throws Error if the AI returns invalid JSON or the result fails schema validation
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateManifestEntry(doc: ChangeDocument, aiClient: AIClient): Promise<ManifestEntry>;
|
|
21
|
+
/**
|
|
22
|
+
* Coerces known array fields to arrays when the AI returns a non-array value.
|
|
23
|
+
* Handles strings (wrap in array), null/other non-string values (remove), and
|
|
24
|
+
* leaves existing arrays untouched.
|
|
25
|
+
*
|
|
26
|
+
* Removing null is critical: ajv's "type: array" check rejects null with
|
|
27
|
+
* "must be array", but the schema's conditionals make several of these
|
|
28
|
+
* fields only conditionally required — deleting null lets the validator
|
|
29
|
+
* either accept the entry or surface a clearer "missing required" error.
|
|
30
|
+
*/
|
|
31
|
+
export declare function coerceArrayFields(candidate: Record<string, unknown>): void;
|
|
32
|
+
//# sourceMappingURL=entry-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-generator.d.ts","sourceRoot":"","sources":["../../src/capture/entry-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAiF5D;AAkBD;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,aAAa,CAAC,CAkDxB;AAQD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAY1E"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import yaml from 'js-yaml';
|
|
2
|
+
import { validateManifestEntry } from './entry-validator.js';
|
|
3
|
+
/**
|
|
4
|
+
* Builds a structured prompt for AI to generate a ManifestEntry from a change document.
|
|
5
|
+
*
|
|
6
|
+
* @param doc - The parsed change document to build a prompt for
|
|
7
|
+
* @returns The prompt string for the AI client
|
|
8
|
+
*/
|
|
9
|
+
export function buildEntryPrompt(doc) {
|
|
10
|
+
const contextTagsYaml = Object.keys(doc.contextTags).length > 0
|
|
11
|
+
? yaml.dump(doc.contextTags)
|
|
12
|
+
: 'None provided';
|
|
13
|
+
return `You are a software upgrade automation expert. Analyze this change document and generate a single ManifestEntry JSON object.
|
|
14
|
+
|
|
15
|
+
## Change Document
|
|
16
|
+
**File:** ${doc.filename}
|
|
17
|
+
**JIRA:** ${doc.metadata.jiraTicket ?? 'N/A'}
|
|
18
|
+
**Author:** ${doc.metadata.author ?? 'Unknown'}
|
|
19
|
+
**Date:** ${doc.metadata.date ?? 'Unknown'}
|
|
20
|
+
|
|
21
|
+
### Content
|
|
22
|
+
${doc.content}
|
|
23
|
+
|
|
24
|
+
### AI Context Tags
|
|
25
|
+
${contextTagsYaml}
|
|
26
|
+
|
|
27
|
+
## ManifestEntry Schema
|
|
28
|
+
|
|
29
|
+
Generate a JSON object with these fields:
|
|
30
|
+
|
|
31
|
+
- **id** (required): Lowercase kebab-case identifier, e.g. "cms-18384-jakarta-migration"
|
|
32
|
+
- **description** (required): Human-readable description of the change
|
|
33
|
+
- **type** (required): One of: namespace_migration, dependency_migration, maven_update, configuration_migration, api_migration, security_configuration, repository_migration, frontend_migration
|
|
34
|
+
- **automatable** (required): One of: "true" (fully automatable with patterns), "partial" (AI-assisted), "false" (manual only)
|
|
35
|
+
- **jira_ticket**: JIRA ticket reference (e.g. "CMS-18384")
|
|
36
|
+
|
|
37
|
+
When automatable is "true":
|
|
38
|
+
- **patterns** (required): Array of { match, replace } objects for find/replace
|
|
39
|
+
- **file_globs** (required): Array of glob patterns for files to transform
|
|
40
|
+
|
|
41
|
+
When automatable is "partial":
|
|
42
|
+
- **detection_patterns** (required): Array of string patterns to detect if change applies
|
|
43
|
+
- **ai_guidance** (required): Guidance text for AI-assisted migration
|
|
44
|
+
|
|
45
|
+
When automatable is "false":
|
|
46
|
+
- **manual_steps** (required): Array of step-by-step instructions
|
|
47
|
+
|
|
48
|
+
Optional fields:
|
|
49
|
+
- **doc_search_keywords**: Array of 3-5 concise keywords for searching brXM documentation (e.g. ["GalleryProcessor", "convertToRGB", "image upload"]). Use specific class names, API names, config property names, and short topic phrases. Do NOT repeat the entry type or generic words like "migration" or "upgrade".
|
|
50
|
+
- **documentation_url**: Link to documentation
|
|
51
|
+
- **changelog_entry**: Human-readable changelog text
|
|
52
|
+
- **depends_on**: Array of entry IDs this depends on
|
|
53
|
+
- **risk_level**: Integer 1-5 (1=lowest, 5=highest)
|
|
54
|
+
- **informational**: Boolean (default false). Set to true when the change is internal to the platform and requires no project modifications from the customer.
|
|
55
|
+
- **changelog_summary**: One-line summary for the Platform Changes Summary. Required when informational is true.
|
|
56
|
+
- **informational_category**: One of: "security", "performance", "ui_ux", "internal_cleanup", "configuration". Category for grouping. Optional.
|
|
57
|
+
|
|
58
|
+
## Quality Pre-Check
|
|
59
|
+
|
|
60
|
+
Before generating, answer these questions internally:
|
|
61
|
+
|
|
62
|
+
1. SCOPE: Does this change require the customer to modify their project files?
|
|
63
|
+
- If NO → set informational: true, add a changelog_summary one-liner, and use automatable: "false" with manual_steps describing what changed.
|
|
64
|
+
- If YES → continue with actionable entry.
|
|
65
|
+
|
|
66
|
+
2. DECOMPOSITION: Does this change involve multiple independent concerns?
|
|
67
|
+
- Version bump + config change + API change = 3 separate entries.
|
|
68
|
+
- Each entry should have ONE clear action for the developer.
|
|
69
|
+
- If multiple concerns, generate the MOST IMPORTANT one. The pipeline will split if needed.
|
|
70
|
+
|
|
71
|
+
3. FILE TARGETING: What specific files would a developer need to touch?
|
|
72
|
+
- For automatable: file_globs must match PROJECT files, not platform internals.
|
|
73
|
+
- For partial: detection_patterns must match code the DEVELOPER wrote, not platform classes inside jars.
|
|
74
|
+
- Never include binary file extensions (.jpg, .png, .jar, .class).
|
|
75
|
+
|
|
76
|
+
4. GUIDANCE SPECIFICITY: Does the ai_guidance reference the same files the detection_patterns would find?
|
|
77
|
+
- If guidance says "edit FooBar.java" but patterns don't detect it → there's a mismatch.
|
|
78
|
+
|
|
79
|
+
## Rules
|
|
80
|
+
1. The id must be lowercase, kebab-case, derived from the JIRA ticket and a short descriptor
|
|
81
|
+
2. Determine automatable level based on the change complexity and type
|
|
82
|
+
3. For breaking API changes with clear patterns, prefer automatable: "true"
|
|
83
|
+
4. For complex changes needing judgment, use automatable: "partial"
|
|
84
|
+
5. For configuration/verification tasks, use automatable: "false"
|
|
85
|
+
6. Always include a changelog_entry
|
|
86
|
+
7. Always include doc_search_keywords with 3-5 specific, searchable terms
|
|
87
|
+
|
|
88
|
+
Respond with ONLY the JSON object, no explanation or markdown fences.`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Extracts JSON from AI response text, handling optional markdown code fences.
|
|
92
|
+
*
|
|
93
|
+
* @param text - Raw AI response text
|
|
94
|
+
* @returns Cleaned JSON string
|
|
95
|
+
*/
|
|
96
|
+
function extractJson(text) {
|
|
97
|
+
// Only strip code fences that wrap the entire response (anchored to start/end),
|
|
98
|
+
// not fences embedded inside JSON string values (e.g. ```java blocks in ai_guidance)
|
|
99
|
+
const fenceMatch = /^\s*```(?:json)?\s*\n([\s\S]*?)\n\s*```\s*$/.exec(text);
|
|
100
|
+
if (fenceMatch?.[1]) {
|
|
101
|
+
return fenceMatch[1].trim();
|
|
102
|
+
}
|
|
103
|
+
return text.trim();
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Uses an AI client to generate a ManifestEntry from a change document.
|
|
107
|
+
* The generated entry is validated against the ManifestEntry JSON schema.
|
|
108
|
+
*
|
|
109
|
+
* @param doc - The change document to generate an entry for
|
|
110
|
+
* @param aiClient - The AI client to use for generation
|
|
111
|
+
* @returns A validated ManifestEntry
|
|
112
|
+
* @throws Error if the AI returns invalid JSON or the result fails schema validation
|
|
113
|
+
*/
|
|
114
|
+
export async function generateManifestEntry(doc, aiClient) {
|
|
115
|
+
const prompt = buildEntryPrompt(doc);
|
|
116
|
+
const result = await aiClient.generate(prompt, {
|
|
117
|
+
maxTokens: 4096,
|
|
118
|
+
temperature: 0.3,
|
|
119
|
+
system: 'You are a JSON generator. Output only valid JSON matching the requested schema. No explanations.',
|
|
120
|
+
});
|
|
121
|
+
const jsonText = extractJson(result.text);
|
|
122
|
+
let parsed;
|
|
123
|
+
try {
|
|
124
|
+
parsed = JSON.parse(jsonText);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
throw new Error(`AI returned invalid JSON for ${doc.filename}. Response: ${result.text.slice(0, 200)}`);
|
|
128
|
+
}
|
|
129
|
+
// AI occasionally returns an array instead of a single object — unwrap it
|
|
130
|
+
if (Array.isArray(parsed)) {
|
|
131
|
+
if (parsed.length === 0) {
|
|
132
|
+
throw new Error(`AI returned an empty array for ${doc.filename}`);
|
|
133
|
+
}
|
|
134
|
+
parsed = parsed[0];
|
|
135
|
+
}
|
|
136
|
+
// Sanitize the id to match the schema pattern ^[a-z0-9-]+$
|
|
137
|
+
// AI sometimes includes dots (version numbers), underscores, or uppercase
|
|
138
|
+
const candidate = parsed;
|
|
139
|
+
if (typeof candidate.id === 'string') {
|
|
140
|
+
candidate.id = candidate.id
|
|
141
|
+
.toLowerCase()
|
|
142
|
+
.replace(/[^a-z0-9-]/g, '-')
|
|
143
|
+
.replace(/-{2,}/g, '-')
|
|
144
|
+
.replace(/^-|-$/g, '');
|
|
145
|
+
}
|
|
146
|
+
coerceArrayFields(candidate);
|
|
147
|
+
validateManifestEntry(candidate);
|
|
148
|
+
const entry = candidate;
|
|
149
|
+
// Ensure doc_search_keywords is always present — derive from entry metadata if AI omitted it
|
|
150
|
+
if (!entry.doc_search_keywords || entry.doc_search_keywords.length === 0) {
|
|
151
|
+
entry.doc_search_keywords = deriveSearchKeywords(entry);
|
|
152
|
+
}
|
|
153
|
+
return entry;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Schema fields that must be arrays. If the AI returns a scalar string,
|
|
157
|
+
* wrap it in a single-element array to avoid validation failure.
|
|
158
|
+
*/
|
|
159
|
+
const ARRAY_FIELDS = ['file_globs', 'detection_patterns', 'manual_steps', 'doc_search_keywords'];
|
|
160
|
+
/**
|
|
161
|
+
* Coerces known array fields to arrays when the AI returns a non-array value.
|
|
162
|
+
* Handles strings (wrap in array), null/other non-string values (remove), and
|
|
163
|
+
* leaves existing arrays untouched.
|
|
164
|
+
*
|
|
165
|
+
* Removing null is critical: ajv's "type: array" check rejects null with
|
|
166
|
+
* "must be array", but the schema's conditionals make several of these
|
|
167
|
+
* fields only conditionally required — deleting null lets the validator
|
|
168
|
+
* either accept the entry or surface a clearer "missing required" error.
|
|
169
|
+
*/
|
|
170
|
+
export function coerceArrayFields(candidate) {
|
|
171
|
+
for (const field of ARRAY_FIELDS) {
|
|
172
|
+
const value = candidate[field];
|
|
173
|
+
if (value === undefined || Array.isArray(value))
|
|
174
|
+
continue;
|
|
175
|
+
if (typeof value === 'string') {
|
|
176
|
+
candidate[field] = [value];
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
// null, object, number, boolean — remove it and let schema validation
|
|
180
|
+
// decide if the field was required by the entry's shape.
|
|
181
|
+
delete candidate[field];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Derives documentation search keywords from an entry's id, description, and type
|
|
187
|
+
* when the AI fails to generate them.
|
|
188
|
+
*/
|
|
189
|
+
function deriveSearchKeywords(entry) {
|
|
190
|
+
const keywords = [];
|
|
191
|
+
// Extract meaningful words from the id (strip jira prefix and split kebab-case)
|
|
192
|
+
const idWords = entry.id
|
|
193
|
+
.replace(/^[a-z]+-\d+-/, '')
|
|
194
|
+
.split('-')
|
|
195
|
+
.filter((w) => w.length > 2);
|
|
196
|
+
keywords.push(...idWords.slice(0, 3));
|
|
197
|
+
// Add the entry type as a keyword (e.g. "api migration")
|
|
198
|
+
const typeWords = entry.type.replace(/_/g, ' ');
|
|
199
|
+
keywords.push(typeWords);
|
|
200
|
+
// Extract capitalized terms from description (likely class/API names)
|
|
201
|
+
const capitalizedTerms = entry.description.match(/[A-Z][a-zA-Z]{2,}/g) ?? [];
|
|
202
|
+
for (const term of capitalizedTerms.slice(0, 2)) {
|
|
203
|
+
if (!keywords.includes(term)) {
|
|
204
|
+
keywords.push(term);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return keywords.slice(0, 5);
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=entry-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-generator.js","sourceRoot":"","sources":["../../src/capture/entry-generator.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAG3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7D;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAmB;IAClD,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC;QAC7D,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC;QAC5B,CAAC,CAAC,eAAe,CAAC;IAEpB,OAAO;;;YAGG,GAAG,CAAC,QAAQ;YACZ,GAAG,CAAC,QAAQ,CAAC,UAAU,IAAI,KAAK;cAC9B,GAAG,CAAC,QAAQ,CAAC,MAAM,IAAI,SAAS;YAClC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,SAAS;;;EAGxC,GAAG,CAAC,OAAO;;;EAGX,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sEA+DqD,CAAC;AACvE,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,IAAY;IAC/B,gFAAgF;IAChF,qFAAqF;IACrF,MAAM,UAAU,GAAG,6CAA6C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5E,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,UAAU,CAA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AO,CAAC,cAAc,EAAE,EAAE,CAAC;SAC3B,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEtC,yDAAyD;IACzD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAChD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEzB,sEAAsE;IACtE,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;IAC7E,KAAK,MAAM,IAAI,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAChD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AIClient } from '../ai/types.js';
|
|
2
|
+
import type { ManifestEntry } from '../planning/types.js';
|
|
3
|
+
import type { QARecord } from './critique-types.js';
|
|
4
|
+
import type { ChangeDocument } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Result of the full QA pipeline for a single change document.
|
|
7
|
+
*/
|
|
8
|
+
export interface GenerateAndReviewResult {
|
|
9
|
+
/** Final manifest entries (may be more than one if the entry was split) */
|
|
10
|
+
entries: ManifestEntry[];
|
|
11
|
+
/** Tracking record for this entry through the QA pipeline */
|
|
12
|
+
qaRecord: QARecord;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Runs the full manifest-entry QA pipeline for a single change document:
|
|
16
|
+
*
|
|
17
|
+
* 1. Generate an initial ManifestEntry from the change document.
|
|
18
|
+
* 2. AI self-critique — assess quality and flag issues.
|
|
19
|
+
* 3. Regenerate if the critique recommends it (overallQuality === 'regenerate' OR shouldSplit).
|
|
20
|
+
* 4. Apply heuristic backstop fixes to every final entry.
|
|
21
|
+
* 5. Build and return a QARecord alongside the final entries.
|
|
22
|
+
*
|
|
23
|
+
* @param doc - The parsed change document to process
|
|
24
|
+
* @param aiClient - AI client used for all generation/critique/regeneration calls
|
|
25
|
+
* @returns Final entries and a QA tracking record
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateAndReviewEntry(doc: ChangeDocument, aiClient: AIClient): Promise<GenerateAndReviewResult>;
|
|
28
|
+
//# sourceMappingURL=entry-qa.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-qa.d.ts","sourceRoot":"","sources":["../../src/capture/entry-qa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,QAAQ,EAAkB,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,2EAA2E;IAC3E,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,6DAA6D;IAC7D,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,uBAAuB,CAAC,CA8ElC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { generateManifestEntry } from './entry-generator.js';
|
|
2
|
+
import { critiqueEntry } from './entry-critique.js';
|
|
3
|
+
import { regenerateEntry } from './entry-regeneration.js';
|
|
4
|
+
import { applyHeuristicFixes } from './heuristics.js';
|
|
5
|
+
/**
|
|
6
|
+
* Runs the full manifest-entry QA pipeline for a single change document:
|
|
7
|
+
*
|
|
8
|
+
* 1. Generate an initial ManifestEntry from the change document.
|
|
9
|
+
* 2. AI self-critique — assess quality and flag issues.
|
|
10
|
+
* 3. Regenerate if the critique recommends it (overallQuality === 'regenerate' OR shouldSplit).
|
|
11
|
+
* 4. Apply heuristic backstop fixes to every final entry.
|
|
12
|
+
* 5. Build and return a QARecord alongside the final entries.
|
|
13
|
+
*
|
|
14
|
+
* @param doc - The parsed change document to process
|
|
15
|
+
* @param aiClient - AI client used for all generation/critique/regeneration calls
|
|
16
|
+
* @returns Final entries and a QA tracking record
|
|
17
|
+
*/
|
|
18
|
+
export async function generateAndReviewEntry(doc, aiClient) {
|
|
19
|
+
// Pre-check: detect hallucinated change documents (wrong JIRA ticket in content).
|
|
20
|
+
// Only flag when the content explicitly references a DIFFERENT JIRA ticket in
|
|
21
|
+
// its header area — don't flag content that simply omits any JIRA reference.
|
|
22
|
+
if (doc.metadata.jiraTicket) {
|
|
23
|
+
const expectedTicket = doc.metadata.jiraTicket;
|
|
24
|
+
const contentHead = doc.content.slice(0, 500);
|
|
25
|
+
const jiraRefs = contentHead.match(/[A-Z]+-\d+/g) ?? [];
|
|
26
|
+
const hasAlienJira = jiraRefs.length > 0
|
|
27
|
+
&& !jiraRefs.includes(expectedTicket);
|
|
28
|
+
if (hasAlienJira) {
|
|
29
|
+
throw new Error(`Change document ${doc.filename} appears to be about ${jiraRefs[0]} instead of ${expectedTicket} (hallucinated content)`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Step 1: Generate initial entry
|
|
33
|
+
const initialEntry = await generateManifestEntry(doc, aiClient);
|
|
34
|
+
// Capture a snapshot of the original entry before any mutations
|
|
35
|
+
const originalEntry = JSON.parse(JSON.stringify(initialEntry));
|
|
36
|
+
// Step 2: AI self-critique
|
|
37
|
+
const critique = await critiqueEntry(initialEntry, doc.content, aiClient);
|
|
38
|
+
// Step 3: Regenerate if needed
|
|
39
|
+
const needsRegeneration = critique.overallQuality === 'regenerate' || critique.shouldSplit;
|
|
40
|
+
let finalEntries;
|
|
41
|
+
let regenerated = false;
|
|
42
|
+
if (needsRegeneration) {
|
|
43
|
+
finalEntries = await regenerateEntry(initialEntry, doc.content, critique, aiClient);
|
|
44
|
+
regenerated = true;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
finalEntries = [initialEntry];
|
|
48
|
+
}
|
|
49
|
+
// Step 4: Apply heuristic backstop to every final entry
|
|
50
|
+
const allHeuristicFixes = [];
|
|
51
|
+
for (const entry of finalEntries) {
|
|
52
|
+
const fixes = applyHeuristicFixes(entry);
|
|
53
|
+
for (const fix of fixes) {
|
|
54
|
+
allHeuristicFixes.push(fix.description);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Step 5: Determine final quality
|
|
58
|
+
const hasHeuristicFixes = allHeuristicFixes.length > 0;
|
|
59
|
+
let finalQuality;
|
|
60
|
+
if (critique.overallQuality === 'good' && !hasHeuristicFixes && !regenerated) {
|
|
61
|
+
finalQuality = 'good';
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
finalQuality = 'needs_improvement';
|
|
65
|
+
}
|
|
66
|
+
// Determine split information
|
|
67
|
+
const split = critique.shouldSplit && finalEntries.length > 1;
|
|
68
|
+
const splitCount = split ? finalEntries.length : undefined;
|
|
69
|
+
const qaRecord = {
|
|
70
|
+
entryId: originalEntry.id,
|
|
71
|
+
originalEntry,
|
|
72
|
+
critique,
|
|
73
|
+
regenerated,
|
|
74
|
+
split,
|
|
75
|
+
...(splitCount !== undefined ? { splitCount } : {}),
|
|
76
|
+
heuristicFixes: allHeuristicFixes,
|
|
77
|
+
finalQuality,
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
entries: finalEntries,
|
|
81
|
+
qaRecord,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=entry-qa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-qa.js","sourceRoot":"","sources":["../../src/capture/entry-qa.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AActD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,GAAmB,EACnB,QAAkB;IAElB,kFAAkF;IAClF,8EAA8E;IAC9E,6EAA6E;IAC7E,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC5B,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC/C,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAa,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QAClE,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC;eACnC,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QACxC,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,mBAAmB,GAAG,CAAC,QAAQ,wBAAwB,QAAQ,CAAC,CAAC,CAAC,eAAe,cAAc,yBAAyB,CACzH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,iCAAiC;IACjC,MAAM,YAAY,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,QA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