@xemahq/contracts 0.76.0 → 0.78.0

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 (160) hide show
  1. package/README.md +1 -1
  2. package/dist/.source-stamp.json +2 -2
  3. package/dist/authorization-module/index.d.ts +2 -0
  4. package/dist/authorization-module/index.d.ts.map +1 -1
  5. package/dist/authorization-module/index.js +2 -0
  6. package/dist/authorization-module/index.js.map +1 -1
  7. package/dist/authorization-module/lib/authorization-composition-error.d.ts +11 -0
  8. package/dist/authorization-module/lib/authorization-composition-error.d.ts.map +1 -1
  9. package/dist/authorization-module/lib/authorization-composition-error.js +16 -1
  10. package/dist/authorization-module/lib/authorization-composition-error.js.map +1 -1
  11. package/dist/authorization-module/lib/authorization-interface-requirements.d.ts +5 -1
  12. package/dist/authorization-module/lib/authorization-interface-requirements.d.ts.map +1 -1
  13. package/dist/authorization-module/lib/authorization-interface-requirements.js +1 -0
  14. package/dist/authorization-module/lib/authorization-interface-requirements.js.map +1 -1
  15. package/dist/authorization-module/lib/authorization-module-contribution.d.ts +24 -0
  16. package/dist/authorization-module/lib/authorization-module-contribution.d.ts.map +1 -1
  17. package/dist/authorization-module/lib/authorization-module-contribution.js +1 -0
  18. package/dist/authorization-module/lib/authorization-module-contribution.js.map +1 -1
  19. package/dist/authorization-module/lib/authorization-module-envelope.d.ts +11 -0
  20. package/dist/authorization-module/lib/authorization-module-envelope.d.ts.map +1 -1
  21. package/dist/authorization-module/lib/authorization-module-envelope.js +4 -0
  22. package/dist/authorization-module/lib/authorization-module-envelope.js.map +1 -1
  23. package/dist/authorization-module/lib/delegation-origination.d.ts +26 -0
  24. package/dist/authorization-module/lib/delegation-origination.d.ts.map +1 -0
  25. package/dist/authorization-module/lib/delegation-origination.js +43 -0
  26. package/dist/authorization-module/lib/delegation-origination.js.map +1 -0
  27. package/dist/authorization-module/lib/delegation-wildcard-ceiling.d.ts +6 -0
  28. package/dist/authorization-module/lib/delegation-wildcard-ceiling.d.ts.map +1 -0
  29. package/dist/authorization-module/lib/delegation-wildcard-ceiling.js +17 -0
  30. package/dist/authorization-module/lib/delegation-wildcard-ceiling.js.map +1 -0
  31. package/dist/authorization-module/lib/platform-authorization-modules.d.ts.map +1 -1
  32. package/dist/authorization-module/lib/platform-authorization-modules.js +10 -11
  33. package/dist/authorization-module/lib/platform-authorization-modules.js.map +1 -1
  34. package/dist/authorization-module/platform/xema_core.fga +76 -45
  35. package/dist/authorization-module/platform/xema_core.fga.yaml +522 -97
  36. package/dist/authorization-module/platform/xema_sharing.fga +48 -33
  37. package/dist/authorization-module/platform/xema_sharing.fga.yaml +555 -2
  38. package/dist/authorization-module/server/authorization-interface-conformance.d.ts +1 -0
  39. package/dist/authorization-module/server/authorization-interface-conformance.d.ts.map +1 -1
  40. package/dist/authorization-module/server/authorization-interface-conformance.js +13 -1
  41. package/dist/authorization-module/server/authorization-interface-conformance.js.map +1 -1
  42. package/dist/authorization-module/server/compose-authorization-base.d.ts +2 -0
  43. package/dist/authorization-module/server/compose-authorization-base.d.ts.map +1 -1
  44. package/dist/authorization-module/server/compose-authorization-base.js +15 -2
  45. package/dist/authorization-module/server/compose-authorization-base.js.map +1 -1
  46. package/dist/authorization-module/server/delegation-origination-conformance.d.ts +15 -0
  47. package/dist/authorization-module/server/delegation-origination-conformance.d.ts.map +1 -0
  48. package/dist/authorization-module/server/delegation-origination-conformance.js +92 -0
  49. package/dist/authorization-module/server/delegation-origination-conformance.js.map +1 -0
  50. package/dist/authorization-module/server/userset-subject-types.d.ts +3 -0
  51. package/dist/authorization-module/server/userset-subject-types.d.ts.map +1 -0
  52. package/dist/authorization-module/server/userset-subject-types.js +65 -0
  53. package/dist/authorization-module/server/userset-subject-types.js.map +1 -0
  54. package/dist/authzen/index.d.ts +1 -0
  55. package/dist/authzen/index.d.ts.map +1 -1
  56. package/dist/authzen/index.js +1 -0
  57. package/dist/authzen/index.js.map +1 -1
  58. package/dist/authzen/lib/durable-delegation-model.d.ts +33 -11
  59. package/dist/authzen/lib/durable-delegation-model.d.ts.map +1 -1
  60. package/dist/authzen/lib/durable-delegation-model.js +54 -16
  61. package/dist/authzen/lib/durable-delegation-model.js.map +1 -1
  62. package/dist/authzen/lib/xema-membership.d.ts +6 -0
  63. package/dist/authzen/lib/xema-membership.d.ts.map +1 -0
  64. package/dist/authzen/lib/xema-membership.js +16 -0
  65. package/dist/authzen/lib/xema-membership.js.map +1 -0
  66. package/dist/biome-dependency/lib/peer-seam-table.d.ts +1 -0
  67. package/dist/biome-dependency/lib/peer-seam-table.d.ts.map +1 -1
  68. package/dist/biome-dependency/lib/peer-seam-table.js +2 -1
  69. package/dist/biome-dependency/lib/peer-seam-table.js.map +1 -1
  70. package/dist/deployment/lib/resolved-deployment.d.ts +29 -4
  71. package/dist/deployment/lib/resolved-deployment.d.ts.map +1 -1
  72. package/dist/deployment/lib/resolved-deployment.js +57 -17
  73. package/dist/deployment/lib/resolved-deployment.js.map +1 -1
  74. package/dist/distribution/index.d.ts +5 -1
  75. package/dist/distribution/index.d.ts.map +1 -1
  76. package/dist/distribution/index.js +6 -0
  77. package/dist/distribution/index.js.map +1 -1
  78. package/dist/distribution/lib/authorization-lock.d.ts +16 -0
  79. package/dist/distribution/lib/authorization-lock.d.ts.map +1 -0
  80. package/dist/distribution/lib/authorization-lock.js +34 -0
  81. package/dist/distribution/lib/authorization-lock.js.map +1 -0
  82. package/dist/distribution/lib/customer-edition-definition.d.ts +10 -1
  83. package/dist/distribution/lib/customer-edition-definition.d.ts.map +1 -1
  84. package/dist/distribution/lib/customer-edition-definition.js +53 -2
  85. package/dist/distribution/lib/customer-edition-definition.js.map +1 -1
  86. package/dist/distribution/lib/delivered-biome.d.ts +2 -2
  87. package/dist/distribution/lib/delivered-biome.d.ts.map +1 -1
  88. package/dist/distribution/lib/delivered-biome.js.map +1 -1
  89. package/dist/distribution/lib/distribution-lock.d.ts +2 -1
  90. package/dist/distribution/lib/distribution-lock.d.ts.map +1 -1
  91. package/dist/distribution/lib/distribution-lock.js +24 -0
  92. package/dist/distribution/lib/distribution-lock.js.map +1 -1
  93. package/dist/distribution/lib/image-producer-evidence.d.ts +86 -14
  94. package/dist/distribution/lib/image-producer-evidence.d.ts.map +1 -1
  95. package/dist/distribution/lib/image-producer-evidence.js +72 -12
  96. package/dist/distribution/lib/image-producer-evidence.js.map +1 -1
  97. package/dist/distribution/lib/kernel-contract-authority.d.ts +1 -0
  98. package/dist/distribution/lib/kernel-contract-authority.d.ts.map +1 -1
  99. package/dist/distribution/lib/kernel-contract-authority.js +6 -2
  100. package/dist/distribution/lib/kernel-contract-authority.js.map +1 -1
  101. package/dist/distribution/lib/kernel-contract-source-paths.d.ts +1 -1
  102. package/dist/distribution/lib/kernel-contract-source-paths.d.ts.map +1 -1
  103. package/dist/distribution/lib/kernel-contract-source-paths.js +9 -0
  104. package/dist/distribution/lib/kernel-contract-source-paths.js.map +1 -1
  105. package/dist/distribution/lib/nexus-endpoint-specs.d.ts +2 -2
  106. package/dist/distribution/lib/nexus-endpoint-specs.d.ts.map +1 -1
  107. package/dist/distribution/lib/nexus-endpoint-specs.js.map +1 -1
  108. package/dist/distribution/lib/resolve-unsplit-deployment.d.ts +16 -0
  109. package/dist/distribution/lib/resolve-unsplit-deployment.d.ts.map +1 -0
  110. package/dist/distribution/lib/resolve-unsplit-deployment.js +48 -0
  111. package/dist/distribution/lib/resolve-unsplit-deployment.js.map +1 -0
  112. package/dist/distribution/lib/runtime-image-source-index.d.ts +18 -1
  113. package/dist/distribution/lib/runtime-image-source-index.d.ts.map +1 -1
  114. package/dist/distribution/lib/runtime-image-source-index.js +38 -2
  115. package/dist/distribution/lib/runtime-image-source-index.js.map +1 -1
  116. package/dist/distribution/lib/verified-resolved-deployment.d.ts +12 -2
  117. package/dist/distribution/lib/verified-resolved-deployment.d.ts.map +1 -1
  118. package/dist/distribution/lib/verify-delivered-locks.d.ts +41 -0
  119. package/dist/distribution/lib/verify-delivered-locks.d.ts.map +1 -0
  120. package/dist/distribution/lib/verify-delivered-locks.js +76 -0
  121. package/dist/distribution/lib/verify-delivered-locks.js.map +1 -0
  122. package/dist/distribution/lib/verify-resolved-deployment.d.ts +27 -7
  123. package/dist/distribution/lib/verify-resolved-deployment.d.ts.map +1 -1
  124. package/dist/distribution/lib/verify-resolved-deployment.js +61 -4
  125. package/dist/distribution/lib/verify-resolved-deployment.js.map +1 -1
  126. package/dist/distribution/server/index.d.ts +8 -0
  127. package/dist/distribution/server/index.d.ts.map +1 -0
  128. package/dist/distribution/server/index.js +34 -0
  129. package/dist/distribution/server/index.js.map +1 -0
  130. package/dist/edition-protocol/edition-contract.schema.json +1 -1
  131. package/dist/edition-protocol/edition-protocol.json +1 -1
  132. package/dist/edition-protocol/lib/edition-protocol.d.ts +2 -1
  133. package/dist/edition-protocol/lib/edition-protocol.d.ts.map +1 -1
  134. package/dist/edition-protocol/lib/edition-protocol.js +4 -2
  135. package/dist/edition-protocol/lib/edition-protocol.js.map +1 -1
  136. package/dist/redis-key/index.d.ts +1 -0
  137. package/dist/redis-key/index.d.ts.map +1 -1
  138. package/dist/redis-key/index.js +1 -0
  139. package/dist/redis-key/index.js.map +1 -1
  140. package/dist/redis-key/lib/deployment-acl-policy.d.ts.map +1 -1
  141. package/dist/redis-key/lib/deployment-acl-policy.js +1 -0
  142. package/dist/redis-key/lib/deployment-acl-policy.js.map +1 -1
  143. package/dist/redis-key/lib/erasure-request.d.ts +6 -0
  144. package/dist/redis-key/lib/erasure-request.d.ts.map +1 -0
  145. package/dist/redis-key/lib/erasure-request.js +75 -0
  146. package/dist/redis-key/lib/erasure-request.js.map +1 -0
  147. package/dist/redis-key/lib/lease-acl-policy.d.ts.map +1 -1
  148. package/dist/redis-key/lib/lease-acl-policy.js +2 -0
  149. package/dist/redis-key/lib/lease-acl-policy.js.map +1 -1
  150. package/dist/resolved-deployment-fixture/lib/resolved-deployment-fixture.d.ts +4 -1
  151. package/dist/resolved-deployment-fixture/lib/resolved-deployment-fixture.d.ts.map +1 -1
  152. package/dist/resolved-deployment-fixture/lib/resolved-deployment-fixture.js +80 -1
  153. package/dist/resolved-deployment-fixture/lib/resolved-deployment-fixture.js.map +1 -1
  154. package/dist/service-registry/lib/on-behalf-descriptor.d.ts.map +1 -1
  155. package/dist/service-registry/lib/on-behalf-descriptor.js.map +1 -1
  156. package/dist/service-registry/lib/service-descriptor.d.ts +6 -0
  157. package/dist/service-registry/lib/service-descriptor.d.ts.map +1 -1
  158. package/dist/service-registry/lib/service-descriptor.js +16 -1
  159. package/dist/service-registry/lib/service-descriptor.js.map +1 -1
  160. package/package.json +5 -2
@@ -43,6 +43,16 @@ module xema_core
43
43
  # originate a durable delegation whose authority OWNER is this subject?". It
44
44
  # grants no capability, scope or holder. These are the zero-configuration
45
45
  # defaults; a biome can never extend a platform type, so nothing widens them.
46
+ #
47
+ # Who may originate over an ANCHOR (`deriveDelegationOriginationChecks`,
48
+ # `@xemahq/contracts/authzen`, the one derivation every consumer uses):
49
+ # "Originating a delegation for an anchor requires `originate` on the anchor.
50
+ # When the anchor's `owner` is a USER, it ALSO requires `may_delegate_for` on
51
+ # that user for the initiator (by default `is_self`: the initiator IS the
52
+ # owner; a deployment may only tighten it). An org admin or a configurer cannot
53
+ # originate over a user-owned anchor. When the owner is the ORG, `originate`
54
+ # alone admits: the authority lent is the org's, the initiator only originates
55
+ # and is recorded as `authorisedBy`."
46
56
  type user
47
57
  relations
48
58
  define is_self: [user]
@@ -54,10 +64,11 @@ type app
54
64
  type external-subject
55
65
 
56
66
  # An ORGANIZATION as a DELEGATOR — never a member of anything, never granted
57
- # anything. It appears only as the OWNER of an org-owned session, which derives
58
- # no human rights: no relation evaluates `owner` for a user, and an org-owned
59
- # session has no `parent` to inherit from. Access to such a session is by the
60
- # delegation it is bound to, checked by the service that owns it.
67
+ # anything. It appears only as the OWNER of an org-owned session: no relation
68
+ # evaluates `owner` for a user, and acting in such a session is by the
69
+ # delegation it is bound to, checked by the service that owns it. Its
70
+ # MANAGEMENT follows the owning space: the org's admins, through the
71
+ # session's `owner_org` (see `xema_session`).
61
72
  type organization
62
73
 
63
74
  type org
@@ -86,13 +97,26 @@ type role
86
97
  define parent: [org]
87
98
  define assignee: [user, agent, service, app, team#member]
88
99
 
100
+ # A MEMBERSHIP is one INSTANCE of a user's membership of an org, and is what a
101
+ # human resource grant binds to (`membership#holder`), not the user and org.
102
+ # Identity gives a NEW membership id on every join. The holder tuple
103
+ # (`user:<u> holder membership:<o|m>`) is written on join and DELETED on leave;
104
+ # a role change keeps the id and writes nothing. So a grant bound to a
105
+ # membership ends with it and never revives on rejoin (a new id), while a
106
+ # demotion keeps it. The object id is the org-qualified `org|membershipId`, so
107
+ # org erasure enumerates it by org.
108
+ type membership
109
+ relations
110
+ define parent: [org]
111
+ define holder: [user]
112
+
89
113
  type project
90
114
  relations
91
115
  define parent: [org, ${XEMA_PARENT_TYPES}]
92
- define owner: [user, agent, service]
93
- define admin: [user, agent, team#member, role#assignee]
94
- define editor: [user, agent, team#member, role#assignee]
95
- define viewer: [user, agent, team#member, role#assignee, org#member]
116
+ define owner: [membership#holder, agent, service]
117
+ define admin: [membership#holder, agent, team#member, role#assignee]
118
+ define editor: [membership#holder, agent, team#member, role#assignee]
119
+ define viewer: [membership#holder, agent, team#member, role#assignee, org#member]
96
120
  define xema_admin: owner or admin or xema_admin from parent
97
121
  define xema_write: editor or xema_admin or xema_write from parent
98
122
  define xema_read: viewer or xema_write or xema_read from parent
@@ -102,28 +126,53 @@ type project
102
126
  # the anchored object gains nothing — and it exists so the PDP's delegation
103
127
  # scope walk (which follows `parent` AND `anchor`) keeps the session and its
104
128
  # descendants inside the delegation's scope. An org-owned session writes
105
- # `owner` (organization) and `anchor`, and no `parent` and no `participant`.
129
+ # `owner` (organization), `owner_org` and `anchor`, and no `parent` and no
130
+ # `participant`.
131
+ #
132
+ # `parent` is the AUDIENCE the launcher stated (relation `parent`): its readers
133
+ # READ the session (`xema_read from parent`) and nothing more. It is never the
134
+ # owning space and never confers management.
135
+ #
136
+ # `owner_org` is the OWNING SPACE (owner rule 10-09: authority follows the
137
+ # owning space). It is written ONLY for an org-owned session, never for a
138
+ # user-owned one (a personal session gives org admins no implicit authority),
139
+ # and the org's admins MANAGE the session through it (`admin from owner_org`):
140
+ # read, write and administer, exactly what `owner` permits apart from acting.
141
+ # Sessions have no team owner, so the relation admits `org` only.
106
142
  #
107
143
  # `can_act` is the human turn/interrupt permission (editor/owner). Human
108
144
  # session relations never confer workload execution authority; that requires
109
- # the session's verified launch delegation. It derives NOTHING from `parent`.
145
+ # the session's verified launch delegation. It derives NOTHING from `parent`
146
+ # or `owner_org`: an org admin manages an org-owned session but never acts as
147
+ # it.
110
148
  #
111
- # Managing the session (`xema_write` / `xema_admin`) is the OWNER ONLY and
112
- # derives NOTHING from `parent`: a parent reader, a parent writer or an org
113
- # admin only READS the session (`xema_read from parent`); they neither act in
114
- # it nor manage it. A future admin "close a member's session" door needs an
115
- # explicit governance capability; inherited manage does not exist.
149
+ # Managing the session (`xema_write` / `xema_admin`) is the owner, or the
150
+ # owning org's admins for an org-owned session. It derives NOTHING from
151
+ # `parent`: a parent reader, a parent writer or an org admin reaching it only
152
+ # through the parent READS the session; they neither act in it nor manage it.
116
153
  # An `editor` is also a reader.
154
+ #
155
+ # `participant` and `editor` are org-scoped grants to a PERSON, so each admits
156
+ # `membership#holder` (the person's membership instance) in place of `user`:
157
+ # leaving ends the grant and a rejoin (a new membership id) never revives it; a
158
+ # demotion keeps the id and so the grant. An agent stays an agent.
159
+ #
160
+ # `owner` admits BOTH person subjects, and the writer picks by the session's
161
+ # OWNING SPACE: `user` ONLY for a PERSONAL session (its owning space is the
162
+ # user), so the ownership is the user's own and survives the user leaving any
163
+ # org; `membership#holder` for an org-scoped person grant, which goes inert on
164
+ # leave and never revives on rejoin, like `participant` and `editor`.
117
165
  type xema_session
118
166
  relations
119
167
  define parent: [org, project, ${XEMA_PARENT_TYPES}]
120
168
  define anchor: [org, project, ${XEMA_PARENT_TYPES}]
121
- define owner: [user, agent, organization]
122
- define participant: [user, agent]
123
- define editor: [user, agent]
124
- define xema_admin: owner
125
- define xema_write: owner
126
- define xema_read: owner or participant or editor or xema_read from parent
169
+ define owner: [user, membership#holder, agent, organization]
170
+ define participant: [membership#holder, agent]
171
+ define editor: [membership#holder, agent]
172
+ define owner_org: [org]
173
+ define xema_admin: owner or admin from owner_org
174
+ define xema_write: owner or admin from owner_org
175
+ define xema_read: owner or participant or editor or xema_read from parent or admin from owner_org
127
176
  define can_read: xema_read
128
177
  define can_write: xema_write
129
178
  define can_act: owner or editor
@@ -131,34 +180,16 @@ type xema_session
131
180
  type xema_artifact
132
181
  relations
133
182
  define parent: [org, project, xema_session, ${XEMA_PARENT_TYPES}]
134
- define owner: [user, agent, service]
183
+ define owner: [membership#holder, agent, service]
135
184
  define can_delete: owner or xema_admin from parent
136
185
  define can_write: owner or xema_write from parent
137
186
  define can_read: owner or can_write or xema_read from parent
138
187
  define xema_read: can_read
139
188
 
140
- # ── Durable delegation: integrations and the scopes bound to them ──────────
141
- #
142
- # Generic plumbing, not a business noun. An integration INSTANCE (a
143
- # connection's sync, a mailbox intake, a scheduled workflow) is the thing a
144
- # durable delegation is created FOR; its owning service writes these facts:
145
- #
146
- # parent — the org it belongs to;
147
- # active — `xema_integration:<o>|<id>#active@org:<o>`, present iff the
148
- # integration is ACTIVE (removed BEFORE a disable commits);
149
- # holder — the workload declared as its executor;
150
- # bound_scope — each opaque scope (`xema_scope`) it is bound to;
151
- # configurer — who may configure it, beside the org's administrators.
189
+ # ── Durable delegation: the opaque scopes a delegation anchor binds ───────
152
190
  #
153
- # A delegation is usable only while these facts hold; the PDP re-checks them
154
- # at every use and reads no stored verdict.
191
+ # Generic plumbing, not a business noun. A biome declares its own delegation
192
+ # ANCHOR type (implementing `xema.delegation-anchor`) and binds each opaque
193
+ # scope ref to it through `bound_scope: [xema_scope]`; this type is that
194
+ # subject.
155
195
  type xema_scope
156
-
157
- type xema_integration
158
- relations
159
- define parent: [org]
160
- define active: [org]
161
- define holder: [service]
162
- define bound_scope: [xema_scope]
163
- define configurer: [user, team#member]
164
- define configure: configurer or admin from parent