agentic-qe 3.13.12 → 3.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/brain-checkpoint.cjs +2 -1
- package/.claude/helpers/validate-v3-config.sh +6 -5
- package/.claude/hooks/aqe-hook.cjs +14 -14
- package/.claude/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/.claude/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/.claude/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/.claude/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/.claude/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/.claude/skills/qe-court/SKILL.md +4 -4
- package/.claude/skills/qe-court/config-schema.json +38 -0
- package/.claude/skills/qe-court/evals/qe-court.yaml +8 -8
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +130 -0
- package/assets/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/assets/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/assets/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/assets/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/assets/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/assets/skills/qe-court/SKILL.md +4 -4
- package/assets/skills/qe-court/config-schema.json +38 -0
- package/assets/skills/qe-court/evals/qe-court.yaml +8 -8
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/brain-commands.d.ts +1 -0
- package/dist/cli/brain-commands.js +1 -0
- package/dist/cli/bundle.js +7 -7
- package/dist/cli/chunks/adapter-I2N7PEKG.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-7I7LZFNC.js → agent-booster-wasm-OY5Y2CUM.js} +2 -2
- package/dist/cli/chunks/{agent-handler-QZZT52BH.js → agent-handler-TUOH55LD.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-MLQS5Y26.js → agent-memory-branch-XM3IYKT3.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-U4ALUH6A.js +2 -0
- package/dist/cli/chunks/{arena-WRIY37EJ.js → arena-DOCLIEBL.js} +4 -4
- package/dist/cli/chunks/{arena-IM4CP6LP.js → arena-UMFJZKG7.js} +2 -2
- package/dist/cli/chunks/{audit-BSAQ4EFN.js → audit-KZLU5VLW.js} +3 -3
- package/dist/cli/chunks/base-RCYIBNHM.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-X2XZUXWZ.js → better-sqlite3-MIEZBNUI.js} +2 -2
- package/dist/cli/chunks/brain-handler-6PZN46B7.js +90 -0
- package/dist/cli/chunks/{branch-enumerator-NI4Q7DSJ.js → branch-enumerator-XCETHA4F.js} +2 -2
- package/dist/cli/chunks/{browser-PXBLORUZ.js → browser-UEXISDCJ.js} +2 -2
- package/dist/cli/chunks/browser-workflow-L6TDB5O5.js +2 -0
- package/dist/cli/chunks/{chunk-5PNQNBDZ.js → chunk-3AYNHOWS.js} +1 -1
- package/dist/cli/chunks/{chunk-NL2SCAGJ.js → chunk-3BRR2FLH.js} +3 -3
- package/dist/cli/chunks/chunk-3FFMUB3B.js +14 -0
- package/dist/cli/chunks/{chunk-GJJWXRAD.js → chunk-3JMSXOU4.js} +2 -2
- package/dist/cli/chunks/{chunk-MB2KLJ6Q.js → chunk-3TMUCJNJ.js} +1 -1
- package/dist/cli/chunks/{chunk-JVFZAJ5N.js → chunk-3WSH4HD2.js} +2 -2
- package/dist/cli/chunks/{chunk-SCQNISGS.js → chunk-3XRXUVUI.js} +1 -1
- package/dist/cli/chunks/{chunk-Z56BBX77.js → chunk-45S5553E.js} +2 -2
- package/dist/cli/chunks/{chunk-6BSZHNOC.js → chunk-4MT62HKK.js} +1 -1
- package/dist/cli/chunks/{chunk-PVINNJ4P.js → chunk-4ZLFUO4I.js} +2 -2
- package/dist/cli/chunks/{chunk-MYVKTG55.js → chunk-5F5V4QYU.js} +3 -3
- package/dist/cli/chunks/{chunk-2W3D5A4R.js → chunk-5KP62DC3.js} +2 -2
- package/dist/cli/chunks/{chunk-BODFJ3DC.js → chunk-5NSSJUWW.js} +2 -2
- package/dist/cli/chunks/{chunk-KXSUDN46.js → chunk-5T6PAUZD.js} +1 -1
- package/dist/cli/chunks/{chunk-7ZVO7I4Q.js → chunk-5TYGSQOL.js} +1 -1
- package/dist/cli/chunks/{chunk-M7CPJW53.js → chunk-5Y2QFSVZ.js} +2 -2
- package/dist/cli/chunks/{chunk-VQD2ELNL.js → chunk-6B77GPWL.js} +2 -2
- package/dist/cli/chunks/{chunk-GJUGG6UR.js → chunk-6DDMHZWH.js} +2 -2
- package/dist/cli/chunks/{chunk-IPZEBALY.js → chunk-6HMNN2Y2.js} +54 -54
- package/dist/cli/chunks/{chunk-M73KM3AZ.js → chunk-6YIMLUH6.js} +160 -26
- package/dist/cli/chunks/{chunk-UBOGJHWC.js → chunk-6Z6Y3YBX.js} +1 -1
- package/dist/cli/chunks/{chunk-M3354CE4.js → chunk-75SC3GEX.js} +2 -2
- package/dist/cli/chunks/{chunk-TJVTV3HP.js → chunk-7AF55H2D.js} +2 -2
- package/dist/cli/chunks/{chunk-3XVZHJQT.js → chunk-7AYTM426.js} +1 -1
- package/dist/cli/chunks/{chunk-U5G6OC2C.js → chunk-7GF6IRSU.js} +2 -2
- package/dist/cli/chunks/{chunk-LRO74LPA.js → chunk-7XL2D56F.js} +4 -4
- package/dist/cli/chunks/{chunk-MGKH4LCM.js → chunk-A6RB34Y6.js} +1 -1
- package/dist/cli/chunks/{chunk-X2SZCVDA.js → chunk-AESYVAPH.js} +8 -7
- package/dist/cli/chunks/{chunk-3ASVQILY.js → chunk-AZUC7E5S.js} +2 -2
- package/dist/cli/chunks/{chunk-R7LGVJMZ.js → chunk-B6Y6AF4M.js} +2 -2
- package/dist/cli/chunks/chunk-C3XNFIOM.js +2 -0
- package/dist/cli/chunks/{chunk-ZSAGRDXA.js → chunk-CBWF42ET.js} +2 -2
- package/dist/cli/chunks/{chunk-VNODKACB.js → chunk-CCZZZBAO.js} +2 -2
- package/dist/cli/chunks/{chunk-5E76HULA.js → chunk-CGDW47WP.js} +2 -2
- package/dist/cli/chunks/chunk-CGZ7LTUK.js +2 -0
- package/dist/cli/chunks/{chunk-6KI6LAAZ.js → chunk-D6RCRTTR.js} +2 -2
- package/dist/cli/chunks/{chunk-TB2N3CAK.js → chunk-DFXQLHQM.js} +2 -2
- package/dist/cli/chunks/chunk-DKSLJZVA.js +2 -0
- package/dist/cli/chunks/{chunk-JTYCOFTD.js → chunk-DKUKGBJE.js} +1 -1
- package/dist/cli/chunks/{chunk-AN5CGTTJ.js → chunk-DKXSJDII.js} +2 -2
- package/dist/cli/chunks/chunk-EEJP3WTQ.js +4 -0
- package/dist/cli/chunks/{chunk-ZMYV4R32.js → chunk-EHW62JL2.js} +1 -1
- package/dist/cli/chunks/{chunk-WYFAPA2G.js → chunk-EPBWFTHH.js} +2 -2
- package/dist/cli/chunks/{chunk-P6EFKHNI.js → chunk-ERTGGFXZ.js} +2 -2
- package/dist/cli/chunks/{chunk-G45AOQDZ.js → chunk-F7TRO2OM.js} +1 -1
- package/dist/cli/chunks/{chunk-XT473WPO.js → chunk-FFRKTZYP.js} +2 -2
- package/dist/cli/chunks/{chunk-5VSS2RBD.js → chunk-FH7SCX2I.js} +2 -2
- package/dist/cli/chunks/{chunk-44NPKZGI.js → chunk-FHBGALBG.js} +2 -2
- package/dist/cli/chunks/{chunk-NTALX2YC.js → chunk-FOAFRC2W.js} +2 -2
- package/dist/cli/chunks/{chunk-7LATB5IR.js → chunk-FPBQ7BXU.js} +2 -2
- package/dist/cli/chunks/{chunk-AKUDUB3O.js → chunk-FRRRDCXY.js} +2 -2
- package/dist/cli/chunks/{chunk-NG6A7LCG.js → chunk-FZ47ZCRL.js} +1 -1
- package/dist/cli/chunks/{chunk-VD53LBF7.js → chunk-GH3NJOTC.js} +3 -3
- package/dist/cli/chunks/{chunk-NDRZZSD5.js → chunk-GO66DCIZ.js} +2 -2
- package/dist/cli/chunks/{chunk-Z6DSYLAG.js → chunk-GRVR3Y6I.js} +1 -1
- package/dist/cli/chunks/chunk-GYTWUOKU.js +65 -0
- package/dist/cli/chunks/{chunk-6KKVMPPR.js → chunk-H2DX36SC.js} +2 -2
- package/dist/cli/chunks/{chunk-NJ3QXJ54.js → chunk-H5LSXVWY.js} +2 -2
- package/dist/cli/chunks/{chunk-HQWFZQMJ.js → chunk-HBAQVJDP.js} +2 -2
- package/dist/cli/chunks/{chunk-33YZGOT6.js → chunk-HCCILQGN.js} +2 -2
- package/dist/cli/chunks/{chunk-KRZYWVS3.js → chunk-HJD52N32.js} +2 -2
- package/dist/cli/chunks/{chunk-IPDM3CAK.js → chunk-HKU5PPS7.js} +1 -1
- package/dist/cli/chunks/{chunk-7RVLVIAI.js → chunk-HPQU6XZH.js} +1 -1
- package/dist/cli/chunks/{chunk-TWUWLSGQ.js → chunk-HRUQWABO.js} +10 -10
- package/dist/cli/chunks/{chunk-HAJG44BD.js → chunk-IGRTQ6VT.js} +2 -2
- package/dist/cli/chunks/{chunk-WXU7FAEB.js → chunk-IIBXGHZT.js} +2 -2
- package/dist/cli/chunks/{chunk-QG5L2JM5.js → chunk-IYB3GRXF.js} +10 -10
- package/dist/cli/chunks/{chunk-NNLZAVFH.js → chunk-IYIMLLUV.js} +1 -1
- package/dist/cli/chunks/{chunk-SXFSJJZF.js → chunk-J2VF7ZO7.js} +2 -2
- package/dist/cli/chunks/{chunk-4FVOJBEU.js → chunk-J33LKXVH.js} +1 -1
- package/dist/cli/chunks/{chunk-IOJ34SXJ.js → chunk-J7VAD4RG.js} +2 -2
- package/dist/cli/chunks/{chunk-VQCLSX7T.js → chunk-JJ4GUO4K.js} +1 -1
- package/dist/cli/chunks/{chunk-QM4Z7TQH.js → chunk-JMULRLD4.js} +1 -1
- package/dist/cli/chunks/{chunk-LXVT6JXO.js → chunk-JNSTKE3K.js} +2 -2
- package/dist/cli/chunks/{chunk-SOS37ECY.js → chunk-JZUWPDVS.js} +1 -1
- package/dist/cli/chunks/chunk-KHUO4NCW.js +11 -0
- package/dist/cli/chunks/chunk-KXMW7XTJ.js +2 -0
- package/dist/cli/chunks/{chunk-4AITMWFZ.js → chunk-KXTN3FR4.js} +2 -2
- package/dist/cli/chunks/{chunk-4Z4X2ND4.js → chunk-L4WATX6B.js} +2 -2
- package/dist/cli/chunks/{chunk-GMLRIZ4E.js → chunk-L66BWYQH.js} +1 -1
- package/dist/cli/chunks/{chunk-52VGZJSD.js → chunk-LJ63HPPN.js} +1 -1
- package/dist/cli/chunks/{chunk-WE3VKDMK.js → chunk-LMPK63PO.js} +3 -3
- package/dist/cli/chunks/{chunk-S6WHYOWV.js → chunk-LQDFWLKK.js} +27 -25
- package/dist/cli/chunks/{chunk-EG73WYAW.js → chunk-LSXQPMPI.js} +2 -2
- package/dist/cli/chunks/{chunk-NJ4YVAG7.js → chunk-MDLLEUFN.js} +3 -3
- package/dist/cli/chunks/{chunk-YQOQVSYU.js → chunk-MFAN5W27.js} +1 -1
- package/dist/cli/chunks/{chunk-A5RWLPVT.js → chunk-MZ2PJUN6.js} +2 -2
- package/dist/cli/chunks/{chunk-HRTSYT4N.js → chunk-N22LMACN.js} +2 -2
- package/dist/cli/chunks/{chunk-L3GBNX7B.js → chunk-NAJCQJSK.js} +2 -2
- package/dist/cli/chunks/{chunk-XM5I7J5S.js → chunk-ND6JBUVH.js} +2 -2
- package/dist/cli/chunks/{chunk-YL2GOJF6.js → chunk-NEEZ6M4W.js} +2 -2
- package/dist/cli/chunks/{chunk-DGFINXUE.js → chunk-NNJ63W77.js} +1 -1
- package/dist/cli/chunks/{chunk-G6FJHDUG.js → chunk-O7KF3GBV.js} +1 -1
- package/dist/cli/chunks/{chunk-RP2BRRLX.js → chunk-OBKMLOHU.js} +2 -2
- package/dist/cli/chunks/{chunk-AOOCV56W.js → chunk-OBLHI4HA.js} +1 -1
- package/dist/cli/chunks/{chunk-OZ53BIY5.js → chunk-ODNLKYOM.js} +1 -1
- package/dist/cli/chunks/{chunk-VBHA4SDU.js → chunk-PMREFRPP.js} +2 -2
- package/dist/cli/chunks/{chunk-ASWWBNX2.js → chunk-PMUF7WU6.js} +2 -2
- package/dist/cli/chunks/{chunk-I5SXLV7D.js → chunk-PS5NIMWJ.js} +2 -2
- package/dist/cli/chunks/chunk-PS6Y662P.js +13 -0
- package/dist/cli/chunks/{chunk-N4OQ4D4V.js → chunk-PYAH4K2U.js} +2 -2
- package/dist/cli/chunks/{chunk-H3GAR4SV.js → chunk-PZZX57ZA.js} +2 -2
- package/dist/cli/chunks/chunk-QAE4BOIV.js +2 -0
- package/dist/cli/chunks/{chunk-7A4WTRWI.js → chunk-QIY43XQJ.js} +1 -1
- package/dist/cli/chunks/{chunk-MLXLGBQZ.js → chunk-QM6EJHP5.js} +1 -1
- package/dist/cli/chunks/{chunk-4ANJV6I4.js → chunk-QMTBWHGR.js} +3 -3
- package/dist/cli/chunks/{chunk-IT5QIUUA.js → chunk-RCHDSUVU.js} +2 -2
- package/dist/cli/chunks/{chunk-AYH3DMW2.js → chunk-RUEHSOE6.js} +1 -1
- package/dist/cli/chunks/{chunk-DCVFHVPR.js → chunk-RVCMZUSJ.js} +2 -2
- package/dist/cli/chunks/{chunk-2JAC57JE.js → chunk-RXHI6CKK.js} +1 -1
- package/dist/cli/chunks/{chunk-QXO35J6F.js → chunk-RXPHQ4ZE.js} +2 -2
- package/dist/cli/chunks/{chunk-FI6J3UHJ.js → chunk-RYHCYTFE.js} +1 -1
- package/dist/cli/chunks/{chunk-DFLASG3B.js → chunk-S4WIAKPL.js} +1 -1
- package/dist/cli/chunks/{chunk-2VY7FL6A.js → chunk-S53ZUAVI.js} +2 -2
- package/dist/cli/chunks/{chunk-4M7YZ2X7.js → chunk-SEKOMKNG.js} +1 -1
- package/dist/cli/chunks/{chunk-UC4EIULB.js → chunk-SZRDEPUY.js} +19 -19
- package/dist/cli/chunks/chunk-T7XYQX5G.js +24 -0
- package/dist/cli/chunks/{chunk-OG3DBHIV.js → chunk-TF33GKWA.js} +2 -2
- package/dist/cli/chunks/{chunk-2VTX4SYW.js → chunk-TGFJUL6M.js} +2 -2
- package/dist/cli/chunks/{chunk-4THFPRFM.js → chunk-TLD727EF.js} +2 -2
- package/dist/cli/chunks/{chunk-7PCIN7UN.js → chunk-TQ2JZVZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-UWZYXI3R.js → chunk-TT7DF2GX.js} +2 -2
- package/dist/cli/chunks/{chunk-X3JNFQW2.js → chunk-UCJEAK7D.js} +2 -2
- package/dist/cli/chunks/{chunk-AM42ROKZ.js → chunk-UN7EHLRV.js} +1 -1
- package/dist/cli/chunks/{chunk-42AS3HPO.js → chunk-UUE5CBZQ.js} +2 -2
- package/dist/cli/chunks/{chunk-E67ZXRG6.js → chunk-UWRMPRY5.js} +1 -1
- package/dist/cli/chunks/{chunk-4YFXF5AQ.js → chunk-VEWYUEVY.js} +5 -5
- package/dist/cli/chunks/{chunk-UJUK6T4V.js → chunk-VUXHJPUS.js} +2 -2
- package/dist/cli/chunks/{chunk-VA2ORJB5.js → chunk-VVP2ROXD.js} +2 -2
- package/dist/cli/chunks/{chunk-BZIPYXSW.js → chunk-WFJKLM6Z.js} +3 -3
- package/dist/cli/chunks/{chunk-MLFELTJX.js → chunk-X5G3UDWP.js} +2 -2
- package/dist/cli/chunks/{chunk-IQH2RDN3.js → chunk-Y63V33M6.js} +5 -5
- package/dist/cli/chunks/{chunk-XIKYUBIV.js → chunk-YXN47QOI.js} +2 -2
- package/dist/cli/chunks/{chunk-RP5VFZJO.js → chunk-Z5YU2TDS.js} +2 -2
- package/dist/cli/chunks/{chunk-KYJBJ56M.js → chunk-ZAHCVRR7.js} +2 -2
- package/dist/cli/chunks/{chunk-66OQ7AB3.js → chunk-ZC3HC6FO.js} +1 -1
- package/dist/cli/chunks/{ci-QAUD62WH.js → ci-Q2VX75PS.js} +2 -2
- package/dist/cli/chunks/{ci-output-TZDVTNE7.js → ci-output-MD5GTVR2.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ZWPHJ7YJ.js → circuit-breaker-JMRLG2XI.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-SCB4EURN.js → claude-flow-setup-IMXYALBU.js} +2 -2
- package/dist/cli/chunks/client-L4PIXCGV.js +2 -0
- package/dist/cli/chunks/{cline-installer-EHZLMLXF.js → cline-installer-HWFASEGE.js} +2 -2
- package/dist/cli/chunks/{code-3N6PBJMK.js → code-3V37TCAD.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-6DIKHNRI.js → code-index-extractor-5V54WGFL.js} +2 -2
- package/dist/cli/chunks/codex-installer-UCA5AVE6.js +14 -0
- package/dist/cli/chunks/{completions-5MKWWCCE.js → completions-2DMRCQU6.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-TPM4IPEK.js → complexity-analyzer-MMQRXBTD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-VXODKGVX.js → continuedev-installer-FAARXP3S.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-PVD5O56P.js → copilot-installer-AKQALMB5.js} +2 -2
- package/dist/cli/chunks/core-handlers-KROSXP4V.js +2 -0
- package/dist/cli/chunks/{cost-tracker-JOMZEQF3.js → cost-tracker-AXWHDND5.js} +2 -2
- package/dist/cli/chunks/{coverage-HTXLEV3B.js → coverage-ZLSKKCG5.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-WMTYBOON.js +2 -0
- package/dist/cli/chunks/{cursor-installer-SHKDTDDZ.js → cursor-installer-UALCQKVD.js} +2 -2
- package/dist/cli/chunks/{daemon-FCFEWVVJ.js → daemon-4LNOPJGN.js} +3 -3
- package/dist/cli/chunks/{daemon-PN4FEPLE.js → daemon-K3DFGCXC.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-PLOHU5SR.js → dag-attention-scheduler-LCQ7MYKC.js} +2 -2
- package/dist/cli/chunks/{detect-F3H4ZEZY.js → detect-P7PEN3MZ.js} +2 -2
- package/dist/cli/chunks/{dist-node-5TC665N6.js → dist-node-I72BJC2D.js} +2 -2
- package/dist/cli/chunks/{domain-handler-ZIWVFXCU.js → domain-handler-LROF6KWN.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-7Q5JYMYR.js → domain-transfer-M2ZSSTPV.js} +2 -2
- package/dist/cli/chunks/dream-AV63YQ2Y.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-MTBPUGO4.js +3 -0
- package/dist/cli/chunks/{eval-E2K2T75A.js → eval-O24ALB3W.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-Z5SE2O53.js → experience-capture-middleware-7JXEOGRE.js} +3 -3
- package/dist/cli/chunks/{fast-paths-3H52RSUK.js → fast-paths-4CFYJV4U.js} +2 -2
- package/dist/cli/chunks/{feature-flags-ONIKUZVK.js → feature-flags-CHPUA7IM.js} +2 -2
- package/dist/cli/chunks/{feature-flags-LUHSMHPS.js → feature-flags-E6PIM6ZB.js} +2 -2
- package/dist/cli/chunks/{file-discovery-FLYSYSS4.js → file-discovery-2ANIAUCP.js} +2 -2
- package/dist/cli/chunks/{fleet-6OJUAAKV.js → fleet-2MQ3OGCP.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-PUL6B7KZ.js → gnn-wrapper-P7JW3622.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-HGHHDUDY.js → heartbeat-handler-WWWZSA7V.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-5IZUGMC2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-NV2NNBJL.js +2 -0
- package/dist/cli/chunks/hnsw-index-GRJ3KA2O.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-NDZSNMYX.js → hnsw-legacy-bridge-W634ZOTV.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-PISLKSO2.js → hnswlib-node-SLZDLMKM.js} +2 -2
- package/dist/cli/chunks/{hooks-WYG54MRI.js → hooks-3BFAZGG7.js} +10 -10
- package/dist/cli/chunks/{hypergraph-engine-EDHKHZZ2.js → hypergraph-engine-XJSGXP2J.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-OCHZAPPL.js → hypergraph-handler-RVUWZMOX.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-YM4QUWVH.js +2 -0
- package/dist/cli/chunks/{init-handler-5TCJ672H.js → init-handler-FYOZNNNO.js} +9 -8
- package/dist/cli/chunks/init-wizard-YESXGIK6.js +2 -0
- package/dist/cli/chunks/kernel-VH5SKESU.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-SWUQRCTZ.js → kilocode-installer-MAAKFVSB.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-L22EBAM5.js → kiro-installer-GX3TLZC5.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-F3NL4WJV.js +2 -0
- package/dist/cli/chunks/learning-T4QZ6C26.js +122 -0
- package/dist/cli/chunks/{llm-router-F2L4LFT2.js → llm-router-N2M4WXOC.js} +14 -14
- package/dist/cli/chunks/llm-router-service-HQYCJMPK.js +2 -0
- package/dist/cli/chunks/{load-A4ZF2KHC.js → load-6RU3G4P2.js} +2 -2
- package/dist/cli/chunks/load-test-GWRGKWMN.js +2 -0
- package/dist/cli/chunks/{mcp-T2Z46NNK.js → mcp-EFBO7BAU.js} +2 -2
- package/dist/cli/chunks/{memory-PUC3J6XC.js → memory-AXU2M3DN.js} +5 -5
- package/dist/cli/chunks/memory-backend-7A2PFKPV.js +2 -0
- package/dist/cli/chunks/memory-handlers-65CXN76C.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-U5L4FI4O.js → multi-model-executor-W7AFGVNH.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-UWI6KHYH.js → opencode-installer-KJE2RLCH.js} +2 -2
- package/dist/cli/chunks/{orchestrator-3BEI7R5D.js → orchestrator-CL6MLGVU.js} +22 -24
- package/dist/cli/chunks/pattern-null-store-K2WPRYCP.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-EGWUI5LU.js → pattern-usage-recorder-7SNSJ7K2.js} +2 -2
- package/dist/cli/chunks/{pipeline-JG6M4RHD.js → pipeline-3UU6ON3F.js} +2 -2
- package/dist/cli/chunks/platform-SNMPIDIT.js +2 -0
- package/dist/cli/chunks/{plugin-EEGN3PMK.js → plugin-65IIUUCU.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-7KZAINFT.js → prime-radiant-advanced-wasm-WWWJRLRP.js} +2 -2
- package/dist/cli/chunks/protocol-executor-TJDLEHND.js +2 -0
- package/dist/cli/chunks/{protocol-handler-UCEHYK2R.js → protocol-handler-SEBHCLLJ.js} +2 -2
- package/dist/cli/chunks/{prove-JSNG75VD.js → prove-N4X7CCJ4.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-CGRMFPDM.js +2 -0
- package/dist/cli/chunks/{quality-7SRM2HBM.js → quality-LBCJWXMU.js} +2 -2
- package/dist/cli/chunks/quality-gate-KZIQI7QT.js +7 -0
- package/dist/cli/chunks/queen-coordinator-FKP6QZAQ.js +2 -0
- package/dist/cli/chunks/real-embeddings-XCZFHFME.js +2 -0
- package/dist/cli/chunks/{roocode-installer-UYQK64BZ.js → roocode-installer-P3O6B7PT.js} +2 -2
- package/dist/cli/chunks/router-KZ5BISAM.js +2 -0
- package/dist/cli/chunks/routing-feedback-O4Y5TTR6.js +2 -0
- package/dist/cli/chunks/{routing-handler-PY3KPDTH.js → routing-handler-OXZ4DOV4.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-GCAOUTYS.js → ruvector-commands-PSY5IDSL.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-NG3UF3D5.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-PUHVTKQY.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-4SUT7GTJ.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-ODXFKZ6G.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-HNDKOM4L.js → rvf-store-integrity-TCKC22FH.js} +2 -2
- package/dist/cli/chunks/safe-db-BUQDNH2R.js +2 -0
- package/dist/cli/chunks/schedule-ZXNDZNNB.js +2 -0
- package/dist/cli/chunks/scheduler-YUQQWWW3.js +2 -0
- package/dist/cli/chunks/{security-MQ2VB7PY.js → security-RQGUQGSI.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-TAZEU6QK.js → shared-rvf-adapter-ZJFN52C2.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-B7N6AOCY.js → shared-rvf-dual-writer-V2R37HWV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-HVSX46C7.js +2 -0
- package/dist/cli/chunks/{status-handler-NZP7DFHE.js → status-handler-XEKWNVDR.js} +2 -2
- package/dist/cli/chunks/{structural-health-ALLUQ4X6.js → structural-health-QMIW6WUN.js} +2 -2
- package/dist/cli/chunks/{sync-WJJG5J6V.js → sync-GDYJ2ULT.js} +2 -2
- package/dist/cli/chunks/{sync-MM7OCUYD.js → sync-H5SXWXPP.js} +2 -2
- package/dist/cli/chunks/{task-handler-CAQUEEB4.js → task-handler-EPLKCQHY.js} +2 -2
- package/dist/cli/chunks/{task-handlers-25BJ7D3W.js → task-handlers-22NTLWTC.js} +3 -3
- package/dist/cli/chunks/{test-HW7GVGVN.js → test-WHJFRZ3F.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-HTMFJMSP.js → test-scheduling-KZVFZOQN.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-BW5WA6PY.js +2 -0
- package/dist/cli/chunks/{token-usage-RJZDMBDP.js → token-usage-4A4O57R6.js} +2 -2
- package/dist/cli/chunks/{transformers-3YFW3EUO.js → transformers-FYTBRV46.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-U3PQPIK7.js → tree-sitter-wasm-parser-TZIJPLF3.js} +2 -2
- package/dist/cli/chunks/{types-7Q762WDO.js → types-B2L6LKFA.js} +2 -2
- package/dist/cli/chunks/unified-memory-AHN4RVBP.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-XB7JPF74.js +2 -0
- package/dist/cli/chunks/unified-persistence-53KWNFQJ.js +2 -0
- package/dist/cli/chunks/{upgrade-F7MKJWBQ.js → upgrade-O6U7EA7V.js} +2 -2
- package/dist/cli/chunks/{validate-B27AVRA6.js → validate-FHNZ5XL3.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-GYZR3GNL.js → validate-swarm-YOLLUEHE.js} +2 -2
- package/dist/cli/chunks/{vibium-W4XQMPJP.js → vibium-UXRPEIXB.js} +2 -2
- package/dist/cli/chunks/visual-security-CRPYS7L7.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-I7CDCFJU.js → web-tree-sitter-JJ5UIYFD.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-UYLHFDHU.js → windsurf-installer-I4QMQPIL.js} +2 -2
- package/dist/cli/chunks/witness-chain-5WCR2CAS.js +2 -0
- package/dist/cli/chunks/{witness-chain-B66SYZKU.js → witness-chain-BIJ7WDGS.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-U4JPAHVW.js → witness-key-manager-3SMMLJLP.js} +2 -2
- package/dist/cli/chunks/{workflow-DYMO47FF.js → workflow-33PUXXJV.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-RZWCLTT5.js +2 -0
- package/dist/cli/chunks/{wrappers-7S6DQTEA.js → wrappers-ASAU36VK.js} +2 -2
- package/dist/cli/commands/learning.js +44 -0
- package/dist/cli/commands/llm-router.js +27 -21
- package/dist/cli/commands/platform.d.ts +1 -0
- package/dist/cli/commands/platform.js +28 -6
- package/dist/cli/commands/quality-gate.js +25 -3
- package/dist/cli/handlers/brain-handler.js +2 -0
- package/dist/cli/handlers/init-handler.d.ts +5 -0
- package/dist/cli/handlers/init-handler.js +6 -0
- package/dist/cli/index.js +4 -1
- package/dist/context/compaction/index.d.ts +1 -0
- package/dist/context/compaction/index.js +3 -0
- package/dist/context/compaction/instruction-provenance.d.ts +20 -0
- package/dist/context/compaction/instruction-provenance.js +18 -0
- package/dist/context/compaction/tier2-session-summary.d.ts +8 -0
- package/dist/context/compaction/tier2-session-summary.js +20 -0
- package/dist/context/compaction/tier3-llm-compact.d.ts +4 -0
- package/dist/context/compaction/tier3-llm-compact.js +32 -4
- package/dist/contracts/verdicts.d.ts +625 -0
- package/dist/contracts/verdicts.js +202 -14
- package/dist/coordination/handlers/coverage-handlers.js +8 -1
- package/dist/domains/chaos-resilience/diagnosis/corpus.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/corpus.js +141 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.d.ts +11 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.js +109 -0
- package/dist/domains/chaos-resilience/diagnosis/index.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/index.js +5 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.d.ts +8 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.js +128 -0
- package/dist/domains/chaos-resilience/diagnosis/types.d.ts +171 -0
- package/dist/domains/chaos-resilience/diagnosis/types.js +3 -0
- package/dist/domains/chaos-resilience/index.d.ts +1 -0
- package/dist/domains/chaos-resilience/index.js +1 -0
- package/dist/domains/index.d.ts +1 -0
- package/dist/domains/index.js +1 -0
- package/dist/early-exit/early-exit-controller.d.ts +4 -2
- package/dist/early-exit/early-exit-controller.js +95 -7
- package/dist/early-exit/index.d.ts +1 -1
- package/dist/early-exit/speculative-executor.js +3 -0
- package/dist/early-exit/types.d.ts +51 -0
- package/dist/early-exit/types.js +3 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/init/browser-engine-installer.d.ts +11 -0
- package/dist/init/browser-engine-installer.js +35 -5
- package/dist/init/codex-installer.d.ts +11 -1
- package/dist/init/codex-installer.js +90 -24
- package/dist/init/init-wizard-hooks.js +11 -11
- package/dist/init/orchestrator.js +2 -0
- package/dist/init/phases/07-hooks.d.ts +3 -3
- package/dist/init/phases/07-hooks.js +19 -21
- package/dist/init/phases/09-assets.d.ts +4 -0
- package/dist/init/phases/09-assets.js +13 -10
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/init/types.d.ts +4 -0
- package/dist/integrations/embeddings/base/EmbeddingGenerator.js +4 -2
- package/dist/integrations/ruvector/brain-exporter.d.ts +1 -1
- package/dist/integrations/ruvector/brain-exporter.js +15 -3
- package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +4 -0
- package/dist/integrations/ruvector/brain-rvf-exporter.js +118 -37
- package/dist/integrations/ruvector/brain-search.d.ts +1 -1
- package/dist/integrations/ruvector/brain-search.js +1 -1
- package/dist/integrations/ruvector/brain-shared.d.ts +4 -2
- package/dist/integrations/ruvector/brain-shared.js +11 -4
- package/dist/integrations/ruvector/brain-table-ddl.d.ts +2 -2
- package/dist/integrations/ruvector/brain-table-ddl.js +20 -8
- package/dist/integrations/ruvector/cognitive-container.js +1 -1
- package/dist/integrations/ruvector/rvf-dual-writer.d.ts +4 -0
- package/dist/integrations/ruvector/rvf-dual-writer.js +57 -9
- package/dist/integrations/ruvector/rvf-store-integrity.js +1 -1
- package/dist/kernel/unified-memory-schemas.d.ts +4 -3
- package/dist/kernel/unified-memory-schemas.js +19 -9
- package/dist/kernel/unified-memory.d.ts +2 -0
- package/dist/kernel/unified-memory.js +19 -0
- package/dist/learning/embed-and-insert-pattern.js +6 -3
- package/dist/learning/embedding-space.d.ts +50 -0
- package/dist/learning/embedding-space.js +128 -0
- package/dist/learning/evidence-admission-store.d.ts +15 -0
- package/dist/learning/evidence-admission-store.js +68 -0
- package/dist/learning/index.d.ts +7 -0
- package/dist/learning/index.js +4 -0
- package/dist/learning/learning-evidence-admission.d.ts +44 -0
- package/dist/learning/learning-evidence-admission.js +97 -0
- package/dist/learning/pattern-mutation-error.d.ts +9 -0
- package/dist/learning/pattern-mutation-error.js +14 -0
- package/dist/learning/pattern-store.d.ts +5 -0
- package/dist/learning/pattern-store.js +60 -9
- package/dist/learning/qe-flywheel/coupled-anchor.d.ts +8 -0
- package/dist/learning/qe-flywheel/coupled-anchor.js +46 -3
- package/dist/learning/qe-reasoning-bank.js +28 -5
- package/dist/learning/real-embeddings.d.ts +3 -0
- package/dist/learning/real-embeddings.js +40 -3
- package/dist/learning/real-qe-reasoning-bank.js +7 -3
- package/dist/learning/rvf-pattern-migration.d.ts +2 -0
- package/dist/learning/rvf-pattern-migration.js +5 -3
- package/dist/learning/rvf-pattern-store.d.ts +3 -0
- package/dist/learning/rvf-pattern-store.js +44 -6
- package/dist/learning/sqlite-persistence.d.ts +7 -2
- package/dist/learning/sqlite-persistence.js +58 -21
- package/dist/learning/structural-retrieval/corpus.d.ts +5 -0
- package/dist/learning/structural-retrieval/corpus.js +97 -0
- package/dist/learning/structural-retrieval/evaluate.d.ts +7 -0
- package/dist/learning/structural-retrieval/evaluate.js +124 -0
- package/dist/learning/structural-retrieval/index.d.ts +6 -0
- package/dist/learning/structural-retrieval/index.js +4 -0
- package/dist/learning/structural-retrieval/receipt.d.ts +14 -0
- package/dist/learning/structural-retrieval/receipt.js +36 -0
- package/dist/learning/structural-retrieval/types.d.ts +83 -0
- package/dist/learning/structural-retrieval/types.js +2 -0
- package/dist/mcp/bundle.js +589 -433
- package/dist/mcp/handlers/memory-handlers.js +6 -2
- package/dist/mcp/services/session-resume.d.ts +15 -19
- package/dist/mcp/services/session-resume.js +204 -194
- package/dist/mcp/tools/quality-assessment/gate.d.ts +8 -5
- package/dist/mcp/tools/quality-assessment/gate.js +9 -4
- package/dist/migrations/20260830_add_learning_evidence_tables.d.ts +7 -0
- package/dist/migrations/20260830_add_learning_evidence_tables.js +173 -0
- package/dist/persistence/rvf-migration-adapter.d.ts +2 -0
- package/dist/persistence/rvf-migration-adapter.js +56 -12
- package/dist/shared/llm/llm-router-service.d.ts +8 -0
- package/dist/shared/llm/llm-router-service.js +21 -3
- package/dist/shared/sql-safety.js +4 -0
- package/dist/skills/qe-court/cli.d.ts +3 -0
- package/dist/skills/qe-court/cli.js +54 -0
- package/dist/validation/quality-gate-runner.d.ts +27 -4
- package/dist/validation/quality-gate-runner.js +33 -4
- package/dist/validation/verification-reach.d.ts +90 -0
- package/dist/validation/verification-reach.js +187 -0
- package/dist/verification/adversarial-verify/calibrate.d.ts +46 -2
- package/dist/verification/adversarial-verify/calibrate.js +104 -2
- package/dist/verification/adversarial-verify/index.d.ts +2 -2
- package/dist/verification/adversarial-verify/index.js +1 -1
- package/dist/verification/adversarial-verify/measurement-receipt.d.ts +13 -0
- package/dist/verification/adversarial-verify/measurement-receipt.js +136 -0
- package/dist/verification/adversarial-verify/synthesize.js +7 -10
- package/dist/verification/adversarial-verify/types.d.ts +35 -0
- package/dist/verification/adversarial-verify/verify.js +6 -1
- package/package.json +14 -6
- package/schemas/coverage-gap.schema.json +41 -0
- package/schemas/finding-verdict.schema.json +470 -0
- package/schemas/risk-decision.schema.json +41 -0
- package/dist/cli/chunks/adapter-FUV6LBJT.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-QNFNA3J4.js +0 -2
- package/dist/cli/chunks/base-37W2XIXC.js +0 -2
- package/dist/cli/chunks/brain-handler-TVTTWZGP.js +0 -89
- package/dist/cli/chunks/browser-workflow-PDIUEK7B.js +0 -2
- package/dist/cli/chunks/chunk-5PI75QYP.js +0 -4
- package/dist/cli/chunks/chunk-EDRPTLAX.js +0 -2
- package/dist/cli/chunks/chunk-GEQWCK4F.js +0 -2
- package/dist/cli/chunks/chunk-GQLJYTXN.js +0 -2
- package/dist/cli/chunks/chunk-NLZUGANH.js +0 -11
- package/dist/cli/chunks/chunk-O4BWESH5.js +0 -2
- package/dist/cli/chunks/chunk-PGFCKE4G.js +0 -12
- package/dist/cli/chunks/chunk-RACWX2ZX.js +0 -9
- package/dist/cli/chunks/chunk-SNC73DWF.js +0 -2
- package/dist/cli/chunks/chunk-TDVMILKO.js +0 -2
- package/dist/cli/chunks/chunk-TK5XLF3Z.js +0 -65
- package/dist/cli/chunks/chunk-UQ4UCHO7.js +0 -2
- package/dist/cli/chunks/chunk-VZGP77YU.js +0 -12
- package/dist/cli/chunks/chunk-WA6CSEOX.js +0 -2
- package/dist/cli/chunks/chunk-WYIXNHPF.js +0 -2
- package/dist/cli/chunks/client-4W3KWTAU.js +0 -2
- package/dist/cli/chunks/codex-installer-P7DPQMYL.js +0 -15
- package/dist/cli/chunks/core-handlers-BDU2XBLO.js +0 -2
- package/dist/cli/chunks/cross-domain-router-BPB6IHN4.js +0 -2
- package/dist/cli/chunks/dream-WFCZGFDY.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-VESJQSYD.js +0 -3
- package/dist/cli/chunks/heartbeat-scheduler-HWS4SHRM.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-7QOBHKRB.js +0 -2
- package/dist/cli/chunks/hnsw-index-6WUKYJH7.js +0 -2
- package/dist/cli/chunks/hybrid-router-525JTRA5.js +0 -2
- package/dist/cli/chunks/impact-analyzer-GG6CJEOK.js +0 -2
- package/dist/cli/chunks/init-wizard-4VFAOK4Y.js +0 -2
- package/dist/cli/chunks/kernel-N3FQGOST.js +0 -2
- package/dist/cli/chunks/knowledge-graph-I5QIHB4G.js +0 -2
- package/dist/cli/chunks/learning-TQOGG3CR.js +0 -119
- package/dist/cli/chunks/llm-router-service-NCJZYJLG.js +0 -2
- package/dist/cli/chunks/load-test-DCJEYIXD.js +0 -2
- package/dist/cli/chunks/memory-backend-O6KO2KTX.js +0 -2
- package/dist/cli/chunks/memory-handlers-4Z43WEKD.js +0 -2
- package/dist/cli/chunks/pattern-null-store-5WIJKX2K.js +0 -2
- package/dist/cli/chunks/platform-F76G6RUI.js +0 -2
- package/dist/cli/chunks/protocol-executor-5TPNAZTB.js +0 -2
- package/dist/cli/chunks/provider-manager-3VMOZ6HV.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-BATV4NTT.js +0 -2
- package/dist/cli/chunks/quality-gate-A5MPWHST.js +0 -7
- package/dist/cli/chunks/queen-coordinator-EIHGYBUO.js +0 -2
- package/dist/cli/chunks/real-embeddings-ZBF5EQOG.js +0 -2
- package/dist/cli/chunks/router-EMVGY4HU.js +0 -2
- package/dist/cli/chunks/routing-feedback-JUP4OFB2.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-BUNP4SKD.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-VSOAPLMB.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-LSWEHAWX.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-LOC42TQ6.js +0 -2
- package/dist/cli/chunks/safe-db-WQ62IQKV.js +0 -2
- package/dist/cli/chunks/schedule-XJRP57TE.js +0 -2
- package/dist/cli/chunks/scheduler-EZH5SDIM.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-HPEVCTIB.js +0 -2
- package/dist/cli/chunks/token-bootstrap-F2DCLWGW.js +0 -2
- package/dist/cli/chunks/unified-memory-ATILROKR.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-XJXAX7DW.js +0 -2
- package/dist/cli/chunks/unified-persistence-3TN5PBWE.js +0 -2
- package/dist/cli/chunks/visual-security-VFWRBCNA.js +0 -2
- package/dist/cli/chunks/witness-chain-JC5LEXRV.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-TKQUF2KN.js +0 -2
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Failure-mode verification reach contracts (#651).
|
|
3
|
+
*
|
|
4
|
+
* Quality evidence is useful only within the boundary it actually observed.
|
|
5
|
+
* This module keeps that boundary revision-bound and fail-closed: direct,
|
|
6
|
+
* executed, fresh evidence with the required oracle can cover a risk; partial,
|
|
7
|
+
* inferred, stale, unavailable, and wrong-target evidence remains visible but
|
|
8
|
+
* cannot silently produce a passing coverage verdict.
|
|
9
|
+
*/
|
|
10
|
+
import { createHash } from 'node:crypto';
|
|
11
|
+
/** Create a manifest whose hash binds its target, risks, checks, and lifetime. */
|
|
12
|
+
export function createVerificationReachManifest(input) {
|
|
13
|
+
validateManifestShape(input);
|
|
14
|
+
const manifest = structuredClone(input);
|
|
15
|
+
return {
|
|
16
|
+
...manifest,
|
|
17
|
+
manifestHash: computeVerificationReachManifestHash(manifest),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Compute the canonical SHA-256 identity for all manifest content except the hash itself. */
|
|
21
|
+
export function computeVerificationReachManifestHash(manifest) {
|
|
22
|
+
const { manifestHash: _ignored, ...content } = manifest;
|
|
23
|
+
return `sha256:${createHash('sha256').update(canonicalJson(content)).digest('hex')}`;
|
|
24
|
+
}
|
|
25
|
+
/** Bind a reach manifest to the exact artifact bytes submitted to the gate. */
|
|
26
|
+
export function computeVerificationArtifactDigest(artifact) {
|
|
27
|
+
return `sha256:${createHash('sha256').update(artifact).digest('hex')}`;
|
|
28
|
+
}
|
|
29
|
+
/** Evaluate whether the declared evidence can directly observe every required failure mode. */
|
|
30
|
+
export function evaluateVerificationReach(manifest, options = {}) {
|
|
31
|
+
validateManifestShape(manifest);
|
|
32
|
+
const expectedHash = computeVerificationReachManifestHash(manifest);
|
|
33
|
+
if (manifest.manifestHash !== expectedHash) {
|
|
34
|
+
throw new Error(`Verification reach manifestHash mismatch: expected ${expectedHash}`);
|
|
35
|
+
}
|
|
36
|
+
const now = options.now ?? new Date();
|
|
37
|
+
const evaluatedAt = now.toISOString();
|
|
38
|
+
const manifestExpired = manifest.expiresAt != null
|
|
39
|
+
&& now.getTime() > parseTimestamp(manifest.expiresAt, 'expiresAt');
|
|
40
|
+
const risks = manifest.risks.map((requirement) => evaluateRisk(requirement, manifest, manifestExpired, now.getTime()));
|
|
41
|
+
return {
|
|
42
|
+
manifestId: manifest.id,
|
|
43
|
+
manifestHash: manifest.manifestHash,
|
|
44
|
+
systemUnderTest: manifest.systemUnderTest,
|
|
45
|
+
artifact: structuredClone(manifest.artifact),
|
|
46
|
+
coverageVerdict: aggregateVerdicts(risks.map((risk) => risk.verdict)),
|
|
47
|
+
risks,
|
|
48
|
+
evaluatedAt,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function evaluateRisk(requirement, manifest, manifestExpired, evaluatedAt) {
|
|
52
|
+
const direct = new Set();
|
|
53
|
+
const partial = new Set();
|
|
54
|
+
const failed = new Set();
|
|
55
|
+
const covered = new Set();
|
|
56
|
+
const limitations = new Set();
|
|
57
|
+
for (const check of requirement.checks) {
|
|
58
|
+
for (const limitation of check.limitations)
|
|
59
|
+
limitations.add(limitation);
|
|
60
|
+
if (!isUsableObservation(check, manifest, manifestExpired, evaluatedAt))
|
|
61
|
+
continue;
|
|
62
|
+
if (check.reach === 'partial') {
|
|
63
|
+
partial.add(check.checkId);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (check.reach !== 'direct')
|
|
67
|
+
continue;
|
|
68
|
+
if (!requirement.requiredObservations.includes(check.channel))
|
|
69
|
+
continue;
|
|
70
|
+
if (check.oracleRef !== requirement.requiredOracle)
|
|
71
|
+
continue;
|
|
72
|
+
if (check.executionStatus === 'failed') {
|
|
73
|
+
failed.add(check.checkId);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (check.executionStatus === 'passed') {
|
|
77
|
+
direct.add(check.checkId);
|
|
78
|
+
covered.add(check.channel);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const uncoveredObservations = requirement.requiredObservations.filter((channel) => !covered.has(channel));
|
|
82
|
+
const verdict = failed.size > 0
|
|
83
|
+
? 'fail'
|
|
84
|
+
: uncoveredObservations.length === 0
|
|
85
|
+
? 'pass'
|
|
86
|
+
: requirement.dispositionWhenUncovered;
|
|
87
|
+
return {
|
|
88
|
+
riskId: requirement.riskId,
|
|
89
|
+
failureMode: requirement.failureMode,
|
|
90
|
+
severity: requirement.severity,
|
|
91
|
+
verdict,
|
|
92
|
+
directCheckIds: [...direct],
|
|
93
|
+
partialCheckIds: [...partial],
|
|
94
|
+
failedCheckIds: [...failed],
|
|
95
|
+
uncoveredObservations,
|
|
96
|
+
limitations: [...limitations],
|
|
97
|
+
reason: buildRiskReason(verdict, failed, uncoveredObservations, manifestExpired),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function isUsableObservation(check, manifest, manifestExpired, evaluatedAt) {
|
|
101
|
+
if (manifestExpired)
|
|
102
|
+
return false;
|
|
103
|
+
if (!sameTarget(check.target, manifest.artifact))
|
|
104
|
+
return false;
|
|
105
|
+
if (check.evidenceClass !== 'EXECUTED')
|
|
106
|
+
return false;
|
|
107
|
+
if (check.executionStatus === 'not-run' || check.executionStatus === 'unavailable')
|
|
108
|
+
return false;
|
|
109
|
+
if (!check.observedAt)
|
|
110
|
+
return false;
|
|
111
|
+
const observedAt = parseTimestamp(check.observedAt, `check ${check.checkId} observedAt`);
|
|
112
|
+
const generatedAt = parseTimestamp(manifest.generatedAt, 'generatedAt');
|
|
113
|
+
if (observedAt < generatedAt)
|
|
114
|
+
return false;
|
|
115
|
+
if (observedAt > evaluatedAt)
|
|
116
|
+
return false;
|
|
117
|
+
if (manifest.expiresAt && observedAt > parseTimestamp(manifest.expiresAt, 'expiresAt'))
|
|
118
|
+
return false;
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
function sameTarget(actual, expected) {
|
|
122
|
+
return actual.revision === expected.revision
|
|
123
|
+
&& actual.digest === expected.digest
|
|
124
|
+
&& actual.environment === expected.environment;
|
|
125
|
+
}
|
|
126
|
+
function aggregateVerdicts(verdicts) {
|
|
127
|
+
if (verdicts.some((verdict) => verdict === 'fail'))
|
|
128
|
+
return 'fail';
|
|
129
|
+
if (verdicts.some((verdict) => verdict === 'human-review'))
|
|
130
|
+
return 'human-review';
|
|
131
|
+
if (verdicts.some((verdict) => verdict === 'inconclusive'))
|
|
132
|
+
return 'inconclusive';
|
|
133
|
+
return 'pass';
|
|
134
|
+
}
|
|
135
|
+
function buildRiskReason(verdict, failed, uncovered, manifestExpired) {
|
|
136
|
+
if (manifestExpired)
|
|
137
|
+
return `verification manifest expired; uncovered: ${uncovered.join(', ')}`;
|
|
138
|
+
if (failed.size > 0)
|
|
139
|
+
return `direct check failed: ${[...failed].join(', ')}`;
|
|
140
|
+
if (verdict === 'pass')
|
|
141
|
+
return 'all required observation channels have direct executed reach';
|
|
142
|
+
return `required reach is uncovered (${uncovered.join(', ')}); disposition: ${verdict}`;
|
|
143
|
+
}
|
|
144
|
+
function validateManifestShape(manifest) {
|
|
145
|
+
if (!manifest.id || !manifest.systemUnderTest) {
|
|
146
|
+
throw new Error('Verification reach manifest requires id and systemUnderTest');
|
|
147
|
+
}
|
|
148
|
+
if (!manifest.artifact.revision || !manifest.artifact.digest || !manifest.artifact.environment) {
|
|
149
|
+
throw new Error('Verification reach manifest artifact requires revision, digest, and environment');
|
|
150
|
+
}
|
|
151
|
+
parseTimestamp(manifest.generatedAt, 'generatedAt');
|
|
152
|
+
if (manifest.expiresAt)
|
|
153
|
+
parseTimestamp(manifest.expiresAt, 'expiresAt');
|
|
154
|
+
if (manifest.risks.length === 0) {
|
|
155
|
+
throw new Error('Verification reach manifest requires at least one failure mode');
|
|
156
|
+
}
|
|
157
|
+
const riskIds = new Set();
|
|
158
|
+
for (const risk of manifest.risks) {
|
|
159
|
+
if (riskIds.has(risk.riskId))
|
|
160
|
+
throw new Error(`Duplicate riskId: ${risk.riskId}`);
|
|
161
|
+
riskIds.add(risk.riskId);
|
|
162
|
+
if (!risk.riskId || !risk.failureMode || !risk.requiredOracle) {
|
|
163
|
+
throw new Error('Each failure mode requires riskId, failureMode, and requiredOracle');
|
|
164
|
+
}
|
|
165
|
+
if (risk.requiredObservations.length === 0) {
|
|
166
|
+
throw new Error(`Failure mode ${risk.riskId} requires at least one observation channel`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function parseTimestamp(value, field) {
|
|
171
|
+
const timestamp = Date.parse(value);
|
|
172
|
+
if (!Number.isFinite(timestamp))
|
|
173
|
+
throw new Error(`Invalid ${field} timestamp: ${value}`);
|
|
174
|
+
return timestamp;
|
|
175
|
+
}
|
|
176
|
+
function canonicalJson(value) {
|
|
177
|
+
if (Array.isArray(value))
|
|
178
|
+
return `[${value.map(canonicalJson).join(',')}]`;
|
|
179
|
+
if (value && typeof value === 'object') {
|
|
180
|
+
const entries = Object.entries(value)
|
|
181
|
+
.filter(([, entry]) => entry !== undefined)
|
|
182
|
+
.sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
183
|
+
return `{${entries.map(([key, entry]) => `${JSON.stringify(key)}:${canonicalJson(entry)}`).join(',')}}`;
|
|
184
|
+
}
|
|
185
|
+
return JSON.stringify(value);
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=verification-reach.js.map
|
|
@@ -7,11 +7,52 @@
|
|
|
7
7
|
* — a deterministic stub (characterize the k-of-n aggregation) or a real LLM
|
|
8
8
|
* (empirical false-kill on a labeled corpus).
|
|
9
9
|
*/
|
|
10
|
-
import type { AdversarialVerifyOptions, Finding } from './types.js';
|
|
10
|
+
import type { AdversarialVerifyOptions, Finding, FindingSeverity } from './types.js';
|
|
11
11
|
export interface LabeledFinding {
|
|
12
12
|
finding: Finding;
|
|
13
13
|
/** Ground truth: is this a genuine, actionable problem? */
|
|
14
14
|
isReal: boolean;
|
|
15
|
+
failureType?: string;
|
|
16
|
+
domain?: string;
|
|
17
|
+
expectedSeverity?: FindingSeverity;
|
|
18
|
+
source?: 'human' | 'oracle' | 'controlled-intervention';
|
|
19
|
+
}
|
|
20
|
+
export interface ConfidenceInterval {
|
|
21
|
+
low: number;
|
|
22
|
+
high: number;
|
|
23
|
+
level: 0.95;
|
|
24
|
+
}
|
|
25
|
+
export type QualificationDisposition = 'automate' | 'human-review' | 'abstain';
|
|
26
|
+
export interface QualificationSlice {
|
|
27
|
+
key: string;
|
|
28
|
+
support: number;
|
|
29
|
+
precision: number;
|
|
30
|
+
recall: number;
|
|
31
|
+
falseKillRate: number;
|
|
32
|
+
falseKeepRate: number;
|
|
33
|
+
uncertainRate: number;
|
|
34
|
+
intervals: {
|
|
35
|
+
precision: ConfidenceInterval;
|
|
36
|
+
recall: ConfidenceInterval;
|
|
37
|
+
falseKillRate: ConfidenceInterval;
|
|
38
|
+
falseKeepRate: ConfidenceInterval;
|
|
39
|
+
};
|
|
40
|
+
disposition: QualificationDisposition;
|
|
41
|
+
}
|
|
42
|
+
export interface QualificationOptions {
|
|
43
|
+
minSupport?: number;
|
|
44
|
+
minRecall?: number;
|
|
45
|
+
minPrecision?: number;
|
|
46
|
+
maxFalseKillRate?: number;
|
|
47
|
+
maxFalseKeepRate?: number;
|
|
48
|
+
criticalSeverities?: FindingSeverity[];
|
|
49
|
+
}
|
|
50
|
+
export interface JudgeQualification {
|
|
51
|
+
status: 'qualified' | 'restricted' | 'unqualified';
|
|
52
|
+
automatedSlices: string[];
|
|
53
|
+
humanReviewSlices: string[];
|
|
54
|
+
abstainSlices: string[];
|
|
55
|
+
reasons: string[];
|
|
15
56
|
}
|
|
16
57
|
export interface CalibrationReport {
|
|
17
58
|
total: number;
|
|
@@ -26,7 +67,10 @@ export interface CalibrationReport {
|
|
|
26
67
|
correctConfirm: number;
|
|
27
68
|
correctKill: number;
|
|
28
69
|
uncertain: number;
|
|
70
|
+
slices: QualificationSlice[];
|
|
71
|
+
qualification: JudgeQualification;
|
|
29
72
|
}
|
|
73
|
+
export declare function qualifyJudge(slices: QualificationSlice[], criticalSliceKeys?: string[]): JudgeQualification;
|
|
30
74
|
/** Run the verifier over a labeled set and report the confusion vs ground truth. */
|
|
31
|
-
export declare function calibrate(labeled: LabeledFinding[], opts: AdversarialVerifyOptions): Promise<CalibrationReport>;
|
|
75
|
+
export declare function calibrate(labeled: LabeledFinding[], opts: AdversarialVerifyOptions, qualificationOptions?: QualificationOptions): Promise<CalibrationReport>;
|
|
32
76
|
//# sourceMappingURL=calibrate.d.ts.map
|
|
@@ -1,11 +1,90 @@
|
|
|
1
1
|
import { adversarialVerify } from './verify.js';
|
|
2
|
+
const DEFAULT_QUALIFICATION = {
|
|
3
|
+
minSupport: 10,
|
|
4
|
+
minRecall: 0.8,
|
|
5
|
+
minPrecision: 0.8,
|
|
6
|
+
maxFalseKillRate: 0.1,
|
|
7
|
+
maxFalseKeepRate: 0.1,
|
|
8
|
+
criticalSeverities: ['critical', 'high'],
|
|
9
|
+
};
|
|
10
|
+
function wilson(successes, total) {
|
|
11
|
+
if (total === 0)
|
|
12
|
+
return { low: 0, high: 1, level: 0.95 };
|
|
13
|
+
const z = 1.959963984540054;
|
|
14
|
+
const p = successes / total;
|
|
15
|
+
const z2 = z * z;
|
|
16
|
+
const denominator = 1 + z2 / total;
|
|
17
|
+
const centre = (p + z2 / (2 * total)) / denominator;
|
|
18
|
+
const margin = z * Math.sqrt((p * (1 - p) + z2 / (4 * total)) / total) / denominator;
|
|
19
|
+
return { low: Math.max(0, centre - margin), high: Math.min(1, centre + margin), level: 0.95 };
|
|
20
|
+
}
|
|
21
|
+
function buildSlice(key, entries, policy) {
|
|
22
|
+
const real = entries.filter(entry => entry.label.isReal);
|
|
23
|
+
const falseEntries = entries.filter(entry => !entry.label.isReal);
|
|
24
|
+
const upheldReal = real.filter(entry => entry.verdict === 'upheld').length;
|
|
25
|
+
const upheldFalse = falseEntries.filter(entry => entry.verdict === 'upheld').length;
|
|
26
|
+
const falseKill = real.filter(entry => entry.verdict === 'refuted').length;
|
|
27
|
+
const falseKeep = upheldFalse;
|
|
28
|
+
const uncertain = entries.filter(entry => entry.verdict === 'uncertain').length;
|
|
29
|
+
const upheld = upheldReal + upheldFalse;
|
|
30
|
+
const precision = upheld ? upheldReal / upheld : 0;
|
|
31
|
+
const recall = real.length ? upheldReal / real.length : 0;
|
|
32
|
+
const falseKillRate = real.length ? falseKill / real.length : 0;
|
|
33
|
+
const falseKeepRate = falseEntries.length ? falseKeep / falseEntries.length : 0;
|
|
34
|
+
const intervals = {
|
|
35
|
+
precision: wilson(upheldReal, upheld),
|
|
36
|
+
recall: wilson(upheldReal, real.length),
|
|
37
|
+
falseKillRate: wilson(falseKill, real.length),
|
|
38
|
+
falseKeepRate: wilson(falseKeep, falseEntries.length),
|
|
39
|
+
};
|
|
40
|
+
let disposition = 'automate';
|
|
41
|
+
if (entries.length < policy.minSupport || real.length === 0)
|
|
42
|
+
disposition = 'abstain';
|
|
43
|
+
else if (intervals.recall.low < policy.minRecall
|
|
44
|
+
|| intervals.precision.low < policy.minPrecision
|
|
45
|
+
|| intervals.falseKillRate.high > policy.maxFalseKillRate
|
|
46
|
+
|| intervals.falseKeepRate.high > policy.maxFalseKeepRate) {
|
|
47
|
+
disposition = 'human-review';
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
key, support: entries.length, precision, recall, falseKillRate, falseKeepRate,
|
|
51
|
+
uncertainRate: entries.length ? uncertain / entries.length : 0,
|
|
52
|
+
intervals,
|
|
53
|
+
disposition,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function qualifyJudge(slices, criticalSliceKeys = []) {
|
|
57
|
+
const automatedSlices = slices.filter(s => s.disposition === 'automate').map(s => s.key);
|
|
58
|
+
const humanReviewSlices = slices.filter(s => s.disposition === 'human-review').map(s => s.key);
|
|
59
|
+
const abstainSlices = slices.filter(s => s.disposition === 'abstain').map(s => s.key);
|
|
60
|
+
const presentKeys = new Set(slices.map(s => s.key));
|
|
61
|
+
const missingCriticalKeys = criticalSliceKeys.filter(key => !presentKeys.has(key));
|
|
62
|
+
const criticalFailures = slices.filter(s => criticalSliceKeys.includes(s.key) && s.disposition !== 'automate');
|
|
63
|
+
const status = criticalFailures.length > 0 || missingCriticalKeys.length > 0
|
|
64
|
+
? 'unqualified'
|
|
65
|
+
: humanReviewSlices.length > 0 || abstainSlices.length > 0
|
|
66
|
+
? 'restricted'
|
|
67
|
+
: 'qualified';
|
|
68
|
+
return {
|
|
69
|
+
status, automatedSlices, humanReviewSlices, abstainSlices,
|
|
70
|
+
reasons: [
|
|
71
|
+
...criticalFailures.map(s => `Critical slice ${s.key} is ${s.disposition}`),
|
|
72
|
+
...missingCriticalKeys.map(key => `Critical slice ${key} is missing`),
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
2
76
|
/** Run the verifier over a labeled set and report the confusion vs ground truth. */
|
|
3
|
-
export async function calibrate(labeled, opts) {
|
|
77
|
+
export async function calibrate(labeled, opts, qualificationOptions = {}) {
|
|
4
78
|
const verdicts = await adversarialVerify(labeled.map((l) => l.finding), opts);
|
|
79
|
+
const policy = { ...DEFAULT_QUALIFICATION, ...qualificationOptions };
|
|
5
80
|
const r = {
|
|
6
81
|
total: labeled.length, realCount: 0, falseCount: 0,
|
|
7
82
|
falseKill: 0, falseKillRate: 0, falseKeep: 0, falseKeepRate: 0,
|
|
8
|
-
correctConfirm: 0, correctKill: 0, uncertain: 0,
|
|
83
|
+
correctConfirm: 0, correctKill: 0, uncertain: 0, slices: [],
|
|
84
|
+
qualification: {
|
|
85
|
+
status: 'restricted', automatedSlices: [], humanReviewSlices: [],
|
|
86
|
+
abstainSlices: [], reasons: [],
|
|
87
|
+
},
|
|
9
88
|
};
|
|
10
89
|
labeled.forEach((l, i) => {
|
|
11
90
|
const v = verdicts[i].verdict;
|
|
@@ -28,6 +107,29 @@ export async function calibrate(labeled, opts) {
|
|
|
28
107
|
});
|
|
29
108
|
r.falseKillRate = r.realCount ? r.falseKill / r.realCount : 0;
|
|
30
109
|
r.falseKeepRate = r.falseCount ? r.falseKeep / r.falseCount : 0;
|
|
110
|
+
const entries = labeled.map((label, index) => ({ label, verdict: verdicts[index].verdict }));
|
|
111
|
+
const groups = new Map();
|
|
112
|
+
const add = (key, entry) => {
|
|
113
|
+
const group = groups.get(key) ?? [];
|
|
114
|
+
group.push(entry);
|
|
115
|
+
groups.set(key, group);
|
|
116
|
+
};
|
|
117
|
+
entries.forEach(entry => {
|
|
118
|
+
add('overall', entry);
|
|
119
|
+
if (entry.label.failureType)
|
|
120
|
+
add(`failureType:${entry.label.failureType}`, entry);
|
|
121
|
+
if (entry.label.domain)
|
|
122
|
+
add(`domain:${entry.label.domain}`, entry);
|
|
123
|
+
const severity = entry.label.expectedSeverity ?? entry.label.finding.severity;
|
|
124
|
+
add(`severity:${severity}`, entry);
|
|
125
|
+
});
|
|
126
|
+
const criticalKeys = policy.criticalSeverities.map(severity => `severity:${severity}`);
|
|
127
|
+
for (const key of criticalKeys) {
|
|
128
|
+
if (!groups.has(key))
|
|
129
|
+
groups.set(key, []);
|
|
130
|
+
}
|
|
131
|
+
r.slices = [...groups.entries()].map(([key, group]) => buildSlice(key, group, policy));
|
|
132
|
+
r.qualification = qualifyJudge(r.slices, criticalKeys);
|
|
31
133
|
return r;
|
|
32
134
|
}
|
|
33
135
|
//# sourceMappingURL=calibrate.js.map
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
* const verdicts = await adversarialVerify(findings, { judge, refuters: 3 });
|
|
12
12
|
* const { confirmed, killed } = partitionVerdicts(verdicts);
|
|
13
13
|
*/
|
|
14
|
-
export type { Finding, FindingVerdict, FindingSeverity, FindingOutcome, RefuterVote, Judge, AdversarialVerifyOptions, } from './types.js';
|
|
14
|
+
export type { Finding, FindingVerdict, FindingSeverity, FindingOutcome, RefuterVote, JudgeMeasurementReceipt, EndpointClass, SnapshotIdentityLevel, ReceiptSemantics, CacheStatus, Judge, AdversarialVerifyOptions, } from './types.js';
|
|
15
15
|
export { adversarialVerify, partitionVerdicts } from './verify.js';
|
|
16
16
|
export { synthesizeVerdict, majorityKill, isFindingVerdict } from './synthesize.js';
|
|
17
17
|
export { refuterPrompt, DEFAULT_LENSES } from './prompts.js';
|
|
18
|
-
export { calibrate, type LabeledFinding, type
|
|
18
|
+
export { calibrate, qualifyJudge, type CalibrationReport, type ConfidenceInterval, type JudgeQualification, type LabeledFinding, type QualificationDisposition, type QualificationOptions, type QualificationSlice, } from './calibrate.js';
|
|
19
19
|
export { verifyGate, type VerifyGateOptions, type VerifyGateResult } from './gate.js';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { adversarialVerify, partitionVerdicts } from './verify.js';
|
|
2
2
|
export { synthesizeVerdict, majorityKill, isFindingVerdict } from './synthesize.js';
|
|
3
3
|
export { refuterPrompt, DEFAULT_LENSES } from './prompts.js';
|
|
4
|
-
export { calibrate } from './calibrate.js';
|
|
4
|
+
export { calibrate, qualifyJudge, } from './calibrate.js';
|
|
5
5
|
export { verifyGate } from './gate.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JudgeMeasurementReceipt } from './types.js';
|
|
2
|
+
export type ReceiptIdentifierField = 'provider' | 'requestedModel' | 'resolvedModel' | 'fingerprint' | 'windowId' | 'requestId';
|
|
3
|
+
export declare const RECEIPT_IDENTIFIER_PATTERN = "^(?:UNKNOWN|[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,255})$";
|
|
4
|
+
export declare const RECEIPT_SENSITIVE_IDENTIFIER_PATTERN = "(?:^|[._:/@+\\-])(?:(?:[sS][kK]|[rR][kK]|[gG][hH][pPoOuUsSrR]|[gG][iI][tT][hH][uU][bB]_[pP][aA][tT]|[xX][oO][xX][bBaApPrRsS]|[nN][pP][mM]|[gG][lL][pP][aA][tT]|[pP][aA][tT])(?:[-_][A-Za-z0-9_-]*|(?=$|[.:/@+\\-]))|(?:[aA][kK][iI][aA]|[aA][sS][iI][aA]|[aA][iI][zZ][aA])[A-Za-z0-9]*)";
|
|
5
|
+
export declare const RECEIPT_JWT_PATTERN = "(?:^|[^A-Za-z0-9_-])(?:eyJ[A-Za-z0-9_-]*|e30|ew[A-Za-z0-9_-]*)\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+(?:$|[^A-Za-z0-9_-])";
|
|
6
|
+
export declare const RECEIPT_OPAQUE_DESCRIPTOR_PATTERN = "(?:^|[._:/@+\\-])[A-Za-z0-9]{32,}(?:$|[._:/@+\\-])";
|
|
7
|
+
export declare const RECEIPT_OPAQUE_CORRELATION_PATTERN = "(?:(?:^|[.:@\\-])[A-Za-z0-9+/]{32,}={0,2}(?:$|[.:@\\-])|(?:^|[.:/@+\\-])[A-Za-z0-9_-]{48,}(?:$|[.:/@+\\-]))";
|
|
8
|
+
export declare const RECEIPT_KNOWN_TIMESTAMP_PATTERN = "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{1,9})?Z$";
|
|
9
|
+
export declare function isSanitizedReceiptIdentifier(candidate: unknown, field: ReceiptIdentifierField): candidate is string;
|
|
10
|
+
export declare function isSanitizedReceiptTimestamp(candidate: unknown): candidate is string;
|
|
11
|
+
/** Convert adapter-supplied receipt evidence into the content-free public contract. */
|
|
12
|
+
export declare function sanitizeJudgeMeasurementReceipt(value: unknown): JudgeMeasurementReceipt;
|
|
13
|
+
//# sourceMappingURL=measurement-receipt.d.ts.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const ENDPOINT_CLASSES = new Set(['shared', 'dedicated', 'local', 'UNKNOWN']);
|
|
2
|
+
const SNAPSHOT_LEVELS = new Set(['L0_UNKNOWN', 'L1_NAMED', 'L2_CONTENT_BOUND']);
|
|
3
|
+
const SEMANTICS = new Set(['verified', 'provider-asserted', 'UNKNOWN']);
|
|
4
|
+
const CACHE_STATUSES = new Set(['hit', 'miss', 'bypass', 'UNKNOWN']);
|
|
5
|
+
export const RECEIPT_IDENTIFIER_PATTERN = '^(?:UNKNOWN|[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,255})$';
|
|
6
|
+
export const RECEIPT_SENSITIVE_IDENTIFIER_PATTERN = '(?:^|[._:/@+\\-])(?:(?:[sS][kK]|[rR][kK]|[gG][hH][pPoOuUsSrR]|[gG][iI][tT][hH][uU][bB]_[pP][aA][tT]|[xX][oO][xX][bBaApPrRsS]|[nN][pP][mM]|[gG][lL][pP][aA][tT]|[pP][aA][tT])(?:[-_][A-Za-z0-9_-]*|(?=$|[.:/@+\\-]))|(?:[aA][kK][iI][aA]|[aA][sS][iI][aA]|[aA][iI][zZ][aA])[A-Za-z0-9]*)';
|
|
7
|
+
export const RECEIPT_JWT_PATTERN = '(?:^|[^A-Za-z0-9_-])(?:eyJ[A-Za-z0-9_-]*|e30|ew[A-Za-z0-9_-]*)\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+(?:$|[^A-Za-z0-9_-])';
|
|
8
|
+
export const RECEIPT_OPAQUE_DESCRIPTOR_PATTERN = '(?:^|[._:/@+\\-])[A-Za-z0-9]{32,}(?:$|[._:/@+\\-])';
|
|
9
|
+
export const RECEIPT_OPAQUE_CORRELATION_PATTERN = '(?:(?:^|[.:@\\-])[A-Za-z0-9+/]{32,}={0,2}(?:$|[.:@\\-])|(?:^|[.:/@+\\-])[A-Za-z0-9_-]{48,}(?:$|[.:/@+\\-]))';
|
|
10
|
+
export const RECEIPT_KNOWN_TIMESTAMP_PATTERN = '^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{1,9})?Z$';
|
|
11
|
+
const SAFE_IDENTIFIER = new RegExp(RECEIPT_IDENTIFIER_PATTERN);
|
|
12
|
+
const SENSITIVE_IDENTIFIER = new RegExp(RECEIPT_SENSITIVE_IDENTIFIER_PATTERN);
|
|
13
|
+
const JWT = new RegExp(RECEIPT_JWT_PATTERN);
|
|
14
|
+
const OPAQUE_DESCRIPTOR = new RegExp(RECEIPT_OPAQUE_DESCRIPTOR_PATTERN);
|
|
15
|
+
const OPAQUE_CORRELATION = new RegExp(RECEIPT_OPAQUE_CORRELATION_PATTERN);
|
|
16
|
+
const KNOWN_TIMESTAMP = new RegExp(RECEIPT_KNOWN_TIMESTAMP_PATTERN);
|
|
17
|
+
const RECEIPT_HASH_FIELDS = [
|
|
18
|
+
'requestHash', 'promptHash', 'configHash', 'parserSchemaHash', 'outputHash', 'parsedVoteHash',
|
|
19
|
+
];
|
|
20
|
+
function isRecord(value) {
|
|
21
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
22
|
+
}
|
|
23
|
+
function looksLikeOpaqueCredential(value, field) {
|
|
24
|
+
if (SENSITIVE_IDENTIFIER.test(value) || JWT.test(value))
|
|
25
|
+
return true;
|
|
26
|
+
if (field === 'provider' || field === 'requestedModel' || field === 'resolvedModel') {
|
|
27
|
+
return OPAQUE_DESCRIPTOR.test(value);
|
|
28
|
+
}
|
|
29
|
+
return OPAQUE_CORRELATION.test(value);
|
|
30
|
+
}
|
|
31
|
+
export function isSanitizedReceiptIdentifier(candidate, field) {
|
|
32
|
+
return typeof candidate === 'string'
|
|
33
|
+
&& SAFE_IDENTIFIER.test(candidate)
|
|
34
|
+
&& !looksLikeOpaqueCredential(candidate, field);
|
|
35
|
+
}
|
|
36
|
+
function identifier(candidate, field) {
|
|
37
|
+
return typeof candidate === 'string'
|
|
38
|
+
&& isSanitizedReceiptIdentifier(candidate, field)
|
|
39
|
+
? candidate
|
|
40
|
+
: 'UNKNOWN';
|
|
41
|
+
}
|
|
42
|
+
export function isSanitizedReceiptTimestamp(candidate) {
|
|
43
|
+
if (candidate === 'UNKNOWN')
|
|
44
|
+
return true;
|
|
45
|
+
if (typeof candidate !== 'string' || !KNOWN_TIMESTAMP.test(candidate))
|
|
46
|
+
return false;
|
|
47
|
+
const [date] = candidate.split('T');
|
|
48
|
+
const [yearText, monthText, dayText] = date.split('-');
|
|
49
|
+
const year = Number(yearText);
|
|
50
|
+
const month = Number(monthText);
|
|
51
|
+
const day = Number(dayText);
|
|
52
|
+
const leapYear = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
53
|
+
const daysInMonth = [31, leapYear ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
54
|
+
return day <= daysInMonth[month - 1];
|
|
55
|
+
}
|
|
56
|
+
function timestamp(candidate) {
|
|
57
|
+
return isSanitizedReceiptTimestamp(candidate) ? candidate : 'UNKNOWN';
|
|
58
|
+
}
|
|
59
|
+
function hash(candidate) {
|
|
60
|
+
return typeof candidate === 'string' && /^(?:sha256:)?[a-f\d]{64}$/i.test(candidate)
|
|
61
|
+
? `sha256:${candidate.replace(/^sha256:/i, '').toLowerCase()}`
|
|
62
|
+
: 'UNKNOWN';
|
|
63
|
+
}
|
|
64
|
+
function enumOr(candidate, allowed, fallback) {
|
|
65
|
+
return typeof candidate === 'string' && allowed.has(candidate) ? candidate : fallback;
|
|
66
|
+
}
|
|
67
|
+
function finiteNonNegativeOrNull(value) {
|
|
68
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;
|
|
69
|
+
}
|
|
70
|
+
function unitOrNull(value) {
|
|
71
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 && value <= 1 ? value : null;
|
|
72
|
+
}
|
|
73
|
+
function unknownReceipt() {
|
|
74
|
+
return {
|
|
75
|
+
contract: 'judge-measurement@1',
|
|
76
|
+
provider: 'UNKNOWN', requestedModel: 'UNKNOWN', resolvedModel: 'UNKNOWN',
|
|
77
|
+
endpointClass: 'UNKNOWN', snapshotIdentity: 'L0_UNKNOWN', semantics: 'UNKNOWN',
|
|
78
|
+
fingerprint: 'UNKNOWN', requestHash: 'UNKNOWN', promptHash: 'UNKNOWN', configHash: 'UNKNOWN',
|
|
79
|
+
parserSchemaHash: 'UNKNOWN', outputHash: 'UNKNOWN', parsedVoteHash: 'UNKNOWN',
|
|
80
|
+
temperature: null, topP: null, seed: null, deterministic: null, cacheStatus: 'UNKNOWN',
|
|
81
|
+
retryCount: 0, timestamp: 'UNKNOWN', windowId: 'UNKNOWN', latencyMs: null, requestId: 'UNKNOWN',
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** Convert adapter-supplied receipt evidence into the content-free public contract. */
|
|
85
|
+
export function sanitizeJudgeMeasurementReceipt(value) {
|
|
86
|
+
if (!isRecord(value))
|
|
87
|
+
return unknownReceipt();
|
|
88
|
+
try {
|
|
89
|
+
const sanitized = {
|
|
90
|
+
contract: 'judge-measurement@1',
|
|
91
|
+
provider: identifier(value.provider, 'provider'),
|
|
92
|
+
requestedModel: identifier(value.requestedModel, 'requestedModel'),
|
|
93
|
+
resolvedModel: identifier(value.resolvedModel, 'resolvedModel'),
|
|
94
|
+
endpointClass: enumOr(value.endpointClass, ENDPOINT_CLASSES, 'UNKNOWN'),
|
|
95
|
+
snapshotIdentity: enumOr(value.snapshotIdentity, SNAPSHOT_LEVELS, 'L0_UNKNOWN'),
|
|
96
|
+
semantics: enumOr(value.semantics, SEMANTICS, 'UNKNOWN'),
|
|
97
|
+
fingerprint: identifier(value.fingerprint, 'fingerprint'),
|
|
98
|
+
requestHash: hash(value.requestHash),
|
|
99
|
+
promptHash: hash(value.promptHash),
|
|
100
|
+
configHash: hash(value.configHash),
|
|
101
|
+
parserSchemaHash: hash(value.parserSchemaHash),
|
|
102
|
+
outputHash: hash(value.outputHash),
|
|
103
|
+
parsedVoteHash: hash(value.parsedVoteHash),
|
|
104
|
+
temperature: finiteNonNegativeOrNull(value.temperature),
|
|
105
|
+
topP: unitOrNull(value.topP),
|
|
106
|
+
seed: typeof value.seed === 'number' && Number.isSafeInteger(value.seed) ? value.seed : null,
|
|
107
|
+
deterministic: typeof value.deterministic === 'boolean' ? value.deterministic : null,
|
|
108
|
+
cacheStatus: enumOr(value.cacheStatus, CACHE_STATUSES, 'UNKNOWN'),
|
|
109
|
+
retryCount: typeof value.retryCount === 'number' && Number.isSafeInteger(value.retryCount) && value.retryCount >= 0
|
|
110
|
+
? value.retryCount
|
|
111
|
+
: 0,
|
|
112
|
+
timestamp: timestamp(value.timestamp),
|
|
113
|
+
windowId: identifier(value.windowId, 'windowId'),
|
|
114
|
+
latencyMs: finiteNonNegativeOrNull(value.latencyMs),
|
|
115
|
+
requestId: identifier(value.requestId, 'requestId'),
|
|
116
|
+
};
|
|
117
|
+
const contentBound = sanitized.fingerprint !== 'UNKNOWN'
|
|
118
|
+
&& RECEIPT_HASH_FIELDS.every((field) => sanitized[field] !== 'UNKNOWN');
|
|
119
|
+
const namedSnapshot = sanitized.resolvedModel !== 'UNKNOWN';
|
|
120
|
+
if ((sanitized.snapshotIdentity === 'L2_CONTENT_BOUND' && !contentBound)
|
|
121
|
+
|| (sanitized.snapshotIdentity === 'L1_NAMED' && !namedSnapshot)) {
|
|
122
|
+
sanitized.snapshotIdentity = 'L0_UNKNOWN';
|
|
123
|
+
}
|
|
124
|
+
if (sanitized.snapshotIdentity === 'L0_UNKNOWN'
|
|
125
|
+
|| sanitized.fingerprint === 'UNKNOWN'
|
|
126
|
+
|| (sanitized.semantics === 'verified'
|
|
127
|
+
&& (sanitized.snapshotIdentity !== 'L2_CONTENT_BOUND' || !contentBound))) {
|
|
128
|
+
sanitized.semantics = 'UNKNOWN';
|
|
129
|
+
}
|
|
130
|
+
return sanitized;
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return unknownReceipt();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=measurement-receipt.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { validateFindingVerdict } from '../../contracts/verdicts.js';
|
|
2
|
+
import { sanitizeJudgeMeasurementReceipt } from './measurement-receipt.js';
|
|
1
3
|
/** Default kill threshold: simple majority of cast votes (2-of-3, 1-of-1, 2-of-2). */
|
|
2
4
|
export const majorityKill = (castVotes) => Math.ceil(castVotes / 2);
|
|
3
5
|
/**
|
|
@@ -6,6 +8,9 @@ export const majorityKill = (castVotes) => Math.ceil(castVotes / 2);
|
|
|
6
8
|
*/
|
|
7
9
|
export function synthesizeVerdict(finding, votes, killThreshold = majorityKill) {
|
|
8
10
|
const refutations = votes.filter((v) => v.refuted).map((v) => v.reasoning);
|
|
11
|
+
const measurementReceipts = votes.flatMap((v) => v.measurementReceipt
|
|
12
|
+
? [sanitizeJudgeMeasurementReceipt(v.measurementReceipt)]
|
|
13
|
+
: []);
|
|
9
14
|
const killed = votes.length > 0 && refutations.length >= killThreshold(votes.length);
|
|
10
15
|
return {
|
|
11
16
|
contract: 'finding-verdict@1',
|
|
@@ -17,19 +22,11 @@ export function synthesizeVerdict(finding, votes, killThreshold = majorityKill)
|
|
|
17
22
|
evidence: finding.evidence,
|
|
18
23
|
verdict: votes.length === 0 ? 'uncertain' : killed ? 'refuted' : 'upheld',
|
|
19
24
|
refutations,
|
|
25
|
+
...(measurementReceipts.length > 0 ? { measurementReceipts } : {}),
|
|
20
26
|
};
|
|
21
27
|
}
|
|
22
28
|
/** Runtime guard: does `x` conform to finding-verdict@1 at the boundary? */
|
|
23
29
|
export function isFindingVerdict(x) {
|
|
24
|
-
|
|
25
|
-
return false;
|
|
26
|
-
const v = x;
|
|
27
|
-
return (v.contract === 'finding-verdict@1' &&
|
|
28
|
-
typeof v.id === 'string' &&
|
|
29
|
-
typeof v.title === 'string' &&
|
|
30
|
-
typeof v.confidence === 'number' &&
|
|
31
|
-
Array.isArray(v.evidence) &&
|
|
32
|
-
Array.isArray(v.refutations) &&
|
|
33
|
-
(v.verdict === 'upheld' || v.verdict === 'refuted' || v.verdict === 'uncertain'));
|
|
30
|
+
return validateFindingVerdict(x).valid;
|
|
34
31
|
}
|
|
35
32
|
//# sourceMappingURL=synthesize.js.map
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export type FindingSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
|
|
10
10
|
export type FindingOutcome = 'upheld' | 'refuted' | 'uncertain';
|
|
11
|
+
export type EndpointClass = 'shared' | 'dedicated' | 'local' | 'UNKNOWN';
|
|
12
|
+
export type SnapshotIdentityLevel = 'L0_UNKNOWN' | 'L1_NAMED' | 'L2_CONTENT_BOUND';
|
|
13
|
+
export type ReceiptSemantics = 'verified' | 'provider-asserted' | 'UNKNOWN';
|
|
14
|
+
export type CacheStatus = 'hit' | 'miss' | 'bypass' | 'UNKNOWN';
|
|
11
15
|
/** A claim to be adversarially verified (input). */
|
|
12
16
|
export interface Finding {
|
|
13
17
|
/** Stable id; the verdict carries it verbatim (callers compose any prefix). */
|
|
@@ -23,6 +27,35 @@ export interface Finding {
|
|
|
23
27
|
export interface RefuterVote {
|
|
24
28
|
refuted: boolean;
|
|
25
29
|
reasoning: string;
|
|
30
|
+
/** Optional sanitized identity/configuration evidence supplied by a real adapter. */
|
|
31
|
+
measurementReceipt?: JudgeMeasurementReceipt;
|
|
32
|
+
}
|
|
33
|
+
/** Hash-bound, content-free evidence for one judge request and parsed vote. */
|
|
34
|
+
export interface JudgeMeasurementReceipt {
|
|
35
|
+
contract: 'judge-measurement@1';
|
|
36
|
+
provider: string;
|
|
37
|
+
requestedModel: string;
|
|
38
|
+
resolvedModel: string;
|
|
39
|
+
endpointClass: EndpointClass;
|
|
40
|
+
snapshotIdentity: SnapshotIdentityLevel;
|
|
41
|
+
semantics: ReceiptSemantics;
|
|
42
|
+
fingerprint: string;
|
|
43
|
+
requestHash: string;
|
|
44
|
+
promptHash: string;
|
|
45
|
+
configHash: string;
|
|
46
|
+
parserSchemaHash: string;
|
|
47
|
+
outputHash: string;
|
|
48
|
+
parsedVoteHash: string;
|
|
49
|
+
temperature: number | null;
|
|
50
|
+
topP: number | null;
|
|
51
|
+
seed: number | null;
|
|
52
|
+
deterministic: boolean | null;
|
|
53
|
+
cacheStatus: CacheStatus;
|
|
54
|
+
retryCount: number;
|
|
55
|
+
timestamp: string;
|
|
56
|
+
windowId: string;
|
|
57
|
+
latencyMs: number | null;
|
|
58
|
+
requestId: string;
|
|
26
59
|
}
|
|
27
60
|
/**
|
|
28
61
|
* The injected LLM refuter. Returns a vote, or `null`/throws on failure (failed
|
|
@@ -42,6 +75,8 @@ export interface FindingVerdict {
|
|
|
42
75
|
verdict: FindingOutcome;
|
|
43
76
|
/** One entry per refuter that voted to refute (empty when none). */
|
|
44
77
|
refutations: string[];
|
|
78
|
+
/** Sanitized receipts for cast votes whose adapters supplied measurement evidence. */
|
|
79
|
+
measurementReceipts?: JudgeMeasurementReceipt[];
|
|
45
80
|
}
|
|
46
81
|
export interface AdversarialVerifyOptions {
|
|
47
82
|
/** The injected LLM refuter. Required. */
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { DEFAULT_LENSES, refuterPrompt } from './prompts.js';
|
|
2
2
|
import { majorityKill, synthesizeVerdict } from './synthesize.js';
|
|
3
|
+
import { sanitizeJudgeMeasurementReceipt } from './measurement-receipt.js';
|
|
3
4
|
/** Call one refuter; a thrown/`null` result is a failed vote (excluded). */
|
|
4
5
|
async function castVote(judge, finding, lens) {
|
|
5
6
|
try {
|
|
6
7
|
const v = await judge(refuterPrompt(finding, lens));
|
|
7
|
-
return v && typeof v.refuted === 'boolean' ? {
|
|
8
|
+
return v && typeof v.refuted === 'boolean' ? {
|
|
9
|
+
refuted: v.refuted,
|
|
10
|
+
reasoning: String(v.reasoning ?? ''),
|
|
11
|
+
...(v.measurementReceipt ? { measurementReceipt: sanitizeJudgeMeasurementReceipt(v.measurementReceipt) } : {}),
|
|
12
|
+
} : null;
|
|
8
13
|
}
|
|
9
14
|
catch {
|
|
10
15
|
return null;
|