@llm-dev-ops/agentics-cli 1.4.59 → 1.4.68
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 +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +167 -0
- package/dist/commands/agents.js.map +1 -1
- package/dist/pipeline/auto-chain.d.ts +1 -0
- package/dist/pipeline/auto-chain.d.ts.map +1 -1
- package/dist/pipeline/auto-chain.js +124 -37
- package/dist/pipeline/auto-chain.js.map +1 -1
- package/dist/pipeline/execution-context.d.ts.map +1 -1
- package/dist/pipeline/execution-context.js +12 -37
- package/dist/pipeline/execution-context.js.map +1 -1
- package/dist/pipeline/phase2/phases/adr-generator.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/adr-generator.js +160 -1
- package/dist/pipeline/phase2/phases/adr-generator.js.map +1 -1
- package/dist/pipeline/phase2/phases/ddd-generator.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/ddd-generator.js +400 -3
- package/dist/pipeline/phase2/phases/ddd-generator.js.map +1 -1
- package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts +43 -0
- package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/ddd-quality-gate.js +413 -0
- package/dist/pipeline/phase2/phases/ddd-quality-gate.js.map +1 -0
- package/dist/pipeline/phase2/phases/research-dossier.d.ts +0 -13
- package/dist/pipeline/phase2/phases/research-dossier.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/research-dossier.js +114 -1
- package/dist/pipeline/phase2/phases/research-dossier.js.map +1 -1
- package/dist/pipeline/phase2/phases/research-quality-gate.d.ts +48 -0
- package/dist/pipeline/phase2/phases/research-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/research-quality-gate.js +322 -0
- package/dist/pipeline/phase2/phases/research-quality-gate.js.map +1 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts +41 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.js +350 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.js.map +1 -0
- package/dist/pipeline/phase2/phases/sparc-specification.d.ts +14 -0
- package/dist/pipeline/phase2/phases/sparc-specification.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/sparc-specification.js +500 -10
- package/dist/pipeline/phase2/phases/sparc-specification.js.map +1 -1
- package/dist/pipeline/phase2/phases/tdd-plan-generator.js +1 -1
- package/dist/pipeline/phase2/phases/tdd-plan-generator.js.map +1 -1
- package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts +72 -0
- package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/tech-stack-detector.js +332 -0
- package/dist/pipeline/phase2/phases/tech-stack-detector.js.map +1 -0
- package/dist/pipeline/phase2/types.d.ts +2 -0
- package/dist/pipeline/phase2/types.d.ts.map +1 -1
- package/dist/pipeline/phase3/phases/domain-codegen.d.ts.map +1 -1
- package/dist/pipeline/phase3/phases/domain-codegen.js +169 -4
- package/dist/pipeline/phase3/phases/domain-codegen.js.map +1 -1
- package/dist/pipeline/phase3/phases/test-generator.d.ts.map +1 -1
- package/dist/pipeline/phase3/phases/test-generator.js +12 -2
- package/dist/pipeline/phase3/phases/test-generator.js.map +1 -1
- package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.d.ts.map +1 -1
- package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js +99 -1
- package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js.map +1 -1
- package/dist/pipeline/phase4/phases/deployment-generator.d.ts +17 -4
- package/dist/pipeline/phase4/phases/deployment-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/deployment-generator.js +364 -44
- package/dist/pipeline/phase4/phases/deployment-generator.js.map +1 -1
- package/dist/pipeline/phase4/phases/erp-client-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/erp-client-generator.js +27 -15
- package/dist/pipeline/phase4/phases/erp-client-generator.js.map +1 -1
- package/dist/pipeline/phase4/phases/erp-target-resolver.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/erp-target-resolver.js +49 -2
- package/dist/pipeline/phase4/phases/erp-target-resolver.js.map +1 -1
- package/dist/pipeline/phase4/phases/http-server-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/http-server-generator.js +263 -3
- package/dist/pipeline/phase4/phases/http-server-generator.js.map +1 -1
- package/dist/pipeline/phase4/phases/infra-adapter-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/infra-adapter-generator.js +335 -37
- package/dist/pipeline/phase4/phases/infra-adapter-generator.js.map +1 -1
- package/dist/pipeline/phase4/types.d.ts +3 -1
- package/dist/pipeline/phase4/types.d.ts.map +1 -1
- package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.d.ts.map +1 -1
- package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js +211 -2
- package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js.map +1 -1
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts +54 -0
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js +417 -0
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js.map +1 -0
- package/dist/pipeline/phases/prompt-generator.js +1 -1
- package/dist/pipeline/phases/prompt-generator.js.map +1 -1
- package/dist/pipeline/ruflo-phase-executor.d.ts +116 -1
- package/dist/pipeline/ruflo-phase-executor.d.ts.map +1 -1
- package/dist/pipeline/ruflo-phase-executor.js +666 -159
- package/dist/pipeline/ruflo-phase-executor.js.map +1 -1
- package/dist/pipeline/swarm-orchestrator.d.ts.map +1 -1
- package/dist/pipeline/swarm-orchestrator.js +62 -6
- package/dist/pipeline/swarm-orchestrator.js.map +1 -1
- package/dist/routing/capability-classifier.d.ts +43 -0
- package/dist/routing/capability-classifier.d.ts.map +1 -0
- package/dist/routing/capability-classifier.js +157 -0
- package/dist/routing/capability-classifier.js.map +1 -0
- package/dist/routing/composition-engine.d.ts +77 -0
- package/dist/routing/composition-engine.d.ts.map +1 -0
- package/dist/routing/composition-engine.js +249 -0
- package/dist/routing/composition-engine.js.map +1 -0
- package/dist/routing/graph-federation.d.ts +71 -0
- package/dist/routing/graph-federation.d.ts.map +1 -0
- package/dist/routing/graph-federation.js +210 -0
- package/dist/routing/graph-federation.js.map +1 -0
- package/dist/routing/graph-loader.d.ts +74 -0
- package/dist/routing/graph-loader.d.ts.map +1 -0
- package/dist/routing/graph-loader.js +383 -0
- package/dist/routing/graph-loader.js.map +1 -0
- package/dist/routing/graph-router.d.ts +103 -0
- package/dist/routing/graph-router.d.ts.map +1 -0
- package/dist/routing/graph-router.js +415 -0
- package/dist/routing/graph-router.js.map +1 -0
- package/dist/routing/graph-validator.d.ts +44 -0
- package/dist/routing/graph-validator.d.ts.map +1 -0
- package/dist/routing/graph-validator.js +329 -0
- package/dist/routing/graph-validator.js.map +1 -0
- package/dist/routing/index.d.ts +52 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +68 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/outcome-recorder.d.ts +71 -0
- package/dist/routing/outcome-recorder.d.ts.map +1 -0
- package/dist/routing/outcome-recorder.js +133 -0
- package/dist/routing/outcome-recorder.js.map +1 -0
- package/dist/routing/weight-adjuster.d.ts +59 -0
- package/dist/routing/weight-adjuster.d.ts.map +1 -0
- package/dist/routing/weight-adjuster.js +167 -0
- package/dist/routing/weight-adjuster.js.map +1 -0
- package/dist/routing/weighted-resolver.d.ts +55 -0
- package/dist/routing/weighted-resolver.d.ts.map +1 -0
- package/dist/routing/weighted-resolver.js +133 -0
- package/dist/routing/weighted-resolver.js.map +1 -0
- package/dist/synthesis/ask-artifact-writer.d.ts.map +1 -1
- package/dist/synthesis/ask-artifact-writer.js +8 -0
- package/dist/synthesis/ask-artifact-writer.js.map +1 -1
- package/dist/synthesis/simulation-artifact-generator.d.ts +14 -0
- package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
- package/dist/synthesis/simulation-artifact-generator.js +224 -1
- package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
- package/dist/synthesis/simulation-renderers.d.ts.map +1 -1
- package/dist/synthesis/simulation-renderers.js +211 -40
- package/dist/synthesis/simulation-renderers.js.map +1 -1
- package/package.json +1 -1
- package/dist/bundled-agents/connector-hub-agents/package-lock.json +0 -11697
- package/dist/bundled-agents/connector-hub-agents/package.json +0 -75
- package/dist/bundled-agents/connector-hub-agents/tsconfig.build.json +0 -22
- package/dist/bundled-agents/connector-hub-agents/tsconfig.json +0 -57
- package/dist/bundled-agents/copilot-agents/functions/.gcloudignore +0 -17
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.d.ts +0 -14
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js +0 -35
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.d.ts +0 -55
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js +0 -40
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.d.ts +0 -22
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js +0 -38
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.d.ts +0 -34
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js +0 -186
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.d.ts +0 -36
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js +0 -121
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.d.ts +0 -157
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js +0 -948
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js +0 -50
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.d.ts +0 -214
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js +0 -91
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.d.ts +0 -1166
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js +0 -308
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js +0 -62
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.d.ts +0 -400
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js +0 -113
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.d.ts +0 -250
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js +0 -169
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.d.ts +0 -17
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js +0 -97
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1085
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js +0 -218
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -949
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js +0 -253
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -657
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js +0 -205
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.d.ts +0 -285
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js +0 -106
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.d.ts +0 -581
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js +0 -136
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.d.ts +0 -791
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js +0 -225
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.d.ts +0 -120
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js +0 -535
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js +0 -18
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.d.ts +0 -4
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js +0 -9
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.d.ts +0 -10
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.d.ts +0 -6
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js +0 -15
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.d.ts +0 -127
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js +0 -483
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.d.ts +0 -122
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js +0 -645
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js +0 -156
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.d.ts +0 -88
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/index.js +0 -4
- package/dist/bundled-agents/copilot-agents/functions/jest.config.js +0 -29
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.d.ts +0 -14
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js +0 -35
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.d.ts +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js +0 -21
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.d.ts +0 -22
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js +0 -38
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.d.ts +0 -34
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js +0 -174
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.d.ts +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js +0 -107
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.d.ts +0 -157
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js +0 -941
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js +0 -50
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.d.ts +0 -185
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js +0 -86
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.d.ts +0 -1081
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js +0 -305
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js +0 -62
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.d.ts +0 -315
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js +0 -110
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.d.ts +0 -250
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js +0 -169
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.d.ts +0 -16
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js +0 -88
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1000
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js +0 -215
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -864
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js +0 -250
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -572
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js +0 -202
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.d.ts +0 -496
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js +0 -133
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.d.ts +0 -706
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js +0 -222
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.d.ts +0 -107
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js +0 -360
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js +0 -18
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.d.ts +0 -4
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js +0 -9
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.d.ts +0 -10
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.d.ts +0 -6
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js +0 -15
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.d.ts +0 -119
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js +0 -421
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.d.ts +0 -122
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js +0 -645
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js +0 -156
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.d.ts +0 -88
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/package-lock.json +0 -5473
- package/dist/bundled-agents/copilot-agents/functions/package.json +0 -40
- package/dist/bundled-agents/copilot-agents/functions/src/claude.ts +0 -71
- package/dist/bundled-agents/copilot-agents/functions/src/cors.ts +0 -36
- package/dist/bundled-agents/copilot-agents/functions/src/envelope.ts +0 -77
- package/dist/bundled-agents/copilot-agents/functions/src/handler.test.ts +0 -340
- package/dist/bundled-agents/copilot-agents/functions/src/health.ts +0 -53
- package/dist/bundled-agents/copilot-agents/functions/src/index.ts +0 -201
- package/dist/bundled-agents/copilot-agents/functions/src/router.ts +0 -148
- package/dist/bundled-agents/copilot-agents/functions/tsconfig.json +0 -31
- package/dist/bundled-agents/copilot-agents/package-lock.json +0 -11825
- package/dist/bundled-agents/copilot-agents/package.json +0 -5
- package/dist/bundled-agents/governance-dashboard-agents/package-lock.json +0 -8282
- package/dist/bundled-agents/governance-dashboard-agents/package.json +0 -13
- package/dist/bundled-agents/orchestrator-agents/functions/contracts/index.js +0 -590
- package/dist/bundled-agents/orchestrator-agents/functions/index.js +0 -442
- package/dist/bundled-agents/orchestrator-agents/functions/test.js +0 -325
- package/dist/bundled-agents/orchestrator-agents/index.js +0 -6
- package/dist/bundled-agents/orchestrator-agents/package-lock.json +0 -13254
- package/dist/bundled-agents/orchestrator-agents/package.json +0 -20
- package/dist/bundled-agents/platform-agents/package-lock.json +0 -1723
- package/dist/bundled-agents/platform-agents/package.json +0 -22
- package/dist/bundled-agents/platform-agents/src/agents/decision-memo.ts +0 -463
- package/dist/bundled-agents/platform-agents/src/agents/decision.ts +0 -234
- package/dist/bundled-agents/platform-agents/src/agents/executive-summary.ts +0 -229
- package/dist/bundled-agents/platform-agents/src/agents/risk-score.ts +0 -327
- package/dist/bundled-agents/platform-agents/src/claude.ts +0 -71
- package/dist/bundled-agents/platform-agents/src/cors.ts +0 -24
- package/dist/bundled-agents/platform-agents/src/envelope.ts +0 -37
- package/dist/bundled-agents/platform-agents/src/health.ts +0 -20
- package/dist/bundled-agents/platform-agents/src/index.ts +0 -171
- package/dist/bundled-agents/platform-agents/src/router.ts +0 -38
- package/dist/bundled-agents/platform-agents/src/text-analysis.ts +0 -238
- package/dist/bundled-agents/platform-agents/tsconfig.json +0 -19
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js +0 -43
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js +0 -30
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js +0 -53
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js +0 -51
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js +0 -36
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/index.d.ts +0 -2
- package/dist/bundled-agents/sentinel-agents/lib/index.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/index.js +0 -70
- package/dist/bundled-agents/sentinel-agents/lib/index.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/package-lock.json +0 -12591
- package/dist/bundled-agents/sentinel-agents/package.json +0 -62
- package/dist/bundled-agents/sentinel-agents/src/agents/alert.ts +0 -46
- package/dist/bundled-agents/sentinel-agents/src/agents/anomaly.ts +0 -33
- package/dist/bundled-agents/sentinel-agents/src/agents/correlation.ts +0 -56
- package/dist/bundled-agents/sentinel-agents/src/agents/drift.ts +0 -54
- package/dist/bundled-agents/sentinel-agents/src/agents/rca.ts +0 -38
- package/dist/bundled-agents/sentinel-agents/src/claude.ts +0 -71
- package/dist/bundled-agents/sentinel-agents/src/index.ts +0 -77
- package/dist/bundled-agents/sentinel-agents/tsconfig.json +0 -20
|
@@ -17,12 +17,43 @@
|
|
|
17
17
|
import * as fs from 'node:fs';
|
|
18
18
|
import * as path from 'node:path';
|
|
19
19
|
import { createSpan, endSpan, emitSpan } from '../telemetry.js';
|
|
20
|
+
import { createClaudeCodeRunner } from '../../../runtime/claude-code-runner.js';
|
|
20
21
|
// ============================================================================
|
|
21
22
|
// Constants
|
|
22
23
|
// ============================================================================
|
|
23
24
|
const DIR_MODE = 0o700;
|
|
24
25
|
const FILE_MODE = 0o600;
|
|
25
26
|
const JSON_INDENT = 2;
|
|
27
|
+
/**
|
|
28
|
+
* Load agentics fleet report from phase2Dir and format for LLM context.
|
|
29
|
+
*/
|
|
30
|
+
function loadAgenticsFleetContextForDDD(phase2Dir) {
|
|
31
|
+
try {
|
|
32
|
+
const reportPath = path.join(phase2Dir, 'agentics-agents-report.json');
|
|
33
|
+
if (!fs.existsSync(reportPath))
|
|
34
|
+
return '';
|
|
35
|
+
const report = JSON.parse(fs.readFileSync(reportPath, 'utf-8'));
|
|
36
|
+
if (!report.results || report.results.length === 0)
|
|
37
|
+
return '';
|
|
38
|
+
const successResults = report.results.filter(r => r.status === 200);
|
|
39
|
+
if (successResults.length === 0)
|
|
40
|
+
return '';
|
|
41
|
+
const summaries = successResults.slice(0, 12).map(r => {
|
|
42
|
+
const resp = r.response;
|
|
43
|
+
const data = resp?.['data'];
|
|
44
|
+
let finding = '';
|
|
45
|
+
if (data) {
|
|
46
|
+
const vals = Object.values(data).filter(v => typeof v === 'string').slice(0, 2);
|
|
47
|
+
finding = vals.map(v => String(v).slice(0, 100)).join('; ');
|
|
48
|
+
}
|
|
49
|
+
return `- [${r.domain}/${r.agent}] ${r.role}: ${finding || 'completed'}`;
|
|
50
|
+
}).join('\n');
|
|
51
|
+
return `\nAGENTICS FLEET ANALYSIS (${successResults.length} agents):\n${summaries}\n`;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
26
57
|
// ============================================================================
|
|
27
58
|
// Context Name Normalization
|
|
28
59
|
// ============================================================================
|
|
@@ -849,11 +880,15 @@ export function buildPhase2DDD(sparc, adrs, dossier, scenarioQuery) {
|
|
|
849
880
|
const entityFields = [];
|
|
850
881
|
const valueObjects = [];
|
|
851
882
|
const seenVOs = new Set();
|
|
883
|
+
// Track field types alongside names for downstream typed entity creation
|
|
884
|
+
const entityFieldTypes = new Map();
|
|
852
885
|
for (const parsed of parsedApis) {
|
|
853
|
-
// Collect unique parameter names as entity fields
|
|
886
|
+
// Collect unique parameter names as entity fields with their types
|
|
854
887
|
for (const p of parsed.params) {
|
|
855
|
-
if (!entityFields.includes(p.name))
|
|
888
|
+
if (!entityFields.includes(p.name)) {
|
|
856
889
|
entityFields.push(p.name);
|
|
890
|
+
entityFieldTypes.set(p.name, p.type);
|
|
891
|
+
}
|
|
857
892
|
// Complex types (non-primitive) become value objects
|
|
858
893
|
const primitives = new Set(['string', 'number', 'boolean', 'Date', 'void', 'any', 'unknown']);
|
|
859
894
|
const baseType = p.type.replace(/[\[\]<>,|?\s]/g, '');
|
|
@@ -914,11 +949,43 @@ export function buildPhase2DDD(sparc, adrs, dossier, scenarioQuery) {
|
|
|
914
949
|
if (invariants.length < 3 && svc.dependencies.length > 0) {
|
|
915
950
|
invariants.push(`${svcName} must validate responses from ${svc.dependencies.slice(0, 2).join(', ')} before updating state`);
|
|
916
951
|
}
|
|
952
|
+
// ADR-029 Fix 4: Detect if this is an intelligence/ML context and add ML-specific
|
|
953
|
+
// value objects, entities, and invariants instead of generic CRUD patterns
|
|
954
|
+
const mlCommandPatterns = /^(Train|RunInference|Detect|Predict|Forecast|Analyze|Classify|Cluster|Evaluate|Deploy)/;
|
|
955
|
+
const hasMlCommands = svc.api.some(api => {
|
|
956
|
+
const segments = api.replace(/^\s*(POST|PUT|PATCH|DELETE|GET)\s+/i, '').split('/').filter(Boolean);
|
|
957
|
+
const action = segments[segments.length - 1] ?? '';
|
|
958
|
+
return mlCommandPatterns.test(pascalCase(action.replace(/[^a-zA-Z0-9-]/g, '')));
|
|
959
|
+
});
|
|
960
|
+
if (hasMlCommands) {
|
|
961
|
+
// Add ML-specific value objects
|
|
962
|
+
valueObjects.push({ name: 'ModelVersion', description: 'Versioned ML model artifact with training metadata', invariants: ['Version must be monotonically increasing', 'Model artifact hash must be immutable after creation'] }, { name: 'TrainingDataset', description: 'Reference to the training data partition used', invariants: ['Dataset partition must exist before training starts'] }, { name: 'HyperParameters', description: 'Model hyperparameter configuration', invariants: ['Learning rate must be positive', 'Batch size must be a power of 2'] }, { name: 'InferenceResult', description: 'Prediction output with confidence scores', invariants: ['Confidence score must be between 0 and 1'] }, { name: 'ModelMetrics', description: 'Accuracy, precision, recall, F1 metrics for the model', invariants: ['All metric values must be between 0 and 1'] });
|
|
963
|
+
// Add ML-specific invariants
|
|
964
|
+
invariants.push(`${svcName} model must be trained before inference can run`, `${svcName} inference results must include confidence scores`, `${svcName} model version must be immutable after deployment`);
|
|
965
|
+
// Add ML-specific entities as typed fields
|
|
966
|
+
entityFields.push('model_id', 'model_version', 'accuracy_score', 'training_samples_count', 'last_trained_at', 'inference_latency_ms');
|
|
967
|
+
entityFieldTypes.set('model_id', 'string');
|
|
968
|
+
entityFieldTypes.set('model_version', 'string');
|
|
969
|
+
entityFieldTypes.set('accuracy_score', 'number');
|
|
970
|
+
entityFieldTypes.set('training_samples_count', 'number');
|
|
971
|
+
entityFieldTypes.set('last_trained_at', 'string');
|
|
972
|
+
entityFieldTypes.set('inference_latency_ms', 'number');
|
|
973
|
+
}
|
|
917
974
|
// Aggregate from service — with typed entity and derived value objects
|
|
918
975
|
const rootEntity = {
|
|
919
976
|
name: svcName,
|
|
920
977
|
description: svc.responsibility,
|
|
921
978
|
};
|
|
979
|
+
// ADR-029 Fix 2: Add typed field entities from parsed API parameters
|
|
980
|
+
// so Phase 5 receives explicit type info instead of generating Record<string, unknown>
|
|
981
|
+
const typedFieldEntities = [];
|
|
982
|
+
for (const fieldName of entityFields) {
|
|
983
|
+
const fieldType = entityFieldTypes.get(fieldName) ?? 'string';
|
|
984
|
+
typedFieldEntities.push({
|
|
985
|
+
name: fieldName,
|
|
986
|
+
description: `${fieldName}: ${fieldType}`,
|
|
987
|
+
});
|
|
988
|
+
}
|
|
922
989
|
// Add sub-entities for non-trivial API surfaces (>3 methods = likely has sub-entities)
|
|
923
990
|
const subEntities = [];
|
|
924
991
|
if (svc.api.length > 3) {
|
|
@@ -944,7 +1011,7 @@ export function buildPhase2DDD(sparc, adrs, dossier, scenarioQuery) {
|
|
|
944
1011
|
const aggregate = {
|
|
945
1012
|
name: `${svcName}Aggregate`,
|
|
946
1013
|
root: svcName,
|
|
947
|
-
entities: [rootEntity, ...subEntities],
|
|
1014
|
+
entities: [rootEntity, ...typedFieldEntities, ...subEntities],
|
|
948
1015
|
valueObjects,
|
|
949
1016
|
invariants,
|
|
950
1017
|
};
|
|
@@ -1021,6 +1088,10 @@ export function buildPhase2DDD(sparc, adrs, dossier, scenarioQuery) {
|
|
|
1021
1088
|
return lower.includes(svc.name.toLowerCase()) || lower.includes(contextName.toLowerCase());
|
|
1022
1089
|
})
|
|
1023
1090
|
.map(a => a.id);
|
|
1091
|
+
// ADR-029 Fix 4: Tag intelligence contexts based on command semantics
|
|
1092
|
+
const intelligenceCommandPatterns = /^(Train|RunInference|Detect|Predict|Forecast|Analyze|Classify|Cluster|Evaluate|Deploy)Model|^(DetectAnomalies|RunForecast|RunAnalysis|RunInference|ExtractFeatures|IngestData|TransformData|ComputeMetrics)/;
|
|
1093
|
+
const hasIntelligenceCommands = commands.some(cmd => intelligenceCommandPatterns.test(cmd.name));
|
|
1094
|
+
const contextType = hasIntelligenceCommands ? 'intelligence' : 'crud';
|
|
1024
1095
|
return {
|
|
1025
1096
|
name: contextName,
|
|
1026
1097
|
description: svc.responsibility,
|
|
@@ -1031,6 +1102,7 @@ export function buildPhase2DDD(sparc, adrs, dossier, scenarioQuery) {
|
|
|
1031
1102
|
ubiquitousLanguage: [],
|
|
1032
1103
|
adrRefs,
|
|
1033
1104
|
subdomain: classifySubdomain(contextName, svc.responsibility),
|
|
1105
|
+
contextType,
|
|
1034
1106
|
};
|
|
1035
1107
|
});
|
|
1036
1108
|
// Build context map using domain-semantic relationship inference
|
|
@@ -1060,6 +1132,323 @@ export function buildPhase2DDD(sparc, adrs, dossier, scenarioQuery) {
|
|
|
1060
1132
|
};
|
|
1061
1133
|
}
|
|
1062
1134
|
// ============================================================================
|
|
1135
|
+
// ADR-027 Change 2: LLM-Enriched DDD Model
|
|
1136
|
+
//
|
|
1137
|
+
// After mechanical derivation, Claude enriches each bounded context with
|
|
1138
|
+
// typed aggregate fields, domain-specific invariants, and ubiquitous language.
|
|
1139
|
+
// Falls back silently to the mechanical model on LLM failure.
|
|
1140
|
+
// ============================================================================
|
|
1141
|
+
/**
|
|
1142
|
+
* Enrich a mechanically-derived DDD model using Claude Code LLM.
|
|
1143
|
+
* Adds typed aggregate fields, domain-specific invariants, and ubiquitous language
|
|
1144
|
+
* terms that the deterministic derivation cannot produce.
|
|
1145
|
+
*
|
|
1146
|
+
* Modifies the model's arrays in-place (push to existing arrays).
|
|
1147
|
+
*/
|
|
1148
|
+
function enrichDDDWithLLM(model, dossier, query, phase2Dir = '') {
|
|
1149
|
+
try {
|
|
1150
|
+
const runner = createClaudeCodeRunner();
|
|
1151
|
+
const contextSummaries = model.contexts.map(c => {
|
|
1152
|
+
const aggNames = c.aggregates.map(a => a.name).join(', ');
|
|
1153
|
+
const cmdNames = c.commands.map(cmd => cmd.name).join(', ');
|
|
1154
|
+
return `- ${c.name} (${c.subdomain ?? 'supporting'}): ${c.description.slice(0, 100)}\n Aggregates: ${aggNames}\n Commands: ${cmdNames}`;
|
|
1155
|
+
}).join('\n');
|
|
1156
|
+
const dossierContext = dossier.items
|
|
1157
|
+
.filter(i => ['requirement', 'recommendation', 'decision-rationale'].includes(i.category))
|
|
1158
|
+
.slice(0, 20)
|
|
1159
|
+
.map(i => `- ${i.title}: ${i.content.slice(0, 150)}`)
|
|
1160
|
+
.join('\n');
|
|
1161
|
+
// ADR-027: Include agentics fleet analysis from 110 agents
|
|
1162
|
+
const agentContext = phase2Dir ? loadAgenticsFleetContextForDDD(phase2Dir) : '';
|
|
1163
|
+
const prompt = `You are a DDD expert enriching a domain model for: ${query}\n` +
|
|
1164
|
+
`\nBOUNDED CONTEXTS:\n${contextSummaries}\n` +
|
|
1165
|
+
`\nRESEARCH FINDINGS:\n${dossierContext}\n` +
|
|
1166
|
+
(agentContext ? agentContext + '\n' : '') +
|
|
1167
|
+
`\nFor each bounded context, provide:\n` +
|
|
1168
|
+
`1. Aggregate root typed fields (use specific types: string, number, boolean, Date, and domain enums like "status: enum(open|in_progress|completed|deferred)")\n` +
|
|
1169
|
+
`2. 2-4 domain-specific invariants (business rules that must always hold true)\n` +
|
|
1170
|
+
`3. 3-6 ubiquitous language terms with definitions specific to this domain\n` +
|
|
1171
|
+
`\nReturn a JSON object with this exact structure:\n` +
|
|
1172
|
+
`{\n` +
|
|
1173
|
+
` "contexts": {\n` +
|
|
1174
|
+
` "<context-name>": {\n` +
|
|
1175
|
+
` "fields": [{"name": "field_name", "type": "string|number|boolean|Date|enum(val1|val2)"}],\n` +
|
|
1176
|
+
` "invariants": ["Business rule description"],\n` +
|
|
1177
|
+
` "ubiquitousLanguage": [{"term": "Term", "definition": "Definition"}]\n` +
|
|
1178
|
+
` }\n` +
|
|
1179
|
+
` }\n` +
|
|
1180
|
+
`}\n` +
|
|
1181
|
+
`\nCRITICAL: Use domain-specific field names and types for ${query}. NOT generic "data: Record<string, unknown>" or "payload: any".`;
|
|
1182
|
+
const result = runner.invoke(prompt, {
|
|
1183
|
+
runId: `ddd-enrich-${Date.now()}`,
|
|
1184
|
+
timeoutMs: 180_000,
|
|
1185
|
+
});
|
|
1186
|
+
const data = result.data;
|
|
1187
|
+
// Try to extract contexts from the response
|
|
1188
|
+
// The LLM may return JSON directly (parsed by envelope unwrapper) or as content string
|
|
1189
|
+
let enrichmentContexts;
|
|
1190
|
+
if (data.contexts && typeof data.contexts === 'object') {
|
|
1191
|
+
enrichmentContexts = data.contexts;
|
|
1192
|
+
}
|
|
1193
|
+
else if (typeof data.content === 'string') {
|
|
1194
|
+
try {
|
|
1195
|
+
const parsed = JSON.parse(data.content);
|
|
1196
|
+
if (parsed.contexts)
|
|
1197
|
+
enrichmentContexts = parsed.contexts;
|
|
1198
|
+
}
|
|
1199
|
+
catch { /* content was not JSON */ }
|
|
1200
|
+
}
|
|
1201
|
+
if (!enrichmentContexts) {
|
|
1202
|
+
process.stderr.write('[ddd-generator] LLM enrichment: could not extract contexts from response\n');
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
applyDDDEnrichment(model, enrichmentContexts);
|
|
1206
|
+
process.stderr.write(`[ddd-generator] LLM-enriched DDD model: ${Object.keys(enrichmentContexts).length} contexts in ${result.durationMs}ms\n`);
|
|
1207
|
+
// ADR-029 Fix 2: Quality gate — re-enrich contexts that still have empty aggregates
|
|
1208
|
+
const emptyAggCount = model.contexts.filter(c => c.aggregates.every(a => a.entities.length <= 1) // Only the root entity = empty
|
|
1209
|
+
).length;
|
|
1210
|
+
const emptyRatio = emptyAggCount / Math.max(model.contexts.length, 1);
|
|
1211
|
+
if (emptyRatio > 0.5) {
|
|
1212
|
+
process.stderr.write(`[ddd-generator] QUALITY GATE: ${emptyAggCount}/${model.contexts.length} contexts have empty aggregates (>${Math.round(emptyRatio * 100)}%). Re-enriching...\n`);
|
|
1213
|
+
// Second pass: focused field generation for empty aggregates only
|
|
1214
|
+
enrichEmptyAggregates(model, dossier, query);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
catch (err) {
|
|
1218
|
+
process.stderr.write(`[ddd-generator] LLM DDD enrichment failed (using mechanical model): ${err instanceof Error ? err.message : String(err)}\n`);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Apply LLM-generated enrichment data to the mechanical DDD model.
|
|
1223
|
+
* Pushes typed fields as entities, adds invariants, and adds glossary terms.
|
|
1224
|
+
*/
|
|
1225
|
+
function applyDDDEnrichment(model, enrichment) {
|
|
1226
|
+
for (const ctx of model.contexts) {
|
|
1227
|
+
const data = enrichment[ctx.name];
|
|
1228
|
+
if (!data)
|
|
1229
|
+
continue;
|
|
1230
|
+
// Add typed fields to the first aggregate as entities with type info
|
|
1231
|
+
const agg = ctx.aggregates.length > 0 ? ctx.aggregates[0] : undefined;
|
|
1232
|
+
if (data.fields && agg) {
|
|
1233
|
+
for (const field of data.fields) {
|
|
1234
|
+
const alreadyExists = agg.entities.some(e => e.name === field.name);
|
|
1235
|
+
if (!alreadyExists) {
|
|
1236
|
+
agg.entities.push({
|
|
1237
|
+
name: field.name,
|
|
1238
|
+
description: `${field.name}: ${field.type}`,
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
// Add domain-specific invariants
|
|
1244
|
+
if (data.invariants && agg) {
|
|
1245
|
+
for (const inv of data.invariants) {
|
|
1246
|
+
if (!agg.invariants.includes(inv)) {
|
|
1247
|
+
agg.invariants.push(inv);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
// Add ubiquitous language terms to the model glossary
|
|
1252
|
+
if (data.ubiquitousLanguage) {
|
|
1253
|
+
for (const term of data.ubiquitousLanguage) {
|
|
1254
|
+
const exists = model.ubiquitousLanguageGlossary.some(t => t.term.toLowerCase() === term.term.toLowerCase());
|
|
1255
|
+
if (!exists) {
|
|
1256
|
+
model.ubiquitousLanguageGlossary.push({
|
|
1257
|
+
term: term.term,
|
|
1258
|
+
definition: term.definition,
|
|
1259
|
+
context: ctx.name,
|
|
1260
|
+
aliases: [],
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
// ============================================================================
|
|
1268
|
+
// ADR-029 Fix 2: Re-enrich empty aggregates with focused LLM call
|
|
1269
|
+
// ============================================================================
|
|
1270
|
+
/**
|
|
1271
|
+
* Focused LLM call that targets ONLY aggregates with zero typed fields.
|
|
1272
|
+
* The prompt is more specific than the general enrichment, asking for
|
|
1273
|
+
* domain-specific typed fields for each empty aggregate.
|
|
1274
|
+
*
|
|
1275
|
+
* Non-fatal: errors log to stderr and preserve the existing model.
|
|
1276
|
+
*/
|
|
1277
|
+
function enrichEmptyAggregates(model, dossier, query) {
|
|
1278
|
+
const emptyContexts = model.contexts.filter(c => c.aggregates.every(a => a.entities.length <= 1));
|
|
1279
|
+
if (emptyContexts.length === 0)
|
|
1280
|
+
return;
|
|
1281
|
+
try {
|
|
1282
|
+
const runner = createClaudeCodeRunner();
|
|
1283
|
+
const contextList = emptyContexts.map(c => `- ${c.name}: ${c.description.slice(0, 100)}. Commands: ${c.commands.map(cmd => cmd.name).join(', ')}`).join('\n');
|
|
1284
|
+
const dossierHints = dossier.items
|
|
1285
|
+
.filter(i => ['requirement', 'recommendation'].includes(i.category))
|
|
1286
|
+
.slice(0, 10)
|
|
1287
|
+
.map(i => `- ${i.title}: ${i.content.slice(0, 100)}`)
|
|
1288
|
+
.join('\n');
|
|
1289
|
+
const prompt = `You are a DDD expert. These bounded contexts have EMPTY aggregates (no typed fields).\n` +
|
|
1290
|
+
`Generate typed fields for each aggregate root.\n\n` +
|
|
1291
|
+
`SCENARIO: ${query}\n\n` +
|
|
1292
|
+
(dossierHints ? `DOMAIN REQUIREMENTS:\n${dossierHints}\n\n` : '') +
|
|
1293
|
+
`CONTEXTS NEEDING FIELDS:\n${contextList}\n\n` +
|
|
1294
|
+
`For each context, provide 5-10 typed fields that are SPECIFIC to this domain.\n` +
|
|
1295
|
+
`Use real domain field names, not generic "data" or "payload".\n\n` +
|
|
1296
|
+
`Return JSON:\n` +
|
|
1297
|
+
`{\n` +
|
|
1298
|
+
` "contexts": {\n` +
|
|
1299
|
+
` "<context-name>": {\n` +
|
|
1300
|
+
` "fields": [\n` +
|
|
1301
|
+
` {"name": "budget_id", "type": "string"},\n` +
|
|
1302
|
+
` {"name": "allocated_amount", "type": "number"},\n` +
|
|
1303
|
+
` {"name": "fiscal_year", "type": "number"},\n` +
|
|
1304
|
+
` {"name": "cost_center_id", "type": "string"},\n` +
|
|
1305
|
+
` {"name": "status", "type": "enum(draft|approved|active|closed)"}\n` +
|
|
1306
|
+
` ]\n` +
|
|
1307
|
+
` }\n` +
|
|
1308
|
+
` }\n` +
|
|
1309
|
+
`}\n\n` +
|
|
1310
|
+
`CRITICAL: Every field must be domain-specific to "${query.slice(0, 60)}". NOT "data: unknown" or "[key: string]: unknown".`;
|
|
1311
|
+
const result = runner.invoke(prompt, {
|
|
1312
|
+
runId: `ddd-empty-fields-${Date.now()}`,
|
|
1313
|
+
timeoutMs: 120_000,
|
|
1314
|
+
});
|
|
1315
|
+
const data = result.data;
|
|
1316
|
+
let enrichmentContexts;
|
|
1317
|
+
if (data.contexts && typeof data.contexts === 'object') {
|
|
1318
|
+
enrichmentContexts = data.contexts;
|
|
1319
|
+
}
|
|
1320
|
+
else if (typeof data.content === 'string') {
|
|
1321
|
+
try {
|
|
1322
|
+
const parsed = JSON.parse(data.content);
|
|
1323
|
+
if (parsed.contexts)
|
|
1324
|
+
enrichmentContexts = parsed.contexts;
|
|
1325
|
+
}
|
|
1326
|
+
catch { /* content was not JSON */ }
|
|
1327
|
+
}
|
|
1328
|
+
if (enrichmentContexts) {
|
|
1329
|
+
applyDDDEnrichment(model, enrichmentContexts);
|
|
1330
|
+
process.stderr.write(`[ddd-generator] Re-enriched ${Object.keys(enrichmentContexts).length} empty aggregates with typed fields in ${result.durationMs}ms\n`);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
catch (err) {
|
|
1334
|
+
process.stderr.write(`[ddd-generator] Empty aggregate re-enrichment failed (non-fatal): ${err instanceof Error ? err.message : String(err)}\n`);
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
// ============================================================================
|
|
1338
|
+
// ADR-029 Fix 3: Enrich context map with LLM-generated relationships
|
|
1339
|
+
// ============================================================================
|
|
1340
|
+
/** Valid relationship type values for Phase2ContextRelation. */
|
|
1341
|
+
const VALID_RELATION_TYPES = new Set([
|
|
1342
|
+
'partnership',
|
|
1343
|
+
'customer-supplier',
|
|
1344
|
+
'conformist',
|
|
1345
|
+
'anticorruption-layer',
|
|
1346
|
+
'open-host-service',
|
|
1347
|
+
'shared-kernel',
|
|
1348
|
+
'published-language',
|
|
1349
|
+
]);
|
|
1350
|
+
/**
|
|
1351
|
+
* Enrich the context map with LLM-generated domain relationships.
|
|
1352
|
+
* Sends bounded contexts + their domain events to Claude for relationship
|
|
1353
|
+
* analysis, then merges new relationships into the existing context map.
|
|
1354
|
+
*
|
|
1355
|
+
* Non-fatal: errors log to stderr and preserve the existing context map.
|
|
1356
|
+
*/
|
|
1357
|
+
function enrichContextMapWithLLM(model, query) {
|
|
1358
|
+
if (model.contexts.length < 3)
|
|
1359
|
+
return; // Not enough contexts for meaningful relationships
|
|
1360
|
+
try {
|
|
1361
|
+
const runner = createClaudeCodeRunner();
|
|
1362
|
+
const contextSummary = model.contexts.map(c => {
|
|
1363
|
+
const events = c.domainEvents.map(e => e.name).join(', ');
|
|
1364
|
+
const commands = c.commands.map(cmd => cmd.name).join(', ');
|
|
1365
|
+
return `- ${c.name}: ${c.description.slice(0, 80)}\n Commands: ${commands || 'none'}\n Events: ${events || 'none'}`;
|
|
1366
|
+
}).join('\n');
|
|
1367
|
+
const minRelationships = Math.max(3, Math.floor(model.contexts.length * 0.6));
|
|
1368
|
+
const prompt = `You are a DDD expert analyzing bounded context relationships for: ${query}\n\n` +
|
|
1369
|
+
`BOUNDED CONTEXTS:\n${contextSummary}\n\n` +
|
|
1370
|
+
`Current context map has ${model.contextMap.length} relationships. Analyze which contexts should be connected.\n\n` +
|
|
1371
|
+
`For each relationship, specify:\n` +
|
|
1372
|
+
`1. Which context publishes events that another context consumes\n` +
|
|
1373
|
+
`2. Which contexts need data from other contexts (upstream/downstream)\n` +
|
|
1374
|
+
`3. The integration pattern (customer-supplier, conformist, anticorruption-layer, published-language, shared-kernel, partnership, open-host-service)\n\n` +
|
|
1375
|
+
`Return JSON array:\n` +
|
|
1376
|
+
`[\n` +
|
|
1377
|
+
` {\n` +
|
|
1378
|
+
` "upstream": "context-name",\n` +
|
|
1379
|
+
` "downstream": "context-name",\n` +
|
|
1380
|
+
` "type": "customer-supplier",\n` +
|
|
1381
|
+
` "description": "Why this relationship exists",\n` +
|
|
1382
|
+
` "data_flows": ["EventName1", "EventName2"],\n` +
|
|
1383
|
+
` "integration_pattern": "Description of pattern"\n` +
|
|
1384
|
+
` }\n` +
|
|
1385
|
+
`]\n\n` +
|
|
1386
|
+
`Generate at least ${minRelationships} meaningful relationships.\n` +
|
|
1387
|
+
`Do NOT create self-referencing relationships (upstream = downstream).`;
|
|
1388
|
+
const result = runner.invoke(prompt, {
|
|
1389
|
+
runId: `ddd-context-map-${Date.now()}`,
|
|
1390
|
+
timeoutMs: 120_000,
|
|
1391
|
+
});
|
|
1392
|
+
const data = result.data;
|
|
1393
|
+
let relationships;
|
|
1394
|
+
// The LLM may return the array directly or wrapped in a content string
|
|
1395
|
+
if (Array.isArray(data)) {
|
|
1396
|
+
relationships = data;
|
|
1397
|
+
}
|
|
1398
|
+
else if (Array.isArray(data.relationships)) {
|
|
1399
|
+
relationships = data.relationships;
|
|
1400
|
+
}
|
|
1401
|
+
else if (typeof data.content === 'string') {
|
|
1402
|
+
try {
|
|
1403
|
+
const parsed = JSON.parse(data.content);
|
|
1404
|
+
if (Array.isArray(parsed))
|
|
1405
|
+
relationships = parsed;
|
|
1406
|
+
else if (Array.isArray(parsed.relationships))
|
|
1407
|
+
relationships = parsed.relationships;
|
|
1408
|
+
}
|
|
1409
|
+
catch { /* content was not JSON */ }
|
|
1410
|
+
}
|
|
1411
|
+
if (!relationships || relationships.length === 0) {
|
|
1412
|
+
process.stderr.write('[ddd-generator] Context map enrichment: no relationships extracted from LLM response\n');
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
// Build dedup set from existing context map
|
|
1416
|
+
const existingKeys = new Set(model.contextMap.map(r => `${r.upstream}|${r.downstream}|${r.type}`));
|
|
1417
|
+
const contextNames = new Set(model.contexts.map(c => c.name));
|
|
1418
|
+
let addedCount = 0;
|
|
1419
|
+
for (const rel of relationships) {
|
|
1420
|
+
const upstream = String(rel.upstream ?? '');
|
|
1421
|
+
const downstream = String(rel.downstream ?? '');
|
|
1422
|
+
const rawType = String(rel.type ?? '');
|
|
1423
|
+
// Validate: no self-references, both contexts must exist, valid type
|
|
1424
|
+
if (!upstream || !downstream || upstream === downstream)
|
|
1425
|
+
continue;
|
|
1426
|
+
if (!contextNames.has(upstream) || !contextNames.has(downstream))
|
|
1427
|
+
continue;
|
|
1428
|
+
if (!VALID_RELATION_TYPES.has(rawType))
|
|
1429
|
+
continue;
|
|
1430
|
+
const key = `${upstream}|${downstream}|${rawType}`;
|
|
1431
|
+
if (existingKeys.has(key))
|
|
1432
|
+
continue;
|
|
1433
|
+
existingKeys.add(key);
|
|
1434
|
+
const newRelation = {
|
|
1435
|
+
upstream,
|
|
1436
|
+
downstream,
|
|
1437
|
+
type: rawType,
|
|
1438
|
+
description: String(rel.description ?? `${upstream} provides data to ${downstream}`),
|
|
1439
|
+
integration_pattern: typeof rel.integration_pattern === 'string' ? rel.integration_pattern : undefined,
|
|
1440
|
+
data_flows: Array.isArray(rel.data_flows) ? rel.data_flows.map(String) : undefined,
|
|
1441
|
+
};
|
|
1442
|
+
model.contextMap.push(newRelation);
|
|
1443
|
+
addedCount++;
|
|
1444
|
+
}
|
|
1445
|
+
process.stderr.write(`[ddd-generator] Context map enriched: added ${addedCount} LLM-generated relationships (total: ${model.contextMap.length}) in ${result.durationMs}ms\n`);
|
|
1446
|
+
}
|
|
1447
|
+
catch (err) {
|
|
1448
|
+
process.stderr.write(`[ddd-generator] Context map LLM enrichment failed (non-fatal): ${err instanceof Error ? err.message : String(err)}\n`);
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
// ============================================================================
|
|
1063
1452
|
// Public: Main Stage Function
|
|
1064
1453
|
// ============================================================================
|
|
1065
1454
|
export async function generateDDDModel(context) {
|
|
@@ -1088,6 +1477,14 @@ export async function generateDDDModel(context) {
|
|
|
1088
1477
|
?? context.phase1Artifacts?.manifest?.query
|
|
1089
1478
|
?? '';
|
|
1090
1479
|
const domainModel = buildPhase2DDD(sparc, Array.isArray(adrs) ? adrs : [], dossier, query);
|
|
1480
|
+
// ADR-027 Change 2: Enrich DDD model with LLM-generated typed fields,
|
|
1481
|
+
// domain-specific invariants, and ubiquitous language terms.
|
|
1482
|
+
// Falls back silently to mechanical model if Claude is unavailable.
|
|
1483
|
+
enrichDDDWithLLM(domainModel, dossier, query, context.phase2Dir);
|
|
1484
|
+
// ADR-029 Fix 3: Enrich context map with LLM-generated relationships
|
|
1485
|
+
if (domainModel.contexts.length >= 3) {
|
|
1486
|
+
enrichContextMapWithLLM(domainModel, query);
|
|
1487
|
+
}
|
|
1091
1488
|
// Generate markdown
|
|
1092
1489
|
const dddMarkdown = writeDDDMarkdown(domainModel, sparc);
|
|
1093
1490
|
// Write artifacts
|