@testmuai/kane-cli 0.8.16 → 0.8.17
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-5JEEFY34.js → ChatSurface-X2HLVN2I.js} +1 -1
- package/dist/{ChromeProfilePicker-6IVAYCWJ.js → ChromeProfilePicker-YU7HL6Z5.js} +1 -1
- package/dist/{CliFeedbackPrompt-K4IN7S6J.js → CliFeedbackPrompt-7FEEVGCU.js} +1 -1
- package/dist/{CliUploadProgress-MI4H4LKT.js → CliUploadProgress-OTVPBGW4.js} +1 -1
- package/dist/{ConfigView-CJY5MB6H.js → ConfigView-UKHUASHL.js} +1 -1
- package/dist/EvidenceViewOffer-LIPGXO23.js +2 -0
- package/dist/FolderPicker-OTQYRAYC.js +2 -0
- package/dist/{InfoBox-RP6RDCG7.js → InfoBox-2TYT2ROK.js} +1 -1
- package/dist/{LinksBox-QOQJ3S2I.js → LinksBox-7AS6D7MX.js} +1 -1
- package/dist/{ProfilesView-BZEBT6R5.js → ProfilesView-F4MFHZ7Y.js} +1 -1
- package/dist/{ProjectPicker-J42MEJRQ.js → ProjectPicker-QLGZM35L.js} +1 -1
- package/dist/{SaveSessionPrompt-MKAIUVX7.js → SaveSessionPrompt-T4MS76FY.js} +1 -1
- package/dist/SingleShotApp-4CDTAF3H.js +2 -0
- package/dist/{SummaryBox-JQJKGYDM.js → SummaryBox-IX32QPWM.js} +1 -1
- package/dist/TestMdRunView-MRMY3RW5.js +2 -0
- package/dist/{TestrunEvidenceTable-FYDS3ZVU.js → TestrunEvidenceTable-OK2HAENB.js} +1 -1
- package/dist/{WhoamiView-F4PPB7SN.js → WhoamiView-AHMNIIXZ.js} +1 -1
- package/dist/{app-download-RA4CGTC5.js → app-download-CF4JLXWV.js} +1 -1
- package/dist/{auth-TAT427C3.js → auth-D4BDPJPR.js} +1 -1
- package/dist/{binary-OFPMBJ34.js → binary-NWVJK542.js} +1 -1
- package/dist/{bind-LY362KX7.js → bind-LWN72YES.js} +4 -4
- package/dist/bootstrap-63FBDEEU.js +2 -0
- package/dist/bridge-UMXGHAJF.js +2 -0
- package/dist/{changelog-ZC3LHV2Z.js → changelog-GIZLIFMN.js} +1 -1
- package/dist/chat-committer-6D7AQI6Z.js +2 -0
- package/dist/chat-controller-UJQ6Z4RE.js +2 -0
- package/dist/{chunk-CVNHUDT4.js → chunk-233MYVFS.js} +1 -1
- package/dist/{chunk-MU3I453X.js → chunk-2LCWGWYC.js} +1 -1
- package/dist/{chunk-Z5DGFN7R.js → chunk-2LKNUXRN.js} +1 -1
- package/dist/{chunk-ZLIYWELJ.js → chunk-2STKZSVF.js} +1 -1
- package/dist/chunk-3UI5VTQS.js +4 -0
- package/dist/{chunk-4PWYSDZR.js → chunk-3UIZVDOF.js} +1 -1
- package/dist/chunk-3VAU3PNU.js +2 -0
- package/dist/{chunk-ICUTARPB.js → chunk-3YBT4UGQ.js} +1 -1
- package/dist/{chunk-4LVZLLTN.js → chunk-47QKRIPY.js} +3 -3
- package/dist/{chunk-AAT4O22C.js → chunk-4ASBXR6Q.js} +1 -1
- package/dist/{chunk-2GWMENG5.js → chunk-4OQ7GEIA.js} +1 -1
- package/dist/{chunk-BY2MU3ZS.js → chunk-4PWAODKJ.js} +1 -1
- package/dist/{chunk-23MVD7GY.js → chunk-5HDM7GDO.js} +1 -1
- package/dist/{chunk-VATOIZYG.js → chunk-5LSPHA3P.js} +5 -5
- package/dist/chunk-5MKY3WMF.js +3 -0
- package/dist/{chunk-C6JFTSIQ.js → chunk-5UHM7CKR.js} +1 -1
- package/dist/{chunk-FQFVAFWK.js → chunk-5X7JIGG7.js} +1 -1
- package/dist/{chunk-HYCOX7AB.js → chunk-5ZU7S4E7.js} +2 -2
- package/dist/{chunk-WPNNRMTP.js → chunk-637S3COE.js} +1 -1
- package/dist/{chunk-GX3FPJUG.js → chunk-63DYVWNX.js} +1 -1
- package/dist/{chunk-QXUPBIV3.js → chunk-64TO3MD7.js} +36 -36
- package/dist/{chunk-E44OHYDS.js → chunk-6CYF7Q5W.js} +2 -2
- package/dist/{chunk-TBYYPGHF.js → chunk-6OKOMKYR.js} +1 -1
- package/dist/{chunk-SF5QPR6T.js → chunk-75SSVUGS.js} +1 -1
- package/dist/{chunk-AHXOKBVE.js → chunk-7N6OCHPC.js} +1 -1
- package/dist/chunk-7U7HOEZO.js +2 -0
- package/dist/{chunk-7O54QURK.js → chunk-AACQE24F.js} +1 -1
- package/dist/{chunk-GCMJDOAE.js → chunk-AG2MVCNK.js} +1 -1
- package/dist/{chunk-NPKB7EK3.js → chunk-AH4QWIYU.js} +1 -1
- package/dist/{chunk-FYJ62EVY.js → chunk-AIR2WVXM.js} +1 -1
- package/dist/{chunk-O3ZKP4DY.js → chunk-AW34ZNNO.js} +1 -1
- package/dist/chunk-B6NU3SNG.js +368 -0
- package/dist/{chunk-OYY566GN.js → chunk-BNZQKQOE.js} +1 -1
- package/dist/{chunk-QMZLIHBS.js → chunk-CCNPXTC6.js} +2 -2
- package/dist/{chunk-CDWUZ54U.js → chunk-CCW3VQIY.js} +1 -1
- package/dist/{chunk-W4Y3PG7F.js → chunk-D2F5T3NX.js} +1 -1
- package/dist/{chunk-JQW2QFSX.js → chunk-D6E6KRVX.js} +1 -1
- package/dist/chunk-D7WG7SRA.js +2 -0
- package/dist/{chunk-Q7LZ5QJV.js → chunk-DFK5QYB5.js} +1 -1
- package/dist/{chunk-EMAKLNDV.js → chunk-DQRVB5EU.js} +1 -1
- package/dist/{chunk-H6S7L2I2.js → chunk-DT2LIX5S.js} +1 -1
- package/dist/{chunk-PDTFQGQF.js → chunk-E6X5BVXC.js} +1 -1
- package/dist/{chunk-MD3S2RXN.js → chunk-EIMHIZKF.js} +1 -1
- package/dist/chunk-EVFFDODK.js +5 -0
- package/dist/{chunk-3IXEARDX.js → chunk-F2OBORCG.js} +1 -1
- package/dist/chunk-FY7TCYPK.js +6 -0
- package/dist/{chunk-7QUFOWMU.js → chunk-GBXF4JE6.js} +1 -1
- package/dist/{chunk-U7BVK5IX.js → chunk-GIC56KI3.js} +1 -1
- package/dist/{chunk-IYOPWIG4.js → chunk-GT6Y2SEY.js} +2 -2
- package/dist/{chunk-ULGFPKC7.js → chunk-HLUOLWEJ.js} +1 -1
- package/dist/{chunk-O3XBIURC.js → chunk-HS7OIRGU.js} +1 -1
- package/dist/{chunk-NADKZKGS.js → chunk-I6RTGDZ7.js} +1 -1
- package/dist/{chunk-MZYPDLD3.js → chunk-ICFJVEEA.js} +1 -1
- package/dist/{chunk-Z4KRSLAM.js → chunk-IDLJHKJX.js} +1 -1
- package/dist/{chunk-J2LWXO55.js → chunk-IGI4T3VC.js} +1 -1
- package/dist/{chunk-KPL2XHYF.js → chunk-IHD2WXKT.js} +1 -1
- package/dist/{chunk-TGBXIV7O.js → chunk-IHUF6UP4.js} +1 -1
- package/dist/chunk-IICT4VOU.js +2 -0
- package/dist/{chunk-HBMNUT6E.js → chunk-IKB2JKMA.js} +1 -1
- package/dist/{chunk-SWTJMTBY.js → chunk-IPQAKIJO.js} +1 -1
- package/dist/{chunk-UEG4LJD6.js → chunk-IZ3PYWUL.js} +1 -1
- package/dist/{chunk-U466V5JN.js → chunk-JGCB4OUP.js} +1 -1
- package/dist/chunk-JPOYZCTX.js +2 -0
- package/dist/chunk-JQ64X2TO.js +2 -0
- package/dist/{chunk-UAFCBZ3P.js → chunk-JWOPRJIO.js} +1 -1
- package/dist/{chunk-WECVT7WE.js → chunk-JWPBLVPW.js} +1 -1
- package/dist/chunk-K2UJYY2U.js +2 -0
- package/dist/{chunk-ALCE5RLK.js → chunk-KDNNMU7Q.js} +1 -1
- package/dist/chunk-KJQNAOOE.js +6 -0
- package/dist/{chunk-DSWHEEHN.js → chunk-KMF2PPJ5.js} +1 -1
- package/dist/{chunk-NN6UG2BE.js → chunk-KQCGBDPM.js} +1 -1
- package/dist/{chunk-ZYEFWJNZ.js → chunk-KRI5NSGQ.js} +1 -1
- package/dist/{chunk-3MVEGB2I.js → chunk-KWANVHJX.js} +1 -1
- package/dist/{chunk-7P6FSGRD.js → chunk-KX5IV5FL.js} +2 -2
- package/dist/{chunk-WML5KSGQ.js → chunk-L2SJRAK4.js} +1 -1
- package/dist/{chunk-TWZ6NZWE.js → chunk-LO47W2DO.js} +4 -4
- package/dist/chunk-LSDWPG6C.js +2 -0
- package/dist/{chunk-G2ZMNVYN.js → chunk-MDM2LJFN.js} +1 -1
- package/dist/{chunk-Z2GDSCPS.js → chunk-MTCLFYNH.js} +1 -1
- package/dist/{chunk-IJTSA34Q.js → chunk-N55U4S4W.js} +1 -1
- package/dist/chunk-NFLQWKFR.js +8 -0
- package/dist/{chunk-OPL2MIQG.js → chunk-NJ4BXZBX.js} +1 -1
- package/dist/{chunk-6HCY5LJO.js → chunk-OCWS5YVO.js} +3 -3
- package/dist/{chunk-F2XTOZTN.js → chunk-PHR2OSWD.js} +1 -1
- package/dist/{chunk-TU6IMGWO.js → chunk-Q4YYAN6E.js} +1 -1
- package/dist/{chunk-55YDTPB7.js → chunk-Q6F23V7L.js} +1 -1
- package/dist/chunk-QSCXXNC2.js +2 -0
- package/dist/{chunk-IZ5CTC6M.js → chunk-RBFCGUR3.js} +1 -1
- package/dist/{chunk-3N6IAVD5.js → chunk-RDHWNSDP.js} +1 -1
- package/dist/{chunk-OUWOLCCS.js → chunk-RGJIGNB3.js} +1 -1
- package/dist/{chunk-TCAHDVII.js → chunk-RRY5IXOB.js} +1 -1
- package/dist/{chunk-BK42G6RI.js → chunk-RSXCS474.js} +1 -1
- package/dist/{chunk-AGKE5WF3.js → chunk-SDJNWR4D.js} +1 -1
- package/dist/{chunk-YCH7H7JX.js → chunk-SEEEGDVK.js} +1 -1
- package/dist/{chunk-5ACSALRU.js → chunk-TISVRTL7.js} +2 -2
- package/dist/{chunk-GGD7NKPL.js → chunk-TMOSERKN.js} +2 -2
- package/dist/{chunk-VOTIGXQ4.js → chunk-U2LDPUDZ.js} +1 -1
- package/dist/chunk-U6OTFMIT.js +4 -0
- package/dist/{chunk-KYZKPNPQ.js → chunk-UQNRUAES.js} +1 -1
- package/dist/{chunk-V4JR5JCK.js → chunk-UTIP6SMW.js} +1 -1
- package/dist/chunk-UUYYTJG2.js +6 -0
- package/dist/{chunk-XGL3RSI5.js → chunk-UXJZUGKL.js} +1 -1
- package/dist/{chunk-52WM3XYO.js → chunk-V4B5QA3U.js} +1 -1
- package/dist/chunk-VIO7CCFW.js +5 -0
- package/dist/{chunk-BCJNIDS3.js → chunk-VIYV6NIW.js} +1 -1
- package/dist/{chunk-IE3OO5GI.js → chunk-VVOKM2VO.js} +1 -1
- package/dist/{chunk-3LXN6AV5.js → chunk-WC54SZUO.js} +1 -1
- package/dist/{chunk-CR7UWQ76.js → chunk-WDK5ETMA.js} +1 -1
- package/dist/chunk-WESMQEPO.js +2 -0
- package/dist/{chunk-ECIGXPLN.js → chunk-WKIYI6MB.js} +1 -1
- package/dist/{chunk-KZG4E5RM.js → chunk-WVHMPIDQ.js} +1 -1
- package/dist/chunk-XLSOQLVT.js +2 -0
- package/dist/chunk-YOVKKZVZ.js +2 -0
- package/dist/chunk-ZLWURCJ7.js +2 -0
- package/dist/{chunk-5VZAWKDF.js → chunk-ZQ6KWTJ2.js} +1 -1
- package/dist/{chunk-IQDZ6YMY.js → chunk-ZRRBZUDJ.js} +1 -1
- package/dist/committer-2QPBANRD.js +2 -0
- package/dist/{config-WETHR632.js → config-WKLEWUPU.js} +1 -1
- package/dist/cover-cmd-7TSQJFGM.js +3 -0
- package/dist/{credentials-RQPAP5KY.js → credentials-FLY3ZXVX.js} +1 -1
- package/dist/{deps-bundle-F47ZDYIM.js → deps-bundle-CAKK3EO5.js} +1 -1
- package/dist/{deps-resolve-URKD4QCB.js → deps-resolve-MSLEFPVD.js} +1 -1
- package/dist/descriptor-3JJUOHBM.js +2 -0
- package/dist/design-committer-D44GSUXY.js +2 -0
- package/dist/dispatch-SXS276ZT.js +2 -0
- package/dist/{doctor-J44UKALC.js → doctor-EZPQTFJM.js} +1 -1
- package/dist/{docx-convert-WPZS6OIC.js → docx-convert-SQRTF7XS.js} +1 -1
- package/dist/{dossier-UGJMYYAB.js → dossier-7HVC6BNK.js} +1 -1
- package/dist/evidence-GUOURW6F.js +2 -0
- package/dist/evolve-cmd-LJJFOXXP.js +2 -0
- package/dist/{explain-H5HJEDEF.js → explain-NEFBUX5G.js} +1 -1
- package/dist/{explain-cmd-USGRZFBY.js → explain-cmd-5LLIJKM2.js} +1 -1
- package/dist/{explain-cmd-R45I5MT7.js → explain-cmd-ENSJNQK7.js} +1 -1
- package/dist/{extract-bind-X4QRQX53.js → extract-bind-CGU6WVS7.js} +3 -3
- package/dist/{extract-cmd-RKEE32FN.js → extract-cmd-7N7CCGN6.js} +2 -2
- package/dist/feeder-66TUPB2R.js +2 -0
- package/dist/gaps-cmd-BNUGDF5N.js +3 -0
- package/dist/{gate-E3BLIUEA.js → gate-OYRDJMF6.js} +1 -1
- package/dist/{generate-headless-LSQHOR3G.js → generate-headless-7TJYESUU.js} +2 -2
- package/dist/index.js +155 -158
- package/dist/ingest-OSNNM3DH.js +2 -0
- package/dist/ingest-cmd-B4T5CW5R.js +2 -0
- package/dist/install-6KJ2MZX3.js +2 -0
- package/dist/interactive-bind-HUZDSGFX.js +26 -0
- package/dist/lifecycle-cmd-GIVLSUPE.js +2 -0
- package/dist/list-cmd-KEKKQDUF.js +3 -0
- package/dist/{list-commands-Q77CAQJ2.js → list-commands-SMBBT5CY.js} +1 -1
- package/dist/logical-ids-GLVM2SVR.js +2 -0
- package/dist/login-flow-5ZIG7JXT.js +2 -0
- package/dist/maintenance-cmd-MLQ3IRFV.js +2 -0
- package/dist/{mobile-prompts-PPPPKRS2.js → mobile-prompts-EEPPPA6S.js} +1 -1
- package/dist/{objective-variable-gate-BCKULIFQ.js → objective-variable-gate-AEBWIGH7.js} +1 -1
- package/dist/open-provider-OTZ37JB6.js +2 -0
- package/dist/{pdf-convert-5H4HQNN3.js → pdf-convert-RLXSXFWN.js} +1 -1
- package/dist/{persist-recorded-session-MK4HCDOY.js → persist-recorded-session-IRWGMXGI.js} +1 -1
- package/dist/phase-seed-H7KXNQO6.js +2 -0
- package/dist/pipeline-OV3TWKSZ.js +2 -0
- package/dist/prepare-target-35OI7XBL.js +2 -0
- package/dist/readmodel-FVLRQWZ7.js +2 -0
- package/dist/reconcile-cmd-NBBDE7DJ.js +2 -0
- package/dist/reconcile-deps-DJNIY7TP.js +4 -0
- package/dist/reconcile-engine-Z2XKUCQ7.js +2 -0
- package/dist/recording-banner-GCR6A46M.js +2 -0
- package/dist/{records-TJJJWBUD.js → records-LMCVKPE5.js} +1 -1
- package/dist/registry-V3ULHPLM.js +2 -0
- package/dist/{require-project-folder-ZLKONKKP.js → require-project-folder-YBB5T3OE.js} +1 -1
- package/dist/{resolve-run-intent-3SXUS676.js → resolve-run-intent-XGZN6OQ6.js} +1 -1
- package/dist/{resolver-G7NGWACO.js → resolver-WNV53IOL.js} +1 -1
- package/dist/revert-NOUECRW4.js +2 -0
- package/dist/review-cmd-ZXTLZ4GE.js +5 -0
- package/dist/run-YWKZGZVL.js +2 -0
- package/dist/run-YZP2PTNW.js +2 -0
- package/dist/run-test-md-N43FRXB6.js +17 -0
- package/dist/{sessions-cmd-DV442ZCY.js → sessions-cmd-IV25N2L7.js} +1 -1
- package/dist/skill-installer-G7Z5ZDAQ.js +3 -0
- package/dist/{spawner-H6IDWY5U.js → spawner-ABB7B5CQ.js} +1 -1
- package/dist/store-guard-YIQQF4LC.js +2 -0
- package/dist/{structured-answers-NADW6D44.js → structured-answers-3C2DCFFF.js} +1 -1
- package/dist/sync-cmd-4AKHO5EG.js +2 -0
- package/dist/sync-setup-E7UV25KK.js +2 -0
- package/dist/tcg-generate-XJN5OMIJ.js +2 -0
- package/dist/testmd-actions-WFDWYEAU.js +2 -0
- package/dist/{testmd-sync-2CXNIPJ7.js → testmd-sync-I2E6W6JL.js} +1 -1
- package/dist/token-refresh-NADDXLYM.js +2 -0
- package/dist/{validate-basic-MN5NDCT2.js → validate-basic-WZY6A3KD.js} +1 -1
- package/dist/{variable-receipt-SIABUC74.js → variable-receipt-JONRYHCY.js} +1 -1
- package/dist/verdicts-JMVS6HNJ.js +2 -0
- package/dist/{version-check-TDGK5REB.js → version-check-CD7DHZI2.js} +1 -1
- package/dist/{view-cmd-RLO7AP4X.js → view-cmd-ASH2UFUW.js} +1 -1
- package/dist/walk-session-ZPXR7ASG.js +2 -0
- package/dist/with-telemetry-QXCHDKPW.js +2 -0
- package/package.json +11 -11
- package/dist/EvidenceViewOffer-ABKTGD4K.js +0 -2
- package/dist/FolderPicker-RQIVS7ZR.js +0 -2
- package/dist/SingleShotApp-TZZ2J7ZO.js +0 -2
- package/dist/TestMdRunView-2YVGGFLU.js +0 -2
- package/dist/bootstrap-RCDB5OWA.js +0 -2
- package/dist/bridge-E2NGMJYM.js +0 -2
- package/dist/chat-committer-HDE3TP5I.js +0 -2
- package/dist/chat-controller-3EPK7UZG.js +0 -2
- package/dist/chunk-3AVBUEBL.js +0 -8
- package/dist/chunk-4PMZ5FCD.js +0 -2
- package/dist/chunk-4WEVTED6.js +0 -3
- package/dist/chunk-7XMDCGIZ.js +0 -3
- package/dist/chunk-AKX4VRRR.js +0 -2
- package/dist/chunk-CRZUBDJ3.js +0 -6
- package/dist/chunk-FFVNISYH.js +0 -2
- package/dist/chunk-FWPRUGJJ.js +0 -368
- package/dist/chunk-GP7WD4UY.js +0 -4
- package/dist/chunk-HOA4VWSD.js +0 -5
- package/dist/chunk-JUJ4SAGH.js +0 -2
- package/dist/chunk-L2TV4G56.js +0 -4
- package/dist/chunk-NMBFAIXZ.js +0 -2
- package/dist/chunk-O25AL4B7.js +0 -5
- package/dist/chunk-RCYYE6ED.js +0 -2
- package/dist/chunk-TNBF5OMZ.js +0 -2
- package/dist/chunk-UHT5SVP5.js +0 -2
- package/dist/chunk-VWOAEF7J.js +0 -2
- package/dist/chunk-YMLC55J4.js +0 -2
- package/dist/chunk-YYYQ5MVD.js +0 -6
- package/dist/committer-IYQPXG6C.js +0 -2
- package/dist/cover-cmd-J3CTQT3R.js +0 -3
- package/dist/descriptor-PWUUNYV7.js +0 -2
- package/dist/design-committer-J57IAAA5.js +0 -2
- package/dist/dispatch-KOZAJQDW.js +0 -2
- package/dist/evidence-KRNDKDCT.js +0 -2
- package/dist/evolve-cmd-CEYGGIWA.js +0 -2
- package/dist/feeder-RSHMGW6B.js +0 -2
- package/dist/gaps-cmd-WL6P6YKS.js +0 -3
- package/dist/ingest-QGLVY7ND.js +0 -2
- package/dist/ingest-cmd-TQ4ARSDE.js +0 -2
- package/dist/install-47CRHVU6.js +0 -2
- package/dist/interactive-bind-FPC4RYEW.js +0 -26
- package/dist/lifecycle-cmd-DB5EFO2O.js +0 -2
- package/dist/list-cmd-UWGJRGKF.js +0 -3
- package/dist/logical-ids-DN6IZSUM.js +0 -2
- package/dist/login-flow-RSNR5HY2.js +0 -2
- package/dist/maintenance-cmd-EJ2RAMWB.js +0 -2
- package/dist/open-provider-XIGABCD3.js +0 -2
- package/dist/phase-seed-HKJ2EF7R.js +0 -2
- package/dist/pipeline-XDWHEZ5S.js +0 -2
- package/dist/prepare-target-NR3MTLLI.js +0 -2
- package/dist/readmodel-IBFRM6EO.js +0 -2
- package/dist/reconcile-cmd-VJPEY7YD.js +0 -2
- package/dist/reconcile-deps-T5YX6HRG.js +0 -4
- package/dist/reconcile-engine-GELPXSLV.js +0 -2
- package/dist/recording-banner-3ET3PMSV.js +0 -3
- package/dist/registry-3XMA4FOC.js +0 -2
- package/dist/revert-6BBBK3I4.js +0 -2
- package/dist/review-cmd-6DNGXV5E.js +0 -5
- package/dist/run-MUVZVTTC.js +0 -2
- package/dist/run-UJLRTKTO.js +0 -2
- package/dist/run-test-md-RI5RXVFU.js +0 -17
- package/dist/skill-installer-CAO2NJZP.js +0 -3
- package/dist/store-guard-PIA2DYZX.js +0 -2
- package/dist/sync-cmd-VFVTFIIJ.js +0 -2
- package/dist/sync-setup-R7BZDE24.js +0 -2
- package/dist/tcg-generate-QADJKNYZ.js +0 -2
- package/dist/testmd-actions-EXSVQRHQ.js +0 -2
- package/dist/token-refresh-5TVNSL4U.js +0 -2
- package/dist/verdicts-ZXXBKTOZ.js +0 -2
- package/dist/walk-session-ATWNUGHX.js +0 -2
- package/dist/with-telemetry-CLSDKQAG.js +0 -2
package/dist/chunk-FWPRUGJJ.js
DELETED
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as nt}from"./chunk-ZKSN2SJ7.js";import{a as it,b as he}from"./chunk-HOA4VWSD.js";import{a as Z,b as Ke,e as pe,f as ge,g as Qe,h as et}from"./chunk-DSWHEEHN.js";import{a as We,c as Ye,d as Xe,e as fe,f as Ze}from"./chunk-UHT5SVP5.js";import{a as Ge,b as Ve,c as Ue}from"./chunk-AGKE5WF3.js";import{a as ze}from"./chunk-L2TV4G56.js";import{c as He}from"./chunk-52WM3XYO.js";import{a as Me,b as Be,c as Fe}from"./chunk-BB2W35TW.js";import{a as qe,e as Le}from"./chunk-CRZUBDJ3.js";import{a as Je}from"./chunk-GX3FPJUG.js";import{a as tt,b as st}from"./chunk-JUJ4SAGH.js";import{q as je}from"./chunk-E44OHYDS.js";import{b as Oe,c as Pe,d as re,f as Ne}from"./chunk-Z4KRSLAM.js";import{b as Se,c as De,e as $e,f as Ee,g as Re,h as de,k as me,l as ue}from"./chunk-SWTJMTBY.js";import{d as xe}from"./chunk-CAOZKSQ3.js";import{b as ce}from"./chunk-VZ7KXRXB.js";import{a as ke,c as le}from"./chunk-5LJRZI7S.js";import{C as U}from"./chunk-GP7WD4UY.js";import{H as Ie}from"./chunk-3N6IAVD5.js";import{a as Ce,f as Ae,g as Te}from"./chunk-FQNQVC5O.js";import{d as Q,e as Y}from"./chunk-AKX4VRRR.js";import{a as we}from"./chunk-5EOX4MEY.js";import{mkdirSync as Vt,appendFileSync as Ut,rmdirSync as St}from"fs";import{randomBytes as Ht}from"crypto";import{dirname as ae,join as ve,relative as zt}from"path";function rt(t,e){let n=[];for(let i of e??[]){let o=t.resolve(i.ref)?.tip??null;o!==i.cid&&n.push({ref:i.ref,pinned:i.cid,now:o})}return n}import{existsSync as be,readFileSync as _e,readdirSync as Et}from"fs";import{join as se}from"path";var at=`
|
|
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 ot={"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 ct=`
|
|
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 Rt=["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"];function mt(t,e){for(let n of t)if(!Rt.includes(n))throw new Error(`${e}: emits '${n}' is not an oracle kind`)}function lt(t,e){let n=ce(t);if(!n||!Array.isArray(n.techniques))throw new Error(`${e}: expected { techniques: [...] }`);for(let i of n.techniques){if(!i.id||!i.name||!i.applies_hint||!Array.isArray(i.emits))throw new Error(`${e}: technique '${i?.id??"?"}' missing id/name/applies_hint/emits`);mt(i.emits,`${e}: technique '${i.id}'`)}return n.techniques}function dt(t,e){let n=ce(t);if(!n||!n.id||!n.name||!n.applies_when||!Array.isArray(n.candidate_checks))throw new Error(`${e}: profile missing id/name/applies_when/candidate_checks`);for(let i of n.candidate_checks){if(!i.id||!i.family||!i.measurable_example||!i.emits)throw new Error(`${e}: candidate_check '${i?.id??"?"}' missing id/family/measurable_example/emits`);mt([i.emits],`${e}: check '${i.id}'`)}return n}function ut(t){let e=new Map(lt(at,"packaged techniques").map(i=>[i.id,i])),n=se(t,"design","techniques.yaml");if(be(n))for(let i of lt(_e(n,"utf8"),n))e.set(i.id,i);return[...e.values()]}function pt(t){let e=new Map(Object.entries(ot).map(([i,o])=>[i,dt(o,`packaged profile '${i}'`)])),n=se(t,"design","profiles");if(be(n))for(let i of Et(n).filter(o=>o.endsWith(".yaml")||o.endsWith(".yml")).sort()){let o=dt(_e(se(n,i),"utf8"),se(n,i));e.set(o.id,o)}return[...e.values()]}function gt(t){let e=se(t,"design","runner-grammar.yaml");return be(e)?_e(e,"utf8"):ct}function ie(t,e){return!t.superseded.has(e)}function ye(t,e,n){return{cid:e,logical_id:t.nameOf.get(e)??null,content:n}}async function ft(t,e,n,i,o){let r=await Ke(t,"search_similar",{text:e,label:n,k:i},o);return r.ok&&Array.isArray(r.result)?r.result:[]}async function ht(t,e,n={}){let i=U(t),o=i.resolve(e);if(!o)throw new Error(`assembleDesignContext: unknown use-case '${e}' (run designGate first)`);let r=o.tip,v=i.getNode(r);if(!v||v.label!==Q.USECASE)throw new Error(`assembleDesignContext: '${e}' is not a use-case (run designGate first)`);let N=i.derivesInto(r).map(l=>({source_id:l.props.source_id??null,anchor:l.props.anchor??null})),w=[],T=new Set;for(let{cid:l,content:g}of i.byLabel(Q.SCENARIO))ie(i,l)&&i.edgesFrom(l).some(h=>h.type===Y.BELONGS_TO&&h.dst===r)&&(w.push(ye(i,l,g)),T.add(l));let $=[];for(let{cid:l,content:g}of i.byLabel(Q.AC)){if(!ie(i,l))continue;let h=i.edgesFrom(l).find(S=>S.type===Y.SCOPED_TO);!h||h.dst!==r&&!T.has(h.dst)||$.push({...ye(i,l,g),scoped_to:h.dst})}let x=Array.isArray(v.content.criteria)?v.content.criteria:[],C=[v.content.title,v.content.description,...x].filter(Boolean).join(`
|
|
353
|
-
`),M=(await ft(i,C,Q.SCENARIO,10,n.embedSearch)).filter(l=>!T.has(l.cid)),R=[],P=new Set,X=[],E=[r],q=new Set([r]);for(;E.length>0;){let l=E.shift();for(let g of i.edgesFrom(l)){if(g.type!==Y.DEPENDS_ON||i.nodeLabel.get(g.dst)!==Q.USECASE)continue;let h=i.tipOf(g.dst);q.has(h)||(q.add(h),X.push(h),E.push(h))}}for(let l of X){let g=`depends_on ${i.nameOf.get(l)??l.slice(0,19)}`;for(let{cid:h}of i.byLabel(Q.SCENARIO))if(ie(i,h)&&i.edgesFrom(h).some(S=>S.type===Y.BELONGS_TO&&S.dst===l))for(let S of i.edgesInto(h)){if(S.type!==Y.AUTOMATES||!ie(i,S.src)||P.has(S.src))continue;P.add(S.src);let G=String(i.getNode(S.src)?.content.title??"");R.push({cid:S.src,logical_id:i.nameOf.get(S.src)??null,title:G,via:g})}}for(let l of await ft(i,C,Q.TEST,5,n.embedSearch)){let{cid:g,title:h}=l;P.has(g)||(P.add(g),R.push({cid:g,logical_id:i.nameOf.get(g)??null,title:h??"",via:"similar"}))}let f=i.byLabel(Q.STYLENOTE).filter(l=>ie(i,l.cid)).sort((l,g)=>l.cid<g.cid?-1:1).slice(0,5).map(l=>`${String(l.content.statement)} [${String(l.content.learned_from_kind)}]`);return{usecase:ye(i,r,v.content),cites:N,committed_acs:$,existing:{scenarios:w,reuse_candidates:M},import_candidates:R,style_notes:f,techniques:ut(t),profiles:pt(t),runner_grammar:gt(t),variables:[...(n.variablesIndex??new Map).entries()].map(([l,g])=>({name:l,has_value:g.has_value})).sort((l,g)=>l.name<g.name?-1:1),budget:{...n.max!=null?{max_pairs:n.max}:{},...n.strength!=null?{strength_override:n.strength}:{}},design_of:(()=>{let l=tt(i,r);return l?{engine:l.engine,seq:l.seq}:null})()}}function bt(t){let e=n=>{if(Array.isArray(n))return n.map(e);if(n!==null&&typeof n=="object"){let i={};for(let o of Object.keys(n).sort())i[o]=e(n[o]);return i}return n};return JSON.stringify(e(t),null,1)}import{basename as qt,dirname as vt,resolve as wt}from"path";import{existsSync as Ct,mkdirSync as At,readFileSync as Tt,renameSync as It,writeFileSync as Ot}from"fs";import{dirname as Pt,join as Nt}from"path";function _t(t){return Nt(t,".testmuai","variables","assurance.json")}function yt(t){for(let o of t.declarations){let r=re(o.name);if(r)throw new Error(`variable declaration refused: ${r}`)}let e={};if(Ct(t.file)){let o=JSON.parse(Tt(t.file,"utf8"));o&&typeof o=="object"&&!Array.isArray(o)&&(e=o)}let n=[],i=[];for(let o of t.declarations){if(Object.hasOwn(e,o.name)||t.known?.has(o.name)){i.push(o.name);continue}e[o.name]={value:"",secret:!!o.secret,description:o.description},n.push(o.name)}if(n.length>0){At(Pt(t.file),{recursive:!0});let o=`${t.file}.tmp-${process.pid}-${Date.now()}`;Ot(o,JSON.stringify(e,null,2)+`
|
|
354
|
-
`),It(o,t.file)}return{written:n,skipped:i}}var jt=me,Lt=new Set(["narrative","acs","scenarios","tests","exercises","gaps","scoped_to_repoints","judgements","variables","phase"]);function Mt(t){let e=/strength=(\d+)\s*(?:—|-)?\s*(.*)/.exec(t??"");return e?{strength:Number(e[1]),reason:e[2]||t||""}:{strength:2,reason:t??""}}function Bt(t,e,n=new Set,i=0){return jt(e,ue(t),n,i)}function Ft(t,e,n,i){let o=e.scenarios?.find(x=>x.temp_ref===n.automates)??(()=>{let x=t.resolve(n.automates),C=x?t.getNode(x.tip)?.content:void 0;return C?{title:String(C.title??""),intent:String(C.intent??""),technique_notes:String(C.technique_notes??"")}:{}})(),r=[...(e.acs??[]).map(x=>({ref:x.temp_ref,text:x.text})),...n.verifies.filter(x=>!(e.acs??[]).some(C=>C.temp_ref===x)).map(x=>{let C=t.resolve(x);return{ref:x,text:C?String(t.getNode(C.tip)?.content.text??""):""}})],{test_md:v,objectives_yaml:N}=Re({title:n.title,steps:n.steps,check:n.check,check_prose:n.check_prose,reuses:n.reuses,...n.target?{target:n.target,...n.app?{app:n.app}:{}}:{}},{title:o.title,intent:o.intent},r),w=de(Bt(t,v)),T=n.check,$={technique:o.technique_notes??"",profile_family:e.judgements?.find(x=>x.kind==="profile_family"&&(x.target===n.temp_ref||x.target===n.automates))?.rationale??"unspecified",anchor:T.verified_against,expected_how:e.judgements?.find(x=>x.kind==="expected_how"&&x.target===T.verified_against)?.rationale??`expected_mode: ${T.expected_mode??"inferred"}`,combinatorial:Mt(o.technique_notes),surface_state:"absent",deferred_bindings:T.expected_mode==="runtime-derived"?1:0};return i.push({definitionId:w,rationale:$,anchorRef:T.verified_against,tempRef:n.temp_ref}),{temp_ref:n.temp_ref,title:n.title,automates:n.automates,verifies:n.verifies,check:n.check,definitionId:w,test_md_blob:v,objectives_blob:N,...n.reuses?.length?{reuses:n.reuses}:{},...n.surface_required!==void 0?{surface_required:n.surface_required}:{},...n.target?{target:n.target}:{},...n.target&&n.app?{app:n.app}:{}}}function Gt(t,e){try{let n=t.resolve(e.automates);if(!n)return!1;let i=t.tipOf(n.cid)??n.cid;for(let o of t.edgesInto(i)){if(o.type!==Y.AUTOMATES)continue;let r=t.getNode(t.tipOf(o.src)??o.src)?.content,v=typeof r?.test_md_blob=="string"?r.test_md_blob:"";if(!v)continue;if(!v.split(`
|
|
355
|
-
`).some(w=>/^##\s/.test(w)&&!/—\s?assert/.test(w)&&xe.test(w)))return!0}return!1}catch{return!1}}function kt(t){let e=0,n=t.forceScope??null;return{terminalEventType:"design",async onProposalEvent(i){let o=a=>t.steer?(t.steer(`[auto-repair] ${a} \u2014 please re-finalize with this fixed.`),{proposal:null,error:null}):{proposal:null,error:a};if(i==null||typeof i!="object")return o("finalize_design payload is not an object");let r=i,v=Object.keys(r).filter(a=>!Lt.has(a));if(v.length>0)return o(`finalize_design carries ungated/unknown section(s): ${v.join(", ")} \u2014 mintable here: acs, scenarios, tests (+gaps)`);let N=new Map;for(let a of r.tests??[]){let m=N.get(a.automates);if(m)return o(`strict 1:1 violated in-payload: ${m} and ${a.temp_ref} both automate ${a.automates}`);if(N.set(a.automates,a.temp_ref),typeof a.app=="string"&&!/^APP/.test(a.app)&&!/[\/]/.test(a.app)&&!/\.(apk|zip|app)$/i.test(a.app))return o(`${a.temp_ref}: app '${a.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=U(t.contextDir),T=/^design@(\d+)$/.exec(t.templateVersion?.()??"");if(T&&Number.parseInt(T[1],10)>=6)for(let a of r.tests??[]){if(!Array.isArray(a.steps??[]))return o(`${a.temp_ref}: steps must be an array of objective strings or {text, verifies} objects`);let m=new Set;for(let k of Array.isArray(a.steps)?a.steps:[])if(typeof k=="object"&&k.verifies)for(let O of k.verifies)m.add(O);let _=new Set(a.verifies??[]),b=[..._].filter(k=>!m.has(k)),I=[...m].filter(k=>!_.has(k));if(!(m.size===0&&Gt(w,a))&&(m.size===0||b.length>0||I.length>0))return o(`${a.temp_ref}: every AC must be claimed by the step that proves it \u2014 `+(m.size===0?"no step carries verifies tags":`not claimed by any step: [${b.join(", ")}]; tagged but not in the test's verifies: [${I.join(", ")}]`))}if(r.variables!==void 0&&!Array.isArray(r.variables))return o("variables must be an array of {name, description, secret}");let $=!!T&&Number.parseInt(T[1],10)>=7;if((r.variables??[]).length>0&&!$)return o("variables[] needs design@7 \u2014 this session is bound to an older template; drop the section");let x=new Set;for(let a of r.variables??[]){if(!a||typeof a!="object"||typeof a.name!="string"||typeof a.description!="string"||typeof a.secret!="boolean")return o(`variables[]: every entry is {name, description, secret} \u2014 got ${JSON.stringify(a)}`);let m=Object.keys(a).filter(b=>!["name","description","secret"].includes(b));if(m.length>0)return o(`variables[]: '${a.name}' carries ${m.join(", ")} \u2014 a declaration has no value and no other fields`);let _=re(a.name);if(_)return o(`variables[]: ${_}`);if(!a.description.trim()||/[\r\n]/.test(a.description))return o(`variables[]: '${a.name}' needs a one-line, non-empty description`);if(x.has(a.name))return o(`variables[]: '${a.name}' is declared twice`);x.add(a.name)}if($){let a=t.variablesIndex?.()??new Map;for(let m of r.tests??[]){let _=[...(Array.isArray(m.steps)?m.steps:[]).map(b=>typeof b=="string"?b:b.text),m.check_prose??""];for(let b of _)for(let I of Ne(b))if(!(a.has(I)||x.has(I)))return o(`${m.temp_ref}: step references {{${I}}} but no variable named '${I}' 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&&n===null&&(n=it(w,t.ucRef));let C=w.resolve(t.ucRef),M=C?String(w.getNode(C.tip)?.content.risk??"med"):"med",R=[],P=new Set([t.ucRef,C?.cid,C?.tip].filter(Boolean)),X=a=>{if(P.has(a))return!0;let m=w.resolve(a);return m!=null&&(P.has(m.cid)||P.has(m.tip))},E;try{E={...r.acs?.length?{acs:r.acs.map(a=>({temp_ref:a.temp_ref,text:a.text,kind:a.kind,risk:a.risk??M,...a.expected_answer?{expected_answer:a.expected_answer}:{},...a.scoped_to&&!X(a.scoped_to)?{scope:{type:"scenario",ref:a.scoped_to}}:{}}))}:{},...r.scenarios?.length?{scenarios:r.scenarios}:{},...r.tests?.length?{tests:r.tests.map(a=>Ft(w,r,a,R))}:{},...r.exercises?.length?{exercises:r.exercises}:{},...r.gaps?.length?{gaps:r.gaps}:{},...r.scoped_to_repoints?.length?{scoped_to_repoints:r.scoped_to_repoints}:{},...r.judgements?.length?{judgements:r.judgements}:{}}}catch(a){return o(a instanceof Error?a.message:String(a))}let q=r.phase??(r.tests?.length?"tests":r.scenarios?.length?"scenarios":r.acs?.length?"acs":"design"),f=(a,m={})=>({contextDir:t.contextDir,graph:a,ucRef:t.ucRef,sections:E,by:t.by,phase:q,...m,...t.templateVersion?{templateVersion:t.templateVersion()}:{},...t.engine?{engine:t.engine}:{},...n?.length?{forceScope:n}:{},...t.because?{reason:t.because}:{},finalizeTestBody:(()=>{let _=new Map((E.tests??[]).map(k=>[k.temp_ref,k])),b=new Map,I=(k,O,H)=>{let L=_.get(k);if(!L?.test_md_blob)return null;let z=b.get(k);if(z!==void 0)return z;if(H.has(k))return L.test_md_blob;H.add(k);let W=new Map;for(let s of L.reuses??[]){I(s,O,H);let d=O(s);d!==null&&d!==s&&W.set(s,d)}let j=L.verifies.map(O).filter(s=>s!==null),J=Ee(L.test_md_blob,W),{md:ne,tagged:D}=Se(J,O),K=D?ne:$e(J,j);return De(K,j),b.set(k,K),K};return(k,O)=>{if(!k.test_md_blob)return null;let H=I(k.temp_ref,O,new Set)??k.test_md_blob;if(H===k.test_md_blob)return null;let L=z=>{for(let W of _.keys())if(O(W)===z){let j=I(W,O,new Set);if(j!==null)return{body:j,cycleKey:`batch:${z}`,next:L}}return ue(w)(z)};return{test_md_blob:H,definitionId:de(me(H,L))}}})()}),l;if(t.protocol){let a=t.generationTicket,m=await Ge(t.protocol,{verb:"design",ucTargets:[{ref:t.ucRef}],newBuCandidates:[],sourcePins:[],readBasis:w.latestHash,...a?{generationTicket:a}:{}},_=>{let b=he(f(_.graph,{eventIds:_.eventIds("design",1),sid:_.sid,...a&&!t.generationStamped?{generationTicket:a}:{}}));return b.errors!==null?{errors:b.errors}:{result:b,record:b.record}});m.ok&&"result"in m?(l=m.result,a&&!t.generationStamped&&(t.generationStamped=!0,t.generationTicket={...a,expected_prev_gen:a.next_gen})):m.ok?l={record:null,errors:null,minted:{},logicalIds:{},superseded:[],warnings:["commit already applied (recommit)"],finalizedTests:{}}:l={record:null,errors:m.kind==="validation"?m.errors:m.kind==="contended"?[{code:m.err.code,detail:`${t.ucRef} is held by ${m.err.holder?.owner_sid??"another session"}${m.err.holder?.alive?" (live)":" (stale)"} \u2014 try another use-case or wait for it to free`}]:m.kind==="drifted"?m.asks.map(b=>({code:"DRIFTED",detail:b.detail})):[{code:"UNSETTLED",detail:`concurrent activity kept moving the store (${m.attempts} attempts) \u2014 retry when the store is quieter`}],minted:{},logicalIds:{},superseded:[],warnings:[],finalizedTests:{}}}else l=he(f(w));if(l.errors)return o("design commit failed: "+l.errors.map(a=>`${a.code}: ${a.detail}`).join("; "));let g=l.warnings.filter(a=>a.includes("\u2014 committed anyway; approve"));for(let a of l.warnings)(!g.includes(a)||g.length===1)&&t.note(`warning: ${a}`);g.length>1&&t.note(`warning: ${g.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 h=(a,m)=>a?`${a} ${m}${a>1?"s":""}`:null,S=[h(r.acs?.length,"AC"),h(r.scenarios?.length,"scenario"),h(r.tests?.length,"test"),h(r.gaps?.length,"gap")].filter(Boolean);t.aliases?.(Object.entries(l.minted).map(([a,m])=>({ref:a,cid:m,...l.logicalIds[a]?{id:l.logicalIds[a]}:{}})));{let a=`saved ${S.join(" \xB7 ")||"judgements/wiring"} as drafts`;(t.commitLine??t.note)(a)}let G=U(t.contextDir);t.onCommitted?.(G);for(let a of R){let m=l.logicalIds[a.anchorRef]??l.minted[a.anchorRef];nt(t.contextDir,l.finalizedTests[a.tempRef]??a.definitionId,{...a.rationale,anchor:m??a.rationale.anchor})}try{let a=Object.values(l.minted).filter(m=>G.getNode(m)?.label==="test");if(a.length>0){let m=vt(wt(t.contextDir)),_=je({graph:G,cids:a,cwd:m});_.wrote.length>0&&t.note(`\u2692 wrote ${_.wrote.map(b=>qt(b.path)).join(" \xB7 ")}`);for(let b of _.refused)t.note(`warning: could not create the test file for ${b.id} \u2014 ${b.reason}`)}}catch(a){t.note(`warning: the design was saved, but its test file could not be created (${a instanceof Error?a.message:String(a)})`)}try{if((r.variables??[]).length>0){let a=vt(wt(t.contextDir)),m=_t(a),{written:_}=yt({file:m,declarations:r.variables,known:t.variablesIndex?.()});if(_.sort(),_.length>0){let b=_.map(I=>({...r.variables.find(k=>k.name===I),file:m}));t.note(`\u2692 declared ${_.length} new variable${_.length===1?"":"s"} \u2014 ${_.join(" \xB7 ")} (values needed)`),t.event?.({type:"variables_declared",file:m,variables:b.map(({name:I,description:k,secret:O})=>({name:I,description:k,secret:O}))}),t.onVariablesDeclared?.(b)}}}catch(a){t.note(`warning: the design was saved, but its variable stubs could not be written (${a instanceof Error?a.message:String(a)})`)}t.event?.({type:"commit",acs:r.acs?.length??0,scenarios:r.scenarios?.length??0,tests:r.tests?.length??0,gaps:r.gaps?.length??0,warnings:l.warnings.length,minted:Object.entries(l.minted).map(([a,m])=>({temp_ref:a,cid:m,...l.logicalIds[a]?{logical_id:l.logicalIds[a]}:{}}))}),e+=1,n!==null&&(n=l.forceScopeRemaining??n,t.onForceScope?.(n));let V=ze({verb:"design",commitN:e,ucRef:t.ucRef,phase:q,committed:Object.entries(l.minted).map(([a,m])=>({temp_ref:a,cid:m,...l.logicalIds[a]?{logical_id:l.logicalIds[a]}:{}})),warnings:l.warnings},G),ee=V.event.parity?.missing??[],te=!!r.tests?.length&&ee.length===0;return{proposal:l,error:null,receipt:V,...te?{sessionComplete:te}:{}}}}}function xt(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:bt({...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 Dt=Symbol("design-out-tee");function Wt(t,e,n,i){return{terminalEventType:"design",async onProposalEvent(o){let r=o??{},v=["acs","scenarios","tests","gaps"].map(N=>r[N]?.length?`${r[N].length} ${N}`:null).filter(Boolean).join(" \xB7 ");return n?.("plan_payload",{payload:r}),t(`plan: finalize_design \u2014 ${v||"wiring/judgements only"} (nothing committed${i?`; full payload: ${Z(i)}`:""})`),e?.({type:"plan",payload:r}),{proposal:r,error:null}}}}async function ii(t,e){let n=U(e.contextDir),i=null,o=null,r=t.useCase;if(t.resume){try{{let p=await Ze(e.contextDir,t.resume,n,{deps:{onWarn:y=>e.out(`note: ${y}`)}});o=p,i=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 ke||p instanceof fe)return e.out(`error: ${p.message}`),e.emit?.({type:"error",message:`error: ${p.message}`}),p instanceof fe||p.code==="SESSION_MISSING"||p.code==="SESSION_EXPIRED"?2:1;throw p}let s=i.state,d=We(s.verb,"design",t.resume);if(d)return e.out(d.message),e.emit?.({type:"error",message:d.message,code:d.code}),i.release(),2;if(r&&s.use_case&&r!==s.use_case){let p=`session ${t.resume} was designing ${s.use_case}; --use-case ${r} 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 ${r}`),e.emit?.({type:"error",code:"RETARGET_MISMATCH",message:p}),i.release(),2}if(r=r??s.use_case,s.uc_tip&&r){let p=n.resolve(r)?.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}),i.release(),2;e.emit?.({type:"stale_basis",usecase:r})}}let u=rt(n,s.target_pins);if(u.length>0){let p=`items this session pinned have changed since it paused: ${u.map(A=>`${A.ref}${A.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}),i.release(),2;i.save({target_pins:(s.target_pins??[]).map(A=>({ref:A.ref,cid:n.resolve(A.ref)?.tip??A.cid}))})}let c=[...new Set([...i.state.held_receipts??[],...o?.view.kane?.held_receipts??[]])];if(c.length>0)if(e.chat?.holdReceipt)for(let p of c)e.chat.holdReceipt(p);else e={...e,initialMessage:[c.join(`
|
|
356
|
-
|
|
357
|
-
`),e.initialMessage].filter(Boolean).join(`
|
|
358
|
-
|
|
359
|
-
`)};if(!r)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>`}),i.release(),2}let v=t.resume?void 0:t.phase,N=!1;if(v!==void 0){let{checkPhaseEntry:s,phaseEntryCmd:d,phaseLadderFor:u}=await import("./phase-seed-HKJ2EF7R.js");N=u(e.contextDir,n,r).length>0;let c=s(e.contextDir,n,r,v);if(!c.ok&&c.code==="UNKNOWN_PHASE")return e.out(`error: ${c.message}`),e.emit?.({type:"error",code:"UNKNOWN_PHASE",message:c.message}),i?.release(),2;if(!c.ok&&c.code==="PHASE_ORDER"){let p=t.askPhaseEntry?await t.askPhaseEntry({message:c.message,earliest:c.earliest}):"cancel";if(p==="earliest")e.out(`starting at ${c.earliest} instead (${c.missing.join(", ")} not committed yet)`),v=c.earliest;else if(p==="proceed")e.out(`note: entering at ${v} with ${c.missing.join(", ")} uncommitted \u2014 proceeding on your say-so`),e.emit?.({type:"phase_entry_override",phase:v,missing:c.missing});else{let y=(t.mode??"interactive")==="agent",A=d(r,c.earliest,y);return e.out(`error: ${c.message}`),e.emit?.({type:"error",code:"PHASE_ORDER",message:c.message,next:[{cmd:A,why:`${c.earliest} is the earliest uncommitted phase for ${r}`,title:`Start at ${c.earliest}`}]}),i?.release(),2}}}let w=!!(t.force||i?.state.force),T=!!(t.resume&&i),$=st(n,r,w||T||N);if(!$.ok){let s=(t.mode??"interactive")==="interactive";if($.wall&&s&&t.askDesignEntry){let{captureForceScope:d}=await import("./design-committer-J57IAAA5.js"),u=d(n,r).length,c=await t.askDesignEntry({wall:$.wall.kind,message:$.message,display:$.wall.display,impactPairs:u});if(c.pick==="redesign"||c.pick==="proceed"){if(!c.because.trim())return e.out("a redesign needs a reason (--because) \u2014 nothing executed"),i?.release(),2;e.out(c.pick==="redesign"?`redesigning ${$.wall.display} (${u} pair(s) superseded) \u2014 because: ${c.because.trim()}`:`proceeding against the stale design (noted) \u2014 because: ${c.because.trim()}`),t={...t,force:!0,because:t.because??c.because.trim()},w=!0}else return c.pick==="view"?(e.out(`view the existing design: kane-cli context view ${$.wall.display}`),i?.release(),0):c.pick==="refresh"?(e.out(`refresh it first: kane-cli maintain evolve ${$.wall.display}`),i?.release(),0):(e.out("nothing executed \u2014 list use-cases: kane-cli context list"),i?.release(),0)}else{e.out(`design: ${$.message}`);let d=$.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,...d?{next:d}:{}}),i?.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"}),i?.release(),2}let x={contextDir:e.contextDir,resolveAlias:s=>Ve(s,{env:process.env,auth:e.auth}),embed:(s,d)=>Ue(s,d,{env:process.env,auth:e.auth})};e.chat?.setWorking?.("assembling context\u2026");let C=Pe(Oe(ae(e.contextDir))),M=[],R=await ht(e.contextDir,r,{max:t.max,strength:t.strength,embedSearch:x,variablesIndex:C});if(t.priorDesign!==void 0&&(R.prior_design=t.priorDesign),t.changeDelta!==void 0&&(R.change_delta=t.changeDelta),t.because&&(R.because=t.because),v!==void 0){let{buildPhaseSeed:s}=await import("./phase-seed-HKJ2EF7R.js"),d=s(e.contextDir,n,r,v);R.prior_design===void 0&&d.priorDesign!==void 0&&(R.prior_design=d.priorDesign),R.entry_phase=v,d.phaseLadder.length>0&&(R.phase_ladder=d.phaseLadder)}let P=e.now?.()??new Date,X=`${P.toISOString().replace(/[-:]/g,"").slice(0,15)}-${Ht(2).toString("hex")}`,E=t.mode??"interactive",q=E==="interactive"&&!!e.chat&&!e.nested,f=o?{...o.spawnConfig,mode:E}:xt(R,{session_id:t.resume??`design-${X}`,mode:E,ucCid:R.usecase.cid,readBasis:n.latestHash,topology:Je("design")}),l={current:null};if(f.resume&&"schema"in f.resume){let s=f.resume.binding?.template_version;typeof s=="string"&&(l.current=s)}t.plan?f.chat=!1:f.chat=!0;let g=e.telemetry?.enabled?e.telemetry:void 0,h=g?we(g.ids.context_instance_id??null,"design",g.ids.session_id):ve(e.contextDir,"logs",`design-${X}.log`);Vt(ae(h),{recursive:!0}),q||e.out(`trace: ${Z(h)}`),e.emit?.({type:"run_start",mode:E,trace:h,use_case:r,...g?{session:g.ids.session_id}:{}});let S=(s,d,u)=>{try{Ut(h,JSON.stringify({ts:new Date().toISOString(),level:s==="error"?"error":"info",run_id:g?.ids.operation_id,...g?{user_session_id:g.ids.session_id}:{},kind:s,session_id:u,data:d})+`
|
|
360
|
-
`)}catch{}g?.wireTrace(s,d,u)};{let s=e.out;if(s[Dt]!==!0){let d=u=>{S("transcript",{line:u}),s(u)};d[Dt]=!0,e.out=d}}if(t.resume&&i){o||(f.resume={agent_state:i.state.agent_state}),e.out(`resuming design session ${t.resume}`),i.state.assumed.length>0&&e.out(`note: ${i.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-TJJJWBUD.js"),d=s(e.contextDir).records.filter(u=>u.sid===t.resume).map(u=>u.design_phase).filter(u=>u!=null&&typeof u.phase=="string");if(d.length>0){let u=d.map(p=>`${p.phase}${p.completeness==="partial"?" (partial)":""}`).join(" \u2192 "),c=`[kane] durable record for this session (${t.resume}) on ${r}: design phases already COMMITTED \u2014 ${u}. 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,c].filter(Boolean).join(`
|
|
361
|
-
|
|
362
|
-
`)}}}catch{}t.message&&(e={...e,initialMessage:[e.initialMessage,t.message].filter(Boolean).join(`
|
|
363
|
-
|
|
364
|
-
`)})}let G=null,V={current:n},ee={detach:null},te=()=>{let s=ee.detach;ee.detach=null,s&&s()},a=(s,d)=>{let u=i;if(!u)return{};let c=s.ask,p=Qe({contextDir:s.contextDir,cwd:ae(s.contextDir),handle:u,note:y=>s.chat?s.chat.note(y):s.out(y),graphSlot:d,...s.now?{now:s.now}:{}});if(s.chat?.attachIngest){let y=s.chat;ee.detach=y.attachIngest(async A=>{try{u.save({ingest_registry:ge(u.state.ingest_registry,A,s.now?.()??new Date)});let B=await p({id:`attach-${u.state.sid}-${(u.state.ingest_registry??[]).length}`,ref:A,purpose:null});return B.ok?(y.deferBatch({source_id:B.result.source_id,cid:B.result.cid}),{ok:!0}):{ok:!1,error:B.error.message}}catch(B){return{ok:!1,error:B instanceof Error?B.message:String(B)}}})}return{ask:async y=>{let A=await c(y);if(Array.isArray(A)){let B=A.filter(F=>{if(F.free_text==null||F.free_text.trim()==="")return!1;let oe=y.find($t=>$t.id===F.id);return F.selected_index!=null&&oe?.options[F.selected_index]?.input===!0}).map(F=>F.free_text.trim());if(B.length>0){let F=u.state.ingest_registry;for(let oe of B)F=ge(F,oe,s.now?.()??new Date);u.save({ingest_registry:F})}}return A},ingest:p}};e.nested||e.chat?.attachOnCommitted?.(s=>{V.current=s});let m="";if(e.chat&&!t.plan&&!e.nested){let s=He({contextDir:e.contextDir,graph:U(e.contextDir),sessionStamp:f.session_id,by:e.by??{kind:"human",id:"owner"}});s.errors===null||s.errors[0]?.code==="CONV_SOURCE_EXISTS"?(m=s.sourceId,e.chat.attachConversationSource?.(m),V.current=U(e.contextDir)):e.out(`warning: notes you add in chat can't be saved to the context this session (${s.errors[0]?.detail})`)}let _=U(e.contextDir),b;if(!t.plan){let s=Be(_,r);if(T&&s!==null&&s.live){let d=_.resolve(r);b={uc_root:Me(_,d.cid),next_gen:s.gen,expected_prev_gen:s.gen}}else{let d=Fe(_,r,{...w?{force:!0}:{},because:t.because??(w?"forced redesign (--force)":void 0)});if("error"in d)return e.out(`design: ${d.error.detail}`),e.emit?.({type:"gate_refused",message:d.error.detail,code:d.error.code}),i?.release(),2;b=d}}let I=Ae(e.contextDir,f.session_id),k=null,O=()=>{try{k?.release()}catch{}};if(!t.plan)try{k=I.acquire([Te(_,r).key],{hold:"session",verb:"design"})}catch(s){if(s instanceof Ce&&s.code==="UC_HELD"){let d=s.holder,u=`design: ${r} is being designed by another session${d?.alive===!1?` \u2014 that session looks stopped; resume it with kane-cli design tests --resume ${d?.owner_sid??"<session>"}`:""} \u2014 pick another use-case (kane-cli design tests) or wait for it to finish`;return e.out(u),e.emit?.({type:"error",code:"UC_HELD",message:u}),i?.release(),2}throw s}let H={contextDir:e.contextDir,rootSid:f.session_id,locks:I,probe:{batchSimilar:async()=>({hits:[],degraded:!1,probeBasis:null}),recheckLocal:()=>({hits:[],uncachedNewNodes:[]})}},L=!t.plan&&E!=="ci",z=()=>Object.fromEntries((n.resolve(r)?n.edgesInto(n.resolve(r).tip):[]).filter(s=>s.type==="DERIVES"&&typeof s.props.source_id=="string").map(s=>[String(s.props.source_id),n.heads.get(String(s.props.source_id))??null])),W=!1;L&&!i&&(W=!0,i=le(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:z(),assumed:[],corpus_cursor:{remaining:[]},conv_source:m,target_pins:n.resolve(r)?[{ref:r,cid:n.resolve(r).tip}]:[],verb:"design",use_case:r,...n.resolve(r)?.tip?{uc_tip:n.resolve(r).tip}:{},...w?{force:!0}:{},...g?{user_session_id:g.ids.session_id}:{}}));let j;if(L&&i){let{resume:s,...d}=f;Le(e.contextDir,f.session_id,{schema:qe,kind:"base",sid:f.session_id,verb:"design",mode:E,created_at:P.toISOString(),run_config:d,conv_source:m||i.state.conv_source||"",...r?{use_case:r}:{},...n.resolve(r)?.tip?{uc_tip:n.resolve(r).tip}:{},store_watermark:Ie(e.contextDir)}),f.checkpoints=!0,t.resume&&S("resume_kind",{kind:o?o.view.pointer===null?"bare-base":o.view.pointer.at==="final"?"pause":"crash":"v1-shim"},f.session_id);let u=o?0:i.state.checkpoint?.seq??0,c=i;j=Xe({contextDir:e.contextDir,handle:c,seqBase:()=>u,peekHeldReceipts:()=>e.chat?.peekHeldReceipts?.()??[],readBasis:()=>z(),corpusCursor:()=>({remaining:[]}),onSoftCap:y=>e.out(y),onStat:y=>S("ckpt_stat",y,f.session_id),...e.now?{now:e.now}:{}});let p=j;j={...p,persist:y=>{let A=y.binding?.template_version;return typeof A=="string"&&A&&(l.current=A),p.persist(y)}}}!L&&!t.plan&&(f.checkpoints=!0,j={persist:s=>{let d=s.binding?.template_version;return typeof d=="string"&&d&&(l.current=d),{seq:s.seq,turn_id:s.turn_id,at:s.at,ts:new Date().toISOString(),full_seq:null}}});let J=()=>{if(!i)return;let s=i.state.checkpoint;if(s){let d=E!=="interactive"?` --mode ${E}`:"";e.out(`session ${i.state.sid} kept its last checkpoint (seq ${s.seq}, ${s.ts}) \u2014 resume with: kane-cli design tests --resume ${i.state.sid}${d}`),i.release()}else if(W){try{i.complete()}catch{i.release()}try{St(ve(e.contextDir,"sessions"))}catch{}}else i.release();i=null},ne=t.plan?Wt(e.out,e.emit,S,h):kt({templateVersion:()=>l.current,contextDir:e.contextDir,ucRef:r,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:()=>C,onVariablesDeclared:s=>{M.push(...s);for(let d of s)C.set(d.name,{has_value:!1,source:d.file})},resuming:T,...i?.state.force_scope?.length?{forceScope:i.state.force_scope}:{},onForceScope:s=>{G=s},...t.because?{because:t.because}:{},aliases:e.chat?s=>e.chat.registerAliases?.(s):void 0,onCommitted:s=>{V.current=s},protocol:H,...b?{generationTicket:b}:{},...T?{generationStamped:!0}:{}});e.chat||(S("design_budget",{max_pairs:R.budget.max_pairs??null,strength:R.budget.strength_override??null}),e.out(`designing: ${R.usecase.logical_id??r}`)),e.chat?.setWorking?.(`designing ${R.usecase.logical_id??r}\u2026`);let D;try{D=await pe(f,{...e,graphSlot:V,...a(e,V),...j?{checkpoint:j}:{}},new Map,n,S,ne)}catch(s){throw S("error",{message:s instanceof Error?s.message:String(s),stack:s instanceof Error?s.stack:void 0},f.session_id),J(),s}finally{e.chat?.setWorking?.(null),te()}if(D.errorCode==="binding_mismatch"&&o){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(c=>c.id==="binding-mismatch"):void 0)?.selected_index!==0){let c=`resume abandoned: binding mismatch on session ${f.session_id} \u2014 the session is preserved`;return e.out(c),e.emit?.({type:"error",message:c,code:"BINDING_MISMATCH"}),i?.release(),2}S("binding_migrate",{sid:f.session_id},f.session_id);let u=f.resume&&"schema"in f.resume?{...f.resume,binding:{}}:void 0;try{D=await pe({...f,...u?{resume:u}:{}},{...e,graphSlot:V,...a(e,V),...j?{checkpoint:j}:{}},new Map,n,S,ne)}catch(c){throw S("error",{message:c instanceof Error?c.message:String(c),stack:c instanceof Error?c.stack:void 0},f.session_id),J(),c}finally{e.chat?.setWorking?.(null),te()}}if(D.highRisk)return e.out(`error: ${D.highRisk.length} high-risk decision${D.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): ${D.highRisk.map(s=>s.id).join(", ")}`,code:"HIGH_RISK_CI"}),J(),O(),1;if(D.paused){let s=i;s||(s=le(e.contextDir,{sid:f.session_id,mode:"agent",created_at:P.toISOString(),expires_at:new Date(P.getTime()+1440*60*1e3).toISOString(),agent_state:D.paused.agent_state,pending:{questions:[],proposals:[]},read_basis:Object.fromEntries((n.resolve(r)?n.edgesInto(n.resolve(r).tip):[]).filter(c=>c.type==="DERIVES"&&typeof c.props.source_id=="string").map(c=>[String(c.props.source_id),n.heads.get(String(c.props.source_id))??null])),assumed:[],corpus_cursor:{remaining:[]},conv_source:m,target_pins:n.resolve(r)?[{ref:r,cid:n.resolve(r).tip}]:[],verb:"design",use_case:r,...n.resolve(r)?.tip?{uc_tip:n.resolve(r).tip}:{},...w?{force:!0}:{},...g?{user_session_id:g.ids.session_id}:{}}));try{w&&!s.state.force&&s.save({force:!0}),g&&s.state.user_session_id!==g.ids.session_id&&s.save({user_session_id:g.ids.session_id}),m&&s.state.conv_source!==m&&s.save({conv_source:m});let c=e.chat?.drainHeldReceipts?.()??[];(c.length>0||(s.state.held_receipts?.length??0)>0)&&s.save({held_receipts:c}),G!==null&&s.save({force_scope:G}),Ye(s,D.paused)}catch(c){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")+` (${c instanceof Error?c.message:String(c)})`;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 d=E!=="interactive"?` --mode ${E}`:"",u=`kane-cli design tests --resume ${s.state.sid}${d}`;if(q||e.out(`paused \u2014 resume with: ${u}`),e.emit?.({type:"session_paused",sid:s.state.sid,mode:E,resume:u,expires_at:s.state.expires_at,pending_questions:D.paused.pending.questions}),q){let c=e.chat?.state.credits?.total;e.onSummary?.({state:"paused",reason:"ctrl+c",facts:[`session ${s.state.sid} saved \u2014 designing ${R.usecase.logical_id??r}`,...s.state.expires_at?[`expires: ${s.state.expires_at}`]:[],...c!==void 0?[`credits used: ${c.toFixed(1)}`]:[]],resume:u,resumeMessage:`${u} --message "<your words>"`,tracePath:Z(h)})}return O(),3}if(D.crashed&&i?.state.checkpoint){let s=i.state.checkpoint,d=E!=="interactive"?` --mode ${E}`:"",u=`kane-cli design tests --resume ${i.state.sid}${d}`;if(S("agent_crashed_resumable",{sid:i.state.sid,seq:s.seq},f.session_id),q||e.out(`agent crashed \u2014 session ${i.state.sid} is resumable at checkpoint seq ${s.seq} (at most the in-flight turn lost); resume with: ${u}`),e.emit?.({type:"session_paused",sid:i.state.sid,mode:E,resume:u,expires_at:i.state.expires_at,crashed:!0}),q){let c=e.chat?.state.credits?.total;e.onSummary?.({state:"crashed",facts:[`agent crashed \u2014 session ${i.state.sid} is resumable at checkpoint seq ${s.seq}`,"at most the in-flight turn was lost",...c!==void 0?[`credits used: ${c.toFixed(1)}`]:[]],resume:u,resumeMessage:`${u} --message "<your words>"`,tracePath:Z(h)})}return i.release(),i=null,3}if(D.error)return e.out(`error: design agent failed: ${D.error}`),e.emit?.({type:"error",message:`error: design agent failed: ${D.error}`}),J(),O(),1;if(D.proposal==null&&E!=="interactive")return e.out(`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${h})`),e.emit?.({type:"error",message:`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${h})`}),J(),O(),1;let K=0;if(D.proposal==null)try{let{readRecords:s}=await import("./records-TJJJWBUD.js"),d=t.resume??f.session_id;K=s(e.contextDir).records.filter(u=>u.sid===d).reduce((u,c)=>u+c.nodes.filter(p=>p.label!=="source").length,0)}catch{}if(D.proposal==null&&e.out(K>0?`done \u2014 ${K} 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)"),D.assumedDefaults&&e.out(`assumed: ${D.assumedDefaults} default(s) taken while unattended`),i&&e.emit?.({type:"session_complete",sid:t.resume??f.session_id}),g?.event("ASR_SESSION_COMPLETE",{}),i?.complete(),W)try{St(ve(e.contextDir,"sessions"))}catch{}if(M.length>0){let s=Kt(M,ae(e.contextDir));e.chat?e.chat.note(s):e.out(s),e.emit?.({type:"variables_summary",file:M[0].file,variables:M.map(({name:d,description:u,secret:c})=>({name:d,description:u,secret:c}))})}if(q){let s=e.chat.state.ledger.filter(c=>c.kind==="answer"&&c.receipt.form==="assumed").length??0,d=(D.assumedDefaults??0)+s,u=e.chat.state.credits?.total??D.creditsTotal;e.onSummary?.({state:"complete",facts:[`designed: ${R.usecase.logical_id??r}${D.proposal==null?K>0?` (${K} item(s) committed across this session)`:" (nothing committed this session)":""}`,...M.length>0?[`${M.length} variable(s) need values \u2014 see .testmuai/variables/assurance.json`]:[],...d>0?[`${d} assumed default(s)`]:[],...u!==void 0?[`credits used: ${u.toFixed(1)}`]:[]],tracePath:Z(h)})}return t.plan||et(e.contextDir),O(),0}function Kt(t,e){if(t.length===0)return"";let n=zt(e,t[0].file)||t[0].file,i=Math.max(...t.map(r=>r.name.length))+3,o=t.slice().sort((r,v)=>r.name<v.name?-1:1).map(r=>` ${r.name.padEnd(i)}${r.description}${r.secret?" (secret)":""}`);return`variables declared this session \u2014 fill their values before running:
|
|
365
|
-
${n}
|
|
366
|
-
${o.join(`
|
|
367
|
-
`)}
|
|
368
|
-
`}export{ii as a,Kt as b};
|
package/dist/chunk-GP7WD4UY.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Te}from"./chunk-JQW2QFSX.js";import{H as ge,M as re,T as Oe,X as we,c as ne,d as K,f as fe,m as te,p as xe,x as Ie}from"./chunk-3N6IAVD5.js";import{d as se,e as O,f as ie,g as ae,h as le}from"./chunk-AKX4VRRR.js";function Le(t,s){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(!pe.test(r))return null;let e=r;for(let c=2;s(e);c++)e=`${r}-${c}`;return pe.test(e)?e:null}var Ge={source:"src",usecase:"uc",scenario:"sc",ac:"ac",test:"t",gap:"gap",stylenote:"sty"};function rt(t,s,r){let e=Ge[t];return Le(e?`${e} ${s}`:s,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 De(t,s,r){let e=Ue[t];if(!e)return null;let c=new RegExp(`^${e}-(\\d+)$`),l=0;for(let d of r){let a=c.exec(d);if(!a)continue;let n=Number(a[1]);Number.isSafeInteger(n)&&n>l&&(l=n)}let o=l+1;for(;s(`${e}-${o}`);)o+=1;return`${e}-${o}`}var Fe=/^L([1-9]\d*)-L([1-9]\d*)$/,je=/^img#(p[1-9]\d*-[1-9]\d*|i[1-9]\d*)$/;function he(t){if(t==="img#whole")return{kind:"img-whole"};let s=je.exec(t);if(s)return{kind:"img-part",ref:s[1]};let r=Fe.exec(t);return r?{kind:"lines",a:parseInt(r[1],10),b:parseInt(r[2],10)}:null}function He(t,s){let r=/^L(\d+)-L(\d+)$/.exec(s);if(!r)return null;let e=parseInt(r[1],10),c=parseInt(r[2],10),l=t.split(`
|
|
3
|
-
`);return e<1||c<e||c>l.length?null:l.slice(e-1,c).map(o=>o.replace(/^\d+\| /,"")).join(`
|
|
4
|
-
`)}function Ae(t,s,r){let e=he(s.anchor);if(t.format==="image")return e?.kind==="img-whole"?[]:[{code:"CITE_ANCHOR_INVALID",detail:`image cites are anchor-only (img#whole), got ${s.anchor}`}];if(e?.kind==="img-part")return new Set((t.images??[]).map(o=>o.ref)).has(e.ref)?[]:[{code:"CITE_ANCHOR_INVALID",detail:`anchor ${s.anchor} names no embedded image of this source version`}];if(!s.anchor||s.quote===void 0||s.quote==="")return[{code:"MISSING_CITE",detail:"text-kind cites need anchor+quote"}];let c=r!==null?He(r,s.anchor):null;return c===null?[{code:"BAD_ANCHOR",detail:`anchor ${s.anchor} does not resolve in the source`}]:c.includes(s.quote)?[]:[{code:"QUOTE_MISMATCH",detail:`quote is not verbatim within ${s.anchor}`}]}import{existsSync as qe,readFileSync as Ke}from"fs";function pt(t){return We(t,we(t))}function We(t,s,r){let e=new Map(Object.entries(s.heads)),c=new Map(Object.entries(s.trust)),l=new Map(Object.entries(s.nodeLabel)),o=new Map(Object.entries(s.superseded)),d=new Map(Object.entries(s.names)),a=new Map(Object.entries(s.archivedReason)),n=new Set(s.appliedEvents),E=new Map(Object.entries(s.conv)),f=p=>s.media[p]??{format:"text",media_type:"text/plain",anchors_supported:["L-L"]},_=new Map;for(let[p,m]of d)_.set(m,p);let g=new Map,y=p=>{if(g.has(p))return g.get(p);if(!l.has(p))return g.set(p,null),null;let m=r?.get(p);if(m)return g.set(p,m),m;let C=Oe(t,p);if(!qe(C))throw new xe(`derived node file missing for ${p} \u2014 run kane-cli context rebuild`);let R=JSON.parse(Ke(C,"utf8"));return g.set(p,R),R},v=p=>{let m=p,C=new Set;for(;o.has(m)&&!C.has(m);){C.add(m);let R=o.get(m);if(typeof R!="string")break;m=R}return m},w=null,N=p=>{let m=_.get(p);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 C=new Set,R=p;for(;!C.has(R);){C.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=p=>{ke.test(p)&&(p=p.toLowerCase());let m=e.get(p),C=l.has(p)?p:d.get(p)??(typeof m=="string"?m:void 0);if(C===void 0||!l.has(C))return null;let R=v(C);return{cid:C,tip:R,superseded:o.has(C)||o.has(R)}},L=new Map;for(let p of Object.values(s.forward))for(let m of p){let C=L.get(m.dst);C?C.push(m):L.set(m.dst,[m])}let P=p=>(p??[]).filter(m=>!o.has(m.ecid)),W=p=>P(L.get(p)),G=p=>W(p).filter(m=>m.type===O.DERIVES),Q=p=>P(s.forward[p]).some(m=>ae(m.type)?.pin?.comparesTo==="dst_tip"&&o.has(m.dst)),oe=p=>{if(o.has(p))return"superseded";let m=G(p);if(m.length===0)return Q(p)?"stale":"fresh";let C=new Map;for(let A of m)C.set(A.props.source_id,A);let R=!1,F=!1;for(let[A,D]of C){let M=e.get(A);if(M!=null&&(R=!0,M!==D.props.source_cid)){let ce=E.get(A)?.chain;(!ce||!ce.includes(D.props.source_cid))&&(F=!0)}}return R?F||Q(p)?"stale":"fresh":"orphaned"};return{heads:e,trust:c,nodeLabel:l,superseded:o,names:d,nameOf:_,archivedReason:a,appliedEvents:n,convChains:E,mediaOf:f,extractedSourceCids:new Set(s.extracted),extractionCompleteness:new Map(Object.entries(s.completeness??{}).map(([p,{seq:m,...C}])=>[p,C])),designOf:new Map(Object.entries(s.design_of??{})),designGenerationOf:new Map(Object.entries(s.design_generation??{})),latestHash:s.applied.hash,lastSeq:s.applied.seq,hasNode:p=>l.has(p),getNode:y,byLabel:p=>[...l.entries()].filter(([,m])=>m===p).map(([m])=>({cid:m,content:y(m)?.content??{}})),edgesFrom:p=>P(s.forward[p]),edgesInto:W,derivesInto:G,resolve:T,tipOf:v,displayNameOf:N,stale:oe,staleList:()=>[...l.keys()].map(p=>({cid:p,state:oe(p)})).filter(p=>p.state!=="fresh"),execHistory:p=>{let m=T(p);if(!m)return[];let C=v(m.cid),R=new Set([C]),F=!0;for(;F;){F=!1;for(let[D,M]of o)M!==null&&R.has(M)&&!R.has(D)&&(R.add(D),F=!0)}let A=[];for(let D of Object.entries(s.exec??{}))R.has(D[0])&&A.push(...D[1]);return A.sort((D,M)=>D.started_at<M.started_at?-1:1)},retractedEdgesTouching:p=>{let m=new Set([v(p),p]),C=!0;for(;C;){C=!1;for(let[D,M]of o)typeof M=="string"&&m.has(M)&&!m.has(D)&&(m.add(D),C=!0)}let R=s.edgeRetractions??{},F=[],A=new Set;for(let D of m)for(let M of[...s.forward[D]??[],...L.get(D)??[]]){let ce=R[M.ecid];!ce||A.has(M.ecid)||(A.add(M.ecid),F.push({...M,retraction:ce}))}return F}}}function ft(t,s){if(t.stale(s)!=="stale")return!1;let r=new Map;for(let e of t.derivesInto(s))r.set(e.props.source_id,e);for(let[e,c]of r){let l=t.heads.get(e);if(l==null||l===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(s)){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 me(t,s){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=[s],l=new Set;for(;c.length>0;){let o=c.pop();l.has(o)||(l.add(o),e.push(o),c.push(...r.get(o)??[]))}return e}function Be(t,s){return(t.extraction_claims??[]).some(r=>r.source_id===s&&r.completeness==="complete")}function Je(t,s){let r=new Set;for(let e of me(t,s))for(let c of t.derivesInto(e))r.add(c.props?.source_id??"conversation");return r}function ye(t,s){let r=[],e=[],c=t.archived??[];if(c.length===0)return{valid:r,errors:e};let l=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=s.resolve(d.matches_existing.cid);a&&o.add(s.tipOf(a.cid))}for(let d of c){let a=`archived[${d.target}]`,n=s.resolve(d.target),E=n?s.tipOf(n.cid):null;if(!E||(s.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=Je(s,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(!l.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(!Be(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,s,r){return t.superseded.has(r)}function Me(t){let{graph:s,oldTip:r,newCid:e,newLabel:c,by:l}=t,o=[],d=[],a=[],n=[],E=new Set;for(let f of s.edgesFrom(r)){if(f.type===O.DERIVES||t.skipEcids?.has(f.ecid))continue;d.push({kind:"edge",ecid:f.ecid,reason:t.reason,by:l}),E.add(f.ecid);let _=t.dstRedirect?.get(f.dst)??f.dst,g=s.nodeLabel.get(f.dst)??"(unknown)",y=le(f.type,c,g,f.props);if(y.length>0){a.push(`rebless ${f.type} \u2192 ${f.dst}: ${y.map(N=>N.detail).join("; ")}`);continue}let v=Te(s,{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(s.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 pe=/^[a-z0-9][a-z0-9-]{1,63}$/;function Pe(t,s,r,e){if(!s)return{error:{code:"SUPERSEDE_TARGET_MISSING",detail:"supersede verdict needs a target (slug or cid)"}};let c=t.resolve(s);return c?c.superseded||e.has(c.cid)?{error:{code:"ALREADY_SUPERSEDED",detail:`${s} 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:`${s} names nothing in the graph`}}}function Ye(t,s,r,e,c=[]){if(!ae(s)?.acyclic)return null;if(r===e)return{code:"EDGE_CYCLE",detail:`${s} ${r} \u2192 itself`};let o=n=>[...t.edgesFrom(n).filter(E=>E.type===s).map(E=>E.dst),...c.filter(E=>E.type===s&&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:`${s} ${r} \u2192 ${e} closes a cycle`};d.has(n)||(d.add(n),a.push(...o(n)))}return null}function kt(t,s,r,e){let l=ae(s)?.cardinality;if(l!=="one-live-per-src"&&l!=="one-live-per-src-and-dst")return null;let o=t.edgesFrom(r).filter(d=>d.type===s&&!t.superseded.has(d.dst));if(o.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${s} from ${r} already has a live edge (${o[0].ecid}) \u2014 supersede it first`};if(l==="one-live-per-src-and-dst"&&e!==void 0){let d=t.edgesInto(e).filter(a=>a.type===s&&!t.superseded.has(a.src));if(d.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${s} onto ${e} already has a live edge (${d[0].ecid}) \u2014 strict 1:1, supersede it first`}}return null}var $e=new Set(["high","med","low"]),_e=t=>t.cites&&t.cites.length>0?t.cites:[t.cite];function Ee(t){let s=0;for(let r of t)typeof r=="object"&&r!==null&&"op"in r&&s++;return s===0?"flat":s===t.length?"ops":"mixed"}var Qe=/^c[1-9][0-9]*$/;function Ve(t,s,r,e){let c=new Map,l=[],o=[];for(let[a,n]of s.entries()){let E=`${t}.updated.criteria[${a}]`;if(n.op==="keep"||n.op==="remove"){if(!Qe.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"&&(l.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 l)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 Dt(t,s,r){let e=[],c=t.sources??[t.source],l=new Map(c.map(n=>[n.source_id,n.source_cid])),o=new Map;if(typeof s=="string")o.set(t.source.source_id,{media:r.mediaOf(t.source.source_cid),numberedText:s});else for(let[n,E]of s)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(!l.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 Ae(_.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`}),$e.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 _e(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=Ee(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?Ze(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 y=r.getNode(g.cid)?.content.criteria??[];Ve(n.temp_ref,_,y,e)}for(let[y,v]of _.entries())v.op==="set"&&(!v.cite||!v.cite.anchor?e.push({code:"MISSING_CITE",detail:`${n.temp_ref}.updated.criteria[${y}]: a set op carries the proposing source's cite`}):d(`${n.temp_ref}.updated.criteria[${y}]`,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 Xe(t,s,r){return`${t}:${s}:${r}`}function ze(t,s,r,e){let c=`${s}:${r}:`,l=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>l&&(l=a)}return Array.from({length:e},(o,d)=>Xe(s,r,l+1+d))}function Ze(t,s){let r=t.resolve(s);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 At(t){let{contextDir:s,graph:r,proposal:e,proposalId:c,verdicts:l,by:o,allowStaleBasis:d,extractorVersion:a,autoName:n}=t,E=ge(s);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 i of e.sources??[e.source])if(!r.hasNode(i.source_cid))return{record:null,errors:[{code:"MISSING_SOURCE_NODE",detail:`source ${i.source_id} (${i.source_cid}) is not a committed node \u2014 ingest it first`}]};let f=new Map((e.sources??[e.source]).map(i=>[i.source_id,i.source_cid])),_={supersedeTarget:{},matches_existing:{},conflicts_with:{},depends_on_hint:{},read_basis_heads:Object.fromEntries(f)},g=[],y=[],v=new Map,w=[],N=r.mediaOf(e.source.source_cid),T=new Set,L=[],P=[],W=[],G=[];for(let i of ye(e,r).valid)G.push({id:i.cid,kind:"pending_archive",resolution:"pending",edit:null,reason:i.op.reason,by:o});let Q=[],oe=[],p=new Set,m=new Set,C=(i,h,j)=>{let Y=Pe(r,h.supersedeTarget,j,p);if("error"in Y){g.push({code:Y.error.code,detail:`${i}: ${Y.error.detail}`});return}p.add(Y.targetCid),_.supersedeTarget[i]=Y.targetCid,Q.push({kind:"node",old:Y.targetCid,new:j,reason:h.reason??`superseded via review by ${o.id}`,by:o})};for(let i of e.use_cases){let h=l.get(i.temp_ref)??{resolution:"skipped"};T.has(i.temp_ref)&&g.push({code:"DUP_TEMP_REF",detail:`duplicate temp_ref ${i.temp_ref}`}),T.add(i.temp_ref),i.conflicts_with&&(_.conflicts_with[i.temp_ref]=i.conflicts_with.map(u=>r.resolve(u)?.cid??null)),(!i.title||!i.title.trim())&&g.push({code:"EMPTY_TITLE",detail:`${i.temp_ref}: title is empty`}),$e.has(i.risk)||g.push({code:"BAD_RISK",detail:`${i.temp_ref}: risk ${JSON.stringify(i.risk)} not in high|med|low`});let j=he(i.cite?.anchor??""),Y=i.cite?.source_id!==void 0&&f.has(i.cite.source_id)?r.mediaOf(f.get(i.cite.source_id)):N;if(Y.format==="image"){if(j?.kind!=="img-whole"){g.push({code:i.cite?.anchor?"CITE_ANCHOR_INVALID":"MISSING_CITE",detail:`${i.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:`${i.temp_ref}: anchor ${i.cite?.anchor} names no embedded image of this source version`});continue}}else if(!i.cite||!i.cite.anchor||!i.cite.quote){g.push({code:"MISSING_CITE",detail:`${i.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:`${i.temp_ref}: edited title is empty`}),h.edit.risk!==void 0&&!$e.has(h.edit.risk)&&g.push({code:"BAD_RISK",detail:`${i.temp_ref}: edited risk ${JSON.stringify(h.edit.risk)} invalid`}));let ve=fe({title:h.edit?.title??i.title,description:i.description,summary:h.edit?.summary??i.summary,actors:i.actors,value:i.value,risk:h.edit?.risk??i.risk,...i.criteria&&i.criteria.length>0?{criteria:i.criteria.map(u=>u.text)}:{}}),b=ne("usecase",ve),Se=i.cite.source_id??e.source.source_id,Ne=f.get(Se);if(i.cite.source_id!==void 0&&Ne===void 0){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${i.temp_ref}: cite source ${JSON.stringify(Se)} is not in read_basis`});continue}let ee={source_id:Se,source_cid:Ne??e.source.source_cid,anchor:i.cite.anchor,...i.cite.quote?{quote:i.cite.quote}:{}};if(i.matches_existing&&!r.hasNode(i.matches_existing.cid)){g.push({code:"UNKNOWN_MATCH",detail:`${i.temp_ref}: matches_existing ${i.matches_existing.cid} is not in the graph`});continue}let x=i.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&&i.matches_existing&&(_.matches_existing[i.temp_ref]=x),x&&i.matches_existing&&(r.trust.get(x)??null)==="derived"){let u=i.updated?.criteria??[];if(i.changed&&u.length>0&&Ee(u)==="ops"&&(h.resolution==="approved"||h.resolution==="edited")){g.push({code:"UC_UNREVIEWED",detail:`${i.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(I=>I.tempRef===i.temp_ref&&I.candidateCid===x);w.push({tempRef:i.temp_ref,candidate_cid:x,score:S?.score??1,scorer:S?.scorer??"lexical_fallback"}),x=null}if(x){if(i.changed&&(h.resolution==="approved"||h.resolution==="edited")){let u=i.updated;if(!u||Object.keys(u).length===0){g.push({code:"CHANGED_NEEDS_PAYLOAD",detail:`${i.temp_ref}: changed:true needs an updated{...} payload naming the moved fields`});continue}let S=r.getNode(x)?.content??{},I=u.criteria??[],V=I.length>0?Ee(I):"flat";if(V==="mixed"){g.push({code:"CRITERIA_SHAPE_MIXED",detail:`${i.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=I,H=S.criteria??[],q=g.length;Ve(i.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:`${i.temp_ref}.updated.criteria[${de}]: a set op carries the proposing source's cite`});if(g.length>q)continue;let k=U.filter(de=>de.op!=="remove").map(de=>de.text),J=fe({title:h.edit?.title??u.title??String(S.title??i.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??i.risk),...k.length>0?{criteria:k}:{}}),X=ne("usecase",J);if(X!==x){for(let $ of ie("usecase",J))g.push({code:$.code,detail:`${i.temp_ref}: ${$.detail}`});L.push({cid:X,label:se.USECASE,content:J});for(let $ of _e(i)){let z=$.source_id??e.source.source_id,B=f.get(z);if(!B){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${i.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,X,Z),type:O.DERIVES,src:B,dst:X,props:Z})}let ue=me(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 Re=`${Z.source_id}|${Z.source_cid}|${Z.anchor}`;if(z.has(Re))continue;z.add(Re);let be={...B.props};P.push({ecid:K("DERIVES",B.src,X,be),type:O.DERIVES,src:B.src,dst:X,props:be})}}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:`${i.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,X,Z),type:O.DERIVES,src:B,dst:X,props:Z})}for(let $ of U)$.op==="remove"&&y.push({about:x,ref:$.ref,text:$.text,reason:$.reason});C(i.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)`},X),G.push({id:X,kind:"review-item",resolution:h.resolution,edit:h.resolution==="edited"?{...h.edit}:null,reason:null,by:o});continue}}else{let U=I.map(k=>typeof k=="string"?{text:k,cite:void 0}:k),H=fe({title:h.edit?.title??u.title??String(S.title??i.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??i.risk),...u.criteria?U.length>0?{criteria:U.map(k=>k.text)}:{}:S.criteria?{criteria:S.criteria}:{}}),q=ne("usecase",H);if(q!==x){for(let k of ie("usecase",H))g.push({code:k.code,detail:`${i.temp_ref}: ${k.detail}`});L.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 k of U){if(!k.cite)continue;let J={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:k.cite.anchor,...k.cite.quote?{quote:k.cite.quote}:{},claim:k.text};P.push({ecid:K("DERIVES",J.source_cid,q,J),type:O.DERIVES,src:J.source_cid,dst:q,props:J})}C(i.temp_ref,{resolution:"supersede",supersedeTarget:x,reason:h.reason??`matches-but-changed: ${e.source.source_id} moved (${Object.keys(u).join(", ")})`},q),G.push({id:q,kind:"review-item",resolution:h.resolution,edit:h.resolution==="edited"?{...h.edit}:null,reason:null,by:o});continue}for(let k of U){if(!k.cite)continue;let J={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:k.cite.anchor,...k.cite.quote?{quote:k.cite.quote}:{},claim:k.text};P.push({ecid:K("DERIVES",J.source_cid,x,J),type:O.DERIVES,src:J.source_cid,dst:x,props:J})}}}if(i.changed&&h.resolution==="skipped"){let u=i.updated?.criteria??[];u.length>0&&Ee(u)==="ops"&&G.push({id:x,kind:"pending_update",resolution:"pending",edit:{temp_ref:i.temp_ref,source_id:e.source.source_id,updated:i.updated},reason:i.change_note??null,by:o})}if(h.resolution!=="rejected"){for(let u of _e(i)){let S=u.source_id??e.source.source_id,I=f.get(S);if(!I){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${i.temp_ref}: cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:I,anchor:u.anchor,...u.quote?{quote:u.quote}:{}};P.push({ecid:K("DERIVES",I,x,V),type:O.DERIVES,src:I,dst:x,props:V})}(h.resolution==="approved"||h.resolution==="edited"||h.resolution==="supersede")&&G.push({id:x,kind:"review-item",resolution:"approved",edit:null,reason:null,by:o}),h.resolution==="supersede"&&C(i.temp_ref,h,x)}continue}for(let u of ie("usecase",ve))g.push({code:u.code,detail:`${i.temp_ref}: ${u.detail}`});for(let u of le(O.DERIVES,"source","usecase",ee))g.push({code:u.code,detail:`${i.temp_ref}: ${u.detail}`});L.push({cid:b,label:se.USECASE,content:ve}),v.set(i.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 _e(i).slice(1)){let S=u.source_id??e.source.source_id,I=f.get(S);if(!I){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${i.temp_ref}: cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:I,anchor:u.anchor,...u.quote?{quote:u.quote}:{}};for(let U of le(O.DERIVES,"source","usecase",V))g.push({code:U.code,detail:`${i.temp_ref}: ${U.detail}`});P.push({ecid:K("DERIVES",I,b,V),type:O.DERIVES,src:I,dst:b,props:V})}for(let u of i.criteria??[]){let S=u.cite.source_id??e.source.source_id,I=f.get(S);if(!I){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${i.temp_ref}: criterion cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:I,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 i.depends_on_hint??[]){let S=H=>H.toLowerCase().trim().replace(/\s+/g," "),I=null,V=r.resolve(u);if(V&&!V.superseded&&r.nodeLabel.get(V.cid)===se.USECASE&&(I=V.cid),!I){for(let{cid:H,content:q}of r.byLabel(se.USECASE))if(!r.superseded.has(H)&&S(String(q.title??""))===S(u)){I=H;break}}if(!I){let H=L.find(q=>q.label===se.USECASE&&S(String(q.content.title??""))===S(u));H&&(I=H.cid)}!I||I===b||Ye(r,O.DEPENDS_ON,b,I,W)||W.some(H=>H.src===b&&H.dst===I)||(P.push({ecid:K(O.DEPENDS_ON,b,I,{reason:"extract hint"}),type:O.DEPENDS_ON,src:b,dst:I,props:{reason:"extract hint"}}),W.push({src:b,dst:I,type:O.DEPENDS_ON}),(_.depends_on_hint[i.temp_ref]??=[]).push(I))}if((h.resolution==="approved"||h.resolution==="edited"||h.resolution==="supersede")&&r.superseded.get(b)===null&&!p.has(b)&&Q.push({kind:"node",old:b,new:b,reason:`re-minted after tombstone via review by ${o.id}`,by:o}),n){let u=De("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"?G.push({id:b,kind:"review-item",resolution:"approved",edit:null,reason:null,by:o}):h.resolution==="edited"?G.push({id:b,kind:"review-item",resolution:"edited",edit:{...h.edit},reason:null,by:o}):h.resolution==="rejected"?G.push({id:b,kind:"review-item",resolution:"rejected",edit:null,reason:h.reason??null,by:o}):h.resolution==="supersede"&&(G.push({id:b,kind:"review-item",resolution:"approved",edit:null,reason:h.reason??null,by:o}),C(i.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 i=[];if(e.extraction_claims==null)i.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&&i.push({source_id:j.source_id,source_cid:j.source_cid,completeness:Y,...a?{extractor_version:a}:{},at:R})}}A=i}else A=e.source.source_cid;let D=[];for(let i of t.probeHits??[])D.push({...v.has(i.tempRef)?{new_cid:v.get(i.tempRef)}:{},candidate_cid:i.candidateCid,score:i.score,scorer:i.scorer,probe_basis:null});for(let i of w){let h=v.get(i.tempRef);D.some(j=>j.new_cid===h&&j.candidate_cid===i.candidate_cid)||D.push({...h!==void 0?{new_cid:h}:{},candidate_cid:i.candidate_cid,score:i.score,scorer:i.scorer,probe_basis:null})}let M=t.eventIds&&t.eventIds.length>0?t.eventIds:t.sid?ze(r,t.sid,"extract",1):void 0;return{record:re(s,{ts:R,proposal_id:c,...c!=null?{extraction_of:A}:{},...c!=null&&a?{extractor_version:a}:{},...y.length>0?{criteria_removed:y}:{},...D.length>0?{dedup_hits:D}:{},nodes:L,edges:P,review:G,supersessions:Q,...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(l),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 Mt(t){let{contextDir:s,graph:r,verdicts:e,by:c}=t,l=[],o=[],d=[],a=[],n=[],E=new Set,f={verdicts:{},supersedeTarget:{}},_=new Map;for(let[y,v]of e){if(v.resolution!=="edited")continue;let w=r.resolve(y);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 L=ne(N.label,T);L===w.cid||Ce(r,w.cid,L)||_.set(w.cid,L)}for(let[y,v]of e){if(v.resolution==="skipped")continue;let w=r.resolve(y);if(!w){l.push({code:"UNKNOWN_NODE",detail:`${y} names nothing in the graph`});continue}if(w.superseded){l.push({code:"SUPERSEDED_TARGET",detail:`${y} is superseded \u2014 review the tip (${w.tip})`});continue}let N=w.cid;if(f.verdicts[y]=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)){l.push({code:"DUPLICATE_TARGET",detail:`${y}: this node was already superseded by another verdict in this batch \u2014 one verdict per node`});continue}let T=r.getNode(N);if(!T){l.push({code:"UNKNOWN_NODE",detail:`${y}: node file unreadable`});continue}let L={...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,L);if(P.length>0){for(let Q of P)l.push({code:Q.code,detail:`${y}: ${Q.detail}`});continue}let W=ne(T.label,L);if(W===N){a.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:null,by:c});continue}if(Ce(r,N,W)){l.push({code:"SUPERSEDE_CYCLE",detail:`${y}: edit reproduces an already-superseded version (supersession cycle guard) \u2014 re-edit forward or redesign`});continue}let G=Me({graph:r,oldTip:N,newCid:W,newLabel:T.label,by:c,reason:`re-blessed onto ${W} (edited in review)`,dstRedirect:_});if(G.errors.length>0){for(let Q of G.errors)l.push({code:"REBLESS_REFUSED",detail:`${y}: ${Q}`});continue}o.push({cid:W,label:T.label,content:L}),d.push(...G.edges),E.add(N),n.push({kind:"node",old:N,new:W,reason:v.reason??"edited in review",by:c}),n.push(...G.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){l.push({code:T.error.code,detail:`${y}: ${T.error.detail}`});continue}E.add(T.targetCid),f.supersedeTarget[y]=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 l.length?{record:null,errors:l}:a.length===0&&n.length===0?{record:null,errors:[{code:"NO_VERDICTS",detail:"every item was skipped \u2014 nothing to commit"}]}:{record:re(s,{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 Pt(t){let{contextDir:s,graph:r,survivor:e,merged:c,reason:l,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(s,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:a.cid,new:d.cid,reason:l??`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:l??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 Vt(t){let{contextDir:s,graph:r,assignments:e,by:c}=t,l=new Set(t.reassign??[]),o=[],d=[],a=new Set,n={};for(let{ref:f,slug:_}of e){if(!pe.test(_)){o.push({code:"BAD_SLUG",detail:`${JSON.stringify(_)} \u2014 slugs are kebab-case ${String(pe)}`});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 y=r.names.get(_);if(y!==void 0&&!r.superseded.has(y)&&y!==g.cid&&!l.has(_)||a.has(_)){o.push({code:"SLUG_TAKEN",detail:`${_} already names ${y??"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(s,{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 Lt(t){let{contextDir:s,graph:r,sourceId:e,reason:c,by:l}=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(s,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:o,new:null,reason:c??`retired source ${e}`,by:l}],source_head_moves:{[e]:null},names:[]},{expectPrev:r.latestHash,intent:{v:1,verb:"retire",args:te({sourceId:e,reason:c??null,by:l}),pins:{head:o}},provenance:t.provenance}).record,errors:null}}function Gt(t){let s=ie("gap",t.content);if(s.length>0)return{ok:!1,refusal:`defer gap failed schema validation: ${s.map(l=>l.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 l=0;;l++)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 Ie){if(l<3)continue;return{ok:!1,refusal:"concurrent activity kept moving the store \u2014 try the card again"}}throw o}}function Ut(t){let s=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(s.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:s.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:s.map(e=>e.cid)}},provenance:t.provenance}),{resolved:s.length}}catch(e){if(e instanceof Ie){if(r<3)continue;return{resolved:0}}throw e}}export{he as a,He as b,Ae as c,ye as d,Ce as e,Me as f,pe as g,Ye as h,kt as i,_e as j,Ee as k,Ve as l,Dt as m,Xe as n,ze as o,Ze as p,At as q,Mt as r,Pt as s,Vt as t,Lt as u,Gt as v,Ut as w,Le as x,Ge as y,rt as z,ke as A,De as B,pt as C,We as D,ft as E,me as F};
|
package/dist/chunk-HOA4VWSD.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Re}from"./chunk-YYYQ5MVD.js";import{a as $e,b as ve,d as ye,e as Oe}from"./chunk-BB2W35TW.js";import{a as Ee}from"./chunk-ALCE5RLK.js";import{B as Se,c as me,h as _e,o as be}from"./chunk-GP7WD4UY.js";import{a as he}from"./chunk-JQW2QFSX.js";import{H as ge,M as le,c as ue,d as X,m as pe}from"./chunk-3N6IAVD5.js";import{d as g,e as l,f as de,g as ae,h as fe}from"./chunk-AKX4VRRR.js";var xe=/\s@verifies\s+(ac-[\w.:\/-]+(?:\s*,\s*ac-[\w.:\/-]+)*)\s*$/,N=i=>({record:null,errors:i,minted:{},logicalIds:{},superseded:[],warnings:[],finalizedTests:{}});function P(i){return i.toLowerCase().trim().replace(/\s+/g," ")}function we(i,O){let t=i.resolve(O);if(!t||i.nodeLabel.get(t.cid)!==g.USECASE||t.superseded)return[];let p=new Set;for(let{cid:a}of i.byLabel(g.SCENARIO))if(!i.superseded.has(a)&&i.edgesFrom(a).some(h=>h.type===l.BELONGS_TO&&i.tipOf(h.dst)===t.cid)){p.add(a);for(let h of i.edgesInto(a))h.type!==l.AUTOMATES||i.superseded.has(h.src)||p.add(h.src)}return[...p]}function Ye(i){let{contextDir:O,graph:t,sections:p,by:a}=i,h=i.engine??"design@1",y=ge(O);if(t.latestHash!==y)return N([{code:"STALE_BASIS",detail:`graph opened at ${String(t.latestHash)} but chain head is ${String(y)} \u2014 re-open and retry`}]);let R=t.resolve(i.ucRef);if(!R||t.nodeLabel.get(R.cid)!==g.USECASE||R.superseded)return N([{code:"UNKNOWN_UC",detail:`${i.ucRef} is not a live use-case`}]);let $=R.cid,S={ucRef:$,automates:{},verifies:{},reuses:{},scope:{},depends_on:{},exercises:[],scoped_to_repoints:[],judgements:[],body_tags:{},forceScope:[]},b=[],Z=/^design@(\d+)$/.exec(i.templateVersion??""),Te=Z!==null&&Number.parseInt(Z[1],10)>=3,ee=new Map,Ce=(e,s)=>{let n=ee.get(e.source_cid);if(n===void 0){let c=Ee(i.contextDir,t,e.source_cid);n=c?Re(c.toString("utf8")):null,ee.set(e.source_cid,n)}if(n===null)return b.push({code:"CITE_UNVERIFIED",detail:`${s}: source ${e.source_id} (${e.source_cid.slice(0,19)}) has no citable text to verify against`}),!1;let d=me(t.mediaOf(e.source_cid),e,n);if(d.length>0){for(let c of d)b.push({code:"CITE_UNVERIFIED",detail:`${s}: ${c.code}: ${c.detail}`});return!1}return!0},A=[],B=[],C=[],V=[],q=[],v={},L={},z={},x=[],j=[],te=new Set,H=[],U=new Set,w=new Set,Y=[];{let e=i.forceScope??(i.force?we(t,i.ucRef):[]);S.forceScope=[...e];let s=new Set;i.sections.scenarios?.length&&s.add(g.SCENARIO),i.sections.tests?.length&&s.add(g.TEST);for(let n of e)t.superseded.has(n)||(s.has(t.nodeLabel.get(n)??"")?w.add(n):Y.push(n))}let D=new Set,K=e=>!t.superseded.has(e)&&(!w.has(e)||D.has(e)),k=(e,s,n)=>{if(v[e])return v[e];let d=t.resolve(e),c=d?K(d.cid)?d.cid:t.tipOf(d.cid):null;return!d||!c||!K(c)?(b.push({code:"UNKNOWN_REF",detail:`${s}: '${e}' is neither in this payload nor a live committed node`}),null):n&&t.nodeLabel.get(c)!==n?(b.push({code:"ILLEGAL_EDGE",detail:`${s}: '${e}' is a ${t.nodeLabel.get(c)}, expected ${n}`}),null):c},ke=(e,s,n,d)=>{if(t.nameOf.has(s)){L[d]=t.nameOf.get(s);return}let c=Se(e,_=>te.has(_),t.names.keys());c!==null&&(te.add(c),V.push({cid:s,slug:c,by:a}),L[d]=c)},G=(e,s,n,d)=>{for(let _ of de(e,n))b.push({code:_.code,detail:`${s}: ${_.detail}`});let c=ue(e,n);return t.hasNode(c)&&!t.superseded.has(c)?(w.has(c)&&D.add(c),v[s]=c,c):(A.push({cid:c,label:e,content:n}),v[s]=c,ke(e,c,d,s),c)},T=(e,s,n,d,c)=>{let _=X(e,s,n,d);if(t.edgesFrom(s).some(o=>o.ecid===_&&!t.superseded.has(o.ecid))){e===l.AUTOMATES&&U.add(n);return}if(t.superseded.has(_)){b.push({code:"EDGE_RETRACTED",detail:`${c}: this ${e} edge was retracted (${_}) \u2014 retraction is terminal for commits. Add a NEW relationship (different endpoint or props), redesign, or revert the retracting record`});return}let I=t.nodeLabel.get(s)??A.find(o=>o.cid===s)?.label??"(unknown)",M=t.nodeLabel.get(n)??A.find(o=>o.cid===n)?.label??"(unknown)";for(let o of fe(e,I,M,d))b.push({code:o.code,detail:`${c}: ${o.detail}`});let f=_e(t,e,s,n,H);if(f){b.push({code:f.code,detail:`${c}: ${f.detail}`});return}if(e===l.BELONGS_TO||e===l.SCOPED_TO){let o=he(t,{type:e,src:s,dst:n},{pending:H,retracted:new Set(C.flatMap(r=>r.kind==="edge"?[r.ecid]:[])),freed:new Set([...w].filter(r=>!D.has(r)))},c);if(o){b.push(o);return}}if(e===l.AUTOMATES){if(U.has(n)){b.push({code:"CARDINALITY_VIOLATION",detail:`${c}: two automates onto ${n} in one record (strict 1:1)`});return}if(U.add(n),!w.has(n)||D.has(n)){let o=m=>w.has(m)&&!D.has(m);if(t.edgesFrom(s).some(m=>m.type===l.AUTOMATES&&m.dst!==n&&!t.superseded.has(m.dst)&&!o(m.dst))&&t.hasNode(s)){b.push({code:"CARDINALITY_VIOLATION",detail:`${c}: automates from ${s} already has a live edge \u2014 supersede it first`});return}if(t.edgesInto(n).some(m=>m.type===l.AUTOMATES&&m.src!==s&&!t.superseded.has(m.src)&&!o(m.src))){b.push({code:"CARDINALITY_VIOLATION",detail:`${c}: automates onto ${n} already has a live edge \u2014 strict 1:1, supersede it first`});return}}}B.push({ecid:X(e,s,n,d),type:e,src:s,dst:n,props:d}),H.push({src:s,dst:n,type:e})},J=new Set;for(let e of p.gaps??[]){let s=e.temp_ref??e.ref??"gap",n=e.question;if(!n||typeof n!="object"||!n.header||!Array.isArray(n.options)||n.options.length===0||!Number.isInteger(n.recommended_index)){b.push({code:"GAP_QUESTION_INCOMPLETE",detail:`${s}: design gaps carry a full ranked question object (header/options/recommended_index)`});continue}e.kind==="budget-evicted"&&e.ref&&J.add(e.ref);let d={kind:e.kind,question:n,derived:!0,uc:$,...e.risk?{risk:e.risk}:{},...e.risk_rationale?{risk_rationale:e.risk_rationale}:{},...e.text?{text:e.text}:{},...e.ref?{ref:e.ref}:{}};G(g.GAP,s,d,String(n.header))}let se=new Map;for(let{cid:e,content:s}of t.byLabel(g.SCENARIO))K(e)&&t.edgesFrom(e).some(n=>n.type===l.BELONGS_TO&&t.tipOf(n.dst)===$)&&se.set(P(String(s.title??"")),e);for(let e of p.scenarios??[]){let s=se.get(P(e.title));if(s){b.push({code:"DUPLICATE_SCENARIO",detail:`${e.temp_ref}: '${e.title}' duplicates live scenario ${t.nameOf.get(s)??s} \u2014 exercise/link it instead (reuse before minting)`});continue}let n={title:e.title,intent:e.intent,case_type:e.case_type,derived:!0,...e.technique_notes?{technique_notes:e.technique_notes}:{},...e.description?{description:e.description}:{},...e.parameters?{parameters:e.parameters}:{},...e.tags?{tags:e.tags}:{}};G(g.SCENARIO,e.temp_ref,n,e.title)}for(let e of p.scenarios??[]){let s=v[e.temp_ref];if(s){T(l.BELONGS_TO,s,$,{},e.temp_ref);for(let n of e.depends_on??[]){let d=k(n,`${e.temp_ref}.depends_on`,g.SCENARIO);d&&((S.depends_on[e.temp_ref]??=[]).push(d),T(l.DEPENDS_ON,s,d,{},`${e.temp_ref}.depends_on`))}}}for(let e of p.acs??[]){let s={text:e.text,kind:e.kind,risk:e.risk,derived:!0,...e.expected_answer?{expected_answer:e.expected_answer}:{},...e.measurable!==void 0?{measurable:e.measurable}:{}},n=G(g.AC,e.temp_ref,s,e.text);if(!n)continue;let d=e.scope?.type==="scenario"&&e.scope.ref?k(e.scope.ref,`${e.temp_ref}.scope`,g.SCENARIO):$;d&&d!==$&&(S.scope[e.temp_ref]=d),d&&!t.edgesFrom(n).some(c=>c.type===l.SCOPED_TO&&!t.superseded.has(c.ecid))&&T(l.SCOPED_TO,n,d,{},`${e.temp_ref}.scope`);for(let c of e.cites??[]){if(Te&&!Ce(c,`${e.temp_ref}.cite`))continue;let _={source_id:c.source_id,source_cid:c.source_cid,anchor:c.anchor,...c.quote?{quote:c.quote}:{}};T(l.DERIVES,c.source_cid,n,_,`${e.temp_ref}.cite`)}}for(let e of p.exercises??[]){let s=k(e.scenario,"exercises.scenario",g.SCENARIO),n=k(e.ac,"exercises.ac",g.AC);!s||!n||(S.exercises.push({scenario:s,ac:n}),T(l.EXERCISES,s,n,{},`exercises ${e.scenario}\u2192${e.ac}`))}let ne=0;for(let e of p.scoped_to_repoints??[]){let s=k(e.ac,"scoped_to_repoints.ac",g.AC),n=k(e.to,"scoped_to_repoints.to");if(!s||!n)continue;S.scoped_to_repoints.push({ac:s,to:n});let d=t.edgesFrom(s).find(c=>c.type===l.SCOPED_TO&&!t.superseded.has(c.ecid));if(d&&d.dst===n){ne+=1,x.push(`scoped_to_repoints ${e.ac}: already scoped to ${e.to} \u2014 no-op`);continue}d&&C.push({kind:"edge",ecid:d.ecid,reason:`re-scoped to ${e.to} by ${a.id}`,by:a}),T(l.SCOPED_TO,s,n,{},`scoped_to_repoints ${e.ac}`)}let ie=new Map;if(i.finalizeTestBody)for(let[e,s]of t.nameOf)ie.set(t.tipOf(e),s);let oe=e=>t.nameOf.get(e)??ie.get(t.tipOf(e))??null,re=e=>{if(v[e])return v[e];let s=t.resolve(e);return s?t.names.has(e)&&!t.superseded.has(s.cid)?s.cid:t.tipOf(s.cid):null},Ie=e=>{let s=re(e);if(!s&&i.strict)throw new Error(`UNMAPPED_REF: '${e}' resolves to nothing on this graph`);return s?v[e]?L[e]??oe(s):t.names.has(e)?e:oe(s):null};for(let e of p.tests??[]){for(let f of e.reuses??[])J.has(f)&&b.push({code:"REUSES_EVICTED",detail:`${e.temp_ref}: reuses '${f}' which was budget-evicted \u2014 drop the edge; the dependent gap names the missing @import`});{let f=r=>r==="emulator"||r==="simulator"?r:"web",o=r=>{let u=(p.tests??[]).find(Ae=>Ae.temp_ref===r);if(u)return f(u.target);let m=t.resolve(r),E=m?t.getNode(t.tipOf(m.cid)??m.cid)?.content:void 0;if(typeof E?.target=="string")return f(String(E.target));let ce=/^\s*\[mobile:\s*(emulator|simulator)\]/m.exec(String(E?.test_md_blob??""));return ce?ce[1]:"web"};for(let r of e.reuses??[]){let u=f(e.target),m=o(r);u!==m&&b.push({code:"REUSES_CROSS_SURFACE",detail:`${e.temp_ref}: reuses '${r}' which runs on ${m} while this test runs on ${u} \u2014 a test imports only same-surface units`})}}let s=e.test_md_blob,n=e.definitionId,d=e.objectives_blob;if(i.finalizeTestBody){let f;try{f=i.finalizeTestBody({temp_ref:e.temp_ref,test_md_blob:e.test_md_blob,verifies:e.verifies,reuses:e.reuses??[]},Ie)}catch(o){return N([{code:"FINALIZE_BODY",detail:`${e.temp_ref}: ${o instanceof Error?o.message:String(o)}`}])}f&&(s=f.test_md_blob,n=f.definitionId,d=f.objectives_blob??d,z[e.temp_ref]=n)}let c={title:e.title,check:e.check,definitionId:n,derived:!0,...e.config?{config:e.config}:{},...s?{test_md_blob:s}:{},...d?{objectives_blob:d}:{},...e.surface_required!==void 0?{surface_required:e.surface_required}:{},...e.target?{target:e.target}:{},...e.app&&e.target?{app:e.app}:{}},_=G(g.TEST,e.temp_ref,c,e.title);if(!_)continue;let I=k(e.automates,`${e.temp_ref}.automates`,g.SCENARIO);I&&(S.automates[e.temp_ref]=I,T(l.AUTOMATES,_,I,{},`${e.temp_ref}.automates`)),S.verifies[e.temp_ref]=[];for(let f of e.verifies){let o=k(f,`${e.temp_ref}.verifies`,g.AC);o&&(S.verifies[e.temp_ref].push(o),T(l.VERIFIES,_,o,{},`${e.temp_ref}.verifies`))}S.reuses[e.temp_ref]=[];for(let f of e.reuses??[]){if(J.has(f))continue;let o=k(f,`${e.temp_ref}.reuses`,g.TEST);o&&(S.reuses[e.temp_ref].push(o),T(l.REUSES,_,o,{},`${e.temp_ref}.reuses`))}for(let f of e.verifies){let o=v[f]??t.resolve(f)?.cid;o&&(t.trust.get(o)??"derived")==="derived"&&!A.some(r=>r.cid===o)?x.push(`${e.temp_ref}: verifies ${f} which is still DERIVED (unapproved) \u2014 committed anyway; approve it in chat or via review`):o&&v[f]===o&&(p.acs??[]).some(r=>r.temp_ref===f)&&x.push(`${e.temp_ref}: verifies ${f} minted in this same record (unapproved) \u2014 committed anyway; approve it in chat`)}if(!String(e.test_md_blob??"").split(`
|
|
3
|
-
`).some(f=>/^##\s/.test(f)&&!/—\s?assert/.test(f)&&xe.test(f))&&e.verifies.length>1){let f=e.check?.verified_against;x.push(`${e.temp_ref}: verifies ${e.verifies.length} ACs but machine-asserts only 1 (check.verified_against=${f!=null?String(f):"?"}) \u2014 the rest ride prose only`)}}let F=[];for(let e of p.tests??[]){let s={};for(let n of De(e.test_md_blob,e.objectives_blob)){let d=re(n);d?s[n]=d:F.push(`${e.temp_ref}: body tag '${n}' resolves to nothing`)}S.body_tags[e.temp_ref]=s,F.push(...Ne(e.temp_ref,s,[...S.verifies[e.temp_ref]??[],...S.reuses[e.temp_ref]??[]]))}if(F.length>0){if(i.strict)return N(F.map(e=>({code:"BODY_EDGE_MISMATCH",detail:e})));x.push(...F.map(e=>`integrity: ${e}`))}let W=[];{let e=(o,r)=>`${o??""}\0${P(String(r??""))}`,s=(o,r)=>i.reason?`${i.reason} \u2014 evolve by ${a.id}${r?` (${r})`:""}`:o,n=new Map;for(let o of A){if(o.label!==g.SCENARIO&&o.label!==g.TEST)continue;let r=e(o.label,o.content.title);n.set(r,[...n.get(r)??[],o.cid])}let d=new Map;for(let o of w){if(D.has(o))continue;let r=e(t.nodeLabel.get(o),t.getNode(o)?.content.title);d.set(r,[...d.get(r)??[],o])}for(let[o,r]of d){let u=n.get(o)??[],m=r.length===1&&u.length===1;for(let E of r)m?(C.push({kind:"node",old:E,new:u[0],reason:s(`--force redesign of ${i.ucRef} by ${a.id} (title-matched successor)`,"title-matched successor"),by:a}),W.push({old:E,next:u[0]})):C.push({kind:"node",old:E,new:null,reason:s(`--force redesign of ${i.ucRef} by ${a.id}`),by:a}),j.push(E)}let c=o=>t.edgesFrom(o).some(r=>r.type!==l.SCOPED_TO?!1:r.dst===$||t.tipOf(r.dst)===$?!0:t.nodeLabel.get(r.dst)===g.SCENARIO&&t.edgesFrom(r.dst).some(u=>u.type===l.BELONGS_TO&&t.tipOf(u.dst)===$)),_=new Map;for(let{cid:o,content:r}of t.byLabel(g.AC)){if(t.superseded.has(o)||!c(o))continue;let u=P(String(r.text??""));_.set(u,[..._.get(u)??[],o])}let I=new Map;for(let o of A){if(o.label!==g.AC)continue;let r=P(String(o.content.text??""));I.set(r,[...I.get(r)??[],o.cid])}for(let[o,r]of _){let u=I.get(o)??[];r.length!==1||u.length!==1||(C.push({kind:"node",old:r[0],new:u[0],reason:s(`AC re-emitted with changed content by ${a.id} (text-matched successor)`,"AC text-matched successor"),by:a}),W.push({old:r[0],next:u[0]}),j.push(r[0]))}let M=new Set(j),f=new Set;for(let o of C)o.kind==="edge"&&f.add(o.ecid);for(let{old:o,next:r}of W)for(let u of t.edgesInto(o))ae(u.type)?.pin?.comparesTo!=="dst_tip"||t.superseded.has(u.src)||M.has(u.src)||f.has(u.ecid)||(C.push({kind:"edge",ecid:u.ecid,reason:`re-blessed onto ${r} (redirect successor of ${o}) by ${a.id}`,by:a}),f.add(u.ecid),B.some(E=>E.type===u.type&&E.src===u.src&&E.dst===r)||t.edgesFrom(u.src).some(E=>E.type===u.type&&E.dst===r))||u.type===l.AUTOMATES&&U.has(r)||T(u.type,u.src,r,u.props,`rebless ${u.type} from ${t.nameOf.get(u.src)??u.src}`)}if(b.length>0)return N(b);if(A.length===0&&B.length===0&&C.length===0&&q.length===0)return Object.keys(v).length>0||ne>0?(x.push("everything in this phase is already current \u2014 nothing re-committed"),{record:null,errors:null,minted:v,logicalIds:L,superseded:[],warnings:x,finalizedTests:z,...i.force||i.forceScope?{forceScopeRemaining:Y}:{}}):N([{code:"EMPTY_DESIGN",detail:"finalize_design produced nothing to commit"}]);if(i.generationTicket){let e=ye(t,i.generationTicket);if(e!==null)return N([e])}let Q=i.eventIds&&i.eventIds.length>0?i.eventIds:i.sid?be(t,i.sid,"design",1):null;return{record:le(O,{ts:new Date().toISOString(),proposal_id:null,nodes:A,edges:B,review:[],supersessions:C,source_head_moves:{},...V.length>0?{names:V}:{},...(()=>{for(let e of p.judgements??[]){let s=e.target?v[e.target]??t.resolve(e.target)?.cid??$:$;S.judgements.push(s),q.push({about:s,rationale:`[${e.kind}] ${e.rationale}`,by:a})}return q.length>0?{judgements:q}:{}})(),design_of:{uc_cid:$,engine:h},...i.generationTicket?{design_generation:Oe(i.generationTicket,$,a)}:{},...Q?{event_ids:Q}:{},...i.sid?{sid:i.sid}:{},...i.phase?{design_phase:{uc_root:$e(t,$),generation:i.generationTicket?.next_gen??ve(t,i.ucRef)?.gen??1,phase:i.phase,completeness:i.phaseCompleteness??"complete"}}:{}},{expectPrev:t.latestHash,intent:{v:1,verb:"design",args:pe({ucRef:i.ucRef,sections:p,by:a,engine:h,force:i.force??!1,forceScope:i.forceScope??null,reason:i.reason??null,generationTicket:i.generationTicket??null,templateVersion:i.templateVersion??null,phase:i.phase??null,phaseCompleteness:i.phaseCompleteness??null,eventIds:Q,sid:i.sid??null}),pins:S},provenance:i.provenance}).record,errors:null,minted:v,logicalIds:L,superseded:j,warnings:x,finalizedTests:z,...i.force||i.forceScope?{forceScopeRemaining:Y}:{}}}function Ne(i,O,t){let p=new Set(Object.values(O));if(p.size===0)return[];let a=new Set(t),h=[];for(let[y,R]of Object.entries(O))a.has(R)||h.push(`${i}: body tag '${y}' has no verifies or reuses edge`);for(let y of a)p.has(y)||h.push(`${i}: edge to ${y} has no body tag`);return h}function De(i,O){let t=[];for(let a of(i??"").split(`
|
|
4
|
-
`)){let h=/^##\s.*?\s@verifies\s+(.+?)\s*$/.exec(a);h&&t.push(...h[1].split(",").map(R=>R.trim()).filter(Boolean));let y=/^@import\s+(\S+)\s*$/.exec(a.trim())??/^## Import: (\S+)\s*$/.exec(a);y&&t.push(y[1])}let p=!1;for(let a of(O??"").split(`
|
|
5
|
-
`)){let h=/^\s*verifies:\s*\[(.*)\]\s*$/.exec(a);if(h){t.push(...h[1].split(",").map(R=>R.trim()).filter(Boolean));continue}if(/^\s*verifies:\s*$/.test(a)){p=!0;continue}let y=p?/^\s*-\s+(\S+)\s*$/.exec(a):null;y?t.push(y[1]):p=!1}return t}function Ke(i,O){let t=[];for(let p of i){let a=p.design_phase;!a||typeof a!="object"||a.uc_root===O&&(typeof a.phase!="string"||typeof a.generation!="number"||t.push({phase:a.phase,generation:a.generation,seq:p.seq,completeness:a.completeness==="partial"?"partial":"complete"}))}return t.sort((p,a)=>p.seq-a.seq)}export{we as a,Ye as b,Ke as c};
|
package/dist/chunk-JUJ4SAGH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as f}from"./chunk-AKX4VRRR.js";function k(s,n){let t=null;for(let[i,e]of s.designOf)i!==n&&s.tipOf(i)!==n||(t==null||e.seq>t.seq)&&(t={...e,designed_at_cid:i});return t}function $(s,n){let t=new Map;for(let[d,o]of s.superseded)o!=null&&t.set(o,d);let i=[n],e=n;for(;t.has(e);)e=t.get(e),i.unshift(e);return i}function w(s,n,t){let i=s.resolve(n);if(!i){let r=[...s.names.keys()].filter(m=>m.startsWith("uc-")).sort().slice(0,6);return{ok:!1,code:2,message:`unknown use-case '${n}' \u2014 no live node by that logical id or cid${r.length?` (known: ${r.join(", ")})`:""}`}}let e=i.tip;if(s.superseded.has(e)&&s.superseded.get(e)===null)return{ok:!1,code:2,message:`use-case '${n}' was removed (tombstoned) \u2014 nothing to design`};let d=s.nodeLabel.get(e);if(d!==f.USECASE)return{ok:!1,code:2,message:`'${n}' is a ${d??"missing node"}, not a use-case \u2014 design runs per use-case`};let o=s.nameOf.get(e)??s.nameOf.get(i.cid)??e.slice(0,19);if(s.trust.get(e)==="archived"){let r=s.archivedReason.get(e);return{ok:!1,code:2,message:`use-case '${o}' is archived${r?` (${r})`:""} \u2014 design runs only over live use-cases`}}let c=k(s,e);if(c==null||t)return{ok:!0};let l=$(s,e),a=l.length;if(c.designed_at_cid===e)return{ok:!1,code:2,message:`'${o}' is already designed @ v${a} \u2014 current; use --force to redesign`,wall:{kind:"already-designed",display:o,currentV:a}};let u=l.indexOf(c.designed_at_cid),g=u>=0?`v${u+1}`:"an earlier version";return{ok:!1,code:2,message:`'${o}' was designed @ ${g} \u2014 the use-case is now @ v${a} (STALE); use --force to redesign`,wall:{kind:"designed-stale",display:o,currentV:a,designedV:g}}}export{k as a,w as b};
|