agentic-qe 3.12.2 → 3.13.0
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/helpers/.helpers-version +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +430 -430
- package/.claude/helpers/helpers.manifest.json +6 -5
- package/.claude/helpers/hook-handler.cjs +565 -311
- package/.claude/helpers/intelligence.cjs +1058 -1058
- package/.claude/helpers/statusline.cjs +995 -682
- package/.claude/skills/qe-court/SKILL.md +186 -0
- package/.claude/skills/qe-court/config.json +27 -0
- package/.claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery/README.md +38 -0
- package/.claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery/budget.test.ts +21 -0
- package/.claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery/budget.ts +25 -0
- package/.claude/skills/qe-court/evals/qe-court.yaml +70 -0
- package/.claude/skills/qe-court/schemas/output.json +92 -0
- package/.claude/skills/qe-court/scripts/validate-config.json +30 -0
- package/.claude/skills/skills-manifest.json +9 -8
- package/CHANGELOG.md +104 -0
- package/README.md +3 -3
- package/assets/skills/qe-court/SKILL.md +186 -0
- package/assets/skills/qe-court/config.json +27 -0
- package/assets/skills/qe-court/evals/fixtures/seeded-mutant-delivery/README.md +38 -0
- package/assets/skills/qe-court/evals/fixtures/seeded-mutant-delivery/budget.test.ts +21 -0
- package/assets/skills/qe-court/evals/fixtures/seeded-mutant-delivery/budget.ts +25 -0
- package/assets/skills/qe-court/evals/qe-court.yaml +70 -0
- package/assets/skills/qe-court/schemas/output.json +92 -0
- package/assets/skills/qe-court/scripts/validate-config.json +30 -0
- package/assets/skills/skills-manifest.json +9 -8
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-CWIMFWAI.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-3KYNICBC.js → agent-booster-wasm-ACX2DK7Y.js} +2 -2
- package/dist/cli/chunks/{agent-handler-NGPTMI6E.js → agent-handler-B45WP4ZJ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-GNTQKQMG.js → agent-memory-branch-QQLZDE56.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-OTXT2DLN.js +2 -0
- package/dist/cli/chunks/{arena-HQEP2NWI.js → arena-G3IKZAG5.js} +4 -4
- package/dist/cli/chunks/{arena-PA7VIYD4.js → arena-SDB7723R.js} +2 -2
- package/dist/cli/chunks/{audit-XSDM57GC.js → audit-GY46XUZA.js} +3 -3
- package/dist/cli/chunks/base-O3SPSWBA.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-BCASOCNU.js → better-sqlite3-DUZ6FFAH.js} +2 -2
- package/dist/cli/chunks/brain-handler-347CYMPN.js +89 -0
- package/dist/cli/chunks/{branch-enumerator-ZW7RNMUF.js → branch-enumerator-Z3ULBFSM.js} +2 -2
- package/dist/cli/chunks/{browser-4LU22CPP.js → browser-OYEIHD7F.js} +2 -2
- package/dist/cli/chunks/browser-workflow-MXS3ZKY2.js +2 -0
- package/dist/cli/chunks/{chunk-CKFZOPZN.js → chunk-2DIT5AUU.js} +2 -2
- package/dist/cli/chunks/{chunk-RXH2TC2K.js → chunk-2NRZYQSF.js} +2 -2
- package/dist/cli/chunks/chunk-2VQVEQS4.js +153 -0
- package/dist/cli/chunks/{chunk-KDGLNJPB.js → chunk-32ZGV4Q4.js} +1 -1
- package/dist/cli/chunks/{chunk-327YEKBU.js → chunk-34PEINFS.js} +2 -2
- package/dist/cli/chunks/{chunk-CTFW7CMI.js → chunk-3GSYD5SL.js} +2 -2
- package/dist/cli/chunks/{chunk-YRO7HNS4.js → chunk-3JVUWKCO.js} +2 -2
- package/dist/cli/chunks/{chunk-TERRRQVY.js → chunk-3K4SF57Q.js} +1 -1
- package/dist/cli/chunks/{chunk-6N62KS3C.js → chunk-3NOCK6ED.js} +2 -2
- package/dist/cli/chunks/{chunk-7DV42KFP.js → chunk-3UHEZ5HZ.js} +2 -2
- package/dist/cli/chunks/{chunk-N57BKUVE.js → chunk-4BDLD7V2.js} +1 -1
- package/dist/cli/chunks/{chunk-5SM57X4D.js → chunk-4BESADKE.js} +2 -2
- package/dist/cli/chunks/{chunk-GCQATSMK.js → chunk-54MFKCLT.js} +2 -2
- package/dist/cli/chunks/{chunk-GUGUYFU5.js → chunk-56WZFXTQ.js} +2 -2
- package/dist/cli/chunks/{chunk-OELLHV7S.js → chunk-5EIOQCGN.js} +2 -2
- package/dist/cli/chunks/{chunk-Z63IOTDW.js → chunk-5FLTZ3KT.js} +2 -2
- package/dist/cli/chunks/{chunk-EKTWIEEO.js → chunk-5ICQL42E.js} +2 -2
- package/dist/cli/chunks/{chunk-VQU2JXTK.js → chunk-5KAT6WBQ.js} +2 -2
- package/dist/cli/chunks/{chunk-VHYACXLN.js → chunk-6AOBLBR4.js} +2 -2
- package/dist/cli/chunks/{chunk-Z3FA5KR6.js → chunk-6DTOGSDV.js} +4 -4
- package/dist/cli/chunks/{chunk-SYLTJKN2.js → chunk-6SXKCIN5.js} +2 -2
- package/dist/cli/chunks/{chunk-MF4FULAI.js → chunk-7DMXCCSD.js} +1 -1
- package/dist/cli/chunks/{chunk-BOR5MME3.js → chunk-7UNY32PU.js} +1 -1
- package/dist/cli/chunks/{chunk-T6TQPF5P.js → chunk-7YXT6BXN.js} +3 -3
- package/dist/cli/chunks/{chunk-ADZTWGEB.js → chunk-A4QLGPYO.js} +2 -2
- package/dist/cli/chunks/{chunk-RFQIC6ZF.js → chunk-A7GLWWSE.js} +1 -1
- package/dist/cli/chunks/{chunk-WC5PM33J.js → chunk-ANIDFJCT.js} +3 -3
- package/dist/cli/chunks/{chunk-TFVWUR2U.js → chunk-ANYYTWOQ.js} +2 -2
- package/dist/cli/chunks/{chunk-YZ44FUVJ.js → chunk-AO7AHX6K.js} +2 -2
- package/dist/cli/chunks/{chunk-PHIEJAQK.js → chunk-BCKTBGDM.js} +3 -3
- package/dist/cli/chunks/{chunk-GECWGFRR.js → chunk-BGYLNCL6.js} +2 -2
- package/dist/cli/chunks/{chunk-PXKVW6PT.js → chunk-BOVH6WSM.js} +2 -2
- package/dist/cli/chunks/{chunk-P65S7AZA.js → chunk-BUGWPTMF.js} +2 -2
- package/dist/cli/chunks/{chunk-RXEQB4OT.js → chunk-CFVEDUTW.js} +2 -2
- package/dist/cli/chunks/{chunk-HNU32LN3.js → chunk-CPH5JP4L.js} +1 -1
- package/dist/cli/chunks/{chunk-LIAW5FD7.js → chunk-CQFT7H3F.js} +2 -2
- package/dist/cli/chunks/{chunk-WY5CX3VH.js → chunk-CWUBOLKY.js} +2 -2
- package/dist/cli/chunks/{chunk-X47GHZY3.js → chunk-CYL2FV23.js} +2 -2
- package/dist/cli/chunks/{chunk-W7LBT3BF.js → chunk-D3MPV5G7.js} +2 -2
- package/dist/cli/chunks/{chunk-7KMYBRKJ.js → chunk-DRIJYTSK.js} +2 -2
- package/dist/cli/chunks/{chunk-BDVOXGY5.js → chunk-DYUC7WFA.js} +1 -1
- package/dist/cli/chunks/{chunk-ZBYMF2QJ.js → chunk-E3B5XTXJ.js} +1 -1
- package/dist/cli/chunks/{chunk-TMQ3S7HR.js → chunk-EECM5XKY.js} +1 -1
- package/dist/cli/chunks/{chunk-7OD6HFCP.js → chunk-EFRESRLB.js} +3 -3
- package/dist/cli/chunks/{chunk-HU6ETNA7.js → chunk-ES7WCYOU.js} +1 -1
- package/dist/cli/chunks/chunk-FAQLI3P5.js +2 -0
- package/dist/cli/chunks/{chunk-K43YXI7C.js → chunk-FBBZHATF.js} +2 -2
- package/dist/cli/chunks/{chunk-2R7J4ZGT.js → chunk-FL3BM54K.js} +1 -1
- package/dist/cli/chunks/{chunk-KBXW7S3W.js → chunk-FQLWQWRU.js} +3 -3
- package/dist/cli/chunks/{chunk-LWVUNBZO.js → chunk-FQY3UTGA.js} +2 -2
- package/dist/cli/chunks/{chunk-2L7K2J2T.js → chunk-FUU32QY5.js} +2 -2
- package/dist/cli/chunks/{chunk-3LELACAQ.js → chunk-G4GTE3RJ.js} +2 -2
- package/dist/cli/chunks/{chunk-APVXTHTA.js → chunk-G5DFYX3J.js} +3 -3
- package/dist/cli/chunks/chunk-G7FMYFTN.js +2 -0
- package/dist/cli/chunks/{chunk-CMKCPRWX.js → chunk-GFBLWFRV.js} +1 -1
- package/dist/cli/chunks/{chunk-5YLY2WT2.js → chunk-GJMZR7WU.js} +3 -3
- package/dist/cli/chunks/{chunk-R6LDR3IO.js → chunk-GTUFX7AR.js} +2 -2
- package/dist/cli/chunks/{chunk-5CGTBAVF.js → chunk-GUEZQOHL.js} +1 -1
- package/dist/cli/chunks/{chunk-DGOZ3CGB.js → chunk-HL2QMM4M.js} +2 -2
- package/dist/cli/chunks/{chunk-VOHYQ6MX.js → chunk-HOKON5EL.js} +2 -2
- package/dist/cli/chunks/{chunk-DTXHRALB.js → chunk-HTPM3URI.js} +2 -2
- package/dist/cli/chunks/chunk-HVB2L52I.js +2 -0
- package/dist/cli/chunks/{chunk-GP7IXYOY.js → chunk-IHQTXJAQ.js} +1 -1
- package/dist/cli/chunks/{chunk-LOZAUP6L.js → chunk-IPHLXAMX.js} +2 -2
- package/dist/cli/chunks/{chunk-56MXYSYY.js → chunk-IYDYJ33J.js} +2 -2
- package/dist/cli/chunks/{chunk-QYST2TZW.js → chunk-IZRLIWFN.js} +2 -2
- package/dist/cli/chunks/{chunk-XNNYHQLW.js → chunk-J3L52EA4.js} +5 -5
- package/dist/cli/chunks/{chunk-P2FYRAC5.js → chunk-JGM6XCCP.js} +1 -1
- package/dist/cli/chunks/chunk-JPIBPKBP.js +54 -0
- package/dist/cli/chunks/{chunk-ILNQPPKB.js → chunk-K5N6SLHO.js} +1 -1
- package/dist/cli/chunks/{chunk-UEIIIDBJ.js → chunk-KSYLRM4Q.js} +2 -2
- package/dist/cli/chunks/{chunk-TRHUH24V.js → chunk-KUA4HHU6.js} +2 -2
- package/dist/cli/chunks/{chunk-OEZNUXY7.js → chunk-KVL63BSU.js} +1 -1
- package/dist/cli/chunks/{chunk-WMNGPIP3.js → chunk-KZTBNDNE.js} +1 -1
- package/dist/cli/chunks/{chunk-OSAPKOGN.js → chunk-L2SFGFE6.js} +1 -1
- package/dist/cli/chunks/{chunk-IQ56KMMH.js → chunk-L4LLA5U7.js} +1 -1
- package/dist/cli/chunks/{chunk-KBAXD6PH.js → chunk-L4S722JD.js} +1 -1
- package/dist/cli/chunks/{chunk-C7VNQ4PY.js → chunk-LBE2P6UC.js} +2 -2
- package/dist/cli/chunks/{chunk-KNOO6TFO.js → chunk-LOXVVMS4.js} +3 -3
- package/dist/cli/chunks/{chunk-B7DI76SY.js → chunk-LWYLW7RX.js} +2 -2
- package/dist/cli/chunks/{chunk-6SWR2BN7.js → chunk-LXPB7H2P.js} +1 -1
- package/dist/cli/chunks/{chunk-LGEPR7MH.js → chunk-MBCGI3M2.js} +3 -3
- package/dist/cli/chunks/{chunk-WL5VMIO4.js → chunk-MVI2QMRW.js} +1 -1
- package/dist/cli/chunks/{chunk-OIUIVV2N.js → chunk-N5MMBA35.js} +1 -1
- package/dist/cli/chunks/{chunk-TQNNKW7K.js → chunk-N7VOOI3U.js} +2 -2
- package/dist/cli/chunks/{chunk-BPSEFLJ6.js → chunk-NETN3OUG.js} +1 -1
- package/dist/cli/chunks/chunk-NQNKKVNO.js +29 -0
- package/dist/cli/chunks/{chunk-ACDZ2CRV.js → chunk-NUQBJGGF.js} +2 -2
- package/dist/cli/chunks/chunk-OETDMOOE.js +2 -0
- package/dist/cli/chunks/{chunk-R5HC6JVJ.js → chunk-OXXMVQDF.js} +2 -2
- package/dist/cli/chunks/{chunk-J6EFAKDQ.js → chunk-OZR25R7W.js} +2 -2
- package/dist/cli/chunks/{chunk-ZL7ZOIHO.js → chunk-PERJO2DY.js} +1 -1
- package/dist/cli/chunks/{chunk-WKWIUS5G.js → chunk-PP2RYSHT.js} +3 -3
- package/dist/cli/chunks/{chunk-WE5QHYL7.js → chunk-Q7PBGNUD.js} +1 -1
- package/dist/cli/chunks/{chunk-E5XWCGSX.js → chunk-QCEW4ZDW.js} +2 -2
- package/dist/cli/chunks/{chunk-EGU54SNK.js → chunk-QI4CGJNK.js} +1 -1
- package/dist/cli/chunks/{chunk-MNNNA57O.js → chunk-QQB55ZJJ.js} +2 -2
- package/dist/cli/chunks/{chunk-KV5OZ6T3.js → chunk-QTU3CVOB.js} +2 -2
- package/dist/cli/chunks/{chunk-M4XVEUUM.js → chunk-QWYISZTN.js} +2 -2
- package/dist/cli/chunks/{chunk-OMIGKGJJ.js → chunk-R3GEXYO4.js} +2 -2
- package/dist/cli/chunks/{chunk-4KEOBDEI.js → chunk-RDU4WTV2.js} +2 -2
- package/dist/cli/chunks/{chunk-3AJUJAUJ.js → chunk-RJZRWVL4.js} +1 -1
- package/dist/cli/chunks/{chunk-UFPCNUJA.js → chunk-RLCWR7TS.js} +10 -10
- package/dist/cli/chunks/{chunk-FTG4ZVTX.js → chunk-RSFIOR2I.js} +10 -10
- package/dist/cli/chunks/{chunk-FKUH33L3.js → chunk-RVJPWRV6.js} +2 -2
- package/dist/cli/chunks/{chunk-AMPYON7M.js → chunk-RVRBTOWX.js} +2 -2
- package/dist/cli/chunks/{chunk-AJ6DZXKK.js → chunk-SHCTEXNH.js} +2 -2
- package/dist/cli/chunks/chunk-SNTUKW4Q.js +2 -0
- package/dist/cli/chunks/{chunk-F3CKOVZM.js → chunk-SRQ3CPJE.js} +6 -6
- package/dist/cli/chunks/{chunk-V2QYW5KW.js → chunk-THBTN7XB.js} +2 -2
- package/dist/cli/chunks/{chunk-6FBXYS6X.js → chunk-TNRIGQ6U.js} +2 -2
- package/dist/cli/chunks/{chunk-UF3YOGHV.js → chunk-TVMFH5N2.js} +2 -2
- package/dist/cli/chunks/{chunk-FUBN5GPY.js → chunk-TZ73SXQ5.js} +1 -1
- package/dist/cli/chunks/chunk-TZPKTRJB.js +9 -0
- package/dist/cli/chunks/{chunk-IKIKIHFQ.js → chunk-U2SW6KK5.js} +2 -2
- package/dist/cli/chunks/{chunk-ZHWXI4SK.js → chunk-UIPPJKON.js} +2 -2
- package/dist/cli/chunks/{chunk-MNHGBG4D.js → chunk-UMG5URNV.js} +1 -1
- package/dist/cli/chunks/{chunk-YYV3FYVB.js → chunk-UNIBND6A.js} +1 -1
- package/dist/cli/chunks/{chunk-HH5Y4NCR.js → chunk-USMDIIHY.js} +2 -2
- package/dist/cli/chunks/{chunk-TLYZPOA7.js → chunk-VC6EXDGY.js} +2 -2
- package/dist/cli/chunks/{chunk-BMRR3MBR.js → chunk-VHYMSZNF.js} +2 -2
- package/dist/cli/chunks/{chunk-SVUWAV6Y.js → chunk-VLBV2VL3.js} +1 -1
- package/dist/cli/chunks/{chunk-BDX54WJV.js → chunk-VLNPJAVH.js} +1 -1
- package/dist/cli/chunks/{chunk-R554WVIG.js → chunk-VSNRPMAZ.js} +2 -2
- package/dist/cli/chunks/{chunk-AL5QT6OX.js → chunk-W5YEIHIO.js} +2 -2
- package/dist/cli/chunks/{chunk-NDAJWCXN.js → chunk-WRYT4HTZ.js} +2 -2
- package/dist/cli/chunks/{chunk-PSA2SOON.js → chunk-XFCWYQHW.js} +2 -2
- package/dist/cli/chunks/{chunk-6X65BGGK.js → chunk-XKFE3FLI.js} +2 -2
- package/dist/cli/chunks/{chunk-ZF65VOQH.js → chunk-YFGAHNCG.js} +2 -2
- package/dist/cli/chunks/{chunk-YSCEUK55.js → chunk-YPTGE5NJ.js} +2 -2
- package/dist/cli/chunks/{chunk-YDZIPP3Y.js → chunk-YRQLVGCI.js} +2 -2
- package/dist/cli/chunks/{chunk-ERQL3D2O.js → chunk-Z6QCOZ2H.js} +2 -2
- package/dist/cli/chunks/{chunk-WYFEVPLO.js → chunk-ZCFZ4USU.js} +1 -1
- package/dist/cli/chunks/{chunk-2R7XZ2WP.js → chunk-ZEIG5IQ4.js} +2 -2
- package/dist/cli/chunks/{chunk-KJJP446A.js → chunk-ZJG6N2OK.js} +1 -1
- package/dist/cli/chunks/{chunk-BUKGW63B.js → chunk-ZJIX5FGQ.js} +3 -3
- package/dist/cli/chunks/{chunk-EZ3JVN6S.js → chunk-ZLXBNNNT.js} +2 -2
- package/dist/cli/chunks/{chunk-4FHJYJCH.js → chunk-ZOXWASCC.js} +2 -2
- package/dist/cli/chunks/{ci-NT4DUGQ4.js → ci-74ZUCO5V.js} +2 -2
- package/dist/cli/chunks/{ci-output-PXBD2QPH.js → ci-output-HD6IZNJA.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ZPCCEEDX.js → circuit-breaker-USZVMA42.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-CZCDFZOE.js → claude-flow-setup-S4XKNCD5.js} +2 -2
- package/dist/cli/chunks/client-33PGO5FA.js +2 -0
- package/dist/cli/chunks/{cline-installer-6J2S7GLM.js → cline-installer-6EW4CHAR.js} +2 -2
- package/dist/cli/chunks/{code-UTERK5AP.js → code-TOLWD2XL.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-O3MJTOS2.js → code-index-extractor-UA4QQ7B3.js} +2 -2
- package/dist/cli/chunks/{codex-installer-AZJIVXJR.js → codex-installer-C2CUP4FW.js} +2 -2
- package/dist/cli/chunks/{completions-A6ANQSZN.js → completions-KVUMQQ4K.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-MRSN7VUP.js → complexity-analyzer-DFH6LMK2.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-6LMKQRUI.js → continuedev-installer-LYDQSAU7.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-KP3TWUNO.js → copilot-installer-7USXLZHZ.js} +2 -2
- package/dist/cli/chunks/core-handlers-CSNZIM3A.js +2 -0
- package/dist/cli/chunks/{cost-tracker-R3C5IQPZ.js → cost-tracker-JBDIUMKZ.js} +2 -2
- package/dist/cli/chunks/{coverage-MR4QA2NM.js → coverage-RGO3K357.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-DRIBR5L3.js +2 -0
- package/dist/cli/chunks/{cursor-installer-LPZ7NGOS.js → cursor-installer-YEZGD37F.js} +2 -2
- package/dist/cli/chunks/{daemon-X5KXHRY3.js → daemon-FVETQ3LL.js} +3 -3
- package/dist/cli/chunks/{daemon-K3KW2UDV.js → daemon-LPEXHNYG.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-J4FJSGNN.js → dag-attention-scheduler-UKYE2FII.js} +2 -2
- package/dist/cli/chunks/{detect-22TX2NCA.js → detect-WBG5P7ER.js} +2 -2
- package/dist/cli/chunks/{dist-node-QI4I4QPS.js → dist-node-YW6YRBCU.js} +2 -2
- package/dist/cli/chunks/{domain-handler-ZYZGPNOQ.js → domain-handler-HH7J4A32.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-2EEQTNIU.js → domain-transfer-V34GXD5I.js} +2 -2
- package/dist/cli/chunks/dream-WUNO723O.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-LYCTU5BS.js → embed-and-insert-pattern-WYLRS3CL.js} +2 -2
- package/dist/cli/chunks/{eval-SOA72GUX.js → eval-EIMVXY5J.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-AFFYOMYM.js → experience-capture-middleware-QMZHRUKM.js} +3 -3
- package/dist/cli/chunks/{fast-paths-WNMHOSUH.js → fast-paths-NHLW6XS6.js} +2 -2
- package/dist/cli/chunks/{feature-flags-HAP5IAAY.js → feature-flags-N3UHMSZ3.js} +2 -2
- package/dist/cli/chunks/{feature-flags-FT4YBZH4.js → feature-flags-NE3MBL3P.js} +2 -2
- package/dist/cli/chunks/{file-discovery-B4FFOH3Z.js → file-discovery-SI44X4YS.js} +2 -2
- package/dist/cli/chunks/{fleet-2ICPYV3J.js → fleet-MMYUXRRM.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-XIBJAHMW.js → gnn-wrapper-RLYXYU2Q.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-NSLSKDOI.js → heartbeat-handler-6EDRUYLV.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-VAFQDJLL.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-TIRPA7XE.js +2 -0
- package/dist/cli/chunks/hnsw-index-SSQBRQCQ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-FTV4CCBB.js → hnsw-legacy-bridge-RVM7EAIH.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-RQCOOAZC.js → hnswlib-node-RJPBJU2Q.js} +2 -2
- package/dist/cli/chunks/{hooks-SM4EU52N.js → hooks-ZF4VKHEO.js} +10 -10
- package/dist/cli/chunks/hybrid-router-AKBWZOQ3.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-RRMX4N3L.js → hypergraph-engine-YWS66PGO.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-MNFGDKAP.js → hypergraph-handler-OQHVRPWB.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-46FQIZ6Y.js +2 -0
- package/dist/cli/chunks/{init-handler-BNHIJ5TX.js → init-handler-YW74YF2V.js} +6 -6
- package/dist/cli/chunks/init-wizard-U3NHGYSS.js +2 -0
- package/dist/cli/chunks/kernel-ZDXHT6QF.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-GFKUKPLY.js → kilocode-installer-APWB2GMA.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-YBIYKODN.js → kiro-installer-DICKFVNC.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-6XTW6WO6.js +2 -0
- package/dist/cli/chunks/{learning-QEWUPCK6.js → learning-MXHNYW5D.js} +3 -3
- package/dist/cli/chunks/{llm-router-D5FQIMVQ.js → llm-router-LTFIX7NY.js} +5 -5
- package/dist/cli/chunks/llm-router-service-3F4E64SY.js +2 -0
- package/dist/cli/chunks/{load-CLBUCKZQ.js → load-JUMIQ4LZ.js} +2 -2
- package/dist/cli/chunks/load-test-SWZNGEIY.js +2 -0
- package/dist/cli/chunks/{mcp-VOMG5DPV.js → mcp-WHIARJGO.js} +2 -2
- package/dist/cli/chunks/{memory-WZO63VSC.js → memory-KAHS6Z5A.js} +5 -5
- package/dist/cli/chunks/memory-backend-PR74ZPBA.js +2 -0
- package/dist/cli/chunks/memory-handlers-DG3RRXB6.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-7UKW43VV.js → multi-model-executor-E3Y2RHMX.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-MLFPRRL2.js → opencode-installer-3RKGNGGE.js} +2 -2
- package/dist/cli/chunks/{orchestrator-XNYDBGIN.js → orchestrator-TXITUKWD.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-EPE36BVT.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-ZAP7ASQI.js → pattern-usage-recorder-EE2BUFZT.js} +2 -2
- package/dist/cli/chunks/{pipeline-4EJYOPBC.js → pipeline-AXTT6KZB.js} +2 -2
- package/dist/cli/chunks/{platform-ALPOWCOH.js → platform-TICPVKE2.js} +2 -2
- package/dist/cli/chunks/{plugin-S2RX3KHR.js → plugin-VQKNV3EM.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-P2JB73XX.js → prime-radiant-advanced-wasm-6GY5YY7D.js} +2 -2
- package/dist/cli/chunks/protocol-executor-IELENNST.js +2 -0
- package/dist/cli/chunks/{protocol-handler-ZBJXSESA.js → protocol-handler-YFWDR7UZ.js} +2 -2
- package/dist/cli/chunks/{prove-MYJ5YV45.js → prove-FUMRCXAA.js} +2 -2
- package/dist/cli/chunks/provider-manager-3R3KOBHG.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-S2R2PCBS.js +2 -0
- package/dist/cli/chunks/{quality-NIACQC4M.js → quality-2APISBW5.js} +2 -2
- package/dist/cli/chunks/{quality-gate-OAZ23ON5.js → quality-gate-MCC3E5TM.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-2E23NEV4.js +2 -0
- package/dist/cli/chunks/{real-embeddings-6I4LP7PL.js → real-embeddings-CC5TNOTI.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-LRQHP6MK.js → roocode-installer-YAHTEVPI.js} +2 -2
- package/dist/cli/chunks/router-3FVLWO6S.js +2 -0
- package/dist/cli/chunks/routing-feedback-ZQLRNNR7.js +2 -0
- package/dist/cli/chunks/{routing-handler-A7BW7MV4.js → routing-handler-6NQBW4TQ.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-ZDRRFSJS.js → ruvector-commands-ZHXLHUPG.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-QWE3Z6BB.js → rvf-dual-writer-5KF2DGCW.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-6UDAP7QB.js → rvf-migration-adapter-BBU57BGF.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-FEW2N4R4.js → rvf-migration-coordinator-VN4VRZA4.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-YFGLQNEB.js +2 -0
- package/dist/cli/chunks/rvf-store-integrity-XCY2XQZA.js +2 -0
- package/dist/cli/chunks/safe-db-4SBLBTW7.js +2 -0
- package/dist/cli/chunks/schedule-5Y3BGVAA.js +2 -0
- package/dist/cli/chunks/scheduler-DOID3QF3.js +2 -0
- package/dist/cli/chunks/{security-KFXBV65O.js → security-PYP4H3KN.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-3CJHRNX6.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-CXXTB7CU.js → shared-rvf-dual-writer-MKSLKWDI.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-M4JEQO57.js +2 -0
- package/dist/cli/chunks/{status-handler-CXSVM236.js → status-handler-VYIZ3VJF.js} +2 -2
- package/dist/cli/chunks/{structural-health-LMHSM7MJ.js → structural-health-MVV4OWXP.js} +2 -2
- package/dist/cli/chunks/{sync-DMOUY2EY.js → sync-G47OYIQ3.js} +2 -2
- package/dist/cli/chunks/sync-VNX6L3TI.js +2 -0
- package/dist/cli/chunks/{task-handler-DMSNFIH3.js → task-handler-GOWF2GEH.js} +2 -2
- package/dist/cli/chunks/{task-handlers-3Z3QV7X7.js → task-handlers-J2WC6J37.js} +3 -3
- package/dist/cli/chunks/{test-U6CGMDLN.js → test-DMCJ3BXS.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-YHYA3BP5.js → test-scheduling-TRFHHKFM.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-KEQ7AHFF.js +2 -0
- package/dist/cli/chunks/{token-usage-EOOTM7Q3.js → token-usage-B54FOFOF.js} +2 -2
- package/dist/cli/chunks/transformers-IACZG7IV.js +2 -0
- package/dist/cli/chunks/{tree-sitter-wasm-parser-HTGAXDQA.js → tree-sitter-wasm-parser-N7H4X37E.js} +2 -2
- package/dist/cli/chunks/{types-GLRXY4RY.js → types-B3SHT4OD.js} +2 -2
- package/dist/cli/chunks/unified-memory-WNYWTGVX.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-YPAV7U4E.js +2 -0
- package/dist/cli/chunks/unified-persistence-TJ252S7L.js +2 -0
- package/dist/cli/chunks/{upgrade-KU55H77X.js → upgrade-A2PQ5EWK.js} +2 -2
- package/dist/cli/chunks/{validate-26VSBOJN.js → validate-UXV7UQUT.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-OIALRDKF.js → validate-swarm-MMBU4FPP.js} +2 -2
- package/dist/cli/chunks/{vibium-LOTWW25P.js → vibium-R4GUVADA.js} +2 -2
- package/dist/cli/chunks/visual-security-VKYXEGJB.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-6LWPPBYU.js → web-tree-sitter-MP6E6CJB.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-ILOQYENG.js → windsurf-installer-Z6BWMUUO.js} +2 -2
- package/dist/cli/chunks/{witness-chain-YBS6OHS4.js → witness-chain-EFLTABBA.js} +2 -2
- package/dist/cli/chunks/witness-chain-WVXRXKQP.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-SI3WV3ZQ.js → witness-key-manager-PN36TV43.js} +2 -2
- package/dist/cli/chunks/{workflow-GY6SJRQW.js → workflow-A2AX3RJU.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-GOWSPR3G.js +2 -0
- package/dist/cli/chunks/{wrappers-MMO5YKOZ.js → wrappers-NA6FHA63.js} +2 -2
- package/dist/cli/commands/llm-router.js +1 -0
- package/dist/init/skills-installer.js +1 -0
- package/dist/integrations/embeddings/base/EmbeddingGenerator.js +13 -1
- package/dist/integrations/ruvector/brain-rvf-exporter.js +115 -13
- package/dist/integrations/ruvector/rvf-dual-writer.js +20 -3
- package/dist/integrations/ruvector/rvf-store-integrity.d.ts +49 -0
- package/dist/integrations/ruvector/rvf-store-integrity.js +137 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.js +23 -5
- package/dist/kernel/unified-memory.js +4 -0
- package/dist/learning/pattern-store.js +23 -5
- package/dist/learning/qe-flywheel/corpus-scorer.js +10 -7
- package/dist/learning/qe-flywheel/generation.d.ts +7 -0
- package/dist/learning/qe-flywheel/generation.js +5 -0
- package/dist/learning/qe-flywheel/platform-signer.d.ts +32 -0
- package/dist/learning/qe-flywheel/platform-signer.js +60 -0
- package/dist/learning/qe-flywheel/receipt.js +9 -2
- package/dist/learning/qe-flywheel/witness-verify.d.ts +86 -0
- package/dist/learning/qe-flywheel/witness-verify.js +156 -0
- package/dist/mcp/bundle.js +398 -387
- package/dist/shared/db-recovery.d.ts +55 -0
- package/dist/shared/db-recovery.js +184 -0
- package/dist/shared/llm/billing-modes.js +5 -2
- package/dist/shared/llm/cost-tracker.js +1 -0
- package/dist/shared/llm/interfaces.d.ts +14 -1
- package/dist/shared/llm/provider-manager.d.ts +1 -1
- package/dist/shared/llm/provider-manager.js +7 -3
- package/dist/shared/llm/providers/claude-code.js +12 -3
- package/dist/shared/llm/providers/codex.d.ts +58 -0
- package/dist/shared/llm/providers/codex.js +305 -0
- package/dist/shared/llm/providers/index.d.ts +1 -0
- package/dist/shared/llm/providers/index.js +1 -0
- package/dist/shared/llm/router/config-store.js +5 -0
- package/dist/shared/llm/router/hybrid-router.js +2 -2
- package/dist/shared/llm/spend-ledger.d.ts +24 -0
- package/dist/shared/llm/spend-ledger.js +86 -15
- package/dist/shared/llm/translation/message-formatter.js +1 -0
- package/dist/shared/safe-db.d.ts +10 -0
- package/dist/shared/safe-db.js +17 -0
- package/dist/skills/qe-court/referee.d.ts +62 -0
- package/dist/skills/qe-court/referee.js +78 -0
- package/dist/validation/gate-reexecute.d.ts +9 -0
- package/dist/validation/gate-reexecute.js +61 -0
- package/dist/validation/paired-bootstrap.d.ts +36 -0
- package/dist/validation/paired-bootstrap.js +58 -0
- package/package.json +8 -4
- package/dist/cli/chunks/adapter-RL6GNUOS.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-UEEW6AQG.js +0 -2
- package/dist/cli/chunks/base-JQA5YULE.js +0 -2
- package/dist/cli/chunks/brain-handler-T7RDPKNM.js +0 -89
- package/dist/cli/chunks/browser-workflow-XTKUHTIT.js +0 -2
- package/dist/cli/chunks/chunk-ABHKXMOJ.js +0 -2
- package/dist/cli/chunks/chunk-CDMAVNV5.js +0 -2
- package/dist/cli/chunks/chunk-CQKEVUMO.js +0 -153
- package/dist/cli/chunks/chunk-KPV4N4KT.js +0 -9
- package/dist/cli/chunks/chunk-MALFTRCT.js +0 -29
- package/dist/cli/chunks/chunk-T75VH6NT.js +0 -2
- package/dist/cli/chunks/chunk-VM6VBRRU.js +0 -43
- package/dist/cli/chunks/chunk-WRMUQVKY.js +0 -2
- package/dist/cli/chunks/chunk-YY4KXDI6.js +0 -2
- package/dist/cli/chunks/client-S7DIRNFJ.js +0 -2
- package/dist/cli/chunks/core-handlers-NM2KCI6Z.js +0 -2
- package/dist/cli/chunks/cross-domain-router-3TSZMCBM.js +0 -2
- package/dist/cli/chunks/dream-QIIJONYI.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-CDNGLJJO.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-CR7Y4OAM.js +0 -2
- package/dist/cli/chunks/hnsw-index-TEDO4MQC.js +0 -2
- package/dist/cli/chunks/hybrid-router-O24ZDIP5.js +0 -2
- package/dist/cli/chunks/impact-analyzer-PDM4SDB6.js +0 -2
- package/dist/cli/chunks/init-wizard-F4KODPNW.js +0 -2
- package/dist/cli/chunks/kernel-77UM35L6.js +0 -2
- package/dist/cli/chunks/knowledge-graph-R6ZWWV2K.js +0 -2
- package/dist/cli/chunks/llm-router-service-7QYCZ66H.js +0 -2
- package/dist/cli/chunks/load-test-AWVA3CAQ.js +0 -2
- package/dist/cli/chunks/memory-backend-YESSIHFW.js +0 -2
- package/dist/cli/chunks/memory-handlers-EOOWSUHI.js +0 -2
- package/dist/cli/chunks/pattern-null-store-X3UXLJNL.js +0 -2
- package/dist/cli/chunks/protocol-executor-KXDCTMWI.js +0 -2
- package/dist/cli/chunks/provider-manager-XJZVHYI6.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-DPHPNIC6.js +0 -2
- package/dist/cli/chunks/queen-coordinator-EVGWME5C.js +0 -2
- package/dist/cli/chunks/router-R2N7TMAS.js +0 -2
- package/dist/cli/chunks/routing-feedback-G6W3H26L.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-D7R2GWXK.js +0 -2
- package/dist/cli/chunks/safe-db-CQZGF2KA.js +0 -2
- package/dist/cli/chunks/schedule-UP7E3LRC.js +0 -2
- package/dist/cli/chunks/scheduler-ENIZHYSL.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-HDDCXCHY.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-CEVJVWS5.js +0 -2
- package/dist/cli/chunks/sync-REEFKICL.js +0 -2
- package/dist/cli/chunks/token-bootstrap-MQCTJURQ.js +0 -2
- package/dist/cli/chunks/transformers-EKDJW2H6.js +0 -2
- package/dist/cli/chunks/unified-memory-PXOQ4N53.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-VEXD6ASE.js +0 -2
- package/dist/cli/chunks/unified-persistence-46G6MZYC.js +0 -2
- package/dist/cli/chunks/visual-security-4X3T3MFL.js +0 -2
- package/dist/cli/chunks/witness-chain-XW4S3LVW.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-IIVV6TCP.js +0 -2
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QE-Court referee (ADR-124) — the falsifiable core of the adversarial court,
|
|
3
|
+
* as pure, deterministic functions so the court's invariants are ENFORCED in
|
|
4
|
+
* code (and unit-testable as oracles), not merely described in the skill doc.
|
|
5
|
+
*
|
|
6
|
+
* These back the qe-court acceptance eval (`.claude/skills/qe-court/evals`):
|
|
7
|
+
* - verdict resolution + the overturn mechanic (SHIP must survive escalation)
|
|
8
|
+
* - panel validation (writer≠juror, vendor diversity)
|
|
9
|
+
* - DoE-gated scoring (no un-validated numeric score)
|
|
10
|
+
*
|
|
11
|
+
* No I/O, no LLM calls — the orchestration (spawning prosecutors, calling the
|
|
12
|
+
* two-gate judge) lives in the skill; the RULES live here.
|
|
13
|
+
*/
|
|
14
|
+
/** Map a provider id to its coarse vendor. */
|
|
15
|
+
export function vendorOf(providerId) {
|
|
16
|
+
const p = providerId.toLowerCase();
|
|
17
|
+
if (p.startsWith('claude'))
|
|
18
|
+
return 'claude';
|
|
19
|
+
if (p.startsWith('cognitum'))
|
|
20
|
+
return 'cognitum';
|
|
21
|
+
if (p === 'codex' || p === 'openai' || p.startsWith('gpt') || p.startsWith('o3') || p.startsWith('o4'))
|
|
22
|
+
return 'gpt';
|
|
23
|
+
if (p.startsWith('openrouter'))
|
|
24
|
+
return 'openrouter';
|
|
25
|
+
if (p === 'ollama' || p === 'local')
|
|
26
|
+
return 'local';
|
|
27
|
+
return 'unknown';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the verdict from the surviving charges, applying the overturn window.
|
|
31
|
+
*
|
|
32
|
+
* THE OVERTURN MECHANIC: only charges surfaced at depth ≤ `overturnDepth` count.
|
|
33
|
+
* With `overturnDepth = 0` the deeper-review rounds are disabled, so a mutant a
|
|
34
|
+
* shallow pass missed (surfaced at depth ≥ 1) does NOT count and the verdict
|
|
35
|
+
* stays SHIP — which is exactly the false-SHIP the court exists to catch. With
|
|
36
|
+
* `overturnDepth ≥ 1` that same charge counts and flips the verdict. This
|
|
37
|
+
* asymmetry is the whole point: a SHIP must SURVIVE escalation.
|
|
38
|
+
*/
|
|
39
|
+
export function resolveVerdict(charges, overturnDepth) {
|
|
40
|
+
const surviving = charges.filter((c) => c.reproduced && c.depthFound <= overturnDepth);
|
|
41
|
+
if (surviving.some((c) => c.fatal))
|
|
42
|
+
return 'BLOCK';
|
|
43
|
+
if (surviving.length > 0)
|
|
44
|
+
return 'REMAND';
|
|
45
|
+
return 'SHIP';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Validate a seated panel against the court's anti-collusion invariants.
|
|
49
|
+
* Returns a list of violation codes (empty == valid).
|
|
50
|
+
* - 'writerIsNeverJuror' : the jury shares a vendor with the writer/defense.
|
|
51
|
+
* - 'vendor-diversity' : fewer than `minVendors` distinct vendors seated.
|
|
52
|
+
*/
|
|
53
|
+
export function validatePanel(panel, policy = {}) {
|
|
54
|
+
const minVendors = policy.minVendors ?? 2;
|
|
55
|
+
const violations = [];
|
|
56
|
+
const vendorsSeated = new Set(panel.map((s) => vendorOf(s.provider)));
|
|
57
|
+
if (vendorsSeated.size < minVendors)
|
|
58
|
+
violations.push('vendor-diversity');
|
|
59
|
+
const jury = panel.find((s) => s.role === 'jury');
|
|
60
|
+
const writerLike = panel.filter((s) => s.role === 'writer' || s.role === 'defense');
|
|
61
|
+
if (jury) {
|
|
62
|
+
const juryVendor = vendorOf(jury.provider);
|
|
63
|
+
if (writerLike.some((w) => vendorOf(w.provider) === juryVendor)) {
|
|
64
|
+
violations.push('writerIsNeverJuror');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return violations;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* DoE-gated scoring: emit a numeric score ONLY when the operator asked for one
|
|
71
|
+
* AND the scoring rubric passed the ADR-122 ANOVA screen (it actually
|
|
72
|
+
* discriminates). Otherwise the court reports the verdict class + charges, never
|
|
73
|
+
* a noise "91/100".
|
|
74
|
+
*/
|
|
75
|
+
export function shouldEmitScore(rubricDoePassed, emitScore) {
|
|
76
|
+
return emitScore && rubricDoePassed;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=referee.js.map
|
|
@@ -40,6 +40,15 @@ export interface SealedInputs {
|
|
|
40
40
|
provenanceTier: string;
|
|
41
41
|
/** Whether judge-tier promotion was explicitly budgeted (ADR-121). */
|
|
42
42
|
allowJudgeTier?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* accept/v1+sig only: the candidate's PER-HELD-OUT-TASK scores, matched by
|
|
45
|
+
* index to `baselineHeldOutSamples`. Optional and omitted from the sealed hash
|
|
46
|
+
* when undefined (so `accept/v1` receipts are byte-identical). The paired
|
|
47
|
+
* bootstrap significance gate needs these; `accept/v1` ignores them.
|
|
48
|
+
*/
|
|
49
|
+
candidateHeldOutSamples?: number[];
|
|
50
|
+
/** accept/v1+sig only: the baseline's per-held-out-task scores (paired by index). */
|
|
51
|
+
baselineHeldOutSamples?: number[];
|
|
43
52
|
}
|
|
44
53
|
export interface RuleResult {
|
|
45
54
|
promote: boolean;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
import { createHash } from 'node:crypto';
|
|
26
26
|
import { meetsNoRegression } from './anchor-set.js';
|
|
27
27
|
import { tierAllowsPromotion } from '../learning/provenance-tier.js';
|
|
28
|
+
import { bootstrapDeltaCILow, pairedDeltas } from './paired-bootstrap.js';
|
|
28
29
|
/** Tag domain-separating the rule fingerprint hash. */
|
|
29
30
|
const RULE_TAG = 'aqe:accept-rule:v1+sig';
|
|
30
31
|
/**
|
|
@@ -45,9 +46,69 @@ const acceptV1 = (s) => {
|
|
|
45
46
|
}
|
|
46
47
|
return { promote: true, reason: 'held-out gain, no anchor regression, oracle-tier evidence' };
|
|
47
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* accept/v1+sig — accept/v1 PLUS a paired-bootstrap significance gate on the
|
|
51
|
+
* held-out delta (adopted from ruflo's flywheel gate). A NEW frozen version:
|
|
52
|
+
* `accept/v1` is untouched. Promotes only when accept/v1 passes AND the paired
|
|
53
|
+
* per-task held-out gain is significant (one-sided 95% CI lower bound > 0) —
|
|
54
|
+
* closing accept/v1's "promote any positive mean-beat, even within noise" gap.
|
|
55
|
+
*
|
|
56
|
+
* Fail-closed: if the paired sample vectors are absent or mismatched, it does
|
|
57
|
+
* NOT promote (a significance claim it cannot verify is a rejection).
|
|
58
|
+
*/
|
|
59
|
+
/** Minimum paired sample size for a meaningful bootstrap CI. Below this, a "95%
|
|
60
|
+
* CI" is just the raw delta dressed up (n=1 → ciLow == delta), so we fail closed
|
|
61
|
+
* rather than certify noise as significant (qe-court finding). */
|
|
62
|
+
const MIN_SIG_SAMPLES = 8;
|
|
63
|
+
/** Tolerance for mean(samples) vs the sealed scalar — guards forged scalar/vector pairs. */
|
|
64
|
+
const SAMPLE_MEAN_TOL = 1e-6;
|
|
65
|
+
const mean = (xs) => xs.reduce((a, b) => a + b, 0) / xs.length;
|
|
66
|
+
const acceptV1Sig = (s) => {
|
|
67
|
+
const base = acceptV1(s);
|
|
68
|
+
if (!base.promote)
|
|
69
|
+
return base;
|
|
70
|
+
const cand = s.candidateHeldOutSamples;
|
|
71
|
+
const bl = s.baselineHeldOutSamples;
|
|
72
|
+
if (!cand || !bl || cand.length === 0 || cand.length !== bl.length) {
|
|
73
|
+
return {
|
|
74
|
+
promote: false,
|
|
75
|
+
reason: `significance gate: missing/mismatched paired held-out samples ` +
|
|
76
|
+
`(need equal-length candidate & baseline per-task vectors)`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (cand.length < MIN_SIG_SAMPLES) {
|
|
80
|
+
return {
|
|
81
|
+
promote: false,
|
|
82
|
+
reason: `significance gate: only ${cand.length} paired samples (< ${MIN_SIG_SAMPLES}) — ` +
|
|
83
|
+
`a bootstrap CI is not meaningful; fail closed rather than certify noise`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// The sealed scalar means MUST match the sealed sample vectors, or a forged
|
|
87
|
+
// receipt could pair a passing scalar with an unrelated (or noisy) vector to
|
|
88
|
+
// spoof significance. This module's whole job is to defend against forged
|
|
89
|
+
// receipts (ADR-120), so it asserts the two describe the same evaluation.
|
|
90
|
+
if (Math.abs(mean(cand) - s.candidateHeldOut) > SAMPLE_MEAN_TOL ||
|
|
91
|
+
Math.abs(mean(bl) - s.baselineHeldOut) > SAMPLE_MEAN_TOL) {
|
|
92
|
+
return {
|
|
93
|
+
promote: false,
|
|
94
|
+
reason: `significance gate: sealed sample means do not match the sealed held-out ` +
|
|
95
|
+
`scalars — inconsistent/forged evaluation`,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const ciLow = bootstrapDeltaCILow(pairedDeltas(cand, bl));
|
|
99
|
+
if (!(ciLow > 0)) {
|
|
100
|
+
return {
|
|
101
|
+
promote: false,
|
|
102
|
+
reason: `significance gate: paired held-out gain not significant ` +
|
|
103
|
+
`(95% CI lower bound ${ciLow.toFixed(4)} ≤ 0)`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return { promote: true, reason: `${base.reason}; paired gain significant (CI low ${ciLow.toFixed(4)} > 0)` };
|
|
107
|
+
};
|
|
48
108
|
/** Registry of versioned frozen rules. Add a NEW key to change a rule; never edit in place. */
|
|
49
109
|
export const ACCEPTANCE_RULES = Object.freeze({
|
|
50
110
|
'accept/v1': acceptV1,
|
|
111
|
+
'accept/v1+sig': acceptV1Sig,
|
|
51
112
|
});
|
|
52
113
|
/**
|
|
53
114
|
* Canonical (sorted-key) JSON — same discipline as ADR-116 proof-gate. Keys
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paired-delta bootstrap significance (ADR-118 accept/v1+sig).
|
|
3
|
+
*
|
|
4
|
+
* Adopted from ruflo's flywheel promotion gate (`accept/v1+sig`,
|
|
5
|
+
* `bootstrapDeltaCILow`), reimplemented dependency-free (technique adoption, not
|
|
6
|
+
* an import — AQE does not depend on the ruflo package). ruflo's gate closes a
|
|
7
|
+
* real gap in AQE's `accept/v1`, which promotes a candidate whose held-out MEAN
|
|
8
|
+
* merely beats baseline by any amount — i.e. it can promote a within-noise gain.
|
|
9
|
+
*
|
|
10
|
+
* This computes a one-sided lower confidence bound on the MEAN of the PAIRED
|
|
11
|
+
* per-task deltas (candidate − baseline, matched by task). If that bound is > 0
|
|
12
|
+
* the gain is significant. The pairing is what makes it stronger than an
|
|
13
|
+
* unpaired 2-group ANOVA (for 2 groups ANOVA F = t², and it discards the
|
|
14
|
+
* pairing this exploits).
|
|
15
|
+
*
|
|
16
|
+
* MUST be DETERMINISTIC — the promotion decision is replay-verified (ADR-120):
|
|
17
|
+
* a fixed-seed LCG resampler makes the same deltas always yield the same bound,
|
|
18
|
+
* so an independent re-run reproduces the exact promote/reject decision.
|
|
19
|
+
*/
|
|
20
|
+
export interface BootstrapOptions {
|
|
21
|
+
/** Resample count (default 2000, matching ruflo). */
|
|
22
|
+
iters?: number;
|
|
23
|
+
/** One-sided significance level (default 0.05 → 95% lower bound). */
|
|
24
|
+
alpha?: number;
|
|
25
|
+
/** LCG seed. Fixed by default so the bound is reproducible for replay. */
|
|
26
|
+
seed?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One-sided lower confidence bound on the mean of `deltas`. Returns -Infinity
|
|
30
|
+
* for an empty sample (no evidence ⇒ never significant), so callers can gate on
|
|
31
|
+
* `bootstrapDeltaCILow(deltas) > 0` and fail closed.
|
|
32
|
+
*/
|
|
33
|
+
export declare function bootstrapDeltaCILow(deltas: number[], opts?: BootstrapOptions): number;
|
|
34
|
+
/** Convenience: paired deltas from matched candidate/baseline sample vectors. */
|
|
35
|
+
export declare function pairedDeltas(candidate: number[], baseline: number[]): number[];
|
|
36
|
+
//# sourceMappingURL=paired-bootstrap.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paired-delta bootstrap significance (ADR-118 accept/v1+sig).
|
|
3
|
+
*
|
|
4
|
+
* Adopted from ruflo's flywheel promotion gate (`accept/v1+sig`,
|
|
5
|
+
* `bootstrapDeltaCILow`), reimplemented dependency-free (technique adoption, not
|
|
6
|
+
* an import — AQE does not depend on the ruflo package). ruflo's gate closes a
|
|
7
|
+
* real gap in AQE's `accept/v1`, which promotes a candidate whose held-out MEAN
|
|
8
|
+
* merely beats baseline by any amount — i.e. it can promote a within-noise gain.
|
|
9
|
+
*
|
|
10
|
+
* This computes a one-sided lower confidence bound on the MEAN of the PAIRED
|
|
11
|
+
* per-task deltas (candidate − baseline, matched by task). If that bound is > 0
|
|
12
|
+
* the gain is significant. The pairing is what makes it stronger than an
|
|
13
|
+
* unpaired 2-group ANOVA (for 2 groups ANOVA F = t², and it discards the
|
|
14
|
+
* pairing this exploits).
|
|
15
|
+
*
|
|
16
|
+
* MUST be DETERMINISTIC — the promotion decision is replay-verified (ADR-120):
|
|
17
|
+
* a fixed-seed LCG resampler makes the same deltas always yield the same bound,
|
|
18
|
+
* so an independent re-run reproduces the exact promote/reject decision.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* One-sided lower confidence bound on the mean of `deltas`. Returns -Infinity
|
|
22
|
+
* for an empty sample (no evidence ⇒ never significant), so callers can gate on
|
|
23
|
+
* `bootstrapDeltaCILow(deltas) > 0` and fail closed.
|
|
24
|
+
*/
|
|
25
|
+
export function bootstrapDeltaCILow(deltas, opts) {
|
|
26
|
+
const n = deltas.length;
|
|
27
|
+
if (n === 0)
|
|
28
|
+
return -Infinity;
|
|
29
|
+
const iters = opts?.iters ?? 2000;
|
|
30
|
+
const alpha = opts?.alpha ?? 0.05;
|
|
31
|
+
// Deterministic LCG (Numerical Recipes constants). Seed is fixed by default so
|
|
32
|
+
// the bound is byte-stable across independent replays of the same deltas.
|
|
33
|
+
let state = (opts?.seed ?? 0x9e3779b1) >>> 0;
|
|
34
|
+
const next = () => {
|
|
35
|
+
state = (Math.imul(state, 1664525) + 1013904223) >>> 0;
|
|
36
|
+
return state / 0x1_0000_0000;
|
|
37
|
+
};
|
|
38
|
+
const resampleMeans = new Array(iters);
|
|
39
|
+
for (let b = 0; b < iters; b++) {
|
|
40
|
+
let sum = 0;
|
|
41
|
+
for (let i = 0; i < n; i++) {
|
|
42
|
+
sum += deltas[Math.floor(next() * n)];
|
|
43
|
+
}
|
|
44
|
+
resampleMeans[b] = sum / n;
|
|
45
|
+
}
|
|
46
|
+
resampleMeans.sort((a, b) => a - b);
|
|
47
|
+
const idx = Math.min(Math.floor(alpha * iters), iters - 1);
|
|
48
|
+
return resampleMeans[idx];
|
|
49
|
+
}
|
|
50
|
+
/** Convenience: paired deltas from matched candidate/baseline sample vectors. */
|
|
51
|
+
export function pairedDeltas(candidate, baseline) {
|
|
52
|
+
const n = Math.min(candidate.length, baseline.length);
|
|
53
|
+
const out = new Array(n);
|
|
54
|
+
for (let i = 0; i < n; i++)
|
|
55
|
+
out[i] = candidate[i] - baseline[i];
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=paired-bootstrap.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-qe",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 13 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 60 specialized QE agents, mathematical Coherence verification, deep Claude Flow integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"test:all": "npm test -- --run",
|
|
79
79
|
"test:mcp": "npm run test:unit:mcp",
|
|
80
80
|
"test:mcp:integration": "npm test -- --run tests/integration/mcp/",
|
|
81
|
-
"test:integration:fast": "NODE_OPTIONS='--max-old-space-size=2048 --expose-gc' vitest run tests/integration/mcp/fleet-init-wires-daemon.test.ts tests/integration/mcp/mcp-cli-inprocess.test.ts tests/integration/mcp/memory-delete-cache-invalidation.test.ts tests/integration/workers/workers-reach-domains.test.ts tests/integration/learning/coordinator-roundtrip.test.ts tests/integration/bridge/bridge-end-to-end.test.ts",
|
|
81
|
+
"test:integration:fast": "NODE_OPTIONS='--max-old-space-size=2048 --expose-gc' vitest run tests/integration/mcp/fleet-init-wires-daemon.test.ts tests/integration/mcp/mcp-cli-inprocess.test.ts tests/integration/mcp/memory-delete-cache-invalidation.test.ts tests/integration/workers/workers-reach-domains.test.ts tests/integration/learning/coordinator-roundtrip.test.ts tests/integration/bridge/bridge-end-to-end.test.ts tests/integration/rvf-corruption-recovery.integration.test.ts",
|
|
82
82
|
"test:integration": "NODE_OPTIONS='--max-old-space-size=4096 --expose-gc' vitest run tests/integration/ --exclude='**/browser/**' --exclude='**/browser-integration/**' --exclude='**/*.e2e.test.ts'",
|
|
83
83
|
"mcp:validate": "node scripts/smoke-mcp-protocol.mjs",
|
|
84
84
|
"mcp:parity": "node scripts/audit-mcp-tool-parity.mjs",
|
|
@@ -164,7 +164,6 @@
|
|
|
164
164
|
"author": "AQE Development Team",
|
|
165
165
|
"license": "MIT",
|
|
166
166
|
"dependencies": {
|
|
167
|
-
"@huggingface/transformers": "^4.2.0",
|
|
168
167
|
"@ruvector/attention": "0.1.3",
|
|
169
168
|
"@ruvector/gnn": "0.1.25",
|
|
170
169
|
"@ruvector/learning-wasm": "^0.1.29",
|
|
@@ -190,7 +189,8 @@
|
|
|
190
189
|
},
|
|
191
190
|
"peerDependencies": {
|
|
192
191
|
"@claude-flow/browser": "3.0.0-alpha.1",
|
|
193
|
-
"@claude-flow/guidance": "3.0.0-alpha.1"
|
|
192
|
+
"@claude-flow/guidance": "3.0.0-alpha.1",
|
|
193
|
+
"@huggingface/transformers": "^4.2.0"
|
|
194
194
|
},
|
|
195
195
|
"peerDependenciesMeta": {
|
|
196
196
|
"@claude-flow/browser": {
|
|
@@ -198,6 +198,9 @@
|
|
|
198
198
|
},
|
|
199
199
|
"@claude-flow/guidance": {
|
|
200
200
|
"optional": true
|
|
201
|
+
},
|
|
202
|
+
"@huggingface/transformers": {
|
|
203
|
+
"optional": true
|
|
201
204
|
}
|
|
202
205
|
},
|
|
203
206
|
"optionalDependencies": {
|
|
@@ -240,6 +243,7 @@
|
|
|
240
243
|
"devDependencies": {
|
|
241
244
|
"@claude-flow/guidance": "3.0.0-alpha.1",
|
|
242
245
|
"@faker-js/faker": "^10.2.0",
|
|
246
|
+
"@huggingface/transformers": "^4.2.0",
|
|
243
247
|
"@types/better-sqlite3": "^7.6.13",
|
|
244
248
|
"@types/cli-progress": "^3.11.6",
|
|
245
249
|
"@types/node": "^25.8.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.12.2");process.exit(0)}
|
|
2
|
-
import{a,b,c}from"./chunk-T6TQPF5P.js";import"./chunk-KV5OZ6T3.js";import"./chunk-WMNGPIP3.js";import"./chunk-CKFZOPZN.js";import"./chunk-X47GHZY3.js";import"./chunk-HU6ETNA7.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.12.2");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-5YLY2WT2.js";import"./chunk-Z63IOTDW.js";import"./chunk-WC5PM33J.js";import"./chunk-5CGTBAVF.js";import"./chunk-F3CKOVZM.js";import"./chunk-YRO7HNS4.js";import"./chunk-WYFEVPLO.js";import"./chunk-BDX54WJV.js";import"./chunk-WE5QHYL7.js";import"./chunk-T75VH6NT.js";import"./chunk-ADZTWGEB.js";import"./chunk-2L7K2J2T.js";import"./chunk-AJ6DZXKK.js";import"./chunk-TQNNKW7K.js";import"./chunk-PHIEJAQK.js";import"./chunk-APVXTHTA.js";import"./chunk-AL5QT6OX.js";import"./chunk-YY4KXDI6.js";import"./chunk-R5HC6JVJ.js";import"./chunk-ACDZ2CRV.js";import"./chunk-CKFZOPZN.js";import"./chunk-6SWR2BN7.js";import"./chunk-TRHUH24V.js";import"./chunk-6N62KS3C.js";import"./chunk-P65S7AZA.js";import"./chunk-EGU54SNK.js";import"./chunk-X47GHZY3.js";import"./chunk-ZBYMF2QJ.js";import"./chunk-WRMUQVKY.js";import"./chunk-UF3YOGHV.js";import"./chunk-V2QYW5KW.js";import"./chunk-4KEOBDEI.js";import"./chunk-C7VNQ4PY.js";import"./chunk-QYST2TZW.js";import"./chunk-YZ44FUVJ.js";import"./chunk-YDZIPP3Y.js";import"./chunk-CTFW7CMI.js";import"./chunk-HU6ETNA7.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.12.2");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-LIAW5FD7.js";import"./chunk-ZHWXI4SK.js";import"./chunk-APVXTHTA.js";import"./chunk-AL5QT6OX.js";import"./chunk-YY4KXDI6.js";import"./chunk-R5HC6JVJ.js";import"./chunk-ACDZ2CRV.js";import"./chunk-CKFZOPZN.js";import"./chunk-P65S7AZA.js";import"./chunk-X47GHZY3.js";import"./chunk-ZBYMF2QJ.js";import"./chunk-ERQL3D2O.js";import"./chunk-WRMUQVKY.js";import"./chunk-UF3YOGHV.js";import"./chunk-V2QYW5KW.js";import"./chunk-4KEOBDEI.js";import"./chunk-C7VNQ4PY.js";import"./chunk-QYST2TZW.js";import"./chunk-YZ44FUVJ.js";import"./chunk-YDZIPP3Y.js";import"./chunk-CTFW7CMI.js";import"./chunk-HU6ETNA7.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.12.2");process.exit(0)}
|
|
2
|
-
import{a as A,b as L,c as F,d as R,e as Y,f as T,g as P,h as C,i as j,j as X,k as V,l as ye,m as $,n as Z,o as be,p as _,q as J,r as U,s as W}from"./chunk-R6LDR3IO.js";import{h as ge}from"./chunk-ADZTWGEB.js";import{b as pe}from"./chunk-2L7K2J2T.js";import"./chunk-APVXTHTA.js";import"./chunk-AL5QT6OX.js";import"./chunk-YY4KXDI6.js";import"./chunk-R5HC6JVJ.js";import"./chunk-ACDZ2CRV.js";import{b as x,d as Q}from"./chunk-CKFZOPZN.js";import{a as fe,b as me,c as ue,d as k,f as ze}from"./chunk-TRHUH24V.js";import"./chunk-P65S7AZA.js";import"./chunk-X47GHZY3.js";import{a as O,b as We}from"./chunk-WRMUQVKY.js";import"./chunk-UF3YOGHV.js";import"./chunk-V2QYW5KW.js";import"./chunk-4KEOBDEI.js";import"./chunk-C7VNQ4PY.js";import"./chunk-QYST2TZW.js";import"./chunk-YZ44FUVJ.js";import"./chunk-YDZIPP3Y.js";import"./chunk-CTFW7CMI.js";import"./chunk-HU6ETNA7.js";import B from"path";import o from"chalk";We();Q();import{existsSync as z,mkdirSync as He,writeFileSync as Ke,readFileSync as ee}from"fs";import{join as E,resolve as ne}from"path";var Ge={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Qe(e,n){let r=Ge[e.tableName];return!(r&&n[r]===!1)}var Ye=1e4;function Xe(e,n,r,t){if(!Qe(n,r))return Z(E(t,n.fileName),[]),{count:0,rows:[]};let[a,s]=n.domainColumn?$(r.domains,n.domainColumn):[void 0,[]];if(X(e,n.tableName,a,s)>=Ye){let d=n.blobColumns,c=d&&d.length>0?p=>T(p,d):void 0;return{count:be(E(t,n.fileName),ye(e,n.tableName,a,s),c)}}let i=V(e,n.tableName,a,s);return n.blobColumns&&n.blobColumns.length>0&&(i=i.map(d=>T(d,n.blobColumns))),Z(E(t,n.fileName),i),{count:i.length,rows:i}}function he(e){let n=[];for(let r of R){let t=E(e,r.fileName);z(t)?n.push(C(ee(t,"utf-8"))):n.push(C(""))}return C(n.join(":"))}function we(e,n,r="memory.db"){let t=ne(n.outputPath);z(t)||He(t,{recursive:!0});let a=0,s={},l=new Set;for(let u of R){let p=Xe(e,u,n,t);if(s[u.tableName]=p.count,a+=p.count,u.tableName==="qe_patterns"){if(p.rows)for(let f of p.rows)f.qe_domain&&l.add(f.qe_domain);else if(p.count>0){let[f,w]=u.domainColumn?$(n.domains,u.domainColumn):[void 0,[]],y=`SELECT DISTINCT qe_domain FROM qe_patterns ${f?`WHERE ${f} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let g=e.prepare(y).all(...w||[]);for(let v of g)l.add(v.qe_domain)}catch{}}}}let i=n.includeVectors!==!1?X(e,"vectors"):0,d=he(t),c={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:s.qe_patterns||0,vectorCount:i,qValueCount:s.rl_q_values||0,dreamInsightCount:s.dream_insights||0,witnessChainLength:s.witness_chain||0,totalRecords:a},domains:[...l].sort(),checksum:d,tableRecordCounts:s};return Ke(E(t,"manifest.json"),JSON.stringify(c,null,2),"utf-8"),c}var Ze=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function en(e){return e==="1.0"?R.filter(n=>Ze.has(n.tableName)):e==="3.0"?R:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),R)}function ve(e,n,r){let t=ne(n),a=E(t,"manifest.json");if(!z(a))throw new Error(`Manifest not found at ${a}`);let s=x(ee(a,"utf-8")),l=he(t);if(l!==s.checksum)throw new Error(`Checksum mismatch: expected ${s.checksum}, got ${l}. The export may have been tampered with or corrupted.`);let i=en(s.version);if(r.dryRun){let f=0;for(let w of i){let m=_(E(t,w.fileName),x);f+=m.length}return{imported:f,skipped:0,conflicts:0}}W(e);let d=0,c=0,u=0;return e.transaction(()=>{for(let f of i){let w=E(t,f.fileName),m=_(w,x);f.blobColumns&&f.blobColumns.length>0&&(m=m.map(y=>P(y,f.blobColumns)));for(let y of m){let g;if(f.dedupColumns&&f.dedupColumns.length>0)g=U(e,f.tableName,y,f.dedupColumns);else{let v=A[f.tableName]||"id",b=F[f.tableName],I=L[f.tableName];g=J(e,f.tableName,y,v,r.mergeStrategy,b,I)}d+=g.imported,c+=g.skipped,u+=g.conflicts}}})(),{imported:d,skipped:c,conflicts:u}}function Re(e){let n=ne(e),r=E(n,"manifest.json");if(!z(r))throw new Error(`Manifest not found at ${r}`);return x(ee(r,"utf-8"))}ze();import{existsSync as H,statSync as nn,unlinkSync as Se,writeFileSync as tn}from"fs";import{resolve as te}from"path";function xe(e,n,r="memory.db"){if(!k())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let t=te(n.outputPath),a=n.dimension??384;H(t)&&Se(t);let s=`${t}.idmap.json`;H(s)&&Se(s);let l=fe(t,a);try{let i={},d=new Set,c=0;for(let S of R){let[h,ce]=S.domainColumn?$(n.domains,S.domainColumn):[void 0,[]],D=V(e,S.tableName,h,ce);if(S.tableName==="qe_patterns")for(let q of D)q.qe_domain&&d.add(q.qe_domain);let G=Y[S.tableName];G&&G.length>0&&(D=D.map(q=>T(q,G))),i[S.tableName]=D,c+=D.length}let u=0,p=[];if(j(e,"qe_pattern_embeddings")){let S=e.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings").all();for(let h of S)h.embedding&&h.dimension===a&&p.push({id:`pe:${h.pattern_id}`,vector:new Float32Array(h.embedding.buffer,h.embedding.byteOffset,a),metadata:{tableName:"qe_pattern_embeddings"}})}if(j(e,"captured_experiences")){let S=e.prepare("SELECT id, embedding, embedding_dimension, domain, quality FROM captured_experiences WHERE embedding IS NOT NULL").all();for(let h of S)h.embedding_dimension===a&&p.push({id:`exp:${h.id}`,vector:new Float32Array(h.embedding.buffer,h.embedding.byteOffset,a),metadata:{tableName:"captured_experiences",domain:h.domain,confidence:h.quality}})}if(j(e,"sona_patterns")){let S=e.prepare("SELECT id, state_embedding, domain, confidence FROM sona_patterns WHERE state_embedding IS NOT NULL").all();for(let h of S)h.state_embedding.byteLength/4===a&&p.push({id:`sona:${h.id}`,vector:new Float32Array(h.state_embedding.buffer,h.state_embedding.byteOffset,a),metadata:{tableName:"sona_patterns",domain:h.domain,confidence:h.confidence}})}p.length>0&&(u=l.ingest(p).accepted);let f={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:r,domains:[...d].sort(),tables:i},w=JSON.stringify(f),m=C(w),y=Buffer.from(w);l.embedKernel(y);let g=n.sign?l.sign(y)??void 0:void 0,v=g?n.signerKeyId??"default":void 0,b=l.fileId(),I=b?{fileId:b,parentId:l.parentId(),lineageDepth:l.lineageDepth()}:void 0,N=l.status(),M={version:"3.0",format:"rvf",exportedAt:f.exportedAt,sourceDb:r,stats:{patternCount:(i.qe_patterns||[]).length,embeddingCount:u,qValueCount:(i.rl_q_values||[]).length,dreamInsightCount:(i.dream_insights||[]).length,witnessChainLength:(i.witness_chain||[]).length,totalRecords:c},domains:f.domains,checksum:m,rvfStatus:{totalVectors:N.totalVectors,totalSegments:N.totalSegments,fileSizeBytes:N.fileSizeBytes},...g?{signature:g,signerKeyId:v}:{},...I?{lineage:I}:{}};if(g)try{l.freeze()}catch{}let Ue=`${t}.manifest.json`;return tn(Ue,JSON.stringify(M,null,2),"utf-8"),M}finally{l.close()}}var rn={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function Ce(e,n,r){if(!k())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let t=te(n);if(!H(t))throw new Error(`RVF file not found: ${t}`);let a=me(t);try{let s=a.verifyWitness();if(!s.valid&&(s.totalEntries>0||s.errors.length>0)){let m=s.errors.length>0?s.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let l=a.extractKernel();if(!l||!l.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let i;try{i=JSON.parse(l.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}if(r.dryRun){let m=0;if(i.tables)for(let y of Object.values(i.tables))m+=y?.length??0;else m=(i.patterns?.length??0)+(i.qValues?.length??0)+(i.dreamInsights?.length??0)+(i.witnessChain?.length??0);return{imported:m,skipped:0,conflicts:0,embeddingsRestored:0}}W(e);let d=0,c=0,u=0,p=0,f={};if(i.tables)Object.assign(f,i.tables);else for(let[m,y]of Object.entries(rn)){let g=i[m];Array.isArray(g)&&(f[y]=g)}if(e.transaction(()=>{for(let m of R){let y=f[m.tableName];if(!y||!Array.isArray(y))continue;let g=Y[m.tableName];if(g&&g.length>0){y=y.map(v=>P(v,g));for(let v of y)for(let b of g)v[b]instanceof Buffer&&p++}for(let v of y){let b;if(m.dedupColumns&&m.dedupColumns.length>0)b=U(e,m.tableName,v,m.dedupColumns);else{let I=A[m.tableName]||"id",N=F[m.tableName],M=L[m.tableName];b=J(e,m.tableName,v,I,r.mergeStrategy,N,M)}d+=b.imported,c+=b.skipped,u+=b.conflicts}}})(),u>0)try{a.compact()}catch{}return{imported:d,skipped:c,conflicts:u,embeddingsRestored:p}}finally{a.close()}}function K(e){if(!k())throw new Error("@ruvector/rvf-node is not available.");let n=te(e);if(!H(n))throw new Error(`RVF file not found: ${n}`);let r=ue(n);try{let t=r.extractKernel();if(!t||!t.image)throw new Error("No brain data found in RVF file");let a=t.image.toString("utf-8"),s;try{s=JSON.parse(a)}catch(w){throw new Error(`Failed to parse brain kernel data as JSON: ${w instanceof Error?w.message:w}`)}let l=r.status(),i=nn(n).size,d=s.tables,c=d?d.qe_patterns?.length??0:s.patterns?.length??0,u=d?d.rl_q_values?.length??0:s.qValues?.length??0,p=d?d.dream_insights?.length??0:s.dreamInsights?.length??0,f=d?d.witness_chain?.length??0:s.witnessChain?.length??0;return{version:"3.0",format:"rvf",exportedAt:s.exportedAt??"unknown",sourceDb:s.sourceDb??"unknown",stats:{patternCount:c,embeddingCount:l.totalVectors,qValueCount:u,dreamInsightCount:p,witnessChainLength:f},domains:s.domains??[],checksum:C(a),rvfStatus:{totalVectors:l.totalVectors,totalSegments:l.totalSegments,fileSizeBytes:i}}}finally{r.close()}}function re(){return k()}Q();import{existsSync as ae,readFileSync as on,statSync as an}from"fs";import{join as oe,resolve as Ee}from"path";function Oe(e,n,r={}){let t=Ee(e),a=Ee(n),s=Be(t),l=Be(a),i=_e(t,s),d=_e(a,l),c=s==="jsonl"&&l==="jsonl",u=dn({pathA:t,pathB:a,manifestA:i,manifestB:d,recordLevel:c,tableFilter:r.tableFilter,maxIdsPerBucket:r.maxIdsPerBucket??500}),p=new Set(i.domains),f=new Set(d.domains),w=i.domains.filter(b=>!f.has(b)),m=d.domains.filter(b=>!p.has(b)),y=i.checksum===d.checksum,g=i.version===d.version,v=y&&g&&u.every(b=>b.delta===0&&(b.added?.length??0)===0&&(b.removed?.length??0)===0&&(b.changed?.length??0)===0);return{pathA:t,pathB:a,formatA:s,formatB:l,manifestA:i,manifestB:d,checksumMatch:y,versionMatch:g,identical:v,recordLevel:c,tableDiffs:u,domainsOnlyInA:w,domainsOnlyInB:m}}function Be(e){if(!ae(e))throw new Error(`Path not found: ${e}`);if(e.endsWith(".rvf"))return"rvf";if(an(e).isFile())throw new Error(`Unsupported brain export: ${e} (expected a .rvf file or a JSONL directory)`);return"jsonl"}function _e(e,n){return n==="rvf"?ln(e):sn(e)}function sn(e){let n=oe(e,"manifest.json");if(!ae(n))throw new Error(`Manifest not found at ${n}`);let r=x(on(n,"utf-8"));return Ae(r,"jsonl")}function ln(e){let n=K(e);return Ae(n,"rvf")}function Ae(e,n){return{format:n,version:e.version??"unknown",exportedAt:e.exportedAt??"unknown",sourceDb:e.sourceDb??"unknown",checksum:e.checksum??"",totalRecords:e.stats?.totalRecords??0,domains:e.domains??[],tableRecordCounts:e.tableRecordCounts??{}}}function dn(e){let n=e.tableFilter?R.filter(t=>t.tableName===e.tableFilter):R;if(e.tableFilter&&n.length===0)throw new Error(`Unknown table: ${e.tableFilter}`);let r=[];for(let t of n){let a=e.manifestA.tableRecordCounts[t.tableName]??0,s=e.manifestB.tableRecordCounts[t.tableName]??0,l=s-a,i,d,c;if(e.recordLevel&&cn(t)){let u=fn(oe(e.pathA,t.fileName),oe(e.pathB,t.fileName),t,e.maxIdsPerBucket);i=u.added,d=u.removed,c=u.changed}r.push({tableName:t.tableName,countA:a,countB:s,delta:l,...i!==void 0?{added:i}:{},...d!==void 0?{removed:d}:{},...c!==void 0?{changed:c}:{}})}return r}function cn(e){return!0}function fn(e,n,r,t){let a=Ie(e,r),s=Ie(n,r),l=[],i=[],d=[];for(let[c,u]of a){let p=s.get(c);if(p===void 0)i.length<t&&i.push(c);else if(p!==u){if(r.dedupColumns&&r.dedupColumns.length>0)continue;d.length<t&&d.push(c)}}for(let c of s.keys())a.has(c)||l.length<t&&l.push(c);return l.sort(),i.sort(),d.sort(),{added:l,removed:i,changed:d}}function Ie(e,n){let r=new Map;if(!ae(e))return r;let t=_(e,x);for(let a of t){let s=mn(a,n);if(s===void 0)continue;let l=un(a);r.set(s,pn(l))}return r}function mn(e,n){if(n.dedupColumns&&n.dedupColumns.length>0){let a=[];for(let s of n.dedupColumns){let l=e[s];if(l==null)return;a.push(String(l))}return a.join("")}let r=A[n.tableName]??"id",t=e[r];if(t!=null)return String(t)}function un(e){let n=Object.keys(e).sort(),r={};for(let t of n)r[t]=e[t];return JSON.stringify(r)}function pn(e){return C(e)}Q();import{existsSync as ie,statSync as gn}from"fs";import{join as Ne,resolve as yn}from"path";var bn=20,hn="qe_patterns";function De(e,n={}){let r=yn(e);Rn(r);let t=n.table??hn,a=R.find(g=>g.tableName===t);if(!a)throw new Error(`Unknown table: ${t}`);let s=Ne(r,a.fileName);if(!ie(s))throw new Error(`Table file not found: ${a.fileName} (expected in ${r}). Was this export generated with --format jsonl?`);let l=_(s,x),i=a.domainColumn,d=Math.max(1,n.limit??bn),c=n.query?n.query.toLowerCase():void 0,u=n.domains&&n.domains.length>0?new Set(n.domains):void 0,p=n.since,f=n.until,w=n.patternType,m=0,y=[];for(let g of l)wn(g,{domainColumn:i,domains:u,patternType:w,since:p,until:f,queryLower:c})&&(m++,y.length<d&&y.push(vn(g,a.tableName,i)));return{table:t,inputPath:r,totalScanned:l.length,totalMatched:m,limit:d,hits:y,truncated:m>d}}function wn(e,n){if(n.domains){if(!n.domainColumn)return!1;let r=e[n.domainColumn];if(typeof r!="string"||!n.domains.has(r))return!1}if(n.patternType!==void 0&&e.pattern_type!==n.patternType)return!1;if(n.since!==void 0||n.until!==void 0){let r=ke(e);if(r===void 0||n.since!==void 0&&r<n.since||n.until!==void 0&&r>n.until)return!1}if(n.queryLower!==void 0){let r=typeof e.name=="string"?e.name.toLowerCase():"",t=typeof e.description=="string"?e.description.toLowerCase():"";if(!r.includes(n.queryLower)&&!t.includes(n.queryLower))return!1}return!0}function ke(e){for(let n of["updated_at","created_at","timestamp"]){let r=e[n];if(typeof r=="string"&&r.length>0)return r}}function vn(e,n,r){let t=(typeof e.id=="string"||typeof e.id=="number"?String(e.id):void 0)??`${n}:?`,a={name:typeof e.name=="string"?e.name:void 0,description:typeof e.description=="string"?e.description:void 0,domain:r&&typeof e[r]=="string"?e[r]:void 0,patternType:typeof e.pattern_type=="string"?e.pattern_type:void 0,confidence:typeof e.confidence=="number"?e.confidence:void 0,updatedAt:ke(e)};return{id:t,display:a,row:e}}function Rn(e){if(!ie(e))throw new Error(`Path not found: ${e}`);if(gn(e).isFile())throw e.endsWith(".rvf")?new Error("Brain search does not support RVF exports. Re-export with --format jsonl, or use `aqe brain info` for RVF summaries."):new Error(`Unsupported brain export: ${e} (expected a JSONL directory)`);let r=Ne(e,"manifest.json");if(!ie(r))throw new Error(`Manifest not found at ${r}. Is this a brain export directory?`)}function Te(e,n){if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};e.exec(`
|
|
3
|
-
CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
|
|
4
|
-
pattern_id TEXT PRIMARY KEY
|
|
5
|
-
)
|
|
6
|
-
`),e.exec("DELETE FROM _covered_patterns"),e.exec(`
|
|
7
|
-
INSERT INTO _covered_patterns (pattern_id)
|
|
8
|
-
SELECT DISTINCT json_extract(action_data, '$.patternId')
|
|
9
|
-
FROM witness_chain
|
|
10
|
-
WHERE action_type = 'PATTERN_CREATE'
|
|
11
|
-
AND json_extract(action_data, '$.patternId') IS NOT NULL
|
|
12
|
-
`),e.exec(`
|
|
13
|
-
INSERT OR IGNORE INTO _covered_patterns (pattern_id)
|
|
14
|
-
SELECT DISTINCT json_extract(action_data, '$.pattern_id')
|
|
15
|
-
FROM witness_chain
|
|
16
|
-
WHERE action_type = 'PATTERN_CREATE'
|
|
17
|
-
AND json_extract(action_data, '$.pattern_id') IS NOT NULL
|
|
18
|
-
`);let t=e.prepare(`SELECT p.id, p.pattern_type, p.qe_domain, p.name, p.created_at
|
|
19
|
-
FROM qe_patterns p
|
|
20
|
-
LEFT JOIN _covered_patterns c ON p.id = c.pattern_id
|
|
21
|
-
WHERE c.pattern_id IS NULL
|
|
22
|
-
ORDER BY p.created_at ASC`).all(),s=e.prepare("SELECT COUNT(*) as count FROM qe_patterns").get().count-t.length,l=0;for(let i of t)n.append("PATTERN_CREATE",{patternId:i.id,patternType:i.pattern_type,qeDomain:i.qe_domain,name:i.name,originalCreatedAt:i.created_at,backfilled:!0},"system:backfill"),l++;return e.exec("DROP TABLE IF EXISTS _covered_patterns"),{created:l,skipped:s}}async function $e(e,n){if(Sn(n.format)==="rvf"){let a=O(e,{readonly:!0});try{return xe(a,{outputPath:n.outputPath,domains:n.domains},e)}finally{a.close()}}let t=O(e,{readonly:!0});try{return we(t,n,e)}finally{t.close()}}async function Me(e,n,r){if(je(n,r.format)==="rvf"){let s=O(e);try{return Ce(s,n,{mergeStrategy:r.mergeStrategy,dryRun:r.dryRun})}finally{s.close()}}let a=O(e);try{return ve(a,n,r)}finally{a.close()}}async function qe(e,n){return je(e,n)==="rvf"?K(e):Re(e)}async function Le(e,n,r={}){return Oe(e,n,r)}async function Fe(e,n={}){return De(e,n)}async function Pe(e){let n=O(e);try{let r=ge(n,pe());return await r.initialize(),Te(n,r)}finally{n.close()}}function Sn(e){if(e==="jsonl")return"jsonl";if(e==="rvf"){if(!re())throw new Error("RVF format requested but @ruvector/rvf-node is not available on this platform. Use --format jsonl instead.");return"rvf"}return re()?"rvf":"jsonl"}function je(e,n){return n==="rvf"?"rvf":n==="jsonl"?"jsonl":e.endsWith(".rvf")?"rvf":"jsonl"}var de=class{name="brain";description="Export, import, and inspect QE brain state";cleanupAndExit;ensureInitialized;constructor(n,r){this.cleanupAndExit=n,this.ensureInitialized=r}register(n,r){let t=n.command("brain").description(this.description);t.command("export").description("Export brain state to a portable directory").requiredOption("-o, --output <path>","Output directory path").option("--format <format>","Export format: rvf (default) or jsonl","rvf").option("--db <path>","Source database path").action(async a=>{await this.executeExport(a)}),t.command("import").description("Import brain state from an export directory").requiredOption("-i, --input <path>","Path to brain export directory").option("--strategy <strategy>","Merge strategy","skip-conflicts").option("--dry-run","Preview import without writing",!1).option("--db <path>","Target database path").action(async a=>{await this.executeImport(a)}),t.command("info").description("Show manifest info for a brain export").requiredOption("-i, --input <path>","Path to brain export directory").action(async a=>{await this.executeInfo(a)}),t.command("witness-backfill").description("Create witness chain entries for patterns that predate the witness chain").option("--db <path>","Database path").action(async a=>{await this.executeWitnessBackfill(a)}),t.command("diff").description("Compare two brain exports (JSONL directory or .rvf file)").argument("<a>","Path to first brain export").argument("<b>","Path to second brain export").option("--table <name>","Restrict comparison to a single table").option("--verbose","Show the IDs of added/removed/changed records",!1).option("--json","Emit the diff as JSON to stdout",!1).action(async(a,s,l)=>{await this.executeDiff(a,s,l)}),t.command("search").description("Search a JSONL brain export with filters").requiredOption("-i, --input <path>","Path to brain export directory (JSONL)").option("--table <name>","Table to search (default: qe_patterns)").option("--domain <name...>","Restrict to one or more domains").option("--pattern-type <type>","Restrict to a specific pattern_type (qe_patterns only)").option("--since <iso>","Include rows with timestamp \u2265 <iso>").option("--until <iso>","Include rows with timestamp \u2264 <iso>").option("-q, --query <text>","Substring match across name + description (case-insensitive)").option("-l, --limit <n>","Maximum results to return","20").option("--json","Emit results as JSON to stdout",!1).action(async a=>{await this.executeSearch(a)})}async executeExport(n){try{console.log(o.blue(`
|
|
23
|
-
Exporting brain state (format: ${n.format})...
|
|
24
|
-
`));let r=await se(n.db),t=await $e(r,{outputPath:B.resolve(n.output),format:n.format});if(console.log(o.green(" Export complete.")),console.log(` Format: ${o.cyan("format"in t?t.format??"jsonl":"jsonl")}`),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"embeddingCount"in t.stats?console.log(` Vectors: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`),"rvfStatus"in t){let a=t.rvfStatus;console.log(` RVF Size: ${o.cyan(Ve(a.fileSizeBytes))}`),console.log(` Segments: ${o.cyan(a.totalSegments)}`)}console.log(` Checksum: ${o.gray(t.checksum)}`),console.log(` Output: ${o.cyan(B.resolve(n.output))}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
25
|
-
Brain export failed:`),r),await this.cleanupAndExit(1)}}async executeImport(n){try{n.dryRun?console.log(o.yellow(`
|
|
26
|
-
Dry-run mode \u2014 no data will be written.
|
|
27
|
-
`)):console.log(o.blue(`
|
|
28
|
-
Importing brain state...
|
|
29
|
-
`));let r=await se(n.db),t=await Me(r,B.resolve(n.input),{mergeStrategy:n.strategy,dryRun:n.dryRun});console.log(o.green(" Import complete.")),console.log(` Imported: ${o.cyan(t.imported)}`),console.log(` Skipped: ${o.yellow(t.skipped)}`),console.log(` Conflicts: ${o.red(t.conflicts)}`),"embeddingsRestored"in t&&console.log(` Embeddings: ${o.cyan(t.embeddingsRestored)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
30
|
-
Brain import failed:`),r),await this.cleanupAndExit(1)}}async executeInfo(n){try{console.log(o.blue(`
|
|
31
|
-
Brain Export Info
|
|
32
|
-
`));let r=B.resolve(n.input),t=await qe(r),a="format"in t?t.format??"jsonl":"jsonl";if(console.log(` Version: ${o.cyan(t.version)}`),console.log(` Format: ${o.cyan(a)}`),console.log(` Exported: ${o.cyan(t.exportedAt)}`),console.log(` Source DB: ${o.cyan(t.sourceDb)}`),console.log(o.blue(`
|
|
33
|
-
Learning Data:`)),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"qValueCount"in t.stats&&console.log(` Q-Values: ${o.cyan(t.stats.qValueCount)}`),"dreamInsightCount"in t.stats){let i=t.stats.dreamInsightCount,c=("tableRecordCounts"in t?t.tableRecordCounts:void 0)?.dream_cycles,u=c!==void 0?` (${c} cycles)`:"";console.log(` Dream Insights: ${o.cyan(i)}${o.gray(u)}`)}"witnessChainLength"in t.stats&&console.log(` Witness Chain: ${o.cyan(t.stats.witnessChainLength)} entries`),"embeddingCount"in t.stats?console.log(` Embeddings: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`);let s="tableRecordCounts"in t?t.tableRecordCounts:void 0;if(s){let i=Object.entries(s).filter(([d,c])=>c>0&&!["qe_patterns","rl_q_values","dream_insights","dream_cycles","witness_chain","vectors","qe_pattern_embeddings"].includes(d));if(i.length>0)for(let[d,c]of i){let p=`${d.replace(/_/g," ").replace(/\b\w/g,f=>f.toUpperCase())}:`.padEnd(15);console.log(` ${p}${o.cyan(c)}`)}}let l="totalRecords"in t.stats?t.stats.totalRecords:void 0;if(l!==void 0&&(console.log(o.blue(`
|
|
34
|
-
Summary:`)),console.log(` Total Records: ${o.cyan(l)}`)),"domains"in t&&Array.isArray(t.domains)&&t.domains.length>0&&(l||console.log(o.blue(`
|
|
35
|
-
Summary:`)),console.log(` Domains: ${o.cyan(t.domains.join(", "))}`)),"rvfStatus"in t){let i=t.rvfStatus;console.log(o.blue(`
|
|
36
|
-
RVF Details:`)),console.log(` File Size: ${o.cyan(Ve(i.fileSizeBytes))}`),console.log(` Vectors: ${o.cyan(i.totalVectors)}`),console.log(` Segments: ${o.cyan(i.totalSegments)}`)}if("lineage"in t){let i=t.lineage;i&&(console.log(o.blue(`
|
|
37
|
-
Lineage:`)),console.log(` File ID: ${o.cyan(i.fileId)}`),console.log(` Parent ID: ${o.cyan(i.parentId??"none (root)")}`),console.log(` Depth: ${o.cyan(i.lineageDepth)}`))}if("signature"in t){let i=t.signature,d=t.signerKeyId;console.log(o.blue(`
|
|
38
|
-
Signature:`)),i?(console.log(` Status: ${o.green("Signed")}`),console.log(` Key ID: ${o.cyan(d??"unknown")}`),console.log(` Signature: ${o.gray(i.slice(0,32)+"...")}`)):console.log(` Status: ${o.yellow("Unsigned")}`)}console.log(`
|
|
39
|
-
Checksum: ${o.gray(t.checksum)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
40
|
-
Failed to read brain info:`),r),await this.cleanupAndExit(1)}}async executeDiff(n,r,t){try{let a=await Le(B.resolve(n),B.resolve(r),{tableFilter:t.table});if(t.json){process.stdout.write(JSON.stringify(a,null,2)+`
|
|
41
|
-
`),await this.cleanupAndExit(a.identical?0:1);return}En(a,t.verbose),await this.cleanupAndExit(a.identical?0:1)}catch(a){console.error(o.red(`
|
|
42
|
-
Brain diff failed:`),a),await this.cleanupAndExit(2)}}async executeSearch(n){try{let r=xn(n.limit),t=Cn(n.domain),a=await Fe(B.resolve(n.input),{table:n.table,domains:t,patternType:n.patternType,since:n.since,until:n.until,query:n.query,limit:r});if(n.json){process.stdout.write(JSON.stringify(a,null,2)+`
|
|
43
|
-
`),await this.cleanupAndExit(a.totalMatched>0?0:3);return}In(a),await this.cleanupAndExit(a.totalMatched>0?0:3)}catch(r){console.error(o.red(`
|
|
44
|
-
Brain search failed:`),r),await this.cleanupAndExit(2)}}async executeWitnessBackfill(n){try{console.log(o.blue(`
|
|
45
|
-
Running witness chain backfill...
|
|
46
|
-
`));let r=await se(n.db),t=await Pe(r);console.log(o.green(" Backfill complete.")),console.log(` Created: ${o.cyan(t.created)} new witness entries`),console.log(` Skipped: ${o.cyan(t.skipped)} (already witnessed)`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
47
|
-
Witness backfill failed:`),r),await this.cleanupAndExit(1)}}getHelp(){return`
|
|
48
|
-
Export, import, and inspect QE brain state.
|
|
49
|
-
|
|
50
|
-
Formats:
|
|
51
|
-
rvf \u2014 Single portable .rvf file (default, requires @ruvector/rvf-node)
|
|
52
|
-
jsonl \u2014 JSONL directory format (fallback when native not available)
|
|
53
|
-
|
|
54
|
-
Usage:
|
|
55
|
-
aqe brain export -o brain.rvf [--format rvf] [--db <path>]
|
|
56
|
-
aqe brain export -o ./brain-dir --format jsonl [--db <path>]
|
|
57
|
-
aqe brain import -i brain.rvf [--strategy skip-conflicts] [--dry-run] [--db <path>]
|
|
58
|
-
aqe brain info -i brain.rvf
|
|
59
|
-
|
|
60
|
-
Subcommands:
|
|
61
|
-
export Export brain state to a portable .rvf file or JSONL directory
|
|
62
|
-
import Import a brain export into the local database
|
|
63
|
-
info Show manifest metadata for an existing brain export
|
|
64
|
-
diff Compare two brain exports (manifest always; record-level for JSONL)
|
|
65
|
-
search Filtered search over a JSONL brain export
|
|
66
|
-
|
|
67
|
-
Examples:
|
|
68
|
-
aqe brain export -o .agentic-qe/brain.rvf
|
|
69
|
-
aqe brain export -o .agentic-qe/brain.rvf --format rvf
|
|
70
|
-
aqe brain export -o ./brain-export --format jsonl
|
|
71
|
-
aqe brain import -i .agentic-qe/brain.rvf --strategy latest-wins
|
|
72
|
-
aqe brain import -i .agentic-qe/brain.rvf --dry-run
|
|
73
|
-
aqe brain info -i .agentic-qe/brain.rvf
|
|
74
|
-
aqe brain diff ./brain-a ./brain-b --verbose
|
|
75
|
-
aqe brain search -i ./brain-export --query oauth --domain test-generation
|
|
76
|
-
aqe brain search -i ./brain-export --since 2026-03-01 --limit 50 --json
|
|
77
|
-
`}};async function se(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-PXOQ4N53.js");return B.join(n(),".agentic-qe","memory.db")}function Ve(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function xn(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function Cn(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let s=a.trim();s&&r.push(s)}return r.length>0?r:void 0}function En(e,n){console.log(o.blue(`
|
|
78
|
-
Brain Diff
|
|
79
|
-
`)),console.log(` A: ${o.cyan(e.pathA)} (${e.formatA})`),console.log(` B: ${o.cyan(e.pathB)} (${e.formatB})`),console.log(` Versions: ${o.cyan(e.manifestA.version)} \u2192 ${o.cyan(e.manifestB.version)}`+(e.versionMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Checksums: ${o.gray(e.manifestA.checksum.slice(0,12))}\u2026 \u2192 ${o.gray(e.manifestB.checksum.slice(0,12))}\u2026`+(e.checksumMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Exported: ${o.gray(e.manifestA.exportedAt)} \u2192 ${o.gray(e.manifestB.exportedAt)}`),console.log(` Records: ${o.cyan(e.manifestA.totalRecords)} \u2192 ${o.cyan(e.manifestB.totalRecords)} `+Je(e.manifestB.totalRecords-e.manifestA.totalRecords)),(e.domainsOnlyInA.length>0||e.domainsOnlyInB.length>0)&&(console.log(o.blue(`
|
|
80
|
-
Domains:`)),e.domainsOnlyInA.length>0&&console.log(` Only in A: ${o.yellow(e.domainsOnlyInA.join(", "))}`),e.domainsOnlyInB.length>0&&console.log(` Only in B: ${o.yellow(e.domainsOnlyInB.join(", "))}`)),e.recordLevel||console.log(o.gray(`
|
|
81
|
-
Note: record-level diff is only available when both sides are JSONL exports.
|
|
82
|
-
Per-table counts shown below; re-export with --format jsonl for added/removed/changed IDs.`)),console.log(o.blue(`
|
|
83
|
-
Tables:`));let r=e.tableDiffs.filter(Bn);if(r.length===0)console.log(o.gray(" (no differences)"));else for(let t of r)console.log(` ${t.tableName.padEnd(28)} ${o.cyan(String(t.countA).padStart(7))} \u2192 ${o.cyan(String(t.countB).padStart(7))} ${Je(t.delta)}`+_n(t,n)),n&&(t.added&&t.added.length>0&&le("added",t.added),t.removed&&t.removed.length>0&&le("removed",t.removed),t.changed&&t.changed.length>0&&le("changed",t.changed));console.log(""),e.identical?console.log(o.green(` Result: identical
|
|
84
|
-
`)):console.log(o.yellow(` Result: differences found
|
|
85
|
-
`))}function Bn(e){return!!(e.delta!==0||e.added&&e.added.length>0||e.removed&&e.removed.length>0||e.changed&&e.changed.length>0)}function Je(e){return e===0?o.gray("(\xB10)"):e>0?o.green(`(+${e})`):o.red(`(${e})`)}function _n(e,n){let r=[];return e.added&&e.added.length>0&&r.push(o.green(`+${e.added.length}`)),e.removed&&e.removed.length>0&&r.push(o.red(`-${e.removed.length}`)),e.changed&&e.changed.length>0&&r.push(o.yellow(`~${e.changed.length}`)),r.length===0?"":n?" "+r.join(" "):" "+o.gray("[")+r.join(" ")+o.gray("]")}function le(e,n){let r=n.slice(0,10).join(", "),t=n.length>10?o.gray(` \u2026(+${n.length-10} more)`):"";console.log(` ${o.gray(e+":")} ${r}${t}`)}function In(e){if(console.log(o.blue(`
|
|
86
|
-
Brain Search
|
|
87
|
-
`)),console.log(` Input: ${o.cyan(e.inputPath)}`),console.log(` Table: ${o.cyan(e.table)}`),console.log(` Scanned: ${o.cyan(e.totalScanned)} Matched: ${o.cyan(e.totalMatched)} Shown: ${o.cyan(e.hits.length)}`+(e.truncated?o.yellow(` (truncated to limit ${e.limit})`):"")),e.hits.length===0){console.log(o.yellow(`
|
|
88
|
-
No matching rows.
|
|
89
|
-
`));return}console.log("");for(let n of e.hits){let r=o.cyan(n.id)+(n.display.patternType?o.gray(` ${n.display.patternType}`):"")+(n.display.domain?o.gray(` [${n.display.domain}]`):"")+(n.display.confidence!==void 0?o.gray(` conf=${n.display.confidence.toFixed(2)}`):"");if(console.log(` ${r}`),n.display.name&&console.log(` ${o.bold(n.display.name)}`),n.display.description){let t=n.display.description.length>200?n.display.description.slice(0,200)+"\u2026":n.display.description;console.log(` ${o.gray(t)}`)}n.display.updatedAt&&console.log(` ${o.gray(n.display.updatedAt)}`),console.log("")}}function dt(e,n){return new de(e,n)}export{de as BrainHandler,dt as createBrainHandler};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.12.2");process.exit(0)}
|
|
2
|
-
import{a}from"./chunk-B7DI76SY.js";import"./chunk-LIAW5FD7.js";import"./chunk-ZHWXI4SK.js";import"./chunk-APVXTHTA.js";import"./chunk-AL5QT6OX.js";import"./chunk-YY4KXDI6.js";import"./chunk-R5HC6JVJ.js";import"./chunk-ACDZ2CRV.js";import"./chunk-CKFZOPZN.js";import"./chunk-P65S7AZA.js";import"./chunk-X47GHZY3.js";import"./chunk-ZBYMF2QJ.js";import"./chunk-ERQL3D2O.js";import"./chunk-WRMUQVKY.js";import"./chunk-UF3YOGHV.js";import"./chunk-V2QYW5KW.js";import"./chunk-4KEOBDEI.js";import"./chunk-C7VNQ4PY.js";import"./chunk-QYST2TZW.js";import"./chunk-YZ44FUVJ.js";import"./chunk-YDZIPP3Y.js";import"./chunk-CTFW7CMI.js";import"./chunk-HU6ETNA7.js";export{a as BrowserWorkflowTool};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.12.2");process.exit(0)}
|
|
2
|
-
var r={claude:"metered-api","claude-code":"subscription",openai:"metered-api",openrouter:"metered-api",gemini:"metered-api","azure-openai":"metered-api",bedrock:"metered-api",cognitum:"metered-capped",ollama:"local"};function o(e){return e.billingMode??r[e.type]??"metered-api"}function n(e){return r[e]??"metered-api"}function t(e,i){switch(i){case"metered-api":return`\u26A0\uFE0F LLM provider "${e}" bills a pay-per-token API key (not your Claude subscription) and has no server-side spend cap. Set a budget with --max-budget-usd / AQE_MAX_BUDGET_USD, or use AQE_LLM_PROVIDER=claude-code to run on your Claude Code subscription instead.`;case"metered-capped":return`\u2139\uFE0F LLM provider "${e}" bills per-token but enforces a server-side hard spend cap; it will pause at the cap rather than overspend.`;case"subscription":return`\u2139\uFE0F LLM provider "${e}" runs on your Claude Code subscription (shared plan usage). Worst case is hitting your plan's rate limit and pausing \u2014 no per-token API charges.`;case"local":return}}export{o as a,n as b,t as c};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.12.2");process.exit(0)}
|
|
2
|
-
import{createRequire as t}from"module";var o=t(import.meta.url),e=o("@huggingface/transformers"),n=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:s,getCompressionLevel:l,init:p,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:d,HyperbolicAttention:f,LinearAttention:A,MoEAttention:g,SonaEngine:h,pipeline:_}=e||{};export{n as a,i as b,a as c,c as d,s as e,l as f,p as g,m as h,u as i,d as j,f as k,A as l,g as m,h as n,_ as o};
|