@unbrained/pm-cli 2026.9.10 → 2026.9.12

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.
Files changed (213) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +53 -11
  3. package/dist/cli/command-namespaces.d.ts +2 -2
  4. package/dist/cli/command-namespaces.js +1 -1
  5. package/dist/cli/error-guidance.d.ts +10 -0
  6. package/dist/cli/error-guidance.js +1 -1
  7. package/dist/cli/extension-command-help.js +3 -3
  8. package/dist/cli/main.d.ts +4 -0
  9. package/dist/cli/main.js +2 -2
  10. package/dist/cli/option-values.d.ts +3 -0
  11. package/dist/cli/option-values.js +2 -0
  12. package/dist/cli/register-history-maintenance.js +2 -1
  13. package/dist/cli/register-list-query.js +2 -2
  14. package/dist/cli/register-mutation.d.ts +5 -0
  15. package/dist/cli/register-mutation.js +2 -16
  16. package/dist/cli/schema/registration.d.ts +4 -0
  17. package/dist/cli/schema/registration.js +16 -0
  18. package/dist/cli-bundle/bundle-manifest.json +156 -156
  19. package/dist/cli-bundle/chunks/{chunk-NKOYVKFM.js → chunk-2JAY4LFI.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-I6XT3DLQ.js → chunk-3ZJDGTYC.js} +53 -53
  21. package/dist/cli-bundle/chunks/chunk-67H4PKQ5.js +3 -0
  22. package/dist/cli-bundle/chunks/{chunk-EOCKPCEY.js → chunk-7H33WPDF.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-7KF6HCRC.js +20 -0
  24. package/dist/cli-bundle/chunks/chunk-DEGRLB6Y.js +235 -0
  25. package/dist/cli-bundle/chunks/chunk-GKY655T7.js +6 -0
  26. package/dist/cli-bundle/chunks/chunk-I6VQUHK6.js +8 -0
  27. package/dist/cli-bundle/chunks/chunk-PTX2JRFR.js +2 -0
  28. package/dist/cli-bundle/chunks/{chunk-PYUITRSV.js → chunk-TAGDYARO.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-X6POOZKD.js +29 -0
  30. package/dist/cli-bundle/chunks/{chunk-4SFBH77G.js → chunk-YU75JRTW.js} +156 -142
  31. package/dist/cli-bundle/chunks/{register-list-query-CUIW7SSE.js → register-list-query-KEZPDR6X.js} +6 -6
  32. package/dist/cli-bundle/chunks/register-mutation-HEXA3ZDM.js +20 -0
  33. package/dist/cli-bundle/chunks/{register-operations-XIZPLPQY.js → register-operations-TEZT65JF.js} +2 -2
  34. package/dist/cli-bundle/chunks/{register-setup-JVGPCAIL.js → register-setup-IIL74WUG.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-ZAWAL2CG.js → chunk-2BQ4JSJQ.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-5CRND7UA.js +12 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-5PSYV3AT.js +164 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-SL5YVVPV.js → chunk-7EKXAUKF.js} +53 -52
  39. package/dist/cli-bundle/focused-chunks/chunk-BIOWOU6S.js +30 -0
  40. package/dist/cli-bundle/focused-chunks/chunk-EIXGDI77.js +2 -0
  41. package/dist/cli-bundle/focused-chunks/chunk-GAKFECOQ.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-HFAW3FJQ.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-U5SHHU7E.js → chunk-IURELABV.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-KK7KSXUP.js +8 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-ZDNAWWQI.js → chunk-LWJBBM6X.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-MFVABYEU.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-7N5MRONP.js → chunk-PERRTPIY.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-FHUARRMA.js → chunk-SDQOOL34.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-M36SF4GE.js → chunk-TTRB47KM.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/chunk-VWMP6W7Y.js +20 -0
  51. package/dist/cli-bundle/focused-chunks/chunk-YNBACVQ2.js +2 -0
  52. package/dist/cli-bundle/main.js +21 -21
  53. package/dist/cli-bundle/sdk-authoring.js +1 -1
  54. package/dist/cli-bundle/sdk-contracts.js +2 -2
  55. package/dist/cli-bundle/sdk-core.js +29 -29
  56. package/dist/cli-bundle/sdk-governance.js +1 -1
  57. package/dist/cli-bundle/sdk-graph.js +1 -1
  58. package/dist/cli-bundle/sdk-merge.js +42 -42
  59. package/dist/cli-bundle/sdk-query.js +1 -1
  60. package/dist/cli-bundle/sdk-runtime.js +1 -1
  61. package/dist/cli-bundle/sdk-testing.js +1 -1
  62. package/dist/cli-bundle/sdk.js +10 -10
  63. package/dist/core/history/digest.d.ts +12 -0
  64. package/dist/core/history/digest.js +2 -0
  65. package/dist/core/history/drift-scan.js +1 -1
  66. package/dist/core/history/history.d.ts +5 -3
  67. package/dist/core/history/history.js +2 -2
  68. package/dist/core/history/operation-contract.d.ts +30 -0
  69. package/dist/core/history/operation-contract.js +2 -0
  70. package/dist/core/history/replay.d.ts +3 -2
  71. package/dist/core/history/replay.js +1 -1
  72. package/dist/core/history/tombstone.d.ts +3 -0
  73. package/dist/core/history/tombstone.js +2 -0
  74. package/dist/core/item/id.d.ts +8 -7
  75. package/dist/core/item/id.js +1 -1
  76. package/dist/core/output/mutation-projection.d.ts +1 -0
  77. package/dist/core/output/mutation-projection.js +1 -1
  78. package/dist/core/shared/command-line.d.ts +10 -0
  79. package/dist/core/shared/command-line.js +2 -0
  80. package/dist/core/shared/errors.d.ts +13 -0
  81. package/dist/core/shared/errors.js +1 -1
  82. package/dist/core/store/item-store.d.ts +5 -1
  83. package/dist/core/store/item-store.js +1 -1
  84. package/dist/core/telemetry/runtime.d.ts +1 -0
  85. package/dist/core/telemetry/runtime.js +2 -2
  86. package/dist/sdk/agent/command-recovery.js +1 -1
  87. package/dist/sdk/agent/item-addressing.js +1 -1
  88. package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
  89. package/dist/sdk/agent-capability-contracts.js +1 -1
  90. package/dist/sdk/cli-bootstrap.d.ts +2 -1
  91. package/dist/sdk/cli-bootstrap.js +1 -1
  92. package/dist/sdk/cli-contracts/command-aliases.d.ts +2 -0
  93. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  94. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  95. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  96. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  97. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  98. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  99. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  100. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -0
  101. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  102. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  103. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  104. package/dist/sdk/cli-contracts.d.ts +1 -1
  105. package/dist/sdk/cli-contracts.js +1 -1
  106. package/dist/sdk/command-line.d.ts +1 -6
  107. package/dist/sdk/command-line.js +1 -1
  108. package/dist/sdk/comments.js +1 -1
  109. package/dist/sdk/completion.d.ts +2 -0
  110. package/dist/sdk/completion.js +26 -14
  111. package/dist/sdk/contracts.d.ts +2 -0
  112. package/dist/sdk/contracts.js +1 -1
  113. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  114. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  115. package/dist/sdk/governance/storage-integrity.js +1 -1
  116. package/dist/sdk/governance/workflow-completeness.js +1 -1
  117. package/dist/sdk/governance/workflow-policy.js +2 -2
  118. package/dist/sdk/governance.d.ts +3 -0
  119. package/dist/sdk/governance.js +1 -1
  120. package/dist/sdk/history/attestation-command.d.ts +22 -0
  121. package/dist/sdk/history/attestation-command.js +3 -0
  122. package/dist/sdk/history/attestation-contract.d.ts +103 -0
  123. package/dist/sdk/history/attestation-contract.js +2 -0
  124. package/dist/sdk/history/attestation-scan.d.ts +16 -0
  125. package/dist/sdk/history/attestation-scan.js +2 -0
  126. package/dist/sdk/history/attestation.d.ts +8 -0
  127. package/dist/sdk/history/attestation.js +2 -0
  128. package/dist/sdk/history/salvage.js +1 -1
  129. package/dist/sdk/history-compact.js +1 -1
  130. package/dist/sdk/history-read.js +1 -1
  131. package/dist/sdk/history-redact.js +1 -1
  132. package/dist/sdk/history-repair.js +1 -1
  133. package/dist/sdk/index.d.ts +3 -1
  134. package/dist/sdk/index.js +1 -1
  135. package/dist/sdk/learnings.js +1 -1
  136. package/dist/sdk/lifecycle/claim.d.ts +2 -0
  137. package/dist/sdk/lifecycle/claim.js +1 -1
  138. package/dist/sdk/lifecycle/mcp-actions.d.ts +4 -0
  139. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  140. package/dist/sdk/lifecycle/task-composition.d.ts +2 -0
  141. package/dist/sdk/lifecycle/task-composition.js +1 -1
  142. package/dist/sdk/merge/reconcile.js +1 -1
  143. package/dist/sdk/merge/three-way.js +2 -2
  144. package/dist/sdk/notes.js +1 -1
  145. package/dist/sdk/public-surface.json +1 -1
  146. package/dist/sdk/query/projection-contracts.d.ts +1 -1
  147. package/dist/sdk/query/projection-contracts.js +1 -1
  148. package/dist/sdk/read-output-budget.d.ts +4 -10
  149. package/dist/sdk/read-output-budget.js +1 -1
  150. package/dist/sdk/read-output-contracts.d.ts +1 -1
  151. package/dist/sdk/read-output-contracts.js +1 -1
  152. package/dist/sdk/read-output-session.d.ts +1 -1
  153. package/dist/sdk/read-output-session.js +1 -1
  154. package/dist/sdk/runtime-input.js +1 -1
  155. package/dist/sdk/runtime.d.ts +3 -0
  156. package/dist/sdk/runtime.js +1 -1
  157. package/dist/types.d.ts +5 -1
  158. package/dist/types.js +1 -1
  159. package/docs/AGENT_UX_CONTRACTS.md +8 -0
  160. package/docs/ARCHITECTURE.md +7 -0
  161. package/docs/CLI_GRAMMAR.md +23 -0
  162. package/docs/HISTORY_ATTESTATION.md +164 -0
  163. package/docs/HISTORY_OPERATIONS.md +46 -0
  164. package/docs/HISTORY_RECOVERY.md +27 -2
  165. package/docs/LIFECYCLE_COMMANDS.md +19 -2
  166. package/docs/MERGE_SAFETY.md +64 -3
  167. package/docs/README.md +1 -0
  168. package/docs/READ_OUTPUT_CONTRACTS.md +13 -0
  169. package/docs/WORKFLOW_POLICIES.md +47 -3
  170. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +4 -4
  171. package/docs/generated/AGENT_COMMAND_SURFACE.md +5 -0
  172. package/docs/generated/FLAG_LEXICON_BUDGETS.md +5 -0
  173. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +10 -7
  174. package/marketplace.json +2 -2
  175. package/package.json +4 -4
  176. package/packages/pm-beads/package.json +1 -1
  177. package/packages/pm-calendar/package.json +1 -1
  178. package/packages/pm-command-kit/package.json +1 -1
  179. package/packages/pm-digital-twin/package.json +1 -1
  180. package/packages/pm-governance-audit/README.md +31 -7
  181. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +6 -3
  182. package/packages/pm-governance-audit/package.json +1 -1
  183. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +7 -19
  184. package/packages/pm-guide-shell/package.json +1 -1
  185. package/packages/pm-kanban/package.json +1 -1
  186. package/packages/pm-lifecycle-hooks/package.json +1 -1
  187. package/packages/pm-linked-test-adapters/package.json +1 -1
  188. package/packages/pm-search-advanced/README.md +9 -5
  189. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +3 -2
  190. package/packages/pm-search-advanced/package.json +1 -1
  191. package/packages/pm-templates/package.json +1 -1
  192. package/packages/pm-todos/package.json +1 -1
  193. package/packages/pm-vcs/package.json +1 -1
  194. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  195. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  196. package/dist/cli-bundle/chunks/chunk-74RGSPLL.js +0 -2
  197. package/dist/cli-bundle/chunks/chunk-7WIHZI2M.js +0 -5
  198. package/dist/cli-bundle/chunks/chunk-GLQMKUGP.js +0 -2
  199. package/dist/cli-bundle/chunks/chunk-MACGGTLQ.js +0 -29
  200. package/dist/cli-bundle/chunks/chunk-P6BEYAON.js +0 -8
  201. package/dist/cli-bundle/chunks/chunk-TSWEX72T.js +0 -20
  202. package/dist/cli-bundle/chunks/chunk-YKQTETJI.js +0 -235
  203. package/dist/cli-bundle/chunks/register-mutation-5F5CYUWZ.js +0 -20
  204. package/dist/cli-bundle/focused-chunks/chunk-26O2WB73.js +0 -10
  205. package/dist/cli-bundle/focused-chunks/chunk-5YU75QLV.js +0 -2
  206. package/dist/cli-bundle/focused-chunks/chunk-B2CMFYRZ.js +0 -2
  207. package/dist/cli-bundle/focused-chunks/chunk-CRY5MHEI.js +0 -2
  208. package/dist/cli-bundle/focused-chunks/chunk-F6WKFXBT.js +0 -8
  209. package/dist/cli-bundle/focused-chunks/chunk-OROZM37I.js +0 -177
  210. package/dist/cli-bundle/focused-chunks/chunk-PNGYYQY7.js +0 -2
  211. package/dist/cli-bundle/focused-chunks/chunk-TPOL4TWE.js +0 -9
  212. package/dist/cli-bundle/focused-chunks/chunk-XSMA2W6Q.js +0 -12
  213. package/dist/cli-bundle/focused-chunks/chunk-ZJHYQOTM.js +0 -20
@@ -1,2 +1,2 @@
1
- import{$b as xi,A as ke,B as Ae,C as Ee,D as Re,E as Se,F as Te,G as Ie,Ma as Ze,Na as Ge,Oa as He,Qb as ei,Rb as ii,Sb as ri,Tb as ti,Ub as ni,Vb as oi,Wb as di,Xb as ai,Yb as ui,Zb as si,_b as _,ac as vi,ba as $e,bc as bi,c as M,ca as Be,cc as yi,d as ee,da as Ce,db as Ve,dc as l,e as ie,ea as De,f as re,fa as Ne,g as te,ga as Oe,h as ne,ha as Ue,hb as Ye,i as oe,ia as Pe,ib as Ke,j as de,ja as je,jb as Xe,k as ae,kb as Le,l as ue,lb as Qe,m as se,mb as Me,n as fe,o as pe,p as ce,pa as Fe,q as _e,qa as qe,r as le,ra as ze,s as me,sa as Je,t as xe,ta as We,u as ve,v as be,w as ye,x as he,y as we,z as ge}from"./focused-chunks/chunk-SL5YVVPV.js";import"./focused-chunks/chunk-FHUARRMA.js";import"./focused-chunks/chunk-U5SHHU7E.js";import{E as B,F as C,G as D,H as N,I as O,J as U,K as P}from"./focused-chunks/chunk-ZAWAL2CG.js";import"./focused-chunks/chunk-PNGYYQY7.js";import{Aa as J,Ba as W,Ca as Z,Ea as G,Fa as H,Ga as V,Ha as Y,Ia as K,Ja as X,Ka as L,La as Q,rb as fi,sb as pi,tb as ci,ub as _i,vb as li,wb as mi,xa as F,ya as q,za as z}from"./focused-chunks/chunk-ZJHYQOTM.js";import"./focused-chunks/chunk-7N5MRONP.js";import"./focused-chunks/chunk-CRY5MHEI.js";import"./focused-chunks/chunk-B2CMFYRZ.js";import{Sa as j}from"./focused-chunks/chunk-OROZM37I.js";import"./focused-chunks/chunk-M36SF4GE.js";import{I as c}from"./focused-chunks/chunk-26O2WB73.js";import{$b as S,Ub as h,Vb as w,Wb as g,Xb as k,Yb as A,Zb as E,_b as R,ac as T,bc as I,cc as $}from"./focused-chunks/chunk-TPOL4TWE.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var m=["captured_redacted","captured_verbatim"],x=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function n(e){return typeof e=="string"&&e.trim().length>0}function v(e,i){if(typeof i!="object"||i===null||Array.isArray(i))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=i,t=[];r.boundary_id!==e.id&&t.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!m.includes(r.capture_source)||!n(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(n)||!("input"in r)||!("observed"in r))&&t.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let d=JSON.stringify(i);for(let s of x)s.pattern.test(d)&&t.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return t}function b(e,i){let r=Date.parse(e.waiver_expires_at),t=n(e.waiver_reason)&&n(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&c(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:t&&r>=i?1:0,findings:t?r<i?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function y(e,i,r){if(!n(e.id)||!n(e.producer)||!n(e.consumer)||!n(e.format))return{captured:0,waived:0,findings:[{boundary_id:n(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let t=i[e.fixture_path],d=n(e.fixture_path)&&e.fixture_path in i?v(e,t):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:d.length===0?1:0,waived:0,findings:d}}return b(e,r)}function wi(e,i,r=new Date){let t=[];if(e.version!==1||!n(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let d=new Set,s=0,p=0;for(let o of e.boundaries){if(typeof o!="object"||o===null||Array.isArray(o)){t.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let a=o,u=n(a.id)?a.id:void 0;if(u!==void 0&&d.has(u)){t.push({boundary_id:u,kind:"duplicate_boundary",detail:`Boundary ${u} is inventoried more than once.`});continue}u!==void 0&&d.add(u);let f=y(a,i,r.getTime());s+=f.captured,p+=f.waived,t.push(...f.findings)}return t.sort((o,a)=>o.boundary_id!==a.boundary_id?o.boundary_id.localeCompare(a.boundary_id):o.kind.localeCompare(a.kind)),{ok:t.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:p,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="db5452b6-8d36-5425-a033-1d36757ce96e")}catch{}})();export{di as ASSURANCE_ACTIONS,ai as ASSURANCE_DECLARATION_KINDS,ne as ASSURANCE_DOCUMENT_VERSION,oe as ASSURANCE_GATE_TRIGGERS,de as ASSURANCE_MEASUREMENT_SOURCE_KINDS,ke as ASSURANCE_PRESET_IDS,ee as AssuranceEvaluationRefusalError,M as AssuranceMutationRefusalError,ie as AssuranceSourceResolutionError,m as BOUNDARY_FIXTURE_CAPTURE_SOURCES,B as DEFECT_ESCAPE_CLASSES,C as DEFECT_GATE_EVIDENCE_DISPOSITIONS,$e as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,w as MAX_WORKFLOW_POLICIES,g as MAX_WORKFLOW_POLICY_TERMS,F as PM_MUTATION_ACTION_CONTRACTS,h as WORKFLOW_POLICY_ACTIONS,qe as WORKFLOW_POLICY_DOCUMENT_SCHEMA,Fe as WORKFLOW_POLICY_SCHEMA,Le as _testOnlyHealthCommand,pi as _testOnlySimilarity,ii as _testOnlyValidateCommand,yi as _testOnlyWorkspacePosition,Se as acceptAssuranceProposals,je as acknowledgeUnknownAuthorHistoryEvents,Pe as acknowledgeUnknownAuthorHistoryEventsFromTransport,N as analyzeDefectChangeRisk,oi as analyzeDefectRecurrenceCoverage,_i as analyzeDuplicateItems,Ee as applyAssurancePreset,ae as assuranceAssertionUpdateIsLoosening,D as buildDefectRecurrenceIndex,Qe as buildLinkedFileRepairReport,Ke as buildStatusRoleWarnings,ze as buildWorkflowCompletenessCheck,Be as classifyHistoryAuthorEvent,Ae as createAssurancePreset,ti as createAssuranceWorkspaceContext,ce as createEmptyAssuranceDocument,Je as createLifecycleCompletenessPolicies,$ as createWorkflowPolicyEvaluator,Re as deriveAssuranceProposals,le as evaluateAssuranceAssertion,me as evaluateAssuranceGate,wi as evaluateBoundaryFixtures,O as evaluateDefectGateEvidence,_e as evaluateMeasurement,z as evaluateMutationGuard,mi as evaluateSimilarityGovernance,I as evaluateWorkflowPolicies,li as findDuplicateClusters,ci as findSimilarItems,bi as formatWorkspacePositionHuman,ve as getAssuranceDeclaration,Z as getMutationActionContract,Ce as inspectHistoryAuthorStream,L as inspectStaleInProgressItems,Ye as inspectStatusRoleAssignments,J as isMutationAction,G as jaccardSimilarity,xe as listAssuranceDeclarations,ge as listAssuranceVerdicts,Ge as listInvalidProvenanceHistoryStreamIds,W as listMutationActions,te as normalizeAssuranceEvaluation,re as normalizeAssuranceMutation,Ze as normalizeInvalidHistoryProvenance,H as normalizeSimilarityText,P as parseDefectChangeRiskRequest,ni as parseDefectRecurrenceCoverageRequest,U as parseDefectRecurrencePolicy,Ue as parseUnknownAuthorHistoryEventCoordinates,k as parseWorkflowPolicy,A as parseWorkflowPolicyDocument,Ne as planUnknownAuthorHistoryAcknowledgment,Y as prepareSimilarityText,ei as projectValidateCounts,Te as promoteAssuranceAssertion,be as putAssuranceDeclaration,ye as putAssuranceDeclarationBundle,j as readWorkflowPolicies,E as readWorkflowPolicyField,vi as readWorkspacePosition,we as recordAssuranceVerdict,he as removeAssuranceDeclaration,Oe as resolveUnknownAuthorAcknowledgmentSelector,ui as runAssuranceAction,si as runAssuranceDispatch,xi as runGc,Xe as runHealth,Ve as runHistoryMaintenance,l as runReindex,_ as runUpgrade,ri as runValidate,We as runWorkflowPolicyAction,Ie as scanExtensionHostVersions,De as scanHistoryAuthorAttribution,q as scanMutationSecrets,He as scanProvenanceResolverHealth,Q as scanStaleInProgressItems,Me as scanStorageIntegrity,K as scoreItemSimilarity,X as scorePreparedItemSimilarity,fi as similarityAdvisoryWarnings,V as tokenizeSimilarityText,se as validateAssertionDefinition,pe as validateAssuranceDocument,fe as validateGateDefinition,ue as validateMeasurementDefinition,S as workflowApprovalFingerprint,T as workflowPolicyApplies,R as workflowPolicyFingerprint};
1
+ import{$b as ki,A as Ie,B as $e,C as Be,D as Ce,E as De,F as Ne,G as Oe,Ma as Xe,Na as Le,Oa as Qe,Qb as ai,Rb as di,Sb as ui,Tb as si,Ub as fi,Vb as pi,Wb as ci,Xb as _i,Yb as li,Zb as mi,_b as gi,ac as Ai,ba as Ue,bc as Ei,c as oe,ca as Pe,cc as _,d as ae,da as je,db as Me,dc as Ri,e as de,ea as Fe,ec as Si,f as ue,fa as qe,fc as Ti,g as se,ga as ze,gc as Ii,h as fe,ha as Je,hb as ei,hc as l,i as pe,ia as We,ib as ii,j as ce,ja as Ze,jb as ri,k as _e,kb as ti,l as le,lb as ni,m as me,mb as oi,n as xe,o as ve,p as be,pa as Ge,q as ye,qa as He,r as he,ra as Ve,s as we,sa as Ye,t as ge,ta as Ke,u as ke,v as Ae,w as Ee,x as Re,y as Se,z as Te}from"./focused-chunks/chunk-7EKXAUKF.js";import"./focused-chunks/chunk-SDQOOL34.js";import{h as j}from"./focused-chunks/chunk-IURELABV.js";import{E as B,F as C,G as D,H as N,I as O,J as U,K as P}from"./focused-chunks/chunk-2BQ4JSJQ.js";import"./focused-chunks/chunk-EIXGDI77.js";import{Aa as Q,Ba as M,Ca as ee,Da as ie,Ea as re,Fa as te,Ga as ne,mb as xi,nb as vi,ob as bi,pb as yi,qb as hi,rb as wi,sa as G,ta as H,ua as V,va as Y,wa as K,xa as X,za as L}from"./focused-chunks/chunk-VWMP6W7Y.js";import"./focused-chunks/chunk-PERRTPIY.js";import"./focused-chunks/chunk-MFVABYEU.js";import"./focused-chunks/chunk-GAKFECOQ.js";import{D as F,E as q,F as z,G as J,H as W,cb as Z}from"./focused-chunks/chunk-5PSYV3AT.js";import"./focused-chunks/chunk-TTRB47KM.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{Ob as h,Pb as w,Qb as g,Rb as k,Sb as A,Tb as E,Td as c,Ub as R,Vb as S,Wb as T,Xb as I,Yb as $}from"./focused-chunks/chunk-BIOWOU6S.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var m=["captured_redacted","captured_verbatim"],x=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function n(e){return typeof e=="string"&&e.trim().length>0}function v(e,i){if(typeof i!="object"||i===null||Array.isArray(i))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=i,t=[];r.boundary_id!==e.id&&t.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!m.includes(r.capture_source)||!n(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(n)||!("input"in r)||!("observed"in r))&&t.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let a=JSON.stringify(i);for(let s of x)s.pattern.test(a)&&t.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return t}function b(e,i){let r=Date.parse(e.waiver_expires_at),t=n(e.waiver_reason)&&n(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&c(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:t&&r>=i?1:0,findings:t?r<i?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function y(e,i,r){if(!n(e.id)||!n(e.producer)||!n(e.consumer)||!n(e.format))return{captured:0,waived:0,findings:[{boundary_id:n(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let t=i[e.fixture_path],a=n(e.fixture_path)&&e.fixture_path in i?v(e,t):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:a.length===0?1:0,waived:0,findings:a}}return b(e,r)}function Bi(e,i,r=new Date){let t=[];if(e.version!==1||!n(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let a=new Set,s=0,p=0;for(let o of e.boundaries){if(typeof o!="object"||o===null||Array.isArray(o)){t.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=o,u=n(d.id)?d.id:void 0;if(u!==void 0&&a.has(u)){t.push({boundary_id:u,kind:"duplicate_boundary",detail:`Boundary ${u} is inventoried more than once.`});continue}u!==void 0&&a.add(u);let f=y(d,i,r.getTime());s+=f.captured,p+=f.waived,t.push(...f.findings)}return t.sort((o,d)=>o.boundary_id!==d.boundary_id?o.boundary_id.localeCompare(d.boundary_id):o.kind.localeCompare(d.kind)),{ok:t.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:p,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="ae8f06a0-a2e6-5f91-99f7-e822270b491d")}catch{}})();export{ci as ASSURANCE_ACTIONS,_i as ASSURANCE_DECLARATION_KINDS,fe as ASSURANCE_DOCUMENT_VERSION,pe as ASSURANCE_GATE_TRIGGERS,ce as ASSURANCE_MEASUREMENT_SOURCE_KINDS,Ie as ASSURANCE_PRESET_IDS,ae as AssuranceEvaluationRefusalError,oe as AssuranceMutationRefusalError,de as AssuranceSourceResolutionError,m as BOUNDARY_FIXTURE_CAPTURE_SOURCES,z as CURRENT_HISTORY_HASH_ALGORITHM,B as DEFECT_ESCAPE_CLASSES,C as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ue as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,F as HISTORY_HASH_ALGORITHMS,q as LEGACY_HISTORY_HASH_ALGORITHM,w as MAX_WORKFLOW_POLICIES,g as MAX_WORKFLOW_POLICY_TERMS,j as PM_HISTORY_ATTESTATION_CONTRACT,G as PM_MUTATION_ACTION_CONTRACTS,h as WORKFLOW_POLICY_ACTIONS,He as WORKFLOW_POLICY_DOCUMENT_SCHEMA,Ge as WORKFLOW_POLICY_SCHEMA,ti as _testOnlyHealthCommand,vi as _testOnlySimilarity,di as _testOnlyValidateCommand,Ii as _testOnlyWorkspacePosition,De as acceptAssuranceProposals,Ze as acknowledgeUnknownAuthorHistoryEvents,We as acknowledgeUnknownAuthorHistoryEventsFromTransport,N as analyzeDefectChangeRisk,pi as analyzeDefectRecurrenceCoverage,yi as analyzeDuplicateItems,Be as applyAssurancePreset,_e as assuranceAssertionUpdateIsLoosening,D as buildDefectRecurrenceIndex,ni as buildLinkedFileRepairReport,ii as buildStatusRoleWarnings,Ve as buildWorkflowCompletenessCheck,Pe as classifyHistoryAuthorEvent,$e as createAssurancePreset,si as createAssuranceWorkspaceContext,be as createEmptyAssuranceDocument,Ye as createLifecycleCompletenessPolicies,$ as createWorkflowPolicyEvaluator,Ce as deriveAssuranceProposals,he as evaluateAssuranceAssertion,we as evaluateAssuranceGate,Bi as evaluateBoundaryFixtures,O as evaluateDefectGateEvidence,ye as evaluateMeasurement,V as evaluateMutationGuard,wi as evaluateSimilarityGovernance,I as evaluateWorkflowPolicies,ki as exportAttestation,hi as findDuplicateClusters,bi as findSimilarItems,Ti as formatWorkspacePositionHuman,ke as getAssuranceDeclaration,X as getMutationActionContract,W as historyDigest,je as inspectHistoryAuthorStream,te as inspectStaleInProgressItems,ei as inspectStatusRoleAssignments,Y as isMutationAction,L as jaccardSimilarity,ge as listAssuranceDeclarations,Te as listAssuranceVerdicts,Le as listInvalidProvenanceHistoryStreamIds,K as listMutationActions,se as normalizeAssuranceEvaluation,ue as normalizeAssuranceMutation,Xe as normalizeInvalidHistoryProvenance,Q as normalizeSimilarityText,P as parseDefectChangeRiskRequest,fi as parseDefectRecurrenceCoverageRequest,U as parseDefectRecurrencePolicy,gi as parseHistoryAttestation,Je as parseUnknownAuthorHistoryEventCoordinates,k as parseWorkflowPolicy,A as parseWorkflowPolicyDocument,qe as planUnknownAuthorHistoryAcknowledgment,ee as prepareSimilarityText,ai as projectValidateCounts,Ne as promoteAssuranceAssertion,Ae as putAssuranceDeclaration,Ee as putAssuranceDeclarationBundle,Z as readWorkflowPolicies,E as readWorkflowPolicyField,Si as readWorkspacePosition,Se as recordAssuranceVerdict,Re as removeAssuranceDeclaration,J as resolveHistoryHashAlgorithm,ze as resolveUnknownAuthorAcknowledgmentSelector,li as runAssuranceAction,mi as runAssuranceDispatch,Ri as runGc,ri as runHealth,Ei as runHistoryAttest,Me as runHistoryMaintenance,l as runReindex,_ as runUpgrade,ui as runValidate,Ke as runWorkflowPolicyAction,Oe as scanExtensionHostVersions,Fe as scanHistoryAuthorAttribution,H as scanMutationSecrets,Qe as scanProvenanceResolverHealth,ne as scanStaleInProgressItems,oi as scanStorageIntegrity,ie as scoreItemSimilarity,re as scorePreparedItemSimilarity,xi as similarityAdvisoryWarnings,M as tokenizeSimilarityText,me as validateAssertionDefinition,ve as validateAssuranceDocument,xe as validateGateDefinition,le as validateMeasurementDefinition,Ai as verifyAttestation,S as workflowApprovalFingerprint,T as workflowPolicyApplies,R as workflowPolicyFingerprint};
2
2
  //# sourceMappingURL=sdk-governance.js.map
@@ -1,2 +1,2 @@
1
- import{a as Be,b as ze,c as Ie}from"./focused-chunks/chunk-F6WKFXBT.js";import{A as me,B as ye,C as we,D as be,E as Re,F as _e,G as ke,H as Ae,I as Ge,J as Se,K as Ee,a as We,b as je,c as Fe,d as Ue,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as te,m as re,n as ne,o as ie,p as se,q as oe,r as ae,s as pe,t as ce,u as de,v as le,w as he,x as fe,y as ge,z as ue}from"./focused-chunks/chunk-PNGYYQY7.js";import{$b as Je,Bb as $,Cb as v,Db as H,Eb as P,Fb as M,Gb as N,Hb as B,Ib as z,Jb as W,Kb as j,Lb as F,Nb as k,Ob as U,Pb as L,Qb as V,Rb as K,Sb as Le,Yb as Ve,Zb as Ke,_b as qe,ac as Ze,bc as Qe,cc as Xe,dc as Ye,ec as et}from"./focused-chunks/chunk-OROZM37I.js";import"./focused-chunks/chunk-M36SF4GE.js";import"./focused-chunks/chunk-26O2WB73.js";import{$a as E,Za as $e,_a as _,ab as ve,bb as He,cb as Pe,db as Me,eb as f,fb as Ne,kc as x,pb as b}from"./focused-chunks/chunk-TPOL4TWE.js";import{createHash as De}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:De("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Te(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function d(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await d(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await d(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ce(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let c=n.get(o.kind);if(c&&b(c)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function I(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Oe(e){let t=I(e.nodeCount,"nodeCount"),r=I(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function D(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=E(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await d(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await d(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await d(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await d(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xe(e){return D(new m,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();import{createHash as T}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function C(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Et(e,t){let r=C(t.migrationId,"migrationId"),n=C(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),c=s.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${S}`,relationshipId:`migration:${r}:${S}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:c})).digest("hex"),O=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!O.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3160880c-9d85-52c5-ae1d-ada213f56ce6")}catch{}})();export{Ke as ACTIONABILITY_ORDERING_KINDS,$e as BUILTIN_RELATIONSHIP_KINDS,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,x as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Be as RelationshipEventLog,ze as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,L as WorkspaceGraphCache,je as analyzeGraphImpact,H as analyzeHierarchyIntegrity,Fe as analyzeKnowledgeGraph,We as analyzeRelationshipExecution,se as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,N as assertHierarchyMutationAllowed,xe as assertMemoryRelationshipGraphAdapterConformance,Me as assertRelationshipEdgeAllowed,D as assertRelationshipGraphAdapterConformance,le as auditWorkspaceRelationshipGraph,Le as buildRelationshipContext,ve as canonicalizeRelationshipKind,be as clearDurableGraphCache,qe as collectBlockedByIds,Ze as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Xe as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,de as collectDuplicateRelationshipEdgeGroups,v as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ie as collectNewOrderingCycleWarnings,ae as collectOrderingCycles,W as collectOrderingStorageContradictions,Ue as compareRelationshipSnapshots,et as computeActionabilityReport,ne as computeRelationshipCentrality,re as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,E as createRelationshipKindRegistry,Ne as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,he as diffRelationshipAuditSnapshots,ue as durableGraphCachePath,Re as durableGraphCacheStatus,X as enumerateRelationshipPaths,Ce as federateRelationshipGraphSnapshots,te as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,P as formatHierarchyRelation,pe as formatOrderingStorageContradiction,me as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Je as indexBlockedByIds,M as indexHierarchyRelations,Pe as isOrderingRelationshipKind,ke as loadGraphAuditBaseline,d as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Et as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,He as resolveCanonicalRelationshipKind,Qe as resolveItemBlockers,Ve as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,Ee as runGraph,Ae as saveGraphAuditBaseline,Ye as selectActionableEntries,_e as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,V as workspaceGraphCache};
1
+ import{a as Be,b as ze,c as Ie}from"./focused-chunks/chunk-KK7KSXUP.js";import{A as me,B as ye,C as we,D as be,E as Re,F as _e,G as ke,H as Ae,I as Ge,J as Se,K as Ee,a as We,b as je,c as Fe,d as Ue,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as te,m as re,n as ne,o as ie,p as se,q as oe,r as ae,s as pe,t as ce,u as de,v as le,w as he,x as fe,y as ge,z as ue}from"./focused-chunks/chunk-EIXGDI77.js";import{Jb as $,Kb as v,Lb as H,Mb as P,Nb as M,Ob as N,Pb as B,Qb as z,Rb as W,Sb as j,Tb as F,Vb as k,Wb as U,Xb as L,Yb as V,Zb as K,_b as Le,ec as Ve,fc as Ke,gc as qe,hc as Je,ic as Ze,jc as Qe,kc as Xe,lc as Ye,mc as et}from"./focused-chunks/chunk-5PSYV3AT.js";import"./focused-chunks/chunk-TTRB47KM.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{$a as E,Za as $e,_a as _,ab as ve,bb as He,cb as Pe,db as Me,eb as f,ec as x,fb as Ne,pb as b}from"./focused-chunks/chunk-BIOWOU6S.js";import{createHash as De}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:De("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Te(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function d(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await d(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await d(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ce(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let c=n.get(o.kind);if(c&&b(c)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function I(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Oe(e){let t=I(e.nodeCount,"nodeCount"),r=I(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function D(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=E(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await d(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await d(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await d(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await d(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xe(e){return D(new m,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();import{createHash as T}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function C(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Et(e,t){let r=C(t.migrationId,"migrationId"),n=C(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),c=s.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${S}`,relationshipId:`migration:${r}:${S}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:c})).digest("hex"),O=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!O.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3160880c-9d85-52c5-ae1d-ada213f56ce6")}catch{}})();export{Ke as ACTIONABILITY_ORDERING_KINDS,$e as BUILTIN_RELATIONSHIP_KINDS,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,x as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Be as RelationshipEventLog,ze as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,L as WorkspaceGraphCache,je as analyzeGraphImpact,H as analyzeHierarchyIntegrity,Fe as analyzeKnowledgeGraph,We as analyzeRelationshipExecution,se as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,N as assertHierarchyMutationAllowed,xe as assertMemoryRelationshipGraphAdapterConformance,Me as assertRelationshipEdgeAllowed,D as assertRelationshipGraphAdapterConformance,le as auditWorkspaceRelationshipGraph,Le as buildRelationshipContext,ve as canonicalizeRelationshipKind,be as clearDurableGraphCache,qe as collectBlockedByIds,Ze as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Xe as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,de as collectDuplicateRelationshipEdgeGroups,v as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ie as collectNewOrderingCycleWarnings,ae as collectOrderingCycles,W as collectOrderingStorageContradictions,Ue as compareRelationshipSnapshots,et as computeActionabilityReport,ne as computeRelationshipCentrality,re as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,E as createRelationshipKindRegistry,Ne as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,he as diffRelationshipAuditSnapshots,ue as durableGraphCachePath,Re as durableGraphCacheStatus,X as enumerateRelationshipPaths,Ce as federateRelationshipGraphSnapshots,te as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,P as formatHierarchyRelation,pe as formatOrderingStorageContradiction,me as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Je as indexBlockedByIds,M as indexHierarchyRelations,Pe as isOrderingRelationshipKind,ke as loadGraphAuditBaseline,d as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Et as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,He as resolveCanonicalRelationshipKind,Qe as resolveItemBlockers,Ve as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,Ee as runGraph,Ae as saveGraphAuditBaseline,Ye as selectActionableEntries,_e as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,V as workspaceGraphCache};
2
2
  //# sourceMappingURL=sdk-graph.js.map