@unbrained/pm-cli 2026.7.6 → 2026.7.8
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 +50 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +10 -2
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/context.d.ts +1 -0
- package/dist/cli/commands/context.js +4 -4
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +23 -19
- package/dist/cli/commands/extension.js +167 -57
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +4 -4
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-content.js +28 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +19 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +119 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-CDPAYYSB.js +11 -0
- package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-RSPHC423.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-2BVD4ZD2.js} +288 -233
- package/dist/cli-bundle/chunks/chunk-2BVD4ZD2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-2RADY7IB.js} +517 -195
- package/dist/cli-bundle/chunks/chunk-2RADY7IB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-3FRNNVWY.js} +518 -196
- package/dist/cli-bundle/chunks/chunk-3FRNNVWY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-3FUXM574.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-3SHDAKMF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-3UXIMY62.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-3UXIMY62.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-3V5C7PUH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-3YJDIJIE.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-3YJDIJIE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-4I7KS5ES.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-4OCWJ2AP.js} +13 -17
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-4OCWJ2AP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-5STY7NVM.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-5VAZHYVQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-6FU5BVRB.js} +12 -14
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-6FU5BVRB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-6RR4XM5H.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-6TD5QGIB.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-6TD5QGIB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-6WCXSC5V.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-6WCXSC5V.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-6ZKDMEVT.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-6ZKDMEVT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-7QKSLAHB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-7TBUV7XS.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-7TBUV7XS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-7UCBLJDF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-AEOFBBWO.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-AEOFBBWO.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-ASMRSIDX.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-ASMRSIDX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-BFNFTHWQ.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-BPJ5NYSJ.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-BPJ5NYSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-C3YU3TXX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-C6XSTACC.js} +11 -7
- package/dist/cli-bundle/chunks/chunk-C6XSTACC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-CGDUIPJL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-CXH7EMSB.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-CXH7EMSB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-D63PEJTB.js} +256 -36
- package/dist/cli-bundle/chunks/chunk-D63PEJTB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-D6J5673C.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-D6J5673C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-DUBC6TI3.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-DUBC6TI3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-EEJKHF7M.js} +7 -6
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-EEJKHF7M.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EP2CKDS7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-EYPIUFWJ.js} +24 -32
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-EYPIUFWJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-F5DDGY6R.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-F5DDGY6R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-FFB3WITE.js} +10 -16
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-FFB3WITE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-FJR2S7S4.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-FJR2S7S4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FL625JJM.js +6792 -0
- package/dist/cli-bundle/chunks/chunk-FL625JJM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-FOJEBRDD.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-FOJEBRDD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-G4FKP4ID.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-G4FKP4ID.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GE44TQMC.js +6726 -0
- package/dist/cli-bundle/chunks/chunk-GE44TQMC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-GLMJLBLR.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-GLMJLBLR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-GO2X6ZRB.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-GO2X6ZRB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-GQOKFX2G.js} +22 -26
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-GQOKFX2G.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-GSQVQINP.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-GSQVQINP.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-HI27UADG.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-HI27UADG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-HZZ3AC27.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-HZZ3AC27.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-IINCZYM3.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-IINCZYM3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-INOWVPUD.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-INOWVPUD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-IYRG5AEC.js} +15 -23
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-IYRG5AEC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-J6AD3GWC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-JH5XDDYS.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-JH5XDDYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-JYVPLGOW.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-JYVPLGOW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-K52C6YPA.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-K52C6YPA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-KFL3XHMA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-KMXVZ2P7.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-KMXVZ2P7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-LD2NBQ5T.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-LD2NBQ5T.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-LG4N6YOK.js} +8 -7
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-LG4N6YOK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-LHDHS4Z6.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-LHDHS4Z6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-MCH6IKK7.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-MCH6IKK7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-MFLLULHU.js} +281 -233
- package/dist/cli-bundle/chunks/chunk-MFLLULHU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-ML27MHNM.js} +35 -17
- package/dist/cli-bundle/chunks/chunk-ML27MHNM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-MYHFZNBO.js} +20 -24
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-MYHFZNBO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-NGBWEYNY.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-NGBWEYNY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-NRMDT4OV.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-NRMDT4OV.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-NTOOEVJ4.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-NTOOEVJ4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-P2WE5KCU.js} +261 -34
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-P2WE5KCU.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-PAWPLIWW.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-PAWPLIWW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-PCBZ2VJD.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-PJPZTE7P.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-PJPZTE7P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-Q3CFSOQZ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-QJZM5WO5.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-QJZM5WO5.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-QLEH6FTQ.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-QLEH6FTQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-QYZMZD4L.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-QYZMZD4L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-RDJXIAJB.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-RDJXIAJB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-RFHLRMLQ.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-RFHLRMLQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-RL24NAUX.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-RL24NAUX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-RLHQ3G4M.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-RLHQ3G4M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-SCJPFQQT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-SCJPFQQT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-SIQGG335.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-SIQGG335.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-SN5X5GTU.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-SN5X5GTU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-TKWTJGD6.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-TKWTJGD6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-TR2C6V5T.js} +37 -19
- package/dist/cli-bundle/chunks/chunk-TR2C6V5T.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-TTCJCKUJ.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-TTCJCKUJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-TU5P744I.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-TUDAYIO7.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-TUDAYIO7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-U72GF3I2.js} +12 -8
- package/dist/cli-bundle/chunks/chunk-U72GF3I2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-UCRYCT5M.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-UCRYCT5M.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-UEATYUZW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-UFNFHCAC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-UH6VFRV6.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-UH6VFRV6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-UIHDZS6X.js} +11 -15
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-UIHDZS6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-UURYLDDC.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-UURYLDDC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-UVFJSKTF.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-UVFJSKTF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-W2VFNVSJ.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-W2VFNVSJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-WVEMZZCR.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-WVEMZZCR.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-XN5BEN2B.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-XN5BEN2B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XPSGJ4IV.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XPSGJ4IV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-YQEKE4FO.js} +13 -21
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-YQEKE4FO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-YR5R4FMQ.js} +26 -34
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-YR5R4FMQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-YSRXFGNV.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-YSRXFGNV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-YUCKM3MD.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-YUCKM3MD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-YUMNZS3X.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-YUMNZS3X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-Z2JQH2MG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-Z6RLSNUX.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-Z6RLSNUX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-ZMOPZFVT.js} +4 -4
- package/dist/cli-bundle/chunks/close-E3RLZSP2.js +12 -0
- package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-K6BFI3OX.js} +5 -9
- package/dist/cli-bundle/chunks/close-many-6NBL3PM4.js +26 -0
- package/dist/cli-bundle/chunks/close-many-X4YKS3RO.js +22 -0
- package/dist/cli-bundle/chunks/comments-PLFK5ZKK.js +17 -0
- package/dist/cli-bundle/chunks/comments-ZNOD5PTV.js +13 -0
- package/dist/cli-bundle/chunks/copy-F7BUFY4J.js +9 -0
- package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-VH3L4MN2.js} +4 -8
- package/dist/cli-bundle/chunks/create-AMBMYP6F.js +25 -0
- package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-TRIBYORN.js} +9 -14
- package/dist/cli-bundle/chunks/delete-6KQHZYIP.js +10 -0
- package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-ZNXUNCZR.js} +4 -8
- package/dist/cli-bundle/chunks/deps-CVDY7FFK.js +13 -0
- package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-SZXQHV73.js} +4 -8
- package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-DR74ITCD.js} +6 -10
- package/dist/cli-bundle/chunks/docs-WCVYY6I7.js +14 -0
- package/dist/cli-bundle/chunks/files-H5YCA74Z.js +18 -0
- package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-QEFQ2M3H.js} +6 -10
- package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-55TRYSNA.js} +7 -9
- package/dist/cli-bundle/chunks/focus-N2QGNS5D.js +10 -0
- package/dist/cli-bundle/chunks/history-compact-GWQ4UOEI.js +21 -0
- package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-JJZ4EFL3.js} +9 -13
- package/dist/cli-bundle/chunks/history-redact-4GJOLXCM.js +17 -0
- package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-TPPUT3A5.js} +7 -11
- package/dist/cli-bundle/chunks/history-repair-HVCVCGUF.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-J7PIZ6ZP.js} +9 -13
- package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-KB6BT4NR.js} +9 -11
- package/dist/cli-bundle/chunks/learnings-YYY3U2Y7.js +13 -0
- package/dist/cli-bundle/chunks/notes-BGG7VL72.js +13 -0
- package/dist/cli-bundle/chunks/notes-ZTHXVOKM.js +17 -0
- package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-CJPKFRBK.js} +10 -15
- package/dist/cli-bundle/chunks/plan-MK2QY3GA.js +24 -0
- package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-AQNHXOYA.js} +9 -13
- package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-HTBFINKQ.js} +9 -13
- package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-EEF33SUJ.js} +43 -34
- package/dist/cli-bundle/chunks/register-list-query-EEF33SUJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-S4FBWIWN.js} +42 -33
- package/dist/cli-bundle/chunks/register-list-query-S4FBWIWN.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-L5Q7AUDN.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-L5Q7AUDN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-QFLRBCI7.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-QFLRBCI7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-HDE4FVW4.js} +79 -46
- package/dist/cli-bundle/chunks/register-operations-HDE4FVW4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-QDU43FCG.js} +78 -45
- package/dist/cli-bundle/chunks/register-operations-QDU43FCG.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-EGMTAXDC.js} +134 -32
- package/dist/cli-bundle/chunks/register-setup-EGMTAXDC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-PNIO3L2P.js} +133 -31
- package/dist/cli-bundle/chunks/register-setup-PNIO3L2P.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-BTBEZ5CK.js} +7 -11
- package/dist/cli-bundle/chunks/restore-EX4UUZL6.js +15 -0
- package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DGSTYYQB.js} +6 -10
- package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-HAIBEE24.js} +6 -10
- package/dist/cli-bundle/chunks/update-MP4XLU56.js +25 -0
- package/dist/cli-bundle/chunks/update-SDIRJGSY.js +21 -0
- package/dist/cli-bundle/chunks/update-many-34AIU6W7.js +31 -0
- package/dist/cli-bundle/chunks/update-many-JUPCNOKV.js +35 -0
- package/dist/cli-bundle/main.js +56 -32
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +161 -107
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +154 -117
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/extensions/extension-types.d.ts +1 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +268 -231
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +3 -3
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +12 -8
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +14 -8
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +282 -8
- package/dist/sdk/runtime.js +453 -14
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/EXTENSIONS.md +7 -20
- package/docs/RELEASING.md +6 -0
- package/docs/SDK.md +65 -0
- package/docs/TESTING.md +3 -0
- package/package.json +2 -1
- package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
- package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
- package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
- package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
- package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LK6XLOGP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
- package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
- package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
- package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
- package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
- package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
- package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
- package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
- package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
- package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
- package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
- package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
- package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
- package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
- package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
- package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
- package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
- package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
- package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
- package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
- package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
- package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
- package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
- package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
- package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
- package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
- package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
- package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
- package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
- package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-CDPAYYSB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-RSPHC423.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-3FUXM574.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-3SHDAKMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-3V5C7PUH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-4I7KS5ES.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-5STY7NVM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-5VAZHYVQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-6RR4XM5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-7QKSLAHB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-7UCBLJDF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-BFNFTHWQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-C3YU3TXX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-CGDUIPJL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EP2CKDS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-J6AD3GWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-KFL3XHMA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-PCBZ2VJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-Q3CFSOQZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-TU5P744I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-UEATYUZW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-UFNFHCAC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-Z2JQH2MG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-ZMOPZFVT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-E3RLZSP2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-K6BFI3OX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-6NBL3PM4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-X4YKS3RO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-PLFK5ZKK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-ZNOD5PTV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-F7BUFY4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-VH3L4MN2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AMBMYP6F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-TRIBYORN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-6KQHZYIP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-ZNXUNCZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-CVDY7FFK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-SZXQHV73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-DR74ITCD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-WCVYY6I7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-H5YCA74Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-QEFQ2M3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-55TRYSNA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-N2QGNS5D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-GWQ4UOEI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-JJZ4EFL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-4GJOLXCM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-TPPUT3A5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-HVCVCGUF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-J7PIZ6ZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-KB6BT4NR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-YYY3U2Y7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-BGG7VL72.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-ZTHXVOKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-CJPKFRBK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-MK2QY3GA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-AQNHXOYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-HTBFINKQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-BTBEZ5CK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-EX4UUZL6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DGSTYYQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-HAIBEE24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-MP4XLU56.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-SDIRJGSY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-34AIU6W7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-JUPCNOKV.js.map} +0 -0
|
@@ -1,2128 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
extractReferencedPmItemIdsFromCommand
|
|
3
|
-
} from "./chunk-C5JBZRPU.js";
|
|
4
|
-
import {
|
|
5
|
-
buildRemediationCommands
|
|
6
|
-
} from "./chunk-JINYH2DB.js";
|
|
7
|
-
import {
|
|
8
|
-
scanHistoryDrift
|
|
9
|
-
} from "./chunk-QLMX7SRD.js";
|
|
10
|
-
import {
|
|
11
|
-
isRemoteLinkedArtifactReference
|
|
12
|
-
} from "./chunk-7M2HAZEB.js";
|
|
13
|
-
import {
|
|
14
|
-
listAllFrontMatterWithBody
|
|
15
|
-
} from "./chunk-5VAA4YHR.js";
|
|
16
|
-
import {
|
|
17
|
-
CURRENT_ITEM_FORMAT_VERSION,
|
|
18
|
-
effectiveItemFormatVersion,
|
|
19
|
-
normalizeStatusInput,
|
|
20
|
-
scanItemFormatVersions
|
|
21
|
-
} from "./chunk-NMP5I3I5.js";
|
|
22
|
-
import {
|
|
23
|
-
nowIso
|
|
24
|
-
} from "./chunk-FLZSGSQR.js";
|
|
25
|
-
import {
|
|
26
|
-
PmCliError,
|
|
27
|
-
getActiveExtensionRegistrations,
|
|
28
|
-
readSettings,
|
|
29
|
-
resolveEstimateDefaultMinutes
|
|
30
|
-
} from "./chunk-SHQY2IDC.js";
|
|
31
|
-
import {
|
|
32
|
-
DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS,
|
|
33
|
-
DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS,
|
|
34
|
-
EXIT_CODE,
|
|
35
|
-
PM_DIRNAME,
|
|
36
|
-
getSettingsPath,
|
|
37
|
-
pathExists,
|
|
38
|
-
resolveItemTypeRegistry,
|
|
39
|
-
resolvePmRoot,
|
|
40
|
-
resolveRuntimeStatusRegistry,
|
|
41
|
-
toNonEmptyStringOrUndefined
|
|
42
|
-
} from "./chunk-LK6XLOGP.js";
|
|
43
|
-
|
|
44
|
-
// dist/cli/commands/validate.js
|
|
45
|
-
import fs from "node:fs/promises";
|
|
46
|
-
import { realpathSync } from "node:fs";
|
|
47
|
-
import { execFile } from "node:child_process";
|
|
48
|
-
import path from "node:path";
|
|
49
|
-
import { promisify } from "node:util";
|
|
50
|
-
|
|
51
|
-
// dist/core/validate/fix-planning.js
|
|
52
|
-
!(function() {
|
|
53
|
-
try {
|
|
54
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
55
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "efc3e5f9-0d68-50a9-a99c-b86ddd13c4ed");
|
|
56
|
-
} catch (e2) {
|
|
57
|
-
}
|
|
58
|
-
})();
|
|
59
|
-
var DEFAULT_GRANTED_FIX_SCOPES = ["metadata", "resolution"];
|
|
60
|
-
var SUPPORTED_FIX_SCOPES = ["metadata", "resolution", "estimates", "lifecycle"];
|
|
61
|
-
var DEFAULT_RESOLUTION_BACKFILL_VALUE = "completed";
|
|
62
|
-
function quoteForCommand(value) {
|
|
63
|
-
return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
64
|
-
}
|
|
65
|
-
function toMeaningfulValue(value) {
|
|
66
|
-
const trimmed = value?.trim();
|
|
67
|
-
return trimmed !== void 0 && trimmed.length > 0 ? trimmed : void 0;
|
|
68
|
-
}
|
|
69
|
-
function planResolutionBackfillFixes(rows) {
|
|
70
|
-
const fixes = [];
|
|
71
|
-
for (const row of rows) {
|
|
72
|
-
if (!row.missing_fields.includes("resolution")) {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
const value = toMeaningfulValue(row.close_reason) ?? DEFAULT_RESOLUTION_BACKFILL_VALUE;
|
|
76
|
-
fixes.push({
|
|
77
|
-
item_id: row.id,
|
|
78
|
-
check: "resolution",
|
|
79
|
-
field: "resolution",
|
|
80
|
-
kind: "set_resolution",
|
|
81
|
-
value,
|
|
82
|
-
command: `pm update ${row.id} --resolution ${quoteForCommand(value)}`,
|
|
83
|
-
gate: "resolution"
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return fixes;
|
|
87
|
-
}
|
|
88
|
-
function planCloseReasonBackfillFixes(rows) {
|
|
89
|
-
const fixes = [];
|
|
90
|
-
for (const row of rows) {
|
|
91
|
-
const value = toMeaningfulValue(row.resolution);
|
|
92
|
-
if (value === void 0) {
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
fixes.push({
|
|
96
|
-
item_id: row.id,
|
|
97
|
-
check: "metadata",
|
|
98
|
-
field: "close_reason",
|
|
99
|
-
kind: "set_close_reason",
|
|
100
|
-
value,
|
|
101
|
-
command: `pm update ${row.id} --close-reason ${quoteForCommand(value)}`,
|
|
102
|
-
gate: "metadata"
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
return fixes;
|
|
106
|
-
}
|
|
107
|
-
function planEstimateBackfillFixes(rows, overrides) {
|
|
108
|
-
return rows.map((row) => {
|
|
109
|
-
const minutes = resolveEstimateDefaultMinutes(row.type, overrides);
|
|
110
|
-
return {
|
|
111
|
-
item_id: row.id,
|
|
112
|
-
check: "metadata",
|
|
113
|
-
field: "estimated_minutes",
|
|
114
|
-
kind: "set_estimate",
|
|
115
|
-
value: String(minutes),
|
|
116
|
-
command: `pm update ${row.id} --estimate ${minutes}`,
|
|
117
|
-
gate: "estimates"
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
function planTerminalParentFixes(rows) {
|
|
122
|
-
return rows.map((row) => {
|
|
123
|
-
if (row.grandparent_id !== void 0 && row.grandparent_active === true) {
|
|
124
|
-
return {
|
|
125
|
-
item_id: row.id,
|
|
126
|
-
check: "lifecycle",
|
|
127
|
-
field: "parent",
|
|
128
|
-
kind: "reparent",
|
|
129
|
-
parent_id: row.grandparent_id,
|
|
130
|
-
command: `pm update ${row.id} --parent ${row.grandparent_id}`,
|
|
131
|
-
gate: "lifecycle"
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
item_id: row.id,
|
|
136
|
-
check: "lifecycle",
|
|
137
|
-
field: "parent",
|
|
138
|
-
kind: "unset_parent",
|
|
139
|
-
command: `pm update ${row.id} --unset parent`,
|
|
140
|
-
gate: "lifecycle"
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function planStaleLinkPruneFixes(rows) {
|
|
145
|
-
const fixes = [];
|
|
146
|
-
for (const row of rows) {
|
|
147
|
-
if (row.classification !== "deleted") {
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
const noun = row.link_kind === "files" ? "files" : "docs";
|
|
151
|
-
fixes.push({
|
|
152
|
-
item_id: row.item_id,
|
|
153
|
-
check: "files",
|
|
154
|
-
field: row.link_kind,
|
|
155
|
-
kind: row.link_kind === "files" ? "prune_file_link" : "prune_doc_link",
|
|
156
|
-
path: row.path,
|
|
157
|
-
command: `pm ${noun} ${row.item_id} --remove ${quoteForCommand(row.path)}`
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
return fixes;
|
|
161
|
-
}
|
|
162
|
-
function resolveGrantedFixScopes(rawScopes) {
|
|
163
|
-
const tokens = (rawScopes ?? []).flatMap((raw) => raw.split(",")).map((raw) => raw.trim()).filter((raw) => raw.length > 0);
|
|
164
|
-
if (tokens.length === 0) {
|
|
165
|
-
if (rawScopes !== void 0 && rawScopes.length > 0) {
|
|
166
|
-
throw new PmCliError(`--fix-scope values must not be empty. Supported values: ${SUPPORTED_FIX_SCOPES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
167
|
-
}
|
|
168
|
-
return new Set(DEFAULT_GRANTED_FIX_SCOPES);
|
|
169
|
-
}
|
|
170
|
-
const granted = /* @__PURE__ */ new Set();
|
|
171
|
-
for (const raw of tokens) {
|
|
172
|
-
const normalized = raw.toLowerCase().replaceAll("-", "_");
|
|
173
|
-
if (SUPPORTED_FIX_SCOPES.includes(normalized)) {
|
|
174
|
-
granted.add(normalized);
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
throw new PmCliError(`Unknown --fix-scope value "${raw}". Supported values: ${SUPPORTED_FIX_SCOPES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
178
|
-
}
|
|
179
|
-
return granted;
|
|
180
|
-
}
|
|
181
|
-
function partitionFixesByGrant(fixes, granted) {
|
|
182
|
-
const applicable = [];
|
|
183
|
-
const gated = [];
|
|
184
|
-
for (const fix of fixes) {
|
|
185
|
-
if (fix.gate !== void 0 && !granted.has(fix.gate)) {
|
|
186
|
-
gated.push(fix);
|
|
187
|
-
} else {
|
|
188
|
-
applicable.push(fix);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return { applicable, gated };
|
|
192
|
-
}
|
|
193
|
-
function toFixOutputRow(fix) {
|
|
194
|
-
return {
|
|
195
|
-
item_id: fix.item_id,
|
|
196
|
-
check: fix.check,
|
|
197
|
-
field: fix.field,
|
|
198
|
-
command: fix.command,
|
|
199
|
-
...fix.gate !== void 0 ? { gate: fix.gate } : {}
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// dist/core/governance/issue-codes.js
|
|
204
|
-
!(function() {
|
|
205
|
-
try {
|
|
206
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
207
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ddde9a81-1cc4-589d-a05f-ebaa5195bac1");
|
|
208
|
-
} catch (e2) {
|
|
209
|
-
}
|
|
210
|
-
})();
|
|
211
|
-
var ISSUE_CODE_PATTERN = /^([A-Z][A-Z0-9]*-\d+)\b/;
|
|
212
|
-
function extractIssueCode(title) {
|
|
213
|
-
if (typeof title !== "string") {
|
|
214
|
-
return null;
|
|
215
|
-
}
|
|
216
|
-
const normalized = title.trim().toUpperCase();
|
|
217
|
-
if (normalized.length === 0) {
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
const match = ISSUE_CODE_PATTERN.exec(normalized);
|
|
221
|
-
return match ? match[1] : null;
|
|
222
|
-
}
|
|
223
|
-
function isNonEmptyIdReference(value) {
|
|
224
|
-
return typeof value === "string" && value.trim().length > 0;
|
|
225
|
-
}
|
|
226
|
-
function findDuplicateIssueCodes(items) {
|
|
227
|
-
const byCode = /* @__PURE__ */ new Map();
|
|
228
|
-
for (const item of items) {
|
|
229
|
-
if (typeof item.title !== "string") {
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
if (isNonEmptyIdReference(item.duplicate_of)) {
|
|
233
|
-
continue;
|
|
234
|
-
}
|
|
235
|
-
const code = extractIssueCode(item.title);
|
|
236
|
-
if (code === null) {
|
|
237
|
-
continue;
|
|
238
|
-
}
|
|
239
|
-
let entries = byCode.get(code);
|
|
240
|
-
if (!entries) {
|
|
241
|
-
entries = [];
|
|
242
|
-
byCode.set(code, entries);
|
|
243
|
-
}
|
|
244
|
-
if (!entries.some((entry) => entry.id === item.id)) {
|
|
245
|
-
entries.push({ id: item.id, title: item.title, parent: isNonEmptyIdReference(item.parent) ? item.parent.trim() : null });
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
const duplicates = [];
|
|
249
|
-
for (const [code, entries] of byCode) {
|
|
250
|
-
if (entries.length < 2) {
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
const idsInGroup = new Set(entries.map((entry) => entry.id.toLowerCase()));
|
|
254
|
-
const collisionEntries = entries.filter((entry) => entry.parent === null || !idsInGroup.has(entry.parent.toLowerCase()));
|
|
255
|
-
if (collisionEntries.length < 2) {
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
const sorted = [...collisionEntries].sort((left, right) => left.id.localeCompare(right.id));
|
|
259
|
-
duplicates.push({
|
|
260
|
-
code,
|
|
261
|
-
count: sorted.length,
|
|
262
|
-
ids: sorted.map((entry) => entry.id),
|
|
263
|
-
titles: sorted.map((entry) => entry.title)
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
return duplicates.sort((left, right) => left.code.localeCompare(right.code));
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// dist/core/validate/missing-by-type.js
|
|
270
|
-
!(function() {
|
|
271
|
-
try {
|
|
272
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
273
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "1fb67bf6-73f3-58f9-a2b3-4ef9aba339d6");
|
|
274
|
-
} catch (e2) {
|
|
275
|
-
}
|
|
276
|
-
})();
|
|
277
|
-
function buildMissingByTypeCounts(occurrences) {
|
|
278
|
-
const countsByType = /* @__PURE__ */ new Map();
|
|
279
|
-
for (const occurrence of occurrences) {
|
|
280
|
-
let fieldCounts = countsByType.get(occurrence.item_type);
|
|
281
|
-
if (!fieldCounts) {
|
|
282
|
-
fieldCounts = /* @__PURE__ */ new Map();
|
|
283
|
-
countsByType.set(occurrence.item_type, fieldCounts);
|
|
284
|
-
}
|
|
285
|
-
fieldCounts.set(occurrence.field, (fieldCounts.get(occurrence.field) ?? 0) + 1);
|
|
286
|
-
}
|
|
287
|
-
const result = {};
|
|
288
|
-
for (const type of [...countsByType.keys()].sort((left, right) => left.localeCompare(right))) {
|
|
289
|
-
const fieldCounts = countsByType.get(type);
|
|
290
|
-
const fields = {};
|
|
291
|
-
for (const field of [...fieldCounts.keys()].sort((left, right) => left.localeCompare(right))) {
|
|
292
|
-
fields[field] = fieldCounts.get(field);
|
|
293
|
-
}
|
|
294
|
-
result[type] = fields;
|
|
295
|
-
}
|
|
296
|
-
return result;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// dist/core/validate/stale-file-classification.js
|
|
300
|
-
!(function() {
|
|
301
|
-
try {
|
|
302
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
303
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9e7c3521-173b-54a8-bd97-2af3e1db8316");
|
|
304
|
-
} catch (e2) {
|
|
305
|
-
}
|
|
306
|
-
})();
|
|
307
|
-
var DEFAULT_STALE_PATH_CANDIDATE_LIMIT = 3;
|
|
308
|
-
function basenameOf(relativePath) {
|
|
309
|
-
const lastSlash = Math.max(relativePath.lastIndexOf("/"), relativePath.lastIndexOf("\\"));
|
|
310
|
-
return lastSlash === -1 ? relativePath : relativePath.slice(lastSlash + 1);
|
|
311
|
-
}
|
|
312
|
-
function classifyStaleLinkedPaths(stalePaths, candidateFiles, candidateLimit = DEFAULT_STALE_PATH_CANDIDATE_LIMIT) {
|
|
313
|
-
const limit = Number.isFinite(candidateLimit) && candidateLimit >= 1 ? Math.floor(candidateLimit) : DEFAULT_STALE_PATH_CANDIDATE_LIMIT;
|
|
314
|
-
const candidatesByBasename = /* @__PURE__ */ new Map();
|
|
315
|
-
for (const candidate of candidateFiles) {
|
|
316
|
-
const basename = basenameOf(candidate);
|
|
317
|
-
if (basename.length === 0) {
|
|
318
|
-
continue;
|
|
319
|
-
}
|
|
320
|
-
const bucket = candidatesByBasename.get(basename);
|
|
321
|
-
if (bucket) {
|
|
322
|
-
bucket.push(candidate);
|
|
323
|
-
} else {
|
|
324
|
-
candidatesByBasename.set(basename, [candidate]);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return stalePaths.map((stalePath) => {
|
|
328
|
-
const matches = (candidatesByBasename.get(basenameOf(stalePath)) ?? []).filter((candidate) => candidate !== stalePath).sort((left, right) => left.localeCompare(right));
|
|
329
|
-
if (matches.length === 0) {
|
|
330
|
-
return {
|
|
331
|
-
path: stalePath,
|
|
332
|
-
classification: "deleted",
|
|
333
|
-
candidates: [],
|
|
334
|
-
candidates_truncated: false
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
return {
|
|
338
|
-
path: stalePath,
|
|
339
|
-
classification: "moved",
|
|
340
|
-
candidates: matches.slice(0, limit),
|
|
341
|
-
candidates_truncated: matches.length > limit
|
|
342
|
-
};
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
function summarizeStaleLinkedPathClassifications(classified) {
|
|
346
|
-
return classified.map((entry) => entry.classification === "moved" ? `${entry.path}:moved:${entry.candidates[0]}` : `${entry.path}:deleted`);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// dist/core/validate/missing-link-owners.js
|
|
350
|
-
!(function() {
|
|
351
|
-
try {
|
|
352
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
353
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "950e74dc-b576-59a0-9c45-e718aa6644fc");
|
|
354
|
-
} catch (e2) {
|
|
355
|
-
}
|
|
356
|
-
})();
|
|
357
|
-
function preferClassification(current, next) {
|
|
358
|
-
return current === "moved" || next === "moved" ? "moved" : "deleted";
|
|
359
|
-
}
|
|
360
|
-
function ownerKey(input) {
|
|
361
|
-
return `${input.item_id} ${input.link_kind}`;
|
|
362
|
-
}
|
|
363
|
-
function buildMissingLinkedPathRows(rows, lookup) {
|
|
364
|
-
const buckets = /* @__PURE__ */ new Map();
|
|
365
|
-
for (const row of rows) {
|
|
366
|
-
const bucket = buckets.get(row.path);
|
|
367
|
-
if (bucket) {
|
|
368
|
-
bucket.classification = preferClassification(bucket.classification, row.classification);
|
|
369
|
-
bucket.owners.set(ownerKey(row), row);
|
|
370
|
-
} else {
|
|
371
|
-
buckets.set(row.path, {
|
|
372
|
-
classification: row.classification,
|
|
373
|
-
owners: /* @__PURE__ */ new Map([[ownerKey(row), row]])
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
return [...buckets.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([path2, bucket]) => ({
|
|
378
|
-
path: path2,
|
|
379
|
-
classification: bucket.classification,
|
|
380
|
-
items: [...bucket.owners.values()].map((owner) => {
|
|
381
|
-
const metadata = lookup(owner.item_id);
|
|
382
|
-
return {
|
|
383
|
-
id: owner.item_id,
|
|
384
|
-
type: metadata?.type ?? "Unknown",
|
|
385
|
-
title: metadata?.title ?? "",
|
|
386
|
-
status: metadata?.status ?? "",
|
|
387
|
-
field: owner.link_kind
|
|
388
|
-
};
|
|
389
|
-
}).sort((leftOwner, rightOwner) => {
|
|
390
|
-
const byId = leftOwner.id.localeCompare(rightOwner.id);
|
|
391
|
-
return byId !== 0 ? byId : leftOwner.field.localeCompare(rightOwner.field);
|
|
392
|
-
})
|
|
393
|
-
}));
|
|
394
|
-
}
|
|
395
|
-
function escapeTitle(title) {
|
|
396
|
-
return title.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
397
|
-
}
|
|
398
|
-
function summarizeMissingLinkedPathRows(rows) {
|
|
399
|
-
const lines = [];
|
|
400
|
-
for (const row of rows) {
|
|
401
|
-
for (const owner of row.items) {
|
|
402
|
-
lines.push(`${row.path}:${row.classification} owner=${owner.id} status=${owner.status} field=${owner.field} title="${escapeTitle(owner.title)}"`);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return lines;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// dist/cli/commands/validate.js
|
|
409
|
-
!(function() {
|
|
410
|
-
try {
|
|
411
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
412
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "e12634b8-369c-5ccf-99ad-ffd5ed8c0182");
|
|
413
|
-
} catch (e2) {
|
|
414
|
-
}
|
|
415
|
-
})();
|
|
416
|
-
var FILE_SCAN_DIRECTORIES = ["src", "tests", "docs"];
|
|
417
|
-
var FILE_SCAN_ROOT_FILES = [
|
|
418
|
-
"README.md",
|
|
419
|
-
"PRD.md",
|
|
420
|
-
"CHANGELOG.md",
|
|
421
|
-
"AGENTS.md",
|
|
422
|
-
"CONTRIBUTING.md",
|
|
423
|
-
"SECURITY.md",
|
|
424
|
-
"CODE_OF_CONDUCT.md",
|
|
425
|
-
"LICENSE"
|
|
426
|
-
];
|
|
427
|
-
var DIRECTORY_IGNORE_SET = /* @__PURE__ */ new Set(["node_modules", ".git", ".cursor", ".agents", "dist", "coverage"]);
|
|
428
|
-
var RESOLUTION_FIELD_KEYS = ["resolution", "expected_result", "actual_result"];
|
|
429
|
-
var VALIDATE_FILE_SCAN_MODES = ["default", "tracked-all", "tracked-all-strict"];
|
|
430
|
-
var VALIDATE_METADATA_PROFILE_VALUES = ["core", "strict", "custom"];
|
|
431
|
-
var VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES = ["off", "warn", "error"];
|
|
432
|
-
var CORE_METADATA_REQUIRED_FIELDS = ["author", "acceptance_criteria", "estimated_minutes", "close_reason"];
|
|
433
|
-
var STRICT_METADATA_REQUIRED_FIELDS = [
|
|
434
|
-
...CORE_METADATA_REQUIRED_FIELDS,
|
|
435
|
-
"reviewer",
|
|
436
|
-
"risk",
|
|
437
|
-
"confidence",
|
|
438
|
-
"sprint",
|
|
439
|
-
"release"
|
|
440
|
-
];
|
|
441
|
-
var SUPPORTED_METADATA_REQUIRED_FIELDS = Array.from(new Set(STRICT_METADATA_REQUIRED_FIELDS));
|
|
442
|
-
var METADATA_REQUIRED_FIELD_ALIASES = {
|
|
443
|
-
author: "author",
|
|
444
|
-
acceptance_criteria: "acceptance_criteria",
|
|
445
|
-
"acceptance-criteria": "acceptance_criteria",
|
|
446
|
-
estimated_minutes: "estimated_minutes",
|
|
447
|
-
"estimated-minutes": "estimated_minutes",
|
|
448
|
-
estimate: "estimated_minutes",
|
|
449
|
-
close_reason: "close_reason",
|
|
450
|
-
"close-reason": "close_reason",
|
|
451
|
-
reviewer: "reviewer",
|
|
452
|
-
risk: "risk",
|
|
453
|
-
confidence: "confidence",
|
|
454
|
-
sprint: "sprint",
|
|
455
|
-
release: "release"
|
|
456
|
-
};
|
|
457
|
-
var METADATA_WARNING_TOKEN_BY_FIELD = {
|
|
458
|
-
author: "validate_metadata_missing_author",
|
|
459
|
-
acceptance_criteria: "validate_metadata_missing_acceptance_criteria",
|
|
460
|
-
estimated_minutes: "validate_metadata_missing_estimate",
|
|
461
|
-
close_reason: "validate_metadata_missing_close_reason",
|
|
462
|
-
reviewer: "validate_metadata_missing_reviewer",
|
|
463
|
-
risk: "validate_metadata_missing_risk",
|
|
464
|
-
confidence: "validate_metadata_missing_confidence",
|
|
465
|
-
sprint: "validate_metadata_missing_sprint",
|
|
466
|
-
release: "validate_metadata_missing_release"
|
|
467
|
-
};
|
|
468
|
-
var METADATA_COUNT_KEY_BY_FIELD = {
|
|
469
|
-
author: "missing_author",
|
|
470
|
-
acceptance_criteria: "missing_acceptance_criteria",
|
|
471
|
-
estimated_minutes: "missing_estimated_minutes",
|
|
472
|
-
close_reason: "closed_missing_close_reason",
|
|
473
|
-
reviewer: "missing_reviewer",
|
|
474
|
-
risk: "missing_risk",
|
|
475
|
-
confidence: "missing_confidence",
|
|
476
|
-
sprint: "missing_sprint",
|
|
477
|
-
release: "missing_release"
|
|
478
|
-
};
|
|
479
|
-
var METADATA_ITEM_IDS_KEY_BY_FIELD = {
|
|
480
|
-
author: "missing_author_item_ids",
|
|
481
|
-
acceptance_criteria: "missing_acceptance_criteria_item_ids",
|
|
482
|
-
estimated_minutes: "missing_estimated_minutes_item_ids",
|
|
483
|
-
close_reason: "closed_missing_close_reason_item_ids",
|
|
484
|
-
reviewer: "missing_reviewer_item_ids",
|
|
485
|
-
risk: "missing_risk_item_ids",
|
|
486
|
-
confidence: "missing_confidence_item_ids",
|
|
487
|
-
sprint: "missing_sprint_item_ids",
|
|
488
|
-
release: "missing_release_item_ids"
|
|
489
|
-
};
|
|
490
|
-
var METADATA_TRUNCATED_KEY_BY_FIELD = {
|
|
491
|
-
author: "missing_author_truncated",
|
|
492
|
-
acceptance_criteria: "missing_acceptance_criteria_truncated",
|
|
493
|
-
estimated_minutes: "missing_estimated_minutes_truncated",
|
|
494
|
-
close_reason: "closed_missing_close_reason_truncated",
|
|
495
|
-
reviewer: "missing_reviewer_truncated",
|
|
496
|
-
risk: "missing_risk_truncated",
|
|
497
|
-
confidence: "missing_confidence_truncated",
|
|
498
|
-
sprint: "missing_sprint_truncated",
|
|
499
|
-
release: "missing_release_truncated"
|
|
500
|
-
};
|
|
501
|
-
var GIT_LS_FILES_MAX_BUFFER = 32 * 1024 * 1024;
|
|
502
|
-
var FILE_LIST_SUMMARY_LIMIT = 40;
|
|
503
|
-
var DIAGNOSTIC_LIST_SUMMARY_LIMIT = 5;
|
|
504
|
-
var LINKED_ARTIFACT_MAX_PATH_LENGTH = 4096;
|
|
505
|
-
var LINKED_ARTIFACT_MAX_SEGMENT_LENGTH = 255;
|
|
506
|
-
var execFileAsync = promisify(execFile);
|
|
507
|
-
function normalizeRelativePath(value) {
|
|
508
|
-
return value.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/^\/+/, "");
|
|
509
|
-
}
|
|
510
|
-
function normalizeRelativeDirectoryPath(value) {
|
|
511
|
-
const normalized = normalizeRelativePath(value);
|
|
512
|
-
return normalized.replace(/\/+$/, "");
|
|
513
|
-
}
|
|
514
|
-
function toMeaningfulString(value) {
|
|
515
|
-
const normalized = toNonEmptyStringOrUndefined(value);
|
|
516
|
-
if (!normalized) {
|
|
517
|
-
return void 0;
|
|
518
|
-
}
|
|
519
|
-
const lowered = normalized.toLowerCase();
|
|
520
|
-
if (lowered === "none" || lowered === "null" || lowered === "n/a" || lowered === "na") {
|
|
521
|
-
return void 0;
|
|
522
|
-
}
|
|
523
|
-
return normalized;
|
|
524
|
-
}
|
|
525
|
-
function normalizeStatusForRegistry(status, statusRegistry) {
|
|
526
|
-
return normalizeStatusInput(status, statusRegistry) ?? status;
|
|
527
|
-
}
|
|
528
|
-
function isTerminalStatus(status, statusRegistry) {
|
|
529
|
-
return statusRegistry.terminal_statuses.has(normalizeStatusForRegistry(status, statusRegistry));
|
|
530
|
-
}
|
|
531
|
-
function normalizeLifecyclePatternList(values) {
|
|
532
|
-
return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
|
|
533
|
-
}
|
|
534
|
-
function areSortedStringListsEqual(left, right) {
|
|
535
|
-
if (left.length !== right.length) {
|
|
536
|
-
return false;
|
|
537
|
-
}
|
|
538
|
-
return left.every((value, index) => value === right[index]);
|
|
539
|
-
}
|
|
540
|
-
function resolveLifecyclePatternPolicy(settings) {
|
|
541
|
-
const defaultStalePatterns = normalizeLifecyclePatternList(DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS);
|
|
542
|
-
const defaultClosureLikePatterns = {
|
|
543
|
-
blocked_reason: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.blocked_reason),
|
|
544
|
-
resolution: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.resolution),
|
|
545
|
-
actual_result: normalizeLifecyclePatternList(DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS.actual_result)
|
|
546
|
-
};
|
|
547
|
-
const staleBlockerReasonPatterns = normalizeLifecyclePatternList(settings.validation.lifecycle_stale_blocker_reason_patterns);
|
|
548
|
-
const closureLikePatterns = {
|
|
549
|
-
blocked_reason: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_blocked_reason_patterns),
|
|
550
|
-
resolution: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_resolution_patterns),
|
|
551
|
-
actual_result: normalizeLifecyclePatternList(settings.validation.lifecycle_closure_like_actual_result_patterns)
|
|
552
|
-
};
|
|
553
|
-
return {
|
|
554
|
-
stale_blocker_reason_patterns: staleBlockerReasonPatterns,
|
|
555
|
-
stale_blocker_reason_pattern_source: areSortedStringListsEqual(staleBlockerReasonPatterns, defaultStalePatterns) ? "default" : "settings",
|
|
556
|
-
closure_like_metadata_field_patterns: closureLikePatterns,
|
|
557
|
-
closure_like_metadata_field_pattern_sources: {
|
|
558
|
-
blocked_reason: areSortedStringListsEqual(closureLikePatterns.blocked_reason, defaultClosureLikePatterns.blocked_reason) ? "default" : "settings",
|
|
559
|
-
resolution: areSortedStringListsEqual(closureLikePatterns.resolution, defaultClosureLikePatterns.resolution) ? "default" : "settings",
|
|
560
|
-
actual_result: areSortedStringListsEqual(closureLikePatterns.actual_result, defaultClosureLikePatterns.actual_result) ? "default" : "settings"
|
|
561
|
-
}
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
function resolveValidateMetadataProfile(value) {
|
|
565
|
-
const normalized = value?.trim().toLowerCase();
|
|
566
|
-
if (!normalized || normalized.length === 0) {
|
|
567
|
-
return "core";
|
|
568
|
-
}
|
|
569
|
-
if (VALIDATE_METADATA_PROFILE_VALUES.includes(normalized)) {
|
|
570
|
-
return normalized;
|
|
571
|
-
}
|
|
572
|
-
throw new PmCliError(`Unknown --metadata-profile value "${value}". Supported values: ${VALIDATE_METADATA_PROFILE_VALUES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
573
|
-
}
|
|
574
|
-
function resolveDependencyCycleSeverity(value) {
|
|
575
|
-
const normalized = value?.trim().toLowerCase();
|
|
576
|
-
if (!normalized || normalized.length === 0) {
|
|
577
|
-
return "warn";
|
|
578
|
-
}
|
|
579
|
-
if (VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES.includes(normalized)) {
|
|
580
|
-
return normalized;
|
|
581
|
-
}
|
|
582
|
-
throw new PmCliError(`Unknown --dependency-cycle-severity value "${value}". Supported values: ${VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
583
|
-
}
|
|
584
|
-
function resolveParentCycleSeverity(value) {
|
|
585
|
-
const normalized = value?.trim().toLowerCase();
|
|
586
|
-
if (!normalized || normalized.length === 0) {
|
|
587
|
-
return "warn";
|
|
588
|
-
}
|
|
589
|
-
if (VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES.includes(normalized)) {
|
|
590
|
-
return normalized;
|
|
591
|
-
}
|
|
592
|
-
throw new PmCliError(`Unknown --parent-cycle-severity value "${value}". Supported values: ${VALIDATE_DEPENDENCY_CYCLE_SEVERITY_VALUES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
593
|
-
}
|
|
594
|
-
function normalizeMetadataRequiredFieldsFromSettings(values) {
|
|
595
|
-
const normalized = [...new Set((values ?? []).map((value) => value.trim().toLowerCase().replaceAll("-", "_")))];
|
|
596
|
-
return normalized.map((value) => METADATA_REQUIRED_FIELD_ALIASES[value]).filter((value) => value !== void 0).sort((left, right) => left.localeCompare(right));
|
|
597
|
-
}
|
|
598
|
-
function resolveValidateMetadataPolicy(profile, profileSource, configuredCustomFields) {
|
|
599
|
-
const normalizedCustomFields = normalizeMetadataRequiredFieldsFromSettings(configuredCustomFields);
|
|
600
|
-
if (profile === "core") {
|
|
601
|
-
return {
|
|
602
|
-
profile,
|
|
603
|
-
profile_source: profileSource,
|
|
604
|
-
required_fields: [...CORE_METADATA_REQUIRED_FIELDS],
|
|
605
|
-
configured_custom_fields: normalizedCustomFields,
|
|
606
|
-
fallback_to_core: false,
|
|
607
|
-
warnings: []
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
if (profile === "strict") {
|
|
611
|
-
return {
|
|
612
|
-
profile,
|
|
613
|
-
profile_source: profileSource,
|
|
614
|
-
required_fields: [...STRICT_METADATA_REQUIRED_FIELDS],
|
|
615
|
-
configured_custom_fields: normalizedCustomFields,
|
|
616
|
-
fallback_to_core: false,
|
|
617
|
-
warnings: []
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
if (normalizedCustomFields.length > 0) {
|
|
621
|
-
return {
|
|
622
|
-
profile,
|
|
623
|
-
profile_source: profileSource,
|
|
624
|
-
required_fields: normalizedCustomFields,
|
|
625
|
-
configured_custom_fields: normalizedCustomFields,
|
|
626
|
-
fallback_to_core: false,
|
|
627
|
-
warnings: []
|
|
628
|
-
};
|
|
629
|
-
}
|
|
630
|
-
return {
|
|
631
|
-
profile,
|
|
632
|
-
profile_source: profileSource,
|
|
633
|
-
required_fields: [...CORE_METADATA_REQUIRED_FIELDS],
|
|
634
|
-
configured_custom_fields: normalizedCustomFields,
|
|
635
|
-
fallback_to_core: true,
|
|
636
|
-
warnings: ["validate_metadata_custom_profile_missing_required_fields:0"]
|
|
637
|
-
};
|
|
638
|
-
}
|
|
639
|
-
var TERMINAL_EXEMPT_PLANNING_FIELDS = /* @__PURE__ */ new Set([
|
|
640
|
-
"acceptance_criteria",
|
|
641
|
-
"estimated_minutes"
|
|
642
|
-
]);
|
|
643
|
-
function isMetadataFieldMissing(item, field, statusRegistry, enforcePlanningFieldsOnTerminal) {
|
|
644
|
-
if (!enforcePlanningFieldsOnTerminal && TERMINAL_EXEMPT_PLANNING_FIELDS.has(field) && isTerminalStatus(item.status, statusRegistry)) {
|
|
645
|
-
return false;
|
|
646
|
-
}
|
|
647
|
-
if (field === "author") {
|
|
648
|
-
return !toNonEmptyStringOrUndefined(item.author);
|
|
649
|
-
}
|
|
650
|
-
if (field === "acceptance_criteria") {
|
|
651
|
-
return !toNonEmptyStringOrUndefined(item.acceptance_criteria);
|
|
652
|
-
}
|
|
653
|
-
if (field === "estimated_minutes") {
|
|
654
|
-
return !Number.isFinite(item.estimated_minutes);
|
|
655
|
-
}
|
|
656
|
-
if (field === "close_reason") {
|
|
657
|
-
return normalizeStatusForRegistry(item.status, statusRegistry) === statusRegistry.close_status && !toNonEmptyStringOrUndefined(item.close_reason);
|
|
658
|
-
}
|
|
659
|
-
if (field === "reviewer") {
|
|
660
|
-
return !toNonEmptyStringOrUndefined(item.reviewer);
|
|
661
|
-
}
|
|
662
|
-
if (field === "risk") {
|
|
663
|
-
return !toNonEmptyStringOrUndefined(item.risk);
|
|
664
|
-
}
|
|
665
|
-
if (field === "confidence") {
|
|
666
|
-
if (typeof item.confidence === "number") {
|
|
667
|
-
return !Number.isFinite(item.confidence);
|
|
668
|
-
}
|
|
669
|
-
return !toNonEmptyStringOrUndefined(item.confidence);
|
|
670
|
-
}
|
|
671
|
-
if (field === "sprint") {
|
|
672
|
-
return !toNonEmptyStringOrUndefined(item.sprint);
|
|
673
|
-
}
|
|
674
|
-
return !toNonEmptyStringOrUndefined(item.release);
|
|
675
|
-
}
|
|
676
|
-
function resolveFileScanMode(scanMode) {
|
|
677
|
-
if (scanMode === void 0) {
|
|
678
|
-
return "default";
|
|
679
|
-
}
|
|
680
|
-
const normalized = scanMode.trim().toLowerCase();
|
|
681
|
-
if (normalized.length === 0) {
|
|
682
|
-
return "default";
|
|
683
|
-
}
|
|
684
|
-
if (normalized === "default") {
|
|
685
|
-
return "default";
|
|
686
|
-
}
|
|
687
|
-
if (normalized === "tracked-all" || normalized === "tracked_all") {
|
|
688
|
-
return "tracked-all";
|
|
689
|
-
}
|
|
690
|
-
if (normalized === "tracked-all-strict" || normalized === "tracked_all_strict") {
|
|
691
|
-
return "tracked-all-strict";
|
|
692
|
-
}
|
|
693
|
-
throw new PmCliError(`Unknown --scan-mode value "${scanMode}". Supported values: ${VALIDATE_FILE_SCAN_MODES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
694
|
-
}
|
|
695
|
-
function resolveWorkspaceRoot(pmRoot) {
|
|
696
|
-
const resolvedPmRoot = path.resolve(pmRoot);
|
|
697
|
-
const normalizedPmRoot = resolvedPmRoot.replaceAll("\\", "/");
|
|
698
|
-
if (normalizedPmRoot.endsWith("/.agents/pm")) {
|
|
699
|
-
return path.dirname(path.dirname(resolvedPmRoot));
|
|
700
|
-
}
|
|
701
|
-
const resolvedCwd = path.resolve(process.cwd());
|
|
702
|
-
const canonicalPmRoot = realpathForWorkspaceRoot(resolvedPmRoot);
|
|
703
|
-
const canonicalCwd = realpathForWorkspaceRoot(resolvedCwd);
|
|
704
|
-
const relativeFromPmRoot = path.relative(canonicalPmRoot, canonicalCwd);
|
|
705
|
-
const cwdInsidePmRoot = relativeFromPmRoot.length === 0 || !relativeFromPmRoot.startsWith("..") && !path.isAbsolute(relativeFromPmRoot);
|
|
706
|
-
if (cwdInsidePmRoot) {
|
|
707
|
-
return resolvedPmRoot;
|
|
708
|
-
}
|
|
709
|
-
return resolvedCwd;
|
|
710
|
-
}
|
|
711
|
-
function realpathForWorkspaceRoot(inputPath) {
|
|
712
|
-
try {
|
|
713
|
-
return realpathSync.native(inputPath);
|
|
714
|
-
} catch {
|
|
715
|
-
return path.resolve(inputPath);
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
async function listFilesRecursive(basePath, relativePath, output) {
|
|
719
|
-
const targetDirectory = relativePath.length > 0 ? path.join(basePath, relativePath) : basePath;
|
|
720
|
-
let entries;
|
|
721
|
-
try {
|
|
722
|
-
entries = await fs.readdir(targetDirectory, { withFileTypes: true });
|
|
723
|
-
} catch (error) {
|
|
724
|
-
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
throw error;
|
|
728
|
-
}
|
|
729
|
-
for (const entry of entries) {
|
|
730
|
-
if (entry.name.startsWith(".")) {
|
|
731
|
-
continue;
|
|
732
|
-
}
|
|
733
|
-
const childRelative = relativePath.length > 0 ? path.join(relativePath, entry.name) : entry.name;
|
|
734
|
-
if (entry.isDirectory()) {
|
|
735
|
-
if (DIRECTORY_IGNORE_SET.has(entry.name)) {
|
|
736
|
-
continue;
|
|
737
|
-
}
|
|
738
|
-
await listFilesRecursive(basePath, childRelative, output);
|
|
739
|
-
continue;
|
|
740
|
-
}
|
|
741
|
-
if (!entry.isFile()) {
|
|
742
|
-
continue;
|
|
743
|
-
}
|
|
744
|
-
output.push(normalizeRelativePath(childRelative));
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
async function collectDefaultProjectFileCandidates(workspaceRoot) {
|
|
748
|
-
const discovered = [];
|
|
749
|
-
for (const directory of FILE_SCAN_DIRECTORIES) {
|
|
750
|
-
await listFilesRecursive(workspaceRoot, directory, discovered);
|
|
751
|
-
}
|
|
752
|
-
for (const candidate of FILE_SCAN_ROOT_FILES) {
|
|
753
|
-
const absolute = path.join(workspaceRoot, candidate);
|
|
754
|
-
try {
|
|
755
|
-
const stats = await fs.stat(absolute);
|
|
756
|
-
if (stats.isFile()) {
|
|
757
|
-
discovered.push(normalizeRelativePath(candidate));
|
|
758
|
-
}
|
|
759
|
-
} catch {
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
return [...new Set(discovered)].sort((left, right) => left.localeCompare(right));
|
|
763
|
-
}
|
|
764
|
-
async function collectTrackedGitFileCandidates(workspaceRoot) {
|
|
765
|
-
try {
|
|
766
|
-
const { stdout } = await execFileAsync("git", ["ls-files", "-z"], {
|
|
767
|
-
cwd: workspaceRoot,
|
|
768
|
-
encoding: "utf8",
|
|
769
|
-
maxBuffer: GIT_LS_FILES_MAX_BUFFER,
|
|
770
|
-
windowsHide: true
|
|
771
|
-
});
|
|
772
|
-
const discovered = stdout.split("\0").map((value) => normalizeRelativePath(value)).filter((value) => value.length > 0);
|
|
773
|
-
return [...new Set(discovered)].sort((left, right) => left.localeCompare(right));
|
|
774
|
-
} catch {
|
|
775
|
-
return null;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
function resolvePmInternalCandidatePrefixes(pmRoot, workspaceRoot) {
|
|
779
|
-
const prefixes = /* @__PURE__ */ new Set();
|
|
780
|
-
const configuredDefault = normalizeRelativeDirectoryPath(PM_DIRNAME);
|
|
781
|
-
if (configuredDefault.length > 0) {
|
|
782
|
-
prefixes.add(configuredDefault);
|
|
783
|
-
}
|
|
784
|
-
const relativePmRoot = normalizeRelativeDirectoryPath(path.relative(workspaceRoot, pmRoot));
|
|
785
|
-
if (relativePmRoot.length > 0 && !relativePmRoot.startsWith("..")) {
|
|
786
|
-
prefixes.add(relativePmRoot);
|
|
787
|
-
}
|
|
788
|
-
return [...prefixes].sort((left, right) => left.localeCompare(right));
|
|
789
|
-
}
|
|
790
|
-
function hasPathPrefix(candidate, prefixes) {
|
|
791
|
-
for (const prefix of prefixes) {
|
|
792
|
-
if (candidate === prefix || candidate.startsWith(`${prefix}/`)) {
|
|
793
|
-
return true;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
return false;
|
|
797
|
-
}
|
|
798
|
-
async function collectProjectFileCandidates(workspaceRoot, scanMode) {
|
|
799
|
-
if (scanMode === "tracked-all" || scanMode === "tracked-all-strict") {
|
|
800
|
-
const trackedCandidates = await collectTrackedGitFileCandidates(workspaceRoot);
|
|
801
|
-
if (trackedCandidates) {
|
|
802
|
-
return {
|
|
803
|
-
requestedMode: scanMode,
|
|
804
|
-
appliedMode: scanMode,
|
|
805
|
-
source: "tracked-git",
|
|
806
|
-
candidateFiles: trackedCandidates,
|
|
807
|
-
candidateTotal: trackedCandidates.length,
|
|
808
|
-
candidateScanned: trackedCandidates.length
|
|
809
|
-
};
|
|
810
|
-
}
|
|
811
|
-
const fallbackCandidates = await collectDefaultProjectFileCandidates(workspaceRoot);
|
|
812
|
-
return {
|
|
813
|
-
requestedMode: scanMode,
|
|
814
|
-
appliedMode: "default",
|
|
815
|
-
source: "tracked-all-fallback-default",
|
|
816
|
-
candidateFiles: fallbackCandidates,
|
|
817
|
-
candidateTotal: fallbackCandidates.length,
|
|
818
|
-
candidateScanned: fallbackCandidates.length
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
const defaultCandidates = await collectDefaultProjectFileCandidates(workspaceRoot);
|
|
822
|
-
return {
|
|
823
|
-
requestedMode: scanMode,
|
|
824
|
-
appliedMode: "default",
|
|
825
|
-
source: "default-curated",
|
|
826
|
-
candidateFiles: defaultCandidates,
|
|
827
|
-
candidateTotal: defaultCandidates.length,
|
|
828
|
-
candidateScanned: defaultCandidates.length
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
function summarizeList(values, limit = DIAGNOSTIC_LIST_SUMMARY_LIMIT) {
|
|
832
|
-
if (values.length <= limit) {
|
|
833
|
-
return { values, truncated: false };
|
|
834
|
-
}
|
|
835
|
-
return {
|
|
836
|
-
values: values.slice(0, limit),
|
|
837
|
-
truncated: true
|
|
838
|
-
};
|
|
839
|
-
}
|
|
840
|
-
function summarizeFileList(values, verboseFileLists) {
|
|
841
|
-
if (verboseFileLists) {
|
|
842
|
-
return {
|
|
843
|
-
values,
|
|
844
|
-
truncated: false,
|
|
845
|
-
total: values.length
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
const summary = summarizeList(values, FILE_LIST_SUMMARY_LIMIT);
|
|
849
|
-
return {
|
|
850
|
-
values: summary.values,
|
|
851
|
-
truncated: summary.truncated,
|
|
852
|
-
total: values.length
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
var RESOLUTION_REMEDIATION_FLAG_BY_FIELD = {
|
|
856
|
-
resolution: "--resolution",
|
|
857
|
-
expected_result: "--expected-result",
|
|
858
|
-
actual_result: "--actual-result"
|
|
859
|
-
};
|
|
860
|
-
var RESOLUTION_REMEDIATION_PLACEHOLDER_BY_FIELD = {
|
|
861
|
-
resolution: "Describe how this item was resolved",
|
|
862
|
-
expected_result: "Describe the expected result",
|
|
863
|
-
actual_result: "Describe the actual result"
|
|
864
|
-
};
|
|
865
|
-
function buildResolutionRemediationCommand(row) {
|
|
866
|
-
const fieldArguments = row.missing_fields.map((field) => `${RESOLUTION_REMEDIATION_FLAG_BY_FIELD[field]} "${RESOLUTION_REMEDIATION_PLACEHOLDER_BY_FIELD[field]}"`).join(" ");
|
|
867
|
-
return `pm update ${row.id} ${fieldArguments} --message "Backfill resolution metadata"`;
|
|
868
|
-
}
|
|
869
|
-
function attachValidateFixHints(check, checkWarnings) {
|
|
870
|
-
const existingResolutionHints = check.details?.missing_resolution_remediation_hints;
|
|
871
|
-
const aliasedResolution = Array.isArray(existingResolutionHints) && existingResolutionHints.length > 0;
|
|
872
|
-
const fixHints = aliasedResolution ? existingResolutionHints.filter((hint) => typeof hint === "string") : buildRemediationCommands(checkWarnings);
|
|
873
|
-
if (fixHints.length === 0) {
|
|
874
|
-
return;
|
|
875
|
-
}
|
|
876
|
-
const truncated = aliasedResolution && check.details?.missing_resolution_remediation_hints_truncated === true;
|
|
877
|
-
check.details = {
|
|
878
|
-
...check.details,
|
|
879
|
-
fix_hints: fixHints,
|
|
880
|
-
...truncated ? { fix_hints_truncated: true } : {}
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
function resolveRequestedChecks(options) {
|
|
884
|
-
const requested = /* @__PURE__ */ new Set();
|
|
885
|
-
if (options.checkMetadata) {
|
|
886
|
-
requested.add("metadata");
|
|
887
|
-
}
|
|
888
|
-
if (options.checkResolution) {
|
|
889
|
-
requested.add("resolution");
|
|
890
|
-
}
|
|
891
|
-
if (options.checkLifecycle || options.checkStaleBlockers) {
|
|
892
|
-
requested.add("lifecycle");
|
|
893
|
-
}
|
|
894
|
-
if (options.checkFiles) {
|
|
895
|
-
requested.add("files");
|
|
896
|
-
}
|
|
897
|
-
if (options.checkHistoryDrift) {
|
|
898
|
-
requested.add("history_drift");
|
|
899
|
-
}
|
|
900
|
-
if (options.checkCommandReferences) {
|
|
901
|
-
requested.add("command_references");
|
|
902
|
-
}
|
|
903
|
-
if (requested.size === 0) {
|
|
904
|
-
if (options.autoFix) {
|
|
905
|
-
requested.add("metadata");
|
|
906
|
-
requested.add("resolution");
|
|
907
|
-
requested.add("lifecycle");
|
|
908
|
-
}
|
|
909
|
-
if (options.pruneMissing) {
|
|
910
|
-
requested.add("files");
|
|
911
|
-
}
|
|
912
|
-
if (requested.size === 0) {
|
|
913
|
-
requested.add("metadata");
|
|
914
|
-
requested.add("resolution");
|
|
915
|
-
requested.add("lifecycle");
|
|
916
|
-
requested.add("files");
|
|
917
|
-
requested.add("command_references");
|
|
918
|
-
requested.add("history_drift");
|
|
919
|
-
requested.add("format_version");
|
|
920
|
-
}
|
|
921
|
-
return requested;
|
|
922
|
-
}
|
|
923
|
-
if (options.pruneMissing) {
|
|
924
|
-
requested.add("files");
|
|
925
|
-
}
|
|
926
|
-
return requested;
|
|
927
|
-
}
|
|
928
|
-
var DUPLICATE_ISSUE_CODE_WARNING_TOKEN = "validate_metadata_duplicate_issue_codes";
|
|
929
|
-
function summarizeDuplicateIssueCodes(duplicates, verboseDiagnostics) {
|
|
930
|
-
if (duplicates.length === 0) {
|
|
931
|
-
return { rows: [], truncated: false, warnings: [] };
|
|
932
|
-
}
|
|
933
|
-
const limit = verboseDiagnostics ? duplicates.length : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
934
|
-
const shown = duplicates.slice(0, limit);
|
|
935
|
-
const rows = shown.map((duplicate) => ({
|
|
936
|
-
code: duplicate.code,
|
|
937
|
-
count: duplicate.count,
|
|
938
|
-
ids: duplicate.ids,
|
|
939
|
-
titles: duplicate.titles,
|
|
940
|
-
remediation_hint: `Items ${duplicate.ids.join(", ")} share issue code "${duplicate.code}"; rename or merge so each logical code maps to one item.`
|
|
941
|
-
}));
|
|
942
|
-
return {
|
|
943
|
-
rows,
|
|
944
|
-
truncated: shown.length < duplicates.length,
|
|
945
|
-
warnings: [`${DUPLICATE_ISSUE_CODE_WARNING_TOKEN}:${duplicates.length}`]
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
function initializeMissingMetadataByField() {
|
|
949
|
-
return Object.fromEntries(SUPPORTED_METADATA_REQUIRED_FIELDS.map((field) => [field, []]));
|
|
950
|
-
}
|
|
951
|
-
function collectMissingMetadataByField(items, statusRegistry, enforcePlanningFieldsOnTerminal) {
|
|
952
|
-
const missingByField = initializeMissingMetadataByField();
|
|
953
|
-
for (const item of items) {
|
|
954
|
-
for (const field of SUPPORTED_METADATA_REQUIRED_FIELDS) {
|
|
955
|
-
if (isMetadataFieldMissing(item, field, statusRegistry, enforcePlanningFieldsOnTerminal)) {
|
|
956
|
-
missingByField[field].push(item.id);
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
return missingByField;
|
|
961
|
-
}
|
|
962
|
-
function buildMetadataWarningTokens(metadataPolicy, missingByField, duplicateWarnings) {
|
|
963
|
-
const warningTokens = [...metadataPolicy.warnings];
|
|
964
|
-
for (const field of metadataPolicy.required_fields) {
|
|
965
|
-
const missingItems = missingByField[field];
|
|
966
|
-
if (missingItems.length > 0) {
|
|
967
|
-
warningTokens.push(`${METADATA_WARNING_TOKEN_BY_FIELD[field]}:${missingItems.length}`);
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
warningTokens.push(...duplicateWarnings);
|
|
971
|
-
return warningTokens;
|
|
972
|
-
}
|
|
973
|
-
function buildMetadataCounts(metadataPolicy, missingByField) {
|
|
974
|
-
const counts = {};
|
|
975
|
-
for (const field of metadataPolicy.required_fields) {
|
|
976
|
-
const missing = missingByField[field];
|
|
977
|
-
const value = missing ? missing.length : 0;
|
|
978
|
-
const countKey = METADATA_COUNT_KEY_BY_FIELD[field];
|
|
979
|
-
if (value > 0 && countKey) {
|
|
980
|
-
counts[countKey] = value;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
return counts;
|
|
984
|
-
}
|
|
985
|
-
function buildMissingFieldOccurrences(metadataPolicy, missingByField, itemsById) {
|
|
986
|
-
const occurrences = [];
|
|
987
|
-
for (const field of metadataPolicy.required_fields) {
|
|
988
|
-
const missing = missingByField[field];
|
|
989
|
-
if (!missing) {
|
|
990
|
-
continue;
|
|
991
|
-
}
|
|
992
|
-
for (const itemId of missing) {
|
|
993
|
-
const itemType = itemsById.get(itemId)?.type;
|
|
994
|
-
const normalizedItemType = typeof itemType === "string" && itemType.length > 0 ? itemType : "Unknown";
|
|
995
|
-
occurrences.push({ item_type: normalizedItemType, field });
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
return occurrences;
|
|
999
|
-
}
|
|
1000
|
-
function attachMissingMetadataItemIds(details, metadataPolicy, missingByField, verboseDiagnostics) {
|
|
1001
|
-
for (const field of metadataPolicy.required_fields) {
|
|
1002
|
-
const missing = missingByField[field];
|
|
1003
|
-
if (!missing || missing.length === 0) {
|
|
1004
|
-
continue;
|
|
1005
|
-
}
|
|
1006
|
-
const idsKey = METADATA_ITEM_IDS_KEY_BY_FIELD[field];
|
|
1007
|
-
const truncatedKey = METADATA_TRUNCATED_KEY_BY_FIELD[field];
|
|
1008
|
-
if (!idsKey || !truncatedKey) {
|
|
1009
|
-
continue;
|
|
1010
|
-
}
|
|
1011
|
-
const summarized = summarizeList(missing, verboseDiagnostics ? missing.length : DIAGNOSTIC_LIST_SUMMARY_LIMIT);
|
|
1012
|
-
details[idsKey] = summarized.values;
|
|
1013
|
-
details[truncatedKey] = summarized.truncated;
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
function buildCloseReasonBackfillRows(metadataPolicy, missingByField, itemsById) {
|
|
1017
|
-
if (!metadataPolicy.required_fields.includes("close_reason")) {
|
|
1018
|
-
return [];
|
|
1019
|
-
}
|
|
1020
|
-
const missing = missingByField.close_reason;
|
|
1021
|
-
if (!missing) {
|
|
1022
|
-
return [];
|
|
1023
|
-
}
|
|
1024
|
-
return missing.map((itemId) => ({
|
|
1025
|
-
id: itemId,
|
|
1026
|
-
resolution: toNonEmptyStringOrUndefined(itemsById.get(itemId)?.resolution)
|
|
1027
|
-
}));
|
|
1028
|
-
}
|
|
1029
|
-
function buildEstimateBackfillRows(metadataPolicy, missingByField, itemsById) {
|
|
1030
|
-
if (!metadataPolicy.required_fields.includes("estimated_minutes")) {
|
|
1031
|
-
return [];
|
|
1032
|
-
}
|
|
1033
|
-
const missing = missingByField.estimated_minutes;
|
|
1034
|
-
if (!missing) {
|
|
1035
|
-
return [];
|
|
1036
|
-
}
|
|
1037
|
-
return missing.map((itemId) => ({
|
|
1038
|
-
id: itemId,
|
|
1039
|
-
type: toNonEmptyStringOrUndefined(itemsById.get(itemId)?.type)
|
|
1040
|
-
}));
|
|
1041
|
-
}
|
|
1042
|
-
function buildMetadataCheck(items, metadataPolicy, statusRegistry, verboseDiagnostics) {
|
|
1043
|
-
const itemsById = new Map(items.map((item) => [item.id, item]));
|
|
1044
|
-
const enforcePlanningFieldsOnTerminal = metadataPolicy.profile === "strict";
|
|
1045
|
-
const missingByField = collectMissingMetadataByField(items, statusRegistry, enforcePlanningFieldsOnTerminal);
|
|
1046
|
-
const duplicateIssueCodes = findDuplicateIssueCodes(items);
|
|
1047
|
-
const duplicateIssueCodeSummary = summarizeDuplicateIssueCodes(duplicateIssueCodes, verboseDiagnostics);
|
|
1048
|
-
const warningTokens = buildMetadataWarningTokens(metadataPolicy, missingByField, duplicateIssueCodeSummary.warnings);
|
|
1049
|
-
const counts = buildMetadataCounts(metadataPolicy, missingByField);
|
|
1050
|
-
const missingFieldOccurrences = buildMissingFieldOccurrences(metadataPolicy, missingByField, itemsById);
|
|
1051
|
-
const missingByType = buildMissingByTypeCounts(missingFieldOccurrences);
|
|
1052
|
-
const details = {
|
|
1053
|
-
checked_items: items.length,
|
|
1054
|
-
metadata_profile: metadataPolicy.profile,
|
|
1055
|
-
metadata_profile_source: metadataPolicy.profile_source,
|
|
1056
|
-
metadata_profile_fallback_to_core: metadataPolicy.fallback_to_core,
|
|
1057
|
-
required_fields: [...metadataPolicy.required_fields],
|
|
1058
|
-
supported_required_fields: [...SUPPORTED_METADATA_REQUIRED_FIELDS],
|
|
1059
|
-
counts,
|
|
1060
|
-
missing_by_type: missingByType,
|
|
1061
|
-
duplicate_issue_codes_count: duplicateIssueCodes.length,
|
|
1062
|
-
duplicate_issue_codes: duplicateIssueCodeSummary.rows,
|
|
1063
|
-
duplicate_issue_codes_truncated: duplicateIssueCodeSummary.truncated
|
|
1064
|
-
};
|
|
1065
|
-
if (metadataPolicy.configured_custom_fields.length > 0) {
|
|
1066
|
-
details.configured_custom_required_fields = [...metadataPolicy.configured_custom_fields];
|
|
1067
|
-
}
|
|
1068
|
-
attachMissingMetadataItemIds(details, metadataPolicy, missingByField, verboseDiagnostics);
|
|
1069
|
-
const closeReasonBackfillRows = buildCloseReasonBackfillRows(metadataPolicy, missingByField, itemsById);
|
|
1070
|
-
const estimateBackfillRows = buildEstimateBackfillRows(metadataPolicy, missingByField, itemsById);
|
|
1071
|
-
return {
|
|
1072
|
-
check: {
|
|
1073
|
-
name: "metadata",
|
|
1074
|
-
status: warningTokens.length === 0 ? "ok" : "warn",
|
|
1075
|
-
details
|
|
1076
|
-
},
|
|
1077
|
-
warnings: warningTokens,
|
|
1078
|
-
closeReasonBackfillRows,
|
|
1079
|
-
estimateBackfillRows
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
function buildResolutionCheck(items, statusRegistry, verboseDiagnostics) {
|
|
1083
|
-
const terminalDoneStatuses = new Set(statusRegistry.terminal_done_statuses);
|
|
1084
|
-
terminalDoneStatuses.add(statusRegistry.close_status);
|
|
1085
|
-
const closedItems = items.filter((item) => terminalDoneStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
|
|
1086
|
-
const missingResolutionRows = [];
|
|
1087
|
-
const resolutionBackfillRows = [];
|
|
1088
|
-
for (const item of closedItems) {
|
|
1089
|
-
const missingFields = RESOLUTION_FIELD_KEYS.filter((field) => !toNonEmptyStringOrUndefined(item[field]));
|
|
1090
|
-
if (missingFields.length === 0) {
|
|
1091
|
-
continue;
|
|
1092
|
-
}
|
|
1093
|
-
missingResolutionRows.push({
|
|
1094
|
-
id: item.id,
|
|
1095
|
-
missing_fields: missingFields
|
|
1096
|
-
});
|
|
1097
|
-
resolutionBackfillRows.push({
|
|
1098
|
-
id: item.id,
|
|
1099
|
-
missing_fields: missingFields,
|
|
1100
|
-
close_reason: toNonEmptyStringOrUndefined(item.close_reason)
|
|
1101
|
-
});
|
|
1102
|
-
}
|
|
1103
|
-
const warnings = missingResolutionRows.length > 0 ? [`validate_resolution_missing_fields:${missingResolutionRows.length}`] : [];
|
|
1104
|
-
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
1105
|
-
const summarizedRows = summarizeList(missingResolutionRows.map((row) => `${row.id}:${row.missing_fields.join(",")}`), diagnosticLimit);
|
|
1106
|
-
const remediationHints = missingResolutionRows.map((row) => buildResolutionRemediationCommand(row));
|
|
1107
|
-
const summarizedHints = summarizeList(remediationHints, diagnosticLimit);
|
|
1108
|
-
return {
|
|
1109
|
-
check: {
|
|
1110
|
-
name: "resolution",
|
|
1111
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1112
|
-
details: {
|
|
1113
|
-
checked_closed_items: closedItems.length,
|
|
1114
|
-
missing_resolution_items: missingResolutionRows.length,
|
|
1115
|
-
missing_resolution_rows: summarizedRows.values,
|
|
1116
|
-
missing_resolution_rows_truncated: summarizedRows.truncated,
|
|
1117
|
-
missing_resolution_remediation_hints: summarizedHints.values,
|
|
1118
|
-
missing_resolution_remediation_hints_truncated: summarizedHints.truncated
|
|
1119
|
-
}
|
|
1120
|
-
},
|
|
1121
|
-
warnings,
|
|
1122
|
-
resolutionBackfillRows
|
|
1123
|
-
};
|
|
1124
|
-
}
|
|
1125
|
-
function escapeRegExp(value) {
|
|
1126
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1127
|
-
}
|
|
1128
|
-
function buildLifecycleDependencyGraph(activeItems, idPrefix = "pm") {
|
|
1129
|
-
const activeItemIds = new Set(activeItems.map((item) => item.id));
|
|
1130
|
-
const graph = /* @__PURE__ */ new Map();
|
|
1131
|
-
const sortedItems = [...activeItems].sort((left, right) => left.id.localeCompare(right.id));
|
|
1132
|
-
for (const item of sortedItems) {
|
|
1133
|
-
const edges = /* @__PURE__ */ new Set();
|
|
1134
|
-
const blockedBy = toMeaningfulString(item.blocked_by);
|
|
1135
|
-
if (blockedBy && activeItemIds.has(blockedBy)) {
|
|
1136
|
-
edges.add(blockedBy);
|
|
1137
|
-
}
|
|
1138
|
-
for (const dependency of item.dependencies ?? []) {
|
|
1139
|
-
const dependencyId = toMeaningfulString(dependency.id);
|
|
1140
|
-
if (!dependencyId || !activeItemIds.has(dependencyId)) {
|
|
1141
|
-
continue;
|
|
1142
|
-
}
|
|
1143
|
-
edges.add(dependencyId);
|
|
1144
|
-
}
|
|
1145
|
-
const definitionOfReady = toMeaningfulString(item.definition_of_ready);
|
|
1146
|
-
if (definitionOfReady) {
|
|
1147
|
-
for (const referencedId of extractItemIds(definitionOfReady, idPrefix)) {
|
|
1148
|
-
if (activeItemIds.has(referencedId)) {
|
|
1149
|
-
edges.add(referencedId);
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
graph.set(item.id, [...edges].sort((left, right) => left.localeCompare(right)));
|
|
1154
|
-
}
|
|
1155
|
-
return graph;
|
|
1156
|
-
}
|
|
1157
|
-
function extractItemIds(value, idPrefix = "pm") {
|
|
1158
|
-
const normalizedPrefix = (idPrefix.trim().toLowerCase() || "pm").replace(/-+$/g, "");
|
|
1159
|
-
const pattern = new RegExp(`(?:^|[^a-z0-9-])(${escapeRegExp(normalizedPrefix)}-[a-z0-9][a-z0-9-]*)`, "gi");
|
|
1160
|
-
return [...new Set([...value.matchAll(pattern)].map((match) => match[1].toLowerCase()))].sort((left, right) => left.localeCompare(right));
|
|
1161
|
-
}
|
|
1162
|
-
function findLifecycleDependencyCycleComponents(graph) {
|
|
1163
|
-
let nextIndex = 0;
|
|
1164
|
-
const indexById = /* @__PURE__ */ new Map();
|
|
1165
|
-
const lowLinkById = /* @__PURE__ */ new Map();
|
|
1166
|
-
const stack = [];
|
|
1167
|
-
const inStack = /* @__PURE__ */ new Set();
|
|
1168
|
-
const components = [];
|
|
1169
|
-
const visit = (id) => {
|
|
1170
|
-
indexById.set(id, nextIndex);
|
|
1171
|
-
lowLinkById.set(id, nextIndex);
|
|
1172
|
-
nextIndex += 1;
|
|
1173
|
-
stack.push(id);
|
|
1174
|
-
inStack.add(id);
|
|
1175
|
-
for (const dependencyId of graph.get(id) ?? []) {
|
|
1176
|
-
if (!indexById.has(dependencyId)) {
|
|
1177
|
-
visit(dependencyId);
|
|
1178
|
-
lowLinkById.set(id, Math.min(lowLinkById.get(id), lowLinkById.get(dependencyId)));
|
|
1179
|
-
} else if (inStack.has(dependencyId)) {
|
|
1180
|
-
lowLinkById.set(id, Math.min(lowLinkById.get(id), indexById.get(dependencyId)));
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
if (lowLinkById.get(id) !== indexById.get(id)) {
|
|
1184
|
-
return;
|
|
1185
|
-
}
|
|
1186
|
-
const component = [];
|
|
1187
|
-
while (stack.length > 0) {
|
|
1188
|
-
const member = stack.pop();
|
|
1189
|
-
inStack.delete(member);
|
|
1190
|
-
component.push(member);
|
|
1191
|
-
if (member === id) {
|
|
1192
|
-
break;
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
component.sort((left, right) => left.localeCompare(right));
|
|
1196
|
-
components.push(component);
|
|
1197
|
-
};
|
|
1198
|
-
const sortedNodeIds = [...graph.keys()].sort((left, right) => left.localeCompare(right));
|
|
1199
|
-
for (const id of sortedNodeIds) {
|
|
1200
|
-
if (!indexById.has(id)) {
|
|
1201
|
-
visit(id);
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
const cycleComponents = components.filter((component) => {
|
|
1205
|
-
if (component.length > 1) {
|
|
1206
|
-
return true;
|
|
1207
|
-
}
|
|
1208
|
-
const selfId = component[0];
|
|
1209
|
-
return (graph.get(selfId) ?? []).includes(selfId);
|
|
1210
|
-
});
|
|
1211
|
-
return cycleComponents.sort((left, right) => left[0].localeCompare(right[0]) || left.length - right.length || left.join(",").localeCompare(right.join(",")));
|
|
1212
|
-
}
|
|
1213
|
-
function resolveLifecycleDependencyCycleSamplePath(component, graph) {
|
|
1214
|
-
const start = component[0];
|
|
1215
|
-
if (component.length === 1) {
|
|
1216
|
-
return [start, start];
|
|
1217
|
-
}
|
|
1218
|
-
const componentSet = new Set(component);
|
|
1219
|
-
const path2 = [start];
|
|
1220
|
-
const visited = /* @__PURE__ */ new Set([start]);
|
|
1221
|
-
const search = (current) => {
|
|
1222
|
-
const neighbors = (graph.get(current) ?? []).filter((candidate) => componentSet.has(candidate));
|
|
1223
|
-
for (const next of neighbors) {
|
|
1224
|
-
if (next === start && path2.length > 1) {
|
|
1225
|
-
path2.push(start);
|
|
1226
|
-
return true;
|
|
1227
|
-
}
|
|
1228
|
-
if (visited.has(next)) {
|
|
1229
|
-
continue;
|
|
1230
|
-
}
|
|
1231
|
-
visited.add(next);
|
|
1232
|
-
path2.push(next);
|
|
1233
|
-
if (search(next)) {
|
|
1234
|
-
return true;
|
|
1235
|
-
}
|
|
1236
|
-
path2.pop();
|
|
1237
|
-
visited.delete(next);
|
|
1238
|
-
}
|
|
1239
|
-
return false;
|
|
1240
|
-
};
|
|
1241
|
-
if (search(start)) {
|
|
1242
|
-
return [...path2];
|
|
1243
|
-
}
|
|
1244
|
-
return [...component, start];
|
|
1245
|
-
}
|
|
1246
|
-
function detectLifecycleDependencyCycles(activeItems, idPrefix = "pm") {
|
|
1247
|
-
const graph = buildLifecycleDependencyGraph(activeItems, idPrefix);
|
|
1248
|
-
const cycleComponents = findLifecycleDependencyCycleComponents(graph);
|
|
1249
|
-
const cycleItemIds = [...new Set(cycleComponents.flat())].sort((left, right) => left.localeCompare(right));
|
|
1250
|
-
const cycleSamplePaths = cycleComponents.map((component) => resolveLifecycleDependencyCycleSamplePath(component, graph).join("->"));
|
|
1251
|
-
return {
|
|
1252
|
-
cycle_count: cycleComponents.length,
|
|
1253
|
-
cycle_item_ids: cycleItemIds,
|
|
1254
|
-
cycle_sample_paths: cycleSamplePaths
|
|
1255
|
-
};
|
|
1256
|
-
}
|
|
1257
|
-
function buildLifecycleParentGraph(items) {
|
|
1258
|
-
const canonicalIdByLowercase = new Map(items.map((item) => [item.id.toLowerCase(), item.id]));
|
|
1259
|
-
const graph = /* @__PURE__ */ new Map();
|
|
1260
|
-
const sortedItems = [...items].sort((left, right) => left.id.localeCompare(right.id));
|
|
1261
|
-
for (const item of sortedItems) {
|
|
1262
|
-
const edges = [];
|
|
1263
|
-
const parentId = toMeaningfulString(item.parent);
|
|
1264
|
-
const canonicalParentId = parentId ? canonicalIdByLowercase.get(parentId.toLowerCase()) : void 0;
|
|
1265
|
-
if (canonicalParentId) {
|
|
1266
|
-
edges.push(canonicalParentId);
|
|
1267
|
-
}
|
|
1268
|
-
graph.set(item.id, edges);
|
|
1269
|
-
}
|
|
1270
|
-
return graph;
|
|
1271
|
-
}
|
|
1272
|
-
function detectLifecycleParentCycles(items) {
|
|
1273
|
-
const graph = buildLifecycleParentGraph(items);
|
|
1274
|
-
const cycleComponents = findLifecycleDependencyCycleComponents(graph);
|
|
1275
|
-
const cycleItemIds = [...new Set(cycleComponents.flat())].sort((left, right) => left.localeCompare(right));
|
|
1276
|
-
const cycleSamplePaths = cycleComponents.map((component) => resolveLifecycleDependencyCycleSamplePath(component, graph).join("->"));
|
|
1277
|
-
return {
|
|
1278
|
-
cycle_count: cycleComponents.length,
|
|
1279
|
-
cycle_item_ids: cycleItemIds,
|
|
1280
|
-
cycle_sample_paths: cycleSamplePaths
|
|
1281
|
-
};
|
|
1282
|
-
}
|
|
1283
|
-
function classifyOrphanedPath(pathValue) {
|
|
1284
|
-
if (pathValue.startsWith("docs/")) {
|
|
1285
|
-
return "docs_unowned";
|
|
1286
|
-
}
|
|
1287
|
-
if (pathValue.startsWith("tests/")) {
|
|
1288
|
-
return "tests_unowned";
|
|
1289
|
-
}
|
|
1290
|
-
if (pathValue.startsWith("src/")) {
|
|
1291
|
-
return "source_unowned";
|
|
1292
|
-
}
|
|
1293
|
-
if (pathValue.endsWith(".md")) {
|
|
1294
|
-
return "docs_unowned";
|
|
1295
|
-
}
|
|
1296
|
-
return "unlinked_existing";
|
|
1297
|
-
}
|
|
1298
|
-
function directoryOf(relativePath) {
|
|
1299
|
-
const slash = relativePath.lastIndexOf("/");
|
|
1300
|
-
return slash === -1 ? "" : relativePath.slice(0, slash);
|
|
1301
|
-
}
|
|
1302
|
-
function sharedDirectoryPrefixLength(left, right) {
|
|
1303
|
-
const leftParts = directoryOf(left).split("/").filter(Boolean);
|
|
1304
|
-
const rightParts = directoryOf(right).split("/").filter(Boolean);
|
|
1305
|
-
let count = 0;
|
|
1306
|
-
while (count < leftParts.length && count < rightParts.length && leftParts[count] === rightParts[count]) {
|
|
1307
|
-
count += 1;
|
|
1308
|
-
}
|
|
1309
|
-
return count;
|
|
1310
|
-
}
|
|
1311
|
-
function scoreOrphanOwnerCandidate(pathValue, linkedPath) {
|
|
1312
|
-
const linkedDir = directoryOf(linkedPath);
|
|
1313
|
-
const orphanDir = directoryOf(pathValue);
|
|
1314
|
-
const directoryPrefix = linkedPath.endsWith("/") ? linkedPath : `${linkedPath}/`;
|
|
1315
|
-
const isDirectoryPrefix = pathValue.startsWith(directoryPrefix);
|
|
1316
|
-
const sameDirectory = linkedDir.length > 0 && linkedDir === orphanDir;
|
|
1317
|
-
const sharedPrefixLength = sharedDirectoryPrefixLength(pathValue, linkedPath);
|
|
1318
|
-
if (!isDirectoryPrefix && !sameDirectory && sharedPrefixLength === 0) {
|
|
1319
|
-
return null;
|
|
1320
|
-
}
|
|
1321
|
-
if (isDirectoryPrefix) {
|
|
1322
|
-
return { score: linkedPath.length + 1e3, confidence: "path_prefix" };
|
|
1323
|
-
}
|
|
1324
|
-
return sameDirectory ? { score: sharedPrefixLength + 500, confidence: "same_directory" } : { score: sharedPrefixLength, confidence: "shared_directory" };
|
|
1325
|
-
}
|
|
1326
|
-
function shouldReplaceOrphanOwnerCandidate(best, item, score) {
|
|
1327
|
-
return best === void 0 || score > best.score || score === best.score && item.id.localeCompare(best.item.id) < 0;
|
|
1328
|
-
}
|
|
1329
|
-
function findOrphanOwnerCandidate(pathValue, classification, items) {
|
|
1330
|
-
const linkKind = classification === "docs_unowned" ? "docs" : "files";
|
|
1331
|
-
let best;
|
|
1332
|
-
for (const item of items) {
|
|
1333
|
-
const links = linkKind === "docs" ? item.docs ?? [] : item.files ?? [];
|
|
1334
|
-
for (const link of links) {
|
|
1335
|
-
if (link.scope !== "project") {
|
|
1336
|
-
continue;
|
|
1337
|
-
}
|
|
1338
|
-
const linkedPath = normalizeRelativePath(link.path);
|
|
1339
|
-
if (linkedPath.length === 0 || linkedPath === pathValue) {
|
|
1340
|
-
continue;
|
|
1341
|
-
}
|
|
1342
|
-
const scored = scoreOrphanOwnerCandidate(pathValue, linkedPath);
|
|
1343
|
-
if (scored === null) {
|
|
1344
|
-
continue;
|
|
1345
|
-
}
|
|
1346
|
-
if (shouldReplaceOrphanOwnerCandidate(best, item, scored.score)) {
|
|
1347
|
-
best = {
|
|
1348
|
-
item,
|
|
1349
|
-
score: scored.score,
|
|
1350
|
-
confidence: scored.confidence
|
|
1351
|
-
};
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
if (!best) {
|
|
1356
|
-
return null;
|
|
1357
|
-
}
|
|
1358
|
-
return {
|
|
1359
|
-
id: best.item.id,
|
|
1360
|
-
type: best.item.type,
|
|
1361
|
-
title: best.item.title,
|
|
1362
|
-
status: best.item.status,
|
|
1363
|
-
confidence: best.confidence
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
function buildOrphanedPathRows(orphanedFiles, items) {
|
|
1367
|
-
return orphanedFiles.map((pathValue) => {
|
|
1368
|
-
const classification = classifyOrphanedPath(pathValue);
|
|
1369
|
-
const linkCommand = classification === "docs_unowned" ? "docs" : "files";
|
|
1370
|
-
const ownerCandidate = findOrphanOwnerCandidate(pathValue, classification, items);
|
|
1371
|
-
const target = ownerCandidate?.id ?? "<id>";
|
|
1372
|
-
return {
|
|
1373
|
-
path: pathValue,
|
|
1374
|
-
classification,
|
|
1375
|
-
owner_candidate: ownerCandidate,
|
|
1376
|
-
remediation_hint: `pm ${linkCommand} ${target} --add path=${pathValue},scope=project,note="<why this artifact belongs to the item>"`
|
|
1377
|
-
};
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
function summarizeOrphanedPathRows(rows) {
|
|
1381
|
-
return rows.map((row) => `${row.path}:${row.classification} owner_candidate=${row.owner_candidate?.id ?? "unowned"} hint=${JSON.stringify(row.remediation_hint)}`);
|
|
1382
|
-
}
|
|
1383
|
-
function closureLikeFieldsForItem(item, lifecyclePatternPolicy) {
|
|
1384
|
-
return Object.entries(lifecyclePatternPolicy.closure_like_metadata_field_patterns).filter(([field, patterns]) => {
|
|
1385
|
-
const value = toMeaningfulString(item[field]);
|
|
1386
|
-
return value ? patterns.some((pattern) => value.toLowerCase().includes(pattern)) : false;
|
|
1387
|
-
}).map(([field]) => field).sort((left, right) => left.localeCompare(right));
|
|
1388
|
-
}
|
|
1389
|
-
function buildTerminalParentFixRow(item, parent, itemsById, canonicalIdByLowercase, statusRegistry) {
|
|
1390
|
-
const grandparentId = toMeaningfulString(parent.parent);
|
|
1391
|
-
const grandparent = grandparentId ? itemsById.get(canonicalIdByLowercase.get(grandparentId.toLowerCase()) ?? grandparentId) : void 0;
|
|
1392
|
-
return {
|
|
1393
|
-
id: item.id,
|
|
1394
|
-
parent_id: parent.id,
|
|
1395
|
-
grandparent_id: grandparent?.id,
|
|
1396
|
-
grandparent_active: grandparent !== void 0 && !isTerminalStatus(grandparent.status, statusRegistry)
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
function staleBlockerReasonsForItem(item, blockedStatuses, statusRegistry, lifecyclePatternPolicy) {
|
|
1400
|
-
const blockedBy = toMeaningfulString(item.blocked_by);
|
|
1401
|
-
const blockedReason = toMeaningfulString(item.blocked_reason);
|
|
1402
|
-
const blockedReasonNormalized = blockedReason?.toLowerCase();
|
|
1403
|
-
const normalizedStatus = normalizeStatusForRegistry(item.status, statusRegistry);
|
|
1404
|
-
const reasons = [];
|
|
1405
|
-
if (!blockedStatuses.has(normalizedStatus)) {
|
|
1406
|
-
if (blockedBy) {
|
|
1407
|
-
reasons.push("non_blocked_status_has_blocked_by");
|
|
1408
|
-
}
|
|
1409
|
-
if (blockedReason) {
|
|
1410
|
-
reasons.push("non_blocked_status_has_blocked_reason");
|
|
1411
|
-
}
|
|
1412
|
-
return reasons;
|
|
1413
|
-
}
|
|
1414
|
-
if (!blockedBy && !blockedReason) {
|
|
1415
|
-
reasons.push("blocked_status_missing_blocker_context");
|
|
1416
|
-
}
|
|
1417
|
-
if (blockedReasonNormalized?.includes("no active blocker")) {
|
|
1418
|
-
reasons.push("blocked_status_reason_reports_no_active_blocker");
|
|
1419
|
-
}
|
|
1420
|
-
if (blockedReasonNormalized && lifecyclePatternPolicy.stale_blocker_reason_patterns.some((pattern) => blockedReasonNormalized.includes(pattern))) {
|
|
1421
|
-
reasons.push("blocked_status_reason_matches_stale_pattern");
|
|
1422
|
-
}
|
|
1423
|
-
return reasons;
|
|
1424
|
-
}
|
|
1425
|
-
function collectLifecycleScanRows(items, includeStaleBlockers, statusRegistry, lifecyclePatternPolicy) {
|
|
1426
|
-
const itemsById = new Map(items.map((item) => [item.id, item]));
|
|
1427
|
-
const canonicalIdByLowercase = new Map(items.map((item) => [item.id.toLowerCase(), item.id]));
|
|
1428
|
-
const blockedStatuses = statusRegistry.blocked_statuses.size > 0 ? statusRegistry.blocked_statuses : /* @__PURE__ */ new Set(["blocked"]);
|
|
1429
|
-
const rows = {
|
|
1430
|
-
activeItems: items.filter((item) => !isTerminalStatus(item.status, statusRegistry)),
|
|
1431
|
-
closureLikeRows: [],
|
|
1432
|
-
terminalParentRows: [],
|
|
1433
|
-
terminalParentFixRows: [],
|
|
1434
|
-
staleBlockerRows: []
|
|
1435
|
-
};
|
|
1436
|
-
for (const item of rows.activeItems) {
|
|
1437
|
-
const closureLikeFields = closureLikeFieldsForItem(item, lifecyclePatternPolicy);
|
|
1438
|
-
if (closureLikeFields.length > 0) {
|
|
1439
|
-
rows.closureLikeRows.push({ id: item.id, fields: closureLikeFields });
|
|
1440
|
-
}
|
|
1441
|
-
const parentId = toMeaningfulString(item.parent);
|
|
1442
|
-
const parent = parentId ? itemsById.get(canonicalIdByLowercase.get(parentId.toLowerCase()) ?? parentId) : void 0;
|
|
1443
|
-
if (parent && isTerminalStatus(parent.status, statusRegistry)) {
|
|
1444
|
-
rows.terminalParentRows.push({ id: item.id, parent_id: parent.id, parent_status: parent.status });
|
|
1445
|
-
rows.terminalParentFixRows.push(buildTerminalParentFixRow(item, parent, itemsById, canonicalIdByLowercase, statusRegistry));
|
|
1446
|
-
}
|
|
1447
|
-
if (includeStaleBlockers) {
|
|
1448
|
-
const reasons = staleBlockerReasonsForItem(item, blockedStatuses, statusRegistry, lifecyclePatternPolicy);
|
|
1449
|
-
if (reasons.length > 0) {
|
|
1450
|
-
rows.staleBlockerRows.push({
|
|
1451
|
-
id: item.id,
|
|
1452
|
-
status: item.status,
|
|
1453
|
-
reasons: [...new Set(reasons)].sort((left, right) => left.localeCompare(right))
|
|
1454
|
-
});
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
return rows;
|
|
1459
|
-
}
|
|
1460
|
-
function sortLifecycleScanRows(rows) {
|
|
1461
|
-
rows.closureLikeRows.sort((left, right) => left.id.localeCompare(right.id));
|
|
1462
|
-
rows.terminalParentRows.sort((left, right) => left.id.localeCompare(right.id) || left.parent_id.localeCompare(right.parent_id));
|
|
1463
|
-
rows.terminalParentFixRows.sort((left, right) => left.id.localeCompare(right.id) || left.parent_id.localeCompare(right.parent_id));
|
|
1464
|
-
rows.staleBlockerRows.sort((left, right) => left.id.localeCompare(right.id));
|
|
1465
|
-
}
|
|
1466
|
-
function lifecycleCycleWarningToken(prefix, severity, count) {
|
|
1467
|
-
if (count <= 0 || severity === "off") {
|
|
1468
|
-
return null;
|
|
1469
|
-
}
|
|
1470
|
-
return `${severity === "error" ? `${prefix}_error` : prefix}:${count}`;
|
|
1471
|
-
}
|
|
1472
|
-
function buildLifecycleWarnings(rows, includeStaleBlockers, dependencyCycleSeverity, parentCycleSeverity, dependencyCycleCount, parentCycleCount) {
|
|
1473
|
-
const warnings = [];
|
|
1474
|
-
if (rows.closureLikeRows.length > 0) {
|
|
1475
|
-
warnings.push(`validate_lifecycle_active_closure_like_metadata:${rows.closureLikeRows.length}`);
|
|
1476
|
-
}
|
|
1477
|
-
if (rows.terminalParentRows.length > 0) {
|
|
1478
|
-
warnings.push(`validate_lifecycle_active_terminal_parent:${rows.terminalParentRows.length}`);
|
|
1479
|
-
}
|
|
1480
|
-
if (includeStaleBlockers && rows.staleBlockerRows.length > 0) {
|
|
1481
|
-
warnings.push(`validate_lifecycle_stale_blockers:${rows.staleBlockerRows.length}`);
|
|
1482
|
-
}
|
|
1483
|
-
const dependencyWarning = lifecycleCycleWarningToken("validate_lifecycle_dependency_cycles", dependencyCycleSeverity, dependencyCycleCount);
|
|
1484
|
-
const parentWarning = lifecycleCycleWarningToken("validate_hierarchy_parent_cycle", parentCycleSeverity, parentCycleCount);
|
|
1485
|
-
return [...warnings, ...dependencyWarning ? [dependencyWarning] : [], ...parentWarning ? [parentWarning] : []];
|
|
1486
|
-
}
|
|
1487
|
-
function linkedArtifactPathExceedsFilesystemLimits(artifactPath) {
|
|
1488
|
-
const normalized = normalizeRelativePath(artifactPath);
|
|
1489
|
-
return normalized.length > LINKED_ARTIFACT_MAX_PATH_LENGTH || normalized.split(/[\\/]/).some((segment) => segment.length > LINKED_ARTIFACT_MAX_SEGMENT_LENGTH);
|
|
1490
|
-
}
|
|
1491
|
-
async function linkedArtifactIsMissing(workspaceRoot, artifactPath) {
|
|
1492
|
-
const absolutePath = path.isAbsolute(artifactPath) ? artifactPath : path.resolve(workspaceRoot, artifactPath);
|
|
1493
|
-
if (linkedArtifactPathExceedsFilesystemLimits(absolutePath)) {
|
|
1494
|
-
return false;
|
|
1495
|
-
}
|
|
1496
|
-
try {
|
|
1497
|
-
const stats = await fs.stat(absolutePath);
|
|
1498
|
-
return !stats.isFile() && !stats.isDirectory();
|
|
1499
|
-
} catch (error) {
|
|
1500
|
-
const code = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
|
|
1501
|
-
return code === "ENOENT" || code === "ENOTDIR";
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
async function collectLinkedPathScanState(items, workspaceRoot) {
|
|
1505
|
-
const state = {
|
|
1506
|
-
linkedProjectPaths: /* @__PURE__ */ new Set(),
|
|
1507
|
-
remoteLinkedPaths: /* @__PURE__ */ new Set(),
|
|
1508
|
-
missingLinkedPaths: [],
|
|
1509
|
-
staleLinkRows: []
|
|
1510
|
-
};
|
|
1511
|
-
for (const item of items) {
|
|
1512
|
-
const linkedArtifactGroups = [
|
|
1513
|
-
{ link_kind: "files", artifacts: item.files ?? [] },
|
|
1514
|
-
{ link_kind: "docs", artifacts: item.docs ?? [] }
|
|
1515
|
-
];
|
|
1516
|
-
for (const group of linkedArtifactGroups) {
|
|
1517
|
-
for (const artifact of group.artifacts) {
|
|
1518
|
-
if (artifact.scope !== "project") {
|
|
1519
|
-
continue;
|
|
1520
|
-
}
|
|
1521
|
-
if (isRemoteLinkedArtifactReference(artifact.path)) {
|
|
1522
|
-
state.remoteLinkedPaths.add(artifact.path.trim());
|
|
1523
|
-
continue;
|
|
1524
|
-
}
|
|
1525
|
-
const normalizedPath = normalizeRelativePath(artifact.path);
|
|
1526
|
-
if (normalizedPath.length === 0) {
|
|
1527
|
-
continue;
|
|
1528
|
-
}
|
|
1529
|
-
state.linkedProjectPaths.add(normalizedPath);
|
|
1530
|
-
if (await linkedArtifactIsMissing(workspaceRoot, artifact.path)) {
|
|
1531
|
-
state.missingLinkedPaths.push(normalizedPath);
|
|
1532
|
-
state.staleLinkRows.push({ item_id: item.id, path: normalizedPath, link_kind: group.link_kind });
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
return state;
|
|
1538
|
-
}
|
|
1539
|
-
function partitionFileCandidates(fileCandidates, pmRoot, workspaceRoot, fileScanMode, includePmInternals, verboseFileLists) {
|
|
1540
|
-
const strictTrackedAllMode = fileScanMode === "tracked-all-strict";
|
|
1541
|
-
const strictModeForcesPmInternals = strictTrackedAllMode && !includePmInternals;
|
|
1542
|
-
const includePmInternalsEffective = includePmInternals || strictTrackedAllMode;
|
|
1543
|
-
const pmInternalCandidatePrefixes = includePmInternalsEffective ? [] : resolvePmInternalCandidatePrefixes(pmRoot, workspaceRoot);
|
|
1544
|
-
const excludedPmInternalPaths = pmInternalCandidatePrefixes.length === 0 ? [] : fileCandidates.candidateFiles.filter((candidate) => hasPathPrefix(candidate, pmInternalCandidatePrefixes));
|
|
1545
|
-
const candidateFiles = pmInternalCandidatePrefixes.length === 0 ? fileCandidates.candidateFiles : fileCandidates.candidateFiles.filter((candidate) => !hasPathPrefix(candidate, pmInternalCandidatePrefixes));
|
|
1546
|
-
const excludedByReason = {};
|
|
1547
|
-
if (excludedPmInternalPaths.length > 0) {
|
|
1548
|
-
const summarizedPmInternalPaths = summarizeFileList(excludedPmInternalPaths, verboseFileLists);
|
|
1549
|
-
excludedByReason.pm_internals = {
|
|
1550
|
-
count: excludedPmInternalPaths.length,
|
|
1551
|
-
paths: summarizedPmInternalPaths.values,
|
|
1552
|
-
paths_truncated: summarizedPmInternalPaths.truncated,
|
|
1553
|
-
paths_total: summarizedPmInternalPaths.total
|
|
1554
|
-
};
|
|
1555
|
-
}
|
|
1556
|
-
return {
|
|
1557
|
-
strictTrackedAllMode,
|
|
1558
|
-
strictModeForcesPmInternals,
|
|
1559
|
-
includePmInternalsEffective,
|
|
1560
|
-
pmInternalCandidatePrefixes,
|
|
1561
|
-
excludedPmInternalPaths,
|
|
1562
|
-
candidateFiles,
|
|
1563
|
-
excludedByReason
|
|
1564
|
-
};
|
|
1565
|
-
}
|
|
1566
|
-
function buildLifecycleCheck(items, includeStaleBlockers, dependencyCycleSeverity, parentCycleSeverity, statusRegistry, lifecyclePatternPolicy, verboseDiagnostics, idPrefix = "pm") {
|
|
1567
|
-
const rows = collectLifecycleScanRows(items, includeStaleBlockers, statusRegistry, lifecyclePatternPolicy);
|
|
1568
|
-
sortLifecycleScanRows(rows);
|
|
1569
|
-
const dependencyCycleDiagnostics = detectLifecycleDependencyCycles(rows.activeItems, idPrefix);
|
|
1570
|
-
const parentCycleDiagnostics = detectLifecycleParentCycles(items);
|
|
1571
|
-
const warnings = buildLifecycleWarnings(rows, includeStaleBlockers, dependencyCycleSeverity, parentCycleSeverity, dependencyCycleDiagnostics.cycle_count, parentCycleDiagnostics.cycle_count);
|
|
1572
|
-
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
1573
|
-
const summarizedClosureLikeRows = summarizeList(rows.closureLikeRows.map((row) => `${row.id}:${row.fields.join(",")}`), diagnosticLimit);
|
|
1574
|
-
const summarizedTerminalParentRows = summarizeList(rows.terminalParentRows.map((row) => `${row.id}:${row.parent_id}:${row.parent_status}`), diagnosticLimit);
|
|
1575
|
-
const summarizedStaleBlockerRows = summarizeList(rows.staleBlockerRows.map((row) => `${row.id}:${row.status}:${row.reasons.join(",")}`), diagnosticLimit);
|
|
1576
|
-
const summarizedDependencyCycleItemIds = summarizeList(dependencyCycleDiagnostics.cycle_item_ids, diagnosticLimit);
|
|
1577
|
-
const summarizedDependencyCycleSamplePaths = summarizeList(dependencyCycleDiagnostics.cycle_sample_paths, diagnosticLimit);
|
|
1578
|
-
const summarizedParentCycleItemIds = summarizeList(parentCycleDiagnostics.cycle_item_ids, diagnosticLimit);
|
|
1579
|
-
const summarizedParentCycleSamplePaths = summarizeList(parentCycleDiagnostics.cycle_sample_paths, diagnosticLimit);
|
|
1580
|
-
const hasErrorSeverityCycle = dependencyCycleDiagnostics.cycle_count > 0 && dependencyCycleSeverity === "error" || parentCycleDiagnostics.cycle_count > 0 && parentCycleSeverity === "error";
|
|
1581
|
-
return {
|
|
1582
|
-
check: {
|
|
1583
|
-
name: "lifecycle",
|
|
1584
|
-
status: hasErrorSeverityCycle ? "error" : warnings.length === 0 ? "ok" : "warn",
|
|
1585
|
-
details: {
|
|
1586
|
-
checked_active_items: rows.activeItems.length,
|
|
1587
|
-
active_closure_like_metadata_items: rows.closureLikeRows.length,
|
|
1588
|
-
active_closure_like_metadata_rows: summarizedClosureLikeRows.values,
|
|
1589
|
-
active_closure_like_metadata_rows_truncated: summarizedClosureLikeRows.truncated,
|
|
1590
|
-
active_terminal_parent_items: rows.terminalParentRows.length,
|
|
1591
|
-
active_terminal_parent_rows: summarizedTerminalParentRows.values,
|
|
1592
|
-
active_terminal_parent_rows_truncated: summarizedTerminalParentRows.truncated,
|
|
1593
|
-
stale_blocker_checks_enabled: includeStaleBlockers,
|
|
1594
|
-
stale_blocker_items: rows.staleBlockerRows.length,
|
|
1595
|
-
stale_blocker_rows: summarizedStaleBlockerRows.values,
|
|
1596
|
-
stale_blocker_rows_truncated: summarizedStaleBlockerRows.truncated,
|
|
1597
|
-
dependency_cycle_severity_policy: dependencyCycleSeverity,
|
|
1598
|
-
dependency_cycle_count: dependencyCycleDiagnostics.cycle_count,
|
|
1599
|
-
dependency_cycle_item_count: dependencyCycleDiagnostics.cycle_item_ids.length,
|
|
1600
|
-
dependency_cycle_item_ids: summarizedDependencyCycleItemIds.values,
|
|
1601
|
-
dependency_cycle_item_ids_truncated: summarizedDependencyCycleItemIds.truncated,
|
|
1602
|
-
dependency_cycle_sample_paths: summarizedDependencyCycleSamplePaths.values,
|
|
1603
|
-
dependency_cycle_sample_paths_truncated: summarizedDependencyCycleSamplePaths.truncated,
|
|
1604
|
-
parent_cycle_severity_policy: parentCycleSeverity,
|
|
1605
|
-
parent_cycle_count: parentCycleDiagnostics.cycle_count,
|
|
1606
|
-
parent_cycle_item_count: parentCycleDiagnostics.cycle_item_ids.length,
|
|
1607
|
-
parent_cycle_item_ids: summarizedParentCycleItemIds.values,
|
|
1608
|
-
parent_cycle_item_ids_truncated: summarizedParentCycleItemIds.truncated,
|
|
1609
|
-
parent_cycle_sample_paths: summarizedParentCycleSamplePaths.values,
|
|
1610
|
-
parent_cycle_sample_paths_truncated: summarizedParentCycleSamplePaths.truncated,
|
|
1611
|
-
stale_blocker_reason_patterns: [...lifecyclePatternPolicy.stale_blocker_reason_patterns],
|
|
1612
|
-
stale_blocker_reason_pattern_source: lifecyclePatternPolicy.stale_blocker_reason_pattern_source,
|
|
1613
|
-
closure_like_blocked_reason_patterns: [
|
|
1614
|
-
...lifecyclePatternPolicy.closure_like_metadata_field_patterns.blocked_reason
|
|
1615
|
-
],
|
|
1616
|
-
closure_like_blocked_reason_pattern_source: lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.blocked_reason,
|
|
1617
|
-
closure_like_resolution_patterns: [...lifecyclePatternPolicy.closure_like_metadata_field_patterns.resolution],
|
|
1618
|
-
closure_like_resolution_pattern_source: lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.resolution,
|
|
1619
|
-
closure_like_actual_result_patterns: [...lifecyclePatternPolicy.closure_like_metadata_field_patterns.actual_result],
|
|
1620
|
-
closure_like_actual_result_pattern_source: lifecyclePatternPolicy.closure_like_metadata_field_pattern_sources.actual_result
|
|
1621
|
-
}
|
|
1622
|
-
},
|
|
1623
|
-
warnings,
|
|
1624
|
-
terminalParentFixRows: rows.terminalParentFixRows
|
|
1625
|
-
};
|
|
1626
|
-
}
|
|
1627
|
-
async function buildFilesCheck(items, workspaceRoot, pmRoot, fileScanMode, includePmInternals, verboseFileLists) {
|
|
1628
|
-
const linkedPathState = await collectLinkedPathScanState(items, workspaceRoot);
|
|
1629
|
-
const itemsById = new Map(items.map((item) => [item.id, item]));
|
|
1630
|
-
const uniqueMissingLinkedPaths = [...new Set(linkedPathState.missingLinkedPaths)].sort((left, right) => left.localeCompare(right));
|
|
1631
|
-
const fileCandidates = await collectProjectFileCandidates(workspaceRoot, fileScanMode);
|
|
1632
|
-
const partition = partitionFileCandidates(fileCandidates, pmRoot, workspaceRoot, fileScanMode, includePmInternals, verboseFileLists);
|
|
1633
|
-
const orphanedFiles = partition.candidateFiles.filter((candidate) => !linkedPathState.linkedProjectPaths.has(candidate));
|
|
1634
|
-
const orphanedPathRows = buildOrphanedPathRows(orphanedFiles, items);
|
|
1635
|
-
const classifiedStalePaths = classifyStaleLinkedPaths(uniqueMissingLinkedPaths, partition.candidateFiles);
|
|
1636
|
-
const classificationByPath = new Map(classifiedStalePaths.map((entry) => [entry.path, entry.classification]));
|
|
1637
|
-
const movedStalePathCount = classifiedStalePaths.filter((entry) => entry.classification === "moved").length;
|
|
1638
|
-
const staleLinkPruneRows = linkedPathState.staleLinkRows.map((row) => ({
|
|
1639
|
-
...row,
|
|
1640
|
-
classification: classificationByPath.get(row.path) ?? "deleted"
|
|
1641
|
-
})).sort((left, right) => left.item_id.localeCompare(right.item_id) || left.path.localeCompare(right.path) || left.link_kind.localeCompare(right.link_kind));
|
|
1642
|
-
const warnings = [];
|
|
1643
|
-
if (partition.strictModeForcesPmInternals) {
|
|
1644
|
-
warnings.push("validate_files_tracked_all_strict_forces_pm_internals");
|
|
1645
|
-
}
|
|
1646
|
-
if (uniqueMissingLinkedPaths.length > 0) {
|
|
1647
|
-
warnings.push(`validate_files_missing_linked_paths:${uniqueMissingLinkedPaths.length}`);
|
|
1648
|
-
}
|
|
1649
|
-
if (orphanedFiles.length > 0) {
|
|
1650
|
-
warnings.push(`validate_files_orphaned_paths:${orphanedFiles.length}`);
|
|
1651
|
-
}
|
|
1652
|
-
const uniqueRemoteLinkedPaths = [...linkedPathState.remoteLinkedPaths].sort((left, right) => left.localeCompare(right));
|
|
1653
|
-
const summarizedRemote = summarizeFileList(uniqueRemoteLinkedPaths, verboseFileLists);
|
|
1654
|
-
const summarizedMissing = summarizeFileList(uniqueMissingLinkedPaths, verboseFileLists);
|
|
1655
|
-
const summarizedOrphaned = summarizeFileList(orphanedFiles, verboseFileLists);
|
|
1656
|
-
const summarizedOrphanedClassifications = summarizeFileList(orphanedPathRows.map((row) => `${row.path}:${row.classification}:owner_candidate=${row.owner_candidate?.id ?? "unowned"}`), verboseFileLists);
|
|
1657
|
-
const orphanedPathRowDetail = verboseFileLists ? orphanedPathRows : summarizeFileList(summarizeOrphanedPathRows(orphanedPathRows), false).values;
|
|
1658
|
-
const summarizedClassifications = summarizeFileList(summarizeStaleLinkedPathClassifications(classifiedStalePaths), verboseFileLists);
|
|
1659
|
-
const missingLinkedPathRows = staleLinkPruneRows.map((row) => ({
|
|
1660
|
-
item_id: row.item_id,
|
|
1661
|
-
path: row.path,
|
|
1662
|
-
link_kind: row.link_kind,
|
|
1663
|
-
classification: row.classification
|
|
1664
|
-
}));
|
|
1665
|
-
const ownerRows = buildMissingLinkedPathRows(missingLinkedPathRows, (id) => {
|
|
1666
|
-
const owner = itemsById.get(id);
|
|
1667
|
-
return owner ? { type: owner.type, title: owner.title, status: owner.status } : void 0;
|
|
1668
|
-
});
|
|
1669
|
-
const ownerRowDetail = verboseFileLists ? ownerRows : summarizeFileList(summarizeMissingLinkedPathRows(ownerRows), false).values;
|
|
1670
|
-
return {
|
|
1671
|
-
check: {
|
|
1672
|
-
name: "files",
|
|
1673
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1674
|
-
details: {
|
|
1675
|
-
workspace_root: workspaceRoot,
|
|
1676
|
-
scan_mode_requested: fileCandidates.requestedMode,
|
|
1677
|
-
scan_mode_applied: fileCandidates.appliedMode,
|
|
1678
|
-
strict_tracked_all_mode: partition.strictTrackedAllMode,
|
|
1679
|
-
strict_mode_forces_pm_internals: partition.strictModeForcesPmInternals,
|
|
1680
|
-
strict_mode_forces_pm_internals_notice: partition.strictModeForcesPmInternals ? "tracked-all-strict force-enables PM internals; pass --include-pm-internals to make inclusion explicit." : null,
|
|
1681
|
-
file_list_detail_mode: verboseFileLists ? "full" : "summary",
|
|
1682
|
-
file_list_summary_limit: FILE_LIST_SUMMARY_LIMIT,
|
|
1683
|
-
candidate_scan_source: fileCandidates.source,
|
|
1684
|
-
include_pm_internals: partition.includePmInternalsEffective,
|
|
1685
|
-
include_pm_internals_requested: includePmInternals,
|
|
1686
|
-
pm_internal_candidate_prefixes: partition.pmInternalCandidatePrefixes,
|
|
1687
|
-
pm_internal_excluded_count: partition.excludedPmInternalPaths.length,
|
|
1688
|
-
excluded_total: partition.excludedPmInternalPaths.length,
|
|
1689
|
-
excluded_by_reason: partition.excludedByReason,
|
|
1690
|
-
linked_project_paths: linkedPathState.linkedProjectPaths.size,
|
|
1691
|
-
remote_linked_paths_count: uniqueRemoteLinkedPaths.length,
|
|
1692
|
-
remote_linked_paths_total: summarizedRemote.total,
|
|
1693
|
-
remote_linked_paths: summarizedRemote.values,
|
|
1694
|
-
remote_linked_paths_truncated: summarizedRemote.truncated,
|
|
1695
|
-
candidate_total_raw: fileCandidates.candidateTotal,
|
|
1696
|
-
candidate_scanned_raw: fileCandidates.candidateScanned,
|
|
1697
|
-
candidate_total: partition.candidateFiles.length,
|
|
1698
|
-
candidate_scanned: partition.candidateFiles.length,
|
|
1699
|
-
scanned_candidate_files: partition.candidateFiles.length,
|
|
1700
|
-
missing_linked_paths_count: uniqueMissingLinkedPaths.length,
|
|
1701
|
-
missing_linked_paths_total: summarizedMissing.total,
|
|
1702
|
-
missing_linked_paths: summarizedMissing.values,
|
|
1703
|
-
missing_linked_paths_truncated: summarizedMissing.truncated,
|
|
1704
|
-
missing_linked_paths_moved_count: movedStalePathCount,
|
|
1705
|
-
missing_linked_paths_deleted_count: uniqueMissingLinkedPaths.length - movedStalePathCount,
|
|
1706
|
-
missing_linked_path_classifications: summarizedClassifications.values,
|
|
1707
|
-
missing_linked_path_classifications_truncated: summarizedClassifications.truncated,
|
|
1708
|
-
missing_linked_path_rows_count: ownerRows.length,
|
|
1709
|
-
missing_linked_path_rows: ownerRowDetail,
|
|
1710
|
-
orphaned_paths_count: orphanedFiles.length,
|
|
1711
|
-
orphaned_paths_total: summarizedOrphaned.total,
|
|
1712
|
-
orphaned_paths: summarizedOrphaned.values,
|
|
1713
|
-
orphaned_paths_truncated: summarizedOrphaned.truncated,
|
|
1714
|
-
orphaned_path_classifications: summarizedOrphanedClassifications.values,
|
|
1715
|
-
orphaned_path_classifications_truncated: summarizedOrphanedClassifications.truncated,
|
|
1716
|
-
orphaned_path_rows_count: orphanedPathRows.length,
|
|
1717
|
-
orphaned_path_rows: orphanedPathRowDetail
|
|
1718
|
-
}
|
|
1719
|
-
},
|
|
1720
|
-
warnings,
|
|
1721
|
-
staleLinkPruneRows
|
|
1722
|
-
};
|
|
1723
|
-
}
|
|
1724
|
-
async function buildHistoryDriftCheck(pmRoot, items, verboseDiagnostics) {
|
|
1725
|
-
const { missingStreams, unreadableStreams, hashMismatches, chainMismatches, driftedItems } = await scanHistoryDrift(pmRoot, items);
|
|
1726
|
-
const warnings = [];
|
|
1727
|
-
if (missingStreams.length > 0) {
|
|
1728
|
-
warnings.push(`validate_history_drift_missing_streams:${missingStreams.length}`);
|
|
1729
|
-
}
|
|
1730
|
-
if (unreadableStreams.length > 0) {
|
|
1731
|
-
warnings.push(`validate_history_drift_unreadable_streams:${unreadableStreams.length}`);
|
|
1732
|
-
}
|
|
1733
|
-
if (hashMismatches.length > 0) {
|
|
1734
|
-
warnings.push(`validate_history_drift_hash_mismatches:${hashMismatches.length}`);
|
|
1735
|
-
}
|
|
1736
|
-
if (chainMismatches.length > 0) {
|
|
1737
|
-
warnings.push(`validate_history_drift_chain_mismatches:${chainMismatches.length}`);
|
|
1738
|
-
}
|
|
1739
|
-
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
1740
|
-
const summarizedDrifted = summarizeList(driftedItems, diagnosticLimit);
|
|
1741
|
-
return {
|
|
1742
|
-
check: {
|
|
1743
|
-
name: "history_drift",
|
|
1744
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1745
|
-
details: {
|
|
1746
|
-
checked_items: items.length,
|
|
1747
|
-
drifted_items_count: driftedItems.length,
|
|
1748
|
-
drifted_items: summarizedDrifted.values,
|
|
1749
|
-
drifted_items_truncated: summarizedDrifted.truncated,
|
|
1750
|
-
counts: {
|
|
1751
|
-
missing_streams: missingStreams.length,
|
|
1752
|
-
unreadable_streams: unreadableStreams.length,
|
|
1753
|
-
hash_mismatches: hashMismatches.length,
|
|
1754
|
-
chain_mismatches: chainMismatches.length
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
},
|
|
1758
|
-
warnings
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
function summarizeCommandReferenceRow(ownerId, referencedId, command) {
|
|
1762
|
-
const normalizedCommand = command.trim().replaceAll(/\s+/g, " ");
|
|
1763
|
-
const commandPreview = normalizedCommand.length > 120 ? `${normalizedCommand.slice(0, 117)}...` : normalizedCommand;
|
|
1764
|
-
return `${ownerId}:${referencedId}:${commandPreview}`;
|
|
1765
|
-
}
|
|
1766
|
-
function buildCommandReferencesCheck(items, idPrefix, verboseDiagnostics) {
|
|
1767
|
-
const knownIds = new Set(items.map((item) => item.id.toLowerCase()));
|
|
1768
|
-
let linkedCommandsScanned = 0;
|
|
1769
|
-
let referencedPmIdCount = 0;
|
|
1770
|
-
const referencedPmIds = /* @__PURE__ */ new Set();
|
|
1771
|
-
const staleReferenceRows = [];
|
|
1772
|
-
for (const item of items) {
|
|
1773
|
-
for (const linkedTest of item.tests ?? []) {
|
|
1774
|
-
if (typeof linkedTest.command !== "string" || linkedTest.command.trim().length === 0) {
|
|
1775
|
-
continue;
|
|
1776
|
-
}
|
|
1777
|
-
linkedCommandsScanned += 1;
|
|
1778
|
-
const referencedIds = extractReferencedPmItemIdsFromCommand(linkedTest.command, idPrefix);
|
|
1779
|
-
if (referencedIds.length === 0) {
|
|
1780
|
-
continue;
|
|
1781
|
-
}
|
|
1782
|
-
referencedPmIdCount += referencedIds.length;
|
|
1783
|
-
for (const referencedId of referencedIds) {
|
|
1784
|
-
referencedPmIds.add(referencedId);
|
|
1785
|
-
if (!knownIds.has(referencedId.toLowerCase())) {
|
|
1786
|
-
staleReferenceRows.push(summarizeCommandReferenceRow(item.id, referencedId, linkedTest.command));
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
const uniqueStaleReferenceRows = [...new Set(staleReferenceRows)].sort((left, right) => left.localeCompare(right));
|
|
1792
|
-
const stalePmIds = [...new Set(uniqueStaleReferenceRows.map((row) => row.split(":")[1] ?? ""))].filter((value) => value.length > 0).sort((left, right) => left.localeCompare(right));
|
|
1793
|
-
const warnings = uniqueStaleReferenceRows.length > 0 ? [`validate_command_references_stale_pm_ids:${uniqueStaleReferenceRows.length}`] : [];
|
|
1794
|
-
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
1795
|
-
const summarizedRows = summarizeList(uniqueStaleReferenceRows, diagnosticLimit);
|
|
1796
|
-
const summarizedStalePmIds = summarizeList(stalePmIds, diagnosticLimit);
|
|
1797
|
-
const summarizedReferencedPmIds = summarizeList([...referencedPmIds].sort((left, right) => left.localeCompare(right)), diagnosticLimit);
|
|
1798
|
-
return {
|
|
1799
|
-
check: {
|
|
1800
|
-
name: "command_references",
|
|
1801
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1802
|
-
details: {
|
|
1803
|
-
checked_items: items.length,
|
|
1804
|
-
linked_commands_scanned: linkedCommandsScanned,
|
|
1805
|
-
referenced_pm_ids_count: referencedPmIdCount,
|
|
1806
|
-
unique_referenced_pm_ids_count: referencedPmIds.size,
|
|
1807
|
-
unique_referenced_pm_ids: summarizedReferencedPmIds.values,
|
|
1808
|
-
unique_referenced_pm_ids_truncated: summarizedReferencedPmIds.truncated,
|
|
1809
|
-
stale_pm_id_references_count: uniqueStaleReferenceRows.length,
|
|
1810
|
-
stale_pm_ids_count: stalePmIds.length,
|
|
1811
|
-
stale_pm_ids: summarizedStalePmIds.values,
|
|
1812
|
-
stale_pm_ids_truncated: summarizedStalePmIds.truncated,
|
|
1813
|
-
stale_pm_id_reference_rows: summarizedRows.values,
|
|
1814
|
-
stale_pm_id_reference_rows_truncated: summarizedRows.truncated
|
|
1815
|
-
}
|
|
1816
|
-
},
|
|
1817
|
-
warnings
|
|
1818
|
-
};
|
|
1819
|
-
}
|
|
1820
|
-
function buildFormatVersionCheck(items, verboseDiagnostics) {
|
|
1821
|
-
const scan = scanItemFormatVersions(items.map((item) => ({ ref: item.id, version: effectiveItemFormatVersion(item) })));
|
|
1822
|
-
const warnings = [];
|
|
1823
|
-
if (scan.outdated.length > 0) {
|
|
1824
|
-
warnings.push(`validate_format_version_outdated_items:${scan.outdated.length}`);
|
|
1825
|
-
}
|
|
1826
|
-
if (scan.ahead.length > 0) {
|
|
1827
|
-
warnings.push(`validate_format_version_ahead_items:${scan.ahead.length}`);
|
|
1828
|
-
}
|
|
1829
|
-
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
1830
|
-
const summarizedOutdated = summarizeList(scan.outdated, diagnosticLimit);
|
|
1831
|
-
const summarizedAhead = summarizeList(scan.ahead, diagnosticLimit);
|
|
1832
|
-
const status = scan.ahead.length > 0 ? "error" : scan.outdated.length > 0 ? "warn" : "ok";
|
|
1833
|
-
return {
|
|
1834
|
-
check: {
|
|
1835
|
-
name: "format_version",
|
|
1836
|
-
status,
|
|
1837
|
-
details: {
|
|
1838
|
-
checked_items: items.length,
|
|
1839
|
-
current_format_version: CURRENT_ITEM_FORMAT_VERSION,
|
|
1840
|
-
outdated_items_count: scan.outdated.length,
|
|
1841
|
-
outdated_items: summarizedOutdated.values,
|
|
1842
|
-
outdated_items_truncated: summarizedOutdated.truncated,
|
|
1843
|
-
ahead_items_count: scan.ahead.length,
|
|
1844
|
-
ahead_items: summarizedAhead.values,
|
|
1845
|
-
ahead_items_truncated: summarizedAhead.truncated
|
|
1846
|
-
}
|
|
1847
|
-
},
|
|
1848
|
-
warnings
|
|
1849
|
-
};
|
|
1850
|
-
}
|
|
1851
|
-
var VALIDATE_AUTO_FIX_MESSAGE = "pm validate auto-fix";
|
|
1852
|
-
async function applyValidateFix(fix, global2) {
|
|
1853
|
-
switch (fix.kind) {
|
|
1854
|
-
case "set_resolution":
|
|
1855
|
-
case "set_close_reason":
|
|
1856
|
-
case "set_estimate":
|
|
1857
|
-
case "reparent":
|
|
1858
|
-
case "unset_parent": {
|
|
1859
|
-
const { runUpdate } = await import("./update-VQVHAY6X.js");
|
|
1860
|
-
const updateOptions = { message: VALIDATE_AUTO_FIX_MESSAGE };
|
|
1861
|
-
if (fix.kind === "set_resolution") {
|
|
1862
|
-
updateOptions.resolution = fix.value;
|
|
1863
|
-
} else if (fix.kind === "set_close_reason") {
|
|
1864
|
-
updateOptions.closeReason = fix.value;
|
|
1865
|
-
} else if (fix.kind === "set_estimate") {
|
|
1866
|
-
updateOptions.estimatedMinutes = fix.value;
|
|
1867
|
-
} else if (fix.kind === "reparent") {
|
|
1868
|
-
updateOptions.parent = fix.parent_id;
|
|
1869
|
-
} else {
|
|
1870
|
-
updateOptions.unset = ["parent"];
|
|
1871
|
-
}
|
|
1872
|
-
await runUpdate(fix.item_id, updateOptions, global2);
|
|
1873
|
-
return;
|
|
1874
|
-
}
|
|
1875
|
-
case "prune_file_link": {
|
|
1876
|
-
throw new Error(`Unsupported non-batched fix kind: ${fix.kind}`);
|
|
1877
|
-
}
|
|
1878
|
-
case "prune_doc_link": {
|
|
1879
|
-
throw new Error(`Unsupported non-batched fix kind: ${fix.kind}`);
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
function pruneBatchKey(fix) {
|
|
1884
|
-
if (fix.kind !== "prune_file_link" && fix.kind !== "prune_doc_link") {
|
|
1885
|
-
return null;
|
|
1886
|
-
}
|
|
1887
|
-
return `${fix.kind}:${fix.item_id}`;
|
|
1888
|
-
}
|
|
1889
|
-
async function applyValidateFixes(applicable, global2) {
|
|
1890
|
-
const applied = [];
|
|
1891
|
-
const failed = [];
|
|
1892
|
-
const pruneBatches = /* @__PURE__ */ new Map();
|
|
1893
|
-
for (const fix of applicable) {
|
|
1894
|
-
const batchKey = pruneBatchKey(fix);
|
|
1895
|
-
if (batchKey === null) {
|
|
1896
|
-
try {
|
|
1897
|
-
await applyValidateFix(fix, global2);
|
|
1898
|
-
applied.push(fix);
|
|
1899
|
-
} catch (error) {
|
|
1900
|
-
failed.push({ fix, error });
|
|
1901
|
-
}
|
|
1902
|
-
continue;
|
|
1903
|
-
}
|
|
1904
|
-
const existing = pruneBatches.get(batchKey);
|
|
1905
|
-
if (existing) {
|
|
1906
|
-
existing.push(fix);
|
|
1907
|
-
} else {
|
|
1908
|
-
pruneBatches.set(batchKey, [fix]);
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
for (const batch of pruneBatches.values()) {
|
|
1912
|
-
const first = batch[0];
|
|
1913
|
-
if (!first) {
|
|
1914
|
-
continue;
|
|
1915
|
-
}
|
|
1916
|
-
const remove = batch.map((fix) => fix.path).filter((value) => typeof value === "string" && value.length > 0);
|
|
1917
|
-
try {
|
|
1918
|
-
if (first.kind === "prune_file_link") {
|
|
1919
|
-
const { runFiles } = await import("./files-EWRQHGIS.js");
|
|
1920
|
-
await runFiles(first.item_id, { remove, message: VALIDATE_AUTO_FIX_MESSAGE }, global2);
|
|
1921
|
-
} else {
|
|
1922
|
-
const { runDocs } = await import("./docs-WL2IWGWV.js");
|
|
1923
|
-
await runDocs(first.item_id, { remove, message: VALIDATE_AUTO_FIX_MESSAGE }, global2);
|
|
1924
|
-
}
|
|
1925
|
-
applied.push(...batch);
|
|
1926
|
-
} catch (error) {
|
|
1927
|
-
failed.push(...batch.map((fix) => ({ fix, error })));
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
return { applied, failed };
|
|
1931
|
-
}
|
|
1932
|
-
var _testOnlyValidateCommand = {
|
|
1933
|
-
applyValidateFix,
|
|
1934
|
-
applyValidateFixes,
|
|
1935
|
-
attachValidateFixHints,
|
|
1936
|
-
buildCommandReferencesCheck,
|
|
1937
|
-
buildCloseReasonBackfillRows,
|
|
1938
|
-
buildFilesCheck,
|
|
1939
|
-
buildLifecycleCheck,
|
|
1940
|
-
buildLifecycleDependencyGraph,
|
|
1941
|
-
buildLifecycleParentGraph,
|
|
1942
|
-
buildEstimateBackfillRows,
|
|
1943
|
-
buildMetadataCounts,
|
|
1944
|
-
buildMissingFieldOccurrences,
|
|
1945
|
-
buildOrphanedPathRows,
|
|
1946
|
-
classifyOrphanedPath,
|
|
1947
|
-
collectDefaultProjectFileCandidates,
|
|
1948
|
-
collectTrackedGitFileCandidates,
|
|
1949
|
-
detectLifecycleDependencyCycles,
|
|
1950
|
-
detectLifecycleParentCycles,
|
|
1951
|
-
escapeRegExp,
|
|
1952
|
-
extractItemIds,
|
|
1953
|
-
findLifecycleDependencyCycleComponents,
|
|
1954
|
-
isMetadataFieldMissing,
|
|
1955
|
-
linkedArtifactPathExceedsFilesystemLimits,
|
|
1956
|
-
listFilesRecursive,
|
|
1957
|
-
resolveDependencyCycleSeverity,
|
|
1958
|
-
resolveParentCycleSeverity,
|
|
1959
|
-
resolveFileScanMode,
|
|
1960
|
-
resolveLifecycleDependencyCycleSamplePath,
|
|
1961
|
-
resolveRequestedChecks,
|
|
1962
|
-
resolveValidateMetadataProfile,
|
|
1963
|
-
resolveWorkspaceRoot,
|
|
1964
|
-
sharedDirectoryPrefixLength,
|
|
1965
|
-
summarizeOrphanedPathRows,
|
|
1966
|
-
summarizeDuplicateIssueCodes,
|
|
1967
|
-
toMeaningfulString
|
|
1968
|
-
};
|
|
1969
|
-
function recordValidateCheck(state, built, fixHintsEnabled) {
|
|
1970
|
-
if (fixHintsEnabled) {
|
|
1971
|
-
attachValidateFixHints(built.check, built.warnings);
|
|
1972
|
-
}
|
|
1973
|
-
state.checks.push(built.check);
|
|
1974
|
-
state.warnings.push(...built.warnings);
|
|
1975
|
-
}
|
|
1976
|
-
async function executeRequestedValidateChecks(params) {
|
|
1977
|
-
const state = {
|
|
1978
|
-
checks: [],
|
|
1979
|
-
warnings: [...params.initialWarnings],
|
|
1980
|
-
closeReasonBackfillRows: [],
|
|
1981
|
-
estimateBackfillRows: [],
|
|
1982
|
-
resolutionBackfillRows: [],
|
|
1983
|
-
terminalParentFixRows: [],
|
|
1984
|
-
staleLinkPruneRows: []
|
|
1985
|
-
};
|
|
1986
|
-
const fixHintsEnabled = params.options.fixHints === true;
|
|
1987
|
-
const fullDiagnostics = params.options.verboseDiagnostics === true || params.options.allAffectedIds === true || params.global.json === true;
|
|
1988
|
-
if (params.requestedChecks.has("metadata")) {
|
|
1989
|
-
const built = buildMetadataCheck(params.items, params.metadataPolicy, params.statusRegistry, fullDiagnostics);
|
|
1990
|
-
state.closeReasonBackfillRows = built.closeReasonBackfillRows;
|
|
1991
|
-
state.estimateBackfillRows = built.estimateBackfillRows;
|
|
1992
|
-
recordValidateCheck(state, built, fixHintsEnabled);
|
|
1993
|
-
}
|
|
1994
|
-
if (params.requestedChecks.has("resolution")) {
|
|
1995
|
-
const built = buildResolutionCheck(params.items, params.statusRegistry, fullDiagnostics);
|
|
1996
|
-
state.resolutionBackfillRows = built.resolutionBackfillRows;
|
|
1997
|
-
recordValidateCheck(state, built, fixHintsEnabled);
|
|
1998
|
-
}
|
|
1999
|
-
if (params.requestedChecks.has("lifecycle")) {
|
|
2000
|
-
const built = buildLifecycleCheck(params.items, Boolean(params.options.checkStaleBlockers), params.dependencyCycleSeverity, params.parentCycleSeverity, params.statusRegistry, params.lifecyclePatternPolicy, fullDiagnostics, params.settings.id_prefix);
|
|
2001
|
-
state.terminalParentFixRows = built.terminalParentFixRows;
|
|
2002
|
-
recordValidateCheck(state, built, fixHintsEnabled);
|
|
2003
|
-
}
|
|
2004
|
-
if (params.requestedChecks.has("files")) {
|
|
2005
|
-
const built = await buildFilesCheck(params.items, params.workspaceRoot, params.pmRoot, params.fileScanMode, Boolean(params.options.includePmInternals), Boolean(params.options.verboseFileLists));
|
|
2006
|
-
state.staleLinkPruneRows = built.staleLinkPruneRows;
|
|
2007
|
-
recordValidateCheck(state, built, fixHintsEnabled);
|
|
2008
|
-
}
|
|
2009
|
-
if (params.requestedChecks.has("command_references")) {
|
|
2010
|
-
recordValidateCheck(state, buildCommandReferencesCheck(params.items, params.settings.id_prefix, fullDiagnostics), fixHintsEnabled);
|
|
2011
|
-
}
|
|
2012
|
-
if (params.requestedChecks.has("history_drift")) {
|
|
2013
|
-
recordValidateCheck(state, await buildHistoryDriftCheck(params.pmRoot, params.items, fullDiagnostics), fixHintsEnabled);
|
|
2014
|
-
}
|
|
2015
|
-
if (params.requestedChecks.has("format_version")) {
|
|
2016
|
-
recordValidateCheck(state, buildFormatVersionCheck(params.items, fullDiagnostics), fixHintsEnabled);
|
|
2017
|
-
}
|
|
2018
|
-
return state;
|
|
2019
|
-
}
|
|
2020
|
-
function planValidateFixes(options, state, settings) {
|
|
2021
|
-
const planned = [];
|
|
2022
|
-
if (options.autoFix === true) {
|
|
2023
|
-
planned.push(...planCloseReasonBackfillFixes(state.closeReasonBackfillRows));
|
|
2024
|
-
planned.push(...planResolutionBackfillFixes(state.resolutionBackfillRows));
|
|
2025
|
-
planned.push(...planEstimateBackfillFixes(state.estimateBackfillRows, settings.validation.estimate_defaults_by_type));
|
|
2026
|
-
planned.push(...planTerminalParentFixes(state.terminalParentFixRows));
|
|
2027
|
-
}
|
|
2028
|
-
if (options.pruneMissing === true) {
|
|
2029
|
-
planned.push(...planStaleLinkPruneFixes(state.staleLinkPruneRows));
|
|
2030
|
-
}
|
|
2031
|
-
return planned;
|
|
2032
|
-
}
|
|
2033
|
-
async function buildValidateFixesSummary(options, state, settings, grantedFixScopes, global2) {
|
|
2034
|
-
if (options.autoFix !== true && options.pruneMissing !== true) {
|
|
2035
|
-
return void 0;
|
|
2036
|
-
}
|
|
2037
|
-
const planned = planValidateFixes(options, state, settings);
|
|
2038
|
-
const { applicable, gated } = partitionFixesByGrant(planned, grantedFixScopes);
|
|
2039
|
-
const dryRun = options.dryRun === true;
|
|
2040
|
-
const appliedFixRows = [];
|
|
2041
|
-
const failedFixRows = [];
|
|
2042
|
-
if (!dryRun) {
|
|
2043
|
-
const applied = await applyValidateFixes(applicable, global2);
|
|
2044
|
-
appliedFixRows.push(...applied.applied.map(toFixOutputRow));
|
|
2045
|
-
failedFixRows.push(...applied.failed.map(({ fix, error }) => ({
|
|
2046
|
-
...toFixOutputRow(fix),
|
|
2047
|
-
error: error instanceof Error ? error.message : String(error)
|
|
2048
|
-
})));
|
|
2049
|
-
}
|
|
2050
|
-
return {
|
|
2051
|
-
mode: dryRun ? "dry_run" : "apply",
|
|
2052
|
-
auto_fix: options.autoFix === true,
|
|
2053
|
-
prune_missing: options.pruneMissing === true,
|
|
2054
|
-
granted_fix_scopes: [...grantedFixScopes].sort((left, right) => left.localeCompare(right)),
|
|
2055
|
-
planned_count: planned.length,
|
|
2056
|
-
applied_count: appliedFixRows.length,
|
|
2057
|
-
gated_count: gated.length,
|
|
2058
|
-
failed_count: failedFixRows.length,
|
|
2059
|
-
planned_fixes: planned.map(toFixOutputRow),
|
|
2060
|
-
applied_fixes: appliedFixRows,
|
|
2061
|
-
gated_fixes: gated.map((fix) => ({
|
|
2062
|
-
...toFixOutputRow(fix),
|
|
2063
|
-
gate_hint: `Withheld: re-run with --fix-scope ${fix.gate} to apply.`
|
|
2064
|
-
})),
|
|
2065
|
-
failed_fixes: failedFixRows
|
|
2066
|
-
};
|
|
2067
|
-
}
|
|
2068
|
-
async function runValidate(options, global2) {
|
|
2069
|
-
const fixesRequested = options.autoFix === true || options.pruneMissing === true;
|
|
2070
|
-
if (options.dryRun === true && !fixesRequested) {
|
|
2071
|
-
throw new PmCliError("--dry-run requires --auto-fix or --prune-missing (there is nothing to preview otherwise).", EXIT_CODE.USAGE);
|
|
2072
|
-
}
|
|
2073
|
-
if (options.fixScope !== void 0 && options.fixScope.length > 0 && options.autoFix !== true) {
|
|
2074
|
-
throw new PmCliError("--fix-scope requires --auto-fix.", EXIT_CODE.USAGE);
|
|
2075
|
-
}
|
|
2076
|
-
const grantedFixScopes = resolveGrantedFixScopes(options.fixScope);
|
|
2077
|
-
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
2078
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
2079
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
2080
|
-
}
|
|
2081
|
-
const settings = await readSettings(pmRoot);
|
|
2082
|
-
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
2083
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
2084
|
-
const itemReadWarnings = [];
|
|
2085
|
-
const items = await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, itemReadWarnings, settings.schema);
|
|
2086
|
-
const requestedChecks = resolveRequestedChecks(options);
|
|
2087
|
-
const metadataProfileSource = typeof options.metadataProfile === "string" ? "option" : "settings";
|
|
2088
|
-
const metadataProfile = resolveValidateMetadataProfile(typeof options.metadataProfile === "string" ? options.metadataProfile : settings.validation.metadata_profile);
|
|
2089
|
-
const metadataPolicy = resolveValidateMetadataPolicy(metadataProfile, metadataProfileSource, settings.validation.metadata_required_fields);
|
|
2090
|
-
const lifecyclePatternPolicy = resolveLifecyclePatternPolicy(settings);
|
|
2091
|
-
const dependencyCycleSeverity = resolveDependencyCycleSeverity(options.dependencyCycleSeverity);
|
|
2092
|
-
const parentCycleSeverity = resolveParentCycleSeverity(options.parentCycleSeverity);
|
|
2093
|
-
const fileScanMode = resolveFileScanMode(options.scanMode);
|
|
2094
|
-
const workspaceRoot = resolveWorkspaceRoot(pmRoot);
|
|
2095
|
-
const state = await executeRequestedValidateChecks({
|
|
2096
|
-
requestedChecks,
|
|
2097
|
-
options,
|
|
2098
|
-
global: global2,
|
|
2099
|
-
pmRoot,
|
|
2100
|
-
workspaceRoot,
|
|
2101
|
-
settings,
|
|
2102
|
-
items,
|
|
2103
|
-
statusRegistry,
|
|
2104
|
-
metadataPolicy,
|
|
2105
|
-
lifecyclePatternPolicy,
|
|
2106
|
-
dependencyCycleSeverity,
|
|
2107
|
-
parentCycleSeverity,
|
|
2108
|
-
fileScanMode,
|
|
2109
|
-
initialWarnings: [...new Set(itemReadWarnings)]
|
|
2110
|
-
});
|
|
2111
|
-
const fixes = fixesRequested ? await buildValidateFixesSummary(options, state, settings, grantedFixScopes, global2) : void 0;
|
|
2112
|
-
const normalizedWarnings = [...new Set(state.warnings)].sort((left, right) => left.localeCompare(right));
|
|
2113
|
-
const hasErrors = state.checks.some((check) => check.status === "error");
|
|
2114
|
-
return {
|
|
2115
|
-
ok: !hasErrors,
|
|
2116
|
-
has_warnings: normalizedWarnings.length > 0,
|
|
2117
|
-
checks: state.checks,
|
|
2118
|
-
warnings: normalizedWarnings,
|
|
2119
|
-
...fixes !== void 0 ? { fixes } : {},
|
|
2120
|
-
generated_at: nowIso()
|
|
2121
|
-
};
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
export {
|
|
2125
|
-
_testOnlyValidateCommand,
|
|
2126
|
-
runValidate
|
|
2127
|
-
};
|
|
2128
|
-
//# sourceMappingURL=chunk-Y6BK55A3.js.map
|