@unbrained/pm-cli 2026.6.30 → 2026.7.2
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/AGENTS.md +2 -0
- package/CHANGELOG.md +26 -0
- package/dist/cli/bootstrap-args.js +89 -79
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.d.ts +2 -0
- package/dist/cli/commander-usage.js +58 -47
- package/dist/cli/commander-usage.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 +339 -303
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +89 -68
- 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 +483 -434
- 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/bundled-catalog.js +59 -46
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +129 -78
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/managed-state.js +101 -57
- package/dist/cli/commands/extension/managed-state.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.d.ts +7 -0
- package/dist/cli/commands/extension/scaffold.js +214 -186
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +6 -1
- package/dist/cli/commands/extension.js +1034 -902
- package/dist/cli/commands/extension.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 +446 -307
- 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.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-filter-shared.js +55 -48
- package/dist/cli/commands/list-filter-shared.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 +49 -32
- 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/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 +595 -536
- 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 +530 -464
- 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 +764 -747
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +18 -1
- package/dist/cli/commands/validate.js +466 -343
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +399 -357
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-options.js +48 -21
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/main.d.ts +47 -0
- package/dist/cli/main.js +428 -341
- 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 +94 -105
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +400 -416
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +86 -66
- 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.js +117 -122
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
- package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
- package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
- package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
- package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
- package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
- package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
- package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
- package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
- package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
- package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
- package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
- package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
- package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
- package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
- package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
- package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
- package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
- package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
- package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
- package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
- package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -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-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
- package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
- package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
- package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
- package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
- package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
- package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
- package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
- package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
- package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
- package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
- package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
- package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
- package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
- package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
- package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
- package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
- package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
- package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
- package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
- package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
- package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
- package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
- package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
- package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
- package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
- package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
- package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
- package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
- package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
- package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
- 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-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
- package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
- package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
- package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
- package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
- package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
- package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
- package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
- package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
- package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
- package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
- package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
- package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
- package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
- package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
- package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
- package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
- package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
- package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
- package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
- package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
- package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
- package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
- package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
- package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
- package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
- package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
- package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
- package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
- package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
- package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
- package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
- package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
- package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
- package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
- package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
- package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
- package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
- package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
- package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
- package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
- package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
- package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
- package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
- package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
- package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
- package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
- package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
- package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
- package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
- package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
- package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
- package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
- package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
- package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
- package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
- package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
- package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
- package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
- package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
- package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
- package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
- package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
- package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
- package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
- package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
- package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
- package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
- package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
- package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
- package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
- package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
- package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
- package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
- package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
- package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
- package/dist/cli-bundle/main.js +986 -1500
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/config/nested-settings.js +89 -67
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/extensions/activation-summary-markdown.js +23 -12
- package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
- package/dist/core/extensions/extension-policy.d.ts +18 -3
- package/dist/core/extensions/extension-policy.js +116 -106
- package/dist/core/extensions/extension-policy.js.map +1 -1
- package/dist/core/extensions/loader.js +310 -232
- package/dist/core/extensions/loader.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-format.js +523 -410
- package/dist/core/item/item-format.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 +87 -82
- 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 +34 -28
- package/dist/core/schema/runtime-schema.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/store/front-matter-cache.js +239 -153
- 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/mcp/server.js +387 -367
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +76 -45
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/compose.d.ts +4 -1
- package/dist/sdk/compose.js +181 -115
- package/dist/sdk/compose.js.map +1 -1
- package/docs/RELEASING.md +2 -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/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
- package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
- package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
- package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
- package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
- package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
- package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
- package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
- package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
- package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
- package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
- package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
- package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
- package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
- package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
- package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
- package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
- package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
- package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
- package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
- package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
- package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
- package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
- package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
- package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../core/schema/runtime-field-values.ts","../../../../../../../../core/item/item-format-version.ts","../../../../../../../../core/item/status.ts","../../../../../../../../core/shared/conflict-markers.ts","../../../../../../../../core/item/item-format.ts","../../../../../../../../core/item/toon-decode.ts"],"sourcesContent":["/**\n * @module core/schema/runtime-field-values\n *\n * Resolves configurable schema, fields, statuses, and workflows for Runtime Field Values.\n */\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { runtimeFieldOptionTarget, type RuntimeFieldDefinitionResolved, type RuntimeFieldRegistry } from \"./runtime-schema.js\";\n\nfunction toCamelToken(value: string): string {\n const segments = value\n .trim()\n .replaceAll(/[^A-Za-z0-9]+/g, \" \")\n .split(/\\s+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.toLowerCase());\n if (segments.length === 0) {\n return value;\n }\n const [first, ...rest] = segments;\n return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join(\"\")}`;\n}\n\nfunction resolveCandidateOptionKeys(definition: RuntimeFieldDefinitionResolved): string[] {\n return [...new Set([\n runtimeFieldOptionTarget(definition),\n toCamelToken(definition.key),\n toCamelToken(definition.cli_flag),\n ...definition.cli_aliases.map((alias) => toCamelToken(alias)),\n ])];\n}\n\n/**\n * Implements read runtime field option value for the public runtime surface of this module.\n */\nexport function readRuntimeFieldOptionValue(\n options: Record<string, unknown>,\n definition: RuntimeFieldDefinitionResolved,\n): unknown {\n for (const candidateKey of resolveCandidateOptionKeys(definition)) {\n if (!Object.hasOwn(options, candidateKey)) {\n continue;\n }\n const value = options[candidateKey];\n if (value !== undefined) {\n return value;\n }\n }\n return undefined;\n}\n\nfunction normalizeStringArrayValue(value: unknown): string[] {\n if (Array.isArray(value)) {\n return value\n .flatMap((entry) => normalizeStringArrayValue(entry))\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n }\n if (typeof value === \"string\") {\n return value\n .split(/[,\\n|]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n }\n if (value === undefined || value === null) {\n return [];\n }\n return [String(value).trim()].filter((entry) => entry.length > 0);\n}\n\nfunction parseBooleanValue(raw: unknown, label: string): boolean {\n if (typeof raw === \"boolean\") {\n return raw;\n }\n if (typeof raw === \"number\") {\n if (raw === 1) {\n return true;\n }\n if (raw === 0) {\n return false;\n }\n }\n if (typeof raw === \"string\") {\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n }\n throw new PmCliError(`${label} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\nfunction parseNumberValue(raw: unknown, label: string): number {\n if (typeof raw === \"number\" && Number.isFinite(raw)) {\n return raw;\n }\n const candidate = typeof raw === \"string\" ? raw.trim() : String(raw);\n const parsed = Number(candidate);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`${label} must be a number`, EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/**\n * Implements coerce runtime field value for the public runtime surface of this module.\n */\nexport function coerceRuntimeFieldValue(\n definition: RuntimeFieldDefinitionResolved,\n rawValue: unknown,\n labelOverride?: string,\n): unknown {\n const label = labelOverride ?? `--${definition.cli_flag}`;\n if (definition.repeatable || definition.type === \"string_array\") {\n const values = normalizeStringArrayValue(rawValue);\n if (definition.type === \"number\") {\n return values.map((value) => parseNumberValue(value, label));\n }\n if (definition.type === \"boolean\") {\n return values.map((value) => parseBooleanValue(value, label));\n }\n return values;\n }\n\n const scalarRaw = Array.isArray(rawValue) ? rawValue[rawValue.length - 1] : rawValue;\n if (scalarRaw === undefined) {\n return undefined;\n }\n if (definition.type === \"number\") {\n return parseNumberValue(scalarRaw, label);\n }\n if (definition.type === \"boolean\") {\n return parseBooleanValue(scalarRaw, label);\n }\n return typeof scalarRaw === \"string\" ? scalarRaw : String(scalarRaw);\n}\n\nfunction shouldRequireFieldOnCreate(definition: RuntimeFieldDefinitionResolved, itemTypeName: string | undefined): boolean {\n if (!definition.required && !definition.required_on_create) {\n return false;\n }\n if (definition.required_types.length === 0) {\n return true;\n }\n if (!itemTypeName) {\n return false;\n }\n return definition.required_types.map((value) => value.toLowerCase()).includes(itemTypeName.trim().toLowerCase());\n}\n\n/**\n * Implements collect runtime create field values for the public runtime surface of this module.\n */\nexport function collectRuntimeCreateFieldValues(\n options: Record<string, unknown>,\n fieldRegistry: RuntimeFieldRegistry,\n itemTypeName: string | undefined,\n): { values: Record<string, unknown>; missing_required_flags: string[] } {\n const values: Record<string, unknown> = {};\n const missingRequiredFlags: string[] = [];\n for (const definition of fieldRegistry.command_to_fields.get(\"create\") ?? []) {\n const rawValue = readRuntimeFieldOptionValue(options, definition);\n if (rawValue === undefined) {\n if (shouldRequireFieldOnCreate(definition, itemTypeName)) {\n missingRequiredFlags.push(`--${definition.cli_flag}`);\n }\n continue;\n }\n values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);\n }\n return {\n values,\n missing_required_flags: [...new Set(missingRequiredFlags)].sort((left, right) => left.localeCompare(right)),\n };\n}\n\n/**\n * Implements collect runtime update field values for the public runtime surface of this module.\n */\nexport function collectRuntimeUpdateFieldValues(\n options: Record<string, unknown>,\n fieldRegistry: RuntimeFieldRegistry,\n commands: Array<\"update\" | \"update_many\"> | null | undefined = [\"update\"],\n): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n const definitions = (commands ?? [\"update\"]).flatMap((command) => fieldRegistry.command_to_fields.get(command) ?? []);\n const seen = new Set<string>();\n for (const definition of definitions) {\n const rawValue = readRuntimeFieldOptionValue(options, definition);\n if (rawValue === undefined) {\n continue;\n }\n if (seen.has(definition.metadata_key)) {\n continue;\n }\n seen.add(definition.metadata_key);\n values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);\n }\n return values;\n}\n","/**\n * @module core/item/item-format-version\n *\n * Tracks the on-disk item front-matter format version so a future breaking\n * storage change can tell already-current items apart from items that a staged\n * migration must rewrite, without re-parsing and structurally guessing every\n * file. The version is an explicit, monotonically increasing integer stamped in\n * front-matter as `pm_format_version`.\n *\n * Token economy is a first-class constraint here: the baseline version (1) is\n * the implicit default and is never serialized, so today's corpus gains zero\n * bytes and zero churn. The field only materializes once an item reaches\n * version 2 or higher. Absence of the field is therefore always interpreted as\n * the baseline version, both now and after future bumps. The classification\n * helpers below power the advisory `pm health` integrity surface and the\n * `pm validate` format-version check.\n */\nimport type { ItemMetadata } from \"../../types/index.js\";\n\n/**\n * The original (and implicit) item front-matter format version. Items missing a\n * `pm_format_version` field are always treated as this version, so the baseline\n * is never written to disk and adds no per-item token cost.\n */\nexport const BASELINE_ITEM_FORMAT_VERSION = 1;\n\n/**\n * The format version this runtime writes and considers current. When a breaking\n * front-matter change ships, bump this constant and add a migration that\n * rewrites items whose {@link effectiveItemFormatVersion} is lower; items at or\n * above it need no migration. It stays equal to\n * {@link BASELINE_ITEM_FORMAT_VERSION} until the first such change.\n */\nexport const CURRENT_ITEM_FORMAT_VERSION = 1;\n\n/**\n * Resolve the format version an item is effectively stored at. A present,\n * positive-integer `pm_format_version` is taken verbatim (including versions\n * ahead of this runtime, so they can be flagged rather than silently clamped);\n * an absent, malformed, or sub-baseline value resolves to\n * {@link BASELINE_ITEM_FORMAT_VERSION}.\n */\nexport function effectiveItemFormatVersion(metadata: Pick<ItemMetadata, \"pm_format_version\">): number {\n const raw = metadata.pm_format_version;\n if (typeof raw === \"number\" && Number.isInteger(raw) && raw >= BASELINE_ITEM_FORMAT_VERSION) {\n return raw;\n }\n return BASELINE_ITEM_FORMAT_VERSION;\n}\n\n/**\n * Reduce an item's `pm_format_version` to its persisted form: the baseline\n * version (and any malformed or sub-baseline value) is dropped so it is never\n * serialized, while versions at or above {@link BASELINE_ITEM_FORMAT_VERSION}\n * plus one are preserved verbatim. This keeps the field absent for the entire\n * current corpus and only writes it once an item genuinely advances past the\n * implicit baseline.\n */\nexport function normalizeItemFormatVersion(value: unknown): number | undefined {\n if (typeof value !== \"number\" || !Number.isInteger(value) || value <= BASELINE_ITEM_FORMAT_VERSION) {\n return undefined;\n }\n return value;\n}\n\n/**\n * Relationship between an item's stored format version and the runtime's\n * current version: `outdated` (below current, a migration would rewrite it),\n * `ahead` (above current, written by a newer pm than this one), or `current`.\n */\nexport type ItemFormatVersionStatus = \"current\" | \"outdated\" | \"ahead\";\n\n/**\n * Classify a single stored format version against the runtime's current\n * version. Defaults to {@link CURRENT_ITEM_FORMAT_VERSION}; the `current`\n * parameter exists so callers (and tests) can evaluate against a hypothetical\n * future version without mutating the module constant.\n */\nexport function classifyItemFormatVersion(\n version: number,\n current: number = CURRENT_ITEM_FORMAT_VERSION,\n): ItemFormatVersionStatus {\n if (version < current) {\n return \"outdated\";\n }\n if (version > current) {\n return \"ahead\";\n }\n return \"current\";\n}\n\n/**\n * One item's reference (id or relative path) paired with the format version it\n * is stored at, used as input to {@link scanItemFormatVersions}.\n */\nexport interface ItemFormatVersionScanEntry {\n ref: string;\n version: number;\n}\n\n/**\n * Sorted references partitioned by how their stored format version compares to\n * the runtime's current version. References at the current version are omitted\n * from both lists.\n */\nexport interface ItemFormatVersionScanResult {\n outdated: string[];\n ahead: string[];\n}\n\n/**\n * Partition a set of items by format version into `outdated` (need migration)\n * and `ahead` (written by a newer pm) reference lists, each sorted for stable\n * diagnostics. Pushing all comparison branches into this pure, exhaustively\n * tested helper lets `pm health` and `pm validate` emit findings by iterating\n * the result lists, with no version-comparison branching of their own.\n */\nexport function scanItemFormatVersions(\n entries: readonly ItemFormatVersionScanEntry[],\n current: number = CURRENT_ITEM_FORMAT_VERSION,\n): ItemFormatVersionScanResult {\n const outdated: string[] = [];\n const ahead: string[] = [];\n for (const entry of entries) {\n const status = classifyItemFormatVersion(entry.version, current);\n if (status === \"outdated\") {\n outdated.push(entry.ref);\n } else if (status === \"ahead\") {\n ahead.push(entry.ref);\n }\n }\n return {\n outdated: outdated.sort((left, right) => left.localeCompare(right)),\n ahead: ahead.sort((left, right) => left.localeCompare(right)),\n };\n}\n","/**\n * @module core/item/status\n *\n * Defines item parsing, formatting, and lifecycle helpers for Status.\n */\nimport { STATUS_VALUES } from \"../../types/index.js\";\nimport type { ItemStatus } from \"../../types/index.js\";\nimport { normalizeStatusInputWithRegistry, type RuntimeStatusRegistry } from \"../schema/runtime-schema.js\";\n\nconst STATUS_ALIAS_MAP: Readonly<Record<string, ItemStatus>> = {\n \"in-progress\": \"in_progress\",\n cancelled: \"canceled\",\n};\n\n/**\n * Implements normalize status input for the public runtime surface of this module.\n */\nexport function normalizeStatusInput(value: unknown, registry?: RuntimeStatusRegistry): ItemStatus | undefined {\n if (registry) {\n const normalizedFromRegistry = normalizeStatusInputWithRegistry(value, registry);\n if (normalizedFromRegistry) {\n return normalizedFromRegistry;\n }\n }\n if (typeof value !== \"string\") {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if (!normalized) {\n return undefined;\n }\n const canonical = STATUS_ALIAS_MAP[normalized] ?? normalized;\n if (!(STATUS_VALUES as readonly string[]).includes(canonical)) {\n return undefined;\n }\n return canonical as ItemStatus;\n}\n\n/**\n * Normalize a status against the runtime registry, falling back to the original\n * value when normalization does not resolve to a known status. This preserves\n * the long-standing `normalizeStatusInput(status, registry) ?? status` pattern\n * used by query commands so that unknown/custom statuses still compare against\n * registry sets by their raw value.\n */\nexport function normalizeStatusForRegistry(status: ItemStatus, registry: RuntimeStatusRegistry): ItemStatus {\n return normalizeStatusInput(status, registry) ?? status;\n}\n\n/**\n * Determine whether a status is terminal according to the runtime status\n * registry, applying registry-aware normalization first (with raw fallback).\n */\nexport function isTerminalStatus(status: ItemStatus, registry: RuntimeStatusRegistry): boolean {\n return registry.terminal_statuses.has(normalizeStatusForRegistry(status, registry));\n}\n","/**\n * @module core/shared/conflict-markers\n *\n * Provides shared primitives and utilities for Conflict Markers.\n */\n/**\n * Describes a detected unresolved merge-conflict marker and its source location.\n */\nexport interface ConflictMarkerMatch {\n line: number;\n marker: \"<<<<<<<\" | \"=======\" | \">>>>>>>\";\n text: string;\n}\n\nconst CONFLICT_MARKER_PATTERN = /^\\s*(<<<<<<<|=======|>>>>>>>)(?:\\s.*)?$/;\n\n/**\n * Implements find merge conflict markers for the public runtime surface of this module.\n */\nexport function findMergeConflictMarkers(content: string): ConflictMarkerMatch[] {\n if (content.length === 0) {\n return [];\n }\n const lines = content.split(/\\r?\\n/);\n const matches: ConflictMarkerMatch[] = [];\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index] ?? \"\";\n const markerMatch = line.match(CONFLICT_MARKER_PATTERN);\n if (!markerMatch) {\n continue;\n }\n const marker = markerMatch[1] as ConflictMarkerMatch[\"marker\"];\n matches.push({\n line: index + 1,\n marker,\n text: line,\n });\n }\n return matches;\n}\n\n/**\n * Implements find first merge conflict marker for the public runtime surface of this module.\n */\nexport function findFirstMergeConflictMarker(content: string): ConflictMarkerMatch | undefined {\n const matches = findMergeConflictMarkers(content);\n return matches[0];\n}\n","/**\n * @module core/item/item-format\n *\n * Defines item parsing, formatting, and lifecycle helpers for Item Format.\n */\nimport { encode as encodeToon } from \"@toon-format/toon\";\nimport type {\n CalendarEvent,\n Comment,\n Dependency,\n ItemDocument,\n ItemMetadata,\n RuntimeSchemaSettings,\n ItemTestRunSummary,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PlanDecision,\n PlanDiscovery,\n PlanStep,\n PlanStepDoc,\n PlanStepFile,\n PlanStepLink,\n PlanStepStatus,\n PlanValidationCheck,\n RecurrenceRule,\n Reminder,\n} from \"../../types/index.js\";\nimport type { ItemFormat } from \"../../types/index.js\";\nimport {\n CONFIDENCE_TEXT_VALUES,\n ISSUE_SEVERITY_VALUES,\n RECURRENCE_FREQUENCY_VALUES,\n RECURRENCE_WEEKDAY_VALUES,\n STATUS_VALUES,\n weekdayOrderIndex,\n} from \"../../types/index.js\";\nimport { coerceRuntimeFieldValue } from \"../schema/runtime-field-values.js\";\nimport {\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../schema/runtime-schema.js\";\nimport { BASELINE_ITEM_FORMAT_VERSION, normalizeItemFormatVersion } from \"./item-format-version.js\";\nimport { normalizeStatusInput } from \"./status.js\";\nimport { decodeToonItemContent } from \"./toon-decode.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { findFirstMergeConflictMarker } from \"../shared/conflict-markers.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { orderObject } from \"../shared/serialization.js\";\nimport { compareTimestampStrings, isTimestampLiteral } from \"../shared/time.js\";\n\nconst LINKED_TEST_PM_CONTEXT_MODE_VALUES = new Set([\"schema\", \"tracker\", \"auto\"]);\n\nfunction normalizePathValue(value: string): string {\n return value.replaceAll(\"\\\\\", \"/\");\n}\n\nfunction firstNonZeroComparison(comparisons: readonly number[]): number {\n for (const comparison of comparisons) {\n if (comparison !== 0) {\n return comparison;\n }\n }\n return 0;\n}\n\nconst REQUIRED_STRING_FIELDS = [\n \"id\",\n \"title\",\n \"description\",\n \"created_at\",\n \"updated_at\",\n] as const;\n\nconst STATIC_FRONT_MATTER_FIELD_SET = new Set(FRONT_MATTER_KEY_ORDER);\n\ninterface RuntimeSchemaValidationContext {\n statusRegistry?: RuntimeStatusRegistry;\n fieldRegistry?: RuntimeFieldRegistry;\n unknownFieldPolicy: \"allow\" | \"warn\" | \"reject\";\n extensionFieldNames: ReadonlySet<string>;\n onWarning?: (warning: string) => void;\n}\n\n/**\n * Documents the item document format options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ItemDocumentFormatOptions {\n format?: ItemFormat;\n schema?: RuntimeSchemaSettings;\n extensionFieldNames?: readonly string[];\n onWarning?: (warning: string) => void;\n}\n\nfunction resolveRuntimeSchemaValidationContext(\n options: ItemDocumentFormatOptions | undefined,\n): RuntimeSchemaValidationContext | undefined {\n if (!options?.schema) {\n return undefined;\n }\n return {\n statusRegistry: resolveRuntimeStatusRegistry(options.schema),\n fieldRegistry: resolveRuntimeFieldRegistry(options.schema),\n unknownFieldPolicy: options.schema.unknown_field_policy ?? \"allow\",\n extensionFieldNames: new Set(options.extensionFieldNames ?? []),\n onWarning: options.onWarning,\n };\n}\n\nfunction runtimeFieldRequiredForType(definition: RuntimeFieldRegistry[\"definitions\"][number], typeName: string): boolean {\n if (!definition.required) {\n return false;\n }\n if (definition.required_types.length === 0) {\n return true;\n }\n return definition.required_types.map((value) => value.toLowerCase()).includes(typeName.trim().toLowerCase());\n}\n\nfunction validationError(message: string): never {\n throw new PmCliError(`Invalid item front matter: ${message}`, EXIT_CODE.GENERIC_FAILURE);\n}\n\nfunction buildKnownFrontMatterKeys(runtimeContext: RuntimeSchemaValidationContext): Set<string> {\n const knownKeys = new Set(STATIC_FRONT_MATTER_FIELD_SET);\n for (const definition of runtimeContext.fieldRegistry?.definitions ?? []) {\n knownKeys.add(definition.metadata_key);\n }\n for (const fieldName of runtimeContext.extensionFieldNames) {\n knownKeys.add(fieldName);\n }\n return knownKeys;\n}\n\nfunction assertFrontMatterCondition(condition: boolean, message: string): void {\n if (!condition) {\n validationError(message);\n }\n}\n\nfunction assertTimestampField(record: Record<string, unknown>, fieldName: \"created_at\" | \"updated_at\" | \"deadline\"): void {\n const rawValue = record[fieldName];\n assertFrontMatterCondition(typeof rawValue === \"string\", `${fieldName} must be a string`);\n const timestamp = rawValue as string;\n assertFrontMatterCondition(isTimestampLiteral(timestamp), `${fieldName} must be a valid ISO timestamp`);\n}\n\nfunction assertValidRecurrenceRule(recurrence: unknown): void {\n assertFrontMatterCondition(\n typeof recurrence === \"object\" && recurrence !== null && !Array.isArray(recurrence),\n \"event.recurrence must be an object\",\n );\n const recurrenceRecord = recurrence as Record<string, unknown>;\n assertFrontMatterCondition(typeof recurrenceRecord.freq === \"string\", \"event.recurrence.freq must be a string\");\n const frequency = (recurrenceRecord.freq as string).trim().toLowerCase();\n assertFrontMatterCondition(\n RECURRENCE_FREQUENCY_VALUES.includes(frequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number]),\n `event.recurrence.freq must be one of: ${RECURRENCE_FREQUENCY_VALUES.join(\", \")}`,\n );\n\n if (recurrenceRecord.interval !== undefined) {\n assertFrontMatterCondition(\n typeof recurrenceRecord.interval === \"number\" &&\n Number.isInteger(recurrenceRecord.interval) &&\n (recurrenceRecord.interval as number) >= 1,\n \"event.recurrence.interval must be an integer >= 1\",\n );\n }\n\n if (recurrenceRecord.count !== undefined) {\n assertFrontMatterCondition(\n typeof recurrenceRecord.count === \"number\" && Number.isInteger(recurrenceRecord.count) && (recurrenceRecord.count as number) >= 1,\n \"event.recurrence.count must be an integer >= 1\",\n );\n }\n\n if (recurrenceRecord.until !== undefined) {\n assertFrontMatterCondition(typeof recurrenceRecord.until === \"string\", \"event.recurrence.until must be a string\");\n assertFrontMatterCondition(\n isTimestampLiteral(recurrenceRecord.until as string),\n \"event.recurrence.until must be a valid ISO timestamp\",\n );\n }\n\n if (recurrenceRecord.by_weekday !== undefined) {\n assertFrontMatterCondition(Array.isArray(recurrenceRecord.by_weekday), \"event.recurrence.by_weekday must be an array\");\n for (const weekday of recurrenceRecord.by_weekday as unknown[]) {\n assertFrontMatterCondition(typeof weekday === \"string\", \"event.recurrence.by_weekday entries must be strings\");\n const normalizedWeekday = (weekday as string).trim().toLowerCase();\n assertFrontMatterCondition(\n RECURRENCE_WEEKDAY_VALUES.includes(normalizedWeekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number]),\n `event.recurrence.by_weekday entries must be one of: ${RECURRENCE_WEEKDAY_VALUES.join(\", \")}`,\n );\n }\n }\n\n if (recurrenceRecord.by_month_day !== undefined) {\n assertFrontMatterCondition(Array.isArray(recurrenceRecord.by_month_day), \"event.recurrence.by_month_day must be an array\");\n for (const day of recurrenceRecord.by_month_day as unknown[]) {\n assertFrontMatterCondition(\n typeof day === \"number\" && Number.isInteger(day) && day >= 1 && day <= 31,\n \"event.recurrence.by_month_day entries must be integers 1..31\",\n );\n }\n }\n\n if (recurrenceRecord.exdates !== undefined) {\n assertFrontMatterCondition(Array.isArray(recurrenceRecord.exdates), \"event.recurrence.exdates must be an array\");\n for (const exdate of recurrenceRecord.exdates as unknown[]) {\n assertFrontMatterCondition(typeof exdate === \"string\", \"event.recurrence.exdates entries must be strings\");\n assertFrontMatterCondition(isTimestampLiteral(exdate as string), \"event.recurrence.exdates entries must be valid ISO timestamps\");\n }\n }\n}\n\nfunction assertValidFrontMatter(\n frontMatter: unknown,\n runtimeContext?: RuntimeSchemaValidationContext,\n): asserts frontMatter is ItemMetadata {\n assertFrontMatterCondition(\n typeof frontMatter === \"object\" && frontMatter !== null && !Array.isArray(frontMatter),\n \"front matter must be an object\",\n );\n\n const record = frontMatter as Record<string, unknown>;\n for (const fieldName of REQUIRED_STRING_FIELDS) {\n assertFrontMatterCondition(typeof record[fieldName] === \"string\", `${fieldName} is required and must be a string`);\n }\n\n const itemType = record.type;\n assertFrontMatterCondition(typeof itemType === \"string\" && itemType.trim().length > 0, \"type must be a non-empty string\");\n\n const formatVersion = record.pm_format_version;\n if (formatVersion !== undefined) {\n assertFrontMatterCondition(\n typeof formatVersion === \"number\" && Number.isInteger(formatVersion) && formatVersion >= BASELINE_ITEM_FORMAT_VERSION,\n `pm_format_version must be an integer >= ${BASELINE_ITEM_FORMAT_VERSION}`,\n );\n }\n\n const status = record.status;\n assertFrontMatterCondition(\n typeof status === \"string\" && status.trim().length > 0,\n \"status must be a non-empty string\",\n );\n const statusRegistry = runtimeContext?.statusRegistry;\n const normalizedStatus = normalizeStatusInput(status as string, statusRegistry);\n const statusDomain = statusRegistry\n ? statusRegistry.definitions.map((definition) => definition.id)\n : [...STATUS_VALUES];\n assertFrontMatterCondition(normalizedStatus !== undefined, `status must be one of: ${statusDomain.join(\", \")}`);\n\n const priority = record.priority;\n assertFrontMatterCondition(\n typeof priority === \"number\" && Number.isInteger(priority) && [0, 1, 2, 3, 4].includes(priority),\n \"priority must be an integer 0..4\",\n );\n\n const tags = record.tags;\n assertFrontMatterCondition(Array.isArray(tags), \"tags must be an array\");\n for (const tag of tags as unknown[]) {\n assertFrontMatterCondition(typeof tag === \"string\", \"tags entries must be strings\");\n }\n\n const confidence = record.confidence;\n if (confidence !== undefined) {\n if (typeof confidence === \"number\") {\n assertFrontMatterCondition(\n Number.isInteger(confidence) && confidence >= 0 && confidence <= 100,\n \"confidence number value must be an integer 0..100\",\n );\n } else if (typeof confidence === \"string\") {\n const normalizedConfidence = confidence.trim().toLowerCase();\n const isKnownTextConfidence =\n normalizedConfidence === \"med\" || CONFIDENCE_TEXT_VALUES.includes(normalizedConfidence as (typeof CONFIDENCE_TEXT_VALUES)[number]);\n assertFrontMatterCondition(\n isKnownTextConfidence,\n `confidence string value must be one of: ${[...CONFIDENCE_TEXT_VALUES, \"med\"].join(\", \")}`,\n );\n } else {\n assertFrontMatterCondition(false, \"confidence must be a number or string\");\n }\n }\n\n const severity = record.severity;\n if (severity !== undefined) {\n if (typeof severity !== \"string\") {\n validationError(\"severity must be a string\");\n }\n const normalizedSeverity = severity.trim().toLowerCase();\n const isKnownSeverity =\n normalizedSeverity === \"med\" || ISSUE_SEVERITY_VALUES.includes(normalizedSeverity as (typeof ISSUE_SEVERITY_VALUES)[number]);\n assertFrontMatterCondition(\n isKnownSeverity,\n `severity value must be one of: ${[...ISSUE_SEVERITY_VALUES, \"med\"].join(\", \")}`,\n );\n }\n\n const regression = record.regression;\n if (regression !== undefined) {\n if (typeof regression !== \"boolean\") {\n validationError(\"regression must be a boolean\");\n }\n }\n\n assertTimestampField(record, \"created_at\");\n assertTimestampField(record, \"updated_at\");\n if (record.deadline !== undefined) {\n assertTimestampField(record, \"deadline\");\n }\n if (record.reminders !== undefined) {\n const reminders = record.reminders;\n assertFrontMatterCondition(Array.isArray(reminders), \"reminders must be an array\");\n for (const reminder of reminders as unknown[]) {\n assertFrontMatterCondition(typeof reminder === \"object\" && reminder !== null && !Array.isArray(reminder), \"reminders entries must be objects\");\n const reminderRecord = reminder as Record<string, unknown>;\n assertFrontMatterCondition(typeof reminderRecord.at === \"string\", \"reminder.at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(reminderRecord.at as string), \"reminder.at must be a valid ISO timestamp\");\n assertFrontMatterCondition(typeof reminderRecord.text === \"string\", \"reminder.text must be a string\");\n assertFrontMatterCondition((reminderRecord.text as string).trim().length > 0, \"reminder.text must not be empty\");\n }\n }\n if (record.events !== undefined) {\n const events = record.events;\n assertFrontMatterCondition(Array.isArray(events), \"events must be an array\");\n for (const event of events as unknown[]) {\n assertFrontMatterCondition(typeof event === \"object\" && event !== null && !Array.isArray(event), \"events entries must be objects\");\n const eventRecord = event as Record<string, unknown>;\n assertFrontMatterCondition(typeof eventRecord.start_at === \"string\", \"event.start_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(eventRecord.start_at as string), \"event.start_at must be a valid ISO timestamp\");\n\n if (eventRecord.end_at !== undefined) {\n assertFrontMatterCondition(typeof eventRecord.end_at === \"string\", \"event.end_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(eventRecord.end_at as string), \"event.end_at must be a valid ISO timestamp\");\n assertFrontMatterCondition(\n compareTimestampStrings(eventRecord.end_at as string, eventRecord.start_at as string) > 0,\n \"event.end_at must be after event.start_at\",\n );\n }\n\n for (const stringField of [\"title\", \"description\", \"location\", \"timezone\"] as const) {\n if (eventRecord[stringField] !== undefined) {\n assertFrontMatterCondition(typeof eventRecord[stringField] === \"string\", `event.${stringField} must be a string`);\n assertFrontMatterCondition(\n (eventRecord[stringField] as string).trim().length > 0,\n `event.${stringField} must not be empty`,\n );\n }\n }\n\n if (eventRecord.all_day !== undefined) {\n assertFrontMatterCondition(typeof eventRecord.all_day === \"boolean\", \"event.all_day must be a boolean\");\n }\n\n if (eventRecord.recurrence !== undefined) {\n assertValidRecurrenceRule(eventRecord.recurrence);\n if ((eventRecord.recurrence as Record<string, unknown>).until !== undefined) {\n assertFrontMatterCondition(\n compareTimestampStrings(\n (eventRecord.recurrence as Record<string, unknown>).until as string,\n eventRecord.start_at as string,\n ) >= 0,\n \"event.recurrence.until must be at or after event.start_at\",\n );\n }\n }\n }\n }\n if (record.closed_at !== undefined) {\n const closedAt = record.closed_at;\n assertFrontMatterCondition(typeof closedAt === \"string\", \"closed_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(closedAt as string), \"closed_at must be a valid ISO timestamp\");\n }\n for (const fieldName of [\"source_type\", \"source_owner\", \"design\", \"external_ref\"] as const) {\n const value = record[fieldName];\n if (value !== undefined) {\n assertFrontMatterCondition(typeof value === \"string\", `${fieldName} must be a string`);\n }\n }\n const typeOptions = record.type_options;\n if (typeOptions !== undefined) {\n assertFrontMatterCondition(\n typeof typeOptions === \"object\" && typeOptions !== null && !Array.isArray(typeOptions),\n \"type_options must be an object\",\n );\n for (const [optionKey, optionValue] of Object.entries(typeOptions as Record<string, unknown>)) {\n assertFrontMatterCondition(optionKey.trim().length > 0, \"type_options keys must be non-empty\");\n assertFrontMatterCondition(typeof optionValue === \"string\", \"type_options values must be strings\");\n const optionText = optionValue as string;\n assertFrontMatterCondition(optionText.trim().length > 0, \"type_options values must be non-empty strings\");\n }\n }\n\n if (runtimeContext?.fieldRegistry) {\n for (const definition of runtimeContext.fieldRegistry.definitions) {\n const fieldValue = record[definition.metadata_key];\n if (fieldValue === undefined) {\n if (runtimeFieldRequiredForType(definition, itemType as string)) {\n validationError(`missing required schema field: ${definition.metadata_key}`);\n }\n continue;\n }\n try {\n record[definition.metadata_key] = coerceRuntimeFieldValue(\n definition,\n fieldValue,\n `metadata field \"${definition.metadata_key}\"`,\n );\n } catch (error: unknown) {\n validationError(String((error as { message?: unknown })?.message).replace(/^Invalid\\s+/u, \"\"));\n }\n }\n }\n\n if (runtimeContext && runtimeContext.unknownFieldPolicy !== \"allow\") {\n const knownKeys = buildKnownFrontMatterKeys(runtimeContext);\n const unknownKeys = Object.keys(record).filter((key) => !knownKeys.has(key)).sort((left, right) => left.localeCompare(right));\n if (unknownKeys.length > 0) {\n if (runtimeContext.unknownFieldPolicy === \"reject\") {\n validationError(`unknown schema fields are not allowed: ${unknownKeys.join(\", \")}`);\n } else {\n runtimeContext.onWarning?.(`item_unknown_schema_fields:${unknownKeys.join(\",\")}`);\n }\n }\n }\n}\n\nfunction sortDependencies(values: Dependency[] | undefined): Dependency[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n id: value.id.trim().toLowerCase(),\n kind: value.kind,\n created_at: value.created_at,\n author: value.author?.trim() || undefined,\n source_kind: value.source_kind?.trim() || undefined,\n }))\n .sort((a, b) => {\n const byCreated = compareTimestampStrings(a.created_at, b.created_at);\n if (byCreated !== 0) return byCreated;\n const byId = a.id.localeCompare(b.id);\n if (byId !== 0) return byId;\n const byKind = a.kind.localeCompare(b.kind);\n if (byKind !== 0) return byKind;\n return (a.source_kind ?? \"\").localeCompare(b.source_kind ?? \"\");\n });\n}\n\nfunction sortLogValues<T extends Comment | LogNote>(values: T[] | undefined): T[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values].sort((a, b) => {\n const byCreated = compareTimestampStrings(a.created_at, b.created_at);\n if (byCreated !== 0) return byCreated;\n const byText = a.text.localeCompare(b.text);\n if (byText !== 0) return byText;\n return a.author.localeCompare(b.author);\n });\n}\n\nfunction sortReminders(values: Reminder[] | undefined): Reminder[] | undefined {\n if (!values || values.length === 0) return undefined;\n const normalized = [...values]\n .map((value) => ({\n at: value.at,\n text: value.text.trim(),\n }))\n .filter((value) => value.text.length > 0)\n .sort((a, b) => {\n const byAt = compareTimestampStrings(a.at, b.at);\n if (byAt !== 0) return byAt;\n return a.text.localeCompare(b.text);\n });\n return normalized.length === 0 ? undefined : normalized;\n}\n\nfunction normalizeRecurrenceRule(value: RecurrenceRule | undefined): RecurrenceRule | undefined {\n if (!value) {\n return undefined;\n }\n const normalizedFrequency = value.freq.trim().toLowerCase();\n if (!RECURRENCE_FREQUENCY_VALUES.includes(normalizedFrequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number])) {\n return undefined;\n }\n\n const byWeekday = Array.from(\n new Set(\n (value.by_weekday ?? [])\n .map((weekday) => weekday.trim().toLowerCase())\n .filter((weekday) => RECURRENCE_WEEKDAY_VALUES.includes(weekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number])),\n ),\n ).sort(\n (a, b) =>\n weekdayOrderIndex(a as (typeof RECURRENCE_WEEKDAY_VALUES)[number]) -\n weekdayOrderIndex(b as (typeof RECURRENCE_WEEKDAY_VALUES)[number]),\n );\n\n const byMonthDay = Array.from(\n new Set(\n (value.by_month_day ?? [])\n .filter((day) => Number.isInteger(day) && day >= 1 && day <= 31)\n .map((day) => day as number),\n ),\n ).sort((a, b) => a - b);\n\n const exdates = Array.from(\n new Set(\n (value.exdates ?? [])\n .map((timestamp) => timestamp.trim())\n .filter((timestamp) => isTimestampLiteral(timestamp)),\n ),\n ).sort((a, b) => compareTimestampStrings(a, b));\n\n const normalized: RecurrenceRule = {\n freq: normalizedFrequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number],\n interval: value.interval !== undefined && value.interval > 1 ? value.interval : undefined,\n count: value.count,\n until: value.until?.trim() || undefined,\n by_weekday: byWeekday.length > 0 ? (byWeekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number][]) : undefined,\n by_month_day: byMonthDay.length > 0 ? byMonthDay : undefined,\n exdates: exdates.length > 0 ? exdates : undefined,\n };\n for (const [key, fieldValue] of Object.entries(normalized)) {\n if (fieldValue === undefined) {\n delete (normalized as unknown as Record<string, unknown>)[key];\n }\n }\n return normalized;\n}\n\nfunction sortEvents(values: CalendarEvent[] | undefined): CalendarEvent[] | undefined {\n if (!values || values.length === 0) {\n return undefined;\n }\n const normalized = [...values]\n .map((value) => {\n const event: CalendarEvent = {\n start_at: value.start_at,\n end_at: value.end_at || undefined,\n title: value.title?.trim() || undefined,\n description: value.description?.trim() || undefined,\n location: value.location?.trim() || undefined,\n all_day: value.all_day,\n timezone: value.timezone?.trim() || undefined,\n recurrence: normalizeRecurrenceRule(value.recurrence),\n };\n for (const [key, fieldValue] of Object.entries(event)) {\n if (fieldValue === undefined) {\n delete (event as unknown as Record<string, unknown>)[key];\n }\n }\n return event;\n })\n .sort((a, b) => {\n const byStart = compareTimestampStrings(a.start_at, b.start_at);\n if (byStart !== 0) return byStart;\n const byEnd = (a.end_at ?? \"\").localeCompare(b.end_at ?? \"\");\n if (byEnd !== 0) return byEnd;\n const byTitle = (a.title ?? \"\").localeCompare(b.title ?? \"\");\n if (byTitle !== 0) return byTitle;\n const byAllDay = Number(Boolean(a.all_day)) - Number(Boolean(b.all_day));\n if (byAllDay !== 0) return byAllDay;\n const byTimezone = (a.timezone ?? \"\").localeCompare(b.timezone ?? \"\");\n if (byTimezone !== 0) return byTimezone;\n const byLocation = (a.location ?? \"\").localeCompare(b.location ?? \"\");\n if (byLocation !== 0) return byLocation;\n const byDescription = (a.description ?? \"\").localeCompare(b.description ?? \"\");\n if (byDescription !== 0) return byDescription;\n return JSON.stringify(a.recurrence ?? {}).localeCompare(JSON.stringify(b.recurrence ?? {}));\n });\n return normalized;\n}\n\nfunction normalizeFiles(values: LinkedFile[] | undefined): LinkedFile[] | undefined {\n if (!values || values.length === 0) return undefined;\n return values\n .map((value) => ({\n path: normalizePathValue(value.path),\n scope: value.scope,\n note: value.note?.trim() || undefined,\n }));\n}\n\nfunction normalizeTestRunSummaries(values: ItemTestRunSummary[] | undefined): ItemTestRunSummary[] | undefined {\n if (!values || values.length === 0) return undefined;\n const normalized = values\n .map((value) => {\n const runId = typeof value.run_id === \"string\" ? value.run_id.trim() : \"\";\n const kind = value.kind === \"test\" || value.kind === \"test-all\" ? value.kind : \"test\";\n const status =\n value.status === \"passed\" || value.status === \"failed\" || value.status === \"stopped\" || value.status === \"canceled\"\n ? value.status\n : \"failed\";\n const startedAt = typeof value.started_at === \"string\" ? value.started_at : \"\";\n const finishedAt = typeof value.finished_at === \"string\" ? value.finished_at : \"\";\n const recordedAt = typeof value.recorded_at === \"string\" ? value.recorded_at : \"\";\n const passed = typeof value.passed === \"number\" && Number.isFinite(value.passed) ? Math.max(0, Math.floor(value.passed)) : 0;\n const failed = typeof value.failed === \"number\" && Number.isFinite(value.failed) ? Math.max(0, Math.floor(value.failed)) : 0;\n const skipped = typeof value.skipped === \"number\" && Number.isFinite(value.skipped) ? Math.max(0, Math.floor(value.skipped)) : 0;\n return {\n run_id: runId,\n kind,\n status,\n started_at: startedAt,\n finished_at: finishedAt,\n recorded_at: recordedAt,\n attempt:\n typeof value.attempt === \"number\" && Number.isFinite(value.attempt) && value.attempt >= 1\n ? Math.floor(value.attempt)\n : undefined,\n resumed_from: value.resumed_from?.trim() || undefined,\n passed,\n failed,\n skipped,\n items:\n typeof value.items === \"number\" && Number.isFinite(value.items) && value.items >= 0\n ? Math.floor(value.items)\n : undefined,\n linked_tests:\n typeof value.linked_tests === \"number\" && Number.isFinite(value.linked_tests) && value.linked_tests >= 0\n ? Math.floor(value.linked_tests)\n : undefined,\n fail_on_skipped_triggered: value.fail_on_skipped_triggered === true ? true : undefined,\n };\n })\n .filter((value) => value.run_id.length > 0 && value.started_at.length > 0 && value.finished_at.length > 0 && value.recorded_at.length > 0)\n .sort((a, b) =>\n firstNonZeroComparison([\n compareTimestampStrings(a.recorded_at, b.recorded_at),\n a.run_id.localeCompare(b.run_id),\n a.kind.localeCompare(b.kind),\n ]),\n );\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction sortTests(values: LinkedTest[] | undefined): LinkedTest[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n command: value.command?.trim() || undefined,\n path: value.path ? normalizePathValue(value.path) : undefined,\n scope: value.scope,\n timeout_seconds:\n typeof value.timeout_seconds === \"number\" && Number.isFinite(value.timeout_seconds) && value.timeout_seconds > 0\n ? value.timeout_seconds\n : undefined,\n pm_context_mode: (() => {\n const normalized = value.pm_context_mode?.trim().toLowerCase();\n if (!normalized || !LINKED_TEST_PM_CONTEXT_MODE_VALUES.has(normalized)) {\n return undefined;\n }\n return normalized as LinkedTest[\"pm_context_mode\"];\n })(),\n env_set: value.env_set\n ? Object.fromEntries(\n Object.entries(value.env_set)\n .map(([key, envValue]) => [key.trim(), String(envValue).trim()] as const)\n .filter(([key, envValue]) => key.length > 0 && envValue.length > 0)\n .sort(([left], [right]) => left.localeCompare(right)),\n )\n : undefined,\n env_clear: value.env_clear\n ? [...new Set(value.env_clear.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n shared_host_safe: value.shared_host_safe === true ? true : undefined,\n assert_stdout_contains: value.assert_stdout_contains\n ? [...new Set(value.assert_stdout_contains.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stdout_regex: value.assert_stdout_regex\n ? [...new Set(value.assert_stdout_regex.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stderr_contains: value.assert_stderr_contains\n ? [...new Set(value.assert_stderr_contains.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stderr_regex: value.assert_stderr_regex\n ? [...new Set(value.assert_stderr_regex.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stdout_min_lines:\n typeof value.assert_stdout_min_lines === \"number\" &&\n Number.isFinite(value.assert_stdout_min_lines) &&\n value.assert_stdout_min_lines >= 0\n ? Math.floor(value.assert_stdout_min_lines)\n : undefined,\n assert_json_field_equals: value.assert_json_field_equals\n ? Object.fromEntries(\n Object.entries(value.assert_json_field_equals)\n .map(([key, expectedValue]) => [key.trim(), String(expectedValue).trim()] as const)\n .filter(([key, expectedValue]) => key.length > 0 && expectedValue.length > 0)\n .sort(([left], [right]) => left.localeCompare(right)),\n )\n : undefined,\n assert_json_field_gte: value.assert_json_field_gte\n ? Object.fromEntries(\n Object.entries(value.assert_json_field_gte)\n .map(([key, expectedValue]) => [key.trim(), Number(expectedValue)] as const)\n .filter(([key, expectedValue]) => key.length > 0 && Number.isFinite(expectedValue))\n .sort(([left], [right]) => left.localeCompare(right)),\n )\n : undefined,\n note: value.note?.trim() || undefined,\n }))\n .sort((a, b) =>\n firstNonZeroComparison([\n a.scope.localeCompare(b.scope),\n (a.path ?? \"\").localeCompare(b.path ?? \"\"),\n (a.command ?? \"\").localeCompare(b.command ?? \"\"),\n (a.timeout_seconds ?? 0) - (b.timeout_seconds ?? 0),\n (a.pm_context_mode ?? \"\").localeCompare(b.pm_context_mode ?? \"\"),\n Number(Boolean(a.shared_host_safe)) - Number(Boolean(b.shared_host_safe)),\n JSON.stringify(a.env_clear ?? []).localeCompare(JSON.stringify(b.env_clear ?? [])),\n JSON.stringify(a.env_set ?? {}).localeCompare(JSON.stringify(b.env_set ?? {})),\n JSON.stringify(a.assert_stdout_contains ?? []).localeCompare(JSON.stringify(b.assert_stdout_contains ?? [])),\n JSON.stringify(a.assert_stdout_regex ?? []).localeCompare(JSON.stringify(b.assert_stdout_regex ?? [])),\n JSON.stringify(a.assert_stderr_contains ?? []).localeCompare(JSON.stringify(b.assert_stderr_contains ?? [])),\n JSON.stringify(a.assert_stderr_regex ?? []).localeCompare(JSON.stringify(b.assert_stderr_regex ?? [])),\n (a.assert_stdout_min_lines ?? 0) - (b.assert_stdout_min_lines ?? 0),\n JSON.stringify(a.assert_json_field_equals ?? {}).localeCompare(JSON.stringify(b.assert_json_field_equals ?? {})),\n JSON.stringify(a.assert_json_field_gte ?? {}).localeCompare(JSON.stringify(b.assert_json_field_gte ?? {})),\n (a.note ?? \"\").localeCompare(b.note ?? \"\"),\n ]),\n );\n}\n\nfunction sortDocs(values: LinkedDoc[] | undefined): LinkedDoc[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n path: normalizePathValue(value.path),\n scope: value.scope,\n note: value.note?.trim() || undefined,\n }))\n .sort((a, b) => {\n const byScope = a.scope.localeCompare(b.scope);\n if (byScope !== 0) return byScope;\n const byPath = a.path.localeCompare(b.path);\n if (byPath !== 0) return byPath;\n return (a.note ?? \"\").localeCompare(b.note ?? \"\");\n });\n}\n\nfunction trimStringOrUndefined(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction normalizePlanStepLinks(value: unknown): PlanStepLink[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepLink[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const id = trimStringOrUndefined(record.id);\n const kind = trimStringOrUndefined(record.kind);\n if (!id || !kind) continue;\n const link: PlanStepLink = { id, kind: kind as PlanStepLink[\"kind\"] };\n const note = trimStringOrUndefined(record.note);\n if (note) link.note = note;\n if (record.required_before_step === true) link.required_before_step = true;\n out.push(link);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepFiles(value: unknown): PlanStepFile[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepFile[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const path = trimStringOrUndefined(record.path);\n if (!path) continue;\n const file: PlanStepFile = { path: normalizePathValue(path) };\n if (record.scope === \"project\" || record.scope === \"global\") file.scope = record.scope;\n const note = trimStringOrUndefined(record.note);\n if (note) file.note = note;\n out.push(file);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepTests(value: unknown): { command?: string; path?: string; note?: string }[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: { command?: string; path?: string; note?: string }[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const command = trimStringOrUndefined(record.command);\n const path = trimStringOrUndefined(record.path);\n if (!command && !path) continue;\n const test: { command?: string; path?: string; note?: string } = {};\n if (command) test.command = command;\n if (path) test.path = normalizePathValue(path);\n const note = trimStringOrUndefined(record.note);\n if (note) test.note = note;\n out.push(test);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepDocs(value: unknown): PlanStepDoc[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepDoc[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const path = trimStringOrUndefined(record.path);\n if (!path) continue;\n const doc: PlanStepDoc = { path: normalizePathValue(path) };\n if (record.scope === \"project\" || record.scope === \"global\") doc.scope = record.scope;\n const note = trimStringOrUndefined(record.note);\n if (note) doc.note = note;\n out.push(doc);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanSteps(value: unknown): PlanStep[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStep[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const id = trimStringOrUndefined(record.id);\n const title = trimStringOrUndefined(record.title);\n const status = trimStringOrUndefined(record.status);\n const orderRaw = record.order;\n const order = typeof orderRaw === \"number\" && Number.isFinite(orderRaw) ? orderRaw : Number(orderRaw);\n if (!id || !title || !status || !Number.isFinite(order)) continue;\n const created_at = typeof record.created_at === \"string\" ? record.created_at : \"\";\n const updated_at = typeof record.updated_at === \"string\" ? record.updated_at : \"\";\n if (!created_at || !updated_at) continue;\n const step: PlanStep = {\n id,\n order,\n title,\n status: status as PlanStepStatus,\n created_at,\n updated_at,\n };\n const body = trimStringOrUndefined(record.body);\n if (body) step.body = body;\n const owner = trimStringOrUndefined(record.owner);\n if (owner) step.owner = owner;\n const evidence = trimStringOrUndefined(record.evidence);\n if (evidence) step.evidence = evidence;\n const blockedReason = trimStringOrUndefined(record.blocked_reason);\n if (blockedReason) step.blocked_reason = blockedReason;\n const supersededBy = trimStringOrUndefined(record.superseded_by);\n if (supersededBy) step.superseded_by = supersededBy;\n const completedAt = typeof record.completed_at === \"string\" ? record.completed_at : undefined;\n if (completedAt && completedAt.length > 0) step.completed_at = completedAt;\n const links = normalizePlanStepLinks(record.linked_items);\n if (links) step.linked_items = links;\n const files = normalizePlanStepFiles(record.files);\n if (files) step.files = files;\n const tests = normalizePlanStepTests(record.tests);\n if (tests) step.tests = tests;\n const docs = normalizePlanStepDocs(record.docs);\n if (docs) step.docs = docs;\n out.push(step);\n }\n out.sort((left, right) => left.order - right.order);\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanDecisions(value: unknown): PlanDecision[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanDecision[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const ts = typeof record.ts === \"string\" ? record.ts : \"\";\n const author = typeof record.author === \"string\" ? record.author : \"\";\n const decision = trimStringOrUndefined(record.decision);\n if (!ts || !author || !decision) continue;\n const item: PlanDecision = { ts, author, decision };\n const rationale = trimStringOrUndefined(record.rationale);\n if (rationale) item.rationale = rationale;\n const evidence = trimStringOrUndefined(record.evidence);\n if (evidence) item.evidence = evidence;\n const stepId = trimStringOrUndefined(record.step_id);\n if (stepId) item.step_id = stepId;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanDiscoveries(value: unknown): PlanDiscovery[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanDiscovery[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const ts = typeof record.ts === \"string\" ? record.ts : \"\";\n const author = typeof record.author === \"string\" ? record.author : \"\";\n const text = trimStringOrUndefined(record.text);\n if (!ts || !author || !text) continue;\n const item: PlanDiscovery = { ts, author, text };\n const stepId = trimStringOrUndefined(record.step_id);\n if (stepId) item.step_id = stepId;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanValidation(value: unknown): PlanValidationCheck[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanValidationCheck[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const text = trimStringOrUndefined(record.text);\n if (!text) continue;\n const item: PlanValidationCheck = { text };\n const command = trimStringOrUndefined(record.command);\n if (command) item.command = command;\n const expected = trimStringOrUndefined(record.expected);\n if (expected) item.expected = expected;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizeTypeOptions(values: Record<string, string> | undefined): Record<string, string> | undefined {\n if (!values) {\n return undefined;\n }\n const normalizedEntries = Object.entries(values)\n .map(([key, value]) => [key.trim(), value.trim()] as const)\n .filter(([key, value]) => key.length > 0 && value.length > 0)\n .sort((left, right) => left[0].localeCompare(right[0]));\n if (normalizedEntries.length === 0) {\n return undefined;\n }\n return Object.fromEntries(normalizedEntries);\n}\n\nfunction normalizeBody(body: string): string {\n let start = 0;\n while (start < body.length && body[start] === \"\\n\") {\n start += 1;\n }\n return body.slice(start).trimEnd();\n}\n\nfunction normalizeConfidenceValue(value: ItemMetadata[\"confidence\"] | undefined): ItemMetadata[\"confidence\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (typeof value === \"number\") {\n return value;\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"med\") {\n return \"medium\";\n }\n if (CONFIDENCE_TEXT_VALUES.includes(normalized as (typeof CONFIDENCE_TEXT_VALUES)[number])) {\n return normalized as (typeof CONFIDENCE_TEXT_VALUES)[number];\n }\n return undefined;\n}\n\nfunction normalizeSeverityValue(value: ItemMetadata[\"severity\"] | undefined): ItemMetadata[\"severity\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"med\") {\n return \"medium\";\n }\n if (ISSUE_SEVERITY_VALUES.includes(normalized as (typeof ISSUE_SEVERITY_VALUES)[number])) {\n return normalized as (typeof ISSUE_SEVERITY_VALUES)[number];\n }\n return undefined;\n}\n\n/**\n * Implements normalize front matter for the public runtime surface of this module.\n */\nexport function normalizeFrontMatter(\n frontMatter: ItemMetadata,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemMetadata {\n const runtimeContext = resolveRuntimeSchemaValidationContext(options);\n const normalizedStatus = normalizeStatusInput(frontMatter.status, runtimeContext?.statusRegistry) ?? frontMatter.status;\n const tags = Array.from(new Set(frontMatter.tags.map((tag) => tag.trim().toLowerCase()).filter(Boolean))).sort((a, b) =>\n a.localeCompare(b),\n );\n const normalized: ItemMetadata = {\n id: frontMatter.id,\n title: frontMatter.title,\n description: frontMatter.description,\n type: frontMatter.type,\n pm_format_version: normalizeItemFormatVersion(frontMatter.pm_format_version),\n source_type: frontMatter.source_type?.trim() || undefined,\n type_options: normalizeTypeOptions(frontMatter.type_options),\n status: normalizedStatus,\n priority: frontMatter.priority,\n tags,\n created_at: frontMatter.created_at,\n updated_at: frontMatter.updated_at,\n dependencies: sortDependencies(frontMatter.dependencies),\n comments: sortLogValues(frontMatter.comments),\n notes: sortLogValues(frontMatter.notes),\n learnings: sortLogValues(frontMatter.learnings),\n files: normalizeFiles(frontMatter.files),\n tests: sortTests(frontMatter.tests),\n test_runs: normalizeTestRunSummaries(frontMatter.test_runs),\n docs: sortDocs(frontMatter.docs),\n deadline: frontMatter.deadline || undefined,\n reminders: sortReminders(frontMatter.reminders),\n events: sortEvents(frontMatter.events),\n closed_at: frontMatter.closed_at || undefined,\n assignee: frontMatter.assignee?.trim() || undefined,\n source_owner: frontMatter.source_owner?.trim() || undefined,\n author: frontMatter.author || undefined,\n estimated_minutes: frontMatter.estimated_minutes,\n acceptance_criteria: frontMatter.acceptance_criteria ?? undefined,\n design: frontMatter.design ?? undefined,\n external_ref: frontMatter.external_ref ?? undefined,\n definition_of_ready: frontMatter.definition_of_ready?.trim() || undefined,\n order: frontMatter.order,\n goal: frontMatter.goal?.trim() || undefined,\n objective: frontMatter.objective?.trim() || undefined,\n value: frontMatter.value?.trim() || undefined,\n impact: frontMatter.impact?.trim() || undefined,\n outcome: frontMatter.outcome?.trim() || undefined,\n why_now: frontMatter.why_now?.trim() || undefined,\n parent: frontMatter.parent?.trim() || undefined,\n reviewer: frontMatter.reviewer?.trim() || undefined,\n risk: frontMatter.risk ?? undefined,\n confidence: normalizeConfidenceValue(frontMatter.confidence),\n sprint: frontMatter.sprint?.trim() || undefined,\n release: frontMatter.release?.trim() || undefined,\n blocked_by: frontMatter.blocked_by?.trim() || undefined,\n blocked_reason: frontMatter.blocked_reason?.trim() || undefined,\n unblock_note: frontMatter.unblock_note?.trim() || undefined,\n reporter: frontMatter.reporter?.trim() || undefined,\n severity: normalizeSeverityValue(frontMatter.severity),\n environment: frontMatter.environment?.trim() || undefined,\n repro_steps: frontMatter.repro_steps?.trim() || undefined,\n resolution: frontMatter.resolution?.trim() || undefined,\n expected_result: frontMatter.expected_result?.trim() || undefined,\n actual_result: frontMatter.actual_result?.trim() || undefined,\n affected_version: frontMatter.affected_version?.trim() || undefined,\n fixed_version: frontMatter.fixed_version?.trim() || undefined,\n component: frontMatter.component?.trim() || undefined,\n regression: frontMatter.regression,\n customer_impact: frontMatter.customer_impact?.trim() || undefined,\n close_reason: frontMatter.close_reason || undefined,\n plan_mode: trimStringOrUndefined(frontMatter.plan_mode) as ItemMetadata[\"plan_mode\"],\n plan_scope: trimStringOrUndefined(frontMatter.plan_scope),\n plan_harness: trimStringOrUndefined(frontMatter.plan_harness) as ItemMetadata[\"plan_harness\"],\n plan_resume_context: trimStringOrUndefined(frontMatter.plan_resume_context),\n plan_steps: normalizePlanSteps(frontMatter.plan_steps),\n plan_decisions: normalizePlanDecisions(frontMatter.plan_decisions),\n plan_discoveries: normalizePlanDiscoveries(frontMatter.plan_discoveries),\n plan_validation: normalizePlanValidation(frontMatter.plan_validation),\n };\n const sourceRecord = frontMatter as unknown as Record<string, unknown>;\n for (const [key, value] of Object.entries(sourceRecord)) {\n if (Object.prototype.hasOwnProperty.call(normalized, key) || value === undefined) {\n continue;\n }\n (normalized as unknown as Record<string, unknown>)[key] = value;\n }\n\n if (runtimeContext?.fieldRegistry) {\n for (const definition of runtimeContext.fieldRegistry.definitions) {\n const currentValue = (normalized as unknown as Record<string, unknown>)[definition.metadata_key];\n if (currentValue === undefined) {\n continue;\n }\n (normalized as unknown as Record<string, unknown>)[definition.metadata_key] = coerceRuntimeFieldValue(\n definition,\n currentValue,\n `metadata field \"${definition.metadata_key}\"`,\n );\n }\n }\n\n if (runtimeContext && runtimeContext.unknownFieldPolicy !== \"allow\") {\n const knownKeys = buildKnownFrontMatterKeys(runtimeContext);\n const unknownKeys = Object.keys(normalized as unknown as Record<string, unknown>)\n .filter((key) => !knownKeys.has(key))\n .sort((left, right) => left.localeCompare(right));\n if (unknownKeys.length > 0) {\n if (runtimeContext.unknownFieldPolicy === \"reject\") {\n validationError(`unknown schema fields are not allowed: ${unknownKeys.join(\", \")}`);\n }\n }\n }\n\n for (const [key, value] of Object.entries(normalized)) {\n if (value === undefined) {\n delete (normalized as unknown as Record<string, unknown>)[key];\n }\n }\n return normalized;\n}\n\nfunction orderFrontMatter(frontMatter: ItemMetadata): Record<string, unknown> {\n return orderObject(frontMatter as unknown as Record<string, unknown>, FRONT_MATTER_KEY_ORDER);\n}\n\nfunction findJsonObjectEnd(content: string): number {\n let depth = 0;\n let inString = false;\n let escaped = false;\n\n for (let i = 0; i < content.length; i += 1) {\n const char = content[i];\n if (inString) {\n if (escaped) {\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n escaped = true;\n continue;\n }\n if (char === \"\\\"\") {\n inString = false;\n }\n continue;\n }\n if (char === \"\\\"\") {\n inString = true;\n continue;\n }\n if (char === \"{\") {\n depth += 1;\n continue;\n }\n if (char === \"}\") {\n depth -= 1;\n if (depth === 0) {\n return i;\n }\n }\n }\n\n return -1;\n}\n\n/**\n * Implements split front matter for the public runtime surface of this module.\n */\nexport function splitFrontMatter(content: string): { frontMatter: string; body: string } {\n if (!content.startsWith(\"{\")) {\n return { frontMatter: \"\", body: content };\n }\n const end = findJsonObjectEnd(content);\n if (end < 0) {\n return { frontMatter: \"\", body: content };\n }\n const frontMatter = content.slice(0, end + 1);\n const body = content.slice(end + 1).replace(/^\\r?\\n+/, \"\");\n return { frontMatter, body };\n}\n\nfunction stripLeadingYamlDocument(content: string): { content: string; stripped: boolean } {\n const normalizedContent = content.charCodeAt(0) === 0xfeff ? content.slice(1) : content;\n const opener = normalizedContent.match(/^[ \\t]*---[ \\t]*(?:\\r?\\n|$)/);\n if (!opener) {\n return { content: normalizedContent, stripped: false };\n }\n\n let cursor = opener[0].length;\n while (cursor < normalizedContent.length) {\n const nextNewline = normalizedContent.indexOf(\"\\n\", cursor);\n const lineEnd = nextNewline === -1 ? normalizedContent.length : nextNewline;\n const line = normalizedContent.slice(cursor, lineEnd).replace(/\\r$/, \"\");\n const afterLine = nextNewline === -1 ? lineEnd : lineEnd + 1;\n if (line.trim() === \"---\") {\n return { content: normalizedContent.slice(afterLine).replace(/^\\s+/, \"\"), stripped: true };\n }\n cursor = afterLine;\n }\n\n return { content: normalizedContent, stripped: false };\n}\n\nfunction parseJsonMarkdownItemDocument(\n content: string,\n runtimeContext?: RuntimeSchemaValidationContext,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemDocument {\n const normalized = stripLeadingYamlDocument(content);\n if (normalized.stripped) {\n options.onWarning?.(\"json_markdown_leading_yaml_frontmatter_ignored\");\n }\n const { frontMatter, body } = splitFrontMatter(normalized.content);\n if (!frontMatter) {\n const trimmed = content.trimStart();\n if (trimmed.startsWith(\"{\")) {\n validationError(\"JSON front matter is not valid JSON\");\n }\n validationError(\"missing JSON front matter\");\n }\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(frontMatter);\n } catch {\n validationError(\"JSON front matter is not valid JSON\");\n }\n assertValidFrontMatter(parsed, runtimeContext);\n\n return {\n metadata: normalizeFrontMatter(parsed, options),\n body: normalizeBody(body),\n };\n}\n\nfunction parseToonItemDocument(\n content: string,\n runtimeContext?: RuntimeSchemaValidationContext,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemDocument {\n let parsed: unknown;\n try {\n // decodeToonItemContent transparently recovers documents that the upstream\n // strict decoder rejects (bracketed-token-then-colon inside a quoted value;\n // see toon-decode.ts). The recovery is lossless, so it stays silent rather\n // than emitting a per-read warning that would perpetually flip pm health\n // red for legacy files. The behavior is pinned by toon-decode.spec.ts.\n parsed = decodeToonItemContent(content).value;\n } catch {\n validationError(\"TOON item document is not valid TOON\");\n }\n assertFrontMatterCondition(\n typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed),\n \"TOON item document must be an object\",\n );\n const record = parsed as Record<string, unknown>;\n\n if (Object.prototype.hasOwnProperty.call(record, \"front_matter\")) {\n assertValidFrontMatter(record.front_matter, runtimeContext);\n assertFrontMatterCondition(\n record.body === undefined || typeof record.body === \"string\",\n \"TOON item document body must be a string\",\n );\n return {\n metadata: normalizeFrontMatter(record.front_matter, options),\n body: normalizeBody(typeof record.body === \"string\" ? record.body : \"\"),\n };\n }\n\n const { body, ...frontMatterRecord } = record;\n assertFrontMatterCondition(\n body === undefined || typeof body === \"string\",\n \"TOON item document body must be a string\",\n );\n assertValidFrontMatter(frontMatterRecord, runtimeContext);\n return {\n metadata: normalizeFrontMatter(frontMatterRecord, options),\n body: normalizeBody(typeof body === \"string\" ? body : \"\"),\n };\n}\n\nfunction serializeJsonMarkdownItemDocument(\n document: ItemDocument,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): string {\n const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);\n const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);\n const serializedFrontMatter = JSON.stringify(orderedFrontMatter, null, 2);\n const normalizedBody = normalizeBody(document.body ?? \"\");\n if (!normalizedBody) {\n return `${serializedFrontMatter}\\n`;\n }\n return `${serializedFrontMatter}\\n\\n${normalizedBody}\\n`;\n}\n\nfunction serializeToonItemDocument(\n document: ItemDocument,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): string {\n const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);\n const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);\n const normalizedBody = normalizeBody(document.body ?? \"\");\n return `${encodeToon({ ...orderedFrontMatter, body: normalizedBody })}\\n`;\n}\n\n/**\n * Implements parse item document for the public runtime surface of this module.\n */\nexport function parseItemDocument(content: string, options: ItemDocumentFormatOptions = {}): ItemDocument {\n const conflictMarker = findFirstMergeConflictMarker(content);\n if (conflictMarker) {\n throw new PmCliError(\n `Merge conflict markers detected in item document at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n {\n code: \"merge_conflict_markers_detected\",\n required: \"Resolve merge-conflict markers in the item file before parsing or mutation commands.\",\n why: \"Partially merged documents can corrupt item metadata and history integrity.\",\n examples: [\"git status\", \"git add <resolved-file> && git commit\"],\n nextSteps: [\"Resolve conflicts, save the file, then rerun the pm command.\"],\n },\n );\n }\n const format = options.format ?? \"toon\";\n const runtimeContext = resolveRuntimeSchemaValidationContext(options);\n return format === \"toon\"\n ? parseToonItemDocument(content, runtimeContext, options)\n : parseJsonMarkdownItemDocument(content, runtimeContext, options);\n}\n\n/**\n * Implements serialize item document for the public runtime surface of this module.\n */\nexport function serializeItemDocument(document: ItemDocument, options: ItemDocumentFormatOptions = {}): string {\n const format = options.format ?? \"toon\";\n return format === \"toon\" ? serializeToonItemDocument(document, options) : serializeJsonMarkdownItemDocument(document, options);\n}\n\n/**\n * Implements canonical document for the public runtime surface of this module.\n */\nexport function canonicalDocument(document: ItemDocument, options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {}): ItemDocument {\n return {\n metadata: normalizeFrontMatter(document.metadata, options),\n body: normalizeBody(document.body ?? \"\"),\n };\n}\n\nexport const _testOnlyItemFormat = {\n buildKnownFrontMatterKeys,\n firstNonZeroComparison,\n normalizeBody,\n normalizePlanDecisions,\n normalizePlanDiscoveries,\n normalizePlanStepDocs,\n normalizePlanStepFiles,\n normalizePlanStepLinks,\n normalizePlanSteps,\n normalizePlanStepTests,\n normalizePlanValidation,\n normalizeTestRunSummaries,\n normalizeTypeOptions,\n runtimeFieldRequiredForType,\n sortTests,\n};\n","/**\n * @module core/item/toon-decode\n *\n * Defines item parsing, formatting, and lifecycle helpers for Toon Decode.\n */\nimport { decode as decodeToon } from \"@toon-format/toon\";\n\nexport const TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR = \"https://github.com/toon-format/toon/pull/314\" as const;\n\nexport const TOON_SCALAR_BRACKET_ESCAPE_TRACKING = {\n dependency: \"@toon-format/toon\",\n affected_versions: \"<=2.3.0\",\n upstream_pr: TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR,\n removal_condition:\n \"Remove escapeBracketsInQuotedScalars retry once the upstream strict decoder fix ships in a released @toon-format/toon version and this repository upgrades to it.\",\n} as const;\n\n/**\n * Documents the toon decode result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ToonDecodeResult {\n /** The decoded TOON document. */\n value: unknown;\n /** True when the strict decode required the scalar-bracket escape workaround. */\n usedScalarBracketEscape: boolean;\n}\n\n/**\n * Escape `[` as `\\u005b` inside quoted scalar values so the upstream\n * `@toon-format/toon` strict decoder cannot mis-read them.\n *\n * The upstream bug: the strict decoder's array-header detection scans the whole\n * line for an opening bracket when the key is unquoted, so a quoted scalar value\n * that contains a bracketed token followed (anywhere later on the line) by a\n * colon, e.g. `body: \"POST [redacted]: ok\"` or `desc: \"sntr[ysu]_ ... :\"`, is\n * mis-detected as a `key`+bracket+colon array header and throws. The library's\n * own `encode()` emits exactly this otherwise-correctly-quoted form, so strict\n * decode cannot read the encoder's own output for such values.\n *\n * A line is treated as a scalar `key: value` (not an array header) only when its\n * `\": \"` key/value separator occurs before the first `[`; array-header lines\n * (`tags[3]:`, `comments[6]{...}:`) have the bracket first and are left\n * untouched, as are non-string (unquoted) values. Within a matched quoted value\n * every `[` becomes `\\u005b`, which the decoder unescapes back to `[`, so the\n * decoded value is byte-for-byte identical. Crucially, this neutralises only the\n * bracket trigger and nothing else, so the retry stays in strict mode and every\n * other strict invariant (duplicate sibling keys, array-count mismatches, tabs\n * in indentation, ...) is still enforced.\n *\n * Upstream tracking metadata lives in {@link TOON_SCALAR_BRACKET_ESCAPE_TRACKING}.\n */\nfunction escapeBracketsInQuotedScalars(content: string): string {\n return content\n .split(\"\\n\")\n .map((line) => {\n const separatorIndex = line.indexOf(\": \");\n const bracketIndex = line.indexOf(\"[\");\n if (separatorIndex === -1 || bracketIndex === -1 || bracketIndex < separatorIndex) {\n return line;\n }\n const key = line.slice(0, separatorIndex + 2);\n const value = line.slice(separatorIndex + 2);\n if (!value.startsWith('\"')) {\n return line;\n }\n return key + value.replaceAll(\"[\", \"\\\\u005b\");\n })\n .join(\"\\n\");\n}\n\n/**\n * Decode a TOON item document, working around the upstream bracket mis-parse\n * bug described in {@link escapeBracketsInQuotedScalars}.\n *\n * Strict decode is attempted first (the fast path for all well-formed\n * documents). Only if it fails is the scalar-bracket escape applied and strict\n * decode retried, so the workaround never relaxes strict validation; it only\n * removes the specific trigger. If the escaped content is identical to the\n * original (no quoted-scalar bracket to neutralise) the original strict error is\n * surfaced unchanged; if the retry itself fails the document has a genuine\n * problem beyond the bracket bug and that error propagates.\n */\nexport function decodeToonItemContent(content: string): ToonDecodeResult {\n try {\n return { value: decodeToon(content), usedScalarBracketEscape: false };\n } catch (strictError) {\n const escaped = escapeBracketsInQuotedScalars(content);\n if (escaped === content) {\n throw strictError;\n }\n return { value: decodeToon(escaped), usedScalarBracketEscape: true };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,aAAa,OAAa;AACjC,QAAM,WAAW,MACd,KAAI,EACJ,WAAW,kBAAkB,GAAG,EAChC,MAAM,KAAK,EACX,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC,EACtC,IAAI,CAAC,YAAY,QAAQ,YAAW,CAAE;AACzC,MAAI,SAAS,WAAW,GAAG;AACzB,WAAO;EACT;AACA,QAAM,CAAC,OAAO,GAAG,IAAI,IAAI;AACzB,SAAO,GAAG,KAAK,GAAG,KAAK,IAAI,CAAC,YAAY,GAAG,QAAQ,MAAM,GAA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,QAAQ,UAAU;AACjC,SAAO,WAAW,SAAS,0BAA0B,UAAU,OAAO,IAAI,kCAAkC,UAAU,OAAO;AAC/H;AAKM,SAAU,kBAAkB,UAAwB,UAA2F,CAAA,GAAE;AACrJ,SAAO;IACL,UAAU,qBAAqB,SAAS,UAAU,OAAO;IACzD,MAAM,cAAc,SAAS,QAAQ,EAAE;;AAE3C","debugId":"da8f95fe-2b22-59c6-af82-e0bd090502e4"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/update.ts"],"sourcesContent":["/**\n * @module cli/commands/update\n *\n * Implements the pm update command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n canonicalizeCommandOptionKey,\n commandOptionFlagLabel,\n resolveItemTypeRegistry,\n resolveCommandOptionPolicyState,\n resolveTypeDefinition,\n resolveTypeName,\n validateTypeOptions,\n} from \"../../core/item/type-registry.js\";\nimport { normalizeItemId } from \"../../core/item/id.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport {\n normalizeParentReferenceValue,\n validateMissingParentReference,\n} from \"../../core/item/parent-reference-policy.js\";\nimport { validateSprintOrReleaseValue } from \"../../core/item/sprint-release-format.js\";\nimport {\n applyTagRemovals,\n assertNoUnknownCsvKeys,\n createStdinTokenResolver,\n looksLikeGenericKeyValueEntry,\n mergeAdditiveTags,\n parseCsvKv,\n parseOptionalNumber,\n parseTags,\n} from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { collectRuntimeUpdateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport {\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport {\n describeAllowedTransitions,\n evaluateTransition,\n resolveTypeWorkflows,\n type NormalizedTypeWorkflow,\n} from \"../../core/schema/type-workflows.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { stableValueEquals } from \"../../core/shared/serialization.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport {\n collectRegisteredItemFieldNames,\n applyRegisteredItemFieldDefaultsAndValidation,\n parseRegisteredItemFieldAssignments,\n} from \"../../core/extensions/item-fields.js\";\nimport { buildItemNotFoundError, locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { runClose } from \"./close.js\";\nimport {\n normalizeRiskInput,\n normalizeSeverityInput,\n parseConfidenceInput,\n parseRegressionInput,\n} from \"./metadata-normalizers.js\";\nimport {\n applyLegacyNoneCollectionNormalizers,\n assertNoLegacyNoneToken,\n assertNoLegacyNoneTokens,\n isLegacyNoneToken,\n type LegacyNoneCollectionNormalizer,\n} from \"./legacy-none-tokens.js\";\nimport { ensureEnumValue as ensureEnum } from \"./recurrence-parsers.js\";\nimport {\n parseEventEntries,\n parseReminderEntries,\n parseTypeOptionEntries,\n} from \"./repeatable-metadata-parsers.js\";\nimport type {\n Comment,\n Dependency,\n GovernanceWorkflowEnforcement,\n ItemFormat,\n ItemFrontMatter,\n ItemStatus,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n} from \"../../types/index.js\";\nimport {\n DEPENDENCY_KIND_VALUES,\n ISSUE_SEVERITY_VALUES,\n RISK_VALUES,\n} from \"../../types/index.js\";\nimport { parseDocs, parseFiles, parseLogSeed, parseTests } from \"./create.js\";\nimport {\n COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR,\n COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON,\n resolveRuntimeUnsetFieldDefinition,\n type CommandUnsetFieldDefinition,\n} from \"./shared-unset-fields.js\";\n\n/**\n * Documents the update command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateCommandOptions {\n title?: string;\n description?: string;\n body?: string;\n status?: string;\n closeReason?: string;\n priority?: string;\n type?: string;\n tags?: string;\n addTags?: string[];\n removeTags?: string[];\n deadline?: string;\n estimatedMinutes?: string;\n acceptanceCriteria?: string;\n definitionOfReady?: string;\n order?: string;\n rank?: string;\n goal?: string;\n objective?: string;\n value?: string;\n impact?: string;\n outcome?: string;\n whyNow?: string;\n author?: string;\n message?: string;\n force?: boolean;\n allowAuditUpdate?: boolean;\n allowAuditDepUpdate?: boolean;\n assignee?: string;\n parent?: string;\n reviewer?: string;\n risk?: string;\n confidence?: string;\n sprint?: string;\n release?: string;\n blockedBy?: string;\n blockedReason?: string;\n unblockNote?: string;\n reporter?: string;\n severity?: string;\n environment?: string;\n reproSteps?: string;\n resolution?: string;\n expectedResult?: string;\n actualResult?: string;\n affectedVersion?: string;\n fixedVersion?: string;\n component?: string;\n regression?: string;\n customerImpact?: string;\n dep?: string[];\n depRemove?: string[];\n replaceDeps?: boolean;\n replaceTests?: boolean;\n runtimeFieldCommands?: Array<\"update\" | \"update_many\">;\n comment?: string[];\n note?: string[];\n learning?: string[];\n file?: string[];\n test?: string[];\n doc?: string[];\n reminder?: string[];\n event?: string[];\n typeOption?: string[];\n field?: string[];\n unset?: string[];\n clearDeps?: boolean;\n clearComments?: boolean;\n clearNotes?: boolean;\n clearLearnings?: boolean;\n clearFiles?: boolean;\n clearTests?: boolean;\n clearDocs?: boolean;\n clearReminders?: boolean;\n clearEvents?: boolean;\n clearTypeOptions?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * Documents the update result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateResult {\n item: Record<string, unknown>;\n changed_fields: string[];\n warnings: string[];\n audit_update?: boolean;\n}\n\ninterface UpdateUnsetFieldDefinition {\n optionKey: string;\n frontMatterKey: string;\n}\n\nconst UPDATE_UNSET_FIELD_DEFINITIONS: readonly CommandUnsetFieldDefinition[] = [\n ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON,\n { canonical: \"close-reason\", aliases: [\"close_reason\", \"close-reason\"], optionKey: \"closeReason\", frontMatterKey: \"close_reason\" },\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR,\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n];\n\nconst UPDATE_UNSET_ALIAS_MAP: Map<string, UpdateUnsetFieldDefinition> = (() => {\n const map = new Map<string, UpdateUnsetFieldDefinition>();\n for (const definition of UPDATE_UNSET_FIELD_DEFINITIONS) {\n for (const alias of definition.aliases) {\n map.set(alias, {\n optionKey: definition.optionKey,\n frontMatterKey: definition.frontMatterKey,\n });\n }\n }\n return map;\n})();\n\nconst UPDATE_OPTION_KEY_TO_UNSET_CANONICAL = new Map<string, string>(\n UPDATE_UNSET_FIELD_DEFINITIONS.map((definition) => [definition.optionKey, definition.canonical]),\n);\n\nconst UPDATE_UNSET_SUPPORTED_CANONICAL_FIELDS = UPDATE_UNSET_FIELD_DEFINITIONS.map((definition) => definition.canonical)\n .sort((left, right) => left.localeCompare(right))\n .join(\", \");\n\nconst AUDIT_UPDATE_DISALLOWED_UNSET_FRONT_MATTER_KEYS = new Set<string>([\n \"close_reason\",\n \"assignee\",\n \"parent\",\n \"blocked_by\",\n \"blocked_reason\",\n \"unblock_note\",\n \"dependencies\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"docs\",\n \"reminders\",\n \"events\",\n]);\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed || \"unknown\";\n}\n\nconst UPDATE_LEGACY_NONE_COLLECTION_NORMALIZERS: ReadonlyArray<LegacyNoneCollectionNormalizer<UpdateCommandOptions>> = [\n { optionKey: \"dep\", clearFlagKey: \"clearDeps\", valueFlag: \"--dep\", clearFlag: \"--clear-deps\", disableFlagKey: \"replaceDeps\" },\n { optionKey: \"comment\", clearFlagKey: \"clearComments\", valueFlag: \"--comment\", clearFlag: \"--clear-comments\" },\n { optionKey: \"note\", clearFlagKey: \"clearNotes\", valueFlag: \"--note\", clearFlag: \"--clear-notes\" },\n { optionKey: \"learning\", clearFlagKey: \"clearLearnings\", valueFlag: \"--learning\", clearFlag: \"--clear-learnings\" },\n { optionKey: \"file\", clearFlagKey: \"clearFiles\", valueFlag: \"--file\", clearFlag: \"--clear-files\" },\n { optionKey: \"test\", clearFlagKey: \"clearTests\", valueFlag: \"--test\", clearFlag: \"--clear-tests\", disableFlagKey: \"replaceTests\" },\n { optionKey: \"doc\", clearFlagKey: \"clearDocs\", valueFlag: \"--doc\", clearFlag: \"--clear-docs\" },\n { optionKey: \"reminder\", clearFlagKey: \"clearReminders\", valueFlag: \"--reminder\", clearFlag: \"--clear-reminders\" },\n { optionKey: \"event\", clearFlagKey: \"clearEvents\", valueFlag: \"--event\", clearFlag: \"--clear-events\" },\n { optionKey: \"typeOption\", clearFlagKey: \"clearTypeOptions\", valueFlag: \"--type-option\", clearFlag: \"--clear-type-options\" },\n];\n\nfunction normalizeLegacyNoneUpdateOptions(options: UpdateCommandOptions): UpdateCommandOptions {\n const normalized: UpdateCommandOptions = {\n ...options,\n unset: options.unset ? [...options.unset] : undefined,\n };\n /* c8 ignore start -- unset dedupe helper branch permutations are covered by legacy option compatibility suites. */\n const appendUnsetTarget = (value: string): void => {\n const current = normalized.unset ? [...normalized.unset] : [];\n if (!current.includes(value)) {\n current.push(value);\n }\n normalized.unset = current;\n };\n /* c8 ignore stop */\n\n const scalarOptionKeys = new Set<string>([...UPDATE_OPTION_KEY_TO_UNSET_CANONICAL.keys(), \"rank\"]);\n for (const optionKey of scalarOptionKeys) {\n const candidate = normalized[optionKey];\n if (typeof candidate !== \"string\" || !isLegacyNoneToken(candidate)) {\n continue;\n }\n /* c8 ignore start -- rank alias canonicalization is exercised in legacy-option compatibility tests. */\n const canonicalUnset = optionKey === \"rank\" ? \"order\" : (UPDATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey);\n appendUnsetTarget(canonicalUnset);\n normalized[optionKey] = undefined;\n /* c8 ignore stop */\n }\n\n return applyLegacyNoneCollectionNormalizers(normalized, UPDATE_LEGACY_NONE_COLLECTION_NORMALIZERS);\n}\n\nfunction parseUpdateUnsetTargets(\n raw: string[] | undefined,\n runtimeFieldRegistry?: RuntimeFieldRegistry,\n extensionFieldNames: readonly string[] = [],\n): { frontMatterKeys: Set<string>; optionKeys: Set<string> } {\n const frontMatterKeys = new Set<string>();\n const optionKeys = new Set<string>();\n if (!raw || raw.length === 0) {\n return { frontMatterKeys, optionKeys };\n }\n\n for (const entry of raw) {\n const trimmed = entry.trim().toLowerCase();\n if (!trimmed) {\n throw new PmCliError(\"--unset values must not be empty\", EXIT_CODE.USAGE);\n }\n if (isLegacyNoneToken(trimmed)) {\n throw new PmCliError(\n '--unset no longer accepts \"none\" or \"null\". Specify concrete field names such as --unset deadline',\n EXIT_CODE.USAGE,\n );\n }\n const extensionFieldName = extensionFieldNames.find((fieldName) => {\n const normalizedFieldName = fieldName.toLowerCase();\n return (\n normalizedFieldName === trimmed ||\n normalizedFieldName.replaceAll(\"_\", \"-\") === trimmed ||\n normalizedFieldName.replaceAll(\"-\", \"_\") === trimmed\n );\n });\n const definition = UPDATE_UNSET_ALIAS_MAP.get(trimmed) ??\n resolveRuntimeUnsetFieldDefinition(trimmed, \"update\", runtimeFieldRegistry) ??\n (extensionFieldName ? { optionKey: \"field\", frontMatterKey: extensionFieldName } : undefined);\n if (!definition) {\n throw new PmCliError(\n `Unsupported --unset field \"${entry}\". Supported fields: ${UPDATE_UNSET_SUPPORTED_CANONICAL_FIELDS}`,\n EXIT_CODE.USAGE,\n );\n }\n frontMatterKeys.add(definition.frontMatterKey);\n optionKeys.add(definition.optionKey);\n }\n\n return { frontMatterKeys, optionKeys };\n}\n\n// Restricted append-style flags have dedicated commands with their own\n// audit/override semantics; map each one to its exact replacement invocation so\n// audit-scope errors tell the agent how to retry instead of dead-ending. The\n// evidence append flags are allowed by --allow-audit-update, but still used by\n// narrower scopes such as --allow-audit-dep-update.\nconst AUDIT_RESTRICTED_FLAG_REPLACEMENTS: ReadonlyMap<string, (id: string) => string> = new Map([\n [\"--comment\", (id: string) => `pm comments ${id} --add \"<text>\" --allow-audit-comment`],\n [\"--file\", (id: string) => `pm files ${id} --add \"path=<path>,scope=<scope>,note=<note>\" --force`],\n [\"--doc\", (id: string) => `pm docs ${id} --add \"path=<path>,scope=<scope>,note=<note>\" --force`],\n]);\n\nfunction buildAuditScopeRestrictedOptionsError(params: {\n id: string;\n code: string;\n message: string;\n required: string;\n why: string;\n disallowedFlags: string[];\n}): PmCliError {\n // Only surface replacement commands for restricted flags the caller actually\n // passed, so the guidance is an exact retry path.\n const replacementCommands = params.disallowedFlags\n .flatMap((flag) => {\n const replacement = AUDIT_RESTRICTED_FLAG_REPLACEMENTS.get(flag);\n return replacement ? [replacement(params.id)] : [];\n });\n const replacementSteps = params.disallowedFlags\n .flatMap((flag) => {\n const replacement = AUDIT_RESTRICTED_FLAG_REPLACEMENTS.get(flag);\n return replacement ? [`Replace ${flag} with: ${replacement(params.id)}`] : [];\n });\n return new PmCliError(params.message, EXIT_CODE.USAGE, {\n code: params.code,\n required: params.required,\n why: params.why,\n ...(replacementCommands.length > 0 ? { examples: replacementCommands } : {}),\n nextSteps: [\n `Re-run without: ${params.disallowedFlags.join(\", \")}`,\n ...replacementSteps,\n ],\n });\n}\n\nfunction enforceAllowAuditUpdateScope(id: string, options: UpdateCommandOptions, clearFrontMatterKeys: Set<string>): void {\n const allowAuditUpdate = options.allowAuditUpdate === true;\n const allowAuditDepUpdate = options.allowAuditDepUpdate === true;\n if (!allowAuditUpdate && !allowAuditDepUpdate) {\n return;\n }\n if (allowAuditUpdate && allowAuditDepUpdate) {\n throw new PmCliError(\n \"Choose either --allow-audit-update or --allow-audit-dep-update; these override modes are mutually exclusive.\",\n EXIT_CODE.USAGE,\n );\n }\n const pushIf = (condition: boolean, flag: string, list: string[]): void => {\n if (condition) {\n list.push(flag);\n }\n };\n if (allowAuditDepUpdate) {\n const disallowedFlags: string[] = [];\n pushIf(options.title !== undefined, \"--title\", disallowedFlags);\n pushIf(options.description !== undefined, \"--description\", disallowedFlags);\n pushIf(options.body !== undefined, \"--body\", disallowedFlags);\n pushIf(options.status !== undefined, \"--status\", disallowedFlags);\n pushIf(options.closeReason !== undefined, \"--close-reason\", disallowedFlags);\n pushIf(options.priority !== undefined, \"--priority\", disallowedFlags);\n pushIf(options.type !== undefined, \"--type\", disallowedFlags);\n pushIf(options.tags !== undefined, \"--tags\", disallowedFlags);\n pushIf(Array.isArray(options.addTags) && options.addTags.length > 0, \"--add-tags\", disallowedFlags);\n pushIf(Array.isArray(options.removeTags) && options.removeTags.length > 0, \"--remove-tags\", disallowedFlags);\n pushIf(options.deadline !== undefined, \"--deadline\", disallowedFlags);\n pushIf(options.estimatedMinutes !== undefined, \"--estimate\", disallowedFlags);\n pushIf(options.acceptanceCriteria !== undefined, \"--acceptance-criteria\", disallowedFlags);\n pushIf(options.definitionOfReady !== undefined, \"--definition-of-ready\", disallowedFlags);\n pushIf(options.order !== undefined || options.rank !== undefined, \"--order/--rank\", disallowedFlags);\n pushIf(options.goal !== undefined, \"--goal\", disallowedFlags);\n pushIf(options.objective !== undefined, \"--objective\", disallowedFlags);\n pushIf(options.value !== undefined, \"--value\", disallowedFlags);\n pushIf(options.impact !== undefined, \"--impact\", disallowedFlags);\n pushIf(options.outcome !== undefined, \"--outcome\", disallowedFlags);\n pushIf(options.whyNow !== undefined, \"--why-now\", disallowedFlags);\n pushIf(options.assignee !== undefined, \"--assignee\", disallowedFlags);\n pushIf(options.parent !== undefined, \"--parent\", disallowedFlags);\n pushIf(options.reviewer !== undefined, \"--reviewer\", disallowedFlags);\n pushIf(options.risk !== undefined, \"--risk\", disallowedFlags);\n pushIf(options.confidence !== undefined, \"--confidence\", disallowedFlags);\n pushIf(options.sprint !== undefined, \"--sprint\", disallowedFlags);\n pushIf(options.release !== undefined, \"--release\", disallowedFlags);\n pushIf(options.blockedBy !== undefined, \"--blocked-by\", disallowedFlags);\n pushIf(options.blockedReason !== undefined, \"--blocked-reason\", disallowedFlags);\n pushIf(options.unblockNote !== undefined, \"--unblock-note\", disallowedFlags);\n pushIf(options.reporter !== undefined, \"--reporter\", disallowedFlags);\n pushIf(options.severity !== undefined, \"--severity\", disallowedFlags);\n pushIf(options.environment !== undefined, \"--environment\", disallowedFlags);\n pushIf(options.reproSteps !== undefined, \"--repro-steps\", disallowedFlags);\n pushIf(options.resolution !== undefined, \"--resolution\", disallowedFlags);\n pushIf(options.expectedResult !== undefined, \"--expected-result\", disallowedFlags);\n pushIf(options.actualResult !== undefined, \"--actual-result\", disallowedFlags);\n pushIf(options.affectedVersion !== undefined, \"--affected-version\", disallowedFlags);\n pushIf(options.fixedVersion !== undefined, \"--fixed-version\", disallowedFlags);\n pushIf(options.component !== undefined, \"--component\", disallowedFlags);\n pushIf(options.regression !== undefined, \"--regression\", disallowedFlags);\n pushIf(options.customerImpact !== undefined, \"--customer-impact\", disallowedFlags);\n pushIf(options.depRemove !== undefined, \"--dep-remove\", disallowedFlags);\n pushIf(options.replaceDeps === true, \"--replace-deps\", disallowedFlags);\n pushIf(options.replaceTests === true, \"--replace-tests\", disallowedFlags);\n pushIf(options.comment !== undefined, \"--comment\", disallowedFlags);\n pushIf(options.note !== undefined, \"--note\", disallowedFlags);\n pushIf(options.learning !== undefined, \"--learning\", disallowedFlags);\n pushIf(options.file !== undefined, \"--file\", disallowedFlags);\n pushIf(options.test !== undefined, \"--test\", disallowedFlags);\n pushIf(options.doc !== undefined, \"--doc\", disallowedFlags);\n pushIf(options.reminder !== undefined, \"--reminder\", disallowedFlags);\n pushIf(options.event !== undefined, \"--event\", disallowedFlags);\n pushIf(options.typeOption !== undefined, \"--type-option\", disallowedFlags);\n pushIf(options.clearDeps === true, \"--clear-deps\", disallowedFlags);\n pushIf(options.clearComments === true, \"--clear-comments\", disallowedFlags);\n pushIf(options.clearNotes === true, \"--clear-notes\", disallowedFlags);\n pushIf(options.clearLearnings === true, \"--clear-learnings\", disallowedFlags);\n pushIf(options.clearFiles === true, \"--clear-files\", disallowedFlags);\n pushIf(options.clearTests === true, \"--clear-tests\", disallowedFlags);\n pushIf(options.clearDocs === true, \"--clear-docs\", disallowedFlags);\n pushIf(options.clearReminders === true, \"--clear-reminders\", disallowedFlags);\n pushIf(options.clearEvents === true, \"--clear-events\", disallowedFlags);\n pushIf(options.clearTypeOptions === true, \"--clear-type-options\", disallowedFlags);\n pushIf(options.force === true, \"--force\", disallowedFlags);\n pushIf(clearFrontMatterKeys.size > 0, \"--unset\", disallowedFlags);\n if (options.dep === undefined || options.dep.length === 0) {\n throw new PmCliError(\"--allow-audit-dep-update requires at least one --dep value\", EXIT_CODE.USAGE);\n }\n if (disallowedFlags.length > 0) {\n throw buildAuditScopeRestrictedOptionsError({\n id,\n code: \"audit_dep_update_restricted_options\",\n message: `--allow-audit-dep-update supports append-only dependency additions via --dep. Remove restricted options: ${disallowedFlags.join(\", \")}`,\n required: \"Pass only --dep additions (plus --message/--author) when using --allow-audit-dep-update.\",\n why: \"--allow-audit-dep-update is a narrow non-owner override scoped to append-only dependency additions; every other mutation keeps its normal ownership rules.\",\n disallowedFlags,\n });\n }\n return;\n }\n\n const disallowedFlags: string[] = [];\n if (options.status !== undefined) {\n disallowedFlags.push(\"--status\");\n }\n if (options.closeReason !== undefined) {\n disallowedFlags.push(\"--close-reason\");\n }\n if (options.assignee !== undefined) {\n disallowedFlags.push(\"--assignee\");\n }\n if (options.parent !== undefined) {\n disallowedFlags.push(\"--parent\");\n }\n if (options.blockedBy !== undefined) {\n disallowedFlags.push(\"--blocked-by\");\n }\n if (options.blockedReason !== undefined) {\n disallowedFlags.push(\"--blocked-reason\");\n }\n if (options.unblockNote !== undefined) {\n disallowedFlags.push(\"--unblock-note\");\n }\n if (options.dep !== undefined) {\n disallowedFlags.push(\"--dep\");\n }\n if (options.depRemove !== undefined) {\n disallowedFlags.push(\"--dep-remove\");\n }\n if (options.replaceDeps === true) {\n disallowedFlags.push(\"--replace-deps\");\n }\n if (options.replaceTests === true) {\n disallowedFlags.push(\"--replace-tests\");\n }\n if (options.note !== undefined) {\n disallowedFlags.push(\"--note\");\n }\n if (options.learning !== undefined) {\n disallowedFlags.push(\"--learning\");\n }\n if (options.test !== undefined) {\n disallowedFlags.push(\"--test\");\n }\n if (options.reminder !== undefined) {\n disallowedFlags.push(\"--reminder\");\n }\n if (options.event !== undefined) {\n disallowedFlags.push(\"--event\");\n }\n if (options.clearDeps === true) {\n disallowedFlags.push(\"--clear-deps\");\n }\n if (options.clearComments === true) {\n disallowedFlags.push(\"--clear-comments\");\n }\n if (options.clearNotes === true) {\n disallowedFlags.push(\"--clear-notes\");\n }\n if (options.clearLearnings === true) {\n disallowedFlags.push(\"--clear-learnings\");\n }\n if (options.clearFiles === true) {\n disallowedFlags.push(\"--clear-files\");\n }\n if (options.clearTests === true) {\n disallowedFlags.push(\"--clear-tests\");\n }\n if (options.clearDocs === true) {\n disallowedFlags.push(\"--clear-docs\");\n }\n if (options.clearReminders === true) {\n disallowedFlags.push(\"--clear-reminders\");\n }\n if (options.clearEvents === true) {\n disallowedFlags.push(\"--clear-events\");\n }\n\n /* c8 ignore start -- audit unset ordering fallback is validated by audit-governance integration coverage. */\n const disallowedUnset = [...clearFrontMatterKeys]\n .filter((field) => AUDIT_UPDATE_DISALLOWED_UNSET_FRONT_MATTER_KEYS.has(field))\n .sort((left, right) => left.localeCompare(right))\n .map((field) => `--unset ${field.replaceAll(\"_\", \"-\")}`);\n /* c8 ignore stop */\n disallowedFlags.push(...disallowedUnset);\n\n if (disallowedFlags.length > 0) {\n throw buildAuditScopeRestrictedOptionsError({\n id,\n code: \"audit_update_restricted_options\",\n message: `--allow-audit-update only supports non-lifecycle metadata fields and evidence appends. Remove restricted options: ${disallowedFlags.join(\", \")}`,\n required: \"Limit --allow-audit-update to non-lifecycle metadata fields plus append-only --comment/--file/--doc evidence; route restricted appends and lifecycle changes through their dedicated commands.\",\n why: \"--allow-audit-update is a non-owner override scoped to metadata audits and append-only evidence; lifecycle, ownership, dependency mutations, restricted append fields, and clear/replace operations keep their normal ownership rules.\",\n disallowedFlags,\n });\n }\n}\n\n/* c8 ignore start -- lifecycle/dependency edge branches are exercised by dedicated update workflow integration tests. */\nfunction parseStatus(value: string, statusRegistry: RuntimeStatusRegistry): ItemStatus {\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(`Invalid --status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\n/**\n * Enforce per-type allowed-transition rules (governance.workflow_enforcement).\n * `off` (default) or an unrestricted type is a no-op. `strict` throws on a\n * disallowed transition; `warn` returns a warning string surfaced on the\n * update result. The target status is the raw `--status` value (resolved\n * case-insensitively through the registry inside evaluateTransition).\n */\nfunction enforceTypeWorkflowTransition(params: {\n enforcement: GovernanceWorkflowEnforcement;\n typeWorkflows: NormalizedTypeWorkflow[];\n statusRegistry: RuntimeStatusRegistry;\n typeName: string;\n fromStatus: string;\n toStatus: string;\n}): string | undefined {\n if (params.enforcement === \"off\" || params.typeWorkflows.length === 0) {\n return undefined;\n }\n const result = evaluateTransition({\n typeName: params.typeName,\n fromStatus: params.fromStatus,\n toStatus: params.toStatus,\n typeWorkflows: params.typeWorkflows,\n statusRegistry: params.statusRegistry,\n });\n if (!result.hasRule || result.allowed) {\n return undefined;\n }\n const normalizedFrom = normalizeStatusInput(params.fromStatus, params.statusRegistry) ?? params.fromStatus;\n const normalizedTo = normalizeStatusInput(params.toStatus, params.statusRegistry) ?? params.toStatus;\n const message =\n `Disallowed transition for type \"${params.typeName}\": ${normalizedFrom} -> ${normalizedTo}. ` +\n `Allowed transitions: ${describeAllowedTransitions(result.allowedTransitions)}.`;\n if (params.enforcement === \"strict\") {\n throw new PmCliError(message, EXIT_CODE.USAGE);\n }\n return `workflow_transition_not_allowed: ${message}`;\n}\n\ninterface ParsedDependencyUpdates {\n additions: Dependency[];\n}\n\ninterface DependencyRemovalSelector {\n id: string;\n kind?: (typeof DEPENDENCY_KIND_VALUES)[number];\n source_kind?: string;\n}\n\nfunction parseDependencyCreatedAt(value: string | undefined, currentIso: string): string {\n if (!value || value.trim() === \"\" || value.trim().toLowerCase() === \"now\") {\n return currentIso;\n }\n const parsed = Date.parse(value);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`Invalid dependency created_at timestamp \"${value}\"`, EXIT_CODE.USAGE);\n }\n return new Date(parsed).toISOString();\n}\n\nfunction parseOptionalDependencyString(value: string | undefined): string | undefined {\n if (value === undefined) return undefined;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\n/** Allowed CSV/markdown keys for the update `--dep` addition seed (GH-258). */\nconst DEP_ADDITION_KEYS = [\"id\", \"kind\", \"type\", \"author\", \"created_at\", \"source_kind\"] as const;\n/** Allowed CSV/markdown keys for the `--dep-remove` selector (GH-258). */\nconst DEP_REMOVE_KEYS = [\"id\", \"kind\", \"type\", \"source_kind\"] as const;\n\nfunction looksLikeStructuredDependencyEntry(raw: string): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n if (/^(?:[-*+]\\s+)?(?:id|kind|type|author|created_at|source_kind)\\s*[:=]/i.test(raw)) {\n return true;\n }\n // A first-key typo (e.g. `bogus=v,id=pm-2`) must still be parsed so the unknown\n // key is rejected rather than swallowed as a bare item id (GH-258).\n return looksLikeGenericKeyValueEntry(raw);\n}\n\n// pm-fl0c #4 (2026-05-28): `pm plan` accepts `depends_on` as a link kind\n// (`PLAN_STEP_LINK_KIND_VALUES`) but `pm update --dep kind=depends_on` rejected\n// it because `DEPENDENCY_KIND_VALUES` only lists `blocked_by`. The two terms\n// are semantically identical from this side (\"X depends on Y\" === \"X blocked\n// by Y\"), so we normalize input here rather than expanding the persisted enum\n// — the stored kind stays canonical (`blocked_by`) and downstream consumers\n// (closing logic, dependency graphs, blockers views) keep working unchanged.\nconst DEPENDENCY_KIND_INPUT_ALIASES: Readonly<Record<string, string>> = {\n \"blocked-by\": \"blocked_by\",\n depends_on: \"blocked_by\",\n \"depends-on\": \"blocked_by\",\n};\n\nfunction normalizeDependencyKindInput(raw: string | undefined): string | undefined {\n if (typeof raw !== \"string\") {\n return raw;\n }\n const trimmed = raw.trim();\n const alias = DEPENDENCY_KIND_INPUT_ALIASES[trimmed.toLowerCase()];\n return alias ?? trimmed;\n}\n\nfunction parseDependencyAdditions(raw: string[] | undefined, prefix: string, nowIso: string): ParsedDependencyUpdates {\n if (!raw) {\n return { additions: [] };\n }\n assertNoLegacyNoneTokens(raw, \"--dep\", \"Use --clear-deps to clear dependencies.\");\n const additions: Dependency[] = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredDependencyEntry(trimmedEntry);\n const kv = isStructured ? parseCsvKv(entry, \"--dep\") : { id: trimmedEntry, kind: \"related\" };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--dep\", DEP_ADDITION_KEYS);\n }\n const id = kv.id?.trim();\n const kind = normalizeDependencyKindInput((kv.kind ?? kv.type)?.trim());\n if (!id || !kind) {\n throw new PmCliError(\"--dep requires id and kind, or a bare item id to add a related dependency\", EXIT_CODE.USAGE);\n }\n if (id.toLowerCase() === \"undefined\") {\n throw new PmCliError(\n `--dep id must not use placeholder token \"${id}\". Use --clear-deps to clear dependencies.`,\n EXIT_CODE.USAGE,\n );\n }\n const sourceKind = parseOptionalDependencyString(kv.source_kind);\n return {\n id: normalizeItemId(id, prefix),\n kind: ensureEnum(kind, DEPENDENCY_KIND_VALUES, \"dependency kind\"),\n created_at: parseDependencyCreatedAt(kv.created_at, nowIso),\n author: parseOptionalDependencyString(kv.author),\n source_kind: sourceKind,\n };\n });\n return { additions };\n}\n\nfunction parseDependencyRemovals(raw: string[] | undefined, prefix: string): DependencyRemovalSelector[] {\n if (!raw) {\n return [];\n }\n assertNoLegacyNoneTokens(raw, \"--dep-remove\");\n return raw.map((entry) => {\n const trimmed = entry.trim();\n if (!trimmed) {\n throw new PmCliError(\"--dep-remove requires id or key/value selectors\", EXIT_CODE.USAGE);\n }\n if (trimmed.includes(\"=\") || /^(?:[-*+]\\s+)?(?:id|kind|type|source_kind)\\s*[:=]/i.test(trimmed) || trimmed.startsWith(\"```\")) {\n const kv = parseCsvKv(trimmed, \"--dep-remove\");\n assertNoUnknownCsvKeys(kv, \"--dep-remove\", DEP_REMOVE_KEYS);\n const idRaw = kv.id?.trim();\n if (!idRaw) {\n throw new PmCliError(\"--dep-remove key/value form requires id=<value>\", EXIT_CODE.USAGE);\n }\n if (idRaw.toLowerCase() === \"undefined\") {\n throw new PmCliError(`--dep-remove id must not use placeholder token \"${idRaw}\"`, EXIT_CODE.USAGE);\n }\n const kindRaw = normalizeDependencyKindInput(parseOptionalDependencyString(kv.kind ?? kv.type));\n const sourceKind = parseOptionalDependencyString(kv.source_kind);\n return {\n id: normalizeItemId(idRaw, prefix),\n kind: kindRaw ? ensureEnum(kindRaw, DEPENDENCY_KIND_VALUES, \"dependency kind\") : undefined,\n source_kind: sourceKind,\n };\n }\n if (trimmed.toLowerCase() === \"undefined\") {\n throw new PmCliError(`--dep-remove id must not use placeholder token \"${trimmed}\"`, EXIT_CODE.USAGE);\n }\n return {\n id: normalizeItemId(trimmed, prefix),\n };\n });\n}\n\nfunction dependencyKey(value: Pick<Dependency, \"id\" | \"kind\" | \"source_kind\">): string {\n return `${value.id}::${value.kind}::${value.source_kind ?? \"\"}`;\n}\n\n// pm-kyd6: `--blocked-by` writes the `blocked_by` scalar, but the dependency\n// graph (`pm deps`) is built only from the `dependencies` array. Mirror the\n// behaviour create.ts already has so the metadata and the graph agree: a\n// resolvable blocker also gets a `blocked_by` dependency edge, clearing the\n// scalar removes that edge, and re-pointing it replaces the prior edge.\nfunction reconcileBlockedByDependency(\n current: Dependency[] | undefined,\n nextBlockedById: string | undefined,\n nowIsoValue: string,\n author: string,\n): { dependencies: Dependency[] | undefined; changed: boolean } {\n let next = [...(current ?? [])];\n let changed = false;\n const filtered = next.filter((dep) => dep.kind !== \"blocked_by\" || dep.id === nextBlockedById);\n if (filtered.length !== next.length) {\n next = filtered;\n changed = true;\n }\n if (nextBlockedById && !next.some((dep) => dep.kind === \"blocked_by\" && dep.id === nextBlockedById)) {\n next.push({ id: nextBlockedById, kind: \"blocked_by\", created_at: nowIsoValue, author });\n changed = true;\n }\n if (!changed) {\n return { dependencies: current, changed: false };\n }\n return { dependencies: next.length > 0 ? next : undefined, changed: true };\n}\n\n// pm-kyd6: resolve the --blocked-by target before the synchronous mutate\n// callback so a real blocker can also become a `blocked_by` dependency edge.\n// `id` is set when the target resolves; `unresolved` carries the raw value when\n// --blocked-by points at an item that does not exist (the scalar is still set,\n// mirroring create.ts and the never-block missing-parent behaviour, but the\n// caller surfaces a warning so the metadata/graph mismatch is visible).\nasync function resolveBlockedByDependencyTarget(\n blockedByOption: string | undefined,\n blockedByCleared: boolean,\n pmRoot: string,\n idPrefix: string,\n itemFormat: ItemFormat,\n typeToFolder: Record<string, string>,\n): Promise<{ id?: string; unresolved?: string }> {\n if (blockedByOption === undefined || blockedByCleared) {\n return {};\n }\n const blockedByValue = blockedByOption.trim();\n if (blockedByValue.length === 0) {\n return {};\n }\n const located = await locateItem(pmRoot, normalizeItemId(blockedByValue, idPrefix), idPrefix, itemFormat, typeToFolder);\n return located ? { id: located.id } : { unresolved: blockedByValue };\n}\n\n// pm-kyd6: apply the reconciled blocked_by dependency edge to the item metadata\n// and record the `dependencies` change. Kept out of the mutate callback so the\n// large runUpdate function stays under the static-quality complexity budget.\nfunction applyBlockedByDependencyEdge(\n metadata: ItemFrontMatter,\n resolvedBlockedById: string | undefined,\n nowIsoValue: string,\n author: string,\n changedFields: string[],\n): void {\n const reconciled = reconcileBlockedByDependency(\n metadata.dependencies,\n resolvedBlockedById,\n nowIsoValue,\n author,\n );\n if (!reconciled.changed) {\n return;\n }\n if (reconciled.dependencies === undefined) {\n delete metadata.dependencies;\n } else {\n metadata.dependencies = reconciled.dependencies;\n }\n if (!changedFields.includes(\"dependencies\")) {\n changedFields.push(\"dependencies\");\n }\n}\n\nfunction fileKey(value: Pick<LinkedFile, \"path\" | \"scope\">): string {\n return `${value.path}::${value.scope}`;\n}\n\nfunction docKey(value: Pick<LinkedDoc, \"path\" | \"scope\">): string {\n return `${value.path}::${value.scope}`;\n}\n\nfunction testKey(value: Pick<LinkedTest, \"command\" | \"path\" | \"scope\" | \"pm_context_mode\">): string {\n return `${value.command}::${value.path ?? \"\"}::${value.scope}::${value.pm_context_mode ?? \"\"}`;\n}\n\nfunction matchesDependencySelector(value: Dependency, selector: DependencyRemovalSelector): boolean {\n if (value.id !== selector.id) {\n return false;\n }\n if (selector.kind && value.kind !== selector.kind) {\n return false;\n }\n if (selector.source_kind !== undefined && (value.source_kind ?? undefined) !== selector.source_kind) {\n return false;\n }\n return true;\n}\n\nfunction ensurePriority(raw: string | number): 0 | 1 | 2 | 3 | 4 {\n return resolvePriority(raw);\n}\n\nfunction normalizeUpdatePolicyOptionKey(raw: string, typeName: string): string {\n const canonical = canonicalizeCommandOptionKey(\"update\", raw);\n if (!canonical) {\n throw new PmCliError(\n `Unsupported command_option_policies option \"${raw}\" for update command on type \"${typeName}\"`,\n EXIT_CODE.CONFLICT,\n );\n }\n return canonical;\n}\n\nfunction collectProvidedUpdatePolicyOptions(options: UpdateCommandOptions, extensionFieldNames: readonly string[]): Set<string> {\n const provided = new Set<string>();\n const mark = (optionKey: string, isProvided: boolean): void => {\n if (isProvided) {\n provided.add(optionKey);\n }\n };\n mark(\"title\", options.title !== undefined);\n mark(\"description\", options.description !== undefined);\n mark(\"body\", options.body !== undefined);\n mark(\"status\", options.status !== undefined);\n mark(\"closeReason\", options.closeReason !== undefined);\n mark(\"priority\", options.priority !== undefined);\n mark(\"type\", options.type !== undefined);\n // `--add-tags` / `--remove-tags` mutate the same `tags` field as `--tags`, so\n // they count toward the `tags` command_option_policy (disabled + required).\n mark(\n \"tags\",\n options.tags !== undefined ||\n (Array.isArray(options.addTags) && options.addTags.length > 0) ||\n (Array.isArray(options.removeTags) && options.removeTags.length > 0),\n );\n mark(\"deadline\", options.deadline !== undefined);\n mark(\"estimatedMinutes\", options.estimatedMinutes !== undefined);\n mark(\"acceptanceCriteria\", options.acceptanceCriteria !== undefined);\n mark(\"definitionOfReady\", options.definitionOfReady !== undefined);\n mark(\"order\", options.order !== undefined || options.rank !== undefined);\n mark(\"goal\", options.goal !== undefined);\n mark(\"objective\", options.objective !== undefined);\n mark(\"value\", options.value !== undefined);\n mark(\"impact\", options.impact !== undefined);\n mark(\"outcome\", options.outcome !== undefined);\n mark(\"whyNow\", options.whyNow !== undefined);\n mark(\"author\", options.author !== undefined);\n mark(\"message\", options.message !== undefined);\n mark(\"assignee\", options.assignee !== undefined);\n mark(\"parent\", options.parent !== undefined);\n mark(\"reviewer\", options.reviewer !== undefined);\n mark(\"risk\", options.risk !== undefined);\n mark(\"confidence\", options.confidence !== undefined);\n mark(\"sprint\", options.sprint !== undefined);\n mark(\"release\", options.release !== undefined);\n mark(\"blockedBy\", options.blockedBy !== undefined);\n mark(\"blockedReason\", options.blockedReason !== undefined);\n mark(\"unblockNote\", options.unblockNote !== undefined);\n mark(\"reporter\", options.reporter !== undefined);\n mark(\"severity\", options.severity !== undefined);\n mark(\"environment\", options.environment !== undefined);\n mark(\"reproSteps\", options.reproSteps !== undefined);\n mark(\"resolution\", options.resolution !== undefined);\n mark(\"expectedResult\", options.expectedResult !== undefined);\n mark(\"actualResult\", options.actualResult !== undefined);\n mark(\"affectedVersion\", options.affectedVersion !== undefined);\n mark(\"fixedVersion\", options.fixedVersion !== undefined);\n mark(\"component\", options.component !== undefined);\n mark(\"regression\", options.regression !== undefined);\n mark(\"customerImpact\", options.customerImpact !== undefined);\n mark(\"dep\", options.dep !== undefined);\n mark(\"depRemove\", options.depRemove !== undefined);\n mark(\"dep\", options.replaceDeps === true);\n mark(\"comment\", options.comment !== undefined);\n mark(\"note\", options.note !== undefined);\n mark(\"learning\", options.learning !== undefined);\n mark(\"file\", options.file !== undefined);\n mark(\"test\", options.test !== undefined);\n mark(\"test\", options.replaceTests === true);\n mark(\"doc\", options.doc !== undefined);\n mark(\"reminder\", options.reminder !== undefined);\n mark(\"event\", options.event !== undefined);\n mark(\"typeOption\", options.typeOption !== undefined);\n mark(\"field\", options.field !== undefined);\n mark(\"force\", options.force === true);\n mark(\"allowAuditUpdate\", options.allowAuditUpdate === true);\n mark(\"dep\", options.clearDeps === true);\n mark(\"comment\", options.clearComments === true);\n mark(\"note\", options.clearNotes === true);\n mark(\"learning\", options.clearLearnings === true);\n mark(\"file\", options.clearFiles === true);\n mark(\"test\", options.clearTests === true);\n mark(\"doc\", options.clearDocs === true);\n mark(\"reminder\", options.clearReminders === true);\n mark(\"event\", options.clearEvents === true);\n mark(\"typeOption\", options.clearTypeOptions === true);\n if (options.unset && options.unset.length > 0) {\n const unsetTargets = parseUpdateUnsetTargets(options.unset, undefined, extensionFieldNames);\n for (const optionKey of unsetTargets.optionKeys) {\n mark(optionKey, true);\n }\n }\n return provided;\n}\n\nfunction enforceUpdateOptionsByType(\n typeName: string,\n options: UpdateCommandOptions,\n typeRegistry: ReturnType<typeof resolveItemTypeRegistry>,\n extensionFieldNames: readonly string[],\n): void {\n const typeDefinition = resolveTypeDefinition(typeName, typeRegistry);\n if (!typeDefinition) {\n throw new PmCliError(`Invalid type value \"${typeName}\"`, EXIT_CODE.USAGE);\n }\n const policyState = resolveCommandOptionPolicyState(typeDefinition, \"update\", []);\n if (policyState.errors.length > 0) {\n throw new PmCliError(policyState.errors.join(\"; \"), EXIT_CODE.CONFLICT);\n }\n\n const provided = collectProvidedUpdatePolicyOptions(options, extensionFieldNames);\n for (const disabled of policyState.disabled) {\n if (provided.has(normalizeUpdatePolicyOptionKey(disabled, typeName))) {\n throw new PmCliError(\n `Option ${commandOptionFlagLabel(\"update\", disabled)} is disabled for type \"${typeName}\" by command_option_policies`,\n EXIT_CODE.USAGE,\n );\n }\n }\n\n for (const required of policyState.required) {\n if (!provided.has(normalizeUpdatePolicyOptionKey(required, typeName))) {\n throw new PmCliError(\n `Missing required option ${commandOptionFlagLabel(\"update\", required)} for type \"${typeName}\"`,\n EXIT_CODE.USAGE,\n );\n }\n }\n}\n\ninterface UpdateScalarMutationContext {\n metadataRecord: Record<string, unknown>;\n clearFrontMatterKeys: ReadonlySet<string>;\n changedFields: string[];\n nowValue: Date;\n}\n\ninterface UpdateScalarMutationDefinition {\n optionKey: keyof UpdateCommandOptions;\n metadataKey: string;\n transform?: (value: string, context: UpdateScalarMutationContext) => unknown;\n}\n\nconst UPDATE_POST_TAG_SCALAR_MUTATIONS: ReadonlyArray<UpdateScalarMutationDefinition> = [\n {\n optionKey: \"deadline\",\n metadataKey: \"deadline\",\n transform: (value, context) => resolveIsoOrRelative(value, context.nowValue, \"deadline\"),\n },\n {\n optionKey: \"estimatedMinutes\",\n metadataKey: \"estimated_minutes\",\n transform: (value) => parseOptionalNumber(value, \"estimated-minutes\"),\n },\n { optionKey: \"acceptanceCriteria\", metadataKey: \"acceptance_criteria\", transform: (value) => value },\n { optionKey: \"definitionOfReady\", metadataKey: \"definition_of_ready\" },\n { optionKey: \"goal\", metadataKey: \"goal\" },\n { optionKey: \"objective\", metadataKey: \"objective\" },\n { optionKey: \"value\", metadataKey: \"value\" },\n { optionKey: \"impact\", metadataKey: \"impact\" },\n { optionKey: \"outcome\", metadataKey: \"outcome\" },\n { optionKey: \"whyNow\", metadataKey: \"why_now\" },\n];\n\nconst UPDATE_STAKEHOLDER_SCALAR_MUTATIONS: ReadonlyArray<UpdateScalarMutationDefinition> = [\n { optionKey: \"reviewer\", metadataKey: \"reviewer\" },\n { optionKey: \"risk\", metadataKey: \"risk\", transform: (value) => ensureEnum(normalizeRiskInput(value), RISK_VALUES, \"risk\") },\n { optionKey: \"confidence\", metadataKey: \"confidence\", transform: (value) => parseConfidenceInput(value) },\n];\n\nconst UPDATE_ISSUE_SCALAR_MUTATIONS: ReadonlyArray<UpdateScalarMutationDefinition> = [\n { optionKey: \"blockedReason\", metadataKey: \"blocked_reason\" },\n { optionKey: \"unblockNote\", metadataKey: \"unblock_note\" },\n { optionKey: \"reporter\", metadataKey: \"reporter\" },\n {\n optionKey: \"severity\",\n metadataKey: \"severity\",\n transform: (value) => ensureEnum(normalizeSeverityInput(value), ISSUE_SEVERITY_VALUES, \"severity\"),\n },\n { optionKey: \"environment\", metadataKey: \"environment\" },\n { optionKey: \"reproSteps\", metadataKey: \"repro_steps\" },\n { optionKey: \"resolution\", metadataKey: \"resolution\" },\n { optionKey: \"expectedResult\", metadataKey: \"expected_result\" },\n { optionKey: \"actualResult\", metadataKey: \"actual_result\" },\n { optionKey: \"affectedVersion\", metadataKey: \"affected_version\" },\n { optionKey: \"fixedVersion\", metadataKey: \"fixed_version\" },\n { optionKey: \"component\", metadataKey: \"component\" },\n { optionKey: \"regression\", metadataKey: \"regression\", transform: (value) => parseRegressionInput(value) },\n { optionKey: \"customerImpact\", metadataKey: \"customer_impact\" },\n];\n\nfunction applyUpdateScalarMutations(\n definitions: ReadonlyArray<UpdateScalarMutationDefinition>,\n options: UpdateCommandOptions,\n context: UpdateScalarMutationContext,\n): void {\n for (const definition of definitions) {\n const optionValue = options[definition.optionKey];\n const shouldClear = context.clearFrontMatterKeys.has(definition.metadataKey);\n if (optionValue === undefined && !shouldClear) {\n continue;\n }\n if (shouldClear) {\n delete context.metadataRecord[definition.metadataKey];\n context.changedFields.push(definition.metadataKey);\n continue;\n }\n if (typeof optionValue !== \"string\") {\n throw new PmCliError(\n `${commandOptionFlagLabel(\"update\", String(definition.optionKey))} must be a string value`,\n EXIT_CODE.USAGE,\n );\n }\n context.metadataRecord[definition.metadataKey] = definition.transform\n ? definition.transform(optionValue, context)\n : optionValue.trim();\n context.changedFields.push(definition.metadataKey);\n }\n}\n\n/**\n * Implements run update for the public runtime surface of this module.\n */\nexport async function runUpdate(id: string, options: UpdateCommandOptions, global: GlobalOptions): Promise<UpdateResult> {\n const stdinResolver = createStdinTokenResolver();\n options = normalizeLegacyNoneUpdateOptions({\n ...options,\n body: await stdinResolver.resolveValue(options.body, \"--body\"),\n dep: await stdinResolver.resolveList(options.dep, \"--dep\"),\n depRemove: await stdinResolver.resolveList(options.depRemove, \"--dep-remove\"),\n comment: await stdinResolver.resolveList(options.comment, \"--comment\"),\n note: await stdinResolver.resolveList(options.note, \"--note\"),\n learning: await stdinResolver.resolveList(options.learning, \"--learning\"),\n file: await stdinResolver.resolveList(options.file, \"--file\"),\n test: await stdinResolver.resolveList(options.test, \"--test\"),\n doc: await stdinResolver.resolveList(options.doc, \"--doc\"),\n reminder: await stdinResolver.resolveList(options.reminder, \"--reminder\"),\n event: await stdinResolver.resolveList(options.event, \"--event\"),\n typeOption: await stdinResolver.resolveList(options.typeOption, \"--type-option\"),\n field: await stdinResolver.resolveList(options.field, \"--field\"),\n });\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n const extensionRegistrations = getActiveExtensionRegistrations();\n const extensionFieldNames = collectRegisteredItemFieldNames(extensionRegistrations);\n const typeRegistry = resolveItemTypeRegistry(settings, extensionRegistrations);\n // Per-type allowed-transition enforcement is read RAW (not preset-derived) so\n // existing projects are unaffected when unset; defaults to \"off\".\n const workflowEnforcement: GovernanceWorkflowEnforcement = settings.governance.workflow_enforcement ?? \"off\";\n const typeWorkflows = workflowEnforcement === \"off\" ? [] : resolveTypeWorkflows(settings.schema);\n const parentReferencePolicy = settings.validation.parent_reference;\n const sprintReleasePolicy = settings.validation.sprint_release_format;\n const unsetTargets = parseUpdateUnsetTargets(options.unset, runtimeFieldRegistry, extensionFieldNames);\n const clearOptionKeys = new Set<string>(unsetTargets.optionKeys);\n const clearFrontMatterKeys = new Set<string>(unsetTargets.frontMatterKeys);\n\n const clearCollectionDefinitions: ReadonlyArray<{\n enabled: boolean | undefined;\n optionKey: string;\n clearFlag: string;\n valueFlag: string;\n values: string[] | undefined;\n frontMatterKey: string;\n }> = [\n {\n enabled: options.clearDeps || options.replaceDeps,\n optionKey: \"dep\",\n clearFlag: \"--clear-deps\",\n valueFlag: \"--dep\",\n values: options.dep,\n frontMatterKey: \"dependencies\",\n },\n {\n enabled: options.clearComments,\n optionKey: \"comment\",\n clearFlag: \"--clear-comments\",\n valueFlag: \"--comment\",\n values: options.comment,\n frontMatterKey: \"comments\",\n },\n {\n enabled: options.clearNotes,\n optionKey: \"note\",\n clearFlag: \"--clear-notes\",\n valueFlag: \"--note\",\n values: options.note,\n frontMatterKey: \"notes\",\n },\n {\n enabled: options.clearLearnings,\n optionKey: \"learning\",\n clearFlag: \"--clear-learnings\",\n valueFlag: \"--learning\",\n values: options.learning,\n frontMatterKey: \"learnings\",\n },\n {\n enabled: options.clearFiles,\n optionKey: \"file\",\n clearFlag: \"--clear-files\",\n valueFlag: \"--file\",\n values: options.file,\n frontMatterKey: \"files\",\n },\n {\n enabled: options.clearTests || options.replaceTests,\n optionKey: \"test\",\n clearFlag: \"--clear-tests\",\n valueFlag: \"--test\",\n values: options.test,\n frontMatterKey: \"tests\",\n },\n {\n enabled: options.clearDocs,\n optionKey: \"doc\",\n clearFlag: \"--clear-docs\",\n valueFlag: \"--doc\",\n values: options.doc,\n frontMatterKey: \"docs\",\n },\n {\n enabled: options.clearReminders,\n optionKey: \"reminder\",\n clearFlag: \"--clear-reminders\",\n valueFlag: \"--reminder\",\n values: options.reminder,\n frontMatterKey: \"reminders\",\n },\n {\n enabled: options.clearEvents,\n optionKey: \"event\",\n clearFlag: \"--clear-events\",\n valueFlag: \"--event\",\n values: options.event,\n frontMatterKey: \"events\",\n },\n {\n enabled: options.clearTypeOptions,\n optionKey: \"typeOption\",\n clearFlag: \"--clear-type-options\",\n valueFlag: \"--type-option\",\n values: options.typeOption,\n frontMatterKey: \"type_options\",\n },\n ];\n if (options.replaceDeps === true && (options.dep === undefined || options.dep.length === 0)) {\n throw new PmCliError(\"--replace-deps requires at least one --dep entry\", EXIT_CODE.USAGE);\n }\n if (options.replaceDeps === true && options.depRemove !== undefined && options.depRemove.length > 0) {\n throw new PmCliError(\"--replace-deps cannot be combined with --dep-remove\", EXIT_CODE.USAGE);\n }\n if (options.replaceTests === true && (options.test === undefined || options.test.length === 0)) {\n throw new PmCliError(\"--replace-tests requires at least one --test entry\", EXIT_CODE.USAGE);\n }\n if (options.replaceTests === true && options.clearTests === true) {\n throw new PmCliError(\"--replace-tests cannot be combined with --clear-tests\", EXIT_CODE.USAGE);\n }\n for (const definition of clearCollectionDefinitions) {\n if (!definition.enabled) {\n continue;\n }\n if (\n definition.values &&\n definition.values.length > 0 &&\n !(\n (definition.optionKey === \"dep\" && options.replaceDeps === true) ||\n (definition.optionKey === \"test\" && options.replaceTests === true)\n )\n ) {\n throw new PmCliError(`Cannot combine ${definition.clearFlag} with ${definition.valueFlag}`, EXIT_CODE.USAGE);\n }\n clearOptionKeys.add(definition.optionKey);\n clearFrontMatterKeys.add(definition.frontMatterKey);\n }\n enforceAllowAuditUpdateScope(id, options, clearFrontMatterKeys);\n\n const scalarOptionPresence: Record<string, boolean> = {\n tags: options.tags !== undefined,\n closeReason: options.closeReason !== undefined,\n deadline: options.deadline !== undefined,\n estimatedMinutes: options.estimatedMinutes !== undefined,\n acceptanceCriteria: options.acceptanceCriteria !== undefined,\n definitionOfReady: options.definitionOfReady !== undefined,\n order: options.order !== undefined || options.rank !== undefined,\n goal: options.goal !== undefined,\n objective: options.objective !== undefined,\n value: options.value !== undefined,\n impact: options.impact !== undefined,\n outcome: options.outcome !== undefined,\n whyNow: options.whyNow !== undefined,\n assignee: options.assignee !== undefined,\n parent: options.parent !== undefined,\n reviewer: options.reviewer !== undefined,\n risk: options.risk !== undefined,\n confidence: options.confidence !== undefined,\n sprint: options.sprint !== undefined,\n release: options.release !== undefined,\n blockedBy: options.blockedBy !== undefined,\n blockedReason: options.blockedReason !== undefined,\n unblockNote: options.unblockNote !== undefined,\n reporter: options.reporter !== undefined,\n severity: options.severity !== undefined,\n environment: options.environment !== undefined,\n reproSteps: options.reproSteps !== undefined,\n resolution: options.resolution !== undefined,\n expectedResult: options.expectedResult !== undefined,\n actualResult: options.actualResult !== undefined,\n affectedVersion: options.affectedVersion !== undefined,\n fixedVersion: options.fixedVersion !== undefined,\n component: options.component !== undefined,\n regression: options.regression !== undefined,\n customerImpact: options.customerImpact !== undefined,\n };\n for (const [optionKey, hasValue] of Object.entries(scalarOptionPresence)) {\n if (!hasValue || !unsetTargets.optionKeys.has(optionKey)) {\n continue;\n }\n const unsetField = UPDATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey;\n throw new PmCliError(\n `Cannot combine --unset ${unsetField} with ${commandOptionFlagLabel(\"update\", optionKey)}`,\n EXIT_CODE.USAGE,\n );\n }\n // `--add-tags`/`--remove-tags` aren't in the scalar presence map above (they\n // are repeatable), but combining them with `--unset tags` is the same\n // contradiction as `--unset tags --tags ...`, so reject it explicitly.\n if (clearFrontMatterKeys.has(\"tags\")) {\n if (Array.isArray(options.addTags) && options.addTags.length > 0) {\n throw new PmCliError(\"Cannot combine --unset tags with --add-tags\", EXIT_CODE.USAGE);\n }\n if (Array.isArray(options.removeTags) && options.removeTags.length > 0) {\n throw new PmCliError(\"Cannot combine --unset tags with --remove-tags\", EXIT_CODE.USAGE);\n }\n }\n\n const assertNoLegacyScalarToken = (value: string | undefined, optionKey: string): void => {\n const unsetField = UPDATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey);\n const hint = unsetField ? `Use --unset ${unsetField} to clear this field.` : undefined;\n assertNoLegacyNoneToken(value, commandOptionFlagLabel(\"update\", optionKey), hint);\n };\n assertNoLegacyScalarToken(options.tags, \"tags\");\n assertNoLegacyScalarToken(options.closeReason, \"closeReason\");\n assertNoLegacyScalarToken(options.deadline, \"deadline\");\n assertNoLegacyScalarToken(options.estimatedMinutes, \"estimatedMinutes\");\n assertNoLegacyScalarToken(options.acceptanceCriteria, \"acceptanceCriteria\");\n assertNoLegacyScalarToken(options.definitionOfReady, \"definitionOfReady\");\n assertNoLegacyScalarToken(options.order ?? options.rank, \"order\");\n assertNoLegacyScalarToken(options.goal, \"goal\");\n assertNoLegacyScalarToken(options.objective, \"objective\");\n assertNoLegacyScalarToken(options.value, \"value\");\n assertNoLegacyScalarToken(options.impact, \"impact\");\n assertNoLegacyScalarToken(options.outcome, \"outcome\");\n assertNoLegacyScalarToken(options.whyNow, \"whyNow\");\n assertNoLegacyScalarToken(options.assignee, \"assignee\");\n assertNoLegacyScalarToken(options.parent, \"parent\");\n assertNoLegacyScalarToken(options.reviewer, \"reviewer\");\n assertNoLegacyScalarToken(options.risk, \"risk\");\n assertNoLegacyScalarToken(options.confidence, \"confidence\");\n assertNoLegacyScalarToken(options.sprint, \"sprint\");\n assertNoLegacyScalarToken(options.release, \"release\");\n assertNoLegacyScalarToken(options.blockedBy, \"blockedBy\");\n assertNoLegacyScalarToken(options.blockedReason, \"blockedReason\");\n assertNoLegacyScalarToken(options.unblockNote, \"unblockNote\");\n assertNoLegacyScalarToken(options.reporter, \"reporter\");\n assertNoLegacyScalarToken(options.severity, \"severity\");\n assertNoLegacyScalarToken(options.environment, \"environment\");\n assertNoLegacyScalarToken(options.reproSteps, \"reproSteps\");\n assertNoLegacyScalarToken(options.resolution, \"resolution\");\n assertNoLegacyScalarToken(options.expectedResult, \"expectedResult\");\n assertNoLegacyScalarToken(options.actualResult, \"actualResult\");\n assertNoLegacyScalarToken(options.affectedVersion, \"affectedVersion\");\n assertNoLegacyScalarToken(options.fixedVersion, \"fixedVersion\");\n assertNoLegacyScalarToken(options.component, \"component\");\n assertNoLegacyScalarToken(options.regression, \"regression\");\n assertNoLegacyScalarToken(options.customerImpact, \"customerImpact\");\n assertNoLegacyNoneTokens(options.reminder, \"--reminder\", \"Use --clear-reminders to clear reminders.\");\n assertNoLegacyNoneTokens(options.event, \"--event\", \"Use --clear-events to clear linked events.\");\n\n const author = toAuthor(options.author, settings.author_default);\n const nowValue = new Date();\n const nowIso = nowValue.toISOString();\n const dependencyUpdates = parseDependencyAdditions(options.dep, settings.id_prefix, nowIso);\n const dependencyRemovals = parseDependencyRemovals(options.depRemove, settings.id_prefix);\n const parsedCommentUpdates = parseLogSeed(\"--comment\", options.comment, nowIso, author);\n const commentUpdates = options.allowAuditUpdate === true && parsedCommentUpdates.values\n ? {\n ...parsedCommentUpdates,\n values: parsedCommentUpdates.values.map((entry) => ({ ...entry, author })),\n }\n : parsedCommentUpdates;\n const noteUpdates = parseLogSeed(\"--note\", options.note, nowIso, author);\n const learningUpdates = parseLogSeed(\"--learning\", options.learning, nowIso, author);\n const fileUpdates = parseFiles(options.file);\n const testUpdates = parseTests(options.test);\n const docUpdates = parseDocs(options.doc);\n const parentReferenceWarnings: string[] = [];\n const workflowTransitionWarnings: string[] = [];\n let resolvedParentValue: string | undefined;\n if (options.parent !== undefined && !unsetTargets.frontMatterKeys.has(\"parent\")) {\n resolvedParentValue = normalizeParentReferenceValue(options.parent);\n const parentLocated = await locateItem(\n pmRoot,\n resolvedParentValue,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!parentLocated) {\n const normalizedParentId = normalizeItemId(resolvedParentValue, settings.id_prefix);\n parentReferenceWarnings.push(...validateMissingParentReference(normalizedParentId, parentReferencePolicy).warnings);\n }\n }\n\n // pm-kyd6: resolve the --blocked-by target up front (async) so the sync\n // mutate callback can mirror create.ts and add a `blocked_by` dependency edge.\n const blockedByResolution = await resolveBlockedByDependencyTarget(\n options.blockedBy,\n clearFrontMatterKeys.has(\"blocked_by\"),\n pmRoot,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n const resolvedBlockedByDependencyId = blockedByResolution.id;\n if (blockedByResolution.unresolved !== undefined) {\n parentReferenceWarnings.push(`blocked_by_unresolved:${blockedByResolution.unresolved}`);\n }\n\n const runtimeFieldUpdates = collectRuntimeUpdateFieldValues(\n options as Record<string, unknown>,\n runtimeFieldRegistry,\n options.runtimeFieldCommands,\n );\n const fieldFlags: Record<string, boolean> = {\n title: options.title !== undefined,\n description: options.description !== undefined,\n body: options.body !== undefined,\n status: options.status !== undefined,\n closeReason: options.closeReason !== undefined,\n priority: options.priority !== undefined,\n type: options.type !== undefined,\n tags: options.tags !== undefined,\n addTags: Array.isArray(options.addTags) && options.addTags.length > 0,\n removeTags: Array.isArray(options.removeTags) && options.removeTags.length > 0,\n deadline: options.deadline !== undefined,\n estimatedMinutes: options.estimatedMinutes !== undefined,\n acceptanceCriteria: options.acceptanceCriteria !== undefined,\n definitionOfReady: options.definitionOfReady !== undefined,\n order: options.order !== undefined,\n rank: options.rank !== undefined,\n goal: options.goal !== undefined,\n objective: options.objective !== undefined,\n value: options.value !== undefined,\n impact: options.impact !== undefined,\n outcome: options.outcome !== undefined,\n whyNow: options.whyNow !== undefined,\n assignee: options.assignee !== undefined,\n parent: options.parent !== undefined,\n reviewer: options.reviewer !== undefined,\n risk: options.risk !== undefined,\n confidence: options.confidence !== undefined,\n sprint: options.sprint !== undefined,\n release: options.release !== undefined,\n blockedBy: options.blockedBy !== undefined,\n blockedReason: options.blockedReason !== undefined,\n unblockNote: options.unblockNote !== undefined,\n reporter: options.reporter !== undefined,\n severity: options.severity !== undefined,\n environment: options.environment !== undefined,\n reproSteps: options.reproSteps !== undefined,\n resolution: options.resolution !== undefined,\n expectedResult: options.expectedResult !== undefined,\n actualResult: options.actualResult !== undefined,\n affectedVersion: options.affectedVersion !== undefined,\n fixedVersion: options.fixedVersion !== undefined,\n component: options.component !== undefined,\n regression: options.regression !== undefined,\n customerImpact: options.customerImpact !== undefined,\n dep: options.dep !== undefined,\n depRemove: options.depRemove !== undefined,\n replaceDeps: options.replaceDeps === true,\n comment: options.comment !== undefined,\n note: options.note !== undefined,\n learning: options.learning !== undefined,\n file: options.file !== undefined,\n test: options.test !== undefined,\n replaceTests: options.replaceTests === true,\n doc: options.doc !== undefined,\n reminder: options.reminder !== undefined,\n event: options.event !== undefined,\n typeOption: options.typeOption !== undefined,\n field: options.field !== undefined,\n unset: options.unset !== undefined && options.unset.length > 0,\n clearDeps: options.clearDeps === true,\n clearComments: options.clearComments === true,\n clearNotes: options.clearNotes === true,\n clearLearnings: options.clearLearnings === true,\n clearFiles: options.clearFiles === true,\n clearTests: options.clearTests === true,\n clearDocs: options.clearDocs === true,\n clearReminders: options.clearReminders === true,\n clearEvents: options.clearEvents === true,\n clearTypeOptions: options.clearTypeOptions === true,\n runtimeFields: Object.keys(runtimeFieldUpdates).length > 0,\n };\n const changedFlags = Object.values(fieldFlags).some(Boolean);\n\n if (!changedFlags) {\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const { document } = await readLocatedItem(located, { schema: settings.schema });\n return {\n item: toItemRecord(document.metadata),\n changed_fields: [],\n warnings: [\"noop_no_update_fields\"],\n };\n }\n\n // Per-type allowed-transition enforcement runs BEFORE the close-reroute so a\n // transition toward the close status is gated too. We read the item's current\n // status + type once (only when enforcement is active and --status is set) so\n // the default `off` path adds zero extra work. A `strict` violation throws; a\n // `warn` violation surfaces a warning on the result.\n if (workflowEnforcement !== \"off\" && typeWorkflows.length > 0 && fieldFlags.status && options.status !== undefined) {\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const { document } = await readLocatedItem(located, { schema: settings.schema });\n // When this update also changes --type, gate the transition against the\n // EFFECTIVE (post-update) type, so a combined --type/--status change can't\n // bypass a target-type rule (or be wrongly blocked by the pre-update type's\n // rule that will no longer apply). Falls back to the raw value when --type is\n // unresolved; the later type resolution surfaces an invalid-type error.\n const effectiveType =\n options.type !== undefined\n ? (resolveTypeName(options.type, typeRegistry) ?? options.type)\n : (document.metadata?.type ?? \"\");\n const warning = enforceTypeWorkflowTransition({\n enforcement: workflowEnforcement,\n typeWorkflows,\n statusRegistry,\n typeName: effectiveType,\n fromStatus: document.metadata?.status ?? \"\",\n toStatus: options.status ?? \"\",\n });\n if (warning) {\n workflowTransitionWarnings.push(warning);\n }\n }\n\n // `pm update --status <close_status>` always routes to the auditable close\n // workflow so agents are never blocked by close-through-update errors. Any\n // other field updates in the same call are applied first, then the item is\n // closed with the supplied --close-reason (or a derived default when omitted).\n if (fieldFlags.status) {\n const targetStatus = normalizeStatusInput(options.status as ItemStatus, statusRegistry);\n if (targetStatus === statusRegistry.close_status) {\n const otherFieldKeys = Object.entries(fieldFlags)\n .filter(([key, value]) => value && key !== \"status\" && key !== \"closeReason\")\n .map(([key]) => key);\n\n const routeWarnings: string[] = [];\n let preChangedFields: string[] = [];\n if (otherFieldKeys.length > 0) {\n const preUpdate = await runUpdate(\n id,\n { ...options, status: undefined, closeReason: undefined, message: undefined },\n global,\n );\n preChangedFields = preUpdate.changed_fields;\n routeWarnings.push(...preUpdate.warnings);\n }\n\n const explicitReason = typeof options.closeReason === \"string\" ? options.closeReason.trim() : \"\";\n const fallbackMessage = typeof options.message === \"string\" ? options.message.trim() : \"\";\n const closeReason = explicitReason || fallbackMessage || \"Closed via pm update\";\n // Only flag a defaulted reason when neither --close-reason nor --message\n // supplied any text and we had to invent the generic placeholder.\n const reasonDefaulted = explicitReason.length === 0 && fallbackMessage.length === 0;\n\n const closeResult = await runClose(\n id,\n closeReason,\n {\n author: options.author,\n message: options.message,\n force: options.force,\n },\n global,\n );\n\n const warnings = [\n ...workflowTransitionWarnings,\n ...routeWarnings,\n ...closeResult.warnings,\n \"auto_routed_from_update_to_close\",\n ];\n if (reasonDefaulted) {\n warnings.push(\"close_reason_defaulted\");\n }\n return {\n item: closeResult.item,\n changed_fields: [...preChangedFields, ...closeResult.changed_fields],\n warnings,\n };\n }\n }\n if (options.order !== undefined && options.rank !== undefined && options.order !== options.rank) {\n throw new PmCliError(\"--order and --rank must match when both are provided\", EXIT_CODE.USAGE);\n }\n\n const result = await mutateItem({\n pmRoot,\n settings,\n typeToFolder: typeRegistry.type_to_folder,\n id,\n op: options.allowAuditUpdate === true || options.allowAuditDepUpdate === true ? \"update_audit\" : \"update\",\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: options.allowAuditUpdate === true || options.allowAuditDepUpdate === true,\n extensionFieldNames,\n mutate(document) {\n const changedFields: string[] = [];\n const warnings: string[] = [];\n let activeTypeName = resolveTypeName(document.metadata.type, typeRegistry) ?? document.metadata.type;\n\n // Declarative set-or-clear helpers for the many string scalar fields that\n // share an identical shape: set from `--flag` (optionally transformed) or\n // delete when `--unset <field>` was requested, then record the change.\n // Each call is placed in the same position the inline block occupied so\n // the order of `changedFields` is preserved exactly (pm-why9).\n const metadataRecord = toItemRecord(document.metadata);\n const scalarMutationContext: UpdateScalarMutationContext = {\n metadataRecord,\n clearFrontMatterKeys,\n changedFields,\n nowValue,\n };\n\n if (options.title !== undefined) {\n document.metadata.title = options.title;\n changedFields.push(\"title\");\n }\n if (options.description !== undefined) {\n document.metadata.description = options.description;\n changedFields.push(\"description\");\n }\n if (options.body !== undefined) {\n document.body = options.body;\n changedFields.push(\"body\");\n }\n const previousStatus = document.metadata.status;\n const previousStatusNormalized = normalizeStatusInput(previousStatus, statusRegistry) ?? previousStatus;\n if (options.status !== undefined) {\n // Close-status routing (with reason + audit) is handled before mutateItem\n // by the close gate above, so only non-close transitions reach this path.\n const status = parseStatus(options.status, statusRegistry);\n document.metadata.status = status;\n if (status === statusRegistry.canceled_status) {\n delete document.metadata.assignee;\n }\n changedFields.push(\"status\");\n }\n if (options.closeReason !== undefined || clearFrontMatterKeys.has(\"close_reason\")) {\n if (clearFrontMatterKeys.has(\"close_reason\")) {\n delete document.metadata.close_reason;\n } else {\n const closeReason = options.closeReason?.trim() ?? \"\";\n if (closeReason.length === 0) {\n throw new PmCliError(\"--close-reason must not be empty\", EXIT_CODE.USAGE);\n }\n document.metadata.close_reason = closeReason;\n }\n changedFields.push(\"close_reason\");\n } else if (\n options.status !== undefined &&\n previousStatusNormalized === statusRegistry.close_status &&\n document.metadata.status !== statusRegistry.canceled_status &&\n document.metadata.close_reason !== undefined\n ) {\n delete document.metadata.close_reason;\n changedFields.push(\"close_reason\");\n }\n if (options.priority !== undefined) {\n document.metadata.priority = ensurePriority(options.priority);\n changedFields.push(\"priority\");\n }\n if (options.type !== undefined) {\n const resolvedTypeName = resolveTypeName(options.type, typeRegistry);\n if (!resolvedTypeName) {\n throw new PmCliError(\n buildInvalidTypeError(options.type, typeRegistry.types, resolveItemTypesFilePath(pmRoot, settings.schema)),\n EXIT_CODE.USAGE,\n );\n }\n document.metadata.type = resolvedTypeName;\n activeTypeName = resolvedTypeName;\n changedFields.push(\"type\");\n }\n enforceUpdateOptionsByType(activeTypeName, options, typeRegistry, extensionFieldNames);\n if (options.typeOption !== undefined || clearFrontMatterKeys.has(\"type_options\")) {\n if (clearFrontMatterKeys.has(\"type_options\")) {\n delete document.metadata.type_options;\n } else {\n const parsedTypeOptions = parseTypeOptionEntries(options.typeOption ?? []);\n const validation = validateTypeOptions(activeTypeName, parsedTypeOptions, typeRegistry);\n if (validation.errors.length > 0) {\n throw new PmCliError(validation.errors.join(\"; \"), EXIT_CODE.USAGE);\n }\n document.metadata.type_options = validation.normalized;\n }\n changedFields.push(\"type_options\");\n } else if (options.type !== undefined && document.metadata.type_options !== undefined) {\n const validation = validateTypeOptions(activeTypeName, document.metadata.type_options, typeRegistry);\n if (validation.errors.length > 0) {\n throw new PmCliError(\n `Current type options are incompatible with type \"${activeTypeName}\". ${validation.errors.join(\"; \")}. Use --clear-type-options to clear them.`,\n EXIT_CODE.USAGE,\n );\n }\n document.metadata.type_options = validation.normalized;\n }\n if (options.dep !== undefined || options.depRemove !== undefined || clearFrontMatterKeys.has(\"dependencies\")) {\n let nextDependencies = clearFrontMatterKeys.has(\"dependencies\") ? [] : [...(document.metadata.dependencies ?? [])];\n if (dependencyUpdates.additions.length > 0) {\n const seen = new Set(nextDependencies.map((entry) => dependencyKey(entry)));\n for (const addition of dependencyUpdates.additions) {\n const key = dependencyKey(addition);\n if (seen.has(key)) {\n continue;\n }\n nextDependencies.push(addition);\n seen.add(key);\n }\n }\n if (dependencyRemovals.length > 0) {\n nextDependencies = nextDependencies.filter(\n (entry) => !dependencyRemovals.some((selector) => matchesDependencySelector(entry, selector)),\n );\n }\n if (nextDependencies.length === 0) {\n delete document.metadata.dependencies;\n } else {\n document.metadata.dependencies = nextDependencies;\n }\n changedFields.push(\"dependencies\");\n }\n if (options.comment !== undefined || clearFrontMatterKeys.has(\"comments\")) {\n if (clearFrontMatterKeys.has(\"comments\") || !commentUpdates.values || commentUpdates.values.length === 0) {\n delete document.metadata.comments;\n } else {\n document.metadata.comments = [...(document.metadata.comments ?? []), ...(commentUpdates.values as Comment[])];\n }\n changedFields.push(\"comments\");\n }\n if (options.note !== undefined || clearFrontMatterKeys.has(\"notes\")) {\n if (clearFrontMatterKeys.has(\"notes\") || !noteUpdates.values || noteUpdates.values.length === 0) {\n delete document.metadata.notes;\n } else {\n document.metadata.notes = [...(document.metadata.notes ?? []), ...(noteUpdates.values as LogNote[])];\n }\n changedFields.push(\"notes\");\n }\n if (options.learning !== undefined || clearFrontMatterKeys.has(\"learnings\")) {\n if (clearFrontMatterKeys.has(\"learnings\") || !learningUpdates.values || learningUpdates.values.length === 0) {\n delete document.metadata.learnings;\n } else {\n document.metadata.learnings = [...(document.metadata.learnings ?? []), ...(learningUpdates.values as LogNote[])];\n }\n changedFields.push(\"learnings\");\n }\n if (options.file !== undefined || clearFrontMatterKeys.has(\"files\")) {\n if (clearFrontMatterKeys.has(\"files\") || !fileUpdates.values || fileUpdates.values.length === 0) {\n delete document.metadata.files;\n } else {\n const nextFiles = [...(document.metadata.files ?? [])];\n const seen = new Set(nextFiles.map((entry) => fileKey(entry)));\n for (const entry of fileUpdates.values) {\n const key = fileKey(entry);\n if (seen.has(key)) {\n continue;\n }\n nextFiles.push(entry);\n seen.add(key);\n }\n document.metadata.files = nextFiles;\n }\n changedFields.push(\"files\");\n }\n if (options.test !== undefined || clearFrontMatterKeys.has(\"tests\")) {\n if (clearFrontMatterKeys.has(\"tests\") && options.replaceTests === true) {\n if (!testUpdates.values || testUpdates.values.length === 0) {\n delete document.metadata.tests;\n } else {\n const replacementTests: LinkedTest[] = [];\n const seen = new Set<string>();\n for (const entry of testUpdates.values) {\n const key = testKey(entry);\n if (seen.has(key)) {\n continue;\n }\n replacementTests.push(entry);\n seen.add(key);\n }\n document.metadata.tests = replacementTests;\n }\n } else if (clearFrontMatterKeys.has(\"tests\") || !testUpdates.values || testUpdates.values.length === 0) {\n delete document.metadata.tests;\n } else {\n const nextTests = [...(document.metadata.tests ?? [])];\n const seen = new Set(nextTests.map((entry) => testKey(entry)));\n for (const entry of testUpdates.values) {\n const key = testKey(entry);\n if (seen.has(key)) {\n continue;\n }\n nextTests.push(entry);\n seen.add(key);\n }\n document.metadata.tests = nextTests;\n }\n changedFields.push(\"tests\");\n }\n if (options.doc !== undefined || clearFrontMatterKeys.has(\"docs\")) {\n if (clearFrontMatterKeys.has(\"docs\") || !docUpdates.values || docUpdates.values.length === 0) {\n delete document.metadata.docs;\n } else {\n const nextDocs = [...(document.metadata.docs ?? [])];\n const seen = new Set(nextDocs.map((entry) => docKey(entry)));\n for (const entry of docUpdates.values) {\n const key = docKey(entry);\n if (seen.has(key)) {\n continue;\n }\n nextDocs.push(entry);\n seen.add(key);\n }\n document.metadata.docs = nextDocs;\n }\n changedFields.push(\"docs\");\n }\n const addTagsValues = options.addTags;\n const removeTagsValues = options.removeTags;\n const hasAdditiveTagMutation =\n (Array.isArray(addTagsValues) && addTagsValues.length > 0) ||\n (Array.isArray(removeTagsValues) && removeTagsValues.length > 0);\n if (options.tags !== undefined || clearFrontMatterKeys.has(\"tags\") || hasAdditiveTagMutation) {\n const baseTags = clearFrontMatterKeys.has(\"tags\")\n ? []\n : options.tags !== undefined\n ? parseTags(options.tags)\n : Array.isArray(document.metadata.tags)\n ? [...(document.metadata.tags as string[])]\n : [];\n const withAdditions = mergeAdditiveTags(baseTags, addTagsValues);\n const finalTags = applyTagRemovals(withAdditions, removeTagsValues);\n document.metadata.tags = finalTags;\n changedFields.push(\"tags\");\n }\n applyUpdateScalarMutations(UPDATE_POST_TAG_SCALAR_MUTATIONS, options, scalarMutationContext);\n const orderRaw = options.order ?? options.rank;\n if (orderRaw !== undefined || clearFrontMatterKeys.has(\"order\")) {\n if (clearFrontMatterKeys.has(\"order\")) {\n delete document.metadata.order;\n } else {\n const parsedOrder = parseOptionalNumber(orderRaw ?? \"\", \"order\");\n if (!Number.isInteger(parsedOrder)) {\n throw new PmCliError(\"Order must be an integer\", EXIT_CODE.USAGE);\n }\n document.metadata.order = parsedOrder;\n }\n changedFields.push(\"order\");\n }\n if (options.assignee !== undefined || clearFrontMatterKeys.has(\"assignee\")) {\n if (clearFrontMatterKeys.has(\"assignee\")) {\n delete document.metadata.assignee;\n } else {\n const assignee = options.assignee?.trim() ?? \"\";\n if (assignee === \"\") {\n throw new PmCliError(\"--assignee must not be empty. Use --unset assignee to clear it.\", EXIT_CODE.USAGE);\n }\n document.metadata.assignee = assignee;\n }\n changedFields.push(\"assignee\");\n }\n if (options.parent !== undefined || clearFrontMatterKeys.has(\"parent\")) {\n if (clearFrontMatterKeys.has(\"parent\")) {\n delete document.metadata.parent;\n } else {\n document.metadata.parent = resolvedParentValue ?? \"\";\n }\n changedFields.push(\"parent\");\n }\n applyUpdateScalarMutations(UPDATE_STAKEHOLDER_SCALAR_MUTATIONS, options, scalarMutationContext);\n if (options.sprint !== undefined || clearFrontMatterKeys.has(\"sprint\")) {\n if (clearFrontMatterKeys.has(\"sprint\")) {\n delete document.metadata.sprint;\n } else {\n const sprintValidation = validateSprintOrReleaseValue(\"sprint\", options.sprint ?? \"\", sprintReleasePolicy);\n document.metadata.sprint = sprintValidation.value;\n warnings.push(...sprintValidation.warnings);\n }\n changedFields.push(\"sprint\");\n }\n if (options.release !== undefined || clearFrontMatterKeys.has(\"release\")) {\n if (clearFrontMatterKeys.has(\"release\")) {\n delete document.metadata.release;\n } else {\n const releaseValidation = validateSprintOrReleaseValue(\"release\", options.release ?? \"\", sprintReleasePolicy);\n document.metadata.release = releaseValidation.value;\n warnings.push(...releaseValidation.warnings);\n }\n changedFields.push(\"release\");\n }\n if (options.blockedBy !== undefined || clearFrontMatterKeys.has(\"blocked_by\")) {\n if (clearFrontMatterKeys.has(\"blocked_by\")) {\n delete document.metadata.blocked_by;\n } else {\n document.metadata.blocked_by = options.blockedBy?.trim() ?? \"\";\n }\n changedFields.push(\"blocked_by\");\n // pm-kyd6: keep the dependency graph in sync with the blocked_by scalar.\n applyBlockedByDependencyEdge(\n document.metadata,\n resolvedBlockedByDependencyId,\n nowIso,\n author,\n changedFields,\n );\n }\n applyUpdateScalarMutations(UPDATE_ISSUE_SCALAR_MUTATIONS, options, scalarMutationContext);\n if (options.reminder !== undefined || clearFrontMatterKeys.has(\"reminders\")) {\n if (clearFrontMatterKeys.has(\"reminders\")) {\n delete document.metadata.reminders;\n } else {\n document.metadata.reminders = parseReminderEntries(options.reminder ?? [], nowValue, { valueMode: \"trimmed\" });\n }\n changedFields.push(\"reminders\");\n }\n if (options.event !== undefined || clearFrontMatterKeys.has(\"events\")) {\n if (clearFrontMatterKeys.has(\"events\")) {\n delete document.metadata.events;\n } else {\n document.metadata.events = parseEventEntries(options.event ?? [], nowValue, {\n allDayEmptyGuard: \"truthy\",\n recurrenceEmptyNumericGuard: \"truthy\",\n });\n }\n changedFields.push(\"events\");\n }\n\n for (const definition of runtimeFieldRegistry.definitions) {\n if (!clearFrontMatterKeys.has(definition.metadata_key)) {\n continue;\n }\n if (metadataRecord[definition.metadata_key] === undefined) {\n continue;\n }\n delete metadataRecord[definition.metadata_key];\n changedFields.push(definition.metadata_key);\n }\n\n for (const fieldKey of extensionFieldNames) {\n if (!clearFrontMatterKeys.has(fieldKey)) {\n continue;\n }\n if (metadataRecord[fieldKey] === undefined) {\n continue;\n }\n delete metadataRecord[fieldKey];\n changedFields.push(fieldKey);\n }\n\n for (const [fieldKey, fieldValue] of Object.entries(runtimeFieldUpdates)) {\n if (clearFrontMatterKeys.has(fieldKey)) {\n continue;\n }\n if (stableValueEquals(metadataRecord[fieldKey], fieldValue)) {\n continue;\n }\n metadataRecord[fieldKey] = fieldValue;\n changedFields.push(fieldKey);\n }\n\n const registeredItemFieldUpdates = parseRegisteredItemFieldAssignments(options.field, extensionRegistrations);\n for (const fieldKey of Object.keys(registeredItemFieldUpdates)) {\n if (!clearFrontMatterKeys.has(fieldKey)) {\n continue;\n }\n throw new PmCliError(\n `Cannot combine --unset ${fieldKey.replaceAll(\"_\", \"-\")} with --field ${fieldKey}=...`,\n EXIT_CODE.USAGE,\n );\n }\n for (const [fieldKey, fieldValue] of Object.entries(registeredItemFieldUpdates)) {\n if (stableValueEquals(metadataRecord[fieldKey], fieldValue)) {\n continue;\n }\n metadataRecord[fieldKey] = fieldValue;\n changedFields.push(fieldKey);\n }\n\n try {\n applyRegisteredItemFieldDefaultsAndValidation(\n metadataRecord,\n extensionRegistrations,\n { skipDefaultFields: clearFrontMatterKeys },\n );\n } catch (error: unknown) {\n throw new PmCliError(error instanceof Error ? error.message : \"Invalid extension item field values\", EXIT_CODE.USAGE);\n }\n\n return { changedFields, warnings };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n warnings: [...workflowTransitionWarnings, ...parentReferenceWarnings, ...result.warnings],\n ...(options.allowAuditUpdate === true || options.allowAuditDepUpdate === true ? { audit_update: true } : {}),\n };\n}\n\n/* c8 ignore stop */\nexport const _testOnlyUpdateCommand = {\n collectProvidedUpdatePolicyOptions,\n buildAuditScopeRestrictedOptionsError,\n enforceAllowAuditUpdateScope,\n enforceTypeWorkflowTransition,\n matchesDependencySelector,\n normalizeLegacyNoneUpdateOptions,\n normalizeUpdatePolicyOptionKey,\n parseDependencyAdditions,\n parseDependencyRemovals,\n parseUpdateUnsetTargets,\n reconcileBlockedByDependency,\n resolveRuntimeUnsetDefinition: (token: string, registry: RuntimeFieldRegistry | undefined) =>\n resolveRuntimeUnsetFieldDefinition(token, \"update\", registry),\n};\n"],"names":["disallowedFlags"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8MA,IAAM,iCAAyE;EAC7E,GAAG;EACH,EAAE,WAAW,gBAAgB,SAAS,CAAC,gBAAgB,cAAc,GAAG,WAAW,eAAe,gBAAgB,eAAc;EAChI,GAAG;EACH,GAAG;;AAGL,IAAM,0BAAmE,MAAK;AAC5E,QAAM,MAAM,oBAAI,IAAG;AACnB,aAAW,cAAc,gCAAgC;AACvD,eAAW,SAAS,WAAW,SAAS;AACtC,UAAI,IAAI,OAAO;QACb,WAAW,WAAW;QACtB,gBAAgB,WAAW;OAC5B;IACH;EACF;AACA,SAAO;AACT,GAAE;AAEF,IAAM,uCAAuC,IAAI,IAC/C,+BAA+B,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