@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
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* intentionally excluded here (see pm-0hnu: "all non-extension checks").
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
!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]="
|
|
27
|
+
!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]="d65fd5ea-fcaf-5004-97da-9cdcbc7b334a")}catch(e){}}();
|
|
28
28
|
export const REMEDIATION_REGISTRY = Object.freeze([
|
|
29
29
|
// --- pm health: directories ---
|
|
30
30
|
{
|
|
@@ -127,25 +127,38 @@ export const REMEDIATION_REGISTRY = Object.freeze([
|
|
|
127
127
|
summary: "A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.",
|
|
128
128
|
},
|
|
129
129
|
// --- pm health: history_drift ---
|
|
130
|
+
// `pm health` rewrites these commands to `pm history-repair --all` in the
|
|
131
|
+
// per-check remediation_map when more than one stream is drifted.
|
|
130
132
|
{
|
|
131
133
|
code: "history_drift_missing_stream",
|
|
132
134
|
command: "pm history-repair <id>",
|
|
133
|
-
summary: "The item has no history stream; re-anchor the chain to rebuild it.",
|
|
135
|
+
summary: "The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).",
|
|
134
136
|
},
|
|
135
137
|
{
|
|
136
138
|
code: "history_drift_unreadable_stream",
|
|
137
139
|
command: "pm history-repair <id>",
|
|
138
|
-
summary: "The item's history stream is unreadable; re-anchor the chain.",
|
|
140
|
+
summary: "The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).",
|
|
139
141
|
},
|
|
140
142
|
{
|
|
141
143
|
code: "history_drift_hash_mismatch",
|
|
142
144
|
command: "pm history-repair <id>",
|
|
143
|
-
summary: "The item's content hash no longer matches its history; re-anchor the chain.",
|
|
145
|
+
summary: "The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).",
|
|
144
146
|
},
|
|
145
147
|
{
|
|
146
148
|
code: "history_drift_chain_mismatch",
|
|
147
149
|
command: "pm history-repair <id>",
|
|
148
|
-
summary: "The item's history chain is broken; re-anchor the chain.",
|
|
150
|
+
summary: "The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).",
|
|
151
|
+
},
|
|
152
|
+
// --- pm health: locks ---
|
|
153
|
+
{
|
|
154
|
+
code: "locks_stale_count",
|
|
155
|
+
command: "pm gc --scope locks",
|
|
156
|
+
summary: "Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
code: "locks_unreadable",
|
|
160
|
+
command: "pm gc --scope locks --dry-run",
|
|
161
|
+
summary: "Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.",
|
|
149
162
|
},
|
|
150
163
|
// --- pm health: vectorization ---
|
|
151
164
|
{
|
|
@@ -340,4 +353,4 @@ export function buildRemediationCommands(warnings) {
|
|
|
340
353
|
return Object.values(buildRemediationMap(warnings));
|
|
341
354
|
}
|
|
342
355
|
//# sourceMappingURL=remediation.js.map
|
|
343
|
-
//# debugId=
|
|
356
|
+
//# debugId=d65fd5ea-fcaf-5004-97da-9cdcbc7b334a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary: \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health: history_drift ---\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it.\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain.\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain.\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain.\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary: \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAkBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,yFAAyF;KACnG;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uHAAuH;KAC1H;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,yHAAyH;KAC5H;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,6GAA6G;KACvH;IACD,qCAAqC;IACrC;QACE,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,yGAAyG;KACnH;IACD;QACE,IAAI,EAAE,iCAAiC;QACvC,OAAO,EA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,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"0913b502-4db3-5424-9ec5-b66ccfb7fc20"}
|
|
1
|
+
{"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary: \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health: history_drift ---\n // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary: \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAkBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,yFAAyF;KACnG;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,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I,oBAAoB,EAAE,CAAC;QACzC,IAAI,UAAU,KAAK,KAAK,CAAC,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACzE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA0B;IAC5D,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"d65fd5ea-fcaf-5004-97da-9cdcbc7b334a"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bdebef92-142e-53b9-a836-480f38d1c3a0")}catch(e){}}();
|
|
3
3
|
import { KNOWN_EXTENSION_CAPABILITIES, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES, } from "./extension-types.js";
|
|
4
|
+
import { levenshteinDistanceWithinLimit } from "../shared/levenshtein.js";
|
|
4
5
|
export function normalizeNames(values) {
|
|
5
6
|
return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((a, b) => a.localeCompare(b));
|
|
6
7
|
}
|
|
@@ -39,33 +40,6 @@ export function normalizeManifestCapabilities(rawCapabilities) {
|
|
|
39
40
|
legacy_aliases: dedupedLegacyAliases,
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
function levenshteinDistance(left, right) {
|
|
43
|
-
if (left === right) {
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
if (left.length === 0) {
|
|
47
|
-
return right.length;
|
|
48
|
-
}
|
|
49
|
-
if (right.length === 0) {
|
|
50
|
-
return left.length;
|
|
51
|
-
}
|
|
52
|
-
const previous = new Array(right.length + 1);
|
|
53
|
-
const current = new Array(right.length + 1);
|
|
54
|
-
for (let j = 0; j <= right.length; j += 1) {
|
|
55
|
-
previous[j] = j;
|
|
56
|
-
}
|
|
57
|
-
for (let i = 1; i <= left.length; i += 1) {
|
|
58
|
-
current[0] = i;
|
|
59
|
-
for (let j = 1; j <= right.length; j += 1) {
|
|
60
|
-
const substitutionCost = left[i - 1] === right[j - 1] ? 0 : 1;
|
|
61
|
-
current[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + substitutionCost);
|
|
62
|
-
}
|
|
63
|
-
for (let j = 0; j <= right.length; j += 1) {
|
|
64
|
-
previous[j] = current[j];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return previous[right.length] ?? left.length;
|
|
68
|
-
}
|
|
69
43
|
export function suggestKnownExtensionCapability(capability) {
|
|
70
44
|
const normalized = capability.trim().toLowerCase();
|
|
71
45
|
if (normalized.length === 0) {
|
|
@@ -75,17 +49,17 @@ export function suggestKnownExtensionCapability(capability) {
|
|
|
75
49
|
if (legacyAlias) {
|
|
76
50
|
return legacyAlias;
|
|
77
51
|
}
|
|
52
|
+
const maxDistance = Math.max(1, Math.floor(normalized.length * 0.34));
|
|
78
53
|
let bestMatch = null;
|
|
79
54
|
let bestDistance = Number.POSITIVE_INFINITY;
|
|
80
55
|
for (const candidate of KNOWN_EXTENSION_CAPABILITIES) {
|
|
81
|
-
const distance =
|
|
82
|
-
if (distance < bestDistance) {
|
|
56
|
+
const distance = levenshteinDistanceWithinLimit(normalized, candidate, maxDistance);
|
|
57
|
+
if (distance !== null && distance < bestDistance) {
|
|
83
58
|
bestDistance = distance;
|
|
84
59
|
bestMatch = candidate;
|
|
85
60
|
}
|
|
86
61
|
}
|
|
87
|
-
|
|
88
|
-
return bestMatch !== null && bestDistance <= maxDistance ? bestMatch : null;
|
|
62
|
+
return bestMatch;
|
|
89
63
|
}
|
|
90
64
|
export function formatUnknownExtensionCapabilityWarning(layer, name, capability) {
|
|
91
65
|
const allowed = KNOWN_EXTENSION_CAPABILITIES.join(",");
|
|
@@ -156,4 +130,4 @@ export function parseLegacyExtensionCapabilityAliasWarning(warning) {
|
|
|
156
130
|
return parsed;
|
|
157
131
|
}
|
|
158
132
|
//# sourceMappingURL=extension-capability-aliases.js.map
|
|
159
|
-
//# debugId=
|
|
133
|
+
//# debugId=bdebef92-142e-53b9-a836-480f38d1c3a0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-capability-aliases.js","sources":["core/extensions/extension-capability-aliases.ts"],"sourceRoot":"/","sourcesContent":["import {\n KNOWN_EXTENSION_CAPABILITIES,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n type ExtensionCapability,\n type ExtensionLayer,\n type LegacyExtensionCapabilityAliasMapping,\n type UnknownExtensionCapabilityWarningDetails,\n} from \"./extension-types.js\";\n\nexport function normalizeNames(values: string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n );\n}\n\nexport function isKnownExtensionCapability(value: string): value is ExtensionCapability {\n return (KNOWN_EXTENSION_CAPABILITIES as readonly string[]).includes(value);\n}\n\nexport function collectUnknownExtensionCapabilities(capabilities: readonly string[]): string[] {\n return capabilities.filter((capability) => !isKnownExtensionCapability(capability));\n}\n\nexport function resolveLegacyExtensionCapabilityAlias(capability: string): ExtensionCapability | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n return EXTENSION_CAPABILITY_LEGACY_ALIASES[normalized] ?? null;\n}\n\nexport function normalizeManifestCapabilities(rawCapabilities: readonly string[]): {\n capabilities: string[];\n legacy_aliases: LegacyExtensionCapabilityAliasMapping[];\n} {\n const normalizedCapabilities = normalizeNames([...rawCapabilities].map((value) => value.toLowerCase()));\n const remappedCapabilities: string[] = [];\n const legacyAliases: LegacyExtensionCapabilityAliasMapping[] = [];\n for (const capability of normalizedCapabilities) {\n const legacyAliasTarget = resolveLegacyExtensionCapabilityAlias(capability);\n if (legacyAliasTarget) {\n remappedCapabilities.push(legacyAliasTarget);\n legacyAliases.push({\n alias: capability,\n target: legacyAliasTarget,\n });\n continue;\n }\n remappedCapabilities.push(capability);\n }\n const dedupedLegacyAliases = [...new Map(legacyAliases.map((entry) => [`${entry.alias}>${entry.target}`, entry])).values()].sort(\n (left, right) => left.alias.localeCompare(right.alias),\n );\n return {\n capabilities: normalizeNames(remappedCapabilities),\n legacy_aliases: dedupedLegacyAliases,\n };\n}\n\nfunction levenshteinDistance(left: string, right: string): number {\n if (left === right) {\n return 0;\n }\n if (left.length === 0) {\n return right.length;\n }\n if (right.length === 0) {\n return left.length;\n }\n const previous = new Array<number>(right.length + 1);\n const current = new Array<number>(right.length + 1);\n for (let j = 0; j <= right.length; j += 1) {\n previous[j] = j;\n }\n for (let i = 1; i <= left.length; i += 1) {\n current[0] = i;\n for (let j = 1; j <= right.length; j += 1) {\n const substitutionCost = left[i - 1] === right[j - 1] ? 0 : 1;\n current[j] = Math.min(\n previous[j] + 1,\n current[j - 1] + 1,\n previous[j - 1] + substitutionCost,\n );\n }\n for (let j = 0; j <= right.length; j += 1) {\n previous[j] = current[j];\n }\n }\n return previous[right.length] ?? left.length;\n}\n\nexport function suggestKnownExtensionCapability(capability: string): string | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(normalized);\n if (legacyAlias) {\n return legacyAlias;\n }\n let bestMatch: string | null = null;\n let bestDistance = Number.POSITIVE_INFINITY;\n for (const candidate of KNOWN_EXTENSION_CAPABILITIES) {\n const distance = levenshteinDistance(normalized, candidate);\n if (distance < bestDistance) {\n bestDistance = distance;\n bestMatch = candidate;\n }\n }\n const maxDistance = Math.max(1, Math.floor(normalized.length * 0.34));\n return bestMatch !== null && bestDistance <= maxDistance ? bestMatch : null;\n}\n\nexport function formatUnknownExtensionCapabilityWarning(layer: ExtensionLayer, name: string, capability: string): string {\n const allowed = KNOWN_EXTENSION_CAPABILITIES.join(\",\");\n const suggested = suggestKnownExtensionCapability(capability) ?? \"none\";\n return `extension_capability_unknown:${layer}:${name}:${capability}:allowed=${allowed}:suggested=${suggested}`;\n}\n\nexport function formatLegacyExtensionCapabilityAliasWarning(\n layer: ExtensionLayer,\n name: string,\n aliases: readonly LegacyExtensionCapabilityAliasMapping[],\n): string {\n const aliasesToken = aliases.map((entry) => `${entry.alias}>${entry.target}`).join(\",\");\n return `extension_capability_legacy_alias:${layer}:${name}:aliases=${aliasesToken}`;\n}\n\n\nexport function parseUnknownExtensionCapabilityWarning(\n warning: string,\n): UnknownExtensionCapabilityWarningDetails | null {\n const match = /^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(\n warning.trim(),\n );\n if (!match) {\n return null;\n }\n const [, layerRaw, name, capability, allowedRaw, suggestedRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowed_capabilities = allowedRaw\n .split(\",\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(capability);\n const suggestedFromWarning = suggestedRaw === \"none\" ? undefined : suggestedRaw;\n const suggested_capability = suggestedFromWarning ?? legacyAlias ?? undefined;\n const suggestion_source = suggested_capability\n ? legacyAlias === suggested_capability\n ? \"legacy_alias\"\n : \"nearest_match\"\n : undefined;\n return {\n layer,\n name,\n capability,\n allowed_capabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability,\n suggestion_source,\n legacy_alias_target: legacyAlias ?? undefined,\n };\n}\n\nexport function parseLegacyExtensionCapabilityAliasWarning(warning: string): UnknownExtensionCapabilityWarningDetails[] {\n const match = /^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(warning.trim());\n if (!match) {\n return [];\n }\n const [, layerRaw, name, aliasesRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowedCapabilities = [...KNOWN_EXTENSION_CAPABILITIES];\n const parsed: UnknownExtensionCapabilityWarningDetails[] = [];\n for (const token of aliasesRaw.split(\",\")) {\n const [rawAlias, rawTarget] = token.split(\">\");\n const alias = rawAlias?.trim();\n const target = rawTarget?.trim().toLowerCase();\n if (!alias || !target || !isKnownExtensionCapability(target)) {\n continue;\n }\n parsed.push({\n layer,\n name,\n capability: alias,\n allowed_capabilities: allowedCapabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability: target,\n suggestion_source: \"legacy_alias\",\n legacy_alias_target: target,\n });\n }\n return parsed;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,4BAA4B,EAC5B,qCAAqC,EACrC,mCAAmC,GAKpC,MAAM,sBAAsB,CAAC;AAE9B,MAAM,UAAU,cAAc,CAAC,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-8746ce68e4e0"}
|
|
1
|
+
{"version":3,"file":"extension-capability-aliases.js","sources":["core/extensions/extension-capability-aliases.ts"],"sourceRoot":"/","sourcesContent":["import {\n KNOWN_EXTENSION_CAPABILITIES,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n type ExtensionCapability,\n type ExtensionLayer,\n type LegacyExtensionCapabilityAliasMapping,\n type UnknownExtensionCapabilityWarningDetails,\n} from \"./extension-types.js\";\nimport { levenshteinDistanceWithinLimit } from \"../shared/levenshtein.js\";\n\nexport function normalizeNames(values: string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n );\n}\n\nexport function isKnownExtensionCapability(value: string): value is ExtensionCapability {\n return (KNOWN_EXTENSION_CAPABILITIES as readonly string[]).includes(value);\n}\n\nexport function collectUnknownExtensionCapabilities(capabilities: readonly string[]): string[] {\n return capabilities.filter((capability) => !isKnownExtensionCapability(capability));\n}\n\nexport function resolveLegacyExtensionCapabilityAlias(capability: string): ExtensionCapability | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n return EXTENSION_CAPABILITY_LEGACY_ALIASES[normalized] ?? null;\n}\n\nexport function normalizeManifestCapabilities(rawCapabilities: readonly string[]): {\n capabilities: string[];\n legacy_aliases: LegacyExtensionCapabilityAliasMapping[];\n} {\n const normalizedCapabilities = normalizeNames([...rawCapabilities].map((value) => value.toLowerCase()));\n const remappedCapabilities: string[] = [];\n const legacyAliases: LegacyExtensionCapabilityAliasMapping[] = [];\n for (const capability of normalizedCapabilities) {\n const legacyAliasTarget = resolveLegacyExtensionCapabilityAlias(capability);\n if (legacyAliasTarget) {\n remappedCapabilities.push(legacyAliasTarget);\n legacyAliases.push({\n alias: capability,\n target: legacyAliasTarget,\n });\n continue;\n }\n remappedCapabilities.push(capability);\n }\n const dedupedLegacyAliases = [...new Map(legacyAliases.map((entry) => [`${entry.alias}>${entry.target}`, entry])).values()].sort(\n (left, right) => left.alias.localeCompare(right.alias),\n );\n return {\n capabilities: normalizeNames(remappedCapabilities),\n legacy_aliases: dedupedLegacyAliases,\n };\n}\n\nexport function suggestKnownExtensionCapability(capability: string): string | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(normalized);\n if (legacyAlias) {\n return legacyAlias;\n }\n const maxDistance = Math.max(1, Math.floor(normalized.length * 0.34));\n let bestMatch: string | null = null;\n let bestDistance = Number.POSITIVE_INFINITY;\n for (const candidate of KNOWN_EXTENSION_CAPABILITIES) {\n const distance = levenshteinDistanceWithinLimit(normalized, candidate, maxDistance);\n if (distance !== null && distance < bestDistance) {\n bestDistance = distance;\n bestMatch = candidate;\n }\n }\n return bestMatch;\n}\n\nexport function formatUnknownExtensionCapabilityWarning(layer: ExtensionLayer, name: string, capability: string): string {\n const allowed = KNOWN_EXTENSION_CAPABILITIES.join(\",\");\n const suggested = suggestKnownExtensionCapability(capability) ?? \"none\";\n return `extension_capability_unknown:${layer}:${name}:${capability}:allowed=${allowed}:suggested=${suggested}`;\n}\n\nexport function formatLegacyExtensionCapabilityAliasWarning(\n layer: ExtensionLayer,\n name: string,\n aliases: readonly LegacyExtensionCapabilityAliasMapping[],\n): string {\n const aliasesToken = aliases.map((entry) => `${entry.alias}>${entry.target}`).join(\",\");\n return `extension_capability_legacy_alias:${layer}:${name}:aliases=${aliasesToken}`;\n}\n\n\nexport function parseUnknownExtensionCapabilityWarning(\n warning: string,\n): UnknownExtensionCapabilityWarningDetails | null {\n const match = /^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(\n warning.trim(),\n );\n if (!match) {\n return null;\n }\n const [, layerRaw, name, capability, allowedRaw, suggestedRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowed_capabilities = allowedRaw\n .split(\",\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(capability);\n const suggestedFromWarning = suggestedRaw === \"none\" ? undefined : suggestedRaw;\n const suggested_capability = suggestedFromWarning ?? legacyAlias ?? undefined;\n const suggestion_source = suggested_capability\n ? legacyAlias === suggested_capability\n ? \"legacy_alias\"\n : \"nearest_match\"\n : undefined;\n return {\n layer,\n name,\n capability,\n allowed_capabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability,\n suggestion_source,\n legacy_alias_target: legacyAlias ?? undefined,\n };\n}\n\nexport function parseLegacyExtensionCapabilityAliasWarning(warning: string): UnknownExtensionCapabilityWarningDetails[] {\n const match = /^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(warning.trim());\n if (!match) {\n return [];\n }\n const [, layerRaw, name, aliasesRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowedCapabilities = [...KNOWN_EXTENSION_CAPABILITIES];\n const parsed: UnknownExtensionCapabilityWarningDetails[] = [];\n for (const token of aliasesRaw.split(\",\")) {\n const [rawAlias, rawTarget] = token.split(\">\");\n const alias = rawAlias?.trim();\n const target = rawTarget?.trim().toLowerCase();\n if (!alias || !target || !isKnownExtensionCapability(target)) {\n continue;\n }\n parsed.push({\n layer,\n name,\n capability: alias,\n allowed_capabilities: allowedCapabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability: target,\n suggestion_source: \"legacy_alias\",\n legacy_alias_target: target,\n });\n }\n return parsed;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,4BAA4B,EAC5B,qCAAqC,EACrC,mCAAmC,GAKpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,MAAM,UAAU,cAAc,CAAC,MAAgB;IAC7C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,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IAC9D,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7D,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;YACV,KAAK;YACL,IAAI;YACJ,UAAU,EAAE,KAAK;YACjB,oBAAoB,EAAE,mBAAmB;YACzC,2BAA2B,EAAE,qCAAqC;YAClE,oBAAoB,EAAE,MAAM;YAC5B,iBAAiB,EAAE,cAAc;YACjC,mBAAmB,EAAE,MAAM;SAC5B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"bdebef92-142e-53b9-a836-480f38d1c3a0"}
|
|
@@ -43,4 +43,35 @@ export interface LockGcResult {
|
|
|
43
43
|
/** one per scanned *.lock file, sorted by file name asc */
|
|
44
44
|
entries: StaleLockScanEntry[];
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Fine-grained classification outcome for one readable lock file's content.
|
|
48
|
+
* `unparseable_json` and `invalid_timestamp` both surface as the coarse
|
|
49
|
+
* `reason: "unparseable"` on the scan entry (gc retains both), but stay
|
|
50
|
+
* distinct here so callers can emit precise warnings.
|
|
51
|
+
*/
|
|
52
|
+
export type LockClassificationDetail = "active" | "expired" | "unparseable_json" | "invalid_timestamp";
|
|
53
|
+
export interface LockContentClassification {
|
|
54
|
+
detail: LockClassificationDetail;
|
|
55
|
+
entry: StaleLockScanEntry;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Pure classification of one lock file's raw content against `nowMs`. This is
|
|
59
|
+
* the single staleness/parse policy shared by `pm gc --scope locks` (which acts
|
|
60
|
+
* on it) and the `pm health` locks check (which only reports it).
|
|
61
|
+
*/
|
|
62
|
+
export declare function classifyLockContent(file: string, raw: string, nowMs: number): LockContentClassification;
|
|
63
|
+
export interface LockHealthScan {
|
|
64
|
+
/** number of *.lock files examined (ghost files that vanish mid-scan are skipped) */
|
|
65
|
+
scanned: number;
|
|
66
|
+
active_lock_count: number;
|
|
67
|
+
stale_lock_count: number;
|
|
68
|
+
unreadable_lock_count: number;
|
|
69
|
+
/** invalid JSON, wrong shape, or an unparseable created_at timestamp */
|
|
70
|
+
unparseable_lock_count: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Read-only locks scan for `pm health`: classifies every lock file with the
|
|
74
|
+
* same policy `pm gc --scope locks` uses but never removes anything.
|
|
75
|
+
*/
|
|
76
|
+
export declare function scanLockHealth(pmRoot: string, now?: number): Promise<LockHealthScan>;
|
|
46
77
|
export declare function runLockGc(pmRoot: string, options: LockGcOptions): Promise<LockGcResult>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Zero ttl means any lock older than 0 ms is stale. Negative ttl means always stale.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
!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]="
|
|
12
|
+
!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]="925ee778-ffe1-587a-9916-bdbd16065381")}catch(e){}}();
|
|
13
13
|
import fs from "node:fs/promises";
|
|
14
14
|
import path from "node:path";
|
|
15
15
|
function parseLock(raw) {
|
|
@@ -40,6 +40,114 @@ function isErrno(error, code) {
|
|
|
40
40
|
"code" in error &&
|
|
41
41
|
error.code === code);
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Pure classification of one lock file's raw content against `nowMs`. This is
|
|
45
|
+
* the single staleness/parse policy shared by `pm gc --scope locks` (which acts
|
|
46
|
+
* on it) and the `pm health` locks check (which only reports it).
|
|
47
|
+
*/
|
|
48
|
+
export function classifyLockContent(file, raw, nowMs) {
|
|
49
|
+
const lock = parseLock(raw);
|
|
50
|
+
if (lock === null) {
|
|
51
|
+
return {
|
|
52
|
+
detail: "unparseable_json",
|
|
53
|
+
entry: {
|
|
54
|
+
file,
|
|
55
|
+
id: null,
|
|
56
|
+
owner: null,
|
|
57
|
+
created_at: null,
|
|
58
|
+
ttl_seconds: null,
|
|
59
|
+
age_seconds: null,
|
|
60
|
+
stale: false,
|
|
61
|
+
reason: "unparseable",
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const createdAtMs = Date.parse(lock.created_at);
|
|
66
|
+
if (!Number.isFinite(createdAtMs)) {
|
|
67
|
+
return {
|
|
68
|
+
detail: "invalid_timestamp",
|
|
69
|
+
entry: {
|
|
70
|
+
file,
|
|
71
|
+
id: lock.id,
|
|
72
|
+
owner: lock.owner,
|
|
73
|
+
created_at: lock.created_at,
|
|
74
|
+
ttl_seconds: lock.ttl_seconds,
|
|
75
|
+
age_seconds: null,
|
|
76
|
+
stale: false,
|
|
77
|
+
reason: "unparseable",
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const ageMs = nowMs - createdAtMs;
|
|
82
|
+
const age_seconds = Math.floor(ageMs / 1000);
|
|
83
|
+
const stale = ageMs > lock.ttl_seconds * 1000;
|
|
84
|
+
return {
|
|
85
|
+
detail: stale ? "expired" : "active",
|
|
86
|
+
entry: {
|
|
87
|
+
file,
|
|
88
|
+
id: lock.id,
|
|
89
|
+
owner: lock.owner,
|
|
90
|
+
created_at: lock.created_at,
|
|
91
|
+
ttl_seconds: lock.ttl_seconds,
|
|
92
|
+
age_seconds,
|
|
93
|
+
stale,
|
|
94
|
+
reason: stale ? "expired" : "active",
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Read-only locks scan for `pm health`: classifies every lock file with the
|
|
100
|
+
* same policy `pm gc --scope locks` uses but never removes anything.
|
|
101
|
+
*/
|
|
102
|
+
export async function scanLockHealth(pmRoot, now) {
|
|
103
|
+
const nowMs = now ?? Date.now();
|
|
104
|
+
const locksDir = path.join(pmRoot, "locks");
|
|
105
|
+
const scan = {
|
|
106
|
+
scanned: 0,
|
|
107
|
+
active_lock_count: 0,
|
|
108
|
+
stale_lock_count: 0,
|
|
109
|
+
unreadable_lock_count: 0,
|
|
110
|
+
unparseable_lock_count: 0,
|
|
111
|
+
};
|
|
112
|
+
let dirEntries;
|
|
113
|
+
try {
|
|
114
|
+
const rawDir = await fs.readdir(locksDir);
|
|
115
|
+
dirEntries = rawDir.filter((f) => f.endsWith(".lock")).sort();
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
if (isErrno(error, "ENOENT")) {
|
|
119
|
+
return scan;
|
|
120
|
+
}
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
for (const file of dirEntries) {
|
|
124
|
+
let raw;
|
|
125
|
+
try {
|
|
126
|
+
raw = await fs.readFile(path.join(locksDir, file), "utf8");
|
|
127
|
+
}
|
|
128
|
+
catch (readError) {
|
|
129
|
+
if (isErrno(readError, "ENOENT")) {
|
|
130
|
+
// Disappeared between readdir and readFile — treat as a ghost; skip quietly.
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
scan.scanned += 1;
|
|
134
|
+
scan.unreadable_lock_count += 1;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
scan.scanned += 1;
|
|
138
|
+
const { detail } = classifyLockContent(file, raw, nowMs);
|
|
139
|
+
if (detail === "active") {
|
|
140
|
+
scan.active_lock_count += 1;
|
|
141
|
+
}
|
|
142
|
+
else if (detail === "expired") {
|
|
143
|
+
scan.stale_lock_count += 1;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
scan.unparseable_lock_count += 1;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return scan;
|
|
150
|
+
}
|
|
43
151
|
export async function runLockGc(pmRoot, options) {
|
|
44
152
|
const { dryRun, hooks } = options;
|
|
45
153
|
const nowMs = options.now ?? Date.now();
|
|
@@ -96,55 +204,23 @@ export async function runLockGc(pmRoot, options) {
|
|
|
96
204
|
});
|
|
97
205
|
continue;
|
|
98
206
|
}
|
|
99
|
-
// ---
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
207
|
+
// --- classify (shared with the read-only pm health locks scan) ---
|
|
208
|
+
const classified = classifyLockContent(file, raw, nowMs);
|
|
209
|
+
if (classified.detail === "unparseable_json") {
|
|
102
210
|
result.warnings.push(`lock_unparseable:${file}`);
|
|
103
211
|
result.retained.push(relPath);
|
|
104
|
-
result.entries.push(
|
|
105
|
-
file,
|
|
106
|
-
id: null,
|
|
107
|
-
owner: null,
|
|
108
|
-
created_at: null,
|
|
109
|
-
ttl_seconds: null,
|
|
110
|
-
age_seconds: null,
|
|
111
|
-
stale: false,
|
|
112
|
-
reason: "unparseable",
|
|
113
|
-
});
|
|
212
|
+
result.entries.push(classified.entry);
|
|
114
213
|
continue;
|
|
115
214
|
}
|
|
116
|
-
|
|
117
|
-
const createdAtMs = Date.parse(lock.created_at);
|
|
118
|
-
if (!Number.isFinite(createdAtMs)) {
|
|
215
|
+
if (classified.detail === "invalid_timestamp") {
|
|
119
216
|
result.warnings.push(`lock_invalid_timestamp:${file}`);
|
|
120
217
|
result.retained.push(relPath);
|
|
121
|
-
result.entries.push(
|
|
122
|
-
file,
|
|
123
|
-
id: lock.id,
|
|
124
|
-
owner: lock.owner,
|
|
125
|
-
created_at: lock.created_at,
|
|
126
|
-
ttl_seconds: lock.ttl_seconds,
|
|
127
|
-
age_seconds: null,
|
|
128
|
-
stale: false,
|
|
129
|
-
reason: "unparseable",
|
|
130
|
-
});
|
|
218
|
+
result.entries.push(classified.entry);
|
|
131
219
|
continue;
|
|
132
220
|
}
|
|
133
|
-
|
|
134
|
-
const age_seconds = Math.floor(ageMs / 1000);
|
|
135
|
-
const stale = ageMs > lock.ttl_seconds * 1000;
|
|
136
|
-
if (!stale) {
|
|
221
|
+
if (classified.detail === "active") {
|
|
137
222
|
result.retained.push(relPath);
|
|
138
|
-
result.entries.push(
|
|
139
|
-
file,
|
|
140
|
-
id: lock.id,
|
|
141
|
-
owner: lock.owner,
|
|
142
|
-
created_at: lock.created_at,
|
|
143
|
-
ttl_seconds: lock.ttl_seconds,
|
|
144
|
-
age_seconds,
|
|
145
|
-
stale: false,
|
|
146
|
-
reason: "active",
|
|
147
|
-
});
|
|
223
|
+
result.entries.push(classified.entry);
|
|
148
224
|
continue;
|
|
149
225
|
}
|
|
150
226
|
// --- stale: remove or preview ---
|
|
@@ -156,16 +232,7 @@ export async function runLockGc(pmRoot, options) {
|
|
|
156
232
|
if (!isErrno(unlinkError, "ENOENT")) {
|
|
157
233
|
result.warnings.push(`lock_remove_failed:${file}`);
|
|
158
234
|
result.retained.push(relPath);
|
|
159
|
-
result.entries.push(
|
|
160
|
-
file,
|
|
161
|
-
id: lock.id,
|
|
162
|
-
owner: lock.owner,
|
|
163
|
-
created_at: lock.created_at,
|
|
164
|
-
ttl_seconds: lock.ttl_seconds,
|
|
165
|
-
age_seconds,
|
|
166
|
-
stale: true,
|
|
167
|
-
reason: "expired",
|
|
168
|
-
});
|
|
235
|
+
result.entries.push(classified.entry);
|
|
169
236
|
continue;
|
|
170
237
|
}
|
|
171
238
|
// ENOENT on unlink = already gone (race); treat as removed
|
|
@@ -177,18 +244,9 @@ export async function runLockGc(pmRoot, options) {
|
|
|
177
244
|
}
|
|
178
245
|
}
|
|
179
246
|
result.removed.push(relPath);
|
|
180
|
-
result.entries.push(
|
|
181
|
-
file,
|
|
182
|
-
id: lock.id,
|
|
183
|
-
owner: lock.owner,
|
|
184
|
-
created_at: lock.created_at,
|
|
185
|
-
ttl_seconds: lock.ttl_seconds,
|
|
186
|
-
age_seconds,
|
|
187
|
-
stale: true,
|
|
188
|
-
reason: "expired",
|
|
189
|
-
});
|
|
247
|
+
result.entries.push(classified.entry);
|
|
190
248
|
}
|
|
191
249
|
return result;
|
|
192
250
|
}
|
|
193
251
|
//# sourceMappingURL=lock-gc.js.map
|
|
194
|
-
//# debugId=
|
|
252
|
+
//# debugId=925ee778-ffe1-587a-9916-bdbd16065381
|