@unbrained/pm-cli 2026.5.31 → 2026.6.6
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/CHANGELOG.md +167 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +12 -4
- package/dist/cli/argv-utils.js +7 -3
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.d.ts +1 -0
- package/dist/cli/bootstrap-args.js +23 -3
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/calendar.js +17 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.d.ts +63 -0
- package/dist/cli/commands/close-many.js +302 -0
- package/dist/cli/commands/close-many.js.map +1 -0
- package/dist/cli/commands/completion.d.ts +1 -0
- package/dist/cli/commands/completion.js +260 -32
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +4 -4
- package/dist/cli/commands/config.js +115 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.js +193 -162
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +77 -114
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/doctor.d.ts +12 -0
- package/dist/cli/commands/extension/doctor.js +97 -2
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +49 -48
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.js +51 -23
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +8 -1
- package/dist/cli/commands/gc.js +26 -3
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.js +7 -7
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +51 -3
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.d.ts +4 -1
- package/dist/cli/commands/history.js +12 -24
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.js +107 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.d.ts +5 -0
- package/dist/cli/commands/list.js +58 -26
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/reindex.js +163 -47
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
- package/dist/cli/commands/restore.js +25 -4
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +122 -1
- package/dist/cli/commands/schema.js +536 -6
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +1 -0
- package/dist/cli/commands/search.js +18 -4
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +8 -1
- package/dist/cli/commands/stats.js +18 -17
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +8 -0
- package/dist/cli/commands/telemetry.js +253 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- package/dist/cli/commands/test.js +4 -3
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +69 -140
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +2 -0
- package/dist/cli/commands/update.js +138 -119
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +1 -0
- package/dist/cli/commands/validate.js +63 -33
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +26 -3
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/help-content.js +91 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +377 -23
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +14 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +200 -28
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +31 -6
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +4 -2
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +31 -4
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
- package/dist/cli-bundle/chunks/activity-JM6DTDND.js +20 -0
- package/dist/cli-bundle/chunks/activity-JM6DTDND.js.map +1 -0
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js +206 -0
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-VNAHUNNF.js} +11 -11
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-7H5N64R2.js} +8 -9
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-7H5N64R2.js.map} +1 -1
- package/dist/cli-bundle/chunks/append-WMKRXKCE.js +69 -0
- package/dist/cli-bundle/chunks/append-WMKRXKCE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-23YFZ3IG.js} +210 -132
- package/dist/cli-bundle/chunks/chunk-23YFZ3IG.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js +128 -0
- package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js +266 -0
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js +631 -0
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js +380 -0
- package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js +1664 -0
- package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-3FI4SEFT.js} +175 -54
- package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3LB74A67.js} +119 -6
- package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js +57 -0
- package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js +1832 -0
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js +422 -0
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js +412 -0
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js +5622 -0
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-6ER6DXH5.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-6ER6DXH5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js +218 -0
- package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-77GFDHGF.js +80 -0
- package/dist/cli-bundle/chunks/chunk-77GFDHGF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-AO442XLN.js} +26 -15
- package/dist/cli-bundle/chunks/chunk-AO442XLN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js +751 -0
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-BQHUILZS.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js +242 -0
- package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-ECCMVXGM.js} +164 -53
- package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js +182 -0
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GCOQW437.js +130 -0
- package/dist/cli-bundle/chunks/chunk-GCOQW437.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js +1340 -0
- package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-GU2ZJ2VV.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js +231 -0
- package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js +76 -0
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js +346 -0
- package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js +140 -0
- package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-IJGCZSIQ.js} +251 -251
- package/dist/cli-bundle/chunks/chunk-IJGCZSIQ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js → chunk-KAG77BY3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-KJ33AOCY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-KJE2FOS4.js} +6 -4
- package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js +3883 -0
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js +1325 -0
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-LCM63IXU.js} +18 -6
- package/dist/cli-bundle/chunks/chunk-LCM63IXU.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js +182 -0
- package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-MITFDD35.js +1809 -0
- package/dist/cli-bundle/chunks/chunk-MITFDD35.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-N7ACFE26.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js +332 -0
- package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-OVQCEJPG.js} +22 -3
- package/dist/cli-bundle/chunks/chunk-OVQCEJPG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-OZ7NSQHL.js} +12 -11
- package/dist/cli-bundle/chunks/chunk-OZ7NSQHL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-PDDFYW4X.js} +35 -8
- package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-PIU6RSL3.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-PIU6RSL3.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js +338 -0
- package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-PRJCELV4.js} +108 -21
- package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-PROOHX4K.js} +332 -32
- package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-Q7SPNHLW.js} +54 -32
- package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-QO7EBBOM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-R6UFP2GE.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js +154 -0
- package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-RZN6VURO.js +119 -0
- package/dist/cli-bundle/chunks/chunk-RZN6VURO.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-T3LC5LKB.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js +173 -0
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js +2988 -0
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-U5SXYXSY.js} +821 -200
- package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js +540 -0
- package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-UM2GBHS4.js} +5 -4
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js +454 -0
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-WKY2IBOQ.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js +698 -0
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js +1704 -0
- package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-XLTD2HN3.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js +131 -0
- package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XTGLRY2Y.js} +484 -49
- package/dist/cli-bundle/chunks/chunk-XTGLRY2Y.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-YL2DJGYS.js} +7 -7
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-4DBF6RVG.js} +10 -11
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-4DBF6RVG.js.map} +1 -1
- package/dist/cli-bundle/chunks/claim-X2P4IB7J.js +129 -0
- package/dist/cli-bundle/chunks/claim-X2P4IB7J.js.map +1 -0
- package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
- package/dist/cli-bundle/chunks/close-PTYFA45H.js +17 -0
- package/dist/cli-bundle/chunks/close-PTYFA45H.js.map +1 -0
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js +314 -0
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +7 -0
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js +311 -0
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +1 -0
- package/dist/cli-bundle/chunks/comments-OONGABK5.js +100 -0
- package/dist/cli-bundle/chunks/comments-OONGABK5.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-QKBYCWKD.js} +10 -11
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-QKBYCWKD.js.map} +1 -1
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js +1671 -0
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-U4RZ4CQB.js} +121 -10
- package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-FYYJGFWS.js} +32 -19
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-FYYJGFWS.js.map} +2 -2
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js +1461 -0
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +1 -0
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js +1278 -0
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-RFSPGVVJ.js} +198 -162
- package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +7 -0
- package/dist/cli-bundle/chunks/create-I5L4EYYZ.js +31 -0
- package/dist/cli-bundle/chunks/create-I5L4EYYZ.js.map +1 -0
- package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
- package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js +55 -0
- package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-VXUPH5RS.js} +7 -8
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-VXUPH5RS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-JSRRWC3Z.js} +7 -8
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-JSRRWC3Z.js.map} +1 -1
- package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js +225 -0
- package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js.map +1 -0
- package/dist/cli-bundle/chunks/docs-GJK6K4VP.js +31 -0
- package/dist/cli-bundle/chunks/docs-GJK6K4VP.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-WW4N3MBM.js} +9 -10
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-WW4N3MBM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-J7IBMFTD.js} +4 -5
- package/dist/cli-bundle/chunks/extension-VDY2U33M.js +28 -0
- package/dist/cli-bundle/chunks/extension-VDY2U33M.js.map +1 -0
- package/dist/cli-bundle/chunks/files-ISZJGILQ.js +282 -0
- package/dist/cli-bundle/chunks/files-ISZJGILQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-WKOD326U.js} +9 -10
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-WKOD326U.js.map} +1 -1
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
- package/dist/cli-bundle/chunks/get-RV37HT3G.js +194 -0
- package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-WXU6WI5P.js} +16 -17
- package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-6L6EH4WR.js} +57 -16
- package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js +1271 -0
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
- package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
- package/dist/cli-bundle/chunks/history-PKN67D5O.js +24 -0
- package/dist/cli-bundle/chunks/history-PKN67D5O.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
- package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js +23 -0
- package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-HIBCBIKK.js} +12 -14
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-HIBCBIKK.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js +193 -0
- package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js.map +1 -0
- package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
- package/dist/cli-bundle/chunks/init-P56QYWJF.js +20 -0
- package/dist/cli-bundle/chunks/init-P56QYWJF.js.map +1 -0
- package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js +44 -0
- package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js.map +1 -0
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-MIXSESLK.js} +10 -11
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-MIXSESLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/list-FGOWQMSM.js +24 -0
- package/dist/cli-bundle/chunks/list-FGOWQMSM.js.map +1 -0
- package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-4XVSH2AZ.js} +10 -11
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-4XVSH2AZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/notes-5UK3GEH2.js +44 -0
- package/dist/cli-bundle/chunks/notes-5UK3GEH2.js.map +1 -0
- package/dist/cli-bundle/chunks/plan-DUMBV3QB.js +1171 -0
- package/dist/cli-bundle/chunks/plan-DUMBV3QB.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-SLMODHWX.js} +13 -14
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-SLMODHWX.js.map} +1 -1
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js +229 -0
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-WST76HSQ.js} +26 -26
- package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +7 -0
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js +813 -0
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-OA675SOU.js} +154 -43
- package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js +383 -0
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-N3PMHXH5.js} +49 -37
- package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +7 -0
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js +242 -0
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-ZHJI2DI3.js} +18 -19
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-ZHJI2DI3.js.map} +2 -2
- package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
- package/dist/cli-bundle/chunks/restore-PBL6T5TW.js +21 -0
- package/dist/cli-bundle/chunks/restore-PBL6T5TW.js.map +1 -0
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js +780 -0
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +7 -0
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js +770 -0
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +1 -0
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js +1127 -0
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-HENBL456.js → search-OA6JX27A.js} +25 -16
- package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +7 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
- package/dist/cli-bundle/chunks/test-MXX3E5JL.js +31 -0
- package/dist/cli-bundle/chunks/test-WBROAJIE.js +35 -0
- package/dist/cli-bundle/chunks/test-WBROAJIE.js.map +1 -0
- package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js +328 -0
- package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-NTOZ7C3M.js} +13 -14
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-NTOZ7C3M.js.map} +1 -1
- package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js +929 -0
- package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-WMVTQU3Y.js} +5 -5
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js.map +1 -0
- package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
- package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js +605 -0
- package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-KGGEYABR.js} +78 -146
- package/dist/cli-bundle/chunks/update-many-KGGEYABR.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-BLI7XBAJ.js} +5 -7
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-BLI7XBAJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js +266 -0
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-AGOAUOVW.js} +61 -48
- package/dist/cli-bundle/chunks/validate-AGOAUOVW.js.map +7 -0
- package/dist/cli-bundle/chunks/validate-L5J6A7YO.js +1120 -0
- package/dist/cli-bundle/chunks/validate-L5J6A7YO.js.map +1 -0
- package/dist/cli-bundle/main.js +534 -1505
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
- package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
- package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
- package/dist/core/config/positional-value.js +4 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/diagnostics/remediation.d.ts +73 -0
- package/dist/core/diagnostics/remediation.js +328 -0
- package/dist/core/diagnostics/remediation.js.map +1 -0
- package/dist/core/extensions/extension-hook-runtime.js +9 -2
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +60 -4
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +5 -1
- package/dist/core/extensions/index.js +61 -2
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.d.ts +5 -1
- package/dist/core/extensions/item-fields.js +126 -4
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +283 -8
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/history-diff.d.ts +47 -0
- package/dist/core/history/history-diff.js +152 -0
- package/dist/core/history/history-diff.js.map +1 -0
- package/dist/core/history/history-storage-stats.d.ts +31 -0
- package/dist/core/history/history-storage-stats.js +101 -0
- package/dist/core/history/history-storage-stats.js.map +1 -0
- package/dist/core/item/item-format.d.ts +3 -2
- package/dist/core/item/item-format.js +15 -10
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/status-filter.d.ts +29 -0
- package/dist/core/item/status-filter.js +97 -0
- package/dist/core/item/status-filter.js.map +1 -0
- package/dist/core/item/type-registry.js +4 -2
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/lock-gc.d.ts +46 -0
- package/dist/core/lock/lock-gc.js +194 -0
- package/dist/core/lock/lock-gc.js.map +1 -0
- package/dist/core/output/output.js +17 -5
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +15 -0
- package/dist/core/schema/item-types-file.js +27 -2
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.js +4 -3
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.d.ts +1 -1
- package/dist/core/schema/runtime-field-values.js +10 -4
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +75 -2
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.d.ts +113 -0
- package/dist/core/schema/status-defs-file.js +260 -0
- package/dist/core/schema/status-defs-file.js.map +1 -0
- package/dist/core/schema/type-workflows.d.ts +64 -0
- package/dist/core/schema/type-workflows.js +98 -0
- package/dist/core/schema/type-workflows.js.map +1 -0
- package/dist/core/search/cache.d.ts +3 -1
- package/dist/core/search/cache.js +104 -28
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/http-client.d.ts +2 -2
- package/dist/core/search/http-client.js +2 -2
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -0
- package/dist/core/search/vector-stores.js +64 -14
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/search/vectorization-metadata.d.ts +13 -0
- package/dist/core/search/vectorization-metadata.js +65 -0
- package/dist/core/search/vectorization-metadata.js.map +1 -0
- package/dist/core/shared/serial-queue.d.ts +12 -0
- package/dist/core/shared/serial-queue.js +43 -0
- package/dist/core/shared/serial-queue.js.map +1 -0
- package/dist/core/shared/serialization.d.ts +1 -0
- package/dist/core/shared/serialization.js +86 -2
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/store/front-matter-cache.js +14 -5
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +61 -6
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.js +18 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.d.ts +19 -1
- package/dist/core/store/settings.js +130 -10
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/telemetry/observability.js +5 -4
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +16 -4
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +372 -45
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +7 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +42 -10
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +42 -1
- package/dist/sdk/cli-contracts.js +225 -19
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/errors.d.ts +22 -0
- package/dist/sdk/errors.js +46 -0
- package/dist/sdk/errors.js.map +1 -0
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +3 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/package-import-adapters.js +14 -3
- package/dist/sdk/package-import-adapters.js.map +1 -1
- package/dist/sdk/runtime.d.ts +1 -0
- package/dist/sdk/runtime.js +3 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/testing.d.ts +77 -0
- package/dist/sdk/testing.js +239 -0
- package/dist/sdk/testing.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +22 -3
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +118 -7
- package/docs/CONFIGURATION.md +57 -2
- package/docs/EXTENSIONS.md +125 -6
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
- package/docs/ONBOARDING.md +165 -0
- package/docs/QUICKSTART.md +3 -1
- package/docs/README.md +12 -4
- package/docs/RELEASING.md +38 -3
- package/docs/SDK.md +273 -1
- package/docs/TESTING.md +36 -1
- package/docs/examples/policy-restricted-extension/manifest.json +1 -0
- package/docs/examples/starter-extension/index.js +9 -1
- package/docs/examples/starter-extension/manifest.json +1 -0
- package/package.json +16 -7
- package/packages/pm-beads/extensions/beads/index.js +2 -4
- package/packages/pm-beads/extensions/beads/index.ts +43 -33
- package/packages/pm-beads/extensions/beads/manifest.json +12 -1
- package/packages/pm-calendar/README.md +6 -0
- package/packages/pm-calendar/extensions/calendar/index.js +6 -1
- package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
- package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
- package/packages/pm-guide-shell/README.md +4 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
- package/packages/pm-lifecycle-hooks/README.md +29 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
- package/packages/pm-lifecycle-hooks/package.json +52 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
- package/packages/pm-templates/extensions/templates/manifest.json +6 -1
- package/packages/pm-todos/extensions/todos/index.js +3 -7
- package/packages/pm-todos/extensions/todos/index.ts +55 -42
- package/packages/pm-todos/extensions/todos/manifest.json +13 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -4
- package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/scripts/bundle-cli.mjs +121 -17
- package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
- package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
- package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
- package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
- package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js +0 -181
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js.map +0 -7
- package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
- package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
- package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
- package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
- package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
- package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js +0 -124
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js.map +0 -7
- package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
- package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
- package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-CVXTCHYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-VNAHUNNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-BQHUILZS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-KAG77BY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-KJ33AOCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-N7ACFE26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-QO7EBBOM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-R6UFP2GE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-T3LC5LKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-UM2GBHS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-WKY2IBOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-XLTD2HN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-YL2DJGYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-3HDWDA3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-JTZNCTQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-J7IBMFTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-2BA3T5AE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-HIVSNX3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-MUSQNMTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-D4RGNX33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-MXX3E5JL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-YRXSUGYQ.js.map} +0 -0
|
@@ -0,0 +1,1120 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3791a091-6275-5b20-8c03-fdd6ad799a1f")}catch(e){}}();
|
|
3
|
+
import {
|
|
4
|
+
extractReferencedPmItemIdsFromCommand
|
|
5
|
+
} from "./chunk-3BWOVLTH.js";
|
|
6
|
+
import {
|
|
7
|
+
buildRemediationCommands,
|
|
8
|
+
scanHistoryDrift
|
|
9
|
+
} from "./chunk-5FDATVEZ.js";
|
|
10
|
+
import "./chunk-GXSUPCBV.js";
|
|
11
|
+
import "./chunk-E5FJNAZA.js";
|
|
12
|
+
import "./chunk-PO3GSVFV.js";
|
|
13
|
+
import "./chunk-AY43SBIN.js";
|
|
14
|
+
import "./chunk-6P6GGMOG.js";
|
|
15
|
+
import "./chunk-TPH5XEVD.js";
|
|
16
|
+
import "./chunk-LXYVKYMQ.js";
|
|
17
|
+
import {
|
|
18
|
+
listAllFrontMatterWithBody
|
|
19
|
+
} from "./chunk-GGYWB3Y2.js";
|
|
20
|
+
import "./chunk-HZGUAH22.js";
|
|
21
|
+
import {
|
|
22
|
+
normalizeStatusInput
|
|
23
|
+
} from "./chunk-LB3RUL2N.js";
|
|
24
|
+
import {
|
|
25
|
+
resolveItemTypeRegistry
|
|
26
|
+
} from "./chunk-2VBQ6ZXS.js";
|
|
27
|
+
import {
|
|
28
|
+
nowIso
|
|
29
|
+
} from "./chunk-TCD3R2PF.js";
|
|
30
|
+
import {
|
|
31
|
+
DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS,
|
|
32
|
+
DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS,
|
|
33
|
+
EXIT_CODE,
|
|
34
|
+
PM_DIRNAME,
|
|
35
|
+
PmCliError,
|
|
36
|
+
getActiveExtensionRegistrations,
|
|
37
|
+
getSettingsPath,
|
|
38
|
+
pathExists,
|
|
39
|
+
readSettings,
|
|
40
|
+
resolvePmRoot,
|
|
41
|
+
resolveRuntimeStatusRegistry,
|
|
42
|
+
toNonEmptyStringOrUndefined
|
|
43
|
+
} from "./chunk-5SFCOO6B.js";
|
|
44
|
+
|
|
45
|
+
// dist/cli/commands/validate.js
|
|
46
|
+
import fs from "node:fs/promises";
|
|
47
|
+
import { realpathSync } from "node:fs";
|
|
48
|
+
import { execFile } from "node:child_process";
|
|
49
|
+
import path from "node:path";
|
|
50
|
+
import { promisify } from "node:util";
|
|
51
|
+
var FILE_SCAN_DIRECTORIES = ["src", "tests", "docs"];
|
|
52
|
+
var FILE_SCAN_ROOT_FILES = [
|
|
53
|
+
"README.md",
|
|
54
|
+
"PRD.md",
|
|
55
|
+
"CHANGELOG.md",
|
|
56
|
+
"AGENTS.md",
|
|
57
|
+
"CONTRIBUTING.md",
|
|
58
|
+
"SECURITY.md",
|
|
59
|
+
"CODE_OF_CONDUCT.md",
|
|
60
|
+
"LICENSE"
|
|
61
|
+
];
|
|
62
|
+
var DIRECTORY_IGNORE_SET = /* @__PURE__ */ new Set(["node_modules", ".git", ".cursor", ".agents", "dist", "coverage"]);
|
|
63
|
+
var RESOLUTION_FIELD_KEYS = ["resolution", "expected_result", "actual_result"];
|
|
64
|
+
var VALIDATE_FILE_SCAN_MODES = ["default", "tracked-all", "tracked-all-strict"];
|
|
65
|
+
var VALIDATE_METADATA_PROFILE_VALUES = ["core", "strict", "custom"];
|
|
66
|
+
var VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES = ["off", "warn", "error"];
|
|
67
|
+
var CORE_METADATA_REQUIRED_FIELDS = ["author", "acceptance_criteria", "estimated_minutes", "close_reason"];
|
|
68
|
+
var STRICT_METADATA_REQUIRED_FIELDS = [
|
|
69
|
+
...CORE_METADATA_REQUIRED_FIELDS,
|
|
70
|
+
"reviewer",
|
|
71
|
+
"risk",
|
|
72
|
+
"confidence",
|
|
73
|
+
"sprint",
|
|
74
|
+
"release"
|
|
75
|
+
];
|
|
76
|
+
var SUPPORTED_METADATA_REQUIRED_FIELDS = [
|
|
77
|
+
.../* @__PURE__ */ new Set([...STRICT_METADATA_REQUIRED_FIELDS])
|
|
78
|
+
];
|
|
79
|
+
var METADATA_REQUIRED_FIELD_ALIASES = {
|
|
80
|
+
author: "author",
|
|
81
|
+
acceptance_criteria: "acceptance_criteria",
|
|
82
|
+
"acceptance-criteria": "acceptance_criteria",
|
|
83
|
+
estimated_minutes: "estimated_minutes",
|
|
84
|
+
"estimated-minutes": "estimated_minutes",
|
|
85
|
+
estimate: "estimated_minutes",
|
|
86
|
+
close_reason: "close_reason",
|
|
87
|
+
"close-reason": "close_reason",
|
|
88
|
+
reviewer: "reviewer",
|
|
89
|
+
risk: "risk",
|
|
90
|
+
confidence: "confidence",
|
|
91
|
+
sprint: "sprint",
|
|
92
|
+
release: "release"
|
|
93
|
+
};
|
|
94
|
+
var METADATA_WARNING_TOKEN_BY_FIELD = {
|
|
95
|
+
author: "validate_metadata_missing_author",
|
|
96
|
+
acceptance_criteria: "validate_metadata_missing_acceptance_criteria",
|
|
97
|
+
estimated_minutes: "validate_metadata_missing_estimate",
|
|
98
|
+
close_reason: "validate_metadata_missing_close_reason",
|
|
99
|
+
reviewer: "validate_metadata_missing_reviewer",
|
|
100
|
+
risk: "validate_metadata_missing_risk",
|
|
101
|
+
confidence: "validate_metadata_missing_confidence",
|
|
102
|
+
sprint: "validate_metadata_missing_sprint",
|
|
103
|
+
release: "validate_metadata_missing_release"
|
|
104
|
+
};
|
|
105
|
+
var METADATA_COUNT_KEY_BY_FIELD = {
|
|
106
|
+
author: "missing_author",
|
|
107
|
+
acceptance_criteria: "missing_acceptance_criteria",
|
|
108
|
+
estimated_minutes: "missing_estimated_minutes",
|
|
109
|
+
close_reason: "closed_missing_close_reason",
|
|
110
|
+
reviewer: "missing_reviewer",
|
|
111
|
+
risk: "missing_risk",
|
|
112
|
+
confidence: "missing_confidence",
|
|
113
|
+
sprint: "missing_sprint",
|
|
114
|
+
release: "missing_release"
|
|
115
|
+
};
|
|
116
|
+
var METADATA_ITEM_IDS_KEY_BY_FIELD = {
|
|
117
|
+
author: "missing_author_item_ids",
|
|
118
|
+
acceptance_criteria: "missing_acceptance_criteria_item_ids",
|
|
119
|
+
estimated_minutes: "missing_estimated_minutes_item_ids",
|
|
120
|
+
close_reason: "closed_missing_close_reason_item_ids",
|
|
121
|
+
reviewer: "missing_reviewer_item_ids",
|
|
122
|
+
risk: "missing_risk_item_ids",
|
|
123
|
+
confidence: "missing_confidence_item_ids",
|
|
124
|
+
sprint: "missing_sprint_item_ids",
|
|
125
|
+
release: "missing_release_item_ids"
|
|
126
|
+
};
|
|
127
|
+
var METADATA_TRUNCATED_KEY_BY_FIELD = {
|
|
128
|
+
author: "missing_author_truncated",
|
|
129
|
+
acceptance_criteria: "missing_acceptance_criteria_truncated",
|
|
130
|
+
estimated_minutes: "missing_estimated_minutes_truncated",
|
|
131
|
+
close_reason: "closed_missing_close_reason_truncated",
|
|
132
|
+
reviewer: "missing_reviewer_truncated",
|
|
133
|
+
risk: "missing_risk_truncated",
|
|
134
|
+
confidence: "missing_confidence_truncated",
|
|
135
|
+
sprint: "missing_sprint_truncated",
|
|
136
|
+
release: "missing_release_truncated"
|
|
137
|
+
};
|
|
138
|
+
var GIT_LS_FILES_MAX_BUFFER = 32 * 1024 * 1024;
|
|
139
|
+
var FILE_LIST_SUMMARY_LIMIT = 40;
|
|
140
|
+
var DIAGNOSTIC_LIST_SUMMARY_LIMIT = 5;
|
|
141
|
+
var execFileAsync = promisify(execFile);
|
|
142
|
+
function normalizeRelativePath(value) {
|
|
143
|
+
return value.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/^\/+/, "");
|
|
144
|
+
}
|
|
145
|
+
function normalizeRelativeDirectoryPath(value) {
|
|
146
|
+
const normalized = normalizeRelativePath(value);
|
|
147
|
+
return normalized.replace(/\/+$/, "");
|
|
148
|
+
}
|
|
149
|
+
function toMeaningfulString(value) {
|
|
150
|
+
const normalized = toNonEmptyStringOrUndefined(value);
|
|
151
|
+
if (!normalized) {
|
|
152
|
+
return void 0;
|
|
153
|
+
}
|
|
154
|
+
const lowered = normalized.toLowerCase();
|
|
155
|
+
if (lowered === "none" || lowered === "null" || lowered === "n/a" || lowered === "na") {
|
|
156
|
+
return void 0;
|
|
157
|
+
}
|
|
158
|
+
return normalized;
|
|
159
|
+
}
|
|
160
|
+
function normalizeStatusForRegistry(status, statusRegistry) {
|
|
161
|
+
return normalizeStatusInput(status, statusRegistry) ?? status;
|
|
162
|
+
}
|
|
163
|
+
function isTerminalStatus(status, statusRegistry) {
|
|
164
|
+
return statusRegistry.terminal_statuses.has(normalizeStatusForRegistry(status, statusRegistry));
|
|
165
|
+
}
|
|
166
|
+
function normalizeLifecyclePatternList(values) {
|
|
167
|
+
return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
|
|
168
|
+
}
|
|
169
|
+
function areSortedStringListsEqual(left, right) {
|
|
170
|
+
if (left.length !== right.length) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return left.every((value, index) => value === right[index]);
|
|
174
|
+
}
|
|
175
|
+
function resolveLifecyclePatternPolicy(settings) {
|
|
176
|
+
const defaultStalePatterns = normalizeLifecyclePatternList(DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS);
|
|
177
|
+
const defaultClosureLikePatterns = {
|
|
178
|
+
blocked_reason: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.blocked_reason),
|
|
179
|
+
resolution: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.resolution),
|
|
180
|
+
actual_result: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.actual_result)
|
|
181
|
+
};
|
|
182
|
+
const staleBlockerReasonPatterns = normalizeLifecyclePatternList(settings.validation.lifecycle_stale_blocker_reason_patterns);
|
|
183
|
+
const closureLikePatterns = {
|
|
184
|
+
blocked_reason: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_blocked_reason_patterns),
|
|
185
|
+
resolution: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_resolution_patterns),
|
|
186
|
+
actual_result: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_actual_result_patterns)
|
|
187
|
+
};
|
|
188
|
+
return {
|
|
189
|
+
stale_blocker_reason_patterns: staleBlockerReasonPatterns,
|
|
190
|
+
stale_blocker_reason_pattern_source: areSortedStringListsEqual(staleBlockerReasonPatterns, defaultStalePatterns) ? "default" : "settings",
|
|
191
|
+
closure_like_metadata_field_patterns: closureLikePatterns,
|
|
192
|
+
closure_like_metadata_field_pattern_sources: {
|
|
193
|
+
blocked_reason: areSortedStringListsEqual(closureLikePatterns.blocked_reason, defaultClosureLikePatterns.blocked_reason) ? "default" : "settings",
|
|
194
|
+
resolution: areSortedStringListsEqual(closureLikePatterns.resolution, defaultClosureLikePatterns.resolution) ? "default" : "settings",
|
|
195
|
+
actual_result: areSortedStringListsEqual(closureLikePatterns.actual_result, defaultClosureLikePatterns.actual_result) ? "default" : "settings"
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function resolveValidateMetadataProfile(value) {
|
|
200
|
+
const normalized = value?.trim().toLowerCase();
|
|
201
|
+
if (!normalized || normalized.length === 0) {
|
|
202
|
+
return "core";
|
|
203
|
+
}
|
|
204
|
+
if (VALIDATE_METADATA_PROFILE_VALUES.includes(normalized)) {
|
|
205
|
+
return normalized;
|
|
206
|
+
}
|
|
207
|
+
throw new PmCliError(`Unknown --metadata-profile value "${value}". Supported values: ${VALIDATE_METADATA_PROFILE_VALUES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
208
|
+
}
|
|
209
|
+
function resolveDependencyCycleSeverity(value) {
|
|
210
|
+
const normalized = value?.trim().toLowerCase();
|
|
211
|
+
if (!normalized || normalized.length === 0) {
|
|
212
|
+
return "warn";
|
|
213
|
+
}
|
|
214
|
+
if (VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES.includes(normalized)) {
|
|
215
|
+
return normalized;
|
|
216
|
+
}
|
|
217
|
+
throw new PmCliError(`Unknown --dependency-cycle-severity value "${value}". Supported values: ${VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
218
|
+
}
|
|
219
|
+
function normalizeMetadataRequiredFieldsFromSettings(values) {
|
|
220
|
+
const normalized = [...new Set((values ?? []).map((value) => value.trim().toLowerCase().replaceAll("-", "_")))];
|
|
221
|
+
return normalized.map((value) => METADATA_REQUIRED_FIELD_ALIASES[value]).filter((value) => value !== void 0).sort((left, right) => left.localeCompare(right));
|
|
222
|
+
}
|
|
223
|
+
function resolveValidateMetadataPolicy(profile, profileSource, configuredCustomFields) {
|
|
224
|
+
const normalizedCustomFields = normalizeMetadataRequiredFieldsFromSettings(configuredCustomFields);
|
|
225
|
+
if (profile === "core") {
|
|
226
|
+
return {
|
|
227
|
+
profile,
|
|
228
|
+
profile_source: profileSource,
|
|
229
|
+
required_fields: [...CORE_METADATA_REQUIRED_FIELDS],
|
|
230
|
+
configured_custom_fields: normalizedCustomFields,
|
|
231
|
+
fallback_to_core: false,
|
|
232
|
+
warnings: []
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (profile === "strict") {
|
|
236
|
+
return {
|
|
237
|
+
profile,
|
|
238
|
+
profile_source: profileSource,
|
|
239
|
+
required_fields: [...STRICT_METADATA_REQUIRED_FIELDS],
|
|
240
|
+
configured_custom_fields: normalizedCustomFields,
|
|
241
|
+
fallback_to_core: false,
|
|
242
|
+
warnings: []
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
if (normalizedCustomFields.length > 0) {
|
|
246
|
+
return {
|
|
247
|
+
profile,
|
|
248
|
+
profile_source: profileSource,
|
|
249
|
+
required_fields: normalizedCustomFields,
|
|
250
|
+
configured_custom_fields: normalizedCustomFields,
|
|
251
|
+
fallback_to_core: false,
|
|
252
|
+
warnings: []
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
profile,
|
|
257
|
+
profile_source: profileSource,
|
|
258
|
+
required_fields: [...CORE_METADATA_REQUIRED_FIELDS],
|
|
259
|
+
configured_custom_fields: normalizedCustomFields,
|
|
260
|
+
fallback_to_core: true,
|
|
261
|
+
warnings: ["validate_metadata_custom_profile_missing_required_fields:0"]
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function isMetadataFieldMissing(item, field, statusRegistry) {
|
|
265
|
+
if (field === "author") {
|
|
266
|
+
return !toNonEmptyStringOrUndefined(item.author);
|
|
267
|
+
}
|
|
268
|
+
if (field === "acceptance_criteria") {
|
|
269
|
+
return !toNonEmptyStringOrUndefined(item.acceptance_criteria);
|
|
270
|
+
}
|
|
271
|
+
if (field === "estimated_minutes") {
|
|
272
|
+
return !Number.isFinite(item.estimated_minutes);
|
|
273
|
+
}
|
|
274
|
+
if (field === "close_reason") {
|
|
275
|
+
return normalizeStatusForRegistry(item.status, statusRegistry) === statusRegistry.close_status && !toNonEmptyStringOrUndefined(item.close_reason);
|
|
276
|
+
}
|
|
277
|
+
if (field === "reviewer") {
|
|
278
|
+
return !toNonEmptyStringOrUndefined(item.reviewer);
|
|
279
|
+
}
|
|
280
|
+
if (field === "risk") {
|
|
281
|
+
return !toNonEmptyStringOrUndefined(item.risk);
|
|
282
|
+
}
|
|
283
|
+
if (field === "confidence") {
|
|
284
|
+
if (typeof item.confidence === "number") {
|
|
285
|
+
return !Number.isFinite(item.confidence);
|
|
286
|
+
}
|
|
287
|
+
return !toNonEmptyStringOrUndefined(item.confidence);
|
|
288
|
+
}
|
|
289
|
+
if (field === "sprint") {
|
|
290
|
+
return !toNonEmptyStringOrUndefined(item.sprint);
|
|
291
|
+
}
|
|
292
|
+
return !toNonEmptyStringOrUndefined(item.release);
|
|
293
|
+
}
|
|
294
|
+
function resolveFileScanMode(scanMode) {
|
|
295
|
+
if (scanMode === void 0) {
|
|
296
|
+
return "default";
|
|
297
|
+
}
|
|
298
|
+
const normalized = scanMode.trim().toLowerCase();
|
|
299
|
+
if (normalized.length === 0) {
|
|
300
|
+
return "default";
|
|
301
|
+
}
|
|
302
|
+
if (normalized === "default") {
|
|
303
|
+
return "default";
|
|
304
|
+
}
|
|
305
|
+
if (normalized === "tracked-all" || normalized === "tracked_all") {
|
|
306
|
+
return "tracked-all";
|
|
307
|
+
}
|
|
308
|
+
if (normalized === "tracked-all-strict" || normalized === "tracked_all_strict") {
|
|
309
|
+
return "tracked-all-strict";
|
|
310
|
+
}
|
|
311
|
+
throw new PmCliError(`Unknown --scan-mode value "${scanMode}". Supported values: ${VALIDATE_FILE_SCAN_MODES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
312
|
+
}
|
|
313
|
+
function resolveWorkspaceRoot(pmRoot) {
|
|
314
|
+
const resolvedPmRoot = path.resolve(pmRoot);
|
|
315
|
+
const normalizedPmRoot = resolvedPmRoot.replaceAll("\\", "/");
|
|
316
|
+
if (normalizedPmRoot.endsWith("/.agents/pm")) {
|
|
317
|
+
return path.dirname(path.dirname(resolvedPmRoot));
|
|
318
|
+
}
|
|
319
|
+
const resolvedCwd = path.resolve(process.cwd());
|
|
320
|
+
const canonicalPmRoot = realpathForWorkspaceRoot(resolvedPmRoot);
|
|
321
|
+
const canonicalCwd = realpathForWorkspaceRoot(resolvedCwd);
|
|
322
|
+
const relativeFromPmRoot = path.relative(canonicalPmRoot, canonicalCwd);
|
|
323
|
+
const cwdInsidePmRoot = relativeFromPmRoot.length === 0 || !relativeFromPmRoot.startsWith("..") && !path.isAbsolute(relativeFromPmRoot);
|
|
324
|
+
if (cwdInsidePmRoot) {
|
|
325
|
+
return resolvedPmRoot;
|
|
326
|
+
}
|
|
327
|
+
return resolvedCwd;
|
|
328
|
+
}
|
|
329
|
+
function realpathForWorkspaceRoot(inputPath) {
|
|
330
|
+
try {
|
|
331
|
+
return realpathSync.native(inputPath);
|
|
332
|
+
} catch {
|
|
333
|
+
return path.resolve(inputPath);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
async function listFilesRecursive(basePath, relativePath, output) {
|
|
337
|
+
const targetDirectory = relativePath.length > 0 ? path.join(basePath, relativePath) : basePath;
|
|
338
|
+
let entries;
|
|
339
|
+
try {
|
|
340
|
+
entries = await fs.readdir(targetDirectory, { withFileTypes: true });
|
|
341
|
+
} catch (error) {
|
|
342
|
+
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
throw error;
|
|
346
|
+
}
|
|
347
|
+
for (const entry of entries) {
|
|
348
|
+
if (entry.name.startsWith(".")) {
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
const childRelative = relativePath.length > 0 ? path.join(relativePath, entry.name) : entry.name;
|
|
352
|
+
if (entry.isDirectory()) {
|
|
353
|
+
if (DIRECTORY_IGNORE_SET.has(entry.name)) {
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
await listFilesRecursive(basePath, childRelative, output);
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (!entry.isFile()) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
output.push(normalizeRelativePath(childRelative));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
async function collectDefaultProjectFileCandidates(workspaceRoot) {
|
|
366
|
+
const discovered = [];
|
|
367
|
+
for (const directory of FILE_SCAN_DIRECTORIES) {
|
|
368
|
+
await listFilesRecursive(workspaceRoot, directory, discovered);
|
|
369
|
+
}
|
|
370
|
+
for (const candidate of FILE_SCAN_ROOT_FILES) {
|
|
371
|
+
const absolute = path.join(workspaceRoot, candidate);
|
|
372
|
+
try {
|
|
373
|
+
const stats = await fs.stat(absolute);
|
|
374
|
+
if (stats.isFile()) {
|
|
375
|
+
discovered.push(normalizeRelativePath(candidate));
|
|
376
|
+
}
|
|
377
|
+
} catch {
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return [...new Set(discovered)].sort((left, right) => left.localeCompare(right));
|
|
381
|
+
}
|
|
382
|
+
async function collectTrackedGitFileCandidates(workspaceRoot) {
|
|
383
|
+
try {
|
|
384
|
+
const { stdout } = await execFileAsync("git", ["ls-files", "-z"], {
|
|
385
|
+
cwd: workspaceRoot,
|
|
386
|
+
encoding: "utf8",
|
|
387
|
+
maxBuffer: GIT_LS_FILES_MAX_BUFFER,
|
|
388
|
+
windowsHide: true
|
|
389
|
+
});
|
|
390
|
+
const discovered = stdout.split("\0").map((value) => normalizeRelativePath(value)).filter((value) => value.length > 0);
|
|
391
|
+
return [...new Set(discovered)].sort((left, right) => left.localeCompare(right));
|
|
392
|
+
} catch {
|
|
393
|
+
return null;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function resolvePmInternalCandidatePrefixes(pmRoot, workspaceRoot) {
|
|
397
|
+
const prefixes = /* @__PURE__ */ new Set();
|
|
398
|
+
const configuredDefault = normalizeRelativeDirectoryPath(PM_DIRNAME);
|
|
399
|
+
if (configuredDefault.length > 0) {
|
|
400
|
+
prefixes.add(configuredDefault);
|
|
401
|
+
}
|
|
402
|
+
const relativePmRoot = normalizeRelativeDirectoryPath(path.relative(workspaceRoot, pmRoot));
|
|
403
|
+
if (relativePmRoot.length > 0 && !relativePmRoot.startsWith("..")) {
|
|
404
|
+
prefixes.add(relativePmRoot);
|
|
405
|
+
}
|
|
406
|
+
return [...prefixes].sort((left, right) => left.localeCompare(right));
|
|
407
|
+
}
|
|
408
|
+
function hasPathPrefix(candidate, prefixes) {
|
|
409
|
+
for (const prefix of prefixes) {
|
|
410
|
+
if (candidate === prefix || candidate.startsWith(`${prefix}/`)) {
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
async function collectProjectFileCandidates(workspaceRoot, scanMode) {
|
|
417
|
+
if (scanMode === "tracked-all" || scanMode === "tracked-all-strict") {
|
|
418
|
+
const trackedCandidates = await collectTrackedGitFileCandidates(workspaceRoot);
|
|
419
|
+
if (trackedCandidates) {
|
|
420
|
+
return {
|
|
421
|
+
requestedMode: scanMode,
|
|
422
|
+
appliedMode: scanMode,
|
|
423
|
+
source: "tracked-git",
|
|
424
|
+
candidateFiles: trackedCandidates,
|
|
425
|
+
candidateTotal: trackedCandidates.length,
|
|
426
|
+
candidateScanned: trackedCandidates.length
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
const fallbackCandidates = await collectDefaultProjectFileCandidates(workspaceRoot);
|
|
430
|
+
return {
|
|
431
|
+
requestedMode: scanMode,
|
|
432
|
+
appliedMode: "default",
|
|
433
|
+
source: "tracked-all-fallback-default",
|
|
434
|
+
candidateFiles: fallbackCandidates,
|
|
435
|
+
candidateTotal: fallbackCandidates.length,
|
|
436
|
+
candidateScanned: fallbackCandidates.length
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
const defaultCandidates = await collectDefaultProjectFileCandidates(workspaceRoot);
|
|
440
|
+
return {
|
|
441
|
+
requestedMode: scanMode,
|
|
442
|
+
appliedMode: "default",
|
|
443
|
+
source: "default-curated",
|
|
444
|
+
candidateFiles: defaultCandidates,
|
|
445
|
+
candidateTotal: defaultCandidates.length,
|
|
446
|
+
candidateScanned: defaultCandidates.length
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
function summarizeList(values, limit = DIAGNOSTIC_LIST_SUMMARY_LIMIT) {
|
|
450
|
+
if (values.length <= limit) {
|
|
451
|
+
return { values, truncated: false };
|
|
452
|
+
}
|
|
453
|
+
return {
|
|
454
|
+
values: values.slice(0, limit),
|
|
455
|
+
truncated: true
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
function summarizeFileList(values, verboseFileLists) {
|
|
459
|
+
if (verboseFileLists) {
|
|
460
|
+
return {
|
|
461
|
+
values,
|
|
462
|
+
truncated: false,
|
|
463
|
+
total: values.length
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
const summary = summarizeList(values, FILE_LIST_SUMMARY_LIMIT);
|
|
467
|
+
return {
|
|
468
|
+
values: summary.values,
|
|
469
|
+
truncated: summary.truncated,
|
|
470
|
+
total: values.length
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
var RESOLUTION_REMEDIATION_FLAG_BY_FIELD = {
|
|
474
|
+
resolution: "--resolution",
|
|
475
|
+
expected_result: "--expected-result",
|
|
476
|
+
actual_result: "--actual-result"
|
|
477
|
+
};
|
|
478
|
+
var RESOLUTION_REMEDIATION_PLACEHOLDER_BY_FIELD = {
|
|
479
|
+
resolution: "Describe how this item was resolved",
|
|
480
|
+
expected_result: "Describe the expected result",
|
|
481
|
+
actual_result: "Describe the actual result"
|
|
482
|
+
};
|
|
483
|
+
function buildResolutionRemediationCommand(row) {
|
|
484
|
+
const fieldArguments = row.missing_fields.map((field) => `${RESOLUTION_REMEDIATION_FLAG_BY_FIELD[field]} "${RESOLUTION_REMEDIATION_PLACEHOLDER_BY_FIELD[field]}"`).join(" ");
|
|
485
|
+
return `pm update ${row.id} ${fieldArguments} --message "Backfill resolution metadata"`;
|
|
486
|
+
}
|
|
487
|
+
function attachValidateFixHints(check, checkWarnings) {
|
|
488
|
+
const existingResolutionHints = check.details?.missing_resolution_remediation_hints;
|
|
489
|
+
const aliasedResolution = Array.isArray(existingResolutionHints) && existingResolutionHints.length > 0;
|
|
490
|
+
const fixHints = aliasedResolution ? existingResolutionHints.filter((hint) => typeof hint === "string") : buildRemediationCommands(checkWarnings);
|
|
491
|
+
if (fixHints.length === 0) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const truncated = aliasedResolution && check.details?.missing_resolution_remediation_hints_truncated === true;
|
|
495
|
+
check.details = {
|
|
496
|
+
...check.details,
|
|
497
|
+
fix_hints: fixHints,
|
|
498
|
+
...truncated ? { fix_hints_truncated: true } : {}
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function resolveRequestedChecks(options) {
|
|
502
|
+
const requested = /* @__PURE__ */ new Set();
|
|
503
|
+
if (options.checkMetadata) {
|
|
504
|
+
requested.add("metadata");
|
|
505
|
+
}
|
|
506
|
+
if (options.checkResolution) {
|
|
507
|
+
requested.add("resolution");
|
|
508
|
+
}
|
|
509
|
+
if (options.checkLifecycle || options.checkStaleBlockers) {
|
|
510
|
+
requested.add("lifecycle");
|
|
511
|
+
}
|
|
512
|
+
if (options.checkFiles) {
|
|
513
|
+
requested.add("files");
|
|
514
|
+
}
|
|
515
|
+
if (options.checkHistoryDrift) {
|
|
516
|
+
requested.add("history_drift");
|
|
517
|
+
}
|
|
518
|
+
if (options.checkCommandReferences) {
|
|
519
|
+
requested.add("command_references");
|
|
520
|
+
}
|
|
521
|
+
if (requested.size === 0) {
|
|
522
|
+
requested.add("metadata");
|
|
523
|
+
requested.add("resolution");
|
|
524
|
+
requested.add("lifecycle");
|
|
525
|
+
requested.add("files");
|
|
526
|
+
requested.add("command_references");
|
|
527
|
+
requested.add("history_drift");
|
|
528
|
+
}
|
|
529
|
+
return requested;
|
|
530
|
+
}
|
|
531
|
+
function buildMetadataCheck(items, metadataPolicy, statusRegistry, verboseDiagnostics) {
|
|
532
|
+
const missingByField = Object.fromEntries(SUPPORTED_METADATA_REQUIRED_FIELDS.map((field) => [field, []]));
|
|
533
|
+
for (const item of items) {
|
|
534
|
+
for (const field of SUPPORTED_METADATA_REQUIRED_FIELDS) {
|
|
535
|
+
if (!isMetadataFieldMissing(item, field, statusRegistry)) {
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
missingByField[field].push(item.id);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
const warningTokens = [...metadataPolicy.warnings];
|
|
542
|
+
for (const field of metadataPolicy.required_fields) {
|
|
543
|
+
const missingItems = missingByField[field];
|
|
544
|
+
if (missingItems.length === 0) {
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
warningTokens.push(`${METADATA_WARNING_TOKEN_BY_FIELD[field]}:${missingItems.length}`);
|
|
548
|
+
}
|
|
549
|
+
const counts = {};
|
|
550
|
+
for (const field of metadataPolicy.required_fields) {
|
|
551
|
+
const value = missingByField[field]?.length ?? 0;
|
|
552
|
+
const countKey = METADATA_COUNT_KEY_BY_FIELD[field];
|
|
553
|
+
if (value > 0 && countKey) {
|
|
554
|
+
counts[countKey] = value;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
const details = {
|
|
558
|
+
checked_items: items.length,
|
|
559
|
+
metadata_profile: metadataPolicy.profile,
|
|
560
|
+
metadata_profile_source: metadataPolicy.profile_source,
|
|
561
|
+
metadata_profile_fallback_to_core: metadataPolicy.fallback_to_core,
|
|
562
|
+
required_fields: [...metadataPolicy.required_fields],
|
|
563
|
+
supported_required_fields: [...SUPPORTED_METADATA_REQUIRED_FIELDS],
|
|
564
|
+
counts
|
|
565
|
+
};
|
|
566
|
+
if (metadataPolicy.configured_custom_fields.length > 0) {
|
|
567
|
+
details.configured_custom_required_fields = [...metadataPolicy.configured_custom_fields];
|
|
568
|
+
}
|
|
569
|
+
for (const field of metadataPolicy.required_fields) {
|
|
570
|
+
const missing = missingByField[field];
|
|
571
|
+
if (!missing || missing.length === 0) {
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
const idsKey = METADATA_ITEM_IDS_KEY_BY_FIELD[field];
|
|
575
|
+
const truncatedKey = METADATA_TRUNCATED_KEY_BY_FIELD[field];
|
|
576
|
+
if (!idsKey || !truncatedKey) {
|
|
577
|
+
continue;
|
|
578
|
+
}
|
|
579
|
+
const summarized = summarizeList(missing, verboseDiagnostics ? missing.length : DIAGNOSTIC_LIST_SUMMARY_LIMIT);
|
|
580
|
+
details[idsKey] = summarized.values;
|
|
581
|
+
details[truncatedKey] = summarized.truncated;
|
|
582
|
+
}
|
|
583
|
+
return {
|
|
584
|
+
check: {
|
|
585
|
+
name: "metadata",
|
|
586
|
+
status: warningTokens.length === 0 ? "ok" : "warn",
|
|
587
|
+
details
|
|
588
|
+
},
|
|
589
|
+
warnings: warningTokens
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function buildResolutionCheck(items, statusRegistry, verboseDiagnostics) {
|
|
593
|
+
const terminalDoneStatuses = new Set(statusRegistry.terminal_done_statuses);
|
|
594
|
+
terminalDoneStatuses.add(statusRegistry.close_status);
|
|
595
|
+
const closedItems = items.filter((item) => terminalDoneStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
|
|
596
|
+
const missingResolutionRows = [];
|
|
597
|
+
for (const item of closedItems) {
|
|
598
|
+
const missingFields = RESOLUTION_FIELD_KEYS.filter((field) => !toNonEmptyStringOrUndefined(item[field]));
|
|
599
|
+
if (missingFields.length === 0) {
|
|
600
|
+
continue;
|
|
601
|
+
}
|
|
602
|
+
missingResolutionRows.push({
|
|
603
|
+
id: item.id,
|
|
604
|
+
missing_fields: missingFields
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
const warnings = missingResolutionRows.length > 0 ? [`validate_resolution_missing_fields:${missingResolutionRows.length}`] : [];
|
|
608
|
+
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
609
|
+
const summarizedRows = summarizeList(missingResolutionRows.map((row) => `${row.id}:${row.missing_fields.join(",")}`), diagnosticLimit);
|
|
610
|
+
const remediationHints = missingResolutionRows.map((row) => buildResolutionRemediationCommand(row));
|
|
611
|
+
const summarizedHints = summarizeList(remediationHints, diagnosticLimit);
|
|
612
|
+
return {
|
|
613
|
+
check: {
|
|
614
|
+
name: "resolution",
|
|
615
|
+
status: warnings.length === 0 ? "ok" : "warn",
|
|
616
|
+
details: {
|
|
617
|
+
checked_closed_items: closedItems.length,
|
|
618
|
+
missing_resolution_items: missingResolutionRows.length,
|
|
619
|
+
missing_resolution_rows: summarizedRows.values,
|
|
620
|
+
missing_resolution_rows_truncated: summarizedRows.truncated,
|
|
621
|
+
missing_resolution_remediation_hints: summarizedHints.values,
|
|
622
|
+
missing_resolution_remediation_hints_truncated: summarizedHints.truncated
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
warnings
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
function buildLifecycleDependencyGraph(activeItems) {
|
|
629
|
+
const activeItemIds = new Set(activeItems.map((item) => item.id));
|
|
630
|
+
const graph = /* @__PURE__ */ new Map();
|
|
631
|
+
const sortedItems = [...activeItems].sort((left, right) => left.id.localeCompare(right.id));
|
|
632
|
+
for (const item of sortedItems) {
|
|
633
|
+
const edges = /* @__PURE__ */ new Set();
|
|
634
|
+
for (const dependency of item.dependencies ?? []) {
|
|
635
|
+
const dependencyId = toMeaningfulString(dependency.id);
|
|
636
|
+
if (!dependencyId || !activeItemIds.has(dependencyId)) {
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
edges.add(dependencyId);
|
|
640
|
+
}
|
|
641
|
+
graph.set(item.id, [...edges].sort((left, right) => left.localeCompare(right)));
|
|
642
|
+
}
|
|
643
|
+
return graph;
|
|
644
|
+
}
|
|
645
|
+
function findLifecycleDependencyCycleComponents(graph) {
|
|
646
|
+
let nextIndex = 0;
|
|
647
|
+
const indexById = /* @__PURE__ */ new Map();
|
|
648
|
+
const lowLinkById = /* @__PURE__ */ new Map();
|
|
649
|
+
const stack = [];
|
|
650
|
+
const inStack = /* @__PURE__ */ new Set();
|
|
651
|
+
const components = [];
|
|
652
|
+
const visit = (id) => {
|
|
653
|
+
indexById.set(id, nextIndex);
|
|
654
|
+
lowLinkById.set(id, nextIndex);
|
|
655
|
+
nextIndex += 1;
|
|
656
|
+
stack.push(id);
|
|
657
|
+
inStack.add(id);
|
|
658
|
+
for (const dependencyId of graph.get(id) ?? []) {
|
|
659
|
+
if (!indexById.has(dependencyId)) {
|
|
660
|
+
visit(dependencyId);
|
|
661
|
+
lowLinkById.set(id, Math.min(lowLinkById.get(id), lowLinkById.get(dependencyId)));
|
|
662
|
+
} else if (inStack.has(dependencyId)) {
|
|
663
|
+
lowLinkById.set(id, Math.min(lowLinkById.get(id), indexById.get(dependencyId)));
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
if (lowLinkById.get(id) !== indexById.get(id)) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
const component = [];
|
|
670
|
+
while (stack.length > 0) {
|
|
671
|
+
const member = stack.pop();
|
|
672
|
+
inStack.delete(member);
|
|
673
|
+
component.push(member);
|
|
674
|
+
if (member === id) {
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
component.sort((left, right) => left.localeCompare(right));
|
|
679
|
+
components.push(component);
|
|
680
|
+
};
|
|
681
|
+
const sortedNodeIds = [...graph.keys()].sort((left, right) => left.localeCompare(right));
|
|
682
|
+
for (const id of sortedNodeIds) {
|
|
683
|
+
if (!indexById.has(id)) {
|
|
684
|
+
visit(id);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
const cycleComponents = components.filter((component) => {
|
|
688
|
+
if (component.length > 1) {
|
|
689
|
+
return true;
|
|
690
|
+
}
|
|
691
|
+
const selfId = component[0];
|
|
692
|
+
return (graph.get(selfId) ?? []).includes(selfId);
|
|
693
|
+
});
|
|
694
|
+
return cycleComponents.sort((left, right) => left[0].localeCompare(right[0]) || left.length - right.length || left.join(",").localeCompare(right.join(",")));
|
|
695
|
+
}
|
|
696
|
+
function resolveLifecycleDependencyCycleSamplePath(component, graph) {
|
|
697
|
+
const start = component[0];
|
|
698
|
+
if (component.length === 1) {
|
|
699
|
+
return [start, start];
|
|
700
|
+
}
|
|
701
|
+
const componentSet = new Set(component);
|
|
702
|
+
const path2 = [start];
|
|
703
|
+
const visited = /* @__PURE__ */ new Set([start]);
|
|
704
|
+
const search = (current) => {
|
|
705
|
+
const neighbors = (graph.get(current) ?? []).filter((candidate) => componentSet.has(candidate));
|
|
706
|
+
for (const next of neighbors) {
|
|
707
|
+
if (next === start && path2.length > 1) {
|
|
708
|
+
path2.push(start);
|
|
709
|
+
return true;
|
|
710
|
+
}
|
|
711
|
+
if (visited.has(next)) {
|
|
712
|
+
continue;
|
|
713
|
+
}
|
|
714
|
+
visited.add(next);
|
|
715
|
+
path2.push(next);
|
|
716
|
+
if (search(next)) {
|
|
717
|
+
return true;
|
|
718
|
+
}
|
|
719
|
+
path2.pop();
|
|
720
|
+
visited.delete(next);
|
|
721
|
+
}
|
|
722
|
+
return false;
|
|
723
|
+
};
|
|
724
|
+
if (search(start)) {
|
|
725
|
+
return [...path2];
|
|
726
|
+
}
|
|
727
|
+
return [...component, start];
|
|
728
|
+
}
|
|
729
|
+
function detectLifecycleDependencyCycles(activeItems) {
|
|
730
|
+
const graph = buildLifecycleDependencyGraph(activeItems);
|
|
731
|
+
const cycleComponents = findLifecycleDependencyCycleComponents(graph);
|
|
732
|
+
const cycleItemIds = [...new Set(cycleComponents.flat())].sort((left, right) => left.localeCompare(right));
|
|
733
|
+
const cycleSamplePaths = cycleComponents.map((component) => resolveLifecycleDependencyCycleSamplePath(component, graph).join("->"));
|
|
734
|
+
return {
|
|
735
|
+
cycle_count: cycleComponents.length,
|
|
736
|
+
cycle_item_ids: cycleItemIds,
|
|
737
|
+
cycle_sample_paths: cycleSamplePaths
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
function buildLifecycleCheck(items, includeStaleBlockers, dependencyCycleSeverity, statusRegistry, lifecyclePatternPolicy, verboseDiagnostics) {
|
|
741
|
+
const itemsById = new Map(items.map((item) => [item.id, item]));
|
|
742
|
+
const blockedStatuses = statusRegistry.blocked_statuses.size > 0 ? statusRegistry.blocked_statuses : /* @__PURE__ */ new Set(["blocked"]);
|
|
743
|
+
const activeItems = items.filter((item) => !isTerminalStatus(item.status, statusRegistry));
|
|
744
|
+
const closureLikeRows = [];
|
|
745
|
+
const terminalParentRows = [];
|
|
746
|
+
const staleBlockerRows = [];
|
|
747
|
+
for (const item of activeItems) {
|
|
748
|
+
const closureLikeFields = Object.entries(lifecyclePatternPolicy.closure_like_metadata_field_patterns).filter(([field, patterns]) => {
|
|
749
|
+
const value = toMeaningfulString(item[field]);
|
|
750
|
+
if (!value) {
|
|
751
|
+
return false;
|
|
752
|
+
}
|
|
753
|
+
const normalized = value.toLowerCase();
|
|
754
|
+
return patterns.some((pattern) => normalized.includes(pattern));
|
|
755
|
+
}).map(([field]) => field).sort((left, right) => left.localeCompare(right));
|
|
756
|
+
if (closureLikeFields.length > 0) {
|
|
757
|
+
closureLikeRows.push({
|
|
758
|
+
id: item.id,
|
|
759
|
+
fields: closureLikeFields
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
const parentId = toMeaningfulString(item.parent);
|
|
763
|
+
if (parentId) {
|
|
764
|
+
const parent = itemsById.get(parentId);
|
|
765
|
+
if (parent && isTerminalStatus(parent.status, statusRegistry)) {
|
|
766
|
+
terminalParentRows.push({
|
|
767
|
+
id: item.id,
|
|
768
|
+
parent_id: parent.id,
|
|
769
|
+
parent_status: parent.status
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
if (includeStaleBlockers) {
|
|
774
|
+
const blockedBy = toMeaningfulString(item.blocked_by);
|
|
775
|
+
const blockedReason = toMeaningfulString(item.blocked_reason);
|
|
776
|
+
const blockedReasonNormalized = blockedReason?.toLowerCase();
|
|
777
|
+
const reasons = [];
|
|
778
|
+
const normalizedStatus = normalizeStatusForRegistry(item.status, statusRegistry);
|
|
779
|
+
if (!blockedStatuses.has(normalizedStatus)) {
|
|
780
|
+
if (blockedBy) {
|
|
781
|
+
reasons.push("non_blocked_status_has_blocked_by");
|
|
782
|
+
}
|
|
783
|
+
if (blockedReason) {
|
|
784
|
+
reasons.push("non_blocked_status_has_blocked_reason");
|
|
785
|
+
}
|
|
786
|
+
} else {
|
|
787
|
+
if (!blockedBy && !blockedReason) {
|
|
788
|
+
reasons.push("blocked_status_missing_blocker_context");
|
|
789
|
+
}
|
|
790
|
+
if (blockedReasonNormalized?.includes("no active blocker")) {
|
|
791
|
+
reasons.push("blocked_status_reason_reports_no_active_blocker");
|
|
792
|
+
}
|
|
793
|
+
if (blockedReasonNormalized && lifecyclePatternPolicy.stale_blocker_reason_patterns.some((pattern) => blockedReasonNormalized.includes(pattern))) {
|
|
794
|
+
reasons.push("blocked_status_reason_matches_stale_pattern");
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
if (reasons.length > 0) {
|
|
798
|
+
staleBlockerRows.push({
|
|
799
|
+
id: item.id,
|
|
800
|
+
status: item.status,
|
|
801
|
+
reasons: [...new Set(reasons)].sort((left, right) => left.localeCompare(right))
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
closureLikeRows.sort((left, right) => left.id.localeCompare(right.id));
|
|
807
|
+
terminalParentRows.sort((left, right) => left.id.localeCompare(right.id) || left.parent_id.localeCompare(right.parent_id));
|
|
808
|
+
staleBlockerRows.sort((left, right) => left.id.localeCompare(right.id));
|
|
809
|
+
const dependencyCycleDiagnostics = detectLifecycleDependencyCycles(activeItems);
|
|
810
|
+
const warnings = [];
|
|
811
|
+
if (closureLikeRows.length > 0) {
|
|
812
|
+
warnings.push(`validate_lifecycle_active_closure_like_metadata:${closureLikeRows.length}`);
|
|
813
|
+
}
|
|
814
|
+
if (terminalParentRows.length > 0) {
|
|
815
|
+
warnings.push(`validate_lifecycle_active_terminal_parent:${terminalParentRows.length}`);
|
|
816
|
+
}
|
|
817
|
+
if (includeStaleBlockers && staleBlockerRows.length > 0) {
|
|
818
|
+
warnings.push(`validate_lifecycle_stale_blockers:${staleBlockerRows.length}`);
|
|
819
|
+
}
|
|
820
|
+
if (dependencyCycleDiagnostics.cycle_count > 0 && dependencyCycleSeverity !== "off") {
|
|
821
|
+
warnings.push(`${dependencyCycleSeverity === "error" ? "validate_lifecycle_dependency_cycles_error" : "validate_lifecycle_dependency_cycles"}:${dependencyCycleDiagnostics.cycle_count}`);
|
|
822
|
+
}
|
|
823
|
+
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
824
|
+
const summarizedClosureLikeRows = summarizeList(closureLikeRows.map((row) => `${row.id}:${row.fields.join(",")}`), diagnosticLimit);
|
|
825
|
+
const summarizedTerminalParentRows = summarizeList(terminalParentRows.map((row) => `${row.id}:${row.parent_id}:${row.parent_status}`), diagnosticLimit);
|
|
826
|
+
const summarizedStaleBlockerRows = summarizeList(staleBlockerRows.map((row) => `${row.id}:${row.status}:${row.reasons.join(",")}`), diagnosticLimit);
|
|
827
|
+
const summarizedDependencyCycleItemIds = summarizeList(dependencyCycleDiagnostics.cycle_item_ids, diagnosticLimit);
|
|
828
|
+
const summarizedDependencyCycleSamplePaths = summarizeList(dependencyCycleDiagnostics.cycle_sample_paths, diagnosticLimit);
|
|
829
|
+
return {
|
|
830
|
+
check: {
|
|
831
|
+
name: "lifecycle",
|
|
832
|
+
status: dependencyCycleDiagnostics.cycle_count > 0 && dependencyCycleSeverity === "error" ? "error" : warnings.length === 0 ? "ok" : "warn",
|
|
833
|
+
details: {
|
|
834
|
+
checked_active_items: activeItems.length,
|
|
835
|
+
active_closure_like_metadata_items: closureLikeRows.length,
|
|
836
|
+
active_closure_like_metadata_rows: summarizedClosureLikeRows.values,
|
|
837
|
+
active_closure_like_metadata_rows_truncated: summarizedClosureLikeRows.truncated,
|
|
838
|
+
active_terminal_parent_items: terminalParentRows.length,
|
|
839
|
+
active_terminal_parent_rows: summarizedTerminalParentRows.values,
|
|
840
|
+
active_terminal_parent_rows_truncated: summarizedTerminalParentRows.truncated,
|
|
841
|
+
stale_blocker_checks_enabled: includeStaleBlockers,
|
|
842
|
+
stale_blocker_items: staleBlockerRows.length,
|
|
843
|
+
stale_blocker_rows: summarizedStaleBlockerRows.values,
|
|
844
|
+
stale_blocker_rows_truncated: summarizedStaleBlockerRows.truncated,
|
|
845
|
+
dependency_cycle_severity_policy: dependencyCycleSeverity,
|
|
846
|
+
dependency_cycle_count: dependencyCycleDiagnostics.cycle_count,
|
|
847
|
+
dependency_cycle_item_count: dependencyCycleDiagnostics.cycle_item_ids.length,
|
|
848
|
+
dependency_cycle_item_ids: summarizedDependencyCycleItemIds.values,
|
|
849
|
+
dependency_cycle_item_ids_truncated: summarizedDependencyCycleItemIds.truncated,
|
|
850
|
+
dependency_cycle_sample_paths: summarizedDependencyCycleSamplePaths.values,
|
|
851
|
+
dependency_cycle_sample_paths_truncated: summarizedDependencyCycleSamplePaths.truncated,
|
|
852
|
+
stale_blocker_reason_patterns: [...lifecyclePatternPolicy.stale_blocker_reason_patterns],
|
|
853
|
+
stale_blocker_reason_pattern_source: lifecyclePatternPolicy.stale_blocker_reason_pattern_source,
|
|
854
|
+
closure_like_blocked_reason_patterns: [
|
|
855
|
+
...lifecyclePatternPolicy.closure_like_metadata_field_patterns.blocked_reason
|
|
856
|
+
],
|
|
857
|
+
closure_like_blocked_reason_pattern_source: lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.blocked_reason,
|
|
858
|
+
closure_like_resolution_patterns: [...lifecyclePatternPolicy.closure_like_metadata_field_patterns.resolution],
|
|
859
|
+
closure_like_resolution_pattern_source: lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.resolution,
|
|
860
|
+
closure_like_actual_result_patterns: [...lifecyclePatternPolicy.closure_like_metadata_field_patterns.actual_result],
|
|
861
|
+
closure_like_actual_result_pattern_source: lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.actual_result
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
warnings
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
async function buildFilesCheck(items, workspaceRoot, pmRoot, fileScanMode, includePmInternals, verboseFileLists) {
|
|
868
|
+
const linkedProjectPaths = /* @__PURE__ */ new Set();
|
|
869
|
+
const missingLinkedPaths = [];
|
|
870
|
+
for (const item of items) {
|
|
871
|
+
const linkedArtifacts = [...item.files ?? [], ...item.docs ?? []];
|
|
872
|
+
for (const artifact of linkedArtifacts) {
|
|
873
|
+
if (artifact.scope !== "project") {
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
const normalizedPath = normalizeRelativePath(artifact.path);
|
|
877
|
+
if (normalizedPath.length === 0) {
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
linkedProjectPaths.add(normalizedPath);
|
|
881
|
+
const absolutePath = path.isAbsolute(artifact.path) ? artifact.path : path.resolve(workspaceRoot, artifact.path);
|
|
882
|
+
try {
|
|
883
|
+
const stats = await fs.stat(absolutePath);
|
|
884
|
+
if (!stats.isFile()) {
|
|
885
|
+
missingLinkedPaths.push(normalizedPath);
|
|
886
|
+
}
|
|
887
|
+
} catch {
|
|
888
|
+
missingLinkedPaths.push(normalizedPath);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
const uniqueMissingLinkedPaths = [...new Set(missingLinkedPaths)].sort((left, right) => left.localeCompare(right));
|
|
893
|
+
const fileCandidates = await collectProjectFileCandidates(workspaceRoot, fileScanMode);
|
|
894
|
+
const strictTrackedAllMode = fileScanMode === "tracked-all-strict";
|
|
895
|
+
const strictModeForcesPmInternals = strictTrackedAllMode && !includePmInternals;
|
|
896
|
+
const includePmInternalsEffective = includePmInternals || strictTrackedAllMode;
|
|
897
|
+
const pmInternalCandidatePrefixes = includePmInternalsEffective ? [] : resolvePmInternalCandidatePrefixes(pmRoot, workspaceRoot);
|
|
898
|
+
const excludedPmInternalPaths = pmInternalCandidatePrefixes.length === 0 ? [] : fileCandidates.candidateFiles.filter((candidate) => hasPathPrefix(candidate, pmInternalCandidatePrefixes));
|
|
899
|
+
const candidateFiles = pmInternalCandidatePrefixes.length === 0 ? fileCandidates.candidateFiles : fileCandidates.candidateFiles.filter((candidate) => !hasPathPrefix(candidate, pmInternalCandidatePrefixes));
|
|
900
|
+
const excludedPmInternalCount = excludedPmInternalPaths.length;
|
|
901
|
+
const excludedByReason = {};
|
|
902
|
+
if (excludedPmInternalCount > 0) {
|
|
903
|
+
const summarizedPmInternalPaths = summarizeFileList(excludedPmInternalPaths, verboseFileLists);
|
|
904
|
+
excludedByReason.pm_internals = {
|
|
905
|
+
count: excludedPmInternalCount,
|
|
906
|
+
paths: summarizedPmInternalPaths.values,
|
|
907
|
+
paths_truncated: summarizedPmInternalPaths.truncated,
|
|
908
|
+
paths_total: summarizedPmInternalPaths.total
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
const orphanedFiles = candidateFiles.filter((candidate) => !linkedProjectPaths.has(candidate));
|
|
912
|
+
const warnings = [];
|
|
913
|
+
if (strictModeForcesPmInternals) {
|
|
914
|
+
warnings.push("validate_files_tracked_all_strict_forces_pm_internals");
|
|
915
|
+
}
|
|
916
|
+
if (uniqueMissingLinkedPaths.length > 0) {
|
|
917
|
+
warnings.push(`validate_files_missing_linked_paths:${uniqueMissingLinkedPaths.length}`);
|
|
918
|
+
}
|
|
919
|
+
if (orphanedFiles.length > 0) {
|
|
920
|
+
warnings.push(`validate_files_orphaned_paths:${orphanedFiles.length}`);
|
|
921
|
+
}
|
|
922
|
+
const summarizedMissing = summarizeFileList(uniqueMissingLinkedPaths, verboseFileLists);
|
|
923
|
+
const summarizedOrphaned = summarizeFileList(orphanedFiles, verboseFileLists);
|
|
924
|
+
return {
|
|
925
|
+
check: {
|
|
926
|
+
name: "files",
|
|
927
|
+
status: warnings.length === 0 ? "ok" : "warn",
|
|
928
|
+
details: {
|
|
929
|
+
workspace_root: workspaceRoot,
|
|
930
|
+
scan_mode_requested: fileCandidates.requestedMode,
|
|
931
|
+
scan_mode_applied: fileCandidates.appliedMode,
|
|
932
|
+
strict_tracked_all_mode: strictTrackedAllMode,
|
|
933
|
+
strict_mode_forces_pm_internals: strictModeForcesPmInternals,
|
|
934
|
+
strict_mode_forces_pm_internals_notice: strictModeForcesPmInternals ? "tracked-all-strict force-enables PM internals; pass --include-pm-internals to make inclusion explicit." : null,
|
|
935
|
+
file_list_detail_mode: verboseFileLists ? "full" : "summary",
|
|
936
|
+
file_list_summary_limit: FILE_LIST_SUMMARY_LIMIT,
|
|
937
|
+
candidate_scan_source: fileCandidates.source,
|
|
938
|
+
include_pm_internals: includePmInternalsEffective,
|
|
939
|
+
include_pm_internals_requested: includePmInternals,
|
|
940
|
+
pm_internal_candidate_prefixes: pmInternalCandidatePrefixes,
|
|
941
|
+
pm_internal_excluded_count: excludedPmInternalCount,
|
|
942
|
+
excluded_total: excludedPmInternalCount,
|
|
943
|
+
excluded_by_reason: excludedByReason,
|
|
944
|
+
linked_project_paths: linkedProjectPaths.size,
|
|
945
|
+
candidate_total_raw: fileCandidates.candidateTotal,
|
|
946
|
+
candidate_scanned_raw: fileCandidates.candidateScanned,
|
|
947
|
+
candidate_total: candidateFiles.length,
|
|
948
|
+
candidate_scanned: candidateFiles.length,
|
|
949
|
+
scanned_candidate_files: candidateFiles.length,
|
|
950
|
+
missing_linked_paths_count: uniqueMissingLinkedPaths.length,
|
|
951
|
+
missing_linked_paths_total: summarizedMissing.total,
|
|
952
|
+
missing_linked_paths: summarizedMissing.values,
|
|
953
|
+
missing_linked_paths_truncated: summarizedMissing.truncated,
|
|
954
|
+
orphaned_paths_count: orphanedFiles.length,
|
|
955
|
+
orphaned_paths_total: summarizedOrphaned.total,
|
|
956
|
+
orphaned_paths: summarizedOrphaned.values,
|
|
957
|
+
orphaned_paths_truncated: summarizedOrphaned.truncated
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
warnings
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
async function buildHistoryDriftCheck(pmRoot, items, verboseDiagnostics) {
|
|
964
|
+
const { missingStreams, unreadableStreams, hashMismatches, chainMismatches, driftedItems } = await scanHistoryDrift(pmRoot, items);
|
|
965
|
+
const warnings = [];
|
|
966
|
+
if (missingStreams.length > 0) {
|
|
967
|
+
warnings.push(`validate_history_drift_missing_streams:${missingStreams.length}`);
|
|
968
|
+
}
|
|
969
|
+
if (unreadableStreams.length > 0) {
|
|
970
|
+
warnings.push(`validate_history_drift_unreadable_streams:${unreadableStreams.length}`);
|
|
971
|
+
}
|
|
972
|
+
if (hashMismatches.length > 0) {
|
|
973
|
+
warnings.push(`validate_history_drift_hash_mismatches:${hashMismatches.length}`);
|
|
974
|
+
}
|
|
975
|
+
if (chainMismatches.length > 0) {
|
|
976
|
+
warnings.push(`validate_history_drift_chain_mismatches:${chainMismatches.length}`);
|
|
977
|
+
}
|
|
978
|
+
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
979
|
+
const summarizedDrifted = summarizeList(driftedItems, diagnosticLimit);
|
|
980
|
+
return {
|
|
981
|
+
check: {
|
|
982
|
+
name: "history_drift",
|
|
983
|
+
status: warnings.length === 0 ? "ok" : "warn",
|
|
984
|
+
details: {
|
|
985
|
+
checked_items: items.length,
|
|
986
|
+
drifted_items_count: driftedItems.length,
|
|
987
|
+
drifted_items: summarizedDrifted.values,
|
|
988
|
+
drifted_items_truncated: summarizedDrifted.truncated,
|
|
989
|
+
counts: {
|
|
990
|
+
missing_streams: missingStreams.length,
|
|
991
|
+
unreadable_streams: unreadableStreams.length,
|
|
992
|
+
hash_mismatches: hashMismatches.length,
|
|
993
|
+
chain_mismatches: chainMismatches.length
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
warnings
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
function summarizeCommandReferenceRow(ownerId, referencedId, command) {
|
|
1001
|
+
const normalizedCommand = command.trim().replaceAll(/\s+/g, " ");
|
|
1002
|
+
const commandPreview = normalizedCommand.length > 120 ? `${normalizedCommand.slice(0, 117)}...` : normalizedCommand;
|
|
1003
|
+
return `${ownerId}:${referencedId}:${commandPreview}`;
|
|
1004
|
+
}
|
|
1005
|
+
function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
|
|
1006
|
+
const knownIds = new Set(items.map((item) => item.id.toLowerCase()));
|
|
1007
|
+
let linkedCommandsScanned = 0;
|
|
1008
|
+
let referencedPmIdCount = 0;
|
|
1009
|
+
const referencedPmIds = /* @__PURE__ */ new Set();
|
|
1010
|
+
const staleReferenceRows = [];
|
|
1011
|
+
for (const item of items) {
|
|
1012
|
+
for (const linkedTest of item.tests ?? []) {
|
|
1013
|
+
if (typeof linkedTest.command !== "string" || linkedTest.command.trim().length === 0) {
|
|
1014
|
+
continue;
|
|
1015
|
+
}
|
|
1016
|
+
linkedCommandsScanned += 1;
|
|
1017
|
+
const referencedIds = extractReferencedPmItemIdsFromCommand(linkedTest.command, idPrefix);
|
|
1018
|
+
if (referencedIds.length === 0) {
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
referencedPmIdCount += referencedIds.length;
|
|
1022
|
+
for (const referencedId of referencedIds) {
|
|
1023
|
+
referencedPmIds.add(referencedId);
|
|
1024
|
+
if (!knownIds.has(referencedId.toLowerCase())) {
|
|
1025
|
+
staleReferenceRows.push(summarizeCommandReferenceRow(item.id, referencedId, linkedTest.command));
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
const uniqueStaleReferenceRows = [...new Set(staleReferenceRows)].sort((left, right) => left.localeCompare(right));
|
|
1031
|
+
const stalePmIds = [...new Set(uniqueStaleReferenceRows.map((row) => row.split(":")[1] ?? ""))].filter((value) => value.length > 0).sort((left, right) => left.localeCompare(right));
|
|
1032
|
+
const warnings = uniqueStaleReferenceRows.length > 0 ? [`validate_command_references_stale_pm_ids:${uniqueStaleReferenceRows.length}`] : [];
|
|
1033
|
+
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
1034
|
+
const summarizedRows = summarizeList(uniqueStaleReferenceRows, diagnosticLimit);
|
|
1035
|
+
const summarizedStalePmIds = summarizeList(stalePmIds, diagnosticLimit);
|
|
1036
|
+
const summarizedReferencedPmIds = summarizeList([...referencedPmIds].sort((left, right) => left.localeCompare(right)), diagnosticLimit);
|
|
1037
|
+
return {
|
|
1038
|
+
check: {
|
|
1039
|
+
name: "command_references",
|
|
1040
|
+
status: warnings.length === 0 ? "ok" : "warn",
|
|
1041
|
+
details: {
|
|
1042
|
+
checked_items: items.length,
|
|
1043
|
+
linked_commands_scanned: linkedCommandsScanned,
|
|
1044
|
+
referenced_pm_ids_count: referencedPmIdCount,
|
|
1045
|
+
unique_referenced_pm_ids_count: referencedPmIds.size,
|
|
1046
|
+
unique_referenced_pm_ids: summarizedReferencedPmIds.values,
|
|
1047
|
+
unique_referenced_pm_ids_truncated: summarizedReferencedPmIds.truncated,
|
|
1048
|
+
stale_pm_id_references_count: uniqueStaleReferenceRows.length,
|
|
1049
|
+
stale_pm_ids_count: stalePmIds.length,
|
|
1050
|
+
stale_pm_ids: summarizedStalePmIds.values,
|
|
1051
|
+
stale_pm_ids_truncated: summarizedStalePmIds.truncated,
|
|
1052
|
+
stale_pm_id_reference_rows: summarizedRows.values,
|
|
1053
|
+
stale_pm_id_reference_rows_truncated: summarizedRows.truncated
|
|
1054
|
+
}
|
|
1055
|
+
},
|
|
1056
|
+
warnings
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
async function runValidate(options, global) {
|
|
1060
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1061
|
+
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
1062
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
1063
|
+
}
|
|
1064
|
+
const settings = await readSettings(pmRoot);
|
|
1065
|
+
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
1066
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
1067
|
+
const itemReadWarnings = [];
|
|
1068
|
+
const items = await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, itemReadWarnings, settings.schema);
|
|
1069
|
+
const requestedChecks = resolveRequestedChecks(options);
|
|
1070
|
+
const metadataProfileSource = typeof options.metadataProfile === "string" ? "option" : "settings";
|
|
1071
|
+
const metadataProfile = resolveValidateMetadataProfile(typeof options.metadataProfile === "string" ? options.metadataProfile : settings.validation.metadata_profile);
|
|
1072
|
+
const metadataPolicy = resolveValidateMetadataPolicy(metadataProfile, metadataProfileSource, settings.validation.metadata_required_fields);
|
|
1073
|
+
const lifecyclePatternPolicy = resolveLifecyclePatternPolicy(settings);
|
|
1074
|
+
const dependencyCycleSeverity = resolveDependencyCycleSeverity(options.dependencyCycleSeverity);
|
|
1075
|
+
const fileScanMode = resolveFileScanMode(options.scanMode);
|
|
1076
|
+
const workspaceRoot = resolveWorkspaceRoot(pmRoot);
|
|
1077
|
+
const checks = [];
|
|
1078
|
+
const warnings = [...new Set(itemReadWarnings)];
|
|
1079
|
+
const fixHintsEnabled = options.fixHints === true;
|
|
1080
|
+
const record = (built) => {
|
|
1081
|
+
if (fixHintsEnabled) {
|
|
1082
|
+
attachValidateFixHints(built.check, built.warnings);
|
|
1083
|
+
}
|
|
1084
|
+
checks.push(built.check);
|
|
1085
|
+
warnings.push(...built.warnings);
|
|
1086
|
+
};
|
|
1087
|
+
if (requestedChecks.has("metadata")) {
|
|
1088
|
+
record(buildMetadataCheck(items, metadataPolicy, statusRegistry, Boolean(options.verboseDiagnostics)));
|
|
1089
|
+
}
|
|
1090
|
+
if (requestedChecks.has("resolution")) {
|
|
1091
|
+
record(buildResolutionCheck(items, statusRegistry, Boolean(options.verboseDiagnostics)));
|
|
1092
|
+
}
|
|
1093
|
+
if (requestedChecks.has("lifecycle")) {
|
|
1094
|
+
record(buildLifecycleCheck(items, Boolean(options.checkStaleBlockers), dependencyCycleSeverity, statusRegistry, lifecyclePatternPolicy, Boolean(options.verboseDiagnostics)));
|
|
1095
|
+
}
|
|
1096
|
+
if (requestedChecks.has("files")) {
|
|
1097
|
+
record(await buildFilesCheck(items, workspaceRoot, pmRoot, fileScanMode, Boolean(options.includePmInternals), Boolean(options.verboseFileLists)));
|
|
1098
|
+
}
|
|
1099
|
+
if (requestedChecks.has("command_references")) {
|
|
1100
|
+
record(buildCommandReferencesCheck(items, settings.id_prefix, Boolean(options.verboseDiagnostics)));
|
|
1101
|
+
}
|
|
1102
|
+
if (requestedChecks.has("history_drift")) {
|
|
1103
|
+
record(await buildHistoryDriftCheck(pmRoot, items, Boolean(options.verboseDiagnostics)));
|
|
1104
|
+
}
|
|
1105
|
+
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1106
|
+
const hasErrors = checks.some((check) => check.status === "error");
|
|
1107
|
+
return {
|
|
1108
|
+
ok: !hasErrors,
|
|
1109
|
+
has_warnings: normalizedWarnings.length > 0,
|
|
1110
|
+
checks,
|
|
1111
|
+
warnings: normalizedWarnings,
|
|
1112
|
+
generated_at: nowIso()
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
export {
|
|
1116
|
+
runValidate
|
|
1117
|
+
};
|
|
1118
|
+
//# sourceMappingURL=validate-L5J6A7YO.js.map
|
|
1119
|
+
|
|
1120
|
+
//# debugId=3791a091-6275-5b20-8c03-fdd6ad799a1f
|