@unbrained/pm-cli 2026.6.13 → 2026.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +102 -0
- package/README.md +1 -1
- package/dist/cli/bootstrap-args.d.ts +29 -0
- package/dist/cli/bootstrap-args.js +11 -4
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.d.ts +12 -0
- package/dist/cli/commander-usage.js +18 -7
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.d.ts +19 -0
- package/dist/cli/commands/activity.js +12 -2
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +58 -0
- package/dist/cli/commands/aggregate.js +48 -15
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +6 -1
- package/dist/cli/commands/annotation-command.js +72 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/append.js +4 -3
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/close-many.d.ts +20 -0
- package/dist/cli/commands/close-many.js +14 -23
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +37 -4
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +3 -2
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +2 -0
- package/dist/cli/commands/comments.js +49 -23
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +362 -15
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +51 -1
- package/dist/cli/commands/config.js +50 -12
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +79 -1
- package/dist/cli/commands/context.js +151 -25
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +80 -1
- package/dist/cli/commands/contracts.js +54 -4
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +51 -0
- package/dist/cli/commands/create.js +137 -18
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.d.ts +33 -0
- package/dist/cli/commands/dedupe-audit.js +18 -14
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/deps.js +7 -4
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.js +3 -3
- package/dist/cli/commands/event-validation-messages.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +7 -0
- package/dist/cli/commands/extension/bundled-catalog.js +19 -15
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +41 -1
- package/dist/cli/commands/extension/install-sources.js +26 -8
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +5 -0
- package/dist/cli/commands/extension/shared.js +9 -3
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +133 -1
- package/dist/cli/commands/extension.js +127 -9
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.d.ts +30 -1
- package/dist/cli/commands/files.js +21 -2
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/focus.d.ts +11 -0
- package/dist/cli/commands/focus.js +86 -0
- package/dist/cli/commands/focus.js.map +1 -0
- package/dist/cli/commands/get.d.ts +9 -2
- package/dist/cli/commands/get.js +34 -6
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/guide.d.ts +5 -0
- package/dist/cli/commands/guide.js +6 -3
- package/dist/cli/commands/guide.js.map +1 -1
- package/dist/cli/commands/health.d.ts +109 -0
- package/dist/cli/commands/health.js +87 -35
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +27 -36
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +46 -0
- package/dist/cli/commands/history-redact.js +99 -67
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +34 -37
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/history.js +6 -2
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +4 -1
- package/dist/cli/commands/index.js +6 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +54 -0
- package/dist/cli/commands/init-agent-guidance.js +31 -4
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +38 -2
- package/dist/cli/commands/init.js +50 -64
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +4 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/lifecycle-transitions.d.ts +23 -0
- package/dist/cli/commands/lifecycle-transitions.js +41 -0
- package/dist/cli/commands/lifecycle-transitions.js.map +1 -0
- package/dist/cli/commands/linked-artifacts.d.ts +5 -0
- package/dist/cli/commands/linked-artifacts.js +18 -4
- package/dist/cli/commands/linked-artifacts.js.map +1 -1
- package/dist/cli/commands/linked-test-parsers.d.ts +5 -0
- package/dist/cli/commands/linked-test-parsers.js +5 -2
- package/dist/cli/commands/linked-test-parsers.js.map +1 -1
- package/dist/cli/commands/list-filter-shared.d.ts +8 -0
- package/dist/cli/commands/list-filter-shared.js +70 -0
- package/dist/cli/commands/list-filter-shared.js.map +1 -0
- package/dist/cli/commands/list.d.ts +116 -0
- package/dist/cli/commands/list.js +194 -6
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +16 -2
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +4 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.js +3 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.d.ts +9 -0
- package/dist/cli/commands/recurrence-parsers.js +19 -2
- package/dist/cli/commands/recurrence-parsers.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +83 -0
- package/dist/cli/commands/reindex.js +45 -10
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/repeatable-metadata-parsers.js +28 -4
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +40 -1
- package/dist/cli/commands/restore.js +27 -2
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/scheduling-shortcuts.d.ts +43 -0
- package/dist/cli/commands/scheduling-shortcuts.js +87 -0
- package/dist/cli/commands/scheduling-shortcuts.js.map +1 -0
- package/dist/cli/commands/schema.d.ts +152 -2
- package/dist/cli/commands/schema.js +510 -4
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +289 -1
- package/dist/cli/commands/search.js +367 -60
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +38 -0
- package/dist/cli/commands/stats.js +38 -10
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.js +5 -3
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +18 -0
- package/dist/cli/commands/templates.js +9 -2
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.d.ts +5 -0
- package/dist/cli/commands/test-all.js +9 -3
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +70 -1
- package/dist/cli/commands/test.js +84 -3
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.d.ts +34 -1
- package/dist/cli/commands/update-many.js +60 -31
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +71 -0
- package/dist/cli/commands/update.js +91 -11
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +28 -1
- package/dist/cli/commands/upgrade.js +17 -4
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +114 -0
- package/dist/cli/commands/validate.js +153 -8
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +30 -0
- package/dist/cli/error-guidance.js +41 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-options.js +9 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +8 -0
- package/dist/cli/help-content.js +54 -6
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +19 -1
- package/dist/cli/help-json-payload.js +16 -7
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +242 -0
- package/dist/cli/main.js +241 -45
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +62 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +16 -0
- package/dist/cli/register-mutation.js +376 -100
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.d.ts +8 -0
- package/dist/cli/register-operations.js +134 -11
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +9 -6
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +124 -38
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-PZYSZA26.js +18 -0
- package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js → activity-SFM4THAU.js} +13 -11
- package/dist/cli-bundle/chunks/{aggregate-IRHJWEKG.js → aggregate-Y5ADDKBM.js} +55 -26
- package/dist/cli-bundle/chunks/aggregate-Y5ADDKBM.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-XEBW22UQ.js → aggregate-YTAUQLRW.js} +54 -25
- package/dist/cli-bundle/chunks/aggregate-YTAUQLRW.js.map +7 -0
- package/dist/cli-bundle/chunks/{append-NL67JNJU.js → append-4M7OVV7M.js} +11 -11
- package/dist/cli-bundle/chunks/append-4M7OVV7M.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-N2AWXKZC.js → append-HSPK4L4V.js} +10 -10
- package/dist/cli-bundle/chunks/{append-N2AWXKZC.js.map → append-HSPK4L4V.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js → chunk-26BM6YLO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js → chunk-2C6FU3D3.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js.map → chunk-2C6FU3D3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQDKAEKG.js → chunk-2OPYLXDO.js} +117 -37
- package/dist/cli-bundle/chunks/chunk-2OPYLXDO.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4ZKKZMLH.js → chunk-2S46FKLB.js} +104 -30
- package/dist/cli-bundle/chunks/chunk-2S46FKLB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js → chunk-2TMKMTEI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js → chunk-2VH7DFSJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RHYBR6G7.js → chunk-3ENF4NO4.js} +74 -14
- package/dist/cli-bundle/chunks/chunk-3ENF4NO4.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js +404 -0
- package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AAUYXSFF.js → chunk-3R3FYCBV.js} +223 -50
- package/dist/cli-bundle/chunks/chunk-3R3FYCBV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5HSAHRYA.js → chunk-3UKJX3RP.js} +82 -21
- package/dist/cli-bundle/chunks/chunk-3UKJX3RP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js +83 -0
- package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UCVJP4JL.js → chunk-5FDYWOJT.js} +52 -8
- package/dist/cli-bundle/chunks/chunk-5FDYWOJT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js → chunk-5XGWFUW2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LYNQ3NGI.js → chunk-6BD77FGL.js} +309 -20
- package/dist/cli-bundle/chunks/chunk-6BD77FGL.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js +35 -0
- package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-36BCSMKP.js → chunk-6HF6CIY2.js} +26 -11
- package/dist/cli-bundle/chunks/chunk-6HF6CIY2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-M3SI2REU.js → chunk-6PBPD4MN.js} +322 -19
- package/dist/cli-bundle/chunks/chunk-6PBPD4MN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TSXWFN3L.js → chunk-6VFUEGOA.js} +53 -9
- package/dist/cli-bundle/chunks/chunk-6VFUEGOA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2J2AH4V5.js → chunk-AAOXSPAE.js} +56 -72
- package/dist/cli-bundle/chunks/chunk-AAOXSPAE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js → chunk-AJCQ5GT6.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js +61 -0
- package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KHGTYCJ6.js → chunk-AOJQL33L.js} +83 -22
- package/dist/cli-bundle/chunks/chunk-AOJQL33L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js → chunk-AXLDUGXA.js} +7 -4
- package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js.map → chunk-AXLDUGXA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js → chunk-BITCVGHT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js → chunk-CGQTFWYI.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LFW5NQUP.js → chunk-CHM2VFVL.js} +407 -290
- package/dist/cli-bundle/chunks/chunk-CHM2VFVL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js → chunk-COVLE33A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SGMGMCIF.js → chunk-DDNBWH4W.js} +157 -25
- package/dist/cli-bundle/chunks/chunk-DDNBWH4W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js → chunk-F5MSD5HE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6TBR5AZ2.js → chunk-FAXB6F6R.js} +76 -8
- package/dist/cli-bundle/chunks/chunk-FAXB6F6R.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L6YQONLM.js → chunk-FPDK5BZQ.js} +18 -19
- package/dist/cli-bundle/chunks/chunk-FPDK5BZQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AGG32LKL.js → chunk-FPY2TOFI.js} +480 -24
- package/dist/cli-bundle/chunks/chunk-FPY2TOFI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JWXTOYBI.js → chunk-G2MOUCTU.js} +121 -44
- package/dist/cli-bundle/chunks/chunk-G2MOUCTU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3VULHQNS.js → chunk-G57RHEGP.js} +36 -18
- package/dist/cli-bundle/chunks/chunk-G57RHEGP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QQG4HEX7.js → chunk-IROHIK2T.js} +37 -63
- package/dist/cli-bundle/chunks/chunk-IROHIK2T.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js → chunk-JZHL4E3Q.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XXLMJDUB.js → chunk-KA22USXD.js} +21 -22
- package/dist/cli-bundle/chunks/chunk-KA22USXD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WLH7X4RN.js → chunk-KBC4O7SY.js} +56 -72
- package/dist/cli-bundle/chunks/chunk-KBC4O7SY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js → chunk-KCAGIH6K.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BVL5KGVA.js → chunk-KO3VM5GS.js} +27 -12
- package/dist/cli-bundle/chunks/chunk-KO3VM5GS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IXVSSHGV.js → chunk-LNH5Q32E.js} +13 -8
- package/dist/cli-bundle/chunks/chunk-LNH5Q32E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js → chunk-LORM3M2I.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js.map → chunk-LORM3M2I.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-PNYAAB4S.js → chunk-LWGMDLQ6.js} +8 -3
- package/dist/cli-bundle/chunks/chunk-LWGMDLQ6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js → chunk-M4AVU7VC.js} +19 -8
- package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js.map → chunk-M4AVU7VC.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js → chunk-MIBX6ZRN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AUDDXKNX.js → chunk-MMF2E3FM.js} +77 -9
- package/dist/cli-bundle/chunks/chunk-MMF2E3FM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RFR2YQGO.js → chunk-MORZOR7W.js} +21 -8
- package/dist/cli-bundle/chunks/chunk-MORZOR7W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4TPFXE2R.js → chunk-MUTUZ2HD.js} +118 -74
- package/dist/cli-bundle/chunks/chunk-MUTUZ2HD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HZOX5BYD.js → chunk-OGXEBTX3.js} +35 -17
- package/dist/cli-bundle/chunks/chunk-OGXEBTX3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js → chunk-OOIH6J5T.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js.map → chunk-OOIH6J5T.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VNC2HBL4.js → chunk-OSBJPPX3.js} +20 -9
- package/dist/cli-bundle/chunks/chunk-OSBJPPX3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2ANTZBYF.js → chunk-PJS3WDO2.js} +122 -45
- package/dist/cli-bundle/chunks/chunk-PJS3WDO2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7SM7VA5I.js → chunk-QGPE2H6Z.js} +19 -8
- package/dist/cli-bundle/chunks/chunk-QGPE2H6Z.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js +58 -0
- package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js → chunk-QW2F6ARZ.js} +8 -5
- package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js.map → chunk-QW2F6ARZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TOX7YQ7X.js → chunk-QXC3LWB7.js} +223 -50
- package/dist/cli-bundle/chunks/chunk-QXC3LWB7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-W6KNFAMZ.js → chunk-QXMXRPX5.js} +9 -8
- package/dist/cli-bundle/chunks/chunk-QXMXRPX5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js → chunk-R4AKUPKI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js.map → chunk-R4AKUPKI.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-RASR23HV.js +394 -0
- package/dist/cli-bundle/chunks/chunk-RASR23HV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JW7D6437.js → chunk-SCDCNGCV.js} +20 -9
- package/dist/cli-bundle/chunks/chunk-SCDCNGCV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js → chunk-SCS5PVAA.js} +10 -9
- package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js.map → chunk-SCS5PVAA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-S2CDTRJ6.js → chunk-SJCMTOEU.js} +381 -271
- package/dist/cli-bundle/chunks/chunk-SJCMTOEU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js → chunk-SO2ES46D.js} +11 -10
- package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js.map → chunk-SO2ES46D.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MACCNKSZ.js → chunk-TBV33CB4.js} +36 -62
- package/dist/cli-bundle/chunks/chunk-TBV33CB4.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js +86 -0
- package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js → chunk-TWBDDVIF.js} +20 -7
- package/dist/cli-bundle/chunks/chunk-TWBDDVIF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4JHJ7YG2.js → chunk-UGUJ2UOR.js} +118 -74
- package/dist/cli-bundle/chunks/chunk-UGUJ2UOR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js → chunk-UN6P3IJ4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-32XSW44C.js → chunk-V2GYOMEX.js} +10 -9
- package/dist/cli-bundle/chunks/chunk-V2GYOMEX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HWHONML5.js → chunk-VF3KQGNY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SOHXUA2Q.js → chunk-VHG6LUKR.js} +116 -36
- package/dist/cli-bundle/chunks/chunk-VHG6LUKR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7CRFV6JR.js → chunk-VXHMQDXA.js} +483 -27
- package/dist/cli-bundle/chunks/chunk-VXHMQDXA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IZHCCG4S.js → chunk-VXRFAE7W.js} +14 -9
- package/dist/cli-bundle/chunks/chunk-VXRFAE7W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-R4VWYWRN.js → chunk-W3HFLORZ.js} +7 -2
- package/dist/cli-bundle/chunks/chunk-W3HFLORZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4FHLNNW7.js → chunk-WQRL4COW.js} +74 -14
- package/dist/cli-bundle/chunks/chunk-WQRL4COW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js +32 -0
- package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MGAQ6KZG.js → chunk-XESAPVZ4.js} +166 -27
- package/dist/cli-bundle/chunks/chunk-XESAPVZ4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PEH7SZD2.js → chunk-YLAW3FZN.js} +105 -31
- package/dist/cli-bundle/chunks/chunk-YLAW3FZN.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js → claim-WGAWJCPY.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js → claim-ZI6P4LMU.js} +10 -10
- package/dist/cli-bundle/chunks/close-I7PRQ5G7.js +13 -0
- package/dist/cli-bundle/chunks/{close-SPUFW5QR.js → close-JMVVSIQE.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-GKAJX54X.js → close-many-IKPJXVOZ.js} +32 -20
- package/dist/cli-bundle/chunks/close-many-IKPJXVOZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-GL6NRUU5.js → close-many-TXABDCSJ.js} +31 -19
- package/dist/cli-bundle/chunks/close-many-TXABDCSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-5FPT6L7N.js → comments-RLWR2S7W.js} +55 -31
- package/dist/cli-bundle/chunks/comments-RLWR2S7W.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-TOLOYWNI.js → comments-YAMXKHUX.js} +54 -30
- package/dist/cli-bundle/chunks/comments-YAMXKHUX.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-7N6D7YJE.js → config-7ICYC2WU.js} +83 -19
- package/dist/cli-bundle/chunks/config-7ICYC2WU.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-4MN45TIH.js → config-NGWN3EXC.js} +83 -19
- package/dist/cli-bundle/chunks/config-NGWN3EXC.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-AQSLE7DZ.js → context-K6QAHN5H.js} +128 -39
- package/dist/cli-bundle/chunks/context-K6QAHN5H.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-U3PUJMVN.js → context-VGXOOAH2.js} +127 -38
- package/dist/cli-bundle/chunks/context-VGXOOAH2.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-ITSJXO3O.js → contracts-KJGY2AQA.js} +99 -15
- package/dist/cli-bundle/chunks/contracts-KJGY2AQA.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-H7KCQXLY.js → contracts-KMA6OJY7.js} +99 -15
- package/dist/cli-bundle/chunks/contracts-KMA6OJY7.js.map +7 -0
- package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js → copy-Q2PPU4AY.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-C4W522JM.js → copy-SC6UF3PI.js} +7 -7
- package/dist/cli-bundle/chunks/{create-4EQNELMY.js → create-76FE7JVF.js} +16 -13
- package/dist/cli-bundle/chunks/create-RTRFW6RE.js +30 -0
- package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js → delete-T6DJSUJI.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js → delete-XFUX533E.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js → deps-5GWMMS6D.js} +9 -10
- package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js.map → deps-5GWMMS6D.js.map} +2 -2
- package/dist/cli-bundle/chunks/{deps-HV2C2L46.js → deps-MCCU633S.js} +10 -11
- package/dist/cli-bundle/chunks/deps-MCCU633S.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js → docs-HE3HCQ4S.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-RJQPLROO.js → docs-SXMOABHR.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js → extension-E23K4QRR.js} +7 -5
- package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js → extension-PMD3XMLN.js} +7 -5
- package/dist/cli-bundle/chunks/{files-OIFN3DQX.js → files-2RSWGPEU.js} +25 -11
- package/dist/cli-bundle/chunks/files-2RSWGPEU.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-LIFDKNCN.js → files-ZWFJFWBK.js} +24 -10
- package/dist/cli-bundle/chunks/files-ZWFJFWBK.js.map +7 -0
- package/dist/cli-bundle/chunks/focus-KTTB3P3F.js +106 -0
- package/dist/cli-bundle/chunks/focus-KTTB3P3F.js.map +1 -0
- package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js +109 -0
- package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js.map +7 -0
- package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js → gc-BXIAKLAH.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js → gc-C7K6JNUO.js} +3 -3
- package/dist/cli-bundle/chunks/{get-SAB7CRBG.js → get-AZQLC4NO.js} +43 -16
- package/dist/cli-bundle/chunks/get-AZQLC4NO.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-K7UULTQF.js → get-I65HTAWO.js} +42 -15
- package/dist/cli-bundle/chunks/get-I65HTAWO.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-NUVZYIEV.js → health-3MFFPQVZ.js} +75 -49
- package/dist/cli-bundle/chunks/health-3MFFPQVZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-VJWH3ZFK.js → health-MYZEOCLI.js} +74 -48
- package/dist/cli-bundle/chunks/health-MYZEOCLI.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-GYFD2DJW.js → history-73Z6OBFZ.js} +10 -10
- package/dist/cli-bundle/chunks/history-BIPHVUMF.js +20 -0
- package/dist/cli-bundle/chunks/{history-compact-WQZQ6KXM.js → history-compact-24VQ63A3.js} +37 -46
- package/dist/cli-bundle/chunks/history-compact-24VQ63A3.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-SLL6ESXH.js → history-compact-UIAR2OI4.js} +38 -47
- package/dist/cli-bundle/chunks/history-compact-UIAR2OI4.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js → history-redact-7YCXEWJD.js} +13 -11
- package/dist/cli-bundle/chunks/history-redact-WZZ6GZ2Z.js +21 -0
- package/dist/cli-bundle/chunks/{history-repair-BJCGM6Q3.js → history-repair-4NOFFG2W.js} +44 -49
- package/dist/cli-bundle/chunks/history-repair-4NOFFG2W.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-UCYS55ZX.js → history-repair-GQN2X4TR.js} +43 -48
- package/dist/cli-bundle/chunks/history-repair-GQN2X4TR.js.map +7 -0
- package/dist/cli-bundle/chunks/init-K34V4PZR.js +20 -0
- package/dist/cli-bundle/chunks/{init-MXV57LKL.js → init-TDEDNVMM.js} +12 -9
- package/dist/cli-bundle/chunks/{learnings-QKJOKEAO.js → learnings-TV2CTGJ3.js} +13 -12
- package/dist/cli-bundle/chunks/learnings-TV2CTGJ3.js.map +7 -0
- package/dist/cli-bundle/chunks/{learnings-L6KTZGOT.js → learnings-U67FTXPB.js} +14 -13
- package/dist/cli-bundle/chunks/learnings-U67FTXPB.js.map +1 -0
- package/dist/cli-bundle/chunks/list-MSHYOCFU.js +33 -0
- package/dist/cli-bundle/chunks/list-VV57WGUD.js +29 -0
- package/dist/cli-bundle/chunks/{notes-HMCB7TK6.js → notes-EUANWWKD.js} +13 -12
- package/dist/cli-bundle/chunks/notes-EUANWWKD.js.map +7 -0
- package/dist/cli-bundle/chunks/{notes-3NLK7WTZ.js → notes-GYVNDAL4.js} +14 -13
- package/dist/cli-bundle/chunks/notes-GYVNDAL4.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-NANUWH4T.js → plan-4LF4AV63.js} +15 -14
- package/dist/cli-bundle/chunks/plan-4LF4AV63.js.map +7 -0
- package/dist/cli-bundle/chunks/{plan-DWBYI5C6.js → plan-W27O6DBS.js} +16 -15
- package/dist/cli-bundle/chunks/plan-W27O6DBS.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-SMMMLSWW.js → register-list-query-BXLEHJ7L.js} +32 -23
- package/dist/cli-bundle/chunks/register-list-query-BXLEHJ7L.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-PWQ5F2VI.js → register-list-query-C2MS3BVQ.js} +31 -22
- package/dist/cli-bundle/chunks/register-list-query-C2MS3BVQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-QKFPTIZG.js → register-mutation-6UCOEQ6L.js} +361 -106
- package/dist/cli-bundle/chunks/register-mutation-6UCOEQ6L.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-ZYJQ4DVP.js → register-mutation-HE73PREP.js} +355 -107
- package/dist/cli-bundle/chunks/register-mutation-HE73PREP.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-2FMZ6WEF.js → register-operations-L6C32FDA.js} +111 -39
- package/dist/cli-bundle/chunks/register-operations-L6C32FDA.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-BAFQURZG.js → register-operations-QQEHEX4P.js} +112 -40
- package/dist/cli-bundle/chunks/register-operations-QQEHEX4P.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-QN2XV7UL.js → register-setup-A7N4PNT3.js} +18 -21
- package/dist/cli-bundle/chunks/register-setup-A7N4PNT3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-DQEIKBIP.js → register-setup-WHG3NBP6.js} +17 -20
- package/dist/cli-bundle/chunks/register-setup-WHG3NBP6.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js → restore-TSWSULYY.js} +13 -11
- package/dist/cli-bundle/chunks/restore-XQXICL3V.js +19 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js +91 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js.map +7 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js +88 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js.map +1 -0
- package/dist/cli-bundle/chunks/{schema-ZZ7ZDM2X.js → schema-7U7JUYGK.js} +797 -10
- package/dist/cli-bundle/chunks/schema-7U7JUYGK.js.map +1 -0
- package/dist/cli-bundle/chunks/{schema-RNVJ55V2.js → schema-TSBYSEMW.js} +810 -9
- package/dist/cli-bundle/chunks/schema-TSBYSEMW.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-BJ457C2A.js → search-OXLSQKHP.js} +328 -71
- package/dist/cli-bundle/chunks/search-OXLSQKHP.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-FQDZXX7P.js → search-T3TOFLOQ.js} +328 -71
- package/dist/cli-bundle/chunks/search-T3TOFLOQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-DUQWCVOS.js → stats-5CLG22YZ.js} +41 -16
- package/dist/cli-bundle/chunks/stats-5CLG22YZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{stats-CUG3ZHOI.js → stats-XEMUXS42.js} +42 -17
- package/dist/cli-bundle/chunks/stats-XEMUXS42.js.map +1 -0
- package/dist/cli-bundle/chunks/{telemetry-RK2VX75A.js → telemetry-23OPBBZT.js} +7 -7
- package/dist/cli-bundle/chunks/telemetry-23OPBBZT.js.map +1 -0
- package/dist/cli-bundle/chunks/{telemetry-33MRGX4Z.js → telemetry-I3D7XZ55.js} +6 -6
- package/dist/cli-bundle/chunks/telemetry-I3D7XZ55.js.map +7 -0
- package/dist/cli-bundle/chunks/test-AROS3LIV.js +35 -0
- package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js → test-CECIMKOA.js} +17 -14
- package/dist/cli-bundle/chunks/{test-all-ARSMX33Q.js → test-all-4DEQPIXH.js} +25 -17
- package/dist/cli-bundle/chunks/test-all-4DEQPIXH.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-all-ANYQ33O2.js → test-all-6RO6X3SM.js} +24 -16
- package/dist/cli-bundle/chunks/test-all-6RO6X3SM.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-runs-5URSD34O.js → test-runs-AAXVFWKH.js} +62 -65
- package/dist/cli-bundle/chunks/test-runs-AAXVFWKH.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-XNACGSNQ.js → test-runs-LYBQSYRC.js} +61 -64
- package/dist/cli-bundle/chunks/test-runs-LYBQSYRC.js.map +7 -0
- package/dist/cli-bundle/chunks/update-MIWEJC76.js +24 -0
- package/dist/cli-bundle/chunks/update-P7I5YSRB.js +28 -0
- package/dist/cli-bundle/chunks/{update-many-724JCVDE.js → update-many-5B4HLVBK.js} +79 -33
- package/dist/cli-bundle/chunks/update-many-5B4HLVBK.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-many-6B7PJ33I.js → update-many-G2QOVZSB.js} +80 -34
- package/dist/cli-bundle/chunks/update-many-G2QOVZSB.js.map +1 -0
- package/dist/cli-bundle/chunks/{upgrade-QHRGDBSA.js → upgrade-GFIDL62L.js} +23 -9
- package/dist/cli-bundle/chunks/upgrade-GFIDL62L.js.map +1 -0
- package/dist/cli-bundle/chunks/{upgrade-ALBEZAI7.js → upgrade-QUQYL7D3.js} +22 -8
- package/dist/cli-bundle/chunks/upgrade-QUQYL7D3.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-UY6DRCG5.js → validate-ADDZBMM3.js} +236 -30
- package/dist/cli-bundle/chunks/validate-ADDZBMM3.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-IQRYFXIV.js → validate-MAS3H6ZP.js} +222 -30
- package/dist/cli-bundle/chunks/validate-MAS3H6ZP.js.map +1 -0
- package/dist/cli-bundle/main.js +312 -139
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +21 -8
- package/dist/cli.js.map +1 -1
- package/dist/core/config/nested-settings.js +40 -2
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +7 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-policy.js +14 -15
- package/dist/core/extensions/extension-policy.js.map +1 -1
- package/dist/core/extensions/item-fields.js +4 -5
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +75 -1
- package/dist/core/extensions/loader.js +56 -32
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/governance/content-fields.d.ts +84 -0
- package/dist/core/governance/content-fields.js +182 -0
- package/dist/core/governance/content-fields.js.map +1 -0
- package/dist/core/governance/issue-codes.d.ts +51 -0
- package/dist/core/governance/issue-codes.js +95 -0
- package/dist/core/governance/issue-codes.js.map +1 -0
- package/dist/core/governance/metadata-coverage.d.ts +168 -0
- package/dist/core/governance/metadata-coverage.js +362 -0
- package/dist/core/governance/metadata-coverage.js.map +1 -0
- package/dist/core/history/history-rewrite.d.ts +22 -0
- package/dist/core/history/history-rewrite.js +38 -2
- package/dist/core/history/history-rewrite.js.map +1 -1
- package/dist/core/history/history.d.ts +7 -0
- package/dist/core/history/history.js +6 -2
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/io/body-file.d.ts +14 -0
- package/dist/core/io/body-file.js +47 -0
- package/dist/core/io/body-file.js.map +1 -0
- package/dist/core/item/item-format.d.ts +46 -1
- package/dist/core/item/item-format.js +51 -60
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/parse.d.ts +41 -0
- package/dist/core/item/parse.js +69 -16
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/type-registry.d.ts +1 -0
- package/dist/core/item/type-registry.js +8 -10
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/lock.d.ts +26 -0
- package/dist/core/lock/lock.js +10 -2
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/output/output.d.ts +7 -0
- package/dist/core/output/output.js +6 -2
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/fields-file.d.ts +94 -0
- package/dist/core/schema/fields-file.js +317 -0
- package/dist/core/schema/fields-file.js.map +1 -0
- package/dist/core/schema/item-types-file.d.ts +25 -2
- package/dist/core/schema/item-types-file.js +78 -6
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-schema.d.ts +7 -0
- package/dist/core/schema/runtime-schema.js +23 -16
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/type-inference.d.ts +34 -0
- package/dist/core/schema/type-inference.js +97 -0
- package/dist/core/schema/type-inference.js.map +1 -0
- package/dist/core/schema/type-presets.d.ts +30 -0
- package/dist/core/schema/type-presets.js +96 -0
- package/dist/core/schema/type-presets.js.map +1 -0
- package/dist/core/search/cache.d.ts +19 -1
- package/dist/core/search/cache.js +11 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +36 -2
- package/dist/core/search/corpus.js +120 -24
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/providers.d.ts +19 -0
- package/dist/core/search/providers.js +19 -2
- package/dist/core/search/providers.js.map +1 -1
- package/dist/core/sentry/instrument.d.ts +1 -0
- package/dist/core/sentry/instrument.js +6 -2
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/session/session-state.d.ts +16 -0
- package/dist/core/session/session-state.js +48 -0
- package/dist/core/session/session-state.js.map +1 -0
- package/dist/core/shared/constants.d.ts +8 -0
- package/dist/core/shared/constants.js +11 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/text-normalization.js +4 -3
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/shared/time.d.ts +13 -0
- package/dist/core/shared/time.js +19 -7
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +13 -0
- package/dist/core/store/front-matter-cache.js +21 -11
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.d.ts +11 -0
- package/dist/core/store/item-store.js +12 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +2 -0
- package/dist/core/store/settings-validator.js +25 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.d.ts +60 -1
- package/dist/core/store/settings.js +100 -46
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +10 -8
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +272 -1
- package/dist/core/telemetry/runtime.js +358 -37
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.d.ts +35 -0
- package/dist/core/test/background-runs.js +72 -61
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/test/run-selectors.js +5 -4
- package/dist/core/test/run-selectors.js.map +1 -1
- package/dist/core/validate/estimate-defaults.d.ts +39 -0
- package/dist/core/validate/estimate-defaults.js +117 -0
- package/dist/core/validate/estimate-defaults.js.map +1 -0
- package/dist/core/validate/fix-planning.d.ts +21 -3
- package/dist/core/validate/fix-planning.js +31 -4
- package/dist/core/validate/fix-planning.js.map +1 -1
- package/dist/core/validate/missing-link-owners.d.ts +64 -0
- package/dist/core/validate/missing-link-owners.js +98 -0
- package/dist/core/validate/missing-link-owners.js.map +1 -0
- package/dist/mcp/server.d.ts +61 -0
- package/dist/mcp/server.js +98 -8
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +64 -10
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +13 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +127 -11
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +31 -0
- package/dist/sdk/cli-contracts.js +238 -12
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/types.d.ts +17 -1
- package/dist/types.js +3 -3
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +15 -3
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +171 -10
- package/docs/CONFIGURATION.md +135 -0
- package/docs/TESTING.md +6 -4
- package/package.json +6 -4
- package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
- package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +3 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +1 -1
- package/scripts/bundle-cli.mjs +46 -37
- package/scripts/finalize-build.mjs +20 -9
- package/scripts/prepare-build-cache.mjs +27 -16
- package/dist/cli-bundle/chunks/activity-XIOTGZMU.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-IRHJWEKG.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-XEBW22UQ.js.map +0 -7
- package/dist/cli-bundle/chunks/append-NL67JNJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2ANTZBYF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2J2AH4V5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-32XSW44C.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-36BCSMKP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VULHQNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4FHLNNW7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4JHJ7YG2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4TPFXE2R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4ZKKZMLH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5HSAHRYA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6TBR5AZ2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7CRFV6JR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7SM7VA5I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AAUYXSFF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AGG32LKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AUDDXKNX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BVL5KGVA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C24PWDFG.js +0 -138
- package/dist/cli-bundle/chunks/chunk-C24PWDFG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HLEGAQXT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HZOX5BYD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IXVSSHGV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZHCCG4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JW7D6437.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JWXTOYBI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KHGTYCJ6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-L6YQONLM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LFW5NQUP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LYNQ3NGI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-M3SI2REU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MACCNKSZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MGAQ6KZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PEH7SZD2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QQG4HEX7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RFR2YQGO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RHYBR6G7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-S2CDTRJ6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SGMGMCIF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SOHXUA2Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SQDKAEKG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TOX7YQ7X.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TSXWFN3L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UCVJP4JL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js +0 -128
- package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VNC2HBL4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-W6KNFAMZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WLH7X4RN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XXLMJDUB.js.map +0 -7
- package/dist/cli-bundle/chunks/close-WOG5WTMZ.js +0 -13
- package/dist/cli-bundle/chunks/close-many-GKAJX54X.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-GL6NRUU5.js.map +0 -7
- package/dist/cli-bundle/chunks/comments-5FPT6L7N.js.map +0 -1
- package/dist/cli-bundle/chunks/comments-TOLOYWNI.js.map +0 -7
- package/dist/cli-bundle/chunks/config-4MN45TIH.js.map +0 -1
- package/dist/cli-bundle/chunks/config-7N6D7YJE.js.map +0 -7
- package/dist/cli-bundle/chunks/context-AQSLE7DZ.js.map +0 -1
- package/dist/cli-bundle/chunks/context-U3PUJMVN.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-H7KCQXLY.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-ITSJXO3O.js.map +0 -1
- package/dist/cli-bundle/chunks/create-NW3K7LVG.js +0 -27
- package/dist/cli-bundle/chunks/deps-HV2C2L46.js.map +0 -1
- package/dist/cli-bundle/chunks/files-LIFDKNCN.js.map +0 -7
- package/dist/cli-bundle/chunks/files-OIFN3DQX.js.map +0 -1
- package/dist/cli-bundle/chunks/get-K7UULTQF.js.map +0 -7
- package/dist/cli-bundle/chunks/get-SAB7CRBG.js.map +0 -1
- package/dist/cli-bundle/chunks/health-NUVZYIEV.js.map +0 -1
- package/dist/cli-bundle/chunks/health-VJWH3ZFK.js.map +0 -7
- package/dist/cli-bundle/chunks/history-IUVN4NTN.js +0 -20
- package/dist/cli-bundle/chunks/history-compact-SLL6ESXH.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-WQZQ6KXM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-75KIIJUJ.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-BJCGM6Q3.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-UCYS55ZX.js.map +0 -7
- package/dist/cli-bundle/chunks/init-JJFYRUKG.js +0 -17
- package/dist/cli-bundle/chunks/learnings-L6KTZGOT.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-QKJOKEAO.js.map +0 -7
- package/dist/cli-bundle/chunks/list-GGVPXEV6.js +0 -23
- package/dist/cli-bundle/chunks/list-VOQDQHA4.js +0 -19
- package/dist/cli-bundle/chunks/notes-3NLK7WTZ.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-HMCB7TK6.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-DWBYI5C6.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-NANUWH4T.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-PWQ5F2VI.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-SMMMLSWW.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-QKFPTIZG.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-ZYJQ4DVP.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-2FMZ6WEF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-BAFQURZG.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-DQEIKBIP.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-QN2XV7UL.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-DRBNXJJH.js +0 -17
- package/dist/cli-bundle/chunks/schema-RNVJ55V2.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-ZZ7ZDM2X.js.map +0 -1
- package/dist/cli-bundle/chunks/search-BJ457C2A.js.map +0 -7
- package/dist/cli-bundle/chunks/search-FQDZXX7P.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-CUG3ZHOI.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-DUQWCVOS.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-33MRGX4Z.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-RK2VX75A.js.map +0 -1
- package/dist/cli-bundle/chunks/test-SDMYEQHH.js +0 -32
- package/dist/cli-bundle/chunks/test-all-ANYQ33O2.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-ARSMX33Q.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5URSD34O.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-XNACGSNQ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-PD46VOXI.js +0 -21
- package/dist/cli-bundle/chunks/update-U235A7WP.js +0 -25
- package/dist/cli-bundle/chunks/update-many-6B7PJ33I.js.map +0 -1
- package/dist/cli-bundle/chunks/update-many-724JCVDE.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-ALBEZAI7.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-QHRGDBSA.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-IQRYFXIV.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-UY6DRCG5.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-XIOTGZMU.js.map → activity-PZYSZA26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js.map → activity-SFM4THAU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js.map → chunk-26BM6YLO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js.map → chunk-2TMKMTEI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js.map → chunk-2VH7DFSJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js.map → chunk-5XGWFUW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js.map → chunk-AJCQ5GT6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js.map → chunk-BITCVGHT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js.map → chunk-CGQTFWYI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js.map → chunk-COVLE33A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js.map → chunk-F5MSD5HE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js.map → chunk-JZHL4E3Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js.map → chunk-KCAGIH6K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js.map → chunk-MIBX6ZRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js.map → chunk-UN6P3IJ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HWHONML5.js.map → chunk-VF3KQGNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js.map → claim-WGAWJCPY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js.map → claim-ZI6P4LMU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-WOG5WTMZ.js.map → close-I7PRQ5G7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-SPUFW5QR.js.map → close-JMVVSIQE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js.map → copy-Q2PPU4AY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-C4W522JM.js.map → copy-SC6UF3PI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4EQNELMY.js.map → create-76FE7JVF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-NW3K7LVG.js.map → create-RTRFW6RE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js.map → delete-T6DJSUJI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js.map → delete-XFUX533E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js.map → docs-HE3HCQ4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RJQPLROO.js.map → docs-SXMOABHR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js.map → extension-E23K4QRR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js.map → extension-PMD3XMLN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js.map → gc-BXIAKLAH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js.map → gc-C7K6JNUO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-GYFD2DJW.js.map → history-73Z6OBFZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-IUVN4NTN.js.map → history-BIPHVUMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js.map → history-redact-7YCXEWJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-75KIIJUJ.js.map → history-redact-WZZ6GZ2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-JJFYRUKG.js.map → init-K34V4PZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-MXV57LKL.js.map → init-TDEDNVMM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-GGVPXEV6.js.map → list-MSHYOCFU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-VOQDQHA4.js.map → list-VV57WGUD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js.map → restore-TSWSULYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-DRBNXJJH.js.map → restore-XQXICL3V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-SDMYEQHH.js.map → test-AROS3LIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js.map → test-CECIMKOA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-PD46VOXI.js.map → update-MIWEJC76.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-U235A7WP.js.map → update-P7I5YSRB.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-selectors.js","sources":["core/test/run-selectors.ts"],"sourceRoot":"/","sourcesContent":["import { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport type { LinkedTest } from \"../../types.js\";\n\n/**\n * Pure selection logic for `pm test --run` selectors (pm-p86h / GitHub #194).\n *\n * Selectors pick WHICH linked tests execute without mutating item metadata:\n * - `--match <substring>`: case-insensitive substring on command/path.\n * - `--only-index <n>`: 1-based index into the `--list` order.\n * - `--only-last`: most recently added entry (last in `--list` order).\n */\n\nexport type LinkedTestSelectorKind = \"match\" | \"only-index\" | \"only-last\";\n\nexport interface LinkedTestRunSelector {\n match?: string;\n onlyIndex?: number;\n onlyLast?: boolean;\n}\n\nexport interface LinkedTestRunSelection {\n selector: LinkedTestSelectorKind | null;\n requested: string | null;\n selected: LinkedTest[];\n /** 1-based positions of selected entries in the original `--list` order. */\n selected_indexes: number[];\n selected_count: number;\n skipped_count: number;\n}\n\nconst MAX_SELECTOR_ENTRY_LABEL_LENGTH = 100;\n\nexport function parseOnlyIndexValue(raw: string | number, optionName = \"--only-index\"): number {\n const value = typeof raw === \"number\" ? raw : Number(String(raw).trim());\n if (!Number.isInteger(value) || value < 1) {\n throw new PmCliError(\n `${optionName} requires a 1-based integer index into the linked-test list (got \"${raw}\"). Use pm test <id> --list to inspect positions.`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\nfunction summarizeSelectorEntry(entry: LinkedTest): string {\n const label = entry.command ?? entry.path ?? \"<no command>\";\n const normalized = label.replaceAll(/\\s+/g, \" \").trim() || \"<no command>\";\n if (normalized.length <= MAX_SELECTOR_ENTRY_LABEL_LENGTH) {\n return normalized;\n }\n return `${normalized.slice(0, MAX_SELECTOR_ENTRY_LABEL_LENGTH - 3)}...`;\n}\n\nexport function describeLinkedTestEntries(tests: LinkedTest[]): string {\n return tests.map((entry, index) => `${index + 1}. ${summarizeSelectorEntry(entry)}`).join(\"; \");\n}\n\nfunction activeSelectorKinds(selector: LinkedTestRunSelector): LinkedTestSelectorKind[] {\n const kinds: LinkedTestSelectorKind[] = [];\n if (selector.match !== undefined) {\n kinds.push(\"match\");\n }\n if (selector.onlyIndex !== undefined) {\n kinds.push(\"only-index\");\n }\n if (selector.onlyLast === true) {\n kinds.push(\"only-last\");\n }\n return kinds;\n}\n\nfunction entryMatchesSubstring(entry: LinkedTest, needle: string): boolean {\n const command = entry.command?.toLowerCase() ?? \"\";\n const entryPath = entry.path?.toLowerCase() ?? \"\";\n return command.includes(needle) || entryPath.includes(needle);\n}\n\nexport function resolveLinkedTestRunSelection(tests: LinkedTest[], selector: LinkedTestRunSelector): LinkedTestRunSelection {\n const kinds = activeSelectorKinds(selector);\n if (kinds.length === 0) {\n return {\n selector: null,\n requested: null,\n selected: tests,\n selected_indexes: tests.map((_, index) => index + 1),\n selected_count: tests.length,\n skipped_count: 0,\n };\n }\n if (kinds.length > 1) {\n throw new PmCliError(\n `Combine at most one linked-test selector per run: ${kinds.map((kind) => `--${kind}`).join(\" and \")} were provided. Pick one of --match, --only-index, --only-last.`,\n EXIT_CODE.USAGE,\n );\n }\n const kind = kinds[0];\n if (tests.length === 0) {\n throw new PmCliError(\n `--${kind} matched no linked tests because this item has none. Add one first with --add, --command, or --add-json.`,\n EXIT_CODE.USAGE,\n );\n }\n if (kind === \"match\") {\n const needle = (selector.match ?? \"\").trim().toLowerCase();\n if (needle.length === 0) {\n throw new PmCliError(\"--match requires a non-empty substring to match against linked-test command/path values\", EXIT_CODE.USAGE);\n }\n const selectedIndexes: number[] = [];\n const selected: LinkedTest[] = [];\n for (let index = 0; index < tests.length; index += 1) {\n if (entryMatchesSubstring(tests[index], needle)) {\n selected.push(tests[index]);\n selectedIndexes.push(index + 1);\n }\n }\n if (selected.length === 0) {\n throw new PmCliError(\n `--match \"${selector.match}\" matched none of the ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n selector: \"match\",\n requested: selector.match ?? \"\",\n selected,\n selected_indexes: selectedIndexes,\n selected_count: selected.length,\n skipped_count: tests.length - selected.length,\n };\n }\n if (kind === \"only-index\") {\n const index = parseOnlyIndexValue(selector.onlyIndex as number);\n if (index > tests.length) {\n throw new PmCliError(\n `--only-index ${index} is out of range: this item has ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n selector: \"only-index\",\n requested: String(index),\n selected: [tests[index - 1]],\n selected_indexes: [index],\n selected_count: 1,\n skipped_count: tests.length - 1,\n };\n }\n return {\n selector: \"only-last\",\n requested: \"last\",\n selected: [tests[tests.length - 1]],\n selected_indexes: [tests.length],\n selected_count: 1,\n skipped_count: tests.length - 1,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA8BjD,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAE5C,MAAM,UAAU,mBAAmB,CAAC,GAAoB,EAAE,UAAU,GAAG,cAAc;IACnF,MAAM,KAAK,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,UAAU,CAClB,GAAG,UAAU,qEAAqE,GAAG,mDAAmD,EACxI,SAAS,CAAC,KAAK,CAChB,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAiB;IAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,cAAc,CAAC;IAC5D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,GAA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;YACtB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC;YACxB,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC5B,gBAAgB,EAAE,CAAC,KAAK,CAAC;YACzB,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;SAChC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,WAAW;QACrB,SAAS,EAAE,MAAM;QACjB,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACnC,gBAAgB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;QAChC,cAAc,EAAE,CAAC;QACjB,aAAa,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;KAChC,CAAC;AACJ,CAAC","debugId":"89480c78-9cf5-55e5-a881-aaa130d9c509"}
|
|
1
|
+
{"version":3,"file":"run-selectors.js","sources":["core/test/run-selectors.ts"],"sourceRoot":"/","sourcesContent":["import { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport type { LinkedTest } from \"../../types.js\";\n\n/**\n * Pure selection logic for `pm test --run` selectors (pm-p86h / GitHub #194).\n *\n * Selectors pick WHICH linked tests execute without mutating item metadata:\n * - `--match <substring>`: case-insensitive substring on command/path.\n * - `--only-index <n>`: 1-based index into the `--list` order.\n * - `--only-last`: most recently added entry (last in `--list` order).\n */\n\nexport type LinkedTestSelectorKind = \"match\" | \"only-index\" | \"only-last\";\n\nexport interface LinkedTestRunSelector {\n match?: string;\n onlyIndex?: number;\n onlyLast?: boolean;\n}\n\nexport interface LinkedTestRunSelection {\n selector: LinkedTestSelectorKind | null;\n requested: string | null;\n selected: LinkedTest[];\n /** 1-based positions of selected entries in the original `--list` order. */\n selected_indexes: number[];\n selected_count: number;\n skipped_count: number;\n}\n\nconst MAX_SELECTOR_ENTRY_LABEL_LENGTH = 100;\n\nexport function parseOnlyIndexValue(raw: string | number, optionName = \"--only-index\"): number {\n const value = typeof raw === \"number\" ? raw : Number(String(raw).trim());\n if (!Number.isInteger(value) || value < 1) {\n throw new PmCliError(\n `${optionName} requires a 1-based integer index into the linked-test list (got \"${raw}\"). Use pm test <id> --list to inspect positions.`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\nfunction summarizeSelectorEntry(entry: LinkedTest): string {\n const label = entry.command ?? entry.path ?? \"<no command>\";\n const normalized = label.replaceAll(/\\s+/g, \" \").trim() || \"<no command>\";\n if (normalized.length <= MAX_SELECTOR_ENTRY_LABEL_LENGTH) {\n return normalized;\n }\n return `${normalized.slice(0, MAX_SELECTOR_ENTRY_LABEL_LENGTH - 3)}...`;\n}\n\nexport function describeLinkedTestEntries(tests: LinkedTest[]): string {\n return tests.map((entry, index) => `${index + 1}. ${summarizeSelectorEntry(entry)}`).join(\"; \");\n}\n\nfunction activeSelectorKinds(selector: LinkedTestRunSelector): LinkedTestSelectorKind[] {\n const kinds: LinkedTestSelectorKind[] = [];\n if (selector.match !== undefined) {\n kinds.push(\"match\");\n }\n if (selector.onlyIndex !== undefined) {\n kinds.push(\"only-index\");\n }\n if (selector.onlyLast === true) {\n kinds.push(\"only-last\");\n }\n return kinds;\n}\n\nfunction entryMatchesSubstring(entry: LinkedTest, needle: string): boolean {\n const command = entry.command?.toLowerCase() ?? \"\";\n const entryPath = entry.path?.toLowerCase() ?? \"\";\n return command.includes(needle) || entryPath.includes(needle);\n}\n\nexport function resolveLinkedTestRunSelection(tests: LinkedTest[], selector: LinkedTestRunSelector): LinkedTestRunSelection {\n const kinds = activeSelectorKinds(selector);\n if (kinds.length === 0) {\n return {\n selector: null,\n requested: null,\n selected: tests,\n selected_indexes: tests.map((_, index) => index + 1),\n selected_count: tests.length,\n skipped_count: 0,\n };\n }\n if (kinds.length > 1) {\n throw new PmCliError(\n `Combine at most one linked-test selector per run: ${kinds.map((kind) => `--${kind}`).join(\" and \")} were provided. Pick one of --match, --only-index, --only-last.`,\n EXIT_CODE.USAGE,\n );\n }\n const kind = kinds[0];\n if (tests.length === 0) {\n throw new PmCliError(\n `--${kind} matched no linked tests because this item has none. Add one first with --add, --command, or --add-json.`,\n EXIT_CODE.USAGE,\n );\n }\n if (kind === \"match\") {\n // kind is \"match\" only when selector.match is defined (see activeSelectorKinds).\n const needle = (selector.match as string).trim().toLowerCase();\n if (needle.length === 0) {\n throw new PmCliError(\"--match requires a non-empty substring to match against linked-test command/path values\", EXIT_CODE.USAGE);\n }\n const selectedIndexes: number[] = [];\n const selected: LinkedTest[] = [];\n for (let index = 0; index < tests.length; index += 1) {\n if (entryMatchesSubstring(tests[index], needle)) {\n selected.push(tests[index]);\n selectedIndexes.push(index + 1);\n }\n }\n if (selected.length === 0) {\n throw new PmCliError(\n `--match \"${selector.match}\" matched none of the ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n selector: \"match\",\n requested: selector.match as string,\n selected,\n selected_indexes: selectedIndexes,\n selected_count: selected.length,\n skipped_count: tests.length - selected.length,\n };\n }\n if (kind === \"only-index\") {\n const index = parseOnlyIndexValue(selector.onlyIndex as number);\n if (index > tests.length) {\n throw new PmCliError(\n `--only-index ${index} is out of range: this item has ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n selector: \"only-index\",\n requested: String(index),\n selected: [tests[index - 1]],\n selected_indexes: [index],\n selected_count: 1,\n skipped_count: tests.length - 1,\n };\n }\n return {\n selector: \"only-last\",\n requested: \"last\",\n selected: [tests[tests.length - 1]],\n selected_indexes: [tests.length],\n selected_count: 1,\n skipped_count: tests.length - 1,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA8BjD,MAAM,+BAA+B,GAAG,GA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|
1
|
+
/**
|
|
2
|
+
* Per-type default estimate resolution for `pm validate --auto-fix` (GH-212).
|
|
3
|
+
*
|
|
4
|
+
* When an item is missing `estimated_minutes`, the auto-fix path backfills a
|
|
5
|
+
* config-driven default based on the item's type. This module is the pure
|
|
6
|
+
* resolution layer: given an item type and an optional settings-derived override
|
|
7
|
+
* map, it returns the default estimate in minutes. The planning + apply path is
|
|
8
|
+
* wired separately by the validate command.
|
|
9
|
+
*
|
|
10
|
+
* Pure module: no filesystem access, no heavy imports. Bad input is never
|
|
11
|
+
* thrown on — invalid override entries are dropped, not errored (mirrors the
|
|
12
|
+
* deterministic, non-throwing style of stale-file-classification.ts).
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Built-in per-type default estimates in MINUTES used by `pm validate --auto-fix`
|
|
16
|
+
* (GH-212) to backfill missing `estimated_minutes`. Keys are canonical built-in
|
|
17
|
+
* type names. Lookups are case-insensitive (see resolveEstimateDefaultMinutes).
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_ESTIMATE_MINUTES_BY_TYPE: Readonly<Record<string, number>>;
|
|
20
|
+
/** Fallback when neither overrides nor the built-in map have the type. */
|
|
21
|
+
export declare const FALLBACK_ESTIMATE_MINUTES = 120;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the default estimated-minutes for an item type.
|
|
24
|
+
* Precedence: overrides (case-insensitive key match) > DEFAULT_ESTIMATE_MINUTES_BY_TYPE
|
|
25
|
+
* (case-insensitive) > FALLBACK_ESTIMATE_MINUTES.
|
|
26
|
+
* - `type` undefined/empty -> FALLBACK.
|
|
27
|
+
* - Only finite values > 0 are honored from overrides/defaults; a non-positive or
|
|
28
|
+
* non-finite override value is ignored and resolution continues to the next tier.
|
|
29
|
+
* - Returned value is a positive integer (floor of the resolved value).
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveEstimateDefaultMinutes(type: string | undefined, overrides?: Readonly<Record<string, number>>): number;
|
|
32
|
+
/**
|
|
33
|
+
* Validate + normalize a raw `validation.estimate_defaults_by_type` settings object
|
|
34
|
+
* into a clean Record<string, number> of positive integers, dropping invalid entries.
|
|
35
|
+
* Used so the pure resolver always receives a sane override map. Returns {} for
|
|
36
|
+
* undefined/null/non-object input. Trims keys; ignores empty keys and non-positive /
|
|
37
|
+
* non-finite / non-number values. Floors values to integers.
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalizeEstimateDefaultOverrides(raw: unknown): Record<string, number>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-type default estimate resolution for `pm validate --auto-fix` (GH-212).
|
|
3
|
+
*
|
|
4
|
+
* When an item is missing `estimated_minutes`, the auto-fix path backfills a
|
|
5
|
+
* config-driven default based on the item's type. This module is the pure
|
|
6
|
+
* resolution layer: given an item type and an optional settings-derived override
|
|
7
|
+
* map, it returns the default estimate in minutes. The planning + apply path is
|
|
8
|
+
* wired separately by the validate command.
|
|
9
|
+
*
|
|
10
|
+
* Pure module: no filesystem access, no heavy imports. Bad input is never
|
|
11
|
+
* thrown on — invalid override entries are dropped, not errored (mirrors the
|
|
12
|
+
* deterministic, non-throwing style of stale-file-classification.ts).
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Built-in per-type default estimates in MINUTES used by `pm validate --auto-fix`
|
|
16
|
+
* (GH-212) to backfill missing `estimated_minutes`. Keys are canonical built-in
|
|
17
|
+
* type names. Lookups are case-insensitive (see resolveEstimateDefaultMinutes).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="33f2ca4e-022c-5fc2-9938-a3fb389c1b93")}catch(e){}}();
|
|
21
|
+
export const DEFAULT_ESTIMATE_MINUTES_BY_TYPE = {
|
|
22
|
+
Epic: 2880,
|
|
23
|
+
Feature: 480,
|
|
24
|
+
Story: 480,
|
|
25
|
+
Milestone: 2880,
|
|
26
|
+
Task: 120,
|
|
27
|
+
Issue: 60,
|
|
28
|
+
Bug: 60,
|
|
29
|
+
Chore: 30,
|
|
30
|
+
Decision: 15,
|
|
31
|
+
Plan: 120,
|
|
32
|
+
};
|
|
33
|
+
/** Fallback when neither overrides nor the built-in map have the type. */
|
|
34
|
+
export const FALLBACK_ESTIMATE_MINUTES = 120;
|
|
35
|
+
/** A value is honored only when it is a finite number strictly greater than zero. */
|
|
36
|
+
function isHonoredMinutes(value) {
|
|
37
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Build a case-insensitive lookup keyed by lowercased type name. When two source
|
|
41
|
+
* keys collide case-insensitively, last-wins (later entries overwrite earlier
|
|
42
|
+
* ones); callers normalize overrides up front so collisions are rare.
|
|
43
|
+
*/
|
|
44
|
+
function toLowercasedLookup(source) {
|
|
45
|
+
const lookup = new Map();
|
|
46
|
+
for (const [key, value] of Object.entries(source)) {
|
|
47
|
+
lookup.set(key.toLowerCase(), value);
|
|
48
|
+
}
|
|
49
|
+
return lookup;
|
|
50
|
+
}
|
|
51
|
+
/** Built-in lookup is type-static, so build the lowercased index once. */
|
|
52
|
+
const BUILTIN_LOWERCASED_LOOKUP = toLowercasedLookup(DEFAULT_ESTIMATE_MINUTES_BY_TYPE);
|
|
53
|
+
/**
|
|
54
|
+
* Cache lowercased override lookups keyed on the override object reference so a
|
|
55
|
+
* backfill that resolves once per item does not rebuild the same Map each call.
|
|
56
|
+
* A WeakMap keeps this allocation-free for callers that reuse one normalized
|
|
57
|
+
* settings map across the whole run.
|
|
58
|
+
*/
|
|
59
|
+
const OVERRIDE_LOOKUP_CACHE = new WeakMap();
|
|
60
|
+
function lowercasedOverrideLookup(overrides) {
|
|
61
|
+
const cached = OVERRIDE_LOOKUP_CACHE.get(overrides);
|
|
62
|
+
if (cached) {
|
|
63
|
+
return cached;
|
|
64
|
+
}
|
|
65
|
+
const lookup = toLowercasedLookup(overrides);
|
|
66
|
+
OVERRIDE_LOOKUP_CACHE.set(overrides, lookup);
|
|
67
|
+
return lookup;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the default estimated-minutes for an item type.
|
|
71
|
+
* Precedence: overrides (case-insensitive key match) > DEFAULT_ESTIMATE_MINUTES_BY_TYPE
|
|
72
|
+
* (case-insensitive) > FALLBACK_ESTIMATE_MINUTES.
|
|
73
|
+
* - `type` undefined/empty -> FALLBACK.
|
|
74
|
+
* - Only finite values > 0 are honored from overrides/defaults; a non-positive or
|
|
75
|
+
* non-finite override value is ignored and resolution continues to the next tier.
|
|
76
|
+
* - Returned value is a positive integer (floor of the resolved value).
|
|
77
|
+
*/
|
|
78
|
+
export function resolveEstimateDefaultMinutes(type, overrides) {
|
|
79
|
+
const key = (type ?? "").trim().toLowerCase();
|
|
80
|
+
if (key.length === 0) {
|
|
81
|
+
return FALLBACK_ESTIMATE_MINUTES;
|
|
82
|
+
}
|
|
83
|
+
if (overrides) {
|
|
84
|
+
const overrideValue = lowercasedOverrideLookup(overrides).get(key);
|
|
85
|
+
if (isHonoredMinutes(overrideValue)) {
|
|
86
|
+
return Math.floor(overrideValue);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const builtinValue = BUILTIN_LOWERCASED_LOOKUP.get(key);
|
|
90
|
+
if (isHonoredMinutes(builtinValue)) {
|
|
91
|
+
return Math.floor(builtinValue);
|
|
92
|
+
}
|
|
93
|
+
return FALLBACK_ESTIMATE_MINUTES;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Validate + normalize a raw `validation.estimate_defaults_by_type` settings object
|
|
97
|
+
* into a clean Record<string, number> of positive integers, dropping invalid entries.
|
|
98
|
+
* Used so the pure resolver always receives a sane override map. Returns {} for
|
|
99
|
+
* undefined/null/non-object input. Trims keys; ignores empty keys and non-positive /
|
|
100
|
+
* non-finite / non-number values. Floors values to integers.
|
|
101
|
+
*/
|
|
102
|
+
export function normalizeEstimateDefaultOverrides(raw) {
|
|
103
|
+
const normalized = {};
|
|
104
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
105
|
+
return normalized;
|
|
106
|
+
}
|
|
107
|
+
for (const [rawKey, rawValue] of Object.entries(raw)) {
|
|
108
|
+
const key = rawKey.trim();
|
|
109
|
+
if (key.length === 0 || !isHonoredMinutes(rawValue)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
normalized[key] = Math.floor(rawValue);
|
|
113
|
+
}
|
|
114
|
+
return normalized;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=estimate-defaults.js.map
|
|
117
|
+
//# debugId=33f2ca4e-022c-5fc2-9938-a3fb389c1b93
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-defaults.js","sources":["core/validate/estimate-defaults.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Per-type default estimate resolution for `pm validate --auto-fix` (GH-212).\n *\n * When an item is missing `estimated_minutes`, the auto-fix path backfills a\n * config-driven default based on the item's type. This module is the pure\n * resolution layer: given an item type and an optional settings-derived override\n * map, it returns the default estimate in minutes. The planning + apply path is\n * wired separately by the validate command.\n *\n * Pure module: no filesystem access, no heavy imports. Bad input is never\n * thrown on — invalid override entries are dropped, not errored (mirrors the\n * deterministic, non-throwing style of stale-file-classification.ts).\n */\n\n/**\n * Built-in per-type default estimates in MINUTES used by `pm validate --auto-fix`\n * (GH-212) to backfill missing `estimated_minutes`. Keys are canonical built-in\n * type names. Lookups are case-insensitive (see resolveEstimateDefaultMinutes).\n */\nexport const DEFAULT_ESTIMATE_MINUTES_BY_TYPE: Readonly<Record<string, number>> = {\n Epic: 2880,\n Feature: 480,\n Story: 480,\n Milestone: 2880,\n Task: 120,\n Issue: 60,\n Bug: 60,\n Chore: 30,\n Decision: 15,\n Plan: 120,\n};\n\n/** Fallback when neither overrides nor the built-in map have the type. */\nexport const FALLBACK_ESTIMATE_MINUTES = 120;\n\n/** A value is honored only when it is a finite number strictly greater than zero. */\nfunction isHonoredMinutes(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value) && value > 0;\n}\n\n/**\n * Build a case-insensitive lookup keyed by lowercased type name. When two source\n * keys collide case-insensitively, last-wins (later entries overwrite earlier\n * ones); callers normalize overrides up front so collisions are rare.\n */\nfunction toLowercasedLookup(source: Readonly<Record<string, number>>): Map<string, number> {\n const lookup = new Map<string, number>();\n for (const [key, value] of Object.entries(source)) {\n lookup.set(key.toLowerCase(), value);\n }\n return lookup;\n}\n\n/** Built-in lookup is type-static, so build the lowercased index once. */\nconst BUILTIN_LOWERCASED_LOOKUP = toLowercasedLookup(DEFAULT_ESTIMATE_MINUTES_BY_TYPE);\n\n/**\n * Cache lowercased override lookups keyed on the override object reference so a\n * backfill that resolves once per item does not rebuild the same Map each call.\n * A WeakMap keeps this allocation-free for callers that reuse one normalized\n * settings map across the whole run.\n */\nconst OVERRIDE_LOOKUP_CACHE = new WeakMap<Readonly<Record<string, number>>, Map<string, number>>();\n\nfunction lowercasedOverrideLookup(overrides: Readonly<Record<string, number>>): Map<string, number> {\n const cached = OVERRIDE_LOOKUP_CACHE.get(overrides);\n if (cached) {\n return cached;\n }\n const lookup = toLowercasedLookup(overrides);\n OVERRIDE_LOOKUP_CACHE.set(overrides, lookup);\n return lookup;\n}\n\n/**\n * Resolve the default estimated-minutes for an item type.\n * Precedence: overrides (case-insensitive key match) > DEFAULT_ESTIMATE_MINUTES_BY_TYPE\n * (case-insensitive) > FALLBACK_ESTIMATE_MINUTES.\n * - `type` undefined/empty -> FALLBACK.\n * - Only finite values > 0 are honored from overrides/defaults; a non-positive or\n * non-finite override value is ignored and resolution continues to the next tier.\n * - Returned value is a positive integer (floor of the resolved value).\n */\nexport function resolveEstimateDefaultMinutes(\n type: string | undefined,\n overrides?: Readonly<Record<string, number>>,\n): number {\n const key = (type ?? \"\").trim().toLowerCase();\n if (key.length === 0) {\n return FALLBACK_ESTIMATE_MINUTES;\n }\n\n if (overrides) {\n const overrideValue = lowercasedOverrideLookup(overrides).get(key);\n if (isHonoredMinutes(overrideValue)) {\n return Math.floor(overrideValue);\n }\n }\n\n const builtinValue = BUILTIN_LOWERCASED_LOOKUP.get(key);\n if (isHonoredMinutes(builtinValue)) {\n return Math.floor(builtinValue);\n }\n\n return FALLBACK_ESTIMATE_MINUTES;\n}\n\n/**\n * Validate + normalize a raw `validation.estimate_defaults_by_type` settings object\n * into a clean Record<string, number> of positive integers, dropping invalid entries.\n * Used so the pure resolver always receives a sane override map. Returns {} for\n * undefined/null/non-object input. Trims keys; ignores empty keys and non-positive /\n * non-finite / non-number values. Floors values to integers.\n */\nexport function normalizeEstimateDefaultOverrides(raw: unknown): Record<string, number> {\n const normalized: Record<string, number> = {};\n if (raw === null || typeof raw !== \"object\" || Array.isArray(raw)) {\n return normalized;\n }\n\n for (const [rawKey, rawValue] of Object.entries(raw as Record<string, unknown>)) {\n const key = rawKey.trim();\n if (key.length === 0 || !isHonoredMinutes(rawValue)) {\n continue;\n }\n normalized[key] = Math.floor(rawValue);\n }\n\n return normalized;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;;;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAqC;IAChF,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,GAAG;IACV,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,EAAE;IACT,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,qFAAqF;AACrF,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ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AAG,CAAC,GAAG,CAAC,CAAC;QACnE,IAAI,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,MAAM,YAAY,GAAG,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAAC,GAAY;IAC5D,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAA8B,CAAC,EAAE,CAAC;QAChF,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpD,SAAS;QACX,CAAC;QACD,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","debugId":"33f2ca4e-022c-5fc2-9938-a3fb389c1b93"}
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
* explicitly granted.
|
|
17
17
|
*/
|
|
18
18
|
export type ValidateFixCheck = "metadata" | "resolution" | "lifecycle" | "files";
|
|
19
|
-
export type ValidateFixKind = "set_resolution" | "set_close_reason" | "reparent" | "unset_parent" | "prune_file_link" | "prune_doc_link";
|
|
20
|
-
export type ValidateFixScope = "metadata" | "resolution" | "lifecycle";
|
|
19
|
+
export type ValidateFixKind = "set_resolution" | "set_close_reason" | "set_estimate" | "reparent" | "unset_parent" | "prune_file_link" | "prune_doc_link";
|
|
20
|
+
export type ValidateFixScope = "metadata" | "resolution" | "estimates" | "lifecycle";
|
|
21
21
|
/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */
|
|
22
22
|
export declare const DEFAULT_GRANTED_FIX_SCOPES: readonly ValidateFixScope[];
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Scopes accepted by `--fix-scope`. `estimates` and `lifecycle` are opt-in:
|
|
25
|
+
* estimate backfills are heuristic per-type guesses (not derived facts) and
|
|
26
|
+
* lifecycle changes are structural, so neither is granted by default.
|
|
27
|
+
*/
|
|
24
28
|
export declare const SUPPORTED_FIX_SCOPES: readonly ValidateFixScope[];
|
|
25
29
|
export interface ValidateFixRecord {
|
|
26
30
|
/** Item the fix targets. */
|
|
@@ -76,6 +80,20 @@ export interface CloseReasonBackfillRow {
|
|
|
76
80
|
* derived).
|
|
77
81
|
*/
|
|
78
82
|
export declare function planCloseReasonBackfillFixes(rows: readonly CloseReasonBackfillRow[]): ValidateFixRecord[];
|
|
83
|
+
export interface EstimateBackfillRow {
|
|
84
|
+
id: string;
|
|
85
|
+
/** Item type, used to resolve the per-type default estimate. */
|
|
86
|
+
type?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Plan estimate backfills for items flagged by the metadata check as missing
|
|
90
|
+
* `estimated_minutes` (GH-212). The value is a config-driven per-type default
|
|
91
|
+
* (overrides > built-in map > fallback), never a derived fact — so these fixes
|
|
92
|
+
* carry `gate: "estimates"`, an opt-in scope that is NOT granted by default.
|
|
93
|
+
* `overrides` is the already-normalized `validation.estimate_defaults_by_type`
|
|
94
|
+
* map; pass `undefined`/`{}` to use the built-in defaults.
|
|
95
|
+
*/
|
|
96
|
+
export declare function planEstimateBackfillFixes(rows: readonly EstimateBackfillRow[], overrides?: Readonly<Record<string, number>>): ValidateFixRecord[];
|
|
79
97
|
export interface TerminalParentFixRow {
|
|
80
98
|
id: string;
|
|
81
99
|
parent_id: string;
|
|
@@ -16,13 +16,18 @@
|
|
|
16
16
|
* explicitly granted.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
19
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="776d7952-ee98-58fe-9373-8f669f2a6f2d")}catch(e){}}();
|
|
20
20
|
import { EXIT_CODE } from "../shared/constants.js";
|
|
21
21
|
import { PmCliError } from "../shared/errors.js";
|
|
22
|
+
import { resolveEstimateDefaultMinutes } from "./estimate-defaults.js";
|
|
22
23
|
/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */
|
|
23
24
|
export const DEFAULT_GRANTED_FIX_SCOPES = ["metadata", "resolution"];
|
|
24
|
-
/**
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Scopes accepted by `--fix-scope`. `estimates` and `lifecycle` are opt-in:
|
|
27
|
+
* estimate backfills are heuristic per-type guesses (not derived facts) and
|
|
28
|
+
* lifecycle changes are structural, so neither is granted by default.
|
|
29
|
+
*/
|
|
30
|
+
export const SUPPORTED_FIX_SCOPES = ["metadata", "resolution", "estimates", "lifecycle"];
|
|
26
31
|
/** Default resolution backfilled onto closed items with no derivable source text. */
|
|
27
32
|
export const DEFAULT_RESOLUTION_BACKFILL_VALUE = "completed";
|
|
28
33
|
function quoteForCommand(value) {
|
|
@@ -83,6 +88,28 @@ export function planCloseReasonBackfillFixes(rows) {
|
|
|
83
88
|
}
|
|
84
89
|
return fixes;
|
|
85
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Plan estimate backfills for items flagged by the metadata check as missing
|
|
93
|
+
* `estimated_minutes` (GH-212). The value is a config-driven per-type default
|
|
94
|
+
* (overrides > built-in map > fallback), never a derived fact — so these fixes
|
|
95
|
+
* carry `gate: "estimates"`, an opt-in scope that is NOT granted by default.
|
|
96
|
+
* `overrides` is the already-normalized `validation.estimate_defaults_by_type`
|
|
97
|
+
* map; pass `undefined`/`{}` to use the built-in defaults.
|
|
98
|
+
*/
|
|
99
|
+
export function planEstimateBackfillFixes(rows, overrides) {
|
|
100
|
+
return rows.map((row) => {
|
|
101
|
+
const minutes = resolveEstimateDefaultMinutes(row.type, overrides);
|
|
102
|
+
return {
|
|
103
|
+
item_id: row.id,
|
|
104
|
+
check: "metadata",
|
|
105
|
+
field: "estimated_minutes",
|
|
106
|
+
kind: "set_estimate",
|
|
107
|
+
value: String(minutes),
|
|
108
|
+
command: `pm update ${row.id} --estimate ${minutes}`,
|
|
109
|
+
gate: "estimates",
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
}
|
|
86
113
|
/**
|
|
87
114
|
* Plan lifecycle fixes for active items whose parent is terminal (pm-8jss /
|
|
88
115
|
* GH-168). When the terminal parent has an active grandparent, the child is
|
|
@@ -199,4 +226,4 @@ export function toFixOutputRow(fix) {
|
|
|
199
226
|
};
|
|
200
227
|
}
|
|
201
228
|
//# sourceMappingURL=fix-planning.js.map
|
|
202
|
-
//# debugId=
|
|
229
|
+
//# debugId=776d7952-ee98-58fe-9373-8f669f2a6f2d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-planning.js","sources":["core/validate/fix-planning.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Fix planning for `pm validate --auto-fix` / `--prune-missing` (pm-c3sz,\n * pm-8jss, pm-0v2m).\n *\n * Pure module: planners turn check findings into declarative\n * {@link ValidateFixRecord}s; the validate command decides whether to apply\n * them (apply mode), preview them (`--dry-run`), or withhold gated fixes\n * (lifecycle structural changes require an explicit `--fix-scope lifecycle`).\n *\n * Safety invariants:\n * - Every planned fix is deterministic and non-destructive: it only sets a\n * derivable field value or removes a stale LINK (never a real file).\n * - No fix ever closes, deletes, or cancels an item.\n * - Lifecycle fixes (reparent / unset parent) are structural, so they are\n * planned with `gate: \"lifecycle\"` and only applied when that scope was\n * explicitly granted.\n */\n\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nexport type ValidateFixCheck = \"metadata\" | \"resolution\" | \"lifecycle\" | \"files\";\n\nexport type ValidateFixKind =\n | \"set_resolution\"\n | \"set_close_reason\"\n | \"reparent\"\n | \"unset_parent\"\n | \"prune_file_link\"\n | \"prune_doc_link\";\n\nexport type ValidateFixScope = \"metadata\" | \"resolution\" | \"lifecycle\";\n\n/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */\nexport const DEFAULT_GRANTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\"];\n\n/** Scopes accepted by `--fix-scope` (lifecycle is the opt-in structural scope). */\nexport const SUPPORTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\", \"lifecycle\"];\n\nexport interface ValidateFixRecord {\n /** Item the fix targets. */\n item_id: string;\n /** Validate check the finding came from. */\n check: ValidateFixCheck;\n /** Front-matter field (or link list) the fix changes. */\n field: string;\n /** Declarative fix kind the applier dispatches on. */\n kind: ValidateFixKind;\n /** Equivalent standalone `pm` command for the fix. */\n command: string;\n /** New value for set-field fixes. */\n value?: string;\n /** Stale link path for prune fixes. */\n path?: string;\n /** Target parent id for reparent fixes. */\n parent_id?: string;\n /**\n * Fix scope the `--fix-scope` allowlist must grant for the fix to be\n * applied. Every `--auto-fix` record carries one (the granted default is\n * metadata+resolution; lifecycle must be named explicitly). Absent only on\n * `--prune-missing` records, which are governed by their own flag.\n */\n gate?: ValidateFixScope;\n}\n\n/** Default resolution backfilled onto closed items with no derivable source text. */\nexport const DEFAULT_RESOLUTION_BACKFILL_VALUE = \"completed\";\n\nfunction quoteForCommand(value: string): string {\n return `\"${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"')}\"`;\n}\n\nfunction toMeaningfulValue(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed !== undefined && trimmed.length > 0 ? trimmed : undefined;\n}\n\nexport interface ResolutionBackfillRow {\n id: string;\n /** Resolution-check missing field keys for this closed item. */\n missing_fields: readonly string[];\n /** The item's close_reason, when present (preferred derivation source). */\n close_reason?: string;\n}\n\n/**\n * Plan resolution backfills for closed items flagged by the resolution check.\n * Only the `resolution` field is mechanical enough to auto-fix: it derives\n * from the item's own `close_reason` when present and falls back to the\n * `\"completed\"` default. `expected_result` / `actual_result` stay hint-only —\n * no deterministic source text exists for them.\n */\nexport function planResolutionBackfillFixes(rows: readonly ResolutionBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (!row.missing_fields.includes(\"resolution\")) {\n continue;\n }\n const value = toMeaningfulValue(row.close_reason) ?? DEFAULT_RESOLUTION_BACKFILL_VALUE;\n fixes.push({\n item_id: row.id,\n check: \"resolution\",\n field: \"resolution\",\n kind: \"set_resolution\",\n value,\n command: `pm update ${row.id} --resolution ${quoteForCommand(value)}`,\n gate: \"resolution\",\n });\n }\n return fixes;\n}\n\nexport interface CloseReasonBackfillRow {\n id: string;\n /** The item's resolution, when present (the only derivation source). */\n resolution?: string;\n}\n\n/**\n * Plan close_reason backfills for closed items flagged by the metadata check.\n * Only derivable when the item already carries a resolution; items missing\n * both stay hint-only (any synthesized reason would be fabricated, not\n * derived).\n */\nexport function planCloseReasonBackfillFixes(rows: readonly CloseReasonBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n const value = toMeaningfulValue(row.resolution);\n if (value === undefined) {\n continue;\n }\n fixes.push({\n item_id: row.id,\n check: \"metadata\",\n field: \"close_reason\",\n kind: \"set_close_reason\",\n value,\n command: `pm update ${row.id} --close-reason ${quoteForCommand(value)}`,\n gate: \"metadata\",\n });\n }\n return fixes;\n}\n\nexport interface TerminalParentFixRow {\n id: string;\n parent_id: string;\n /** The terminal parent's own parent, when one exists. */\n grandparent_id?: string;\n /** True when the grandparent exists and is NOT terminal (safe reparent target). */\n grandparent_active?: boolean;\n}\n\n/**\n * Plan lifecycle fixes for active items whose parent is terminal (pm-8jss /\n * GH-168). When the terminal parent has an active grandparent, the child is\n * reparented one level up (it stays inside the same hierarchy); otherwise the\n * parent link is cleared so the item surfaces as unparented active work.\n * Either way the item itself is never closed or mutated beyond `parent` —\n * and every fix carries `gate: \"lifecycle\"` so it is only applied under an\n * explicit `--fix-scope lifecycle`.\n */\nexport function planTerminalParentFixes(rows: readonly TerminalParentFixRow[]): ValidateFixRecord[] {\n return rows.map((row) => {\n if (row.grandparent_id !== undefined && row.grandparent_active === true) {\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"reparent\" as const,\n parent_id: row.grandparent_id,\n command: `pm update ${row.id} --parent ${row.grandparent_id}`,\n gate: \"lifecycle\" as const,\n };\n }\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"unset_parent\" as const,\n command: `pm update ${row.id} --unset parent`,\n gate: \"lifecycle\" as const,\n };\n });\n}\n\nexport interface StaleLinkPruneRow {\n item_id: string;\n path: string;\n link_kind: \"files\" | \"docs\";\n classification: \"moved\" | \"deleted\";\n}\n\n/**\n * Plan link prunes for `--prune-missing` (pm-0v2m / GH-184). Only links whose\n * stale path classified as `deleted` are pruned; `moved` links keep their\n * relink candidates in the files-check details instead of being dropped, so\n * recoverable link information is never destroyed. Link removal only — real\n * files are never touched.\n */\nexport function planStaleLinkPruneFixes(rows: readonly StaleLinkPruneRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (row.classification !== \"deleted\") {\n continue;\n }\n const noun = row.link_kind === \"files\" ? \"files\" : \"docs\";\n fixes.push({\n item_id: row.item_id,\n check: \"files\",\n field: row.link_kind,\n kind: row.link_kind === \"files\" ? \"prune_file_link\" : \"prune_doc_link\",\n path: row.path,\n command: `pm ${noun} ${row.item_id} --remove ${quoteForCommand(row.path)}`,\n });\n }\n return fixes;\n}\n\n/**\n * Resolve the granted `--fix-scope` set (repeatable and/or comma-separated).\n * With no explicit scopes the safe field-backfill scopes (metadata,\n * resolution) are granted; lifecycle must always be named explicitly. Unknown\n * values fail fast with the supported list.\n */\nexport function resolveGrantedFixScopes(rawScopes: readonly string[] | undefined): Set<ValidateFixScope> {\n const tokens = (rawScopes ?? [])\n .flatMap((raw) => raw.split(\",\"))\n .map((raw) => raw.trim())\n .filter((raw) => raw.length > 0);\n if (tokens.length === 0) {\n if (rawScopes !== undefined && rawScopes.length > 0) {\n throw new PmCliError(\n `--fix-scope values must not be empty. Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return new Set(DEFAULT_GRANTED_FIX_SCOPES);\n }\n const granted = new Set<ValidateFixScope>();\n for (const raw of tokens) {\n const normalized = raw.toLowerCase().replaceAll(\"-\", \"_\");\n if ((SUPPORTED_FIX_SCOPES as readonly string[]).includes(normalized)) {\n granted.add(normalized as ValidateFixScope);\n continue;\n }\n throw new PmCliError(\n `Unknown --fix-scope value \"${raw}\". Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return granted;\n}\n\n/**\n * Split a fix plan into the records that may be applied under the granted\n * scopes and the gated records that were withheld. `--fix-scope` is an exact\n * allowlist: every `--auto-fix` record requires its gate scope in `granted`.\n * Ungated records (`--prune-missing` link prunes, governed by their own flag)\n * are always applicable.\n */\nexport function partitionFixesByGrant(\n fixes: readonly ValidateFixRecord[],\n granted: ReadonlySet<ValidateFixScope>,\n): { applicable: ValidateFixRecord[]; gated: ValidateFixRecord[] } {\n const applicable: ValidateFixRecord[] = [];\n const gated: ValidateFixRecord[] = [];\n for (const fix of fixes) {\n if (fix.gate !== undefined && !granted.has(fix.gate)) {\n gated.push(fix);\n } else {\n applicable.push(fix);\n }\n }\n return { applicable, gated };\n}\n\n/** Compact serialization of a fix for planned/applied output rows. */\nexport function toFixOutputRow(fix: ValidateFixRecord): Record<string, unknown> {\n return {\n item_id: fix.item_id,\n check: fix.check,\n field: fix.field,\n command: fix.command,\n ...(fix.gate !== undefined ? { gate: fix.gate } : {}),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAcjD,oFAAoF;AACpF,MAAM,CAAC,MAAM,0BAA0B,GAAgC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAElG,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAgC,CAAC,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;AA4BzG,qFAAqF;AACrF,MAAM,CAAC,MAAM,iCAAiC,GAAG,WAAW,CAAC;AAE7D,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;AACtE,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAyB;IAClD,MAAM,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IAC9B,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AA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.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Fix planning for `pm validate --auto-fix` / `--prune-missing` (pm-c3sz,\n * pm-8jss, pm-0v2m).\n *\n * Pure module: planners turn check findings into declarative\n * {@link ValidateFixRecord}s; the validate command decides whether to apply\n * them (apply mode), preview them (`--dry-run`), or withhold gated fixes\n * (lifecycle structural changes require an explicit `--fix-scope lifecycle`).\n *\n * Safety invariants:\n * - Every planned fix is deterministic and non-destructive: it only sets a\n * derivable field value or removes a stale LINK (never a real file).\n * - No fix ever closes, deletes, or cancels an item.\n * - Lifecycle fixes (reparent / unset parent) are structural, so they are\n * planned with `gate: \"lifecycle\"` and only applied when that scope was\n * explicitly granted.\n */\n\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { resolveEstimateDefaultMinutes } from \"./estimate-defaults.js\";\n\nexport type ValidateFixCheck = \"metadata\" | \"resolution\" | \"lifecycle\" | \"files\";\n\nexport type ValidateFixKind =\n | \"set_resolution\"\n | \"set_close_reason\"\n | \"set_estimate\"\n | \"reparent\"\n | \"unset_parent\"\n | \"prune_file_link\"\n | \"prune_doc_link\";\n\nexport type ValidateFixScope = \"metadata\" | \"resolution\" | \"estimates\" | \"lifecycle\";\n\n/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */\nexport const DEFAULT_GRANTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\"];\n\n/**\n * Scopes accepted by `--fix-scope`. `estimates` and `lifecycle` are opt-in:\n * estimate backfills are heuristic per-type guesses (not derived facts) and\n * lifecycle changes are structural, so neither is granted by default.\n */\nexport const SUPPORTED_FIX_SCOPES: readonly ValidateFixScope[] = [\"metadata\", \"resolution\", \"estimates\", \"lifecycle\"];\n\nexport interface ValidateFixRecord {\n /** Item the fix targets. */\n item_id: string;\n /** Validate check the finding came from. */\n check: ValidateFixCheck;\n /** Front-matter field (or link list) the fix changes. */\n field: string;\n /** Declarative fix kind the applier dispatches on. */\n kind: ValidateFixKind;\n /** Equivalent standalone `pm` command for the fix. */\n command: string;\n /** New value for set-field fixes. */\n value?: string;\n /** Stale link path for prune fixes. */\n path?: string;\n /** Target parent id for reparent fixes. */\n parent_id?: string;\n /**\n * Fix scope the `--fix-scope` allowlist must grant for the fix to be\n * applied. Every `--auto-fix` record carries one (the granted default is\n * metadata+resolution; lifecycle must be named explicitly). Absent only on\n * `--prune-missing` records, which are governed by their own flag.\n */\n gate?: ValidateFixScope;\n}\n\n/** Default resolution backfilled onto closed items with no derivable source text. */\nexport const DEFAULT_RESOLUTION_BACKFILL_VALUE = \"completed\";\n\nfunction quoteForCommand(value: string): string {\n return `\"${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"')}\"`;\n}\n\nfunction toMeaningfulValue(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed !== undefined && trimmed.length > 0 ? trimmed : undefined;\n}\n\nexport interface ResolutionBackfillRow {\n id: string;\n /** Resolution-check missing field keys for this closed item. */\n missing_fields: readonly string[];\n /** The item's close_reason, when present (preferred derivation source). */\n close_reason?: string;\n}\n\n/**\n * Plan resolution backfills for closed items flagged by the resolution check.\n * Only the `resolution` field is mechanical enough to auto-fix: it derives\n * from the item's own `close_reason` when present and falls back to the\n * `\"completed\"` default. `expected_result` / `actual_result` stay hint-only —\n * no deterministic source text exists for them.\n */\nexport function planResolutionBackfillFixes(rows: readonly ResolutionBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (!row.missing_fields.includes(\"resolution\")) {\n continue;\n }\n const value = toMeaningfulValue(row.close_reason) ?? DEFAULT_RESOLUTION_BACKFILL_VALUE;\n fixes.push({\n item_id: row.id,\n check: \"resolution\",\n field: \"resolution\",\n kind: \"set_resolution\",\n value,\n command: `pm update ${row.id} --resolution ${quoteForCommand(value)}`,\n gate: \"resolution\",\n });\n }\n return fixes;\n}\n\nexport interface CloseReasonBackfillRow {\n id: string;\n /** The item's resolution, when present (the only derivation source). */\n resolution?: string;\n}\n\n/**\n * Plan close_reason backfills for closed items flagged by the metadata check.\n * Only derivable when the item already carries a resolution; items missing\n * both stay hint-only (any synthesized reason would be fabricated, not\n * derived).\n */\nexport function planCloseReasonBackfillFixes(rows: readonly CloseReasonBackfillRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n const value = toMeaningfulValue(row.resolution);\n if (value === undefined) {\n continue;\n }\n fixes.push({\n item_id: row.id,\n check: \"metadata\",\n field: \"close_reason\",\n kind: \"set_close_reason\",\n value,\n command: `pm update ${row.id} --close-reason ${quoteForCommand(value)}`,\n gate: \"metadata\",\n });\n }\n return fixes;\n}\n\nexport interface EstimateBackfillRow {\n id: string;\n /** Item type, used to resolve the per-type default estimate. */\n type?: string;\n}\n\n/**\n * Plan estimate backfills for items flagged by the metadata check as missing\n * `estimated_minutes` (GH-212). The value is a config-driven per-type default\n * (overrides > built-in map > fallback), never a derived fact — so these fixes\n * carry `gate: \"estimates\"`, an opt-in scope that is NOT granted by default.\n * `overrides` is the already-normalized `validation.estimate_defaults_by_type`\n * map; pass `undefined`/`{}` to use the built-in defaults.\n */\nexport function planEstimateBackfillFixes(\n rows: readonly EstimateBackfillRow[],\n overrides?: Readonly<Record<string, number>>,\n): ValidateFixRecord[] {\n return rows.map((row) => {\n const minutes = resolveEstimateDefaultMinutes(row.type, overrides);\n return {\n item_id: row.id,\n check: \"metadata\" as const,\n field: \"estimated_minutes\",\n kind: \"set_estimate\" as const,\n value: String(minutes),\n command: `pm update ${row.id} --estimate ${minutes}`,\n gate: \"estimates\" as const,\n };\n });\n}\n\nexport interface TerminalParentFixRow {\n id: string;\n parent_id: string;\n /** The terminal parent's own parent, when one exists. */\n grandparent_id?: string;\n /** True when the grandparent exists and is NOT terminal (safe reparent target). */\n grandparent_active?: boolean;\n}\n\n/**\n * Plan lifecycle fixes for active items whose parent is terminal (pm-8jss /\n * GH-168). When the terminal parent has an active grandparent, the child is\n * reparented one level up (it stays inside the same hierarchy); otherwise the\n * parent link is cleared so the item surfaces as unparented active work.\n * Either way the item itself is never closed or mutated beyond `parent` —\n * and every fix carries `gate: \"lifecycle\"` so it is only applied under an\n * explicit `--fix-scope lifecycle`.\n */\nexport function planTerminalParentFixes(rows: readonly TerminalParentFixRow[]): ValidateFixRecord[] {\n return rows.map((row) => {\n if (row.grandparent_id !== undefined && row.grandparent_active === true) {\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"reparent\" as const,\n parent_id: row.grandparent_id,\n command: `pm update ${row.id} --parent ${row.grandparent_id}`,\n gate: \"lifecycle\" as const,\n };\n }\n return {\n item_id: row.id,\n check: \"lifecycle\" as const,\n field: \"parent\",\n kind: \"unset_parent\" as const,\n command: `pm update ${row.id} --unset parent`,\n gate: \"lifecycle\" as const,\n };\n });\n}\n\nexport interface StaleLinkPruneRow {\n item_id: string;\n path: string;\n link_kind: \"files\" | \"docs\";\n classification: \"moved\" | \"deleted\";\n}\n\n/**\n * Plan link prunes for `--prune-missing` (pm-0v2m / GH-184). Only links whose\n * stale path classified as `deleted` are pruned; `moved` links keep their\n * relink candidates in the files-check details instead of being dropped, so\n * recoverable link information is never destroyed. Link removal only — real\n * files are never touched.\n */\nexport function planStaleLinkPruneFixes(rows: readonly StaleLinkPruneRow[]): ValidateFixRecord[] {\n const fixes: ValidateFixRecord[] = [];\n for (const row of rows) {\n if (row.classification !== \"deleted\") {\n continue;\n }\n const noun = row.link_kind === \"files\" ? \"files\" : \"docs\";\n fixes.push({\n item_id: row.item_id,\n check: \"files\",\n field: row.link_kind,\n kind: row.link_kind === \"files\" ? \"prune_file_link\" : \"prune_doc_link\",\n path: row.path,\n command: `pm ${noun} ${row.item_id} --remove ${quoteForCommand(row.path)}`,\n });\n }\n return fixes;\n}\n\n/**\n * Resolve the granted `--fix-scope` set (repeatable and/or comma-separated).\n * With no explicit scopes the safe field-backfill scopes (metadata,\n * resolution) are granted; lifecycle must always be named explicitly. Unknown\n * values fail fast with the supported list.\n */\nexport function resolveGrantedFixScopes(rawScopes: readonly string[] | undefined): Set<ValidateFixScope> {\n const tokens = (rawScopes ?? [])\n .flatMap((raw) => raw.split(\",\"))\n .map((raw) => raw.trim())\n .filter((raw) => raw.length > 0);\n if (tokens.length === 0) {\n if (rawScopes !== undefined && rawScopes.length > 0) {\n throw new PmCliError(\n `--fix-scope values must not be empty. Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return new Set(DEFAULT_GRANTED_FIX_SCOPES);\n }\n const granted = new Set<ValidateFixScope>();\n for (const raw of tokens) {\n const normalized = raw.toLowerCase().replaceAll(\"-\", \"_\");\n if ((SUPPORTED_FIX_SCOPES as readonly string[]).includes(normalized)) {\n granted.add(normalized as ValidateFixScope);\n continue;\n }\n throw new PmCliError(\n `Unknown --fix-scope value \"${raw}\". Supported values: ${SUPPORTED_FIX_SCOPES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n return granted;\n}\n\n/**\n * Split a fix plan into the records that may be applied under the granted\n * scopes and the gated records that were withheld. `--fix-scope` is an exact\n * allowlist: every `--auto-fix` record requires its gate scope in `granted`.\n * Ungated records (`--prune-missing` link prunes, governed by their own flag)\n * are always applicable.\n */\nexport function partitionFixesByGrant(\n fixes: readonly ValidateFixRecord[],\n granted: ReadonlySet<ValidateFixScope>,\n): { applicable: ValidateFixRecord[]; gated: ValidateFixRecord[] } {\n const applicable: ValidateFixRecord[] = [];\n const gated: ValidateFixRecord[] = [];\n for (const fix of fixes) {\n if (fix.gate !== undefined && !granted.has(fix.gate)) {\n gated.push(fix);\n } else {\n applicable.push(fix);\n }\n }\n return { applicable, gated };\n}\n\n/** Compact serialization of a fix for planned/applied output rows. */\nexport function toFixOutputRow(fix: ValidateFixRecord): Record<string, unknown> {\n return {\n item_id: fix.item_id,\n check: fix.check,\n field: fix.field,\n command: fix.command,\n ...(fix.gate !== undef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C,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC;AACJ,CAAC","debugId":"776d7952-ee98-58fe-9373-8f669f2a6f2d"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner attribution for stale linked paths reported by `pm validate --check-files`.
|
|
3
|
+
*
|
|
4
|
+
* The files check collects, per item, the linked paths (from the item's `files`
|
|
5
|
+
* and `docs` link lists) that no longer resolve on disk. By default those are
|
|
6
|
+
* surfaced as bare path strings + `path:classification` rows, which forces a
|
|
7
|
+
* reverse lookup to discover which item owns each stale link. This module turns
|
|
8
|
+
* the already-collected stale-link rows into owner-attributed, path-grouped rows
|
|
9
|
+
* so an agent can perform evidence-based cleanup (relink/prune) without that
|
|
10
|
+
* reverse lookup.
|
|
11
|
+
*
|
|
12
|
+
* Pure module (GH-210): no filesystem access and no heavy imports — callers pass
|
|
13
|
+
* the already-collected stale-link rows plus a metadata `lookup` closure.
|
|
14
|
+
*/
|
|
15
|
+
export type StaleLinkClassification = "moved" | "deleted";
|
|
16
|
+
export interface StaleLinkOwnerInput {
|
|
17
|
+
item_id: string;
|
|
18
|
+
/** Normalized workspace-relative path that no longer resolves. */
|
|
19
|
+
path: string;
|
|
20
|
+
/** Which link list of the owning item the path lives in. */
|
|
21
|
+
link_kind: "files" | "docs";
|
|
22
|
+
classification: StaleLinkClassification;
|
|
23
|
+
}
|
|
24
|
+
export interface MissingLinkedPathOwner {
|
|
25
|
+
id: string;
|
|
26
|
+
/** Owning item type, `"Unknown"` if metadata is absent. */
|
|
27
|
+
type: string;
|
|
28
|
+
/** Owning item title, `""` if absent. */
|
|
29
|
+
title: string;
|
|
30
|
+
/** Owning item status, `""` if absent. */
|
|
31
|
+
status: string;
|
|
32
|
+
/** The link list the path lives in (= the input `link_kind`). */
|
|
33
|
+
field: "files" | "docs";
|
|
34
|
+
}
|
|
35
|
+
export interface MissingLinkedPathRow {
|
|
36
|
+
path: string;
|
|
37
|
+
classification: StaleLinkClassification;
|
|
38
|
+
items: MissingLinkedPathOwner[];
|
|
39
|
+
}
|
|
40
|
+
export interface OwnerItemMetadata {
|
|
41
|
+
type?: string;
|
|
42
|
+
title?: string;
|
|
43
|
+
status?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Group stale-link owner inputs by linked path and attach owning-item metadata.
|
|
47
|
+
*
|
|
48
|
+
* - Paths sorted ascending (`localeCompare`); items within a path sorted by `id`
|
|
49
|
+
* then `field`.
|
|
50
|
+
* - De-duplicates identical `(id, field)` owners for the same path.
|
|
51
|
+
* - `classification` per path follows {@link preferClassification} (moved wins).
|
|
52
|
+
* - Missing metadata falls back: type `"Unknown"`, title `""`, status `""`.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildMissingLinkedPathRows(rows: readonly StaleLinkOwnerInput[], lookup: (itemId: string) => OwnerItemMetadata | undefined): MissingLinkedPathRow[];
|
|
55
|
+
/**
|
|
56
|
+
* Token-efficient one-line-per-owner serialization for the files-check details
|
|
57
|
+
* (compact text counterpart to the full {@link MissingLinkedPathRow} objects).
|
|
58
|
+
* Format per owner row:
|
|
59
|
+
* `<path>:<classification> owner=<id> status=<status> field=<field> title="<title>"`
|
|
60
|
+
* Title is double-quoted with backslash/quote escaping; empty status/title still
|
|
61
|
+
* render (`status=` and `title=""`). Order follows
|
|
62
|
+
* {@link buildMissingLinkedPathRows} output order.
|
|
63
|
+
*/
|
|
64
|
+
export declare function summarizeMissingLinkedPathRows(rows: readonly MissingLinkedPathRow[]): string[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner attribution for stale linked paths reported by `pm validate --check-files`.
|
|
3
|
+
*
|
|
4
|
+
* The files check collects, per item, the linked paths (from the item's `files`
|
|
5
|
+
* and `docs` link lists) that no longer resolve on disk. By default those are
|
|
6
|
+
* surfaced as bare path strings + `path:classification` rows, which forces a
|
|
7
|
+
* reverse lookup to discover which item owns each stale link. This module turns
|
|
8
|
+
* the already-collected stale-link rows into owner-attributed, path-grouped rows
|
|
9
|
+
* so an agent can perform evidence-based cleanup (relink/prune) without that
|
|
10
|
+
* reverse lookup.
|
|
11
|
+
*
|
|
12
|
+
* Pure module (GH-210): no filesystem access and no heavy imports — callers pass
|
|
13
|
+
* the already-collected stale-link rows plus a metadata `lookup` closure.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* `moved` wins over `deleted` when a single path's rows disagree on
|
|
17
|
+
* classification: `moved` means a relink candidate exists, which is the safer,
|
|
18
|
+
* more-actionable signal (relink instead of risk pruning a still-reachable
|
|
19
|
+
* link). In practice all rows for one path share a classification; this is a
|
|
20
|
+
* deterministic tie-break for the degenerate case.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="39287cbe-d50d-5e82-9d38-194006b8b3f3")}catch(e){}}();
|
|
24
|
+
function preferClassification(current, next) {
|
|
25
|
+
return current === "moved" || next === "moved" ? "moved" : "deleted";
|
|
26
|
+
}
|
|
27
|
+
function ownerKey(input) {
|
|
28
|
+
return `${input.item_id} ${input.link_kind}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Group stale-link owner inputs by linked path and attach owning-item metadata.
|
|
32
|
+
*
|
|
33
|
+
* - Paths sorted ascending (`localeCompare`); items within a path sorted by `id`
|
|
34
|
+
* then `field`.
|
|
35
|
+
* - De-duplicates identical `(id, field)` owners for the same path.
|
|
36
|
+
* - `classification` per path follows {@link preferClassification} (moved wins).
|
|
37
|
+
* - Missing metadata falls back: type `"Unknown"`, title `""`, status `""`.
|
|
38
|
+
*/
|
|
39
|
+
export function buildMissingLinkedPathRows(rows, lookup) {
|
|
40
|
+
const buckets = new Map();
|
|
41
|
+
for (const row of rows) {
|
|
42
|
+
const bucket = buckets.get(row.path);
|
|
43
|
+
if (bucket) {
|
|
44
|
+
bucket.classification = preferClassification(bucket.classification, row.classification);
|
|
45
|
+
bucket.owners.set(ownerKey(row), row);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
buckets.set(row.path, {
|
|
49
|
+
classification: row.classification,
|
|
50
|
+
owners: new Map([[ownerKey(row), row]]),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return [...buckets.entries()]
|
|
55
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
56
|
+
.map(([path, bucket]) => ({
|
|
57
|
+
path,
|
|
58
|
+
classification: bucket.classification,
|
|
59
|
+
items: [...bucket.owners.values()]
|
|
60
|
+
.map((owner) => {
|
|
61
|
+
const metadata = lookup(owner.item_id);
|
|
62
|
+
return {
|
|
63
|
+
id: owner.item_id,
|
|
64
|
+
type: metadata?.type ?? "Unknown",
|
|
65
|
+
title: metadata?.title ?? "",
|
|
66
|
+
status: metadata?.status ?? "",
|
|
67
|
+
field: owner.link_kind,
|
|
68
|
+
};
|
|
69
|
+
})
|
|
70
|
+
.sort((leftOwner, rightOwner) => {
|
|
71
|
+
const byId = leftOwner.id.localeCompare(rightOwner.id);
|
|
72
|
+
return byId !== 0 ? byId : leftOwner.field.localeCompare(rightOwner.field);
|
|
73
|
+
}),
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
function escapeTitle(title) {
|
|
77
|
+
return title.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Token-efficient one-line-per-owner serialization for the files-check details
|
|
81
|
+
* (compact text counterpart to the full {@link MissingLinkedPathRow} objects).
|
|
82
|
+
* Format per owner row:
|
|
83
|
+
* `<path>:<classification> owner=<id> status=<status> field=<field> title="<title>"`
|
|
84
|
+
* Title is double-quoted with backslash/quote escaping; empty status/title still
|
|
85
|
+
* render (`status=` and `title=""`). Order follows
|
|
86
|
+
* {@link buildMissingLinkedPathRows} output order.
|
|
87
|
+
*/
|
|
88
|
+
export function summarizeMissingLinkedPathRows(rows) {
|
|
89
|
+
const lines = [];
|
|
90
|
+
for (const row of rows) {
|
|
91
|
+
for (const owner of row.items) {
|
|
92
|
+
lines.push(`${row.path}:${row.classification} owner=${owner.id} status=${owner.status} field=${owner.field} title="${escapeTitle(owner.title)}"`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return lines;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=missing-link-owners.js.map
|
|
98
|
+
//# debugId=39287cbe-d50d-5e82-9d38-194006b8b3f3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-link-owners.js","sources":["core/validate/missing-link-owners.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Owner attribution for stale linked paths reported by `pm validate --check-files`.\n *\n * The files check collects, per item, the linked paths (from the item's `files`\n * and `docs` link lists) that no longer resolve on disk. By default those are\n * surfaced as bare path strings + `path:classification` rows, which forces a\n * reverse lookup to discover which item owns each stale link. This module turns\n * the already-collected stale-link rows into owner-attributed, path-grouped rows\n * so an agent can perform evidence-based cleanup (relink/prune) without that\n * reverse lookup.\n *\n * Pure module (GH-210): no filesystem access and no heavy imports — callers pass\n * the already-collected stale-link rows plus a metadata `lookup` closure.\n */\n\nexport type StaleLinkClassification = \"moved\" | \"deleted\";\n\nexport interface StaleLinkOwnerInput {\n item_id: string;\n /** Normalized workspace-relative path that no longer resolves. */\n path: string;\n /** Which link list of the owning item the path lives in. */\n link_kind: \"files\" | \"docs\";\n classification: StaleLinkClassification;\n}\n\nexport interface MissingLinkedPathOwner {\n id: string;\n /** Owning item type, `\"Unknown\"` if metadata is absent. */\n type: string;\n /** Owning item title, `\"\"` if absent. */\n title: string;\n /** Owning item status, `\"\"` if absent. */\n status: string;\n /** The link list the path lives in (= the input `link_kind`). */\n field: \"files\" | \"docs\";\n}\n\nexport interface MissingLinkedPathRow {\n path: string;\n classification: StaleLinkClassification;\n items: MissingLinkedPathOwner[];\n}\n\nexport interface OwnerItemMetadata {\n type?: string;\n title?: string;\n status?: string;\n}\n\ninterface PathBucket {\n classification: StaleLinkClassification;\n /** Keyed by `<id> <field>` so identical owners de-duplicate. */\n owners: Map<string, StaleLinkOwnerInput>;\n}\n\n/**\n * `moved` wins over `deleted` when a single path's rows disagree on\n * classification: `moved` means a relink candidate exists, which is the safer,\n * more-actionable signal (relink instead of risk pruning a still-reachable\n * link). In practice all rows for one path share a classification; this is a\n * deterministic tie-break for the degenerate case.\n */\nfunction preferClassification(\n current: StaleLinkClassification,\n next: StaleLinkClassification,\n): StaleLinkClassification {\n return current === \"moved\" || next === \"moved\" ? \"moved\" : \"deleted\";\n}\n\nfunction ownerKey(input: StaleLinkOwnerInput): string {\n return `${input.item_id} ${input.link_kind}`;\n}\n\n/**\n * Group stale-link owner inputs by linked path and attach owning-item metadata.\n *\n * - Paths sorted ascending (`localeCompare`); items within a path sorted by `id`\n * then `field`.\n * - De-duplicates identical `(id, field)` owners for the same path.\n * - `classification` per path follows {@link preferClassification} (moved wins).\n * - Missing metadata falls back: type `\"Unknown\"`, title `\"\"`, status `\"\"`.\n */\nexport function buildMissingLinkedPathRows(\n rows: readonly StaleLinkOwnerInput[],\n lookup: (itemId: string) => OwnerItemMetadata | undefined,\n): MissingLinkedPathRow[] {\n const buckets = new Map<string, PathBucket>();\n for (const row of rows) {\n const bucket = buckets.get(row.path);\n if (bucket) {\n bucket.classification = preferClassification(bucket.classification, row.classification);\n bucket.owners.set(ownerKey(row), row);\n } else {\n buckets.set(row.path, {\n classification: row.classification,\n owners: new Map([[ownerKey(row), row]]),\n });\n }\n }\n\n return [...buckets.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([path, bucket]) => ({\n path,\n classification: bucket.classification,\n items: [...bucket.owners.values()]\n .map((owner): MissingLinkedPathOwner => {\n const metadata = lookup(owner.item_id);\n return {\n id: owner.item_id,\n type: metadata?.type ?? \"Unknown\",\n title: metadata?.title ?? \"\",\n status: metadata?.status ?? \"\",\n field: owner.link_kind,\n };\n })\n .sort((leftOwner, rightOwner) => {\n const byId = leftOwner.id.localeCompare(rightOwner.id);\n return byId !== 0 ? byId : leftOwner.field.localeCompare(rightOwner.field);\n }),\n }));\n}\n\nfunction escapeTitle(title: string): string {\n return title.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"');\n}\n\n/**\n * Token-efficient one-line-per-owner serialization for the files-check details\n * (compact text counterpart to the full {@link MissingLinkedPathRow} objects).\n * Format per owner row:\n * `<path>:<classification> owner=<id> status=<status> field=<field> title=\"<title>\"`\n * Title is double-quoted with backslash/quote escaping; empty status/title still\n * render (`status=` and `title=\"\"`). Order follows\n * {@link buildMissingLinkedPathRows} output order.\n */\nexport function summarizeMissingLinkedPathRows(rows: readonly MissingLinkedPathRow[]): string[] {\n const lines: string[] = [];\n for (const row of rows) {\n for (const owner of row.items) {\n lines.push(\n `${row.path}:${row.classification} owner=${owner.id} status=${owner.status} field=${owner.field} title=\"${escapeTitle(owner.title)}\"`,\n );\n }\n }\n return lines;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA2CH;;;;;;GAMG;;;AACH,SAAS,oBAAoB,CAC3B,OAAgC,EAChC,IAA6B;IAE7B,OAAO,OAAO,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AAED,SAAS,QAAQ,CAAC,KAA0B;IAC1C,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACxC,IAAoC,EACpC,MAAyD;IAEzD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC9C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB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