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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Witness-key bridge (qe-harness issue #7) — sign flywheel receipts with the ONE
|
|
3
|
+
* Cognitum platform identity instead of a self-generated key, so every QE receipt
|
|
4
|
+
* (engine campaign · flywheel promotion · coherence verdict) chains to the same
|
|
5
|
+
* externally-verifiable key (`QE_WITNESS_PUBLIC_KEYS_JSON` allowlist, fingerprint
|
|
6
|
+
* `f1ac28607da49ec1`).
|
|
7
|
+
*
|
|
8
|
+
* `createSigner` already accepts a 32-byte Ed25519 seed → deterministic keypair.
|
|
9
|
+
* The platform key is delivered as `QE_WITNESS_SIGNING_KEY` — a JSON
|
|
10
|
+
* `{ publicKey, privateKey }` of PEM strings (same shape qe-harness Stage-B reads
|
|
11
|
+
* from Secret Manager). We derive the seed from that private key and hand it to
|
|
12
|
+
* `createSigner`, reproducing the exact platform keypair.
|
|
13
|
+
*
|
|
14
|
+
* Graceful: returns null when the env var is absent/malformed, so the flywheel
|
|
15
|
+
* keeps its self-generated-key behaviour where the platform key isn't provided.
|
|
16
|
+
* Env-reading lives HERE, not in the dependency-free `receipt.ts` core.
|
|
17
|
+
*/
|
|
18
|
+
import { type Signer } from './receipt.js';
|
|
19
|
+
/**
|
|
20
|
+
* Extract the raw 32-byte Ed25519 seed from a PKCS#8 private-key PEM. Throws if the
|
|
21
|
+
* key is not an Ed25519 PKCS#8 key (wrong curve / format).
|
|
22
|
+
*/
|
|
23
|
+
export declare function seedFromPkcs8Pem(privateKeyPem: string): Buffer;
|
|
24
|
+
/**
|
|
25
|
+
* Build a {@link Signer} bound to the Cognitum platform identity from
|
|
26
|
+
* `QE_WITNESS_SIGNING_KEY`, or null when it is unset/malformed (graceful fallback).
|
|
27
|
+
* The returned signer's `keyId` equals the platform witness fingerprint, so a
|
|
28
|
+
* verifier can attribute the receipt to the platform via the same allowlist that
|
|
29
|
+
* accepts qe-harness evidence bundles.
|
|
30
|
+
*/
|
|
31
|
+
export declare function platformSigner(env?: NodeJS.ProcessEnv): Signer | null;
|
|
32
|
+
//# sourceMappingURL=platform-signer.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Witness-key bridge (qe-harness issue #7) — sign flywheel receipts with the ONE
|
|
3
|
+
* Cognitum platform identity instead of a self-generated key, so every QE receipt
|
|
4
|
+
* (engine campaign · flywheel promotion · coherence verdict) chains to the same
|
|
5
|
+
* externally-verifiable key (`QE_WITNESS_PUBLIC_KEYS_JSON` allowlist, fingerprint
|
|
6
|
+
* `f1ac28607da49ec1`).
|
|
7
|
+
*
|
|
8
|
+
* `createSigner` already accepts a 32-byte Ed25519 seed → deterministic keypair.
|
|
9
|
+
* The platform key is delivered as `QE_WITNESS_SIGNING_KEY` — a JSON
|
|
10
|
+
* `{ publicKey, privateKey }` of PEM strings (same shape qe-harness Stage-B reads
|
|
11
|
+
* from Secret Manager). We derive the seed from that private key and hand it to
|
|
12
|
+
* `createSigner`, reproducing the exact platform keypair.
|
|
13
|
+
*
|
|
14
|
+
* Graceful: returns null when the env var is absent/malformed, so the flywheel
|
|
15
|
+
* keeps its self-generated-key behaviour where the platform key isn't provided.
|
|
16
|
+
* Env-reading lives HERE, not in the dependency-free `receipt.ts` core.
|
|
17
|
+
*/
|
|
18
|
+
import { createPrivateKey } from 'node:crypto';
|
|
19
|
+
import { createSigner } from './receipt.js';
|
|
20
|
+
/** DER prefix of an Ed25519 PKCS#8 private key (16 bytes) preceding the 32-byte seed. */
|
|
21
|
+
const ED25519_PKCS8_PREFIX = '302e020100300506032b657004220420';
|
|
22
|
+
/**
|
|
23
|
+
* Extract the raw 32-byte Ed25519 seed from a PKCS#8 private-key PEM. Throws if the
|
|
24
|
+
* key is not an Ed25519 PKCS#8 key (wrong curve / format).
|
|
25
|
+
*/
|
|
26
|
+
export function seedFromPkcs8Pem(privateKeyPem) {
|
|
27
|
+
const der = createPrivateKey(privateKeyPem).export({ format: 'der', type: 'pkcs8' });
|
|
28
|
+
if (der.length !== 48 || der.subarray(0, 16).toString('hex') !== ED25519_PKCS8_PREFIX) {
|
|
29
|
+
throw new Error('not an Ed25519 PKCS#8 private key (cannot derive a 32-byte seed)');
|
|
30
|
+
}
|
|
31
|
+
return Buffer.from(der.subarray(16, 48));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Build a {@link Signer} bound to the Cognitum platform identity from
|
|
35
|
+
* `QE_WITNESS_SIGNING_KEY`, or null when it is unset/malformed (graceful fallback).
|
|
36
|
+
* The returned signer's `keyId` equals the platform witness fingerprint, so a
|
|
37
|
+
* verifier can attribute the receipt to the platform via the same allowlist that
|
|
38
|
+
* accepts qe-harness evidence bundles.
|
|
39
|
+
*/
|
|
40
|
+
export function platformSigner(env = process.env) {
|
|
41
|
+
const raw = env.QE_WITNESS_SIGNING_KEY;
|
|
42
|
+
if (!raw)
|
|
43
|
+
return null;
|
|
44
|
+
let key;
|
|
45
|
+
try {
|
|
46
|
+
key = JSON.parse(raw);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
if (!key.privateKey)
|
|
52
|
+
return null;
|
|
53
|
+
try {
|
|
54
|
+
return createSigner(seedFromPkcs8Pem(key.privateKey));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return null; // wrong key type / unparseable — fall back to a self-generated signer
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=platform-signer.js.map
|
|
@@ -10,9 +10,16 @@
|
|
|
10
10
|
* Ed25519 via Node's built-in crypto — dependency-free (ADR-118 §6).
|
|
11
11
|
*/
|
|
12
12
|
import { generateKeyPairSync, createPrivateKey, createPublicKey, sign as edSign, verify as edVerify, createHash, } from 'node:crypto';
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Derive a stable key id from a public key PEM. The PEM is trimmed first so the id
|
|
15
|
+
* is invariant to trailing whitespace (PEM exports carry a trailing newline) AND
|
|
16
|
+
* matches the Cognitum platform witness fingerprint scheme — `sha256(pem.trim())`
|
|
17
|
+
* truncated to 16 hex (qe-harness `witness.ts` / meta-llm `qe-witness.ts`). This lets
|
|
18
|
+
* a flywheel receipt signed with the platform key carry the SAME id the platform
|
|
19
|
+
* allowlist (`QE_WITNESS_PUBLIC_KEYS_JSON`) recognizes. See platform-signer.ts.
|
|
20
|
+
*/
|
|
14
21
|
function keyIdOf(publicKeyPem) {
|
|
15
|
-
return createHash('sha256').update(publicKeyPem).digest('hex').slice(0, 16);
|
|
22
|
+
return createHash('sha256').update(publicKeyPem.trim()).digest('hex').slice(0, 16);
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* Create an Ed25519 signer. With a 32-byte seed (hex or Buffer) the keypair is
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-side witness verification (ADR-124 M2.2) — the single verifier that
|
|
3
|
+
* reconciles AQE's flywheel receipts with the Cognitum `qe-harness` witness
|
|
4
|
+
* bundles so QE evidence signed by the shared platform identity
|
|
5
|
+
* (fingerprint `f1ac28607da49ec1`) is verifiable on either side.
|
|
6
|
+
*
|
|
7
|
+
* WHAT WAS ALREADY ALIGNED (the bridge that exists): both sides use Ed25519,
|
|
8
|
+
* the same env secret `QE_WITNESS_SIGNING_KEY` (JSON `{publicKey,privateKey}`
|
|
9
|
+
* PEM), and the SAME key-id/fingerprint scheme `sha256(pem.trim()).slice(0,16)`
|
|
10
|
+
* — so both can sign AS the platform identity. `keyFingerprint()` here is
|
|
11
|
+
* byte-identical to `receipt.ts` `keyIdOf` and to qe-harness `witness.ts`.
|
|
12
|
+
*
|
|
13
|
+
* WHAT THIS RECONCILES: the two SIGNED ARTIFACTS are not natively
|
|
14
|
+
* cross-verifiable — AQE signs a fixed-field-order JSON body as HEX; qe-harness
|
|
15
|
+
* signs a `sha256:`-prefixed digest of a recursively key-sorted `stableStringify`
|
|
16
|
+
* as BASE64, wrapped in a nested `witness{}`. This module verifies BOTH.
|
|
17
|
+
*
|
|
18
|
+
* TWO EXTERNAL DEPENDENCIES (tracked, need the qe-harness owner — see M2.2 notes):
|
|
19
|
+
* 1. The public key for `f1ac28607da49ec1` is committed to NEITHER repo (it
|
|
20
|
+
* lives on meta-llm). Offline verification of platform-signed artifacts
|
|
21
|
+
* needs it provisioned via `QE_WITNESS_PUBLIC_KEYS_JSON`. This verifier is
|
|
22
|
+
* READY the moment that allowlist is populated.
|
|
23
|
+
* 2. The qe-harness bundle format here is implemented to the documented
|
|
24
|
+
* algorithm; byte-parity must be confirmed against a REAL qe-harness sample
|
|
25
|
+
* bundle before it gates anything (see witness-verify.test.ts).
|
|
26
|
+
*
|
|
27
|
+
* No new deps — node:crypto only. Reuses receipt.ts for the AQE path.
|
|
28
|
+
*/
|
|
29
|
+
import { type EvolveReceipt } from './receipt.js';
|
|
30
|
+
/** Public-key allowlist: fingerprint (`sha256(pem)[:16]`) → SPKI PEM. */
|
|
31
|
+
export type PublicKeyAllowlist = Map<string, string>;
|
|
32
|
+
/** Byte-identical to receipt.ts `keyIdOf` and qe-harness `witness.ts` fingerprint. */
|
|
33
|
+
export declare function keyFingerprint(publicKeyPem: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Load the trusted public-key allowlist from `QE_WITNESS_PUBLIC_KEYS_JSON`
|
|
36
|
+
* (`{ "<fingerprint>": "<SPKI PEM>", ... }`). Empty map when unset/unparseable —
|
|
37
|
+
* callers decide whether an empty allowlist means "verify signature only" (AQE
|
|
38
|
+
* receipts carry their own PEM) or "reject" (platform bundles need a trust root).
|
|
39
|
+
*/
|
|
40
|
+
export declare function loadAllowlist(json?: string | undefined): PublicKeyAllowlist;
|
|
41
|
+
/**
|
|
42
|
+
* Deterministic serialization matching qe-harness `stableStringify`: recursive
|
|
43
|
+
* key-sort on objects, array order preserved. This MUST stay byte-identical to
|
|
44
|
+
* the qe-harness implementation or digests will not match.
|
|
45
|
+
*/
|
|
46
|
+
export declare function stableStringify(value: unknown): string;
|
|
47
|
+
/** qe-harness canonical digest: `sha256:` + sha256(stableStringify(bundle − digest − witness)). */
|
|
48
|
+
export declare function canonicalDigest(bundle: Record<string, unknown>): string;
|
|
49
|
+
/** The qe-harness witness envelope (packages/engine/src/types.ts). */
|
|
50
|
+
export interface HarnessWitness {
|
|
51
|
+
alg: 'ed25519';
|
|
52
|
+
digest: string;
|
|
53
|
+
/** base64 Ed25519 signature over `digest`. */
|
|
54
|
+
signature: string;
|
|
55
|
+
publicKeyFingerprint: string;
|
|
56
|
+
signedAt?: string;
|
|
57
|
+
}
|
|
58
|
+
export type WitnessFormat = 'aqe-receipt' | 'harness-witness' | 'unknown';
|
|
59
|
+
export interface VerifyResult {
|
|
60
|
+
valid: boolean;
|
|
61
|
+
format: WitnessFormat;
|
|
62
|
+
fingerprint?: string;
|
|
63
|
+
reason?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Verify an AQE flywheel receipt. When an allowlist is provided and non-empty,
|
|
67
|
+
* the receipt's embedded public key must be present (by fingerprint) AND match;
|
|
68
|
+
* an empty allowlist verifies the signature against the receipt's own PEM only.
|
|
69
|
+
* NOTE: this is signature verification; the full AQE trust model ALSO re-executes
|
|
70
|
+
* the frozen gate (ADR-120) — do that separately for promotion decisions.
|
|
71
|
+
*/
|
|
72
|
+
export declare function verifyAqeReceipt(receipt: EvolveReceipt, allowlist?: PublicKeyAllowlist, opts?: {
|
|
73
|
+
allowSelfSigned?: boolean;
|
|
74
|
+
}): VerifyResult;
|
|
75
|
+
/**
|
|
76
|
+
* Verify a qe-harness witness bundle. Requires the signer's public key in the
|
|
77
|
+
* allowlist (platform bundles do NOT embed their PEM). Recomputes the canonical
|
|
78
|
+
* digest to detect payload tampering, then Ed25519-verifies the base64 signature
|
|
79
|
+
* over the digest string.
|
|
80
|
+
*/
|
|
81
|
+
export declare function verifyHarnessWitness(bundle: Record<string, unknown> & {
|
|
82
|
+
witness: HarnessWitness;
|
|
83
|
+
}, allowlist: PublicKeyAllowlist): VerifyResult;
|
|
84
|
+
/** Detect the artifact format and dispatch to the right verifier. */
|
|
85
|
+
export declare function verifyWitness(artifact: unknown, allowlist?: PublicKeyAllowlist): VerifyResult;
|
|
86
|
+
//# sourceMappingURL=witness-verify.d.ts.map
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-side witness verification (ADR-124 M2.2) — the single verifier that
|
|
3
|
+
* reconciles AQE's flywheel receipts with the Cognitum `qe-harness` witness
|
|
4
|
+
* bundles so QE evidence signed by the shared platform identity
|
|
5
|
+
* (fingerprint `f1ac28607da49ec1`) is verifiable on either side.
|
|
6
|
+
*
|
|
7
|
+
* WHAT WAS ALREADY ALIGNED (the bridge that exists): both sides use Ed25519,
|
|
8
|
+
* the same env secret `QE_WITNESS_SIGNING_KEY` (JSON `{publicKey,privateKey}`
|
|
9
|
+
* PEM), and the SAME key-id/fingerprint scheme `sha256(pem.trim()).slice(0,16)`
|
|
10
|
+
* — so both can sign AS the platform identity. `keyFingerprint()` here is
|
|
11
|
+
* byte-identical to `receipt.ts` `keyIdOf` and to qe-harness `witness.ts`.
|
|
12
|
+
*
|
|
13
|
+
* WHAT THIS RECONCILES: the two SIGNED ARTIFACTS are not natively
|
|
14
|
+
* cross-verifiable — AQE signs a fixed-field-order JSON body as HEX; qe-harness
|
|
15
|
+
* signs a `sha256:`-prefixed digest of a recursively key-sorted `stableStringify`
|
|
16
|
+
* as BASE64, wrapped in a nested `witness{}`. This module verifies BOTH.
|
|
17
|
+
*
|
|
18
|
+
* TWO EXTERNAL DEPENDENCIES (tracked, need the qe-harness owner — see M2.2 notes):
|
|
19
|
+
* 1. The public key for `f1ac28607da49ec1` is committed to NEITHER repo (it
|
|
20
|
+
* lives on meta-llm). Offline verification of platform-signed artifacts
|
|
21
|
+
* needs it provisioned via `QE_WITNESS_PUBLIC_KEYS_JSON`. This verifier is
|
|
22
|
+
* READY the moment that allowlist is populated.
|
|
23
|
+
* 2. The qe-harness bundle format here is implemented to the documented
|
|
24
|
+
* algorithm; byte-parity must be confirmed against a REAL qe-harness sample
|
|
25
|
+
* bundle before it gates anything (see witness-verify.test.ts).
|
|
26
|
+
*
|
|
27
|
+
* No new deps — node:crypto only. Reuses receipt.ts for the AQE path.
|
|
28
|
+
*/
|
|
29
|
+
import { createHash, verify as edVerify, createPublicKey } from 'node:crypto';
|
|
30
|
+
import { verifySignature, receiptBodyString } from './receipt.js';
|
|
31
|
+
/** Byte-identical to receipt.ts `keyIdOf` and qe-harness `witness.ts` fingerprint. */
|
|
32
|
+
export function keyFingerprint(publicKeyPem) {
|
|
33
|
+
return createHash('sha256').update(publicKeyPem.trim()).digest('hex').slice(0, 16);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Load the trusted public-key allowlist from `QE_WITNESS_PUBLIC_KEYS_JSON`
|
|
37
|
+
* (`{ "<fingerprint>": "<SPKI PEM>", ... }`). Empty map when unset/unparseable —
|
|
38
|
+
* callers decide whether an empty allowlist means "verify signature only" (AQE
|
|
39
|
+
* receipts carry their own PEM) or "reject" (platform bundles need a trust root).
|
|
40
|
+
*/
|
|
41
|
+
export function loadAllowlist(json = process.env.QE_WITNESS_PUBLIC_KEYS_JSON) {
|
|
42
|
+
const map = new Map();
|
|
43
|
+
if (!json)
|
|
44
|
+
return map;
|
|
45
|
+
try {
|
|
46
|
+
const obj = JSON.parse(json);
|
|
47
|
+
for (const [fp, pem] of Object.entries(obj)) {
|
|
48
|
+
if (typeof pem === 'string')
|
|
49
|
+
map.set(fp, pem);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// An unparseable allowlist yields an empty (fail-closed) trust root — but log
|
|
54
|
+
// it loudly, or a typo'd env var silently disables verification (qe-court finding).
|
|
55
|
+
console.error('[witness-verify] QE_WITNESS_PUBLIC_KEYS_JSON is set but not valid JSON — ' +
|
|
56
|
+
'treating the trust root as EMPTY (verification will fail closed).');
|
|
57
|
+
}
|
|
58
|
+
return map;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Deterministic serialization matching qe-harness `stableStringify`: recursive
|
|
62
|
+
* key-sort on objects, array order preserved. This MUST stay byte-identical to
|
|
63
|
+
* the qe-harness implementation or digests will not match.
|
|
64
|
+
*/
|
|
65
|
+
export function stableStringify(value) {
|
|
66
|
+
if (value === null || typeof value !== 'object')
|
|
67
|
+
return JSON.stringify(value) ?? 'null';
|
|
68
|
+
if (Array.isArray(value))
|
|
69
|
+
return '[' + value.map(stableStringify).join(',') + ']';
|
|
70
|
+
const obj = value;
|
|
71
|
+
const keys = Object.keys(obj).sort();
|
|
72
|
+
return '{' + keys.map((k) => JSON.stringify(k) + ':' + stableStringify(obj[k])).join(',') + '}';
|
|
73
|
+
}
|
|
74
|
+
/** qe-harness canonical digest: `sha256:` + sha256(stableStringify(bundle − digest − witness)). */
|
|
75
|
+
export function canonicalDigest(bundle) {
|
|
76
|
+
const rest = {};
|
|
77
|
+
for (const [k, v] of Object.entries(bundle)) {
|
|
78
|
+
if (k === 'digest' || k === 'witness')
|
|
79
|
+
continue;
|
|
80
|
+
rest[k] = v;
|
|
81
|
+
}
|
|
82
|
+
return 'sha256:' + createHash('sha256').update(stableStringify(rest)).digest('hex');
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Verify an AQE flywheel receipt. When an allowlist is provided and non-empty,
|
|
86
|
+
* the receipt's embedded public key must be present (by fingerprint) AND match;
|
|
87
|
+
* an empty allowlist verifies the signature against the receipt's own PEM only.
|
|
88
|
+
* NOTE: this is signature verification; the full AQE trust model ALSO re-executes
|
|
89
|
+
* the frozen gate (ADR-120) — do that separately for promotion decisions.
|
|
90
|
+
*/
|
|
91
|
+
export function verifyAqeReceipt(receipt, allowlist, opts) {
|
|
92
|
+
const fingerprint = keyFingerprint(receipt.publicKeyPem);
|
|
93
|
+
if (allowlist && allowlist.size > 0) {
|
|
94
|
+
const allowed = allowlist.get(fingerprint);
|
|
95
|
+
if (!allowed)
|
|
96
|
+
return { valid: false, format: 'aqe-receipt', fingerprint, reason: 'fingerprint-not-in-allowlist' };
|
|
97
|
+
if (allowed.trim() !== receipt.publicKeyPem.trim()) {
|
|
98
|
+
return { valid: false, format: 'aqe-receipt', fingerprint, reason: 'allowlist-pem-mismatch' };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else if (!opts?.allowSelfSigned) {
|
|
102
|
+
// FAIL-CLOSED (qe-court finding): with no trust root, verifying against the
|
|
103
|
+
// receipt's OWN embedded key just proves internal consistency — anyone can
|
|
104
|
+
// self-sign a forged receipt. A caller must either provide an allowlist or
|
|
105
|
+
// explicitly opt into self-signed verification (e.g. a consistency check that
|
|
106
|
+
// is NOT used as authorization).
|
|
107
|
+
return { valid: false, format: 'aqe-receipt', fingerprint, reason: 'no-trust-root' };
|
|
108
|
+
}
|
|
109
|
+
const ok = verifySignature(receipt.publicKeyPem, receiptBodyString(receipt), receipt.signature);
|
|
110
|
+
return { valid: ok, format: 'aqe-receipt', fingerprint, reason: ok ? undefined : 'bad-signature' };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Verify a qe-harness witness bundle. Requires the signer's public key in the
|
|
114
|
+
* allowlist (platform bundles do NOT embed their PEM). Recomputes the canonical
|
|
115
|
+
* digest to detect payload tampering, then Ed25519-verifies the base64 signature
|
|
116
|
+
* over the digest string.
|
|
117
|
+
*/
|
|
118
|
+
export function verifyHarnessWitness(bundle, allowlist) {
|
|
119
|
+
const w = bundle.witness;
|
|
120
|
+
const fingerprint = w?.publicKeyFingerprint;
|
|
121
|
+
// Fail closed on an unexpected algorithm — never verify a non-Ed25519-declared
|
|
122
|
+
// witness as Ed25519 (qe-court finding: ambiguous alg across implementations).
|
|
123
|
+
if (w?.alg !== 'ed25519') {
|
|
124
|
+
return { valid: false, format: 'harness-witness', fingerprint, reason: 'unsupported-alg' };
|
|
125
|
+
}
|
|
126
|
+
const pem = fingerprint ? allowlist.get(fingerprint) : undefined;
|
|
127
|
+
if (!pem)
|
|
128
|
+
return { valid: false, format: 'harness-witness', fingerprint, reason: 'fingerprint-not-in-allowlist' };
|
|
129
|
+
const recomputed = canonicalDigest(bundle);
|
|
130
|
+
if (recomputed !== w.digest) {
|
|
131
|
+
return { valid: false, format: 'harness-witness', fingerprint, reason: 'digest-mismatch' };
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
const key = createPublicKey(pem);
|
|
135
|
+
const ok = edVerify(null, Buffer.from(w.digest, 'utf8'), key, Buffer.from(w.signature, 'base64'));
|
|
136
|
+
return { valid: ok, format: 'harness-witness', fingerprint, reason: ok ? undefined : 'bad-signature' };
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return { valid: false, format: 'harness-witness', fingerprint, reason: 'verify-error' };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/** Detect the artifact format and dispatch to the right verifier. */
|
|
143
|
+
export function verifyWitness(artifact, allowlist = loadAllowlist()) {
|
|
144
|
+
if (artifact && typeof artifact === 'object') {
|
|
145
|
+
const o = artifact;
|
|
146
|
+
const w = o.witness;
|
|
147
|
+
if (w && typeof w === 'object' && typeof w.signature === 'string' && typeof w.publicKeyFingerprint === 'string') {
|
|
148
|
+
return verifyHarnessWitness(o, allowlist);
|
|
149
|
+
}
|
|
150
|
+
if (typeof o.signature === 'string' && typeof o.publicKeyPem === 'string' && typeof o.sealedHash === 'string') {
|
|
151
|
+
return verifyAqeReceipt(o, allowlist);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { valid: false, format: 'unknown', reason: 'unrecognized-artifact' };
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=witness-verify.js.map
|