@testmuai/kane-cli 0.8.23 → 0.10.0-rc.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/dist/ChatSurface-VPD5G67Q.js +2 -0
- package/dist/ChromeProfilePicker-CRKQEFYD.js +2 -0
- package/dist/CliFeedbackPrompt-M7BMWLKK.js +2 -0
- package/dist/CliUploadProgress-OP7DXMC2.js +2 -0
- package/dist/ConfigView-XI74BCCH.js +2 -0
- package/dist/EvidenceViewOffer-HAAK6DS5.js +2 -0
- package/dist/FolderPicker-W5S6RFCP.js +2 -0
- package/dist/InfoBox-OWUEHV2D.js +2 -0
- package/dist/LinksBox-PNSESNCU.js +2 -0
- package/dist/ProfilesView-PYDZZHKO.js +2 -0
- package/dist/ProjectPicker-BGFCUGT5.js +2 -0
- package/dist/SaveSessionPrompt-SUJE54GS.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-4TDXZEUA.js +2 -0
- package/dist/SummaryBox-FALOODAQ.js +2 -0
- package/dist/TestMdRunView-4GPRWHEU.js +2 -0
- package/dist/TestrunEvidenceTable-OBVQJ6IO.js +2 -0
- package/dist/WhoamiView-6WXGRANY.js +2 -0
- package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
- package/dist/app-client-U2YYF65L.js +2 -0
- package/dist/app-download-RXVZB6MM.js +2 -0
- package/dist/assurance-job-C3TXZGLL.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-MOJTQGUV.js → binary-DJCDMGPX.js} +1 -1
- package/dist/bind-XVO4CQYV.js +2 -0
- package/dist/bootstrap-TY5RANJ7.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-RRQF4TCA.js +2 -0
- package/dist/{changelog-2N6HKKKQ.js → changelog-GBEVIUFJ.js} +1 -1
- package/dist/chat-committer-ZCSRJEUB.js +2 -0
- package/dist/chat-controller-XINCDH6Z.js +2 -0
- package/dist/child-G2GCW73X.js +2 -0
- package/dist/chunk-22PIMG52.js +2 -0
- package/dist/chunk-252FWF2G.js +19 -0
- package/dist/{chunk-AT3RME5W.js → chunk-2IZRPMZN.js} +1 -1
- package/dist/chunk-2NFS4KE4.js +2 -0
- package/dist/{chunk-LHUW5QDT.js → chunk-2OOFURWD.js} +1 -1
- package/dist/chunk-2OSFI33O.js +97 -0
- package/dist/chunk-2S3W2JT3.js +5 -0
- package/dist/chunk-2SWSVJUP.js +12 -0
- package/dist/chunk-2TVPA3LL.js +2 -0
- package/dist/chunk-2XW33VOK.js +2 -0
- package/dist/chunk-33DWJV67.js +235 -0
- package/dist/chunk-34R7BNZ2.js +2 -0
- package/dist/chunk-35ECWCCK.js +2 -0
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3G2LSTK5.js +2 -0
- package/dist/chunk-3GXN6VF6.js +2 -0
- package/dist/chunk-3JLEDSG5.js +4 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3UVSAAES.js +10 -0
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-432ZOE42.js +21 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/{chunk-J2FJ62K4.js → chunk-4D5PC6QE.js} +1 -1
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/{chunk-SYJXTB4J.js → chunk-4LPX2OLV.js} +1 -1
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-57MDWTON.js +2 -0
- package/dist/{chunk-3C32LVLX.js → chunk-5BUIIFLC.js} +1 -1
- package/dist/chunk-5D7ENQTQ.js +2 -0
- package/dist/chunk-63EKRZKI.js +2 -0
- package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
- package/dist/chunk-672CQECV.js +47 -0
- package/dist/chunk-6LIC2R22.js +3 -0
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6NWT2TEJ.js +2 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/{chunk-MBJHS653.js → chunk-6U7ID777.js} +1 -1
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-74W4AOT2.js +2 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7EXDYXXD.js +2 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/chunk-7LKCWO2R.js +11 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/chunk-7RPKHKA3.js +2 -0
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/chunk-A6TJOZ24.js +2 -0
- package/dist/chunk-A7RJQJNT.js +2 -0
- package/dist/chunk-AA674WLL.js +2 -0
- package/dist/chunk-AIXJYMSP.js +9 -0
- package/dist/chunk-AJQZ3ST5.js +8 -0
- package/dist/chunk-AQ2OG2EF.js +2 -0
- package/dist/chunk-AUJSC7PU.js +4 -0
- package/dist/chunk-AVI5H4UM.js +13 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/chunk-B2HXPGIZ.js +26 -0
- package/dist/chunk-B7ZX5HEN.js +8 -0
- package/dist/{chunk-XQQHSC7G.js → chunk-BJJUKB5K.js} +1 -1
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/{chunk-TONFENRW.js → chunk-BVO4C5F2.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-BZVNI44O.js +6 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/chunk-CPBBYNL7.js +4 -0
- package/dist/{chunk-GFNCGN5V.js → chunk-D4FFXCX6.js} +2 -2
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DD5TULWQ.js +34 -0
- package/dist/{chunk-SY4T44VC.js → chunk-DDJNYQBH.js} +1 -1
- package/dist/{chunk-KJIDMW6N.js → chunk-DHQ4SQWA.js} +1 -1
- package/dist/chunk-DNGOT65K.js +3 -0
- package/dist/chunk-DPGOAFKF.js +2 -0
- package/dist/chunk-DREQ3RAA.js +2 -0
- package/dist/chunk-DTUPEKEO.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ENL4XTQ2.js +2 -0
- package/dist/chunk-EXFDIVNI.js +9 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/chunk-F3U6T4YD.js +22 -0
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FFL55I2M.js +2 -0
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GZFLJORM.js +2 -0
- package/dist/{chunk-PXHN7SFG.js → chunk-H3HHSTEK.js} +4 -4
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HFJSP4KD.js +2 -0
- package/dist/chunk-HHW6MRU3.js +6 -0
- package/dist/chunk-HIUAUZNL.js +2 -0
- package/dist/chunk-HJLMH7ZM.js +2 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/chunk-I2KOGINW.js +7 -0
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I5NSJBOZ.js +2 -0
- package/dist/chunk-I6OQISK4.js +2 -0
- package/dist/chunk-IBBD36FQ.js +2 -0
- package/dist/chunk-IINZZ4BZ.js +2 -0
- package/dist/{chunk-UYI4WPNQ.js → chunk-IMDMRJQ6.js} +2 -2
- package/dist/chunk-IXW7FOGX.js +2 -0
- package/dist/chunk-IZ65ZPWY.js +3 -0
- package/dist/chunk-JD52IXON.js +9 -0
- package/dist/chunk-JGRXMTME.js +15 -0
- package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
- package/dist/chunk-JNSWKGTB.js +2 -0
- package/dist/chunk-JPYW6U4D.js +2 -0
- package/dist/chunk-JQSLUGD4.js +3 -0
- package/dist/chunk-K45BKGB5.js +8 -0
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/chunk-L4UVUFL6.js +3 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/chunk-LNNWCBPQ.js +2 -0
- package/dist/chunk-LRS5MGBY.js +3 -0
- package/dist/chunk-LRXBJTD4.js +4 -0
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/chunk-LWJRSUE2.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-K6VDRR3H.js → chunk-M6MBMRFR.js} +1 -1
- package/dist/chunk-MGNRNLBE.js +2 -0
- package/dist/chunk-MII3JOO3.js +4 -0
- package/dist/chunk-MNBGG4H3.js +16 -0
- package/dist/chunk-MYVKUJGS.js +2 -0
- package/dist/chunk-MYZHOBS4.js +2 -0
- package/dist/chunk-MZOIHUVX.js +27 -0
- package/dist/{chunk-OFRYEWZE.js → chunk-N3TCNZSX.js} +1 -1
- package/dist/chunk-NC7D7GOM.js +21 -0
- package/dist/{chunk-CLQP3DHT.js → chunk-NDEI7R4K.js} +1 -1
- package/dist/chunk-NFRA64NU.js +10 -0
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-5HOHXV2K.js → chunk-NQTYWHPB.js} +1 -1
- package/dist/chunk-NWBLYMH7.js +3 -0
- package/dist/chunk-NWD54VV5.js +2 -0
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/{chunk-FPFS6OSR.js → chunk-OAKYUBD3.js} +1 -1
- package/dist/chunk-OEWYXCTA.js +7 -0
- package/dist/{chunk-BASTDR3M.js → chunk-OF7WPCTQ.js} +1 -1
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-OQ5G773E.js +2 -0
- package/dist/chunk-OVNRRI4E.js +2 -0
- package/dist/{chunk-RAARDC2O.js → chunk-OZNBTSW5.js} +1 -1
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/chunk-P7MSVLAH.js +6 -0
- package/dist/chunk-PUVMC4PX.js +26 -0
- package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
- package/dist/chunk-Q3C6NDGI.js +2 -0
- package/dist/chunk-QCKA665H.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/chunk-QHRUBG7J.js +2 -0
- package/dist/chunk-QI5RZ7LL.js +2 -0
- package/dist/chunk-QNLVC5ZB.js +2 -0
- package/dist/{chunk-DSKJ6J7Y.js → chunk-QQ4TKLWP.js} +1 -1
- package/dist/chunk-QS5ZJFGF.js +4 -0
- package/dist/chunk-QTZBVDPR.js +12 -0
- package/dist/chunk-QXQ7KVEN.js +2 -0
- package/dist/chunk-R4JUKTDO.js +2 -0
- package/dist/chunk-R7KXAISS.js +12 -0
- package/dist/chunk-RDP7GWSY.js +2 -0
- package/dist/chunk-REKHAN53.js +5 -0
- package/dist/{chunk-5RHR4DMF.js → chunk-RFEON5GN.js} +1 -1
- package/dist/chunk-RFIIM33J.js +2 -0
- package/dist/chunk-RG372DON.js +6 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/chunk-RW3Z2HMB.js +7 -0
- package/dist/chunk-RX47NRSM.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/chunk-S53AQU7R.js +6 -0
- package/dist/{chunk-HJX5PQRD.js → chunk-SA6IKFFD.js} +1 -1
- package/dist/{chunk-2MEQTHNI.js → chunk-SLKYD44Y.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/chunk-SONMD3W5.js +5 -0
- package/dist/chunk-SWMTXMKB.js +2 -0
- package/dist/chunk-SXRHKXSE.js +2 -0
- package/dist/chunk-T3HEJASG.js +5 -0
- package/dist/chunk-T4AVLJCW.js +6 -0
- package/dist/{chunk-J6TBTWW7.js → chunk-T6K2MEWP.js} +1 -1
- package/dist/{chunk-D6BULK7E.js → chunk-T7H4LBFK.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TW63WWEN.js +2 -0
- package/dist/chunk-UALJTPSA.js +18 -0
- package/dist/chunk-UAWWLLTI.js +2 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-UTM7D4PI.js +2 -0
- package/dist/chunk-UUJIGOEO.js +2 -0
- package/dist/chunk-UYDHOHSZ.js +2 -0
- package/dist/chunk-V5JGXOV7.js +2 -0
- package/dist/chunk-V7S6S5W3.js +2 -0
- package/dist/{chunk-HBSYBL6J.js → chunk-VG44B5JD.js} +1 -1
- package/dist/chunk-VJGWVBZR.js +1 -0
- package/dist/chunk-VLDCHFXF.js +2 -0
- package/dist/chunk-VO66KP2W.js +2 -0
- package/dist/{chunk-D4XR7EEQ.js → chunk-VQLH63X7.js} +14 -12
- package/dist/chunk-VRIZDOO5.js +2 -0
- package/dist/chunk-VYHT2IET.js +1397 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/chunk-W3OVSDBN.js +29 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/{chunk-IEW7AW64.js → chunk-WEM3MOAL.js} +1 -1
- package/dist/chunk-WI7K6VKQ.js +2 -0
- package/dist/chunk-WMGKUERB.js +6 -0
- package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
- package/dist/chunk-WOSANGV6.js +5 -0
- package/dist/chunk-WYSZ6TPW.js +15 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-5ESGUPSR.js → chunk-XBEYWXPV.js} +1 -1
- package/dist/chunk-XIPKSXRQ.js +16 -0
- package/dist/chunk-XJ7HCXKW.js +2 -0
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/chunk-Y4T4SLDO.js +2 -0
- package/dist/chunk-Y6Y6RAY4.js +2 -0
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZCRZFAOT.js +2 -0
- package/dist/chunk-ZFM77AQU.js +2 -0
- package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
- package/dist/chunk-ZHWU6L2G.js +5 -0
- package/dist/chunk-ZTHYAHDN.js +17 -0
- package/dist/chunk-ZZP5SHUV.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-5ZOALGKE.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-UA2SVIZZ.js +2 -0
- package/dist/{credentials-PSQWWFGD.js → credentials-MRG452Y6.js} +1 -1
- package/dist/{deps-bundle-PPOQHJTB.js → deps-bundle-FWINW4XM.js} +1 -1
- package/dist/{deps-resolve-AX6ZAKLH.js → deps-resolve-IET4KIBO.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-MM5PJD2N.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-FZONCKHW.js +2 -0
- package/dist/design-remote-SPVRIY2H.js +3 -0
- package/dist/device-env-LXJ65AVF.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-VAX2BWQF.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-LVVK7ROT.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-AGRKG7T3.js +2 -0
- package/dist/evolve-remote-BGHULJTL.js +2 -0
- package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
- package/dist/explain-DGJ5T6V5.js +2 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explain-cmd-WOBGS6KX.js +12 -0
- package/dist/explore-LOKNOVNP.js +2 -0
- package/dist/explore-context-tty-JTZVZFOE.js +2 -0
- package/dist/explore-entry-5OGNLFAU.js +6 -0
- package/dist/explore-live-2XZHUYFS.js +5 -0
- package/dist/explore-run-tty-LGTIK2NA.js +5 -0
- package/dist/extract-bind-NM2BBK4I.js +14 -0
- package/dist/extract-chat-HLQMJJIC.js +2 -0
- package/dist/extract-cmd-T2TSAC3N.js +6 -0
- package/dist/extract-headless-OQTQ3FJK.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-WXUR6OPJ.js +2 -0
- package/dist/gaps-cmd-PTSKPTF7.js +3 -0
- package/dist/gate-P57VP4E5.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-TEDHS3F2.js → generate-headless-JYZP6VXZ.js} +3 -3
- package/dist/headless-io-FFM5T6KL.js +2 -0
- package/dist/hold-passthrough-IOWPVB4W.js +2 -0
- package/dist/identity-HL5CJJXR.js +2 -0
- package/dist/index.js +194 -175
- package/dist/ingest-PDGS5ZTL.js +2 -0
- package/dist/ingest-cmd-LHCBMO4Z.js +8 -0
- package/dist/ingest-remote-D5TO5JQP.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-Z6K2D2VY.js +2 -0
- package/dist/interactive-bind-5EJQUGKI.js +26 -0
- package/dist/interactive-remote-D77ULJGL.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-74XGF77Y.js +2 -0
- package/dist/lifecycle-cmd-7SM6UCMH.js +2 -0
- package/dist/list-cmd-Z6FZXMFU.js +3 -0
- package/dist/list-commands-CZYZ7GIG.js +2 -0
- package/dist/list-remote-WOPOC6KK.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-2FZEOVHM.js +2 -0
- package/dist/maintenance-cmd-VRTGZVRE.js +2 -0
- package/dist/mobile-prompts-KNAHU64X.js +2 -0
- package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
- package/dist/{objective-variable-gate-JALOH6SL.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
- package/dist/onboarding-LGT6PMDZ.js +5 -0
- package/dist/open-provider-OZAG6WZS.js +2 -0
- package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
- package/dist/pdf-convert-447ACUB3.js +2 -0
- package/dist/persist-recorded-session-BX7II5P7.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-IXVTVRS5.js +2 -0
- package/dist/prepare-target-ULMKVKMC.js +2 -0
- package/dist/pull-cmd-6AL2WYHB.js +2 -0
- package/dist/pull-route-TTVARJMV.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-2LFS5WE2.js +2 -0
- package/dist/reconcile-cmd-R6H37SQR.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-GWDV5CUT.js +13 -0
- package/dist/recording-banner-ACC67Q2U.js +2 -0
- package/dist/registry-6IJYQXQC.js +2 -0
- package/dist/remote-entry-YL7O2NJQ.js +2 -0
- package/dist/remote-mode-7G6PLJCW.js +4 -0
- package/dist/remote-words-45USLRVN.js +2 -0
- package/dist/require-project-folder-A3UDRELU.js +2 -0
- package/dist/resolve-run-intent-ZGPSUBXV.js +2 -0
- package/dist/resolver-IPM6R7U4.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-NNT5C5RZ.js +5 -0
- package/dist/run-5RQUCNYP.js +2 -0
- package/dist/run-PC5YO4AS.js +2 -0
- package/dist/run-channel-63SVP5OI.js +2 -0
- package/dist/run-remote-3AYYVPKX.js +2 -0
- package/dist/run-startup-gate-NKRMKYBB.js +2 -0
- package/dist/run-test-md-HE6DUWQR.js +17 -0
- package/dist/scrollback-GGNBDFQV.js +2 -0
- package/dist/session-target-DD53UXO7.js +2 -0
- package/dist/session-worker.js +12 -0
- package/dist/sessions-CFV7FOIT.js +2 -0
- package/dist/sessions-cmd-GYMETJHG.js +26 -0
- package/dist/sessions-remote-GI7GOBMH.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-T2IOCPET.js → skill-installer-3QAVQGDH.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-X6XPFSKF.js +2 -0
- package/dist/store-choice-RT73HAI7.js +2 -0
- package/dist/store-guard-SNWKLHQV.js +2 -0
- package/dist/store-id-YZ5WKJ25.js +2 -0
- package/dist/store-site-KA2DNBGY.js +2 -0
- package/dist/stream-warnings-GEQKKJU7.js +2 -0
- package/dist/structured-answers-EQ2AP3F7.js +2 -0
- package/dist/sync-cmd-NBPPDG3B.js +2 -0
- package/dist/sync-setup-5NUCH6N3.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-Z23CUISY.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-GH5BW5V5.js +2 -0
- package/dist/testmd-sync-ACKCIOL3.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-4UCYAG6A.js +2 -0
- package/dist/trust-gate-AT2XBWN4.js +2 -0
- package/dist/turn-preflight-LHYLRL7G.js +2 -0
- package/dist/ui-SNV3FD2G.js +4 -0
- package/dist/use-case-ref-NE4X4MZN.js +2 -0
- package/dist/validate-basic-RE2WLIGQ.js +2 -0
- package/dist/{variable-receipt-F55CSW5Z.js → variable-receipt-BXSZO36E.js} +1 -1
- package/dist/verdicts-XK3GAUX3.js +2 -0
- package/dist/version-check-4FJVZP3K.js +2 -0
- package/dist/{view-cmd-ELDKYRMZ.js → view-cmd-N47BQZPD.js} +4 -3
- package/dist/walk-session-DA7QWXSW.js +2 -0
- package/dist/with-telemetry-7V4LY2BG.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-GBZX4LWL.js +0 -8
- package/dist/ChromeProfilePicker-UONX2UVC.js +0 -2
- package/dist/CliFeedbackPrompt-6BJCNRNG.js +0 -2
- package/dist/CliUploadProgress-K4Z22DSY.js +0 -2
- package/dist/ConfigView-BB22G7JO.js +0 -2
- package/dist/EvidenceViewOffer-25IQF3TX.js +0 -2
- package/dist/FolderPicker-65JFR2NW.js +0 -2
- package/dist/InfoBox-OU5PLRIL.js +0 -2
- package/dist/LinksBox-DH7TSUXW.js +0 -2
- package/dist/ProfilesView-MGJKBOF5.js +0 -2
- package/dist/ProjectPicker-YFV6K77F.js +0 -2
- package/dist/SaveSessionPrompt-64QKQB6B.js +0 -2
- package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
- package/dist/SingleShotApp-VYKUCRVW.js +0 -2
- package/dist/SummaryBox-DGS3LVRF.js +0 -2
- package/dist/TestMdRunView-LKAITAA4.js +0 -2
- package/dist/TestrunEvidenceTable-PHBAB4XQ.js +0 -2
- package/dist/WhoamiView-6HWPYN6Y.js +0 -2
- package/dist/app-client-ZCCNE3RV.js +0 -2
- package/dist/app-download-SQ2LYYL7.js +0 -2
- package/dist/auth-NWBIFCB7.js +0 -2
- package/dist/bind-S3IQTPNN.js +0 -15
- package/dist/bootstrap-RCV7PNMQ.js +0 -2
- package/dist/bridge-O7ENTV4K.js +0 -2
- package/dist/build-JIKYOZUH.js +0 -2
- package/dist/chat-committer-6D7AQI6Z.js +0 -2
- package/dist/chat-controller-UJQ6Z4RE.js +0 -2
- package/dist/chunk-2A7OQRAD.js +0 -17
- package/dist/chunk-2FH4HJYB.js +0 -5
- package/dist/chunk-2KVECC36.js +0 -2
- package/dist/chunk-2YEHV2CX.js +0 -2
- package/dist/chunk-3OKX64UR.js +0 -2
- package/dist/chunk-3UI5VTQS.js +0 -4
- package/dist/chunk-3UMVRJX3.js +0 -6
- package/dist/chunk-3VAU3PNU.js +0 -2
- package/dist/chunk-5EOX4MEY.js +0 -2
- package/dist/chunk-5LJRZI7S.js +0 -6
- package/dist/chunk-5UHY3PTQ.js +0 -3
- package/dist/chunk-5ZFOKYFB.js +0 -5
- package/dist/chunk-63DYVWNX.js +0 -2
- package/dist/chunk-6YZ3VP3E.js +0 -2
- package/dist/chunk-7KRY26OF.js +0 -4
- package/dist/chunk-7N6OCHPC.js +0 -7
- package/dist/chunk-A2SQD2AY.js +0 -4
- package/dist/chunk-AACQE24F.js +0 -2
- package/dist/chunk-AGDPEZXT.js +0 -4
- package/dist/chunk-AIK7BAME.js +0 -8
- package/dist/chunk-ATYXPCM6.js +0 -6
- package/dist/chunk-AXTPNZPX.js +0 -2
- package/dist/chunk-BB2W35TW.js +0 -2
- package/dist/chunk-BKM2LWU2.js +0 -3
- package/dist/chunk-BL5QHONU.js +0 -2
- package/dist/chunk-C44QQJR4.js +0 -239
- package/dist/chunk-C7NWWGLT.js +0 -6
- package/dist/chunk-CAJZQQ3G.js +0 -3
- package/dist/chunk-CSVPZ33X.js +0 -2
- package/dist/chunk-CXF6AZWY.js +0 -2
- package/dist/chunk-D6E6KRVX.js +0 -2
- package/dist/chunk-D7WG7SRA.js +0 -2
- package/dist/chunk-DDHGEJJP.js +0 -2
- package/dist/chunk-DUYRCVI5.js +0 -2
- package/dist/chunk-DWHF5HUD.js +0 -2
- package/dist/chunk-EM3PU2YW.js +0 -2
- package/dist/chunk-EVFFDODK.js +0 -5
- package/dist/chunk-EYOCNMUM.js +0 -2
- package/dist/chunk-F2OBORCG.js +0 -2
- package/dist/chunk-FMBPUXWL.js +0 -8
- package/dist/chunk-FORNRNHU.js +0 -2
- package/dist/chunk-FQJOWUEN.js +0 -2
- package/dist/chunk-FQNQVC5O.js +0 -5
- package/dist/chunk-FY7TCYPK.js +0 -6
- package/dist/chunk-HJGVM6TS.js +0 -370
- package/dist/chunk-HPHETGRE.js +0 -2
- package/dist/chunk-I7TIGB7K.js +0 -2
- package/dist/chunk-IGHK2ENL.js +0 -2
- package/dist/chunk-IICT4VOU.js +0 -2
- package/dist/chunk-IIDBLJ5A.js +0 -18
- package/dist/chunk-JFZA4UON.js +0 -9
- package/dist/chunk-K2UJYY2U.js +0 -2
- package/dist/chunk-KBM3XHAM.js +0 -2
- package/dist/chunk-KDNNMU7Q.js +0 -4
- package/dist/chunk-KJQNAOOE.js +0 -6
- package/dist/chunk-LF42V6P6.js +0 -7
- package/dist/chunk-LNFU4JZ7.js +0 -2
- package/dist/chunk-LNSBC32V.js +0 -2
- package/dist/chunk-LSDWPG6C.js +0 -2
- package/dist/chunk-MKMJOMLX.js +0 -8
- package/dist/chunk-MKQ7ZRDW.js +0 -2
- package/dist/chunk-MSGW4JDG.js +0 -2
- package/dist/chunk-MV3Q335C.js +0 -7
- package/dist/chunk-MWIE6LOZ.js +0 -4
- package/dist/chunk-MZ7W4WLF.js +0 -4
- package/dist/chunk-NIFJJX6N.js +0 -12
- package/dist/chunk-NJ4BXZBX.js +0 -2
- package/dist/chunk-NLCCBXXV.js +0 -2
- package/dist/chunk-ODU2JSMA.js +0 -8
- package/dist/chunk-OYKRCDT4.js +0 -15
- package/dist/chunk-Q2F5QB2W.js +0 -2
- package/dist/chunk-Q4YYAN6E.js +0 -2
- package/dist/chunk-Q6AHSGOE.js +0 -5
- package/dist/chunk-QAG67DUT.js +0 -2
- package/dist/chunk-QGXVQIN5.js +0 -27
- package/dist/chunk-QQCEP3QP.js +0 -2
- package/dist/chunk-QU7P7B3W.js +0 -4
- package/dist/chunk-RAPV3BTA.js +0 -98
- package/dist/chunk-RD72POF2.js +0 -2
- package/dist/chunk-RDHWNSDP.js +0 -7
- package/dist/chunk-RGRFL7XG.js +0 -29
- package/dist/chunk-RKXHVP2Z.js +0 -2
- package/dist/chunk-RMVASIVL.js +0 -35
- package/dist/chunk-RRY5IXOB.js +0 -2
- package/dist/chunk-RSSOJ3L2.js +0 -21
- package/dist/chunk-SB2SKN34.js +0 -2
- package/dist/chunk-SFFDVF3J.js +0 -9
- package/dist/chunk-T2ONUKTL.js +0 -5
- package/dist/chunk-TAOHYWEO.js +0 -2
- package/dist/chunk-U6OTFMIT.js +0 -4
- package/dist/chunk-UD7KKHPW.js +0 -5
- package/dist/chunk-UF4MU2AZ.js +0 -22
- package/dist/chunk-UQSVO7TY.js +0 -9
- package/dist/chunk-URWWROLS.js +0 -9
- package/dist/chunk-V4B5QA3U.js +0 -4
- package/dist/chunk-VACHFCNC.js +0 -21
- package/dist/chunk-VAN7ECN6.js +0 -2
- package/dist/chunk-VIO7CCFW.js +0 -5
- package/dist/chunk-VOYMN2WQ.js +0 -5
- package/dist/chunk-VVOKM2VO.js +0 -2
- package/dist/chunk-W5TTF7GB.js +0 -6
- package/dist/chunk-WESMQEPO.js +0 -2
- package/dist/chunk-WICJY6KL.js +0 -6
- package/dist/chunk-WJR2FU7S.js +0 -16
- package/dist/chunk-WVHMPIDQ.js +0 -2
- package/dist/chunk-X4NUVVCJ.js +0 -26
- package/dist/chunk-XLSOQLVT.js +0 -2
- package/dist/chunk-YCCUBQY4.js +0 -2
- package/dist/chunk-YFQGOOF7.js +0 -2
- package/dist/chunk-YI3H2UIB.js +0 -2
- package/dist/chunk-YKTYVJBN.js +0 -3
- package/dist/chunk-YLQHY4A7.js +0 -2
- package/dist/chunk-ZIHG6EKH.js +0 -2
- package/dist/chunk-ZKSN2SJ7.js +0 -2
- package/dist/chunk-ZLWURCJ7.js +0 -2
- package/dist/committer-2QPBANRD.js +0 -2
- package/dist/config-7E4NS553.js +0 -2
- package/dist/controller-client-ZF5IXRUV.js +0 -2
- package/dist/cover-cmd-6KZX46S2.js +0 -3
- package/dist/descriptor-3JJUOHBM.js +0 -2
- package/dist/design-committer-D44GSUXY.js +0 -2
- package/dist/device-env-TZQDB5T3.js +0 -2
- package/dist/dispatch-KMWEDMKE.js +0 -2
- package/dist/doctor-XDF3MA4W.js +0 -2
- package/dist/docx-convert-SQRTF7XS.js +0 -2
- package/dist/evidence-EUIDOVOR.js +0 -2
- package/dist/evidence-presentation-XF23B7F2.js +0 -2
- package/dist/evolve-cmd-QVTGTCJ5.js +0 -2
- package/dist/explain-NEFBUX5G.js +0 -2
- package/dist/explain-cmd-36SVSHU7.js +0 -9
- package/dist/explain-cmd-JAOHSI4F.js +0 -3
- package/dist/extract-bind-PLMSZKLZ.js +0 -14
- package/dist/extract-cmd-RJBHPPF3.js +0 -5
- package/dist/feeder-66TUPB2R.js +0 -2
- package/dist/gaps-cmd-3WZPDDYS.js +0 -3
- package/dist/gate-OYRDJMF6.js +0 -2
- package/dist/headless-io-75HUMWZB.js +0 -2
- package/dist/identity-ADZ4PAJF.js +0 -2
- package/dist/ingest-OSNNM3DH.js +0 -2
- package/dist/ingest-cmd-JDIOPJBN.js +0 -2
- package/dist/install-Y3VKFBK3.js +0 -2
- package/dist/interactive-bind-XUMKEGAN.js +0 -26
- package/dist/interrupt-guard-UREUWNRL.js +0 -2
- package/dist/lifecycle-cmd-FBDRFIOE.js +0 -2
- package/dist/list-cmd-TFUACRAM.js +0 -3
- package/dist/list-commands-OHIQFJGQ.js +0 -2
- package/dist/locks-cmd-67OHQZNV.js +0 -2
- package/dist/logical-ids-GLVM2SVR.js +0 -2
- package/dist/login-flow-OHNKSVYZ.js +0 -2
- package/dist/maintenance-cmd-7OSUIDL4.js +0 -2
- package/dist/mobile-prompts-DEVUZRG3.js +0 -2
- package/dist/open-provider-746LLSEO.js +0 -2
- package/dist/pdf-convert-RLXSXFWN.js +0 -2
- package/dist/persist-recorded-session-GPP6UKN6.js +0 -3
- package/dist/phase-seed-MKHEWUN6.js +0 -2
- package/dist/pipeline-QPTPZVUJ.js +0 -2
- package/dist/prepare-target-N7QRNYOS.js +0 -2
- package/dist/readmodel-FVLRQWZ7.js +0 -2
- package/dist/reconcile-cmd-SMGLHMLF.js +0 -2
- package/dist/reconcile-deps-DVIJK5UZ.js +0 -4
- package/dist/reconcile-engine-KL2J5SNQ.js +0 -2
- package/dist/recording-banner-TCFFB6KE.js +0 -2
- package/dist/records-LMCVKPE5.js +0 -2
- package/dist/registry-BFFA4YJK.js +0 -2
- package/dist/require-project-folder-2224ZMJ5.js +0 -2
- package/dist/resolve-run-intent-HFXGEOYK.js +0 -2
- package/dist/resolver-GJR2Z7JY.js +0 -2
- package/dist/revert-NOUECRW4.js +0 -2
- package/dist/review-cmd-CQE6SBZA.js +0 -5
- package/dist/run-BXKWDJFJ.js +0 -2
- package/dist/run-HSP2MZPU.js +0 -2
- package/dist/run-channel-RGH4WIQX.js +0 -2
- package/dist/run-test-md-2ELPAASM.js +0 -17
- package/dist/scrollback-JLPJR25X.js +0 -2
- package/dist/session-items-2ATN7VXG.js +0 -2
- package/dist/session-target-UWROGOCY.js +0 -2
- package/dist/sessions-NH7WQWMX.js +0 -2
- package/dist/sessions-cmd-IV25N2L7.js +0 -25
- package/dist/spawner-HQM2757J.js +0 -2
- package/dist/store-guard-NAW26EEQ.js +0 -2
- package/dist/store-id-EOSGEKVK.js +0 -2
- package/dist/structured-answers-ZI2B6JJE.js +0 -2
- package/dist/sync-cmd-Q6ZYEVWI.js +0 -2
- package/dist/sync-setup-CA362C5S.js +0 -2
- package/dist/tcg-generate-CDB2N5LD.js +0 -2
- package/dist/testmd-actions-BDWDE2TG.js +0 -2
- package/dist/testmd-sync-EPTUVJYJ.js +0 -2
- package/dist/tms-client-KU6HCA23.js +0 -2
- package/dist/token-refresh-TKBOHXSD.js +0 -2
- package/dist/trust-gate-EX7R2P4Y.js +0 -2
- package/dist/turn-preflight-JGYT7LXP.js +0 -2
- package/dist/ui-JEJGTURD.js +0 -4
- package/dist/validate-basic-V7R4RH5M.js +0 -2
- package/dist/verdicts-7IUZFXB4.js +0 -2
- package/dist/version-check-PUUSB7AY.js +0 -2
- package/dist/walk-session-EGIMA4VG.js +0 -2
- package/dist/with-telemetry-LRWWBISP.js +0 -2
- /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
- /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
- /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
- /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
- /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
- /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
- /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
- /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
- /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
- /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
package/dist/chunk-HJGVM6TS.js
DELETED
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ot}from"./chunk-ZKSN2SJ7.js";import{a as at,b as _e}from"./chunk-EVFFDODK.js";import{a as X,b as Je,e as fe,f as he,g as Xe,h as nt}from"./chunk-UQSVO7TY.js";import{a as Ye,c as et,d as tt,e as be,f as st}from"./chunk-D7WG7SRA.js";import{a as ze,b as We,c as Ke}from"./chunk-CAJZQQ3G.js";import{a as Ve,b as Ue,c as He}from"./chunk-BB2W35TW.js";import{a as ge}from"./chunk-U6OTFMIT.js";import{c as Qe}from"./chunk-V4B5QA3U.js";import{a as Ge,e as Fe}from"./chunk-FY7TCYPK.js";import{a as Ze}from"./chunk-63DYVWNX.js";import{a as it,b as rt}from"./chunk-LSDWPG6C.js";import{a as qe}from"./chunk-Q2F5QB2W.js";import{b as je}from"./chunk-DWHF5HUD.js";import{q as Le}from"./chunk-RMVASIVL.js";import{b as $e,c as Ee,e as Re,f as Ce,g as Ae,h as me,k as ue,l as pe}from"./chunk-RGRFL7XG.js";import{z as V}from"./chunk-IICT4VOU.js";import{b as Me,c as Be,f as oe}from"./chunk-YI3H2UIB.js";import{d as De}from"./chunk-ODU2JSMA.js";import{b as le}from"./chunk-VZ7KXRXB.js";import{a as xe,c as de}from"./chunk-5LJRZI7S.js";import{H as Ne}from"./chunk-RDHWNSDP.js";import{a as Ie,f as Oe,g as Pe}from"./chunk-FQNQVC5O.js";import{d as ae,e as Te,f as U,g as W}from"./chunk-XLSOQLVT.js";import{a as Se}from"./chunk-5EOX4MEY.js";import{mkdirSync as Wt,appendFileSync as Kt,rmdirSync as Et}from"fs";import{randomBytes as Qt}from"crypto";import{dirname as ce,join as ke,relative as Yt}from"path";function ct(t,e){let i=[];for(let n of e??[]){let c=t.resolve(n.ref)?.tip??null;c!==n.cid&&i.push({ref:n.ref,pinned:n.cid,now:c})}return i}import{existsSync as ye,readFileSync as ve,readdirSync as Tt}from"fs";import{join as se}from"path";var lt=`
|
|
3
|
-
version: 1
|
|
4
|
-
techniques:
|
|
5
|
-
- id: eqp
|
|
6
|
-
name: "Equivalence partitioning"
|
|
7
|
-
applies_hint: "any constrained input"
|
|
8
|
-
emits: [absolute, forbidden-presence]
|
|
9
|
-
- id: bva
|
|
10
|
-
name: "Boundary value analysis"
|
|
11
|
-
applies_hint: "input has an ordered range or length"
|
|
12
|
-
emits: [absolute, forbidden-presence]
|
|
13
|
-
- id: negative
|
|
14
|
-
name: "Negative / error"
|
|
15
|
-
applies_hint: "any input or action that can fail"
|
|
16
|
-
emits: [forbidden-presence]
|
|
17
|
-
- id: state_flow
|
|
18
|
-
name: "State / flow"
|
|
19
|
-
applies_hint: "the AC sits in a multi-step flow"
|
|
20
|
-
emits: [state-transition]
|
|
21
|
-
- id: crud
|
|
22
|
-
name: "CRUD round-trip"
|
|
23
|
-
applies_hint: "AC touches a persisted resource"
|
|
24
|
-
emits: [delta, presence, forbidden-presence]
|
|
25
|
-
- id: auth
|
|
26
|
-
name: "Auth / permission"
|
|
27
|
-
applies_hint: "AC is behind a gate or role"
|
|
28
|
-
emits: [forbidden-presence, presence]
|
|
29
|
-
- id: api_contract
|
|
30
|
-
name: "API-contract"
|
|
31
|
-
applies_hint: "surface is REST/GraphQL"
|
|
32
|
-
emits: [absolute]
|
|
33
|
-
- id: concurrency
|
|
34
|
-
name: "Concurrency / race"
|
|
35
|
-
applies_hint: "high-risk (money / data-loss) or shared-resource AC"
|
|
36
|
-
emits: [state-transition, forbidden-presence]
|
|
37
|
-
- id: idempotency
|
|
38
|
-
name: "Idempotency / retry"
|
|
39
|
-
applies_hint: "money or write operations"
|
|
40
|
-
emits: [delta]
|
|
41
|
-
- id: i18n
|
|
42
|
-
name: "i18n / l10n"
|
|
43
|
-
applies_hint: "AC renders user text or formats numbers/dates/currency"
|
|
44
|
-
emits: [presence, absolute]
|
|
45
|
-
- id: a11y
|
|
46
|
-
name: "a11y"
|
|
47
|
-
applies_hint: "any rendered surface"
|
|
48
|
-
emits: [presence, absolute]
|
|
49
|
-
- id: responsiveness
|
|
50
|
-
name: "Responsiveness / layout"
|
|
51
|
-
applies_hint: "rendered surface"
|
|
52
|
-
emits: [presence, forbidden-presence]
|
|
53
|
-
- id: empty_state
|
|
54
|
-
name: "Empty / null / zero state"
|
|
55
|
-
applies_hint: "list / search / collection AC"
|
|
56
|
-
emits: [presence]
|
|
57
|
-
- id: overflow_underflow
|
|
58
|
-
name: "Overflow / underflow"
|
|
59
|
-
applies_hint: "numeric or quantity AC (R9: explicit underflow/overflow)"
|
|
60
|
-
emits: [forbidden-presence]
|
|
61
|
-
- id: persistence
|
|
62
|
-
name: "Persistence / refresh"
|
|
63
|
-
applies_hint: "AC asserts durable state"
|
|
64
|
-
emits: [absolute]
|
|
65
|
-
- id: temporal
|
|
66
|
-
name: "Time / timezone / expiry"
|
|
67
|
-
applies_hint: "AC involves dates, TTLs, schedules"
|
|
68
|
-
emits: [state-transition, forbidden-presence]
|
|
69
|
-
- id: currency
|
|
70
|
-
name: "Currency / rounding"
|
|
71
|
-
applies_hint: "money AC"
|
|
72
|
-
emits: [absolute]
|
|
73
|
-
- id: pagination
|
|
74
|
-
name: "Pagination / sort / filter"
|
|
75
|
-
applies_hint: "list / search AC"
|
|
76
|
-
emits: [absolute, presence]
|
|
77
|
-
- id: file_media
|
|
78
|
-
name: "File / media"
|
|
79
|
-
applies_hint: "upload surface"
|
|
80
|
-
emits: [forbidden-presence]
|
|
81
|
-
- id: notification
|
|
82
|
-
name: "Notification / async-effect"
|
|
83
|
-
applies_hint: "AC produces an out-of-band effect (email/SMS/push)"
|
|
84
|
-
emits: [presence, delta]
|
|
85
|
-
`;var dt={"web-form":`
|
|
86
|
-
id: web-form
|
|
87
|
-
name: "Web form"
|
|
88
|
-
version: 1
|
|
89
|
-
applies_when: >
|
|
90
|
-
The AC concerns a data-entry form: input fields, required fields, submit,
|
|
91
|
-
validation messages.
|
|
92
|
-
candidate_checks:
|
|
93
|
-
- id: field-validation
|
|
94
|
-
family: negative
|
|
95
|
-
measurable_example: "Enter 'abc' in a numeric quantity field \u2192 inline error 'must be a number', value not accepted"
|
|
96
|
-
emits: forbidden-presence
|
|
97
|
-
- id: required-fields
|
|
98
|
-
family: negative
|
|
99
|
-
measurable_example: "Submit with a required field empty \u2192 submit blocked, field flagged"
|
|
100
|
-
emits: forbidden-presence
|
|
101
|
-
- id: formats
|
|
102
|
-
family: negative
|
|
103
|
-
measurable_example: "Email without @ rejected; valid accepted"
|
|
104
|
-
emits: forbidden-presence
|
|
105
|
-
- id: empty-state
|
|
106
|
-
family: empty_state
|
|
107
|
-
measurable_example: "First load: no stale values, placeholders shown"
|
|
108
|
-
emits: presence
|
|
109
|
-
- id: error-messages
|
|
110
|
-
family: negative
|
|
111
|
-
measurable_example: "Each error is specific and tied to its field"
|
|
112
|
-
emits: presence
|
|
113
|
-
- id: a11y
|
|
114
|
-
family: a11y
|
|
115
|
-
measurable_example: "Every input has a programmatic label; keyboard-only submit works"
|
|
116
|
-
emits: presence
|
|
117
|
-
- id: responsiveness
|
|
118
|
-
family: responsiveness
|
|
119
|
-
measurable_example: "No field overlap at 1280/768/375 px"
|
|
120
|
-
emits: forbidden-presence
|
|
121
|
-
`,"rest-graphql-api":`
|
|
122
|
-
id: rest-graphql-api
|
|
123
|
-
name: "REST / GraphQL API"
|
|
124
|
-
version: 1
|
|
125
|
-
applies_when: >
|
|
126
|
-
The surface is an HTTP/GraphQL endpoint.
|
|
127
|
-
candidate_checks:
|
|
128
|
-
- id: response-shape
|
|
129
|
-
family: api_contract
|
|
130
|
-
measurable_example: "Body validates against the declared schema"
|
|
131
|
-
emits: absolute
|
|
132
|
-
- id: status-codes
|
|
133
|
-
family: api_contract
|
|
134
|
-
measurable_example: "GET 200, POST 201, missing 404, bad 400, unauth 401"
|
|
135
|
-
emits: absolute
|
|
136
|
-
- id: verbs
|
|
137
|
-
family: idempotency
|
|
138
|
-
measurable_example: "PUT is idempotent, POST is not"
|
|
139
|
-
emits: delta
|
|
140
|
-
- id: bad-payloads
|
|
141
|
-
family: negative
|
|
142
|
-
measurable_example: "Malformed JSON \u2192 400, never 500"
|
|
143
|
-
emits: absolute
|
|
144
|
-
- id: idempotency
|
|
145
|
-
family: idempotency
|
|
146
|
-
measurable_example: "Same POST with idempotency-key twice \u2192 one effect"
|
|
147
|
-
emits: delta
|
|
148
|
-
- id: pagination
|
|
149
|
-
family: pagination
|
|
150
|
-
measurable_example: "Page beyond last \u2192 empty list, not error; cursor stable"
|
|
151
|
-
emits: absolute
|
|
152
|
-
- id: versioning
|
|
153
|
-
family: api_contract
|
|
154
|
-
measurable_example: "v1 contract unchanged after v2 ships"
|
|
155
|
-
emits: absolute
|
|
156
|
-
- id: rate-limits
|
|
157
|
-
family: api_contract
|
|
158
|
-
measurable_example: "Over the limit \u2192 429 with retry-after"
|
|
159
|
-
emits: absolute
|
|
160
|
-
`,"mobile-native":`
|
|
161
|
-
id: mobile-native
|
|
162
|
-
name: "Mobile native"
|
|
163
|
-
version: 2
|
|
164
|
-
applies_when: >
|
|
165
|
-
iOS/Android native surface.
|
|
166
|
-
candidate_checks:
|
|
167
|
-
- id: interruptions
|
|
168
|
-
family: state_flow
|
|
169
|
-
measurable_example: "Incoming call mid-flow \u2192 state preserved on return \u2014 no device control: promises here become gaps, not tests"
|
|
170
|
-
emits: state-transition
|
|
171
|
-
- id: network-transitions
|
|
172
|
-
family: state_flow
|
|
173
|
-
measurable_example: "wifi\u2192cellular\u21924G drop: no data loss, graceful retry \u2014 no connectivity control: promises here become gaps, not tests"
|
|
174
|
-
emits: state-transition
|
|
175
|
-
- id: permissions
|
|
176
|
-
family: negative
|
|
177
|
-
measurable_example: "Deny camera \u2192 feature degrades, no crash \u2014 the OS dialog is tappable UI (exercise Allow/Deny on screen); only programmatic grant/deny or pre-seeded permission state has no control"
|
|
178
|
-
emits: forbidden-presence
|
|
179
|
-
- id: orientation
|
|
180
|
-
family: persistence
|
|
181
|
-
measurable_example: "Rotate mid-form \u2192 input preserved"
|
|
182
|
-
emits: absolute
|
|
183
|
-
- id: deep-links
|
|
184
|
-
family: state_flow
|
|
185
|
-
measurable_example: "Cold-start deep link lands on the right screen with auth \u2014 legal when the test states the exact link target"
|
|
186
|
-
emits: state-transition
|
|
187
|
-
- id: state-persistence
|
|
188
|
-
family: persistence
|
|
189
|
-
measurable_example: "Kill + relaunch \u2192 resume where left off"
|
|
190
|
-
emits: absolute
|
|
191
|
-
- id: localization
|
|
192
|
-
family: i18n
|
|
193
|
-
measurable_example: "Device locale switch reformats and re-translates \u2014 no device control: promises here become gaps, not tests"
|
|
194
|
-
emits: presence
|
|
195
|
-
`,"stateful-flow":`
|
|
196
|
-
id: stateful-flow
|
|
197
|
-
name: "Stateful flow"
|
|
198
|
-
version: 1
|
|
199
|
-
applies_when: >
|
|
200
|
-
Multi-step wizard / checkout / onboarding.
|
|
201
|
-
candidate_checks:
|
|
202
|
-
- id: valid-transitions
|
|
203
|
-
family: state_flow
|
|
204
|
-
measurable_example: "Each step advances only when its precondition is met"
|
|
205
|
-
emits: state-transition
|
|
206
|
-
- id: invalid-transitions
|
|
207
|
-
family: state_flow
|
|
208
|
-
measurable_example: "Can't jump to step 3 with step 2 incomplete"
|
|
209
|
-
emits: forbidden-presence
|
|
210
|
-
- id: back-and-abandon
|
|
211
|
-
family: state_flow
|
|
212
|
-
measurable_example: "Back from step 3, then abandon \u2192 no partial commit"
|
|
213
|
-
emits: forbidden-presence
|
|
214
|
-
- id: refresh-persistence
|
|
215
|
-
family: persistence
|
|
216
|
-
measurable_example: "Reload at step 2 \u2192 still at step 2 with data"
|
|
217
|
-
emits: absolute
|
|
218
|
-
- id: resume
|
|
219
|
-
family: persistence
|
|
220
|
-
measurable_example: "Return later \u2192 resume the saved flow"
|
|
221
|
-
emits: absolute
|
|
222
|
-
- id: double-submission
|
|
223
|
-
family: idempotency
|
|
224
|
-
measurable_example: "Double-click submit \u2192 exactly one submission"
|
|
225
|
-
emits: delta
|
|
226
|
-
`,"data-crud":`
|
|
227
|
-
id: data-crud
|
|
228
|
-
name: "Data CRUD"
|
|
229
|
-
version: 1
|
|
230
|
-
applies_when: >
|
|
231
|
-
A persisted record.
|
|
232
|
-
candidate_checks:
|
|
233
|
-
- id: crud-round-trip
|
|
234
|
-
family: crud
|
|
235
|
-
measurable_example: "Create \u2192 read shows it \u2192 update \u2192 read shows the change \u2192 delete \u2192 read 404"
|
|
236
|
-
emits: state-transition
|
|
237
|
-
- id: retry-safety
|
|
238
|
-
family: idempotency
|
|
239
|
-
measurable_example: "Retried create with same key \u2192 one row"
|
|
240
|
-
emits: delta
|
|
241
|
-
- id: concurrency-lost-update
|
|
242
|
-
family: concurrency
|
|
243
|
-
measurable_example: "Two writers, last must not silently clobber \u2192 conflict surfaced"
|
|
244
|
-
emits: forbidden-presence
|
|
245
|
-
- id: delete-cascade
|
|
246
|
-
family: crud
|
|
247
|
-
measurable_example: "Delete parent \u2192 children handled per rule"
|
|
248
|
-
emits: state-transition
|
|
249
|
-
- id: referential-consistency
|
|
250
|
-
family: crud
|
|
251
|
-
measurable_example: "Can't create a child for a missing parent"
|
|
252
|
-
emits: forbidden-presence
|
|
253
|
-
`,"auth-gated":`
|
|
254
|
-
id: auth-gated
|
|
255
|
-
name: "Auth gated"
|
|
256
|
-
version: 1
|
|
257
|
-
applies_when: >
|
|
258
|
-
Behind login/role.
|
|
259
|
-
candidate_checks:
|
|
260
|
-
- id: login-gate
|
|
261
|
-
family: auth
|
|
262
|
-
measurable_example: "Anonymous \u2192 redirected to login, not the resource"
|
|
263
|
-
emits: forbidden-presence
|
|
264
|
-
- id: role-permission-matrix
|
|
265
|
-
family: auth
|
|
266
|
-
measurable_example: "For each role \xD7 action: allowed/denied as specified"
|
|
267
|
-
emits: absolute
|
|
268
|
-
- id: cross-user-record
|
|
269
|
-
family: auth
|
|
270
|
-
measurable_example: "User A cannot read/edit user B's record by id"
|
|
271
|
-
emits: forbidden-presence
|
|
272
|
-
- id: token-session-expiry
|
|
273
|
-
family: auth
|
|
274
|
-
measurable_example: "Expired token \u2192 401/redirect, no stale access"
|
|
275
|
-
emits: forbidden-presence
|
|
276
|
-
- id: privilege-escalation
|
|
277
|
-
family: auth
|
|
278
|
-
measurable_example: "Non-admin cannot reach an admin action by direct URL/API"
|
|
279
|
-
emits: forbidden-presence
|
|
280
|
-
`,"search-list":`
|
|
281
|
-
id: search-list
|
|
282
|
-
name: "Search / list"
|
|
283
|
-
version: 1
|
|
284
|
-
applies_when: >
|
|
285
|
-
Search results / list views.
|
|
286
|
-
candidate_checks:
|
|
287
|
-
- id: pagination
|
|
288
|
-
family: pagination
|
|
289
|
-
measurable_example: "First/last/empty page correct; total accurate"
|
|
290
|
-
emits: absolute
|
|
291
|
-
- id: sorting
|
|
292
|
-
family: pagination
|
|
293
|
-
measurable_example: "Sort asc/desc actually orders; ties stable"
|
|
294
|
-
emits: absolute
|
|
295
|
-
- id: filtering
|
|
296
|
-
family: pagination
|
|
297
|
-
measurable_example: "Each filter narrows correctly; combined filters AND"
|
|
298
|
-
emits: absolute
|
|
299
|
-
- id: empty-state
|
|
300
|
-
family: empty_state
|
|
301
|
-
measurable_example: "No results \u2192 friendly empty state, not blank/error"
|
|
302
|
-
emits: presence
|
|
303
|
-
- id: invalid-input
|
|
304
|
-
family: negative
|
|
305
|
-
measurable_example: "Garbage query \u2192 no crash, sane result"
|
|
306
|
-
emits: forbidden-presence
|
|
307
|
-
- id: length-limits
|
|
308
|
-
family: bva
|
|
309
|
-
measurable_example: "Max-length query handled"
|
|
310
|
-
emits: absolute
|
|
311
|
-
- id: locale
|
|
312
|
-
family: i18n
|
|
313
|
-
measurable_example: "Locale-correct collation/casing"
|
|
314
|
-
emits: presence
|
|
315
|
-
`};var mt=`
|
|
316
|
-
version: 3
|
|
317
|
-
principles:
|
|
318
|
-
- "Each step is one complete OBJECTIVE the executing agent achieves autonomously \u2014 state the goal and the path, never low-level actions (the agent emits its own actions)."
|
|
319
|
-
- "One objective (or tightly-related items of one goal) per step; unrelated goals split."
|
|
320
|
-
- "Verbose path: name site or app, page or screen, section, panel, control, state \u2014 'On the search results page for Noida, in the filter panel's Budget section, set min to 50L and max to 1Cr'."
|
|
321
|
-
- "Self-contained: concrete values inline; never 'as defined in the scenario' \u2014 the agent cannot see the graph."
|
|
322
|
-
- "Two surfaces: WEB tests run in the kane-cli browser agent; MOBILE tests run in the kane-cli mobile agent on a local Android emulator / iOS simulator (native app). One surface per test; imports/reuse only same-surface units."
|
|
323
|
-
- "In scope: web-browser behavior, mobile emulator/simulator native-app behavior, and direct API calls. NOT in scope: out-of-band email/SMS, backend state with no web, app-screen, or API surface."
|
|
324
|
-
verification:
|
|
325
|
-
- "Phrase checks against what the test's own surface can observe:"
|
|
326
|
-
- "WEB Visual \u2014 visible text, labels, counts, prices ('verify the price is 29.99', 'the Sold out label is shown')."
|
|
327
|
-
- "WEB Textual/DOM \u2014 element states/attributes ('the Add button is disabled', 'the placeholder of the search box is \u2026')."
|
|
328
|
-
- "WEB URL \u2014 'URL contains /checkout'. Title \u2014 'page title contains \u2026'."
|
|
329
|
-
- "WEB DevTools/Network \u2014 'no API calls returned 5xx', 'the POST /api/login returned 200'. Console \u2014 'no console errors'. Performance \u2014 'LCP under 2500ms'. Cookies/localStorage \u2014 'a cookie named session_id exists'."
|
|
330
|
-
- "MOBILE Visual \u2014 on-screen text, labels, counts, states ('the Upcoming list shows 2 reservations', 'a Booking cancelled toast is shown')."
|
|
331
|
-
- "MOBILE Element \u2014 native accessibility-tree states ('the Pay button is disabled', 'the Remember me switch is on')."
|
|
332
|
-
- "MOBILE Network (environment-dependent) \u2014 the app's own captured traffic ('the POST /api/login returned 200') and direct API calls ('call GET /api/bookings and verify the cancelled booking is absent') need a capture/API-wired run environment; when the promise is observable on-screen, prefer the screen."
|
|
333
|
-
- "MOBILE Lifecycle \u2014 background/foreground, terminate/relaunch (only when the objective closes the app), orientation, deep links with a stated target ('background the app and return; the draft is preserved'). OS permission dialogs are tappable UI \u2014 exercising Allow/Deny on screen is legal."
|
|
334
|
-
- "MOBILE ILLEGAL \u2014 URL, page Title, browser console, page-performance: none exist on a native app. Cookies/localStorage: WebView-only AND write-only \u2014 never a read check. Keyboard-visibility: illegal on Android (default sessions suppress the soft keyboard); iOS renders it as ordinary elements. No control exists \u2192 gap, never a test: incoming call/SMS, posting notifications, wifi/airplane switches, locale/timezone, clipboard reads, on-device DB/file reads (the db-query tool reads a configured backend DB, never the device), geolocation, biometrics, programmatic permission pre-seeding. Platform-conditional: notification-shade observation and tab handling are Android-only \u2014 gap iOS notification promises."
|
|
335
|
-
- "Assertions are the CLOSING CLAUSE of the step that performed the action \u2014 '\u2026swipe the row left, then assert a Cancel action is shown'. Say assert, not verify. Never a standalone assertion step, never a restated summary check at the end."
|
|
336
|
-
- "Setup steps stay clean: a step with no verifies tags states its goal plainly and carries NO assert clause \u2014 failing to reach the goal is signal enough."
|
|
337
|
-
- "Tag the proof: a step whose assert clause proves acceptance criteria lists them in its verifies field \u2014 every AC is proven by the step that observes it."
|
|
338
|
-
- "Assert the outcome, never the trigger: 'Verify the Submit button is visible' fails exactly when the action worked \u2014 assert what the action changed."
|
|
339
|
-
- "A UI-commit confirm is an action, not a check: 'confirm the dialog' presses a control; the check is the resulting state ('\u2026 then assert the banner reads Order placed')."
|
|
340
|
-
- "Intent for the actions, literal for the data: goals for verbs ('Log in with {{user}}'), literal or {{variable}} for values."
|
|
341
|
-
- "Extractions: 'Store \u2026 as name' \u2014 vague verbs (read/tell/report) do NOT persist values."
|
|
342
|
-
- "Baselines/deltas are EXTRACTIONS on both surfaces: 'store the result count as baseline_count' BEFORE the action; compare after. Never an abstract 'capture the state'."
|
|
343
|
-
variables:
|
|
344
|
-
- "Credentials and environment values are {{name}} variables; concrete domain values from the source stay literal."
|
|
345
|
-
- "A value no evidence supplies (start URL, test account, seed data) is ASKED for \u2014 actual value or a variable name \u2014 never invented."
|
|
346
|
-
pitfalls:
|
|
347
|
-
- "A WEB test without a starting URL cannot run \u2014 its first step names it."
|
|
348
|
-
- "A MOBILE test declares its platform as the typed target field; kane writes target:/app: frontmatter into the minted file and the run dispatches on it. Its first step launches the app \u2014 never a URL, never a [mobile:] marker. App data PERSISTS between runs (no reset): never assume first-install or signed-out state."
|
|
349
|
-
- "'Test the checkout flow' has no end state \u2014 state what done looks like."
|
|
350
|
-
- "Do not cram many unrelated operations into one step; do not reference data outside the step."
|
|
351
|
-
- "A step whose only content is an assertion is a smell \u2014 fold it into the action step before it."
|
|
352
|
-
`;var It=["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"];function gt(t,e){for(let i of t)if(!It.includes(i))throw new Error(`${e}: emits '${i}' is not an oracle kind`)}function ut(t,e){let i=le(t);if(!i||!Array.isArray(i.techniques))throw new Error(`${e}: expected { techniques: [...] }`);for(let n of i.techniques){if(!n.id||!n.name||!n.applies_hint||!Array.isArray(n.emits))throw new Error(`${e}: technique '${n?.id??"?"}' missing id/name/applies_hint/emits`);gt(n.emits,`${e}: technique '${n.id}'`)}return i.techniques}function pt(t,e){let i=le(t);if(!i||!i.id||!i.name||!i.applies_when||!Array.isArray(i.candidate_checks))throw new Error(`${e}: profile missing id/name/applies_when/candidate_checks`);for(let n of i.candidate_checks){if(!n.id||!n.family||!n.measurable_example||!n.emits)throw new Error(`${e}: candidate_check '${n?.id??"?"}' missing id/family/measurable_example/emits`);gt([n.emits],`${e}: check '${n.id}'`)}return i}function ft(t){let e=new Map(ut(lt,"packaged techniques").map(n=>[n.id,n])),i=se(t,"design","techniques.yaml");if(ye(i))for(let n of ut(ve(i,"utf8"),i))e.set(n.id,n);return[...e.values()]}function ht(t){let e=new Map(Object.entries(dt).map(([n,c])=>[n,pt(c,`packaged profile '${n}'`)])),i=se(t,"design","profiles");if(ye(i))for(let n of Tt(i).filter(c=>c.endsWith(".yaml")||c.endsWith(".yml")).sort()){let c=pt(ve(se(i,n),"utf8"),se(i,n));e.set(c.id,c)}return[...e.values()]}function bt(t){let e=se(t,"design","runner-grammar.yaml");return ye(e)?ve(e,"utf8"):mt}function ne(t,e){return!t.superseded.has(e)}function we(t,e,i){return{cid:e,logical_id:t.nameOf.get(e)??null,content:i}}async function _t(t,e,i,n,c){let a=await Je(t,"search_similar",{text:e,label:i,k:n},c);return a.ok&&Array.isArray(a.result)?a.result:[]}async function yt(t,e,i={}){let n=V(t),c=n.resolve(e);if(!c)throw new Error(`assembleDesignContext: unknown use-case '${e}' (run designGate first)`);let a=c.tip,k=n.getNode(a);if(!k||k.label!==U.USECASE)throw new Error(`assembleDesignContext: '${e}' is not a use-case (run designGate first)`);let M=n.derivesInto(a).map(g=>({source_id:g.props.source_id??null,anchor:g.props.anchor??null})),w=[],I=new Set;for(let{cid:g,content:d}of n.byLabel(U.SCENARIO))ne(n,g)&&n.edgesFrom(g).some(v=>v.type===W.BELONGS_TO&&v.dst===a)&&(w.push(we(n,g,d)),I.add(g));let $=[];for(let{cid:g,content:d}of n.byLabel(U.AC)){if(!ne(n,g))continue;let v=n.edgesFrom(g).find(S=>S.type===W.SCOPED_TO);!v||v.dst!==a&&!I.has(v.dst)||$.push({...we(n,g,d),scoped_to:v.dst})}let D=Array.isArray(k.content.criteria)?k.content.criteria:[],A=[k.content.title,k.content.description,...D].filter(Boolean).join(`
|
|
353
|
-
`),q=(await _t(n,A,U.SCENARIO,10,i.embedSearch)).filter(g=>!I.has(g.cid)),C=[],P=new Set,K=[],E=[a],B=new Set([a]);for(;E.length>0;){let g=E.shift();for(let d of n.edgesFrom(g)){if(d.type!==W.DEPENDS_ON||n.nodeLabel.get(d.dst)!==U.USECASE)continue;let v=n.tipOf(d.dst);B.has(v)||(B.add(v),K.push(v),E.push(v))}}for(let g of K){let d=`depends_on ${n.nameOf.get(g)??g.slice(0,19)}`;for(let{cid:v}of n.byLabel(U.SCENARIO))if(ne(n,v)&&n.edgesFrom(v).some(S=>S.type===W.BELONGS_TO&&S.dst===g))for(let S of n.edgesInto(v)){if(S.type!==W.AUTOMATES||!ne(n,S.src)||P.has(S.src))continue;P.add(S.src);let F=String(n.getNode(S.src)?.content.title??"");C.push({cid:S.src,logical_id:n.nameOf.get(S.src)??null,title:F,via:d})}}for(let g of await _t(n,A,U.TEST,5,i.embedSearch)){let{cid:d,title:v}=g;P.has(d)||(P.add(d),C.push({cid:d,logical_id:n.nameOf.get(d)??null,title:v??"",via:"similar"}))}let f=n.byLabel(U.STYLENOTE).filter(g=>ne(n,g.cid)).sort((g,d)=>g.cid<d.cid?-1:1).slice(0,5).map(g=>`${String(g.content.statement)} [${String(g.content.learned_from_kind)}]`);return{usecase:we(n,a,k.content),cites:M,committed_acs:$,existing:{scenarios:w,reuse_candidates:q},import_candidates:C,style_notes:f,techniques:ft(t),profiles:ht(t),runner_grammar:bt(t),variables:[...(i.variablesIndex??new Map).entries()].map(([g,d])=>({name:g,has_value:d.has_value})).sort((g,d)=>g.name<d.name?-1:1),budget:{...i.max!=null?{max_pairs:i.max}:{},...i.strength!=null?{strength_override:i.strength}:{}},design_of:(()=>{let g=it(n,a);return g?{engine:g.engine,seq:g.seq}:null})()}}function vt(t){let e=i=>{if(Array.isArray(i))return i.map(e);if(i!==null&&typeof i=="object"){let n={};for(let c of Object.keys(i).sort())n[c]=e(i[c]);return n}return i};return JSON.stringify(e(t),null,1)}import{basename as Gt,dirname as St,resolve as xt}from"path";import{existsSync as Ot,mkdirSync as Pt,readFileSync as Nt,renameSync as Mt,writeFileSync as Bt}from"fs";import{dirname as jt,join as Lt}from"path";function wt(t){return Lt(t,".testmuai","variables","assurance.json")}function kt(t){for(let c of t.declarations){let a=oe(c.name);if(a)throw new Error(`variable declaration refused: ${a}`)}let e={};if(Ot(t.file)){let c=JSON.parse(Nt(t.file,"utf8"));c&&typeof c=="object"&&!Array.isArray(c)&&(e=c)}let i=[],n=[];for(let c of t.declarations){if(Object.hasOwn(e,c.name)||t.known?.has(c.name)){n.push(c.name);continue}e[c.name]={value:"",secret:!!c.secret,description:c.description},i.push(c.name)}if(i.length>0){Pt(jt(t.file),{recursive:!0});let c=`${t.file}.tmp-${process.pid}-${Date.now()}`;Bt(c,JSON.stringify(e,null,2)+`
|
|
354
|
-
`),Mt(c,t.file)}return{written:i,skipped:n}}var qt=ue,Ft=new Set(["narrative","acs","scenarios","tests","exercises","gaps","scoped_to_repoints","judgements","variables","phase"]);function Vt(t){let e=/strength=(\d+)\s*(?:—|-)?\s*(.*)/.exec(t??"");return e?{strength:Number(e[1]),reason:e[2]||t||""}:{strength:2,reason:t??""}}function Ut(t,e,i=new Set,n=0){return qt(e,pe(t),i,n)}function Ht(t,e,i,n){let c=e.scenarios?.find(D=>D.temp_ref===i.automates)??(()=>{let D=t.resolve(i.automates),A=D?t.getNode(D.tip)?.content:void 0;return A?{title:String(A.title??""),intent:String(A.intent??""),technique_notes:String(A.technique_notes??"")}:{}})(),a=[...(e.acs??[]).map(D=>({ref:D.temp_ref,text:D.text})),...i.verifies.filter(D=>!(e.acs??[]).some(A=>A.temp_ref===D)).map(D=>{let A=t.resolve(D);return{ref:D,text:A?String(t.getNode(A.tip)?.content.text??""):""}})],{test_md:k,objectives_yaml:M}=Ae({title:i.title,steps:i.steps,check:i.check,check_prose:i.check_prose,reuses:i.reuses,...i.target?{target:i.target,...i.app?{app:i.app}:{}}:{}},{title:c.title,intent:c.intent},a),w=me(Ut(t,k)),I=i.check,$={technique:c.technique_notes??"",profile_family:e.judgements?.find(D=>D.kind==="profile_family"&&(D.target===i.temp_ref||D.target===i.automates))?.rationale??"unspecified",anchor:I.verified_against,expected_how:e.judgements?.find(D=>D.kind==="expected_how"&&D.target===I.verified_against)?.rationale??`expected_mode: ${I.expected_mode??"inferred"}`,combinatorial:Vt(c.technique_notes),surface_state:"absent",deferred_bindings:I.expected_mode==="runtime-derived"?1:0};return n.push({definitionId:w,rationale:$,anchorRef:I.verified_against,tempRef:i.temp_ref}),{temp_ref:i.temp_ref,title:i.title,automates:i.automates,verifies:i.verifies,check:i.check,definitionId:w,test_md_blob:k,objectives_blob:M,...i.reuses?.length?{reuses:i.reuses}:{},...i.surface_required!==void 0?{surface_required:i.surface_required}:{},...i.target?{target:i.target}:{},...i.target&&i.app?{app:i.app}:{}}}function zt(t,e){try{let i=t.resolve(e.automates);if(!i)return!1;let n=t.tipOf(i.cid)??i.cid;for(let c of t.edgesInto(n)){if(c.type!==W.AUTOMATES)continue;let a=t.getNode(t.tipOf(c.src)??c.src)?.content,k=typeof a?.test_md_blob=="string"?a.test_md_blob:"";if(!k)continue;if(!k.split(`
|
|
355
|
-
`).some(w=>/^##\s/.test(w)&&!/—\s?assert/.test(w)&&De.test(w)))return!0}return!1}catch{return!1}}function Dt(t){let e=0,i=t.forceScope??null;return{terminalEventType:"design",async onProposalEvent(n){let c=r=>t.steer?(t.steer(`[auto-repair] ${r} \u2014 please re-finalize with this fixed.`),{proposal:null,error:null}):{proposal:null,error:r};if(n==null||typeof n!="object")return c("finalize_design payload is not an object");let a=n,k=Object.keys(a).filter(r=>!Ft.has(r));if(k.length>0)return c(`finalize_design carries ungated/unknown section(s): ${k.join(", ")} \u2014 mintable here: acs, scenarios, tests (+gaps)`);let M=new Map;for(let r of a.tests??[]){let u=M.get(r.automates);if(u)return c(`strict 1:1 violated in-payload: ${u} and ${r.temp_ref} both automate ${r.automates}`);if(M.set(r.automates,r.temp_ref),typeof r.app=="string"&&!/^APP/.test(r.app)&&!/[\/]/.test(r.app)&&!/\.(apk|zip|app)$/i.test(r.app))return c(`${r.temp_ref}: app '${r.app}' is neither a build path (.apk / .zip of an .app) nor an APP\u2026 upload id \u2014 omit the field when only a bundle id exists`)}let w=V(t.contextDir),I=/^design@(\d+)$/.exec(t.templateVersion?.()??"");if(I&&Number.parseInt(I[1],10)>=6)for(let r of a.tests??[]){if(!Array.isArray(r.steps??[]))return c(`${r.temp_ref}: steps must be an array of objective strings or {text, verifies} objects`);let u=new Set;for(let x of Array.isArray(r.steps)?r.steps:[])if(typeof x=="object"&&x.verifies)for(let b of x.verifies)u.add(b);let _=new Set(r.verifies??[]),h=[..._].filter(x=>!u.has(x)),T=[...u].filter(x=>!_.has(x));if(!(u.size===0&&zt(w,r))&&(u.size===0||h.length>0||T.length>0))return c(`${r.temp_ref}: every AC must be claimed by the step that proves it \u2014 `+(u.size===0?"no step carries verifies tags":`not claimed by any step: [${h.join(", ")}]; tagged but not in the test's verifies: [${T.join(", ")}]`))}if(a.variables!==void 0&&!Array.isArray(a.variables))return c("variables must be an array of {name, description, secret}");let $=!!I&&Number.parseInt(I[1],10)>=7;if((a.variables??[]).length>0&&!$)return c("variables[] needs design@7 \u2014 this session is bound to an older template; drop the section");let D=new Set;for(let r of a.variables??[]){if(!r||typeof r!="object"||typeof r.name!="string"||typeof r.description!="string"||typeof r.secret!="boolean")return c(`variables[]: every entry is {name, description, secret} \u2014 got ${JSON.stringify(r)}`);let u=Object.keys(r).filter(h=>!["name","description","secret"].includes(h));if(u.length>0)return c(`variables[]: '${r.name}' carries ${u.join(", ")} \u2014 a declaration has no value and no other fields`);let _=oe(r.name);if(_)return c(`variables[]: ${_}`);if(!r.description.trim()||/[\r\n]/.test(r.description))return c(`variables[]: '${r.name}' needs a one-line, non-empty description`);if(D.has(r.name))return c(`variables[]: '${r.name}' is declared twice`);D.add(r.name)}if($){let r=t.variablesIndex?.()??new Map;for(let u of a.tests??[]){let _=[...(Array.isArray(u.steps)?u.steps:[]).map(h=>typeof h=="string"?h:h.text),u.check_prose??""];for(let h of _)for(let T of je(h))if(!(r.has(T)||D.has(T)))return c(`${u.temp_ref}: step references {{${T}}} but no variable named '${T}' exists in the pool and this payload does not declare it \u2014 reuse a name from the variables block, or declare it in \`variables\` ({name, description, secret})`)}}t.force&&!t.resuming&&e===0&&i===null&&(i=at(w,t.ucRef,{blockerGaps:ae(t.templateVersion?.()??null)>=8}));let A=w.resolve(t.ucRef),q=A?String(w.getNode(A.tip)?.content.risk??"med"):"med",C=[],P=new Set([t.ucRef,A?.cid,A?.tip].filter(Boolean)),K=r=>{if(P.has(r))return!0;let u=w.resolve(r);return u!=null&&(P.has(u.cid)||P.has(u.tip))},E;try{E={...a.acs?.length?{acs:a.acs.map(r=>({temp_ref:r.temp_ref,text:r.text,kind:r.kind,risk:r.risk??q,...r.expected_answer?{expected_answer:r.expected_answer}:{},...r.scoped_to&&!K(r.scoped_to)?{scope:{type:"scenario",ref:r.scoped_to}}:{}}))}:{},...a.scenarios?.length?{scenarios:a.scenarios}:{},...a.tests?.length?{tests:a.tests.map(r=>Ht(w,a,r,C))}:{},...a.exercises?.length?{exercises:a.exercises}:{},...a.gaps?.length?{gaps:a.gaps}:{},...a.scoped_to_repoints?.length?{scoped_to_repoints:a.scoped_to_repoints}:{},...a.judgements?.length?{judgements:a.judgements}:{}}}catch(r){return c(r instanceof Error?r.message:String(r))}let B=ae(t.templateVersion?.()??null)>=8,f=a.phase??(a.tests?.length?"tests":a.scenarios?.length?"scenarios":a.acs?.length?"acs":"design"),g=(r,u={})=>({contextDir:t.contextDir,graph:r,ucRef:t.ucRef,sections:E,by:t.by,phase:f,...u,...t.templateVersion?{templateVersion:t.templateVersion()}:{},...t.engine?{engine:t.engine}:{},...i?.length?{forceScope:i}:{},...t.because?{reason:t.because}:{},finalizeTestBody:(()=>{let _=new Map((E.tests??[]).map(x=>[x.temp_ref,x])),h=new Map,T=(x,b,j)=>{let s=_.get(x);if(!s?.test_md_blob)return null;let l=h.get(x);if(l!==void 0)return l;if(j.has(x))return s.test_md_blob;j.add(x);let m=new Map;for(let O of s.reuses??[]){T(O,b,j);let J=b(O);J!==null&&J!==O&&m.set(O,J)}let o=s.verifies.map(b).filter(O=>O!==null),p=Ce(s.test_md_blob,m),{md:y,tagged:R}=$e(p,b),N=R?y:Re(p,o);return Ee(N,o),h.set(x,N),N};return(x,b)=>{if(!x.test_md_blob)return null;let j=T(x.temp_ref,b,new Set)??x.test_md_blob;if(j===x.test_md_blob)return null;let s=l=>{for(let m of _.keys())if(b(m)===l){let o=T(m,b,new Set);if(o!==null)return{body:o,cycleKey:`batch:${l}`,next:s}}return pe(w)(l)};return{test_md_blob:j,definitionId:me(ue(j,s))}}})()}),d,v=[],S=[];if(t.protocol){let r=t.generationTicket,u=await ze(t.protocol,{verb:"design",ucTargets:[{ref:t.ucRef}],newBuCandidates:[],sourcePins:[],readBasis:w.latestHash,...r?{generationTicket:r}:{}},_=>{let h=_e(g(_.graph,{eventIds:_.eventIds("design",1),sid:_.sid,...r&&!t.generationStamped?{generationTicket:r}:{}}));return h.errors!==null?(v=h.warnings,S=h.droppedBlockers??[],{errors:h.errors}):{result:h,record:h.record}});u.ok&&"result"in u?(d=u.result,r&&!t.generationStamped&&(t.generationStamped=!0,t.generationTicket={...r,expected_prev_gen:r.next_gen})):u.ok?d={record:null,errors:null,minted:{},logicalIds:{},superseded:[],warnings:["commit already applied (recommit)"],finalizedTests:{}}:d={record:null,errors:u.kind==="validation"?u.errors:u.kind==="contended"?[{code:u.err.code,detail:`${t.ucRef} is held by ${u.err.holder?.owner_sid??"another session"}${u.err.holder?.alive?" (live)":" (stale)"} \u2014 try another use-case or wait for it to free`}]:u.kind==="drifted"?u.asks.map(h=>({code:"DRIFTED",detail:h.detail})):[{code:"UNSETTLED",detail:`concurrent activity kept moving the store (${u.attempts} attempts) \u2014 retry when the store is quieter`}],minted:{},logicalIds:{},superseded:[],finalizedTests:{},warnings:u.kind==="validation"?v:[],...u.kind==="validation"&&S.length?{droppedBlockers:S}:{}}}else d=_e(g(w));if(d.errors){if((d.droppedBlockers?.length??0)>0&&d.errors.every(r=>r.code==="EMPTY_DESIGN")){for(let _ of d.warnings)t.note(`warning: ${_}`);e+=1;let r=new Set((i??[]).filter(_=>w.nodeLabel.get(_)==="gap"));return{proposal:null,error:null,receipt:ge({verb:"design",commitN:e,ucRef:t.ucRef,typedBlockers:B,phase:f,committed:[],warnings:d.warnings,...r.size?{ignoreGaps:r}:{}},w)}}return c("design commit failed: "+d.errors.map(r=>`${r.code}: ${r.detail}`).join("; "))}let F=d.warnings.filter(r=>r.includes("\u2014 committed anyway; approve"));for(let r of d.warnings)(!F.includes(r)||F.length===1)&&t.note(`warning: ${r}`);F.length>1&&t.note(`warning: ${F.length} test link(s) refer to items still awaiting approval \u2014 saved anyway; review and approve those items in chat or via kane-cli context review`);let L=(r,u)=>r?`${r} ${u}${r>1?"s":""}`:null,Z=[L(a.acs?.length,"AC"),L(a.scenarios?.length,"scenario"),L(a.tests?.length,"test"),L(a.gaps?.length,"gap")].filter(Boolean);t.aliases?.(Object.entries(d.minted).map(([r,u])=>({ref:r,cid:u,...d.logicalIds[r]?{id:d.logicalIds[r]}:{}})));{let r=`saved ${Z.join(" \xB7 ")||"judgements/wiring"} as drafts`;(t.commitLine??t.note)(r)}let H=V(t.contextDir);t.onCommitted?.(H);for(let r of C){let u=d.logicalIds[r.anchorRef]??d.minted[r.anchorRef];ot(t.contextDir,d.finalizedTests[r.tempRef]??r.definitionId,{...r.rationale,anchor:u??r.rationale.anchor})}try{let r=Object.values(d.minted).filter(u=>H.getNode(u)?.label==="test");if(r.length>0){let u=St(xt(t.contextDir)),_=Le({graph:H,cids:r,cwd:u});_.wrote.length>0&&t.note(`\u2692 wrote ${_.wrote.map(h=>Gt(h.path)).join(" \xB7 ")}`);for(let h of _.refused)t.note(`warning: could not create the test file for ${h.id} \u2014 ${h.reason}`)}}catch(r){t.note(`warning: the design was saved, but its test file could not be created (${r instanceof Error?r.message:String(r)})`)}try{if((a.variables??[]).length>0){let r=St(xt(t.contextDir)),u=wt(r),{written:_}=kt({file:u,declarations:a.variables,known:t.variablesIndex?.()});if(_.sort(),_.length>0){let h=_.map(T=>({...a.variables.find(x=>x.name===T),file:u}));t.note(`\u2692 declared ${_.length} new variable${_.length===1?"":"s"} \u2014 ${_.join(" \xB7 ")} (values needed)`),t.event?.({type:"variables_declared",file:u,variables:h.map(({name:T,description:x,secret:b})=>({name:T,description:x,secret:b}))}),t.onVariablesDeclared?.(h)}}}catch(r){t.note(`warning: the design was saved, but its variable stubs could not be written (${r instanceof Error?r.message:String(r)})`)}t.event?.({type:"commit",acs:a.acs?.length??0,scenarios:a.scenarios?.length??0,tests:a.tests?.length??0,gaps:a.gaps?.length??0,warnings:d.warnings.length,minted:Object.entries(d.minted).map(([r,u])=>({temp_ref:r,cid:u,...d.logicalIds[r]?{logical_id:d.logicalIds[r]}:{}}))}),e+=1,i!==null&&(i=d.forceScopeRemaining??i,t.onForceScope?.(i));let ee=new Set((i??[]).filter(r=>H.nodeLabel.get(r)==="gap")),G=ge({verb:"design",commitN:e,ucRef:t.ucRef,typedBlockers:B,...ee.size?{ignoreGaps:ee}:{},phase:f,committed:Object.entries(d.minted).map(([r,u])=>({temp_ref:r,cid:u,...d.logicalIds[r]?{logical_id:d.logicalIds[r]}:{}})),warnings:d.warnings},H),z=G.event.parity,Q=z?.missing??[],te=!!a.tests?.length,ie=new Set(d.droppedBlockers??[]),Y=f==="tests"&&(a.gaps??[]).some((r,u)=>Te.has(String(r.kind))&&!ie.has(u)),re=B?(te||Y)&&Q.length===0&&(z?.live_scenarios??0)>0:te&&Q.length===0;return{proposal:d,error:null,receipt:G,...re?{sessionComplete:re}:{}}}}}function $t(t,e){return{type:"run_config",version:1,session_id:e.session_id,mode:e.mode,source:{source_id:`design:${t.usecase.logical_id??e.ucCid.slice(0,19)}`,source_cid:e.ucCid,kind:"design_context",numbered_text:vt({...t,session_mode:e.mode})},existing_use_cases:[],read_basis:e.readBasis,max_free_text_rounds:2,graph_reads:!0,verb:"design",chat:!0,design_budget:t.budget,topology:e.topology}}var Rt=Symbol("design-out-tee");function Jt(t,e,i,n){return{terminalEventType:"design",async onProposalEvent(c){let a=c??{},k=["acs","scenarios","tests","gaps"].map(M=>a[M]?.length?`${a[M].length} ${M}`:null).filter(Boolean).join(" \xB7 ");return i?.("plan_payload",{payload:a}),t(`plan: finalize_design \u2014 ${k||"wiring/judgements only"} (nothing committed${n?`; full payload: ${X(n)}`:""})`),e?.({type:"plan",payload:a}),{proposal:a,error:null}}}}var Ct=8*1024;function Xt(t,e){let i=qe({message_id:`msg-${e}-ffffff`,text:t});return i<=Ct?null:`error: the opening statement is ${i} bytes and the agent takes at most ${Ct} per message (it would drop it silently) \u2014 pass a shorter --because (it replaces the generated stale reason)`}function Zt(t,e,i){if(!t.statement||t.resume)return{initialMessage:e};let n=[e,t.statement].filter(Boolean).join(`
|
|
356
|
-
|
|
357
|
-
`),c=Xt(n,i);return c?{initialMessage:e,error:c}:{initialMessage:n}}async function un(t,e){let i=V(e.contextDir),n=null,c=null,a=t.useCase;if(t.resume){try{{let p=await st(e.contextDir,t.resume,i,{deps:{onWarn:y=>e.out(`note: ${y}`)}});c=p,n=p.handle,p.drift.length>0&&(e.out(`note: sources changed since the pause: ${p.drift.map(y=>y.subject).join(", ")} \u2014 the design continues against the current versions`),e.emit?.({type:"stale_basis",sources:p.drift.map(y=>y.subject)}))}}catch(p){if(p instanceof xe||p instanceof be)return e.out(`error: ${p.message}`),e.emit?.({type:"error",message:`error: ${p.message}`}),p instanceof be||p.code==="SESSION_MISSING"||p.code==="SESSION_EXPIRED"?2:1;throw p}let s=n.state,l=Ye(s.verb,"design",t.resume);if(l)return e.out(l.message),e.emit?.({type:"error",message:l.message,code:l.code}),n.release(),2;if(a&&s.use_case&&a!==s.use_case){let p=`session ${t.resume} was designing ${s.use_case}; --use-case ${a} RETARGETS it`;if(!(t.confirmRetarget?await t.confirmRetarget(`${p} \u2014 continue with the new target?`):!1))return e.out(`error: ${p} \u2014 resume without --use-case to continue ${s.use_case}, or start a fresh session on ${a}`),e.emit?.({type:"error",code:"RETARGET_MISMATCH",message:p}),n.release(),2}if(a=a??s.use_case,s.uc_tip&&a){let p=i.resolve(a)?.tip;if(p&&p!==s.uc_tip){let y=`the use-case changed since the pause (${s.uc_tip.slice(0,19)}\u2026 \u2192 ${p.slice(0,19)}\u2026)`;if(!(t.confirmRetarget?await t.confirmRetarget(`${y} \u2014 re-ground and continue against the new version?`):!1))return e.out(`error: ${y} \u2014 resume interactively to re-ground, or abandon this session`),e.emit?.({type:"error",code:"UC_TIP_MOVED",message:y}),n.release(),2;e.emit?.({type:"stale_basis",usecase:a})}}let m=ct(i,s.target_pins);if(m.length>0){let p=`items this session pinned have changed since it paused: ${m.map(R=>`${R.ref}${R.now===null?" (now gone)":""}`).join(", ")}`;if(!(t.confirmRetarget?await t.confirmRetarget(`${p} \u2014 re-ground and continue?`):!1))return e.out(`error: ${p} \u2014 resume interactively to re-ground, or abandon`),e.emit?.({type:"error",code:"TARGET_PIN_MOVED",message:p}),n.release(),2;n.save({target_pins:(s.target_pins??[]).map(R=>({ref:R.ref,cid:i.resolve(R.ref)?.tip??R.cid}))})}let o=[...new Set([...n.state.held_receipts??[],...c?.view.kane?.held_receipts??[]])];if(o.length>0)if(e.chat?.holdReceipt)for(let p of o)e.chat.holdReceipt(p);else e={...e,initialMessage:[o.join(`
|
|
358
|
-
|
|
359
|
-
`),e.initialMessage].filter(Boolean).join(`
|
|
360
|
-
|
|
361
|
-
`)};if(!a)return e.out(`error: session ${t.resume} predates use-case persistence \u2014 re-supply --use-case <ref>`),e.emit?.({type:"error",message:`error: session ${t.resume} predates use-case persistence \u2014 re-supply --use-case <ref>`}),n.release(),2}let k=t.resume?void 0:t.phase,M=!1;if(k!==void 0){let{checkPhaseEntry:s,phaseEntryCmd:l,phaseLadderFor:m}=await import("./phase-seed-MKHEWUN6.js");M=m(e.contextDir,i,a).length>0;let o=s(e.contextDir,i,a,k);if(!o.ok&&o.code==="UNKNOWN_PHASE")return e.out(`error: ${o.message}`),e.emit?.({type:"error",code:"UNKNOWN_PHASE",message:o.message}),n?.release(),2;if(!o.ok&&o.code==="PHASE_ORDER"){let p=t.askPhaseEntry?await t.askPhaseEntry({message:o.message,earliest:o.earliest}):"cancel";if(p==="earliest")e.out(`starting at ${o.earliest} instead (${o.missing.join(", ")} not committed yet)`),k=o.earliest;else if(p==="proceed")e.out(`note: entering at ${k} with ${o.missing.join(", ")} uncommitted \u2014 proceeding on your say-so`),e.emit?.({type:"phase_entry_override",phase:k,missing:o.missing});else{let y=(t.mode??"interactive")==="agent",R=l(a,o.earliest,y);return e.out(`error: ${o.message}`),e.emit?.({type:"error",code:"PHASE_ORDER",message:o.message,next:[{cmd:R,why:`${o.earliest} is the earliest uncommitted phase for ${a}`,title:`Start at ${o.earliest}`}]}),n?.release(),2}}}let w=!!(t.force||n?.state.force),I=!!(t.resume&&n),$=rt(i,a,w||I||M);if(!$.ok){let s=(t.mode??"interactive")==="interactive";if($.wall&&s&&t.askDesignEntry){let{captureForceScope:l}=await import("./design-committer-D44GSUXY.js"),m=l(i,a).length,o=await t.askDesignEntry({wall:$.wall.kind,message:$.message,display:$.wall.display,impactPairs:m});if(o.pick==="redesign"||o.pick==="proceed"){if(!o.because.trim())return e.out("a redesign needs a reason (--because) \u2014 nothing executed"),n?.release(),2;e.out(o.pick==="redesign"?`redesigning ${$.wall.display} (${m} pair(s) superseded, with any typed blocker gaps standing in for their tests) \u2014 because: ${o.because.trim()}`:`proceeding against the stale design (noted) \u2014 because: ${o.because.trim()}`),t={...t,force:!0,because:t.because??o.because.trim()},w=!0}else return o.pick==="view"?(e.out(`view the existing design: kane-cli context view ${$.wall.display}`),n?.release(),0):o.pick==="refresh"?(e.out(`refresh it first: kane-cli maintain evolve ${$.wall.display}`),n?.release(),0):(e.out("nothing executed \u2014 list use-cases: kane-cli context list"),n?.release(),0)}else{e.out(`design: ${$.message}`);let l=$.wall&&t.mode==="agent"?[{cmd:`kane-cli context view ${$.wall.display}`,why:"view the existing design",title:"View the design"},...$.wall.kind==="designed-stale"?[{cmd:`kane-cli maintain evolve ${$.wall.display}`,why:"the use-case moved since the design \u2014 evolve refreshes it",title:"Evolve the design"}]:[],{cmd:`kane-cli design tests --use-case ${$.wall.display} --force --mode agent`,why:"redesign \u2014 supersedes the live scenario+test pairs",title:"Redesign"}]:void 0;return e.emit?.({type:"gate_refused",message:$.message,...l?{next:l}:{}}),n?.release(),$.code}}if(e.preflightTurn){let s=await e.preflightTurn();if(!s.ok)return e.out(s.message??"error: turn-endpoint preflight failed"),e.emit?.({type:"error",message:s.message??"error: turn-endpoint preflight failed",code:"PREFLIGHT"}),n?.release(),2}let D={contextDir:e.contextDir,resolveAlias:s=>We(s,{env:process.env,auth:e.auth}),embed:(s,l)=>Ke(s,l,{env:process.env,auth:e.auth})};e.chat?.setWorking?.("assembling context\u2026");let A=Be(Me(ce(e.contextDir))),q=[],C=await yt(e.contextDir,a,{max:t.max,strength:t.strength,embedSearch:D,variablesIndex:A});if(t.priorDesign!==void 0&&(C.prior_design=t.priorDesign),t.changeDelta!==void 0&&(C.change_delta=t.changeDelta),t.because&&(C.because=t.because),k!==void 0){let{buildPhaseSeed:s}=await import("./phase-seed-MKHEWUN6.js"),l=s(e.contextDir,i,a,k);C.prior_design===void 0&&l.priorDesign!==void 0&&(C.prior_design=l.priorDesign),C.entry_phase=k,l.phaseLadder.length>0&&(C.phase_ladder=l.phaseLadder)}let P=e.now?.()??new Date,K=`${P.toISOString().replace(/[-:]/g,"").slice(0,15)}-${Qt(2).toString("hex")}`,E=t.mode??"interactive",B=E==="interactive"&&!!e.chat&&!e.nested,f=c?{...c.spawnConfig,mode:E}:$t(C,{session_id:t.resume??`design-${K}`,mode:E,ucCid:C.usecase.cid,readBasis:i.latestHash,topology:Ze("design")}),g={current:null};if(f.resume&&"schema"in f.resume){let s=f.resume.binding?.template_version;typeof s=="string"&&(g.current=s,e.onTemplateVersion?.(s))}t.plan?f.chat=!1:f.chat=!0;let d=e.telemetry?.enabled?e.telemetry:void 0,v=d?Se(d.ids.context_instance_id??null,"design",d.ids.session_id):ke(e.contextDir,"logs",`design-${K}.log`);Wt(ce(v),{recursive:!0}),B||e.out(`trace: ${X(v)}`),e.emit?.({type:"run_start",mode:E,trace:v,use_case:a,...d?{session:d.ids.session_id}:{}});let S=(s,l,m)=>{try{Kt(v,JSON.stringify({ts:new Date().toISOString(),level:s==="error"?"error":"info",run_id:d?.ids.operation_id,...d?{user_session_id:d.ids.session_id}:{},kind:s,session_id:m,data:l})+`
|
|
362
|
-
`)}catch{}d?.wireTrace(s,l,m)};{let s=e.out;if(s[Rt]!==!0){let l=m=>{S("transcript",{line:m}),s(m)};l[Rt]=!0,e.out=l}}if(t.resume&&n){c||(f.resume={agent_state:n.state.agent_state}),e.out(`resuming design session ${t.resume}`),n.state.assumed.length>0&&e.out(`note: ${n.state.assumed.length} default(s) were assumed while you were away \u2014 kane-cli context sessions show ${t.resume} lists them`);try{let{readRecords:s}=await import("./records-LMCVKPE5.js"),l=s(e.contextDir).records.filter(m=>m.sid===t.resume).map(m=>m.design_phase).filter(m=>m!=null&&typeof m.phase=="string");if(l.length>0){let m=l.map(p=>`${p.phase}${p.completeness==="partial"?" (partial)":""}`).join(" \u2192 "),o=`[kane] durable record for this session (${t.resume}) on ${a}: design phases already COMMITTED \u2014 ${m}. Those finalizes landed; do not re-send them. Continue from the next uncommitted phase, or finish if the design is complete.`;e={...e,initialMessage:[e.initialMessage,o].filter(Boolean).join(`
|
|
363
|
-
|
|
364
|
-
`)}}}catch{}t.message&&(e={...e,initialMessage:[e.initialMessage,t.message].filter(Boolean).join(`
|
|
365
|
-
|
|
366
|
-
`)})}{let s=Zt(t,e.initialMessage,f.session_id);if(s.error)return e.out(s.error),e.emit?.({type:"error",message:s.error,code:"MESSAGE_TOO_LARGE"}),n?.release(),2;s.initialMessage!==e.initialMessage&&(e={...e,initialMessage:s.initialMessage})}let F=null,L={current:i},Z={detach:null},H=()=>{let s=Z.detach;Z.detach=null,s&&s()},ee=(s,l)=>{let m=n;if(!m)return{};let o=s.ask,p=Xe({contextDir:s.contextDir,cwd:ce(s.contextDir),handle:m,note:y=>s.chat?s.chat.note(y):s.out(y),graphSlot:l,...s.now?{now:s.now}:{}});if(s.chat?.attachIngest){let y=s.chat;Z.detach=y.attachIngest(async R=>{try{m.save({ingest_registry:he(m.state.ingest_registry,R,s.now?.()??new Date)});let N=await p({id:`attach-${m.state.sid}-${(m.state.ingest_registry??[]).length}`,ref:R,purpose:null});return N.ok?(y.deferBatch({source_id:N.result.source_id,cid:N.result.cid}),{ok:!0}):{ok:!1,error:N.error.message}}catch(N){return{ok:!1,error:N instanceof Error?N.message:String(N)}}})}return{ask:async y=>{let R=await o(y);if(Array.isArray(R)){let N=R.filter(O=>{if(O.free_text==null||O.free_text.trim()==="")return!1;let J=y.find(At=>At.id===O.id);return O.selected_index!=null&&J?.options[O.selected_index]?.input===!0}).map(O=>O.free_text.trim());if(N.length>0){let O=m.state.ingest_registry;for(let J of N)O=he(O,J,s.now?.()??new Date);m.save({ingest_registry:O})}}return R},ingest:p}};e.nested||e.chat?.attachOnCommitted?.(s=>{L.current=s});let G="";if(e.chat&&!t.plan&&!e.nested){let s=Qe({contextDir:e.contextDir,graph:V(e.contextDir),sessionStamp:f.session_id,by:e.by??{kind:"human",id:"owner"}});s.errors===null||s.errors[0]?.code==="CONV_SOURCE_EXISTS"?(G=s.sourceId,e.chat.attachConversationSource?.(G),L.current=V(e.contextDir)):e.out(`warning: notes you add in chat can't be saved to the context this session (${s.errors[0]?.detail})`)}let z=V(e.contextDir),Q;if(!t.plan){let s=Ue(z,a);if(I&&s!==null&&s.live){let l=z.resolve(a);Q={uc_root:Ve(z,l.cid),next_gen:s.gen,expected_prev_gen:s.gen}}else{let l=He(z,a,{...w?{force:!0}:{},because:t.because??(w?"forced redesign (--force)":void 0)});if("error"in l)return e.out(`design: ${l.error.detail}`),e.emit?.({type:"gate_refused",message:l.error.detail,code:l.error.code}),n?.release(),2;Q=l}}let te=Oe(e.contextDir,f.session_id),ie=null,Y=()=>{try{ie?.release()}catch{}};if(!t.plan)try{ie=te.acquire([Pe(z,a).key],{hold:"session",verb:"design"})}catch(s){if(s instanceof Ie&&s.code==="UC_HELD"){let l=s.holder,m=`design: ${a} is being designed by another session${l?.alive===!1?` \u2014 that session looks stopped; resume it with kane-cli design tests --resume ${l?.owner_sid??"<session>"}`:""} \u2014 pick another use-case (kane-cli design tests) or wait for it to finish`;return e.out(m),e.emit?.({type:"error",code:"UC_HELD",message:m}),n?.release(),2}throw s}let re={contextDir:e.contextDir,rootSid:f.session_id,locks:te,probe:{batchSimilar:async()=>({hits:[],degraded:!1,probeBasis:null}),recheckLocal:()=>({hits:[],uncachedNewNodes:[]})}},r=!t.plan&&E!=="ci",u=()=>Object.fromEntries((i.resolve(a)?i.edgesInto(i.resolve(a).tip):[]).filter(s=>s.type==="DERIVES"&&typeof s.props.source_id=="string").map(s=>[String(s.props.source_id),i.heads.get(String(s.props.source_id))??null])),_=!1;r&&!n&&(_=!0,n=de(e.contextDir,{sid:f.session_id,mode:"agent",created_at:P.toISOString(),expires_at:new Date(P.getTime()+1440*60*1e3).toISOString(),agent_state:{schema:2,items:[],provider_state:""},pending:{questions:[],proposals:[]},read_basis:u(),assumed:[],corpus_cursor:{remaining:[]},conv_source:G,target_pins:i.resolve(a)?[{ref:a,cid:i.resolve(a).tip}]:[],verb:"design",use_case:a,...i.resolve(a)?.tip?{uc_tip:i.resolve(a).tip}:{},...w?{force:!0}:{},...d?{user_session_id:d.ids.session_id}:{}}));let h;if(r&&n){let{resume:s,...l}=f;Fe(e.contextDir,f.session_id,{schema:Ge,kind:"base",sid:f.session_id,verb:"design",mode:E,created_at:P.toISOString(),run_config:l,conv_source:G||n.state.conv_source||"",...a?{use_case:a}:{},...i.resolve(a)?.tip?{uc_tip:i.resolve(a).tip}:{},store_watermark:Ne(e.contextDir)}),f.checkpoints=!0,t.resume&&S("resume_kind",{kind:c?c.view.pointer===null?"bare-base":c.view.pointer.at==="final"?"pause":"crash":"v1-shim"},f.session_id);let m=c?0:n.state.checkpoint?.seq??0,o=n;h=tt({contextDir:e.contextDir,handle:o,seqBase:()=>m,peekHeldReceipts:()=>e.chat?.peekHeldReceipts?.()??[],readBasis:()=>u(),corpusCursor:()=>({remaining:[]}),onSoftCap:y=>e.out(y),onStat:y=>S("ckpt_stat",y,f.session_id),...e.now?{now:e.now}:{}});let p=h;h={...p,persist:y=>{let R=y.binding?.template_version;return typeof R=="string"&&R&&(g.current=R,e.onTemplateVersion?.(R)),p.persist(y)}}}!r&&!t.plan&&(f.checkpoints=!0,h={persist:s=>{let l=s.binding?.template_version;return typeof l=="string"&&l&&(g.current=l,e.onTemplateVersion?.(l)),{seq:s.seq,turn_id:s.turn_id,at:s.at,ts:new Date().toISOString(),full_seq:null}}});let T=()=>{if(!n)return;let s=n.state.checkpoint;if(s){let l=E!=="interactive"?` --mode ${E}`:"";e.out(`session ${n.state.sid} kept its last checkpoint (seq ${s.seq}, ${s.ts}) \u2014 resume with: kane-cli design tests --resume ${n.state.sid}${l}`),n.release()}else if(_){try{n.complete()}catch{n.release()}try{Et(ke(e.contextDir,"sessions"))}catch{}}else n.release();n=null};n?.state.force_scope?.length&&e.onForceScope?.(n.state.force_scope);let x=t.plan?Jt(e.out,e.emit,S,v):Dt({templateVersion:()=>g.current,contextDir:e.contextDir,ucRef:a,by:{kind:"ai",id:"design-agent"},force:w,engine:"design@1",note:s=>e.chat?e.chat.note(s):e.out(s),commitLine:s=>e.chat?e.chat.ledger({kind:"commit",ok:!0,line:s}):e.out(s),steer:e.chat?s=>e.chat.submit(s):void 0,event:e.emit,variablesIndex:()=>A,onVariablesDeclared:s=>{q.push(...s);for(let l of s)A.set(l.name,{has_value:!1,source:l.file})},resuming:I,...n?.state.force_scope?.length?{forceScope:n.state.force_scope}:{},onForceScope:s=>{F=s,e.onForceScope?.(s)},...t.because?{because:t.because}:{},aliases:e.chat?s=>e.chat.registerAliases?.(s):void 0,onCommitted:s=>{L.current=s},protocol:re,...Q?{generationTicket:Q}:{},...I?{generationStamped:!0}:{}});e.chat||(S("design_budget",{max_pairs:C.budget.max_pairs??null,strength:C.budget.strength_override??null}),e.out(`designing: ${C.usecase.logical_id??a}`)),e.chat?.setWorking?.(`designing ${C.usecase.logical_id??a}\u2026`);let b;try{b=await fe(f,{...e,graphSlot:L,...ee(e,L),...h?{checkpoint:h}:{}},new Map,i,S,x)}catch(s){throw S("error",{message:s instanceof Error?s.message:String(s),stack:s instanceof Error?s.stack:void 0},f.session_id),T(),s}finally{e.chat?.setWorking?.(null),H()}if(b.errorCode==="binding_mismatch"&&c){let s=await e.ask([{id:"binding-mismatch",text:"this session's saved conversation is no longer accepted by the service \u2014 start the conversation fresh (committed work is kept), or stop and keep the session?",risk:"high",rationale:"the service refused the saved conversation on the first turn after resume",options:[{label:"start fresh",detail:"continue with a fresh conversation \u2014 earlier answers may be re-asked"},{label:"stop",detail:"stop here; the session stays resumable"}],recommended_index:1,allow_free_text:!1}]);if((Array.isArray(s)?s.find(o=>o.id==="binding-mismatch"):void 0)?.selected_index!==0){let o=`resume abandoned: binding mismatch on session ${f.session_id} \u2014 the session is preserved`;return e.out(o),e.emit?.({type:"error",message:o,code:"BINDING_MISMATCH"}),n?.release(),2}S("binding_migrate",{sid:f.session_id},f.session_id);let m=f.resume&&"schema"in f.resume?{...f.resume,binding:{}}:void 0;try{b=await fe({...f,...m?{resume:m}:{}},{...e,graphSlot:L,...ee(e,L),...h?{checkpoint:h}:{}},new Map,i,S,x)}catch(o){throw S("error",{message:o instanceof Error?o.message:String(o),stack:o instanceof Error?o.stack:void 0},f.session_id),T(),o}finally{e.chat?.setWorking?.(null),H()}}if(b.highRisk)return e.out(`error: ${b.highRisk.length} high-risk decision${b.highRisk.length===1?"":"s"} need a human \u2014 ci mode won't guess. Re-run with --mode agent to pause for review.`),e.emit?.({type:"error",message:`error: high-risk question(s) in ci mode (fail-closed): ${b.highRisk.map(s=>s.id).join(", ")}`,code:"HIGH_RISK_CI"}),T(),Y(),1;if(b.paused){let s=n;s||(s=de(e.contextDir,{sid:f.session_id,mode:"agent",created_at:P.toISOString(),expires_at:new Date(P.getTime()+1440*60*1e3).toISOString(),agent_state:b.paused.agent_state,pending:{questions:[],proposals:[]},read_basis:Object.fromEntries((i.resolve(a)?i.edgesInto(i.resolve(a).tip):[]).filter(o=>o.type==="DERIVES"&&typeof o.props.source_id=="string").map(o=>[String(o.props.source_id),i.heads.get(String(o.props.source_id))??null])),assumed:[],corpus_cursor:{remaining:[]},conv_source:G,target_pins:i.resolve(a)?[{ref:a,cid:i.resolve(a).tip}]:[],verb:"design",use_case:a,...i.resolve(a)?.tip?{uc_tip:i.resolve(a).tip}:{},...w?{force:!0}:{},...d?{user_session_id:d.ids.session_id}:{}}));try{w&&!s.state.force&&s.save({force:!0}),d&&s.state.user_session_id!==d.ids.session_id&&s.save({user_session_id:d.ids.session_id}),G&&s.state.conv_source!==G&&s.save({conv_source:G});let o=e.chat?.drainHeldReceipts?.()??[];(o.length>0||(s.state.held_receipts?.length??0)>0)&&s.save({held_receipts:o}),F!==null&&s.save({force_scope:F}),et(s,b.paused)}catch(o){let p=s.state.checkpoint,y=`error: couldn't persist the pause for session ${s.state.sid}`+(p?` \u2014 last durable checkpoint: seq ${p.seq} @ ${p.ts}`:" \u2014 no durable checkpoint exists")+` (${o instanceof Error?o.message:String(o)})`;return e.out(y),e.emit?.({type:"error",message:y,code:"PAUSE_PERSIST_FAILED",sid:s.state.sid}),1}S("session_paused",{sid:s.state.sid},f.session_id);let l=E!=="interactive"?` --mode ${E}`:"",m=`kane-cli design tests --resume ${s.state.sid}${l}`;if(B||e.out(`paused \u2014 resume with: ${m}`),e.emit?.({type:"session_paused",sid:s.state.sid,mode:E,resume:m,expires_at:s.state.expires_at,pending_questions:b.paused.pending.questions}),B){let o=e.chat?.state.credits?.total;e.onSummary?.({state:"paused",reason:"ctrl+c",facts:[`session ${s.state.sid} saved \u2014 designing ${C.usecase.logical_id??a}`,...s.state.expires_at?[`expires: ${s.state.expires_at}`]:[],...o!==void 0?[`credits used: ${o.toFixed(1)}`]:[]],resume:m,resumeMessage:`${m} --message "<your words>"`,tracePath:X(v)})}return Y(),3}if(b.crashed&&n?.state.checkpoint){let s=n.state.checkpoint,l=E!=="interactive"?` --mode ${E}`:"",m=`kane-cli design tests --resume ${n.state.sid}${l}`;if(S("agent_crashed_resumable",{sid:n.state.sid,seq:s.seq},f.session_id),B||e.out(`agent crashed \u2014 session ${n.state.sid} is resumable at checkpoint seq ${s.seq} (at most the in-flight turn lost); resume with: ${m}`),e.emit?.({type:"session_paused",sid:n.state.sid,mode:E,resume:m,expires_at:n.state.expires_at,crashed:!0}),B){let o=e.chat?.state.credits?.total;e.onSummary?.({state:"crashed",facts:[`agent crashed \u2014 session ${n.state.sid} is resumable at checkpoint seq ${s.seq}`,"at most the in-flight turn was lost",...o!==void 0?[`credits used: ${o.toFixed(1)}`]:[]],resume:m,resumeMessage:`${m} --message "<your words>"`,tracePath:X(v)})}return n.release(),n=null,3}if(b.error)return e.out(`error: design agent failed: ${b.error}`),e.emit?.({type:"error",message:`error: design agent failed: ${b.error}`}),T(),Y(),1;if(b.proposal==null&&E!=="interactive")return e.out(`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${v})`),e.emit?.({type:"error",message:`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${v})`}),T(),Y(),1;let j=0;if(b.proposal==null)try{let{readRecords:s}=await import("./records-LMCVKPE5.js"),l=t.resume??f.session_id;j=s(e.contextDir).records.filter(m=>m.sid===l).reduce((m,o)=>m+o.nodes.filter(p=>p.label!=="source").length,0)}catch{}if(b.proposal==null&&e.out(j>0?`done \u2014 ${j} item(s) committed in this session (earlier legs included); nothing new since the resume`:"done \u2014 nothing designed this session (no finalize before the session ended)"),b.assumedDefaults&&e.out(`assumed: ${b.assumedDefaults} default(s) taken while unattended`),n&&e.emit?.({type:"session_complete",sid:t.resume??f.session_id}),d?.event("ASR_SESSION_COMPLETE",{}),n?.complete(),_)try{Et(ke(e.contextDir,"sessions"))}catch{}if(q.length>0){let s=es(q,ce(e.contextDir));e.chat?e.chat.note(s):e.out(s),e.emit?.({type:"variables_summary",file:q[0].file,variables:q.map(({name:l,description:m,secret:o})=>({name:l,description:m,secret:o}))})}if(B){let s=e.chat.state.ledger.filter(o=>o.kind==="answer"&&o.receipt.form==="assumed").length??0,l=(b.assumedDefaults??0)+s,m=e.chat.state.credits?.total??b.creditsTotal;e.onSummary?.({state:"complete",facts:[`designed: ${C.usecase.logical_id??a}${b.proposal==null?j>0?` (${j} item(s) committed across this session)`:" (nothing committed this session)":""}`,...q.length>0?[`${q.length} variable(s) need values \u2014 see .testmuai/variables/assurance.json`]:[],...l>0?[`${l} assumed default(s)`]:[],...m!==void 0?[`credits used: ${m.toFixed(1)}`]:[]],tracePath:X(v)})}return t.plan||nt(e.contextDir),Y(),0}function es(t,e){if(t.length===0)return"";let i=Yt(e,t[0].file)||t[0].file,n=Math.max(...t.map(a=>a.name.length))+3,c=t.slice().sort((a,k)=>a.name<k.name?-1:1).map(a=>` ${a.name.padEnd(n)}${a.description}${a.secret?" (secret)":""}`);return`variables declared this session \u2014 fill their values before running:
|
|
367
|
-
${i}
|
|
368
|
-
${c.join(`
|
|
369
|
-
`)}
|
|
370
|
-
`}export{Ct as a,Xt as b,Zt as c,un as d,es as e};
|
package/dist/chunk-HPHETGRE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as j}from"./chunk-RKXHVP2Z.js";import{a as L}from"./chunk-RRY5IXOB.js";import{a as O}from"./chunk-5Y2G4NC7.js";import{a as D}from"./chunk-YCCUBQY4.js";import{y as l}from"./chunk-CXF6AZWY.js";import{a as E}from"./chunk-HCBYKLMW.js";import{a as g,b as s,i as I,k as B}from"./chunk-C44QQJR4.js";import{a as P}from"./chunk-6YGTRKDT.js";import{e as $}from"./chunk-UR6MHSHU.js";var H=$(P(),1);var w=$(E(),1),K=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function J(e){let t=e.replace(/…$/,"");return t&&t.charAt(0).toLowerCase()+t.slice(1)}function N(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),n=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${n>0?e.slice(-n):""}`}function Z({status:e,meta:t,tallies:r,keys:n,child:d,cols:c}){let{stdout:h}=B(),m=c??h?.columns??80,f=e.kind==="working"||e.kind==="child-working",[i,b]=(0,H.useState)(0);O(()=>b(a=>a+1),f?120:null);let k=K[i%K.length],u,p;switch(e.kind){case"working":u=`${k} ${e.step}${e.elapsedS!==void 0?` \xB7 ${e.elapsedS}s`:""}`,p=l.assuranceAccent;break;case"waiting":u=`\u25CF waiting on you${e.pending?` \u2014 ${e.pending} question${e.pending===1?"":"s"}`:""}`,p=l.amber;break;case"idle":u="\u25CF idle",p=l.assuranceAccent;break;case"card":u=`\u25CF card ${e.n} of ${e.m}`,p=l.amber;break;case"child-working":u=`${k} child: ${e.step}`,p=l.assuranceAccent;break;case"child-waiting":u="\u25CF child waiting on you",p=l.amber;break}let A=d?`${t.verb} \u25B8 ${d.verb}`:t.verb,S=d?.sid?t.sid?`${N(t.sid,14)} \u25B8 ${d.sid}`:d.sid:t.sid,C=t.env==="prod"?"":t.env,_=[A,S,C].filter(Boolean),v=" \xB7 ",R=u.length+v.length+_.join(v).length,T=t.subject;if(T){let a=m-R-v.length;T=a>=8?N(T,a):void 0}let M=[A,...T?[T]:[],S,C].filter(Boolean).join(v);return(0,w.jsxs)(g,{flexDirection:"column",children:[(0,w.jsx)(s,{color:l.muted,children:"\u2500".repeat(Math.max(1,m))}),(0,w.jsxs)(s,{children:[(0,w.jsx)(s,{color:p,children:u}),(0,w.jsx)(s,{color:l.dim,children:`${v}${M}`})]}),(0,w.jsx)(s,{color:l.dim,children:r.items.length>0?r.items.join(v):" "}),(0,w.jsx)(s,{color:l.muted,children:n.join(v)})]})}var y=$(P(),1);function ne({onToggleThinking:e,onCtrlC:t,explorer:r,panel:n}){let c=(0,y.useRef)(null),h=(0,y.useRef)(""),m=()=>{c.current&&clearTimeout(c.current),c.current=null,h.current=""};return(0,y.useEffect)(()=>m,[]),I((f,i)=>{if(i.ctrl&&f==="t"){e();return}if(i.ctrl&&f==="c"){t();return}if(!i.ctrl&&f.includes("")){t();return}if(!i.ctrl&&f.includes("")){e();return}if(r&&r.isOpen()){let b=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(),r.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return){m(),i.return?r.onEnter():r.onMove(i.upArrow?-1:1);return}if(h.current+=f,h.current==="["){b();return}let k=h.current;m();let u=/^\[([ABCD])/.exec(k);if(u){(u[1]==="A"||u[1]==="B")&&r.onMove(u[1]==="A"?-1:1);return}r.onBack();return}if(i.upArrow){r.onMove(-1);return}if(i.downArrow){r.onMove(1);return}if(i.return){r.onEnter();return}if(i.escape){h.current="",b();return}return}if(n&&n.isFocused()){let b=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(),n.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return||i.leftArrow||i.rightArrow){m(),i.return?n.onSelect():i.leftArrow?n.onLeft?.():i.rightArrow?n.onRight?.():n.onMove(i.upArrow?-1:1);return}if(h.current+=f,h.current==="["){b();return}let k=h.current;m();let u=/^\[([ABCD])/.exec(k);if(u){u[1]==="A"||u[1]==="B"?n.onMove(u[1]==="A"?-1:1):u[1]==="C"?n.onRight?.():n.onLeft?.();return}n.onBack();return}if(i.upArrow){n.onMove(-1);return}if(i.downArrow){n.onMove(1);return}if(i.leftArrow){n.onLeft?.();return}if(i.rightArrow){n.onRight?.();return}if(i.return){n.onSelect();return}if(i.escape){h.current="",b();return}if(/^[1-9]$/.test(f)){n.onDigit(Number(f));return}if(i.tab){n.onTab?.();return}if(f===" "&&n.isMulti()){n.onSpace();return}if(f&&!i.ctrl&&!i.meta){n.onType(f);return}return}}),null}var o=$(E(),1);function V(e){return e.kind==="REVIEW"?[{v:"approve",label:"approve",detail:"mark it reviewed and trusted"},{v:"archive",label:"archive",detail:"reject it \u2014 asks for a reason; impact shown above"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="PAIR"?[{v:"merge",label:"merge",detail:"duplicate \u2014 fold into the older item (it stays unreviewed)"},{v:"keep_both",label:"keep both",detail:"genuinely distinct \u2014 promote both"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="ARCHIVE"?[{v:"archive",label:"retire",detail:"hidden from now on; history is kept and it can be reverted"},{v:"skip",label:"skip",detail:"keep it \u2014 decided, never re-offered"},{v:"defer",label:"defer",detail:"not now \u2014 the plan re-offers it"}]:e.heldPayload?[{v:"approve",label:"approve update",detail:"commit the held payload \u2014 impact preview above"},{v:"skip",label:"keep current",detail:"drop the held payload (the owner's disk state stays untouched)"},{v:"defer",label:"defer",detail:"not now \u2014 stays held"}]:[{v:"approve",label:"approve",detail:e.kind==="ADD"?"commit + design it":"commit the updated version (old\u2192new redirect)"},{v:"skip",label:e.origin==="content-change"?"reject":"skip",detail:e.origin==="content-change"?"drop the staged proposal \u2014 nothing committed":"leave it as is"},{v:"defer",label:"defer",detail:"not now \u2014 the plan keeps it staged"}]}function F(e){let t=V(e);return e.viewDiff&&t.push({v:"view_diff",label:"view diff",detail:"full old \u2192 new"}),t}function W(e){return e.kind==="ARCHIVE"?null:F(e).length}var q={ADD:{color:l.green??"green"},MODIFY:{color:"yellow"},ARCHIVE:{color:l.red},REVIEW:{color:"cyan"},PAIR:{color:"magenta"}},Q=60;function ce({card:e,position:t,sel:r=0,focused:n=!1,freeText:d=null,editorIntent:c="steer"}){let{stdout:h}=B(),m=h?.columns??80,f=m<Q,i=F(e),b=W(e),k=q[e.kind],u=a=>n&&r===a?(0,o.jsx)(s,{color:l.assuranceAccent,children:"\u276F"}):" ",p=e.impact,A=p&&"stale_refs"in p&&p.stale_refs.length>0?`${e.kind==="ARCHIVE"?"retiring leaves":"approving marks"} ${p.stale_refs.length} item(s) stale`+((p.direct_refs?.length??0)>0?` \u2014 ${p.direct_refs.length} directly touched: ${p.direct_refs.join(", ")}`:""):p&&"design_children"in p?`${e.kind==="REVIEW"?"archiving drops":"merging folds"} ${p.design_children} design child(ren)`:null,S=e.provenance&&e.provenance!==e.why?e.provenance:e.origin??null,C=[{label:"why",text:e.why},...S?[{label:"from",text:S,dimmer:!0}]:[],...e.tier?[{label:"match",text:e.tier,dimmer:!0}]:[],...A?[{label:"impact",text:A}]:[]],_=Math.max(...C.map(a=>a.label.length)),v="? reconcile",R=`item ${t.n} of ${t.of}`,T=(0,o.jsxs)(g,{flexDirection:"column",children:[(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsxs)(s,{bold:!0,children:[(0,o.jsx)(s,{color:k.color,children:`[${e.kind}]`}),` ${L(e.title)}`]})}),C.map((a,x)=>(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{color:l.dim,children:`${a.label.padEnd(_)} `}),(0,o.jsx)(s,{color:a.dimmer?l.dim:void 0,children:a.text})]})},`f-${x}`)),e.diffSummary?(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsx)(s,{color:l.dim,children:e.diffSummary})}):(e.diff??[]).map((a,x)=>(0,o.jsx)(g,{paddingLeft:4,children:(0,o.jsx)(s,{color:a.op==="-"?"red":"green",children:`${a.op==="-"?"\u2212":"+"} ${a.field==="criteria"?"criterion":a.field}: ${a.text}`})},`d-${x}`)),(e.citeLines??[]).map((a,x)=>(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsx)(s,{color:l.dim,children:a})},`c-${x}`)),(0,o.jsx)(s,{children:" "}),i.map((a,x)=>(0,o.jsxs)(s,{children:[u(x),` ${x+1}. ${a.label}`,(0,o.jsx)(s,{color:l.dim,children:` \u2014 ${a.detail}`})]},`o-${x}`)),b!==null||d&&c==="because"?d?(0,o.jsxs)(g,{flexDirection:"column",children:[(0,o.jsxs)(g,{children:[(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{color:l.assuranceAccent,children:"\u276F"})," ",(0,o.jsx)(s,{color:l.dim,children:"\u270E "})]}),(0,o.jsx)(D,{value:d.value,onChange:d.onChange,onSubmit:d.onSubmit,onCancel:d.onCancel,placeholder:c==="because"?"why archive it?":"say what to adjust"})]}),(0,o.jsx)(s,{color:l.muted,children:c==="because"?" submits as: archive \xB7 your reason goes on the record":e.kind==="PAIR"?" submits as: defer \xB7 your note parks with the card (it re-offers)":" submits as: approve \xB7 your words steer the re-design"})]}):b!==null?(0,o.jsxs)(s,{children:[u(b)," ",(0,o.jsx)(s,{color:l.dim,children:e.kind==="PAIR"?"\u270E defer with a note \u2014 say what you noticed":"\u270E approve with changes \u2014 say what to adjust"})]}):null:null]});if(f)return(0,o.jsxs)(g,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,o.jsx)(s,{bold:!0,color:l.assuranceAccent,children:v}),(0,o.jsx)(s,{color:l.dim,children:R}),T]});let M=Math.max(2,Math.min(m-1,100)-v.length-R.length);return(0,o.jsxs)(g,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{bold:!0,color:l.assuranceAccent,children:v})," ".repeat(M),(0,o.jsx)(s,{color:l.dim,children:R})]}),(0,o.jsx)(s,{children:" "}),T]})}var Y={"acceptance criteria":1,scenarios:2,"acceptance criteria + exercises":3,"tests + gaps":4};function ue(e,t){let r=[],n=j(e.turns).entries.length;if(t==="design"){let c;for(let m=e.ledger.length-1;m>=0;m--){let f=e.ledger[m];if(f.kind==="banner"&&f.text.startsWith("designing: ")){c=f.text.slice(11);break}}let h=c?Y[c]:void 0;h&&r.push(`phase ${h}/4`),n>0&&r.push(`${n} item${n===1?"":"s"} this session`)}else n>0&&r.push(`${n} saved as draft${n===1?"":"s"}`);let d=e.pending?e.pending.resolution.filter(c=>!c).length:0;return d>0&&r.push(`${d} question${d===1?"":"s"} pending`),e.credits&&r.push(`${e.credits.total.toFixed(1)} credits`),{items:r}}function fe(e,t){let r=[],n=e.applied+e.committed+e.retired;r.push(`${n} applied`),r.push(`${t} to decide`);let d=[];return e.skipped>0&&d.push(`${e.skipped} skipped`),e.deferred>0&&d.push(`${e.deferred} deferred`),e.failed>0&&d.push(`${e.failed} failed`),{items:[...r,...d]}}function he(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.multi_select&&r.push("space toggle"),t.batchCount>1&&r.push("\u2190 \u2192 questions"),(e.allow_free_text||e.options.some(n=>n.input===!0))&&r.push("\u270E type your own"),t.canAttach&&r.push("@ attach a file or URL"),t.escBack&&r.push("esc back"),{keys:r}}function ge(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.some(n=>n.free)&&r.push("\u270E type your own"),t.escBack&&r.push("esc back"),{keys:r}}function be(e){let t=["\u2191\u2193 select","\u23CE confirm","1-9 verdict"];return W(e)!==null&&t.push("type = adjust"),t.push("esc \xB7 nothing to undo"),{keys:t}}export{J as a,Z as b,ne as c,V as d,F as e,W as f,ce as g,ue as h,fe as i,he as j,ge as k,be as l};
|
package/dist/chunk-I7TIGB7K.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as v}from"./chunk-UD7KKHPW.js";var E=.8,y="usecase-dedup";function w(n,r){let i=Math.min(n.length,r.length),u=0,s=0,c=0;for(let e=0;e<i;e++)u+=n[e]*r[e],s+=n[e]*n[e],c+=r[e]*r[e];return s===0||c===0?0:u/(Math.sqrt(s)*Math.sqrt(c))}function C(n,r,i){return i*n+(1-i)*r}var D=.7;function A(n){return new Set(n.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").split(" ").filter(Boolean))}function R(n,...r){let i=A(n);if(i.size===0)return 0;let u=n.trim().toLowerCase(),s=0;for(let c of r){let e=A(c);if(e.size===0)continue;let p=0;for(let b of i)e.has(b)&&p++;let m=i.size+e.size-p,d=m===0?0:p/m;u&&c.toLowerCase().includes(u)&&(d=Math.max(d,.9)),s=Math.max(s,d)}return s}var S=n=>String(n.title??"");function _(n){return n.byLabel("usecase").filter(r=>!n.superseded.has(r.cid)).map(r=>({cid:r.cid,text:S(r.content)}))}function L(n,r){let i=r.threshold??E,u=new Map,s=null;return{async batchSimilar(c,e){let p=c.latestHash;if(e.length===0)return{hits:[],degraded:!1,probeBasis:p};let m=_(c),d=[];try{s=(await r.resolveAlias(y)).alias;let f=new Map,g=[];for(let t of m){let a=r.readVector?.(s,t.cid)??null;a!==null?f.set(t.cid,a):g.push(t)}let o=[...e.map(t=>t.probeText),...g.map(t=>t.text)],{vectors:P}=await r.embed(y,o);e.forEach((t,a)=>u.set(t.tempRef,Float32Array.from(P[a]))),g.forEach((t,a)=>{let l=Float32Array.from(P[e.length+a]);f.set(t.cid,l),r.writeVector?.(s,t.cid,l)});for(let t of e){let a=u.get(t.tempRef);for(let l of m){let x=f.get(l.cid);if(x===void 0)continue;let h=C(w(a,x),R(t.probeText,l.text),D);h>=i&&d.push({tempRef:t.tempRef,candidateCid:l.cid,score:h,scorer:"embedding"})}}return{hits:d,degraded:!1,probeBasis:p}}catch(b){v(JSON.stringify({event:"dedup_probe_degraded",contextDir:n,candidates:e.length,reason:String(b?.message??b).slice(0,160),ts:new Date().toISOString()}),"DEDUP_PROBE_DEGRADED");for(let f of e)for(let g of m){let o=R(f.probeText,g.text);o>=i&&d.push({tempRef:f.tempRef,candidateCid:g.cid,score:o,scorer:"lexical_fallback"})}return{hits:d,degraded:!0,probeBasis:p}}},recheckLocal(c,e,p,m){let d=[],b=[],f=new Set;for(let g of m)for(let o of g.nodes){if(o.label!=="usecase"||f.has(o.cid)||(f.add(o.cid),c.superseded.has(o.cid)||!c.hasNode(o.cid)))continue;let P=S(o.content),t=s!==null?r.readVector?.(s,o.cid)??null:null,a=t!==null;for(let l of e){let x=u.get(l.tempRef),h;t!==null&&x!==void 0?h=C(w(x,t),R(l.probeText,P),D):(h=R(l.probeText,P),a=a&&!1),h>=i&&d.push({tempRef:l.tempRef,candidateCid:o.cid,score:h,scorer:t!==null&&x!==void 0?"embedding":"lexical_fallback"})}a||b.push(o.cid)}return{hits:d,uncachedNewNodes:b}}}}export{L as a};
|
package/dist/chunk-IGHK2ENL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{y as o}from"./chunk-CXF6AZWY.js";import{a as m}from"./chunk-HCBYKLMW.js";import{a as e,b as i}from"./chunk-C44QQJR4.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:o.muted,error:o.red,success:o.green,info:o.orange,warning:o.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?o.orange:s[n]);return(0,r.jsxs)(e,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(e,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(e,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=o.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(e,{children:[(0,r.jsx)(e,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(e,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(e,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
|
package/dist/chunk-IICT4VOU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as De}from"./chunk-D6E6KRVX.js";import{a as we,e as Te}from"./chunk-3UI5VTQS.js";import{H as ge,M as re,T as xe,X as Oe,c as ne,d as K,f as fe,m as te,p as be,x as Se}from"./chunk-RDHWNSDP.js";import{f as se,g as O,h as ie,i as ae,j as pe}from"./chunk-XLSOQLVT.js";function Ge(t,i){let r=t.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(r.length>60){let c=r.lastIndexOf("-",60);r=(c>0?r.slice(0,c):r.slice(0,60)).replace(/-+$/g,"")}if(!le.test(r))return null;let e=r;for(let c=2;i(e);c++)e=`${r}-${c}`;return le.test(e)?e:null}var Le={source:"src",usecase:"uc",scenario:"sc",ac:"ac",test:"t",gap:"gap",stylenote:"sty"};function Ze(t,i,r){let e=Le[t];return Ge(e?`${e} ${i}`:i,r)}var Ue={usecase:"uc",scenario:"sc",ac:"ac",test:"t",gap:"gap",stylenote:"sty"},ke=/^(uc|sc|ac|t|gap|sty)-\d+$/i;function Ae(t,i,r){let e=Ue[t];if(!e)return null;let c=new RegExp(`^${e}-(\\d+)$`),p=0;for(let d of r){let a=c.exec(d);if(!a)continue;let n=Number(a[1]);Number.isSafeInteger(n)&&n>p&&(p=n)}let o=p+1;for(;i(`${e}-${o}`);)o+=1;return`${e}-${o}`}import{existsSync as Fe,readFileSync as je}from"fs";function ot(t){return He(t,Oe(t))}function He(t,i,r){let e=new Map(Object.entries(i.heads)),c=new Map(Object.entries(i.trust)),p=new Map(Object.entries(i.nodeLabel)),o=new Map(Object.entries(i.superseded)),d=new Map(Object.entries(i.names)),a=new Map(Object.entries(i.archivedReason)),n=new Set(i.appliedEvents),E=new Map(Object.entries(i.conv)),f=l=>i.media[l]??{format:"text",media_type:"text/plain",anchors_supported:["L-L"]},_=new Map;for(let[l,m]of d)_.set(m,l);let g=new Map,C=l=>{if(g.has(l))return g.get(l);if(!p.has(l))return g.set(l,null),null;let m=r?.get(l);if(m)return g.set(l,m),m;let I=xe(t,l);if(!Fe(I))throw new be(`derived node file missing for ${l} \u2014 run kane-cli context rebuild`);let R=JSON.parse(je(I,"utf8"));return g.set(l,R),R},v=l=>{let m=l,I=new Set;for(;o.has(m)&&!I.has(m);){I.add(m);let R=o.get(m);if(typeof R!="string")break;m=R}return m},w=null,N=l=>{let m=_.get(l);if(m!==void 0)return m;if(w===null){w=new Map;for(let[F,A]of o)typeof A=="string"&&w.set(A,F)}let I=new Set,R=l;for(;!I.has(R);){I.add(R);let F=w.get(R);if(F===void 0)return null;let A=_.get(F);if(A!==void 0)return A;R=F}return null},T=l=>{ke.test(l)&&(l=l.toLowerCase());let m=e.get(l),I=p.has(l)?l:d.get(l)??(typeof m=="string"?m:void 0);if(I===void 0||!p.has(I))return null;let R=v(I);return{cid:I,tip:R,superseded:o.has(I)||o.has(R)}},G=new Map;for(let l of Object.values(i.forward))for(let m of l){let I=G.get(m.dst);I?I.push(m):G.set(m.dst,[m])}let P=l=>(l??[]).filter(m=>!o.has(m.ecid)),W=l=>P(G.get(l)),L=l=>W(l).filter(m=>m.type===O.DERIVES),X=l=>P(i.forward[l]).some(m=>ae(m.type)?.pin?.comparesTo==="dst_tip"&&o.has(m.dst)),oe=l=>{if(o.has(l))return"superseded";let m=L(l);if(m.length===0)return X(l)?"stale":"fresh";let I=new Map;for(let A of m)I.set(A.props.source_id,A);let R=!1,F=!1;for(let[A,k]of I){let M=e.get(A);if(M!=null&&(R=!0,M!==k.props.source_cid)){let ce=E.get(A)?.chain;(!ce||!ce.includes(k.props.source_cid))&&(F=!0)}}return R?F||X(l)?"stale":"fresh":"orphaned"};return{heads:e,trust:c,nodeLabel:p,superseded:o,names:d,nameOf:_,archivedReason:a,appliedEvents:n,convChains:E,mediaOf:f,extractedSourceCids:new Set(i.extracted),extractionCompleteness:new Map(Object.entries(i.completeness??{}).map(([l,{seq:m,...I}])=>[l,I])),designOf:new Map(Object.entries(i.design_of??{})),designGenerationOf:new Map(Object.entries(i.design_generation??{})),latestHash:i.applied.hash,lastSeq:i.applied.seq,hasNode:l=>p.has(l),getNode:C,byLabel:l=>[...p.entries()].filter(([,m])=>m===l).map(([m])=>({cid:m,content:C(m)?.content??{}})),edgesFrom:l=>P(i.forward[l]),edgesInto:W,derivesInto:L,resolve:T,tipOf:v,displayNameOf:N,stale:oe,staleList:()=>[...p.keys()].map(l=>({cid:l,state:oe(l)})).filter(l=>l.state!=="fresh"),execHistory:l=>{let m=T(l);if(!m)return[];let I=v(m.cid),R=new Set([I]),F=!0;for(;F;){F=!1;for(let[k,M]of o)M!==null&&R.has(M)&&!R.has(k)&&(R.add(k),F=!0)}let A=[];for(let k of Object.entries(i.exec??{}))R.has(k[0])&&A.push(...k[1]);return A.sort((k,M)=>k.started_at<M.started_at?-1:1)},retractedEdgesTouching:l=>{let m=new Set([v(l),l]),I=!0;for(;I;){I=!1;for(let[k,M]of o)typeof M=="string"&&m.has(M)&&!m.has(k)&&(m.add(k),I=!0)}let R=i.edgeRetractions??{},F=[],A=new Set;for(let k of m)for(let M of[...i.forward[k]??[],...G.get(k)??[]]){let ce=R[M.ecid];!ce||A.has(M.ecid)||(A.add(M.ecid),F.push({...M,retraction:ce}))}return F}}}function ct(t,i){if(t.stale(i)!=="stale")return!1;let r=new Map;for(let e of t.derivesInto(i))r.set(e.props.source_id,e);for(let[e,c]of r){let p=t.heads.get(e);if(p==null||p===c.props.source_cid)continue;let o=t.convChains.get(e)?.chain;if(!o||!o.includes(c.props.source_cid))return!0}for(let e of t.edgesFrom(i)){if(ae(e.type)?.pin?.comparesTo!=="dst_tip"||!t.superseded.has(e.dst))continue;let c=t.tipOf(e.dst);if(t.superseded.has(c)||t.nodeLabel.get(c)==="usecase")return!0}return!1}function he(t,i){let r=new Map;for(let[o,d]of t.superseded)typeof d=="string"&&d!==o&&r.set(d,[...r.get(d)??[],o]);let e=[],c=[i],p=new Set;for(;c.length>0;){let o=c.pop();p.has(o)||(p.add(o),e.push(o),c.push(...r.get(o)??[]))}return e}function qe(t,i){return(t.extraction_claims??[]).some(r=>r.source_id===i&&r.completeness==="complete")}function Ke(t,i){let r=new Set;for(let e of he(t,i))for(let c of t.derivesInto(e))r.add(c.props?.source_id??"conversation");return r}function ye(t,i){let r=[],e=[],c=t.archived??[];if(c.length===0)return{valid:r,errors:e};let p=new Set([...t.source?[t.source.source_id]:[],...(t.sources??[]).map(d=>d.source_id)]),o=new Set;for(let d of t.use_cases){if(!d.matches_existing)continue;let a=i.resolve(d.matches_existing.cid);a&&o.add(i.tipOf(a.cid))}for(let d of c){let a=`archived[${d.target}]`,n=i.resolve(d.target),E=n?i.tipOf(n.cid):null;if(!E||(i.trust.get(E)??null)==="archived"){e.push({code:"ARCHIVE_TARGET_UNKNOWN",detail:`${a}: target does not resolve to an existing, live item`});continue}let f=Ke(i,E);if(!f.has(d.basis)){e.push({code:"ARCHIVE_FOREIGN_PROVENANCE",detail:`${a}: its provenance does not include ${d.basis} \u2014 an archive claim must come from a source that evidences the item`});continue}if(!p.has(d.basis)){e.push({code:"ARCHIVE_WITHOUT_COMPLETE_CLAIM",detail:`${a}: ${d.basis} was not read by this extraction \u2014 a completeness claim only counts for a source this run actually read`});continue}if(!qe(t,d.basis)){e.push({code:"ARCHIVE_WITHOUT_COMPLETE_CLAIM",detail:`${a}: archiving needs an EXPLICIT complete extraction claim for ${d.basis} (the omitted-claims default does not count) \u2014 add extraction_claims`});continue}if(o.has(E)){e.push({code:"ARCHIVE_TARGET_MATCHED",detail:`${a}: this proposal also matches the target via matches_existing \u2014 a matched item cannot be archived by the same extraction; propose the change as an update instead`});continue}let _=[...f].filter(g=>g!==d.basis);if(_.length>0){e.push({code:"ARCHIVE_OTHER_LIVE_EVIDENCE",detail:`${a}: still evidenced by ${_.join(", ")} \u2014 an item another live source evidences is never archived from here`});continue}r.push({op:d,cid:E})}return{valid:r,errors:e}}function Ce(t,i,r){return t.superseded.has(r)}function Me(t){let{graph:i,oldTip:r,newCid:e,newLabel:c,by:p}=t,o=[],d=[],a=[],n=[],E=new Set;for(let f of i.edgesFrom(r)){if(f.type===O.DERIVES||t.skipEcids?.has(f.ecid))continue;d.push({kind:"edge",ecid:f.ecid,reason:t.reason,by:p}),E.add(f.ecid);let _=t.dstRedirect?.get(f.dst)??f.dst,g=i.nodeLabel.get(f.dst)??"(unknown)",C=pe(f.type,c,g,f.props);if(C.length>0){a.push(`rebless ${f.type} \u2192 ${f.dst}: ${C.map(N=>N.detail).join("; ")}`);continue}let v=De(i,{type:f.type,src:e,dst:_},{pending:n,retracted:E},`rebless ${f.type}`);if(v){a.push(v.detail);continue}let w=K(f.type,e,_,f.props);if(i.superseded.has(w)){a.push(`rebless ${f.type} \u2192 ${_}: the re-derived edge (${w}) was retracted \u2014 retraction is terminal, the successor cannot revive it`);continue}o.push({ecid:w,type:f.type,src:e,dst:_,props:f.props}),n.push({src:e,dst:_,type:f.type})}return{edges:o,supersessions:d,errors:a}}var le=/^[a-z0-9][a-z0-9-]{1,63}$/;function Pe(t,i,r,e){if(!i)return{error:{code:"SUPERSEDE_TARGET_MISSING",detail:"supersede verdict needs a target (slug or cid)"}};let c=t.resolve(i);return c?c.superseded||e.has(c.cid)?{error:{code:"ALREADY_SUPERSEDED",detail:`${i} is already superseded (tip: ${c.tip})`}}:c.cid===r?{error:{code:"SELF_SUPERSEDE",detail:"a node cannot supersede itself"}}:{targetCid:c.cid}:{error:{code:"UNKNOWN_SUPERSEDE_TARGET",detail:`${i} names nothing in the graph`}}}function We(t,i,r,e,c=[]){if(!ae(i)?.acyclic)return null;if(r===e)return{code:"EDGE_CYCLE",detail:`${i} ${r} \u2192 itself`};let o=n=>[...t.edgesFrom(n).filter(E=>E.type===i).map(E=>E.dst),...c.filter(E=>E.type===i&&E.src===n).map(E=>E.dst)],d=new Set,a=[e];for(;a.length>0;){let n=a.pop();if(n===r)return{code:"EDGE_CYCLE",detail:`${i} ${r} \u2192 ${e} closes a cycle`};d.has(n)||(d.add(n),a.push(...o(n)))}return null}function Rt(t,i,r,e){let p=ae(i)?.cardinality;if(p!=="one-live-per-src"&&p!=="one-live-per-src-and-dst")return null;let o=t.edgesFrom(r).filter(d=>d.type===i&&!t.superseded.has(d.dst));if(o.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${i} from ${r} already has a live edge (${o[0].ecid}) \u2014 supersede it first`};if(p==="one-live-per-src-and-dst"&&e!==void 0){let d=t.edgesInto(e).filter(a=>a.type===i&&!t.superseded.has(a.src));if(d.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${i} onto ${e} already has a live edge (${d[0].ecid}) \u2014 strict 1:1, supersede it first`}}return null}var Ie=new Set(["high","med","low"]),me=t=>t.cites&&t.cites.length>0?t.cites:[t.cite];function _e(t){let i=0;for(let r of t)typeof r=="object"&&r!==null&&"op"in r&&i++;return i===0?"flat":i===t.length?"ops":"mixed"}var Be=/^c[1-9][0-9]*$/;function Ve(t,i,r,e){let c=new Map,p=[],o=[];for(let[a,n]of i.entries()){let E=`${t}.updated.criteria[${a}]`;if(n.op==="keep"||n.op==="remove"){if(!Be.test(n.ref??"")){e.push({code:"CRITERIA_REF_UNKNOWN",detail:`${E}: ref ${JSON.stringify(n.ref)} is not a c<N> criterion index`});continue}if(c.has(n.ref)){e.push({code:"CRITERIA_REF_DUPLICATE",detail:`${E}: ${n.ref} is already named by another op \u2014 every prior criterion appears in exactly one keep or remove`});continue}c.set(n.ref,n);let f=Number.parseInt(n.ref.slice(1),10);if(f>r.length){e.push({code:"CRITERIA_REF_UNKNOWN",detail:`${E}: ${n.ref} \u2014 the live target has ${r.length} criteria`});continue}if(r[f-1]!==n.text){e.push({code:"CRITERIA_REF_MISMATCH",detail:`${E}: ${n.ref} echo mismatch \u2014 the live target's criterion ${f} reads ${JSON.stringify(r[f-1])}, the op echoed ${JSON.stringify(n.text)} \u2014 re-read the node and re-emit`});continue}n.op==="remove"&&(p.push(n.text),(!n.reason||!n.reason.trim())&&e.push({code:"EMPTY_REASON",detail:`${E}: a remove op carries its reason`}))}else!n.text||!n.text.trim()?e.push({code:"EMPTY_CRITERION",detail:`${E}: set text is empty`}):o.push(n.text)}let d=[];for(let a=1;a<=r.length;a++)c.has(`c${a}`)||d.push(`c${a}`);d.length>0&&e.push({code:"CRITERIA_PARTITION_INCOMPLETE",detail:`${t}: prior criteria ${d.join(", ")} named by no keep/remove op \u2014 every prior criterion must be kept or removed (with a reason)`});for(let a of p)o.includes(a)&&e.push({code:"CRITERIA_OP_CONFLICT",detail:`${t}: ${JSON.stringify(a)} is removed AND re-set in the same update \u2014 drop one of the two ops`})}function bt(t,i,r){let e=[],c=t.sources??[t.source],p=new Map(c.map(n=>[n.source_id,n.source_cid])),o=new Map;if(typeof i=="string")o.set(t.source.source_id,{media:r.mediaOf(t.source.source_cid),numberedText:i});else for(let[n,E]of i)o.set(n,E);for(let n of c)r.hasNode(n.source_cid)||e.push({code:"MISSING_SOURCE_NODE",detail:`source ${n.source_id} (${n.source_cid}) is not a committed node \u2014 ingest it first`});let d=(n,E)=>{let f=E.source_id??t.source.source_id;if(!p.has(f)){e.push({code:"CITE_SOURCE_UNKNOWN",detail:`${n}: cite source ${JSON.stringify(f)} is not in read_basis`});return}let _=o.get(f);if(!_){e.push({code:"MISSING_SOURCE_NODE",detail:`${n}: no citable text available for source ${f}`});return}for(let g of Te(_.media,E,_.numberedText))e.push({code:g.code,detail:`${n}: ${g.detail}`})},a=new Set;for(let n of t.use_cases){if(a.has(n.temp_ref)&&e.push({code:"DUP_TEMP_REF",detail:`duplicate temp_ref ${n.temp_ref}`}),a.add(n.temp_ref),(!n.title||!n.title.trim())&&e.push({code:"EMPTY_TITLE",detail:`${n.temp_ref}: title is empty`}),Ie.has(n.risk)||e.push({code:"BAD_RISK",detail:`${n.temp_ref}: risk ${JSON.stringify(n.risk)} not in high|med|low`}),!n.cite||!n.cite.anchor)e.push({code:"MISSING_CITE",detail:`${n.temp_ref}: every derived use-case must carry a cite`});else for(let f of me(n))d(n.temp_ref,f);n.matches_existing&&!r.hasNode(n.matches_existing.cid)&&e.push({code:"UNKNOWN_MATCH",detail:`${n.temp_ref}: matches_existing ${n.matches_existing.cid} is not in the graph`});for(let[f,_]of(n.criteria??[]).entries())(!_.text||!_.text.trim())&&e.push({code:"EMPTY_CRITERION",detail:`${n.temp_ref}.criteria[${f}]: text is empty`}),!_.cite||!_.cite.anchor?e.push({code:"MISSING_CITE",detail:`${n.temp_ref}.criteria[${f}]: every criterion carries its own cite`}):d(`${n.temp_ref}.criteria[${f}]`,_.cite);let E=n.updated?.criteria??[];if(E.length>0){let f=_e(E);if(f==="mixed")e.push({code:"CRITERIA_SHAPE_MIXED",detail:`${n.temp_ref}.updated.criteria mixes op-shaped (keep/set/remove) and {text, cite} entries \u2014 emit ONE shape for the whole array`});else if(f==="ops"){let _=E,g=n.matches_existing?Xe(r,n.matches_existing.cid):null;if(!g)e.push({code:"CRITERIA_REF_UNKNOWN",detail:`${n.temp_ref}: op-union criteria address a prior version \u2014 they need a resolvable matches_existing target`});else{let C=r.getNode(g.cid)?.content.criteria??[];Ve(n.temp_ref,_,C,e)}for(let[C,v]of _.entries())v.op==="set"&&(!v.cite||!v.cite.anchor?e.push({code:"MISSING_CITE",detail:`${n.temp_ref}.updated.criteria[${C}]: a set op carries the proposing source's cite`}):d(`${n.temp_ref}.updated.criteria[${C}]`,v.cite))}else for(let[_,g]of E.entries())(!g.text||!g.text.trim())&&e.push({code:"EMPTY_CRITERION",detail:`${n.temp_ref}.updated.criteria[${_}]: text is empty`}),!g.cite||!g.cite.anchor?e.push({code:"MISSING_CITE",detail:`${n.temp_ref}.updated.criteria[${_}]: every updated criterion carries its own cite`}):d(`${n.temp_ref}.updated.criteria[${_}]`,g.cite)}}return e.push(...ye(t,r).errors),e}function Je(t,i,r){return`${t}:${i}:${r}`}function Ye(t,i,r,e){let c=`${i}:${r}:`,p=0;for(let o of t.appliedEvents){if(!o.startsWith(c))continue;let d=o.slice(c.length);if(!/^\d+$/.test(d))continue;let a=Number.parseInt(d,10);a>p&&(p=a)}return Array.from({length:e},(o,d)=>Je(i,r,p+1+d))}function Xe(t,i){let r=t.resolve(i);if(r===null)return null;let e=r.cid;if(t.superseded.has(e)){let c=t.tipOf(e);return t.superseded.has(c)?null:{cid:c,redirected:!0}}return{cid:e,redirected:!1}}function xt(t){let{contextDir:i,graph:r,proposal:e,proposalId:c,verdicts:p,by:o,allowStaleBasis:d,extractorVersion:a,autoName:n}=t,E=ge(i);if(!d&&e.read_basis!==E)return{record:null,errors:[{code:"STALE_BASIS",detail:`proposal read_basis ${String(e.read_basis)} != latest ${String(E)}`}]};for(let s of e.sources??[e.source])if(!r.hasNode(s.source_cid))return{record:null,errors:[{code:"MISSING_SOURCE_NODE",detail:`source ${s.source_id} (${s.source_cid}) is not a committed node \u2014 ingest it first`}]};let f=new Map((e.sources??[e.source]).map(s=>[s.source_id,s.source_cid])),_={supersedeTarget:{},matches_existing:{},conflicts_with:{},depends_on_hint:{},read_basis_heads:Object.fromEntries(f)},g=[],C=[],v=new Map,w=[],N=r.mediaOf(e.source.source_cid),T=new Set,G=[],P=[],W=[],L=[];for(let s of ye(e,r).valid)L.push({id:s.cid,kind:"pending_archive",resolution:"pending",edit:null,reason:s.op.reason,by:o});let X=[],oe=[],l=new Set,m=new Set,I=(s,h,j)=>{let Y=Pe(r,h.supersedeTarget,j,l);if("error"in Y){g.push({code:Y.error.code,detail:`${s}: ${Y.error.detail}`});return}l.add(Y.targetCid),_.supersedeTarget[s]=Y.targetCid,X.push({kind:"node",old:Y.targetCid,new:j,reason:h.reason??`superseded via review by ${o.id}`,by:o})};for(let s of e.use_cases){let h=p.get(s.temp_ref)??{resolution:"skipped"};T.has(s.temp_ref)&&g.push({code:"DUP_TEMP_REF",detail:`duplicate temp_ref ${s.temp_ref}`}),T.add(s.temp_ref),s.conflicts_with&&(_.conflicts_with[s.temp_ref]=s.conflicts_with.map(u=>r.resolve(u)?.cid??null)),(!s.title||!s.title.trim())&&g.push({code:"EMPTY_TITLE",detail:`${s.temp_ref}: title is empty`}),Ie.has(s.risk)||g.push({code:"BAD_RISK",detail:`${s.temp_ref}: risk ${JSON.stringify(s.risk)} not in high|med|low`});let j=we(s.cite?.anchor??""),Y=s.cite?.source_id!==void 0&&f.has(s.cite.source_id)?r.mediaOf(f.get(s.cite.source_id)):N;if(Y.format==="image"){if(j?.kind!=="img-whole"){g.push({code:s.cite?.anchor?"CITE_ANCHOR_INVALID":"MISSING_CITE",detail:`${s.temp_ref}: image cites are anchor-only (img#whole)`});continue}}else if(j?.kind==="img-part"){if(!(Y.images??[]).some(S=>S.ref===j.ref)){g.push({code:"CITE_ANCHOR_INVALID",detail:`${s.temp_ref}: anchor ${s.cite?.anchor} names no embedded image of this source version`});continue}}else if(!s.cite||!s.cite.anchor||!s.cite.quote){g.push({code:"MISSING_CITE",detail:`${s.temp_ref}: every derived use-case must cite anchor+quote`});continue}h.resolution==="edited"&&h.edit&&(h.edit.title!==void 0&&!h.edit.title.trim()&&g.push({code:"EMPTY_TITLE",detail:`${s.temp_ref}: edited title is empty`}),h.edit.risk!==void 0&&!Ie.has(h.edit.risk)&&g.push({code:"BAD_RISK",detail:`${s.temp_ref}: edited risk ${JSON.stringify(h.edit.risk)} invalid`}));let Ee=fe({title:h.edit?.title??s.title,description:s.description,summary:h.edit?.summary??s.summary,actors:s.actors,value:s.value,risk:h.edit?.risk??s.risk,...s.criteria&&s.criteria.length>0?{criteria:s.criteria.map(u=>u.text)}:{}}),b=ne("usecase",Ee),ve=s.cite.source_id??e.source.source_id,$e=f.get(ve);if(s.cite.source_id!==void 0&&$e===void 0){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(ve)} is not in read_basis`});continue}let ee={source_id:ve,source_cid:$e??e.source.source_cid,anchor:s.cite.anchor,...s.cite.quote?{quote:s.cite.quote}:{}};if(s.matches_existing&&!r.hasNode(s.matches_existing.cid)){g.push({code:"UNKNOWN_MATCH",detail:`${s.temp_ref}: matches_existing ${s.matches_existing.cid} is not in the graph`});continue}let x=s.matches_existing?.cid??(r.hasNode(b)?b:null);if(x&&r.superseded.has(x)){let u=r.tipOf(x);x=r.superseded.has(u)?null:u}if(x&&s.matches_existing&&(_.matches_existing[s.temp_ref]=x),x&&s.matches_existing&&(r.trust.get(x)??null)==="derived"){let u=s.updated?.criteria??[];if(s.changed&&u.length>0&&_e(u)==="ops"&&(h.resolution==="approved"||h.resolution==="edited")){g.push({code:"UC_UNREVIEWED",detail:`${s.temp_ref}: merge target ${x.slice(0,19)} is unreviewed (derived) \u2014 bless it first (kane-cli context review) and re-propose the merge`});continue}let S=(t.probeHits??[]).find(y=>y.tempRef===s.temp_ref&&y.candidateCid===x);w.push({tempRef:s.temp_ref,candidate_cid:x,score:S?.score??1,scorer:S?.scorer??"lexical_fallback"}),x=null}if(x){if(s.changed&&(h.resolution==="approved"||h.resolution==="edited")){let u=s.updated;if(!u||Object.keys(u).length===0){g.push({code:"CHANGED_NEEDS_PAYLOAD",detail:`${s.temp_ref}: changed:true needs an updated{...} payload naming the moved fields`});continue}let S=r.getNode(x)?.content??{},y=u.criteria??[],V=y.length>0?_e(y):"flat";if(V==="mixed"){g.push({code:"CRITERIA_SHAPE_MIXED",detail:`${s.temp_ref}.updated.criteria mixes op-shaped (keep/set/remove) and {text, cite} entries \u2014 emit ONE shape for the whole array`});continue}if(V==="ops"){let U=y,H=S.criteria??[],q=g.length;Ve(s.temp_ref,U,H,g);for(let[de,ue]of U.entries())ue.op==="set"&&(!ue.cite||!ue.cite.anchor)&&g.push({code:"MISSING_CITE",detail:`${s.temp_ref}.updated.criteria[${de}]: a set op carries the proposing source's cite`});if(g.length>q)continue;let D=U.filter(de=>de.op!=="remove").map(de=>de.text),J=fe({title:h.edit?.title??u.title??String(S.title??s.title),...u.description??S.description?{description:u.description??S.description}:{},...h.edit?.summary??u.summary??S.summary?{summary:h.edit?.summary??u.summary??S.summary}:{},...u.actors??S.actors?{actors:u.actors??S.actors}:{},...u.value??S.value?{value:u.value??S.value}:{},risk:h.edit?.risk??u.risk??String(S.risk??s.risk),...D.length>0?{criteria:D}:{}}),Q=ne("usecase",J);if(Q!==x){for(let $ of ie("usecase",J))g.push({code:$.code,detail:`${s.temp_ref}: ${$.detail}`});G.push({cid:Q,label:se.USECASE,content:J});for(let $ of me(s)){let z=$.source_id??e.source.source_id,B=f.get(z);if(!B){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(z)} is not in read_basis`});continue}let Z={source_id:z,source_cid:B,anchor:$.anchor,...$.quote?{quote:$.quote}:{}};P.push({ecid:K("DERIVES",B,Q,Z),type:O.DERIVES,src:B,dst:Q,props:Z})}let ue=he(r,x).flatMap($=>r.edgesInto($)).filter($=>$.type===O.DERIVES&&typeof $.props.claim=="string");for(let $ of U){if($.op!=="keep")continue;let z=new Set;for(let B of ue){let Z=B.props;if(Z.claim!==$.text)continue;let Ne=`${Z.source_id}|${Z.source_cid}|${Z.anchor}`;if(z.has(Ne))continue;z.add(Ne);let Re={...B.props};P.push({ecid:K("DERIVES",B.src,Q,Re),type:O.DERIVES,src:B.src,dst:Q,props:Re})}}for(let $ of U){if($.op!=="set")continue;let z=$.cite.source_id??e.source.source_id,B=f.get(z);if(!B){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: set cite source ${JSON.stringify(z)} is not in read_basis`});continue}let Z={source_id:z,source_cid:B,anchor:$.cite.anchor,...$.cite.quote?{quote:$.cite.quote}:{},claim:$.text};P.push({ecid:K("DERIVES",B,Q,Z),type:O.DERIVES,src:B,dst:Q,props:Z})}for(let $ of U)$.op==="remove"&&C.push({about:x,ref:$.ref,text:$.text,reason:$.reason});I(s.temp_ref,{resolution:"supersede",supersedeTarget:x,reason:h.reason??`criteria merge: ${e.source.source_id} (${U.filter($=>$.op==="keep").length} kept, ${U.filter($=>$.op==="set").length} set, ${U.filter($=>$.op==="remove").length} removed)`},Q),L.push({id:Q,kind:"review-item",resolution:h.resolution,edit:h.resolution==="edited"?{...h.edit}:null,reason:null,by:o});continue}}else{let U=y.map(D=>typeof D=="string"?{text:D,cite:void 0}:D),H=fe({title:h.edit?.title??u.title??String(S.title??s.title),...u.description??S.description?{description:u.description??S.description}:{},...h.edit?.summary??u.summary??S.summary?{summary:h.edit?.summary??u.summary??S.summary}:{},...u.actors??S.actors?{actors:u.actors??S.actors}:{},...u.value??S.value?{value:u.value??S.value}:{},risk:h.edit?.risk??u.risk??String(S.risk??s.risk),...u.criteria?U.length>0?{criteria:U.map(D=>D.text)}:{}:S.criteria?{criteria:S.criteria}:{}}),q=ne("usecase",H);if(q!==x){for(let D of ie("usecase",H))g.push({code:D.code,detail:`${s.temp_ref}: ${D.detail}`});G.push({cid:q,label:se.USECASE,content:H}),P.push({ecid:K("DERIVES",ee.source_cid,q,ee),type:O.DERIVES,src:ee.source_cid,dst:q,props:ee});for(let D of U){if(!D.cite)continue;let J={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:D.cite.anchor,...D.cite.quote?{quote:D.cite.quote}:{},claim:D.text};P.push({ecid:K("DERIVES",J.source_cid,q,J),type:O.DERIVES,src:J.source_cid,dst:q,props:J})}I(s.temp_ref,{resolution:"supersede",supersedeTarget:x,reason:h.reason??`matches-but-changed: ${e.source.source_id} moved (${Object.keys(u).join(", ")})`},q),L.push({id:q,kind:"review-item",resolution:h.resolution,edit:h.resolution==="edited"?{...h.edit}:null,reason:null,by:o});continue}for(let D of U){if(!D.cite)continue;let J={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:D.cite.anchor,...D.cite.quote?{quote:D.cite.quote}:{},claim:D.text};P.push({ecid:K("DERIVES",J.source_cid,x,J),type:O.DERIVES,src:J.source_cid,dst:x,props:J})}}}if(s.changed&&h.resolution==="skipped"){let u=s.updated?.criteria??[];u.length>0&&_e(u)==="ops"&&L.push({id:x,kind:"pending_update",resolution:"pending",edit:{temp_ref:s.temp_ref,source_id:e.source.source_id,updated:s.updated},reason:s.change_note??null,by:o})}if(h.resolution!=="rejected"){for(let u of me(s)){let S=u.source_id??e.source.source_id,y=f.get(S);if(!y){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:y,anchor:u.anchor,...u.quote?{quote:u.quote}:{}};P.push({ecid:K("DERIVES",y,x,V),type:O.DERIVES,src:y,dst:x,props:V})}(h.resolution==="approved"||h.resolution==="edited"||h.resolution==="supersede")&&L.push({id:x,kind:"review-item",resolution:"approved",edit:null,reason:null,by:o}),h.resolution==="supersede"&&I(s.temp_ref,h,x)}continue}for(let u of ie("usecase",Ee))g.push({code:u.code,detail:`${s.temp_ref}: ${u.detail}`});for(let u of pe(O.DERIVES,"source","usecase",ee))g.push({code:u.code,detail:`${s.temp_ref}: ${u.detail}`});G.push({cid:b,label:se.USECASE,content:Ee}),v.set(s.temp_ref,b),P.push({ecid:K("DERIVES",ee.source_cid,b,ee),type:O.DERIVES,src:ee.source_cid,dst:b,props:ee});for(let u of me(s).slice(1)){let S=u.source_id??e.source.source_id,y=f.get(S);if(!y){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:y,anchor:u.anchor,...u.quote?{quote:u.quote}:{}};for(let U of pe(O.DERIVES,"source","usecase",V))g.push({code:U.code,detail:`${s.temp_ref}: ${U.detail}`});P.push({ecid:K("DERIVES",y,b,V),type:O.DERIVES,src:y,dst:b,props:V})}for(let u of s.criteria??[]){let S=u.cite.source_id??e.source.source_id,y=f.get(S);if(!y){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: criterion cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:y,anchor:u.cite.anchor,...u.cite.quote?{quote:u.cite.quote}:{},claim:u.text};P.push({ecid:K("DERIVES",V.source_cid,b,V),type:O.DERIVES,src:V.source_cid,dst:b,props:V})}for(let u of s.depends_on_hint??[]){let S=H=>H.toLowerCase().trim().replace(/\s+/g," "),y=null,V=r.resolve(u);if(V&&!V.superseded&&r.nodeLabel.get(V.cid)===se.USECASE&&(y=V.cid),!y){for(let{cid:H,content:q}of r.byLabel(se.USECASE))if(!r.superseded.has(H)&&S(String(q.title??""))===S(u)){y=H;break}}if(!y){let H=G.find(q=>q.label===se.USECASE&&S(String(q.content.title??""))===S(u));H&&(y=H.cid)}!y||y===b||We(r,O.DEPENDS_ON,b,y,W)||W.some(H=>H.src===b&&H.dst===y)||(P.push({ecid:K(O.DEPENDS_ON,b,y,{reason:"extract hint"}),type:O.DEPENDS_ON,src:b,dst:y,props:{reason:"extract hint"}}),W.push({src:b,dst:y,type:O.DEPENDS_ON}),(_.depends_on_hint[s.temp_ref]??=[]).push(y))}if((h.resolution==="approved"||h.resolution==="edited"||h.resolution==="supersede")&&r.superseded.get(b)===null&&!l.has(b)&&X.push({kind:"node",old:b,new:b,reason:`re-minted after tombstone via review by ${o.id}`,by:o}),n){let u=Ae("usecase",S=>m.has(S),r.names.keys());u!==null&&!r.nameOf.has(b)&&(m.add(u),oe.push({cid:b,slug:u,by:o}))}h.resolution==="approved"?L.push({id:b,kind:"review-item",resolution:"approved",edit:null,reason:null,by:o}):h.resolution==="edited"?L.push({id:b,kind:"review-item",resolution:"edited",edit:{...h.edit},reason:null,by:o}):h.resolution==="rejected"?L.push({id:b,kind:"review-item",resolution:"rejected",edit:null,reason:h.reason??null,by:o}):h.resolution==="supersede"&&(L.push({id:b,kind:"review-item",resolution:"approved",edit:null,reason:h.reason??null,by:o}),I(s.temp_ref,h,b))}if(g.length)return{record:null,errors:g};let R=new Date().toISOString(),F=(e.sources?.length??0)>1||(e.extraction_claims?.length??0)>0,A;if(F){let s=[];if(e.extraction_claims==null)s.push({source_id:e.source.source_id,source_cid:e.source.source_cid,completeness:"complete",...a?{extractor_version:a}:{},at:R});else{let h=new Map(e.extraction_claims.map(j=>[j.source_id,j.completeness]));for(let j of e.sources??[e.source]){let Y=h.get(j.source_id)??null;Y!==null&&s.push({source_id:j.source_id,source_cid:j.source_cid,completeness:Y,...a?{extractor_version:a}:{},at:R})}}A=s}else A=e.source.source_cid;let k=[];for(let s of t.probeHits??[])k.push({...v.has(s.tempRef)?{new_cid:v.get(s.tempRef)}:{},candidate_cid:s.candidateCid,score:s.score,scorer:s.scorer,probe_basis:null});for(let s of w){let h=v.get(s.tempRef);k.some(j=>j.new_cid===h&&j.candidate_cid===s.candidate_cid)||k.push({...h!==void 0?{new_cid:h}:{},candidate_cid:s.candidate_cid,score:s.score,scorer:s.scorer,probe_basis:null})}let M=t.eventIds&&t.eventIds.length>0?t.eventIds:t.sid?Ye(r,t.sid,"extract",1):void 0;return{record:re(i,{ts:R,proposal_id:c,...c!=null?{extraction_of:A}:{},...c!=null&&a?{extractor_version:a}:{},...C.length>0?{criteria_removed:C}:{},...k.length>0?{dedup_hits:k}:{},nodes:G,edges:P,review:L,supersessions:X,...oe.length>0?{names:oe}:{},...t.judgements&&t.judgements.length>0?{judgements:t.judgements}:{},...M?{event_ids:M}:{},...t.sid?{sid:t.sid}:{},source_head_moves:{}},{expectPrev:E,intent:{v:1,verb:"extract",args:te({proposal:e,proposalId:c,verdicts:Object.fromEntries(p),by:o,flags:{allowStaleBasis:d??null,autoName:n??null,extractorVersion:a??null,sid:t.sid??null},judgements:t.judgements??null,probeHits:t.probeHits??null,eventIds:M??null}),pins:_},provenance:t.provenance}).record,errors:null}}function Ot(t){let{contextDir:i,graph:r,verdicts:e,by:c}=t,p=[],o=[],d=[],a=[],n=[],E=new Set,f={verdicts:{},supersedeTarget:{}},_=new Map;for(let[C,v]of e){if(v.resolution!=="edited")continue;let w=r.resolve(C);if(!w||w.superseded)continue;let N=r.getNode(w.cid);if(!N)continue;let T={...N.content,...v.edit?.title!==void 0?{title:v.edit.title}:{},...v.edit?.summary!==void 0?{summary:v.edit.summary}:{},...v.edit?.risk!==void 0?{risk:v.edit.risk}:{}};if(ie(N.label,T).length>0)continue;let G=ne(N.label,T);G===w.cid||Ce(r,w.cid,G)||_.set(w.cid,G)}for(let[C,v]of e){if(v.resolution==="skipped")continue;let w=r.resolve(C);if(!w){p.push({code:"UNKNOWN_NODE",detail:`${C} names nothing in the graph`});continue}if(w.superseded){p.push({code:"SUPERSEDED_TARGET",detail:`${C} is superseded \u2014 review the tip (${w.tip})`});continue}let N=w.cid;if(f.verdicts[C]=N,v.resolution==="approved")a.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:null,by:c});else if(v.resolution==="rejected")t.holdArchives?a.push({id:N,kind:"pending_archive",resolution:"pending",edit:null,reason:v.reason??null,by:c}):a.push({id:N,kind:"review-item",resolution:"rejected",edit:null,reason:v.reason??null,by:c});else if(v.resolution==="edited"){if(E.has(N)){p.push({code:"DUPLICATE_TARGET",detail:`${C}: this node was already superseded by another verdict in this batch \u2014 one verdict per node`});continue}let T=r.getNode(N);if(!T){p.push({code:"UNKNOWN_NODE",detail:`${C}: node file unreadable`});continue}let G={...T.content,...v.edit?.title!==void 0?{title:v.edit.title}:{},...v.edit?.summary!==void 0?{summary:v.edit.summary}:{},...v.edit?.risk!==void 0?{risk:v.edit.risk}:{}},P=ie(T.label,G);if(P.length>0){for(let X of P)p.push({code:X.code,detail:`${C}: ${X.detail}`});continue}let W=ne(T.label,G);if(W===N){a.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:null,by:c});continue}if(Ce(r,N,W)){p.push({code:"SUPERSEDE_CYCLE",detail:`${C}: edit reproduces an already-superseded version (supersession cycle guard) \u2014 re-edit forward or redesign`});continue}let L=Me({graph:r,oldTip:N,newCid:W,newLabel:T.label,by:c,reason:`re-blessed onto ${W} (edited in review)`,dstRedirect:_});if(L.errors.length>0){for(let X of L.errors)p.push({code:"REBLESS_REFUSED",detail:`${C}: ${X}`});continue}o.push({cid:W,label:T.label,content:G}),d.push(...L.edges),E.add(N),n.push({kind:"node",old:N,new:W,reason:v.reason??"edited in review",by:c}),n.push(...L.supersessions),a.push({id:W,kind:"review-item",resolution:"edited",edit:{...v.edit},reason:null,by:c})}else if(v.resolution==="supersede"){let T=Pe(r,v.supersedeTarget,N,E);if("error"in T){p.push({code:T.error.code,detail:`${C}: ${T.error.detail}`});continue}E.add(T.targetCid),f.supersedeTarget[C]=T.targetCid,t.holdArchives?a.push({id:T.targetCid,kind:"pending_archive",resolution:"pending",edit:null,reason:`supersede by ${N}${v.reason?` \u2014 ${v.reason}`:""}`,by:c}):(n.push({kind:"node",old:T.targetCid,new:N,reason:v.reason??`superseded via review by ${c.id}`,by:c}),a.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:v.reason??null,by:c}))}}return p.length?{record:null,errors:p}:a.length===0&&n.length===0?{record:null,errors:[{code:"NO_VERDICTS",detail:"every item was skipped \u2014 nothing to commit"}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:o,edges:d,review:a,supersessions:n,source_head_moves:{}},{expectPrev:r.latestHash,intent:{v:1,verb:"review",args:te({verdicts:Object.fromEntries(e),by:c,holdArchives:t.holdArchives??null}),pins:f},provenance:t.provenance}).record,errors:null}}function wt(t){let{contextDir:i,graph:r,survivor:e,merged:c,reason:p,by:o}=t,d=r.resolve(e),a=r.resolve(c);return d?a?d.superseded||a.superseded?{record:null,errors:[{code:"ALREADY_SUPERSEDED",detail:"a side of the pair is already superseded \u2014 the pair is drained"}]}:d.cid===a.cid?{record:null,errors:[{code:"SELF_SUPERSEDE",detail:"a pair cannot merge a node into itself"}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:a.cid,new:d.cid,reason:p??`pair merge: duplicate of ${e}`,by:o}],source_head_moves:{}},{expectPrev:r.latestHash,intent:{v:1,verb:"pair-merge",args:te({survivor:e,merged:c,reason:p??null,by:o}),pins:{survivor:d.cid,merged:a.cid}},provenance:t.provenance}).record,errors:null}:{record:null,errors:[{code:"UNKNOWN_NODE",detail:`${c} names nothing in the graph`}]}:{record:null,errors:[{code:"UNKNOWN_NODE",detail:`${e} names nothing in the graph`}]}}function Tt(t){let{contextDir:i,graph:r,assignments:e,by:c}=t,p=new Set(t.reassign??[]),o=[],d=[],a=new Set,n={};for(let{ref:f,slug:_}of e){if(!le.test(_)){o.push({code:"BAD_SLUG",detail:`${JSON.stringify(_)} \u2014 slugs are kebab-case ${String(le)}`});continue}let g=r.resolve(f);if(!g){o.push({code:"UNKNOWN_REF",detail:`${f} names nothing in the graph`});continue}if(g.superseded){o.push({code:"SUPERSEDED_TARGET",detail:`${f} is superseded \u2014 name the tip instead (${g.tip})`});continue}let C=r.names.get(_);if(C!==void 0&&!r.superseded.has(C)&&C!==g.cid&&!p.has(_)||a.has(_)){o.push({code:"SLUG_TAKEN",detail:`${_} already names ${C??"another node in this record"}`});continue}a.add(_),n[f]=g.cid,d.push({cid:g.cid,slug:_,by:c})}return o.length?{record:null,errors:o}:d.length===0?{record:null,errors:[{code:"NO_ASSIGNMENTS",detail:"nothing to name"}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],names:d,source_head_moves:{}},{expectPrev:r.latestHash,intent:{v:1,verb:"names",args:te({assignments:e,by:c,...t.reassign&&t.reassign.length>0?{reassign:t.reassign}:{}}),pins:{refs:n}},provenance:t.provenance}).record,errors:null}}function Dt(t){let{contextDir:i,graph:r,sourceId:e,reason:c,by:p}=t,o=r.heads.get(e);return o===void 0?{record:null,errors:[{code:"UNKNOWN_SOURCE",detail:`no source ${e} in the graph`}]}:o===null?{record:null,errors:[{code:"ALREADY_RETIRED",detail:`source ${e} is already retired`}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:o,new:null,reason:c??`retired source ${e}`,by:p}],source_head_moves:{[e]:null},names:[]},{expectPrev:r.latestHash,intent:{v:1,verb:"retire",args:te({sourceId:e,reason:c??null,by:p}),pins:{head:o}},provenance:t.provenance}).record,errors:null}}function kt(t){let i=ie("gap",t.content);if(i.length>0)return{ok:!1,refusal:`defer gap failed schema validation: ${i.map(p=>p.detail).join("; ")}`};let r=ne("gap",t.content),e={reason:"reconcile change deferred"},c=t.annotates?[{ecid:K(O.ANNOTATES,r,t.annotates,e),type:O.ANNOTATES,src:r,dst:t.annotates,props:e}]:[];for(let p=0;;p++)try{return re(t.contextDir,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:r,label:"gap",content:t.content}],edges:c,review:[],supersessions:[],source_head_moves:{}},{expectPrev:ge(t.contextDir),intent:{v:1,verb:"gap",args:te({content:t.content,annotates:t.annotates??null}),pins:{annotates:t.annotates??null}},provenance:t.provenance}),{ok:!0,cid:r}}catch(o){if(o instanceof Se){if(p<3)continue;return{ok:!1,refusal:"concurrent activity kept moving the store \u2014 try the card again"}}throw o}}function At(t){let i=t.graph.byLabel("gap").filter(r=>(t.gaps===void 0||t.gaps.includes(r.cid))&&r.content.kind==="reconcile_deferred"&&typeof r.content.uc=="string"&&t.graph.tipOf(r.content.uc)===t.targetTip&&(t.sourceId===void 0||r.content.basis?.source_id===void 0||r.content.basis.source_id===t.sourceId)&&!t.graph.superseded.has(r.cid)&&t.graph.trust.get(r.cid)!=="archived");if(i.length===0)return{resolved:0};for(let r=0;;r++)try{return re(t.contextDir,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:i.map(e=>({kind:"node",old:e.cid,new:t.resolvedBy,reason:"reconcile change resolved by a later verdict",by:t.by})),source_head_moves:{}},{expectPrev:ge(t.contextDir),intent:{v:1,verb:"gap-close",args:te({targetTip:t.targetTip,resolvedBy:t.resolvedBy,sourceId:t.sourceId??null,by:t.by}),pins:{gaps:i.map(e=>e.cid)}},provenance:t.provenance}),{resolved:i.length}}catch(e){if(e instanceof Se){if(r<3)continue;return{resolved:0}}throw e}}export{ye as a,Ce as b,Me as c,le as d,We as e,Rt as f,me as g,_e as h,Ve as i,bt as j,Je as k,Ye as l,Xe as m,xt as n,Ot as o,wt as p,Tt as q,Dt as r,kt as s,At as t,Ge as u,Le as v,Ze as w,ke as x,Ae as y,ot as z,He as A,ct as B,he as C};
|