@unbrained/pm-cli 2026.7.20 → 2026.7.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +11 -0
- package/dist/cli/commander-usage.d.ts +1 -1
- package/dist/cli/commander-usage.js +5 -5
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/completion.js +13 -5
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/contracts.js +4 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +7 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/main.d.ts +1 -5
- package/dist/cli/main.js +12 -50
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +13 -3
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +45 -3
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-structured-mutation.d.ts +14 -0
- package/dist/cli/register-structured-mutation.js +62 -0
- package/dist/cli/register-structured-mutation.js.map +1 -0
- package/dist/cli/registration-helpers.js +5 -3
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +280 -296
- package/dist/cli-bundle/chunks/{append-E6V54WOQ.js → append-7OVFYR3C.js} +3 -3
- package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js → append-DFETHAZL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C3KD7U3T.js → chunk-2L6ZP22J.js} +241 -10
- package/dist/cli-bundle/chunks/chunk-2L6ZP22J.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KZEANWJS.js → chunk-4PUUNQDV.js} +98 -30
- package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js → chunk-4QOB7L7I.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js.map → chunk-4QOB7L7I.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3LPFHE3P.js → chunk-4QSQ6XDK.js} +62 -20
- package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js → chunk-7656MAUL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3AO5VSDR.js → chunk-7RW4JCU2.js} +328 -6
- package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js → chunk-7W2UAXXT.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js → chunk-ABWCF646.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js.map → chunk-ABWCF646.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WVA4DVNV.js → chunk-ADBTSVGK.js} +71 -33
- package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-J4FBIFU6.js → chunk-AELMUANP.js} +12 -6
- package/dist/cli-bundle/chunks/chunk-AELMUANP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4F6BWJ4J.js → chunk-AMJPSANK.js} +57 -36
- package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6VIJ7UA5.js → chunk-AS4SAZ5R.js} +850 -819
- package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SG74J6MV.js → chunk-ATBCUC7Y.js} +574 -5
- package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js → chunk-BXNDKOR2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js → chunk-CPX275C6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js → chunk-DZRV2OPA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js → chunk-E5XMKOSB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js → chunk-EWJWSNRU.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DAQ45GCS.js → chunk-F2LBF7XJ.js} +22 -15
- package/dist/cli-bundle/chunks/chunk-F2LBF7XJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6XMUURSS.js → chunk-FJIFFBJX.js} +64 -33
- package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js → chunk-FO6OSVEN.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js.map → chunk-FO6OSVEN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js → chunk-FPBMLYPI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UZDQXNUB.js → chunk-FSE2IKJQ.js} +46 -5
- package/dist/cli-bundle/chunks/chunk-FSE2IKJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IX677TRO.js → chunk-GKX4NJ7U.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-IX677TRO.js.map → chunk-GKX4NJ7U.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js → chunk-GTK4DTEW.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-H7EAER5L.js +974 -0
- package/dist/cli-bundle/chunks/chunk-H7EAER5L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5UX66S6U.js → chunk-ICDAQ4TD.js} +316 -8
- package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js → chunk-JFD5LPMI.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js.map → chunk-JFD5LPMI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js → chunk-JXCW2TI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js.map → chunk-JXCW2TI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GSJSM5BJ.js → chunk-K36WV5J6.js} +76 -13
- package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GVI6FAFG.js → chunk-K55VMLSS.js} +7 -5
- package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js → chunk-KBLZ3AA5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js → chunk-KH44WBAT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GV2262OF.js → chunk-LAV26CQG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js → chunk-LVC72YRD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3VY6MIEO.js → chunk-LZYP423P.js} +35 -6
- package/dist/cli-bundle/chunks/chunk-LZYP423P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js → chunk-MATHDCGG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OV7MSW3I.js → chunk-MWQ2HC2A.js} +99 -31
- package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NHT3F4WZ.js → chunk-NUF7ROFH.js} +840 -816
- package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js → chunk-O4BCOJTZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js → chunk-OCUBRA6D.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5IZJWSDB.js → chunk-OG5DVFMA.js} +22 -15
- package/dist/cli-bundle/chunks/chunk-OG5DVFMA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I577UHC7.js → chunk-OR42SO64.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js → chunk-OY7DMU5P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HEWM6CEN.js → chunk-P7MTHPJQ.js} +50 -9
- package/dist/cli-bundle/chunks/chunk-P7MTHPJQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js → chunk-PFNHX655.js} +236 -12
- package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js.map → chunk-PFNHX655.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js → chunk-PONKZPCJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-THAOZG4U.js → chunk-PQSEQD6E.js} +8 -6
- package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js +991 -0
- package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js → chunk-PZC2FUOQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js → chunk-QG4GFLQ6.js} +3 -5
- package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js.map → chunk-QG4GFLQ6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js → chunk-QIH77CAG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js → chunk-QJIKE24M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js → chunk-QOOTOD3W.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js.map → chunk-QOOTOD3W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js → chunk-R3P6FZJW.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js.map → chunk-R3P6FZJW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-G3COA6GS.js → chunk-RNPZYNHS.js} +56 -35
- package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-T44FMVRL.js → chunk-RPESLSO5.js} +62 -20
- package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-INSTSQNZ.js → chunk-SY4SFZSD.js} +595 -3
- package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js → chunk-TRSHFPRZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js → chunk-UCBDQI5E.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js → chunk-V22ZPOKN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js → chunk-VHXHVTUU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LPEYZRUR.js → chunk-VJQG4BIM.js} +35 -6
- package/dist/cli-bundle/chunks/chunk-VJQG4BIM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js → chunk-VLRGDBLY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js → chunk-VNTCM3VW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js → chunk-VXOOB6YX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js → chunk-VZIZB6QH.js} +3 -5
- package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js.map → chunk-VZIZB6QH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js → chunk-X3W65QK3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js → chunk-XJTABV3X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GVT754PX.js → chunk-YCIUJJOD.js} +11 -5
- package/dist/cli-bundle/chunks/chunk-YCIUJJOD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IJNK6WW2.js → chunk-Z75ONV25.js} +75 -12
- package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js → chunk-Z7VWXXJM.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js.map → chunk-Z7VWXXJM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js → chunk-ZTVA4KLN.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js.map → chunk-ZTVA4KLN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js → chunk-ZVZGXPQ5.js} +2 -2
- package/dist/cli-bundle/chunks/{close-many-SDA426VT.js → close-many-5RZXVN4J.js} +5 -6
- package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js → close-many-RZVTUGBG.js} +5 -6
- package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js → comments-TPU7QRBL.js} +4 -4
- package/dist/cli-bundle/chunks/{comments-VBQ345ND.js → comments-Z4KV6FU3.js} +4 -4
- package/dist/cli-bundle/chunks/{create-GG4RBCGC.js → create-EIFBIVNQ.js} +6 -6
- package/dist/cli-bundle/chunks/{create-JBC5KUW6.js → create-RGSPN5GD.js} +6 -6
- package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js → deps-UH5EQQUY.js} +3 -3
- package/dist/cli-bundle/chunks/{deps-DELOO4TL.js → deps-YG7UF3VR.js} +3 -3
- package/dist/cli-bundle/chunks/{docs-6Z2MP526.js → docs-G32TK6XS.js} +4 -4
- package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js → docs-JWWNRC27.js} +4 -4
- package/dist/cli-bundle/chunks/{files-HKEAN5MA.js → files-3H32UQ4K.js} +4 -4
- package/dist/cli-bundle/chunks/{files-HEUGSJZL.js → files-4ALMCSKB.js} +4 -4
- package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js → history-compact-77BT2LUB.js} +3 -4
- package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js → history-compact-VCKGTX64.js} +3 -4
- package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js → history-redact-LJPZPNFA.js} +2 -3
- package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js → history-redact-PWTTJ3XS.js} +2 -3
- package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js → history-repair-I7CBNCV3.js} +5 -6
- package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js → history-repair-YTDZRK5E.js} +5 -6
- package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js → learnings-CYNOICKR.js} +4 -4
- package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js → learnings-KTYW3AL7.js} +4 -4
- package/dist/cli-bundle/chunks/{notes-7JMLQ447.js → notes-FGO63FXL.js} +4 -4
- package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js → notes-ZERD3KB2.js} +4 -4
- package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js → plan-OFJUBIM5.js} +7 -7
- package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js → plan-SGCDDTYR.js} +7 -7
- package/dist/cli-bundle/chunks/{profile-OILJHKUW.js → profile-3THJPIQY.js} +4 -5
- package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js → profile-XEZAMMBW.js} +4 -5
- package/dist/cli-bundle/chunks/{register-list-query-CFVG75P3.js → register-list-query-BR435Q2H.js} +19 -16
- package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-E7UVY4TN.js → register-list-query-RWTWLOBE.js} +18 -15
- package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-IQ55E25C.js → register-mutation-HLWC2WNP.js} +167 -31
- package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-4VJTXBZW.js → register-mutation-ZJX5AZM5.js} +173 -30
- package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js → register-operations-744YBJMV.js} +23 -25
- package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js.map → register-operations-744YBJMV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js → register-operations-UEBJH6AN.js} +21 -23
- package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js.map → register-operations-UEBJH6AN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js → register-setup-5DA4UZXI.js} +7 -8
- package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js.map → register-setup-5DA4UZXI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js → register-setup-6H25M3BH.js} +9 -10
- package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js.map → register-setup-6H25M3BH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js → restore-6TDVSATY.js} +4 -5
- package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js → restore-RSL7C7LO.js} +4 -5
- package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js → schema-HFXFSGPG.js} +2 -3
- package/dist/cli-bundle/chunks/{schema-55DL3Q52.js → schema-TPVTIJPO.js} +2 -3
- package/dist/cli-bundle/chunks/{update-FW6FKDOP.js → update-LJZCL5SI.js} +7 -7
- package/dist/cli-bundle/chunks/{update-TJHSPRPT.js → update-SIA7LH5Y.js} +7 -7
- package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js → update-many-BDBZVGQL.js} +11 -12
- package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js → update-many-MOY3A5B3.js} +11 -12
- package/dist/cli-bundle/main.js +60 -85
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +37 -37
- package/dist/cli-bundle/sdk.js +126 -291
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/core/item/parse.d.ts +1 -1
- package/dist/core/item/parse.js +13 -7
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/output/mutation-projection.d.ts +2 -0
- package/dist/core/output/mutation-projection.js +33 -2
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/output/output.d.ts +4 -0
- package/dist/core/output/output.js +18 -13
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +4 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/mcp/server.js +39 -4
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +45 -4
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +20 -27
- package/dist/sdk/cli-bootstrap.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/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +16 -3
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +6 -2
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/cli-program.js +4 -2
- package/dist/sdk/cli-program.js.map +1 -1
- package/dist/sdk/dependencies.d.ts +3 -2
- package/dist/sdk/dependencies.js +13 -12
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/sdk/error-runtime.d.ts +10 -0
- package/dist/sdk/error-runtime.js +59 -0
- package/dist/sdk/error-runtime.js.map +1 -0
- package/dist/sdk/graph/analytics.d.ts +9 -0
- package/dist/sdk/graph/analytics.js +24 -13
- package/dist/sdk/graph/analytics.js.map +1 -1
- package/dist/sdk/graph/assembly.d.ts +39 -0
- package/dist/sdk/graph/assembly.js +92 -12
- package/dist/sdk/graph/assembly.js.map +1 -1
- package/dist/sdk/graph/cache.d.ts +4 -1
- package/dist/sdk/graph/cache.js +17 -4
- package/dist/sdk/graph/cache.js.map +1 -1
- package/dist/sdk/graph/centrality.d.ts +82 -0
- package/dist/sdk/graph/centrality.js +259 -0
- package/dist/sdk/graph/centrality.js.map +1 -0
- package/dist/sdk/graph/durable-cache.d.ts +71 -0
- package/dist/sdk/graph/durable-cache.js +205 -0
- package/dist/sdk/graph/durable-cache.js.map +1 -0
- package/dist/sdk/graph/governance.d.ts +69 -1
- package/dist/sdk/graph/governance.js +143 -35
- package/dist/sdk/graph/governance.js.map +1 -1
- package/dist/sdk/graph/index.d.ts +7 -4
- package/dist/sdk/graph/index.js +8 -5
- package/dist/sdk/graph/index.js.map +1 -1
- package/dist/sdk/graph/mutation-advisory.d.ts +35 -4
- package/dist/sdk/graph/mutation-advisory.js +124 -35
- package/dist/sdk/graph/mutation-advisory.js.map +1 -1
- package/dist/sdk/graph/remediation.js +12 -2
- package/dist/sdk/graph/remediation.js.map +1 -1
- package/dist/sdk/graph/run.d.ts +133 -2
- package/dist/sdk/graph/run.js +217 -8
- package/dist/sdk/graph/run.js.map +1 -1
- package/dist/sdk/graph/scheduling.d.ts +59 -0
- package/dist/sdk/graph/scheduling.js +125 -0
- package/dist/sdk/graph/scheduling.js.map +1 -0
- package/dist/sdk/graph/traversal.d.ts +11 -0
- package/dist/sdk/graph/traversal.js +16 -2
- package/dist/sdk/graph/traversal.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +6 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime-input.js +7 -2
- package/dist/sdk/runtime-input.js.map +1 -1
- package/dist/sdk/runtime-primitives.d.ts +10 -0
- package/dist/sdk/runtime-primitives.js +14 -0
- package/dist/sdk/runtime-primitives.js.map +1 -0
- package/dist/sdk/runtime.d.ts +15 -0
- package/dist/sdk/runtime.js +16 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/structured-mutations.d.ts +21 -0
- package/dist/sdk/structured-mutations.js +375 -0
- package/dist/sdk/structured-mutations.js.map +1 -0
- package/docs/COMMANDS.md +85 -5
- package/docs/RELATIONSHIP_GRAPH.md +48 -7
- package/docs/SDK.md +78 -3
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +5 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3VY6MIEO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5IZJWSDB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js +0 -286
- package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6VIJ7UA5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +0 -334
- package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DAQ45GCS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +0 -249
- package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GSJSM5BJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IJNK6WW2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KZEANWJS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LPEYZRUR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NHT3F4WZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +0 -246
- package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +0 -344
- package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UQLXSG72.js +0 -289
- package/dist/cli-bundle/chunks/chunk-UQLXSG72.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WVA4DVNV.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-CFVG75P3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-E7UVY4TN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +0 -1
- /package/dist/cli-bundle/chunks/{append-E6V54WOQ.js.map → append-7OVFYR3C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js.map → append-DFETHAZL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js.map → chunk-7656MAUL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js.map → chunk-7W2UAXXT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js.map → chunk-BXNDKOR2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js.map → chunk-CPX275C6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js.map → chunk-DZRV2OPA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js.map → chunk-E5XMKOSB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js.map → chunk-EWJWSNRU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js.map → chunk-FPBMLYPI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js.map → chunk-GTK4DTEW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js.map → chunk-KBLZ3AA5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js.map → chunk-KH44WBAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GV2262OF.js.map → chunk-LAV26CQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js.map → chunk-LVC72YRD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js.map → chunk-MATHDCGG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js.map → chunk-O4BCOJTZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js.map → chunk-OCUBRA6D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I577UHC7.js.map → chunk-OR42SO64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js.map → chunk-OY7DMU5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js.map → chunk-PONKZPCJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js.map → chunk-PZC2FUOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js.map → chunk-QIH77CAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js.map → chunk-QJIKE24M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js.map → chunk-TRSHFPRZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js.map → chunk-UCBDQI5E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js.map → chunk-V22ZPOKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js.map → chunk-VHXHVTUU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js.map → chunk-VLRGDBLY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js.map → chunk-VNTCM3VW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js.map → chunk-VXOOB6YX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js.map → chunk-X3W65QK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js.map → chunk-XJTABV3X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js.map → chunk-ZVZGXPQ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-SDA426VT.js.map → close-many-5RZXVN4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js.map → close-many-RZVTUGBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js.map → comments-TPU7QRBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-VBQ345ND.js.map → comments-Z4KV6FU3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-GG4RBCGC.js.map → create-EIFBIVNQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JBC5KUW6.js.map → create-RGSPN5GD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js.map → deps-UH5EQQUY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-DELOO4TL.js.map → deps-YG7UF3VR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-6Z2MP526.js.map → docs-G32TK6XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js.map → docs-JWWNRC27.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-HKEAN5MA.js.map → files-3H32UQ4K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-HEUGSJZL.js.map → files-4ALMCSKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js.map → history-compact-77BT2LUB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js.map → history-compact-VCKGTX64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js.map → history-redact-LJPZPNFA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js.map → history-redact-PWTTJ3XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js.map → history-repair-I7CBNCV3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js.map → history-repair-YTDZRK5E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js.map → learnings-CYNOICKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js.map → learnings-KTYW3AL7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-7JMLQ447.js.map → notes-FGO63FXL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js.map → notes-ZERD3KB2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js.map → plan-OFJUBIM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js.map → plan-SGCDDTYR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-OILJHKUW.js.map → profile-3THJPIQY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js.map → profile-XEZAMMBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js.map → restore-6TDVSATY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js.map → restore-RSL7C7LO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js.map → schema-HFXFSGPG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-55DL3Q52.js.map → schema-TPVTIJPO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-FW6FKDOP.js.map → update-LJZCL5SI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-TJHSPRPT.js.map → update-SIA7LH5Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js.map → update-many-BDBZVGQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js.map → update-many-MOY3A5B3.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"governance.js","sources":["sdk/graph/governance.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/governance\n *\n * Policy-aware relationship-graph quality audit shared by validation, health,\n * and package governance surfaces. The audit inspects one assembled workspace\n * graph and reports machine-readable findings — integrity gaps, ordering\n * cycles, duplicated edge spellings, stale lifecycle blocks, and coverage\n * outliers — without inventing edges or assuming that sparse connectivity is\n * defective. Findings gate severity on lifecycle: contradictions confined to\n * terminal items downgrade to informational `legacy_*` codes because repairing\n * them would mutate closed history. Every finding names the violated policy,\n * carries a deterministic bounded sample, and proposes a safe next action so\n * agents can plan remediation without re-deriving context.\n */\nimport type { RelationshipEdge } from \"../relationships.js\";\nimport {\n isTransitiveKind,\n orientTransitiveEdge,\n transitiveFamilyKey,\n} from \"./analytics.js\";\nimport type { WorkspaceRelationshipAssembly } from \"./assembly.js\";\n\n/** Severity ladder shared by every relationship audit finding. */\nexport type RelationshipAuditSeverity = \"error\" | \"warning\" | \"info\";\n\n/** Machine-readable identifier for one relationship audit finding family. */\nexport type RelationshipAuditFindingCode =\n | \"missing_reference_active\"\n | \"missing_reference_terminal\"\n | \"legacy_no_blocker_sentinel\"\n | \"ordering_cycle\"\n | \"legacy_ordering_cycle\"\n | \"duplicate_edge\"\n | \"legacy_duplicate_edge\"\n | \"stale_lifecycle_block\"\n | \"isolated_active_node\"\n | \"sparse_active_node\";\n\n/** One policy-aware relationship audit finding with bounded evidence. */\nexport interface RelationshipAuditFinding {\n /** Machine-readable finding family identifier. */\n code: RelationshipAuditFindingCode;\n /** Severity of the violated policy. */\n severity: RelationshipAuditSeverity;\n /** Policy statement this finding violates. */\n policy: string;\n /** Human-readable summary including the affected count. */\n message: string;\n /** Total number of affected subjects, independent of sample bounding. */\n count: number;\n /** Deterministic bounded sample of affected subjects. */\n sample: string[];\n /** Whether {@link sample} was truncated by the configured sample bound. */\n sample_truncated: boolean;\n /** Safe machine-actionable next step; audits never invent or auto-apply edges. */\n remediation: string;\n}\n\n/** Aggregate structural coverage metrics for one assembled workspace graph. */\nexport interface RelationshipCoverageProfile {\n /** Total indexed nodes including materialized missing placeholders. */\n nodes: number;\n /** Total deduplicated indexed edges. */\n edges: number;\n /** Deterministic per-kind edge counts. */\n edges_by_kind: Record<string, number>;\n /** Nodes whose lifecycle status is active (non-terminal, non-missing). */\n active_nodes: number;\n /** Materialized placeholder nodes for referenced-but-absent items. */\n missing_nodes: number;\n /** Active nodes with no incident edges at all. */\n isolated_active_nodes: number;\n /** Active nodes with at most one incident edge, isolates included. */\n degree_leq_one_active_nodes: number;\n}\n\n/** Tuning and policy inputs accepted by the relationship audit. */\nexport interface RelationshipAuditOptions {\n /** Terminal-lifecycle predicate; defaults to the built-in closed/canceled statuses. */\n isTerminal?: (status: string) => boolean;\n /** Blocked-lifecycle predicate for stale-block detection; defaults to `status === \"blocked\"`. */\n isBlocked?: (status: string) => boolean;\n /** Node identifiers that are explicitly valid isolates (roots, archives, scratch work). */\n exemptIsolates?: readonly string[];\n /** Maximum sample entries retained per finding; defaults to 25. */\n maxSampleSize?: number;\n /** Abort signal checked between finding families. */\n signal?: AbortSignal;\n}\n\n/** Complete deterministic result of one relationship-graph audit. */\nexport interface RelationshipAuditReport {\n /** Findings ordered by severity, then code, then first sample subject. */\n findings: RelationshipAuditFinding[];\n /** Structural coverage metrics computed during the audit. */\n profile: RelationshipCoverageProfile;\n}\n\n/** Default bounded sample size applied to every finding family. */\nconst DEFAULT_MAX_SAMPLE_SIZE = 25;\n\n/** Rank used to order findings by decreasing severity. */\nconst SEVERITY_RANK: Record<RelationshipAuditSeverity, number> = {\n error: 0,\n warning: 1,\n info: 2,\n};\n\n/** Internal per-node lifecycle classification resolved once per audit. */\ninterface AuditNodeState {\n /** Original-case node identifier. */\n id: string;\n /** Raw lifecycle status string from assembly details. */\n status: string;\n /** Whether the node is a materialized missing placeholder. */\n missing: boolean;\n /** Whether the node's lifecycle status is terminal. */\n terminal: boolean;\n}\n\n/** Mutable state shared by iterative Tarjan frames. */\ninterface TarjanState {\n /** Discovery index assigned to each visited node. */\n indexes: Map<string, number>;\n /** Lowest reachable discovery index per visited node. */\n lowLinks: Map<string, number>;\n /** Nodes that still belong to an unfinished component. */\n onStack: Set<string>;\n /** Component-membership stack. */\n stack: string[];\n /** Completed cyclic components. */\n components: string[][];\n /** Discovery index assigned to the next unseen node. */\n nextIndex: number;\n}\n\n/** One explicit depth-first frame used by iterative Tarjan traversal. */\ninterface TarjanFrame {\n /** Node currently being expanded. */\n node: string;\n /** Index of the next successor to inspect. */\n neighborIndex: number;\n}\n\n/** Build one finding with deterministic bounded sampling over sorted subjects. */\nfunction buildFinding(\n code: RelationshipAuditFindingCode,\n severity: RelationshipAuditSeverity,\n policy: string,\n describe: (count: number) => string,\n subjects: readonly string[],\n maxSampleSize: number,\n remediation: string,\n): RelationshipAuditFinding {\n const sorted = [...subjects].sort((left, right) => left.localeCompare(right));\n return {\n code,\n severity,\n policy,\n message: describe(sorted.length),\n count: sorted.length,\n sample: sorted.slice(0, maxSampleSize),\n sample_truncated: sorted.length > maxSampleSize,\n remediation,\n };\n}\n/** Resolve the ordering-only successor adjacency for cycle analysis. */\nfunction buildOrderingAdjacency(\n assembly: WorkspaceRelationshipAssembly,\n): Map<string, string[]> {\n const registry = assembly.graph.registry();\n const successors = new Map<string, string[]>();\n for (const edge of assembly.graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!definition.ordering) continue;\n // Orient every ordering edge predecessor -> successor so inverse spellings\n // (blocked_by/blocks) land in one canonical execution-order digraph.\n const [predecessor, successor] =\n (definition.precedence ?? \"source_before_target\") ===\n \"target_before_source\"\n ? [edge.target, edge.source]\n : [edge.source, edge.target];\n const adjacent = successors.get(predecessor);\n if (adjacent) adjacent.push(successor);\n else successors.set(predecessor, [successor]);\n }\n for (const adjacent of successors.values())\n adjacent.sort((left, right) => left.localeCompare(right));\n return successors;\n}\n\n/** Register one newly discovered Tarjan node. */\nfunction registerTarjanNode(node: string, state: TarjanState): void {\n state.indexes.set(node, state.nextIndex);\n state.lowLinks.set(node, state.nextIndex);\n state.nextIndex += 1;\n state.stack.push(node);\n state.onStack.add(node);\n}\n\n/** Visit one pending successor, returning whether the frame had work left. */\nfunction visitNextTarjanNeighbor(\n frame: TarjanFrame,\n frames: TarjanFrame[],\n successors: Map<string, string[]>,\n state: TarjanState,\n): boolean {\n const neighbors = successors.get(frame.node) ?? [];\n if (frame.neighborIndex >= neighbors.length) return false;\n const neighbor = neighbors[frame.neighborIndex]!;\n frame.neighborIndex += 1;\n if (!state.indexes.has(neighbor)) {\n registerTarjanNode(neighbor, state);\n frames.push({ node: neighbor, neighborIndex: 0 });\n } else if (state.onStack.has(neighbor)) {\n state.lowLinks.set(\n frame.node,\n Math.min(state.lowLinks.get(frame.node)!, state.indexes.get(neighbor)!),\n );\n }\n return true;\n}\n\n/** Complete one Tarjan frame and emit its component when it is a root. */\nfunction completeTarjanFrame(\n frame: TarjanFrame,\n frames: TarjanFrame[],\n successors: Map<string, string[]>,\n state: TarjanState,\n): void {\n frames.pop();\n const parent = frames.at(-1);\n if (parent)\n state.lowLinks.set(\n parent.node,\n Math.min(\n state.lowLinks.get(parent.node)!,\n state.lowLinks.get(frame.node)!,\n ),\n );\n if (state.lowLinks.get(frame.node) !== state.indexes.get(frame.node)) return;\n const component: string[] = [];\n while (true) {\n const member = state.stack.pop()!;\n state.onStack.delete(member);\n component.push(member);\n if (member === frame.node) break;\n }\n if (\n component.length > 1 ||\n (component.length === 1 &&\n successors.get(component[0]!)?.includes(component[0]!))\n )\n state.components.push(\n component.sort((left, right) => left.localeCompare(right)),\n );\n}\n\n/**\n * Enumerate strongly connected components with more than one member over the\n * ordering-only digraph using an iterative Tarjan traversal. Only order-bearing\n * kinds participate: associative kinds such as `related` cannot create\n * execution-order contradictions and stay out of cycle analysis by policy.\n */\nfunction collectOrderingCycles(successors: Map<string, string[]>): string[][] {\n const state: TarjanState = {\n indexes: new Map(),\n lowLinks: new Map(),\n onStack: new Set(),\n stack: [],\n components: [],\n nextIndex: 0,\n };\n const roots = [...successors.keys()].sort((left, right) =>\n left.localeCompare(right),\n );\n for (const root of roots) {\n if (state.indexes.has(root)) continue;\n // Explicit frame stack keeps the traversal safe on deep dependency chains.\n const frames: TarjanFrame[] = [{ node: root, neighborIndex: 0 }];\n registerTarjanNode(root, state);\n while (frames.length > 0) {\n const frame = frames.at(-1)!;\n if (visitNextTarjanNeighbor(frame, frames, successors, state)) continue;\n completeTarjanFrame(frame, frames, successors, state);\n }\n }\n return state.components.sort((left, right) =>\n left[0]!.localeCompare(right[0]!),\n );\n}\n\n/** Format one dangling reference as a compact deterministic evidence string. */\nfunction formatDanglingReference(reference: {\n holder_id: string;\n target_id: string;\n kind: string;\n}): string {\n return `${reference.holder_id} -> ${reference.target_id} (${reference.kind})`;\n}\n\n/** Append one finding only when its subject collection is non-empty. */\nfunction appendFinding(\n findings: RelationshipAuditFinding[],\n subjects: readonly string[],\n maxSampleSize: number,\n code: RelationshipAuditFindingCode,\n severity: RelationshipAuditSeverity,\n policy: string,\n describe: (count: number) => string,\n remediation: string,\n): void {\n if (subjects.length === 0) return;\n findings.push(\n buildFinding(\n code,\n severity,\n policy,\n describe,\n subjects,\n maxSampleSize,\n remediation,\n ),\n );\n}\n\n/** Collect dangling-reference and retired-sentinel governance findings. */\nfunction collectIntegrityFindings(\n assembly: WorkspaceRelationshipAssembly,\n isTerminal: (status: string) => boolean,\n maxSampleSize: number,\n): RelationshipAuditFinding[] {\n const findings: RelationshipAuditFinding[] = [];\n const references = [\n ...assembly.dangling.active,\n ...assembly.dangling.legacy_terminal,\n ].filter((reference) => !reference.no_active_blocker_sentinel);\n appendFinding(\n findings,\n references\n .filter((reference) => !isTerminal(reference.holder_status))\n .map(formatDanglingReference),\n maxSampleSize,\n \"missing_reference_active\",\n \"error\",\n \"Active items must not reference absent targets; missing prerequisites distort scheduling.\",\n (count) => `${count} active dangling reference(s) to absent items`,\n \"Restore or re-create the referenced item, or remove/retype the reference on the holder.\",\n );\n appendFinding(\n findings,\n references\n .filter((reference) => isTerminal(reference.holder_status))\n .map(formatDanglingReference),\n maxSampleSize,\n \"missing_reference_terminal\",\n \"info\",\n \"Terminal items may retain historical references, but absent targets remain unexplainable context.\",\n (count) => `${count} terminal dangling reference(s) to absent items`,\n \"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.\",\n );\n appendFinding(\n findings,\n assembly.dangling.no_active_blocker_sentinels.map(formatDanglingReference),\n maxSampleSize,\n \"legacy_no_blocker_sentinel\",\n \"info\",\n \"The pre-structured-dependency no-active-blocker sentinel is retired; real edges carry blocker state.\",\n (count) => `${count} legacy no-active-blocker sentinel reference(s)`,\n \"Delete the sentinel reference; blocker state is derived from blocked_by edges.\",\n );\n return findings;\n}\n\n/** Decide whether one audited node still participates in active scheduling. */\nfunction isActiveAuditMember(\n member: string,\n nodeStates: Map<string, AuditNodeState>,\n): boolean {\n const state = nodeStates.get(member);\n // A trimmed or custom assembly may omit a member's details. Treat that\n // unknown lifecycle conservatively as active so contradictions are never\n // silently downgraded to legacy history debt.\n if (!state) return true;\n return !state.terminal;\n}\n\n/** Collect ordering-cycle and lifecycle-block governance findings. */\nfunction collectOrderingFindings(\n assembly: WorkspaceRelationshipAssembly,\n nodeStates: Map<string, AuditNodeState>,\n isBlocked: (status: string) => boolean,\n maxSampleSize: number,\n): RelationshipAuditFinding[] {\n const findings: RelationshipAuditFinding[] = [];\n const orderingAdjacency = buildOrderingAdjacency(assembly);\n for (const cycle of collectOrderingCycles(orderingAdjacency)) {\n // A cycle whose members are all terminal is a historical contradiction:\n // it cannot make live work unschedulable, and \"repairing\" it would touch\n // closed items (changelog drag), so it downgrades to informational debt.\n const active = cycle.some((member) =>\n isActiveAuditMember(member, nodeStates),\n );\n findings.push(\n active\n ? buildFinding(\n \"ordering_cycle\",\n \"error\",\n \"Order-bearing relationship kinds must stay acyclic; a cycle makes every member unschedulable.\",\n (count) => `execution-order cycle across ${count} item(s)`,\n cycle,\n maxSampleSize,\n \"Remove or retype one ordering edge inside the cycle, or split the work so precedence is linear.\",\n )\n : buildFinding(\n \"legacy_ordering_cycle\",\n \"info\",\n \"Ordering cycles between exclusively terminal items are historical contradictions with no scheduling effect.\",\n (count) => `terminal-only execution-order cycle across ${count} item(s)`,\n cycle,\n maxSampleSize,\n \"Leave as history debt, or clean up in a dedicated changelog-safe closed-item batch; never repair closed items ad hoc.\",\n ),\n );\n }\n const predecessorsByNode = new Map<string, string[]>();\n for (const [predecessor, adjacent] of orderingAdjacency)\n for (const successor of adjacent) {\n const predecessors = predecessorsByNode.get(successor);\n if (predecessors) predecessors.push(predecessor);\n else predecessorsByNode.set(successor, [predecessor]);\n }\n const staleLifecycleBlocks = [...nodeStates.values()]\n .filter(\n (state) =>\n !state.missing &&\n !state.terminal &&\n isBlocked(state.status) &&\n !(predecessorsByNode.get(state.id) ?? []).some((predecessor) => {\n const predecessorState = nodeStates.get(predecessor);\n // A trimmed/custom assembly may omit predecessor details. Treat that\n // unknown state conservatively as potentially open instead of\n // falsely declaring the lifecycle block stale.\n return predecessorState === undefined || !predecessorState.terminal;\n }),\n )\n .map((state) => state.id);\n appendFinding(\n findings,\n staleLifecycleBlocks,\n maxSampleSize,\n \"stale_lifecycle_block\",\n \"warning\",\n \"A blocked lifecycle status must be backed by at least one open ordering predecessor.\",\n (count) => `${count} status-blocked item(s) with no open blocker edge`,\n \"Re-open the missing prerequisite as an edge, or move the item back to an active status.\",\n );\n return findings;\n}\n\n/** One duplicate-edge group in semantic orientation with its stored spellings. */\nexport interface DuplicateRelationshipEdgeGroup {\n /** Semantic tail node shared by every stored spelling. */\n from: string;\n /** Semantic head node shared by every stored spelling. */\n to: string;\n /** Stored parallel edges sorted by kind. */\n edges: RelationshipEdge[];\n}\n\n/** Format one duplicate-edge group as a compact deterministic evidence string. */\nexport function formatDuplicateEdgeGroup(\n group: DuplicateRelationshipEdgeGroup,\n): string {\n const kinds = group.edges\n .map((edge) => edge.kind)\n .sort((left, right) => left.localeCompare(right));\n return `${group.from} -> ${group.to} (${kinds.join(\" + \")})`;\n}\n\n/**\n * Collect the groups of parallel same-family stored edges over the directed\n * ordering and hierarchy families. Each family joins a kind with its inverse\n * spelling in semantic orientation, so a reciprocal pair such as\n * `A blocked_by B` plus `B blocks A` collapses onto one oriented endpoint\n * pair. Only groups holding at least two stored spellings are returned, in\n * deterministic orientation order with per-group edges sorted by kind, source,\n * then target — the exact stored identities remediation planning targets.\n */\nexport function collectDuplicateRelationshipEdgeGroups(\n assembly: WorkspaceRelationshipAssembly,\n): DuplicateRelationshipEdgeGroup[] {\n const registry = assembly.graph.registry();\n const groups = new Map<string, DuplicateRelationshipEdgeGroup>();\n for (const edge of assembly.graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!isTransitiveKind(definition)) continue;\n const oriented = orientTransitiveEdge(edge, definition);\n if (oriented.from === oriented.to) continue;\n const key = `${transitiveFamilyKey(definition)}::${oriented.from}::${oriented.to}`;\n const group = groups.get(key);\n if (group) group.edges.push(edge);\n else groups.set(key, { ...oriented, edges: [edge] });\n }\n const duplicated = [...groups.values()].filter(\n (group) => group.edges.length >= 2,\n );\n // Within one oriented group every stored spelling has a distinct kind: a\n // same-kind restatement of the same oriented pair would carry identical\n // endpoints and is deduplicated by edge identity during graph construction.\n for (const group of duplicated)\n group.edges.sort((left, right) => left.kind.localeCompare(right.kind));\n return duplicated.sort(\n (left, right) =>\n left.from.localeCompare(right.from) || left.to.localeCompare(right.to),\n );\n}\n\n/**\n * Collect duplicate stored-edge findings from the oriented duplicate groups.\n * Transitive-reduction redundancy analysis deliberately skips the direct edge\n * under test, so these exact parallels are invisible there and this is the\n * only surface that reports them.\n */\nfunction collectDuplicateEdgeFindings(\n assembly: WorkspaceRelationshipAssembly,\n nodeStates: Map<string, AuditNodeState>,\n maxSampleSize: number,\n): RelationshipAuditFinding[] {\n const active: string[] = [];\n const legacy: string[] = [];\n for (const group of collectDuplicateRelationshipEdgeGroups(assembly)) {\n const subjects =\n isActiveAuditMember(group.from, nodeStates) ||\n isActiveAuditMember(group.to, nodeStates)\n ? active\n : legacy;\n subjects.push(formatDuplicateEdgeGroup(group));\n }\n const findings: RelationshipAuditFinding[] = [];\n appendFinding(\n findings,\n active,\n maxSampleSize,\n \"duplicate_edge\",\n \"info\",\n \"One semantic relationship should be stored once; parallel same-family spellings (reciprocal inverse pairs included) add no information and skew degree metrics.\",\n (count) => `${count} duplicated relationship(s) between active endpoints`,\n \"Remove all but one stored spelling of the relationship; keep the canonical direction the holder declared first.\",\n );\n appendFinding(\n findings,\n legacy,\n maxSampleSize,\n \"legacy_duplicate_edge\",\n \"info\",\n \"Duplicated spellings between exclusively terminal items are historical noise with no scheduling effect.\",\n (count) => `${count} duplicated relationship(s) between terminal endpoints`,\n \"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.\",\n );\n return findings;\n}\n\n/** Compute structural coverage metrics and coverage-policy findings. */\nfunction collectCoverageReport(\n assembly: WorkspaceRelationshipAssembly,\n nodeStates: Map<string, AuditNodeState>,\n exemptIsolates: Set<string>,\n maxSampleSize: number,\n edgesByKind: Record<string, number>,\n): RelationshipAuditReport {\n let activeNodes = 0;\n let missingNodes = 0;\n let isolatedActiveNodes = 0;\n let degreeLeqOneActive = 0;\n const isolates: string[] = [];\n const sparse: string[] = [];\n for (const id of assembly.graph.nodes()) {\n const state = nodeStates.get(id);\n /* c8 ignore next -- every graph node originates from assembly details by construction */\n if (!state) continue;\n if (state.missing) {\n missingNodes += 1;\n continue;\n }\n if (state.terminal) continue;\n activeNodes += 1;\n const degree = assembly.graph.incidentEdges(id).length;\n if (degree > 1) continue;\n degreeLeqOneActive += 1;\n if (degree === 0) isolatedActiveNodes += 1;\n if (exemptIsolates.has(id.toLowerCase())) continue;\n if (degree === 0) isolates.push(id);\n else sparse.push(id);\n }\n const findings: RelationshipAuditFinding[] = [];\n appendFinding(\n findings,\n isolates,\n maxSampleSize,\n \"isolated_active_node\",\n \"warning\",\n \"Active work should be reachable from the graph unless explicitly declared a valid isolate.\",\n (count) => `${count} active item(s) with no relationships`,\n \"Link the item to its parent, prerequisite, or origin — or register it as an exempt isolate.\",\n );\n appendFinding(\n findings,\n sparse,\n maxSampleSize,\n \"sparse_active_node\",\n \"info\",\n \"Active items with a single edge often miss an honest semantic partner; sparse is not automatically defective.\",\n (count) => `${count} active item(s) with exactly one relationship`,\n \"Investigate for an honest second edge (story->task, defect family, cross-epic complement); do not fabricate one.\",\n );\n return {\n findings,\n profile: {\n nodes: assembly.graph.nodes().length,\n edges: assembly.graph.edges().length,\n edges_by_kind: Object.fromEntries(\n Object.entries(edgesByKind).sort(([left], [right]) =>\n left.localeCompare(right),\n ),\n ),\n active_nodes: activeNodes,\n missing_nodes: missingNodes,\n isolated_active_nodes: isolatedActiveNodes,\n degree_leq_one_active_nodes: degreeLeqOneActive,\n },\n };\n}\n\n/**\n * Audit one assembled workspace relationship graph against the shared\n * governance policy and return deterministic machine-readable findings plus a\n * structural coverage profile.\n *\n * The audit is read-only and never proposes inventing an edge: integrity\n * findings report evidence for investigation, coverage findings honor explicit\n * isolate exemptions, and cycle findings enumerate the strongly connected\n * members so callers can decide which edge to retype, remove, or waive.\n */\nexport function auditWorkspaceRelationshipGraph(\n assembly: WorkspaceRelationshipAssembly,\n options: RelationshipAuditOptions = {},\n): RelationshipAuditReport {\n const isTerminal =\n options.isTerminal ??\n ((status: string) => status === \"closed\" || status === \"canceled\");\n const isBlocked =\n options.isBlocked ?? ((status: string) => status === \"blocked\");\n const maxSampleSize = options.maxSampleSize ?? DEFAULT_MAX_SAMPLE_SIZE;\n if (!Number.isInteger(maxSampleSize) || maxSampleSize < 1)\n throw new TypeError(\n `Invalid audit sample bound: ${String(options.maxSampleSize)}`,\n );\n const exemptIsolates = new Set(\n (options.exemptIsolates ?? [])\n .filter((id): id is string => typeof id === \"string\")\n .map((id) => id.trim().toLowerCase()),\n );\n const nodeStates = new Map<string, AuditNodeState>(\n assembly.details.map((detail) => [\n detail.id,\n {\n id: detail.id,\n status: detail.status,\n missing: assembly.missingIdSet.has(detail.id.toLowerCase()),\n terminal: isTerminal(detail.status),\n },\n ]),\n );\n options.signal?.throwIfAborted();\n\n const edgesByKind: Record<string, number> = {};\n for (const edge of assembly.graph.edges())\n edgesByKind[edge.kind] = (edgesByKind[edge.kind] ?? 0) + 1;\n const findings = collectIntegrityFindings(\n assembly,\n isTerminal,\n maxSampleSize,\n );\n options.signal?.throwIfAborted();\n findings.push(\n ...collectOrderingFindings(assembly, nodeStates, isBlocked, maxSampleSize),\n );\n options.signal?.throwIfAborted();\n findings.push(\n ...collectDuplicateEdgeFindings(assembly, nodeStates, maxSampleSize),\n );\n options.signal?.throwIfAborted();\n const coverage = collectCoverageReport(\n assembly,\n nodeStates,\n exemptIsolates,\n maxSampleSize,\n edgesByKind,\n );\n findings.push(...coverage.findings);\n\n findings.sort(\n (left, right) =>\n SEVERITY_RANK[left.severity] - SEVERITY_RANK[right.severity] ||\n left.code.localeCompare(right.code) ||\n left.sample[0]!.localeCompare(right.sample[0]!),\n );\n return {\n findings,\n profile: coverage.profile,\n };\n}\n"],"names":[],"mappings":";;AAeA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GAC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.js","sources":["sdk/graph/governance.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/governance\n *\n * Policy-aware relationship-graph quality audit shared by validation, health,\n * and package governance surfaces. The audit inspects one assembled workspace\n * graph and reports machine-readable findings — integrity gaps, ordering\n * cycles, duplicated edge spellings, stale lifecycle blocks, and coverage\n * outliers — without inventing edges or assuming that sparse connectivity is\n * defective. Findings gate severity on lifecycle: contradictions confined to\n * terminal items downgrade to informational `legacy_*` codes because repairing\n * them would mutate closed history. Every finding names the violated policy,\n * carries a deterministic bounded sample, and proposes a safe next action so\n * agents can plan remediation without re-deriving context.\n */\nimport type { RelationshipEdge } from \"../relationships.js\";\nimport {\n isTransitiveKind,\n orientTransitiveEdge,\n transitiveFamilyKey,\n} from \"./analytics.js\";\nimport type { WorkspaceRelationshipAssembly } from \"./assembly.js\";\n\n/** Severity ladder shared by every relationship audit finding. */\nexport type RelationshipAuditSeverity = \"error\" | \"warning\" | \"info\";\n\n/** Machine-readable identifier for one relationship audit finding family. */\nexport type RelationshipAuditFindingCode =\n | \"missing_reference_active\"\n | \"missing_reference_terminal\"\n | \"legacy_no_blocker_sentinel\"\n | \"ordering_cycle\"\n | \"legacy_ordering_cycle\"\n | \"duplicate_edge\"\n | \"legacy_duplicate_edge\"\n | \"duplicate_dependency_row\"\n | \"legacy_duplicate_dependency_row\"\n | \"stale_lifecycle_block\"\n | \"isolated_active_node\"\n | \"sparse_active_node\";\n\n/** One policy-aware relationship audit finding with bounded evidence. */\nexport interface RelationshipAuditFinding {\n /** Machine-readable finding family identifier. */\n code: RelationshipAuditFindingCode;\n /** Severity of the violated policy. */\n severity: RelationshipAuditSeverity;\n /** Policy statement this finding violates. */\n policy: string;\n /** Human-readable summary including the affected count. */\n message: string;\n /** Total number of affected subjects, independent of sample bounding. */\n count: number;\n /** Deterministic bounded sample of affected subjects. */\n sample: string[];\n /** Whether {@link sample} was truncated by the configured sample bound. */\n sample_truncated: boolean;\n /** Safe machine-actionable next step; audits never invent or auto-apply edges. */\n remediation: string;\n}\n\n/** Per-item-type connectivity coverage inside a coverage profile. */\nexport interface RelationshipCoverageTypeProfile {\n /** Active nodes declaring this item type. */\n active: number;\n /** Active nodes of this type with no incident edges. */\n isolated: number;\n /** Active nodes of this type with at most one incident edge, isolates included. */\n degree_leq_one: number;\n}\n\n/** Aggregate structural coverage metrics for one assembled workspace graph. */\nexport interface RelationshipCoverageProfile {\n /** Total indexed nodes including materialized missing placeholders. */\n nodes: number;\n /** Total deduplicated indexed edges. */\n edges: number;\n /** Deterministic per-kind edge counts. */\n edges_by_kind: Record<string, number>;\n /** Nodes whose lifecycle status is active (non-terminal, non-missing). */\n active_nodes: number;\n /** Materialized placeholder nodes for referenced-but-absent items. */\n missing_nodes: number;\n /** Active nodes with no incident edges at all. */\n isolated_active_nodes: number;\n /** Active nodes with at most one incident edge, isolates included. */\n degree_leq_one_active_nodes: number;\n /** Deterministic per-type connectivity coverage; untyped nodes bucket under `(untyped)`. */\n coverage_by_type: Record<string, RelationshipCoverageTypeProfile>;\n}\n\n/** Tuning and policy inputs accepted by the relationship audit. */\nexport interface RelationshipAuditOptions {\n /** Terminal-lifecycle predicate; defaults to the built-in closed/canceled statuses. */\n isTerminal?: (status: string) => boolean;\n /** Blocked-lifecycle predicate for stale-block detection; defaults to `status === \"blocked\"`. */\n isBlocked?: (status: string) => boolean;\n /** Node identifiers that are explicitly valid isolates (roots, archives, scratch work). */\n exemptIsolates?: readonly string[];\n /** Item types whose active nodes are policy-valid isolates or sparse nodes (case-insensitive); they stay in the coverage profile but raise no coverage finding. */\n isolateExemptTypes?: readonly string[];\n /** Maximum sample entries retained per finding; defaults to 25. */\n maxSampleSize?: number;\n /** Abort signal checked between finding families. */\n signal?: AbortSignal;\n}\n\n/** Complete deterministic result of one relationship-graph audit. */\nexport interface RelationshipAuditReport {\n /** Findings ordered by severity, then code, then first sample subject. */\n findings: RelationshipAuditFinding[];\n /** Structural coverage metrics computed during the audit. */\n profile: RelationshipCoverageProfile;\n}\n\n/** Default bounded sample size applied to every finding family. */\nconst DEFAULT_MAX_SAMPLE_SIZE = 25;\n\n/** Rank used to order findings by decreasing severity. */\nconst SEVERITY_RANK: Record<RelationshipAuditSeverity, number> = {\n error: 0,\n warning: 1,\n info: 2,\n};\n\n/** Internal per-node lifecycle classification resolved once per audit. */\ninterface AuditNodeState {\n /** Original-case node identifier. */\n id: string;\n /** Raw lifecycle status string from assembly details. */\n status: string;\n /** Whether the node is a materialized missing placeholder. */\n missing: boolean;\n /** Whether the node's lifecycle status is terminal. */\n terminal: boolean;\n /** Declared item type, when the assembly carried one. */\n type?: string;\n}\n\n/** Mutable state shared by iterative Tarjan frames. */\ninterface TarjanState {\n /** Discovery index assigned to each visited node. */\n indexes: Map<string, number>;\n /** Lowest reachable discovery index per visited node. */\n lowLinks: Map<string, number>;\n /** Nodes that still belong to an unfinished component. */\n onStack: Set<string>;\n /** Component-membership stack. */\n stack: string[];\n /** Completed cyclic components. */\n components: string[][];\n /** Discovery index assigned to the next unseen node. */\n nextIndex: number;\n}\n\n/** One explicit depth-first frame used by iterative Tarjan traversal. */\ninterface TarjanFrame {\n /** Node currently being expanded. */\n node: string;\n /** Index of the next successor to inspect. */\n neighborIndex: number;\n}\n\n/** Build one finding with deterministic bounded sampling over sorted subjects. */\nfunction buildFinding(\n code: RelationshipAuditFindingCode,\n severity: RelationshipAuditSeverity,\n policy: string,\n describe: (count: number) => string,\n subjects: readonly string[],\n maxSampleSize: number,\n remediation: string,\n): RelationshipAuditFinding {\n const sorted = [...subjects].sort((left, right) => left.localeCompare(right));\n return {\n code,\n severity,\n policy,\n message: describe(sorted.length),\n count: sorted.length,\n sample: sorted.slice(0, maxSampleSize),\n sample_truncated: sorted.length > maxSampleSize,\n remediation,\n };\n}\n/** Resolve the ordering-only successor adjacency for cycle analysis. */\nfunction buildOrderingAdjacency(\n assembly: WorkspaceRelationshipAssembly,\n): Map<string, string[]> {\n const registry = assembly.graph.registry();\n const successors = new Map<string, string[]>();\n for (const edge of assembly.graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!definition.ordering) continue;\n // Orient every ordering edge predecessor -> successor so inverse spellings\n // (blocked_by/blocks) land in one canonical execution-order digraph.\n const [predecessor, successor] =\n (definition.precedence ?? \"source_before_target\") ===\n \"target_before_source\"\n ? [edge.target, edge.source]\n : [edge.source, edge.target];\n const adjacent = successors.get(predecessor);\n if (adjacent) adjacent.push(successor);\n else successors.set(predecessor, [successor]);\n }\n for (const adjacent of successors.values())\n adjacent.sort((left, right) => left.localeCompare(right));\n return successors;\n}\n\n/** Register one newly discovered Tarjan node. */\nfunction registerTarjanNode(node: string, state: TarjanState): void {\n state.indexes.set(node, state.nextIndex);\n state.lowLinks.set(node, state.nextIndex);\n state.nextIndex += 1;\n state.stack.push(node);\n state.onStack.add(node);\n}\n\n/** Visit one pending successor, returning whether the frame had work left. */\nfunction visitNextTarjanNeighbor(\n frame: TarjanFrame,\n frames: TarjanFrame[],\n successors: Map<string, string[]>,\n state: TarjanState,\n): boolean {\n const neighbors = successors.get(frame.node) ?? [];\n if (frame.neighborIndex >= neighbors.length) return false;\n const neighbor = neighbors[frame.neighborIndex]!;\n frame.neighborIndex += 1;\n if (!state.indexes.has(neighbor)) {\n registerTarjanNode(neighbor, state);\n frames.push({ node: neighbor, neighborIndex: 0 });\n } else if (state.onStack.has(neighbor)) {\n state.lowLinks.set(\n frame.node,\n Math.min(state.lowLinks.get(frame.node)!, state.indexes.get(neighbor)!),\n );\n }\n return true;\n}\n\n/** Complete one Tarjan frame and emit its component when it is a root. */\nfunction completeTarjanFrame(\n frame: TarjanFrame,\n frames: TarjanFrame[],\n successors: Map<string, string[]>,\n state: TarjanState,\n): void {\n frames.pop();\n const parent = frames.at(-1);\n if (parent)\n state.lowLinks.set(\n parent.node,\n Math.min(\n state.lowLinks.get(parent.node)!,\n state.lowLinks.get(frame.node)!,\n ),\n );\n if (state.lowLinks.get(frame.node) !== state.indexes.get(frame.node)) return;\n const component: string[] = [];\n while (true) {\n const member = state.stack.pop()!;\n state.onStack.delete(member);\n component.push(member);\n if (member === frame.node) break;\n }\n if (\n component.length > 1 ||\n (component.length === 1 &&\n successors.get(component[0]!)?.includes(component[0]!))\n )\n state.components.push(\n component.sort((left, right) => left.localeCompare(right)),\n );\n}\n\n/**\n * Enumerate strongly connected components with more than one member (or a\n * self-loop) over an ordering-only successor digraph using an iterative Tarjan\n * traversal. Only order-bearing kinds should participate: associative kinds\n * such as `related` cannot create execution-order contradictions and stay out\n * of cycle analysis by policy. Exported so incremental consumers (mutation\n * advisories) share one cycle semantics with the workspace audit.\n */\nexport function collectOrderingCycles(\n successors: Map<string, string[]>,\n): string[][] {\n const state: TarjanState = {\n indexes: new Map(),\n lowLinks: new Map(),\n onStack: new Set(),\n stack: [],\n components: [],\n nextIndex: 0,\n };\n const roots = [...successors.keys()].sort((left, right) =>\n left.localeCompare(right),\n );\n for (const root of roots) {\n if (state.indexes.has(root)) continue;\n // Explicit frame stack keeps the traversal safe on deep dependency chains.\n const frames: TarjanFrame[] = [{ node: root, neighborIndex: 0 }];\n registerTarjanNode(root, state);\n while (frames.length > 0) {\n const frame = frames.at(-1)!;\n if (visitNextTarjanNeighbor(frame, frames, successors, state)) continue;\n completeTarjanFrame(frame, frames, successors, state);\n }\n }\n return state.components.sort((left, right) =>\n left[0]!.localeCompare(right[0]!),\n );\n}\n\n/** Format one dangling reference as a compact deterministic evidence string. */\nfunction formatDanglingReference(reference: {\n holder_id: string;\n target_id: string;\n kind: string;\n}): string {\n return `${reference.holder_id} -> ${reference.target_id} (${reference.kind})`;\n}\n\n/** Append one finding only when its subject collection is non-empty. */\nfunction appendFinding(\n findings: RelationshipAuditFinding[],\n subjects: readonly string[],\n maxSampleSize: number,\n code: RelationshipAuditFindingCode,\n severity: RelationshipAuditSeverity,\n policy: string,\n describe: (count: number) => string,\n remediation: string,\n): void {\n if (subjects.length === 0) return;\n findings.push(\n buildFinding(\n code,\n severity,\n policy,\n describe,\n subjects,\n maxSampleSize,\n remediation,\n ),\n );\n}\n\n/** Collect dangling-reference and retired-sentinel governance findings. */\nfunction collectIntegrityFindings(\n assembly: WorkspaceRelationshipAssembly,\n isTerminal: (status: string) => boolean,\n maxSampleSize: number,\n): RelationshipAuditFinding[] {\n const findings: RelationshipAuditFinding[] = [];\n const references = [\n ...assembly.dangling.active,\n ...assembly.dangling.legacy_terminal,\n ].filter((reference) => !reference.no_active_blocker_sentinel);\n appendFinding(\n findings,\n references\n .filter((reference) => !isTerminal(reference.holder_status))\n .map(formatDanglingReference),\n maxSampleSize,\n \"missing_reference_active\",\n \"error\",\n \"Active items must not reference absent targets; missing prerequisites distort scheduling.\",\n (count) => `${count} active dangling reference(s) to absent items`,\n \"Restore or re-create the referenced item, or remove/retype the reference on the holder.\",\n );\n appendFinding(\n findings,\n references\n .filter((reference) => isTerminal(reference.holder_status))\n .map(formatDanglingReference),\n maxSampleSize,\n \"missing_reference_terminal\",\n \"info\",\n \"Terminal items may retain historical references, but absent targets remain unexplainable context.\",\n (count) => `${count} terminal dangling reference(s) to absent items`,\n \"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.\",\n );\n appendFinding(\n findings,\n assembly.dangling.no_active_blocker_sentinels.map(formatDanglingReference),\n maxSampleSize,\n \"legacy_no_blocker_sentinel\",\n \"info\",\n \"The pre-structured-dependency no-active-blocker sentinel is retired; real edges carry blocker state.\",\n (count) => `${count} legacy no-active-blocker sentinel reference(s)`,\n \"Delete the sentinel reference; blocker state is derived from blocked_by edges.\",\n );\n return findings;\n}\n\n/** Decide whether one audited node still participates in active scheduling. */\nfunction isActiveAuditMember(\n member: string,\n nodeStates: Map<string, AuditNodeState>,\n): boolean {\n const state = nodeStates.get(member);\n // A trimmed or custom assembly may omit a member's details. Treat that\n // unknown lifecycle conservatively as active so contradictions are never\n // silently downgraded to legacy history debt.\n if (!state) return true;\n return !state.terminal;\n}\n\n/** Collect ordering-cycle and lifecycle-block governance findings. */\nfunction collectOrderingFindings(\n assembly: WorkspaceRelationshipAssembly,\n nodeStates: Map<string, AuditNodeState>,\n isBlocked: (status: string) => boolean,\n maxSampleSize: number,\n): RelationshipAuditFinding[] {\n const findings: RelationshipAuditFinding[] = [];\n const orderingAdjacency = buildOrderingAdjacency(assembly);\n for (const cycle of collectOrderingCycles(orderingAdjacency)) {\n // A cycle whose members are all terminal is a historical contradiction:\n // it cannot make live work unschedulable, and \"repairing\" it would touch\n // closed items (changelog drag), so it downgrades to informational debt.\n const active = cycle.some((member) =>\n isActiveAuditMember(member, nodeStates),\n );\n findings.push(\n active\n ? buildFinding(\n \"ordering_cycle\",\n \"error\",\n \"Order-bearing relationship kinds must stay acyclic; a cycle makes every member unschedulable.\",\n (count) => `execution-order cycle across ${count} item(s)`,\n cycle,\n maxSampleSize,\n \"Remove or retype one ordering edge inside the cycle, or split the work so precedence is linear.\",\n )\n : buildFinding(\n \"legacy_ordering_cycle\",\n \"info\",\n \"Ordering cycles between exclusively terminal items are historical contradictions with no scheduling effect.\",\n (count) =>\n `terminal-only execution-order cycle across ${count} item(s)`,\n cycle,\n maxSampleSize,\n \"Leave as history debt, or clean up in a dedicated changelog-safe closed-item batch; never repair closed items ad hoc.\",\n ),\n );\n }\n const predecessorsByNode = new Map<string, string[]>();\n for (const [predecessor, adjacent] of orderingAdjacency)\n for (const successor of adjacent) {\n const predecessors = predecessorsByNode.get(successor);\n if (predecessors) predecessors.push(predecessor);\n else predecessorsByNode.set(successor, [predecessor]);\n }\n const staleLifecycleBlocks = [...nodeStates.values()]\n .filter(\n (state) =>\n !state.missing &&\n !state.terminal &&\n isBlocked(state.status) &&\n !(predecessorsByNode.get(state.id) ?? []).some((predecessor) => {\n const predecessorState = nodeStates.get(predecessor);\n // A trimmed/custom assembly may omit predecessor details. Treat that\n // unknown state conservatively as potentially open instead of\n // falsely declaring the lifecycle block stale.\n return predecessorState === undefined || !predecessorState.terminal;\n }),\n )\n .map((state) => state.id);\n appendFinding(\n findings,\n staleLifecycleBlocks,\n maxSampleSize,\n \"stale_lifecycle_block\",\n \"warning\",\n \"A blocked lifecycle status must be backed by at least one open ordering predecessor.\",\n (count) => `${count} status-blocked item(s) with no open blocker edge`,\n \"Re-open the missing prerequisite as an edge, or move the item back to an active status.\",\n );\n return findings;\n}\n\n/** One duplicate-edge group in semantic orientation with its stored spellings. */\nexport interface DuplicateRelationshipEdgeGroup {\n /** Semantic tail node shared by every stored spelling. */\n from: string;\n /** Semantic head node shared by every stored spelling. */\n to: string;\n /** Stored parallel edges sorted by kind. */\n edges: RelationshipEdge[];\n}\n\n/** Format one duplicate-edge group as a compact deterministic evidence string. */\nexport function formatDuplicateEdgeGroup(\n group: DuplicateRelationshipEdgeGroup,\n): string {\n const kinds = group.edges\n .map((edge) => edge.kind)\n .sort((left, right) => left.localeCompare(right));\n return `${group.from} -> ${group.to} (${kinds.join(\" + \")})`;\n}\n\n/**\n * Collect the groups of parallel same-family stored edges over the directed\n * ordering and hierarchy families. Each family joins a kind with its inverse\n * spelling in semantic orientation, so a reciprocal pair such as\n * `A blocked_by B` plus `B blocks A` collapses onto one oriented endpoint\n * pair. Only groups holding at least two stored spellings are returned, in\n * deterministic orientation order with per-group edges sorted by kind, source,\n * then target — the exact stored identities remediation planning targets.\n */\nexport function collectDuplicateRelationshipEdgeGroups(\n assembly: WorkspaceRelationshipAssembly,\n): DuplicateRelationshipEdgeGroup[] {\n const registry = assembly.graph.registry();\n const groups = new Map<string, DuplicateRelationshipEdgeGroup>();\n for (const edge of assembly.graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!isTransitiveKind(definition)) continue;\n const oriented = orientTransitiveEdge(edge, definition);\n if (oriented.from === oriented.to) continue;\n const key = `${transitiveFamilyKey(definition)}::${oriented.from}::${oriented.to}`;\n const group = groups.get(key);\n if (group) group.edges.push(edge);\n else groups.set(key, { ...oriented, edges: [edge] });\n }\n const duplicated = [...groups.values()].filter(\n (group) => group.edges.length >= 2,\n );\n // Within one oriented group every stored spelling has a distinct kind: a\n // same-kind restatement of the same oriented pair would carry identical\n // endpoints and is deduplicated by edge identity during graph construction.\n for (const group of duplicated)\n group.edges.sort((left, right) => left.kind.localeCompare(right.kind));\n return duplicated.sort(\n (left, right) =>\n left.from.localeCompare(right.from) || left.to.localeCompare(right.to),\n );\n}\n\n/**\n * Collect duplicate stored-edge findings from the oriented duplicate groups.\n * Transitive-reduction redundancy analysis deliberately skips the direct edge\n * under test, so these exact parallels are invisible there and this is the\n * only surface that reports them.\n */\nfunction collectDuplicateEdgeFindings(\n assembly: WorkspaceRelationshipAssembly,\n nodeStates: Map<string, AuditNodeState>,\n maxSampleSize: number,\n): RelationshipAuditFinding[] {\n const active: string[] = [];\n const legacy: string[] = [];\n for (const group of collectDuplicateRelationshipEdgeGroups(assembly)) {\n const subjects =\n isActiveAuditMember(group.from, nodeStates) ||\n isActiveAuditMember(group.to, nodeStates)\n ? active\n : legacy;\n subjects.push(formatDuplicateEdgeGroup(group));\n }\n const findings: RelationshipAuditFinding[] = [];\n appendFinding(\n findings,\n active,\n maxSampleSize,\n \"duplicate_edge\",\n \"info\",\n \"One semantic relationship should be stored once; parallel same-family spellings (reciprocal inverse pairs included) add no information and skew degree metrics.\",\n (count) => `${count} duplicated relationship(s) between active endpoints`,\n \"Remove all but one stored spelling of the relationship; keep the canonical direction the holder declared first.\",\n );\n appendFinding(\n findings,\n legacy,\n maxSampleSize,\n \"legacy_duplicate_edge\",\n \"info\",\n \"Duplicated spellings between exclusively terminal items are historical noise with no scheduling effect.\",\n (count) => `${count} duplicated relationship(s) between terminal endpoints`,\n \"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.\",\n );\n return findings;\n}\n\n/**\n * Collect storage-integrity findings for raw dependency rows whose exact\n * identity is stored more than once on one holder. Graph edge-identity dedup\n * hides these from every assembled-graph surface (duplicate_edge only covers\n * cross-spelling parallels), so the audit reports them from the pre-assembly\n * scan carried on the assembly.\n */\nfunction collectDuplicateRowFindings(\n assembly: WorkspaceRelationshipAssembly,\n maxSampleSize: number,\n): RelationshipAuditFinding[] {\n const active: string[] = [];\n const legacy: string[] = [];\n // Public/JSON-parsed assemblies produced before duplicate-row governance may omit this field.\n for (const row of assembly.duplicateRows ?? []) {\n (row.legacy_terminal ? legacy : active).push(\n `${row.holder_id} -> ${row.target_id} (${row.kind} x${row.occurrences})`,\n );\n }\n const findings: RelationshipAuditFinding[] = [];\n appendFinding(\n findings,\n active,\n maxSampleSize,\n \"duplicate_dependency_row\",\n \"warning\",\n \"One dependency row must be stored once per holder; identical repeated rows are a storage-layer defect invisible to the assembled graph.\",\n (count) =>\n `${count} exactly duplicated stored dependency row(s) on active holder(s)`,\n \"Remove the repeated rows so the dependency is stored exactly once; graph semantics are unchanged.\",\n );\n appendFinding(\n findings,\n legacy,\n maxSampleSize,\n \"legacy_duplicate_dependency_row\",\n \"info\",\n \"Identical repeated dependency rows on terminal holders are historical storage noise with no scheduling effect.\",\n (count) =>\n `${count} exactly duplicated stored dependency row(s) on terminal holder(s)`,\n \"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.\",\n );\n return findings;\n}\n\n/** Compute structural coverage metrics and coverage-policy findings. */\n/** Mutable coverage tallies accumulated across active graph nodes. */\ninterface CoverageTallies {\n /** Active node count. */\n active: number;\n /** Missing placeholder count. */\n missing: number;\n /** Isolated active node count. */\n isolated: number;\n /** Degree-at-most-one active node count, isolates included. */\n degreeLeqOne: number;\n /** Non-exempt isolate finding subjects. */\n isolates: string[];\n /** Non-exempt single-edge finding subjects. */\n sparse: string[];\n /** Per-type connectivity tallies. */\n byType: Map<string, RelationshipCoverageTypeProfile>;\n}\n\n/** Fold one active node's degree into the aggregate and per-type coverage tallies. */\nfunction tallyActiveCoverageNode(\n tallies: CoverageTallies,\n state: AuditNodeState,\n degree: number,\n exemptIsolates: Set<string>,\n isolateExemptTypes: Set<string>,\n): void {\n tallies.active += 1;\n const typeKey = state.type ?? \"(untyped)\";\n let typeProfile = tallies.byType.get(typeKey);\n if (!typeProfile) {\n typeProfile = { active: 0, isolated: 0, degree_leq_one: 0 };\n tallies.byType.set(typeKey, typeProfile);\n }\n typeProfile.active += 1;\n if (degree > 1) return;\n tallies.degreeLeqOne += 1;\n typeProfile.degree_leq_one += 1;\n if (degree === 0) {\n tallies.isolated += 1;\n typeProfile.isolated += 1;\n }\n if (\n exemptIsolates.has(state.id.toLowerCase()) ||\n isolateExemptTypes.has(typeKey.toLowerCase())\n )\n return;\n if (degree === 0) tallies.isolates.push(state.id);\n else tallies.sparse.push(state.id);\n}\n\nfunction collectCoverageReport(\n assembly: WorkspaceRelationshipAssembly,\n nodeStates: Map<string, AuditNodeState>,\n exemptIsolates: Set<string>,\n isolateExemptTypes: Set<string>,\n maxSampleSize: number,\n edgesByKind: Record<string, number>,\n): RelationshipAuditReport {\n const tallies: CoverageTallies = {\n active: 0,\n missing: 0,\n isolated: 0,\n degreeLeqOne: 0,\n isolates: [],\n sparse: [],\n byType: new Map(),\n };\n for (const id of assembly.graph.nodes()) {\n const state = nodeStates.get(id);\n /* c8 ignore next -- every graph node originates from assembly details by construction */\n if (!state) continue;\n if (state.missing) {\n tallies.missing += 1;\n continue;\n }\n if (state.terminal) continue;\n tallyActiveCoverageNode(\n tallies,\n state,\n assembly.graph.incidentEdges(id).length,\n exemptIsolates,\n isolateExemptTypes,\n );\n }\n const { isolates, sparse } = tallies;\n const findings: RelationshipAuditFinding[] = [];\n appendFinding(\n findings,\n isolates,\n maxSampleSize,\n \"isolated_active_node\",\n \"warning\",\n \"Active work should be reachable from the graph unless explicitly declared a valid isolate.\",\n (count) => `${count} active item(s) with no relationships`,\n \"Link the item to its parent, prerequisite, or origin — or register it as an exempt isolate.\",\n );\n appendFinding(\n findings,\n sparse,\n maxSampleSize,\n \"sparse_active_node\",\n \"info\",\n \"Active items with a single edge often miss an honest semantic partner; sparse is not automatically defective.\",\n (count) => `${count} active item(s) with exactly one relationship`,\n \"Investigate for an honest second edge (story->task, defect family, cross-epic complement); do not fabricate one.\",\n );\n return {\n findings,\n profile: {\n nodes: assembly.graph.nodes().length,\n edges: assembly.graph.edges().length,\n edges_by_kind: Object.fromEntries(\n Object.entries(edgesByKind).sort(([left], [right]) =>\n left.localeCompare(right),\n ),\n ),\n active_nodes: tallies.active,\n missing_nodes: tallies.missing,\n isolated_active_nodes: tallies.isolated,\n degree_leq_one_active_nodes: tallies.degreeLeqOne,\n coverage_by_type: Object.fromEntries(\n [...tallies.byType.entries()].sort(([left], [right]) =>\n left < right ? -1 : 1,\n ),\n ),\n },\n };\n}\n\n/**\n * Audit one assembled workspace relationship graph against the shared\n * governance policy and return deterministic machine-readable findings plus a\n * structural coverage profile.\n *\n * The audit is read-only and never proposes inventing an edge: integrity\n * findings report evidence for investigation, coverage findings honor explicit\n * isolate exemptions, and cycle findings enumerate the strongly connected\n * members so callers can decide which edge to retype, remove, or waive.\n */\nexport function auditWorkspaceRelationshipGraph(\n assembly: WorkspaceRelationshipAssembly,\n options: RelationshipAuditOptions = {},\n): RelationshipAuditReport {\n const isTerminal =\n options.isTerminal ??\n ((status: string) => status === \"closed\" || status === \"canceled\");\n const isBlocked =\n options.isBlocked ?? ((status: string) => status === \"blocked\");\n const maxSampleSize = options.maxSampleSize ?? DEFAULT_MAX_SAMPLE_SIZE;\n if (!Number.isInteger(maxSampleSize) || maxSampleSize < 1)\n throw new TypeError(\n `Invalid audit sample bound: ${String(options.maxSampleSize)}`,\n );\n const exemptIsolates = new Set(\n (options.exemptIsolates ?? [])\n .filter((id): id is string => typeof id === \"string\")\n .map((id) => id.trim().toLowerCase()),\n );\n const isolateExemptTypes = new Set(\n (options.isolateExemptTypes ?? [])\n .filter((type): type is string => typeof type === \"string\")\n .map((type) => type.trim().toLowerCase()),\n );\n const nodeStates = new Map<string, AuditNodeState>(\n assembly.details.map((detail) => [\n detail.id,\n {\n id: detail.id,\n status: detail.status,\n missing: assembly.missingIdSet.has(detail.id.toLowerCase()),\n terminal: isTerminal(detail.status),\n ...(detail.type === undefined ? {} : { type: detail.type }),\n },\n ]),\n );\n options.signal?.throwIfAborted();\n\n const edgesByKind: Record<string, number> = {};\n for (const edge of assembly.graph.edges())\n edgesByKind[edge.kind] = (edgesByKind[edge.kind] ?? 0) + 1;\n const findings = collectIntegrityFindings(\n assembly,\n isTerminal,\n maxSampleSize,\n );\n options.signal?.throwIfAborted();\n findings.push(\n ...collectOrderingFindings(assembly, nodeStates, isBlocked, maxSampleSize),\n );\n options.signal?.throwIfAborted();\n findings.push(\n ...collectDuplicateEdgeFindings(assembly, nodeStates, maxSampleSize),\n ...collectDuplicateRowFindings(assembly, maxSampleSize),\n );\n options.signal?.throwIfAborted();\n const coverage = collectCoverageReport(\n assembly,\n nodeStates,\n exemptIsolates,\n isolateExemptTypes,\n maxSampleSize,\n edgesByKind,\n );\n findings.push(...coverage.findings);\n\n findings.sort(\n (left, right) =>\n SEVERITY_RANK[left.severity] - SEVERITY_RANK[right.severity] ||\n left.code.localeCompare(right.code) ||\n left.sample[0]!.localeCompare(right.sample[0]!),\n );\n return {\n findings,\n profile: coverage.profile,\n };\n}\n\n/** One persisted point-in-time audit census used for temporal comparison. */\nexport interface RelationshipAuditSnapshot {\n /** ISO timestamp the snapshot was taken at. */\n saved_at: string;\n /** Workspace graph fingerprint of the audited item snapshot. */\n fingerprint: string;\n /** Affected-subject counts keyed by finding code at snapshot time. */\n affected_subjects_by_code: Record<string, number>;\n /** Structural coverage profile at snapshot time. */\n profile: RelationshipCoverageProfile;\n}\n\n/** Signed change between two audit snapshots; zero-change keys are dropped. */\nexport interface RelationshipAuditDelta {\n /** ISO timestamp of the baseline snapshot the delta is measured against. */\n baseline_saved_at: string;\n /** Whether both snapshots audited the identical workspace fingerprint. */\n same_snapshot: boolean;\n /** Signed affected-subject deltas keyed by finding code. */\n affected_subjects_by_code: Record<string, number>;\n /** Signed structural profile deltas. */\n profile: {\n /** Node-count change including missing placeholders. */\n nodes: number;\n /** Deduplicated edge-count change. */\n edges: number;\n /** Active-node-count change. */\n active_nodes: number;\n /** Missing-placeholder-count change. */\n missing_nodes: number;\n /** Isolated-active-node-count change. */\n isolated_active_nodes: number;\n /** Degree-at-most-one active-node-count change. */\n degree_leq_one_active_nodes: number;\n /** Signed per-kind edge-count deltas; unchanged kinds are dropped. */\n edges_by_kind: Record<string, number>;\n /** Signed per-type coverage deltas; unchanged types are dropped. */\n coverage_by_type: Record<string, RelationshipCoverageTypeProfile>;\n };\n}\n\n/** Subtract two count records, keeping only non-zero signed deltas in sorted key order. */\nfunction diffCountRecords(\n baseline: Record<string, number>,\n current: Record<string, number>,\n): Record<string, number> {\n const keys = [\n ...new Set([...Object.keys(baseline), ...Object.keys(current)]),\n ].sort();\n const deltas: Record<string, number> = {};\n for (const key of keys) {\n const delta = (current[key] ?? 0) - (baseline[key] ?? 0);\n if (delta !== 0) deltas[key] = delta;\n }\n return deltas;\n}\n\n/** Read per-type coverage defensively from current or legacy runtime snapshots. */\nfunction readSnapshotCoverageByType(\n snapshot: RelationshipAuditSnapshot,\n): Record<string, RelationshipCoverageTypeProfile> {\n return snapshot.profile.coverage_by_type ?? {};\n}\n\n/**\n * Compare two point-in-time audit snapshots and return the signed change in\n * findings and structural coverage. This is the temporal primitive behind\n * change-since-baseline audit reporting: agents track census drift across\n * sessions without re-deriving or storing full finding collections.\n */\nexport function diffRelationshipAuditSnapshots(\n baseline: RelationshipAuditSnapshot,\n current: RelationshipAuditSnapshot,\n): RelationshipAuditDelta {\n const coverageByType: Record<string, RelationshipCoverageTypeProfile> = {};\n // Public SDK callers may compare legacy or JSON-decoded snapshots created\n // before per-type coverage was added, even though current typed snapshots\n // always carry this field.\n const baselineCoverageByType = readSnapshotCoverageByType(baseline);\n const currentCoverageByType = readSnapshotCoverageByType(current);\n const typeKeys = [\n ...new Set([\n ...Object.keys(baselineCoverageByType),\n ...Object.keys(currentCoverageByType),\n ]),\n ].sort();\n for (const type of typeKeys) {\n const before = baselineCoverageByType[type];\n const after = currentCoverageByType[type];\n const delta = {\n active: (after?.active ?? 0) - (before?.active ?? 0),\n isolated: (after?.isolated ?? 0) - (before?.isolated ?? 0),\n degree_leq_one:\n (after?.degree_leq_one ?? 0) - (before?.degree_leq_one ?? 0),\n };\n if (Object.values(delta).some((value) => value !== 0))\n coverageByType[type] = delta;\n }\n return {\n baseline_saved_at: baseline.saved_at,\n same_snapshot: baseline.fingerprint === current.fingerprint,\n affected_subjects_by_code: diffCountRecords(\n baseline.affected_subjects_by_code,\n current.affected_subjects_by_code,\n ),\n profile: {\n nodes: current.profile.nodes - baseline.profile.nodes,\n edges: current.profile.edges - baseline.profile.edges,\n active_nodes:\n current.profile.active_nodes - baseline.profile.active_nodes,\n missing_nodes:\n current.profile.missing_nodes - baseline.profile.missing_nodes,\n isolated_active_nodes:\n current.profile.isolated_active_nodes -\n baseline.profile.isolated_active_nodes,\n degree_leq_one_active_nodes:\n current.profile.degree_leq_one_active_nodes -\n baseline.profile.degree_leq_one_active_nodes,\n edges_by_kind: diffCountRecords(\n baseline.profile.edges_by_kind,\n current.profile.edges_by_kind,\n ),\n coverage_by_type: coverageByType,\n },\n };\n}\n"],"names":[],"mappings":";;AAeA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AA+FxB,mEAAmE;AACnE,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,0DAA0D;AAC1D,MAAM,aAAa,GAA8C;IAC/D,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;CACR,CAAC;AAwCF,kFAAkF;AAClF,SAAS,YAAY,CACnB,IAAkC,EAClC,QAAmC,EACnC,MAAc,EACd,QAAmC,EACnC,QAA2B,EAC3B,aAAqB,EACrB,WAAmB;IAEnB,MAAM,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,MAAM;QACN,OA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MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC;YACnD,cAAc,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACjC,CAAC;IACD,OAAO;QACL,iBAAiB,EAAE,QAAQ,CAAC,QAAQ;QACpC,aAAa,EAAE,QAAQ,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW;QAC3D,yBAAyB,EAAE,gBAAgB,CACzC,QAAQ,CAAC,yBAAyB,EAClC,OAAO,CAAC,yBAAyB,CAClC;QACD,OAAO,EAAE;YACP,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK;YACrD,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK;YACrD,YAAY,EACV,OAAO,CAAC,OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAY;YAC9D,aAAa,EACX,OAAO,CAAC,OAAO,CAAC,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa;YAChE,qBAAqB,EACnB,OAAO,CAAC,OAAO,CAAC,qBAAqB;gBACrC,QAAQ,CAAC,OAAO,CAAC,qBAAqB;YACxC,2BAA2B,EACzB,OAAO,CAAC,OAAO,CAAC,2BAA2B;gBAC3C,QAAQ,CAAC,OAAO,CAAC,2BAA2B;YAC9C,aAAa,EAAE,gBAAgB,CAC7B,QAAQ,CAAC,OAAO,CAAC,aAAa,EAC9B,OAAO,CAAC,OAAO,CAAC,aAAa,CAC9B;YACD,gBAAgB,EAAE,cAAc;SACjC;KACF,CAAC;AACJ,CAAC","debugId":"4b36a9d4-2621-5560-831f-7fd026072cf1"}
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
* relationship audit. Everything here layers on the dependency-free kernel in
|
|
8
8
|
* `sdk/relationships` and is safe for CLI, MCP, extension, and non-PM callers.
|
|
9
9
|
*/
|
|
10
|
-
export { computeRelationshipDominators, detectRelationshipCommunities, findRedundantRelationshipEdges, type GraphCommunityOptions, type GraphDominatorOptions, type GraphRedundancyOptions, type RedundantRelationshipEdge, type RelationshipCommunity, type RelationshipCommunityAnalysis, type RelationshipDominatorAnalysis, type RelationshipDominatorRow, } from "./analytics.js";
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
10
|
+
export { computeRelationshipDominators, detectRelationshipCommunities, findRedundantRelationshipEdges, forEachMatchedRelationshipEdge, type GraphCommunityOptions, type GraphDominatorOptions, type GraphRedundancyOptions, type RedundantRelationshipEdge, type RelationshipCommunity, type RelationshipCommunityAnalysis, type RelationshipDominatorAnalysis, type RelationshipDominatorRow, } from "./analytics.js";
|
|
11
|
+
export { computeRelationshipCentrality, findRelationshipCutStructure, type GraphCentralityOptions, type GraphCutStructureOptions, type RelationshipBridge, type RelationshipCentralityAnalysis, type RelationshipCentralityRow, type RelationshipCutStructure, } from "./centrality.js";
|
|
12
|
+
export { analyzeRelationshipSchedule, type GraphScheduleOptions, type RelationshipScheduleAnalysis, type RelationshipScheduleRow, } from "./scheduling.js";
|
|
13
|
+
export { assembleWorkspaceRelationshipGraph, collectDanglingDependencyReferences, collectDuplicateDependencyRows, collectMissingDependencyTargetIds, normalizeDependencyGraphTarget, resolveWorkspaceRelationshipKindRegistry, type DanglingDependencyReference, type DanglingDependencyReferenceSummary, type DependencyReferenceHolder, type DependencyReferenceSource, type DuplicateDependencyRow, type WorkspaceRelationshipAssembly, type WorkspaceRelationshipItem, type WorkspaceRelationshipNodeDetails, } from "./assembly.js";
|
|
14
|
+
export { auditWorkspaceRelationshipGraph, collectDuplicateRelationshipEdgeGroups, collectOrderingCycles, diffRelationshipAuditSnapshots, formatDuplicateEdgeGroup, type DuplicateRelationshipEdgeGroup, type RelationshipAuditDelta, type RelationshipAuditFinding, type RelationshipAuditFindingCode, type RelationshipAuditOptions, type RelationshipAuditReport, type RelationshipAuditSeverity, type RelationshipAuditSnapshot, type RelationshipCoverageProfile, type RelationshipCoverageTypeProfile, } from "./governance.js";
|
|
15
|
+
export { clearDurableGraphCache, durableGraphCachePath, durableGraphCacheStatus, GRAPH_DURABLE_CACHE_MIN_ITEMS, GRAPH_DURABLE_CACHE_VERSION, graphAuditBaselinePath, loadGraphAuditBaseline, openDurableGraphCache, persistDurableGraphResult, saveGraphAuditBaseline, shouldPersistDurableGraphCache, type DurableGraphCacheEnvelope, type DurableGraphCacheStatus, type DurableGraphCacheView, } from "./durable-cache.js";
|
|
13
16
|
export { enumerateRelationshipPaths, hierarchyAncestors, hierarchyDescendants, orderingPredecessors, orderingSuccessors, type GraphPathOptions, type GraphTraversalOptions, type RelationshipPath, } from "./traversal.js";
|
|
14
17
|
export { computeWorkspaceGraphFingerprint, resetWorkspaceGraphCache, workspaceGraphCache, WorkspaceGraphCache, type GraphCacheMetadata, type WorkspaceGraphCacheLookup, } from "./cache.js";
|
|
15
18
|
export { planRelationshipRemediation, type RelationshipRemediationCode, type RelationshipRemediationConfidence, type RelationshipRemediationOperation, type RelationshipRemediationPlan, type RelationshipRemediationPlanOptions, type RelationshipRemediationStep, } from "./remediation.js";
|
|
16
19
|
export { collectNewOrderingCycleWarnings } from "./mutation-advisory.js";
|
|
17
|
-
export { GRAPH_SUBCOMMAND_VALUES, parseGraphSubcommand, runGraph, type GraphAnalyzeResult, type GraphAuditResult, type GraphCommandOptions, type GraphCommunitiesResult, type GraphCommunityRow, type GraphDominatorRow, type GraphDominatorsResult, type GraphExecutionSummary, type GraphImpactResult, type GraphImpactRow, type GraphKnowledgeSummary, type GraphPathRow, type GraphPathsResult, type GraphPlanResult, type GraphQueryCost, type GraphRedundancyResult, type GraphRedundancyRow, type GraphResult, type GraphSubcommand, type GraphTraversalResult, } from "./run.js";
|
|
20
|
+
export { GRAPH_SUBCOMMAND_VALUES, parseGraphSubcommand, runGraph, type GraphAnalyzeResult, type GraphArticulationResult, type GraphAuditResult, type GraphBridgeRow, type GraphCentralityResult, type GraphCentralityRow, type GraphCommandOptions, type GraphCommunitiesResult, type GraphCommunityRow, type GraphDominatorRow, type GraphDominatorsResult, type GraphExecutionSummary, type GraphImpactResult, type GraphImpactRow, type GraphIndexResult, type GraphKnowledgeSummary, type GraphPathRow, type GraphPathsResult, type GraphPlanResult, type GraphQueryCost, type GraphRedundancyResult, type GraphRedundancyRow, type GraphResult, type GraphScheduleRow, type GraphSlackResult, type GraphSubcommand, type GraphTraversalResult, } from "./run.js";
|
package/dist/sdk/graph/index.js
CHANGED
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
* `sdk/relationships` and is safe for CLI, MCP, extension, and non-PM callers.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
12
|
-
export { computeRelationshipDominators, detectRelationshipCommunities, findRedundantRelationshipEdges, } from "./analytics.js";
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
11
|
+
!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]="94a76dca-4199-582e-882e-9525a42319db")}catch(e){}}();
|
|
12
|
+
export { computeRelationshipDominators, detectRelationshipCommunities, findRedundantRelationshipEdges, forEachMatchedRelationshipEdge, } from "./analytics.js";
|
|
13
|
+
export { computeRelationshipCentrality, findRelationshipCutStructure, } from "./centrality.js";
|
|
14
|
+
export { analyzeRelationshipSchedule, } from "./scheduling.js";
|
|
15
|
+
export { assembleWorkspaceRelationshipGraph, collectDanglingDependencyReferences, collectDuplicateDependencyRows, collectMissingDependencyTargetIds, normalizeDependencyGraphTarget, resolveWorkspaceRelationshipKindRegistry, } from "./assembly.js";
|
|
16
|
+
export { auditWorkspaceRelationshipGraph, collectDuplicateRelationshipEdgeGroups, collectOrderingCycles, diffRelationshipAuditSnapshots, formatDuplicateEdgeGroup, } from "./governance.js";
|
|
17
|
+
export { clearDurableGraphCache, durableGraphCachePath, durableGraphCacheStatus, GRAPH_DURABLE_CACHE_MIN_ITEMS, GRAPH_DURABLE_CACHE_VERSION, graphAuditBaselinePath, loadGraphAuditBaseline, openDurableGraphCache, persistDurableGraphResult, saveGraphAuditBaseline, shouldPersistDurableGraphCache, } from "./durable-cache.js";
|
|
15
18
|
export { enumerateRelationshipPaths, hierarchyAncestors, hierarchyDescendants, orderingPredecessors, orderingSuccessors, } from "./traversal.js";
|
|
16
19
|
export { computeWorkspaceGraphFingerprint, resetWorkspaceGraphCache, workspaceGraphCache, WorkspaceGraphCache, } from "./cache.js";
|
|
17
20
|
export { planRelationshipRemediation, } from "./remediation.js";
|
|
18
21
|
export { collectNewOrderingCycleWarnings } from "./mutation-advisory.js";
|
|
19
22
|
export { GRAPH_SUBCOMMAND_VALUES, parseGraphSubcommand, runGraph, } from "./run.js";
|
|
20
23
|
//# sourceMappingURL=index.js.map
|
|
21
|
-
//# debugId=
|
|
24
|
+
//# debugId=94a76dca-4199-582e-882e-9525a42319db
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["sdk/graph/index.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph\n *\n * Public workspace graph toolkit: one-pass relationship assembly with\n * missing-reference governance, registry-semantics traversal (hierarchy,\n * execution order, bounded path enumeration), and the policy-aware\n * relationship audit. Everything here layers on the dependency-free kernel in\n * `sdk/relationships` and is safe for CLI, MCP, extension, and non-PM callers.\n */\nexport {\n computeRelationshipDominators,\n detectRelationshipCommunities,\n findRedundantRelationshipEdges,\n type GraphCommunityOptions,\n type GraphDominatorOptions,\n type GraphRedundancyOptions,\n type RedundantRelationshipEdge,\n type RelationshipCommunity,\n type RelationshipCommunityAnalysis,\n type RelationshipDominatorAnalysis,\n type RelationshipDominatorRow,\n} from \"./analytics.js\";\nexport {\n assembleWorkspaceRelationshipGraph,\n collectDanglingDependencyReferences,\n collectMissingDependencyTargetIds,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DependencyReferenceSource,\n type WorkspaceRelationshipAssembly,\n type WorkspaceRelationshipItem,\n type WorkspaceRelationshipNodeDetails,\n} from \"./assembly.js\";\nexport {\n auditWorkspaceRelationshipGraph,\n collectDuplicateRelationshipEdgeGroups,\n formatDuplicateEdgeGroup,\n type DuplicateRelationshipEdgeGroup,\n type RelationshipAuditFinding,\n type RelationshipAuditFindingCode,\n type RelationshipAuditOptions,\n type RelationshipAuditReport,\n type RelationshipAuditSeverity,\n type RelationshipCoverageProfile,\n} from \"./governance.js\";\nexport {\n enumerateRelationshipPaths,\n hierarchyAncestors,\n hierarchyDescendants,\n orderingPredecessors,\n orderingSuccessors,\n type GraphPathOptions,\n type GraphTraversalOptions,\n type RelationshipPath,\n} from \"./traversal.js\";\nexport {\n computeWorkspaceGraphFingerprint,\n resetWorkspaceGraphCache,\n workspaceGraphCache,\n WorkspaceGraphCache,\n type GraphCacheMetadata,\n type WorkspaceGraphCacheLookup,\n} from \"./cache.js\";\nexport {\n planRelationshipRemediation,\n type RelationshipRemediationCode,\n type RelationshipRemediationConfidence,\n type RelationshipRemediationOperation,\n type RelationshipRemediationPlan,\n type RelationshipRemediationPlanOptions,\n type RelationshipRemediationStep,\n} from \"./remediation.js\";\nexport { collectNewOrderingCycleWarnings } from \"./mutation-advisory.js\";\nexport {\n GRAPH_SUBCOMMAND_VALUES,\n parseGraphSubcommand,\n runGraph,\n type GraphAnalyzeResult,\n type GraphAuditResult,\n type GraphCommandOptions,\n type GraphCommunitiesResult,\n type GraphCommunityRow,\n type GraphDominatorRow,\n type GraphDominatorsResult,\n type GraphExecutionSummary,\n type GraphImpactResult,\n type GraphImpactRow,\n type GraphKnowledgeSummary,\n type GraphPathRow,\n type GraphPathsResult,\n type GraphPlanResult,\n type GraphQueryCost,\n type GraphRedundancyResult,\n type GraphRedundancyRow,\n type GraphResult,\n type GraphSubcommand,\n type GraphTraversalResult,\n} from \"./run.js\";\n"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;AACH,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,GAS/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,iCAAiC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["sdk/graph/index.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph\n *\n * Public workspace graph toolkit: one-pass relationship assembly with\n * missing-reference governance, registry-semantics traversal (hierarchy,\n * execution order, bounded path enumeration), and the policy-aware\n * relationship audit. Everything here layers on the dependency-free kernel in\n * `sdk/relationships` and is safe for CLI, MCP, extension, and non-PM callers.\n */\nexport {\n computeRelationshipDominators,\n detectRelationshipCommunities,\n findRedundantRelationshipEdges,\n forEachMatchedRelationshipEdge,\n type GraphCommunityOptions,\n type GraphDominatorOptions,\n type GraphRedundancyOptions,\n type RedundantRelationshipEdge,\n type RelationshipCommunity,\n type RelationshipCommunityAnalysis,\n type RelationshipDominatorAnalysis,\n type RelationshipDominatorRow,\n} from \"./analytics.js\";\nexport {\n computeRelationshipCentrality,\n findRelationshipCutStructure,\n type GraphCentralityOptions,\n type GraphCutStructureOptions,\n type RelationshipBridge,\n type RelationshipCentralityAnalysis,\n type RelationshipCentralityRow,\n type RelationshipCutStructure,\n} from \"./centrality.js\";\nexport {\n analyzeRelationshipSchedule,\n type GraphScheduleOptions,\n type RelationshipScheduleAnalysis,\n type RelationshipScheduleRow,\n} from \"./scheduling.js\";\nexport {\n assembleWorkspaceRelationshipGraph,\n collectDanglingDependencyReferences,\n collectDuplicateDependencyRows,\n collectMissingDependencyTargetIds,\n normalizeDependencyGraphTarget,\n resolveWorkspaceRelationshipKindRegistry,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DependencyReferenceSource,\n type DuplicateDependencyRow,\n type WorkspaceRelationshipAssembly,\n type WorkspaceRelationshipItem,\n type WorkspaceRelationshipNodeDetails,\n} from \"./assembly.js\";\nexport {\n auditWorkspaceRelationshipGraph,\n collectDuplicateRelationshipEdgeGroups,\n collectOrderingCycles,\n diffRelationshipAuditSnapshots,\n formatDuplicateEdgeGroup,\n type DuplicateRelationshipEdgeGroup,\n type RelationshipAuditDelta,\n type RelationshipAuditFinding,\n type RelationshipAuditFindingCode,\n type RelationshipAuditOptions,\n type RelationshipAuditReport,\n type RelationshipAuditSeverity,\n type RelationshipAuditSnapshot,\n type RelationshipCoverageProfile,\n type RelationshipCoverageTypeProfile,\n} from \"./governance.js\";\nexport {\n clearDurableGraphCache,\n durableGraphCachePath,\n durableGraphCacheStatus,\n GRAPH_DURABLE_CACHE_MIN_ITEMS,\n GRAPH_DURABLE_CACHE_VERSION,\n graphAuditBaselinePath,\n loadGraphAuditBaseline,\n openDurableGraphCache,\n persistDurableGraphResult,\n saveGraphAuditBaseline,\n shouldPersistDurableGraphCache,\n type DurableGraphCacheEnvelope,\n type DurableGraphCacheStatus,\n type DurableGraphCacheView,\n} from \"./durable-cache.js\";\nexport {\n enumerateRelationshipPaths,\n hierarchyAncestors,\n hierarchyDescendants,\n orderingPredecessors,\n orderingSuccessors,\n type GraphPathOptions,\n type GraphTraversalOptions,\n type RelationshipPath,\n} from \"./traversal.js\";\nexport {\n computeWorkspaceGraphFingerprint,\n resetWorkspaceGraphCache,\n workspaceGraphCache,\n WorkspaceGraphCache,\n type GraphCacheMetadata,\n type WorkspaceGraphCacheLookup,\n} from \"./cache.js\";\nexport {\n planRelationshipRemediation,\n type RelationshipRemediationCode,\n type RelationshipRemediationConfidence,\n type RelationshipRemediationOperation,\n type RelationshipRemediationPlan,\n type RelationshipRemediationPlanOptions,\n type RelationshipRemediationStep,\n} from \"./remediation.js\";\nexport { collectNewOrderingCycleWarnings } from \"./mutation-advisory.js\";\nexport {\n GRAPH_SUBCOMMAND_VALUES,\n parseGraphSubcommand,\n runGraph,\n type GraphAnalyzeResult,\n type GraphArticulationResult,\n type GraphAuditResult,\n type GraphBridgeRow,\n type GraphCentralityResult,\n type GraphCentralityRow,\n type GraphCommandOptions,\n type GraphCommunitiesResult,\n type GraphCommunityRow,\n type GraphDominatorRow,\n type GraphDominatorsResult,\n type GraphExecutionSummary,\n type GraphImpactResult,\n type GraphImpactRow,\n type GraphIndexResult,\n type GraphKnowledgeSummary,\n type GraphPathRow,\n type GraphPathsResult,\n type GraphPlanResult,\n type GraphQueryCost,\n type GraphRedundancyResult,\n type GraphRedundancyRow,\n type GraphResult,\n type GraphScheduleRow,\n type GraphSlackResult,\n type GraphSubcommand,\n type GraphTraversalResult,\n} from \"./run.js\";\n"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;AACH,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,GAS/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAO7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,GAI5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,8BAA8B,EAC9B,iCAAiC,EACjC,8BAA8B,EAC9B,wCAAwC,GASzC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,+BAA+B,EAC/B,sCAAsC,EACtC,qBAAqB,EACrB,8BAA8B,EAC9B,wBAAwB,GAWzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC3B,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,8BAA8B,GAI/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,GAO5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,GA4BT,MAAM,UAAU,CAAC","debugId":"94a76dca-4199-582e-882e-9525a42319db"}
|
|
@@ -3,17 +3,48 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Detects newly introduced execution-order cycles across immutable workspace
|
|
5
5
|
* snapshots so mutation clients can warn without rejecting legacy graph debt.
|
|
6
|
+
* Detection is incremental: instead of assembling the full workspace
|
|
7
|
+
* relationship graph and running whole-graph cycle analysis twice per
|
|
8
|
+
* mutation, both snapshots build only a lightweight ordering digraph and scope
|
|
9
|
+
* cycle enumeration to the changed item's weakly connected ordering component
|
|
10
|
+
* — a cycle containing the changed item can never span nodes outside it.
|
|
6
11
|
*/
|
|
7
12
|
import type { ItemMetadata } from "../../types/index.js";
|
|
8
|
-
import type {
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
import type { RelationshipKindRegistry } from "../relationships.js";
|
|
14
|
+
/** Lightweight ordering digraph over one immutable item snapshot. */
|
|
15
|
+
interface OrderingDigraph {
|
|
16
|
+
/** Sorted successor adjacency oriented predecessor -> successor. */
|
|
17
|
+
successors: Map<string, string[]>;
|
|
18
|
+
/** Sorted predecessor adjacency, the reverse orientation of successors. */
|
|
19
|
+
predecessors: Map<string, string[]>;
|
|
20
|
+
/** Canonical original-case ids keyed by their lowercase spelling. */
|
|
21
|
+
canonicalIds: Map<string, string>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build the ordering-only digraph for one item snapshot without assembling a
|
|
25
|
+
* full relationship graph: one linear pass over the legacy scalar blocker and
|
|
26
|
+
* structured dependency rows of every item.
|
|
27
|
+
*/
|
|
28
|
+
declare function buildOrderingDigraph(items: readonly ItemMetadata[], registry: RelationshipKindRegistry): OrderingDigraph;
|
|
29
|
+
/**
|
|
30
|
+
* Collect the changed item's weakly connected ordering component: every node
|
|
31
|
+
* reachable through ordering edges in either orientation. Cycle enumeration
|
|
32
|
+
* restricted to this member set is exact for cycles containing the changed
|
|
33
|
+
* item, because a strongly connected component is always contained in a
|
|
34
|
+
* weakly connected one.
|
|
35
|
+
*/
|
|
36
|
+
declare function collectWeakComponent(digraph: OrderingDigraph, start: string): Set<string>;
|
|
37
|
+
/** Restrict a successor adjacency to edges whose endpoints are both members. */
|
|
38
|
+
declare function induceSuccessors(digraph: OrderingDigraph, members: ReadonlySet<string>): Map<string, string[]>;
|
|
39
|
+
declare function findCyclePath(adjacency: ReadonlyMap<string, readonly string[]>, component: readonly string[], changedItemId: string): string[];
|
|
11
40
|
declare function findPathBackToStart(adjacency: ReadonlyMap<string, readonly string[]>, members: ReadonlySet<string>, start: string, first: string): string[] | undefined;
|
|
12
41
|
/** Return actionable warnings only for ordering cycles created by the later snapshot and containing the changed item. */
|
|
13
42
|
export declare function collectNewOrderingCycleWarnings(beforeItems: readonly ItemMetadata[], afterItems: readonly ItemMetadata[], changedItemId: string): string[];
|
|
14
43
|
/** White-box graph-path helpers for exhaustive SDK primitive verification. */
|
|
15
44
|
export declare const mutationAdvisoryTestOnly: {
|
|
16
|
-
|
|
45
|
+
buildOrderingDigraph: typeof buildOrderingDigraph;
|
|
46
|
+
collectWeakComponent: typeof collectWeakComponent;
|
|
47
|
+
induceSuccessors: typeof induceSuccessors;
|
|
17
48
|
findCyclePath: typeof findCyclePath;
|
|
18
49
|
findPathBackToStart: typeof findPathBackToStart;
|
|
19
50
|
};
|
|
@@ -1,33 +1,124 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9dcd2523-3a8a-5667-bd6b-d51c385be111")}catch(e){}}();
|
|
3
|
+
import { normalizeDependencyGraphTarget, resolveWorkspaceRelationshipKindRegistry, } from "./assembly.js";
|
|
4
|
+
import { collectOrderingCycles } from "./governance.js";
|
|
5
5
|
function cycleKey(component) {
|
|
6
|
-
return [...component]
|
|
7
|
-
.sort((left, right) => left.localeCompare(right))
|
|
8
|
-
.join("\u0000");
|
|
6
|
+
return [...component].sort().join("\u0000");
|
|
9
7
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
/** Append one oriented ordering edge to both adjacency orientations. */
|
|
9
|
+
function addOrderingEdge(digraph, predecessor, successor) {
|
|
10
|
+
const forward = digraph.successors.get(predecessor);
|
|
11
|
+
if (forward)
|
|
12
|
+
forward.push(successor);
|
|
13
|
+
else
|
|
14
|
+
digraph.successors.set(predecessor, [successor]);
|
|
15
|
+
const backward = digraph.predecessors.get(successor);
|
|
16
|
+
if (backward)
|
|
17
|
+
backward.push(predecessor);
|
|
18
|
+
else
|
|
19
|
+
digraph.predecessors.set(successor, [predecessor]);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Orient one candidate reference into the digraph when its kind is a
|
|
23
|
+
* registry-known order-bearing kind and its target resolves to a real item.
|
|
24
|
+
* Associative kinds, unknown kinds, retired sentinels, and references to
|
|
25
|
+
* absent items are skipped because none of them can create an
|
|
26
|
+
* execution-order cycle — a referenced-but-absent item has no stored
|
|
27
|
+
* out-edges.
|
|
28
|
+
*/
|
|
29
|
+
function orientOrderingEdge(digraph, registry, source, target, kind) {
|
|
30
|
+
const definition = registry.resolve(kind);
|
|
31
|
+
if (definition?.ordering !== true)
|
|
32
|
+
return;
|
|
33
|
+
const normalized = normalizeDependencyGraphTarget(target);
|
|
34
|
+
const canonicalTarget = normalized === undefined
|
|
35
|
+
? undefined
|
|
36
|
+
: digraph.canonicalIds.get(normalized.toLowerCase());
|
|
37
|
+
if (canonicalTarget === undefined)
|
|
38
|
+
return;
|
|
39
|
+
const sourceFirst = (definition.precedence ?? "source_before_target") ===
|
|
40
|
+
"source_before_target";
|
|
41
|
+
addOrderingEdge(digraph, sourceFirst ? source : canonicalTarget, sourceFirst ? canonicalTarget : source);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build the ordering-only digraph for one item snapshot without assembling a
|
|
45
|
+
* full relationship graph: one linear pass over the legacy scalar blocker and
|
|
46
|
+
* structured dependency rows of every item.
|
|
47
|
+
*/
|
|
48
|
+
function buildOrderingDigraph(items, registry) {
|
|
49
|
+
const digraph = {
|
|
50
|
+
successors: new Map(),
|
|
51
|
+
predecessors: new Map(),
|
|
52
|
+
canonicalIds: new Map(),
|
|
53
|
+
};
|
|
54
|
+
const safeItems = items.filter((item) => typeof item?.id === "string" && item.id.trim().length > 0);
|
|
55
|
+
for (const item of safeItems) {
|
|
56
|
+
const id = item.id.trim();
|
|
57
|
+
digraph.canonicalIds.set(id.toLowerCase(), id);
|
|
58
|
+
}
|
|
59
|
+
for (const item of safeItems) {
|
|
60
|
+
const id = item.id.trim();
|
|
61
|
+
orientOrderingEdge(digraph, registry, id, item.blocked_by, "blocked_by");
|
|
62
|
+
for (const dependency of item.dependencies ?? []) {
|
|
63
|
+
if (typeof dependency !== "object" || dependency === null)
|
|
64
|
+
continue;
|
|
65
|
+
orientOrderingEdge(digraph, registry, id, dependency.id, typeof dependency.kind === "string" ? dependency.kind : "related");
|
|
66
|
+
}
|
|
21
67
|
}
|
|
22
|
-
for (const
|
|
23
|
-
|
|
68
|
+
for (const adjacency of [digraph.successors, digraph.predecessors])
|
|
69
|
+
for (const neighbors of adjacency.values())
|
|
70
|
+
neighbors.sort();
|
|
71
|
+
return digraph;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Collect the changed item's weakly connected ordering component: every node
|
|
75
|
+
* reachable through ordering edges in either orientation. Cycle enumeration
|
|
76
|
+
* restricted to this member set is exact for cycles containing the changed
|
|
77
|
+
* item, because a strongly connected component is always contained in a
|
|
78
|
+
* weakly connected one.
|
|
79
|
+
*/
|
|
80
|
+
function collectWeakComponent(digraph, start) {
|
|
81
|
+
const members = new Set([start]);
|
|
82
|
+
const queue = [start];
|
|
83
|
+
while (queue.length > 0) {
|
|
84
|
+
const node = queue.pop();
|
|
85
|
+
for (const adjacency of [digraph.successors, digraph.predecessors]) {
|
|
86
|
+
for (const neighbor of adjacency.get(node) ?? []) {
|
|
87
|
+
if (members.has(neighbor))
|
|
88
|
+
continue;
|
|
89
|
+
members.add(neighbor);
|
|
90
|
+
queue.push(neighbor);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
24
93
|
}
|
|
25
|
-
return
|
|
94
|
+
return members;
|
|
95
|
+
}
|
|
96
|
+
/** Restrict a successor adjacency to edges whose endpoints are both members. */
|
|
97
|
+
function induceSuccessors(digraph, members) {
|
|
98
|
+
const induced = new Map();
|
|
99
|
+
for (const member of members) {
|
|
100
|
+
const neighbors = (digraph.successors.get(member) ?? []).filter((node) => members.has(node));
|
|
101
|
+
if (neighbors.length > 0)
|
|
102
|
+
induced.set(member, neighbors);
|
|
103
|
+
}
|
|
104
|
+
return induced;
|
|
105
|
+
}
|
|
106
|
+
/** Enumerate component-scoped ordering cycles around one canonical item id. */
|
|
107
|
+
function collectScopedCycles(items, registry, changedItemId) {
|
|
108
|
+
const digraph = buildOrderingDigraph(items, registry);
|
|
109
|
+
const canonical = digraph.canonicalIds.get(changedItemId.trim().toLowerCase());
|
|
110
|
+
if (canonical === undefined)
|
|
111
|
+
return { cycles: [], successors: new Map(), canonical: changedItemId };
|
|
112
|
+
const successors = induceSuccessors(digraph, collectWeakComponent(digraph, canonical));
|
|
113
|
+
return {
|
|
114
|
+
cycles: collectOrderingCycles(successors).filter((component) => component.includes(canonical)),
|
|
115
|
+
successors,
|
|
116
|
+
canonical,
|
|
117
|
+
};
|
|
26
118
|
}
|
|
27
|
-
function findCyclePath(
|
|
119
|
+
function findCyclePath(adjacency, component, changedItemId) {
|
|
28
120
|
const members = new Set(component);
|
|
29
121
|
const start = members.has(changedItemId) ? changedItemId : component[0];
|
|
30
|
-
const adjacency = buildOrderingAdjacency(graph);
|
|
31
122
|
if (adjacency.get(start)?.includes(start))
|
|
32
123
|
return [start, start];
|
|
33
124
|
for (const first of adjacency.get(start) ?? []) {
|
|
@@ -58,23 +149,21 @@ function findPathBackToStart(adjacency, members, start, first) {
|
|
|
58
149
|
}
|
|
59
150
|
/** Return actionable warnings only for ordering cycles created by the later snapshot and containing the changed item. */
|
|
60
151
|
export function collectNewOrderingCycleWarnings(beforeItems, afterItems, changedItemId) {
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}).cycles
|
|
69
|
-
.filter((component) => component.includes(changedItemId) &&
|
|
70
|
-
!beforeCycles.has(cycleKey(component)))
|
|
71
|
-
.map((component) => `ordering_cycle_created:${findCyclePath(afterGraph, component, changedItemId).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`);
|
|
152
|
+
const registry = resolveWorkspaceRelationshipKindRegistry();
|
|
153
|
+
const before = collectScopedCycles(beforeItems, registry, changedItemId);
|
|
154
|
+
const after = collectScopedCycles(afterItems, registry, changedItemId);
|
|
155
|
+
const beforeCycles = new Set(before.cycles.map(cycleKey));
|
|
156
|
+
return after.cycles
|
|
157
|
+
.filter((component) => !beforeCycles.has(cycleKey(component)))
|
|
158
|
+
.map((component) => `ordering_cycle_created:${findCyclePath(after.successors, component, after.canonical).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`);
|
|
72
159
|
}
|
|
73
160
|
/** White-box graph-path helpers for exhaustive SDK primitive verification. */
|
|
74
161
|
export const mutationAdvisoryTestOnly = {
|
|
75
|
-
|
|
162
|
+
buildOrderingDigraph,
|
|
163
|
+
collectWeakComponent,
|
|
164
|
+
induceSuccessors,
|
|
76
165
|
findCyclePath,
|
|
77
166
|
findPathBackToStart,
|
|
78
167
|
};
|
|
79
168
|
//# sourceMappingURL=mutation-advisory.js.map
|
|
80
|
-
//# debugId=
|
|
169
|
+
//# debugId=9dcd2523-3a8a-5667-bd6b-d51c385be111
|