@unbrained/pm-cli 2026.6.11 → 2026.6.13
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 +47 -0
- package/README.md +1 -1
- package/dist/cli/commands/completion.js +20 -8
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.js +13 -3
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +2 -0
- package/dist/cli/commands/docs.js +2 -2
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/files.d.ts +2 -0
- package/dist/cli/commands/files.js +2 -2
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/health.d.ts +1 -1
- package/dist/cli/commands/health.js +77 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +36 -0
- package/dist/cli/commands/history-repair.js +68 -3
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +3 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/linked-artifacts.d.ts +18 -0
- package/dist/cli/commands/linked-artifacts.js +26 -3
- package/dist/cli/commands/linked-artifacts.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +6 -0
- package/dist/cli/commands/plan.js +93 -32
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +20 -0
- package/dist/cli/commands/validate.js +292 -28
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +29 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/help-content.js +7 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +13 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-mutation.js +47 -16
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +10 -2
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +16 -16
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-XADJOG6G.js → activity-PPO7QWJF.js} +11 -11
- package/dist/cli-bundle/chunks/activity-XIOTGZMU.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-6OTS3AOO.js → aggregate-IRHJWEKG.js} +10 -10
- package/dist/cli-bundle/chunks/{aggregate-OD36DJU5.js → aggregate-XEBW22UQ.js} +10 -10
- package/dist/cli-bundle/chunks/{append-JYWO4P7W.js → append-N2AWXKZC.js} +8 -8
- package/dist/cli-bundle/chunks/{append-KG55G7S3.js → append-NL67JNJU.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-IH4MBKK7.js → chunk-2ANTZBYF.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-F75JSIOZ.js → chunk-2J2AH4V5.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-CCX4RSYZ.js → chunk-32XSW44C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DY6C42S6.js → chunk-36BCSMKP.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-XUC4C4PT.js → chunk-3CQPVBK3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SXKNJPQ7.js → chunk-3FMQMHAG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-I7NYDZDV.js → chunk-3VULHQNS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HHHJ2GI3.js → chunk-4FHLNNW7.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-RXAP6JL5.js → chunk-4JHJ7YG2.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-P5BJOMBB.js → chunk-4TPFXE2R.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-XJDGS74Y.js → chunk-4ZKKZMLH.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-XJDGS74Y.js.map → chunk-4ZKKZMLH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3SLOMKCJ.js → chunk-5HSAHRYA.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-ZLMIWZUG.js → chunk-5LMF75Q7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TK5VZFHY.js → chunk-6TBR5AZ2.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ATEES5SX.js → chunk-6ZFTM65G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P2PSODAQ.js → chunk-7CRFV6JR.js} +111 -10
- package/dist/cli-bundle/chunks/chunk-7CRFV6JR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VFUZV5EB.js → chunk-7SM7VA5I.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-GKIZW7SM.js → chunk-AAUYXSFF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FXRU333M.js → chunk-AGG32LKL.js} +111 -10
- package/dist/cli-bundle/chunks/chunk-AGG32LKL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OASDW5UI.js → chunk-AUDDXKNX.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ZMW77VWV.js → chunk-BVL5KGVA.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-4JCSYR6F.js → chunk-C24PWDFG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4HFU4UO2.js → chunk-CEGUH2E5.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-Y3YKK7CY.js → chunk-DWG4FHPY.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js +217 -0
- package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YW6Q3RYZ.js → chunk-GFBEXDCQ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-XMBI6TNW.js → chunk-GOO4UXBI.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-IGVJRZ6H.js → chunk-GRZGHGRG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-E5DUIJA4.js → chunk-HLEGAQXT.js} +20 -7
- package/dist/cli-bundle/chunks/chunk-HLEGAQXT.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HWHONML5.js +190 -0
- package/dist/cli-bundle/chunks/chunk-HWHONML5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TNAP7EJX.js → chunk-HZOX5BYD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VSRZRLG3.js → chunk-IIOIBAQW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IUKD4W6Z.js → chunk-IXVSSHGV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WUNFKP7M.js → chunk-IZHCCG4S.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VAOUX6TK.js → chunk-JCTZV7TO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZYNJNPYD.js → chunk-JE5IZXDS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QNJSITCX.js → chunk-JW7D6437.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-B65UUCGQ.js → chunk-JWXTOYBI.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-7RIT3OCD.js → chunk-KHGTYCJ6.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-HI7STVF2.js → chunk-L6YQONLM.js} +11 -27
- package/dist/cli-bundle/chunks/chunk-L6YQONLM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FY4SPXSC.js → chunk-LFW5NQUP.js} +59 -86
- package/dist/cli-bundle/chunks/chunk-LFW5NQUP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VPEAS7PS.js → chunk-LGOXXQUW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I2IJY2NL.js → chunk-LOAR5TKX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-S26FESD4.js → chunk-LSSTKL3Y.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CW6E4NAT.js → chunk-LYNQ3NGI.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-4YFAGDRH.js → chunk-M3SI2REU.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-73ZPG2I3.js → chunk-MACCNKSZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IKOH24GZ.js → chunk-MGAQ6KZG.js} +20 -15
- package/dist/cli-bundle/chunks/{chunk-IKOH24GZ.js.map → chunk-MGAQ6KZG.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js +220 -0
- package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-P5U5EOMA.js → chunk-NN6RKGFW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GWZSYR6X.js → chunk-O3YCJOVX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7UGSRQCL.js → chunk-PEH7SZD2.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-7UGSRQCL.js.map → chunk-PEH7SZD2.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UOO6BYIA.js → chunk-PNYAAB4S.js} +21 -188
- package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UUWGCWBU.js → chunk-QQG4HEX7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XTKJSVWH.js → chunk-QU3OPNVV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LCSCXBGT.js → chunk-R4VWYWRN.js} +19 -193
- package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PSD7F7DX.js → chunk-RFR2YQGO.js} +21 -8
- package/dist/cli-bundle/chunks/chunk-RFR2YQGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EWFY7SLA.js → chunk-RHYBR6G7.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-A6LXQFO7.js → chunk-S2CDTRJ6.js} +52 -79
- package/dist/cli-bundle/chunks/chunk-S2CDTRJ6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-J3GD64J2.js → chunk-SGMGMCIF.js} +21 -16
- package/dist/cli-bundle/chunks/{chunk-J3GD64J2.js.map → chunk-SGMGMCIF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-S2ZLDYGS.js → chunk-SOHXUA2Q.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-KWAXVAXX.js → chunk-SQDKAEKG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7IYFN5R7.js → chunk-TOX7YQ7X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FDH2X65L.js → chunk-TSXWFN3L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OLKBSY4N.js → chunk-UCVJP4JL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AVGHVVF7.js → chunk-V4KP3TCN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QKW5D45B.js → chunk-VNC2HBL4.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-QJMGRZO2.js → chunk-VYZNX4C5.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5SCT2JCT.js → chunk-W6KNFAMZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I53JBTJW.js → chunk-WLH7X4RN.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-ESANVZF4.js → chunk-XOYHMHFF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HGLC63AU.js → chunk-XWDZVCBJ.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3KLPFWZ4.js → chunk-XXLMJDUB.js} +10 -26
- package/dist/cli-bundle/chunks/chunk-XXLMJDUB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-Z647PYLD.js +187 -0
- package/dist/cli-bundle/chunks/chunk-Z647PYLD.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-MJ7DZFC3.js → claim-HE6KEGJW.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-2RDYMCTP.js → claim-QJOQBH7J.js} +10 -10
- package/dist/cli-bundle/chunks/{close-XLEKIQSW.js → close-SPUFW5QR.js} +8 -8
- package/dist/cli-bundle/chunks/close-WOG5WTMZ.js +13 -0
- package/dist/cli-bundle/chunks/{close-many-AOD4HSAZ.js → close-many-GKAJX54X.js} +15 -15
- package/dist/cli-bundle/chunks/{close-many-XKAQY5CQ.js → close-many-GL6NRUU5.js} +15 -15
- package/dist/cli-bundle/chunks/{comments-RN5TG4ZN.js → comments-5FPT6L7N.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-B4RWWDJT.js → comments-TOLOYWNI.js} +10 -10
- package/dist/cli-bundle/chunks/{config-3JXJ3XZ7.js → config-4MN45TIH.js} +8 -8
- package/dist/cli-bundle/chunks/{config-FZ4UDC4B.js → config-7N6D7YJE.js} +8 -8
- package/dist/cli-bundle/chunks/{context-QBPO3BFM.js → context-AQSLE7DZ.js} +13 -13
- package/dist/cli-bundle/chunks/{context-L36PIN35.js → context-U3PUJMVN.js} +13 -13
- package/dist/cli-bundle/chunks/{contracts-MIXBWJIB.js → contracts-H7KCQXLY.js} +4 -4
- package/dist/cli-bundle/chunks/{contracts-3NKWYKKU.js → contracts-ITSJXO3O.js} +4 -4
- package/dist/cli-bundle/chunks/{copy-ALU5WMHA.js → copy-C4W522JM.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-FWIVTLBO.js → copy-EB3MUCSW.js} +7 -7
- package/dist/cli-bundle/chunks/{create-IFA26O2I.js → create-4EQNELMY.js} +13 -13
- package/dist/cli-bundle/chunks/create-NW3K7LVG.js +27 -0
- package/dist/cli-bundle/chunks/{delete-IYTIYAJS.js → delete-X5QLXIQX.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-Y2SGJBGY.js → delete-ZLGUYIXU.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-CZ4PTVXU.js → deps-GPB3LGWN.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-6TSPOSGU.js → deps-HV2C2L46.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-5WMBVQT2.js → docs-RJQPLROO.js} +11 -11
- package/dist/cli-bundle/chunks/docs-RJQPLROO.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-MB53UJAJ.js → docs-SRTLCQOL.js} +10 -10
- package/dist/cli-bundle/chunks/docs-SRTLCQOL.js.map +7 -0
- package/dist/cli-bundle/chunks/{extension-Q34OEWO5.js → extension-MM3TVWOO.js} +5 -5
- package/dist/cli-bundle/chunks/{extension-WH2FOIOZ.js → extension-WKPVPNCC.js} +5 -5
- package/dist/cli-bundle/chunks/{files-GVMNVLCB.js → files-LIFDKNCN.js} +10 -10
- package/dist/cli-bundle/chunks/files-LIFDKNCN.js.map +7 -0
- package/dist/cli-bundle/chunks/{files-DLB5LJEP.js → files-OIFN3DQX.js} +11 -11
- package/dist/cli-bundle/chunks/files-OIFN3DQX.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-4Z3IKHAZ.js → gc-DL6AVOX5.js} +12 -181
- package/dist/cli-bundle/chunks/gc-DL6AVOX5.js.map +7 -0
- package/dist/cli-bundle/chunks/{gc-2WEPW6D6.js → gc-NRFHLVFT.js} +14 -176
- package/dist/cli-bundle/chunks/gc-NRFHLVFT.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-QARTE6BL.js → get-K7UULTQF.js} +11 -11
- package/dist/cli-bundle/chunks/{get-PCHS7RA6.js → get-SAB7CRBG.js} +11 -11
- package/dist/cli-bundle/chunks/{health-4ZYB3IYQ.js → health-NUVZYIEV.js} +83 -16
- package/dist/cli-bundle/chunks/health-NUVZYIEV.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-YO5LRWN4.js → health-VJWH3ZFK.js} +82 -15
- package/dist/cli-bundle/chunks/health-VJWH3ZFK.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-7WUAEWHW.js → history-GYFD2DJW.js} +10 -10
- package/dist/cli-bundle/chunks/history-IUVN4NTN.js +20 -0
- package/dist/cli-bundle/chunks/{history-compact-3EJ3L2O7.js → history-compact-SLL6ESXH.js} +11 -11
- package/dist/cli-bundle/chunks/{history-compact-LW27IPFK.js → history-compact-WQZQ6KXM.js} +11 -11
- package/dist/cli-bundle/chunks/history-redact-75KIIJUJ.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-G72A4EJ4.js → history-redact-SDTDR6WM.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-RUGKD3YR.js → history-repair-BJCGM6Q3.js} +72 -14
- package/dist/cli-bundle/chunks/history-repair-BJCGM6Q3.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-KVPFJKOS.js → history-repair-UCYS55ZX.js} +71 -13
- package/dist/cli-bundle/chunks/history-repair-UCYS55ZX.js.map +7 -0
- package/dist/cli-bundle/chunks/init-JJFYRUKG.js +17 -0
- package/dist/cli-bundle/chunks/{init-S5WEGUJY.js → init-MXV57LKL.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-HQXSSKZ5.js → learnings-L6KTZGOT.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-XK3P4ZDR.js → learnings-QKJOKEAO.js} +10 -10
- package/dist/cli-bundle/chunks/{list-6CL3XFT6.js → list-GGVPXEV6.js} +10 -10
- package/dist/cli-bundle/chunks/list-VOQDQHA4.js +19 -0
- package/dist/cli-bundle/chunks/{notes-5T6P7C5V.js → notes-3NLK7WTZ.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-U5FZCSBT.js → notes-HMCB7TK6.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-VNUG3WZZ.js → plan-DWBYI5C6.js} +63 -23
- package/dist/cli-bundle/chunks/plan-DWBYI5C6.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-FQLMJRLZ.js → plan-NANUWH4T.js} +62 -22
- package/dist/cli-bundle/chunks/plan-NANUWH4T.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-VHDXWEPP.js → register-list-query-PWQ5F2VI.js} +18 -18
- package/dist/cli-bundle/chunks/{register-list-query-NPE3ECJQ.js → register-list-query-SMMMLSWW.js} +18 -18
- package/dist/cli-bundle/chunks/{register-mutation-EAYNLGOS.js → register-mutation-QKFPTIZG.js} +64 -47
- package/dist/cli-bundle/chunks/{register-mutation-EAYNLGOS.js.map → register-mutation-QKFPTIZG.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-DG53FCBV.js → register-mutation-ZYJQ4DVP.js} +65 -48
- package/dist/cli-bundle/chunks/{register-mutation-DG53FCBV.js.map → register-mutation-ZYJQ4DVP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-FWFE64JG.js → register-operations-2FMZ6WEF.js} +37 -33
- package/dist/cli-bundle/chunks/{register-operations-FWFE64JG.js.map → register-operations-2FMZ6WEF.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-AM6KTWB6.js → register-operations-BAFQURZG.js} +38 -34
- package/dist/cli-bundle/chunks/register-operations-BAFQURZG.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-G4QYI3RX.js → register-setup-DQEIKBIP.js} +30 -30
- package/dist/cli-bundle/chunks/register-setup-DQEIKBIP.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-IKX5524L.js → register-setup-QN2XV7UL.js} +31 -31
- package/dist/cli-bundle/chunks/register-setup-QN2XV7UL.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-DRBNXJJH.js +17 -0
- package/dist/cli-bundle/chunks/{restore-M6AFHMV4.js → restore-FJQWXMPY.js} +11 -11
- package/dist/cli-bundle/chunks/{schema-AINZ2IMM.js → schema-RNVJ55V2.js} +8 -8
- package/dist/cli-bundle/chunks/{schema-76HDZJCC.js → schema-ZZ7ZDM2X.js} +8 -8
- package/dist/cli-bundle/chunks/{search-JMLFQEPJ.js → search-BJ457C2A.js} +10 -10
- package/dist/cli-bundle/chunks/{search-NL3TSCYB.js → search-FQDZXX7P.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-UBD56TGK.js → stats-CUG3ZHOI.js} +7 -7
- package/dist/cli-bundle/chunks/{stats-BKXCBIGT.js → stats-DUQWCVOS.js} +7 -7
- package/dist/cli-bundle/chunks/{telemetry-ZJXK3H7X.js → telemetry-33MRGX4Z.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-N454RHG5.js → telemetry-RK2VX75A.js} +4 -4
- package/dist/cli-bundle/chunks/test-SDMYEQHH.js +32 -0
- package/dist/cli-bundle/chunks/{test-BQAKIXAT.js → test-Y3CTFMEC.js} +14 -14
- package/dist/cli-bundle/chunks/{test-all-7LV3I6S5.js → test-all-ANYQ33O2.js} +14 -14
- package/dist/cli-bundle/chunks/{test-all-TDYCCBA4.js → test-all-ARSMX33Q.js} +14 -14
- package/dist/cli-bundle/chunks/{test-runs-E64M6XS3.js → test-runs-5URSD34O.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-LXZLULCI.js → test-runs-XNACGSNQ.js} +5 -5
- package/dist/cli-bundle/chunks/update-PD46VOXI.js +21 -0
- package/dist/cli-bundle/chunks/update-U235A7WP.js +25 -0
- package/dist/cli-bundle/chunks/{update-many-V4LA3C4H.js → update-many-6B7PJ33I.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-TUGU5YXQ.js → update-many-724JCVDE.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-37F7JKES.js → upgrade-ALBEZAI7.js} +5 -5
- package/dist/cli-bundle/chunks/{upgrade-L32JA4TZ.js → upgrade-QHRGDBSA.js} +5 -5
- package/dist/cli-bundle/chunks/{validate-EQTT6WVX.js → validate-IQRYFXIV.js} +462 -50
- package/dist/cli-bundle/chunks/validate-IQRYFXIV.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-XN4I4DPL.js → validate-UY6DRCG5.js} +482 -49
- package/dist/cli-bundle/chunks/validate-UY6DRCG5.js.map +7 -0
- package/dist/cli-bundle/main.js +72 -24
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/diagnostics/remediation.js +19 -6
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-capability-aliases.js +7 -33
- package/dist/core/extensions/extension-capability-aliases.js.map +1 -1
- package/dist/core/lock/lock-gc.d.ts +31 -0
- package/dist/core/lock/lock-gc.js +120 -62
- package/dist/core/lock/lock-gc.js.map +1 -1
- package/dist/core/search/background-refresh.js +3 -3
- package/dist/core/search/background-refresh.js.map +1 -1
- package/dist/core/shared/errors.d.ts +3 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/store/item-store.js +6 -22
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/telemetry/consent.js +18 -3
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/validate/fix-planning.d.ts +130 -0
- package/dist/core/validate/fix-planning.js +202 -0
- package/dist/core/validate/fix-planning.js.map +1 -0
- package/dist/core/validate/missing-by-type.d.ts +21 -0
- package/dist/core/validate/missing-by-type.js +39 -0
- package/dist/core/validate/missing-by-type.js.map +1 -0
- package/dist/core/validate/stale-file-classification.d.ts +41 -0
- package/dist/core/validate/stale-file-classification.js +73 -0
- package/dist/core/validate/stale-file-classification.js.map +1 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +62 -9
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +38 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +6 -1
- package/dist/sdk/cli-contracts.js +74 -7
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/docs/AGENT_GUIDE.md +6 -1
- package/docs/COMMANDS.md +23 -1
- package/package.json +1 -1
- package/plugins/pm-claude/README.md +4 -12
- package/dist/cli-bundle/chunks/activity-XZIUPGZH.js +0 -16
- package/dist/cli-bundle/chunks/chunk-3KLPFWZ4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-A6LXQFO7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-E5DUIJA4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FXRU333M.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FY4SPXSC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HI7STVF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LCSCXBGT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-P2PSODAQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PSD7F7DX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UOO6BYIA.js.map +0 -1
- package/dist/cli-bundle/chunks/close-4FMAPEMY.js +0 -13
- package/dist/cli-bundle/chunks/create-JVXYHYH4.js +0 -27
- package/dist/cli-bundle/chunks/docs-5WMBVQT2.js.map +0 -1
- package/dist/cli-bundle/chunks/docs-MB53UJAJ.js.map +0 -7
- package/dist/cli-bundle/chunks/files-DLB5LJEP.js.map +0 -1
- package/dist/cli-bundle/chunks/files-GVMNVLCB.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-2WEPW6D6.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-4Z3IKHAZ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-4ZYB3IYQ.js.map +0 -1
- package/dist/cli-bundle/chunks/health-YO5LRWN4.js.map +0 -7
- package/dist/cli-bundle/chunks/history-L2FQFRTU.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-QWQCX5DZ.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-KVPFJKOS.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-RUGKD3YR.js.map +0 -1
- package/dist/cli-bundle/chunks/init-4BKRHGWW.js +0 -17
- package/dist/cli-bundle/chunks/list-BYNN4ZEO.js +0 -19
- package/dist/cli-bundle/chunks/plan-FQLMJRLZ.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-VNUG3WZZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-AM6KTWB6.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-G4QYI3RX.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-IKX5524L.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-CHIOQAQL.js +0 -17
- package/dist/cli-bundle/chunks/test-O74JFUH5.js +0 -32
- package/dist/cli-bundle/chunks/update-2EVXOC7V.js +0 -21
- package/dist/cli-bundle/chunks/update-5A2B6QYB.js +0 -25
- package/dist/cli-bundle/chunks/validate-EQTT6WVX.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-XN4I4DPL.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-XADJOG6G.js.map → activity-PPO7QWJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-XZIUPGZH.js.map → activity-XIOTGZMU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-6OTS3AOO.js.map → aggregate-IRHJWEKG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-OD36DJU5.js.map → aggregate-XEBW22UQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-JYWO4P7W.js.map → append-N2AWXKZC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-KG55G7S3.js.map → append-NL67JNJU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IH4MBKK7.js.map → chunk-2ANTZBYF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F75JSIOZ.js.map → chunk-2J2AH4V5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CCX4RSYZ.js.map → chunk-32XSW44C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DY6C42S6.js.map → chunk-36BCSMKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XUC4C4PT.js.map → chunk-3CQPVBK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SXKNJPQ7.js.map → chunk-3FMQMHAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I7NYDZDV.js.map → chunk-3VULHQNS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HHHJ2GI3.js.map → chunk-4FHLNNW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RXAP6JL5.js.map → chunk-4JHJ7YG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P5BJOMBB.js.map → chunk-4TPFXE2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3SLOMKCJ.js.map → chunk-5HSAHRYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZLMIWZUG.js.map → chunk-5LMF75Q7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TK5VZFHY.js.map → chunk-6TBR5AZ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ATEES5SX.js.map → chunk-6ZFTM65G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VFUZV5EB.js.map → chunk-7SM7VA5I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GKIZW7SM.js.map → chunk-AAUYXSFF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OASDW5UI.js.map → chunk-AUDDXKNX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZMW77VWV.js.map → chunk-BVL5KGVA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4JCSYR6F.js.map → chunk-C24PWDFG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4HFU4UO2.js.map → chunk-CEGUH2E5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y3YKK7CY.js.map → chunk-DWG4FHPY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YW6Q3RYZ.js.map → chunk-GFBEXDCQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XMBI6TNW.js.map → chunk-GOO4UXBI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IGVJRZ6H.js.map → chunk-GRZGHGRG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TNAP7EJX.js.map → chunk-HZOX5BYD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VSRZRLG3.js.map → chunk-IIOIBAQW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IUKD4W6Z.js.map → chunk-IXVSSHGV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WUNFKP7M.js.map → chunk-IZHCCG4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VAOUX6TK.js.map → chunk-JCTZV7TO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZYNJNPYD.js.map → chunk-JE5IZXDS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QNJSITCX.js.map → chunk-JW7D6437.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B65UUCGQ.js.map → chunk-JWXTOYBI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7RIT3OCD.js.map → chunk-KHGTYCJ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VPEAS7PS.js.map → chunk-LGOXXQUW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I2IJY2NL.js.map → chunk-LOAR5TKX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S26FESD4.js.map → chunk-LSSTKL3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CW6E4NAT.js.map → chunk-LYNQ3NGI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4YFAGDRH.js.map → chunk-M3SI2REU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-73ZPG2I3.js.map → chunk-MACCNKSZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P5U5EOMA.js.map → chunk-NN6RKGFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GWZSYR6X.js.map → chunk-O3YCJOVX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UUWGCWBU.js.map → chunk-QQG4HEX7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XTKJSVWH.js.map → chunk-QU3OPNVV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EWFY7SLA.js.map → chunk-RHYBR6G7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S2ZLDYGS.js.map → chunk-SOHXUA2Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KWAXVAXX.js.map → chunk-SQDKAEKG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7IYFN5R7.js.map → chunk-TOX7YQ7X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDH2X65L.js.map → chunk-TSXWFN3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OLKBSY4N.js.map → chunk-UCVJP4JL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AVGHVVF7.js.map → chunk-V4KP3TCN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QKW5D45B.js.map → chunk-VNC2HBL4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QJMGRZO2.js.map → chunk-VYZNX4C5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5SCT2JCT.js.map → chunk-W6KNFAMZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I53JBTJW.js.map → chunk-WLH7X4RN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ESANVZF4.js.map → chunk-XOYHMHFF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HGLC63AU.js.map → chunk-XWDZVCBJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-MJ7DZFC3.js.map → claim-HE6KEGJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-2RDYMCTP.js.map → claim-QJOQBH7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-XLEKIQSW.js.map → close-SPUFW5QR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-4FMAPEMY.js.map → close-WOG5WTMZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-AOD4HSAZ.js.map → close-many-GKAJX54X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-XKAQY5CQ.js.map → close-many-GL6NRUU5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-RN5TG4ZN.js.map → comments-5FPT6L7N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-B4RWWDJT.js.map → comments-TOLOYWNI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-3JXJ3XZ7.js.map → config-4MN45TIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-FZ4UDC4B.js.map → config-7N6D7YJE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-QBPO3BFM.js.map → context-AQSLE7DZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-L36PIN35.js.map → context-U3PUJMVN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-MIXBWJIB.js.map → contracts-H7KCQXLY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-3NKWYKKU.js.map → contracts-ITSJXO3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-ALU5WMHA.js.map → copy-C4W522JM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-FWIVTLBO.js.map → copy-EB3MUCSW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-IFA26O2I.js.map → create-4EQNELMY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JVXYHYH4.js.map → create-NW3K7LVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-IYTIYAJS.js.map → delete-X5QLXIQX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-Y2SGJBGY.js.map → delete-ZLGUYIXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-CZ4PTVXU.js.map → deps-GPB3LGWN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-6TSPOSGU.js.map → deps-HV2C2L46.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-Q34OEWO5.js.map → extension-MM3TVWOO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-WH2FOIOZ.js.map → extension-WKPVPNCC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-QARTE6BL.js.map → get-K7UULTQF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-PCHS7RA6.js.map → get-SAB7CRBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-7WUAEWHW.js.map → history-GYFD2DJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-L2FQFRTU.js.map → history-IUVN4NTN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-3EJ3L2O7.js.map → history-compact-SLL6ESXH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-LW27IPFK.js.map → history-compact-WQZQ6KXM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-QWQCX5DZ.js.map → history-redact-75KIIJUJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-G72A4EJ4.js.map → history-redact-SDTDR6WM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-4BKRHGWW.js.map → init-JJFYRUKG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-S5WEGUJY.js.map → init-MXV57LKL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-HQXSSKZ5.js.map → learnings-L6KTZGOT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-XK3P4ZDR.js.map → learnings-QKJOKEAO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-6CL3XFT6.js.map → list-GGVPXEV6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-BYNN4ZEO.js.map → list-VOQDQHA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-5T6P7C5V.js.map → notes-3NLK7WTZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-U5FZCSBT.js.map → notes-HMCB7TK6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-VHDXWEPP.js.map → register-list-query-PWQ5F2VI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-NPE3ECJQ.js.map → register-list-query-SMMMLSWW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-CHIOQAQL.js.map → restore-DRBNXJJH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-M6AFHMV4.js.map → restore-FJQWXMPY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-AINZ2IMM.js.map → schema-RNVJ55V2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-76HDZJCC.js.map → schema-ZZ7ZDM2X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-JMLFQEPJ.js.map → search-BJ457C2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-NL3TSCYB.js.map → search-FQDZXX7P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-UBD56TGK.js.map → stats-CUG3ZHOI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-BKXCBIGT.js.map → stats-DUQWCVOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-ZJXK3H7X.js.map → telemetry-33MRGX4Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-N454RHG5.js.map → telemetry-RK2VX75A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-O74JFUH5.js.map → test-SDMYEQHH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-BQAKIXAT.js.map → test-Y3CTFMEC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-7LV3I6S5.js.map → test-all-ANYQ33O2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-TDYCCBA4.js.map → test-all-ARSMX33Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-E64M6XS3.js.map → test-runs-5URSD34O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-LXZLULCI.js.map → test-runs-XNACGSNQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-2EVXOC7V.js.map → update-PD46VOXI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-5A2B6QYB.js.map → update-U235A7WP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-V4LA3C4H.js.map → update-many-6B7PJ33I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-TUGU5YXQ.js.map → update-many-724JCVDE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-37F7JKES.js.map → upgrade-ALBEZAI7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-L32JA4TZ.js.map → upgrade-QHRGDBSA.js.map} +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fix planning for `pm validate --auto-fix` / `--prune-missing` (pm-c3sz,
|
|
3
|
+
* pm-8jss, pm-0v2m).
|
|
4
|
+
*
|
|
5
|
+
* Pure module: planners turn check findings into declarative
|
|
6
|
+
* {@link ValidateFixRecord}s; the validate command decides whether to apply
|
|
7
|
+
* them (apply mode), preview them (`--dry-run`), or withhold gated fixes
|
|
8
|
+
* (lifecycle structural changes require an explicit `--fix-scope lifecycle`).
|
|
9
|
+
*
|
|
10
|
+
* Safety invariants:
|
|
11
|
+
* - Every planned fix is deterministic and non-destructive: it only sets a
|
|
12
|
+
* derivable field value or removes a stale LINK (never a real file).
|
|
13
|
+
* - No fix ever closes, deletes, or cancels an item.
|
|
14
|
+
* - Lifecycle fixes (reparent / unset parent) are structural, so they are
|
|
15
|
+
* planned with `gate: "lifecycle"` and only applied when that scope was
|
|
16
|
+
* explicitly granted.
|
|
17
|
+
*/
|
|
18
|
+
export type ValidateFixCheck = "metadata" | "resolution" | "lifecycle" | "files";
|
|
19
|
+
export type ValidateFixKind = "set_resolution" | "set_close_reason" | "reparent" | "unset_parent" | "prune_file_link" | "prune_doc_link";
|
|
20
|
+
export type ValidateFixScope = "metadata" | "resolution" | "lifecycle";
|
|
21
|
+
/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */
|
|
22
|
+
export declare const DEFAULT_GRANTED_FIX_SCOPES: readonly ValidateFixScope[];
|
|
23
|
+
/** Scopes accepted by `--fix-scope` (lifecycle is the opt-in structural scope). */
|
|
24
|
+
export declare const SUPPORTED_FIX_SCOPES: readonly ValidateFixScope[];
|
|
25
|
+
export interface ValidateFixRecord {
|
|
26
|
+
/** Item the fix targets. */
|
|
27
|
+
item_id: string;
|
|
28
|
+
/** Validate check the finding came from. */
|
|
29
|
+
check: ValidateFixCheck;
|
|
30
|
+
/** Front-matter field (or link list) the fix changes. */
|
|
31
|
+
field: string;
|
|
32
|
+
/** Declarative fix kind the applier dispatches on. */
|
|
33
|
+
kind: ValidateFixKind;
|
|
34
|
+
/** Equivalent standalone `pm` command for the fix. */
|
|
35
|
+
command: string;
|
|
36
|
+
/** New value for set-field fixes. */
|
|
37
|
+
value?: string;
|
|
38
|
+
/** Stale link path for prune fixes. */
|
|
39
|
+
path?: string;
|
|
40
|
+
/** Target parent id for reparent fixes. */
|
|
41
|
+
parent_id?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Fix scope the `--fix-scope` allowlist must grant for the fix to be
|
|
44
|
+
* applied. Every `--auto-fix` record carries one (the granted default is
|
|
45
|
+
* metadata+resolution; lifecycle must be named explicitly). Absent only on
|
|
46
|
+
* `--prune-missing` records, which are governed by their own flag.
|
|
47
|
+
*/
|
|
48
|
+
gate?: ValidateFixScope;
|
|
49
|
+
}
|
|
50
|
+
/** Default resolution backfilled onto closed items with no derivable source text. */
|
|
51
|
+
export declare const DEFAULT_RESOLUTION_BACKFILL_VALUE = "completed";
|
|
52
|
+
export interface ResolutionBackfillRow {
|
|
53
|
+
id: string;
|
|
54
|
+
/** Resolution-check missing field keys for this closed item. */
|
|
55
|
+
missing_fields: readonly string[];
|
|
56
|
+
/** The item's close_reason, when present (preferred derivation source). */
|
|
57
|
+
close_reason?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Plan resolution backfills for closed items flagged by the resolution check.
|
|
61
|
+
* Only the `resolution` field is mechanical enough to auto-fix: it derives
|
|
62
|
+
* from the item's own `close_reason` when present and falls back to the
|
|
63
|
+
* `"completed"` default. `expected_result` / `actual_result` stay hint-only —
|
|
64
|
+
* no deterministic source text exists for them.
|
|
65
|
+
*/
|
|
66
|
+
export declare function planResolutionBackfillFixes(rows: readonly ResolutionBackfillRow[]): ValidateFixRecord[];
|
|
67
|
+
export interface CloseReasonBackfillRow {
|
|
68
|
+
id: string;
|
|
69
|
+
/** The item's resolution, when present (the only derivation source). */
|
|
70
|
+
resolution?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Plan close_reason backfills for closed items flagged by the metadata check.
|
|
74
|
+
* Only derivable when the item already carries a resolution; items missing
|
|
75
|
+
* both stay hint-only (any synthesized reason would be fabricated, not
|
|
76
|
+
* derived).
|
|
77
|
+
*/
|
|
78
|
+
export declare function planCloseReasonBackfillFixes(rows: readonly CloseReasonBackfillRow[]): ValidateFixRecord[];
|
|
79
|
+
export interface TerminalParentFixRow {
|
|
80
|
+
id: string;
|
|
81
|
+
parent_id: string;
|
|
82
|
+
/** The terminal parent's own parent, when one exists. */
|
|
83
|
+
grandparent_id?: string;
|
|
84
|
+
/** True when the grandparent exists and is NOT terminal (safe reparent target). */
|
|
85
|
+
grandparent_active?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Plan lifecycle fixes for active items whose parent is terminal (pm-8jss /
|
|
89
|
+
* GH-168). When the terminal parent has an active grandparent, the child is
|
|
90
|
+
* reparented one level up (it stays inside the same hierarchy); otherwise the
|
|
91
|
+
* parent link is cleared so the item surfaces as unparented active work.
|
|
92
|
+
* Either way the item itself is never closed or mutated beyond `parent` —
|
|
93
|
+
* and every fix carries `gate: "lifecycle"` so it is only applied under an
|
|
94
|
+
* explicit `--fix-scope lifecycle`.
|
|
95
|
+
*/
|
|
96
|
+
export declare function planTerminalParentFixes(rows: readonly TerminalParentFixRow[]): ValidateFixRecord[];
|
|
97
|
+
export interface StaleLinkPruneRow {
|
|
98
|
+
item_id: string;
|
|
99
|
+
path: string;
|
|
100
|
+
link_kind: "files" | "docs";
|
|
101
|
+
classification: "moved" | "deleted";
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Plan link prunes for `--prune-missing` (pm-0v2m / GH-184). Only links whose
|
|
105
|
+
* stale path classified as `deleted` are pruned; `moved` links keep their
|
|
106
|
+
* relink candidates in the files-check details instead of being dropped, so
|
|
107
|
+
* recoverable link information is never destroyed. Link removal only — real
|
|
108
|
+
* files are never touched.
|
|
109
|
+
*/
|
|
110
|
+
export declare function planStaleLinkPruneFixes(rows: readonly StaleLinkPruneRow[]): ValidateFixRecord[];
|
|
111
|
+
/**
|
|
112
|
+
* Resolve the granted `--fix-scope` set (repeatable and/or comma-separated).
|
|
113
|
+
* With no explicit scopes the safe field-backfill scopes (metadata,
|
|
114
|
+
* resolution) are granted; lifecycle must always be named explicitly. Unknown
|
|
115
|
+
* values fail fast with the supported list.
|
|
116
|
+
*/
|
|
117
|
+
export declare function resolveGrantedFixScopes(rawScopes: readonly string[] | undefined): Set<ValidateFixScope>;
|
|
118
|
+
/**
|
|
119
|
+
* Split a fix plan into the records that may be applied under the granted
|
|
120
|
+
* scopes and the gated records that were withheld. `--fix-scope` is an exact
|
|
121
|
+
* allowlist: every `--auto-fix` record requires its gate scope in `granted`.
|
|
122
|
+
* Ungated records (`--prune-missing` link prunes, governed by their own flag)
|
|
123
|
+
* are always applicable.
|
|
124
|
+
*/
|
|
125
|
+
export declare function partitionFixesByGrant(fixes: readonly ValidateFixRecord[], granted: ReadonlySet<ValidateFixScope>): {
|
|
126
|
+
applicable: ValidateFixRecord[];
|
|
127
|
+
gated: ValidateFixRecord[];
|
|
128
|
+
};
|
|
129
|
+
/** Compact serialization of a fix for planned/applied output rows. */
|
|
130
|
+
export declare function toFixOutputRow(fix: ValidateFixRecord): Record<string, unknown>;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fix planning for `pm validate --auto-fix` / `--prune-missing` (pm-c3sz,
|
|
3
|
+
* pm-8jss, pm-0v2m).
|
|
4
|
+
*
|
|
5
|
+
* Pure module: planners turn check findings into declarative
|
|
6
|
+
* {@link ValidateFixRecord}s; the validate command decides whether to apply
|
|
7
|
+
* them (apply mode), preview them (`--dry-run`), or withhold gated fixes
|
|
8
|
+
* (lifecycle structural changes require an explicit `--fix-scope lifecycle`).
|
|
9
|
+
*
|
|
10
|
+
* Safety invariants:
|
|
11
|
+
* - Every planned fix is deterministic and non-destructive: it only sets a
|
|
12
|
+
* derivable field value or removes a stale LINK (never a real file).
|
|
13
|
+
* - No fix ever closes, deletes, or cancels an item.
|
|
14
|
+
* - Lifecycle fixes (reparent / unset parent) are structural, so they are
|
|
15
|
+
* planned with `gate: "lifecycle"` and only applied when that scope was
|
|
16
|
+
* explicitly granted.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7163fbbf-1a9c-52e0-a1d5-6034abefc50f")}catch(e){}}();
|
|
20
|
+
import { EXIT_CODE } from "../shared/constants.js";
|
|
21
|
+
import { PmCliError } from "../shared/errors.js";
|
|
22
|
+
/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */
|
|
23
|
+
export const DEFAULT_GRANTED_FIX_SCOPES = ["metadata", "resolution"];
|
|
24
|
+
/** Scopes accepted by `--fix-scope` (lifecycle is the opt-in structural scope). */
|
|
25
|
+
export const SUPPORTED_FIX_SCOPES = ["metadata", "resolution", "lifecycle"];
|
|
26
|
+
/** Default resolution backfilled onto closed items with no derivable source text. */
|
|
27
|
+
export const DEFAULT_RESOLUTION_BACKFILL_VALUE = "completed";
|
|
28
|
+
function quoteForCommand(value) {
|
|
29
|
+
return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
30
|
+
}
|
|
31
|
+
function toMeaningfulValue(value) {
|
|
32
|
+
const trimmed = value?.trim();
|
|
33
|
+
return trimmed !== undefined && trimmed.length > 0 ? trimmed : undefined;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Plan resolution backfills for closed items flagged by the resolution check.
|
|
37
|
+
* Only the `resolution` field is mechanical enough to auto-fix: it derives
|
|
38
|
+
* from the item's own `close_reason` when present and falls back to the
|
|
39
|
+
* `"completed"` default. `expected_result` / `actual_result` stay hint-only —
|
|
40
|
+
* no deterministic source text exists for them.
|
|
41
|
+
*/
|
|
42
|
+
export function planResolutionBackfillFixes(rows) {
|
|
43
|
+
const fixes = [];
|
|
44
|
+
for (const row of rows) {
|
|
45
|
+
if (!row.missing_fields.includes("resolution")) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const value = toMeaningfulValue(row.close_reason) ?? DEFAULT_RESOLUTION_BACKFILL_VALUE;
|
|
49
|
+
fixes.push({
|
|
50
|
+
item_id: row.id,
|
|
51
|
+
check: "resolution",
|
|
52
|
+
field: "resolution",
|
|
53
|
+
kind: "set_resolution",
|
|
54
|
+
value,
|
|
55
|
+
command: `pm update ${row.id} --resolution ${quoteForCommand(value)}`,
|
|
56
|
+
gate: "resolution",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return fixes;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Plan close_reason backfills for closed items flagged by the metadata check.
|
|
63
|
+
* Only derivable when the item already carries a resolution; items missing
|
|
64
|
+
* both stay hint-only (any synthesized reason would be fabricated, not
|
|
65
|
+
* derived).
|
|
66
|
+
*/
|
|
67
|
+
export function planCloseReasonBackfillFixes(rows) {
|
|
68
|
+
const fixes = [];
|
|
69
|
+
for (const row of rows) {
|
|
70
|
+
const value = toMeaningfulValue(row.resolution);
|
|
71
|
+
if (value === undefined) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
fixes.push({
|
|
75
|
+
item_id: row.id,
|
|
76
|
+
check: "metadata",
|
|
77
|
+
field: "close_reason",
|
|
78
|
+
kind: "set_close_reason",
|
|
79
|
+
value,
|
|
80
|
+
command: `pm update ${row.id} --close-reason ${quoteForCommand(value)}`,
|
|
81
|
+
gate: "metadata",
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return fixes;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Plan lifecycle fixes for active items whose parent is terminal (pm-8jss /
|
|
88
|
+
* GH-168). When the terminal parent has an active grandparent, the child is
|
|
89
|
+
* reparented one level up (it stays inside the same hierarchy); otherwise the
|
|
90
|
+
* parent link is cleared so the item surfaces as unparented active work.
|
|
91
|
+
* Either way the item itself is never closed or mutated beyond `parent` —
|
|
92
|
+
* and every fix carries `gate: "lifecycle"` so it is only applied under an
|
|
93
|
+
* explicit `--fix-scope lifecycle`.
|
|
94
|
+
*/
|
|
95
|
+
export function planTerminalParentFixes(rows) {
|
|
96
|
+
return rows.map((row) => {
|
|
97
|
+
if (row.grandparent_id !== undefined && row.grandparent_active === true) {
|
|
98
|
+
return {
|
|
99
|
+
item_id: row.id,
|
|
100
|
+
check: "lifecycle",
|
|
101
|
+
field: "parent",
|
|
102
|
+
kind: "reparent",
|
|
103
|
+
parent_id: row.grandparent_id,
|
|
104
|
+
command: `pm update ${row.id} --parent ${row.grandparent_id}`,
|
|
105
|
+
gate: "lifecycle",
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
item_id: row.id,
|
|
110
|
+
check: "lifecycle",
|
|
111
|
+
field: "parent",
|
|
112
|
+
kind: "unset_parent",
|
|
113
|
+
command: `pm update ${row.id} --unset parent`,
|
|
114
|
+
gate: "lifecycle",
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Plan link prunes for `--prune-missing` (pm-0v2m / GH-184). Only links whose
|
|
120
|
+
* stale path classified as `deleted` are pruned; `moved` links keep their
|
|
121
|
+
* relink candidates in the files-check details instead of being dropped, so
|
|
122
|
+
* recoverable link information is never destroyed. Link removal only — real
|
|
123
|
+
* files are never touched.
|
|
124
|
+
*/
|
|
125
|
+
export function planStaleLinkPruneFixes(rows) {
|
|
126
|
+
const fixes = [];
|
|
127
|
+
for (const row of rows) {
|
|
128
|
+
if (row.classification !== "deleted") {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const noun = row.link_kind === "files" ? "files" : "docs";
|
|
132
|
+
fixes.push({
|
|
133
|
+
item_id: row.item_id,
|
|
134
|
+
check: "files",
|
|
135
|
+
field: row.link_kind,
|
|
136
|
+
kind: row.link_kind === "files" ? "prune_file_link" : "prune_doc_link",
|
|
137
|
+
path: row.path,
|
|
138
|
+
command: `pm ${noun} ${row.item_id} --remove ${quoteForCommand(row.path)}`,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return fixes;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Resolve the granted `--fix-scope` set (repeatable and/or comma-separated).
|
|
145
|
+
* With no explicit scopes the safe field-backfill scopes (metadata,
|
|
146
|
+
* resolution) are granted; lifecycle must always be named explicitly. Unknown
|
|
147
|
+
* values fail fast with the supported list.
|
|
148
|
+
*/
|
|
149
|
+
export function resolveGrantedFixScopes(rawScopes) {
|
|
150
|
+
const tokens = (rawScopes ?? [])
|
|
151
|
+
.flatMap((raw) => raw.split(","))
|
|
152
|
+
.map((raw) => raw.trim())
|
|
153
|
+
.filter((raw) => raw.length > 0);
|
|
154
|
+
if (tokens.length === 0) {
|
|
155
|
+
if (rawScopes !== undefined && rawScopes.length > 0) {
|
|
156
|
+
throw new PmCliError(`--fix-scope values must not be empty. Supported values: ${SUPPORTED_FIX_SCOPES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
157
|
+
}
|
|
158
|
+
return new Set(DEFAULT_GRANTED_FIX_SCOPES);
|
|
159
|
+
}
|
|
160
|
+
const granted = new Set();
|
|
161
|
+
for (const raw of tokens) {
|
|
162
|
+
const normalized = raw.toLowerCase().replaceAll("-", "_");
|
|
163
|
+
if (SUPPORTED_FIX_SCOPES.includes(normalized)) {
|
|
164
|
+
granted.add(normalized);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
throw new PmCliError(`Unknown --fix-scope value "${raw}". Supported values: ${SUPPORTED_FIX_SCOPES.join(", ")}.`, EXIT_CODE.USAGE);
|
|
168
|
+
}
|
|
169
|
+
return granted;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Split a fix plan into the records that may be applied under the granted
|
|
173
|
+
* scopes and the gated records that were withheld. `--fix-scope` is an exact
|
|
174
|
+
* allowlist: every `--auto-fix` record requires its gate scope in `granted`.
|
|
175
|
+
* Ungated records (`--prune-missing` link prunes, governed by their own flag)
|
|
176
|
+
* are always applicable.
|
|
177
|
+
*/
|
|
178
|
+
export function partitionFixesByGrant(fixes, granted) {
|
|
179
|
+
const applicable = [];
|
|
180
|
+
const gated = [];
|
|
181
|
+
for (const fix of fixes) {
|
|
182
|
+
if (fix.gate !== undefined && !granted.has(fix.gate)) {
|
|
183
|
+
gated.push(fix);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
applicable.push(fix);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return { applicable, gated };
|
|
190
|
+
}
|
|
191
|
+
/** Compact serialization of a fix for planned/applied output rows. */
|
|
192
|
+
export function toFixOutputRow(fix) {
|
|
193
|
+
return {
|
|
194
|
+
item_id: fix.item_id,
|
|
195
|
+
check: fix.check,
|
|
196
|
+
field: fix.field,
|
|
197
|
+
command: fix.command,
|
|
198
|
+
...(fix.gate !== undefined ? { gate: fix.gate } : {}),
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=fix-planning.js.map
|
|
202
|
+
//# debugId=7163fbbf-1a9c-52e0-a1d5-6034abefc50f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-planning.js","sources":["core/validate/fix-planning.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Fix planning for `pm validate --auto-fix` / `--prune-missing` (pm-c3sz,\n * pm-8jss, pm-0v2m).\n *\n * Pure module: planners turn check findings into declarative\n * {@link ValidateFixRecord}s; the validate command decides whether to apply\n * them (apply mode), preview them (`--dry-run`), or withhold gated fixes\n * (lifecycle structural changes require an explicit `--fix-scope lifecycle`).\n *\n * Safety invariants:\n * - Every planned fix is deterministic and non-destructive: it only sets a\n * derivable field value or removes a stale LINK (never a real file).\n * - No fix ever closes, deletes, or cancels an item.\n * - Lifecycle fixes (reparent / unset parent) are structural, so they are\n * planned with `gate: \"lifecycle\"` and only applied when that scope was\n * explicitly granted.\n */\n\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nexport type ValidateFixCheck = \"metadata\" | \"resolution\" | \"lifecycle\" | \"files\";\n\nexport type ValidateFixKind =\n | \"set_resolution\"\n | \"set_close_reason\"\n | \"reparent\"\n | \"unset_parent\"\n | \"prune_file_link\"\n | \"prune_doc_link\";\n\nexport type ValidateFixScope = \"metadata\" | \"resolution\" | \"lifecycle\";\n\n/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */\nexport const DEFAULT_GRANTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\"];\n\n/** Scopes accepted by `--fix-scope` (lifecycle is the opt-in structural scope). */\nexport const SUPPORTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\", \"lifecycle\"];\n\nexport interface ValidateFixRecord {\n /** Item the fix targets. */\n item_id: string;\n /** Validate check the finding came from. */\n check: ValidateFixCheck;\n /** Front-matter field (or link list) the fix changes. */\n field: string;\n /** Declarative fix kind the applier dispatches on. */\n kind: ValidateFixKind;\n /** Equivalent standalone `pm` command for the fix. */\n command: string;\n /** New value for set-field fixes. */\n value?: string;\n /** Stale link path for prune fixes. */\n path?: string;\n /** Target parent id for reparent fixes. */\n parent_id?: string;\n /**\n * Fix scope the `--fix-scope` allowlist must grant for the fix to be\n * applied. Every `--auto-fix` record carries one (the granted default is\n * metadata+resolution; lifecycle must be named explicitly). Absent only on\n * `--prune-missing` records, which are governed by their own flag.\n */\n gate?: ValidateFixScope;\n}\n\n/** Default resolution backfilled onto closed items with no derivable source text. */\nexport const DEFAULT_RESOLUTION_BACKFILL_VALUE = \"completed\";\n\nfunction quoteForCommand(value: string): string {\n return `\"${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"')}\"`;\n}\n\nfunction toMeaningfulValue(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed !== undefined && trimmed.length > 0 ? trimmed : undefined;\n}\n\nexport interface ResolutionBackfillRow {\n id: string;\n /** Resolution-check missing field keys for this closed item. */\n missing_fields: readonly string[];\n /** The item's close_reason, when present (preferred derivation source). */\n close_reason?: string;\n}\n\n/**\n * Plan resolution backfills for closed items flagged by the resolution check.\n * Only the `resolution` field is mechanical enough to auto-fix: it derives\n * from the item's own `close_reason` when present and falls back to the\n * `\"completed\"` default. `expected_result` / `actual_result` stay hint-only —\n * no deterministic source text exists for them.\n */\nexport function planResolutionBackfillFixes(rows: readonly ResolutionBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (!row.missing_fields.includes(\"resolution\")) {\n continue;\n }\n const value = toMeaningfulValue(row.close_reason) ?? DEFAULT_RESOLUTION_BACKFILL_VALUE;\n fixes.push({\n item_id: row.id,\n check: \"resolution\",\n field: \"resolution\",\n kind: \"set_resolution\",\n value,\n command: `pm update ${row.id} --resolution ${quoteForCommand(value)}`,\n gate: \"resolution\",\n });\n }\n return fixes;\n}\n\nexport interface CloseReasonBackfillRow {\n id: string;\n /** The item's resolution, when present (the only derivation source). */\n resolution?: string;\n}\n\n/**\n * Plan close_reason backfills for closed items flagged by the metadata check.\n * Only derivable when the item already carries a resolution; items missing\n * both stay hint-only (any synthesized reason would be fabricated, not\n * derived).\n */\nexport function planCloseReasonBackfillFixes(rows: readonly CloseReasonBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n const value = toMeaningfulValue(row.resolution);\n if (value === undefined) {\n continue;\n }\n fixes.push({\n item_id: row.id,\n check: \"metadata\",\n field: \"close_reason\",\n kind: \"set_close_reason\",\n value,\n command: `pm update ${row.id} --close-reason ${quoteForCommand(value)}`,\n gate: \"metadata\",\n });\n }\n return fixes;\n}\n\nexport interface TerminalParentFixRow {\n id: string;\n parent_id: string;\n /** The terminal parent's own parent, when one exists. */\n grandparent_id?: string;\n /** True when the grandparent exists and is NOT terminal (safe reparent target). */\n grandparent_active?: boolean;\n}\n\n/**\n * Plan lifecycle fixes for active items whose parent is terminal (pm-8jss /\n * GH-168). When the terminal parent has an active grandparent, the child is\n * reparented one level up (it stays inside the same hierarchy); otherwise the\n * parent link is cleared so the item surfaces as unparented active work.\n * Either way the item itself is never closed or mutated beyond `parent` —\n * and every fix carries `gate: \"lifecycle\"` so it is only applied under an\n * explicit `--fix-scope lifecycle`.\n */\nexport function planTerminalParentFixes(rows: readonly TerminalParentFixRow[]): ValidateFixRecord[] {\n return rows.map((row) => {\n if (row.grandparent_id !== undefined && row.grandparent_active === true) {\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"reparent\" as const,\n parent_id: row.grandparent_id,\n command: `pm update ${row.id} --parent ${row.grandparent_id}`,\n gate: \"lifecycle\" as const,\n };\n }\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"unset_parent\" as const,\n command: `pm update ${row.id} --unset parent`,\n gate: \"lifecycle\" as const,\n };\n });\n}\n\nexport interface StaleLinkPruneRow {\n item_id: string;\n path: string;\n link_kind: \"files\" | \"docs\";\n classification: \"moved\" | \"deleted\";\n}\n\n/**\n * Plan link prunes for `--prune-missing` (pm-0v2m / GH-184). Only links whose\n * stale path classified as `deleted` are pruned; `moved` links keep their\n * relink candidates in the files-check details instead of being dropped, so\n * recoverable link information is never destroyed. Link removal only — real\n * files are never touched.\n */\nexport function planStaleLinkPruneFixes(rows: readonly StaleLinkPruneRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (row.classification !== \"deleted\") {\n continue;\n }\n const noun = row.link_kind === \"files\" ? \"files\" : \"docs\";\n fixes.push({\n item_id: row.item_id,\n check: \"files\",\n field: row.link_kind,\n kind: row.link_kind === \"files\" ? \"prune_file_link\" : \"prune_doc_link\",\n path: row.path,\n command: `pm ${noun} ${row.item_id} --remove ${quoteForCommand(row.path)}`,\n });\n }\n return fixes;\n}\n\n/**\n * Resolve the granted `--fix-scope` set (repeatable and/or comma-separated).\n * With no explicit scopes the safe field-backfill scopes (metadata,\n * resolution) are granted; lifecycle must always be named explicitly. Unknown\n * values fail fast with the supported list.\n */\nexport function resolveGrantedFixScopes(rawScopes: readonly string[] | undefined): Set<ValidateFixScope> {\n const tokens = (rawScopes ?? [])\n .flatMap((raw) => raw.split(\",\"))\n .map((raw) => raw.trim())\n .filter((raw) => raw.length > 0);\n if (tokens.length === 0) {\n if (rawScopes !== undefined && rawScopes.length > 0) {\n throw new PmCliError(\n `--fix-scope values must not be empty. Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return new Set(DEFAULT_GRANTED_FIX_SCOPES);\n }\n const granted = new Set<ValidateFixScope>();\n for (const raw of tokens) {\n const normalized = raw.toLowerCase().replaceAll(\"-\", \"_\");\n if ((SUPPORTED_FIX_SCOPES as readonly string[]).includes(normalized)) {\n granted.add(normalized as ValidateFixScope);\n continue;\n }\n throw new PmCliError(\n `Unknown --fix-scope value \"${raw}\". Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return granted;\n}\n\n/**\n * Split a fix plan into the records that may be applied under the granted\n * scopes and the gated records that were withheld. `--fix-scope` is an exact\n * allowlist: every `--auto-fix` record requires its gate scope in `granted`.\n * Ungated records (`--prune-missing` link prunes, governed by their own flag)\n * are always applicable.\n */\nexport function partitionFixesByGrant(\n fixes: readonly ValidateFixRecord[],\n granted: ReadonlySet<ValidateFixScope>,\n): { applicable: ValidateFixRecord[]; gated: ValidateFixRecord[] } {\n const applicable: ValidateFixRecord[] = [];\n const gated: ValidateFixRecord[] = [];\n for (const fix of fixes) {\n if (fix.gate !== undefined && !granted.has(fix.gate)) {\n gated.push(fix);\n } else {\n applicable.push(fix);\n }\n }\n return { applicable, gated };\n}\n\n/** Compact serialization of a fix for planned/applied output rows. */\nexport function toFixOutputRow(fix: ValidateFixRecord): Record<string, unknown> {\n return {\n item_id: fix.item_id,\n check: fix.check,\n field: fix.field,\n command: fix.command,\n ...(fix.gate !== undefined ? { gate: fix.gate } : {}),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAcjD,oFAAoF;AACpF,MAAM,CAAC,MAAM,0BAA0B,GAAgC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAElG,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAgC,CAAC,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;AA4BzG,qFAAqF;AACrF,MAAM,CAAC,MAAM,iCAAiC,GAAG,WAAW,CAAC;AAE7D,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,IAA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AAK;QAChB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC;AACJ,CAAC","debugId":"7163fbbf-1a9c-52e0-a1d5-6034abefc50f"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-item-type grouping of missing-required-field counts for
|
|
3
|
+
* `pm validate --check-metadata` (pm-pmyq / GH-172).
|
|
4
|
+
*
|
|
5
|
+
* Pure module: callers stream `(item_type, field)` pairs — one per missing
|
|
6
|
+
* required field occurrence — and receive a compact, deterministically sorted
|
|
7
|
+
* `missing_by_type` map of counts (never row dumps), e.g.
|
|
8
|
+
* `{ Task: { close_reason: 3, reviewer: 1 } }`.
|
|
9
|
+
*/
|
|
10
|
+
export interface MissingFieldOccurrence {
|
|
11
|
+
/** Item type name as stored in front matter (e.g. "Task"). */
|
|
12
|
+
item_type: string;
|
|
13
|
+
/** Required metadata field that is missing on the item. */
|
|
14
|
+
field: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Aggregate missing-field occurrences into `{ type: { field: count } }` with
|
|
18
|
+
* both levels sorted lexicographically for stable, diff-friendly output.
|
|
19
|
+
* Zero counts never appear (only observed occurrences are aggregated).
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildMissingByTypeCounts(occurrences: Iterable<MissingFieldOccurrence>): Record<string, Record<string, number>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-item-type grouping of missing-required-field counts for
|
|
3
|
+
* `pm validate --check-metadata` (pm-pmyq / GH-172).
|
|
4
|
+
*
|
|
5
|
+
* Pure module: callers stream `(item_type, field)` pairs — one per missing
|
|
6
|
+
* required field occurrence — and receive a compact, deterministically sorted
|
|
7
|
+
* `missing_by_type` map of counts (never row dumps), e.g.
|
|
8
|
+
* `{ Task: { close_reason: 3, reviewer: 1 } }`.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Aggregate missing-field occurrences into `{ type: { field: count } }` with
|
|
12
|
+
* both levels sorted lexicographically for stable, diff-friendly output.
|
|
13
|
+
* Zero counts never appear (only observed occurrences are aggregated).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="16988d98-5a10-5e0a-952c-0a6289ab5935")}catch(e){}}();
|
|
17
|
+
export function buildMissingByTypeCounts(occurrences) {
|
|
18
|
+
const countsByType = new Map();
|
|
19
|
+
for (const occurrence of occurrences) {
|
|
20
|
+
let fieldCounts = countsByType.get(occurrence.item_type);
|
|
21
|
+
if (!fieldCounts) {
|
|
22
|
+
fieldCounts = new Map();
|
|
23
|
+
countsByType.set(occurrence.item_type, fieldCounts);
|
|
24
|
+
}
|
|
25
|
+
fieldCounts.set(occurrence.field, (fieldCounts.get(occurrence.field) ?? 0) + 1);
|
|
26
|
+
}
|
|
27
|
+
const result = {};
|
|
28
|
+
for (const type of [...countsByType.keys()].sort((left, right) => left.localeCompare(right))) {
|
|
29
|
+
const fieldCounts = countsByType.get(type);
|
|
30
|
+
const fields = {};
|
|
31
|
+
for (const field of [...fieldCounts.keys()].sort((left, right) => left.localeCompare(right))) {
|
|
32
|
+
fields[field] = fieldCounts.get(field);
|
|
33
|
+
}
|
|
34
|
+
result[type] = fields;
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=missing-by-type.js.map
|
|
39
|
+
//# debugId=16988d98-5a10-5e0a-952c-0a6289ab5935
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-by-type.js","sources":["core/validate/missing-by-type.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Per-item-type grouping of missing-required-field counts for\n * `pm validate --check-metadata` (pm-pmyq / GH-172).\n *\n * Pure module: callers stream `(item_type, field)` pairs — one per missing\n * required field occurrence — and receive a compact, deterministically sorted\n * `missing_by_type` map of counts (never row dumps), e.g.\n * `{ Task: { close_reason: 3, reviewer: 1 } }`.\n */\n\nexport interface MissingFieldOccurrence {\n /** Item type name as stored in front matter (e.g. \"Task\"). */\n item_type: string;\n /** Required metadata field that is missing on the item. */\n field: string;\n}\n\n/**\n * Aggregate missing-field occurrences into `{ type: { field: count } }` with\n * both levels sorted lexicographically for stable, diff-friendly output.\n * Zero counts never appear (only observed occurrences are aggregated).\n */\nexport function buildMissingByTypeCounts(\n occurrences: Iterable<MissingFieldOccurrence>,\n): Record<string, Record<string, number>> {\n const countsByType = new Map<string, Map<string, number>>();\n for (const occurrence of occurrences) {\n let fieldCounts = countsByType.get(occurrence.item_type);\n if (!fieldCounts) {\n fieldCounts = new Map<string, number>();\n countsByType.set(occurrence.item_type, fieldCounts);\n }\n fieldCounts.set(occurrence.field, (fieldCounts.get(occurrence.field) ?? 0) + 1);\n }\n\n const result: Record<string, Record<string, number>> = {};\n for (const type of [...countsByType.keys()].sort((left, right) => left.localeCompare(right))) {\n const fieldCounts = countsByType.get(type)!;\n const fields: Record<string, number> = {};\n for (const field of [...fieldCounts.keys()].sort((left, right) => left.localeCompare(right))) {\n fields[field] = fieldCounts.get(field)!;\n }\n result[type] = fields;\n }\n return result;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH;;;;GAIG;;;AACH,MAAM,UAAU,wBAAwB,CACtC,WAA6C;IAE7C,MAAM,YAAY,GAAG,IAAI,GAAG,EAA+B,CAAC;IAC5D,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,IAAI,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QACzD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;YACxC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACtD,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,MAAM,GAA2C,EAAE,CAAC;IAC1D,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC7F,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAC5C,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,KAAK,MAAM,KAAK,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAC7F,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;QAC1C,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"16988d98-5a10-5e0a-952c-0a6289ab5935"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classification of stale linked paths reported by `pm validate --check-files`.
|
|
3
|
+
*
|
|
4
|
+
* A linked file path that no longer exists is either:
|
|
5
|
+
* - `moved`: a file with the same basename still exists elsewhere in the
|
|
6
|
+
* scanned candidate set — the candidates are reported so an agent can relink
|
|
7
|
+
* the item to the new location instead of dropping the link, or
|
|
8
|
+
* - `deleted`: no candidate with that basename exists anywhere in the scan,
|
|
9
|
+
* so the link points at content that is gone and pruning it is safe.
|
|
10
|
+
*
|
|
11
|
+
* Pure module (pm-0v2m / GH-184): no filesystem access — callers pass the
|
|
12
|
+
* already-collected candidate file list from the files check scan.
|
|
13
|
+
*/
|
|
14
|
+
export type StaleLinkedPathClassification = "moved" | "deleted";
|
|
15
|
+
export interface ClassifiedStaleLinkedPath {
|
|
16
|
+
/** Normalized workspace-relative stale linked path. */
|
|
17
|
+
path: string;
|
|
18
|
+
classification: StaleLinkedPathClassification;
|
|
19
|
+
/**
|
|
20
|
+
* Candidate new locations (same basename, different path), sorted and capped
|
|
21
|
+
* at `candidateLimit`. Empty for `deleted`.
|
|
22
|
+
*/
|
|
23
|
+
candidates: string[];
|
|
24
|
+
/** True when more candidates existed than `candidateLimit` allowed. */
|
|
25
|
+
candidates_truncated: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const DEFAULT_STALE_PATH_CANDIDATE_LIMIT = 3;
|
|
28
|
+
/**
|
|
29
|
+
* Classify each stale (missing) linked path as `moved` or `deleted` by
|
|
30
|
+
* matching its basename against the candidate file list. Output preserves the
|
|
31
|
+
* input order of `stalePaths` (callers pass an already-sorted unique list).
|
|
32
|
+
* A candidate equal to the stale path itself never matches (the path is known
|
|
33
|
+
* missing; an identical candidate would be self-referential noise).
|
|
34
|
+
*/
|
|
35
|
+
export declare function classifyStaleLinkedPaths(stalePaths: readonly string[], candidateFiles: readonly string[], candidateLimit?: number): ClassifiedStaleLinkedPath[];
|
|
36
|
+
/**
|
|
37
|
+
* Render compact `<path>:moved:<top-candidate>` / `<path>:deleted` rows for
|
|
38
|
+
* the files check details (token-efficient counterpart to the full
|
|
39
|
+
* classification objects).
|
|
40
|
+
*/
|
|
41
|
+
export declare function summarizeStaleLinkedPathClassifications(classified: readonly ClassifiedStaleLinkedPath[]): string[];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classification of stale linked paths reported by `pm validate --check-files`.
|
|
3
|
+
*
|
|
4
|
+
* A linked file path that no longer exists is either:
|
|
5
|
+
* - `moved`: a file with the same basename still exists elsewhere in the
|
|
6
|
+
* scanned candidate set — the candidates are reported so an agent can relink
|
|
7
|
+
* the item to the new location instead of dropping the link, or
|
|
8
|
+
* - `deleted`: no candidate with that basename exists anywhere in the scan,
|
|
9
|
+
* so the link points at content that is gone and pruning it is safe.
|
|
10
|
+
*
|
|
11
|
+
* Pure module (pm-0v2m / GH-184): no filesystem access — callers pass the
|
|
12
|
+
* already-collected candidate file list from the files check scan.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2df68560-32a7-5762-9470-cf82e978a90d")}catch(e){}}();
|
|
16
|
+
export const DEFAULT_STALE_PATH_CANDIDATE_LIMIT = 3;
|
|
17
|
+
function basenameOf(relativePath) {
|
|
18
|
+
const lastSlash = Math.max(relativePath.lastIndexOf("/"), relativePath.lastIndexOf("\\"));
|
|
19
|
+
return lastSlash === -1 ? relativePath : relativePath.slice(lastSlash + 1);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Classify each stale (missing) linked path as `moved` or `deleted` by
|
|
23
|
+
* matching its basename against the candidate file list. Output preserves the
|
|
24
|
+
* input order of `stalePaths` (callers pass an already-sorted unique list).
|
|
25
|
+
* A candidate equal to the stale path itself never matches (the path is known
|
|
26
|
+
* missing; an identical candidate would be self-referential noise).
|
|
27
|
+
*/
|
|
28
|
+
export function classifyStaleLinkedPaths(stalePaths, candidateFiles, candidateLimit = DEFAULT_STALE_PATH_CANDIDATE_LIMIT) {
|
|
29
|
+
const limit = Number.isFinite(candidateLimit) && candidateLimit >= 1 ? Math.floor(candidateLimit) : DEFAULT_STALE_PATH_CANDIDATE_LIMIT;
|
|
30
|
+
const candidatesByBasename = new Map();
|
|
31
|
+
for (const candidate of candidateFiles) {
|
|
32
|
+
const basename = basenameOf(candidate);
|
|
33
|
+
if (basename.length === 0) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const bucket = candidatesByBasename.get(basename);
|
|
37
|
+
if (bucket) {
|
|
38
|
+
bucket.push(candidate);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
candidatesByBasename.set(basename, [candidate]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return stalePaths.map((stalePath) => {
|
|
45
|
+
const matches = (candidatesByBasename.get(basenameOf(stalePath)) ?? [])
|
|
46
|
+
.filter((candidate) => candidate !== stalePath)
|
|
47
|
+
.sort((left, right) => left.localeCompare(right));
|
|
48
|
+
if (matches.length === 0) {
|
|
49
|
+
return {
|
|
50
|
+
path: stalePath,
|
|
51
|
+
classification: "deleted",
|
|
52
|
+
candidates: [],
|
|
53
|
+
candidates_truncated: false,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
path: stalePath,
|
|
58
|
+
classification: "moved",
|
|
59
|
+
candidates: matches.slice(0, limit),
|
|
60
|
+
candidates_truncated: matches.length > limit,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Render compact `<path>:moved:<top-candidate>` / `<path>:deleted` rows for
|
|
66
|
+
* the files check details (token-efficient counterpart to the full
|
|
67
|
+
* classification objects).
|
|
68
|
+
*/
|
|
69
|
+
export function summarizeStaleLinkedPathClassifications(classified) {
|
|
70
|
+
return classified.map((entry) => entry.classification === "moved" ? `${entry.path}:moved:${entry.candidates[0]}` : `${entry.path}:deleted`);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=stale-file-classification.js.map
|
|
73
|
+
//# debugId=2df68560-32a7-5762-9470-cf82e978a90d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stale-file-classification.js","sources":["core/validate/stale-file-classification.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Classification of stale linked paths reported by `pm validate --check-files`.\n *\n * A linked file path that no longer exists is either:\n * - `moved`: a file with the same basename still exists elsewhere in the\n * scanned candidate set — the candidates are reported so an agent can relink\n * the item to the new location instead of dropping the link, or\n * - `deleted`: no candidate with that basename exists anywhere in the scan,\n * so the link points at content that is gone and pruning it is safe.\n *\n * Pure module (pm-0v2m / GH-184): no filesystem access — callers pass the\n * already-collected candidate file list from the files check scan.\n */\n\nexport type StaleLinkedPathClassification = \"moved\" | \"deleted\";\n\nexport interface ClassifiedStaleLinkedPath {\n /** Normalized workspace-relative stale linked path. */\n path: string;\n classification: StaleLinkedPathClassification;\n /**\n * Candidate new locations (same basename, different path), sorted and capped\n * at `candidateLimit`. Empty for `deleted`.\n */\n candidates: string[];\n /** True when more candidates existed than `candidateLimit` allowed. */\n candidates_truncated: boolean;\n}\n\nexport const DEFAULT_STALE_PATH_CANDIDATE_LIMIT = 3;\n\nfunction basenameOf(relativePath: string): string {\n const lastSlash = Math.max(relativePath.lastIndexOf(\"/\"), relativePath.lastIndexOf(\"\\\\\"));\n return lastSlash === -1 ? relativePath : relativePath.slice(lastSlash + 1);\n}\n\n/**\n * Classify each stale (missing) linked path as `moved` or `deleted` by\n * matching its basename against the candidate file list. Output preserves the\n * input order of `stalePaths` (callers pass an already-sorted unique list).\n * A candidate equal to the stale path itself never matches (the path is known\n * missing; an identical candidate would be self-referential noise).\n */\nexport function classifyStaleLinkedPaths(\n stalePaths: readonly string[],\n candidateFiles: readonly string[],\n candidateLimit: number = DEFAULT_STALE_PATH_CANDIDATE_LIMIT,\n): ClassifiedStaleLinkedPath[] {\n const limit = Number.isFinite(candidateLimit) && candidateLimit >= 1 ? Math.floor(candidateLimit) : DEFAULT_STALE_PATH_CANDIDATE_LIMIT;\n const candidatesByBasename = new Map<string, string[]>();\n for (const candidate of candidateFiles) {\n const basename = basenameOf(candidate);\n if (basename.length === 0) {\n continue;\n }\n const bucket = candidatesByBasename.get(basename);\n if (bucket) {\n bucket.push(candidate);\n } else {\n candidatesByBasename.set(basename, [candidate]);\n }\n }\n\n return stalePaths.map((stalePath) => {\n const matches = (candidatesByBasename.get(basenameOf(stalePath)) ?? [])\n .filter((candidate) => candidate !== stalePath)\n .sort((left, right) => left.localeCompare(right));\n if (matches.length === 0) {\n return {\n path: stalePath,\n classification: \"deleted\" as const,\n candidates: [],\n candidates_truncated: false,\n };\n }\n return {\n path: stalePath,\n classification: \"moved\" as const,\n candidates: matches.slice(0, limit),\n candidates_truncated: matches.length > limit,\n };\n });\n}\n\n/**\n * Render compact `<path>:moved:<top-candidate>` / `<path>:deleted` rows for\n * the files check details (token-efficient counterpart to the full\n * classification objects).\n */\nexport function summarizeStaleLinkedPathClassifications(classified: readonly ClassifiedStaleLinkedPath[]): string[] {\n return classified.map((entry) =>\n entry.classification === \"moved\" ? `${entry.path}:moved:${entry.candidates[0]}` : `${entry.path}:deleted`,\n );\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;;;AAiBH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC;AAEpD,SAAS,UAAU,CAAC,YAAoB;IACtC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1F,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAA6B,EAC7B,cAAiC,EACjC,iBAAyB,k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ACL,IAAI,EAAE,SAAS;YACf,cAAc,EAAE,OAAgB;YAChC,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;YACnC,oBAAoB,EAAE,OAAO,CAAC,MAAM,GAAG,KAAK;SAC7C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uCAAuC,CAAC,UAAgD;IACtG,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC9B,KAAK,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,UAAU,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,UAAU,CAC1G,CAAC;AACJ,CAAC","debugId":"2df68560-32a7-5762-9470-cf82e978a90d"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ interface JsonRpcRequest {
|
|
|
8
8
|
export declare function handleRequest(request: JsonRpcRequest): Promise<Record<string, unknown> | undefined>;
|
|
9
9
|
export declare function processRpcLine(line: string): Promise<void>;
|
|
10
10
|
export declare function startMcpServer(): void;
|
|
11
|
+
export declare function isInvokedAsMcpMainModule(argvPath: string | undefined, moduleUrl: string): boolean;
|
|
11
12
|
export {};
|