agentic-qe 3.11.0 → 3.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/agents/README.md +50 -0
- package/.claude/commands/agents/agent-capabilities.md +140 -0
- package/.claude/commands/agents/agent-coordination.md +28 -0
- package/.claude/commands/agents/agent-spawning.md +28 -0
- package/.claude/commands/agents/agent-types.md +216 -0
- package/.claude/commands/agents/health.md +139 -0
- package/.claude/commands/agents/list.md +100 -0
- package/.claude/commands/agents/logs.md +130 -0
- package/.claude/commands/agents/metrics.md +122 -0
- package/.claude/commands/agents/pool.md +127 -0
- package/.claude/commands/agents/spawn.md +140 -0
- package/.claude/commands/agents/status.md +115 -0
- package/.claude/commands/agents/stop.md +102 -0
- package/.claude/commands/claude-flow-help.md +1 -1
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/init.md +44 -0
- package/.claude/commands/coordination/orchestrate.md +43 -0
- package/.claude/commands/coordination/spawn.md +45 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/github/code-review-swarm.md +1 -1
- package/.claude/commands/github/issue-tracker.md +3 -3
- package/.claude/commands/github/release-manager.md +5 -3
- package/.claude/commands/github/release-swarm.md +1 -1
- package/.claude/commands/github/repo-architect.md +2 -2
- package/.claude/commands/github/swarm-issue.md +4 -1
- package/.claude/commands/github/swarm-pr.md +6 -3
- package/.claude/commands/github/sync-coordinator.md +3 -1
- package/.claude/commands/github/workflow-automation.md +2 -2
- package/.claude/commands/hive-mind/README.md +17 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
- package/.claude/commands/hive-mind/hive-mind.md +27 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/memory/neural.md +47 -0
- package/.claude/commands/swarm/README.md +15 -0
- package/.claude/commands/swarm/analysis.md +95 -0
- package/.claude/commands/swarm/development.md +96 -0
- package/.claude/commands/swarm/examples.md +168 -0
- package/.claude/commands/swarm/maintenance.md +102 -0
- package/.claude/commands/swarm/optimization.md +117 -0
- package/.claude/commands/swarm/research.md +136 -0
- package/.claude/commands/swarm/swarm-analysis.md +8 -0
- package/.claude/commands/swarm/swarm-background.md +8 -0
- package/.claude/commands/swarm/swarm-init.md +19 -0
- package/.claude/commands/swarm/swarm-modes.md +8 -0
- package/.claude/commands/swarm/swarm-monitor.md +8 -0
- package/.claude/commands/swarm/swarm-spawn.md +19 -0
- package/.claude/commands/swarm/swarm-status.md +8 -0
- package/.claude/commands/swarm/swarm-strategies.md +8 -0
- package/.claude/commands/swarm/swarm.md +87 -0
- package/.claude/commands/swarm/testing.md +131 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/development.md +78 -0
- package/.claude/commands/workflows/research.md +63 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/auto-commit.sh +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +37 -4
- package/.claude/helpers/github-safe.js +90 -40
- package/.claude/helpers/github-setup.sh +30 -13
- package/.claude/helpers/hook-handler.cjs +68 -49
- package/.claude/helpers/intelligence.cjs +156 -27
- package/.claude/helpers/post-commit +1 -1
- package/.claude/helpers/pre-commit +1 -1
- package/.claude/helpers/quick-start.sh +4 -4
- package/.claude/helpers/router.js +70 -31
- package/.claude/helpers/ruflo-hook.cjs +59 -0
- package/.claude/helpers/session.js +28 -6
- package/.claude/helpers/setup-mcp.sh +3 -3
- package/.claude/helpers/statusline.cjs +584 -468
- package/.claude/helpers/statusline.js +47 -11
- package/.claude/skills/github-code-review/SKILL.md +2 -17
- package/.claude/skills/github-multi-repo/SKILL.md +4 -16
- package/.claude/skills/github-project-management/SKILL.md +18 -33
- package/.claude/skills/github-release-management/SKILL.md +4 -21
- package/.claude/skills/github-workflow-automation/SKILL.md +8 -26
- package/.claude/skills/pair-programming/SKILL.md +2 -2
- package/.claude/skills/qe-code-intelligence/SKILL.md +3 -0
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
- package/.claude/skills/skill-builder/SKILL.md +0 -103
- package/.claude/skills/skills-manifest.json +1 -1
- package/.claude/skills/sparc-methodology/SKILL.md +2 -11
- package/.claude/skills/stream-chain/SKILL.md +0 -3
- package/.claude/skills/swarm-advanced/SKILL.md +2 -5
- package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
- package/.claude/skills/verification-quality/SKILL.md +121 -93
- package/CHANGELOG.md +84 -0
- package/README.md +1 -0
- package/assets/skills/pair-programming/SKILL.md +2 -2
- package/assets/skills/qe-code-intelligence/SKILL.md +3 -0
- package/assets/skills/verification-quality/SKILL.md +121 -93
- package/dist/audit/witness-chain.d.ts +1 -1
- package/dist/audit/witness-findings.d.ts +50 -0
- package/dist/audit/witness-findings.js +41 -0
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-LDNYC4GH.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-5CSKQB4O.js → agent-booster-wasm-FNCVODUJ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-EBV3OKTE.js → agent-handler-JK7VK37B.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-RZ53YM2U.js → agent-memory-branch-EPVVJNNA.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-CA4CT5Q7.js +2 -0
- package/dist/cli/chunks/{arena-UCP74DRO.js → arena-EH2IMSRW.js} +4 -4
- package/dist/cli/chunks/{arena-QWYTIQ6I.js → arena-NTHVDZTJ.js} +2 -2
- package/dist/cli/chunks/{audit-M4FNIX47.js → audit-ODZV2T2B.js} +2 -2
- package/dist/cli/chunks/base-TSDAEMT4.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-HMZC5TXM.js → better-sqlite3-5JTP47LA.js} +2 -2
- package/dist/cli/chunks/{brain-handler-OY6Q2GY5.js → brain-handler-NVB6OJ25.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-TQWN4NIX.js → branch-enumerator-BIXSELMY.js} +2 -2
- package/dist/cli/chunks/{browser-2EH3RXJ2.js → browser-S2Y2W33Z.js} +2 -2
- package/dist/cli/chunks/browser-workflow-3HCTJBLR.js +2 -0
- package/dist/cli/chunks/{chunk-V6WJVFRN.js → chunk-26ZMIYSK.js} +2 -2
- package/dist/cli/chunks/{chunk-I2HQLBWG.js → chunk-27KNLVOY.js} +2 -2
- package/dist/cli/chunks/{chunk-HNSZDIQU.js → chunk-2Q65LTJN.js} +2 -2
- package/dist/cli/chunks/{chunk-SKL225P5.js → chunk-3ATEYGVD.js} +2 -2
- package/dist/cli/chunks/{chunk-LTH6XARD.js → chunk-3J3QXLWP.js} +2 -2
- package/dist/cli/chunks/{chunk-NQD4CMXC.js → chunk-3KTOM7NN.js} +2 -2
- package/dist/cli/chunks/{chunk-QCJ7YOVN.js → chunk-3NCVUFAL.js} +2 -2
- package/dist/cli/chunks/{chunk-ZEUUVLS2.js → chunk-42DCMEUM.js} +1 -1
- package/dist/cli/chunks/{chunk-2QU6C3OS.js → chunk-4FTVTAMN.js} +2 -2
- package/dist/cli/chunks/{chunk-QYXTESM3.js → chunk-4PYJCIRO.js} +2 -2
- package/dist/cli/chunks/{chunk-LFT7WYHW.js → chunk-527U4AHC.js} +2 -2
- package/dist/cli/chunks/{chunk-VHON5NDM.js → chunk-5AFO7ZZG.js} +3 -3
- package/dist/cli/chunks/{chunk-F62ZQZQQ.js → chunk-5BDVFFYF.js} +2 -2
- package/dist/cli/chunks/{chunk-KBVXKFDI.js → chunk-5KMGG3QW.js} +4 -4
- package/dist/cli/chunks/{chunk-AVKGDS6F.js → chunk-6LQIVIZB.js} +2 -2
- package/dist/cli/chunks/{chunk-RKDNLPZM.js → chunk-6SOGYNJG.js} +2 -2
- package/dist/cli/chunks/{chunk-RPYYS6BX.js → chunk-6VAFRS5N.js} +2 -2
- package/dist/cli/chunks/chunk-72VVTMEL.js +2 -0
- package/dist/cli/chunks/{chunk-AURDGQNB.js → chunk-75C5GX7D.js} +2 -2
- package/dist/cli/chunks/{chunk-JN3IQB4L.js → chunk-76RO2RHG.js} +1 -1
- package/dist/cli/chunks/{chunk-7E5NYLJT.js → chunk-7HYO76F2.js} +2 -2
- package/dist/cli/chunks/{chunk-R3YO3Z7I.js → chunk-7KHZZVF2.js} +4 -4
- package/dist/cli/chunks/{chunk-G5VE3HQW.js → chunk-7MKF52GT.js} +2 -2
- package/dist/cli/chunks/{chunk-TGLEREP5.js → chunk-7VM4ZUHT.js} +2 -2
- package/dist/cli/chunks/{chunk-XW5OXBVV.js → chunk-7XIQR6VU.js} +2 -2
- package/dist/cli/chunks/{chunk-XKRG2U3V.js → chunk-A4ZDKF5F.js} +1 -1
- package/dist/cli/chunks/{chunk-XSG4XKGO.js → chunk-AAVUZVM6.js} +2 -2
- package/dist/cli/chunks/{chunk-XVQUVCFR.js → chunk-AINAWVGD.js} +2 -2
- package/dist/cli/chunks/{chunk-PUTRXS5I.js → chunk-AK5Q2WCJ.js} +2 -2
- package/dist/cli/chunks/{chunk-TYS77XHV.js → chunk-AKZK46TQ.js} +2 -2
- package/dist/cli/chunks/{chunk-JQM64WJ2.js → chunk-ARUXFZDY.js} +1 -1
- package/dist/cli/chunks/{chunk-YR44KQUK.js → chunk-AYXRT2ND.js} +1 -1
- package/dist/cli/chunks/{chunk-ZT4NPTML.js → chunk-AZQ6HDPM.js} +2 -2
- package/dist/cli/chunks/{chunk-DCJIXDO6.js → chunk-BGVEBYV4.js} +2 -2
- package/dist/cli/chunks/{chunk-IHNBZ5XG.js → chunk-C6UTRG66.js} +2 -2
- package/dist/cli/chunks/{chunk-R7FHQQAV.js → chunk-CAUTOCLZ.js} +2 -2
- package/dist/cli/chunks/{chunk-N52ZBTPM.js → chunk-CAVBEZV4.js} +2 -2
- package/dist/cli/chunks/{chunk-3LP5GPGU.js → chunk-CEMROADY.js} +1 -1
- package/dist/cli/chunks/{chunk-IQSPL2H4.js → chunk-CMVNYVKL.js} +2 -2
- package/dist/cli/chunks/{chunk-7BD7DZCB.js → chunk-CUDGKSFX.js} +2 -2
- package/dist/cli/chunks/{chunk-D3S4SRSA.js → chunk-CZYSCUJ4.js} +2 -2
- package/dist/cli/chunks/{chunk-4OTA6KYJ.js → chunk-DMUQV2YU.js} +2 -2
- package/dist/cli/chunks/{chunk-KZE5UR4T.js → chunk-DPFLJMEI.js} +3 -3
- package/dist/cli/chunks/{chunk-IOQYSR5S.js → chunk-DU4GQKTH.js} +2 -2
- package/dist/cli/chunks/{chunk-FMKALHT3.js → chunk-EDH4H55B.js} +2 -2
- package/dist/cli/chunks/{chunk-NI7O3GKZ.js → chunk-EIWZDVMT.js} +3 -3
- package/dist/cli/chunks/{chunk-5DG6H553.js → chunk-FPZLOVEF.js} +1 -1
- package/dist/cli/chunks/{chunk-DV7662EZ.js → chunk-FV53RMVB.js} +1 -1
- package/dist/cli/chunks/{chunk-BA4WZIAQ.js → chunk-FYY7OJ6Y.js} +2 -2
- package/dist/cli/chunks/{chunk-5ASPEVVF.js → chunk-G4CQBQBV.js} +1 -1
- package/dist/cli/chunks/{chunk-GBFAQ4DW.js → chunk-G6LIQFT2.js} +1 -1
- package/dist/cli/chunks/{chunk-2WVLFT2I.js → chunk-H3LGBH4Y.js} +1 -1
- package/dist/cli/chunks/{chunk-G25YZ7Z6.js → chunk-H4ZPPHOI.js} +2 -2
- package/dist/cli/chunks/{chunk-C33BMWYZ.js → chunk-H5TM4KIB.js} +5 -5
- package/dist/cli/chunks/{chunk-72QNONO6.js → chunk-H6MBRYA7.js} +2 -2
- package/dist/cli/chunks/{chunk-5OJXVVTI.js → chunk-HDBJORV7.js} +2 -2
- package/dist/cli/chunks/{chunk-HJFQVKPI.js → chunk-I3AD523O.js} +1 -1
- package/dist/cli/chunks/{chunk-2BBKA5J4.js → chunk-I7UWFV6N.js} +1 -1
- package/dist/cli/chunks/{chunk-IFTEM672.js → chunk-IMPSB5WW.js} +2 -2
- package/dist/cli/chunks/{chunk-YSTWLDVD.js → chunk-IO7ZUP2G.js} +3 -3
- package/dist/cli/chunks/{chunk-F6Y7DTHR.js → chunk-IQOCTGA2.js} +2 -2
- package/dist/cli/chunks/{chunk-RVQW6CBF.js → chunk-IXYF5BZY.js} +2 -2
- package/dist/cli/chunks/{chunk-3J6LYF6I.js → chunk-JC4Z2ADP.js} +2 -2
- package/dist/cli/chunks/{chunk-T6KT63NC.js → chunk-JCH2FHJ7.js} +2 -2
- package/dist/cli/chunks/{chunk-7PTA7AVW.js → chunk-JDFF2QMZ.js} +1 -1
- package/dist/cli/chunks/{chunk-UEH6C5JA.js → chunk-JELN5XTK.js} +1 -1
- package/dist/cli/chunks/{chunk-Z45QDDZQ.js → chunk-JSZNI3AO.js} +1 -1
- package/dist/cli/chunks/{chunk-ZFP3O5FM.js → chunk-K3YM2Z3E.js} +1 -1
- package/dist/cli/chunks/{chunk-X2TUDGFL.js → chunk-K426HTEQ.js} +44 -44
- package/dist/cli/chunks/{chunk-GGSXHGWD.js → chunk-K6IQBVD7.js} +2 -2
- package/dist/cli/chunks/{chunk-453UDYD2.js → chunk-KEJEZY2R.js} +163 -181
- package/dist/cli/chunks/{chunk-MTSMFEWK.js → chunk-KFE6LB4I.js} +2 -2
- package/dist/cli/chunks/{chunk-DDQWW22L.js → chunk-KO3WB4SU.js} +2 -2
- package/dist/cli/chunks/{chunk-ETGEGMYS.js → chunk-LAY35POY.js} +3 -3
- package/dist/cli/chunks/{chunk-P3NV6KN3.js → chunk-LFXXA325.js} +1 -1
- package/dist/cli/chunks/{chunk-ZK56THZT.js → chunk-LI3T5YNC.js} +3 -3
- package/dist/cli/chunks/{chunk-ACV2WVMX.js → chunk-LIEA5EON.js} +1 -1
- package/dist/cli/chunks/{chunk-KOOY72E3.js → chunk-LRJWKFGY.js} +2 -2
- package/dist/cli/chunks/{chunk-Y7TBCHW4.js → chunk-LY6PTRVL.js} +2 -2
- package/dist/cli/chunks/{chunk-WP6XUSVW.js → chunk-MAXOIEUG.js} +1 -1
- package/dist/cli/chunks/{chunk-X2L4POJE.js → chunk-MN6W7ZNL.js} +1 -1
- package/dist/cli/chunks/{chunk-CERSTEAJ.js → chunk-NGE5YNKC.js} +2 -2
- package/dist/cli/chunks/{chunk-J425SQFE.js → chunk-NIW4CLN2.js} +2 -2
- package/dist/cli/chunks/{chunk-PJ4HSXH3.js → chunk-NPT7BYGF.js} +1 -1
- package/dist/cli/chunks/{chunk-HHSEIPSQ.js → chunk-NZNXEEZR.js} +1 -1
- package/dist/cli/chunks/{chunk-FMULOSBL.js → chunk-O3IIAIXB.js} +1 -1
- package/dist/cli/chunks/{chunk-ITRUZ3WE.js → chunk-OC2W7KIW.js} +2 -2
- package/dist/cli/chunks/{chunk-QZQGYSDG.js → chunk-OFUF3APC.js} +2 -2
- package/dist/cli/chunks/{chunk-MKLLB4PM.js → chunk-OU52V67H.js} +4 -4
- package/dist/cli/chunks/{chunk-Y7UJC5OL.js → chunk-P2RR4SW5.js} +3 -3
- package/dist/cli/chunks/{chunk-7Q6CMSMD.js → chunk-P3VRXQ3H.js} +3 -3
- package/dist/cli/chunks/{chunk-YRP73HO4.js → chunk-P5SGBQLY.js} +1 -1
- package/dist/cli/chunks/{chunk-MDYI4IIW.js → chunk-P7MIOTVP.js} +1 -1
- package/dist/cli/chunks/{chunk-B4QA3YN6.js → chunk-PFDILSVO.js} +1 -1
- package/dist/cli/chunks/{chunk-2ZC7S4UG.js → chunk-PPD5ZLNA.js} +2 -2
- package/dist/cli/chunks/{chunk-VGYUVMSN.js → chunk-QFJDR4HC.js} +2 -2
- package/dist/cli/chunks/{chunk-3GWSHRDA.js → chunk-QZ2GQGJX.js} +2 -2
- package/dist/cli/chunks/{chunk-XMZ2DHUL.js → chunk-QZLTIGLB.js} +1 -1
- package/dist/cli/chunks/{chunk-BEOGI5FC.js → chunk-RHSUXQNF.js} +2 -2
- package/dist/cli/chunks/{chunk-ISVBO4XO.js → chunk-S6BWEZKK.js} +2 -2
- package/dist/cli/chunks/{chunk-AYOTODUV.js → chunk-SE4S23C7.js} +1 -1
- package/dist/cli/chunks/{chunk-SLWJNHCR.js → chunk-TOGZ37RL.js} +2 -2
- package/dist/cli/chunks/{chunk-73EWPVBJ.js → chunk-UCXW24HY.js} +2 -2
- package/dist/cli/chunks/{chunk-JQSA6EMI.js → chunk-UQ6WB4N2.js} +2 -2
- package/dist/cli/chunks/{chunk-SQPDGRYR.js → chunk-UQBGA4UA.js} +1 -1
- package/dist/cli/chunks/{chunk-N3R3JGUY.js → chunk-VNFL2TPU.js} +1 -1
- package/dist/cli/chunks/{chunk-QGBXENIP.js → chunk-WARFZ626.js} +1 -1
- package/dist/cli/chunks/{chunk-PVBJUANU.js → chunk-WEBHFIWS.js} +2 -2
- package/dist/cli/chunks/{chunk-YQIMO7VJ.js → chunk-WKIYYF3G.js} +2 -2
- package/dist/cli/chunks/{chunk-6VQKNPGY.js → chunk-WZC4HKGZ.js} +2 -2
- package/dist/cli/chunks/{chunk-O6FN53HB.js → chunk-X36TZXDK.js} +1 -1
- package/dist/cli/chunks/{chunk-IKNDGXZZ.js → chunk-XN4G3SRU.js} +2 -2
- package/dist/cli/chunks/{chunk-N7MKF4F4.js → chunk-XNREA3FG.js} +1 -1
- package/dist/cli/chunks/{chunk-PC3VIR2A.js → chunk-XRDPGJNW.js} +2 -2
- package/dist/cli/chunks/{chunk-ETZ62NFD.js → chunk-XXCSJMSR.js} +1 -1
- package/dist/cli/chunks/{chunk-LCDRRAES.js → chunk-XY2B2BEJ.js} +2 -2
- package/dist/cli/chunks/{chunk-HMSPPGUF.js → chunk-XY4JS3IZ.js} +2 -2
- package/dist/cli/chunks/{chunk-L7GQKJLV.js → chunk-Y4M2HMPR.js} +2 -2
- package/dist/cli/chunks/{chunk-2TUVBEWK.js → chunk-YDPBCN7H.js} +2 -2
- package/dist/cli/chunks/{chunk-NBTKI2TX.js → chunk-YGR54EAA.js} +2 -2
- package/dist/cli/chunks/{chunk-WBQEOACC.js → chunk-YGRY2TVI.js} +2 -2
- package/dist/cli/chunks/{chunk-VVJXQ4FR.js → chunk-YJUJCLXV.js} +2 -2
- package/dist/cli/chunks/{chunk-SHW43QQV.js → chunk-YWG4LHFU.js} +2 -2
- package/dist/cli/chunks/{chunk-FGOVDO3R.js → chunk-Z2QNTRUX.js} +2 -2
- package/dist/cli/chunks/{chunk-UFMW25MS.js → chunk-ZBJMVWQR.js} +2 -2
- package/dist/cli/chunks/{chunk-7MBF3S25.js → chunk-ZH6HYT7C.js} +1 -1
- package/dist/cli/chunks/{chunk-LYV7WJWA.js → chunk-ZP2GE6DM.js} +1 -1
- package/dist/cli/chunks/{chunk-JNX7IRSI.js → chunk-ZQYEBLTL.js} +2 -2
- package/dist/cli/chunks/{chunk-FTOICJQG.js → chunk-ZRU3OZEU.js} +2 -2
- package/dist/cli/chunks/{chunk-OZQIDDXB.js → chunk-ZU3V4CJ4.js} +2 -2
- package/dist/cli/chunks/{chunk-JZFA2PWY.js → chunk-ZWMXF6AX.js} +2 -2
- package/dist/cli/chunks/{ci-4JK2NFCD.js → ci-SM3EVLZ4.js} +2 -2
- package/dist/cli/chunks/{ci-output-LCGTJQWC.js → ci-output-YYXICZBC.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-EJF7D3L4.js → circuit-breaker-CV5UGKXT.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-3RUC6OB4.js → claude-flow-setup-BSBUZ4B7.js} +2 -2
- package/dist/cli/chunks/client-WRDYZGM2.js +2 -0
- package/dist/cli/chunks/{cline-installer-6LY5C5QH.js → cline-installer-P2O6STIC.js} +2 -2
- package/dist/cli/chunks/code-M7DDLBGS.js +58 -0
- package/dist/cli/chunks/{code-index-extractor-OY5GQJBM.js → code-index-extractor-3QZIUYOG.js} +2 -2
- package/dist/cli/chunks/{codex-installer-BO7E2ZVA.js → codex-installer-5JVZCCTC.js} +2 -2
- package/dist/cli/chunks/{completions-VGL3KJ2R.js → completions-EM7IL2BJ.js} +8 -5
- package/dist/cli/chunks/{complexity-analyzer-5DPUK7IL.js → complexity-analyzer-VJXVB2CV.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-LFDG2D42.js → continuedev-installer-RCKJIAEC.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-SEMMMIZH.js → copilot-installer-DZ7LTDOZ.js} +2 -2
- package/dist/cli/chunks/core-handlers-O6E5DNHT.js +2 -0
- package/dist/cli/chunks/{cost-tracker-OPBC6FQM.js → cost-tracker-QLOLXVAM.js} +2 -2
- package/dist/cli/chunks/{coverage-CFDUSRKU.js → coverage-LYHTLWRV.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-EV7LQMDO.js +2 -0
- package/dist/cli/chunks/{cursor-installer-6TXUUVY4.js → cursor-installer-PSIZ3Y53.js} +2 -2
- package/dist/cli/chunks/{daemon-5KO46YQR.js → daemon-IYDTMA5M.js} +4 -4
- package/dist/cli/chunks/{daemon-7BDBPPAF.js → daemon-YLOAXM4X.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-6DQKZOUW.js → dag-attention-scheduler-I2UIO3Z7.js} +2 -2
- package/dist/cli/chunks/{detect-R2QAYDPI.js → detect-ZXQ7X7GZ.js} +2 -2
- package/dist/cli/chunks/{dist-node-3POCIJ4N.js → dist-node-GK6OZX4H.js} +2 -2
- package/dist/cli/chunks/{domain-handler-KW63CHUH.js → domain-handler-NS3IBLRQ.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-2QPOJCUD.js → domain-transfer-5G4RZEWF.js} +2 -2
- package/dist/cli/chunks/dream-E4C236UL.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-OIDJZQEP.js → embed-and-insert-pattern-V4JJUFR6.js} +2 -2
- package/dist/cli/chunks/{eval-UGEKTTAQ.js → eval-7Q6PPYKR.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-3BIM2TT7.js → experience-capture-middleware-DUBKSYFM.js} +3 -3
- package/dist/cli/chunks/{fast-paths-HCJQXB7W.js → fast-paths-IDPPMBUW.js} +2 -2
- package/dist/cli/chunks/{feature-flags-W4JSFBMV.js → feature-flags-EPTMAAKA.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GDGJKLN4.js → feature-flags-KXI6FDY7.js} +2 -2
- package/dist/cli/chunks/{file-discovery-JMUZ4MUH.js → file-discovery-EDX2OJO7.js} +2 -2
- package/dist/cli/chunks/{fleet-YNNK2CKW.js → fleet-67BO3LJ4.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-R2ZY6CDD.js → gnn-wrapper-YARORYT7.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-OZX2EJHQ.js → heartbeat-handler-K3JGPBYR.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-WMADLDKT.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-STRDGJ65.js +2 -0
- package/dist/cli/chunks/hnsw-index-DBHX3TSC.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-3S6TYCG3.js → hnsw-legacy-bridge-CDDRSV5E.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-RIBLRHJL.js → hnswlib-node-2KL54YUA.js} +2 -2
- package/dist/cli/chunks/{hooks-KM7WR35T.js → hooks-6SCAE6LC.js} +10 -10
- package/dist/cli/chunks/hybrid-router-L2K55I4T.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-RX53A73M.js → hypergraph-engine-I3LUMO7I.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-3QQB3H3Z.js → hypergraph-handler-YAKAIVCN.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-WMO7ZGS7.js +2 -0
- package/dist/cli/chunks/{init-handler-Y62RH4ZI.js → init-handler-NBKCZD7Q.js} +6 -6
- package/dist/cli/chunks/init-wizard-ZAB7UZZS.js +2 -0
- package/dist/cli/chunks/kernel-4MUFDEQI.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-26R253L2.js → kilocode-installer-YGPJCPU3.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-PFA5QPZZ.js → kiro-installer-JV3ONVMN.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-GZRFGXLX.js +2 -0
- package/dist/cli/chunks/{learning-CQLM5ANX.js → learning-2FEZJ5CX.js} +3 -3
- package/dist/cli/chunks/{llm-router-QZ5PG4PF.js → llm-router-SILI4KLU.js} +4 -4
- package/dist/cli/chunks/llm-router-service-5ODLU5U5.js +2 -0
- package/dist/cli/chunks/{load-UPA6LPHM.js → load-EGXLQVR3.js} +2 -2
- package/dist/cli/chunks/load-test-ZDQFS5XS.js +2 -0
- package/dist/cli/chunks/{mcp-LSWTLAJ4.js → mcp-OJH775TL.js} +2 -2
- package/dist/cli/chunks/{memory-VGEYYGCG.js → memory-FNEOK4FW.js} +5 -5
- package/dist/cli/chunks/memory-backend-UK7SQ6ZM.js +2 -0
- package/dist/cli/chunks/{memory-handlers-QBURG7NA.js → memory-handlers-6LDUH3JZ.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-VZVFBIKC.js → multi-model-executor-ORTFWLLE.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-PBQAXNLV.js → opencode-installer-UAQLW6XX.js} +2 -2
- package/dist/cli/chunks/{orchestrator-YND7JB5O.js → orchestrator-VE5KJ2V4.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-LO2QTIBU.js +2 -0
- package/dist/cli/chunks/{pipeline-GM5RRUES.js → pipeline-FNMDRWTU.js} +2 -2
- package/dist/cli/chunks/{platform-L7OGGRSL.js → platform-MGAKRUQN.js} +2 -2
- package/dist/cli/chunks/{plugin-N4YAE6H5.js → plugin-YX7THX3I.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-7D67XV6Z.js → prime-radiant-advanced-wasm-XJV4RLMK.js} +2 -2
- package/dist/cli/chunks/protocol-executor-JWMYQEOI.js +2 -0
- package/dist/cli/chunks/{protocol-handler-V2WTFU7N.js → protocol-handler-QFET442Y.js} +2 -2
- package/dist/cli/chunks/{prove-33DS5Z3N.js → prove-QBAESCOC.js} +2 -2
- package/dist/cli/chunks/provider-manager-PEXOHGNB.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-7B2G4UGQ.js +2 -0
- package/dist/cli/chunks/{quality-WCSEA5GH.js → quality-ZTNRL6EG.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-6OF4HT3S.js +2 -0
- package/dist/cli/chunks/{real-embeddings-OQ5F37DG.js → real-embeddings-ZFFDV6HC.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-II7LIR2X.js → roocode-installer-J4LFL4AE.js} +2 -2
- package/dist/cli/chunks/router-GMWRF6DU.js +2 -0
- package/dist/cli/chunks/routing-feedback-XKJSQK3I.js +2 -0
- package/dist/cli/chunks/{routing-handler-6OFHARIY.js → routing-handler-A5QG2TP2.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-GD5JTR4M.js → ruvector-commands-J5JL5WX5.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-HSK6BYZV.js → rvf-dual-writer-H7442GMO.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-554SMF5S.js → rvf-migration-adapter-PTFQUYKC.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-OFDBCAYE.js → rvf-migration-coordinator-RSNROYRX.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-YEA6TMXB.js +2 -0
- package/dist/cli/chunks/safe-db-5DOP2J3V.js +2 -0
- package/dist/cli/chunks/schedule-SUWTOBHP.js +2 -0
- package/dist/cli/chunks/scheduler-P4VTC5SQ.js +2 -0
- package/dist/cli/chunks/{security-GN4J6DSS.js → security-LHHLMCBA.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-Q4PM3QCN.js → shared-rvf-adapter-NPSHVUTM.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-R5WK5BXQ.js → shared-rvf-dual-writer-INQDY5WE.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-5Z2RAXH7.js +2 -0
- package/dist/cli/chunks/{status-handler-AHS5WVMG.js → status-handler-R2KIAMAE.js} +2 -2
- package/dist/cli/chunks/{structural-health-5KUKNLHZ.js → structural-health-2VPPIOZX.js} +2 -2
- package/dist/cli/chunks/{sync-PUMM3SR6.js → sync-ASZ3T5GT.js} +2 -2
- package/dist/cli/chunks/{sync-TQLGD5HX.js → sync-NLASP7AK.js} +2 -2
- package/dist/cli/chunks/{task-handler-D7VXV4AF.js → task-handler-UV5R6LJG.js} +2 -2
- package/dist/cli/chunks/{task-handlers-QMN4SWUG.js → task-handlers-I6YJXPYP.js} +3 -3
- package/dist/cli/chunks/{test-HEWZR6YQ.js → test-TE43TNTI.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-VTMLBEPA.js → test-scheduling-WWWWF2TZ.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-IYBG7PQ6.js → token-bootstrap-HEWP7KKS.js} +2 -2
- package/dist/cli/chunks/{token-usage-C7H27BFZ.js → token-usage-3FVHUAW6.js} +2 -2
- package/dist/cli/chunks/{transformers-5ZJVC6NB.js → transformers-O5OFM4XM.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-EARBJG2H.js → tree-sitter-wasm-parser-YOYWFW63.js} +2 -2
- package/dist/cli/chunks/{types-3IHE42PZ.js → types-42GR6PLO.js} +2 -2
- package/dist/cli/chunks/unified-memory-HCKOPFAY.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-6NQPYA5C.js +2 -0
- package/dist/cli/chunks/unified-persistence-NIMKNAFR.js +2 -0
- package/dist/cli/chunks/{upgrade-YP3VFSXO.js → upgrade-BU6DJ4LT.js} +2 -2
- package/dist/cli/chunks/{validate-VSBNKPN6.js → validate-MPTBARGN.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-GOCJVWXE.js → validate-swarm-5LUQYHPP.js} +2 -2
- package/dist/cli/chunks/{vibium-U6YKCLDF.js → vibium-MJJDANDL.js} +2 -2
- package/dist/cli/chunks/visual-security-HFGHA57Z.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-TSNVGWSN.js → web-tree-sitter-5TF4UGB3.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-2VKMEFSD.js → windsurf-installer-NQAOSVCN.js} +2 -2
- package/dist/cli/chunks/{witness-chain-BWZCW52H.js → witness-chain-23UWK2JT.js} +2 -2
- package/dist/cli/chunks/witness-chain-VZGGJ7TJ.js +2 -0
- package/dist/cli/chunks/{workflow-J6SCYLU3.js → workflow-3QOLXRJC.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-45L7D4SN.js +2 -0
- package/dist/cli/chunks/{wrappers-M5C7DONW.js → wrappers-S6EUZBCX.js} +2 -2
- package/dist/cli/commands/code.js +78 -2
- package/dist/cli/completions/index.js +4 -1
- package/dist/domains/code-intelligence/coordinator.js +8 -4
- package/dist/domains/code-intelligence/services/c4-model/from-detected.d.ts +41 -0
- package/dist/domains/code-intelligence/services/c4-model/from-detected.js +152 -0
- package/dist/domains/code-intelligence/services/c4-model/kg-relationships.d.ts +71 -0
- package/dist/domains/code-intelligence/services/c4-model/kg-relationships.js +87 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +6 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.js +3 -3
- package/dist/domains/code-intelligence/services/product-factors-bridge.d.ts +26 -5
- package/dist/domains/code-intelligence/services/product-factors-bridge.js +72 -65
- package/dist/domains/requirements-validation/coordinator.d.ts +16 -2
- package/dist/domains/requirements-validation/coordinator.js +112 -7
- package/dist/domains/requirements-validation/plugin.js +20 -1
- package/dist/domains/test-generation/coordinator.d.ts +3 -1
- package/dist/domains/test-generation/coordinator.js +15 -33
- package/dist/integrations/darwin/types.d.ts +10 -3
- package/dist/integrations/darwin/types.js +10 -3
- package/dist/mcp/bundle.js +446 -464
- package/dist/mcp/tool-scoping.d.ts +8 -2
- package/dist/mcp/tool-scoping.js +13 -0
- package/dist/mcp/tools/code-intelligence/c4.d.ts +56 -0
- package/dist/mcp/tools/code-intelligence/c4.js +145 -0
- package/dist/mcp/tools/index.d.ts +1 -0
- package/dist/mcp/tools/index.js +1 -0
- package/dist/mcp/tools/registry.d.ts +1 -0
- package/dist/mcp/tools/registry.js +3 -0
- package/dist/routing/free-tier/coordinator-support.d.ts +90 -0
- package/dist/routing/free-tier/coordinator-support.js +78 -0
- package/dist/routing/free-tier/executor.d.ts +43 -1
- package/dist/routing/free-tier/executor.js +69 -26
- package/dist/routing/free-tier/index.d.ts +1 -0
- package/dist/routing/free-tier/index.js +1 -0
- package/dist/routing/value-score.d.ts +49 -0
- package/dist/routing/value-score.js +54 -0
- package/dist/shared/c4-model/confidence.d.ts +38 -0
- package/dist/shared/c4-model/confidence.js +69 -0
- package/dist/shared/c4-model/index.d.ts +4 -0
- package/dist/shared/c4-model/index.js +1 -0
- package/dist/shared/optional-module.d.ts +23 -0
- package/dist/shared/optional-module.js +46 -0
- package/dist/verification/adversarial-verify/calibrate.d.ts +32 -0
- package/dist/verification/adversarial-verify/calibrate.js +33 -0
- package/dist/verification/adversarial-verify/gate.d.ts +38 -0
- package/dist/verification/adversarial-verify/gate.js +32 -0
- package/dist/verification/adversarial-verify/index.d.ts +20 -0
- package/dist/verification/adversarial-verify/index.js +6 -0
- package/dist/verification/adversarial-verify/prompts.d.ts +14 -0
- package/dist/verification/adversarial-verify/prompts.js +17 -0
- package/dist/verification/adversarial-verify/synthesize.d.ts +18 -0
- package/dist/verification/adversarial-verify/synthesize.js +35 -0
- package/dist/verification/adversarial-verify/types.d.ts +59 -0
- package/dist/verification/adversarial-verify/types.js +10 -0
- package/dist/verification/adversarial-verify/verify.d.ts +20 -0
- package/dist/verification/adversarial-verify/verify.js +34 -0
- package/package.json +10 -1
- package/dist/cli/chunks/adapter-WLFT5VMV.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-JBH4GZUM.js +0 -2
- package/dist/cli/chunks/base-A7JGM473.js +0 -2
- package/dist/cli/chunks/browser-workflow-TIDJWULK.js +0 -2
- package/dist/cli/chunks/chunk-C4OYHUJV.js +0 -2
- package/dist/cli/chunks/client-ZLJ3JMBC.js +0 -2
- package/dist/cli/chunks/code-MPDG4UHS.js +0 -39
- package/dist/cli/chunks/core-handlers-EM7FUYTI.js +0 -2
- package/dist/cli/chunks/cross-domain-router-DYGHQ6P5.js +0 -2
- package/dist/cli/chunks/dream-DBE5D5BD.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-NFHAANNL.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-HMPCZFBY.js +0 -2
- package/dist/cli/chunks/hnsw-index-KRIWSXX4.js +0 -2
- package/dist/cli/chunks/hybrid-router-BAB32B2W.js +0 -2
- package/dist/cli/chunks/impact-analyzer-3D6XHWQE.js +0 -2
- package/dist/cli/chunks/init-wizard-LLU3WVGC.js +0 -2
- package/dist/cli/chunks/kernel-ZFHAYHHJ.js +0 -2
- package/dist/cli/chunks/knowledge-graph-ETZ65KOY.js +0 -2
- package/dist/cli/chunks/llm-router-service-R6CTGF5I.js +0 -2
- package/dist/cli/chunks/load-test-UOWIJUCH.js +0 -2
- package/dist/cli/chunks/memory-backend-E3ZQKW7A.js +0 -2
- package/dist/cli/chunks/pattern-null-store-OUOJO2RH.js +0 -2
- package/dist/cli/chunks/protocol-executor-KHAPG5CP.js +0 -2
- package/dist/cli/chunks/provider-manager-FGPPW7T4.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-TS7XOJDA.js +0 -2
- package/dist/cli/chunks/queen-coordinator-J35FNFQ3.js +0 -2
- package/dist/cli/chunks/router-AFTKPDI5.js +0 -2
- package/dist/cli/chunks/routing-feedback-SABZUJTF.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-57MDDSFQ.js +0 -2
- package/dist/cli/chunks/safe-db-2HR6MVYM.js +0 -2
- package/dist/cli/chunks/schedule-KLVAN6XI.js +0 -2
- package/dist/cli/chunks/scheduler-WYZ6BC5Y.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-2CGU5INO.js +0 -2
- package/dist/cli/chunks/unified-memory-PMYRQC5K.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-7TRL2K5Q.js +0 -2
- package/dist/cli/chunks/unified-persistence-S4BNJK4S.js +0 -2
- package/dist/cli/chunks/visual-security-RPMZ3J7L.js +0 -2
- package/dist/cli/chunks/witness-chain-BTDZSQ6P.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-42B62D3V.js +0 -2
|
@@ -18,8 +18,10 @@ import * as fs from 'fs/promises';
|
|
|
18
18
|
import { ok, err } from '../../../shared/types';
|
|
19
19
|
import { CodeIntelligenceEvents, createEvent, } from '../../../shared/events/domain-events';
|
|
20
20
|
import { toError } from '../../../shared/error-utils.js';
|
|
21
|
-
import { isCacheValid, sanitizeId, inferComponentType, } from '../../../shared/c4-model';
|
|
21
|
+
import { isCacheValid, sanitizeId, inferComponentType, assessC4Confidence, } from '../../../shared/c4-model';
|
|
22
22
|
import { safeJsonParse } from '../../../shared/safe-json.js';
|
|
23
|
+
import { C4ModelService } from './c4-model';
|
|
24
|
+
import { toContextRequest, toContainerRequest, toComponentRequest, } from './c4-model/from-detected';
|
|
23
25
|
const DEFAULT_CONFIG = {
|
|
24
26
|
cacheTtlMs: 3600000, // 1 hour
|
|
25
27
|
publishEvents: true,
|
|
@@ -96,11 +98,26 @@ export class ProductFactorsBridgeService {
|
|
|
96
98
|
config;
|
|
97
99
|
initialized = false;
|
|
98
100
|
eventSubscriptions = [];
|
|
101
|
+
/** ADR-112: the consolidated render+analyze+store engine (lazily built). */
|
|
102
|
+
c4Service;
|
|
99
103
|
constructor(eventBus, memory, config = {}) {
|
|
100
104
|
this.eventBus = eventBus;
|
|
101
105
|
this.memory = memory;
|
|
102
106
|
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
103
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* ADR-112: lazily construct the shared C4ModelService.
|
|
110
|
+
* Embeddings are OFF on this internal product-factors path (keeps it offline +
|
|
111
|
+
* fast); the CLI/MCP surfaces opt embeddings in when semantic search is wanted.
|
|
112
|
+
*/
|
|
113
|
+
getC4Service() {
|
|
114
|
+
if (!this.c4Service) {
|
|
115
|
+
this.c4Service = new C4ModelService(this.memory, {
|
|
116
|
+
enableEmbeddings: this.config.enableC4Embeddings ?? false,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return this.c4Service;
|
|
120
|
+
}
|
|
104
121
|
// ==========================================================================
|
|
105
122
|
// Lifecycle
|
|
106
123
|
// ==========================================================================
|
|
@@ -130,7 +147,7 @@ export class ProductFactorsBridgeService {
|
|
|
130
147
|
const sub2 = this.eventBus.subscribe(CodeIntelligenceEvents.ImpactAnalysisCompleted, this.handleImpactAnalysisCompleted.bind(this));
|
|
131
148
|
this.eventSubscriptions.push(sub2);
|
|
132
149
|
}
|
|
133
|
-
async handleKnowledgeGraphUpdated(
|
|
150
|
+
async handleKnowledgeGraphUpdated(_event) {
|
|
134
151
|
// Invalidate relevant caches when knowledge graph is updated
|
|
135
152
|
logger.info('[ProductFactorsBridge] Knowledge graph updated, considering cache invalidation');
|
|
136
153
|
// Note: We don't have project path in this event, so we rely on hash-based invalidation
|
|
@@ -198,30 +215,40 @@ export class ProductFactorsBridgeService {
|
|
|
198
215
|
if (request.analyzeCoupling && components.length > 1) {
|
|
199
216
|
couplingAnalysis = this.analyzeCoupling(components, relationships);
|
|
200
217
|
}
|
|
201
|
-
// Generate diagrams
|
|
218
|
+
// Generate diagrams. ADR-112: the three C4 levels render through the
|
|
219
|
+
// consolidated C4ModelService (richer + stored + searchable); the bridge
|
|
220
|
+
// keeps only detection. Inline generators remain as a safety fallback.
|
|
202
221
|
const diagrams = {};
|
|
203
222
|
if (request.includeContext !== false) {
|
|
204
|
-
diagrams.context = this.
|
|
223
|
+
diagrams.context = await this.renderContext(projectInfo, externalSystems);
|
|
205
224
|
}
|
|
206
225
|
if (request.includeContainer !== false) {
|
|
207
|
-
diagrams.container = this.
|
|
226
|
+
diagrams.container = await this.renderContainer(projectInfo, externalSystems);
|
|
208
227
|
}
|
|
209
228
|
if (request.includeComponent !== false && components.length > 0) {
|
|
210
|
-
diagrams.component = this.
|
|
229
|
+
diagrams.component = await this.renderComponent(projectInfo, components, relationships);
|
|
211
230
|
}
|
|
212
231
|
if (request.includeDependency && components.length > 0) {
|
|
213
232
|
diagrams.dependency = this.generateDependencyGraph(components, relationships);
|
|
214
233
|
}
|
|
234
|
+
const filesAnalyzed = components.reduce((sum, c) => sum + c.files.length, 0);
|
|
215
235
|
const metadata = {
|
|
216
236
|
projectName: projectInfo.name,
|
|
217
237
|
projectDescription: projectInfo.description,
|
|
218
238
|
generatedAt: new Date(),
|
|
219
239
|
source: 'codebase-analysis',
|
|
220
240
|
analysisMetadata: {
|
|
221
|
-
filesAnalyzed
|
|
241
|
+
filesAnalyzed,
|
|
222
242
|
componentsDetected: components.length,
|
|
223
243
|
externalSystemsDetected: externalSystems.length,
|
|
224
244
|
analysisTimeMs: Date.now() - startTime,
|
|
245
|
+
// ADR-112: deterministic confidence gate — never present a wrong diagram as truth.
|
|
246
|
+
confidence: assessC4Confidence({
|
|
247
|
+
componentsDetected: components.length,
|
|
248
|
+
relationshipsDetected: relationships.length,
|
|
249
|
+
externalSystemsDetected: externalSystems.length,
|
|
250
|
+
filesAnalyzed,
|
|
251
|
+
}),
|
|
225
252
|
},
|
|
226
253
|
};
|
|
227
254
|
return ok({
|
|
@@ -239,70 +266,37 @@ export class ProductFactorsBridgeService {
|
|
|
239
266
|
}
|
|
240
267
|
}
|
|
241
268
|
// ==========================================================================
|
|
242
|
-
//
|
|
269
|
+
// ADR-112: render via the consolidated C4ModelService (the single engine).
|
|
270
|
+
// On failure we FAIL LOUD — propagate the error so the caller surfaces it —
|
|
271
|
+
// rather than silently degrading to a weaker inline diagram. A masked render
|
|
272
|
+
// failure is worse than a surfaced one (ADR-050: no silent degradation).
|
|
243
273
|
// ==========================================================================
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
System(system, "${project.name}", "${project.description}")
|
|
250
|
-
`;
|
|
251
|
-
for (const sys of externalSystems) {
|
|
252
|
-
mermaid += ` System_Ext(${sys.id}, "${sys.name}", "${sys.type}")
|
|
253
|
-
`;
|
|
254
|
-
}
|
|
255
|
-
mermaid += `
|
|
256
|
-
Rel(user, system, "Uses")
|
|
257
|
-
`;
|
|
258
|
-
for (const sys of externalSystems) {
|
|
259
|
-
mermaid += ` Rel(system, ${sys.id}, "${sys.relationship}")
|
|
260
|
-
`;
|
|
274
|
+
async renderContext(projectInfo, externalSystems) {
|
|
275
|
+
const res = await this.getC4Service().buildContext(toContextRequest(projectInfo, externalSystems));
|
|
276
|
+
if (!res.success) {
|
|
277
|
+
logger.error('[ProductFactorsBridge] C4 context render failed', res.error);
|
|
278
|
+
throw res.error;
|
|
261
279
|
}
|
|
262
|
-
return mermaid;
|
|
280
|
+
return res.value.mermaid;
|
|
263
281
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
Container_Boundary(c1, "${project.name}") {
|
|
271
|
-
Container(app, "Application", "TypeScript", "Main application")
|
|
272
|
-
}
|
|
273
|
-
`;
|
|
274
|
-
for (const sys of externalSystems) {
|
|
275
|
-
mermaid += ` System_Ext(${sys.id}, "${sys.name}", "${sys.type}")
|
|
276
|
-
`;
|
|
277
|
-
}
|
|
278
|
-
mermaid += `
|
|
279
|
-
Rel(user, app, "Uses")
|
|
280
|
-
`;
|
|
281
|
-
for (const sys of externalSystems) {
|
|
282
|
-
mermaid += ` Rel(app, ${sys.id}, "${sys.relationship}")
|
|
283
|
-
`;
|
|
282
|
+
async renderContainer(projectInfo, externalSystems) {
|
|
283
|
+
const res = await this.getC4Service().buildContainer(toContainerRequest(projectInfo, externalSystems));
|
|
284
|
+
if (!res.success) {
|
|
285
|
+
logger.error('[ProductFactorsBridge] C4 container render failed', res.error);
|
|
286
|
+
throw res.error;
|
|
284
287
|
}
|
|
285
|
-
return mermaid;
|
|
288
|
+
return res.value.mermaid;
|
|
286
289
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
`;
|
|
293
|
-
for (const comp of components) {
|
|
294
|
-
const responsibility = comp.responsibilities?.[0] || '';
|
|
295
|
-
mermaid += ` Component(${comp.id}, "${comp.name}", "${comp.technology || 'TypeScript'}", "${responsibility}")
|
|
296
|
-
`;
|
|
297
|
-
}
|
|
298
|
-
mermaid += ` }
|
|
299
|
-
`;
|
|
300
|
-
for (const rel of relationships) {
|
|
301
|
-
mermaid += ` Rel(${rel.sourceId}, ${rel.targetId}, "${rel.type}")
|
|
302
|
-
`;
|
|
290
|
+
async renderComponent(projectInfo, components, relationships) {
|
|
291
|
+
const res = await this.getC4Service().buildComponent(toComponentRequest(components, relationships));
|
|
292
|
+
if (!res.success) {
|
|
293
|
+
logger.error('[ProductFactorsBridge] C4 component render failed', res.error);
|
|
294
|
+
throw res.error;
|
|
303
295
|
}
|
|
304
|
-
return mermaid;
|
|
296
|
+
return res.value.mermaid;
|
|
305
297
|
}
|
|
298
|
+
// The dependency graph is NOT a C4 level and C4ModelService does not render
|
|
299
|
+
// it, so this stays as the bridge's own renderer.
|
|
306
300
|
generateDependencyGraph(components, relationships) {
|
|
307
301
|
let mermaid = `graph TD
|
|
308
302
|
`;
|
|
@@ -439,6 +433,19 @@ export class ProductFactorsBridgeService {
|
|
|
439
433
|
catch (error) {
|
|
440
434
|
logger.error('Component analysis failed:', error instanceof Error ? error : undefined);
|
|
441
435
|
}
|
|
436
|
+
// ADR-112 C2: prefer REAL KG-derived edges (AST import/call graph) over the
|
|
437
|
+
// naming heuristic. The resolver returns null on any miss → heuristic stands.
|
|
438
|
+
if (this.config.relationshipResolver && components.length > 0) {
|
|
439
|
+
try {
|
|
440
|
+
const resolved = await this.config.relationshipResolver(components, projectPath);
|
|
441
|
+
if (resolved && resolved.length > 0) {
|
|
442
|
+
return { components, relationships: resolved };
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
catch (error) {
|
|
446
|
+
logger.debug(`KG relationship resolver failed; using heuristic: ${toError(error).message}`);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
442
449
|
return { components, relationships };
|
|
443
450
|
}
|
|
444
451
|
shouldExclude(name) {
|
|
@@ -473,7 +480,7 @@ export class ProductFactorsBridgeService {
|
|
|
473
480
|
}
|
|
474
481
|
}
|
|
475
482
|
}
|
|
476
|
-
catch
|
|
483
|
+
catch {
|
|
477
484
|
// Non-critical: permission errors when scanning directories
|
|
478
485
|
logger.debug('Directory scan error:');
|
|
479
486
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { Result } from '../../shared/types/index.js';
|
|
10
10
|
import { EventBus, MemoryBackend, AgentCoordinator } from '../../kernel/interfaces.js';
|
|
11
11
|
import type { HybridRouter } from '../../shared/llm/router/hybrid-router.js';
|
|
12
|
+
import { type FreeTierCoordinatorConfig, type RoutingFeedbackLike } from '../../routing/free-tier/index.js';
|
|
12
13
|
import { IRequirementsValidationCoordinator, RequirementAnalysis, TestArtifacts, SprintValidation } from './interfaces.js';
|
|
13
14
|
import { BaseDomainCoordinator, type BaseDomainCoordinatorConfig } from '../base-domain-coordinator.js';
|
|
14
15
|
import { type DomainFinding } from '../../coordination/consensus/domain-findings.js';
|
|
@@ -22,7 +23,7 @@ export declare const RequirementsValidationEvents: {
|
|
|
22
23
|
/**
|
|
23
24
|
* CQ-002: Extends BaseDomainCoordinatorConfig — removes duplicate fields
|
|
24
25
|
*/
|
|
25
|
-
export interface CoordinatorConfig extends BaseDomainCoordinatorConfig {
|
|
26
|
+
export interface CoordinatorConfig extends BaseDomainCoordinatorConfig, FreeTierCoordinatorConfig {
|
|
26
27
|
minTestabilityThreshold: number;
|
|
27
28
|
enablePPO: boolean;
|
|
28
29
|
enableSONA: boolean;
|
|
@@ -45,10 +46,14 @@ export declare class RequirementsValidationCoordinator extends BaseDomainCoordin
|
|
|
45
46
|
private readonly bddWriter;
|
|
46
47
|
private readonly testabilityScorer;
|
|
47
48
|
private readonly repository;
|
|
49
|
+
/** Opt-in cheap-first BDD scenario generation (plan 06, ADR-111). Null = off. */
|
|
50
|
+
private readonly freeTierExecutor;
|
|
48
51
|
private ppoAlgorithm?;
|
|
49
52
|
private sonaEngine?;
|
|
50
53
|
private rlInitialized;
|
|
51
|
-
constructor(eventBus: EventBus, memory: MemoryBackend, agentCoordinator: AgentCoordinator, config?: Partial<CoordinatorConfig>, llmRouter?: HybridRouter
|
|
54
|
+
constructor(eventBus: EventBus, memory: MemoryBackend, agentCoordinator: AgentCoordinator, config?: Partial<CoordinatorConfig>, llmRouter?: HybridRouter,
|
|
55
|
+
/** Optional D9 sink — when provided, free-tier outcomes feed routing-feedback. */
|
|
56
|
+
routingFeedback?: RoutingFeedbackLike | null);
|
|
52
57
|
/**
|
|
53
58
|
* Initialize the coordinator
|
|
54
59
|
* CQ-002: Domain-specific initialization
|
|
@@ -74,6 +79,15 @@ export declare class RequirementsValidationCoordinator extends BaseDomainCoordin
|
|
|
74
79
|
/**
|
|
75
80
|
* Generate test artifacts from requirement
|
|
76
81
|
*/
|
|
82
|
+
/**
|
|
83
|
+
* Cheap-first BDD generation (plan 06 broadening; ADR-111 escalation lane).
|
|
84
|
+
* Generates raw Gherkin on the free local tier (best-effort), verifies Gherkin
|
|
85
|
+
* STRUCTURE as the objective oracle (§10 — never the model's own judgement),
|
|
86
|
+
* parses it back into structured scenarios, and escalates the hard tail via the
|
|
87
|
+
* router. Returns null when off or nothing usable → caller falls back to the
|
|
88
|
+
* normal structured path. Off by default.
|
|
89
|
+
*/
|
|
90
|
+
private tryFreeTierScenarios;
|
|
77
91
|
generateTestArtifacts(requirementId: string): Promise<Result<TestArtifacts>>;
|
|
78
92
|
/**
|
|
79
93
|
* Validate sprint requirements
|
|
@@ -10,6 +10,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
10
10
|
import { LoggerFactory } from '../../logging/index.js';
|
|
11
11
|
import { ok, err } from '../../shared/types/index.js';
|
|
12
12
|
import { toError } from '../../shared/error-utils.js';
|
|
13
|
+
import { buildFreeTierExecutor, } from '../../routing/free-tier/index.js';
|
|
13
14
|
import { createEvent } from '../../shared/events/domain-events.js';
|
|
14
15
|
import { RequirementsValidatorService } from './services/requirements-validator.js';
|
|
15
16
|
import { BDDScenarioWriterService } from './services/bdd-scenario-writer.js';
|
|
@@ -93,6 +94,25 @@ class InMemoryRequirementRepository {
|
|
|
93
94
|
* CQ-002: Extends BaseDomainCoordinator
|
|
94
95
|
*/
|
|
95
96
|
const logger = LoggerFactory.create('requirements-validation');
|
|
97
|
+
/** Strip a ```gherkin fence (truncation-robust); else return the text as-is. */
|
|
98
|
+
function stripGherkinFence(s) {
|
|
99
|
+
s = (s ?? '').trim();
|
|
100
|
+
const full = /```(?:gherkin|feature)?\s*([\s\S]*?)```/.exec(s);
|
|
101
|
+
if (full)
|
|
102
|
+
return full[1].trim();
|
|
103
|
+
const open = /```(?:gherkin|feature)?[^\n]*\n([\s\S]*)$/.exec(s);
|
|
104
|
+
return open ? open[1].trim() : s;
|
|
105
|
+
}
|
|
106
|
+
const GHERKIN_STOPWORDS = new Set([
|
|
107
|
+
'given', 'when', 'then', 'scenario', 'feature', 'with', 'that', 'this', 'from', 'into',
|
|
108
|
+
'should', 'must', 'have', 'will', 'shall', 'able', 'user', 'users', 'system', 'value',
|
|
109
|
+
'valid', 'invalid', 'returns', 'return', 'apply', 'using', 'based', 'their', 'they',
|
|
110
|
+
]);
|
|
111
|
+
/** Significant lowercased terms (>3 chars, non-stopword) from a requirement. */
|
|
112
|
+
function significantTerms(requirement) {
|
|
113
|
+
const src = `${requirement.title} ${(requirement.acceptanceCriteria ?? []).join(' ')}`.toLowerCase();
|
|
114
|
+
return Array.from(new Set(src.match(/[a-z][a-z0-9]{3,}/g) ?? [])).filter((w) => !GHERKIN_STOPWORDS.has(w));
|
|
115
|
+
}
|
|
96
116
|
export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
97
117
|
memory;
|
|
98
118
|
agentCoordinator;
|
|
@@ -100,11 +120,15 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
100
120
|
bddWriter;
|
|
101
121
|
testabilityScorer;
|
|
102
122
|
repository;
|
|
123
|
+
/** Opt-in cheap-first BDD scenario generation (plan 06, ADR-111). Null = off. */
|
|
124
|
+
freeTierExecutor;
|
|
103
125
|
// V3: RL and SONA integrations
|
|
104
126
|
ppoAlgorithm;
|
|
105
127
|
sonaEngine;
|
|
106
128
|
rlInitialized = false;
|
|
107
|
-
constructor(eventBus, memory, agentCoordinator, config = {}, llmRouter
|
|
129
|
+
constructor(eventBus, memory, agentCoordinator, config = {}, llmRouter,
|
|
130
|
+
/** Optional D9 sink — when provided, free-tier outcomes feed routing-feedback. */
|
|
131
|
+
routingFeedback) {
|
|
108
132
|
const fullConfig = { ...DEFAULT_CONFIG, ...config };
|
|
109
133
|
super(eventBus, 'requirements-validation', fullConfig, {
|
|
110
134
|
verifyFindingTypes: ['requirement-conflict', 'testability-assessment', 'ambiguous-requirement'],
|
|
@@ -116,6 +140,16 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
116
140
|
this.bddWriter = new BDDScenarioWriterService(memory);
|
|
117
141
|
this.testabilityScorer = new TestabilityScorerService(memory);
|
|
118
142
|
this.repository = new InMemoryRequirementRepository(memory);
|
|
143
|
+
// Opt-in cheap-first BDD generation (plan 06 broadening; ADR-111 escalation
|
|
144
|
+
// lane). OFF by default; BDD/Gherkin is a bounded-gen + objective-oracle fit.
|
|
145
|
+
this.freeTierExecutor = buildFreeTierExecutor({
|
|
146
|
+
config: this.config,
|
|
147
|
+
agentType: 'qe-requirements-validator',
|
|
148
|
+
taskKind: 'requirements-validation',
|
|
149
|
+
llmRouter,
|
|
150
|
+
routingFeedback, // D9 sink (undefined unless wired by the plugin)
|
|
151
|
+
logger,
|
|
152
|
+
});
|
|
119
153
|
}
|
|
120
154
|
// ==========================================================================
|
|
121
155
|
// BaseDomainCoordinator Template Methods
|
|
@@ -294,6 +328,72 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
294
328
|
/**
|
|
295
329
|
* Generate test artifacts from requirement
|
|
296
330
|
*/
|
|
331
|
+
/**
|
|
332
|
+
* Cheap-first BDD generation (plan 06 broadening; ADR-111 escalation lane).
|
|
333
|
+
* Generates raw Gherkin on the free local tier (best-effort), verifies Gherkin
|
|
334
|
+
* STRUCTURE as the objective oracle (§10 — never the model's own judgement),
|
|
335
|
+
* parses it back into structured scenarios, and escalates the hard tail via the
|
|
336
|
+
* router. Returns null when off or nothing usable → caller falls back to the
|
|
337
|
+
* normal structured path. Off by default.
|
|
338
|
+
*/
|
|
339
|
+
async tryFreeTierScenarios(requirement, scenarioCount) {
|
|
340
|
+
if (!this.freeTierExecutor)
|
|
341
|
+
return null;
|
|
342
|
+
const ac = (requirement.acceptanceCriteria ?? []).map((c, i) => `${i + 1}. ${c}`).join('\n');
|
|
343
|
+
const system = 'You write Gherkin .feature files. Output ONLY a single fenced ```gherkin code block — no prose.';
|
|
344
|
+
const user = `Write a Gherkin feature with ~${scenarioCount} scenarios for this requirement. ` +
|
|
345
|
+
'Use Feature/Scenario/Given/When/Then; cover the acceptance criteria and edge cases.\n\n' +
|
|
346
|
+
`Title: ${requirement.title}\nDescription: ${requirement.description}\n` +
|
|
347
|
+
(ac ? `Acceptance criteria:\n${ac}\n` : '');
|
|
348
|
+
// Objective oracle (structural proxy — does NOT execute the scenarios). Beyond
|
|
349
|
+
// bare structure it requires: parses to >=1 scenario, EVERY scenario has a
|
|
350
|
+
// non-empty Given/When/Then, AND the feature is RELEVANT to the requirement
|
|
351
|
+
// (token overlap) — so generic off-topic boilerplate is rejected, not rewarded
|
|
352
|
+
// (resists the §10 Goodhart trap). Still a proxy, not semantic ground truth.
|
|
353
|
+
const sigTerms = significantTerms(requirement);
|
|
354
|
+
const verify = (out) => {
|
|
355
|
+
const text = stripGherkinFence(out);
|
|
356
|
+
const structural = /\bFeature:/i.test(text) && /\bScenario:/i.test(text) &&
|
|
357
|
+
/\bGiven\b/i.test(text) && /\bWhen\b/i.test(text) && /\bThen\b/i.test(text);
|
|
358
|
+
if (!structural) {
|
|
359
|
+
return { passed: false, feedback: 'must be valid Gherkin: Feature:, Scenario:, and Given/When/Then steps' };
|
|
360
|
+
}
|
|
361
|
+
const parsed = this.bddWriter.parseGherkin(text);
|
|
362
|
+
if (!parsed.success || parsed.value.length === 0) {
|
|
363
|
+
return { passed: false, feedback: 'Gherkin did not parse into any scenario' };
|
|
364
|
+
}
|
|
365
|
+
const wellFormed = parsed.value.every((s) => s.given.length > 0 && s.when.length > 0 && s.then.length > 0);
|
|
366
|
+
if (!wellFormed) {
|
|
367
|
+
return { passed: false, feedback: 'every scenario needs at least one Given, one When, and one Then step' };
|
|
368
|
+
}
|
|
369
|
+
if (sigTerms.length > 0) {
|
|
370
|
+
const lower = text.toLowerCase();
|
|
371
|
+
const hits = sigTerms.filter((t) => lower.includes(t)).length;
|
|
372
|
+
if (hits < Math.min(2, sigTerms.length)) {
|
|
373
|
+
return { passed: false, feedback: `scenarios must address THIS requirement — reference its terms (e.g. ${sigTerms.slice(0, 6).join(', ')})` };
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return { passed: true };
|
|
377
|
+
};
|
|
378
|
+
const r = await this.freeTierExecutor.execute({
|
|
379
|
+
agentId: `requirements:${requirement.id}`,
|
|
380
|
+
messages: [
|
|
381
|
+
{ role: 'system', content: system },
|
|
382
|
+
{ role: 'user', content: user },
|
|
383
|
+
],
|
|
384
|
+
verify,
|
|
385
|
+
escalate: true,
|
|
386
|
+
bestOfK: this.config.freeTierBestOfK ?? 2, // §12, matches the D3-validated config
|
|
387
|
+
repairAttempts: this.config.freeTierRepairAttempts ?? 1,
|
|
388
|
+
});
|
|
389
|
+
if (!r.ok)
|
|
390
|
+
return null;
|
|
391
|
+
const parsed = this.bddWriter.parseGherkin(stripGherkinFence(r.content));
|
|
392
|
+
if (!parsed.success || parsed.value.length === 0)
|
|
393
|
+
return null;
|
|
394
|
+
logger.info(`Free-tier BDD scenarios for ${requirement.id} via tier=${r.tierUsed} (${parsed.value.length} scenarios)`);
|
|
395
|
+
return parsed.value;
|
|
396
|
+
}
|
|
297
397
|
async generateTestArtifacts(requirementId) {
|
|
298
398
|
const workflowId = uuidv4();
|
|
299
399
|
try {
|
|
@@ -320,15 +420,20 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
320
420
|
logger.info(`[PPO] Optimized scenario count to ${optimizedScenarioCount}`);
|
|
321
421
|
}
|
|
322
422
|
}
|
|
323
|
-
//
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
423
|
+
// Cheap-first (opt-in, ADR-111): generate Gherkin on the free local tier,
|
|
424
|
+
// verify its structure (objective oracle), parse back to scenarios. Falls
|
|
425
|
+
// through to the normal structured path on any miss (off by default).
|
|
426
|
+
let scenarios = await this.tryFreeTierScenarios(requirement, optimizedScenarioCount);
|
|
427
|
+
if (!scenarios) {
|
|
428
|
+
const scenariosResult = await this.bddWriter.generateScenariosWithExamples(requirement, optimizedScenarioCount);
|
|
429
|
+
if (!scenariosResult.success) {
|
|
430
|
+
this.failWorkflow(workflowId, scenariosResult.error.message);
|
|
431
|
+
return err(scenariosResult.error);
|
|
432
|
+
}
|
|
433
|
+
scenarios = scenariosResult.value;
|
|
328
434
|
}
|
|
329
435
|
this.updateWorkflowProgress(workflowId, 50);
|
|
330
436
|
// V3: Use PPO to optimize scenario ordering
|
|
331
|
-
let scenarios = scenariosResult.value;
|
|
332
437
|
if (this.config.enablePPO && this.ppoAlgorithm) {
|
|
333
438
|
scenarios = await this.optimizeScenarioOrdering(requirement, scenarios);
|
|
334
439
|
}
|
|
@@ -9,6 +9,7 @@ import { RequirementsValidatorService, } from './services/requirements-validator
|
|
|
9
9
|
import { BDDScenarioWriterService, } from './services/bdd-scenario-writer.js';
|
|
10
10
|
import { TestabilityScorerService, } from './services/testability-scorer.js';
|
|
11
11
|
import { createQCSDIdeationPlugin, } from './qcsd-ideation-plugin.js';
|
|
12
|
+
import { RoutingFeedbackCollector } from '../../routing/routing-feedback.js';
|
|
12
13
|
import { toError } from '../../shared/error-utils.js';
|
|
13
14
|
// ============================================================================
|
|
14
15
|
// Plugin Implementation
|
|
@@ -171,8 +172,26 @@ export class RequirementsValidationPlugin extends BaseDomainPlugin {
|
|
|
171
172
|
this.validator = new RequirementsValidatorService({ memory: this.memory, llmRouter: this.llmRouter }, this.pluginConfig.validator);
|
|
172
173
|
this.bddWriter = new BDDScenarioWriterService(this.memory, this.pluginConfig.bddWriter);
|
|
173
174
|
this.testabilityScorer = new TestabilityScorerService(this.memory, this.pluginConfig.testabilityScorer);
|
|
175
|
+
// D9: when the free tier is opted in, stand up a live RoutingFeedbackCollector
|
|
176
|
+
// (calibrator + auto-escalation) so each cheap-vs-escalated BDD outcome feeds
|
|
177
|
+
// routing confidence. Memory-only fallback if the DB is unavailable.
|
|
178
|
+
let routingFeedback;
|
|
179
|
+
const freeTierOn = this.pluginConfig.coordinator?.enableFreeTier === true || process.env.AQE_FREE_TIER === '1';
|
|
180
|
+
if (freeTierOn) {
|
|
181
|
+
routingFeedback = new RoutingFeedbackCollector(10000, {
|
|
182
|
+
enableEMACalibration: true,
|
|
183
|
+
enableAutoEscalation: true,
|
|
184
|
+
});
|
|
185
|
+
try {
|
|
186
|
+
await routingFeedback.initialize();
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
// memory-only is fine — recording still drives calibration/escalation
|
|
190
|
+
}
|
|
191
|
+
}
|
|
174
192
|
// Create and initialize coordinator
|
|
175
|
-
this.coordinator = new RequirementsValidationCoordinator(this.eventBus, this.memory, this.agentCoordinator, this.pluginConfig.coordinator, this.llmRouter)
|
|
193
|
+
this.coordinator = new RequirementsValidationCoordinator(this.eventBus, this.memory, this.agentCoordinator, this.pluginConfig.coordinator, this.llmRouter, routingFeedback // D9 sink (undefined unless free tier is on)
|
|
194
|
+
);
|
|
176
195
|
await this.coordinator.initialize();
|
|
177
196
|
// Create and initialize QCSD Ideation Plugin
|
|
178
197
|
this.qcsdIdeationPlugin = createQCSDIdeationPlugin(this.memory);
|
|
@@ -68,10 +68,12 @@ export interface CoordinatorConfig extends BaseDomainCoordinatorConfig {
|
|
|
68
68
|
* — also enables via env `AQE_FREE_TIER=1`. Local-only / no paid escalation yet.
|
|
69
69
|
*/
|
|
70
70
|
enableFreeTier?: boolean;
|
|
71
|
-
/** Local model id for the free tier (default
|
|
71
|
+
/** Local model id for the free tier (default qwen3:30b-a3b or env AQE_FREE_TIER_MODEL). */
|
|
72
72
|
freeTierModel?: string;
|
|
73
73
|
/** Same-tier repair retries on a failed free-tier generation (D8). Default 1. */
|
|
74
74
|
freeTierRepairAttempts?: number;
|
|
75
|
+
/** Best-of-k diverse local attempts per tier (§12; D3-validated k=2). Default 2. */
|
|
76
|
+
freeTierBestOfK?: number;
|
|
75
77
|
}
|
|
76
78
|
type TestGenWorkflowType = 'generate' | 'tdd' | 'property' | 'data' | 'learn';
|
|
77
79
|
export declare class TestGenerationCoordinator extends BaseDomainCoordinator<CoordinatorConfig, TestGenWorkflowType> implements ITestGenerationCoordinator {
|
|
@@ -13,7 +13,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
13
13
|
import { ok, err, } from '../../shared/types';
|
|
14
14
|
import { toError } from '../../shared/error-utils.js';
|
|
15
15
|
// Opt-in free-tier local test generation (cross-pollination plan 06, D7-wire/D8/D9).
|
|
16
|
-
import {
|
|
16
|
+
import { buildFreeTierExecutor, } from '../../routing/free-tier/index.js';
|
|
17
17
|
import { TestGenerationEvents, LearningOptimizationEvents, createEvent, } from '../../shared/events/domain-events';
|
|
18
18
|
import { createTestGeneratorServiceWithDependencies, } from './services/test-generator';
|
|
19
19
|
import { PatternMatcherService, } from './services/pattern-matcher';
|
|
@@ -123,36 +123,16 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
123
123
|
// ADR-043 wiring: dependencies factory accepts llmRouter.
|
|
124
124
|
this.testGenerator = createTestGeneratorServiceWithDependencies({ memory, llmRouter });
|
|
125
125
|
this.patternMatcher = new PatternMatcherService(memory);
|
|
126
|
-
// Opt-in free-tier local generation (plan 06, D7-wire/D8/D9).
|
|
127
|
-
//
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const complexity = tier === 'opus' ? 'high' : tier === 'sonnet' ? 'medium' : 'low';
|
|
137
|
-
const resp = await llmRouter.chat({
|
|
138
|
-
messages: msgs.map((m) => ({ role: m.role, content: m.content })),
|
|
139
|
-
agentType: 'qe-test-architect',
|
|
140
|
-
complexity,
|
|
141
|
-
});
|
|
142
|
-
return { content: resp.content };
|
|
143
|
-
}
|
|
144
|
-
: undefined;
|
|
145
|
-
this.freeTierExecutor = new FreeTierEscalatingExecutor({
|
|
146
|
-
ladder: defaultFreeTierLadder(model),
|
|
147
|
-
claudeRunner,
|
|
148
|
-
defaultRepairAttempts: this.config.freeTierRepairAttempts ?? 1,
|
|
149
|
-
onOutcome: routingFeedback
|
|
150
|
-
? createRoutingFeedbackSink(routingFeedback, { taskKind: 'test-generation' }) // D9
|
|
151
|
-
: undefined,
|
|
152
|
-
});
|
|
153
|
-
logger.info(`Free-tier local test generation enabled (model=${model}, repair, ` +
|
|
154
|
-
`${claudeRunner ? 'escalation→HybridRouter' : 'local-only'})`);
|
|
155
|
-
}
|
|
126
|
+
// Opt-in free-tier local generation (plan 06, D7-wire/D8/D9; ADR-111).
|
|
127
|
+
// OFF by default. Generic wiring lives in the shared factory now.
|
|
128
|
+
this.freeTierExecutor = buildFreeTierExecutor({
|
|
129
|
+
config: this.config,
|
|
130
|
+
agentType: 'qe-test-architect',
|
|
131
|
+
taskKind: 'test-generation',
|
|
132
|
+
llmRouter,
|
|
133
|
+
routingFeedback,
|
|
134
|
+
logger,
|
|
135
|
+
});
|
|
156
136
|
// Initialize coherence gate if service is provided (ADR-052)
|
|
157
137
|
if (this.config.enableCoherenceGate && coherenceService) {
|
|
158
138
|
this.coherenceGate = createTestGenerationCoherenceGate(coherenceService, undefined, // Use default embedding service
|
|
@@ -472,9 +452,11 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
472
452
|
agentId: `test-gen:${src}`,
|
|
473
453
|
messages,
|
|
474
454
|
verify,
|
|
475
|
-
// Cheap-first:
|
|
476
|
-
// ladder via the HybridRouter (when wired).
|
|
455
|
+
// Cheap-first: best-of-k (§12) + repair on the local tier, then escalate the
|
|
456
|
+
// hard tail up the ladder via the HybridRouter (when wired). Matches the D3
|
|
457
|
+
// config that was validated (k=2). Local-only if no router.
|
|
477
458
|
escalate: true,
|
|
459
|
+
bestOfK: this.config.freeTierBestOfK ?? 2,
|
|
478
460
|
repairAttempts: this.config.freeTierRepairAttempts ?? 1,
|
|
479
461
|
});
|
|
480
462
|
if (!r.ok)
|
|
@@ -5,10 +5,17 @@
|
|
|
5
5
|
* `packages/darwin-mode/src/types.ts` (ADR-072 ScoreCard) so AQE can produce
|
|
6
6
|
* Darwin-compatible scores WITHOUT a build-time dependency on the pre-1.0
|
|
7
7
|
* MetaHarness package (per cross-pollination plan 05: Phase-0 actions stay
|
|
8
|
-
* decoupled).
|
|
9
|
-
* real import.
|
|
8
|
+
* decoupled).
|
|
10
9
|
*
|
|
11
|
-
*
|
|
10
|
+
* VERSION CONTRACT (plan A8, verified 2026-06-25): `DarwinScoreCard` is byte-for-
|
|
11
|
+
* byte structurally identical to upstream `ScoreCard` from @metaharness/darwin@0.2.1
|
|
12
|
+
* THROUGH @0.7.0 (no drift across 5 minors). The mirror is INTENTIONALLY KEPT, not
|
|
13
|
+
* replaced by a real import: the upstream is a fast-moving pre-1.0 package whose
|
|
14
|
+
* tarball pulls napi/wasm transitive deps, so the zero-coupling mirror is the lower-
|
|
15
|
+
* risk substrate (see plan 05 "A8 — status"). `tests/.../darwin-version-contract.test.ts`
|
|
16
|
+
* pins the mirror's field set so any divergence is caught.
|
|
17
|
+
*
|
|
18
|
+
* Pinned upstream contract: @metaharness/darwin ScoreCard @ 0.2.1–0.7.0.
|
|
12
19
|
*/
|
|
13
20
|
/** The seven mutation surfaces (mirror of Darwin's MutationSurface). */
|
|
14
21
|
export type MutationSurface = 'planner' | 'contextBuilder' | 'reviewer' | 'retryPolicy' | 'toolPolicy' | 'memoryPolicy' | 'scorePolicy';
|
|
@@ -5,10 +5,17 @@
|
|
|
5
5
|
* `packages/darwin-mode/src/types.ts` (ADR-072 ScoreCard) so AQE can produce
|
|
6
6
|
* Darwin-compatible scores WITHOUT a build-time dependency on the pre-1.0
|
|
7
7
|
* MetaHarness package (per cross-pollination plan 05: Phase-0 actions stay
|
|
8
|
-
* decoupled).
|
|
9
|
-
* real import.
|
|
8
|
+
* decoupled).
|
|
10
9
|
*
|
|
11
|
-
*
|
|
10
|
+
* VERSION CONTRACT (plan A8, verified 2026-06-25): `DarwinScoreCard` is byte-for-
|
|
11
|
+
* byte structurally identical to upstream `ScoreCard` from @metaharness/darwin@0.2.1
|
|
12
|
+
* THROUGH @0.7.0 (no drift across 5 minors). The mirror is INTENTIONALLY KEPT, not
|
|
13
|
+
* replaced by a real import: the upstream is a fast-moving pre-1.0 package whose
|
|
14
|
+
* tarball pulls napi/wasm transitive deps, so the zero-coupling mirror is the lower-
|
|
15
|
+
* risk substrate (see plan 05 "A8 — status"). `tests/.../darwin-version-contract.test.ts`
|
|
16
|
+
* pins the mirror's field set so any divergence is caught.
|
|
17
|
+
*
|
|
18
|
+
* Pinned upstream contract: @metaharness/darwin ScoreCard @ 0.2.1–0.7.0.
|
|
12
19
|
*/
|
|
13
20
|
export {};
|
|
14
21
|
//# sourceMappingURL=types.js.map
|