@unbrained/pm-cli 2026.7.1 → 2026.7.3
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/.claude-plugin/marketplace.json +3 -3
- package/CHANGELOG.md +25 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +1 -1
- package/dist/cli/commander-usage.d.ts +2 -0
- package/dist/cli/commander-usage.js +110 -86
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +79 -57
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.js +102 -79
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +278 -243
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +176 -114
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +157 -129
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +50 -42
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/config.d.ts +2 -0
- package/dist/cli/commands/config.js +443 -879
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +365 -287
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +352 -238
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +32 -17
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +46 -39
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/dedupe-merge.js +88 -69
- package/dist/cli/commands/dedupe-merge.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +56 -67
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/shared.js +21 -15
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/get.js +114 -81
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +17 -0
- package/dist/cli/commands/health.js +545 -417
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +209 -140
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.js +162 -119
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +120 -85
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.js +32 -19
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +8 -2
- package/dist/cli/commands/init.js +263 -162
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.js +152 -102
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.js +60 -40
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/plan.js +373 -298
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/profile.js +23 -15
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.js +43 -25
- package/dist/cli/commands/recurrence-parsers.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +21 -5
- package/dist/cli/commands/reindex.js +345 -205
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +8 -7
- package/dist/cli/commands/restore.js +105 -69
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.js +33 -30
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +10 -2
- package/dist/cli/commands/search.js +503 -470
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/telemetry.js +98 -87
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/test-all.js +237 -168
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +6 -5
- package/dist/cli/commands/test.js +424 -344
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +57 -42
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +1 -1
- package/dist/cli/commands/update.js +738 -671
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +20 -1
- package/dist/cli/commands/validate.js +478 -343
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +406 -361
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.js +27 -19
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-json-payload.js +57 -49
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +47 -0
- package/dist/cli/main.js +474 -371
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.js +22 -45
- package/dist/cli/migration-gates.js.map +1 -1
- package/dist/cli/register-list-query.js +299 -310
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +763 -779
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +386 -362
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +120 -101
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +45 -56
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-5YWLSPGE.js} +9 -9
- package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-2V2M3JZU.js} +107 -83
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-2V2M3JZU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-EK7DXML7.js} +108 -84
- package/dist/cli-bundle/chunks/aggregate-EK7DXML7.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-EZESUVJT.js} +8 -8
- package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-JFG4WQMG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-32IUNTG4.js} +158 -119
- package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-3W2HJKJX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-4EXFFP7T.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-4PFVUUYV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-4WB6S4YX.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-572FKBRL.js} +61 -102
- package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-5E7N4T2Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-5IZUBZBR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-5JIWFWOZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-67LARBDL.js} +493 -404
- package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-6CDCWKSX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-6KRFL33E.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-6NYJGMTY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-7CLLC75T.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-7LYO6S5A.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-A3OQ7TFW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-AIKU3IIL.js} +153 -90
- package/dist/cli-bundle/chunks/chunk-AIKU3IIL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AJHYQCBJ.js} +39 -5
- package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OTUHB4HS.js → chunk-BE2SR6QL.js} +92 -77
- package/dist/cli-bundle/chunks/chunk-BE2SR6QL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-BI4R7HI2.js} +75 -53
- package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-CXR3CMBQ.js} +33 -6
- package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-ECU6MMTQ.js} +713 -613
- package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-EJ2OCBHF.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-EQURFOMH.js} +41 -26
- package/dist/cli-bundle/chunks/chunk-EQURFOMH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-ER4ME5U2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-ERG65A2L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-F6WNBITZ.js} +157 -113
- package/dist/cli-bundle/chunks/chunk-F6WNBITZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-FH2H3CBD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-FUFFPIYA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-FZJM2TXF.js} +110 -73
- package/dist/cli-bundle/chunks/chunk-FZJM2TXF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-GUYNUXQT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-GVJE5T7Q.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-HB4FAT3O.js} +42 -60
- package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-HQAF23Q2.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-JBZ2NTKX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-JPATY4SE.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-K5DT2YKM.js} +109 -72
- package/dist/cli-bundle/chunks/chunk-K5DT2YKM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KEZOIPCR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-KHVGM5CS.js} +466 -365
- package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-KS6ATO47.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-L4SLHV6G.js} +463 -362
- package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-LBE5QFMZ.js} +158 -114
- package/dist/cli-bundle/chunks/chunk-LBE5QFMZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-LCWQP6NM.js} +76 -54
- package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-LOWVNZBZ.js} +91 -76
- package/dist/cli-bundle/chunks/chunk-LOWVNZBZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-MDHWWBNZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-MEZZZBYX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-MHRS5FUX.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-NOIEVOK5.js} +391 -313
- package/dist/cli-bundle/chunks/chunk-NOIEVOK5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-NZ7QIUP5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-OGLGI22K.js} +115 -67
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js.map → chunk-OGLGI22K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-P5L7Z2O6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-PULUSQAV.js} +492 -403
- package/dist/cli-bundle/chunks/chunk-PULUSQAV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-QCDTQCMW.js} +22 -30
- package/dist/cli-bundle/chunks/chunk-QCDTQCMW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-QNNQAAZ5.js} +24 -18
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-QNNQAAZ5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-RAHINBVP.js} +60 -101
- package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-RJH5VQHW.js} +43 -61
- package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-SU2E4AWU.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-SU3TB4NS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-SYE6WMV6.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-T3P7PMZP.js} +42 -27
- package/dist/cli-bundle/chunks/chunk-T3P7PMZP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-T4XBKJ3F.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-T6AXEBOP.js} +23 -17
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-T6AXEBOP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-TQ6AX5SQ.js} +58 -69
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-U3S2B7TA.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-U5TR4N7J.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UMNQZS4H.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-WJA3PXW7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WRYERRZX.js} +157 -118
- package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-WYOIIFSE.js} +712 -612
- package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-XRYSCRZR.js} +116 -68
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js.map → chunk-XRYSCRZR.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-YF746GTH.js} +59 -70
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-YF746GTH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-YPWUSH72.js} +390 -312
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-YPWUSH72.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-YSDFIY7N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-YSGTMDWC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-YVKZ3ANP.js} +21 -29
- package/dist/cli-bundle/chunks/chunk-YVKZ3ANP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js → chunk-Z5F6XZXE.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-Z7RPDF2Y.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-ZFTKYWIF.js} +152 -89
- package/dist/cli-bundle/chunks/chunk-ZFTKYWIF.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-2BGBGSVI.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-5GU7OE67.js} +8 -8
- package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
- package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-AFVKPR57.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-7KLOSYLP.js} +186 -122
- package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-JKUJMHLG.js} +187 -123
- package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-DNWHEBOS.js} +9 -9
- package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-RW23R3VE.js} +9 -9
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js +1072 -0
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js.map +7 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js +1062 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-OYXRGY7S.js} +12 -12
- package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-PKCEHQY3.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-L6ODXNUM.js} +320 -199
- package/dist/cli-bundle/chunks/contracts-L6ODXNUM.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-X74F2GSM.js} +321 -200
- package/dist/cli-bundle/chunks/contracts-X74F2GSM.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-6XOR3HKN.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-I4NCLBR4.js} +5 -5
- package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-PM45M6PE.js} +12 -12
- package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
- package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-7YXHYG67.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-LPISP43T.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-N2T26FME.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-WATKQDE3.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-6LQ3GLM7.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-Z3X6JZLT.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-6DCLG52D.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-Y3ZCUTHK.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-BNINIMT7.js} +11 -11
- package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-QWE4YYK5.js} +11 -11
- package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-6SGKHS6O.js} +7 -7
- package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-FUYPSOFJ.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-2Q3K76G2.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-ATLBWXXD.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-RUYEMNRF.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-TDWSDR66.js} +3 -3
- package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-2WGLX74N.js} +120 -80
- package/dist/cli-bundle/chunks/get-2WGLX74N.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-LY6M2JIM.js} +121 -81
- package/dist/cli-bundle/chunks/get-LY6M2JIM.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-4RKHYS3T.js} +535 -371
- package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-TMFVNYRA.js} +534 -370
- package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
- package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
- package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-SGRRS72R.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-LOED43R3.js} +213 -134
- package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-V5DNAQHH.js} +214 -135
- package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-IRL7WJ3E.js} +9 -9
- package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-4WVBVHFR.js} +124 -84
- package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-PGYQJMGD.js} +123 -83
- package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +7 -0
- package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-4GESW7RM.js} +12 -12
- package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-4BHWFFUV.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-4FJY7WIW.js} +9 -9
- package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-472TIOVK.js} +8 -8
- package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-D7BF5CL2.js} +8 -8
- package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-D5STGWI2.js} +71 -46
- package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
- package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-SFQZVX2B.js} +70 -45
- package/dist/cli-bundle/chunks/next-SFQZVX2B.js.map +7 -0
- package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-6KNOSLIT.js} +9 -9
- package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-W4UEICGF.js} +9 -9
- package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-JO6V7BXO.js} +373 -279
- package/dist/cli-bundle/chunks/plan-JO6V7BXO.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-MJQW5XK3.js} +372 -278
- package/dist/cli-bundle/chunks/plan-MJQW5XK3.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-3TOTMUR4.js} +27 -19
- package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-WIQY2KCV.js} +28 -20
- package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js +416 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js +406 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-ROFE2YPC.js} +729 -702
- package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-SJWMVIJ2.js} +730 -703
- package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-IADFVH53.js} +389 -365
- package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js +510 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-3QJY43CY.js} +128 -103
- package/dist/cli-bundle/chunks/register-setup-3QJY43CY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-AJWUSSQX.js} +129 -104
- package/dist/cli-bundle/chunks/register-setup-AJWUSSQX.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-44IHMMZZ.js} +9 -9
- package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-IB2NZZWD.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-VBCELP5G.js} +7 -7
- package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-7UBETML4.js} +10 -10
- package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-R227JOL6.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-FAG7COEH.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-MCK7PLYS.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-DRPDZMAO.js} +84 -70
- package/dist/cli-bundle/chunks/telemetry-DRPDZMAO.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-GVVUQSJQ.js} +85 -71
- package/dist/cli-bundle/chunks/telemetry-GVVUQSJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-QY44WAMR.js} +15 -15
- package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-SY76DZTO.js} +15 -15
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js +430 -0
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js +427 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-MG5VIGSK.js} +185 -147
- package/dist/cli-bundle/chunks/test-runs-MG5VIGSK.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-QIR5MJPL.js} +184 -146
- package/dist/cli-bundle/chunks/test-runs-QIR5MJPL.js.map +7 -0
- package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
- package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-IKJZWLQC.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-BEMTDA2X.js} +84 -69
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-BEMTDA2X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-RATAARHU.js} +83 -68
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-RATAARHU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-NWMR3VQL.js} +11 -11
- package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-VU46BLJZ.js} +11 -11
- package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-GAJ6FUSI.js} +451 -321
- package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-NRY6MFXN.js} +450 -320
- package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
- package/dist/cli-bundle/main.js +1107 -916
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/config/nested-settings.js +89 -67
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/governance/metadata-coverage.js +20 -28
- package/dist/core/governance/metadata-coverage.js.map +1 -1
- package/dist/core/history/drift-scan.js +93 -81
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/item/item-type-definition.js +14 -14
- package/dist/core/item/item-type-definition.js.map +1 -1
- package/dist/core/item/type-registry.js +114 -99
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/mutation-projection.js +42 -26
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +97 -80
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +26 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/search/corpus.js +25 -19
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +64 -37
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +32 -17
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.js +31 -28
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/sentry/instrument.js +54 -43
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/memo.d.ts +12 -0
- package/dist/core/shared/memo.js +25 -0
- package/dist/core/shared/memo.js.map +1 -0
- package/dist/core/shared/serialization.js +24 -14
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/time.js +26 -4
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +5 -0
- package/dist/core/store/front-matter-cache.js +316 -171
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.js +33 -26
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings.js +247 -203
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/test/background-runs.js +189 -160
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +71 -99
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/compose.js +51 -42
- package/dist/sdk/compose.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -2
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/COMMANDS.md +8 -4
- package/docs/CONFIGURATION.md +1 -1
- package/docs/EXTENSIONS.md +12 -12
- package/docs/ONBOARDING.md +4 -2
- package/docs/README.md +2 -0
- package/docs/examples/starter-extension/README.md +11 -10
- package/marketplace.json +3 -3
- package/package.json +2 -2
- package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
- package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
- package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
- package/plugins/pm-claude/README.md +6 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-22WKIL3H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AXIDKKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JLM7BHI7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WYDHYJPO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
- package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
- package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
- package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
- package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
- package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
- package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
- package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
- package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
- package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
- package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
- package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
- package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
- package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
- package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
- package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
- package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js +0 -400
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js +0 -410
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js +0 -486
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
- package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
- package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-5YWLSPGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-BIML7K2D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-EZESUVJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-JFG4WQMG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-3W2HJKJX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-4PFVUUYV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-5E7N4T2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-5IZUBZBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-5JIWFWOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-6CDCWKSX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-6NYJGMTY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-7CLLC75T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-7LYO6S5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-A3OQ7TFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-ER4ME5U2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-ERG65A2L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-FH2H3CBD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-FUFFPIYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-GUYNUXQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-GVJE5T7Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-JBZ2NTKX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KEZOIPCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-MDHWWBNZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-MEZZZBYX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-NZ7QIUP5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-P5L7Z2O6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-SU2E4AWU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-SU3TB4NS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-T4XBKJ3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-U5TR4N7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UMNQZS4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-WJA3PXW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-YSDFIY7N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-YSGTMDWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-Z5F6XZXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-2BGBGSVI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-5GU7OE67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-6YODBUIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-AFVKPR57.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-DNWHEBOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-RW23R3VE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-OYXRGY7S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-PKCEHQY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-6XOR3HKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-I4NCLBR4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-PM45M6PE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-Z7YCH3BE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-7YXHYG67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-LPISP43T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-N2T26FME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-WATKQDE3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-6LQ3GLM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-Z3X6JZLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-6DCLG52D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-Y3ZCUTHK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-BNINIMT7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-QWE4YYK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-6SGKHS6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-FUYPSOFJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-2Q3K76G2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-ATLBWXXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-RUYEMNRF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-TDWSDR66.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-CGNQJXFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-SGRRS72R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-N3JK7VBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-4GESW7RM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-XIDPABA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-4BHWFFUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-4FJY7WIW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-472TIOVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-D7BF5CL2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-6KNOSLIT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-W4UEICGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-44IHMMZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-EXHU34EU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-IB2NZZWD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-VBCELP5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-7UBETML4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-R227JOL6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-FAG7COEH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-MCK7PLYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-QY44WAMR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-SY76DZTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-A7EICML6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-IKJZWLQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-NWMR3VQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-VU46BLJZ.js.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm health command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="d078e1a2-2f92-566c-8ecd-542b2730a9b6")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
@@ -150,6 +150,9 @@ async function listItemDocumentPaths(pmRoot, typeToFolder) {
|
|
|
150
150
|
itemPaths.sort((left, right) => normalizeRelativePath(pmRoot, left).localeCompare(normalizeRelativePath(pmRoot, right)));
|
|
151
151
|
return itemPaths;
|
|
152
152
|
}
|
|
153
|
+
function shouldReportHistoryDirectoryUnreadable(error) {
|
|
154
|
+
return !(typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT");
|
|
155
|
+
}
|
|
153
156
|
async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
154
157
|
const itemPaths = await listItemDocumentPaths(pmRoot, typeToFolder);
|
|
155
158
|
const itemUnreadable = [];
|
|
@@ -195,7 +198,7 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
|
195
198
|
}
|
|
196
199
|
catch (error) {
|
|
197
200
|
/* c8 ignore start -- ENOENT/non-ENOENT differentiation requires filesystem fault injection */
|
|
198
|
-
if (
|
|
201
|
+
if (shouldReportHistoryDirectoryUnreadable(error)) {
|
|
199
202
|
historyUnreadable.push("history");
|
|
200
203
|
}
|
|
201
204
|
/* c8 ignore stop */
|
|
@@ -636,49 +639,50 @@ function summarizeStringList(value, limit) {
|
|
|
636
639
|
truncated: strings.length > limit,
|
|
637
640
|
};
|
|
638
641
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
if (check.name === "settings") {
|
|
643
|
-
return {
|
|
644
|
-
version: details.version,
|
|
645
|
-
id_prefix: details.id_prefix,
|
|
646
|
-
locks_ttl_seconds: details.locks_ttl_seconds,
|
|
647
|
-
warnings: summarizeStringList(details.warnings, limit),
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
if (check.name === "directories") {
|
|
651
|
-
return {
|
|
652
|
-
required_count: Array.isArray(details.required) ? details.required.length : 0,
|
|
653
|
-
optional_count: Array.isArray(details.optional) ? details.optional.length : 0,
|
|
654
|
-
missing_required: summarizeStringList(details.missing_required, limit),
|
|
655
|
-
missing_optional: summarizeStringList(details.missing_optional, limit),
|
|
656
|
-
missing: summarizeStringList(details.missing, limit),
|
|
657
|
-
strict_directories: details.strict_directories,
|
|
658
|
-
};
|
|
642
|
+
function summarizeActivationMigrationStatus(value) {
|
|
643
|
+
if (typeof value !== "object" || value === null) {
|
|
644
|
+
return null;
|
|
659
645
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
646
|
+
const status = value;
|
|
647
|
+
return {
|
|
648
|
+
applied_count: status.applied_count,
|
|
649
|
+
pending_count: status.pending_count,
|
|
650
|
+
failed_count: status.failed_count,
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
const HEALTH_DETAIL_SUMMARIZERS = {
|
|
654
|
+
settings: (details, limit) => ({
|
|
655
|
+
version: details.version,
|
|
656
|
+
id_prefix: details.id_prefix,
|
|
657
|
+
locks_ttl_seconds: details.locks_ttl_seconds,
|
|
658
|
+
warnings: summarizeStringList(details.warnings, limit),
|
|
659
|
+
}),
|
|
660
|
+
directories: (details, limit) => ({
|
|
661
|
+
required_count: Array.isArray(details.required) ? details.required.length : 0,
|
|
662
|
+
optional_count: Array.isArray(details.optional) ? details.optional.length : 0,
|
|
663
|
+
missing_required: summarizeStringList(details.missing_required, limit),
|
|
664
|
+
missing_optional: summarizeStringList(details.missing_optional, limit),
|
|
665
|
+
missing: summarizeStringList(details.missing, limit),
|
|
666
|
+
strict_directories: details.strict_directories,
|
|
667
|
+
}),
|
|
668
|
+
settings_values: (details, limit) => ({
|
|
669
|
+
warnings: summarizeStringList(details.warnings, limit),
|
|
670
|
+
}),
|
|
671
|
+
telemetry: (details) => ({
|
|
672
|
+
enabled: details.enabled,
|
|
673
|
+
capture_level: details.capture_level,
|
|
674
|
+
endpoint: details.endpoint,
|
|
675
|
+
queue_exists: details.queue_exists,
|
|
676
|
+
queue_entries: details.queue_entries,
|
|
677
|
+
queue_draining: details.queue_draining,
|
|
678
|
+
queue_invalid_rows: details.queue_invalid_rows,
|
|
679
|
+
queue_rows_total: details.queue_rows_total,
|
|
680
|
+
last_successful_flush_at: details.last_successful_flush_at,
|
|
681
|
+
last_failed_flush_at: details.last_failed_flush_at,
|
|
682
|
+
endpoint_probe: details.endpoint_probe,
|
|
683
|
+
env_overrides: details.env_overrides,
|
|
684
|
+
}),
|
|
685
|
+
extensions: (details, limit) => {
|
|
682
686
|
const activation = typeof details.activation === "object" && details.activation !== null ? details.activation : {};
|
|
683
687
|
return {
|
|
684
688
|
disabled_by_flag: details.disabled_by_flag,
|
|
@@ -695,79 +699,67 @@ function summarizeHealthCheckDetails(check, limit) {
|
|
|
695
699
|
service_override_count: activation.service_override_count,
|
|
696
700
|
renderer_override_count: activation.renderer_override_count,
|
|
697
701
|
registration_counts: activation.registration_counts,
|
|
698
|
-
migration_status:
|
|
699
|
-
? {
|
|
700
|
-
applied_count: activation.migration_status.applied_count,
|
|
701
|
-
pending_count: activation.migration_status.pending_count,
|
|
702
|
-
failed_count: activation.migration_status.failed_count,
|
|
703
|
-
}
|
|
704
|
-
: null,
|
|
702
|
+
migration_status: summarizeActivationMigrationStatus(activation.migration_status),
|
|
705
703
|
},
|
|
706
704
|
triage: details.triage,
|
|
707
705
|
capability_contract: details.capability_contract,
|
|
708
706
|
capability_guidance: summarizeRecordList(details.capability_guidance, limit),
|
|
709
707
|
};
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
stale_items_after_total: details.stale_items_after_total,
|
|
766
|
-
stale_items_after: summarizeStringList(details.stale_items_after, limit),
|
|
767
|
-
skipped: details.skipped,
|
|
768
|
-
};
|
|
769
|
-
}
|
|
770
|
-
return details;
|
|
708
|
+
},
|
|
709
|
+
// Storage details are already compact counters; keep the pre-refactor pass-through shape.
|
|
710
|
+
storage: (details) => details,
|
|
711
|
+
locks: (details) => ({
|
|
712
|
+
active_lock_count: details.active_lock_count,
|
|
713
|
+
stale_lock_count: details.stale_lock_count,
|
|
714
|
+
unreadable_lock_count: details.unreadable_lock_count,
|
|
715
|
+
unparseable_lock_count: details.unparseable_lock_count,
|
|
716
|
+
}),
|
|
717
|
+
integrity: (details, limit) => ({
|
|
718
|
+
checked_item_files: details.checked_item_files,
|
|
719
|
+
checked_history_streams: details.checked_history_streams,
|
|
720
|
+
counts: details.counts,
|
|
721
|
+
item_unreadable: summarizeStringList(details.item_unreadable, limit),
|
|
722
|
+
item_conflict_markers: summarizeRecordList(details.item_conflict_markers, limit),
|
|
723
|
+
item_parse_failures: summarizeStringList(details.item_parse_failures, limit),
|
|
724
|
+
history_unreadable: summarizeStringList(details.history_unreadable, limit),
|
|
725
|
+
history_conflict_markers: summarizeRecordList(details.history_conflict_markers, limit),
|
|
726
|
+
history_invalid_json: summarizeRecordList(details.history_invalid_json, limit),
|
|
727
|
+
skipped: details.skipped,
|
|
728
|
+
}),
|
|
729
|
+
history_drift: (details, limit) => ({
|
|
730
|
+
checked_items: details.checked_items,
|
|
731
|
+
counts: details.counts,
|
|
732
|
+
drifted_items: summarizeStringList(details.drifted_items, limit),
|
|
733
|
+
missing_streams: summarizeStringList(details.missing_streams, limit),
|
|
734
|
+
unreadable_streams: summarizeStringList(details.unreadable_streams, limit),
|
|
735
|
+
hash_mismatches: summarizeStringList(details.hash_mismatches, limit),
|
|
736
|
+
chain_mismatches: summarizeStringList(details.chain_mismatches, limit),
|
|
737
|
+
skipped: details.skipped,
|
|
738
|
+
}),
|
|
739
|
+
vectorization: (details, limit) => ({
|
|
740
|
+
semantic_runtime_available: details.semantic_runtime_available,
|
|
741
|
+
compatibility_mode_auto_defaults: details.compatibility_mode_auto_defaults,
|
|
742
|
+
auto_ollama_defaults_applied: details.auto_ollama_defaults_applied,
|
|
743
|
+
refresh_policy: details.refresh_policy,
|
|
744
|
+
provider_active: details.provider_active,
|
|
745
|
+
vector_store_active: details.vector_store_active,
|
|
746
|
+
items: details.items,
|
|
747
|
+
ledger_entries_before: details.ledger_entries_before,
|
|
748
|
+
stale_items_before_total: details.stale_items_before_total,
|
|
749
|
+
stale_items_before: summarizeStringList(details.stale_items_before, limit),
|
|
750
|
+
refresh_attempted: details.refresh_attempted,
|
|
751
|
+
refresh_skipped_reason: details.refresh_skipped_reason,
|
|
752
|
+
refresh_result: details.refresh_result,
|
|
753
|
+
ledger_entries_after: details.ledger_entries_after,
|
|
754
|
+
stale_items_after_total: details.stale_items_after_total,
|
|
755
|
+
stale_items_after: summarizeStringList(details.stale_items_after, limit),
|
|
756
|
+
skipped: details.skipped,
|
|
757
|
+
}),
|
|
758
|
+
};
|
|
759
|
+
/* c8 ignore start -- brief/summary projection matrix branches are validated in projection integration tests */
|
|
760
|
+
function summarizeHealthCheckDetails(check, limit) {
|
|
761
|
+
const summarize = HEALTH_DETAIL_SUMMARIZERS[check.name];
|
|
762
|
+
return summarize ? summarize(check.details, limit) : check.details;
|
|
771
763
|
}
|
|
772
764
|
/* c8 ignore stop */
|
|
773
765
|
function applyBriefHealthProjection(result) {
|
|
@@ -903,6 +895,101 @@ function parseTelemetryQueue(raw) {
|
|
|
903
895
|
maxAttempts,
|
|
904
896
|
};
|
|
905
897
|
}
|
|
898
|
+
function emptyTelemetryQueueSummary() {
|
|
899
|
+
return { validEntries: 0, invalidRows: 0, totalRows: 0, highRetryEntries: 0, maxAttempts: 0 };
|
|
900
|
+
}
|
|
901
|
+
/* c8 ignore start -- telemetry state corruption and otel-failure branches require runtime-coordinated fixture mutation */
|
|
902
|
+
function parseTelemetryRuntimeState(stateRaw) {
|
|
903
|
+
if (!stateRaw || stateRaw.trim().length === 0) {
|
|
904
|
+
return { runtimeState: {}, stateParseFailed: false };
|
|
905
|
+
}
|
|
906
|
+
try {
|
|
907
|
+
const parsed = JSON.parse(stateRaw);
|
|
908
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
909
|
+
return { runtimeState: parsed, stateParseFailed: false };
|
|
910
|
+
}
|
|
911
|
+
return { runtimeState: {}, stateParseFailed: true };
|
|
912
|
+
}
|
|
913
|
+
catch {
|
|
914
|
+
return { runtimeState: {}, stateParseFailed: true };
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
async function maybeProbeTelemetryEndpoint(settings, checkTelemetry) {
|
|
918
|
+
const endpoint = settings.telemetry.endpoint.trim();
|
|
919
|
+
if (!checkTelemetry || !settings.telemetry.enabled || endpoint.length === 0) {
|
|
920
|
+
return undefined;
|
|
921
|
+
}
|
|
922
|
+
const probe = await probeTelemetryEndpointHealth(endpoint);
|
|
923
|
+
return {
|
|
924
|
+
attempted: true,
|
|
925
|
+
...probe,
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
function collectTelemetryQueueWarnings(settings, queueSummary, runtimeState) {
|
|
929
|
+
const warnings = [];
|
|
930
|
+
if (queueSummary.invalidRows > 0) {
|
|
931
|
+
warnings.push(`telemetry_queue_invalid_rows:${queueSummary.invalidRows}`);
|
|
932
|
+
}
|
|
933
|
+
if (!settings.telemetry.enabled || queueSummary.validEntries === 0) {
|
|
934
|
+
return warnings;
|
|
935
|
+
}
|
|
936
|
+
const lastSuccess = runtimeState.last_successful_flush_at;
|
|
937
|
+
const lastFailure = runtimeState.last_failed_flush_at;
|
|
938
|
+
const activeFailure = lastFailure && (!lastSuccess || lastFailure > lastSuccess);
|
|
939
|
+
const neverFlushed = !lastSuccess;
|
|
940
|
+
const highWater = queueSummary.validEntries >= TELEMETRY_QUEUE_HIGH_WATER_MARK;
|
|
941
|
+
if (activeFailure || neverFlushed || highWater) {
|
|
942
|
+
warnings.push(`telemetry_queue_pending:${queueSummary.validEntries}`);
|
|
943
|
+
}
|
|
944
|
+
if (queueSummary.highRetryEntries > 0) {
|
|
945
|
+
warnings.push(`telemetry_queue_high_retries:${queueSummary.highRetryEntries}`);
|
|
946
|
+
}
|
|
947
|
+
return warnings;
|
|
948
|
+
}
|
|
949
|
+
function collectTelemetryEndpointWarnings(endpointProbe) {
|
|
950
|
+
if (!endpointProbe || endpointProbe.ok !== false) {
|
|
951
|
+
return [];
|
|
952
|
+
}
|
|
953
|
+
return typeof endpointProbe.status === "number"
|
|
954
|
+
? [`telemetry_endpoint_probe_http_status:${endpointProbe.status}`]
|
|
955
|
+
: ["telemetry_endpoint_probe_failed"];
|
|
956
|
+
}
|
|
957
|
+
function collectTelemetrySchemaWarnings(endpointProbe) {
|
|
958
|
+
const parsedMaxSchemaVersion = Number.parseInt(endpointProbe?.max_schema_version ?? "", 10);
|
|
959
|
+
if (endpointProbe?.ok === true && Number.isInteger(parsedMaxSchemaVersion) && parsedMaxSchemaVersion > TELEMETRY_SCHEMA_VERSION) {
|
|
960
|
+
return [`telemetry_schema_version_behind:${parsedMaxSchemaVersion}`];
|
|
961
|
+
}
|
|
962
|
+
return [];
|
|
963
|
+
}
|
|
964
|
+
function collectTelemetryOtelWarnings(settings, runtimeState) {
|
|
965
|
+
const pendingOtelSpans = typeof runtimeState.pending_otel_spans === "number" ? runtimeState.pending_otel_spans : 0;
|
|
966
|
+
const lastOtelSuccess = runtimeState.last_otel_success_at;
|
|
967
|
+
const lastOtelFailure = runtimeState.last_otel_failure_at;
|
|
968
|
+
const otelExportFailing = settings.telemetry.enabled &&
|
|
969
|
+
pendingOtelSpans > 0 &&
|
|
970
|
+
Boolean(lastOtelFailure) &&
|
|
971
|
+
// >= so a mixed-outcome batch (success + failure share the same attempt
|
|
972
|
+
// timestamp) still surfaces the warning rather than being masked by the tie.
|
|
973
|
+
(!lastOtelSuccess || lastOtelFailure >= lastOtelSuccess);
|
|
974
|
+
return otelExportFailing ? [`telemetry_otel_export_failing:${pendingOtelSpans}`] : [];
|
|
975
|
+
}
|
|
976
|
+
function buildTelemetryEnvOverrideDetails() {
|
|
977
|
+
return {
|
|
978
|
+
telemetry_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_DISABLED") || telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
979
|
+
pm_no_telemetry: telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
980
|
+
telemetry_otel_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_OTEL_DISABLED"),
|
|
981
|
+
telemetry_inline_flush: telemetryEnvFlagEnabled("PM_TELEMETRY_INLINE_FLUSH"),
|
|
982
|
+
telemetry_source_context: telemetrySourceContextOverride(),
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
/* c8 ignore stop */
|
|
986
|
+
function telemetryQueueHasEntries(settings, queueSummary) {
|
|
987
|
+
return settings.telemetry.enabled && queueSummary.validEntries > 0;
|
|
988
|
+
}
|
|
989
|
+
function isTelemetryQueueDraining(queueHasEntries, warnings) {
|
|
990
|
+
return (queueHasEntries &&
|
|
991
|
+
warnings.every((warning) => !warning.startsWith("telemetry_queue_pending:") && !warning.startsWith("telemetry_queue_high_retries:")));
|
|
992
|
+
}
|
|
906
993
|
async function probeTelemetryEndpointHealth(endpoint) {
|
|
907
994
|
let probeUrl = endpoint;
|
|
908
995
|
try {
|
|
@@ -951,88 +1038,19 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
951
1038
|
const queueRaw = await readFileIfExists(queuePath);
|
|
952
1039
|
const queueExists = queueRaw !== null;
|
|
953
1040
|
const queueSizeBytes = queueRaw ? Buffer.byteLength(queueRaw, "utf8") : 0;
|
|
954
|
-
const queueSummary = queueRaw
|
|
955
|
-
? parseTelemetryQueue(queueRaw)
|
|
956
|
-
: { validEntries: 0, invalidRows: 0, totalRows: 0, highRetryEntries: 0, maxAttempts: 0 };
|
|
1041
|
+
const queueSummary = queueRaw ? parseTelemetryQueue(queueRaw) : emptyTelemetryQueueSummary();
|
|
957
1042
|
const stateRaw = await readFileIfExists(statePath);
|
|
958
|
-
|
|
959
|
-
let stateParseFailed = false;
|
|
960
|
-
/* c8 ignore start -- telemetry state corruption and otel-failure branches require runtime-coordinated fixture mutation */
|
|
961
|
-
if (stateRaw && stateRaw.trim().length > 0) {
|
|
962
|
-
try {
|
|
963
|
-
const parsed = JSON.parse(stateRaw);
|
|
964
|
-
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
965
|
-
runtimeState = parsed;
|
|
966
|
-
}
|
|
967
|
-
else {
|
|
968
|
-
/* c8 ignore next -- malformed runtime-state payloads are integration-only corruption cases */
|
|
969
|
-
stateParseFailed = true;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
catch {
|
|
973
|
-
stateParseFailed = true;
|
|
974
|
-
}
|
|
975
|
-
}
|
|
1043
|
+
const { runtimeState, stateParseFailed } = parseTelemetryRuntimeState(stateRaw);
|
|
976
1044
|
const endpoint = settings.telemetry.endpoint.trim();
|
|
977
1045
|
const endpointDisplay = normalizeEndpointForDisplay(endpoint);
|
|
978
|
-
|
|
979
|
-
if (options.checkTelemetry && settings.telemetry.enabled && endpoint.length > 0) {
|
|
980
|
-
const probe = await probeTelemetryEndpointHealth(endpoint);
|
|
981
|
-
endpointProbe = {
|
|
982
|
-
attempted: true,
|
|
983
|
-
...probe,
|
|
984
|
-
};
|
|
985
|
-
}
|
|
1046
|
+
const endpointProbe = await maybeProbeTelemetryEndpoint(settings, options.checkTelemetry);
|
|
986
1047
|
const warnings = [];
|
|
987
1048
|
if (stateParseFailed) {
|
|
988
1049
|
warnings.push("telemetry_state_invalid_json");
|
|
989
1050
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
}
|
|
993
|
-
const queueHasEntries = settings.telemetry.enabled && queueSummary.validEntries > 0;
|
|
994
|
-
if (queueHasEntries) {
|
|
995
|
-
const lastSuccess = runtimeState.last_successful_flush_at;
|
|
996
|
-
const lastFailure = runtimeState.last_failed_flush_at;
|
|
997
|
-
const activeFailure = lastFailure && (!lastSuccess || lastFailure > lastSuccess);
|
|
998
|
-
const neverFlushed = !lastSuccess;
|
|
999
|
-
const highWater = queueSummary.validEntries >= TELEMETRY_QUEUE_HIGH_WATER_MARK;
|
|
1000
|
-
const highRetries = queueSummary.highRetryEntries > 0;
|
|
1001
|
-
if (activeFailure || neverFlushed || highWater) {
|
|
1002
|
-
warnings.push(`telemetry_queue_pending:${queueSummary.validEntries}`);
|
|
1003
|
-
}
|
|
1004
|
-
if (highRetries) {
|
|
1005
|
-
warnings.push(`telemetry_queue_high_retries:${queueSummary.highRetryEntries}`);
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
if (endpointProbe && !endpointProbe.ok) {
|
|
1009
|
-
if (typeof endpointProbe.status === "number") {
|
|
1010
|
-
warnings.push(`telemetry_endpoint_probe_http_status:${endpointProbe.status}`);
|
|
1011
|
-
}
|
|
1012
|
-
else {
|
|
1013
|
-
warnings.push("telemetry_endpoint_probe_failed");
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
const parsedMaxSchemaVersion = Number.parseInt(endpointProbe?.max_schema_version ?? "", 10);
|
|
1017
|
-
if (endpointProbe &&
|
|
1018
|
-
endpointProbe.ok &&
|
|
1019
|
-
Number.isInteger(parsedMaxSchemaVersion) &&
|
|
1020
|
-
parsedMaxSchemaVersion > TELEMETRY_SCHEMA_VERSION) {
|
|
1021
|
-
warnings.push(`telemetry_schema_version_behind:${parsedMaxSchemaVersion}`);
|
|
1022
|
-
}
|
|
1051
|
+
warnings.push(...collectTelemetryQueueWarnings(settings, queueSummary, runtimeState), ...collectTelemetryEndpointWarnings(endpointProbe), ...collectTelemetrySchemaWarnings(endpointProbe), ...collectTelemetryOtelWarnings(settings, runtimeState));
|
|
1052
|
+
const queueHasEntries = telemetryQueueHasEntries(settings, queueSummary);
|
|
1023
1053
|
const pendingOtelSpans = typeof runtimeState.pending_otel_spans === "number" ? runtimeState.pending_otel_spans : 0;
|
|
1024
|
-
const lastOtelSuccess = runtimeState.last_otel_success_at;
|
|
1025
|
-
const lastOtelFailure = runtimeState.last_otel_failure_at;
|
|
1026
|
-
const otelExportFailing = settings.telemetry.enabled &&
|
|
1027
|
-
pendingOtelSpans > 0 &&
|
|
1028
|
-
Boolean(lastOtelFailure) &&
|
|
1029
|
-
// >= so a mixed-outcome batch (success + failure share the same attempt
|
|
1030
|
-
// timestamp) still surfaces the warning rather than being masked by the tie.
|
|
1031
|
-
(!lastOtelSuccess || lastOtelFailure >= lastOtelSuccess);
|
|
1032
|
-
if (otelExportFailing) {
|
|
1033
|
-
warnings.push(`telemetry_otel_export_failing:${pendingOtelSpans}`);
|
|
1034
|
-
}
|
|
1035
|
-
/* c8 ignore stop */
|
|
1036
1054
|
return {
|
|
1037
1055
|
check: {
|
|
1038
1056
|
name: "telemetry",
|
|
@@ -1045,8 +1063,7 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
1045
1063
|
queue_path: queuePath,
|
|
1046
1064
|
queue_exists: queueExists,
|
|
1047
1065
|
queue_entries: queueSummary.validEntries,
|
|
1048
|
-
queue_draining: queueHasEntries
|
|
1049
|
-
warnings.every((warning) => !warning.startsWith("telemetry_queue_pending:") && !warning.startsWith("telemetry_queue_high_retries:")),
|
|
1066
|
+
queue_draining: isTelemetryQueueDraining(queueHasEntries, warnings),
|
|
1050
1067
|
queue_invalid_rows: queueSummary.invalidRows,
|
|
1051
1068
|
queue_rows_total: queueSummary.totalRows,
|
|
1052
1069
|
queue_size_bytes: queueSizeBytes,
|
|
@@ -1063,18 +1080,8 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
1063
1080
|
last_otel_success_at: runtimeState.last_otel_success_at ?? null,
|
|
1064
1081
|
last_otel_failure_at: runtimeState.last_otel_failure_at ?? null,
|
|
1065
1082
|
last_otel_failure_error: runtimeState.last_otel_failure_error ?? null,
|
|
1066
|
-
endpoint_probe: endpointProbe ?? {
|
|
1067
|
-
|
|
1068
|
-
},
|
|
1069
|
-
/* c8 ignore start -- env-override combinations are validated through runtime integration suites */
|
|
1070
|
-
env_overrides: {
|
|
1071
|
-
telemetry_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_DISABLED") || telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
1072
|
-
pm_no_telemetry: telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
1073
|
-
telemetry_otel_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_OTEL_DISABLED"),
|
|
1074
|
-
telemetry_inline_flush: telemetryEnvFlagEnabled("PM_TELEMETRY_INLINE_FLUSH"),
|
|
1075
|
-
telemetry_source_context: telemetrySourceContextOverride(),
|
|
1076
|
-
},
|
|
1077
|
-
/* c8 ignore stop */
|
|
1083
|
+
endpoint_probe: endpointProbe ?? { attempted: false },
|
|
1084
|
+
env_overrides: buildTelemetryEnvOverrideDetails(),
|
|
1078
1085
|
},
|
|
1079
1086
|
},
|
|
1080
1087
|
warnings,
|
|
@@ -1165,78 +1172,136 @@ async function buildHistoryDriftCheck(pmRoot, items) {
|
|
|
1165
1172
|
warnings,
|
|
1166
1173
|
};
|
|
1167
1174
|
}
|
|
1168
|
-
|
|
1175
|
+
function buildVectorizationRuntimeSnapshot(settings) {
|
|
1169
1176
|
const runtimeDefaults = resolveSettingsWithSemanticRuntimeDefaults(settings);
|
|
1170
1177
|
const providerResolution = resolveEmbeddingProviders(runtimeDefaults.settings);
|
|
1171
1178
|
const vectorStoreResolution = resolveVectorStores(runtimeDefaults.settings);
|
|
1172
1179
|
const runtimeEmbeddingIdentity = providerResolution.active
|
|
1173
1180
|
? buildVectorizationEmbeddingIdentity(providerResolution.active.name, providerResolution.active.model)
|
|
1174
1181
|
: null;
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1182
|
+
return {
|
|
1183
|
+
runtimeDefaults,
|
|
1184
|
+
providerResolution,
|
|
1185
|
+
vectorStoreResolution,
|
|
1186
|
+
runtimeEmbeddingIdentity,
|
|
1187
|
+
semanticRuntimeAvailable: Boolean(providerResolution.active && vectorStoreResolution.active),
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
function emptyVectorizationRefreshResult() {
|
|
1191
|
+
return {
|
|
1179
1192
|
refreshed: [],
|
|
1180
1193
|
skipped: [],
|
|
1181
1194
|
warnings: [],
|
|
1182
1195
|
};
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
});
|
|
1196
|
+
}
|
|
1197
|
+
async function refreshStaleVectorizationItems(params) {
|
|
1198
|
+
if (!params.refreshPolicy.enabled || !params.snapshot.semanticRuntimeAvailable || params.staleBefore.length === 0) {
|
|
1199
|
+
return emptyVectorizationRefreshResult();
|
|
1188
1200
|
}
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
+
return refreshSemanticEmbeddingsForMutatedItems(params.pmRoot, params.staleBefore, {
|
|
1202
|
+
settings: params.snapshot.runtimeDefaults.settings,
|
|
1203
|
+
apply_runtime_defaults: false,
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
function vectorizationEmbeddingIdentityChanged(params) {
|
|
1207
|
+
return (params.strictVectorizationWarnings &&
|
|
1208
|
+
params.semanticRuntimeAvailable &&
|
|
1209
|
+
Boolean(params.ledgerBefore.embedding &&
|
|
1210
|
+
params.runtimeEmbeddingIdentity &&
|
|
1211
|
+
hasVectorizationEmbeddingIdentityChanged(params.ledgerBefore.embedding, params.runtimeEmbeddingIdentity)));
|
|
1212
|
+
}
|
|
1213
|
+
/* c8 ignore start -- strict-vectorization warning synthesis branches are integration-only policy permutations */
|
|
1214
|
+
function collectVectorizationWarnings(params) {
|
|
1215
|
+
const warningSet = new Set([...params.ledgerBefore.warnings, ...params.ledgerAfter.warnings]);
|
|
1216
|
+
if (params.strictVectorizationWarnings) {
|
|
1217
|
+
for (const warning of params.refreshResult.warnings) {
|
|
1201
1218
|
warningSet.add(warning);
|
|
1202
1219
|
}
|
|
1203
1220
|
}
|
|
1204
|
-
if (embeddingIdentityChanged) {
|
|
1221
|
+
if (params.embeddingIdentityChanged) {
|
|
1205
1222
|
warningSet.add("vectorization_embedding_identity_changed");
|
|
1206
1223
|
}
|
|
1207
|
-
if (strictVectorizationWarnings && semanticRuntimeAvailable && staleAfter.length > 0) {
|
|
1208
|
-
warningSet.add(`vectorization_stale_items_remaining:${staleAfter.length}`);
|
|
1224
|
+
if (params.strictVectorizationWarnings && params.semanticRuntimeAvailable && params.staleAfter.length > 0) {
|
|
1225
|
+
warningSet.add(`vectorization_stale_items_remaining:${params.staleAfter.length}`);
|
|
1209
1226
|
}
|
|
1210
|
-
|
|
1227
|
+
return [...warningSet].sort((left, right) => left.localeCompare(right));
|
|
1228
|
+
}
|
|
1229
|
+
/* c8 ignore stop */
|
|
1230
|
+
function resolveVectorizationRefreshSkippedReason(refreshPolicy, semanticRuntimeAvailable, staleBefore) {
|
|
1231
|
+
if (refreshPolicy.enabled && semanticRuntimeAvailable && staleBefore.length > 0) {
|
|
1232
|
+
return null;
|
|
1233
|
+
}
|
|
1234
|
+
if (!refreshPolicy.enabled) {
|
|
1235
|
+
return "refresh_disabled";
|
|
1236
|
+
}
|
|
1237
|
+
return semanticRuntimeAvailable ? "no_stale_items" : "semantic_runtime_unavailable";
|
|
1238
|
+
}
|
|
1239
|
+
function buildVectorizationProviderDetails(settings, snapshot) {
|
|
1240
|
+
const activeProvider = snapshot.providerResolution.active?.name ?? null;
|
|
1241
|
+
const activeVectorStore = snapshot.vectorStoreResolution.active?.name ?? null;
|
|
1242
|
+
return {
|
|
1243
|
+
provider_active: activeProvider,
|
|
1244
|
+
// GH-244: surface the persisted (possibly empty) configured value and
|
|
1245
|
+
// how the active resolution was sourced, so a config audit can tell
|
|
1246
|
+
// "auto-detected" apart from a genuine misconfiguration when
|
|
1247
|
+
// settings.search.provider / vector_store.adapter are empty strings.
|
|
1248
|
+
provider_configured: typeof settings.search?.provider === "string" ? settings.search.provider : null,
|
|
1249
|
+
provider_source: resolveProviderConfigSource(activeProvider, settings.search?.provider ?? null),
|
|
1250
|
+
vector_store_active: activeVectorStore,
|
|
1251
|
+
vector_store_configured: typeof settings.vector_store?.adapter === "string" ? settings.vector_store.adapter : null,
|
|
1252
|
+
vector_store_source: resolveProviderConfigSource(activeVectorStore, settings.vector_store?.adapter ?? null),
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
function buildVectorizationRefreshPolicyDetails(refreshPolicy) {
|
|
1256
|
+
return {
|
|
1257
|
+
enabled: refreshPolicy.enabled,
|
|
1258
|
+
check_only: refreshPolicy.checkOnly,
|
|
1259
|
+
no_refresh: refreshPolicy.noRefresh,
|
|
1260
|
+
refresh_vectors: refreshPolicy.refreshVectors,
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
function vectorizationRefreshAttempted(refreshPolicy, semanticRuntimeAvailable, staleBefore) {
|
|
1264
|
+
return refreshPolicy.enabled && staleBefore.length > 0 && semanticRuntimeAvailable;
|
|
1265
|
+
}
|
|
1266
|
+
async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, verboseStaleItems) {
|
|
1267
|
+
const snapshot = buildVectorizationRuntimeSnapshot(settings);
|
|
1268
|
+
const ledgerBefore = await readVectorizationStatusLedger(pmRoot);
|
|
1269
|
+
const staleBefore = snapshot.semanticRuntimeAvailable ? collectStaleVectorizationIds(items, ledgerBefore.entries) : [];
|
|
1270
|
+
const refreshResult = await refreshStaleVectorizationItems({ pmRoot, snapshot, refreshPolicy, staleBefore });
|
|
1271
|
+
const ledgerAfter = await readVectorizationStatusLedger(pmRoot);
|
|
1272
|
+
const staleAfter = snapshot.semanticRuntimeAvailable ? collectStaleVectorizationIds(items, ledgerAfter.entries) : [];
|
|
1273
|
+
const strictVectorizationWarnings = !snapshot.runtimeDefaults.auto_ollama_defaults_applied;
|
|
1274
|
+
const embeddingIdentityChanged = vectorizationEmbeddingIdentityChanged({
|
|
1275
|
+
strictVectorizationWarnings,
|
|
1276
|
+
semanticRuntimeAvailable: snapshot.semanticRuntimeAvailable,
|
|
1277
|
+
ledgerBefore,
|
|
1278
|
+
runtimeEmbeddingIdentity: snapshot.runtimeEmbeddingIdentity,
|
|
1279
|
+
});
|
|
1280
|
+
const warnings = collectVectorizationWarnings({
|
|
1281
|
+
ledgerBefore,
|
|
1282
|
+
ledgerAfter,
|
|
1283
|
+
refreshResult,
|
|
1284
|
+
strictVectorizationWarnings,
|
|
1285
|
+
semanticRuntimeAvailable: snapshot.semanticRuntimeAvailable,
|
|
1286
|
+
embeddingIdentityChanged,
|
|
1287
|
+
staleAfter,
|
|
1288
|
+
});
|
|
1211
1289
|
const staleBeforeDetail = selectStaleItemDetail(staleBefore, verboseStaleItems);
|
|
1212
1290
|
const staleAfterDetail = selectStaleItemDetail(staleAfter, verboseStaleItems);
|
|
1291
|
+
const refreshAttempted = vectorizationRefreshAttempted(refreshPolicy, snapshot.semanticRuntimeAvailable, staleBefore);
|
|
1213
1292
|
return {
|
|
1214
1293
|
check: {
|
|
1215
1294
|
name: "vectorization",
|
|
1216
1295
|
status: warnings.length === 0 ? "ok" : "warn",
|
|
1217
1296
|
details: {
|
|
1218
|
-
semantic_runtime_available: semanticRuntimeAvailable,
|
|
1219
|
-
compatibility_mode_auto_defaults: runtimeDefaults.auto_ollama_defaults_applied,
|
|
1220
|
-
auto_ollama_defaults_applied: runtimeDefaults.auto_ollama_defaults_applied,
|
|
1221
|
-
refresh_policy:
|
|
1222
|
-
|
|
1223
|
-
check_only: refreshPolicy.checkOnly,
|
|
1224
|
-
no_refresh: refreshPolicy.noRefresh,
|
|
1225
|
-
refresh_vectors: refreshPolicy.refreshVectors,
|
|
1226
|
-
},
|
|
1227
|
-
provider_active: providerResolution.active?.name ?? null,
|
|
1228
|
-
// GH-244: surface the persisted (possibly empty) configured value and
|
|
1229
|
-
// how the active resolution was sourced, so a config audit can tell
|
|
1230
|
-
// "auto-detected" apart from a genuine misconfiguration when
|
|
1231
|
-
// settings.search.provider / vector_store.adapter are empty strings.
|
|
1232
|
-
provider_configured: typeof settings.search?.provider === "string" ? settings.search.provider : null,
|
|
1233
|
-
provider_source: resolveProviderConfigSource(providerResolution.active?.name ?? null, settings.search?.provider ?? null),
|
|
1234
|
-
vector_store_active: vectorStoreResolution.active?.name ?? null,
|
|
1235
|
-
vector_store_configured: typeof settings.vector_store?.adapter === "string" ? settings.vector_store.adapter : null,
|
|
1236
|
-
vector_store_source: resolveProviderConfigSource(vectorStoreResolution.active?.name ?? null, settings.vector_store?.adapter ?? null),
|
|
1297
|
+
semantic_runtime_available: snapshot.semanticRuntimeAvailable,
|
|
1298
|
+
compatibility_mode_auto_defaults: snapshot.runtimeDefaults.auto_ollama_defaults_applied,
|
|
1299
|
+
auto_ollama_defaults_applied: snapshot.runtimeDefaults.auto_ollama_defaults_applied,
|
|
1300
|
+
refresh_policy: buildVectorizationRefreshPolicyDetails(refreshPolicy),
|
|
1301
|
+
...buildVectorizationProviderDetails(settings, snapshot),
|
|
1237
1302
|
embedding_identity_changed: embeddingIdentityChanged,
|
|
1238
1303
|
embedding_identity_before: ledgerBefore.embedding ?? null,
|
|
1239
|
-
embedding_identity_runtime: runtimeEmbeddingIdentity ?? null,
|
|
1304
|
+
embedding_identity_runtime: snapshot.runtimeEmbeddingIdentity ?? null,
|
|
1240
1305
|
items: items.length,
|
|
1241
1306
|
ledger_entries_before: Object.keys(ledgerBefore.entries).length,
|
|
1242
1307
|
stale_items_detail_mode: verboseStaleItems ? "full" : "summary",
|
|
@@ -1244,14 +1309,8 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
|
|
|
1244
1309
|
stale_items_before_total: staleBeforeDetail.total,
|
|
1245
1310
|
stale_items_before: staleBeforeDetail.values,
|
|
1246
1311
|
stale_items_before_truncated: staleBeforeDetail.truncated,
|
|
1247
|
-
refresh_attempted:
|
|
1248
|
-
refresh_skipped_reason: refreshPolicy.
|
|
1249
|
-
? null
|
|
1250
|
-
: !refreshPolicy.enabled
|
|
1251
|
-
? "refresh_disabled"
|
|
1252
|
-
: !semanticRuntimeAvailable
|
|
1253
|
-
? "semantic_runtime_unavailable"
|
|
1254
|
-
: "no_stale_items",
|
|
1312
|
+
refresh_attempted: refreshAttempted,
|
|
1313
|
+
refresh_skipped_reason: resolveVectorizationRefreshSkippedReason(refreshPolicy, snapshot.semanticRuntimeAvailable, staleBefore),
|
|
1255
1314
|
refresh_result: refreshResult,
|
|
1256
1315
|
ledger_entries_after: Object.keys(ledgerAfter.entries).length,
|
|
1257
1316
|
stale_items_after_total: staleAfterDetail.total,
|
|
@@ -1261,7 +1320,6 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
|
|
|
1261
1320
|
},
|
|
1262
1321
|
warnings,
|
|
1263
1322
|
};
|
|
1264
|
-
/* c8 ignore stop */
|
|
1265
1323
|
}
|
|
1266
1324
|
function validateSettingsValues(settings) {
|
|
1267
1325
|
const warnings = [];
|
|
@@ -1290,20 +1348,7 @@ function resolveVectorRefreshPolicy(options) {
|
|
|
1290
1348
|
refreshVectors,
|
|
1291
1349
|
};
|
|
1292
1350
|
}
|
|
1293
|
-
|
|
1294
|
-
* Implements run health for the public runtime surface of this module.
|
|
1295
|
-
*/
|
|
1296
|
-
export async function runHealth(global, options = {}) {
|
|
1297
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1298
|
-
const settingsPath = getSettingsPath(pmRoot);
|
|
1299
|
-
if (!(await pathExists(settingsPath))) {
|
|
1300
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
1301
|
-
}
|
|
1302
|
-
const { settings, warnings: settingsReadWarnings } = await readSettingsWithMetadata(pmRoot);
|
|
1303
|
-
const normalizedSettingsReadWarnings = [...new Set(settingsReadWarnings)];
|
|
1304
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
1305
|
-
const strictDirectories = options.strictDirectories === true;
|
|
1306
|
-
const refreshPolicy = resolveVectorRefreshPolicy(options);
|
|
1351
|
+
function resolveHealthDirectoryLists(typeRegistry) {
|
|
1307
1352
|
const optionalBuiltinDirs = new Set(PM_OPTIONAL_TYPE_SUBDIRS.filter((entry) => entry.length > 0));
|
|
1308
1353
|
const requiredDirSet = new Set(PM_CORE_REQUIRED_SUBDIRS.filter((entry) => entry.length > 0));
|
|
1309
1354
|
const optionalDirSet = new Set();
|
|
@@ -1314,44 +1359,208 @@ export async function runHealth(global, options = {}) {
|
|
|
1314
1359
|
}
|
|
1315
1360
|
requiredDirSet.add(folder);
|
|
1316
1361
|
}
|
|
1317
|
-
|
|
1318
|
-
|
|
1362
|
+
return {
|
|
1363
|
+
requiredDirs: [...requiredDirSet].sort((left, right) => left.localeCompare(right)),
|
|
1364
|
+
optionalDirs: [...optionalDirSet].sort((left, right) => left.localeCompare(right)),
|
|
1365
|
+
optionalDirSet,
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
async function scanHealthDirectories(pmRoot, typeRegistry, strictDirectories) {
|
|
1369
|
+
const { requiredDirs, optionalDirs, optionalDirSet } = resolveHealthDirectoryLists(typeRegistry);
|
|
1319
1370
|
const missingRequiredDirs = [];
|
|
1320
1371
|
const missingOptionalDirs = [];
|
|
1321
1372
|
const hookWarnings = [];
|
|
1322
1373
|
for (const relativeDir of [...requiredDirs, ...optionalDirs]) {
|
|
1323
1374
|
const directoryPath = path.join(pmRoot, relativeDir);
|
|
1324
|
-
hookWarnings.push(...(await runActiveOnReadHooks({
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
}
|
|
1328
|
-
if (
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1375
|
+
hookWarnings.push(...(await runActiveOnReadHooks({ path: directoryPath, scope: "project" })));
|
|
1376
|
+
if (await isDirectory(directoryPath)) {
|
|
1377
|
+
continue;
|
|
1378
|
+
}
|
|
1379
|
+
if (optionalDirSet.has(relativeDir)) {
|
|
1380
|
+
missingOptionalDirs.push(relativeDir);
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
missingRequiredDirs.push(relativeDir);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return {
|
|
1387
|
+
requiredDirs,
|
|
1388
|
+
optionalDirs,
|
|
1389
|
+
missingRequiredDirs,
|
|
1390
|
+
missingOptionalDirs,
|
|
1391
|
+
missingDirs: strictDirectories ? [...missingRequiredDirs, ...missingOptionalDirs] : [...missingRequiredDirs],
|
|
1392
|
+
hookWarnings,
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
function resolveHealthSkipPolicy(options) {
|
|
1396
|
+
const summaryMode = options.summary === true && options.full !== true;
|
|
1397
|
+
const fastProjectionCheckOnly = options.checkOnly === true && (options.brief === true || options.summary === true) && options.full !== true;
|
|
1398
|
+
return {
|
|
1399
|
+
summaryMode,
|
|
1400
|
+
skipIntegrity: (options.skipIntegrity === true || fastProjectionCheckOnly) && options.full !== true,
|
|
1401
|
+
skipDrift: (options.skipDrift === true || fastProjectionCheckOnly) && options.full !== true,
|
|
1402
|
+
skipVectors: (options.skipVectors === true || fastProjectionCheckOnly) && options.full !== true,
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
async function readHealthItems(params) {
|
|
1406
|
+
if (params.skipPolicy.skipDrift && params.skipPolicy.skipVectors) {
|
|
1407
|
+
return listAllFrontMatter(params.pmRoot, params.settings.item_format, params.typeRegistry.type_to_folder, params.itemReadWarnings, params.settings.schema);
|
|
1408
|
+
}
|
|
1409
|
+
return listAllFrontMatterWithBody(params.pmRoot, params.settings.item_format, params.typeRegistry.type_to_folder, params.itemReadWarnings, params.settings.schema);
|
|
1410
|
+
}
|
|
1411
|
+
function buildSkippedHealthCheck(name) {
|
|
1412
|
+
return { check: { name, status: "ok", details: { skipped: true } }, warnings: [] };
|
|
1413
|
+
}
|
|
1414
|
+
function buildSettingsHealthCheck(settingsPath, settings, normalizedSettingsReadWarnings) {
|
|
1415
|
+
return {
|
|
1416
|
+
name: "settings",
|
|
1417
|
+
/* c8 ignore next -- settings read-warning status split is covered in broader read-settings integration tests */
|
|
1418
|
+
status: normalizedSettingsReadWarnings.length === 0 ? "ok" : "warn",
|
|
1419
|
+
details: {
|
|
1420
|
+
path: settingsPath,
|
|
1421
|
+
version: settings.version,
|
|
1422
|
+
id_prefix: settings.id_prefix,
|
|
1423
|
+
locks_ttl_seconds: settings.locks.ttl_seconds,
|
|
1424
|
+
warnings: normalizedSettingsReadWarnings,
|
|
1425
|
+
},
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
function buildDirectoriesHealthCheck(directoryState, strictDirectories) {
|
|
1429
|
+
return {
|
|
1430
|
+
name: "directories",
|
|
1431
|
+
status: directoryState.missingDirs.length === 0 ? "ok" : "warn",
|
|
1432
|
+
details: {
|
|
1433
|
+
required: directoryState.requiredDirs,
|
|
1434
|
+
optional: directoryState.optionalDirs,
|
|
1435
|
+
missing_required: directoryState.missingRequiredDirs,
|
|
1436
|
+
missing_optional: directoryState.missingOptionalDirs,
|
|
1437
|
+
missing: directoryState.missingDirs,
|
|
1438
|
+
strict_directories: strictDirectories,
|
|
1439
|
+
},
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
function buildSettingsValuesHealthCheck(settingWarnings) {
|
|
1443
|
+
return {
|
|
1444
|
+
name: "settings_values",
|
|
1445
|
+
status: settingWarnings.length === 0 ? "ok" : "warn",
|
|
1446
|
+
details: { warnings: settingWarnings },
|
|
1447
|
+
};
|
|
1448
|
+
}
|
|
1449
|
+
function buildStorageHealthCheck(items, settings, historySummary) {
|
|
1450
|
+
return {
|
|
1451
|
+
name: "storage",
|
|
1452
|
+
status: historySummary.over_threshold.length === 0 ? "ok" : "warn",
|
|
1453
|
+
details: {
|
|
1454
|
+
items: items.length,
|
|
1455
|
+
history_streams: historySummary.count,
|
|
1456
|
+
...(historySummary.max_entries !== null
|
|
1457
|
+
? {
|
|
1458
|
+
compact_policy: {
|
|
1459
|
+
enabled: settings.history.compact_policy.enabled,
|
|
1460
|
+
max_entries: historySummary.max_entries,
|
|
1461
|
+
trigger: settings.history.compact_policy.trigger,
|
|
1462
|
+
over_threshold_count: historySummary.over_threshold.length,
|
|
1463
|
+
over_threshold: historySummary.over_threshold,
|
|
1464
|
+
},
|
|
1465
|
+
}
|
|
1466
|
+
: {}),
|
|
1467
|
+
},
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
function collectHealthWarnings(params) {
|
|
1471
|
+
const warnings = [
|
|
1472
|
+
...params.directoryState.missingDirs.map((dir) => `missing_directory:${dir}`),
|
|
1473
|
+
...params.normalizedSettingsReadWarnings,
|
|
1474
|
+
...params.settingWarnings,
|
|
1475
|
+
...params.normalizedItemReadWarnings,
|
|
1476
|
+
...params.telemetryCheck.warnings,
|
|
1477
|
+
...params.extensionCheck.warnings,
|
|
1478
|
+
...params.historyPolicyWarnings,
|
|
1479
|
+
...params.historySummary.warnings,
|
|
1480
|
+
...params.locksCheck.warnings,
|
|
1481
|
+
...params.integrityCheck.warnings,
|
|
1482
|
+
...params.historyDriftCheck.warnings,
|
|
1483
|
+
...params.vectorizationCheck.warnings,
|
|
1484
|
+
...params.directoryState.hookWarnings,
|
|
1485
|
+
];
|
|
1486
|
+
return [...new Set(warnings)];
|
|
1487
|
+
}
|
|
1488
|
+
function extractHistoryDriftedCount(historyDriftCheck) {
|
|
1489
|
+
const counts = historyDriftCheck.check.details.counts;
|
|
1490
|
+
return typeof counts?.drifted === "number" ? counts.drifted : 0;
|
|
1491
|
+
}
|
|
1492
|
+
function buildHealthRemediationSources(params) {
|
|
1493
|
+
return {
|
|
1494
|
+
settings: params.normalizedSettingsReadWarnings,
|
|
1495
|
+
directories: params.directoryState.missingDirs.map((dir) => `missing_directory:${dir}`),
|
|
1496
|
+
settings_values: params.settingWarnings,
|
|
1497
|
+
telemetry: params.telemetryCheck.warnings,
|
|
1498
|
+
extensions: params.extensionCheck.warnings,
|
|
1499
|
+
storage: params.historySummary.over_threshold.map((id) => `history_stream_over_compact_threshold:${id}`),
|
|
1500
|
+
locks: params.locksCheck.warnings,
|
|
1501
|
+
integrity: params.integrityCheck.warnings,
|
|
1502
|
+
history_drift: params.historyDriftCheck.warnings,
|
|
1503
|
+
vectorization: params.vectorizationCheck.warnings,
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
function rewriteBulkHealthRemediation(params) {
|
|
1507
|
+
if (params.check.name === "history_drift" && params.historyDriftedCount > 1) {
|
|
1508
|
+
for (const code of Object.keys(params.remediationMap)) {
|
|
1509
|
+
params.remediationMap[code] = "pm history-repair --all";
|
|
1335
1510
|
}
|
|
1336
1511
|
}
|
|
1337
|
-
|
|
1512
|
+
if (params.check.name === "storage" && params.overThresholdCount > 1) {
|
|
1513
|
+
for (const code of Object.keys(params.remediationMap)) {
|
|
1514
|
+
params.remediationMap[code] = "pm history-compact --all-streams";
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
function attachHealthRemediationMaps(params) {
|
|
1519
|
+
for (const check of params.checks) {
|
|
1520
|
+
const remediationMap = buildRemediationMap(params.remediationSources[check.name]);
|
|
1521
|
+
rewriteBulkHealthRemediation({
|
|
1522
|
+
check,
|
|
1523
|
+
remediationMap,
|
|
1524
|
+
historyDriftedCount: params.historyDriftedCount,
|
|
1525
|
+
overThresholdCount: params.overThresholdCount,
|
|
1526
|
+
});
|
|
1527
|
+
if (Object.keys(remediationMap).length > 0) {
|
|
1528
|
+
check.details = { ...check.details, remediation_map: remediationMap };
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
function projectHealthResult(result, options, summaryMode) {
|
|
1533
|
+
if (summaryMode) {
|
|
1534
|
+
return applySummaryHealthProjection(result);
|
|
1535
|
+
}
|
|
1536
|
+
return options.brief === true ? applyBriefHealthProjection(result) : result;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Implements run health for the public runtime surface of this module.
|
|
1540
|
+
*/
|
|
1541
|
+
export async function runHealth(global, options = {}) {
|
|
1542
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1543
|
+
const settingsPath = getSettingsPath(pmRoot);
|
|
1544
|
+
if (!(await pathExists(settingsPath))) {
|
|
1545
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
1546
|
+
}
|
|
1547
|
+
const { settings, warnings: settingsReadWarnings } = await readSettingsWithMetadata(pmRoot);
|
|
1548
|
+
const normalizedSettingsReadWarnings = [...new Set(settingsReadWarnings)];
|
|
1549
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
1550
|
+
const strictDirectories = options.strictDirectories === true;
|
|
1551
|
+
const refreshPolicy = resolveVectorRefreshPolicy(options);
|
|
1552
|
+
const directoryState = await scanHealthDirectories(pmRoot, typeRegistry, strictDirectories);
|
|
1338
1553
|
const settingWarnings = validateSettingsValues(settings);
|
|
1339
1554
|
const telemetryCheck = await buildTelemetryCheck(settings, {
|
|
1340
1555
|
checkTelemetry: options.checkTelemetry === true,
|
|
1341
1556
|
});
|
|
1342
1557
|
const extensionCheck = await buildExtensionCheck(pmRoot, settings, Boolean(global.noExtensions));
|
|
1343
|
-
const
|
|
1344
|
-
const fastProjectionCheckOnly = options.checkOnly === true && (options.brief === true || options.summary === true) && options.full !== true;
|
|
1345
|
-
const skipIntegrity = (options.skipIntegrity === true || fastProjectionCheckOnly) && options.full !== true;
|
|
1346
|
-
const skipDrift = (options.skipDrift === true || fastProjectionCheckOnly) && options.full !== true;
|
|
1347
|
-
const skipVectors = (options.skipVectors === true || fastProjectionCheckOnly) && options.full !== true;
|
|
1558
|
+
const skipPolicy = resolveHealthSkipPolicy(options);
|
|
1348
1559
|
const itemReadWarnings = [];
|
|
1349
|
-
const items =
|
|
1350
|
-
? await listAllFrontMatter(pmRoot, settings.item_format, typeRegistry.type_to_folder, itemReadWarnings, settings.schema)
|
|
1351
|
-
: await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, itemReadWarnings, settings.schema);
|
|
1560
|
+
const items = await readHealthItems({ pmRoot, settings, typeRegistry, skipPolicy, itemReadWarnings });
|
|
1352
1561
|
const itemsWithBody = items;
|
|
1353
1562
|
const normalizedItemReadWarnings = [...new Set(itemReadWarnings)];
|
|
1354
|
-
const historyPolicy = skipDrift
|
|
1563
|
+
const historyPolicy = skipPolicy.skipDrift
|
|
1355
1564
|
? { warnings: [] }
|
|
1356
1565
|
: await enforceHistoryStreamPolicyForItems({
|
|
1357
1566
|
pmRoot,
|
|
@@ -1361,137 +1570,58 @@ export async function runHealth(global, options = {}) {
|
|
|
1361
1570
|
});
|
|
1362
1571
|
const historySummary = await countHistoryStreams(pmRoot, settings.history.compact_policy);
|
|
1363
1572
|
const locksCheck = await buildLocksCheck(pmRoot);
|
|
1364
|
-
const integrityCheck = skipIntegrity
|
|
1365
|
-
?
|
|
1573
|
+
const integrityCheck = skipPolicy.skipIntegrity
|
|
1574
|
+
? buildSkippedHealthCheck("integrity")
|
|
1366
1575
|
: await buildIntegrityCheck(pmRoot, typeRegistry.type_to_folder, settings.schema);
|
|
1367
|
-
const historyDriftCheck = skipDrift
|
|
1368
|
-
?
|
|
1576
|
+
const historyDriftCheck = skipPolicy.skipDrift
|
|
1577
|
+
? buildSkippedHealthCheck("history_drift")
|
|
1369
1578
|
: await buildHistoryDriftCheck(pmRoot, itemsWithBody);
|
|
1370
|
-
const vectorizationCheck = skipVectors
|
|
1371
|
-
?
|
|
1579
|
+
const vectorizationCheck = skipPolicy.skipVectors
|
|
1580
|
+
? buildSkippedHealthCheck("vectorization")
|
|
1372
1581
|
: await buildVectorizationCheck(pmRoot, settings, itemsWithBody, refreshPolicy, options.verboseStaleItems === true);
|
|
1373
1582
|
const checks = [
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
status: normalizedSettingsReadWarnings.length === 0 ? "ok" : "warn",
|
|
1378
|
-
details: {
|
|
1379
|
-
path: settingsPath,
|
|
1380
|
-
version: settings.version,
|
|
1381
|
-
id_prefix: settings.id_prefix,
|
|
1382
|
-
locks_ttl_seconds: settings.locks.ttl_seconds,
|
|
1383
|
-
warnings: normalizedSettingsReadWarnings,
|
|
1384
|
-
},
|
|
1385
|
-
},
|
|
1386
|
-
{
|
|
1387
|
-
name: "directories",
|
|
1388
|
-
status: missingDirs.length === 0 ? "ok" : "warn",
|
|
1389
|
-
details: {
|
|
1390
|
-
required: requiredDirs,
|
|
1391
|
-
optional: optionalDirs,
|
|
1392
|
-
missing_required: missingRequiredDirs,
|
|
1393
|
-
missing_optional: missingOptionalDirs,
|
|
1394
|
-
missing: missingDirs,
|
|
1395
|
-
strict_directories: strictDirectories,
|
|
1396
|
-
},
|
|
1397
|
-
},
|
|
1398
|
-
{
|
|
1399
|
-
name: "settings_values",
|
|
1400
|
-
status: settingWarnings.length === 0 ? "ok" : "warn",
|
|
1401
|
-
details: {
|
|
1402
|
-
warnings: settingWarnings,
|
|
1403
|
-
},
|
|
1404
|
-
},
|
|
1583
|
+
buildSettingsHealthCheck(settingsPath, settings, normalizedSettingsReadWarnings),
|
|
1584
|
+
buildDirectoriesHealthCheck(directoryState, strictDirectories),
|
|
1585
|
+
buildSettingsValuesHealthCheck(settingWarnings),
|
|
1405
1586
|
telemetryCheck.check,
|
|
1406
1587
|
extensionCheck.check,
|
|
1407
|
-
|
|
1408
|
-
name: "storage",
|
|
1409
|
-
status: historySummary.over_threshold.length === 0 ? "ok" : "warn",
|
|
1410
|
-
details: {
|
|
1411
|
-
items: items.length,
|
|
1412
|
-
history_streams: historySummary.count,
|
|
1413
|
-
...(historySummary.max_entries !== null
|
|
1414
|
-
? {
|
|
1415
|
-
compact_policy: {
|
|
1416
|
-
enabled: settings.history.compact_policy.enabled,
|
|
1417
|
-
max_entries: historySummary.max_entries,
|
|
1418
|
-
trigger: settings.history.compact_policy.trigger,
|
|
1419
|
-
over_threshold_count: historySummary.over_threshold.length,
|
|
1420
|
-
over_threshold: historySummary.over_threshold,
|
|
1421
|
-
},
|
|
1422
|
-
}
|
|
1423
|
-
: {}),
|
|
1424
|
-
},
|
|
1425
|
-
},
|
|
1588
|
+
buildStorageHealthCheck(items, settings, historySummary),
|
|
1426
1589
|
locksCheck.check,
|
|
1427
1590
|
integrityCheck.check,
|
|
1428
1591
|
historyDriftCheck.check,
|
|
1429
1592
|
vectorizationCheck.check,
|
|
1430
1593
|
];
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
settings_values: settingWarnings,
|
|
1463
|
-
telemetry: telemetryCheck.warnings,
|
|
1464
|
-
extensions: extensionCheck.warnings,
|
|
1465
|
-
storage: historySummary.over_threshold.map((id) => `history_stream_over_compact_threshold:${id}`),
|
|
1466
|
-
locks: locksCheck.warnings,
|
|
1467
|
-
integrity: integrityCheck.warnings,
|
|
1468
|
-
history_drift: historyDriftCheck.warnings,
|
|
1469
|
-
vectorization: vectorizationCheck.warnings,
|
|
1470
|
-
};
|
|
1471
|
-
const historyDriftedCount = typeof historyDriftCheck.check.details.counts?.drifted === "number"
|
|
1472
|
-
? (historyDriftCheck.check.details.counts.drifted)
|
|
1473
|
-
: 0;
|
|
1474
|
-
for (const check of checks) {
|
|
1475
|
-
const remediationMap = buildRemediationMap(checkRemediationSources[check.name]);
|
|
1476
|
-
// With multiple drifted streams the per-item `pm history-repair <id>`
|
|
1477
|
-
// template would have to be run once per stream; suggest the bulk audited
|
|
1478
|
-
// pass instead so agents repair everything in one command.
|
|
1479
|
-
if (check.name === "history_drift" && historyDriftedCount > 1) {
|
|
1480
|
-
for (const code of Object.keys(remediationMap)) {
|
|
1481
|
-
remediationMap[code] = "pm history-repair --all";
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
// With multiple over-threshold streams, point at the one-pass bulk sweep
|
|
1485
|
-
// rather than a per-stream `pm history-compact <id>` template.
|
|
1486
|
-
if (check.name === "storage" && historySummary.over_threshold.length > 1) {
|
|
1487
|
-
for (const code of Object.keys(remediationMap)) {
|
|
1488
|
-
remediationMap[code] = "pm history-compact --all-streams";
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
if (Object.keys(remediationMap).length > 0) {
|
|
1492
|
-
check.details = { ...check.details, remediation_map: remediationMap };
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1594
|
+
const normalizedWarnings = collectHealthWarnings({
|
|
1595
|
+
directoryState,
|
|
1596
|
+
normalizedSettingsReadWarnings,
|
|
1597
|
+
settingWarnings,
|
|
1598
|
+
normalizedItemReadWarnings,
|
|
1599
|
+
telemetryCheck,
|
|
1600
|
+
extensionCheck,
|
|
1601
|
+
historyPolicyWarnings: historyPolicy.warnings,
|
|
1602
|
+
historySummary,
|
|
1603
|
+
locksCheck,
|
|
1604
|
+
integrityCheck,
|
|
1605
|
+
historyDriftCheck,
|
|
1606
|
+
vectorizationCheck,
|
|
1607
|
+
});
|
|
1608
|
+
attachHealthRemediationMaps({
|
|
1609
|
+
checks,
|
|
1610
|
+
remediationSources: buildHealthRemediationSources({
|
|
1611
|
+
directoryState,
|
|
1612
|
+
normalizedSettingsReadWarnings,
|
|
1613
|
+
settingWarnings,
|
|
1614
|
+
telemetryCheck,
|
|
1615
|
+
extensionCheck,
|
|
1616
|
+
historySummary,
|
|
1617
|
+
locksCheck,
|
|
1618
|
+
integrityCheck,
|
|
1619
|
+
historyDriftCheck,
|
|
1620
|
+
vectorizationCheck,
|
|
1621
|
+
}),
|
|
1622
|
+
historyDriftedCount: extractHistoryDriftedCount(historyDriftCheck),
|
|
1623
|
+
overThresholdCount: historySummary.over_threshold.length,
|
|
1624
|
+
});
|
|
1495
1625
|
// Telemetry is an opt-out, non-critical observability feature. Its operational
|
|
1496
1626
|
// state (queue backlog, unreachable endpoint, corrupt local state) is advisory:
|
|
1497
1627
|
// it must never flip overall project health to not-ok. Such warnings are still
|
|
@@ -1503,14 +1633,12 @@ export async function runHealth(global, options = {}) {
|
|
|
1503
1633
|
warnings: normalizedWarnings,
|
|
1504
1634
|
generated_at: nowIso(),
|
|
1505
1635
|
};
|
|
1506
|
-
|
|
1507
|
-
return applySummaryHealthProjection(result);
|
|
1508
|
-
}
|
|
1509
|
-
return options.brief === true ? applyBriefHealthProjection(result) : result;
|
|
1636
|
+
return projectHealthResult(result, options, skipPolicy.summaryMode);
|
|
1510
1637
|
}
|
|
1511
1638
|
export const _testOnlyHealthCommand = {
|
|
1512
1639
|
buildExtensionHealthTriageSummary,
|
|
1513
1640
|
buildCapabilityContractMetadata,
|
|
1641
|
+
buildVectorizationProviderDetails,
|
|
1514
1642
|
collectUnknownCapabilityGuidance,
|
|
1515
1643
|
isAdvisoryHealthWarning,
|
|
1516
1644
|
isDirectory,
|
|
@@ -1529,4 +1657,4 @@ export const _testOnlyHealthCommand = {
|
|
|
1529
1657
|
warningCode,
|
|
1530
1658
|
};
|
|
1531
1659
|
//# sourceMappingURL=health.js.map
|
|
1532
|
-
//# debugId=
|
|
1660
|
+
//# debugId=d078e1a2-2f92-566c-8ecd-542b2730a9b6
|