# @objectstack/plugin-sharing

## 18.6.0

### Patch Changes

- 1381f08: fix(plugin-sharing): two sharing rules that reach one user on one record keep one grant each, so the widest level wins and revoking one rule leaves the other
  
  Clause-②: no
  Metadata-protocol: none
  
  A user that two sharing rules reach on the same record now ends with the most permissive access either rule grants. Before this fix the two rules shared one `sys_record_share` row: `SharingService.grant` looked a rule grant up by object, record, recipient and source, without the rule's id, and overwrote the row it found. The last rule written won whatever its level, so an `edit` rule followed by a `read` rule left the user with `read`, and a project manager who is also on the project team could not edit the project. Each rule also revokes by its own id, so the merged row belonged to whichever rule wrote last: revoking that rule removed access the other rule still granted, and revoking the other rule removed nothing.
  
  A rule-materialised grant is now keyed by its rule id too, one row per rule and recipient. The read and write gates already take the widest level across a user's rows, so nothing on the read side changes. A manual grant, and any grant made outside the rule evaluator, keeps its one row per recipient.
  
  No migration is needed. A row two rules already share is split by the next reconcile of the rule whose id it no longer carries: that rule writes its own row, and the user regains its access.
- c47e4ea: fix(plugin-sharing)!: the write gate judges by id exactly the writes the engine runs by id
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) a runtime authorization answer moves: no metadata key, accepted value or stored row changes, so `os migrate meta` has nothing to rewrite -->
  
  The sharing write gate now takes its by-id or bulk branch from the engine's own dispatch decision for the write's options. A write the engine runs by id is judged by id, as before. Every other write is one the engine runs as a predicate, an `$in` or `$eq` on `id` included, and it meets the bulk write scope: it writes the rows the caller may update or delete, leaves the others as they were, and answers no error.
  
  A member's multi-row delete or update of rows it owns, on a `private` or `public_read` object with an `owner_id`, now lands where it answered 403 FORBIDDEN.
  
  A call the engine refuses at dispatch (for example a scalar `where.id` beside another key without `multi: true`, or a payload `id` beside a `where` predicate) now gets the engine's own refusal, the answer a system caller gets, instead of this gate's 403 first. It is refused either way and nothing is written.
  
  **BREAKING** for a caller of a multi-row (`multi: true`) update or delete in one of two shapes, both of which the engine runs as a predicate and the gate now judges as one:
  
  - a `where` that carries a scalar `id` beside another key;
  - an `id` that is falsy (`''` or `0`).
  
  Such a write meets the bulk write scope instead of the by-id judgment:
  
  - a row the caller may not write is left as it was, and the write answers no error where it answered 403 FORBIDDEN;
  - a row the caller may write only because an application row-level policy widens the sharing scope for it (the by-id judgment's deferral to such a policy) is no longer written by these two shapes, as for every other predicate write.
  
  To write such a row, address it by id alone (`where: { id }`, or the payload `id`): that write is judged by id, as before.
- e61af97: feat: the list toolbar offers the "In a queue" toggle only on objects that actually use queues
  
  Clause-②: yes (widening)
  Metadata-protocol: added
  
  Until now the toggle appeared on every list of an object with a user owner as soon as the organization had a single queue, although on most of those objects no record ever sits in a queue, so it could only return an empty list. It now appears only on an object where a queue can hold something:
  
  - a record of the object sits in a queue now (no owner, a queue set), or
  - an active assignment rule routes the object's new records into a queue: one of the organization's own rules, or a rule an installed package declares that is not switched off.
  
  Nothing is authored for this. The server works it out from the rules and the records.
  
  `GET /auth/me/permissions` carries the answer as a new field beside `hasAnyQueue`: `objectsUsingQueues`, a list of object names, declared in `MePermissionsAuthenticatedResponseSchema`. It names only objects the caller may read, and never a queue name or a count. It is empty when the organization has no queue, when no ownership-queue service is registered, and on the closed body. The ownership-queue service contract gains the optional method `objectsUsingQueues(organizationId)`, implemented by `@objectstack/plugin-sharing`. The method checks each owned object for one sitting record (`limit 1`) and reads the routing rules once. The route asks only when `hasAnyQueue` is true, so an organization with no queue pays nothing extra.
  
  **Migration.** `objectsUsingQueues` is required on the strict `MePermissionsAuthenticatedResponseSchema`. Code that builds a `MePermissionsAuthenticatedResponse` (a test fixture, a stub server) adds `objectsUsingQueues: []` beside `hasAnyQueue`. Code that parses a body from a server older than this release with the schema gets a parse failure for the missing key: parse with `.partial({ objectsUsingQueues: true })` or default it to `[]` until the server is upgraded. The console does not parse; it reads the field and treats its absence as "no object".
  
  The console reads the field from the payload it already loads once per session. A record that starts sitting in a queue on an object not listed yet shows the toggle from the next time the permissions are read. An answer without the field is treated as "no", the same way an unknown `hasAnyQueue` is.
- 5d01679: fix(plugin-sharing)!: a share granted directly by a non-system caller is always a manual share
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export changes shape. The moved answer is a refusal of two input fields on one service method and the door that calls it: no stored row changes, so there is nothing for a migration to rewrite and no tombstone. -->
  
  **BREAKING** for a client that sends a non-manual `source` or a `sourceId` on the direct-grant door. `SharingService.grant` called by a non-system caller, and so `POST /api/v1/data/:object/:id/shares`, now refuses an input whose `source` is present and is not `'manual'`, and an input that carries any `sourceId`, with `VALIDATION_FAILED` (400), and writes nothing. The refusal comes before any other check reads anything. Only the platform's own sharing-rule, team and system paths, which run under a system context, write a share of another source.
  
  **Who moves:** a client that sent a non-manual `source` (`'rule'`, `'team'`, `'inherited'` or any other string) or a `sourceId` on the direct-grant door. FROM 201 with the row written TO 400 `VALIDATION_FAILED`, nothing written. The fix is one line: drop `source` and `sourceId` from the request (or send `source: 'manual'` with no `sourceId`); a share that should follow a rule is declared as a sharing rule.
  
  **Not moved.** A grant with no `source`, or with `source: 'manual'` and no `sourceId`, answers as before. The system path (the sharing-rule evaluator and other platform callers under a system context) writes its shares as before, and the revoke door answers as before.
- Updated dependencies [e53e02e]
- Updated dependencies [35c9a30]
- Updated dependencies [1f923d7]
- Updated dependencies [a00b422]
- Updated dependencies [64c4285]
- Updated dependencies [b1efa37]
- Updated dependencies [84e6bbb]
- Updated dependencies [fb79d47]
- Updated dependencies [69783b7]
- Updated dependencies [5af956f]
- Updated dependencies [bb17350]
- Updated dependencies [a061708]
- Updated dependencies [b109659]
- Updated dependencies [c59198f]
- Updated dependencies [d1ab592]
- Updated dependencies [fb3d1ff]
- Updated dependencies [9a7f8c1]
- Updated dependencies [2068e03]
- Updated dependencies [5c7e448]
- Updated dependencies [8f052e9]
- Updated dependencies [de3538c]
- Updated dependencies [5326028]
- Updated dependencies [f7b2d02]
- Updated dependencies [54f8e16]
- Updated dependencies [bb3c163]
- Updated dependencies [3c2fb32]
- Updated dependencies [d635555]
- Updated dependencies [0ac112f]
- Updated dependencies [c934631]
- Updated dependencies [4176c95]
- Updated dependencies [63e47fe]
- Updated dependencies [b005638]
- Updated dependencies [e5c2d76]
- Updated dependencies [db3bbd3]
- Updated dependencies [9f32c0f]
- Updated dependencies [109a903]
- Updated dependencies [2539ad9]
- Updated dependencies [568d416]
- Updated dependencies [98a4449]
- Updated dependencies [fdfccbf]
- Updated dependencies [fa1fb6f]
- Updated dependencies [d10f652]
- Updated dependencies [ba03d5e]
- Updated dependencies [3e49033]
- Updated dependencies [6091b64]
- Updated dependencies [6844e6b]
- Updated dependencies [021abd4]
- Updated dependencies [61ded62]
- Updated dependencies [75ab117]
- Updated dependencies [6080387]
- Updated dependencies [8fd5004]
- Updated dependencies [071323e]
- Updated dependencies [41ff7c3]
- Updated dependencies [aab8b31]
- Updated dependencies [e0670b9]
- Updated dependencies [50d655f]
- Updated dependencies [3a08833]
- Updated dependencies [0e2e4f5]
- Updated dependencies [d5e6b20]
- Updated dependencies [803f909]
- Updated dependencies [bef80d3]
- Updated dependencies [e0670b9]
- Updated dependencies [9e6fee1]
- Updated dependencies [52ec26f]
- Updated dependencies [c2cabce]
- Updated dependencies [6fb3d0c]
- Updated dependencies [2c296cf]
- Updated dependencies [fa9d695]
- Updated dependencies [d9c4b62]
- Updated dependencies [1ccb445]
- Updated dependencies [8c6ddc5]
- Updated dependencies [1bf90a0]
- Updated dependencies [27c0b20]
- Updated dependencies [842637a]
- Updated dependencies [227ae36]
- Updated dependencies [1177058]
- Updated dependencies [12b69e1]
- Updated dependencies [d4e4dfb]
- Updated dependencies [22bf910]
- Updated dependencies [371e5f1]
- Updated dependencies [11e0441]
- Updated dependencies [f23c71e]
- Updated dependencies [4240719]
- Updated dependencies [6302c2c]
- Updated dependencies [7b3e955]
- Updated dependencies [066177b]
- Updated dependencies [a8e09bb]
- Updated dependencies [ddab49d]
- Updated dependencies [1538596]
- Updated dependencies [21d84a8]
- Updated dependencies [b91cefa]
- Updated dependencies [4fb8790]
- Updated dependencies [a1082f3]
- Updated dependencies [f02f4f6]
- Updated dependencies [62d9d0d]
- Updated dependencies [e61af97]
- Updated dependencies [758bbe7]
- Updated dependencies [99bd220]
- Updated dependencies [13057ce]
- Updated dependencies [a8aa6ab]
- Updated dependencies [cc5472e]
- Updated dependencies [a825152]
- Updated dependencies [9cf74ae]
- Updated dependencies [c81f498]
- Updated dependencies [6c1f9b3]
- Updated dependencies [b846710]
- Updated dependencies [b633afe]
- Updated dependencies [aa0fde3]
- Updated dependencies [b85dff0]
- Updated dependencies [743308b]
- Updated dependencies [bb169c3]
- Updated dependencies [0465f4a]
- Updated dependencies [2487242]
- Updated dependencies [3a78b89]
- Updated dependencies [92a5cac]
- Updated dependencies [2f656af]
- Updated dependencies [d4b2a75]
- Updated dependencies [ad9b74b]
- Updated dependencies [e2a4c66]
- Updated dependencies [c37e47a]
- Updated dependencies [ad7331a]
- Updated dependencies [a6c2b83]
- Updated dependencies [6880b04]
- Updated dependencies [d18d54b]
- Updated dependencies [1354d2a]
- Updated dependencies [0593356]
- Updated dependencies [a2bb7d5]
- Updated dependencies [6aeb665]
  - @objectstack/platform-objects@18.6.0
  - @objectstack/spec@18.6.0
  - @objectstack/objectql@18.6.0
  - @objectstack/core@18.6.0
  - @objectstack/metadata-core@18.6.0
  - @objectstack/formula@18.6.0
  - @objectstack/types@18.6.0

## 18.5.0

### Patch Changes

- Updated dependencies [f229dfd]
- Updated dependencies [322ded7]
- Updated dependencies [f4cafd5]
- Updated dependencies [c747cf0]
- Updated dependencies [c747cf0]
- Updated dependencies [30e364e]
- Updated dependencies [68cb68e]
- Updated dependencies [1cf2a5a]
- Updated dependencies [605d712]
- Updated dependencies [05b56ef]
- Updated dependencies [f31f784]
- Updated dependencies [7ffbb1a]
- Updated dependencies [89d7bef]
- Updated dependencies [89d7bef]
- Updated dependencies [51ceb43]
- Updated dependencies [d635599]
- Updated dependencies [6a36b79]
- Updated dependencies [548f8ff]
- Updated dependencies [16e3486]
- Updated dependencies [16e3486]
- Updated dependencies [8c88db6]
- Updated dependencies [834d5f5]
- Updated dependencies [d38ceba]
- Updated dependencies [6538ba4]
- Updated dependencies [5430b4a]
- Updated dependencies [9673030]
- Updated dependencies [84c66d3]
- Updated dependencies [a1604ce]
- Updated dependencies [6c5d31f]
- Updated dependencies [b462444]
- Updated dependencies [5ea8ce5]
- Updated dependencies [4ace1fa]
- Updated dependencies [61ed314]
- Updated dependencies [40c73a8]
- Updated dependencies [2c98485]
- Updated dependencies [1bbeb94]
- Updated dependencies [9317833]
- Updated dependencies [5e29b7e]
- Updated dependencies [1f8ce6e]
- Updated dependencies [c312b26]
- Updated dependencies [6e28797]
- Updated dependencies [7adb1b5]
- Updated dependencies [5b2ec82]
- Updated dependencies [3e19223]
- Updated dependencies [1b878e7]
- Updated dependencies [6482c08]
- Updated dependencies [6222ecb]
- Updated dependencies [728be58]
- Updated dependencies [728be58]
- Updated dependencies [1fd5d8a]
- Updated dependencies [26b5994]
- Updated dependencies [0ba30eb]
- Updated dependencies [27d042f]
- Updated dependencies [cbb876c]
- Updated dependencies [4dbcbdd]
- Updated dependencies [633d8c4]
- Updated dependencies [09da8c7]
- Updated dependencies [53f5a4c]
- Updated dependencies [bc50d11]
- Updated dependencies [8a8c21e]
- Updated dependencies [b194618]
- Updated dependencies [0be91f0]
- Updated dependencies [df9fe94]
- Updated dependencies [8f9eb3d]
- Updated dependencies [1da43fe]
- Updated dependencies [6ff3eee]
- Updated dependencies [8b53cc8]
- Updated dependencies [b392ff7]
- Updated dependencies [6107290]
- Updated dependencies [3c231cd]
- Updated dependencies [489ef5f]
- Updated dependencies [480246b]
- Updated dependencies [ee627c6]
- Updated dependencies [53b3544]
- Updated dependencies [b070e1c]
- Updated dependencies [ea67b26]
- Updated dependencies [3cbf1f2]
- Updated dependencies [89defde]
- Updated dependencies [06e53a7]
- Updated dependencies [481f642]
- Updated dependencies [f64c0f9]
- Updated dependencies [1c32f6d]
- Updated dependencies [b8f6237]
- Updated dependencies [dd291b8]
- Updated dependencies [e997113]
- Updated dependencies [615c67f]
- Updated dependencies [67274ac]
- Updated dependencies [0a6f193]
  - @objectstack/spec@18.5.0
  - @objectstack/objectql@18.5.0
  - @objectstack/core@18.5.0
  - @objectstack/platform-objects@18.5.0
  - @objectstack/metadata-core@18.5.0
  - @objectstack/types@18.5.0
  - @objectstack/formula@18.5.0

## 18.4.0

### Minor Changes

- ac890f5: feat(objectql,plugin-sharing): an organization authors its own assignment rules in Setup, as `sys_assignment_rule` records
  
  Clause-②: yes (widening)
  Metadata-protocol: added
  Skills-docs: follow-up owed — content/docs/automation/queues-and-assignment-rules.mdx, skills/objectstack-automation/SKILL.md
  
  Until now only a package could declare an assignment rule, so routing new records differently meant a package release. An organization can now write its own rules in Setup (Access Control → Assignment Rules), on the same two-source model sharing rules and queues already follow: the rules packages declare keep working, and the organization's own rules sit beside them.
  
  - **`@objectstack/plugin-sharing`**: a new object, `sys_assignment_rule`. One row is one rule: when a new record of the chosen object matches the condition (a CEL expression over `record`, empty for every record), it goes to a queue or to one person, and a queue target may pick a member by `round_robin` or `least_loaded` (which needs its open-work expression, `load`). Each row belongs to one organization (`organization_id` is required). The table's save guard refuses, naming each field at fault: a name that is not snake_case or that a package rule already holds (one name means one rule); an object that does not exist or whose records have no owner; an entry shape the stack schema refuses for a declared rule; a condition or open-work expression the engine cannot compile; a person who is not an active member of the organization; a rule that would land in no organization. A boot report logs, at `error`, an organization's rule whose name a later-installed package now declares. Setup gains an "Assignment Rules" entry beside Queues.
  - **`@objectstack/objectql`**: the engine evaluates an object's organization rules first, ascending by `sort_order` and then by name, and the rules packages declare as the fallback; the first match decides. A user target, from either source, now owns the record only while the user is an active member of the record's organization and is not banned. One that no longer resolves leaves the record ownerless, the way a queue that no longer resolves does, and is logged once; the insert is never refused. When an organization's rules cannot be read, its new records are written as they stood rather than routed by the package rules its own would have overtaken. New exports for the save guard: `ASSIGNMENT_RULE_OBJECT`, `assignmentExpressionRefusals`, `organizationMemberStanding`.
  - **`@objectstack/spec`**: `PLATFORM_PROVIDED_OBJECT_NAMES` lists `sys_assignment_rule` under `plugin-sharing`, and the `AssignmentRuleSchema` documentation says how the two sources combine. No key, shape or validation changes.
  - **`@objectstack/platform-objects`**: the Setup app labels the new "Assignment Rules" navigation entry in English, Chinese, Japanese and Spanish.
  - **`@objectstack/cli`**: the organization-ownership inventory lists `sys_assignment_rule`, so `os migrate organization-ownership` plans it instead of refusing it as an uninventoried platform table.
  
  Upgrading: a package rule whose entry names a user id (the `assignment-rule-user-target` lint warning) stops assigning in an organization where that user is not a member; the engine logs the lapse once per rule, user and organization. Route such a rule to a queue whose members are positions.

### Patch Changes

- 13c0c5b: fix(plugin-approvals)!: an approval node refuses to open when a team or position approver's directory read fails, or a queue approver's expansion rejects, and the ownership-queue reads page to completion
  
  Clause-②: yes (narrowing) — an approval node no longer opens when a `team` or `position` approver (static, or an `expression` approver with `resolveAs` `team` / `position`) cannot be expanded because a directory read or the cross-organization read filter failed, or when a `queue` approver's expansion rejects. Under every `onEmptyApprovers` policy, the `fallbackApprovers` slate included, it now fails the node with a retryable `APPROVER_DIRECTORY_UNREADABLE:` error naming the read, where it used to open on the rest of the slate, on the fallback slate or on the administrators, or auto-approve. The registered ownership-queue service does not reject yet: a failed member read inside it still answers nobody until #29604 part 2 (#30251), so a `queue` approver refuses here only when `expandMembers` itself rejects. Every other input answers as before.
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped: the approval node config, the approver types and the ownership-queue contract keep their shapes. What moves is the answer a node gives while a directory table cannot be read, and nothing at rest records that answer, so there is nothing for a migration to rewrite. -->
  
  **BREAKING** accept-set narrowing at the approval node (`@objectstack/plugin-approvals`): a failed directory read behind a `team` or `position` approver, or a `queue` approver whose expansion rejects, refuses the node instead of opening it on a slate that is missing people (ADR-0142 D6 as amended, ruling record 6599731698 on #29604).
  
  - **Before.** A `team` or `position` approver whose `sys_team_member`, `sys_user_position` or `sys_member` read failed kept its `type:value` literal slot, which nobody can act on, and logged the failure. A `queue` approver whose expansion threw answered "expanded to nobody" and added no slot. Either way the node went on as if those people did not exist: beside other approvers it opened on them alone, and on an otherwise empty slate the node's `onEmptyApprovers` policy acted, opening on the `fallbackApprovers` or the organization's administrators, or auto-approving.
  - **Now.** The node does not open and writes no request, approver or action row. It fails with an `ApproverDirectoryUnreadableError` whose message starts `APPROVER_DIRECTORY_UNREADABLE:`, names the approver, the organization and the read that failed (a failure of the cross-organization read filter is named as that filter's read, on a static approver and on an `expression` one alike), and is retryable: the flow node's failure is a runtime one, so the run can be resumed once the directory can be read. A `fallbackApprovers` slate whose own `team` or `position` read fails refuses the same way. `department` / `business_unit`, `org_membership_level` and `manager` approvers are not named by the ruling and answer exactly as before.
  - **Unchanged.** A decision on a request opened before the approver snapshot existed still re-reads its slate on the old path, which keeps the literal slot on a failed read, because the decision has already been recorded when that read happens.
  - **Not yet.** The ownership-queue service shipped in `@objectstack/plugin-sharing` answers a failed `sys_queue` / `sys_queue_member`, team or position read with nobody (logged once) rather than rejecting, so a `queue` approver backed by it still adds no slot on such a failure. Its refusal arrives with #29604 part 2, once the contract can carry it (#30251).
  
  `@objectstack/plugin-sharing`: the ownership-queue service reads its `sys_queue` and `sys_queue_member` rows by id, page after page, to the end, where it read one page of 10,000 rows and answered on it. A queue's 10,001st member, an organization's 10,001st queue and the queues naming a recipient past that bound are now found. A read that fails partway answers as a failed read did before (that read contributes nobody, logged once, with the read's reason and without the walk's own "refuses instead" clause), never with the pages it had read.
- fe835b4: fix(plugin-sharing)!: the ownership-queue service refuses a failed member read when the caller asks, and the approver slate and the sharing-recipient grant recompute ask
  
  Clause-②: yes (narrowing) — `expandMembers` and `isMember` of the registered ownership-queue service, called with `onFailedRead: 'refuse'`, now reject when a read behind the queue fails, where they answered nobody. The approver slate asks for that answer, so an approval node whose `queue` approver cannot be read refuses to open under every `onEmptyApprovers` policy, where it opened on the rest of the slate, on the fallback slate or on the administrators, or auto-approved. The sharing-rule recompute asks for it too, so a whole-rule pass (`evaluateRule`, the REST evaluate endpoint, the boot backfill), the recipient-axis revoke and the per-user pass on a `queue`-recipient rule reject on such a failure, where they completed by revoking the grants of the members who could not be read. Every call without the option, and every read that succeeds, answers as before.
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped: the ownership-queue contract's `onFailedRead` option already exists, and the approval node config and the sharing rule keep their shapes. What moves is the answer two consumers get while a membership table cannot be read, and nothing at rest records that answer, so there is nothing for a migration to rewrite. -->
  
  **BREAKING** accept-set narrowing at the ownership-queue service's `'refuse'` answer and at its two recompute consumers (`@objectstack/plugin-sharing`, `@objectstack/plugin-approvals`): an empty expansion is a fact, a failed read is a fault (ADR-0142 D2 as amended), and the approver slate (D6) and the sharing-recipient grant recompute (D7) now get the fault instead of "nobody".
  
  - **The service.** `OwnershipQueueService.expandMembers(name, org, { onFailedRead: 'refuse' })` and `isMember(user, name, org, { onFailedRead: 'refuse' })` reject when the queue's `sys_queue` row, its `sys_queue_member` rows, or a member table one of its specifications reads (`sys_team_member`, `sys_user_position`, `sys_member`, `sys_business_unit_member`, `sys_business_unit`) cannot be read, or a paged read cannot vouch for completion. The rejection's message starts `[queue] queue '<name>' in organization '<org>' does not answer its members, because a read behind it failed:` and names that read; the read's own error rides along as `cause`. It never answers `[]`, a partial set or `false` instead. `isMember` still answers `true` when a read that succeeded reaches the user, and answers `false` only when every read behind it succeeded. An empty queue is still `[]`, and a name that resolves nowhere is still `[]` / `false`.
  - **Unchanged: the default.** Without the option (`onFailedRead: 'nobody'`), a failed read still contributes nobody, logged once. The sitting-record access path (`queuesOf`), the claim admission and the assignment pool take that answer, so they deny on a failed read exactly as before. A failed read of the activation ledger (`sys_metadata_activation`) is not a failed read in this sense under either answer: it still reads "switched on" for that call, logged, the posture the sharing-rule service takes for its own position recipients.
  - **The approver slate (D6).** A `queue` approver asks with `onFailedRead: 'refuse'` beside the addressing purpose. When the registered service rejects, the node fails with the retryable `APPROVER_DIRECTORY_UNREADABLE:` error that a failed team or position read already raises, naming the queue's failed read, and writes no request, approver or action row. Before, the registered service answered nobody, so the queue added no slot and the node's `onEmptyApprovers` policy acted on a slate missing those people.
  - **The sharing-recipient grant recompute (D7).** A `queue`-recipient rule's expansion and its per-user membership check ask with `onFailedRead: 'refuse'`. A failed member read now rejects before any grant is diffed, so the rule's existing grants stay as they were until a pass can read the queue, and each recompute's caller logs it: the record pass and the object pass per rule (`record reconcile failed for rule`, `object reconcile failed for rule`), the queue-membership and business-unit write recomputes (`queue-membership revocation failed`, `queue-membership re-grant failed`, `business-unit revocation failed`, `business-unit re-grant failed`), the membership-row recompute (`recipient membership re-evaluation failed`) and the boot backfill (`boot rule backfill failed for rule`). A direct call to `evaluateRule`, `revokeRuleGrantsForRetiredRecipients` or `reconcileRuleForUser`, the REST evaluate endpoint included, rejects with the service's failure. Before, the failed read answered nobody and the pass revoked the grant of every member behind it. This is the answer a `team` or `position` recipient has given since its own reads began to refuse.
  - **Supersedes the approval node's "Not yet".** The approval node's own entry in this release ("an approval node refuses to open when a team or position approver's directory read fails…") says, in its `Clause-②:` line and its **Not yet** bullet, that the registered ownership-queue service answers a failed member read with nobody rather than rejecting, so a `queue` approver backed by it refuses only when `expandMembers` itself rejects. That was true when it was written and is not after this change: the service now rejects on that failure when asked, and the slate asks, so a `queue` approver backed by it refuses on a failed `sys_queue`, `sys_queue_member`, team, position or business-unit read, as a `team` or `position` approver does. Read this bullet in place of those two sentences.
- 05a30e6: feat(service-settings,plugin-audit,plugin-sharing): a config_change ledger row names the settings row it changed, an audit row's record page lists the other changes to the same record, and a queue's record page lists its members
  
  Clause-②: no
  Metadata-protocol: none
  
  - **`@objectstack/service-settings`: the `config_change` row's shape changes (not breaking).** A settings write's `config_change` row in `sys_audit_log` now sets `record_id` to the id of the stored settings row the write changed (`sys_setting`, or `sys_platform_setting` for a global value), beside the `object_name` it already named; before, `record_id` was always null. `metadata` and the digest in `new_value` are unchanged, and an in-memory settings store still writes null. Rows written before this release keep their null `record_id`.
  - **Who can read those rows narrows.** Because a `config_change` row now names a record, the ledger's parent-record read gate judges it by that settings row: a reader holding only the ledger's own read grant, who cannot read the settings store, no longer sees new `config_change` rows. Holders of the ledger's audit capability (`view_all_audit_log`, administrators by default) still see every row. Older rows with a null `record_id` are still served under the ledger grant. Nothing becomes visible to a reader who could not see it before.
  - **`@objectstack/plugin-audit`: `sys_audit_log` gets a default record page** (`sys_audit_log_detail`) that shows the row's fields and lists every other ledger row with the same `record_id`, newest first. Beside a `config_change` row that list holds the CRUD mirror's create and update rows for the same settings row, which carry a non-secret value in plain text; a secret's mirror row carries neither the value nor its handle. The list has no "New". The page label ships in all eleven locales.
  - **`@objectstack/plugin-sharing`: `sys_queue` gets a default record page** (`sys_queue_detail`) whose members list reads `sys_queue_member` where `queue` equals this queue's `name`, and whose "New" opens the member form with `queue` filled in with that name. `sys_queue_member.queue` is unchanged. Declared queues have no `sys_queue` row, so they have no page. The page label ships in the plugin's four locales.
- 6f017e2: feat(plugin-sharing): list the objects a sharing rule can take effect on
  
  Clause-②: yes (widening)
  Metadata-protocol: none
  
  `SharingServicePlugin` mounts a read-only route, `GET /api/v1/sharing/shareable-objects`, for Setup's sharing-rule object picker. It answers `{ success: true, data: { objects } }`, each object `{ name, label, system }`, business objects first and then platform objects, each group by label.
  
  An object is listed exactly when a sharing rule saved on it would take effect: the list asks the same check the save doors already ask (`SharingService.sharingRuleObjectRefusal`), so every object it leaves out is one a save refuses with `SHARING_NOT_ENABLED`. The platform's credential and session objects (sessions, linked accounts, API keys, verification tokens, two-factor rows, OAuth applications, tokens and consents, signing keys, secrets) are not listed.
  
  Who may ask: the sharing-rule administrators, as `/api/v1/sharing/rules` admits them (`manage_sharing`, or the legacy `manage_platform_settings`, with an active organization). Anyone else is answered `403 PERMISSION_DENIED`, anonymous `401`. The route takes no query parameter and refuses one with `400 VALIDATION_ERROR`. With record-sharing enforcement off (`enforce: false`) it answers `501 NOT_IMPLEMENTED`.
  
  `SharingRuleService` gains `listShareableObjects(context)`, the same list for in-process callers.
  
  Nothing stored or authored changes; the `sys_sharing_rule` object field keeps its `object-ref` picker until the console's filtered picker lands.
- 6a70821: feat(security): the recycle bin's two grants are read: `restore` asks `allowRestoreOwnDeleted` and `purge` asks `manageRecycleBin`, and a member restores only the entries they deleted
  
  Clause-②: yes (widening)
  Metadata-protocol: none
  Skills-docs: follow-up #30847
  
  Until now every `restore` and `purge` dispatch was refused for every caller but the system, whatever the caller's permission sets granted. The two recycle-bin keys on an object permission are now read (ADR-0148 D5):
  
  - **`allowRestoreOwnDeleted`** answers `restore`. It restores only the entries the caller deleted: restoring an entry someone else deleted is refused `403 PERMISSION_DENIED` unless the caller holds `manageRecycleBin` on the object. When the platform cannot tell what the caller holds, that restore is refused.
  - **`manageRecycleBin`** answers `purge`: purging one entry, emptying an object's entries, and the permanent delete (`delete(…, { permanent: true })`). It also restores any entry, not only your own.
  - **How the keys fold**: each is bounded by read; `modifyAllRecords` implies both; `manageRecycleBin` implies `allowRestoreOwnDeleted`; `allowDelete` implies neither. `objectPermissionGrants` (`@objectstack/spec/security`) answers both keys this way, and `/me/permissions` reports them.
  - **The tenant wall on the bin**: a caller the organization wall denies (for example, signed in with no active organization on a multi-organization deployment) now sees no entry: `restore` answers `null`, `purge` answers `false` and `empty` answers `0`. Before, such a caller's `purge` and `empty` were not scoped to any organization. The removal is scoped by the verdict the security layer recorded on the dispatch when it recorded one.
  - **Record sharing on the permanent delete**: the sharing write gate judges `purge` as the delete it is, so the permanent delete of a record by id is refused (`403 FORBIDDEN`) unless the caller may delete that record (ownership, write depth or Modify All Data; an edit share is not enough), and a bulk permanent delete is scoped to the records the caller may delete. `security/explain` reports a purge against the same delete gate.
  - **The retired `allowRestore` / `allowPurge` keys stay refused**, but their prescription (and that of the bare `restore` / `purge` keys) no longer says the operations do not exist: it says to delete the key and names the grants that gate the operations now, `allowRestoreOwnDeleted` and `manageRecycleBin`. The residue lint's rule explanation says the same.
  - `@objectstack/verify`: a write observer now also sees `purge` and `restore`.
  
  Grant `allowRestoreOwnDeleted` (with read) to the people who should take back what they deleted, and `manageRecycleBin` to the people who administer the bin. Nothing changes for a caller who holds neither.
- f41ddbd: i18n(plugin-sharing): the assignment rule object ships in all eleven platform languages
  
  Clause-②: no
  Metadata-protocol: none
  
  `sys_assignment_rule`, the object an organization authors its own assignment rules in, now carries its label, description, field labels and help, option labels and its "By Object" view name in `zh-CN`, `ja-JP`, `es-ES`, `zh-Hant`, `ar`, `fr`, `pt-BR`, `ru`, `de` and `ko`, so an administrator in any platform language reads Setup → Assignment Rules in their own language instead of English. The object is now listed in the package's extract config, so the existing `check:i18n` bundle check covers it. Its recipient options read the same words as the queue and sharing objects in each language. Part of #30512.
- 561d532: i18n(plugin-sharing): the sharing and queue objects ship in all eleven platform languages
  
  Clause-②: no
  Metadata-protocol: none
  
  The sharing objects (`sys_record_share`, `sys_sharing_rule`, `sys_share_link`) and the queue objects (`sys_queue`, `sys_queue_member`) now carry `zh-Hant`, `ar`, `fr`, `pt-BR`, `ru`, `de` and `ko` beside the existing `en`, `zh-CN`, `ja-JP` and `es-ES`, so an administrator in one of those languages reads the sharing and queue screens in their own language instead of English. Each recipient option reads the same on every object within a locale. The queue record page (`sys_queue_detail`) carries its title in the seven languages too, the same word as the queue object's own label. Each new locale is registered under its platform-table tag with its source-hash companion, and the package's extract command lists the tags, so the existing `check:i18n` bundle check covers them. Package 8 of #30512.
- ee874b1: fix(plugin-sharing)!: a sharing rule on an object without record sharing is refused at save, not saved to do nothing
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped. What moves is the save door's answer to a sys_sharing_rule row whose object no sharing gate consults; a rule already stored keeps its row and can still be switched off, so there is nothing for a migration to rewrite. -->
  
  **BREAKING** accept-set narrowing at the sharing-rule save doors (`@objectstack/plugin-sharing`): a rule whose object is not under record-sharing enforcement is refused with `422 SHARING_NOT_ENABLED` instead of saved.
  
  - **Before.** An administrator could save a sharing rule on an object no sharing gate consults, such as `sys_session`, `sys_account` or `sys_api_key` (a system object with no `owner_id`), a public object without an owner, a `controlled_by_parent` detail or a bypass-listed object. The save answered `201`, the rule showed as active in Setup, and its reconcile then refused every grant (`SHARING_NOT_ENABLED`) and wrote no `sys_record_share`, so the rule's recipients saw nothing more than before. Nothing told the administrator.
  - **Now.** Both save doors refuse that rule and save nothing: the `/data` door (Setup's New and edit forms, scripts, imports) through a `sys_sharing_rule` hook guard, and `POST /api/v1/sharing/rules` (`SharingRuleService.defineRule`). The answer is `422 SHARING_NOT_ENABLED`, the pair the per-record share routes and `POST /api/v1/sharing/rules/:idOrName/evaluate` already answer for the same verdict. Its sentence names the object and says how to make it one a rule applies to, for example "give the object a private or read-only sharing model (`sharingModel: 'private'` or `'read'`) and an `owner_id` field", or "author the rule on its master object instead". An update is refused when it moves a rule onto such an object.
  
  The verdict is the reconcile's own: the save doors read the same ADR-0111 D7 inert-grant check (`SharingService.sharingRuleObjectRefusal`, over `inertGrantReason`) that the grant pre-flight throws on, so the two cannot disagree. A public object that has an owner column is still admitted, because the grant service there still grants an external member of the record's organization (#25549). System writes pass, as with the declared-name guard.
  
  To fix a rejected save, author the rule on an object that uses record sharing, or turn record sharing on for the object as the sentence says. A rule already stored on such an object is not migrated or deleted: it keeps sharing nothing, and an edit that leaves it on its object (for example switching it off) still saves.
- 534a287: feat(console): the sharing-rule object picker lists only the objects a rule can take effect on, business objects first
  
  Clause-②: yes (widening) — `field:shareable-object-ref` joins `@object-ui/fields`' registered widget keys (`RegisteredFieldWidgetType`) and the console's known schema types; nothing is narrowed and no translation key is added.
  Metadata-protocol: none
  
  The object field of a new sharing rule listed every registered object, most of them platform `sys_*` objects, including ones a save refuses with `SHARING_NOT_ENABLED` and the credential and session objects. It now lists only what `GET /api/v1/sharing/shareable-objects` answers: the objects a rule saved on would take effect on, business objects first and then platform objects, each group by label, in the order the server sends.
  
  - **The widget (`@object-ui/fields`).** `field:shareable-object-ref` reads the list through the host's authenticated fetch (`SchemaRendererContext.apiFetch`) and stores the object's name, as `object-ref` does, with the same `Label (name)` spelling. A stored name the list does not hold stays on screen as its own option, so editing a rule never drops it. The read-only face is `object-ref`'s.
  - **When the list is not served.** A `403` (the caller is not a sharing-rule administrator), a `501` (sharing rules do not run on this deployment), any other failed or unreadable answer, and a host with no authenticated fetch all give the `object-ref` picker over every registered object, as before. The field is never an empty picker; the save doors still decide which object a rule may name.
  - **The declaration (`@objectstack/plugin-sharing`).** `sys_sharing_rule.object_name` declares `widget: 'shareable-object-ref'` (was `object-ref`). A console without the widget draws the field as a text box, as with any unregistered widget.
  - **The list cell, the record form and the grid.** The new key draws the same object label cell as `object-ref` (`@object-ui/app-shell`), the record form hands it the data source its fallback reads (`@object-ui/components`), and it is not edited inline in a grid cell, like the other widget-hint pickers.
- 43fb482: feat(plugin-sharing)!: declared sharing rules, queues and assignment rules are read on (package, name), and a name two packages declare is refused, naming both
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) nothing an author writes is renamed, removed or re-shaped; the change is which declared item a bare name reads at runtime, so there is no stored or authored shape for objectstack migrate meta to rewrite -->
  
  **BREAKING**, narrowly, for a deployment that already installs two packages declaring a sharing rule, a queue or an assignment rule under the same name. Who is affected: such a deployment only. Measured first-party: none (the showcase declares two sharing rules, no queue and no assignment rule; no two packages share a name).
  
  The three declared types are addressed by `(package, name)` (ADR-0150). Every place the sharing plugin reads one of them by bare name now goes through objectql's shared package-scoped resolver:
  
  - A name one package declares answers exactly what it answered before.
  - A name two packages declare used to answer the first package registered, or, for a user's queues and the session's queue flag, the last. It is now refused: the declared sharing rule is not served and grants nothing, the queue resolves nowhere (a refusal naming both packages for a caller that asked for one), and a lookup by that name answers `409 RESOURCE_CONFLICT` naming both packages. The name stays taken: no organization's own rule or queue may take it. The refusal is logged once at `warn`, naming every holder. Grants the name already holds stop answering: the boot sweep of orphaned rule grants revokes them and reports it once as that refusal, naming every holder; they come back once the rule is addressed by package.
  - A declared sharing rule's queue recipient is read from the rule's own package: its own queue, or the one queue its declared dependencies hold. A queue only an unrelated package holds, or only an environment-authored registry item holds, is refused, naming the holder, where it used to be served. An organization's own queue (a `sys_queue` row) is served as before.
  
  What to do if you see the refusal: keep one of the two packages' items under that name. If a declared rule's queue lives in another package, declare a dependency on that package.
- 4fd8db3: feat(plugin-security, plugin-sharing): security and sharing stored references gain a package column, backfilled at boot from the one package that holds the name (ADR-0150 D8 R1, R3, R5, R6, R13)
  
  Clause-②: no
  Metadata-protocol: none
  
  Five stored references that name a declared item by its bare name now carry, beside the name, the package that holds it: `sys_user_permission_set.permission_set_package` (R1), `sys_audience_binding_suggestion.permission_set_package` (R3), `sys_sharing_rule.package_id` on package- and platform-managed rows (R5), `sys_queue_member.queue_package` (R6) and `sys_assignment_cursor.rule_package` (R13). Each is nullable, read-only to users, and filled in by the platform.
  
  At every boot, once the registry has sealed its holders, each table's rows that name no package are walked and asked the one ADR-0150 D3 rule, from the package that wrote the reference. A grant, a sharing-rule row, a queue member and a cursor are the environment's own rows, so they are asked with no caller package. A suggestion is the reference of the package that made it, so it is asked from that package: its own set first, then the one holder among its declared dependencies. A suggesting package's own set therefore binds to it even where an unrelated package holds a set of the same name from before the one-holder rule, which is D3's answer for that package, not a pick; and a set only an unrelated package holds is left null and reported, never bound to it. A name exactly one package holds is bound to that package. A name the rule refuses (two or more holders, or for a suggestion none among the suggesting package's dependencies) is left null and logged as a warning naming every candidate; it is never bound to the first. A name that only the environment or the platform holds, or that nothing holds, is left null and reported. A row that already names a package is never read again, so a second boot writes nothing and reports the same names. Suggestion rows bound to a dependency of the suggesting package rather than to the package itself are logged too.
  
  Nothing reads the new columns yet: who may hold what, which rule shares what, and who a queue routes to answer exactly as before, and no unique key changes. Writers do not stamp the columns yet either; each reader's own card moves its reader and writer together. If the boot pass fails, it logs a warning, leaves its rows as they are and is tried again at the next boot. Rolling back drops nothing a reader needs.
- fdfcc7a: feat(spec, plugin-sharing): the ownership-queue reads take an optional caller package, so a declared sharing rule's queue recipient resolves from the rule's package
  
  Clause-②: yes (widening); narrowing per ADR-0150 D3 declared below
  Metadata-protocol: none
  
  `IOwnershipQueueService.resolveQueue`, `expandMembers` and `isMember` (`@objectstack/spec/contracts`) take an optional `callerPackageId` (new type `OwnershipQueueCallerPackage`, `string | null`). With it, a queue name resolves from that package (ADR-0150 D3): the package's own declared queue, else the unique holder in its declared dependency closure plus `sys`, else a refusal naming every candidate. Without it, the read is environment-wide, exactly as before. An implementation written before the key still satisfies the contract.
  
  `@objectstack/plugin-sharing` implements it and passes it where a package wrote the queue name: a declared sharing rule's queue recipient is now read from the rule's package. A queue name the rule's package reaches through one declared dependency is served even when an unrelated package also declares a queue of that name; before, that name was refused because two packages declared it. Every other answer is unchanged: no caller package, one holder, two holders in the package's reach (refused, naming both), a holder only outside the reach (refused), and an organization's own `sys_queue` row.
  
  Narrowing, per ADR-0150 D3: take a declared rule whose package depends on a package D that is disabled, where an unrelated package U declares a queue of the same name. That rule used to grant to U's queue members. Its queue recipient is now refused. The refusal is logged once at `warn` and names U as outside the rule package's dependency closure. U's members gain no grant from it; grants the rule already holds are kept, as for any refused recipient. A disabled package holds no queue for this read, the same population the listing serves. To resolve it, enable D or declare a dependency on the package whose queue you mean. Measured first-party: 0 (no first-party package declares a queue).
- d9f626b: refactor: "is this object federated (ADR-0015 `external`)?" has one runtime binding, and it reads the spec predicate
  
  Clause-②: no
  Metadata-protocol: none
  
  `@objectstack/core`'s `isFederatedObject` now returns `!platformProvisionsStorage(schema)` from `@objectstack/spec/data`, the one spelling of that question. `@objectstack/plugin-security` and `@objectstack/plugin-sharing` re-export core's binding from `federated-phantom-anchors.ts` instead of holding their own copies, so every existing import keeps resolving. The remaining hand-written copies of the `external` presence test now ask the same binding: the objectql search companion gate, `os migrate` (unmapped columns, the drift pass and the managed-drift coverage), the analytics federation gate (ADR-0062 D6), the schedule trigger's inert-scope bind line and the save door's datasource-binding read. Behaviour is unchanged on every object record and on `null`, `undefined`, arrays and primitives.
- 1a66fcf: refactor(core,objectql,plugin-sharing): one `PackageScopedNameRefusedError` class for the 409 a package-scoped by-name read refuses with
  
  Clause-②: yes (widening)
  Metadata-protocol: none
  
  - **`@objectstack/core`: `PackageScopedNameRefusedError`** (new export), beside `PackageScopedRefusal` and `packageScopedRefusalMessage`. It carries `code: 'RESOURCE_CONFLICT'`, `status: 409`, `httpStatus: 409` and the resolver's `refusal`, and its message is the refusal's own sentence, which names every candidate.
  - **`@objectstack/objectql`** and **`@objectstack/plugin-sharing`** each declared a class of that name before, and an `instanceof` against one never matched the other. Both now re-export core's class under the same name, so every existing import keeps resolving and one `instanceof` matches a refusal from an objectql reader (`SchemaRegistry#getApp` and the other ADR-0150 by-name readers) and from a plugin-sharing door (a declared sharing rule, queue or assignment rule name) alike. objectql's copy already carried `httpStatus`; plugin-sharing's refusal now carries it too, with the same value.
  - **`@objectstack/objectql/core`** (the lean entry) now exports `PackageScopedNameRefusedError` too, since the `SchemaRegistry` it exports throws it.
  
  No door changes its answer: each still refuses `409 RESOURCE_CONFLICT` with the same sentence.
- f00fb1b: fix(core)!: every door that admits an API key records where the use came from on the `credential_use` row (#31898)
  
  Clause-②: yes (narrowing) — `RequestExecutionContextInput.transport` in `@objectstack/core` becomes a required key, typed `{ remoteAddress } | undefined`: a caller of `resolveRequestExecutionContext` now states the transport's peer address, or states that it hands none.
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (runtime-interface-only packages/core/src/security/request-execution-context.ts#RequestExecutionContextInput) the narrowed member is an input key of a runtime TypeScript interface, which the compiler names at every caller (TS2741); no packages/spec schema, registered node type, stored row or ADR-0087 conversion surface names it, so there is nothing for `objectstack migrate meta` to rewrite -->
  
  **BREAKING** for a TypeScript caller of `resolveRequestExecutionContext`.
  
  Since #31821 the `credential_use` audit row records the client address and user agent of the use that opened the window, but only REST, the runtime dispatcher (its `/mcp` face included) and the stdio MCP transport handed their client facts over. An API key admitted at any other door wrote `metadata.ip_address_absent: 'not_supplied'`. Every door that can admit an API key now hands them over, so no door writes `not_supplied`:
  
  - the storage family (its sign-in gate reader, the parent-governed download authorizer and the upload attacher), the settings routes, the sharing-rule shareable-objects list, the share-link routes, the notification preference options, the datasource admin routes, the print route, the own-row delete routes, the organization settings door, the cloud-connection status and setup doors, and the marketplace local-plugin install.
  
  Each door hands only its transport's own peer address and the request headers. The address recorded is the one the deployment establishes under its one client-address trust rule (`IAuthService.resolveClientAddress`): `X-Forwarded-For` / `X-Real-IP` only when `server.trustProxy` is declared, otherwise the peer. No door reads a forwarded header itself. `@objectstack/core` exports the one helper the doors use, `credentialUseClientFor(authService, { headers, remoteAddress })`, and `transportPeerAddressOf(c)` for a Hono door's socket peer.
  
  Which credentials a door admits does not change. Doors that read only a session (`credentials: 'session-only'`) read no key and write no row; they state `transport: undefined`.
  
  What to do on upgrade:
  
  - A caller of `resolveRequestExecutionContext` that omitted `transport` no longer compiles (`TS2741: Property 'transport' is missing`). Pass `transport: { remoteAddress }` with the transport's own peer address (`undefined` when it has none), or `transport: undefined` for a call that hands no client facts, such as a `'session-only'` call. Never pass a forwarded header as `remoteAddress`: the auth service applies the trust rule.
- 0763bf6: fix(objectql, metadata-protocol)!: by-name doors judge a name's holders over the served set, so a disabled package's item is not a holder (ADR-0150 D3, #32183)
  
  Clause-②: no (narrowing) — for a name that only disabled packages hold, `SchemaRegistry.resolveItem`, `MetadataFacade.get` / `getEntry` and `SchemaRegistry.getApp` (`@objectstack/objectql`) answer `undefined` where they answered the disabled package's body, and `MetadataFacade.exists` answers false where it answered true. Every by-name door already withheld that body. The other moved answers are listed below, each before → after. Most widen or name fewer packages: a name one enabled and one disabled package hold is served by the enabled holder where it was refused naming both. Three narrow a served answer. A package caller whose closure holds the name only through a disabled package, while an enabled package outside the closure holds it, is refused `outside-closure` where it was served the disabled package's body. The pair address (`?package=<base>.custom`) of a disabled base answers 404 where, with an enabled holder registered first, it served the disabled base's body under that holder's envelope. A disabled package's address at a member only its customization pair stores answers 404 where it served the pair's row. The rest move between a refusal and not-found.
  Metadata-protocol: none
  Skills-docs: none — `content/docs/deployment/marketplace-handbook.mdx` already says a disabled module is hidden, and no skill or doc teaches the by-name answer for a name a disabled package holds.
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export changes shape beyond optional parameters (the flow and connector resolvers' `options`, `MetadataManager.getPublished`'s `packageId`) and one optional query member. The moved answers are reads of registered items under a reversible package state, so there is nothing for a migration to rewrite and no tombstone. -->
  
  **BREAKING** answer narrowing at exported in-process APIs of `@objectstack/objectql`, for a name only disabled packages hold, and for a package caller that reaches a name only through a disabled package; and at the `/meta` exact read (`@objectstack/metadata-protocol`), for the pair address of a disabled base and for a disabled package's address at a member only its pair stores.
  
  - **Before → after.** `SchemaRegistry.resolveItem(type, name)`, `MetadataFacade.get` / `getEntry` and `SchemaRegistry.getApp(name)`: the disabled package's body → `undefined`. `MetadataFacade.exists`: true → false. First-party callers: 0. `MetadataFacade` is never constructed in-tree, `getApp` has no caller, and the one door that reads `resolveItem` (the protocol's by-name read) already withheld the body.
  - **Before → after, the resolver primitives**, same name: `SchemaRegistry.packageScopedHoldersOf(type, name)`: `[DISABLED]` → `[]`. `resolvePackageScopedName`, `readPackageScopedItem` and `resolveActionByPackage`, a caller with no package or outside the holder's closure: resolved to the disabled holder → not-found. First-party callers whose answer moves: 0 (no first-party app disables a package at boot).
  - **Before → after, served → refused.** A package caller whose declared closure holds the name only through a disabled package, while an enabled package outside the closure holds it: the disabled package's body → refused `outside-closure`, naming the enabled holder. At `resolvePackageScopedName`, `SchemaRegistry.resolveItem(type, name, callerPackageId)` and `resolveActionByPackage`. First-party callers: 0.
  - **Before → after, served → not-found, at a door.** `GET /meta/:type/:name?package=<base>.custom`, on both transports, the pair of a disabled base, when an enabled package that holds the name registered first: 200 with the disabled base's body under the enabled holder's envelope (`_packageId`) → 404, the disabled base's withheld item. Measured on `main` with the email-template namespace change merged. First-party callers: 0.
  - **Before → after, served → not-found, at a door.** `GET /meta/:type/:name?package=DISABLED&member=`, `?package=DISABLED.custom&member=` and the disabled package's namespace path, at a member only the disabled package's customization pair stores, with one holder of the name or two, in either registration order: 200 with the pair's row → 404, the disabled package's withheld item. The same with one holder, disabled, at a member only a package-less stored row carries: 200 with that row → 404. An address that reads only a disabled package never serves its customization. Measured on `main` 216674301. First-party callers: 0.
  - **Added, `@objectstack/metadata`.** `MetadataManager.getPublished(type, name, packageId?)`: an optional `packageId`, read as `get` reads it. Without it, every answer is unchanged.
  - **Unchanged.** A caller inside the disabled package still reads its own item. Re-enabling the package serves it again. A consumer that needs a disabled package's body names the package (`SchemaRegistry.getPackageScopedItem(type, name, packageId)`), or reads the holders with `includeDisabledPackages: true`.
  
  **Every moved answer, before → after.** First-party count 0 for each: showcase (22 packages, 205 package-scoped names), crm (18, 35) and multi-package (16, 27) hold no name that two packages share, and disable none at boot.
  
  Widening:
  
  - Bare `GET /meta/:type/:name` for every type of `PACKAGE_SCOPED_READ_TYPES`, on both transports, and the doors that read it (MCP `agent_prompt`, the dataset query door with a bare `datasetName`, the import door's `mappingName`, the connector pull). Two holders, one disabled: 409 naming both → 200 with the enabled holder's item.
  - Bare `GET /meta/:type/:name/layers` (and `?layers=true`), on both transports, the same name: 409 naming both → 200 with the enabled holder's layers, read at its address (its code layer, its stored overlay row, its lock), whichever holder registered first or last. A stored row bound to the disabled holder is read by none of them, and rows bound to each holder no longer make the layered read refuse. The metadata service's copy of a type it keys by name alone is the body registered last, and when that copy is the disabled holder's it is never the code layer.
  - Bare `GET /meta/:type/:name/published`, on both transports, the same name: 409 naming both → the enabled holder's stored row if it has one. Otherwise → the metadata service's copy, read at the enabled holder's package. A type the service stores per `(package, name)` (`agent`, `skill`, `api`, `action`) answers that package's copy and is never refused naming the disabled holder. A copy stamped with the disabled holder is replaced by the enabled holder's code layer. Otherwise → 404, as `/published` answers an item the metadata service does not hold (a package registered only through the `manifest` service).
  - Two co-owners of a shareable namespace, one disabled, `GET /meta/:type/:ns/:name` and the bare read: 409 `ambiguous-in-namespace` → 200 with the enabled co-owner's item.
  - `resolveActionByPackage`, and the REST route rung for a caller's package (`resolveRouteActionDeclaration`), a caller with no package or one whose closure holds both: refused → the enabled holder's declaration and its handler.
  - The caller arm (`?callerPackage=P`) of `GET /meta/dataset/:name` and of the dataset query doors, single and batch, on both transports: two holders in P's declared closure, one disabled: 409 naming both → 200 with the enabled holder's dataset.
  - The connector pull of a job's mapping for a package caller (the package that declares the job): two holders in its closure, one disabled: 409 `mapping_name_refused` naming both → the enabled holder's mapping is pulled.
  - An App's pair (`?package=<App>.custom`), two modules of the App holding the name, one disabled, where the layer below reaches neither module's item (a package outside the App holds the name and registered first): 409 `ambiguous-in-closure` naming both → 200 with the enabled module's item.
  - A package-less row of a name an enabled and a disabled package hold (the environment's item, or a package-less stored row), at the enabled holder's exact address (`?package=`, its namespace): 409 `ambiguous-in-closure` naming both → served as that holder's customization, as with one holder. Re-enabled, it is refused naming both again. At the enabled holder's pair (`?package=<enabled>.custom`) beside the same row: 409 naming both → 200 with the row when the enabled holder registered first; → 404 when the disabled one did (the 409 → 404 line below). The same for `action`, whose package-less rows are judged since the narrowed types joined that judgment (`judgesPackageLessRows`): the environment's item at the enabled holder's exact address, and a package-less stored row in the layered read at that address (`?layers=true&package=`), reported as its overlay, where both were refused naming both.
  - The flow credential channel's write (the flow save door's credential store), for a flow name an enabled and a disabled package hold: a save that sets, clears or removes a stored credential, refused 409 naming both → written, each row stamped (`flow_package`) with the enabled holder's package, the one the served flow is.
  - The list scoped to the enabled holder (`GET /meta/:type?package=`), and the execution list at its address (`getMetaItemsForExecution`, which an email send resolved to that holder reads), a package-less stored row of a name an enabled and a disabled package hold: the holder's own item → the row, as that holder's customization (the package-less row line above, read in the list). Re-enabled, the holder's own item again. The environment's item in the registry is not in either list, disabled or not.
  - A member row an App's pair stores with no `overrides`, of a bundle name two modules of the App hold, one disabled: at the enabled module's exact address, refused 409 naming both → served as its member; in its scoped list and its execution list (a send resolved to that module), left out → listed. Re-enabled, as before.
  - The same member row, both modules disabled: in each module's scoped list and execution list, left out → listed; a send made from either module at that member, no template → that member. Carried to #32670.
  - The bare read of a name two or more packages hold, every one disabled, at a member only another row carries (a package-less row, a dependent's added locale, or the App pair's row the metadata service answers by name): 409 naming them → 200 with that row, the answer `main` already gives with one holder. Beside the 409 → 404 line for the bare read below; carried to #32354.
  
  Same status, the disabled package no longer named:
  
  - `?package=NONHOLDER`, `GET /meta/:type/:ns/:name` of a namespace that holds nothing, and `_env`, two holders: 409 naming both → 409 naming the enabled holder.
  - An action caller outside both closures: refused naming both → refused naming the enabled holder.
  
  Served or not-found → refused:
  
  - An action caller whose closure holds the name only through the disabled holder, the enabled one outside it: the disabled holder's declaration → refused `outside-closure`, naming the enabled holder (the served → refused line above).
  - The dataset caller arm (`?callerPackage=P`), P's closure reaching the name only through a disabled package while an enabled package outside it holds it: 404 (the disabled package's withheld item) → 409 `outside-closure`, naming the enabled holder.
  
  Served → not-found:
  
  - The pair address of a disabled base, an enabled holder registered first (the line above): the disabled base's body → 404.
  - `?package=DISABLED&member=`, `?package=DISABLED.custom&member=` and the namespace path, at a member only the disabled package's pair stores, or, with one holder, only a package-less stored row carries (the line above): that row → 404.
  
  409 → 404:
  
  - An App's pair whose every base is disabled: 409 `ambiguous-in-closure` naming them → 404.
  - `?package=DISABLED` and `?package=DISABLED.custom`, beside a package-less row (the environment's item, or a package-less stored row) of a name an enabled and the disabled package hold: 409 `ambiguous-in-closure` naming both → 404, the disabled package's withheld item. For `action`, `?package=DISABLED` beside the environment's item, the same.
  - `?package=<enabled>.custom` beside the same row, the disabled holder registered first: 409 naming both → 404. The pair address's envelope falls back to the first holder that ships the name (#32501 location 1, the same on `main`); with the enabled holder first it is the widening above.
  - A name only disabled packages hold, on `?package=NONHOLDER` and its qualified path, whatever row a layer of the read reached (a row of a holder's customization pair at a member only it stores included): 409 naming the disabled package → 404. Only a row stored under the address's own package is served.
  - A name two or more disabled packages hold, and nothing else, on the bare read: 409 naming them → 404. At a member only another row carries, it serves that row (the widening line above).
  - A shareable namespace whose co-owners both hold the name and are both disabled, `GET /meta/:type/:ns/:name`: 409 `ambiguous-in-namespace` → 404.
  
  Refused → not-found:
  
  - A stored permission-set column naming the disabled holder: refused naming both (it was read as a stale column) → not-found. It conferred nothing before and confers nothing now, and it is never re-targeted to the enabled holder.
  - An action caller outside the closure of a name only a disabled package holds: refused naming it → not-found.
  
  Degraded → 409:
  
  - The REST action rung for a caller's package (`resolveRouteActionDeclaration` with `callerPackageId`): a package-scoped refusal the protocol's execution read throws → the declaration's `refusal`, answered as the declared `409 RESOURCE_CONFLICT`, where it was swallowed as `degraded`. No door reaches this rung today: it runs only for a caller that names its package, and neither the bare `/actions` door nor the activation door passes one.
  
  **Not moved.** `?package=DISABLED`, the disabled package's namespace, the pair of a disabled base read where no enabled holder's envelope is reached, and the caller arm (`?callerPackage=P`) when P's own holding is disabled keep their 404 (beside a package-less row, the 409 → 404 line above; at a member only the pair stores, the 200 → 404 line above). The email template send (`createRegistryEmailTemplateLoader`, `@objectstack/plugin-email`) reads every holder, so a disabled package still counts there and a refusal still names it, until #32670: the door asks the list for the same address, or throws the same refusal, as on `main`, a send made from the disabled holder included; what an address lists moves only as the scoped-list and execution-list lines above declare. `_env` of a name only disabled packages hold keeps `main`'s 409 naming them: with no served holder, its admission judges every holder. The exact qualifier admits them over every holder, and the item face answers the address itself as the disabled package's withheld item, whichever envelope a layer reached; a refusal's candidates and the bases a pair is read at are the served holders. A name only disabled packages hold keeps the missing name's 404 on the bare `/meta/:type/:name/layers` and `/published`, and the layered view at any other address answers 404 as the plain read does: the item face (`@objectstack/metadata-protocol`) answers it as that package's withheld item, the shape a disabled holder's read had. Every holder's own read, the served lists (but the list scoped to an enabled holder and its execution list, for the two lines above), and a name only disabled packages hold on the bare read (404) answer as before. Durable judgments read every holder, so a binding never moves with a reversible disable: a name only a disabled package holds still binds to it, and a name an enabled and a disabled package both hold stays ambiguous and is left null. They are the stored-reference backfills (R1/R3 permission sets, R4 activation ledger, R5/R6/R13 sharing declarations, R20 email templates, R7 open approval requests, R8 paused runs, R9 flow credentials, R10 dispatch keys, R11 connector connections), the CLI stored-reference report (`os migrate stored-references`, its pair-member and package-less-row sections included), and the picklist verdict that the load audit, the install door and a field's options share. R7–R11 read through `AutomationEngine.durableFlowHolder` and the connector resolver asked with `includeDisabledPackages`, and so does the dispatch key a trigger claims (`AutomationEngine.flowDispatchHolder`), as the re-key does: a flow only a disabled package holds keeps that package's scope, and a name an enabled and a disabled package hold keeps the collision guard; the connector execute door, and the flow execute door for a name one slot holds, keep judging the served holders. The install gate (`bareNamePackageHolders`) and the security catalog's item seam are separate reads and are not touched. A permission-set grant is the fixed exception to the served set: the security catalog's resolution (`resolvePermissionScoped`, for a reference with no package column, a stale column, or a position's package) and `holdsPlatformPermissionSet` (`@objectstack/core`) read every holder, so a disable never makes a grant confer more. Two holders with one disabled stay refused naming both, and `holdsPlatformPermissionSet` is false; a name only a disabled package holds counts that package, so a caller outside it is refused naming it, and no grant resolves to its set: each as on `main`. Only a column naming the disabled holder moves (the refused → not-found line above). The picklist arrival judge (`SchemaRegistry.judgePicklistArrival`: an install, an upgrade, a hot reload or a late item whose lists would leave an installed reference with no one list) reads every holder before and after the arrival, as the picklist verdict does, so the install audit and a field's options agree for a disabled holder: an arrival is refused exactly as with the holder enabled. The doors that run one package's flow of a name two packages hold read every holder too, so a disable moves none of their answers: a flow action's and a flow endpoint's target (`flowServiceForCaller`, `endpointPackageOf`), the start admission's read walk (`flowWalkReads`), `flowHolderForCaller`, the `/automation` bare-name refusal and addressed paths of such a name (`bareNameRefusal`, `admitAutomationAddress`), and the engine's slot table (`heldByMany`), its shared-name refusal and the shared branch of its flow-key resolution. A runtime disable keeps the disabled package's engine slot armed, so a served read there would move these doors both ways; their served judgment is carried to #32670. The engine's `flowHolder` and `flowHolderPackage` (the credential channel line above), and the activation ledger's `stillHolds`, keep the served read. The metadata service's removal by name (`storeRemovalKeys`) counts the store's own slots and reads no package state, so it does not move either. The bare action read's check for a disabled package's customization (`servedFromDisabledHolder`, `@objectstack/metadata-protocol`) asks which disabled holder's slot answered, so it reads every holder and answers as on `main`.
  
  **Also in this change, not breaking.** `@objectstack/metadata-protocol`: `packageLessRowOwners(registry, type, name, options?)` takes an optional `options` carrying `includeDisabledPackages`, which the CLI report passes; without it the answer is the served holders. `SchemaRegistry.packageScopedHoldersOf(type, name, callerPackageId?, options?)` takes `options.includeDisabledPackages` (the option name `listItems` already carries) to read every holder, and `resolvePackageScopedName`'s query takes `includeDisabledPackages`, forwarded to it. `@objectstack/service-automation`: `AutomationEngine.durableFlowHolder(name)` asks `flowHolder`'s question over every holder, and the `FlowNameResolver` and `ConnectorNameResolver` types take an optional third `options` argument carrying it.
- bdbaf80: fix: Setup's form help speaks to an administrator, and the queue pages, the mail status banner and the test-email toast read in Chinese on a zh-CN console
  
  Clause-②: yes (widening)
  Metadata-protocol: none
  
  - **Field help (English source and zh-CN):** the permission set and position assignment forms, the out-of-office (approval delegation) rule, and the business unit, organization and user forms no longer describe the implementation. Gone: "fail-closed", "half-open [from, until)", "agent grants", "graph semantics", "expanded by graph queries", "Null = root of tenant", "HRIS", "When true / When false" (zh-CN 「为 true 时」 now reads 「开启后」) and an HTTP status code. The help now says when an assignment starts and ends, what turning a switch on does, and what to fill in. Text only: no field name, key, option value or behaviour changes.
  - **`@objectstack/plugin-sharing`:** `sys_queue` and `sys_queue_member` join the plugin's translation bundle, with zh-CN text, so the 队列 and 队列成员 pages, their columns, help and the 新建 button read in Chinese. ja-JP and es-ES carry English fills for now.
  - **`@objectstack/plugin-email`:** the live-status statement at the top of Setup → Email and the "Send test email" answer (sent, failed, logged only) are written in the caller's display language, en and zh-CN today; another language gets English.
  - **`@objectstack/service-settings`:** a settings action handler (`SettingsActionHandler`) receives an optional `locale`, the caller's display language read from the request the same way the live-status statement's is (`Accept-Language`, else `?locale`); `runAction` takes it as a fifth `display` argument. Existing handlers compile and behave unchanged.
- Updated dependencies [31fe289]
- Updated dependencies [7d0b47c]
- Updated dependencies [f6a429b]
- Updated dependencies [eb96480]
- Updated dependencies [8aa2e91]
- Updated dependencies [c17719d]
- Updated dependencies [de24d17]
- Updated dependencies [b90a6f7]
- Updated dependencies [486b0a9]
- Updated dependencies [9ed2ee1]
- Updated dependencies [769adff]
- Updated dependencies [e8dc483]
- Updated dependencies [bcdb1db]
- Updated dependencies [9ebca94]
- Updated dependencies [3b8c724]
- Updated dependencies [140d8ce]
- Updated dependencies [699ebd8]
- Updated dependencies [5f47410]
- Updated dependencies [4c2cd29]
- Updated dependencies [4be8a2e]
- Updated dependencies [471add3]
- Updated dependencies [314ad95]
- Updated dependencies [b5eb61d]
- Updated dependencies [771b2db]
- Updated dependencies [97e4249]
- Updated dependencies [9037b13]
- Updated dependencies [e3b56b2]
- Updated dependencies [a52761f]
- Updated dependencies [e8afd1e]
- Updated dependencies [bd65cb6]
- Updated dependencies [cd5f554]
- Updated dependencies [f19fbb8]
- Updated dependencies [217ba78]
- Updated dependencies [cde492d]
- Updated dependencies [eee4149]
- Updated dependencies [0f3ee58]
- Updated dependencies [f3a52d3]
- Updated dependencies [d59a1eb]
- Updated dependencies [13aa6a3]
- Updated dependencies [391d748]
- Updated dependencies [af3451b]
- Updated dependencies [ddcdc80]
- Updated dependencies [000e773]
- Updated dependencies [7fc401f]
- Updated dependencies [4013e30]
- Updated dependencies [3a27208]
- Updated dependencies [29cbfcc]
- Updated dependencies [343ddb2]
- Updated dependencies [0c666c3]
- Updated dependencies [f672e0d]
- Updated dependencies [38717d3]
- Updated dependencies [bfbdeec]
- Updated dependencies [4adc890]
- Updated dependencies [bcdf8d3]
- Updated dependencies [ac890f5]
- Updated dependencies [aa57c76]
- Updated dependencies [fc869c2]
- Updated dependencies [fef212b]
- Updated dependencies [dc51811]
- Updated dependencies [b77c160]
- Updated dependencies [09720e2]
- Updated dependencies [8fed00f]
- Updated dependencies [25fea77]
- Updated dependencies [86ae2ca]
- Updated dependencies [3da9a4c]
- Updated dependencies [3da9a4c]
- Updated dependencies [4be9734]
- Updated dependencies [bb86ff9]
- Updated dependencies [977be38]
- Updated dependencies [2046d21]
- Updated dependencies [243eba1]
- Updated dependencies [740edc5]
- Updated dependencies [778aedf]
- Updated dependencies [71318af]
- Updated dependencies [fd749a4]
- Updated dependencies [a26abbc]
- Updated dependencies [d9d42d4]
- Updated dependencies [6a70821]
- Updated dependencies [9d939c5]
- Updated dependencies [d4a8439]
- Updated dependencies [69c7cd6]
- Updated dependencies [25e1c1a]
- Updated dependencies [6a8f415]
- Updated dependencies [67d5d53]
- Updated dependencies [47226e6]
- Updated dependencies [c7d1367]
- Updated dependencies [f5aaa0b]
- Updated dependencies [0005fec]
- Updated dependencies [2d6402c]
- Updated dependencies [77c203a]
- Updated dependencies [8293c74]
- Updated dependencies [8cc709d]
- Updated dependencies [60fe44f]
- Updated dependencies [29702d5]
- Updated dependencies [a839020]
- Updated dependencies [a7b8876]
- Updated dependencies [f7afab8]
- Updated dependencies [7b80724]
- Updated dependencies [fb1ab89]
- Updated dependencies [4dde0ae]
- Updated dependencies [e8e924f]
- Updated dependencies [590724f]
- Updated dependencies [35cd64c]
- Updated dependencies [38d416f]
- Updated dependencies [d2e2f6f]
- Updated dependencies [d5f3bc5]
- Updated dependencies [e3948ae]
- Updated dependencies [b55d6ab]
- Updated dependencies [1c5cee6]
- Updated dependencies [aad1603]
- Updated dependencies [0e4747a]
- Updated dependencies [eb68b98]
- Updated dependencies [1ebe0c5]
- Updated dependencies [2f05a46]
- Updated dependencies [b126c13]
- Updated dependencies [a11ef71]
- Updated dependencies [deac7f4]
- Updated dependencies [2ae3e30]
- Updated dependencies [7145bf3]
- Updated dependencies [55d9dd4]
- Updated dependencies [af8aab1]
- Updated dependencies [63de248]
- Updated dependencies [a59d00a]
- Updated dependencies [a2437b5]
- Updated dependencies [4bf9a2d]
- Updated dependencies [0c9aa82]
- Updated dependencies [49c8568]
- Updated dependencies [4564d6f]
- Updated dependencies [f2ea193]
- Updated dependencies [badf24d]
- Updated dependencies [5268f50]
- Updated dependencies [a30c4f4]
- Updated dependencies [e2bcd5c]
- Updated dependencies [0cba0ce]
- Updated dependencies [c893b3d]
- Updated dependencies [677d542]
- Updated dependencies [9bdeed2]
- Updated dependencies [9052337]
- Updated dependencies [3479c33]
- Updated dependencies [000a4c0]
- Updated dependencies [7569fb5]
- Updated dependencies [f4d9c09]
- Updated dependencies [4a3b186]
- Updated dependencies [a2826a1]
- Updated dependencies [2a6a28d]
- Updated dependencies [902f162]
- Updated dependencies [c77dd17]
- Updated dependencies [555eb1b]
- Updated dependencies [ebe0a98]
- Updated dependencies [9038187]
- Updated dependencies [f108e6d]
- Updated dependencies [8847e09]
- Updated dependencies [40eaae7]
- Updated dependencies [45916c9]
- Updated dependencies [b2ce250]
- Updated dependencies [5cb7d7e]
- Updated dependencies [78eb352]
- Updated dependencies [2ce2646]
- Updated dependencies [468e0c1]
- Updated dependencies [6106b73]
- Updated dependencies [0f920b9]
- Updated dependencies [6bd00d2]
- Updated dependencies [b5696b4]
- Updated dependencies [33bc8ae]
- Updated dependencies [293a85b]
- Updated dependencies [ed4b832]
- Updated dependencies [8c9260f]
- Updated dependencies [b70d9aa]
- Updated dependencies [f6199a8]
- Updated dependencies [f5e23e2]
- Updated dependencies [a1afbb9]
- Updated dependencies [150f740]
- Updated dependencies [42eb126]
- Updated dependencies [8cf1fd0]
- Updated dependencies [98583cd]
- Updated dependencies [cadd6aa]
- Updated dependencies [a5cb4f1]
- Updated dependencies [d36d4ad]
- Updated dependencies [3c1eb63]
- Updated dependencies [d57be87]
- Updated dependencies [2b752f1]
- Updated dependencies [c0068ed]
- Updated dependencies [7fe019f]
- Updated dependencies [e735425]
- Updated dependencies [1f37085]
- Updated dependencies [71d094c]
- Updated dependencies [8b16445]
- Updated dependencies [6ee8c61]
- Updated dependencies [f4b4c8a]
- Updated dependencies [db50231]
- Updated dependencies [0e1311d]
- Updated dependencies [8c75f83]
- Updated dependencies [3aa0b42]
- Updated dependencies [82e6da1]
- Updated dependencies [acfc86c]
- Updated dependencies [18ed2db]
- Updated dependencies [39aa3f6]
- Updated dependencies [b6e6545]
- Updated dependencies [90457e7]
- Updated dependencies [1f30be1]
- Updated dependencies [76e4c2c]
- Updated dependencies [47bc621]
- Updated dependencies [efbe1a0]
- Updated dependencies [2d1a76b]
- Updated dependencies [3b7219e]
- Updated dependencies [3fed8ce]
- Updated dependencies [bafbc68]
- Updated dependencies [0ebb080]
- Updated dependencies [907fdca]
- Updated dependencies [f25414e]
- Updated dependencies [75d7fb1]
- Updated dependencies [41106b5]
- Updated dependencies [8aaa69f]
- Updated dependencies [59630d9]
- Updated dependencies [fe88ecd]
- Updated dependencies [5e85952]
- Updated dependencies [ef4af73]
- Updated dependencies [ae31539]
- Updated dependencies [7e697ff]
- Updated dependencies [96b9350]
- Updated dependencies [d9a232f]
- Updated dependencies [d655caf]
- Updated dependencies [1cd0e01]
- Updated dependencies [3487ccc]
- Updated dependencies [cc16008]
- Updated dependencies [cfe3563]
- Updated dependencies [2b3e3eb]
- Updated dependencies [5b7269f]
- Updated dependencies [2735ca4]
- Updated dependencies [6dd196d]
- Updated dependencies [d834a36]
- Updated dependencies [0cd594b]
- Updated dependencies [8beac67]
- Updated dependencies [b96b875]
- Updated dependencies [c62e72a]
- Updated dependencies [351c22c]
- Updated dependencies [450bfb6]
- Updated dependencies [5defbfe]
- Updated dependencies [f56354c]
- Updated dependencies [e55347d]
- Updated dependencies [5f84ef0]
- Updated dependencies [5f84ef0]
- Updated dependencies [9046e02]
- Updated dependencies [f647430]
- Updated dependencies [36a8700]
- Updated dependencies [69db709]
- Updated dependencies [fdfcc7a]
- Updated dependencies [5a8dbc7]
- Updated dependencies [fb94249]
- Updated dependencies [98ba756]
- Updated dependencies [e627eaa]
- Updated dependencies [7231dc7]
- Updated dependencies [c8223fb]
- Updated dependencies [3224545]
- Updated dependencies [8fca8f7]
- Updated dependencies [26d30d7]
- Updated dependencies [a15b544]
- Updated dependencies [3684d18]
- Updated dependencies [d9f626b]
- Updated dependencies [1a66fcf]
- Updated dependencies [6180c87]
- Updated dependencies [bc41e01]
- Updated dependencies [f00fb1b]
- Updated dependencies [c655af8]
- Updated dependencies [93ff5dd]
- Updated dependencies [c7dd505]
- Updated dependencies [016ec88]
- Updated dependencies [1934918]
- Updated dependencies [01559b8]
- Updated dependencies [8075338]
- Updated dependencies [93f0d43]
- Updated dependencies [c7dc143]
- Updated dependencies [aad7d2f]
- Updated dependencies [4f6fb53]
- Updated dependencies [7d4fcb6]
- Updated dependencies [4c928f5]
- Updated dependencies [171cf6d]
- Updated dependencies [f75466c]
- Updated dependencies [ff04ad8]
- Updated dependencies [36b216b]
- Updated dependencies [84aabea]
- Updated dependencies [b96d492]
- Updated dependencies [ed95466]
- Updated dependencies [0561e60]
- Updated dependencies [45f0f81]
- Updated dependencies [fa4cb68]
- Updated dependencies [036a9fb]
- Updated dependencies [91d88ec]
- Updated dependencies [fb71296]
- Updated dependencies [aac03d9]
- Updated dependencies [f714b0a]
- Updated dependencies [ba8e993]
- Updated dependencies [9bff554]
- Updated dependencies [1368536]
- Updated dependencies [02498c9]
- Updated dependencies [7aab601]
- Updated dependencies [5c5f382]
- Updated dependencies [2830f31]
- Updated dependencies [c419609]
- Updated dependencies [e34723f]
- Updated dependencies [9052363]
- Updated dependencies [eeb6cc1]
- Updated dependencies [88282a7]
- Updated dependencies [d074c28]
- Updated dependencies [e267b96]
- Updated dependencies [225e179]
- Updated dependencies [0bc0774]
- Updated dependencies [e765a09]
- Updated dependencies [1e474e3]
- Updated dependencies [7575116]
- Updated dependencies [0763bf6]
- Updated dependencies [2b11a71]
- Updated dependencies [de6d893]
- Updated dependencies [c147fc2]
- Updated dependencies [5192297]
- Updated dependencies [326453e]
- Updated dependencies [6d6f86b]
- Updated dependencies [a95cb06]
- Updated dependencies [f1d1f6c]
- Updated dependencies [a03cf66]
- Updated dependencies [90106d6]
- Updated dependencies [0115280]
- Updated dependencies [26f4e6d]
- Updated dependencies [6ff08b0]
- Updated dependencies [f09517e]
- Updated dependencies [2ae811e]
- Updated dependencies [1216abf]
- Updated dependencies [cac0f1a]
- Updated dependencies [3c18783]
- Updated dependencies [e336a33]
- Updated dependencies [e336a33]
- Updated dependencies [3452dec]
- Updated dependencies [e47da23]
- Updated dependencies [f0f729e]
- Updated dependencies [1af8253]
- Updated dependencies [be0c0a2]
- Updated dependencies [5694bf5]
- Updated dependencies [c54d60c]
- Updated dependencies [101adaf]
- Updated dependencies [6219588]
- Updated dependencies [6cec006]
- Updated dependencies [af90f30]
- Updated dependencies [245afc1]
- Updated dependencies [ee9ad83]
- Updated dependencies [070e879]
- Updated dependencies [a888c5c]
- Updated dependencies [9ae8291]
- Updated dependencies [a2cb3aa]
- Updated dependencies [4f1de9f]
- Updated dependencies [8c77203]
- Updated dependencies [386891e]
- Updated dependencies [9891065]
- Updated dependencies [870ce55]
- Updated dependencies [c54a23d]
- Updated dependencies [28a1527]
- Updated dependencies [b811f6a]
- Updated dependencies [9af0766]
- Updated dependencies [fd63747]
- Updated dependencies [1ff2c7f]
- Updated dependencies [0b23b2a]
- Updated dependencies [fc45328]
- Updated dependencies [04c35f0]
- Updated dependencies [a596c03]
- Updated dependencies [ccaee99]
- Updated dependencies [d4b14a8]
- Updated dependencies [8004529]
- Updated dependencies [152b53c]
- Updated dependencies [3a83b53]
- Updated dependencies [e003ebb]
- Updated dependencies [6739719]
- Updated dependencies [5d4f2aa]
- Updated dependencies [9dbcc1f]
- Updated dependencies [19f9053]
- Updated dependencies [133f75a]
- Updated dependencies [f4cd4ec]
- Updated dependencies [b3d2f4b]
- Updated dependencies [d0fbe11]
- Updated dependencies [eca7cd2]
- Updated dependencies [cf4b9bf]
- Updated dependencies [767f110]
- Updated dependencies [7193160]
- Updated dependencies [14754c7]
- Updated dependencies [766a5df]
- Updated dependencies [e1dac19]
- Updated dependencies [e542831]
- Updated dependencies [3299873]
- Updated dependencies [7d13a33]
- Updated dependencies [7b2bb66]
- Updated dependencies [44a030b]
- Updated dependencies [a794e32]
- Updated dependencies [21510bb]
- Updated dependencies [8304b08]
- Updated dependencies [0fd363d]
- Updated dependencies [f127b04]
- Updated dependencies [5210acf]
- Updated dependencies [d6b88f1]
- Updated dependencies [4123865]
- Updated dependencies [bdbaf80]
- Updated dependencies [6ffe37e]
- Updated dependencies [1f3e6fd]
- Updated dependencies [cad764d]
- Updated dependencies [63a470a]
  - @objectstack/objectql@18.4.0
  - @objectstack/spec@18.4.0
  - @objectstack/platform-objects@18.4.0
  - @objectstack/core@18.4.0
  - @objectstack/metadata-core@18.4.0
  - @objectstack/formula@18.4.0
  - @objectstack/types@18.4.0

## 18.3.0

### Minor Changes

- a9f654e: feat!: ownership queues: records wait in a queue until a member claims them, and assignment rules route new records (ADR-0142)
  
  Clause-②: yes (narrowing)
  Metadata-protocol: narrowed
  
  <!-- adr-0087: registered object-queue-field-reserved -->
  
  **BREAKING** for one shape only: an object whose records have a user owner (`ownership: 'user'`, the default) can no longer declare its own field named `queue`. The platform now injects a `queue` column on every such object, and `registerObject` refuses the declaration with `422 INVALID_METADATA` (`ObjectQueueColumnRefusedError`), naming the object. An `objectExtensions` entry that declares `queue` on such an object is not refused, because an extension is folded over its object at read time: its `queue` is ignored, the platform's column stands, and a warning names the extension. The remedy: rename the business field (for example `support_queue`) and copy its data across, or, when the object's records have no user owner, declare `ownership: 'business_unit'`, `'org'` or `'none'`. The upgrade guide entry is `object-queue-field-reserved`.
  
  Beside that, two enum additions: `ShareRecipientType` gains `queue` (a sharing rule can now name a queue as its recipient), and the `queue` approver type is authorable again (it leaves `NON_AUTHORABLE_APPROVER_TYPES`, so it is no longer marked deprecated). Two metadata types are new: `queue` and `assignment_rule`.
  
  - **`@objectstack/spec`**: new `queue` and `assignment_rule` metadata types (`QueueSchema`, `AssignmentRuleSchema`) and the stack keys `queues` and `assignmentRules`. A declared queue's members are positions. New `IOwnershipQueueService` contract, registered under `ownership-queue`. `queue` joins the injected system columns of `ownership: 'user'` objects and `PUBLIC_FORM_SERVER_MANAGED_FIELDS`. `APPROVER_VALUE_BINDINGS.queue` reads both a declared queue and an organization's `sys_queue` row, and `APPROVER_ORG_SCOPED.queue` is `true`. The explain rule kinds `queue_membership` and `queue_claim` are new. `QUEUE_NOT_FOUND` (422) is registered under plugin-security.
  - **`@objectstack/objectql`**: objects with `ownership: 'user'` get a system-managed `queue` column beside `owner_id`. Declaring your own `queue` field on one is refused at registration (`INVALID_METADATA`), and an extension's own `queue` field on one is ignored with a warning. An update can carry a write precondition: when it no longer matches, the update answers `409 CONCURRENT_UPDATE`. Declared assignment rules run once for each inserted row that has no owner and no queue after the `beforeInsert` hooks. A rule can park the row in a queue, or pick a member by `round_robin` or `least_loaded`. Assignment never refuses an insert. `kernel:ready` refuses to boot a stack that declares queues or assignment rules when no `ownership-queue` service is registered.
  - **`@objectstack/metadata-core`**: `queue` is classified as an injected system column.
  - **`@objectstack/metadata`**: the artifact door registers a stack's `queues` and `assignmentRules`, so an artifact-only runtime serves them.
  - **`@objectstack/plugin-sharing`**: three new objects, `sys_queue`, `sys_queue_member` and `sys_assignment_cursor`, and the `ownership-queue` service. The service resolves a queue name from the registry first, then from the organization's own rows, and has one member expander. A record with no owner that sits in a queue can be read and edited by the queue's members, never deleted. The `queue` sharing recipient grants matched records to the queue's members, and its grants are recomputed when membership changes or the queue is switched on or off.
  - **`@objectstack/plugin-security`**: the owner gate handles `queue`. A **claim** sets `owner_id` from empty to yourself, by id. It is admitted when the sharing model allows you the record, and only one claimant wins: the loser gets `409`. A **release** gives your own record back to its home queue. A **move** to another queue needs the transfer grant, and a queue name that does not resolve is refused with `422 QUEUE_NOT_FOUND`. An insert that names a queue needs the transfer grant or membership of that queue. A guest can supply neither. Explain reports the queue reasons on the sharing layer.
  - **`@objectstack/plugin-approvals`**: a `queue` approver resolves to the queue's members when the step opens. An empty queue adds nobody and logs a warning. The `queue:<name>` placeholder is never written again.
  - **`@objectstack/lint`**: a queue-only approval node is reported `approval-approvers-may-resolve-empty`, and the org-axis red line admits the queue recipient. Two new advisory rules come with `os explain` entries: `assignment-rule-user-target` (warning) and `assignment-rule-queue-unstaffed` (info).
  - **`@objectstack/cli`**: the organization-ownership inventory lists `sys_queue`, `sys_queue_member` and `sys_assignment_cursor`, so `os migrate organization-ownership` plans them instead of refusing.
  - **`@objectstack/runtime`**: `POST /security/_activation/:type/:name` also switches a declared `queue` or `assignment_rule` on and off.
  - **`@objectstack/platform-objects`**: the two new metadata types' labels, and the queue recipient option, are translated in zh-CN, ja-JP and es-ES.
  - **`@object-ui/app-shell`**: the flow designer no longer warns that a queue approver resolves to nobody.
  - **`@objectstack/skills`**: the platform skill lists `queues` and `assignmentRules` among the stack's top-level keys.
  
  What to do: rename any `queue` field on a user-owned object, or in an extension of one, as above. Every other existing stack behaves as before. To use queues, declare `queues` and `assignmentRules` in your stack, and make sure plugin-sharing is installed: it registers the `ownership-queue` service.
- 8bb2c31: feat(plugin-sharing): `SharingService.admitsByIdWrite` — the by-id write gate the middleware refuses on
  
  Clause-②: yes (widening)
  Metadata-protocol: added
  
  The sharing middleware's by-id `update` / `delete` gate is now one service method, `admitsByIdWrite(object, recordId, verb, context)`, and the middleware refuses exactly when it answers `false`. The same calls run in the same order: `canEdit` / `canDelete`, the delegator's gate for an on-behalf-of write, then the authored-row-write deferral. `byIdWriteGateInstalled` says whether the middleware is installed (`false` under `enforce: false`). `plugin-security` asks the method for the record field-access answer's `writable`, so that verdict is the sharing gate's own. Refusals, their messages and their log lines are unchanged.
- 3557366: feat!: an object that declares `titleFormat` is refused at save and by `os validate`, with the `nameField` prescription (#29007)
  
  Clause-②: no (narrowing)
  Metadata-protocol: narrowed
  
  <!-- adr-0087: registered object-title-format-refused -->
  
  **BREAKING** accept-set narrowing on `object.titleFormat`. The key stays in the schema; what changes is which doors accept it.
  
  - **Before.** `titleFormat` was deprecated (ADR-0079) and still accepted: a save, a publish and `os validate` all passed, with an advisory `title-format-retired` warning on the CLI only. It titled nothing. An explicit `nameField` outranks it, and the registry stamps a derived `nameField` on every object that authors none, so the record page and the list showed one field however the template was written.
  - **Now.** `title-format-retired` is an error. An object definition that declares `titleFormat` is refused by `os validate`, `os build` and `os lint`, and at the metadata save gate (`422 INVALID_METADATA`): an active save, a draft promotion and a restore. A draft save still lands, and its `_diagnostics` reads `valid: false` with the refusal its publish gives. The message and the fix line are the prescription the `titleFormat` describe already carried.
  - **Unchanged.** A stored object that carries `titleFormat` still parses, loads and is served; no conversion drops the key. It is refused only when it is next saved, published or restored. The title order is unchanged: `nameField`, then its alias `displayNameField`, then the derivation.
  - **The platform's own objects.** The 68 system objects that declared `titleFormat` no longer do. 65 already declared the `nameField` that titles them. `sys_attachment`, `sys_audience_binding_suggestion` and `sys_notification_template` now declare the field the registry already stamped (`file_name`, `permission_set_name`, `subject`), so every record title reads as before.
  - **`@objectstack/lint`.** `validateTitleFormatRetired` is a new export and a new gating registry entry. `validateRecordTitle` now reports `title-unresolvable` only.
  
  **The remedy.** Point `nameField` at the title field and drop `titleFormat`. For a composite title that an import, a sort or a search must match, add a `text` field that declares an `expression` (computed and stored on every write) and point `nameField` at it; a `formula` with `returnType: 'text'` stays legal for a title shown for display only. The upgrade guide entry is `object-title-format-refused`.

### Patch Changes

- 685d9f3: fix(runtime, plugin-sharing): a share link's resolve answer describes the fields it returns — authored label, type, picklist option labels, currency and lookup display bits — so the shared-record page no longer has only the field keys to show (#26991)
  
  Clause-②: no
  Metadata-protocol: none
  
  `GET /api/v1/share-links/TOKEN/resolve` answered `{ record, link, redactFields }` on both of its mounts (the `plugin-sharing` routes and the runtime dispatcher's `/share-links` domain). Its visitor is usually anonymous, and `GET /api/v1/meta/object/NAME` refuses an anonymous caller, so a page rendering the shared record could only humanize each key. The answer now also carries `fields`, keyed by field name:
  
  - **What an entry holds.** The field's authored `label` and `type`; a picklist's `options` (`value`, `label`, `color`); `multiple` when it is `true`; a currency field's `currencyConfig` (`currencyMode`, `defaultCurrency`); and a lookup's `reference` (the target object) and authored `displayField`. Labels are the authored ones the object schema holds, untranslated. A lookup's value in `record` is unchanged: the stored id.
  - **Which fields.** Exactly the keys `record` carries that the shared object declares. A field the link redacts is absent from both `record` and `fields`; a field the record read never returns (`internal`) is absent from both; no other field of the object is described. The meta door's anonymous refusal is unchanged.
  - **One builder.** Both mounts build the whole answer through `buildShareLinkResolveAnswer` (new in `@objectstack/types`, beside `redactSharedRecord` and `projectSharedRecordFields`), so they answer the same shape. Redaction is unchanged.
  
  The existing keys are unchanged, so a reader of the old answer reads the new one as before.
- f57eddc: fix(plugin-sharing)!: on a federated object whose `owner_id` is the platform's injected anchor, the read and bulk-write scopes narrow below `org` instead of going unscoped (#27425)
  
  Clause-②: yes (narrowing) — `SharingService.buildReadFilter` and `buildWriteFilter` answer a deny-all scope, where they answered `null` (no scope), for a caller below `org` depth on an ADR-0015 federated object that neither declares `owner_id` in `fields` nor maps a remote column onto it; on `private` such an object's refused edit answers 404 where it answered 403. One accept set widens: `SharingService.grant()` on a federated object that maps a remote column onto `owner_id` through `external.columnMap` (without declaring it) is no longer refused as inert, because that object's share rows are now read. No key is added, removed or renamed.
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export or type changes: the record-sharing scope of one class of federated object fails closed where it went unscoped. The remedy is a metadata choice the author already has (declare the owner column, or choose the sharing model on purpose), so there is nothing for a migration to rewrite and no tombstone. -->
  
  **BREAKING** read-scope narrowing in record sharing (`@objectstack/plugin-sharing`).
  
  - **Before.** On a federated object (`external` binding) with an owner-keyed sharing model, the sharing service decided whether `owner_id` was real from the declared `fields` alone. When the author had not declared it, the registry's injected anchor was taken to mean "no owner column", and the read filter applied no scope. A driver can still serve `owner_id` (the SQL driver through `external.columnMap`, a remote column of that name, a plugin driver on its own), so a `private` object answered its rows to members it was meant to hide them from. Bulk updates and deletes went unscoped the same way, while single-record writes were refused with 403.
  - **Now.** The owner column counts as proven when `fields` declares `owner_id` or an `external.columnMap` entry maps a remote column onto it; such an object keeps ordinary owner scoping (a driver that does not apply the map serves no `owner_id`, so the owner predicate admits nothing there). Otherwise an unproven owner narrows the scope: below `org` read depth the read filter admits no row by ownership, no owner predicate and no share rows (a grant on such an object is already refused as inert), and a pending approval step still opens the record it waits on. The bulk write filter admits no row below `org` write depth. Because an edit reads its record through the same scope first, a member's PATCH on a `private` object of this shape now answers 404 `RECORD_NOT_FOUND` where it answered 403 `PERMISSION_DENIED`; on `public_read` it stays 403. `org` depth, the Modify All bypass, system callers and local objects are unchanged.
  - **Who sees it.** An app with a federated object on `private` (including no `sharingModel`, which the runtime treats as `private`), or `public_read` for bulk writes, that neither declares nor maps `owner_id`: members below `org` depth now read no row there, and their refused edits answer 404. An external principal on a `public_read` object meets the same closed scope. `os validate`'s `security-external-owner-unmapped` warning (`@objectstack/lint`) now names the 404 on `private`, and its explanation says reads are refused too.
  
  **The remedy.** Choose on purpose. Declare `owner_id` in `fields` and have the driver return the remote owner under that name (a built-in SQL driver through `external.columnMap`; a plugin driver must return it itself), and the object scopes to the owner. Or choose `sharingModel: 'public_read'` (everyone reads) or `'public_read_write'` (everyone reads and edits, a `beforeUpdate` hook decides who may).
- 684f2f6: fix(spec): one reader decides whether an external object's owner is provable, and record sharing and lint both read it
  
  Clause-②: yes
  Metadata-protocol: none
  
  An external object (ADR-0015) gets the platform's `owner_id` injected but no storage for it. Record sharing narrows such an object's member reads and bulk writes to no row by ownership unless the author declares where the owner comes from: a declared `owner_id` field, or an `external.columnMap` entry that maps a remote column onto `owner_id`. That question was answered in three places. The spec's provenance helper did not know the `columnMap` arm, while plugin-sharing and lint each read `columnMap` with their own copy.
  
  - **`isOwnerAnchorUnprovable(def)`** (`@objectstack/spec/data`) is now the one answer: `true` when `resolveInjectedColumnProvenance(def, 'owner_id')` is `injected-unprovisioned` and no `external.columnMap` value is `owner_id`. Plugin-sharing's `hasPhantomOwnerAnchor` and lint's `hasUnprovableOwnerAnchor` return it.
  - **`externalColumnMapTargets(def, field)`** reads whether `external.columnMap` maps a remote column onto `field`. Lint's `security-external-owner-unmapped` uses it for its "mapped but not declared" wording.
  - **Public surface.** `@objectstack/spec/data` gains the two exports above; no existing export changes its answer.
  - **`resolveInjectedColumnProvenance` is unchanged.** A `columnMap` entry does not change who wrote the `owner_id` field, and the lint write rule depends on that: on a plugin driver the map is not applied, so only a declared field lets a member write.
  
  Read scopes, write scopes, share-grant refusals and lint findings are unchanged for registered objects. On hand-built documents, two readings move: an object with no `owner_id` key that would be injected one now reads as unprovable, which every sharing caller already guards by checking for the field first; and an object whose tier withholds `owner_id` but which declares a field identical to the platform's now reads as the author's, the spec's existing rule. Both still match no remote row the author did not vouch for.
- 64599ec: fix(plugin-sharing): a refused write on a federated object whose mapped owner column the driver did not serve is logged again
  
  Clause-②: no
  Metadata-protocol: none
  
  A federated object that maps a remote column onto `owner_id` through `external.columnMap`, served by a plugin driver that does not apply the map, returns rows with no `owner_id`, so every member edit or delete is refused. The refusal is unchanged. Since the mapped class stopped counting as a phantom owner anchor, the one-line server warning that tells the operator why had stopped firing. It fires again, at most once per object, as the new `UNSERVED_OWNER_WRITE_DENY_NOTICE`, which names the driver returning no value for the mapped or declared owner column. A driver that serves the column, including a row whose owner is NULL, stays silent.
- 3944d2e: feat(plugin-hono-server,plugin-sharing): `GET /auth/me/permissions` answers `hasAnyQueue`, whether the caller's organization has at least one ownership queue
  
  Clause-②: yes
  Metadata-protocol: none
  
  The console's list toolbar offers an "in a queue" toggle, and it needs to know, once per session, whether that toggle can ever return a row. A plain member cannot find out: `member_default` names no `sys_queue` entry, so `GET /data/sys_queue` answers 403. The server now answers the one question for them.
  
  - **The field.** Every authenticated `/auth/me/permissions` body carries `hasAnyQueue: boolean`. It is `true` when the caller's organization has at least one ownership queue: a declared queue the activation ledger has not switched off, or a `sys_queue` row of the organization. A row under a declared queue's name does not count, since that name resolves nowhere. Only the boolean is disclosed: no names and no counts. An anonymous caller still gets `{ "authenticated": false }` and nothing else.
  - **Where it is resolved.** `OwnershipQueueService.hasAnyQueue(organizationId)` in `@objectstack/plugin-sharing`, under system context, with the same registry-first read and activation-ledger filter `queuesOf` uses.
  - **When there is no answer.** No ownership-queue service registered, a service without the method, or a service that throws answers `false`. A throw is logged at `warn` and does not cost the caller the rest of the permissions body. The closed body the handler answers on a fault carries `false` too.
  - **Unchanged.** A member's read of `sys_queue` and `sys_queue_member` stays refused. No route is added.
- 4d278c9: feat(spec): a strict response contract for `GET /auth/me/permissions`, and `hasAnyQueue` on the ownership-queue contract
  
  Clause-②: yes (widening)
  Metadata-protocol: added
  
  `GET /auth/me/permissions` is the payload the console reads once per session for its whole permission layer. Until now nothing in `@objectstack/spec` declared its body. It is now declared, strictly:
  
  - **`MePermissionsResponseSchema`** (`@objectstack/spec/api`), discriminated by `authenticated`:
    - `MePermissionsAnonymousResponseSchema`: `{ authenticated: false }` and nothing else.
    - `MePermissionsAuthenticatedResponseSchema`: `userId`, `tenantId` (nullable), `positions`, `permissionSets`, `objects` (effective object permissions), `fields` (`{ readable, editable }` per `object.field`), `systemPermissions` and `tabPermissions` (optional: absent only on the body a server without SecurityPlugin answers, where absent means unknown), and `hasAnyQueue: boolean`.
    - Both branches are strict: an undeclared key is refused, not dropped. A key the server starts sending is declared here first.
    - Types `MePermissionsResponse`, `MePermissionsAnonymousResponse`, `MePermissionsAuthenticatedResponse`.
  - **`IOwnershipQueueService.hasAnyQueue?(organizationId)`** (`@objectstack/spec/contracts`): does the organization have at least one ownership queue, `true` exactly when some name would resolve through `resolveQueue`. Optional, like `declaredQueueNamed?`, so an implementation written before it still satisfies the contract; the route answers `false` without it. `@objectstack/plugin-sharing`'s `OwnershipQueueService` implements it.
  - **`@objectstack/plugin-hono-server`** types the route's body builder against `MePermissionsAuthenticatedResponse`, and reads `hasAnyQueue` through the contract. The wire is unchanged.
  - **`@object-ui/permissions`**: `MePermissionsResponse` is now the spec's type, re-exported from `@objectstack/spec/api` (with `MePermissionsAuthenticatedResponse` beside it), in place of a hand-written interface that had drifted from the wire. The interface read a `roles` key the server never sends; the server's key is `positions`, so `usePermissions().roles` under `MePermissionsProvider` was always empty and now carries the caller's positions. A fixture typed as the response migrates `roles: [...]` → `positions: [...]` and adds `hasAnyQueue`; the anonymous body is `{ authenticated: false }` and nothing else.
- 67103cc: feat(setup): Setup's metadata pages open Studio's All metadata area, the catalog's Active switch moves to each item's page, and Studio stops linking into Setup
  
  Clause-②: no
  Metadata-protocol: none
  
  Setup no longer has a metadata editor or a metadata catalog (ADR-0146 D1). Studio's "All metadata" area serves those pages now.
  
  - **Setup's metadata URLs redirect.** Each `/apps/<app>/metadata/...` route opens the same page in Studio's "All metadata" area: the directory, `_diagnostics`, a type's list, an item, its history and its create page. The legacy aliases redirect too: `component/metadata/{directory,resource}` in the shell, and `system/objects`, `system/metadata` and `system/{roles,positions,permissions}` in the console. `?package=`, `?scope=environment` and `?review=1` carry over, and each URL lands in one hop on the leg its query names.
  - **The datasource stays in Setup.** Its routes render Setup's pages as before. It is runtime configuration, not metadata authoring, and the area sends datasource URLs back to Setup.
  - **A bookmark of the retired Setup › Packaged automation page lands in Studio.** `/apps/<app>/component/automation/packaged?package=<id>` opens that package's Automations pillar, where a packaged flow's switch and New similar are, with the query kept. With no package named, it opens the area's cross-package list of flows.
  - **The catalog entries leave Setup.** Positions, Capabilities, Permission Sets and Declared Sharing Rules leave Setup's navigation, and their labels are retired in all four locales. Home loses the "Manage Objects" quick action, and the sidebar loses its Objects entry.
  - **The Active switch moves to the item's page.** A permission set, a position or a declared sharing rule is now switched on and off on its own page in the area. It is the same switch the catalog list had: switching off asks first and names how many users lose the access, and switching on writes at once. The area's type lists keep their switch column. **An admin with `setup.access` but no `studio.access` now switches these items in Studio.** Grant `studio.access` to anyone who managed the catalog from Setup.
  - **Studio stops linking into Setup.** The landing page's environment-overlay link is gone. The read-only item link and the chat's "Review changes" now open the item in Studio's area.
- 3ff32c4: fix(plugin-sharing): a share link whose `redactFields` names a field the object does not have is refused at mint, instead of being issued with a redaction that hides nothing
  
  Clause-②: yes (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) the narrowing is a REST request refusal at the share-link mint; no metadata key, spec schema or stored row changes, so there is nothing for objectstack migrate meta to rewrite and the caller is told at the request -->
  
  **BREAKING**: `POST /api/v1/share-links` (and `ShareLinkService.createLink`) now refuses a `redactFields` entry that names no column of the object with `400 VALIDATION_FAILED`, where it used to answer `201` and mint the link. FROM a request carrying a misspelt or unknown name in `redactFields` TO the same request with the name corrected to a real field of the object, or the entry dropped.
  
  The share-link mint (`POST /api/v1/share-links`, `ShareLinkService.createLink`) stored the per-link `redactFields` list as sent. At resolve the list is applied as field names, so an entry that matched no field stripped nothing, while the resolve answer still listed it among the hidden fields and the landing page said it was hidden. A misspelt redaction therefore served the very field it was meant to keep back.
  
  - **The mint now narrows.** Every `redactFields` entry must name a column a read of the object serves: a declared field, or a platform-provisioned column (`id`, `created_at`, `updated_at`). Anything else answers `400 VALIDATION_FAILED` naming each unknown entry, and no link is minted. A `redactFields` that is not an array of strings answers the same. A request accepted on the previous release with a misspelt entry is now refused: correct the name, or drop it.
  - **Unchanged.** A valid list is stored and applied exactly as before. An omitted or empty list still means no per-link redaction. A caller with no authority over the record still gets its `403` before any name is judged. An object whose schema exposes no field map is not judged, and the list is kept as sent.
  - **Links already minted** keep the list they were stored with; nothing is migrated.
  
  `@objectstack/objectql`: the `./core` entry gains one export, `declaredColumnSet(schema)`, the column set a read serves (the field map plus the platform-provisioned columns). The mint judges `redactFields` against it, so the share-link check and the read and write doors read one list.
- 2789ba7: fix(plugins)!: a role or membership tier held by more than 10,000 members reaches every holder in sharing and approvals, and a membership read that fails is refused loudly instead of answered with an empty set
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export, type or metadata changes: two expansions read a list they already read, to completion. No author has anything to rewrite; the one new refusal is a membership read that already failed, which used to answer an empty list. -->
  
  **BREAKING** only where a `sys_member` read fails: the role expansion in sharing and the membership-tier expansion in approvals used to answer an empty list then, and now refuse.
  
  Both expansions read `sys_member` once with a 10,000-row bound and took that read as the whole holder list. They also turned any read error into `[]`.
  
  - **Every holder, nobody else.** `TeamGraphService.expandRoleUsers` (plugin-sharing: the `sys_member.role` limb of every `position` sharing recipient, and `expandPrincipal('role')`) and the approvals membership-tier expansion (an `org_membership_level` approver, and the second limb of every `position` approver) now read `sys_member` in pages of 10,000 ordered by id until the holders are exhausted. Past 10,000 holders, a sharing rule used to grant nothing to the holders past the 10,000th row, and an approval used to route without them. Both now reach every holder.
  - **Smaller roles are unchanged.** A role or tier held by fewer than 10,000 members issues one read, as before, and answers the same set.
  - **Loud, never short or empty.** A read that fails, or a page the driver returned without honouring the id cursor, now throws instead of answering `[]`.
    - Sharing: the expansion rejects, so that rule's reconcile or revoke pass fails, its callers log their existing per-rule warning, and the grants it already holds stay as they were. Before, the retired-recipient revoke compared a rule's materialised grants against that empty answer and revoked every one of them.
    - Approvals: the approver slot falls back to its literal (`position:NAME`, which whoever holds the position can still act on, or `org_membership_level:NAME`), and the warning now reads `could not be expanded — a directory or read-filter lookup failed` and carries its `error`. Before, a `position` approver routed to its assignment-table holders alone, which looked like a complete slate, and an `org_membership_level` approver logged "expanded to nobody".
  - **The per-record sharing pass now resolves per rule.** `SharingRuleService.evaluateAllForRecord` (the pass a record write runs) used to reject as a whole when any one rule threw. Now a rule whose recipients cannot be read is left out of the returned results, its existing grants stay, and it logs `[sharing-rule] record reconcile failed for rule` with the rule and the error. The record's other rules still reconcile. This matches what `evaluateAllRulesForObject` already did.
  - **A missing membership object is still no holders.** A stack that never creates or never registers `sys_member` keeps answering `[]`. That is judged by the shared missing-table predicate, or by the engine's `OBJECT_NOT_FOUND` for `sys_member`, rather than by swallowing every error.
  
  **The remedy.** None is needed. A refusal means the membership table could not be read: fix that read, and the next expansion succeeds. A failed read is never cached.
- 9bdfe37: fix(plugins)!: team and position recipients reach every holder past 10,000 rows in sharing and approvals, and a team, position or role holder read that fails is refused loudly instead of answered with nobody
  
  Clause-②: yes (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no metadata changes: the team and position expansions read lists they already read, to completion, and the holder checks refuse a read that already failed. The one new export (isObjectAbsentError in @objectstack/types) is an addition. No author has anything to rewrite. -->
  
  **BREAKING** only where a `sys_team_member`, `sys_user_position` or `sys_member` read fails: the team and position expansions and the user-scoped holder checks used to answer nobody (an empty list, or `false`) then, and now refuse.
  
  This completes the family the role and membership-tier fix started. The team and position reads still read once with a 10,000-row bound and turned any read error into nobody.
  
  - **Every holder, nobody else.** In plugin-sharing, `TeamGraphService.expandUsers` (`sys_team_member`, every `team` sharing recipient) and the assignment limb of `PositionGraphService.expandPositionUsers` (`sys_user_position`, every `position` sharing recipient) now read in pages of 10,000 ordered by id until the holders are exhausted. In plugin-approvals, the `team` approver and the assignment limb of the `position` approver (and every caller of the position expansion: escalation targets, reassign checks, `resolveAs` expressions) do the same. Past 10,000 holders, the holders past the 10,000th row used to get no grant and no approval slot. They now do.
  - **Smaller groups are unchanged.** A team or position held by fewer than 10,000 people issues one read, as before, and answers the same set.
  - **Loud, never short or empty.** A read that fails, or a page the driver returned without honouring the id cursor, now throws.
    - Sharing, whole-rule passes: the expansion rejects, so that rule's reconcile or revoke pass fails, its callers log their existing per-rule warning, and the grants it already holds stay. Before, a failed team read answered `[]`, and a failed assignment read answered the `sys_member.role` holders alone, so the retired-recipient revoke took grants away from people who still held the recipient.
    - Sharing, per-user recompute (a write to `sys_team_member` or `sys_user_position`): the holder checks `teamHasMember`, `holdsRole` and `PositionGraphService.holdsPosition` now refuse a failed read instead of answering `false`. The recompute logs `recipient membership re-evaluation failed` for that rule and user, and the user's grants stay. Before, an outage revoked that user's grants.
    - Approvals: the approver slot falls back to its literal (`team:ID` or `position:NAME`) and logs `could not be expanded — a directory or read-filter lookup failed` with its `error`. Before, a failed team read logged "expanded to nobody", and a failed assignment read routed a `position` approver to its membership-tier holders alone, which looked like a complete slate.
  - **Ownership queues: a position specification now contributes nobody on a `sys_user_position` outage.** A queue team specification whose `sys_team_member` read fails still contributes nobody, as before. A queue position specification whose `sys_user_position` read fails now contributes nobody too, on the expansion and on the queue's holder check alike, where before it contributed that position's `sys_member.role` transition-source holders. That is the posture the queue declares for a failed member-table read, reached here for the first time. Both now log once. Whether a queue should refuse instead is left to a ruling.
  - **A missing object is still no holders.** A stack that never registers, or never creates, `sys_team_member`, `sys_user_position` or `sys_member` keeps answering no holders through it. That is judged by the new `isObjectAbsentError(error, readObject)` in `@objectstack/types`: the shared missing-table predicate for that object, or the engine's `OBJECT_NOT_FOUND` naming that object. Any other error, including an absence of a different object, stays loud.
  
  **The remedy.** None is needed. A refusal means the membership table could not be read: fix that read, and the next expansion succeeds. A failed read is never cached.
- e0187d0: fix(plugins)!: business-unit recipients and approvers reach every member past 10,000 rows, a failed business-unit member read is refused loudly instead of answered with nobody, and a failed `resolveAs` expansion says so
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no metadata changes: the business-unit expansions and the primary-business-unit backfill read lists they already read, to completion, and refuse a read that already failed. No author has anything to rewrite. -->
  
  **BREAKING** only where a `sys_business_unit_member` read fails: the business-unit expansions used to answer nobody (an empty list) then, and now refuse.
  
  This extends the family the team, position and role fixes closed to the last membership object, `sys_business_unit_member`. Its reads still read once with a 10,000-row bound and turned any read error into nobody.
  
  - **Every member, nobody else.** In plugin-sharing, `BusinessUnitGraphService.expandUnitMembers` (every `business_unit` sharing recipient) and `BusinessUnitGraphService.expandUsers` (every `unit_and_subordinates` recipient) now read in pages of 10,000 ordered by id until the members are exhausted. In plugin-approvals, the `department` / `business_unit` / `bu` approver and an `expression` approver with `resolveAs: 'department'` do the same. Past 10,000 members, the members past the 10,000th row used to get no grant and no approval slot. They now do.
  - **The primary-business-unit backfill projects every primary membership.** The boot backfill of `sys_user.primary_business_unit_id` used to scan the `is_primary` rows once at the same bound, so users past the 10,000th row were never projected and nothing said so. It now pages to completion. A scan that fails, or a page the driver returned without honouring the id cursor, writes nothing and logs why (a failed scan logged before too, now with the consequence).
  - **Smaller units are unchanged.** A unit or subtree with fewer than 10,000 members issues one read, as before, and answers the same set.
  - **Loud, never short or empty.** A member read that fails, or a page the driver returned without honouring the id cursor, now throws.
    - Sharing, whole-rule passes: the expansion rejects, so that rule's reconcile or revoke pass fails, its callers log their existing per-rule warning, and the grants it already holds stay. Before, a failed read answered `[]`, so the retired-recipient revoke a business-unit graph write triggers took the rule's grants away from every member.
    - Approvals: the approver slot falls back to its literal (`department:ID`) and logs `could not be expanded — a directory or read-filter lookup failed` with its `error`. Before, a failed read logged "expanded to nobody", indistinguishable from an unstaffed unit.
    - Ownership queues: a `business_unit` or `unit_and_subordinates` queue specification whose member read fails still contributes nobody, the posture the queue declares for a failed member-table read, and now logs it once.
  - **A failed `resolveAs` expansion says so.** An `expression` approver whose `resolveAs` value could not be expanded (a `department`, `position` or `team` read failed) kept its `KIND:VALUE` literal slot with no log line. It now logs the same `could not be expanded` warning the static approver types log, with the `error` and the `expression` source.
  - **A missing object is still no members.** A stack that never registers, or never creates, `sys_business_unit_member` keeps answering no members through it, and the backfill has nothing to project. That is judged by `isObjectAbsentError(error, 'sys_business_unit_member')`; any other error stays loud.
  
  **The remedy.** None is needed. A refusal means the membership table could not be read: fix that read, and the next expansion succeeds. A failed read is never cached.
- 4898162: fix(plugins)!: a failed `sys_business_unit` read refuses instead of answering nobody, and a business unit with more than 1,000 child units keeps every child
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no metadata changes: the business-unit expansions read the unit rows they already read, to completion, and refuse a read that already failed. No author has anything to rewrite. -->
  
  **BREAKING** only where a `sys_business_unit` read fails: the business-unit expansions used to answer nobody (an empty list) then, and now refuse.
  
  The member reads of a business unit (`sys_business_unit_member`) read to completion and refuse on failure. The reads of the unit table they are keyed by did not: the check that the unit exists and is active, and the read of each unit's child units, still turned any read error into nobody, and the child-unit read stopped at 1,000 rows.
  
  - **A failed unit read refuses.** In plugin-sharing, `BusinessUnitGraphService.descendants`, `expandUnitMembers` (every `business_unit` sharing recipient) and `expandUsers` (every `unit_and_subordinates` recipient) now throw when the unit's own row or a child-unit read fails. In plugin-approvals, the `department` / `business_unit` / `bu` approver and an `expression` approver with `resolveAs: 'department'` do the same.
    - Sharing: the expansion rejects, so that rule's reconcile or revoke pass fails, its callers log their existing per-rule warning, and the grants it already holds stay. Before, a failed unit read answered `[]` and that answer was kept for the rest of the pass, so the recompute a business-unit graph write triggers revoked every grant the rule gave.
    - Approvals: the approver slot falls back to its literal (`department:ID`) and logs `could not be expanded — a directory or read-filter lookup failed` with its `error`. Before, a failed seed read logged "expanded to nobody", and a failed child-unit read routed to the units that did read, with no signal.
    - Ownership queues: a `business_unit` or `unit_and_subordinates` queue specification whose unit read fails contributes nobody, the posture the queue declares for a failed expansion, and logs it once.
  - **Nothing is cached after a failed read.** The next expansion on the same pass reads again.
  - **Every child unit.** The child units of each unit are read in pages of 1,000 ordered by id until they are exhausted. A unit with more than 1,000 active child units used to lose the children past the 1,000th row, with all their members and descendants. A unit with fewer issues one read, as before.
  - **A missing object is still nobody.** A stack that never registers, or never creates, `sys_business_unit` keeps answering no members. That is judged by `isObjectAbsentError(error, 'sys_business_unit')`; any other error stays loud.
  
  **The remedy.** None is needed. A refusal means the business-unit table could not be read: fix that read, and the next expansion succeeds.
- a565019: fix(plugin-sharing)!: a failed business-unit head or standalone manager read refuses instead of answering no head or no manager
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no metadata changes: the two lookups read the rows they already read, and refuse a read that already failed. No author has anything to rewrite. -->
  
  **BREAKING** only where the read fails: `BusinessUnitGraphService.headOf` and the standalone `BusinessUnitGraphService.managerOf` used to answer `null` then, and now refuse.
  
  The member, seed and descent reads of `BusinessUnitGraphService` already refuse on a failed read. Two sibling lookups on the same service did not.
  
  - **`headOf(businessUnitId)`.** A failed `sys_business_unit` read now throws. Before, it answered `null` (no head) and kept that answer for the rest of the pass, so the head stayed missing after the read recovered. Nothing is cached after a failed read now: the next call reads again.
  - **`managerOf(userId, organizationId)` without a `TeamGraphService`.** A failed `sys_user` read now throws. Before, it answered `null` (no manager). This fallback caches nothing, before or after. The organization screen keeps its fail-open posture, and a service built with a `teamGraph` still answers exactly what `TeamGraphService.managerOf` answers.
  - **A missing object is still nobody.** A stack that never registers, or never creates, `sys_business_unit` or `sys_user` keeps answering `null`. That is judged by `isObjectAbsentError`; any other error stays loud.
  - **No caller on this release changes behaviour.** No sharing rule, approval or ownership queue on this release calls either lookup. A caller of the exported class sees the refusal instead of `null`.
  
  **The remedy.** None is needed. A refusal means the business-unit or user table could not be read: fix that read, and the next lookup succeeds.
- bbb98c4: fix(plugin-sharing)!: a failed team-graph manager read refuses instead of answering no manager
  
  Clause-②: no (narrowing)
  Metadata-protocol: none
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no metadata changes: the lookup reads the row it already read, and refuses a read that already failed. The spec change is interface documentation only. No author has anything to rewrite. -->
  
  **BREAKING** only where the read fails: `TeamGraphService.managerOf` used to answer `null` then, and now refuses.
  
  The holder reads of `TeamGraphService`, and the head and standalone manager lookups of `BusinessUnitGraphService`, already refuse on a failed read. This was the last lookup of that family that did not.
  
  - **`TeamGraphService.managerOf(userId, organizationId)`.** A failed `sys_user` read now throws. Before, it answered `null` (no manager) and kept that answer for the rest of the pass, so the manager stayed missing after the read recovered. Nothing is cached after a failed read now: the next call reads again.
  - **Who sees it.** The `manager` arm of the exported `expandPrincipal`, and `BusinessUnitGraphService.managerOf` when it is built with a `teamGraph`, pass the refusal through instead of answering no manager.
  - **A missing object is still nobody.** A stack that never registers, or never creates, `sys_user` keeps answering `null`. That is judged by `isObjectAbsentError`; any other error stays loud.
  - **The organization screen is unchanged.** When `sys_member` cannot be read, the manager is still kept, as before.
  - **The refusal names a lookup.** A failed head or manager lookup now says it is a lookup of one person, not a holder set or an expansion.
  - **The contract says so.** The documentation of `ITeamGraphService.managerOf` and `IBusinessUnitGraphService.headOf` in `@objectstack/spec` now reads "refuses (throws) on a failed read; `null` when none" instead of "best-effort". No key or type changes.
  - **No caller on this release changes behaviour.** No sharing rule, approval or ownership queue on this release calls `managerOf` or `expandPrincipal`. A caller of the exported class or function sees the refusal instead of `null`.
  
  **The remedy.** None is needed. A refusal means the user table could not be read: fix that read, and the next lookup succeeds.
- Updated dependencies [ce12ad2]
- Updated dependencies [ea025d3]
- Updated dependencies [af1e1e0]
- Updated dependencies [2f21b48]
- Updated dependencies [0ea90c7]
- Updated dependencies [dbf7e04]
- Updated dependencies [a9f654e]
- Updated dependencies [b49b752]
- Updated dependencies [d8a9cc5]
- Updated dependencies [b53d9f3]
- Updated dependencies [8eeb3b3]
- Updated dependencies [4f05de4]
- Updated dependencies [95f818d]
- Updated dependencies [b3f7344]
- Updated dependencies [d90657b]
- Updated dependencies [ff26bc4]
- Updated dependencies [21a13f1]
- Updated dependencies [c68869c]
- Updated dependencies [162f668]
- Updated dependencies [43714ca]
- Updated dependencies [63e3873]
- Updated dependencies [9bf6598]
- Updated dependencies [a98693d]
- Updated dependencies [7dd5a2f]
- Updated dependencies [d9bf777]
- Updated dependencies [804a2b0]
- Updated dependencies [bb91ae8]
- Updated dependencies [d434481]
- Updated dependencies [f9f27a0]
- Updated dependencies [02b1392]
- Updated dependencies [c26d643]
- Updated dependencies [416a760]
- Updated dependencies [76a1275]
- Updated dependencies [13e85be]
- Updated dependencies [13dc413]
- Updated dependencies [eab4bba]
- Updated dependencies [e438a55]
- Updated dependencies [2205863]
- Updated dependencies [2205863]
- Updated dependencies [dabe771]
- Updated dependencies [9fab076]
- Updated dependencies [1f1eda4]
- Updated dependencies [74801d1]
- Updated dependencies [74801d1]
- Updated dependencies [17b5152]
- Updated dependencies [ef7067f]
- Updated dependencies [031d97a]
- Updated dependencies [0c47e87]
- Updated dependencies [e01edb2]
- Updated dependencies [da46b2a]
- Updated dependencies [f79fa74]
- Updated dependencies [b358e79]
- Updated dependencies [5374967]
- Updated dependencies [8a218fc]
- Updated dependencies [31a6ca7]
- Updated dependencies [1539aad]
- Updated dependencies [cdd9f0a]
- Updated dependencies [3fe9d25]
- Updated dependencies [2ecf6a7]
- Updated dependencies [fbe344b]
- Updated dependencies [354dfcd]
- Updated dependencies [d887aa9]
- Updated dependencies [39fd5fb]
- Updated dependencies [5aad4e0]
- Updated dependencies [b2b3124]
- Updated dependencies [5bd3d2f]
- Updated dependencies [81b4599]
- Updated dependencies [c13ef04]
- Updated dependencies [6eaf404]
- Updated dependencies [c13ef04]
- Updated dependencies [79ed6f7]
- Updated dependencies [40320f1]
- Updated dependencies [40320f1]
- Updated dependencies [0eb2d21]
- Updated dependencies [49d652e]
- Updated dependencies [c13ef04]
- Updated dependencies [685d9f3]
- Updated dependencies [0fb0dda]
- Updated dependencies [693a729]
- Updated dependencies [9fa70b4]
- Updated dependencies [e3470ed]
- Updated dependencies [9ac5ae5]
- Updated dependencies [c082af6]
- Updated dependencies [6dbff8e]
- Updated dependencies [c63ce2a]
- Updated dependencies [12b5aec]
- Updated dependencies [8b1740a]
- Updated dependencies [b88519e]
- Updated dependencies [e5b5c5b]
- Updated dependencies [d4ff1a0]
- Updated dependencies [10f27b6]
- Updated dependencies [10f27b6]
- Updated dependencies [fe9e856]
- Updated dependencies [d4ff1a0]
- Updated dependencies [ae16687]
- Updated dependencies [efdf11a]
- Updated dependencies [2655ebd]
- Updated dependencies [14e9685]
- Updated dependencies [0cd578f]
- Updated dependencies [a33fce2]
- Updated dependencies [ee9a8d6]
- Updated dependencies [385aa12]
- Updated dependencies [79d5dac]
- Updated dependencies [8bb2c31]
- Updated dependencies [8d79bbd]
- Updated dependencies [b8f4acc]
- Updated dependencies [4145210]
- Updated dependencies [194e66c]
- Updated dependencies [57c51aa]
- Updated dependencies [3604371]
- Updated dependencies [1ed3360]
- Updated dependencies [a8ec04d]
- Updated dependencies [73b7270]
- Updated dependencies [6762dd9]
- Updated dependencies [6762dd9]
- Updated dependencies [556f323]
- Updated dependencies [b445807]
- Updated dependencies [b445807]
- Updated dependencies [6abcb72]
- Updated dependencies [7735d1d]
- Updated dependencies [0c8c27e]
- Updated dependencies [7739573]
- Updated dependencies [99aeee6]
- Updated dependencies [bc4c963]
- Updated dependencies [86edcaf]
- Updated dependencies [ad3a640]
- Updated dependencies [8d66cbe]
- Updated dependencies [fbaacfe]
- Updated dependencies [dbf576b]
- Updated dependencies [a1d8bf6]
- Updated dependencies [4fa4f2c]
- Updated dependencies [76b4ae4]
- Updated dependencies [0368504]
- Updated dependencies [6663a66]
- Updated dependencies [ca64f6f]
- Updated dependencies [fbb8bec]
- Updated dependencies [f557d90]
- Updated dependencies [b8b3208]
- Updated dependencies [aad9ad5]
- Updated dependencies [e29a1b1]
- Updated dependencies [72c0152]
- Updated dependencies [e0aed00]
- Updated dependencies [f40b777]
- Updated dependencies [72b08ee]
- Updated dependencies [bf658d1]
- Updated dependencies [3702be4]
- Updated dependencies [4a5396b]
- Updated dependencies [a3d24c9]
- Updated dependencies [a7de844]
- Updated dependencies [ecd944f]
- Updated dependencies [9d29223]
- Updated dependencies [7538f27]
- Updated dependencies [21c4bdd]
- Updated dependencies [2c683cf]
- Updated dependencies [86c9d53]
- Updated dependencies [bfdaba4]
- Updated dependencies [8441a01]
- Updated dependencies [db44327]
- Updated dependencies [0027c4a]
- Updated dependencies [684f2f6]
- Updated dependencies [869fa76]
- Updated dependencies [2fc3861]
- Updated dependencies [74aae1e]
- Updated dependencies [2b4b970]
- Updated dependencies [e063a87]
- Updated dependencies [03cc871]
- Updated dependencies [7811c3f]
- Updated dependencies [755e285]
- Updated dependencies [07585bf]
- Updated dependencies [6a648ac]
- Updated dependencies [9cbe507]
- Updated dependencies [2695de7]
- Updated dependencies [0a4b0fb]
- Updated dependencies [b373263]
- Updated dependencies [d8de26d]
- Updated dependencies [d3b0a40]
- Updated dependencies [ed8b237]
- Updated dependencies [a68430a]
- Updated dependencies [6da8c3c]
- Updated dependencies [1ea3fe9]
- Updated dependencies [3e0fd7a]
- Updated dependencies [3e0fd7a]
- Updated dependencies [f552fa8]
- Updated dependencies [8cb8c7f]
- Updated dependencies [0bf7aaf]
- Updated dependencies [8ec00cf]
- Updated dependencies [5954705]
- Updated dependencies [dc4755c]
- Updated dependencies [0a52b7d]
- Updated dependencies [4793aa4]
- Updated dependencies [119931d]
- Updated dependencies [f3d2845]
- Updated dependencies [c946cb9]
- Updated dependencies [3a054cb]
- Updated dependencies [f934a41]
- Updated dependencies [00c9a0b]
- Updated dependencies [0c64014]
- Updated dependencies [a7bdac4]
- Updated dependencies [c3842ac]
- Updated dependencies [916531a]
- Updated dependencies [d85ff19]
- Updated dependencies [7e3822c]
- Updated dependencies [50015d8]
- Updated dependencies [645534d]
- Updated dependencies [3cc45cc]
- Updated dependencies [3a2f4c0]
- Updated dependencies [5b7dbb8]
- Updated dependencies [8d36669]
- Updated dependencies [e26cf9a]
- Updated dependencies [6e0b16a]
- Updated dependencies [7c3cc88]
- Updated dependencies [9b1dc99]
- Updated dependencies [f3fe660]
- Updated dependencies [3739d8d]
- Updated dependencies [f4a8eed]
- Updated dependencies [8f36f6b]
- Updated dependencies [80a9f99]
- Updated dependencies [5f31470]
- Updated dependencies [11a7f96]
- Updated dependencies [ae64120]
- Updated dependencies [139bc18]
- Updated dependencies [b357250]
- Updated dependencies [75c2658]
- Updated dependencies [35f2055]
- Updated dependencies [fb4e0bb]
- Updated dependencies [f9a1363]
- Updated dependencies [7d846b5]
- Updated dependencies [fc5d509]
- Updated dependencies [71de060]
- Updated dependencies [1e01924]
- Updated dependencies [2c0a97b]
- Updated dependencies [7abe151]
- Updated dependencies [6fd87b7]
- Updated dependencies [d359857]
- Updated dependencies [2db3281]
- Updated dependencies [3238750]
- Updated dependencies [f23e051]
- Updated dependencies [bed8306]
- Updated dependencies [35ffb77]
- Updated dependencies [04c8930]
- Updated dependencies [001c04b]
- Updated dependencies [8ce974c]
- Updated dependencies [2d3aa8c]
- Updated dependencies [85a1b9d]
- Updated dependencies [361ea24]
- Updated dependencies [ea1751b]
- Updated dependencies [3fd4d6b]
- Updated dependencies [a00f335]
- Updated dependencies [700ec85]
- Updated dependencies [1c61f48]
- Updated dependencies [8bceb6a]
- Updated dependencies [8771726]
- Updated dependencies [ef0f6a1]
- Updated dependencies [9eaa209]
- Updated dependencies [e2d0dab]
- Updated dependencies [9b4d193]
- Updated dependencies [aa46d14]
- Updated dependencies [ba0084e]
- Updated dependencies [462935d]
- Updated dependencies [0ecc2c4]
- Updated dependencies [1e346e9]
- Updated dependencies [d6e0967]
- Updated dependencies [519089e]
- Updated dependencies [16e7a80]
- Updated dependencies [044d201]
- Updated dependencies [12333ba]
- Updated dependencies [e7a6cc7]
- Updated dependencies [4d278c9]
- Updated dependencies [76bf6c5]
- Updated dependencies [1a95c74]
- Updated dependencies [d2c4874]
- Updated dependencies [0c03ce2]
- Updated dependencies [5114b0e]
- Updated dependencies [e62dcc5]
- Updated dependencies [0c1829a]
- Updated dependencies [bc02a77]
- Updated dependencies [0aaad18]
- Updated dependencies [67103cc]
- Updated dependencies [36fa4ff]
- Updated dependencies [c594e1c]
- Updated dependencies [e170d42]
- Updated dependencies [e170d42]
- Updated dependencies [f5a400a]
- Updated dependencies [7b293c4]
- Updated dependencies [3fb74b6]
- Updated dependencies [86fb645]
- Updated dependencies [c16040d]
- Updated dependencies [1617b7f]
- Updated dependencies [b399cb8]
- Updated dependencies [a9782b3]
- Updated dependencies [a96bf3c]
- Updated dependencies [899782b]
- Updated dependencies [2587485]
- Updated dependencies [60d8522]
- Updated dependencies [8196881]
- Updated dependencies [8d208a4]
- Updated dependencies [5493b88]
- Updated dependencies [663b7c0]
- Updated dependencies [c708de6]
- Updated dependencies [50df124]
- Updated dependencies [3cb8553]
- Updated dependencies [70943dd]
- Updated dependencies [92b7bbd]
- Updated dependencies [2081a5e]
- Updated dependencies [892eb66]
- Updated dependencies [2cba2eb]
- Updated dependencies [4a49ad7]
- Updated dependencies [bf03ebb]
- Updated dependencies [2c3574c]
- Updated dependencies [581d294]
- Updated dependencies [1335c6b]
- Updated dependencies [bdb19ca]
- Updated dependencies [5e1b9b0]
- Updated dependencies [d8c611d]
- Updated dependencies [ec0316e]
- Updated dependencies [8bb2417]
- Updated dependencies [2ac698b]
- Updated dependencies [62b3ec3]
- Updated dependencies [d0df873]
- Updated dependencies [462b4f9]
- Updated dependencies [9a0c622]
- Updated dependencies [138dacf]
- Updated dependencies [7f4258f]
- Updated dependencies [1ac1c24]
- Updated dependencies [97ca257]
- Updated dependencies [104cd1a]
- Updated dependencies [f1d795b]
- Updated dependencies [b3d1415]
- Updated dependencies [078e581]
- Updated dependencies [18e4ac1]
- Updated dependencies [51058ef]
- Updated dependencies [4df6292]
- Updated dependencies [f125ce4]
- Updated dependencies [b16ee8b]
- Updated dependencies [86d0a8c]
- Updated dependencies [d089dac]
- Updated dependencies [3557366]
- Updated dependencies [29c70ca]
- Updated dependencies [b5e7ba5]
- Updated dependencies [38a278b]
- Updated dependencies [5f7d554]
- Updated dependencies [6a940d1]
- Updated dependencies [bb82da1]
- Updated dependencies [85ea12f]
- Updated dependencies [85f7a0d]
- Updated dependencies [344a16d]
- Updated dependencies [e9fb529]
- Updated dependencies [7b55ea9]
- Updated dependencies [4138ce8]
- Updated dependencies [3ff32c4]
- Updated dependencies [391216f]
- Updated dependencies [53dda03]
- Updated dependencies [ba1f164]
- Updated dependencies [20f052d]
- Updated dependencies [ac4715a]
- Updated dependencies [9467a1b]
- Updated dependencies [9e6df40]
- Updated dependencies [8b65633]
- Updated dependencies [c268b72]
- Updated dependencies [04e0c2c]
- Updated dependencies [e832ddb]
- Updated dependencies [d68d129]
- Updated dependencies [fe5ed7c]
- Updated dependencies [bd68248]
- Updated dependencies [f72bc9e]
- Updated dependencies [a20dcae]
- Updated dependencies [3291213]
- Updated dependencies [5d46f43]
- Updated dependencies [c9aaee9]
- Updated dependencies [3d6f230]
- Updated dependencies [7eb0b19]
- Updated dependencies [8e6ab05]
- Updated dependencies [e756782]
- Updated dependencies [8209a2f]
- Updated dependencies [aee9c47]
- Updated dependencies [0e75081]
- Updated dependencies [45b4922]
- Updated dependencies [399df5b]
- Updated dependencies [31204d1]
- Updated dependencies [2c881fb]
- Updated dependencies [1bdf674]
- Updated dependencies [03797bd]
- Updated dependencies [4b8cbe2]
- Updated dependencies [de708b3]
- Updated dependencies [5f99582]
- Updated dependencies [63f962f]
- Updated dependencies [df8d020]
- Updated dependencies [f966f01]
- Updated dependencies [6f09464]
- Updated dependencies [772b356]
- Updated dependencies [4008e62]
- Updated dependencies [b64bb72]
- Updated dependencies [b861525]
- Updated dependencies [6903c93]
- Updated dependencies [4b06a54]
- Updated dependencies [ebbb5b8]
- Updated dependencies [9bdfe37]
- Updated dependencies [a81b7cb]
- Updated dependencies [eeb3117]
- Updated dependencies [c9c6828]
- Updated dependencies [dbe2a93]
- Updated dependencies [a5fcd06]
- Updated dependencies [56076fd]
- Updated dependencies [fdb9a07]
- Updated dependencies [57958aa]
- Updated dependencies [b391feb]
- Updated dependencies [59775a0]
- Updated dependencies [744211f]
- Updated dependencies [87956dc]
- Updated dependencies [3482f3d]
- Updated dependencies [a6a369e]
- Updated dependencies [601832b]
- Updated dependencies [5c4e752]
- Updated dependencies [85ea224]
- Updated dependencies [4ab2e7e]
- Updated dependencies [589049b]
- Updated dependencies [d0f308c]
- Updated dependencies [4dc41e6]
- Updated dependencies [eb05ea2]
- Updated dependencies [55a4898]
- Updated dependencies [f87239a]
- Updated dependencies [2ae8c89]
- Updated dependencies [a4daa85]
- Updated dependencies [b64980a]
- Updated dependencies [bbb98c4]
- Updated dependencies [1bb9536]
- Updated dependencies [2bf71ce]
- Updated dependencies [c1af99c]
- Updated dependencies [5afe7d7]
- Updated dependencies [6f35b74]
- Updated dependencies [99a6a78]
- Updated dependencies [1a8ba3f]
- Updated dependencies [1a8ba3f]
- Updated dependencies [3ac22c9]
- Updated dependencies [ceef714]
- Updated dependencies [54c2496]
- Updated dependencies [b388cfe]
- Updated dependencies [04b1402]
- Updated dependencies [672bda0]
- Updated dependencies [3e54f99]
- Updated dependencies [710c2da]
- Updated dependencies [5d759b1]
- Updated dependencies [e2772b4]
- Updated dependencies [cfd237f]
- Updated dependencies [ac9c2f0]
  - @objectstack/platform-objects@18.3.0
  - @objectstack/spec@18.3.0
  - @objectstack/objectql@18.3.0
  - @objectstack/core@18.3.0
  - @objectstack/metadata-core@18.3.0
  - @objectstack/formula@18.3.0
  - @objectstack/types@18.3.0

## 18.2.0

### Patch Changes

- 8654435: docs: the sharing-rule pass note and the `ISharingService.grant` contract say what a share on a public object does
  
  Clause-②: no
  Metadata-protocol: none
  
  A follow-up to the external-share change. The one-line `note` a sharing-rule pass carries when it skips recipients on a public object now also covers a record whose organization could not be resolved, which admits no recipient. The `ISharingService.grant` docblock no longer says a share on a public object enforces nothing: it is admitted for an `external` member of the record's organization.
- 8061f33: chore(packages): publishing metadata — per-format types in `exports`, declared `sideEffects`, and a README for the 18 published packages without one
  
  Clause-②: no
  Metadata-protocol: none
  
  Measured on a fresh `origin/main` build of all 73 published packages outside `ui/`, each staged as `npm pack` would ship it, with publint 0.3.25 and @arethetypeswrong/cli 0.18.5. Before: 73 of 73 packages carried at least one publint message and 48 carried an attw problem. After: 3 packages carry a publint message and 16 carry an attw problem, each remaining class needing a change this one deliberately does not make — an export-map shape change, or a dual-build fix in `@objectstack/core`.
  
  - **Types per module format.** On 38 manifests one `types` entry served both formats, so a TypeScript consumer importing the ESM build was handed the CJS declarations — every one of attw's 38 `FalseCJS`. Each `{types, import, require}` entry becomes `{import: {types, default}, require: {types, default}}` pointing at the declaration file the same tsup run already emits for that format. No subpath is added or removed, and no JavaScript target moves. `@objectstack/core` keeps its single `types` entry: its `.d.ts` and `.d.cts` declare the same classes with private members, so serving them per format gives a consumer that reaches `core` through both resolution modes two incompatible `ObjectKernel` types, which is `@objectstack/plugin-dev`'s declaration build (it awaits `import('@objectstack/objectql')` inside a CommonJS build). Its `FalseESM` therefore stays, measured and unfixed here.
  - **`sideEffects` on the 72 manifests that declared none**, read per package rather than set in bulk: `@objectstack/service-cluster-redis` registers its `redis` cluster driver at module load and `create-objectstack`'s bin reaches its program through a bare import, so both declare their entry files side-effectful; everything else is `false`.
  - **`publishConfig: { access: 'public' }`** on the 17 that had none, the value the other 56 already declare.
  - **`type`** on the 39 that shipped `.js` without declaring a format — every `.js` under their `dist/` was read first and is CommonJS, which is what the absent field already meant — **`engines.node >= 22.0.0`** on the 22 that had no `engines`, and **`repository.url`** as the full `git+https://` git URL on 71.
  - **A README for 18 published packages that had none**: one paragraph, the first import a reader writes, and a link to the package's docs page. They are the pages npm renders, and for these 18 npm rendered nothing.
- b7b04e5: fix(plugin-approvals,plugin-sharing): the approver a pending step waits on can read the record the request is about
  
  Clause-②: no
  Metadata-protocol: none
  
  An approver was asked to decide on a record they could not open. Unless the app happened to grant them read of that exact row, the request page showed only the snapshot and the record card read "unable to open this record", so a contract was approved without its document being read.
  
  - **Who reads.** While an approval request is pending, each person on its current step's slate (a slot naming their user id, or the email their own account carries) and the override holder (the administrator who may decide any pending request of their organization) may READ the one record the request is about. A slot left as a `position:` or `team:` literal names no person and grants no read.
  - **How far.** Read only: the write gates never read this grant, so the approver still cannot edit or delete the record. Only the record itself, as a reader of it reads it: attachments follow the record read, as they do for any reader. Only while the step is pending: a decision that resolves the step, or advances the request to its next step, ends the grant at the next read. Never across organizations, the platform administrator's override included. An on-behalf-of (agent) principal gets no approval grant.
  - **Where it is decided.** `@objectstack/plugin-approvals` derives the records from the slate it already resolves (`ApprovalService.pendingApproverReadGrants`, one indexed read of the pending-approver index per request context, plus one request read per object, memoized per request and retired by any write). `@objectstack/plugin-sharing` ORs those record ids into its read filter beside the caller's record shares, so every read door that composes the sharing filter serves them; it grants nothing when the approvals service is absent or its read fails.
  - **Explain.** `@objectstack/plugin-security`'s access explanation names the grant on the sharing layer as a read share "via approval request N".
  
  The grant is the row-level reach of a read share; the approver still needs read on the object itself. Nothing is declared: no metadata key, no app setting.
  
  What to do: nothing. An app that wrote sharing rules mirroring its approval routing only so approvers could open the record may drop them.
- Updated dependencies [733b3c8]
- Updated dependencies [48e84a9]
- Updated dependencies [384bb7b]
- Updated dependencies [fc4ac58]
- Updated dependencies [fc4ac58]
- Updated dependencies [a0fac02]
- Updated dependencies [a0fac02]
- Updated dependencies [ab0bc89]
- Updated dependencies [42d9fe8]
- Updated dependencies [2af790f]
- Updated dependencies [cc10e74]
- Updated dependencies [8654435]
- Updated dependencies [65145d3]
- Updated dependencies [888d686]
- Updated dependencies [f6ba134]
- Updated dependencies [b77bb37]
- Updated dependencies [f1ddace]
- Updated dependencies [9993165]
- Updated dependencies [557973d]
- Updated dependencies [49653f9]
- Updated dependencies [6021b5e]
- Updated dependencies [6444288]
- Updated dependencies [7cd2ebf]
- Updated dependencies [4bcc4df]
- Updated dependencies [e44a1ff]
- Updated dependencies [47af3dd]
- Updated dependencies [073f08b]
- Updated dependencies [6a6ebff]
- Updated dependencies [07586f5]
- Updated dependencies [5874d25]
- Updated dependencies [fa44dd2]
- Updated dependencies [0c81694]
- Updated dependencies [4034f47]
- Updated dependencies [52f3f51]
- Updated dependencies [d727348]
- Updated dependencies [a4eae06]
- Updated dependencies [5e113b3]
- Updated dependencies [493a6c4]
- Updated dependencies [d65cbb6]
- Updated dependencies [f00e8d5]
- Updated dependencies [d1663ba]
- Updated dependencies [2163e80]
- Updated dependencies [b00fc55]
- Updated dependencies [dd5e355]
- Updated dependencies [e2a4b6a]
- Updated dependencies [be78977]
- Updated dependencies [3446d43]
- Updated dependencies [436d284]
- Updated dependencies [dc71845]
- Updated dependencies [6d9d3ef]
- Updated dependencies [be531f6]
- Updated dependencies [f0b33ee]
- Updated dependencies [7a04ba2]
- Updated dependencies [9ca36b1]
- Updated dependencies [39a78b1]
- Updated dependencies [c8cb510]
- Updated dependencies [db5fca7]
- Updated dependencies [9494dd8]
- Updated dependencies [1af2cea]
- Updated dependencies [8061f33]
- Updated dependencies [617f27e]
- Updated dependencies [b029c90]
- Updated dependencies [495fa07]
- Updated dependencies [876aa27]
- Updated dependencies [40f5c6e]
- Updated dependencies [3b480e0]
- Updated dependencies [af13616]
- Updated dependencies [14b5597]
- Updated dependencies [4548ba3]
- Updated dependencies [6a2866a]
- Updated dependencies [3a2d38c]
- Updated dependencies [1f40201]
- Updated dependencies [17f8217]
- Updated dependencies [5e7cf63]
- Updated dependencies [6e47e16]
  - @objectstack/core@18.2.0
  - @objectstack/objectql@18.2.0
  - @objectstack/types@18.2.0
  - @objectstack/spec@18.2.0
  - @objectstack/platform-objects@18.2.0
  - @objectstack/metadata-core@18.2.0
  - @objectstack/formula@18.2.0

## 18.1.0

### Minor Changes

- 7cacad5: **Shipped in 18.0.0**, whose CHANGELOG missed this entry; listed here one release late.
  
  feat(plugin-sharing,plugin-approvals,metadata-protocol)!: the organization-less readers of sharing rules, approval units and the seed loader retire (ADR-0131 D2/D8, 18.x step 7)
  
  Clause-②: yes (narrowing): a declared sharing rule served under `single` gains the `deploymentWide: true` key on the wire in place of `organization_id: null` (widening); the sharing-rule admin reads, the approval unit screen and the scoped seed pre-load stop reading rows with no organization (narrowing). A declared rule keeps applying deployment-wide; nothing an author declares is refused.
  
  <!-- adr-0087: not-required (no-migration-prescription) No key of any metadata schema is removed, renamed or re-shaped, so there is nothing for `objectstack migrate meta` to rewrite and no tombstone. The data migration a database with organization-less rows needs is the operator's ceremony, `os migrate organization-ownership`, stated below; the 18.x boot refusal already names it. The one wire change is a declared sharing rule's response row (`deploymentWide: true` in place of `organization_id: null`), not an authorable key. -->
  
  **BREAKING** — readers narrow. On a certified database (every 18.x database: a fresh install, or one the organization-ownership ceremony upgraded) none of these readers has a row left to find; they matter only to a database that still holds organization-less rows, which 18.x refuses at boot.
  
  - **A declared sharing rule is deployment-wide by a typed marker, never a NULL organization.** Under `single` it is served as one projection carrying `deploymentWide: true` and no `organization_id` key (was `organization_id: null`); its criteria sweep carries no tenant (the predicate ADR-0131 D8 computes under `single` is none) and each grant is stamped with its record's organization. Under `group` / `isolated` it is served once per organization, exactly as before. FROM `rule.organization_id === null` TO `rule.deploymentWide === true` for any client that told a declared rule apart by its NULL organization (`GET /api/v1/sharing/rules`, `GET /api/v1/sharing/rules/:idOrName`).
  - **The contract names the marker.** `SharingRuleRow` (`@objectstack/spec/contracts`) declares `deploymentWide?: true`, documented: set only on a declared rule's `single` projection, which carries no `organization_id`.
  - **A stored sharing rule with no organization sweeps nothing and grants nothing** where the deployment registers the organization object, reported once at `error` with the remedy (run the organization-ownership ceremony, or re-author the rule in its organization). A lean embedding with no organization object keeps sweeping the deployment: it has no organization to scope by.
  - **Sharing-rule administration reads the caller's own organization only.** `listRules`, `getRule` (by id and by name), `evaluateRule` and `deleteRule` no longer reach an `organization_id = null` row for an organization-bound admin; system contexts and platform operators keep the unfiltered read. Deleting a "platform-global" rule no longer needs platform authority, because that rule class no longer exists: the guard is removed.
  - **The approval unit screen is a strict equality.** A `department` approver resolves a `sys_business_unit` in the request's organization only (was: that organization or no organization). The ceremony attributes `sys_business_unit`, and a fresh install stamps it.
  - **The scoped seed pre-load reads one thing: its organization's rows.** The second read that collected keys held by organization-less rows, and refused to twin or adopt them, is deleted; a scoped upsert/ignore/update issues no `organization_id IS NULL` read on any path.
  
  Remedy for a database that still holds organization-less rows: `os migrate organization-ownership --out PLAN`, review it, then `os migrate organization-ownership --apply --plan-file PLAN --backup-taken`.
- 45f9962: feat: a holder of the `external` organization role is the EXTERNAL principal — the org-wide default never widens it, and it reaches data only through shares, sharing rules and grant RLS
  
  Clause-②: yes (widening: `@objectstack/core` gains `owdForAudience`, `isExternalAudienceContext`, `externalGrantSpeaks` and the two grant-stamp keys; every narrowing below applies only to the `external` role, which no release has shipped yet)
  Metadata-protocol: semantic
  
  Stage 2 of the `external` organization role (ruling of record 6355206139). Stage 1 kept externals off the member directory and the everyone-anchored default sets. This stage makes the role a posture of its own:
  
  - **Audience and posture.** The authorization resolver stamps `audience: 'external'` on a holder's execution context, and `derivePosture` returns `EXTERNAL` for it. Platform admin still outranks it; tenant admin does not. The assembled context carries the audience to agents acting for an external, as it carries the posture.
  - **The org-wide default.** For an external, every object's org-wide default is owner-only: it reads and writes the rows it owns and the rows shared to it, by a share or a sharing rule. A `public_read` or `public_read_write` object is not open to it. A `controlled_by_parent` detail is not floored on its own: its rows follow the master, which meets the floor, so an external reads the lines of a master shared to it.
  - **Grant RLS lifts that floor.** When a permission set or position the external holds carries a row policy for the object (a `using` predicate, such as `supplier in current_user.<key>`), the object's own default stands and that policy bounds the rows. The object's declared default row scope and the platform's ownership floor do not count as a grant.
  - **Writes.** `external_default` carries the platform's owner-only write floor (`owner_only_writes`, `owner_only_deletes`), bound to `org_external`, so an external never writes wider than a member. It shares the member floor's identity, so every relief that lifts a member's floor lifts an external's too.
  - **Explain and describe** name the baseline an external resolves, `external_default`, as "external baseline (org_external)", and explain's OWD layer reports the owner-only floor when no held grant speaks.
  - **Directory doors.** `list-teams` and `get-full-organization`'s `teams` answer an external only the teams it sits on. `list-invitations`, which better-auth gates on membership alone, answers an external only invitations to its own email.
  
  Nothing changes for a principal that does not hold the `external` role.
- 4a25192: feat: a share or sharing rule on a public object reaches an external member of the record's organization
  
  Clause-②: yes (widening: the grant door and the materialiser admit one recipient population on effective-public objects)
  Metadata-protocol: semantic
  
  An external member (`sys_member.role` exactly `external`) reads only the rows it owns and the rows shared to it, on every object. On a `public_read_write` object, or a system object with no `sharingModel`, a share to it used to be refused as one that would never take effect. For that member it is the only thing that does.
  
  - **Manual shares.** `SharingService.grant` now admits a `user` recipient on such an object when the recipient is an `external` member of the record's organization. Every other recipient keeps the 422 `SHARING_NOT_ENABLED`, with a message that says the share is consulted for external members only. A user who is external in one organization and a member of another is judged in the record's organization. `controlled_by_parent`, owner-less, federated phantom-anchor and bypass objects are refused for every recipient, as before.
  - **Sharing rules.** A rule's pass writes rows for the external members it expands to and skips the internal ones without failing the pass. When it skips any, the evaluate result carries a one-line `note`, and the pass logs the count once.
  - **Lint.** `sharing-rule-object-not-shareable` on a public object is now a warning: the rule is effective for external recipients only. `os explain` says when to keep it and when to change the object's `sharingModel`.

### Patch Changes

- 54df640: feat: at boot, an administrator is told when a package upgrade renamed, removed or collided with an access item the customer switched off, cloned or authored
  
  Clause-②: yes (widening: plugin-sharing's exported `SharingRuleService` gains `listDeclaredRules()`; the report itself refuses nothing and adds no key, code or setting)
  Metadata-protocol: none
  
  ADR-0126 §6 wall 3 says no upgrade un-makes a customer's choice. A switch-off, a clone or a sharing rule row is kept by name, so a vendor rename made a switched-off item active again under its new name, and nothing told anyone. At `kernel:bootstrapped`, beside the catalog reference report, `SecurityPlugin` now compares the customer's access state with the registry this boot registered. It covers sharing rules, permission sets, positions and capabilities, and lists:
  
  - **Orphans:** activation-ledger rows (`position`, `permission`, `sharing_rule`) whose name the registry no longer resolves.
  - **Suspected re-enablements:** a switched-off orphan whose recorded `package_id` is P, with every name of the same type P now ships that no ledger row covers. A permission-set candidate names the positions that bind it.
  - **Sharing-rule collisions, per organization:** a `sys_sharing_rule` row holding a declared rule's name, so the declared rule is served nowhere in that scope. A position, permission-set or capability collision is already refused at registration or at boot.
  - **Broken references in the customer's items:** a permission set authored in this system naming an object, field or capability the registry lacks, and a `sys_sharing_rule` row naming an object or criteria field the registry lacks.
  - **Field denies a customer set lacks:** a package-shipped set that denies a field, beside a set authored in this system that grants the same object with no entry for that field. An unlisted field is visible.
  
  The findings are logged once per category, as now. They are also raised to the people who can act on them:
  
  - **Under `single`,** through the existing notification ingress (`messaging.emit()`, topic `security.access_upgrade`, severity `warning`), which writes a Notification Events row in Setup and the in-app inbox. It reaches the Default Organization's `admin_full_access` holders and any `OS_PLATFORM_OWNER_EMAIL` address.
    - The `dedupKey` is the finding set's digest, so an unchanged set notifies once, not at every boot.
    - With no messaging service, nobody to tell, or an emit the ingress refuses, one log line says the findings reached no administrator and names the fix for that cause.
    - The notification is not mandatory: the ingress has no per-emit flag, so a recipient's mute hides it. To make it mute-proof, add `security.access_upgrade` to the messaging plugin's existing `mandatoryTopics` option.
  - **Under `group` or `isolated`,** to the platform operator alone, by one `error` line addressed to the operator. The ledger and the catalog are deployment-level, so only the operator can act. The notification family is organization-scoped, and a walled write with no organization is refused (ADR-0131 D9); stamping an organization would hand the finding to a tenant. So no notification is attempted, and no organization is told.
  
  Two limits follow from ADR-0126 §9, under which a clone records no base, and from the bare `(metadata_type, name)` ledger key:
  
  - A re-enablement is **suspected** and may list several same-package candidates. Nothing records which name replaced which.
  - The field-deny check reads "grants the same object", not "copied from that set", so it may name an unrelated set. It is a review item.
  
  "The old name carrying a clone" is carried by the switch-off half. The sanctioned ceremony is clone plus switch-off, and a clone whose base stays on is not a choice a rename un-makes. A read that fails stops the report for that boot, and nothing is judged from an unread store.
  
  - **`@objectstack/plugin-sharing`:** `SharingRuleService.listDeclaredRules()` answers every declared rule with its `packageId`, or `null` when the service reads no declarations.
- 0091d84: fix: no shipped text says the SQL driver reads organization-less rows, and the in-memory HTTP outbox no longer does
  
  Clause-②: no (one fix and texts: the in-memory HTTP outbox's `redeliver()` now answers as `SqlHttpOutbox` already did; no accept set, served body or error code of a shipped composition moves)
  
  ADR-0131 D8 retired the driver's `OR organization_id IS NULL` arm. Several shipped texts still described it as the live tenant predicate. They now state the current rule: the tenant term is `organization_id = :tenant`, or `IN (:tenants)` under the `group` posture, and nothing else. No tenant-scoped read reaches an organization-less row on a tenant table.
  
  - **`@objectstack/service-messaging` — fix.** `MemoryHttpOutbox.redeliver()` no longer lets a tenant-scoped caller replay a row with no organization. It answers `RESOURCE_NOT_FOUND`, as `SqlHttpOutbox` does through the driver's tenant scope (ADR-0131 D8: no layer has a NULL arm). A caller with no tenant is still unscoped. No shipped composition constructs the in-memory outbox; the messaging plugin always builds `SqlHttpOutbox`. Code that embeds `MemoryHttpOutbox` directly sees the change.
  - **`@objectstack/service-automation`.** The `[http]` node's warning for a durable callout with no organization no longer says the `sys_http_delivery` row is "a global row every organization's redeliver door can reach". It now says no organization's redeliver door reaches that row.
  - **`@objectstack/objectql`.** The `sys_record_share` entry of the platform-object tenancy inventory carries an updated `evidence` text.
  - **`@objectstack/lint`.** `os explain unique/legacy-organization-composite` now says that a new row carries its organization wherever the organization object is registered. A composition that registers no organization object still writes rows whose organization column is NULL.
  - **`@objectstack/spec`.** The TSDoc of `SharingRuleRow` no longer calls it a 1-to-1 stored shape: `deploymentWide` has no `sys_sharing_rule` column. The TSDoc of `DriverOptions.tenantIds` and of the events `organizationId` member describe the predicate without a NULL arm.
  - **The other packages.** Code comments only.
- 60b42cd: fix(spec,plugin-sharing): the `DataEvent.organizationId` description and the sharing-rule Organization help stop describing organization-less rows that 18.x no longer writes
  
  Clause-②: no (description and help text only: no response, status, outcome, boot verdict or export moves)
  Metadata-protocol: none (a schema description and a field's help text; nothing a metadata author writes changes)
  
  - **`DataEvent.organizationId` (`@objectstack/spec/api`).** The description said every event on a `single`-posture deployment carries no organization, because nothing stamps the column there. Since 18.x the engine stamps every tenant row on a single-organization deployment with its Default Organization, so those events carry it. The key is now described as absent in two cases: a row of an object outside the wall, and every row of a composition that registers no organization object. The schema itself is unchanged (`z.string().min(1).optional()`).
  - **`sys_sharing_rule.organization_id` (`@objectstack/plugin-sharing`).** The Setup help said "null = global". A stored rule always carries its organization; a rule that applies to every organization is a declared rule. The help now reads "The organization this rule belongs to.", with the translated locales updated to match.
- 24360dc: fix(plugin-sharing): the declared-rule organization walk ends on the rows read, and a row with no readable id answers unknown; texts that still described the retired NULL-organization reading are corrected
  
  Clause-②: no
  Metadata-protocol: none
  
  - **`@objectstack/plugin-sharing`.** The boot's organization walk for declared sharing-rule scopes (`resolveDeclaredRuleScopes`) judged "short page, stop" on the ids it kept, so a full page of `sys_organization` holding one row with no readable `id` ended the walk early and served a partial list, and the boot sweep then revoked the declared-rule grants of every organization past it. The walk now ends on the number of rows READ, and such a row makes the answer unknown: declared rules are served in no organization until the next boot and no declared rule's grant is revoked, with a warning that names the cause. Under the shipped schema every organization row has a text id, so no install is expected to see the new warning.
  - **`@objectstack/plugin-security`.** The Organization help on `sys_user_position` and `sys_user_permission_set` no longer says an empty value means "global" or "applies in every org context". A grant or assignment applies only in its own organization, and one with no organization applies nowhere. The four locale bundles carry the new text.
  - **`@objectstack/cli`.** `os migrate organization-ownership`'s warning about rows whose owner cannot be derived reads "…while one stays NULL, except on a table whose column is not the tenancy anchor." where it read "(but on a table …)".
  - **`@objectstack/spec`.** Wording only, no schema moves: the upgrade guide's `driver-read-scope-follows-tenant-wall` entry names update and delete "by id or by predicate"; the `sharing-rule-declared-mirror-retired` entry no longer paraphrases ADR-0131 D13 as asking an entry of every retirement; `IEmailService`'s `organizationId` TSDoc no longer says an absent value leaves the row unstamped (the engine stamps the derivable organization or refuses the insert); a TSDoc citation in `schedule-organization.zod.ts` names the run store instead of a deleted file.
- bdf762c: fix: Setup forms show option labels instead of machine values on Business Units, Sharing Rules and Datasources
  
  Clause-②: no
  Metadata-protocol: none
  
  - **`@objectstack/platform-objects`:** `sys_business_unit.kind` declared its options as bare strings, so each label equalled its stored value and the form offered `cost_center`. The options now carry labels (Company, Division, Department, Office, Cost Center). The stored values are unchanged.
  - **`@objectstack/plugin-sharing`:** `sys_sharing_rule.recipient_type` and `access_level` declared bare-string options too. They now carry labels (User, Team, Business unit, Position, Business unit and subordinates, Field; Read, Read and edit), which are the names the Recipient Type help text already used. `sys_record_share` declares the same recipient and access vocabulary, so its `recipient_type` (User, Group, Position, Business unit and subordinates) and `access_level` options carry the same labels. The stored values are unchanged.
  - **`@objectstack/spec`:** the `autoMigrate` key of the SQLite, PostgreSQL and MySQL driver configs had no JSON-Schema `title`, so the New datasource form labelled the field with the raw key `autoMigrate`. It is now titled "Auto-migrate schema".
  
  The English labels flow into the generated translation bundles; the existing zh-CN, ja-JP and es-ES option translations are kept.
- Updated dependencies [448374d]
- Updated dependencies [94842ba]
- Updated dependencies [7cacad5]
- Updated dependencies [df8bb40]
- Updated dependencies [0091d84]
- Updated dependencies [d5d8146]
- Updated dependencies [5e9b100]
- Updated dependencies [7532ea3]
- Updated dependencies [fde7456]
- Updated dependencies [b42c621]
- Updated dependencies [de9cd1f]
- Updated dependencies [7035682]
- Updated dependencies [d606fc1]
- Updated dependencies [a8b44d4]
- Updated dependencies [78ab647]
- Updated dependencies [73a2b52]
- Updated dependencies [5872450]
- Updated dependencies [9ea5afe]
- Updated dependencies [72518d2]
- Updated dependencies [925fd07]
- Updated dependencies [e7befa7]
- Updated dependencies [55d7aab]
- Updated dependencies [5050442]
- Updated dependencies [2b1382a]
- Updated dependencies [644e4b2]
- Updated dependencies [0715fac]
- Updated dependencies [60b42cd]
- Updated dependencies [b9a79ef]
- Updated dependencies [63085c3]
- Updated dependencies [0b8bce4]
- Updated dependencies [5d2c5a1]
- Updated dependencies [066dabc]
- Updated dependencies [4b8f597]
- Updated dependencies [688052e]
- Updated dependencies [6b656bf]
- Updated dependencies [2069b81]
- Updated dependencies [157ebd0]
- Updated dependencies [1862d8d]
- Updated dependencies [30d21f6]
- Updated dependencies [eddffc3]
- Updated dependencies [69712d5]
- Updated dependencies [dfe60e3]
- Updated dependencies [e939357]
- Updated dependencies [045858f]
- Updated dependencies [baedcec]
- Updated dependencies [03c12a5]
- Updated dependencies [f8c5fb3]
- Updated dependencies [d96f618]
- Updated dependencies [386f60f]
- Updated dependencies [28c9a2c]
- Updated dependencies [2354058]
- Updated dependencies [ba244f1]
- Updated dependencies [edcc8ce]
- Updated dependencies [9340181]
- Updated dependencies [fccbd9d]
- Updated dependencies [c8f4c43]
- Updated dependencies [db9c02a]
- Updated dependencies [02ad31a]
- Updated dependencies [03966ce]
- Updated dependencies [e3aa111]
- Updated dependencies [863c580]
- Updated dependencies [7f5b19d]
- Updated dependencies [504d8b3]
- Updated dependencies [14e7239]
- Updated dependencies [fe0ec2b]
- Updated dependencies [dfab597]
- Updated dependencies [9127f23]
- Updated dependencies [3a440b0]
- Updated dependencies [24360dc]
- Updated dependencies [ecb4e69]
- Updated dependencies [8dfd126]
- Updated dependencies [bda53bb]
- Updated dependencies [b62f959]
- Updated dependencies [b964ea1]
- Updated dependencies [4395cbc]
- Updated dependencies [9019af9]
- Updated dependencies [45f9962]
- Updated dependencies [e5eab06]
- Updated dependencies [dc532e8]
- Updated dependencies [d196748]
- Updated dependencies [9d96b2b]
- Updated dependencies [5f30f00]
- Updated dependencies [7db1697]
- Updated dependencies [f5b6b3f]
- Updated dependencies [c109bfc]
- Updated dependencies [f4112a7]
- Updated dependencies [f4112a7]
- Updated dependencies [db1c7cc]
- Updated dependencies [303aef0]
- Updated dependencies [b3034ee]
- Updated dependencies [d12e650]
- Updated dependencies [830a63a]
- Updated dependencies [1000cc7]
- Updated dependencies [ee63b47]
- Updated dependencies [bdf762c]
- Updated dependencies [27b3f1f]
- Updated dependencies [3306cad]
- Updated dependencies [c898bd8]
- Updated dependencies [97aa34e]
- Updated dependencies [832a84e]
- Updated dependencies [7c68b10]
- Updated dependencies [915e940]
- Updated dependencies [025f6de]
- Updated dependencies [9f39094]
- Updated dependencies [f7d7403]
  - @objectstack/spec@18.1.0
  - @objectstack/core@18.1.0
  - @objectstack/objectql@18.1.0
  - @objectstack/metadata-core@18.1.0
  - @objectstack/platform-objects@18.1.0
  - @objectstack/formula@18.1.0
  - @objectstack/types@18.1.0

## 18.0.0

### Minor Changes

- 1e8b628: feat(spec,metadata-protocol)!: the `/meta` door no longer authors sharing rules — `sharing_rule` is a code-only metadata type; Setup lists declared sharing rules
  
  Clause-②: yes (narrowing)
  
  <!-- adr-0087: registered sharing-rule-runtime-create-withdrawn -->
  
  **BREAKING** accept-set narrowing, shipped as `minor` under the repo's launch-window convention for breaking changes (ADR-0131 D6, regime C).
  
  A sharing rule has two sources: a package declares it (the stack's `sharingRules`, switched off through the activation ledger), or an organization authors its own (`sys_sharing_rule`). A runtime metadata item was a third, and it bypassed the same-name guard and the organization wall. The narrowings, FROM → TO:
  
  - `PUT /api/v1/meta/sharing_rule/:name`, with a name nothing declares, in publish or `?mode=draft` — FROM `200`, with an environment-wide item stored and served by `GET /api/v1/sharing/rules`, TO `403 NOT_CREATABLE`, nothing stored. With a declared rule's name — TO `403 NOT_OVERRIDABLE`.
  - `GET /api/v1/meta/types` — FROM `sharing_rule` advertised `allowRuntimeCreate: true`, TO `allowRuntimeCreate: false` and `allowEnvironmentOverlay: false`.
  
  **The fix:** author an organization rule, or clone the declared one. `POST /api/v1/sharing/rules` (Setup > Sharing Rules) creates an organization rule. To customize a declared rule, copy it to an organization rule under a new name, then switch the declared one off with `POST /api/v1/security/_activation/sharing_rule/:name`, body `{ "enabled": false }`. A package declares its rules in the stack's `sharingRules`, as before. An item stored through the old door is still served until you remove it with `DELETE /api/v1/meta/sharing_rule/:name`. On an environment kernel, removing it needs `OS_METADATA_WRITABLE=sharing_rule`. That hatch is an explicit operator opt-in, not an authoring route: as for any code-only type, it reopens every write on the type, including creates of new names, and a sharing rule grants access. Unset it after the removal.
  
  Also in this change:
  
  - **`@objectstack/spec`.** `MetadataTypeSchema` (so the `MetadataType` union) and `DEFAULT_METADATA_TYPE_REGISTRY` gain `sharing_rule`. Its schema binding (`SharingRuleSchema`) moves from the non-kind collections into the kind map. `META_URL_TO_SINGULAR` gains the `sharing_rules` spelling, so `/api/v1/meta/sharing_rules` now folds to `sharing_rule`; before, that plural was not a recognised spelling.
  - **`@objectstack/metadata-protocol`.** The refusal names the two sanctioned paths, not a source glob. `sharing_rule` gains its ADR-0126 Regime C row (clone, and the ledger switch).
  - **`@objectstack/plugin-sharing`.** Setup's Access Control group gains **Declared Sharing Rules** (`nav_declared_sharing_rules`). It opens `/apps/setup/metadata/sharing_rule?scope=environment` beside **Sharing Rules**, which lists the organization's own rules.
  - **`@objectstack/platform-objects`.** That entry's label, in `en`, `zh-CN`, `ja-JP` and `es-ES`.
- e7e6544: feat(plugin-sharing)!: a sharing rule reads a position's deactivation from the activation ledger, as the authorization resolver does (ADR-0131 D3, ADR-0126 §4)
  
  Clause-②: yes (narrowing: a position switched off in the activation ledger stops receiving sharing-rule shares in every organization; widening: a position whose `sys_position` row reads `active: false` receives them again)
  
  <!-- adr-0087: not-required (no-migration-prescription) no authorable metadata key changes; the sharing-rule evaluator reads deactivation from the store the resolver already reads, whose own move is registered as position-permission-sets-declared -->
  
  **BREAKING**, shipped as `minor` under the launch-window convention for breaking changes. A position's deactivation now comes from `sys_metadata_activation` instead of the `sys_position` row's `active` column, so the shares a sharing rule materializes follow the same switch the authorization resolver reads.
  
  - A sharing rule whose recipient is a position materializes no share while that position is switched off. Switched off means a `sys_metadata_activation` row of type `position` naming it, with `active` false (a driver `0` included). The switch is deployment-wide, like the ledger, so it no longer depends on the rule's organization.
  - The `sys_position` row's `active` is no longer read. A deactivation made in Setup writes that column, so until the upgrade ceremony converts it into a ledger row it stops neither the resolver nor sharing rules.
  - A name with no ledger row keeps sharing, including a membership-derived position name. A composition that registers no ledger object issues no ledger read. A ledger read that fails still grants for the pass, as the row read did.
- 78652c0: feat(cli,plugin-sharing)!: in the 17 → 18 ownership ceremony, a row whose owner cannot be derived blocks certification, and a declared-rule mirror's grants are renamed only onto a rule plugin-sharing serves
  
  Clause-②: yes (narrowing)
  
  <!-- adr-0087: not-required (no-migration-prescription) No spec key, option, error code or stored shape is added, removed or renamed, and nothing exported is removed: the ceremony's report gains one field (`TableOutcome.held`), its verdict counts change, and plugin-sharing gains one export. The only stored state that moves is the operator's own: a row whose owner cannot be derived is given its organization or deleted by hand, which `objectstack migrate meta` has nothing to rewrite for. The other categories are closed on facts: the packages publish (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); no Zod schema in packages/spec changes (not runtime-interface-only or type-surface-only in the spec sense); and nothing exported is retired (not runtime-export-retired). -->
  
  **BREAKING** (narrowings), shipped as `minor` under the launch-window convention for breaking changes.
  
  - **FROM** (`@objectstack/cli`): `os migrate organization-ownership --apply` on a database holding a row whose owner cannot be derived exited `0` with `blocking: 0`, counted the row in `advisory`, and verified the `sys_migration` marker. This covers a reported (fate 4) row, and a row whose anchor is missing under a wall (fate 3). **TO:** it exits `1`, counts the row in `blocking`, and leaves the marker unverified, so a v18 `os serve` / `os start` does not start on the database. **Fix:** give each row its organization (write its `organization_id`, or repair the anchor its reason names), or delete it by hand, then re-run `--apply` with the same plan file.
  - **FROM** (`@objectstack/cli`): a database an earlier version of this command certified while it held such a row was certified again by the next `--apply`. **TO:** that run leaves its marker unverified, for the same rows. **Fix:** the same as above.
  - **FROM** (`@objectstack/cli`): `os dev`'s in-place upgrade of a development database started the server again whenever every ceremony step finished. **TO:** it starts it only when the post-check also holds nothing (`blocking` 0); otherwise it prints each table that holds, with its count and remedy, and the command that resumes the run. **Fix:** resolve the rows it names, then run the printed command.
  - **FROM** (`@objectstack/cli`): the `mirror-deletion` step renamed the grants of a declared-rule mirror onto its rule's name, and deleted the mirror, even when plugin-sharing does not serve that rule (a condition that does not translate, an unmappable recipient, a retired owner-based rule); the next boot's orphaned-grant sweep then revoked those grants. **TO:** while `sys_record_share` grants name such a mirror, the step blocks, naming the rule, its rows and the reason, and writes nothing. **Fix:** correct the rule's declaration in its package so it is served, or delete each mirror row and the grants that name it, then re-run `--apply`.
  
  `@objectstack/cli` — **unattributable rows hold certification (ADR-0131 D10 fate 4).** The ceremony still never guesses an owner for such a row and never deletes it. The post-check now holds each one against the verdict:
  
  - Each table that holds one carries `held: { rows, remedy }` in the apply report, and counts those rows in its `remaining`. The terminal output names each table, its row count and the remedy.
  - `advisory` now counts only the rows of an advisory departure and the reported rows of a table whose `organization_id` is not the tenancy anchor (`sys_sso_provider`, the retired `sys_scim_provider`). A row there that is bound to no organization is legitimate, is reported, and does not block.
  - So a verified marker means no organization-less row on any table that the tenancy anchor governs.
  - The plan's summary line says that such rows will hold `--apply`'s certification until they are resolved.
  
  `@objectstack/cli` — **the ceremony asks plugin-sharing which declared sharing rules it serves.** The port the `mirror-deletion` step reads (`DeclaredSharingRulesPort.rules()`, formerly `names()`) judges each declared rule through plugin-sharing's own translation. A mirror's grants are renamed only onto a rule that is served. A mirror of a refused rule that no grant names is still deleted.
  
  `@objectstack/plugin-sharing` — **exports `translateDeclaredSharingRule`** with its `DeclaredSharingRule` and `DeclaredSharingRuleSkip` types. It is the one translation enforcement serves a declared rule through. It is pure, and it is unchanged.
- 5cfd866: feat(sharing): a share-link password can be sent in the `X-Share-Password` header whatever its characters, under a declared encoding (`X-Share-Password-Encoding: utf-8`)
  
  Clause-②: yes (widening)
  
  - **What was missing.** A browser cannot put a character above U+00FF in a request header (`Headers` throws a `TypeError` before the request leaves), and it strips leading and trailing spaces. `createLink` accepts any password, so a link whose password has a CJK character or an emoji could not be opened through the header.
  - **What is now accepted.** A new companion request header, `X-Share-Password-Encoding`, declares how `X-Share-Password` is encoded. Its one value is `utf-8`, compared case-insensitively. Under it, `X-Share-Password` carries the password's UTF-8 bytes percent-encoded, as `encodeURIComponent(password)` produces them, and both public routes (`GET /api/v1/share-links/:token/resolve` and `/:token/messages`) decode it on both mounts: the sharing plugin's routes and the runtime dispatcher's `/share-links` domain. Both read the pair through one helper, `readSharePasswordHeader`, exported from `@objectstack/types` with the header-name constants.
  - **Unchanged.** Without `X-Share-Password-Encoding`, `X-Share-Password` is read raw, exactly as before, so every value a client sends today resolves as it did. That includes a Latin-1 password and a raw password containing `%`; the server never percent-decodes a value nobody declared encoded. The `?password=` query parameter is still read first, and when it is present the header pair is not read.
  - **What is refused.** `X-Share-Password-Encoding` naming any other value, or a password header that is not percent-encoded UTF-8 under `utf-8` (a `%` without two hex digits, octets that are not well-formed UTF-8, a character outside visible ASCII), answers `400 VALIDATION_FAILED` before the token is looked up. It is never compared raw instead. The message names the headers and the rule, never the presented value.
  - **Response headers.** Both public routes now answer `Vary: X-Share-Password, X-Share-Password-Encoding`, still beside `Cache-Control: no-store`.
  - **Cross-origin clients.** `X-Share-Password-Encoding` is in the default CORS preflight allow-list (`DEFAULT_CORS_ALLOW_HEADERS` in `@objectstack/plugin-hono-server`, which the `@objectstack/hono` adapter also applies). A deployment that passes its own `allowHeaders` must add `X-Share-Password-Encoding` beside `X-Share-Password` to let a cross-origin client send an encoded password.
- 08b38cb: fix(services)!: the datasource admin, share-link, webhook redeliver and storage families refuse a session the ADR-0069 authentication policy holds
  
  Clause-②: no (narrowing) — a session ADR-0069 holds out of protected resources is refused by families that answered it; core's existing exports only, no published schema or export moves.
  
  <!-- adr-0087: not-required (no-migration-prescription) A runtime authentication narrowing at four families of routes mounted directly on the host server, not a metadata change. No spec key, export, option, config field, response field or stored shape is removed, renamed or re-shaped, and a session the policy does not hold receives the same answers as before, so there is no tombstone and nothing for `objectstack migrate meta` to rewrite. What narrows is which sessions these families serve: a session whose user carries the ADR-0069 posture (an expired password, or enforced MFA not yet enrolled) is now refused with the gate's 403 before any of the family's logic runs. The other categories are closed on facts: the packages publish (not unpublished); no ADR-0087 id covers these routes and this diff adds none (not registered / already-registered); and no published interface or type changes (not runtime-interface-only / type-surface-only). -->
  
  **BREAKING** (an accept-set narrowing), shipped as `minor` under the launch-window convention for breaking changes.
  
  ADR-0069 holds a signed-in user out of every protected resource while their password has expired or while enforced MFA is not yet enrolled, until they remediate. REST and the runtime dispatcher already refuse such a session. Four families of routes mounted straight on the host server never asked, so they served it as an ordinary signed-in caller:
  
  - **`@objectstack/service-datasource`**: the datasource admin family (`registerDatasourceAdminRoutes`). Its door now asks the shared decision (`evaluateAuthGate`, `@objectstack/core`) about the session it already reads, before the anonymous floor and the capability check.
  - **`@objectstack/plugin-sharing`**: the share-link family (`registerShareLinkRoutes`). Every route, the two capability-token routes included, is now mounted through one door that refuses a context carrying `authGate`. `SharingServicePlugin`'s resolver now puts the session's posture on that context, as REST does.
  - **`@objectstack/plugin-webhooks`**: the redeliver door (`WebhookOutboxPlugin`), on both of its faces: the route the plugin mounts, and the `webhooks` service's `handleRedeliver`.
  - **`@objectstack/service-storage`**: the storage family, the two capability-token raw-transfer routes included. Every route is now mounted through one door. The posture is bound where every other storage gate is bound, so both the plugin's own mount and the host door `mountStorageRoutes` carry it. When a gate feature is active, the door reads the session and refuses a held one. When the gate is active but the session cannot be read, the door answers the declared `503` (`SERVICE_UNAVAILABLE`), as REST does. A direct call of `registerStorageRoutes` mounts the family exactly as before, because like the other storage gates this one is bound by the package's composition. No exported declaration changes.
  
  - **Refused now:** a held session gets `403` with the gate's own `code` (`PASSWORD_EXPIRED` or `MFA_REQUIRED`) and `message`, in each family's declared error envelope, before the family does anything else. This is the answer REST gives the same session.
  - **Unchanged:** a session the policy does not hold is served exactly as before, and an API-key caller is unaffected because it has no session to hold. A CORS preflight is answered as before.
  
  What changes for you. A user the policy holds must remediate (change the password, or enroll an authenticator) before these routes answer them, as on every other protected route. If you mount the storage routes through `mountStorageRoutes`, the gate is bound from the kernel's `auth` service with nothing to configure. If you mount `registerShareLinkRoutes` yourself with your own `contextFromRequest`, set `authGate` on the context it returns for a held session; the door refuses on that field.
- 345d1be: fix(spec,plugin-sharing)!: `sys_record_share` no longer offers a `guest` recipient, which no grant ever honoured (ADR-0138 D8)
  
  Clause-②: no (narrowing: a declared recipient value no grant honours is refused)
  
  <!-- adr-0087: not-required (no-migration-prescription) No working use of the value exists to rewrite. `ISharingService.grant` refused every non-`user` recipient before this change, so no grant naming `guest` ever succeeded, and the census pinned in `@objectstack/spec` finds no seed, fixture, example, template, migration or test row in this repository that writes `recipient_type` as `guest`, and no stored metadata surface that carries it. Seed data, the one metadata surface that can carry a row value, targets `sys_record_share` nowhere in the tree (the examples seed `sys_user` and `sys_business_unit`, never a record share). What narrows is a published TypeScript union in `packages/spec/src/contracts/` and the option set of a platform object's select: a caller that still spells the value meets a compile error or a located refusal, and there is nothing for `objectstack migrate meta` to derive from metadata. The other categories are closed on facts: both packages publish (not unpublished); no ADR-0087 id covers this value and this diff adds none (not registered or already-registered); the union lives under `packages/spec/src/contracts/` and the diff touches `packages/spec` (not runtime-interface-only or type-surface-only); no export is removed (not runtime-export-retired). -->
  
  **BREAKING** (an accept-set narrowing), shipped as `minor` under the launch-window convention for breaking changes.
  
  A record share to the anonymous principal was declared in two places and honoured in none. Both declarations are gone:
  
  - `RecordShareRecipientType` (`@objectstack/spec/contracts`) is now `'user' | 'group' | 'position' | 'unit_and_subordinates'`. Passing `recipientType: 'guest'` to `ISharingService.grant`, or typing a `RecordShare.recipient_type` as `'guest'`, is a compile error.
  - The `recipient_type` select on `sys_record_share` (`@objectstack/plugin-sharing`) offers those same four options, and its `guest` label is gone from the four translation bundles.
  
  Why: the grant refused `guest` (ADR-0078), and no gate reads such a row, because the read and write gates match `recipient_type: 'user'` only. ADR-0090 D11 routes guest access through the guest position and share links, so a record share to the guest had nothing to gain. The sharing-rule vocabulary retired the same recipient in v17.
  
  What a caller sees now:
  
  - **The grant door** (`POST /data/:object/:id/shares`, or `grant()` from untyped code). A body naming `recipientType: 'guest'` is still refused with `VALIDATION_FAILED` (`400`), as before. The sentence now says the value was removed and that guest access flows through the guest position and share links. It used to say that sharing rules deliver non-`user` recipients, which was never true of a guest. To let a guest reach a record, use a public form or a share link.
  - **The row door** (a system-context engine write: a seed, a plugin, a migration script). A row carrying `recipient_type: 'guest'` is now refused with `VALIDATION_FAILED`, an `invalid_option` error on `recipient_type` that lists the four values a row may carry. Before this change such a write stored a row that looked granted and enforced nothing.
  - **Unchanged:** every `user` grant, the other three row values, the sharing-rule service, and the gates. A `guest` row that a system write stored before this release is read by no gate, both before and after.
- 0f05907: feat(spec,core,plugin-auth)!: an API key answers as its owner's session does when the ADR-0069 policy holds the account, the forced reset gets its own code and an explicit revocation switch
  
  Clause-②: yes (narrowing) — the published contract widens (the posture codes become a closed vocabulary with a declared scope, a new `PASSWORD_RESET_REQUIRED` code, a per-user posture member on the auth service contract, new `@objectstack/core` exports) and the API-key door narrows (a key whose owner holds an account-scope posture is refused where it was served).
  
  <!-- adr-0087: not-required (no-migration-prescription) An authentication-policy change at the API-key admission seam plus one new error code, not a metadata change. No authorable spec key, stored shape or metadata surface is removed or renamed, so `objectstack migrate meta` has nothing to rewrite. `ExecutionContext.authGate.code` narrows from a bare string to the closed posture vocabulary, but that field is server-constructed only and never authored; its one producer already wrote only members of it. What narrows is which API keys are served (a key whose owner owes MFA enrolment is refused with 403 MFA_REQUIRED), and the administrator-forced password change answers its own code. The packages publish (not unpublished), no ADR-0087 id covers this and none is added (not registered or already-registered). -->
  
  **BREAKING** (an accept-set narrowing at the API-key door, and a changed code for the administrator-forced password change), shipped as `minor` under the launch-window convention for breaking changes.
  
  Ruling C′ on #23287: posture codes are a closed vocabulary, and each code declares what it holds.
  
  - **The vocabulary and its scope (`@objectstack/spec/kernel`).** `AuthGateCodeSchema` is the closed set of codes an `authGate` may carry: `PASSWORD_EXPIRED`, `PASSWORD_RESET_REQUIRED` and `MFA_REQUIRED`. `AUTH_GATE_SCOPES` declares each code's scope once: `MFA_REQUIRED` holds the **account** (every credential of the user); `PASSWORD_EXPIRED` and `PASSWORD_RESET_REQUIRED` hold the **credential** (password sign-in alone). `ExecutionContext.authGate.code` is typed against the vocabulary, and `PASSWORD_RESET_REQUIRED` is registered for `@objectstack/plugin-auth` in the error-code ledger.
  - **One per-user posture computation (`@objectstack/plugin-auth`, `IAuthService.resolveUserAuthGates`).** It answers every posture a user holds, most urgent first, keyed by user id and the organization the credential operates in. The session gate shows its first entry, as before.
  - **One judgment at the shared key-admission seam (`@objectstack/core`).** `resolveApiKeyAdmission` asks that computation for the key's owner and holds the key on an account-scope posture (a new `held` outcome). `resolveAuthzContext` resolves a held key as a held principal: the owner, `credential: 'api_key'`, and the posture on `authGate`. Both new inputs are optional (`userAuthGates`), and `userAuthGateSourceOf(authService)` binds one from an auth service.
  - **REST and the runtime dispatcher** judge a key-admitted request by the key's answer, and re-read the session cookie for the gate only when a session admitted the caller. The declared-endpoint fallback does the same.
  - **The raw-host families** take the same answer through the shared seam: datasource admin, share links, settings, and the storage family's door. The webhook-redeliver door admits no API key at all, and still does not.
  - **The forced reset (`POST /api/v1/auth/admin/set-user-password`, the `set_user_password` action).** `must_change_password` now answers `PASSWORD_RESET_REQUIRED` instead of reusing `PASSWORD_EXPIRED`. The act carries `revokeSessionsAndKeys`, **on by default**: it ends every live session of the user and revokes every API key they own, and the response reports what landed (`revoked: { sessions, apiKeys, failed, complete }`).
  
  What changes for you:
  
  - **Refused now:** an API key whose owner owes MFA enrolment past the grace window gets `403 MFA_REQUIRED`, with the message the session gets, on every face that admits keys. It works again the moment the owner enrols, with nothing reissued: the refusal is not a revocation.
  - **Unchanged:** a key whose owner's password expired, or whose administrator forced a password change, keeps working. A session sent beside an API key no longer answers for the key.
  - **A forced password change answers `PASSWORD_RESET_REQUIRED`.** A client that recognises `PASSWORD_EXPIRED` to show its change-password flow should recognise `PASSWORD_RESET_REQUIRED` the same way.
  - **An administrator's password reset now signs the user out everywhere and revokes their API keys by default.** For a routine reset, pass `revokeSessionsAndKeys: false` (or clear the switch in the Set Password dialog). Revoked keys stay revoked after the password change; an administrator can restore a key a routine reset revoked with the Restore API Key action, or the owner mints a replacement.
  - **Hosts calling `resolveAuthzContext` or `resolveApiKeyAdmission` directly** pass `userAuthGates: userAuthGateSourceOf(authService)` to have the key's owner asked. Code switching exhaustively over `ApiKeyAdmission['outcome']` handles the new `held` outcome.
- 1d79556: feat(spec,core,runtime,plugin-auth)!: API keys get a lifecycle: a 90-day default expiry, a one-year ceiling, a 90-day inactivity expiry, a one-year grace for keys created with none, and distinct refusal codes
  
  Clause-②: yes (narrowing) — the published contract widens (four `auth` settings keys, the `IAuthService.resolveApiKeyLifecyclePolicy` member and its `ApiKeyLifecyclePolicy` type, four registered error codes, new `@objectstack/core` exports) and the API-key doors narrow (a signing past the ceiling is refused; an inactive key, a key past its grace, and a revoked or expired key sent beside a session are refused where they were served).
  
  <!-- adr-0087: not-required (no-migration-prescription) An authentication-policy change at the API-key signing door and the shared key-admission seam, not a metadata change. No authorable spec key, stored shape or metadata surface is removed, renamed or re-shaped, so `objectstack migrate meta` has nothing to rewrite: the four new `auth` settings keys are additive and defaulted, `sys_api_key` gains no column (its existing `expires_at` and `last_used_at` are written by the platform), and `ResolveAuthzInput.apiKeyLifecycle` / the sixth parameter of `resolveApiKeyAdmission` and `resolveApiKeyPrincipal` are server-side wiring no author writes. What narrows is which API keys are served and which signings are accepted; the remedy is a new key or a nearer date, never a rewrite of a package source or a stored row. The packages publish (not unpublished), no ADR-0087 id covers this and none is added (not registered or already-registered). -->
  
  **BREAKING** (an accept-set narrowing at the API-key doors), shipped as `minor` under the launch-window convention for breaking changes.
  
  Ruling A on #23367: the key store stays `sys_api_key`, and the policy is auth configuration.
  
  - **The policy (`@objectstack/plugin-auth`, `IAuthService.resolveApiKeyLifecyclePolicy`).** Three `auth` settings keys, bound by `bindAuthSettings`: `api_key_default_expiry_days` (90), `api_key_max_expiry_days` (365) and `api_key_inactivity_days` (90; `0` turns it off). A fourth, `api_key_policy_started_at`, is recorded once — on the first boot that runs the policy, at `kernel:bootstrapped` — and anchors the two clocks below; it survives restarts and is never overwritten by the platform.
  - **The signing door (`POST /api/v1/keys`).** A signing that names no `expires_at` gets the default life and the response echoes it. An `expires_at` further away than the ceiling is refused `400 API_KEY_EXPIRY_TOO_LONG`, naming the latest date allowed; exactly the ceiling is accepted. A kernel with no auth service signs as before.
  - **The key-admission seam (`resolveApiKeyAdmission`, `@objectstack/core`).** A real key its own state refuses is a new outcome, `lifecycle`, with one of three distinct codes: `API_KEY_REVOKED`, `API_KEY_EXPIRED` (past `expires_at`, or past the grace of a key created with none) or `API_KEY_INACTIVE` (no recorded use for longer than the window). `resolveAuthzContext` raises it as the branded `ApiKeyLifecycleRefusalError` (`403`, a located message naming the key's prefix, the date and the remedy). An unknown key is still `none`.
  - **`last_used_at` is written.** Its description promised "Automatically updated on each API call", and nothing wrote it. The seam now stamps it on an admitted (or held) call, at most once an hour per key, and the inactivity judgment reads the value as it was BEFORE that call's stamp, so a key's own use cannot revive it. A stamp that fails never fails the request; it is said once, at `error`.
  - **Keys created before the policy.** A key with no expiry gets one year from `api_key_policy_started_at`; the date is stamped onto its `expires_at` the first time it is admitted, so the keys page shows it, and the refusal after it names it. A key with no recorded use counts its inactivity from the same anchor (or from its own creation, when later) — never from an earlier `created_at`, since no use was ever recorded before the policy.
  - **Every face that admits keys** passes the policy source (`apiKeyLifecyclePolicySourceOf(authService)`, a required input beside `userAuthGates`). Every one of them answers the refusal's `403` and code: the runtime dispatcher (the MCP HTTP endpoint among its routes), the REST data API, the settings routes, the storage download routes, the datasource admin routes, the share-link routes, the marketplace install-local routes and the MCP stdio transport. Each relays the refusal by its brand, so every other identity fault at those doors keeps its existing answer.
  - **`OS_CLOUD_API_KEY` is untouched.** It is the runtime's outbound credential to the control plane, never admitted by this seam.
  
  What changes for you:
  
  - **A key created without an expiry now expires.** It used to live until revoked; it now lives 90 days (or the configured default). Pass `expires_at` to choose, and create a new key before it ends.
  - **A signing asking for more than a year is refused** `400 API_KEY_EXPIRY_TOO_LONG`, where it used to be accepted. Ask for the date the message names, or an earlier one.
  - **A key unused for 90 days is refused** `403 API_KEY_INACTIVE`, where it used to be served. It is not revoked; the remedy is a new key.
  - **A key that already existed with no expiry keeps working for one year** from the date the policy took effect on your deployment (`auth.api_key_policy_started_at`), then answers `403 API_KEY_EXPIRED` naming that date. Replace such keys within the year.
  - **A revoked or expired key answers its own code** (`403 API_KEY_REVOKED` / `API_KEY_EXPIRED`) on every face that accepts a key, where it used to answer the generic `401`; and a session cookie sent beside such a key no longer answers for it.
  - **Hosts calling `resolveAuthzContext`, `resolveApiKeyAdmission` or `resolveApiKeyPrincipal` directly** pass `apiKeyLifecycle: apiKeyLifecyclePolicySourceOf(authService)` (or the sixth argument), or an explicit `undefined` where no auth service exists. A caller of `resolveAuthzContext` that wants the located answer re-raises `ApiKeyLifecycleRefusalError` (`isApiKeyLifecycleRefusalError`) the way it re-raises the store outage. Code switching exhaustively over `ApiKeyAdmission['outcome']` handles the new `lifecycle` outcome.
- 5e97907: feat(plugin-sharing,cli)!: declared sharing rules are read from the registry — the boot writes no `sys_sharing_rule` row for them, and the 17 → 18 ownership ceremony deletes the copies the retired seeder wrote
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: registered sharing-rule-declared-mirror-retired -->
  
  The narrowings, FROM → TO, each with its one-line remedy:
  
  - `DELETE /api/v1/sharing/rules/:idOrName` on a declared rule — FROM `204`, the seeded row deleted (and written again by the next boot), TO `403 PERMISSION_DENIED`. Remedy: change or remove the rule in its declaration in the package; an organization's own rule is deleted as before.
  - `sys_sharing_rule` — FROM one `managed_by: package` row per declared rule, TO none: the boot writes none and the ownership ceremony deletes the copies the seeder wrote (Setup's Sharing Rules object list, which lists rows, no longer shows declared rules). Remedy: read declared rules through `GET /api/v1/sharing/rules`, which lists them beside the organization's own; on an upgraded database run `os migrate organization-ownership --apply` with a fresh plan.
  
  The retirement note for the seeder is the ADR-0087 semantic entry `sharing-rule-declared-mirror-retired`.
  
  **BREAKING**, shipped as `minor` under the repo's launch-window convention for breaking changes.
  
  `@objectstack/plugin-sharing` no longer copies a stack's declared `sharingRules` into `sys_sharing_rule` at boot. ADR-0131 D2 retires that seeder (`bootstrapDeclaredSharingRules`). The sharing-rule service reads each declared rule from the registry whenever it reads the rule set: listing, getting, evaluating, the per-record hooks, the boot backfill and the orphaned-grant sweep. Rules an organization authors keep their `sys_sharing_rule` rows.
  
  - **A declared rule still grants, and stops granting when its declaration goes.** It is translated from the registry's copy exactly as the seeder translated it: the CEL `condition` is lowered to a `criteria` filter, and `sharedWith` becomes the recipient. A condition that does not lower is not served, and never as a match-all. It says so in one WARN line per rule per process. A declared rule's id is its NAME, and the grants it materialises carry the name as `sys_record_share.source_id`. Remove the declaration and the next boot's orphaned-grant sweep revokes those grants.
  - **Scopes follow the posture, as the seeder's passes did.** Under `single` a declared rule is served once, organization-less, so every organization reads it. Under a wall it is served once per organization — every organization, read page by page. An organization created after boot is served from its creation on. If the organizations cannot be read at boot, no declared rule is served until the next boot, and the boot's orphaned-grant sweep revokes none of their grants meanwhile: a failed read is never a revocation.
  - **A stored row of the same name answers for it.** Under `single` that is a row of that name in any organization, and under a wall that organization's own row. Such a row is an organization's own rule, a seeded copy an administrator customized, or a seeded copy the ceremony has not deleted yet. The declared rule is not served beside it, the same as while the seeder ran: it never overwrote an admin-authored or customized row.
  - **`DELETE /api/v1/sharing/rules/:idOrName` refuses a declared rule** with `403 PERMISSION_DENIED`. It has no row: it is changed or removed in its declaration. Before this release a platform administrator could delete the seeded row, and the next boot wrote it again. An organization's own rule is deleted as before.
  - **Setup's Sharing Rules object list no longer shows declared rules.** It lists `sys_sharing_rule` rows. `GET /api/v1/sharing/rules` lists both.
  
  `@objectstack/cli` — **`os migrate organization-ownership --apply` deletes the declared-rule mirrors.** The `declared-rule-mirrors` rows on `sys_sharing_rule` are the seeder's uncustomized copies (`managed_by` `package` or `platform`, `customized` not true). They now block certification until the ceremony's `mirror-deletion` step removes them. It works in the ruled order. It renames every grant naming a mirror by row id (`sys_record_share.source_id`, `source = 'rule'`) to the rule's name and verifies that no grant names a mirror any more. Only then does it delete the mirrors. Under a wall it deletes the organization-stamped copies too.
  - A mirror whose rule no installed package declares, and that grants still name, blocks with nothing written. The blocker names the rows and the remedy. A mirror no grant names is deleted.
  - The step also runs on a database whose ceremony already completed while an earlier release still seeded the rows, where they were advisory. Re-run `--apply` with a fresh plan.
  - `DECLARED_SHARING_RULE_SEEDER_RUNS` is now `false`. A customized copy and an organization's own rule stay. Under `single` they take the Default Organization, as before.
  
  `@objectstack/lint` — the sharing-rule enforceability verdicts and `os explain` say what now happens to a declared rule whose condition does not lower. It is "never served", not "never seeded", because it is never written to `sys_sharing_rule`. The rule ids, severities, paths and what each rule accepts or refuses are unchanged.
- 964a237: fix(plugin-sharing,runtime)!: a declared sharing rule is read-only and clonable — no rule, new or renamed, can take its name, and it is switched off through the activation ledger, which revokes its grants at once
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: not-required (no-migration-prescription) no spec key, export, option or stored metadata shape is added, removed or renamed, so `objectstack migrate meta` has nothing to rewrite; what changes is the accept set of two write doors, whose remedy is another name for the caller's rule plus one activation call -->
  
  **BREAKING** (an accept-set narrowing), shipped as `minor` under the launch-window convention for breaking changes.
  
  ADR-0131 D6 charts declared sharing rules under regime C: a rule a package declares is read-only, it is customised by a clone under another name, and it is switched off through the deployment-level activation ledger (`sys_metadata_activation`), like flows, actions, positions and permission sets. Same-name shadowing is retired.
  
  What is refused now:
  
  - `POST /api/v1/sharing/rules` (and `SharingRuleService.defineRule`) creating a rule under a declared rule's name — FROM `201`, the new row replacing the declared rule in its scope, TO `409 RESOURCE_CONFLICT` naming the declared rule. Fix: create your rule under another name, and switch the declared one off with `POST /api/v1/security/_activation/sharing_rule/<name>` and `{ "enabled": false }`.
  - A `/data` insert of a `sys_sharing_rule` row under a declared rule's name, or an update that renames a row onto one — FROM `201` / `200`, TO `409 RESOURCE_CONFLICT`. Fix: the same.
  
  What is added:
  
  - **The switch.** `POST /api/v1/security/_activation/sharing_rule/:name` writes the declared rule's activation row, behind the same authority as the other activation doors: `manage_metadata`, and the platform operator under a wall, because the row covers every organization. A declared rule switched off is served nowhere. The write revokes every grant that carries the rule's name in the same request, and switching it back on re-derives them. The name must be a declared rule (`404` otherwise; a rule your organization authored keeps its own `active` field), and with no sharing-rule service bound the door answers `503`.
  - **A declaration over a stored row is reported, never made an overlay.** When a package declares a rule whose name a `sys_sharing_rule` row already holds in a scope (a package upgrade, or a copy customised before this release), the row keeps answering as its own rule. The declaration is not served beside it, and that is logged at `error` once per name and scope per process, with the remedy.
  
  Unchanged: rules whose name no declaration holds are created, renamed and switched as before. A stored row that already holds a declared name stays editable as itself. `DELETE /api/v1/sharing/rules/:idOrName` on a declared rule is still `403 PERMISSION_DENIED`, and is now answered the same way when the rule is switched off.

### Patch Changes

- 92ce3af: fix(plugin-approvals, plugin-audit, plugin-sharing): list views no longer show the target object's API name as an Object column
  
  Clause-②: no
  
  - **The Object column leaves these lists.** These list views showed `object_name`, the target object's API name (such as `showcase_announcement`), as plain text beside the `record_id` record pointer. They no longer list it:
    - `sys_approval_request`: `all_requests`, `my_pending`, `submitted_by_me` and `completed`;
    - `sys_approval_action`: `recent` and `all_actions`;
    - `sys_audit_log`: `recent`, `writes_only`, `record_views` and `all_events`;
    - `sys_record_share`: all six views;
    - `sys_share_link`: all four views.
  - **The Record column names the target record.** `record_id` is the id half of the `record_id` / `object_name` pointer pair. The console draws it as the target record, with its object's icon and the record's name, and fetches `object_name` for that cell without a column. This relies on a console that fetches a pointer's type half for its cell, as the console bundled with this release does; an older console draws the raw record id in that column.
  - **Unchanged:** `object_name` stays a declared field on all five objects, and the pointer pair, its indexes and every query on it are untouched. `sys_audit_log`'s `config_changes` view keeps its Object column, because its rows carry no `record_id`.
  
  A patch: entries removed from list view `columns` on shipped platform objects. No export, type, accepted value, served key or stored column changes.
- 54159fd: fix(plugin-audit, plugin-sharing): record pages, the `by_object` grouping and the Config list no longer name the target object by its API name
  
  Clause-②: no
  
  - **A record share's title is its recipient.** `sys_record_share` declares `nameField: 'recipient_id'`. It declared no title pointer, so the registry derived `object_name` (the first `*_name` text field), and a record share's page heading read the shared record's object API name, such as `showcase_announcement`. Its `titleFormat` is removed: the declared pointer outranks it everywhere.
  - **A share link's title is its label, else what it grants.** `sys_share_link` declares `nameField: 'label'`, the field the registry already derived. A link with no label is titled by `titleFormat: '{permission} · {audience}'` (for example "View · Anyone with the link") instead of `{object_name}/{record_id} ({permission})`.
  - **`sys_audit_log` drops its `titleFormat`.** It read `{action} · {object_name}`, but the required `action` pointer outranks it, so it never titled a row.
  - **The strip lists neither half of the pointer pair.** `highlightFields` no longer lists `object_name` or `record_id` on the three objects. The record page's strip drew them as stored text, an API name and a raw id. A strip field is also hidden from the Details tab, which is where `record_id` draws as the record card, headed by the target object's label.
  - **`sys_record_share.by_object` sorts by object instead of grouping on it.** A group header drew `object_name` as stored text. The sort still keeps one object's grants together.
  - **`sys_audit_log.config_changes` drops its Object column.** Its rows carry no `record_id`, so the column drew a stored API name (`sys_setting`, `sys_platform_setting` or `sys_user`) with no record beside it.
  - **Unchanged:** `object_name` stays a declared field on all three objects, and the pointer pair, its indexes and every query on it are untouched. On the record page, the Details tab still shows `object_name` as a row of its stored text.
  
  A patch: title and highlight declarations and list view keys change on shipped platform objects. No export, type, accepted value, stored column or authorable key changes.
- 39e93b9: fix(plugin-sharing, plugin-webhooks): the `by_object` lists of sharing rules and webhooks no longer head each group with an object API name
  
  Clause-②: no
  
  - **`sys_sharing_rule.by_object` and `sys_webhook.by_object` sort by object instead of grouping on it.** Both grouped on `object_name`, and a group header draws its value as stored text, so each group was headed by an API name such as `crm_account`. The sort on `object_name`, then `label`, still keeps one object's rows together, and the Object column still draws each object's icon and label.
  - **Unchanged:** `object_name` stays a declared field on both objects, with the same widget, and no stored column, index or query changes.
  
  A patch: one list view key is removed on each of two shipped platform objects. No export, type, accepted value, stored column or authorable key changes.
- 99e4eaa: fix(plugin-sharing): a record share's Recipient column names the recipient instead of drawing its raw id
  
  Clause-②: no
  
  - **`sys_record_share.recipient_id` declares `widget: 'recipient-picker'` and `dependsOn: ['recipient_type']`**, the display declaration `sys_sharing_rule.recipient_id` already carries. The console draws a field with this widget by naming the stored id through the row's `recipient_type`, so a user grant reads as the user's name in a list that shows the Recipient Type column beside it (Setup → Record Shares → All). A list that does not fetch `recipient_type` still draws the stored id.
  - **`object_name` is not a dependency here**: the face reads it only for the `field` recipient kind, which a record share cannot store.
  - **Unchanged:** `recipient_id` stays the same required text column, the object stays engine-owned and read-only through the data API, and `grant()` stays the only writer of a share row.
  
  A patch: one display hint on one field of a shipped platform object. No export, type, accepted value, stored column or authorable key changes.
- 0b7286f: fix(plugin-sharing): position- and team-recipient sharing rules are re-evaluated for the affected user when the membership behind the recipient changes
  
  Clause-②: no
  
  A sharing rule's grants are materialised per user. When a position assignment (`sys_user_position`) or a team membership (`sys_team_member`) is inserted, deleted, or updated in a column the recipient expansion reads (the user, the position or team, the organization, the validity window), every sharing rule whose recipient the row names is now re-evaluated for the user the row names, before the write returns. A new holder gains the rule's grants and a former holder loses them. Other users' grants, and rules naming other recipients, are not touched.
  
  The re-evaluation is scoped to that one user and to the rules naming the recipient: an indexed holder check, that user's grants of the rule, and the rule's criteria read only when the rule reaches the user. A bulk assignment import therefore costs one user-scoped pass per row and never a whole-rule pass. An organization's rule is re-evaluated only for rows of its own organization; a platform-global rule for every row.
  
  `SharingRuleService` gains `reconcileRuleForUser(rule, userId)`, the user-scoped pass these hooks run. No spec key, endpoint or configuration changes.
- 66949b7: feat(plugin-security)!: the four security-catalog row objects are retired — `sys_position`, `sys_permission_set`, `sys_position_permission_set` and `sys_capability` (ADR-0131 D3)
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: registered catalog-row-objects-retired -->
  
  **BREAKING**, shipped as `minor` under the repo's launch-window convention for breaking changes.
  
  Positions, permission sets and capabilities live in the security catalog — the environment registry, fed by package declarations and by environment metadata saved through `/api/v1/meta` (ADR-0131 D3). The four row objects that mirrored them are no longer registered, so their data and REST routes and their Setup object pages are gone. No table is dropped and no row is deleted.
  
  FROM → TO:
  
  - `GET|POST|PATCH|DELETE /api/v1/data/sys_permission_set` → `GET|PUT|DELETE /api/v1/meta/permission/:name`; to copy a set, `POST /api/v1/security/permission-sets/:name/clone` with `{ name, label }`.
  - `… /api/v1/data/sys_position` → `/api/v1/meta/position/:name`. A position's permission sets are its definition's `permissionSets`.
  - `… /api/v1/data/sys_position_permission_set` → the position definition's `permissionSets` (`PUT /api/v1/meta/position/:name`).
  - `… /api/v1/data/sys_capability` → read-only `GET /api/v1/meta/capability`; a package declares a capability with `defineCapability` (`stack.capabilities`).
  - Setup → Access Control → Positions / Capabilities / Permission Sets now open Setup's catalog lists (`/apps/setup/metadata/<type>?scope=environment`) instead of the object pages; the `sys_position` record page (`SysPositionDetailPage`) is removed.
  - An object permission on one of the four names in a permission set grants nothing and can be deleted.
  
  What else changes:
  
  - `sys_user_permission_set.permission_set_id` is a plain text column now, not a lookup: same column, same stored ids, same indexes. It is not written and grants nothing; a grant names its set by `permission_set`.
  - A permission set saved through the metadata door is written to no row: the `permission` mutation projector, the `sys_permission_set` and `sys_position` data-door write-throughs and the row-only position backfill are no longer registered.
  - On a fresh `single`-posture database the first human is promoted to platform administrator without reading any catalog row. An unscoped grant written before `sys_user_permission_set.permission_set` existed (it names no set) still withholds the promotion until the organization-ownership migration names it.
  - Uninstalling a package still revokes every grant naming a permission set the package declared, by the names the uninstalling door captures before the withdrawal (`declared`, `captureUninstallDeclared`), and now by those names alone: the cleanup reads and removes no `sys_permission_set` or `sys_position_permission_set` row, so the `sets` and `positionBindings` counts on its outcome are always 0. A grant written before `sys_user_permission_set.permission_set` existed names no set and is not reached; the organization-ownership migration names it.
  - On a `group` or `isolated` deployment the data-door half of the walled catalog refusal goes with the objects: a data-door insert, update or delete on `sys_position`, `sys_permission_set` or `sys_capability` answers `404 OBJECT_NOT_FOUND` for every caller instead of `403 PERMISSION_DENIED` below the platform operator. The refusal at the `/meta` write doors, the permission-set clone door and the `/packages` write doors is unchanged.
  - `capability-reference-unknown` no longer counts a `sys_capability` seed row as a declared capability — no runtime reader consults one. Declare the capability with `defineCapability`.
  - On an existing database `os migrate plan`'s unmanaged-table sweep now lists the `sys_position`, `sys_permission_set`, `sys_position_permission_set` and `sys_capability` tables: they keep their rows and no object declares them any more. The sweep only reports; nothing is dropped, and the tables stay for the organization-ownership migration.
  
  Removed exports, no replacement:
  
  - `@objectstack/plugin-security`: the object definitions `SysPosition`, `SysPermissionSet`, `SysPositionPermissionSet`, `SysCapability` (from `./objects`); `securityObjects` lists the remaining three.
  - `@objectstack/platform-objects/pages`: `SysPositionDetailPage`.
  - `@objectstack/spec`: `SystemObjectName.POSITION`, `SystemObjectName.PERMISSION_SET`; the four names leave `PLATFORM_OBJECTS_BY_PACKAGE['plugin-security']` and `PLATFORM_PROVIDED_OBJECT_NAMES`.
  - `@objectstack/core`: `isRowActive` and `ActivatableRow` — a catalog row's `active` column decides nothing; deactivation is the activation ledger's (`sys_metadata_activation`).
  - `@objectstack/objectql`: the published `PLATFORM_OBJECT_TENANCY` record loses its `sys_permission_set` key (the other three names were never in it). A removed key of an exported constant is a narrowing, so `@objectstack/objectql` takes `minor` under the launch-window convention for breaking changes.
- 9847f87: fix(plugin-sharing): a minted share link carries an organization, never a NULL one (ADR-0131 D9)
  
  Clause-②: no
  
  - **What changed.** `ShareLinkService.createLink` stamps `sys_share_link.organization_id`. It takes the organization of the linked record, read under the system context. When the record names none, it takes the acting context's organization (`tenantId`). When neither names one, it applies the system-write rule: under `single`, the Default Organization (the only one there is); under a wall (`group` or `isolated`), the mint is refused with `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` (status 500) and no link is written. The same refusal answers a `single` install that holds no organization or several. Before, every link was written with `organization_id` NULL.
  - **A link on another organization's record.** Under `group`, a member active in one organization can mint on a visible record of another. The link carries the record's organization, not the session's.
  - **What stays the same.** Under `single` nothing a user sees changes. The mint response keeps the `ShareLink` shape and carries no organization field. A composition that registers no `sys_organization` object writes links as before.
  - **Who can meet the refusal.** No in-repo caller reaches it. Both share-link routes need a signed-in caller. Under a wall, an organization-less API key is refused at admission, and an organization-less session cannot see a record that has a tenant column, so its mint is refused before the stamp. The refusal is reached by a walled, organization-less caller minting on an object with no tenant column, or by a system caller that threads no `tenantId`. The fix is to pass the organization on the context (`{ isSystem: true, tenantId }`).
- 1c563af: Setup → Record Shares opens on every share, not on the shares granted to the administrator. Before this, the entry named no view, and `sys_record_share` declared the caller-scoped "Granted to Me" view (`recipient_id = {current_user_id}`) first.
  
  Clause-②: no
  
  - `sys_record_share` now declares its unscoped "All" view (`all_shares`) first. "Granted to Me" and "Granted by Me" follow it, still as tabs. No view is added, removed or changed.
  - The Setup entry `nav_record_shares` now names `all_shares` with `viewName`, so it does not depend on the declared order.
  - The generated translation bundles follow the new view order. No translated text changed.
  - ⛔ No schema, parse, export or accept-set change.
- 4f4c4ed: fix(auth,services): the remaining in-process session reads no longer renew a browser session behind its cookie (#22258)
  
  **What was wrong.** better-auth's `getSession` renews a session older than `session.updateAge`: it moves `sys_session.expires_at` to `now + expiresIn` and stages the renewed session cookie on that call's own response. Nine doors in these packages read the session in-process (`auth.api.getSession({ headers })`) and answer with their own response, so the renewal landed in the database and its cookie was discarded. The browser kept its old cookie, which then expired before the session: a dead cookie beside a live bearer, after which every cookie-only path saw a signed-out user. The doors: `POST /api/v1/auth/admin/oauth2/toggle-disabled`, every `/api/v1/auth/admin/*` mount behind the shared platform-admin gate, `POST /api/v1/auth/admin/unlock-user` and `POST /api/v1/auth/admin/has-permission` (`@objectstack/plugin-auth`); `POST /api/v1/webhooks/redeliver`; the storage upload and download doors (`/api/v1/storage/*`); the share-link management routes (`/api/v1/share-links`); the settings routes (`/api/settings`); and the datasource-admin routes (`/api/v1/datasources/*`).
  
  **The rule now** is the one the REST, dispatcher, current-user and cloud-connection doors already follow. Each of these reads goes through `inProcessSessionReadInput(headers)` from `@objectstack/types`:
  
  - **A request carrying a session cookie** (a browser, including a console that sends its cookie beside its bearer) reads with `query.disableRefresh`. The session renews only through `GET /api/v1/auth/get-session`, which re-issues the cookie with `Max-Age = expiresIn`, so cookie and session expire together.
  - **A bearer-only request** (`@objectstack/client` outside a browser, the `os` CLI) is unchanged: a read past `updateAge` still renews the session, and no cookie is set on a response to a request that sent none.
  
  **Upgrading.** Nothing to change. `@objectstack/plugin-webhooks` now depends on `@objectstack/types` directly; it already reached it through `@objectstack/core`.
- b3a3634: docs: four contract docblocks now describe what the code decides. No type, schema or runtime change.
  
  Clause-②: no
  
  - **`ControlledByParentWriteDenialLeg` (`@objectstack/spec`).** The `master_chain` leg has three resolution refusals: no relation to derive from, a row that is not present, and an empty master reference. Each names the master whose own master the walk could not derive. That master is the record's own master, when it is itself `controlled_by_parent`, or any master above it. The docblock said only a master above the record's own master. The next sentence now says "past the record itself" where it said "above the first hop", so the two agree. The `record_not_found` bullet of `ControlledByParentWriteUnresolvedReason` had the same first-hop gap for a missing master row: it now says an absent row of a master that is itself `controlled_by_parent` is the `master_chain` leg, on the first hop or above it, and the legs judge a missing row only where the master governs its own rows.
  - **`ISharingService.canEdit` (`@objectstack/spec`) and `SharingService.canEdit` (`@objectstack/plugin-sharing`).** The caller lists no longer name the `sys_attachment` and `sys_comment` parent gates. Those gates read `checkEdit` and the master-detail write check. The `ISharingService.canEdit` sentence on how they reach the service now names `checkEdit`.
  
  `ControlledByParentWriteDenialLeg`, `ControlledByParentWriteOutcome`, `canEdit` and `checkEdit` keep their declared shapes, and no verdict, outcome or refusal changes.
- 3c1a046: fix: a route's catch-all `500` answers its own generic text, never the caught error's message, and `@objectstack/types` exports the writer that does it, `sendServerFault`
  
  Clause-②: yes (widening) — `@objectstack/types` gains one export, `sendServerFault`; nothing is removed, renamed or narrowed, and no response field changes shape.
  
  A declared 5xx does not carry the text of the error it caught: that text can name server internals, such as a path, a host or a table. The REST layer already withheld it. The storage, settings and i18n route families and the share-link routes answer in the nested `{ success: false, error: { code, message } }` envelope and did not: their catch-all `500` sent the caught error's message to the caller.
  
  - **What a caller now reads.** The same `status` and `code` as before, with the route's own generic text as `error.message`: `Internal error` on the storage and i18n routes, the route's message on the settings routes (`Failed to list manifests`, `Failed to read namespace`, `Failed to write namespace`, `Action failed`), and the route's `Failed to …` message on the share-link routes. On the storage routes this includes the metadata store's outage sentence, which an operator now reads in the server log.
  - **What the operator reads.** The original error, stack included, in one `[5xx]` server-fault line. The storage byte routes, which already withheld the text, logged two lines per fault and now log one. A line names the mounted route pattern when the route passes one, never the request URL.
  - **Unchanged.** Every `4xx` answer. The settings `SETTINGS_CRYPTO_UNAVAILABLE` refusal, which keeps its prescription. The authorization-store outage `503`, which keeps its declared code and message. The storage `501 NOT_IMPLEMENTED` answers. On the share-link routes, any error that declares its own `status` keeps the envelope it declares.
  - **`sendServerFault(res, status, code, message, thrown, request?)`** (new, `@objectstack/types`): writes `message` in the declared envelope, and hands `thrown` to the server-fault log with its stack, as the fault's one line. Use it for an arm that answers a caught fault. Keep `sendError` for a `4xx` and for a `5xx` whose text you wrote for the reader. `request` is the mounted route pattern, never the request URL.
- 37510aa: feat(security): the guest's grants channel — an anonymous request at a guest-entry door holds the sets bound to the `guest` anchor, in the one organization the deployment resolves for it (ADR-0138 E1, D3/D4)
  
  ADR-0087 disposition: none. No authorable key, accept set or stored shape moves: no spec schema, metadata type, stored row or published response field is added, removed, renamed or re-shaped. A declared binding that was not enforced becomes enforced (ADR-0090 D9, as ADR-0138 D3 amends it).
  
  **The bindings that start granting.** On the reference apps, none: `app-showcase`, `app-crm`, `app-multi-package` and `app-todo` declare no definition of the `guest` anchor that names a set. `app-showcase` ships `showcase_guest_portal` as a capability an administrator may bind and binds it to no anchor (its `client_portal_user` position is an ordinary position), and `app-crm`'s `guest_portal` is the public form doors' set, which keeps its own posture. No reference app declares a permission set named `guest`, so no grant stops either. A set starts granting only where a deployment holds an environment definition of the `guest` position that names it.
  
  What changes:
  
  - **`@objectstack/core`** — the anonymous branch of `resolveAuthzContext` resolves the guest's grants on a face that takes the explicit guest entry (the new `guestEntry` input). It reads the sets the `guest` position's definition names, through the same position-bound read every position uses, and the activation ledger as for any held set. It resolves them only in the organization the guest entry's organization step derives (`resolveGuestOrganization`), which asks ADR-0131 D9's predicate and no second spelling of it. With nothing bound, the guest holds no set and no read is issued. The predicate itself, `resolveSystemWriteOrganization`, moves to `@objectstack/core` so both of its askers share it. New exports: `resolveGuestOrganization`, `resolveSystemWriteOrganization` (with `SystemWriteOrganizationDecision` and `SystemWriteRefusalReason`), and `GuestOrganizationUnresolvedError` with `isGuestOrganizationUnresolvedError` and its constants.
  - **`@objectstack/objectql`** — `resolveSystemWriteOrganization` and its two types are re-exported from `@objectstack/core` as the same bindings. Nothing a caller imports changes.
  - **`@objectstack/plugin-security`** — the set resolution treats the guest's sets as any requested set, and no longer folds the guest's position into the request. A permission set that merely shares the anchor's name no longer reaches an anonymous caller, and the baseline and `everyone` never did. At the CRUD gate, a guest that reaches a data operation acting in no organization, on a deployment where the organization step refuses, is refused before the operation runs.
  - **`@objectstack/plugin-sharing`** — the read filter answers deny-all for the guest on every object that record sharing scopes, before the sharing-model branch: the guest reaches rows only through share links, never through the object's sharing model (ADR-0138 D3 item 6, as the maintainer's ruling C amends it). `externalSharingModel` is still not read for any caller. Share links are redeemed at their own door and are unchanged.
  - **`@objectstack/runtime`** — the runtime face, which serves the guest, asks for the guest's grants.
  
  What an anonymous caller sees at an `authRequired: false` endpoint of `type: 'object_operation'`:
  
  - **One organization, a set bound to `guest`:** the operation runs as the guest, under that set, in that organization. A read the set grants is admitted and returns no row, whatever the object's sharing model (`private`, `public_read`, `public_read_write` or `controlled_by_parent`): the guest reaches a record only through a share link. A create the set grants lands in that organization with no owner.
  - **Nothing bound:** `403 PERMISSION_DENIED`, as before.
  - **A walled deployment, several organizations, or none:** `501 NOT_IMPLEMENTED`, naming the missing site binding (ADR-0138 D5), where it used to be `403 PERMISSION_DENIED` with nothing granted. Nothing that was served stops being served. The operator's log names the reason once.
  
  Unchanged: share links, which still serve an anonymous caller the one record they name, with `publicSharing.eligibility` checked at the mint and at every redemption; the public form doors, which keep their own posture and organization; the flow door, which runs under the flow's own declared posture; every surface that answers an anonymous request `401`; and every signed-in caller.
  
  Level: `minor` for `@objectstack/core`, because new exported symbols widen its published index; `patch` for the other four, whose exports do not move.
- c245986: fix(plugin-sharing): a record-share grant refused for a non-user recipient names the sharing-rule recipient that delivers it, so a `group` caller is sent to `team`
  
  Clause-②: no
  
  **What was wrong.** `ISharingService.grant` writes a record share for a `user` only (ADR-0078), and refuses `group`, `position` and `unit_and_subordinates` with one sentence. FROM: "VALIDATION_FAILED: recipientType must be 'user' (received "group") — group/position recipients are delivered via sharing rules (ADR-0111 D7)". The sharing-rule vocabulary has no `group` recipient: a rule spells it `team`, since the ADR-0090 D3 rename. A caller or an AI that followed the remedy wrote a rule naming `group`, which neither the authoring `sharedWith.type` enum nor the `sys_sharing_rule.recipient_type` select offers. A `unit_and_subordinates` caller read a sentence that did not name its value.
  
  **What changed.** Each declared value's remedy names its own rule recipient. TO:
  
  - `group`: "… — a group recipient is delivered via a sharing rule with recipient type 'team', its name since the ADR-0090 D3 rename (ADR-0111 D7)"
  - `position`: "… — a position recipient is delivered via a sharing rule with recipient type 'position' (ADR-0111 D7)"
  - `unit_and_subordinates`: "… — a unit_and_subordinates recipient is delivered via a sharing rule with recipient type 'unit_and_subordinates' (ADR-0111 D7)"
  
  A value no record share declares (an untyped REST body sending `team`, say) is told so, and is named no route: "… — "team" is not a record-share recipient type (ADR-0111 D7)".
  
  **Unchanged.** Which values `grant()` accepts (`user` only), the `VALIDATION_FAILED` code and its 400, the first clause of every refusal, the retired `guest` value's own prescription, and the record-share vocabulary. Nothing is written for a refused grant.
- 28e294f: fix(plugin-sharing, runtime): a share link that has a password and is limited to signed-in users answers an anonymous visitor `401 SIGN_IN_REQUIRED`, whatever password was sent
  
  Clause-②: no — every request refused before is still refused; only which refusal code an anonymous caller reads changes.
  
  A share link can carry a password and the `signed_in` audience together. For such a link, the share-link resolve door answered an anonymous visitor from the password before the audience: `NEEDS_PASSWORD` with no password, and `WRONG_PASSWORD` with any password, the correct one included. The console's shared-record page then told a visitor who typed the right password "Wrong password.", and never offered sign-in.
  
  - **Anonymous caller, `signed_in` link:** `401 SIGN_IN_REQUIRED` with no password, a wrong one or the correct one. The answer is the same for all three, so it never tells an anonymous caller whether a password is right. Once signed in, the visitor is asked for the password as before.
  - **Signed-in caller:** unchanged. `401 NEEDS_PASSWORD` with no password, `401 WRONG_PASSWORD` with a wrong one, and the record with the correct one.
  - **Unchanged:** links with any other audience (a `public` link with a password still answers `NEEDS_PASSWORD` / `WRONG_PASSWORD` to an anonymous caller), the expired-or-revoked `410 EXPIRED_OR_REVOKED`, the `404 INVALID_OR_EXPIRED` for an unknown token or an object with public sharing switched off, and every link that resolves.
  - Both mounts of the resolve door answer alike: plugin-sharing's share-link routes and the runtime dispatcher's share-links domain.
- c980d11: fix(plugin-sharing, runtime): a shared conversation's messages open for exactly the callers its share link opens for, on both mounts
  
  Clause-②: no — `/messages` now reaches the answer `/resolve` already gives the same caller for the same link, on the same mount; who can open a share link is unchanged.
  
  A share link to an AI conversation has two public routes: `/resolve` returns the conversation, and `/messages` returns its messages. Both check the link through the same service call. `/resolve` passed it every input an audience is judged by. `/messages` passed fewer, so it refused callers `/resolve` served:
  
  - **A `signed_in` link, a signed-in caller:** plugin-sharing's share-link routes answered `/messages` with `404 NOT_FOUND`, so the console's shared-conversation page showed the conversation with no messages. It now returns the messages, as the runtime dispatcher's share-links domain already did.
  - **An `email` link, an allowlisted `?email=`:** both mounts answered `/messages` with `404 NOT_FOUND`. Both now read `?email=` on `/messages` exactly as on `/resolve`, and return the messages.
  - **Unchanged:** every caller `/resolve` refuses is still refused on `/messages` with `404 NOT_FOUND`: an anonymous caller of a `signed_in` link, and a caller of an `email` link with no email or an off-list email, signed in or not. A password-protected link still needs its password on both routes. `/resolve` is unchanged.
- 0ecac96: fix(plugin-sharing, runtime): a share link limited to an email allowlist answers every caller it does not open for with `404 INVALID_OR_EXPIRED`, whatever email and password were sent
  
  Clause-②: no — every request refused before is still refused, and every request served before is still served; only which refusal code a caller reads changes.
  
  A share link can carry a password and the `email` audience together. For such a link, the share-link resolve door answered a caller it did not open for from the password, never the audience: `401 NEEDS_PASSWORD` with no password, and `401 WRONG_PASSWORD` with any password, the correct one included, when the email sent was missing or not on the allowlist. A caller with the right password read "Incorrect password".
  
  - **An `email` link, any caller it does not open for:** `404 INVALID_OR_EXPIRED`, with or without an email, with no password, a wrong one or the correct one, signed in or not. It is the answer a password-less `email` link already gave and an unknown token gives, so it tells the caller neither whether the email is on the allowlist, nor whether the password is right, nor whether the link has a password. The door does not read the email to choose its answer.
  - **Served, unchanged:** an allowlisted email with the correct password (or, on a link without a password, an allowlisted email alone) still opens the record. An API or SDK caller sends both together; the door no longer prompts for the password first.
  - **Unchanged:** links with any other audience, including the `signed_in` order (`401 SIGN_IN_REQUIRED` before sign-in, the password arms after), a `public` link's `NEEDS_PASSWORD` / `WRONG_PASSWORD`, and the expired-or-revoked `410 EXPIRED_OR_REVOKED`.
  - Both mounts of the resolve door answer alike: plugin-sharing's share-link routes and the runtime dispatcher's share-links domain.
- d1e2841: fix(plugin-sharing): an email-audience share link's refusal does the same work whatever email and password are presented
  
  The refusal of an `email`-audience share link no longer does a different amount
  of work depending on the caller's input, as its answer bytes already did not.
  The refusal and the served response are byte-for-byte unchanged.
  
  Clause-②: no
- 099cc9d: Clause-②: no
  
  The approval, security, automation and sharing objects describe their records in plain admin
  sentences. Approval Delegations now reads "While someone is away, approvals assigned to them
  personally go to their delegate.", Record Shares "Records shared beyond their owner, one row per
  grant.", User Positions "Which positions each user holds, one row per assignment.", Audience
  Binding Suggestions "A package's suggestion to give one of its permission sets to everyone who
  signs in, and the decision taken on it." and Automation Runs "Paused automation runs waiting to
  resume, and the recent history of finished runs." Field help on Approval Requests, Approval
  Delegations, User Positions, User Permission Sets and Audience Binding Suggestions, the
  descriptions of the `organization_admin_no_bypass`, `mcp_agent_data_read` and
  `mcp_agent_data_write` permission sets, the flow-dispatch ledger's description and the
  reserved-position refusal no longer carry design-record numbers or runtime vocabulary; those
  references stay in the code comments. The zh-CN, ja-JP and es-ES translations follow. Wording
  only: no field, permission or behaviour changes.
- 6dede7a: fix(runtime, plugin-sharing): on the standalone server, an anonymous caller of any `/api/v1/notifications` verb or any `/api/v1/share-links` path off the two token faces is answered `401 UNAUTHENTICATED` in the dispatcher's standard envelope
  
  Clause-②: no
  
  The v18 text for these two doors reads "`/notifications`: `401 UNAUTHENTICATED` on every face" and "`/share-links`: `401 UNAUTHENTICATED` on the create, list and revoke faces and on every path the domain does not serve", in "the dispatcher's standard envelope … with the shared message every other dispatcher domain answers with". A host that reaches the dispatcher through `@objectstack/hono`'s catch-all already answered that way. The standalone server (the one `os dev` and `os serve` run) did not:
  
  - `/api/v1/notifications`, `/api/v1/notifications/read` and `/api/v1/notifications/read/all` were each mounted for the one verb they serve, so any other verb never reached the `notifications` domain and the HTTP adapter answered `405`, naming the allowed methods, to an anonymous caller as well.
  - `/api/v1/share-links` is served there by `@objectstack/plugin-sharing`'s routes, not by the dispatcher. They registered five routes and nothing else, so another verb or path got the adapter's `405` or `404`, and the create, list and revoke faces answered `401` with a sentence of their own ("Sign in to list share links") and no `error.httpStatus`.
  
  What the standalone server answers now:
  
  - **Anonymous caller.** `401 UNAUTHENTICATED`, `{ success: false, error: { code: 'UNAUTHENTICATED', message: 'Authentication is required to access this endpoint.', httpStatus: 401 } }`, on every verb of the three notifications paths, and on every verb and path under `/api/v1/share-links` except `GET /share-links/:token/resolve` and `GET /share-links/:token/messages`, which the capability token still admits. A body the server cannot parse does not outrank this answer anywhere under `/api/v1/share-links`, nor on the notifications verbs no face serves.
  - **Signed-in caller of a verb or path that is not served.** Still refused. On the notifications paths the domain answers it: `404 ROUTE_NOT_FOUND` from the dispatcher (or the `501` capability answer on a deployment with no inbox), where the adapter used to answer `405`. Under `/api/v1/share-links` the share-link routes answer it themselves: `404 ENDPOINT_NOT_FOUND`, naming the request, where the adapter used to answer `405` or `404`. No `Allow` header is sent on either.
  
  Every request that was served is served as before. A notifications sub-path no face names, such as `/api/v1/notifications/<anything>`, is still not mounted on the standalone server and is answered `404`.
- ef1fcb2: A declared index states its uniqueness scope: bare `unique: true` on `indexes[]` is refused (protocol 18, ADR-0120 D1/D7), stored metadata converts it to `unique: 'global'` with zero drift, and `VISIBILITY_STRICT_OPTIONS` leaves `@objectstack/spec`'s public surface.
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: registered declared-index-bare-unique-true-retired, visibility-strict-options-unexported -->
  
  **BREAKING**: an accept-set narrowing on a published authoring surface and one export removal, shipped as `minor` under the launch-window convention for accept-set narrowings (Changesets pre mode is not in on `main`).
  
  **Why.** On a declared index, bare `unique: true` was the one `unique` spelling whose scope was positional. It built the index over exactly `fields`, one holder across the whole installation, while reading like "unique per organization" to an author who knew the field-level meaning. 17.x warned (lint `unique/unscoped-declared-index`). Protocol 18 refuses it, so the scope is always stated.
  
  **What is refused.** A declared index (`objects[].indexes[]`, `objectExtensions[].indexes[]`) whose `unique` is bare `true`. The refusal names both replacements, and says which one keeps the index bare `true` built. It is raised by:
  
  - the schema (`IndexSchema.unique`, now `false | 'global' | 'organization'`), at every door that parses: `ObjectSchema.create()` and `ObjectSchema.parse()`, `defineStack`, `os validate`, `os build`, and the runtime save door (`422 INVALID_METADATA`). `tsc` refuses it too, because the input type no longer admits `true`;
  - lint `unique/unscoped-declared-index`, now an `error` and a gating rule on all three commands. It is what refuses the spelling under `os lint`, which never parses.
  
  **What converts.** The protocol-18 ADR-0087 conversion `declared-index-unique-scope` rewrites a declared index's bare `true` to `'global'` on every data-at-rest seam: stored `sys_metadata` rows (`applyConversionsToStoredItem`), built artifacts inside their declared-floor window, and `os migrate meta --from 17`. `'global'` is exactly the index bare `true` built, so the physical index is byte-identical and the drift plan is empty. It is retired from the authoring funnel, so a live author is refused and taught instead of converted silently.
  
  **What stays accepted.** Field-level `unique: true` still means one holder per organization and stays valid indefinitely. On a declared index, `unique: false` or omitted, `'global'` and `'organization'` parse exactly as before.
  
  ## FROM → TO
  
  | you wrote | write instead |
  |:--|:--|
  | `indexes: [{ fields: [...], unique: true }]` | `indexes: [{ fields: [...], unique: 'global' }]`: the same index, nothing on disk changes |
  | …the same, when you meant one holder per organization | `unique: 'organization'`: the driver prepends the NULL-safe organization key part at registration, and `os migrate plan` shows the index change |
  | `import { VISIBILITY_STRICT_OPTIONS } from '@objectstack/spec/shared'` (or the root entry) | delete the import: it was an internal option bag for the spec's own visibility-carrying schemas, and those schemas are unchanged |
  
  **The one-line fix: on every declared index, write `unique: 'global'` where you wrote `unique: true`.** Run `os migrate meta --from 17` to list the mechanical edits for existing sources; apply them by hand.
  
  **Who is affected, measured.** At `e67ba80049`, an AST census found 48 declared indexes with bare `unique: true` in 39 source files of this repository, all platform and plugin objects. Every one is respelled `'global'` in this change, and the nine-key S5 corpus is pinned to build byte-identical indexes before and after (`driver-sql`'s `sql-driver-unique-tenancy.test.ts`). `examples/**` and `apps/**` carry none. Deployed metadata and other repositories were not measured.
  
  ### The kit
  
  - **The refusal.** `IndexSchema.unique` in `data/object.zod.ts`, with its own prescription. The lint rule moved from `warning` to `error` and from advisory to gating.
  - **The conversion.** `declared-index-unique-scope` (`toMajor: 18`, retired from the load path, `retiredAfter: '17.7.0'`), with its S4/S5 fixture.
  - **The ledger.** The D3 semantic entries `declared-index-bare-unique-true-retired` (the scope each respelled index really meant is the author's call) and `visibility-strict-options-unexported`, plus a step-18 rationale fragment.
  - **The export.** `VISIBILITY_STRICT_OPTIONS` moved to the unbarrelled `shared/visibility-strict-options.ts`, beside its type `StrictObjectOptions`. `check:api-surface` counts the removal.
  - **The pins.** The "`'global'` is a synonym of `true`" driver pin retired with the bare spelling. The verbatim pin is stated in `'global'`.
- Updated dependencies [5a871e4]
- Updated dependencies [f8ef144]
- Updated dependencies [fc34d00]
- Updated dependencies [ffba02e]
- Updated dependencies [29d0ed3]
- Updated dependencies [29d0ed3]
- Updated dependencies [1b40780]
- Updated dependencies [78b1a63]
- Updated dependencies [d11fa8c]
- Updated dependencies [d11fa8c]
- Updated dependencies [ca426cb]
- Updated dependencies [4ad3ce5]
- Updated dependencies [8016a9d]
- Updated dependencies [df9d07e]
- Updated dependencies [913fd6d]
- Updated dependencies [8eac321]
- Updated dependencies [de43524]
- Updated dependencies [a5a781b]
- Updated dependencies [04669a4]
- Updated dependencies [073b1b2]
- Updated dependencies [9a7838e]
- Updated dependencies [191e043]
- Updated dependencies [b12e16a]
- Updated dependencies [fbafb85]
- Updated dependencies [35450f0]
- Updated dependencies [4840720]
- Updated dependencies [1e8b628]
- Updated dependencies [12d1476]
- Updated dependencies [7c2eab9]
- Updated dependencies [bd6dab0]
- Updated dependencies [14ccb1d]
- Updated dependencies [7879391]
- Updated dependencies [c0803b0]
- Updated dependencies [d117382]
- Updated dependencies [0ca8180]
- Updated dependencies [4bc3bec]
- Updated dependencies [1f949da]
- Updated dependencies [ecb7b44]
- Updated dependencies [41edf73]
- Updated dependencies [1c1144f]
- Updated dependencies [014863d]
- Updated dependencies [f7005cb]
- Updated dependencies [3983965]
- Updated dependencies [3230d66]
- Updated dependencies [0c910d5]
- Updated dependencies [9d13b5f]
- Updated dependencies [317cddd]
- Updated dependencies [b2e7870]
- Updated dependencies [fec87e7]
- Updated dependencies [34dba5a]
- Updated dependencies [c28f317]
- Updated dependencies [2e10c9a]
- Updated dependencies [dac99c2]
- Updated dependencies [0d3ea29]
- Updated dependencies [67b669e]
- Updated dependencies [0253192]
- Updated dependencies [0253192]
- Updated dependencies [48cca4a]
- Updated dependencies [bfc15d2]
- Updated dependencies [2ff0825]
- Updated dependencies [7aa8d51]
- Updated dependencies [95a8435]
- Updated dependencies [c8a9783]
- Updated dependencies [60bcfe7]
- Updated dependencies [66949b7]
- Updated dependencies [d112087]
- Updated dependencies [4806b18]
- Updated dependencies [1802315]
- Updated dependencies [06cc45d]
- Updated dependencies [8c5aa50]
- Updated dependencies [7de0265]
- Updated dependencies [7895671]
- Updated dependencies [b389e43]
- Updated dependencies [c8b062f]
- Updated dependencies [117d34d]
- Updated dependencies [6729e10]
- Updated dependencies [1920cf3]
- Updated dependencies [1920cf3]
- Updated dependencies [41d0d40]
- Updated dependencies [c52bfb4]
- Updated dependencies [f9b4217]
- Updated dependencies [eebaf3b]
- Updated dependencies [c7d6037]
- Updated dependencies [72b26ed]
- Updated dependencies [2d21b9c]
- Updated dependencies [f66fdc7]
- Updated dependencies [9fdb127]
- Updated dependencies [615c696]
- Updated dependencies [968acc8]
- Updated dependencies [111ffff]
- Updated dependencies [12b9daf]
- Updated dependencies [7958bdf]
- Updated dependencies [d85615d]
- Updated dependencies [6a06e3b]
- Updated dependencies [0e9e7b7]
- Updated dependencies [0af4f66]
- Updated dependencies [9a0401f]
- Updated dependencies [9c93ce6]
- Updated dependencies [77a94d8]
- Updated dependencies [ac9f8bd]
- Updated dependencies [879bd38]
- Updated dependencies [04e776b]
- Updated dependencies [1c563af]
- Updated dependencies [a7df552]
- Updated dependencies [2f70c22]
- Updated dependencies [78f841b]
- Updated dependencies [c565813]
- Updated dependencies [d5a14dd]
- Updated dependencies [f85a83b]
- Updated dependencies [93125ae]
- Updated dependencies [56c8844]
- Updated dependencies [5cfd866]
- Updated dependencies [d4680d2]
- Updated dependencies [c8d06a9]
- Updated dependencies [cdeabec]
- Updated dependencies [d7c5c33]
- Updated dependencies [a87d8be]
- Updated dependencies [15ec50e]
- Updated dependencies [db4c45b]
- Updated dependencies [51290bc]
- Updated dependencies [ad381fd]
- Updated dependencies [4e4111c]
- Updated dependencies [2b61f2d]
- Updated dependencies [8f2e808]
- Updated dependencies [3b49318]
- Updated dependencies [4e9fe9f]
- Updated dependencies [fe98cc6]
- Updated dependencies [9ad3d24]
- Updated dependencies [326a90a]
- Updated dependencies [9fe7448]
- Updated dependencies [2e11d90]
- Updated dependencies [0b7ba4d]
- Updated dependencies [4578c56]
- Updated dependencies [c512c25]
- Updated dependencies [0b997ea]
- Updated dependencies [215e662]
- Updated dependencies [3d886ee]
- Updated dependencies [f4069c5]
- Updated dependencies [d8d0711]
- Updated dependencies [a45d5d8]
- Updated dependencies [b15f8a1]
- Updated dependencies [f6e1d49]
- Updated dependencies [345d3f3]
- Updated dependencies [e9a1f5c]
- Updated dependencies [40a6ee5]
- Updated dependencies [e87070e]
- Updated dependencies [5910b5e]
- Updated dependencies [7098aca]
- Updated dependencies [97610a5]
- Updated dependencies [081e6a0]
- Updated dependencies [c8c803c]
- Updated dependencies [f05649f]
- Updated dependencies [e030d43]
- Updated dependencies [1884948]
- Updated dependencies [3089848]
- Updated dependencies [e23eccb]
- Updated dependencies [ac8f2c5]
- Updated dependencies [746637e]
- Updated dependencies [fdfdd7e]
- Updated dependencies [db9cf80]
- Updated dependencies [e75dced]
- Updated dependencies [9af0005]
- Updated dependencies [9af0005]
- Updated dependencies [440bed6]
- Updated dependencies [94379f4]
- Updated dependencies [b2549a8]
- Updated dependencies [ee8751d]
- Updated dependencies [96e4be4]
- Updated dependencies [194a42d]
- Updated dependencies [35ef501]
- Updated dependencies [faf6348]
- Updated dependencies [557ae7c]
- Updated dependencies [6a3fe25]
- Updated dependencies [7731d70]
- Updated dependencies [da989bb]
- Updated dependencies [3073b72]
- Updated dependencies [c76edeb]
- Updated dependencies [5b12503]
- Updated dependencies [514bf3c]
- Updated dependencies [20e7d52]
- Updated dependencies [b3a3634]
- Updated dependencies [3e72f93]
- Updated dependencies [f89b5f5]
- Updated dependencies [d25b187]
- Updated dependencies [0e00d36]
- Updated dependencies [018b077]
- Updated dependencies [d748ae8]
- Updated dependencies [dab6bf4]
- Updated dependencies [ed1de8c]
- Updated dependencies [a00cf99]
- Updated dependencies [a00cf99]
- Updated dependencies [5fb1746]
- Updated dependencies [29a163f]
- Updated dependencies [e223152]
- Updated dependencies [9f5eca5]
- Updated dependencies [9963322]
- Updated dependencies [b27b894]
- Updated dependencies [874a38d]
- Updated dependencies [02d9f69]
- Updated dependencies [f53f14b]
- Updated dependencies [a800912]
- Updated dependencies [87cd458]
- Updated dependencies [d973c34]
- Updated dependencies [156ddfa]
- Updated dependencies [1bb1da1]
- Updated dependencies [5081090]
- Updated dependencies [615cba8]
- Updated dependencies [b6eb25f]
- Updated dependencies [165587e]
- Updated dependencies [e04759d]
- Updated dependencies [ea9fd99]
- Updated dependencies [b32ee3e]
- Updated dependencies [b62260c]
- Updated dependencies [91f46d0]
- Updated dependencies [e5899a6]
- Updated dependencies [d7b26df]
- Updated dependencies [490cb6d]
- Updated dependencies [e865300]
- Updated dependencies [ec7c7e0]
- Updated dependencies [ec7c7e0]
- Updated dependencies [c74d843]
- Updated dependencies [6d5191e]
- Updated dependencies [85edd61]
- Updated dependencies [e84aeb3]
- Updated dependencies [322ff1e]
- Updated dependencies [7b0a9c9]
- Updated dependencies [5fc57b3]
- Updated dependencies [fe58bbc]
- Updated dependencies [c4e7fa5]
- Updated dependencies [581ca7d]
- Updated dependencies [3f0b6f2]
- Updated dependencies [3f0b6f2]
- Updated dependencies [b7cd1af]
- Updated dependencies [9814035]
- Updated dependencies [55382dc]
- Updated dependencies [b1d701b]
- Updated dependencies [efcbac7]
- Updated dependencies [51f36e7]
- Updated dependencies [31b5a5f]
- Updated dependencies [20028df]
- Updated dependencies [69d4218]
- Updated dependencies [5ce6773]
- Updated dependencies [8532783]
- Updated dependencies [eb20c33]
- Updated dependencies [9432bac]
- Updated dependencies [6373952]
- Updated dependencies [3caae97]
- Updated dependencies [3f69471]
- Updated dependencies [87e902d]
- Updated dependencies [8bc7836]
- Updated dependencies [e5687cb]
- Updated dependencies [1e62f71]
- Updated dependencies [777eed2]
- Updated dependencies [ec7f7f8]
- Updated dependencies [038d4c9]
- Updated dependencies [5677add]
- Updated dependencies [8d8f965]
- Updated dependencies [147a0d1]
- Updated dependencies [21914c3]
- Updated dependencies [1959aac]
- Updated dependencies [ed03834]
- Updated dependencies [e1deaef]
- Updated dependencies [4663801]
- Updated dependencies [3071d3e]
- Updated dependencies [d294951]
- Updated dependencies [1badd31]
- Updated dependencies [58f5c90]
- Updated dependencies [55828c5]
- Updated dependencies [7856110]
- Updated dependencies [9b37edb]
- Updated dependencies [4216796]
- Updated dependencies [a22e67b]
- Updated dependencies [5f37d36]
- Updated dependencies [62ce45d]
- Updated dependencies [c5b43b6]
- Updated dependencies [39e93ef]
- Updated dependencies [02bec6c]
- Updated dependencies [719183f]
- Updated dependencies [c40a0dd]
- Updated dependencies [bb7ccde]
- Updated dependencies [df000d4]
- Updated dependencies [646303e]
- Updated dependencies [8464380]
- Updated dependencies [8c10776]
- Updated dependencies [252a582]
- Updated dependencies [abf8655]
- Updated dependencies [f931e76]
- Updated dependencies [1912af4]
- Updated dependencies [e5f9f01]
- Updated dependencies [76815b9]
- Updated dependencies [4d1e4a8]
- Updated dependencies [4cc3ff9]
- Updated dependencies [c056979]
- Updated dependencies [4f68ba1]
- Updated dependencies [107853c]
- Updated dependencies [543b33d]
- Updated dependencies [b529a5c]
- Updated dependencies [1623faf]
- Updated dependencies [b4d573a]
- Updated dependencies [3c1a046]
- Updated dependencies [87d0619]
- Updated dependencies [4e0838d]
- Updated dependencies [60f9baf]
- Updated dependencies [f5ef054]
- Updated dependencies [584e737]
- Updated dependencies [37510aa]
- Updated dependencies [c857a93]
- Updated dependencies [345d1be]
- Updated dependencies [430e5f5]
- Updated dependencies [14a13bc]
- Updated dependencies [ca0bdbc]
- Updated dependencies [301eec6]
- Updated dependencies [572ecfb]
- Updated dependencies [5547ad4]
- Updated dependencies [707b3cd]
- Updated dependencies [6673c80]
- Updated dependencies [24e064f]
- Updated dependencies [0f05907]
- Updated dependencies [5e725b8]
- Updated dependencies [086fa46]
- Updated dependencies [eeb95f7]
- Updated dependencies [d89f491]
- Updated dependencies [dc39326]
- Updated dependencies [775ed65]
- Updated dependencies [e4ec6ec]
- Updated dependencies [b1e9280]
- Updated dependencies [05ab9ef]
- Updated dependencies [1d79556]
- Updated dependencies [07b27b3]
- Updated dependencies [d0c09e4]
- Updated dependencies [3fed1eb]
- Updated dependencies [1692cd1]
- Updated dependencies [73c7dc4]
- Updated dependencies [8693110]
- Updated dependencies [ad5a7d7]
- Updated dependencies [dd29bbe]
- Updated dependencies [dd29bbe]
- Updated dependencies [6f21216]
- Updated dependencies [2372e0a]
- Updated dependencies [5afa1e0]
- Updated dependencies [56b2612]
- Updated dependencies [1418de4]
- Updated dependencies [7a96bf8]
- Updated dependencies [a35f7a6]
- Updated dependencies [daafae6]
- Updated dependencies [3f0a307]
- Updated dependencies [5fd2c76]
- Updated dependencies [be48c5e]
- Updated dependencies [57994c3]
- Updated dependencies [989aa48]
- Updated dependencies [23e689d]
- Updated dependencies [bc0538a]
- Updated dependencies [f606ba2]
- Updated dependencies [d176b0a]
- Updated dependencies [105902f]
- Updated dependencies [f901746]
- Updated dependencies [c5dd7fc]
- Updated dependencies [ee0e115]
- Updated dependencies [c2bb302]
- Updated dependencies [4feb2d0]
- Updated dependencies [8684079]
- Updated dependencies [a69a40a]
- Updated dependencies [1ac24f2]
- Updated dependencies [0a052e6]
- Updated dependencies [30c33e3]
- Updated dependencies [462dff3]
- Updated dependencies [8044f4d]
- Updated dependencies [cd86e41]
- Updated dependencies [ae0ca66]
- Updated dependencies [c03077e]
- Updated dependencies [3bc407d]
- Updated dependencies [76560a1]
- Updated dependencies [23d0bc7]
- Updated dependencies [069fd40]
- Updated dependencies [abb6df0]
- Updated dependencies [941c78a]
- Updated dependencies [8776119]
- Updated dependencies [0a168a3]
- Updated dependencies [97b8e7a]
- Updated dependencies [af3873b]
- Updated dependencies [9cb9d95]
- Updated dependencies [f846cc2]
- Updated dependencies [30ce56e]
- Updated dependencies [2e0e451]
- Updated dependencies [df2c551]
- Updated dependencies [1ecb08a]
- Updated dependencies [adad73f]
- Updated dependencies [77efc66]
- Updated dependencies [6422da5]
- Updated dependencies [8f4260f]
- Updated dependencies [d0fe050]
- Updated dependencies [dd11563]
- Updated dependencies [2c702fd]
- Updated dependencies [92fd343]
- Updated dependencies [f7af839]
- Updated dependencies [bbdfc05]
- Updated dependencies [a33f3d5]
- Updated dependencies [d050a8f]
- Updated dependencies [b25d98a]
- Updated dependencies [a237d7f]
- Updated dependencies [4ffdebe]
- Updated dependencies [d731b89]
- Updated dependencies [905f57b]
- Updated dependencies [66d2757]
- Updated dependencies [e246f06]
- Updated dependencies [a65a59b]
- Updated dependencies [b0a1df0]
- Updated dependencies [077b75f]
- Updated dependencies [8a83ceb]
- Updated dependencies [462d02f]
- Updated dependencies [eda6f14]
- Updated dependencies [2ee5861]
- Updated dependencies [45e6001]
- Updated dependencies [e46ce7b]
- Updated dependencies [a19b2a7]
- Updated dependencies [9f024d8]
- Updated dependencies [2ac0616]
- Updated dependencies [2ac0616]
- Updated dependencies [1489952]
- Updated dependencies [030a7b8]
- Updated dependencies [b1845ed]
- Updated dependencies [99e9d29]
- Updated dependencies [70cfb12]
- Updated dependencies [aa31569]
- Updated dependencies [8bfb17d]
- Updated dependencies [8215ff7]
- Updated dependencies [4f11af5]
- Updated dependencies [b036ac5]
- Updated dependencies [d537a31]
- Updated dependencies [d537a31]
- Updated dependencies [1bf5f6e]
- Updated dependencies [d537a31]
- Updated dependencies [6ec0e12]
- Updated dependencies [af284b0]
- Updated dependencies [14a8bd2]
- Updated dependencies [1e001c7]
- Updated dependencies [0b44840]
- Updated dependencies [ef65646]
- Updated dependencies [586705d]
- Updated dependencies [1173017]
- Updated dependencies [8baeda5]
- Updated dependencies [ec749fb]
- Updated dependencies [fa26308]
- Updated dependencies [2ce2e36]
- Updated dependencies [584b422]
- Updated dependencies [62e2b6d]
- Updated dependencies [01fafde]
- Updated dependencies [370833a]
- Updated dependencies [2f569a9]
- Updated dependencies [69147ab]
- Updated dependencies [3a734e0]
- Updated dependencies [ba5bfe9]
- Updated dependencies [26501ae]
- Updated dependencies [9112bcd]
- Updated dependencies [31e7d0b]
- Updated dependencies [94e60c0]
- Updated dependencies [741aa85]
- Updated dependencies [db1f1fd]
- Updated dependencies [cf16a0d]
- Updated dependencies [cf540a7]
- Updated dependencies [cf540a7]
- Updated dependencies [adb7910]
- Updated dependencies [f573976]
- Updated dependencies [f573976]
- Updated dependencies [69f342b]
- Updated dependencies [2ec6827]
- Updated dependencies [2ec6827]
- Updated dependencies [fb0d85b]
- Updated dependencies [4d12b23]
- Updated dependencies [ff48407]
- Updated dependencies [45bec43]
- Updated dependencies [b7a688e]
- Updated dependencies [ef1fcb2]
- Updated dependencies [ace0a53]
- Updated dependencies [8311650]
- Updated dependencies [de70e97]
- Updated dependencies [74c4b34]
- Updated dependencies [e040b8c]
- Updated dependencies [f451a59]
- Updated dependencies [ba95607]
- Updated dependencies [b53b949]
- Updated dependencies [ea9fd99]
- Updated dependencies [1e44436]
- Updated dependencies [2acff87]
- Updated dependencies [299a2c6]
- Updated dependencies [325a92e]
- Updated dependencies [e23eccb]
- Updated dependencies [bf492c8]
- Updated dependencies [c7a3234]
  - @objectstack/core@18.0.0
  - @objectstack/objectql@18.0.0
  - @objectstack/spec@18.0.0
  - @objectstack/platform-objects@18.0.0
  - @objectstack/metadata-core@18.0.0
  - @objectstack/formula@18.0.0
  - @objectstack/types@18.0.0

## 18.0.0-next.5

### Minor Changes

- 964a237: fix(plugin-sharing,runtime)!: a declared sharing rule is read-only and clonable — no rule, new or renamed, can take its name, and it is switched off through the activation ledger, which revokes its grants at once
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: not-required (no-migration-prescription) no spec key, export, option or stored metadata shape is added, removed or renamed, so `objectstack migrate meta` has nothing to rewrite; what changes is the accept set of two write doors, whose remedy is another name for the caller's rule plus one activation call -->
  
  **BREAKING** (an accept-set narrowing), shipped as `minor` under the launch-window convention for breaking changes.
  
  ADR-0131 D6 charts declared sharing rules under regime C: a rule a package declares is read-only, it is customised by a clone under another name, and it is switched off through the deployment-level activation ledger (`sys_metadata_activation`), like flows, actions, positions and permission sets. Same-name shadowing is retired.
  
  What is refused now:
  
  - `POST /api/v1/sharing/rules` (and `SharingRuleService.defineRule`) creating a rule under a declared rule's name — FROM `201`, the new row replacing the declared rule in its scope, TO `409 RESOURCE_CONFLICT` naming the declared rule. Fix: create your rule under another name, and switch the declared one off with `POST /api/v1/security/_activation/sharing_rule/<name>` and `{ "enabled": false }`.
  - A `/data` insert of a `sys_sharing_rule` row under a declared rule's name, or an update that renames a row onto one — FROM `201` / `200`, TO `409 RESOURCE_CONFLICT`. Fix: the same.
  
  What is added:
  
  - **The switch.** `POST /api/v1/security/_activation/sharing_rule/:name` writes the declared rule's activation row, behind the same authority as the other activation doors: `manage_metadata`, and the platform operator under a wall, because the row covers every organization. A declared rule switched off is served nowhere. The write revokes every grant that carries the rule's name in the same request, and switching it back on re-derives them. The name must be a declared rule (`404` otherwise; a rule your organization authored keeps its own `active` field), and with no sharing-rule service bound the door answers `503`.
  - **A declaration over a stored row is reported, never made an overlay.** When a package declares a rule whose name a `sys_sharing_rule` row already holds in a scope (a package upgrade, or a copy customised before this release), the row keeps answering as its own rule. The declaration is not served beside it, and that is logged at `error` once per name and scope per process, with the remedy.
  
  Unchanged: rules whose name no declaration holds are created, renamed and switched as before. A stored row that already holds a declared name stays editable as itself. `DELETE /api/v1/sharing/rules/:idOrName` on a declared rule is still `403 PERMISSION_DENIED`, and is now answered the same way when the rule is switched off.

### Patch Changes

- 9847f87: fix(plugin-sharing): a minted share link carries an organization, never a NULL one (ADR-0131 D9)
  
  Clause-②: no
  
  - **What changed.** `ShareLinkService.createLink` stamps `sys_share_link.organization_id`. It takes the organization of the linked record, read under the system context. When the record names none, it takes the acting context's organization (`tenantId`). When neither names one, it applies the system-write rule: under `single`, the Default Organization (the only one there is); under a wall (`group` or `isolated`), the mint is refused with `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` (status 500) and no link is written. The same refusal answers a `single` install that holds no organization or several. Before, every link was written with `organization_id` NULL.
  - **A link on another organization's record.** Under `group`, a member active in one organization can mint on a visible record of another. The link carries the record's organization, not the session's.
  - **What stays the same.** Under `single` nothing a user sees changes. The mint response keeps the `ShareLink` shape and carries no organization field. A composition that registers no `sys_organization` object writes links as before.
  - **Who can meet the refusal.** No in-repo caller reaches it. Both share-link routes need a signed-in caller. Under a wall, an organization-less API key is refused at admission, and an organization-less session cannot see a record that has a tenant column, so its mint is refused before the stamp. The refusal is reached by a walled, organization-less caller minting on an object with no tenant column, or by a system caller that threads no `tenantId`. The fix is to pass the organization on the context (`{ isSystem: true, tenantId }`).
- Updated dependencies [fa26308]
- Updated dependencies [01fafde]
- Updated dependencies [26501ae]
- Updated dependencies [9112bcd]
- Updated dependencies [94e60c0]
- Updated dependencies [adb7910]
- Updated dependencies [69f342b]
- Updated dependencies [2ec6827]
- Updated dependencies [2ec6827]
- Updated dependencies [fb0d85b]
- Updated dependencies [4d12b23]
- Updated dependencies [ff48407]
- Updated dependencies [45bec43]
- Updated dependencies [b7a688e]
  - @objectstack/spec@18.0.0-next.5
  - @objectstack/objectql@18.0.0-next.5
  - @objectstack/metadata-core@18.0.0-next.5
  - @objectstack/platform-objects@18.0.0-next.5
  - @objectstack/core@18.0.0-next.5
  - @objectstack/formula@18.0.0-next.5
  - @objectstack/types@18.0.0-next.5

## 18.0.0-next.4

### Minor Changes

- 78652c0: feat(cli,plugin-sharing)!: in the 17 → 18 ownership ceremony, a row whose owner cannot be derived blocks certification, and a declared-rule mirror's grants are renamed only onto a rule plugin-sharing serves
  
  Clause-②: yes (narrowing)
  
  <!-- adr-0087: not-required (no-migration-prescription) No spec key, option, error code or stored shape is added, removed or renamed, and nothing exported is removed: the ceremony's report gains one field (`TableOutcome.held`), its verdict counts change, and plugin-sharing gains one export. The only stored state that moves is the operator's own: a row whose owner cannot be derived is given its organization or deleted by hand, which `objectstack migrate meta` has nothing to rewrite for. The other categories are closed on facts: the packages publish (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); no Zod schema in packages/spec changes (not runtime-interface-only or type-surface-only in the spec sense); and nothing exported is retired (not runtime-export-retired). -->
  
  **BREAKING** (narrowings), shipped as `minor` under the launch-window convention for breaking changes.
  
  - **FROM** (`@objectstack/cli`): `os migrate organization-ownership --apply` on a database holding a row whose owner cannot be derived exited `0` with `blocking: 0`, counted the row in `advisory`, and verified the `sys_migration` marker. This covers a reported (fate 4) row, and a row whose anchor is missing under a wall (fate 3). **TO:** it exits `1`, counts the row in `blocking`, and leaves the marker unverified, so a v18 `os serve` / `os start` does not start on the database. **Fix:** give each row its organization (write its `organization_id`, or repair the anchor its reason names), or delete it by hand, then re-run `--apply` with the same plan file.
  - **FROM** (`@objectstack/cli`): a database an earlier version of this command certified while it held such a row was certified again by the next `--apply`. **TO:** that run leaves its marker unverified, for the same rows. **Fix:** the same as above.
  - **FROM** (`@objectstack/cli`): `os dev`'s in-place upgrade of a development database started the server again whenever every ceremony step finished. **TO:** it starts it only when the post-check also holds nothing (`blocking` 0); otherwise it prints each table that holds, with its count and remedy, and the command that resumes the run. **Fix:** resolve the rows it names, then run the printed command.
  - **FROM** (`@objectstack/cli`): the `mirror-deletion` step renamed the grants of a declared-rule mirror onto its rule's name, and deleted the mirror, even when plugin-sharing does not serve that rule (a condition that does not translate, an unmappable recipient, a retired owner-based rule); the next boot's orphaned-grant sweep then revoked those grants. **TO:** while `sys_record_share` grants name such a mirror, the step blocks, naming the rule, its rows and the reason, and writes nothing. **Fix:** correct the rule's declaration in its package so it is served, or delete each mirror row and the grants that name it, then re-run `--apply`.
  
  `@objectstack/cli` — **unattributable rows hold certification (ADR-0131 D10 fate 4).** The ceremony still never guesses an owner for such a row and never deletes it. The post-check now holds each one against the verdict:
  
  - Each table that holds one carries `held: { rows, remedy }` in the apply report, and counts those rows in its `remaining`. The terminal output names each table, its row count and the remedy.
  - `advisory` now counts only the rows of an advisory departure and the reported rows of a table whose `organization_id` is not the tenancy anchor (`sys_sso_provider`, the retired `sys_scim_provider`). A row there that is bound to no organization is legitimate, is reported, and does not block.
  - So a verified marker means no organization-less row on any table that the tenancy anchor governs.
  - The plan's summary line says that such rows will hold `--apply`'s certification until they are resolved.
  
  `@objectstack/cli` — **the ceremony asks plugin-sharing which declared sharing rules it serves.** The port the `mirror-deletion` step reads (`DeclaredSharingRulesPort.rules()`, formerly `names()`) judges each declared rule through plugin-sharing's own translation. A mirror's grants are renamed only onto a rule that is served. A mirror of a refused rule that no grant names is still deleted.
  
  `@objectstack/plugin-sharing` — **exports `translateDeclaredSharingRule`** with its `DeclaredSharingRule` and `DeclaredSharingRuleSkip` types. It is the one translation enforcement serves a declared rule through. It is pure, and it is unchanged.
- 5e97907: feat(plugin-sharing,cli)!: declared sharing rules are read from the registry — the boot writes no `sys_sharing_rule` row for them, and the 17 → 18 ownership ceremony deletes the copies the retired seeder wrote
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: registered sharing-rule-declared-mirror-retired -->
  
  The narrowings, FROM → TO, each with its one-line remedy:
  
  - `DELETE /api/v1/sharing/rules/:idOrName` on a declared rule — FROM `204`, the seeded row deleted (and written again by the next boot), TO `403 PERMISSION_DENIED`. Remedy: change or remove the rule in its declaration in the package; an organization's own rule is deleted as before.
  - `sys_sharing_rule` — FROM one `managed_by: package` row per declared rule, TO none: the boot writes none and the ownership ceremony deletes the copies the seeder wrote (Setup's Sharing Rules object list, which lists rows, no longer shows declared rules). Remedy: read declared rules through `GET /api/v1/sharing/rules`, which lists them beside the organization's own; on an upgraded database run `os migrate organization-ownership --apply` with a fresh plan.
  
  The retirement note for the seeder is the ADR-0087 semantic entry `sharing-rule-declared-mirror-retired`.
  
  **BREAKING**, shipped as `minor` under the repo's launch-window convention for breaking changes.
  
  `@objectstack/plugin-sharing` no longer copies a stack's declared `sharingRules` into `sys_sharing_rule` at boot. ADR-0131 D2 retires that seeder (`bootstrapDeclaredSharingRules`). The sharing-rule service reads each declared rule from the registry whenever it reads the rule set: listing, getting, evaluating, the per-record hooks, the boot backfill and the orphaned-grant sweep. Rules an organization authors keep their `sys_sharing_rule` rows.
  
  - **A declared rule still grants, and stops granting when its declaration goes.** It is translated from the registry's copy exactly as the seeder translated it: the CEL `condition` is lowered to a `criteria` filter, and `sharedWith` becomes the recipient. A condition that does not lower is not served, and never as a match-all. It says so in one WARN line per rule per process. A declared rule's id is its NAME, and the grants it materialises carry the name as `sys_record_share.source_id`. Remove the declaration and the next boot's orphaned-grant sweep revokes those grants.
  - **Scopes follow the posture, as the seeder's passes did.** Under `single` a declared rule is served once, organization-less, so every organization reads it. Under a wall it is served once per organization — every organization, read page by page. An organization created after boot is served from its creation on. If the organizations cannot be read at boot, no declared rule is served until the next boot, and the boot's orphaned-grant sweep revokes none of their grants meanwhile: a failed read is never a revocation.
  - **A stored row of the same name answers for it.** Under `single` that is a row of that name in any organization, and under a wall that organization's own row. Such a row is an organization's own rule, a seeded copy an administrator customized, or a seeded copy the ceremony has not deleted yet. The declared rule is not served beside it, the same as while the seeder ran: it never overwrote an admin-authored or customized row.
  - **`DELETE /api/v1/sharing/rules/:idOrName` refuses a declared rule** with `403 PERMISSION_DENIED`. It has no row: it is changed or removed in its declaration. Before this release a platform administrator could delete the seeded row, and the next boot wrote it again. An organization's own rule is deleted as before.
  - **Setup's Sharing Rules object list no longer shows declared rules.** It lists `sys_sharing_rule` rows. `GET /api/v1/sharing/rules` lists both.
  
  `@objectstack/cli` — **`os migrate organization-ownership --apply` deletes the declared-rule mirrors.** The `declared-rule-mirrors` rows on `sys_sharing_rule` are the seeder's uncustomized copies (`managed_by` `package` or `platform`, `customized` not true). They now block certification until the ceremony's `mirror-deletion` step removes them. It works in the ruled order. It renames every grant naming a mirror by row id (`sys_record_share.source_id`, `source = 'rule'`) to the rule's name and verifies that no grant names a mirror any more. Only then does it delete the mirrors. Under a wall it deletes the organization-stamped copies too.
  - A mirror whose rule no installed package declares, and that grants still name, blocks with nothing written. The blocker names the rows and the remedy. A mirror no grant names is deleted.
  - The step also runs on a database whose ceremony already completed while an earlier release still seeded the rows, where they were advisory. Re-run `--apply` with a fresh plan.
  - `DECLARED_SHARING_RULE_SEEDER_RUNS` is now `false`. A customized copy and an organization's own rule stay. Under `single` they take the Default Organization, as before.
  
  `@objectstack/lint` — the sharing-rule enforceability verdicts and `os explain` say what now happens to a declared rule whose condition does not lower. It is "never served", not "never seeded", because it is never written to `sys_sharing_rule`. The rule ids, severities, paths and what each rule accepts or refuses are unchanged.

### Patch Changes

- Updated dependencies [b2e7870]
- Updated dependencies [eebaf3b]
- Updated dependencies [194a42d]
- Updated dependencies [bb7ccde]
- Updated dependencies [df000d4]
- Updated dependencies [646303e]
- Updated dependencies [f5ef054]
- Updated dependencies [f7af839]
- Updated dependencies [a237d7f]
- Updated dependencies [b0a1df0]
- Updated dependencies [eda6f14]
- Updated dependencies [2ee5861]
- Updated dependencies [e46ce7b]
- Updated dependencies [a19b2a7]
- Updated dependencies [2ac0616]
- Updated dependencies [2ac0616]
- Updated dependencies [1489952]
- Updated dependencies [030a7b8]
- Updated dependencies [b1845ed]
- Updated dependencies [99e9d29]
- Updated dependencies [70cfb12]
- Updated dependencies [aa31569]
- Updated dependencies [8bfb17d]
- Updated dependencies [8215ff7]
- Updated dependencies [4f11af5]
- Updated dependencies [b036ac5]
- Updated dependencies [d537a31]
- Updated dependencies [d537a31]
- Updated dependencies [1bf5f6e]
- Updated dependencies [d537a31]
- Updated dependencies [6ec0e12]
- Updated dependencies [af284b0]
- Updated dependencies [14a8bd2]
- Updated dependencies [1e001c7]
- Updated dependencies [0b44840]
- Updated dependencies [ef65646]
- Updated dependencies [586705d]
- Updated dependencies [1173017]
- Updated dependencies [8baeda5]
- Updated dependencies [ec749fb]
- Updated dependencies [2ce2e36]
- Updated dependencies [584b422]
- Updated dependencies [62e2b6d]
- Updated dependencies [370833a]
- Updated dependencies [2f569a9]
- Updated dependencies [69147ab]
- Updated dependencies [3a734e0]
- Updated dependencies [ba5bfe9]
- Updated dependencies [31e7d0b]
- Updated dependencies [741aa85]
- Updated dependencies [db1f1fd]
- Updated dependencies [cf16a0d]
- Updated dependencies [cf540a7]
- Updated dependencies [cf540a7]
- Updated dependencies [f573976]
- Updated dependencies [f573976]
  - @objectstack/core@18.0.0-next.4
  - @objectstack/objectql@18.0.0-next.4
  - @objectstack/spec@18.0.0-next.4
  - @objectstack/platform-objects@18.0.0-next.4
  - @objectstack/formula@18.0.0-next.4
  - @objectstack/metadata-core@18.0.0-next.4
  - @objectstack/types@18.0.0-next.4

## 18.0.0-next.3

### Patch Changes

- 099cc9d: Clause-②: no
  
  The approval, security, automation and sharing objects describe their records in plain admin
  sentences. Approval Delegations now reads "While someone is away, approvals assigned to them
  personally go to their delegate.", Record Shares "Records shared beyond their owner, one row per
  grant.", User Positions "Which positions each user holds, one row per assignment.", Audience
  Binding Suggestions "A package's suggestion to give one of its permission sets to everyone who
  signs in, and the decision taken on it." and Automation Runs "Paused automation runs waiting to
  resume, and the recent history of finished runs." Field help on Approval Requests, Approval
  Delegations, User Positions, User Permission Sets and Audience Binding Suggestions, the
  descriptions of the `organization_admin_no_bypass`, `mcp_agent_data_read` and
  `mcp_agent_data_write` permission sets, the flow-dispatch ledger's description and the
  reserved-position refusal no longer carry design-record numbers or runtime vocabulary; those
  references stay in the code comments. The zh-CN, ja-JP and es-ES translations follow. Wording
  only: no field, permission or behaviour changes.
- 6dede7a: fix(runtime, plugin-sharing): on the standalone server, an anonymous caller of any `/api/v1/notifications` verb or any `/api/v1/share-links` path off the two token faces is answered `401 UNAUTHENTICATED` in the dispatcher's standard envelope
  
  Clause-②: no
  
  The v18 text for these two doors reads "`/notifications`: `401 UNAUTHENTICATED` on every face" and "`/share-links`: `401 UNAUTHENTICATED` on the create, list and revoke faces and on every path the domain does not serve", in "the dispatcher's standard envelope … with the shared message every other dispatcher domain answers with". A host that reaches the dispatcher through `@objectstack/hono`'s catch-all already answered that way. The standalone server (the one `os dev` and `os serve` run) did not:
  
  - `/api/v1/notifications`, `/api/v1/notifications/read` and `/api/v1/notifications/read/all` were each mounted for the one verb they serve, so any other verb never reached the `notifications` domain and the HTTP adapter answered `405`, naming the allowed methods, to an anonymous caller as well.
  - `/api/v1/share-links` is served there by `@objectstack/plugin-sharing`'s routes, not by the dispatcher. They registered five routes and nothing else, so another verb or path got the adapter's `405` or `404`, and the create, list and revoke faces answered `401` with a sentence of their own ("Sign in to list share links") and no `error.httpStatus`.
  
  What the standalone server answers now:
  
  - **Anonymous caller.** `401 UNAUTHENTICATED`, `{ success: false, error: { code: 'UNAUTHENTICATED', message: 'Authentication is required to access this endpoint.', httpStatus: 401 } }`, on every verb of the three notifications paths, and on every verb and path under `/api/v1/share-links` except `GET /share-links/:token/resolve` and `GET /share-links/:token/messages`, which the capability token still admits. A body the server cannot parse does not outrank this answer anywhere under `/api/v1/share-links`, nor on the notifications verbs no face serves.
  - **Signed-in caller of a verb or path that is not served.** Still refused. On the notifications paths the domain answers it: `404 ROUTE_NOT_FOUND` from the dispatcher (or the `501` capability answer on a deployment with no inbox), where the adapter used to answer `405`. Under `/api/v1/share-links` the share-link routes answer it themselves: `404 ENDPOINT_NOT_FOUND`, naming the request, where the adapter used to answer `405` or `404`. No `Allow` header is sent on either.
  
  Every request that was served is served as before. A notifications sub-path no face names, such as `/api/v1/notifications/<anything>`, is still not mounted on the standalone server and is answered `404`.
- Updated dependencies [b15f8a1]
- Updated dependencies [4216796]
- Updated dependencies [c40a0dd]
- Updated dependencies [60f9baf]
- Updated dependencies [3fed1eb]
- Updated dependencies [a35f7a6]
- Updated dependencies [f606ba2]
- Updated dependencies [105902f]
- Updated dependencies [f901746]
- Updated dependencies [ee0e115]
- Updated dependencies [8684079]
- Updated dependencies [a69a40a]
- Updated dependencies [0a052e6]
- Updated dependencies [ae0ca66]
- Updated dependencies [23d0bc7]
- Updated dependencies [abb6df0]
- Updated dependencies [8776119]
- Updated dependencies [0a168a3]
- Updated dependencies [97b8e7a]
- Updated dependencies [af3873b]
- Updated dependencies [9cb9d95]
- Updated dependencies [f846cc2]
- Updated dependencies [30ce56e]
- Updated dependencies [2e0e451]
- Updated dependencies [df2c551]
- Updated dependencies [1ecb08a]
- Updated dependencies [adad73f]
- Updated dependencies [77efc66]
- Updated dependencies [6422da5]
- Updated dependencies [8f4260f]
- Updated dependencies [d0fe050]
- Updated dependencies [dd11563]
- Updated dependencies [2c702fd]
- Updated dependencies [92fd343]
- Updated dependencies [bbdfc05]
- Updated dependencies [a33f3d5]
- Updated dependencies [d050a8f]
- Updated dependencies [b25d98a]
- Updated dependencies [4ffdebe]
- Updated dependencies [d731b89]
- Updated dependencies [905f57b]
- Updated dependencies [66d2757]
- Updated dependencies [e246f06]
- Updated dependencies [a65a59b]
- Updated dependencies [077b75f]
- Updated dependencies [8a83ceb]
- Updated dependencies [462d02f]
- Updated dependencies [45e6001]
- Updated dependencies [9f024d8]
  - @objectstack/spec@18.0.0-next.3
  - @objectstack/metadata-core@18.0.0-next.3
  - @objectstack/objectql@18.0.0-next.3
  - @objectstack/platform-objects@18.0.0-next.3
  - @objectstack/core@18.0.0-next.3
  - @objectstack/formula@18.0.0-next.3
  - @objectstack/types@18.0.0-next.3

## 18.0.0-next.2

### Minor Changes

- 0f05907: feat(spec,core,plugin-auth)!: an API key answers as its owner's session does when the ADR-0069 policy holds the account, the forced reset gets its own code and an explicit revocation switch
  
  Clause-②: yes (narrowing) — the published contract widens (the posture codes become a closed vocabulary with a declared scope, a new `PASSWORD_RESET_REQUIRED` code, a per-user posture member on the auth service contract, new `@objectstack/core` exports) and the API-key door narrows (a key whose owner holds an account-scope posture is refused where it was served).
  
  <!-- adr-0087: not-required (no-migration-prescription) An authentication-policy change at the API-key admission seam plus one new error code, not a metadata change. No authorable spec key, stored shape or metadata surface is removed or renamed, so `objectstack migrate meta` has nothing to rewrite. `ExecutionContext.authGate.code` narrows from a bare string to the closed posture vocabulary, but that field is server-constructed only and never authored; its one producer already wrote only members of it. What narrows is which API keys are served (a key whose owner owes MFA enrolment is refused with 403 MFA_REQUIRED), and the administrator-forced password change answers its own code. The packages publish (not unpublished), no ADR-0087 id covers this and none is added (not registered or already-registered). -->
  
  **BREAKING** (an accept-set narrowing at the API-key door, and a changed code for the administrator-forced password change), shipped as `minor` under the launch-window convention for breaking changes.
  
  Ruling C′ on #23287: posture codes are a closed vocabulary, and each code declares what it holds.
  
  - **The vocabulary and its scope (`@objectstack/spec/kernel`).** `AuthGateCodeSchema` is the closed set of codes an `authGate` may carry: `PASSWORD_EXPIRED`, `PASSWORD_RESET_REQUIRED` and `MFA_REQUIRED`. `AUTH_GATE_SCOPES` declares each code's scope once: `MFA_REQUIRED` holds the **account** (every credential of the user); `PASSWORD_EXPIRED` and `PASSWORD_RESET_REQUIRED` hold the **credential** (password sign-in alone). `ExecutionContext.authGate.code` is typed against the vocabulary, and `PASSWORD_RESET_REQUIRED` is registered for `@objectstack/plugin-auth` in the error-code ledger.
  - **One per-user posture computation (`@objectstack/plugin-auth`, `IAuthService.resolveUserAuthGates`).** It answers every posture a user holds, most urgent first, keyed by user id and the organization the credential operates in. The session gate shows its first entry, as before.
  - **One judgment at the shared key-admission seam (`@objectstack/core`).** `resolveApiKeyAdmission` asks that computation for the key's owner and holds the key on an account-scope posture (a new `held` outcome). `resolveAuthzContext` resolves a held key as a held principal: the owner, `credential: 'api_key'`, and the posture on `authGate`. Both new inputs are optional (`userAuthGates`), and `userAuthGateSourceOf(authService)` binds one from an auth service.
  - **REST and the runtime dispatcher** judge a key-admitted request by the key's answer, and re-read the session cookie for the gate only when a session admitted the caller. The declared-endpoint fallback does the same.
  - **The raw-host families** take the same answer through the shared seam: datasource admin, share links, settings, and the storage family's door. The webhook-redeliver door admits no API key at all, and still does not.
  - **The forced reset (`POST /api/v1/auth/admin/set-user-password`, the `set_user_password` action).** `must_change_password` now answers `PASSWORD_RESET_REQUIRED` instead of reusing `PASSWORD_EXPIRED`. The act carries `revokeSessionsAndKeys`, **on by default**: it ends every live session of the user and revokes every API key they own, and the response reports what landed (`revoked: { sessions, apiKeys, failed, complete }`).
  
  What changes for you:
  
  - **Refused now:** an API key whose owner owes MFA enrolment past the grace window gets `403 MFA_REQUIRED`, with the message the session gets, on every face that admits keys. It works again the moment the owner enrols, with nothing reissued: the refusal is not a revocation.
  - **Unchanged:** a key whose owner's password expired, or whose administrator forced a password change, keeps working. A session sent beside an API key no longer answers for the key.
  - **A forced password change answers `PASSWORD_RESET_REQUIRED`.** A client that recognises `PASSWORD_EXPIRED` to show its change-password flow should recognise `PASSWORD_RESET_REQUIRED` the same way.
  - **An administrator's password reset now signs the user out everywhere and revokes their API keys by default.** For a routine reset, pass `revokeSessionsAndKeys: false` (or clear the switch in the Set Password dialog). Revoked keys stay revoked after the password change; an administrator can restore a key a routine reset revoked with the Restore API Key action, or the owner mints a replacement.
  - **Hosts calling `resolveAuthzContext` or `resolveApiKeyAdmission` directly** pass `userAuthGates: userAuthGateSourceOf(authService)` to have the key's owner asked. Code switching exhaustively over `ApiKeyAdmission['outcome']` handles the new `held` outcome.
- 1d79556: feat(spec,core,runtime,plugin-auth)!: API keys get a lifecycle: a 90-day default expiry, a one-year ceiling, a 90-day inactivity expiry, a one-year grace for keys created with none, and distinct refusal codes
  
  Clause-②: yes (narrowing) — the published contract widens (four `auth` settings keys, the `IAuthService.resolveApiKeyLifecyclePolicy` member and its `ApiKeyLifecyclePolicy` type, four registered error codes, new `@objectstack/core` exports) and the API-key doors narrow (a signing past the ceiling is refused; an inactive key, a key past its grace, and a revoked or expired key sent beside a session are refused where they were served).
  
  <!-- adr-0087: not-required (no-migration-prescription) An authentication-policy change at the API-key signing door and the shared key-admission seam, not a metadata change. No authorable spec key, stored shape or metadata surface is removed, renamed or re-shaped, so `objectstack migrate meta` has nothing to rewrite: the four new `auth` settings keys are additive and defaulted, `sys_api_key` gains no column (its existing `expires_at` and `last_used_at` are written by the platform), and `ResolveAuthzInput.apiKeyLifecycle` / the sixth parameter of `resolveApiKeyAdmission` and `resolveApiKeyPrincipal` are server-side wiring no author writes. What narrows is which API keys are served and which signings are accepted; the remedy is a new key or a nearer date, never a rewrite of a package source or a stored row. The packages publish (not unpublished), no ADR-0087 id covers this and none is added (not registered or already-registered). -->
  
  **BREAKING** (an accept-set narrowing at the API-key doors), shipped as `minor` under the launch-window convention for breaking changes.
  
  Ruling A on #23367: the key store stays `sys_api_key`, and the policy is auth configuration.
  
  - **The policy (`@objectstack/plugin-auth`, `IAuthService.resolveApiKeyLifecyclePolicy`).** Three `auth` settings keys, bound by `bindAuthSettings`: `api_key_default_expiry_days` (90), `api_key_max_expiry_days` (365) and `api_key_inactivity_days` (90; `0` turns it off). A fourth, `api_key_policy_started_at`, is recorded once — on the first boot that runs the policy, at `kernel:bootstrapped` — and anchors the two clocks below; it survives restarts and is never overwritten by the platform.
  - **The signing door (`POST /api/v1/keys`).** A signing that names no `expires_at` gets the default life and the response echoes it. An `expires_at` further away than the ceiling is refused `400 API_KEY_EXPIRY_TOO_LONG`, naming the latest date allowed; exactly the ceiling is accepted. A kernel with no auth service signs as before.
  - **The key-admission seam (`resolveApiKeyAdmission`, `@objectstack/core`).** A real key its own state refuses is a new outcome, `lifecycle`, with one of three distinct codes: `API_KEY_REVOKED`, `API_KEY_EXPIRED` (past `expires_at`, or past the grace of a key created with none) or `API_KEY_INACTIVE` (no recorded use for longer than the window). `resolveAuthzContext` raises it as the branded `ApiKeyLifecycleRefusalError` (`403`, a located message naming the key's prefix, the date and the remedy). An unknown key is still `none`.
  - **`last_used_at` is written.** Its description promised "Automatically updated on each API call", and nothing wrote it. The seam now stamps it on an admitted (or held) call, at most once an hour per key, and the inactivity judgment reads the value as it was BEFORE that call's stamp, so a key's own use cannot revive it. A stamp that fails never fails the request; it is said once, at `error`.
  - **Keys created before the policy.** A key with no expiry gets one year from `api_key_policy_started_at`; the date is stamped onto its `expires_at` the first time it is admitted, so the keys page shows it, and the refusal after it names it. A key with no recorded use counts its inactivity from the same anchor (or from its own creation, when later) — never from an earlier `created_at`, since no use was ever recorded before the policy.
  - **Every face that admits keys** passes the policy source (`apiKeyLifecyclePolicySourceOf(authService)`, a required input beside `userAuthGates`). Every one of them answers the refusal's `403` and code: the runtime dispatcher (the MCP HTTP endpoint among its routes), the REST data API, the settings routes, the storage download routes, the datasource admin routes, the share-link routes, the marketplace install-local routes and the MCP stdio transport. Each relays the refusal by its brand, so every other identity fault at those doors keeps its existing answer.
  - **`OS_CLOUD_API_KEY` is untouched.** It is the runtime's outbound credential to the control plane, never admitted by this seam.
  
  What changes for you:
  
  - **A key created without an expiry now expires.** It used to live until revoked; it now lives 90 days (or the configured default). Pass `expires_at` to choose, and create a new key before it ends.
  - **A signing asking for more than a year is refused** `400 API_KEY_EXPIRY_TOO_LONG`, where it used to be accepted. Ask for the date the message names, or an earlier one.
  - **A key unused for 90 days is refused** `403 API_KEY_INACTIVE`, where it used to be served. It is not revoked; the remedy is a new key.
  - **A key that already existed with no expiry keeps working for one year** from the date the policy took effect on your deployment (`auth.api_key_policy_started_at`), then answers `403 API_KEY_EXPIRED` naming that date. Replace such keys within the year.
  - **A revoked or expired key answers its own code** (`403 API_KEY_REVOKED` / `API_KEY_EXPIRED`) on every face that accepts a key, where it used to answer the generic `401`; and a session cookie sent beside such a key no longer answers for it.
  - **Hosts calling `resolveAuthzContext`, `resolveApiKeyAdmission` or `resolveApiKeyPrincipal` directly** pass `apiKeyLifecycle: apiKeyLifecyclePolicySourceOf(authService)` (or the sixth argument), or an explicit `undefined` where no auth service exists. A caller of `resolveAuthzContext` that wants the located answer re-raises `ApiKeyLifecycleRefusalError` (`isApiKeyLifecycleRefusalError`) the way it re-raises the store outage. Code switching exhaustively over `ApiKeyAdmission['outcome']` handles the new `lifecycle` outcome.

### Patch Changes

- c245986: fix(plugin-sharing): a record-share grant refused for a non-user recipient names the sharing-rule recipient that delivers it, so a `group` caller is sent to `team`
  
  Clause-②: no
  
  **What was wrong.** `ISharingService.grant` writes a record share for a `user` only (ADR-0078), and refuses `group`, `position` and `unit_and_subordinates` with one sentence. FROM: "VALIDATION_FAILED: recipientType must be 'user' (received "group") — group/position recipients are delivered via sharing rules (ADR-0111 D7)". The sharing-rule vocabulary has no `group` recipient: a rule spells it `team`, since the ADR-0090 D3 rename. A caller or an AI that followed the remedy wrote a rule naming `group`, which neither the authoring `sharedWith.type` enum nor the `sys_sharing_rule.recipient_type` select offers. A `unit_and_subordinates` caller read a sentence that did not name its value.
  
  **What changed.** Each declared value's remedy names its own rule recipient. TO:
  
  - `group`: "… — a group recipient is delivered via a sharing rule with recipient type 'team', its name since the ADR-0090 D3 rename (ADR-0111 D7)"
  - `position`: "… — a position recipient is delivered via a sharing rule with recipient type 'position' (ADR-0111 D7)"
  - `unit_and_subordinates`: "… — a unit_and_subordinates recipient is delivered via a sharing rule with recipient type 'unit_and_subordinates' (ADR-0111 D7)"
  
  A value no record share declares (an untyped REST body sending `team`, say) is told so, and is named no route: "… — "team" is not a record-share recipient type (ADR-0111 D7)".
  
  **Unchanged.** Which values `grant()` accepts (`user` only), the `VALIDATION_FAILED` code and its 400, the first clause of every refusal, the retired `guest` value's own prescription, and the record-share vocabulary. Nothing is written for a refused grant.
- c980d11: fix(plugin-sharing, runtime): a shared conversation's messages open for exactly the callers its share link opens for, on both mounts
  
  Clause-②: no — `/messages` now reaches the answer `/resolve` already gives the same caller for the same link, on the same mount; who can open a share link is unchanged.
  
  A share link to an AI conversation has two public routes: `/resolve` returns the conversation, and `/messages` returns its messages. Both check the link through the same service call. `/resolve` passed it every input an audience is judged by. `/messages` passed fewer, so it refused callers `/resolve` served:
  
  - **A `signed_in` link, a signed-in caller:** plugin-sharing's share-link routes answered `/messages` with `404 NOT_FOUND`, so the console's shared-conversation page showed the conversation with no messages. It now returns the messages, as the runtime dispatcher's share-links domain already did.
  - **An `email` link, an allowlisted `?email=`:** both mounts answered `/messages` with `404 NOT_FOUND`. Both now read `?email=` on `/messages` exactly as on `/resolve`, and return the messages.
  - **Unchanged:** every caller `/resolve` refuses is still refused on `/messages` with `404 NOT_FOUND`: an anonymous caller of a `signed_in` link, and a caller of an `email` link with no email or an off-list email, signed in or not. A password-protected link still needs its password on both routes. `/resolve` is unchanged.
- 0ecac96: fix(plugin-sharing, runtime): a share link limited to an email allowlist answers every caller it does not open for with `404 INVALID_OR_EXPIRED`, whatever email and password were sent
  
  Clause-②: no — every request refused before is still refused, and every request served before is still served; only which refusal code a caller reads changes.
  
  A share link can carry a password and the `email` audience together. For such a link, the share-link resolve door answered a caller it did not open for from the password, never the audience: `401 NEEDS_PASSWORD` with no password, and `401 WRONG_PASSWORD` with any password, the correct one included, when the email sent was missing or not on the allowlist. A caller with the right password read "Incorrect password".
  
  - **An `email` link, any caller it does not open for:** `404 INVALID_OR_EXPIRED`, with or without an email, with no password, a wrong one or the correct one, signed in or not. It is the answer a password-less `email` link already gave and an unknown token gives, so it tells the caller neither whether the email is on the allowlist, nor whether the password is right, nor whether the link has a password. The door does not read the email to choose its answer.
  - **Served, unchanged:** an allowlisted email with the correct password (or, on a link without a password, an allowlisted email alone) still opens the record. An API or SDK caller sends both together; the door no longer prompts for the password first.
  - **Unchanged:** links with any other audience, including the `signed_in` order (`401 SIGN_IN_REQUIRED` before sign-in, the password arms after), a `public` link's `NEEDS_PASSWORD` / `WRONG_PASSWORD`, and the expired-or-revoked `410 EXPIRED_OR_REVOKED`.
  - Both mounts of the resolve door answer alike: plugin-sharing's share-link routes and the runtime dispatcher's share-links domain.
- d1e2841: fix(plugin-sharing): an email-audience share link's refusal does the same work whatever email and password are presented
  
  The refusal of an `email`-audience share link no longer does a different amount
  of work depending on the caller's input, as its answer bytes already did not.
  The refusal and the served response are byte-for-byte unchanged.
  
  Clause-②: no
- Updated dependencies [0d3ea29]
- Updated dependencies [f9b4217]
- Updated dependencies [87d0619]
- Updated dependencies [4e0838d]
- Updated dependencies [584e737]
- Updated dependencies [301eec6]
- Updated dependencies [5547ad4]
- Updated dependencies [0f05907]
- Updated dependencies [086fa46]
- Updated dependencies [b1e9280]
- Updated dependencies [05ab9ef]
- Updated dependencies [1d79556]
- Updated dependencies [07b27b3]
- Updated dependencies [d0c09e4]
- Updated dependencies [1692cd1]
- Updated dependencies [73c7dc4]
- Updated dependencies [8693110]
- Updated dependencies [ad5a7d7]
- Updated dependencies [dd29bbe]
- Updated dependencies [dd29bbe]
- Updated dependencies [6f21216]
- Updated dependencies [2372e0a]
- Updated dependencies [5afa1e0]
- Updated dependencies [56b2612]
- Updated dependencies [1418de4]
- Updated dependencies [7a96bf8]
- Updated dependencies [daafae6]
- Updated dependencies [3f0a307]
- Updated dependencies [5fd2c76]
- Updated dependencies [be48c5e]
- Updated dependencies [57994c3]
- Updated dependencies [989aa48]
- Updated dependencies [23e689d]
- Updated dependencies [bc0538a]
- Updated dependencies [d176b0a]
- Updated dependencies [c5dd7fc]
- Updated dependencies [c2bb302]
- Updated dependencies [4feb2d0]
- Updated dependencies [1ac24f2]
- Updated dependencies [30c33e3]
- Updated dependencies [462dff3]
- Updated dependencies [8044f4d]
- Updated dependencies [cd86e41]
- Updated dependencies [c03077e]
- Updated dependencies [3bc407d]
- Updated dependencies [76560a1]
- Updated dependencies [069fd40]
- Updated dependencies [941c78a]
  - @objectstack/platform-objects@18.0.0-next.2
  - @objectstack/spec@18.0.0-next.2
  - @objectstack/core@18.0.0-next.2
  - @objectstack/objectql@18.0.0-next.2
  - @objectstack/metadata-core@18.0.0-next.2
  - @objectstack/formula@18.0.0-next.2
  - @objectstack/types@18.0.0-next.2

## 18.0.0-next.1

### Minor Changes

- 08b38cb: fix(services)!: the datasource admin, share-link, webhook redeliver and storage families refuse a session the ADR-0069 authentication policy holds
  
  Clause-②: no (narrowing) — a session ADR-0069 holds out of protected resources is refused by families that answered it; core's existing exports only, no published schema or export moves.
  
  <!-- adr-0087: not-required (no-migration-prescription) A runtime authentication narrowing at four families of routes mounted directly on the host server, not a metadata change. No spec key, export, option, config field, response field or stored shape is removed, renamed or re-shaped, and a session the policy does not hold receives the same answers as before, so there is no tombstone and nothing for `objectstack migrate meta` to rewrite. What narrows is which sessions these families serve: a session whose user carries the ADR-0069 posture (an expired password, or enforced MFA not yet enrolled) is now refused with the gate's 403 before any of the family's logic runs. The other categories are closed on facts: the packages publish (not unpublished); no ADR-0087 id covers these routes and this diff adds none (not registered / already-registered); and no published interface or type changes (not runtime-interface-only / type-surface-only). -->
  
  **BREAKING** (an accept-set narrowing), shipped as `minor` under the launch-window convention for breaking changes.
  
  ADR-0069 holds a signed-in user out of every protected resource while their password has expired or while enforced MFA is not yet enrolled, until they remediate. REST and the runtime dispatcher already refuse such a session. Four families of routes mounted straight on the host server never asked, so they served it as an ordinary signed-in caller:
  
  - **`@objectstack/service-datasource`**: the datasource admin family (`registerDatasourceAdminRoutes`). Its door now asks the shared decision (`evaluateAuthGate`, `@objectstack/core`) about the session it already reads, before the anonymous floor and the capability check.
  - **`@objectstack/plugin-sharing`**: the share-link family (`registerShareLinkRoutes`). Every route, the two capability-token routes included, is now mounted through one door that refuses a context carrying `authGate`. `SharingServicePlugin`'s resolver now puts the session's posture on that context, as REST does.
  - **`@objectstack/plugin-webhooks`**: the redeliver door (`WebhookOutboxPlugin`), on both of its faces: the route the plugin mounts, and the `webhooks` service's `handleRedeliver`.
  - **`@objectstack/service-storage`**: the storage family, the two capability-token raw-transfer routes included. Every route is now mounted through one door. The posture is bound where every other storage gate is bound, so both the plugin's own mount and the host door `mountStorageRoutes` carry it. When a gate feature is active, the door reads the session and refuses a held one. When the gate is active but the session cannot be read, the door answers the declared `503` (`SERVICE_UNAVAILABLE`), as REST does. A direct call of `registerStorageRoutes` mounts the family exactly as before, because like the other storage gates this one is bound by the package's composition. No exported declaration changes.
  
  - **Refused now:** a held session gets `403` with the gate's own `code` (`PASSWORD_EXPIRED` or `MFA_REQUIRED`) and `message`, in each family's declared error envelope, before the family does anything else. This is the answer REST gives the same session.
  - **Unchanged:** a session the policy does not hold is served exactly as before, and an API-key caller is unaffected because it has no session to hold. A CORS preflight is answered as before.
  
  What changes for you. A user the policy holds must remediate (change the password, or enroll an authenticator) before these routes answer them, as on every other protected route. If you mount the storage routes through `mountStorageRoutes`, the gate is bound from the kernel's `auth` service with nothing to configure. If you mount `registerShareLinkRoutes` yourself with your own `contextFromRequest`, set `authGate` on the context it returns for a held session; the door refuses on that field.
- 345d1be: fix(spec,plugin-sharing)!: `sys_record_share` no longer offers a `guest` recipient, which no grant ever honoured (ADR-0138 D8)
  
  Clause-②: no (narrowing: a declared recipient value no grant honours is refused)
  
  <!-- adr-0087: not-required (no-migration-prescription) No working use of the value exists to rewrite. `ISharingService.grant` refused every non-`user` recipient before this change, so no grant naming `guest` ever succeeded, and the census pinned in `@objectstack/spec` finds no seed, fixture, example, template, migration or test row in this repository that writes `recipient_type` as `guest`, and no stored metadata surface that carries it. Seed data, the one metadata surface that can carry a row value, targets `sys_record_share` nowhere in the tree (the examples seed `sys_user` and `sys_business_unit`, never a record share). What narrows is a published TypeScript union in `packages/spec/src/contracts/` and the option set of a platform object's select: a caller that still spells the value meets a compile error or a located refusal, and there is nothing for `objectstack migrate meta` to derive from metadata. The other categories are closed on facts: both packages publish (not unpublished); no ADR-0087 id covers this value and this diff adds none (not registered or already-registered); the union lives under `packages/spec/src/contracts/` and the diff touches `packages/spec` (not runtime-interface-only or type-surface-only); no export is removed (not runtime-export-retired). -->
  
  **BREAKING** (an accept-set narrowing), shipped as `minor` under the launch-window convention for breaking changes.
  
  A record share to the anonymous principal was declared in two places and honoured in none. Both declarations are gone:
  
  - `RecordShareRecipientType` (`@objectstack/spec/contracts`) is now `'user' | 'group' | 'position' | 'unit_and_subordinates'`. Passing `recipientType: 'guest'` to `ISharingService.grant`, or typing a `RecordShare.recipient_type` as `'guest'`, is a compile error.
  - The `recipient_type` select on `sys_record_share` (`@objectstack/plugin-sharing`) offers those same four options, and its `guest` label is gone from the four translation bundles.
  
  Why: the grant refused `guest` (ADR-0078), and no gate reads such a row, because the read and write gates match `recipient_type: 'user'` only. ADR-0090 D11 routes guest access through the guest position and share links, so a record share to the guest had nothing to gain. The sharing-rule vocabulary retired the same recipient in v17.
  
  What a caller sees now:
  
  - **The grant door** (`POST /data/:object/:id/shares`, or `grant()` from untyped code). A body naming `recipientType: 'guest'` is still refused with `VALIDATION_FAILED` (`400`), as before. The sentence now says the value was removed and that guest access flows through the guest position and share links. It used to say that sharing rules deliver non-`user` recipients, which was never true of a guest. To let a guest reach a record, use a public form or a share link.
  - **The row door** (a system-context engine write: a seed, a plugin, a migration script). A row carrying `recipient_type: 'guest'` is now refused with `VALIDATION_FAILED`, an `invalid_option` error on `recipient_type` that lists the four values a row may carry. Before this change such a write stored a row that looked granted and enforced nothing.
  - **Unchanged:** every `user` grant, the other three row values, the sharing-rule service, and the gates. A `guest` row that a system write stored before this release is read by no gate, both before and after.

### Patch Changes

- 66949b7: feat(plugin-security)!: the four security-catalog row objects are retired — `sys_position`, `sys_permission_set`, `sys_position_permission_set` and `sys_capability` (ADR-0131 D3)
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: registered catalog-row-objects-retired -->
  
  **BREAKING**, shipped as `minor` under the repo's launch-window convention for breaking changes.
  
  Positions, permission sets and capabilities live in the security catalog — the environment registry, fed by package declarations and by environment metadata saved through `/api/v1/meta` (ADR-0131 D3). The four row objects that mirrored them are no longer registered, so their data and REST routes and their Setup object pages are gone. No table is dropped and no row is deleted.
  
  FROM → TO:
  
  - `GET|POST|PATCH|DELETE /api/v1/data/sys_permission_set` → `GET|PUT|DELETE /api/v1/meta/permission/:name`; to copy a set, `POST /api/v1/security/permission-sets/:name/clone` with `{ name, label }`.
  - `… /api/v1/data/sys_position` → `/api/v1/meta/position/:name`. A position's permission sets are its definition's `permissionSets`.
  - `… /api/v1/data/sys_position_permission_set` → the position definition's `permissionSets` (`PUT /api/v1/meta/position/:name`).
  - `… /api/v1/data/sys_capability` → read-only `GET /api/v1/meta/capability`; a package declares a capability with `defineCapability` (`stack.capabilities`).
  - Setup → Access Control → Positions / Capabilities / Permission Sets now open Setup's catalog lists (`/apps/setup/metadata/<type>?scope=environment`) instead of the object pages; the `sys_position` record page (`SysPositionDetailPage`) is removed.
  - An object permission on one of the four names in a permission set grants nothing and can be deleted.
  
  What else changes:
  
  - `sys_user_permission_set.permission_set_id` is a plain text column now, not a lookup: same column, same stored ids, same indexes. It is not written and grants nothing; a grant names its set by `permission_set`.
  - A permission set saved through the metadata door is written to no row: the `permission` mutation projector, the `sys_permission_set` and `sys_position` data-door write-throughs and the row-only position backfill are no longer registered.
  - On a fresh `single`-posture database the first human is promoted to platform administrator without reading any catalog row. An unscoped grant written before `sys_user_permission_set.permission_set` existed (it names no set) still withholds the promotion until the organization-ownership migration names it.
  - Uninstalling a package still revokes every grant naming a permission set the package declared, by the names the uninstalling door captures before the withdrawal (`declared`, `captureUninstallDeclared`), and now by those names alone: the cleanup reads and removes no `sys_permission_set` or `sys_position_permission_set` row, so the `sets` and `positionBindings` counts on its outcome are always 0. A grant written before `sys_user_permission_set.permission_set` existed names no set and is not reached; the organization-ownership migration names it.
  - On a `group` or `isolated` deployment the data-door half of the walled catalog refusal goes with the objects: a data-door insert, update or delete on `sys_position`, `sys_permission_set` or `sys_capability` answers `404 OBJECT_NOT_FOUND` for every caller instead of `403 PERMISSION_DENIED` below the platform operator. The refusal at the `/meta` write doors, the permission-set clone door and the `/packages` write doors is unchanged.
  - `capability-reference-unknown` no longer counts a `sys_capability` seed row as a declared capability — no runtime reader consults one. Declare the capability with `defineCapability`.
  - On an existing database `os migrate plan`'s unmanaged-table sweep now lists the `sys_position`, `sys_permission_set`, `sys_position_permission_set` and `sys_capability` tables: they keep their rows and no object declares them any more. The sweep only reports; nothing is dropped, and the tables stay for the organization-ownership migration.
  
  Removed exports, no replacement:
  
  - `@objectstack/plugin-security`: the object definitions `SysPosition`, `SysPermissionSet`, `SysPositionPermissionSet`, `SysCapability` (from `./objects`); `securityObjects` lists the remaining three.
  - `@objectstack/platform-objects/pages`: `SysPositionDetailPage`.
  - `@objectstack/spec`: `SystemObjectName.POSITION`, `SystemObjectName.PERMISSION_SET`; the four names leave `PLATFORM_OBJECTS_BY_PACKAGE['plugin-security']` and `PLATFORM_PROVIDED_OBJECT_NAMES`.
  - `@objectstack/core`: `isRowActive` and `ActivatableRow` — a catalog row's `active` column decides nothing; deactivation is the activation ledger's (`sys_metadata_activation`).
  - `@objectstack/objectql`: the published `PLATFORM_OBJECT_TENANCY` record loses its `sys_permission_set` key (the other three names were never in it). A removed key of an exported constant is a narrowing, so `@objectstack/objectql` takes `minor` under the launch-window convention for breaking changes.
- 3c1a046: fix: a route's catch-all `500` answers its own generic text, never the caught error's message, and `@objectstack/types` exports the writer that does it, `sendServerFault`
  
  Clause-②: yes (widening) — `@objectstack/types` gains one export, `sendServerFault`; nothing is removed, renamed or narrowed, and no response field changes shape.
  
  A declared 5xx does not carry the text of the error it caught: that text can name server internals, such as a path, a host or a table. The REST layer already withheld it. The storage, settings and i18n route families and the share-link routes answer in the nested `{ success: false, error: { code, message } }` envelope and did not: their catch-all `500` sent the caught error's message to the caller.
  
  - **What a caller now reads.** The same `status` and `code` as before, with the route's own generic text as `error.message`: `Internal error` on the storage and i18n routes, the route's message on the settings routes (`Failed to list manifests`, `Failed to read namespace`, `Failed to write namespace`, `Action failed`), and the route's `Failed to …` message on the share-link routes. On the storage routes this includes the metadata store's outage sentence, which an operator now reads in the server log.
  - **What the operator reads.** The original error, stack included, in one `[5xx]` server-fault line. The storage byte routes, which already withheld the text, logged two lines per fault and now log one. A line names the mounted route pattern when the route passes one, never the request URL.
  - **Unchanged.** Every `4xx` answer. The settings `SETTINGS_CRYPTO_UNAVAILABLE` refusal, which keeps its prescription. The authorization-store outage `503`, which keeps its declared code and message. The storage `501 NOT_IMPLEMENTED` answers. On the share-link routes, any error that declares its own `status` keeps the envelope it declares.
  - **`sendServerFault(res, status, code, message, thrown, request?)`** (new, `@objectstack/types`): writes `message` in the declared envelope, and hands `thrown` to the server-fault log with its stack, as the fault's one line. Use it for an arm that answers a caught fault. Keep `sendError` for a `4xx` and for a `5xx` whose text you wrote for the reader. `request` is the mounted route pattern, never the request URL.
- 37510aa: feat(security): the guest's grants channel — an anonymous request at a guest-entry door holds the sets bound to the `guest` anchor, in the one organization the deployment resolves for it (ADR-0138 E1, D3/D4)
  
  ADR-0087 disposition: none. No authorable key, accept set or stored shape moves: no spec schema, metadata type, stored row or published response field is added, removed, renamed or re-shaped. A declared binding that was not enforced becomes enforced (ADR-0090 D9, as ADR-0138 D3 amends it).
  
  **The bindings that start granting.** On the reference apps, none: `app-showcase`, `app-crm`, `app-multi-package` and `app-todo` declare no definition of the `guest` anchor that names a set. `app-showcase` ships `showcase_guest_portal` as a capability an administrator may bind and binds it to no anchor (its `client_portal_user` position is an ordinary position), and `app-crm`'s `guest_portal` is the public form doors' set, which keeps its own posture. No reference app declares a permission set named `guest`, so no grant stops either. A set starts granting only where a deployment holds an environment definition of the `guest` position that names it.
  
  What changes:
  
  - **`@objectstack/core`** — the anonymous branch of `resolveAuthzContext` resolves the guest's grants on a face that takes the explicit guest entry (the new `guestEntry` input). It reads the sets the `guest` position's definition names, through the same position-bound read every position uses, and the activation ledger as for any held set. It resolves them only in the organization the guest entry's organization step derives (`resolveGuestOrganization`), which asks ADR-0131 D9's predicate and no second spelling of it. With nothing bound, the guest holds no set and no read is issued. The predicate itself, `resolveSystemWriteOrganization`, moves to `@objectstack/core` so both of its askers share it. New exports: `resolveGuestOrganization`, `resolveSystemWriteOrganization` (with `SystemWriteOrganizationDecision` and `SystemWriteRefusalReason`), and `GuestOrganizationUnresolvedError` with `isGuestOrganizationUnresolvedError` and its constants.
  - **`@objectstack/objectql`** — `resolveSystemWriteOrganization` and its two types are re-exported from `@objectstack/core` as the same bindings. Nothing a caller imports changes.
  - **`@objectstack/plugin-security`** — the set resolution treats the guest's sets as any requested set, and no longer folds the guest's position into the request. A permission set that merely shares the anchor's name no longer reaches an anonymous caller, and the baseline and `everyone` never did. At the CRUD gate, a guest that reaches a data operation acting in no organization, on a deployment where the organization step refuses, is refused before the operation runs.
  - **`@objectstack/plugin-sharing`** — the read filter answers deny-all for the guest on every object that record sharing scopes, before the sharing-model branch: the guest reaches rows only through share links, never through the object's sharing model (ADR-0138 D3 item 6, as the maintainer's ruling C amends it). `externalSharingModel` is still not read for any caller. Share links are redeemed at their own door and are unchanged.
  - **`@objectstack/runtime`** — the runtime face, which serves the guest, asks for the guest's grants.
  
  What an anonymous caller sees at an `authRequired: false` endpoint of `type: 'object_operation'`:
  
  - **One organization, a set bound to `guest`:** the operation runs as the guest, under that set, in that organization. A read the set grants is admitted and returns no row, whatever the object's sharing model (`private`, `public_read`, `public_read_write` or `controlled_by_parent`): the guest reaches a record only through a share link. A create the set grants lands in that organization with no owner.
  - **Nothing bound:** `403 PERMISSION_DENIED`, as before.
  - **A walled deployment, several organizations, or none:** `501 NOT_IMPLEMENTED`, naming the missing site binding (ADR-0138 D5), where it used to be `403 PERMISSION_DENIED` with nothing granted. Nothing that was served stops being served. The operator's log names the reason once.
  
  Unchanged: share links, which still serve an anonymous caller the one record they name, with `publicSharing.eligibility` checked at the mint and at every redemption; the public form doors, which keep their own posture and organization; the flow door, which runs under the flow's own declared posture; every surface that answers an anonymous request `401`; and every signed-in caller.
  
  Level: `minor` for `@objectstack/core`, because new exported symbols widen its published index; `patch` for the other four, whose exports do not move.
- 28e294f: fix(plugin-sharing, runtime): a share link that has a password and is limited to signed-in users answers an anonymous visitor `401 SIGN_IN_REQUIRED`, whatever password was sent
  
  Clause-②: no — every request refused before is still refused; only which refusal code an anonymous caller reads changes.
  
  A share link can carry a password and the `signed_in` audience together. For such a link, the share-link resolve door answered an anonymous visitor from the password before the audience: `NEEDS_PASSWORD` with no password, and `WRONG_PASSWORD` with any password, the correct one included. The console's shared-record page then told a visitor who typed the right password "Wrong password.", and never offered sign-in.
  
  - **Anonymous caller, `signed_in` link:** `401 SIGN_IN_REQUIRED` with no password, a wrong one or the correct one. The answer is the same for all three, so it never tells an anonymous caller whether a password is right. Once signed in, the visitor is asked for the password as before.
  - **Signed-in caller:** unchanged. `401 NEEDS_PASSWORD` with no password, `401 WRONG_PASSWORD` with a wrong one, and the record with the correct one.
  - **Unchanged:** links with any other audience (a `public` link with a password still answers `NEEDS_PASSWORD` / `WRONG_PASSWORD` to an anonymous caller), the expired-or-revoked `410 EXPIRED_OR_REVOKED`, the `404 INVALID_OR_EXPIRED` for an unknown token or an object with public sharing switched off, and every link that resolves.
  - Both mounts of the resolve door answer alike: plugin-sharing's share-link routes and the runtime dispatcher's share-links domain.
- Updated dependencies [dac99c2]
- Updated dependencies [66949b7]
- Updated dependencies [7958bdf]
- Updated dependencies [87e902d]
- Updated dependencies [777eed2]
- Updated dependencies [ed03834]
- Updated dependencies [5f37d36]
- Updated dependencies [1912af4]
- Updated dependencies [76815b9]
- Updated dependencies [4d1e4a8]
- Updated dependencies [4cc3ff9]
- Updated dependencies [c056979]
- Updated dependencies [4f68ba1]
- Updated dependencies [107853c]
- Updated dependencies [543b33d]
- Updated dependencies [b529a5c]
- Updated dependencies [1623faf]
- Updated dependencies [b4d573a]
- Updated dependencies [3c1a046]
- Updated dependencies [37510aa]
- Updated dependencies [c857a93]
- Updated dependencies [345d1be]
- Updated dependencies [430e5f5]
- Updated dependencies [14a13bc]
- Updated dependencies [ca0bdbc]
- Updated dependencies [572ecfb]
- Updated dependencies [707b3cd]
- Updated dependencies [6673c80]
- Updated dependencies [24e064f]
- Updated dependencies [5e725b8]
- Updated dependencies [eeb95f7]
- Updated dependencies [d89f491]
- Updated dependencies [dc39326]
- Updated dependencies [775ed65]
- Updated dependencies [e4ec6ec]
- Updated dependencies [325a92e]
  - @objectstack/spec@18.0.0-next.1
  - @objectstack/platform-objects@18.0.0-next.1
  - @objectstack/core@18.0.0-next.1
  - @objectstack/objectql@18.0.0-next.1
  - @objectstack/types@18.0.0-next.1
  - @objectstack/metadata-core@18.0.0-next.1
  - @objectstack/formula@18.0.0-next.1

## 18.0.0-next.0

### Minor Changes

- e7e6544: feat(plugin-sharing)!: a sharing rule reads a position's deactivation from the activation ledger, as the authorization resolver does (ADR-0131 D3, ADR-0126 §4)
  
  Clause-②: yes (narrowing: a position switched off in the activation ledger stops receiving sharing-rule shares in every organization; widening: a position whose `sys_position` row reads `active: false` receives them again)
  
  <!-- adr-0087: not-required (no-migration-prescription) no authorable metadata key changes; the sharing-rule evaluator reads deactivation from the store the resolver already reads, whose own move is registered as position-permission-sets-declared -->
  
  **BREAKING**, shipped as `minor` under the launch-window convention for breaking changes. A position's deactivation now comes from `sys_metadata_activation` instead of the `sys_position` row's `active` column, so the shares a sharing rule materializes follow the same switch the authorization resolver reads.
  
  - A sharing rule whose recipient is a position materializes no share while that position is switched off. Switched off means a `sys_metadata_activation` row of type `position` naming it, with `active` false (a driver `0` included). The switch is deployment-wide, like the ledger, so it no longer depends on the rule's organization.
  - The `sys_position` row's `active` is no longer read. A deactivation made in Setup writes that column, so until the upgrade ceremony converts it into a ledger row it stops neither the resolver nor sharing rules.
  - A name with no ledger row keeps sharing, including a membership-derived position name. A composition that registers no ledger object issues no ledger read. A ledger read that fails still grants for the pass, as the row read did.
- 5cfd866: feat(sharing): a share-link password can be sent in the `X-Share-Password` header whatever its characters, under a declared encoding (`X-Share-Password-Encoding: utf-8`)
  
  Clause-②: yes (widening)
  
  - **What was missing.** A browser cannot put a character above U+00FF in a request header (`Headers` throws a `TypeError` before the request leaves), and it strips leading and trailing spaces. `createLink` accepts any password, so a link whose password has a CJK character or an emoji could not be opened through the header.
  - **What is now accepted.** A new companion request header, `X-Share-Password-Encoding`, declares how `X-Share-Password` is encoded. Its one value is `utf-8`, compared case-insensitively. Under it, `X-Share-Password` carries the password's UTF-8 bytes percent-encoded, as `encodeURIComponent(password)` produces them, and both public routes (`GET /api/v1/share-links/:token/resolve` and `/:token/messages`) decode it on both mounts: the sharing plugin's routes and the runtime dispatcher's `/share-links` domain. Both read the pair through one helper, `readSharePasswordHeader`, exported from `@objectstack/types` with the header-name constants.
  - **Unchanged.** Without `X-Share-Password-Encoding`, `X-Share-Password` is read raw, exactly as before, so every value a client sends today resolves as it did. That includes a Latin-1 password and a raw password containing `%`; the server never percent-decodes a value nobody declared encoded. The `?password=` query parameter is still read first, and when it is present the header pair is not read.
  - **What is refused.** `X-Share-Password-Encoding` naming any other value, or a password header that is not percent-encoded UTF-8 under `utf-8` (a `%` without two hex digits, octets that are not well-formed UTF-8, a character outside visible ASCII), answers `400 VALIDATION_FAILED` before the token is looked up. It is never compared raw instead. The message names the headers and the rule, never the presented value.
  - **Response headers.** Both public routes now answer `Vary: X-Share-Password, X-Share-Password-Encoding`, still beside `Cache-Control: no-store`.
  - **Cross-origin clients.** `X-Share-Password-Encoding` is in the default CORS preflight allow-list (`DEFAULT_CORS_ALLOW_HEADERS` in `@objectstack/plugin-hono-server`, which the `@objectstack/hono` adapter also applies). A deployment that passes its own `allowHeaders` must add `X-Share-Password-Encoding` beside `X-Share-Password` to let a cross-origin client send an encoded password.

### Patch Changes

- 1c563af: Setup → Record Shares opens on every share, not on the shares granted to the administrator. Before this, the entry named no view, and `sys_record_share` declared the caller-scoped "Granted to Me" view (`recipient_id = {current_user_id}`) first.
  
  Clause-②: no
  
  - `sys_record_share` now declares its unscoped "All" view (`all_shares`) first. "Granted to Me" and "Granted by Me" follow it, still as tabs. No view is added, removed or changed.
  - The Setup entry `nav_record_shares` now names `all_shares` with `viewName`, so it does not depend on the declared order.
  - The generated translation bundles follow the new view order. No translated text changed.
  - ⛔ No schema, parse, export or accept-set change.
- 4f4c4ed: fix(auth,services): the remaining in-process session reads no longer renew a browser session behind its cookie (#22258)
  
  **What was wrong.** better-auth's `getSession` renews a session older than `session.updateAge`: it moves `sys_session.expires_at` to `now + expiresIn` and stages the renewed session cookie on that call's own response. Nine doors in these packages read the session in-process (`auth.api.getSession({ headers })`) and answer with their own response, so the renewal landed in the database and its cookie was discarded. The browser kept its old cookie, which then expired before the session: a dead cookie beside a live bearer, after which every cookie-only path saw a signed-out user. The doors: `POST /api/v1/auth/admin/oauth2/toggle-disabled`, every `/api/v1/auth/admin/*` mount behind the shared platform-admin gate, `POST /api/v1/auth/admin/unlock-user` and `POST /api/v1/auth/admin/has-permission` (`@objectstack/plugin-auth`); `POST /api/v1/webhooks/redeliver`; the storage upload and download doors (`/api/v1/storage/*`); the share-link management routes (`/api/v1/share-links`); the settings routes (`/api/settings`); and the datasource-admin routes (`/api/v1/datasources/*`).
  
  **The rule now** is the one the REST, dispatcher, current-user and cloud-connection doors already follow. Each of these reads goes through `inProcessSessionReadInput(headers)` from `@objectstack/types`:
  
  - **A request carrying a session cookie** (a browser, including a console that sends its cookie beside its bearer) reads with `query.disableRefresh`. The session renews only through `GET /api/v1/auth/get-session`, which re-issues the cookie with `Max-Age = expiresIn`, so cookie and session expire together.
  - **A bearer-only request** (`@objectstack/client` outside a browser, the `os` CLI) is unchanged: a read past `updateAge` still renews the session, and no cookie is set on a response to a request that sent none.
  
  **Upgrading.** Nothing to change. `@objectstack/plugin-webhooks` now depends on `@objectstack/types` directly; it already reached it through `@objectstack/core`.
- b3a3634: docs: four contract docblocks now describe what the code decides. No type, schema or runtime change.
  
  Clause-②: no
  
  - **`ControlledByParentWriteDenialLeg` (`@objectstack/spec`).** The `master_chain` leg has three resolution refusals: no relation to derive from, a row that is not present, and an empty master reference. Each names the master whose own master the walk could not derive. That master is the record's own master, when it is itself `controlled_by_parent`, or any master above it. The docblock said only a master above the record's own master. The next sentence now says "past the record itself" where it said "above the first hop", so the two agree. The `record_not_found` bullet of `ControlledByParentWriteUnresolvedReason` had the same first-hop gap for a missing master row: it now says an absent row of a master that is itself `controlled_by_parent` is the `master_chain` leg, on the first hop or above it, and the legs judge a missing row only where the master governs its own rows.
  - **`ISharingService.canEdit` (`@objectstack/spec`) and `SharingService.canEdit` (`@objectstack/plugin-sharing`).** The caller lists no longer name the `sys_attachment` and `sys_comment` parent gates. Those gates read `checkEdit` and the master-detail write check. The `ISharingService.canEdit` sentence on how they reach the service now names `checkEdit`.
  
  `ControlledByParentWriteDenialLeg`, `ControlledByParentWriteOutcome`, `canEdit` and `checkEdit` keep their declared shapes, and no verdict, outcome or refusal changes.
- ef1fcb2: A declared index states its uniqueness scope: bare `unique: true` on `indexes[]` is refused (protocol 18, ADR-0120 D1/D7), stored metadata converts it to `unique: 'global'` with zero drift, and `VISIBILITY_STRICT_OPTIONS` leaves `@objectstack/spec`'s public surface.
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: registered declared-index-bare-unique-true-retired, visibility-strict-options-unexported -->
  
  **BREAKING**: an accept-set narrowing on a published authoring surface and one export removal, shipped as `minor` under the launch-window convention for accept-set narrowings (Changesets pre mode is not in on `main`).
  
  **Why.** On a declared index, bare `unique: true` was the one `unique` spelling whose scope was positional. It built the index over exactly `fields`, one holder across the whole installation, while reading like "unique per organization" to an author who knew the field-level meaning. 17.x warned (lint `unique/unscoped-declared-index`). Protocol 18 refuses it, so the scope is always stated.
  
  **What is refused.** A declared index (`objects[].indexes[]`, `objectExtensions[].indexes[]`) whose `unique` is bare `true`. The refusal names both replacements, and says which one keeps the index bare `true` built. It is raised by:
  
  - the schema (`IndexSchema.unique`, now `false | 'global' | 'organization'`), at every door that parses: `ObjectSchema.create()` and `ObjectSchema.parse()`, `defineStack`, `os validate`, `os build`, and the runtime save door (`422 INVALID_METADATA`). `tsc` refuses it too, because the input type no longer admits `true`;
  - lint `unique/unscoped-declared-index`, now an `error` and a gating rule on all three commands. It is what refuses the spelling under `os lint`, which never parses.
  
  **What converts.** The protocol-18 ADR-0087 conversion `declared-index-unique-scope` rewrites a declared index's bare `true` to `'global'` on every data-at-rest seam: stored `sys_metadata` rows (`applyConversionsToStoredItem`), built artifacts inside their declared-floor window, and `os migrate meta --from 17`. `'global'` is exactly the index bare `true` built, so the physical index is byte-identical and the drift plan is empty. It is retired from the authoring funnel, so a live author is refused and taught instead of converted silently.
  
  **What stays accepted.** Field-level `unique: true` still means one holder per organization and stays valid indefinitely. On a declared index, `unique: false` or omitted, `'global'` and `'organization'` parse exactly as before.
  
  ## FROM → TO
  
  | you wrote | write instead |
  |:--|:--|
  | `indexes: [{ fields: [...], unique: true }]` | `indexes: [{ fields: [...], unique: 'global' }]`: the same index, nothing on disk changes |
  | …the same, when you meant one holder per organization | `unique: 'organization'`: the driver prepends the NULL-safe organization key part at registration, and `os migrate plan` shows the index change |
  | `import { VISIBILITY_STRICT_OPTIONS } from '@objectstack/spec/shared'` (or the root entry) | delete the import: it was an internal option bag for the spec's own visibility-carrying schemas, and those schemas are unchanged |
  
  **The one-line fix: on every declared index, write `unique: 'global'` where you wrote `unique: true`.** Run `os migrate meta --from 17` to list the mechanical edits for existing sources; apply them by hand.
  
  **Who is affected, measured.** At `e67ba80049`, an AST census found 48 declared indexes with bare `unique: true` in 39 source files of this repository, all platform and plugin objects. Every one is respelled `'global'` in this change, and the nine-key S5 corpus is pinned to build byte-identical indexes before and after (`driver-sql`'s `sql-driver-unique-tenancy.test.ts`). `examples/**` and `apps/**` carry none. Deployed metadata and other repositories were not measured.
  
  ### The kit
  
  - **The refusal.** `IndexSchema.unique` in `data/object.zod.ts`, with its own prescription. The lint rule moved from `warning` to `error` and from advisory to gating.
  - **The conversion.** `declared-index-unique-scope` (`toMajor: 18`, retired from the load path, `retiredAfter: '17.7.0'`), with its S4/S5 fixture.
  - **The ledger.** The D3 semantic entries `declared-index-bare-unique-true-retired` (the scope each respelled index really meant is the author's call) and `visibility-strict-options-unexported`, plus a step-18 rationale fragment.
  - **The export.** `VISIBILITY_STRICT_OPTIONS` moved to the unbarrelled `shared/visibility-strict-options.ts`, beside its type `StrictObjectOptions`. `check:api-surface` counts the removal.
  - **The pins.** The "`'global'` is a synonym of `true`" driver pin retired with the bare spelling. The verbatim pin is stated in `'global'`.
- Updated dependencies [317cddd]
- Updated dependencies [fec87e7]
- Updated dependencies [34dba5a]
- Updated dependencies [c28f317]
- Updated dependencies [2e10c9a]
- Updated dependencies [67b669e]
- Updated dependencies [0253192]
- Updated dependencies [0253192]
- Updated dependencies [48cca4a]
- Updated dependencies [bfc15d2]
- Updated dependencies [2ff0825]
- Updated dependencies [7aa8d51]
- Updated dependencies [95a8435]
- Updated dependencies [c8a9783]
- Updated dependencies [60bcfe7]
- Updated dependencies [d112087]
- Updated dependencies [4806b18]
- Updated dependencies [1802315]
- Updated dependencies [06cc45d]
- Updated dependencies [8c5aa50]
- Updated dependencies [7de0265]
- Updated dependencies [7895671]
- Updated dependencies [b389e43]
- Updated dependencies [c8b062f]
- Updated dependencies [117d34d]
- Updated dependencies [6729e10]
- Updated dependencies [1920cf3]
- Updated dependencies [1920cf3]
- Updated dependencies [41d0d40]
- Updated dependencies [c52bfb4]
- Updated dependencies [c7d6037]
- Updated dependencies [72b26ed]
- Updated dependencies [2d21b9c]
- Updated dependencies [f66fdc7]
- Updated dependencies [9fdb127]
- Updated dependencies [615c696]
- Updated dependencies [968acc8]
- Updated dependencies [111ffff]
- Updated dependencies [12b9daf]
- Updated dependencies [d85615d]
- Updated dependencies [6a06e3b]
- Updated dependencies [0e9e7b7]
- Updated dependencies [0af4f66]
- Updated dependencies [9a0401f]
- Updated dependencies [9c93ce6]
- Updated dependencies [77a94d8]
- Updated dependencies [ac9f8bd]
- Updated dependencies [879bd38]
- Updated dependencies [04e776b]
- Updated dependencies [1c563af]
- Updated dependencies [a7df552]
- Updated dependencies [2f70c22]
- Updated dependencies [78f841b]
- Updated dependencies [c565813]
- Updated dependencies [d5a14dd]
- Updated dependencies [f85a83b]
- Updated dependencies [93125ae]
- Updated dependencies [56c8844]
- Updated dependencies [5cfd866]
- Updated dependencies [d4680d2]
- Updated dependencies [c8d06a9]
- Updated dependencies [cdeabec]
- Updated dependencies [d7c5c33]
- Updated dependencies [a87d8be]
- Updated dependencies [15ec50e]
- Updated dependencies [db4c45b]
- Updated dependencies [51290bc]
- Updated dependencies [ad381fd]
- Updated dependencies [4e4111c]
- Updated dependencies [2b61f2d]
- Updated dependencies [8f2e808]
- Updated dependencies [3b49318]
- Updated dependencies [4e9fe9f]
- Updated dependencies [fe98cc6]
- Updated dependencies [9ad3d24]
- Updated dependencies [326a90a]
- Updated dependencies [9fe7448]
- Updated dependencies [2e11d90]
- Updated dependencies [0b7ba4d]
- Updated dependencies [4578c56]
- Updated dependencies [c512c25]
- Updated dependencies [0b997ea]
- Updated dependencies [215e662]
- Updated dependencies [3d886ee]
- Updated dependencies [f4069c5]
- Updated dependencies [d8d0711]
- Updated dependencies [a45d5d8]
- Updated dependencies [f6e1d49]
- Updated dependencies [345d3f3]
- Updated dependencies [e9a1f5c]
- Updated dependencies [40a6ee5]
- Updated dependencies [e87070e]
- Updated dependencies [5910b5e]
- Updated dependencies [7098aca]
- Updated dependencies [97610a5]
- Updated dependencies [081e6a0]
- Updated dependencies [c8c803c]
- Updated dependencies [f05649f]
- Updated dependencies [e030d43]
- Updated dependencies [1884948]
- Updated dependencies [3089848]
- Updated dependencies [e23eccb]
- Updated dependencies [ac8f2c5]
- Updated dependencies [746637e]
- Updated dependencies [fdfdd7e]
- Updated dependencies [db9cf80]
- Updated dependencies [e75dced]
- Updated dependencies [9af0005]
- Updated dependencies [9af0005]
- Updated dependencies [440bed6]
- Updated dependencies [94379f4]
- Updated dependencies [b2549a8]
- Updated dependencies [ee8751d]
- Updated dependencies [96e4be4]
- Updated dependencies [35ef501]
- Updated dependencies [faf6348]
- Updated dependencies [557ae7c]
- Updated dependencies [6a3fe25]
- Updated dependencies [7731d70]
- Updated dependencies [da989bb]
- Updated dependencies [3073b72]
- Updated dependencies [c76edeb]
- Updated dependencies [5b12503]
- Updated dependencies [514bf3c]
- Updated dependencies [20e7d52]
- Updated dependencies [b3a3634]
- Updated dependencies [3e72f93]
- Updated dependencies [f89b5f5]
- Updated dependencies [d25b187]
- Updated dependencies [0e00d36]
- Updated dependencies [018b077]
- Updated dependencies [d748ae8]
- Updated dependencies [dab6bf4]
- Updated dependencies [ed1de8c]
- Updated dependencies [a00cf99]
- Updated dependencies [a00cf99]
- Updated dependencies [5fb1746]
- Updated dependencies [29a163f]
- Updated dependencies [e223152]
- Updated dependencies [9f5eca5]
- Updated dependencies [9963322]
- Updated dependencies [b27b894]
- Updated dependencies [874a38d]
- Updated dependencies [02d9f69]
- Updated dependencies [f53f14b]
- Updated dependencies [a800912]
- Updated dependencies [87cd458]
- Updated dependencies [d973c34]
- Updated dependencies [156ddfa]
- Updated dependencies [1bb1da1]
- Updated dependencies [5081090]
- Updated dependencies [615cba8]
- Updated dependencies [b6eb25f]
- Updated dependencies [165587e]
- Updated dependencies [e04759d]
- Updated dependencies [ea9fd99]
- Updated dependencies [b32ee3e]
- Updated dependencies [b62260c]
- Updated dependencies [91f46d0]
- Updated dependencies [e5899a6]
- Updated dependencies [d7b26df]
- Updated dependencies [490cb6d]
- Updated dependencies [e865300]
- Updated dependencies [ec7c7e0]
- Updated dependencies [ec7c7e0]
- Updated dependencies [c74d843]
- Updated dependencies [6d5191e]
- Updated dependencies [85edd61]
- Updated dependencies [e84aeb3]
- Updated dependencies [322ff1e]
- Updated dependencies [7b0a9c9]
- Updated dependencies [5fc57b3]
- Updated dependencies [fe58bbc]
- Updated dependencies [c4e7fa5]
- Updated dependencies [581ca7d]
- Updated dependencies [3f0b6f2]
- Updated dependencies [3f0b6f2]
- Updated dependencies [b7cd1af]
- Updated dependencies [9814035]
- Updated dependencies [55382dc]
- Updated dependencies [b1d701b]
- Updated dependencies [efcbac7]
- Updated dependencies [51f36e7]
- Updated dependencies [31b5a5f]
- Updated dependencies [20028df]
- Updated dependencies [69d4218]
- Updated dependencies [5ce6773]
- Updated dependencies [8532783]
- Updated dependencies [eb20c33]
- Updated dependencies [9432bac]
- Updated dependencies [6373952]
- Updated dependencies [3caae97]
- Updated dependencies [3f69471]
- Updated dependencies [8bc7836]
- Updated dependencies [e5687cb]
- Updated dependencies [1e62f71]
- Updated dependencies [ec7f7f8]
- Updated dependencies [038d4c9]
- Updated dependencies [5677add]
- Updated dependencies [8d8f965]
- Updated dependencies [147a0d1]
- Updated dependencies [21914c3]
- Updated dependencies [1959aac]
- Updated dependencies [e1deaef]
- Updated dependencies [4663801]
- Updated dependencies [3071d3e]
- Updated dependencies [d294951]
- Updated dependencies [1badd31]
- Updated dependencies [58f5c90]
- Updated dependencies [55828c5]
- Updated dependencies [7856110]
- Updated dependencies [9b37edb]
- Updated dependencies [a22e67b]
- Updated dependencies [62ce45d]
- Updated dependencies [c5b43b6]
- Updated dependencies [39e93ef]
- Updated dependencies [02bec6c]
- Updated dependencies [719183f]
- Updated dependencies [8464380]
- Updated dependencies [8c10776]
- Updated dependencies [252a582]
- Updated dependencies [abf8655]
- Updated dependencies [f931e76]
- Updated dependencies [e5f9f01]
- Updated dependencies [ef1fcb2]
- Updated dependencies [ace0a53]
- Updated dependencies [8311650]
- Updated dependencies [de70e97]
- Updated dependencies [74c4b34]
- Updated dependencies [e040b8c]
- Updated dependencies [f451a59]
- Updated dependencies [ba95607]
- Updated dependencies [b53b949]
- Updated dependencies [ea9fd99]
- Updated dependencies [1e44436]
- Updated dependencies [2acff87]
- Updated dependencies [299a2c6]
- Updated dependencies [e23eccb]
- Updated dependencies [bf492c8]
- Updated dependencies [c7a3234]
  - @objectstack/spec@18.0.0-next.0
  - @objectstack/objectql@18.0.0-next.0
  - @objectstack/core@18.0.0-next.0
  - @objectstack/platform-objects@18.0.0-next.0
  - @objectstack/metadata-core@18.0.0-next.0
  - @objectstack/types@18.0.0-next.0
  - @objectstack/formula@18.0.0-next.0

## 17.7.0

### Minor Changes

- 50e1c65: fix(plugin-audit,platform-objects,plugin-auth,plugin-sharing,plugin-approvals)!: the audit ledger no longer records fields declared `internal`, and the platform's credential-class fields are declared `internal`
  
  Clause-②: no (narrowing)
  
  <!-- adr-0087: not-required (no-migration-prescription) No authorable key, export or config field is removed or renamed: the change narrows what the generic data path and the audit ledger return for platform-owned columns, and nothing an author wrote needs rewriting. The objectql half adds exports only. -->
  
  **BREAKING for readers of credential-class columns on the generic data path and in the audit ledger.**
  
  **What changed.**
  
  - The audit plugin's CRUD mirror now omits every field declared `internal: true` from the
    rows it writes to `sys_audit_log` and `sys_activity`: create `new_value`, both sides of an
    update, delete `old_value`, and the activity row. It already masked `secret` and `password`
    fields; `internal` is the same contract the generic data path already enforces ("never
    returned on the generic data path"). An update that changes only an `internal` field still
    writes its row, with neither value.
  - These platform fields are now declared `internal: true`, so neither the generic data path
    nor the ledger returns them: the JWT signing key's private key (`sys_jwks`), both credential
    columns of the one-time verification object (`sys_verification`), the two-factor secret and
    backup codes, the SSO provider's OIDC and SAML protocol blobs, the OAuth access and refresh
    token columns, the OAuth client secret digest, the SCIM credential digest, the share link's
    token and password hash, and the approval action-token digest. API key digests and email
    headers were already `internal`; the ledger now honours that too.
  - Every built-in consumer that needs one of these values reads it back through the engine's
    privileged accessor rather than the generic path: JWT signing, password reset and the other
    one-time verification flows, two-factor verification, SSO sign-in and the legacy SSO secret
    migration, OAuth client authentication, share-link redemption (the password gate is held)
    and the creator's share-link list, which keeps returning each link's token. The runtime's
    share-link resolve route (the dispatcher twin of the plugin's) still answers "password
    required" for a protected link rather than the unknown-link shape.
  - The one-time verification object's record title is now the fixed label `Verification`; it no
    longer shows the identifier column.
  - `@objectstack/objectql` exports two helpers from its main and `/core` entries:
    `collectInternalReadFields` (the names of an object's `internal` fields) and
    `readInternalColumn` (recovers one `internal` column for rows already read, through the
    engine's privileged accessor, and fails closed when the value cannot be recovered).
  
  **What to do after upgrading.**
  
  - **Rotate the JWT signing keys.** Ledger rows written before this release are not rewritten
    (the ledger is append-only), so a signing key that existed before the upgrade may have a copy
    in the ledger. Rotate the keys so that copy signs nothing.
  - **Revoke and re-mint share links that must stay private.** A share link's token is a
    capability that stays valid until the link expires or is revoked, and links minted before this
    release may have a copy in the ledger.
  - A copy of a one-time verification credential is usable only while that credential is still
    outstanding: once it is consumed or expires, its copy names nothing that will be accepted.
  - An integration that read any of these columns through `GET /api/v1/data/...` no longer
    receives them. Read share links through `/api/v1/share-links`, and OAuth clients and SSO
    providers through their auth routes.
- 4c8363f: feat(plugin-sharing): the record owner and an explicit Modify-All holder may mint a share link on a record the data door refuses them (ADR-0111 D8 rule 1, ruling A′) (#21329)
  
  Clause-②: yes (widening)
  
  - **Who may mint.** `ShareLinkService.createLink` admits the caller when they can see the record, **or** own it, **or** hold `modifyAllRecords` on the object. The object's `publicSharing` opt-in is still checked first, and `publicSharing.eligibility` still last. On an object declared `access: { default: 'private' }` no wildcard grant covers the record, so its owner's own read is refused; the owner can now share it anyway. A member who neither sees nor owns the record is refused exactly as before, with the same envelope.
  - **Who still needs visibility.** A hierarchy manager whose write depth covers the record's owner manages the record's shares (revoke, grant, list), but is not admitted to mint without seeing the record: a link creates access.
  - **The organization wall.** Under the `group` and `isolated` tenancy postures the owner and Modify-All alternatives are withheld and visibility alone admits, as before this release. A member who left an organization still owns the records they created there, and must not be able to publish them by link.
  - **A required capability.** Neither alternative applies past a capability the object requires (`requiredPermissions`). An owner or Modify-All holder who lacks it is refused with the capability gate's own refusal, as before this release; an owner who holds it, refused only because no permission set grants the object, mints. The verdict is read from the `required_permissions` layer of `ISecurityService.explain`, so a security service the sharing service reaches must implement `explain`. If it does not, the two alternatives are withheld.
  - **API.** `SharingService.canMintWithoutVisibility(object, recordId, context)` answers the two alternatives with the owner and Modify-All branches `canManageShares` reads. `ShareLinkServiceOptions.canMintWithoutVisibility` is the late-bound probe `createLink` asks once the visibility read refuses, and `SharingServicePlugin` wires it. A host that constructs `ShareLinkService` itself without it keeps the visibility rule alone. The probe slice `SharingServiceOptions.securityService` returns gains an optional `explain`, the part of `ISecurityService.explain` the capability verdict reads.
  - **`@objectstack/spec` (documentation only).** The `IShareLinkService.createLink` TSDoc states who may mint, replacing "you may only link-share a record you can yourself see". The `ISharingService.canManageShares` TSDoc describes the hierarchy-manager branch, which is implemented, and says it is not mint authority. No schema, key, type or export changes.

### Patch Changes

- 4916168: Sharing refusals and log lines, and the audit write-failure line, no longer cite tracker numbers; each one states the decision behind it in words
  
  Clause-②: no
  
  Some strings these two packages show to administrators and operators pointed at an issue-tracker number for the reason behind them. The number goes; where the sentence did not already say what was decided, it now does.
  
  - `@objectstack/plugin-sharing`: the orphan-sweep line for record shares says every share on a deleted record goes, whatever its source, so a reused record id cannot inherit it; the same line for share links says a share link is a bearer token, so a reused record id must not inherit it; the write-gate failure line says a failed lookup is a refusal, never an abstention, because an abstention would hand the row to the other write authorities, which may admit it; the authored-row-write probe line says only an app-authored row-level policy that positively admits the row may lift the sharing refusal; the hierarchy-scope line says the resolver contract makes a resolver fail closed on a missing organization. The two sharing-rule refusals (no active organization; deleting a platform-global rule) drop their citations, since each sentence already says why. The `OrphanSweepSubject.issue` member's doc comment now says the member carries that reason in words.
  - `@objectstack/plugin-audit`: the missing-table fix in the audit write-failure line says that on a fresh `os dev` boot the table exists in the sibling telemetry file and not in the primary one, so look there before concluding it was never created.
  
  Text only: no status, error code, field, route or control flow moves. A client or log filter that matches the old text (for example a tracker-number suffix) needs the new spelling.
- db3fee3: A plain member's share-link list now answers: `GET /api/v1/share-links` is self-scoped for every signed-in caller, as ADR-0111 rules it
  
  Clause-②: no
  
  `ShareLinkService.listLinks` read `sys_share_link` under the caller's context. Both share-link doors force the list's `createdBy` to the caller, but the read still needed an object-level grant on `sys_share_link`, and the platform's member baseline does not grant one. So every plain member's list was refused, with or without an object filter, and the Share dialog, which loads this list when it opens, showed an error for them on every record. An admin's list answered.
  
  - The caller's own list is now read under the system context. This happens only when the caller has a non-empty user identity and the creator filter equals it. The read is constrained server-side to that identity, and each row it returns must pass the creator rule before it leaves.
  - One creator rule now serves both `listLinks` and `revokeLink`. It never matches a caller with no user identity. Neither HTTP door reaches that case, because both answer 401 first, so for an internal caller with no user identity, `revokeLink` now refuses a link whose `created_by` is absent or empty instead of treating it as theirs.
  - Every other list shape keeps the caller's context, as before: no creator filter, another user as creator, no user identity, or an admin listing someone else's links. A system caller keeps its bypass.
  - The rows carry the same columns as before. The token comes back so the console can build the link URL, and the password hash never does.
  - `@objectstack/spec`: the `IShareLinkService.listLinks` doc comment now describes the self-scoped own list. It previously said every listing is read under `context`. This is a doc comment only, with no type or export change.
  - ⛔ No permission set changes, and no new grant on `sys_share_link`.
- f5b8e29: Share-link passwords follow the platform's credential rules (#21839).
  
  - **The stored hash never leaves the server.** The share-link mint response (`POST /api/v1/share-links`, and `ShareLinkService.createLink`'s return value) no longer carries `password_hash`. The list and the redemption result are projected the same way. A client that reads a link's password state keeps reading it from the redemption route's `NEEDS_PASSWORD` answer, as before.
  - **The stored form is the platform's slow password hash.** New passwords are hashed with scrypt at the parameters account passwords use, instead of one salted SHA-256. Links minted before this release keep working: a stored password in a legacy form still verifies, and it is re-hashed into the new form on its first successful redemption. Every comparison is constant-time. A deployment that injects its own `hashPassword` / `verifyPassword` pair is unaffected, and its stored forms are left alone.
  - **The password travels in a header.** Both public share-link routes (`GET /api/v1/share-links/:token/resolve` and `/:token/messages`) accept the `x-share-password` request header, the preferred form, because a header is not part of the request URL. The `?password=` query parameter is still accepted for compatibility, so current consoles keep working until they move to the header. `/messages` accepted only the query parameter on this mount before.
  - **Cross-origin clients can send the header.** `X-Share-Password` is in the default CORS preflight allow-list (`DEFAULT_CORS_ALLOW_HEADERS` in `@objectstack/plugin-hono-server`, which the `@objectstack/hono` adapter also applies). A deployment that passes its own `allowHeaders` is unchanged; add the header to that list to let a cross-origin client use it.
  - **Public share-link answers are not cached.** Both public routes answer with `Cache-Control: no-store` and `Vary: X-Share-Password` on every outcome, on both mounts (the sharing plugin's routes and the runtime dispatcher's `/share-links` domain). The authenticated create, list and revoke routes are unchanged.
  - **Hashing works in WebContainer.** On StackBlitz WebContainer, where `node:crypto.scrypt` is incomplete, the password is hashed with the pure-JS scrypt from `@noble/hashes` (now a dependency of `@objectstack/plugin-sharing`, as it already is of `@objectstack/plugin-auth`), at the same parameters and in the same stored form. A hash made on either runtime verifies on the other.
- Updated dependencies [ecb6ca0]
- Updated dependencies [135daaa]
- Updated dependencies [22c2d6f]
- Updated dependencies [909229e]
- Updated dependencies [0721848]
- Updated dependencies [bdd3654]
- Updated dependencies [aead296]
- Updated dependencies [c205b6c]
- Updated dependencies [0a0debb]
- Updated dependencies [c98a72d]
- Updated dependencies [48fa7a3]
- Updated dependencies [ad7c351]
- Updated dependencies [e901c27]
- Updated dependencies [a387354]
- Updated dependencies [f6b7520]
- Updated dependencies [36e4647]
- Updated dependencies [93a54b8]
- Updated dependencies [f623e2f]
- Updated dependencies [96a9719]
- Updated dependencies [41a3c8d]
- Updated dependencies [c52c49d]
- Updated dependencies [cfa4d74]
- Updated dependencies [99589f9]
- Updated dependencies [36ad321]
- Updated dependencies [dcc5ef4]
- Updated dependencies [748b240]
- Updated dependencies [9b7a0ef]
- Updated dependencies [50e1c65]
- Updated dependencies [713b0fa]
- Updated dependencies [5a9292e]
- Updated dependencies [30af17e]
- Updated dependencies [1878ef9]
- Updated dependencies [7aab759]
- Updated dependencies [1c52a5e]
- Updated dependencies [c2cd651]
- Updated dependencies [99e1912]
- Updated dependencies [7ebb543]
- Updated dependencies [3911901]
- Updated dependencies [222ecc2]
- Updated dependencies [04f0cc4]
- Updated dependencies [1fd5664]
- Updated dependencies [3937ad2]
- Updated dependencies [3a6d92f]
- Updated dependencies [7526058]
- Updated dependencies [53fd35e]
- Updated dependencies [23365ea]
- Updated dependencies [32d5769]
- Updated dependencies [ceb4a93]
- Updated dependencies [16eefc6]
- Updated dependencies [6e33b67]
- Updated dependencies [57cc695]
- Updated dependencies [db3fee3]
- Updated dependencies [4c8363f]
- Updated dependencies [9f13c94]
- Updated dependencies [9f13c94]
- Updated dependencies [d956910]
- Updated dependencies [6d67ad5]
- Updated dependencies [ca0dfb6]
- Updated dependencies [45efcfa]
- Updated dependencies [45efcfa]
- Updated dependencies [6d728b8]
- Updated dependencies [6d728b8]
- Updated dependencies [c9c555a]
- Updated dependencies [68c5ab7]
- Updated dependencies [b793010]
- Updated dependencies [5555047]
- Updated dependencies [5555047]
- Updated dependencies [85e29b8]
- Updated dependencies [aa46322]
- Updated dependencies [100c394]
- Updated dependencies [72217cd]
- Updated dependencies [72af58c]
- Updated dependencies [1289925]
- Updated dependencies [958cfe2]
- Updated dependencies [ced3e1a]
- Updated dependencies [7d674df]
- Updated dependencies [3f1bc81]
- Updated dependencies [72f3c74]
- Updated dependencies [529d971]
- Updated dependencies [16d241a]
- Updated dependencies [4331a6b]
- Updated dependencies [83b3d32]
- Updated dependencies [6c5697d]
- Updated dependencies [9a4182a]
- Updated dependencies [41b1333]
- Updated dependencies [f1e4ae5]
- Updated dependencies [eb9ef79]
- Updated dependencies [eb9ef79]
- Updated dependencies [eb9ef79]
- Updated dependencies [f83d066]
- Updated dependencies [1ac7308]
- Updated dependencies [10454b3]
- Updated dependencies [9e9d693]
- Updated dependencies [5c9138b]
- Updated dependencies [6ec54f0]
- Updated dependencies [a1ca156]
- Updated dependencies [98eb3b9]
- Updated dependencies [5b5e83f]
- Updated dependencies [be55fd2]
- Updated dependencies [a2aadab]
- Updated dependencies [8843505]
- Updated dependencies [fe10172]
- Updated dependencies [5259a35]
- Updated dependencies [ed15448]
- Updated dependencies [9d91f58]
- Updated dependencies [9059082]
- Updated dependencies [a6a7547]
- Updated dependencies [309224d]
- Updated dependencies [e83c9f6]
- Updated dependencies [045f764]
- Updated dependencies [75ddcd1]
- Updated dependencies [2df3d13]
- Updated dependencies [07bf21f]
- Updated dependencies [6fb7115]
- Updated dependencies [53021e3]
- Updated dependencies [26d710e]
- Updated dependencies [a0176ef]
- Updated dependencies [e1790fd]
- Updated dependencies [149153c]
- Updated dependencies [ba57588]
- Updated dependencies [a43d90a]
- Updated dependencies [607463d]
- Updated dependencies [607463d]
- Updated dependencies [cab6396]
- Updated dependencies [e864db5]
- Updated dependencies [7665c54]
- Updated dependencies [866683f]
- Updated dependencies [88a39c0]
- Updated dependencies [8e35895]
- Updated dependencies [1f04696]
- Updated dependencies [0728cbf]
- Updated dependencies [e6dc7a2]
- Updated dependencies [f243a29]
- Updated dependencies [d16b9fb]
- Updated dependencies [13a22d0]
- Updated dependencies [bab7685]
- Updated dependencies [fb69825]
- Updated dependencies [f76c622]
- Updated dependencies [48eb9c1]
- Updated dependencies [8832655]
- Updated dependencies [100f68b]
- Updated dependencies [8963dbf]
- Updated dependencies [1354e7b]
- Updated dependencies [1cbe165]
- Updated dependencies [3c7785d]
- Updated dependencies [6dd99b8]
- Updated dependencies [568dc0b]
- Updated dependencies [15fe567]
- Updated dependencies [0bddffd]
- Updated dependencies [7e0066a]
  - @objectstack/spec@17.7.0
  - @objectstack/platform-objects@17.7.0
  - @objectstack/core@17.7.0
  - @objectstack/formula@17.7.0
  - @objectstack/metadata-core@17.7.0
  - @objectstack/objectql@17.7.0
  - @objectstack/types@17.7.0

## 17.6.0

### Patch Changes

- b80ab57: Provenance comments in `plugin-sharing` were re-anchored
  
  Comment and docblock lines under `src/` that cited tracker numbers which no
  longer resolve on GitHub now cite the commit in this repository's history that
  decided the matter, and say in their own words what was decided. Comments
  only: no type, schema, export, log or refusal text, or runtime behaviour changes.
- Updated dependencies [e5c7d07]
- Updated dependencies [addbbf0]
- Updated dependencies [93d4e0e]
- Updated dependencies [88b484e]
- Updated dependencies [9905e61]
- Updated dependencies [fa0a4b6]
- Updated dependencies [f11b5f2]
- Updated dependencies [0cb72cf]
- Updated dependencies [c1d8051]
- Updated dependencies [a918fe7]
- Updated dependencies [41dcf11]
- Updated dependencies [c46279f]
- Updated dependencies [688ddef]
- Updated dependencies [b1aab1e]
- Updated dependencies [274e162]
- Updated dependencies [05a7547]
- Updated dependencies [0efbdc3]
- Updated dependencies [c8dd8dd]
- Updated dependencies [03cdb9a]
- Updated dependencies [15b586d]
- Updated dependencies [542670d]
- Updated dependencies [e73ee2d]
- Updated dependencies [92fe081]
- Updated dependencies [c4c68ca]
- Updated dependencies [d78a0bd]
- Updated dependencies [5363e2d]
- Updated dependencies [c876a74]
- Updated dependencies [f1e921a]
- Updated dependencies [7a1faf1]
- Updated dependencies [c9d234c]
- Updated dependencies [3572916]
- Updated dependencies [5a23096]
- Updated dependencies [a94f3ba]
- Updated dependencies [3fbf3ca]
- Updated dependencies [24d521e]
- Updated dependencies [f4ce10c]
- Updated dependencies [b785c3b]
- Updated dependencies [97005ae]
- Updated dependencies [2473e26]
- Updated dependencies [3a89d45]
- Updated dependencies [f379f57]
- Updated dependencies [889139c]
- Updated dependencies [05cb2bc]
- Updated dependencies [7510663]
- Updated dependencies [4bf4e7e]
- Updated dependencies [a6866da]
- Updated dependencies [1a75e39]
- Updated dependencies [cd901d7]
- Updated dependencies [d7631d5]
- Updated dependencies [d830d71]
- Updated dependencies [89801cd]
- Updated dependencies [1ab9892]
- Updated dependencies [fbec216]
- Updated dependencies [35587f7]
- Updated dependencies [cd6d8a5]
- Updated dependencies [ace770d]
- Updated dependencies [ed54768]
- Updated dependencies [99786f9]
- Updated dependencies [5757463]
- Updated dependencies [63bfe69]
- Updated dependencies [1940afd]
- Updated dependencies [4f83db5]
- Updated dependencies [f5c7b2c]
- Updated dependencies [6afccda]
- Updated dependencies [671d4c1]
- Updated dependencies [bbcd20c]
- Updated dependencies [c8111a5]
- Updated dependencies [9ad6544]
- Updated dependencies [c9c182e]
- Updated dependencies [4b4ee88]
- Updated dependencies [4b4ee88]
- Updated dependencies [b9087d7]
- Updated dependencies [f10d802]
- Updated dependencies [856321f]
- Updated dependencies [6b004c0]
- Updated dependencies [93e9e42]
- Updated dependencies [157baa7]
- Updated dependencies [ca5408c]
- Updated dependencies [ca5408c]
- Updated dependencies [b280546]
- Updated dependencies [975b248]
- Updated dependencies [ebb66aa]
- Updated dependencies [ceee88f]
- Updated dependencies [8460592]
- Updated dependencies [e18fea6]
- Updated dependencies [f750119]
- Updated dependencies [660a9b2]
- Updated dependencies [dcd3309]
- Updated dependencies [f6ccca4]
- Updated dependencies [26437ae]
- Updated dependencies [05be352]
- Updated dependencies [d67b942]
- Updated dependencies [d1633f3]
- Updated dependencies [32d3b3c]
- Updated dependencies [c6b3a01]
- Updated dependencies [bee75ce]
- Updated dependencies [2742e53]
- Updated dependencies [a75311d]
- Updated dependencies [d98bf24]
- Updated dependencies [8368f1c]
- Updated dependencies [8368f1c]
- Updated dependencies [8368f1c]
- Updated dependencies [31c3996]
- Updated dependencies [95555e7]
- Updated dependencies [657b6b7]
- Updated dependencies [a29a0ea]
- Updated dependencies [83480c6]
- Updated dependencies [013f97d]
- Updated dependencies [5d5e679]
- Updated dependencies [e07566b]
- Updated dependencies [11d28c1]
- Updated dependencies [399e3aa]
- Updated dependencies [ba03198]
- Updated dependencies [94608a7]
- Updated dependencies [c35436c]
- Updated dependencies [58a77db]
- Updated dependencies [b3d7a70]
- Updated dependencies [b3917d9]
- Updated dependencies [c27404f]
- Updated dependencies [a11faee]
- Updated dependencies [2c1cef3]
- Updated dependencies [27c0cf3]
- Updated dependencies [097ef80]
- Updated dependencies [70dae53]
- Updated dependencies [665cab3]
- Updated dependencies [682873d]
- Updated dependencies [1bd14c9]
- Updated dependencies [62b90d7]
- Updated dependencies [cb45469]
- Updated dependencies [f3b16fc]
- Updated dependencies [d6d6e87]
- Updated dependencies [df1feae]
- Updated dependencies [336e191]
- Updated dependencies [336e191]
- Updated dependencies [9bdc6d3]
- Updated dependencies [24c554d]
- Updated dependencies [3dc33b2]
- Updated dependencies [9969228]
- Updated dependencies [95e24b0]
- Updated dependencies [1a4c7f8]
- Updated dependencies [c7396f1]
- Updated dependencies [434c6c7]
- Updated dependencies [4b59a38]
- Updated dependencies [d2bc644]
- Updated dependencies [cfa9315]
- Updated dependencies [0803a8b]
- Updated dependencies [0d42104]
- Updated dependencies [a3d7588]
- Updated dependencies [b8191f7]
- Updated dependencies [315888d]
- Updated dependencies [1741c5d]
- Updated dependencies [3711e0b]
- Updated dependencies [a8acee2]
- Updated dependencies [a51920f]
- Updated dependencies [0f6dcac]
- Updated dependencies [682873f]
- Updated dependencies [2123fcc]
- Updated dependencies [00f045d]
  - @objectstack/spec@17.6.0
  - @objectstack/platform-objects@17.6.0
  - @objectstack/objectql@17.6.0
  - @objectstack/core@17.6.0
  - @objectstack/metadata-core@17.6.0
  - @objectstack/formula@17.6.0
  - @objectstack/types@17.6.0

## 17.5.0

### Minor Changes

- 9347c1f: A row-level or sharing-rule predicate comparing a field against a list with `!=` / `==` is refused at the CEL lowering instead of lowering to a filter that widens on driver-mongodb, and driver-mongodb refuses `$ne` with an array comparand (#19886).
  
  **BREAKING** — an accept-set narrowing, shipped by `@objectstack/formula`, `@objectstack/driver-mongodb`, `@objectstack/plugin-security`, `@objectstack/plugin-sharing` and `@objectstack/lint` as `minor` under the repo's launch-window convention for accept-set narrowings. The hand-migration prescription is registered under protocol major 18 as `cel-predicate-list-comparand-refused`.
  
  Clause-②: no (narrowing)
  
  **Security fix for RLS reads on MongoDB and RLS write checks.** A policy written `record.status != ['closed', 'archived']` (or `!(record.status == [...])`, or `!=` against a `current_user` membership set) lowered to `{ status: { $ne: [...] } }` (or `$not` around a bare-array equality). The RLS `using` clause is composed into the query after the engine's comparand-shape check, and driver-mongodb passed the shape to the server, where it selects every scalar row: the read returned the rows the policy was written to hide. A `check` written `!=` against a membership set admitted every write.
  
  - `@objectstack/formula`: `compileCelToFilter` refuses `==` / `!=` whose comparand is a list (`unsupported`): a list literal, or a `current_user` variable that resolves to an array. The authoring shape check (`isPushdownableCel`, `isSupportedRlsExpression`) reports the literal; a resolved array is refused per request.
  - `@objectstack/plugin-security`: the RLS compiler drops such a policy and fails closed when no other policy applies (`RLS_DENY_FILTER`: reads return no rows, `check` writes are refused 403). A CEL-authored `check` gets this 403; the `INVALID_FILTER` / 400 of `matchesFilterCondition` remains for a filter passed to it directly.
  - `@objectstack/plugin-sharing`: a declared sharing rule with such a `condition` is skipped at bootstrap and never seeded.
  - `@objectstack/lint`: the list-literal form is reported (`rls-predicate-unenforceable`, `sharing-rule-unlowerable-condition`). The RLS reference pass probes each kernel-resolved `current_user` key with its runtime type.
  - `@objectstack/driver-mongodb`: `translateFilter` refuses `$ne` with an array comparand at any depth, with `INVALID_FILTER` / 400, as driver-sql and driver-memory already do.
  - `@objectstack/spec`: the migration registry carries the entry.
  
  **What to change.** "One of these values" is `record.status in ['open', 'pending']`; "none of these values" is `!(record.status in ['closed', 'archived'])`. In a raw filter, use `$in` / `$nin`. `in`, scalar `==` / `!=`, `null` and field-to-field comparisons are unchanged.
  
  <!-- adr-0087: registered cel-predicate-list-comparand-refused -->
- 4d7e740: A row-level or sharing-rule predicate whose comparison is handed something other than one value is refused at the CEL lowering or at the write-check evaluator, instead of admitting writes and reads it was written to refuse (#19886).
  
  **BREAKING** — an accept-set narrowing, shipped by `@objectstack/formula`, `@objectstack/plugin-security`, `@objectstack/plugin-sharing`, `@objectstack/lint` and `@objectstack/objectql` as `minor` under the repo's launch-window convention for accept-set narrowings. The hand-migration prescription is registered under protocol major 18 as `cel-predicate-one-value-comparand-refused`.
  
  Clause-②: no (narrowing)
  
  **Security fix for RLS write checks and reads.** Each shape below was measured through the real plugin-security on driver-sql and driver-memory:
  
  - `!(record.status in [['closed', 'archived']])` (a list nested in an `in` list) admitted and stored every write the `check` was written to refuse, and a `using` read returned every row on driver-memory.
  - `current_user.org_user_ids != 'x'` and `current_user.org_user_ids > 'a'` (a membership set on a comparison with no field) folded to "no restriction": every write admitted, every row read, on every driver.
  - `record.status > ['m']` compared the list as the string `'m'` on the write check, while the analytics read scope bound the whole list as one SQL parameter. `record.reviewer_id > current_user` compared the whole caller object as a string and admitted and stored every write; in this release the RLS compiler's comparand faces (#20212) already drop that policy, and this change refuses it at the lowering for every caller of the compiler.
  - `record.status != record.tags`, its negation `!(record.status == record.tags)`, and the mirror `record.tags != record.status`, with `tags` a `json` field or a `multiple` lookup, admitted and stored every write.
  
  What changes:
  
  - `@objectstack/formula`: `compileCelToFilter` refuses, with `unsupported`, a list comparand under every comparison (the ordering operators now included, and on the constant-fold branch, whichever side), the `current_user` root or a key resolving to an object under an ordering operator, and an `in` list whose member is itself a list. The authoring shape check (`isPushdownableCel`, `isSupportedRlsExpression`) reports each literal form; a resolved value is refused per request. `matchesFilterCondition` refuses, with `INVALID_FILTER` / 400, an array under `$gt` / `$gte` / `$lt` / `$lte`, an array member of `$in` / `$nin`, and a `{ $field }` comparison (`$eq`, `$ne` or an ordering operator) whose column holds a list or an object on the record being judged, on either side. The message withholds the field, the operator and the value.
  - `@objectstack/plugin-security`: the RLS compiler drops a policy the compiler refuses and fails closed when no other policy applies (`RLS_DENY_FILTER`: reads return no rows, `check` writes are refused 403, and `getReadFilter` hands the analytics read scope the deny scope). A `check` comparing a field with a list-holding column is refused 400 and stores nothing.
  - `@objectstack/plugin-sharing`: a declared sharing rule with such a `condition` is skipped at bootstrap and never seeded.
  - `@objectstack/lint`: the literal forms are reported as `rls-predicate-unenforceable`, and an ordering comparison against a membership set through the reference pass.
  - `@objectstack/objectql`: a `having` comparison against a `{ $field }` column whose aggregated row holds a list is refused 400 where the row carries the list itself (driver-memory); driver-sql rows carry the stored JSON text and compare as before.
  - `@objectstack/spec`: the migration registry carries the entry.
  
  The stage 2a changeset's sentence that `{ $field }` references evaluate as before no longer holds for a column holding a list or an object: that comparison is now refused.
  
  **What to change.** "One of these values" is `record.status in ['open', 'pending']`, and "none of these values" is `!(record.status in ['closed', 'archived'])`, with the list flat. An ordering takes one bound (`record.status > 'm'`); a range is two comparisons joined by `&&`. Compare against one key of the caller (`record.reviewer_id > current_user.id`). A field compared with a `json` or `multiple` field has no pushdown form: compare with a single-valued column, or move the condition into a validation rule or hook. In a raw filter, use `$in` / `$nin` with flat lists and one bound per ordering operator.
  
  Not changed: a field compared with a `json` or `multiple` field still lowers and is not reported at authoring time, because the lowering sees the predicate's text and not the object's field types; driver-memory still answers a `{ $field }` comparison on a read without evaluating the reference.
  
  <!-- adr-0087: registered cel-predicate-one-value-comparand-refused -->
- 560b724: A row-level or sharing-rule predicate comparing with `!=` / `==` against the bare `current_user` root is refused at the CEL lowering instead of lowering against the whole caller context object (#19959).
  
  **BREAKING** — an accept-set narrowing, shipped by `@objectstack/formula`, `@objectstack/plugin-security`, `@objectstack/plugin-sharing` and `@objectstack/lint` as `minor` under the repo's launch-window convention for accept-set narrowings. The hand-migration prescription is registered under protocol major 18 as `cel-predicate-variable-root-comparand-refused`.
  
  Clause-②: no (narrowing)
  
  **Security fix for RLS write checks.** A policy written `record.owner_id != current_user` (or `== current_user`, or `!(record.owner_id == current_user)`) named the variable root alone, which resolved to the whole caller context, and lowered to `{ owner_id: { $ne: <that object> } }` (or the bare object, or `$not` around it). A strict compare never equals an object, so a `check` so written admitted and stored every insert and by-id update it was written to refuse, a USING-only such policy admitted every insert, and explain reported the read as narrowed with the caller's membership sets echoed in its `readFilter`. A constant comparison such as `current_user != 'guest'` folded to no restriction.
  
  - `@objectstack/formula`: `compileCelToFilter` refuses `==` / `!=` whose operand is the bare variable root (`unsupported`), in both of its modes, so the authoring shape check (`isPushdownableCel`, `isSupportedRlsExpression`) reports it before any request. A variable that resolves to an object is refused per request; a `Date` still passes.
  - `@objectstack/plugin-security`: the RLS compiler drops such a policy and fails closed when no other policy applies (`RLS_DENY_FILTER`: reads return no rows, `check` writes are refused 403, explain answers `denies`).
  - `@objectstack/plugin-sharing`: a declared sharing rule with such a `condition` is still skipped at bootstrap, now with reason `unsupported` instead of `unresolved-variable`.
  - `@objectstack/lint`: the shape is reported as `rls-predicate-unenforceable` on either RLS clause, where it was silent, and as `sharing-rule-unlowerable-condition` on a sharing condition, where it was `sharing-rule-runtime-variable-condition`.
  - `@objectstack/spec`: the migration registry carries the entry.
  
  **What to change.** Compare against the key the predicate means: `record.owner_id != current_user` becomes `record.owner_id != current_user.id` (or `current_user.organization_id`, `current_user.email`); a membership test is `record.owner_id in current_user.org_user_ids`. Scalar keys, `in`, `null`, literals and field-to-field comparisons are unchanged.
  
  <!-- adr-0087: registered cel-predicate-variable-root-comparand-refused -->

### Patch Changes

- 7851fa3: docs(plugin-sharing): the `grantsRefused` subtype comment states the NARROWING, not a spec lag (#15712)
  
  Two comments in this package described a spec/plugin lag that #14969 ended.
  `@objectstack/spec` now declares `grantsRefused?: number` on
  `SharingRuleEvaluationResult` itself, so "the six declared fields are unchanged"
  and "the contract lives in `@objectstack/spec` and is another lane's to move"
  read as if the spec were still behind. A reader reconciling the two would
  conclude the spec is missing a key it has.
  
  No code moves. `SharingRuleReconcilePassResult extends SharingRuleEvaluationResult
  { grantsRefused: number }` is a legal covariant narrowing before and after, and
  that narrowing is now what the prose says: the spec declares the key OPTIONAL on
  purpose — an `ISharingRuleService` implementation that does not count refusals
  leaves it ABSENT, and absent is not `0` — while this implementation always counts
  them and therefore requires it. The load-bearing paragraph is kept verbatim:
  `grantsRefused > 0` is NOT "the pass failed", it is the pass reporting that it met
  a record it cannot grant on and CONTINUED.
  
  What reaches a consumer: doc comments, and only through the published
  `dist/index.d.ts` / `dist/index.d.mts`, where the JSDoc on the exported
  `SharingRuleReconcilePassResult` ships (705,069 to 705,528 bytes). The
  declaration-only projection of that file, comments stripped, is byte-identical
  before and after — no exported symbol added or removed, no key changed — and the
  JavaScript outputs (`dist/index.js`, `dist/index.mjs`) are untouched, because the
  compiler strips comments from them.
- 97f4f8c: `plugin-sharing` recognises the engine's organization refusal through objectql's own published recognizer instead of a locally re-spelled literal, and the `PROVENANCE_WAIVERS` row that excused that local spelling is retired with it (#16160).
  
  Clause-②: no
  
  The waiver carried its own expiry in its `reason`: *removed together with the stamp site when objectql publishes a recognizer*. It does, so both halves land here — `check:error-code-provenance` reconciles a waiver in three directions at once (the `registeredUnder` key still lists the code, the waived package still does not, and the scan still finds a site for the pair), so removing either half alone reddens the gate on the other.
  
  - **`ENGINE_ORGANIZATION_REFUSAL_CODE` is gone.** It was a `constdef` stamp site in `plugin-sharing/src/sharing-rule-service.ts` for a code this package only ever RECOGNISES — `@objectstack/objectql` is the emitter and already carries the row. The per-grant catch now asks `isSystemWriteOrganizationRequiredError(err)`, and the `warn` that reports an absorbed refusal names `SYSTEM_WRITE_ORGANIZATION_REQUIRED_CODE`. Both are imported from `@objectstack/objectql`, which exports them for exactly this: a consumer performs the `code` compare without authoring the string, so it acquires no stamp site of its own and cannot drift from what the engine throws.
  - **Nothing about the absorbed set moves.** The catch stays as narrow as it was — one engine refusal absorbed, everything else rethrown unchanged — and `plugin-sharing` still emits this code nowhere: the surviving mention is a structured log field on the refusal it just absorbed, not a refusal envelope of its own.
  - **No error-code membership moves.** `ERROR_CODE_LEDGER` and `StandardErrorCode` are untouched; `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` stays registered under `@objectstack/objectql` exactly as before. The only ledger change is one `PROVENANCE_WAIVERS` element, 10 waivers → 9, and the gate's site census 339 → 338 with `listed` unchanged at 322.
- 4be0868: `sys_sharing_rule.recipient_id` now declares `dependsOn: ['recipient_type', 'object_name']` — every sibling field its `recipient-picker` widget actually reads.
  
  The picker reads two siblings, not one: `recipient_type` picks the mode (a record picker over `sys_user` / `sys_team` / `sys_business_unit` / `sys_position`), and for the `field` recipient kind (#15072) it reads `object_name` to offer that object's user-valued columns. The declaration named only the first. The neighbouring `criteria_json` field already declares `dependsOn: ['object_name']` for its own `filter-condition` widget, so the key is live and correctly used a few lines up — the omission was an omission.
  
  Nothing was broken at runtime: the form renderer hands widgets the WHOLE watched record as `dependentValues` rather than a `dependsOn`-scoped slice, which masked the under-declaration. A renderer that ever scoped it — which is exactly what this key asks for — would drop the object name and degrade the `field` recipient mode to a plain text input **in silence**, with no error anywhere. This is the declaration catching up with what is read, so the scoping change can never be the one that breaks it.
  
  The same commit corrects the `recipient_id` docblock: the picker no longer "has no mapping for that kind and degrades to its text input" — the pinned console (`.objectui-sha` 87af769e, which includes objectui#10049 / commit 23b99585) offers the shared object's user-valued columns for the `field` kind, using a "holds users" predicate that is a clause-for-clause copy of this plugin's own `fieldHoldsUsers`.
  
  Authors and stored rows are unaffected: no key is added, removed or renamed, no value is newly accepted or refused, and no wire byte moves.
- 71629a1: refactor(core): one `classifyAdmissionTenancyPosture`, so six admission seams cannot each get the classification wrong (#16013)
  
  Six admission doors each hand-wrote the same try/catch on the `tenancy` read that
  feeds `resolveAuthzContext`: the registry's branded "never registered" rejection
  (`isServiceNotRegisteredError`, #13905) resolves quietly to `undefined` — the
  supported no-tenancy composition, where no posture-conditional refusal runs at
  all — and every other rejection becomes `AuthzStoreUnavailableError('tenancy', err)`
  (ADR-0112 `SERVICE_UNAVAILABLE` / 503), because the posture is an authorization
  INPUT and admission was therefore never DECIDED. That is #13906 decision 1
  option A, and it is the part nobody may get wrong: a quiet `catch` at any one of
  the six re-opens the defect, where a failure reads as "this check does not apply"
  and an ex-member's org-stamped API key is admitted.
  
  Nothing is broken today — every copy was correct — so this removes a standing
  hazard rather than fixing a defect. **No admission verdict changes**, on any
  wiring: the classification is byte-for-byte the decision the six copies made,
  now made once.
  
  - **`@objectstack/core` gains `classifyAdmissionTenancyPosture`** (and the
    `TenancyServiceResolver` type), exported from the package index beside
    `effectiveTenancyPosture`. It takes a THUNK and owns the classification only.
    The thunk is not a style choice: the REJECTION is what gets classified, so the
    resolution has to happen inside the helper's `try` — a caller that awaited the
    service first would need a `catch` of its own, which is the thing being
    deleted.
  - **The RESOLUTION deliberately did not move.** `rest-server.ts` branches on
    kernel-vs-provider, and asking twice would let a provider bound to the local
    kernel answer for a request that resolved to another environment; four seams
    read `ctx.getKernel()`; `service-storage` reads an already-normalised gate
    registry; and each seam's reason why a MISSING async accessor must stay quiet
    is its own argument (the storage door's is its declared degrade-to-ungated
    contract, the others' is the `KernelBase`/`LiteKernel` host shape). A helper
    that also owned how the service is reached would be wrong for one of them or
    grow a flag per seam — the copies again, with an extra step. Every one of
    those reasons stays written at its seam.
  - **Folded**: `packages/rest/src/rest-server.ts` (both wirings),
    `packages/cloud-connection/src/marketplace-install-local-plugin.ts`,
    `packages/plugins/plugin-sharing/src/sharing-plugin.ts`,
    `packages/services/service-datasource/src/admin-routes.ts`,
    `packages/services/service-settings/src/settings-service-plugin.ts`,
    `packages/services/service-storage/src/storage-service-plugin.ts`.
  - **Pinned where the decision now lives**:
    `packages/core/src/security/admission-tenancy-posture.test.ts` drives both
    rejections at the production seam — a real `ObjectKernel` that never
    registered `tenancy`, and one whose `tenancy` factory throws — each beside the
    brand predicate's own answer on that same rejection, so "the outage throws" is
    distinguishable from a helper that throws at everything. It also holds the
    constraint mechanically: the helper's source may not name an accessor, a
    kernel or a plugin context, and it takes exactly one parameter.
- Updated dependencies [863c7c4]
- Updated dependencies [0f95f43]
- Updated dependencies [825d70f]
- Updated dependencies [6057357]
- Updated dependencies [a60e04d]
- Updated dependencies [7f62536]
- Updated dependencies [abc4b83]
- Updated dependencies [7382c5d]
- Updated dependencies [ea2940d]
- Updated dependencies [7d0f911]
- Updated dependencies [48f5200]
- Updated dependencies [245f360]
- Updated dependencies [d0f1845]
- Updated dependencies [9dcdb77]
- Updated dependencies [6175da8]
- Updated dependencies [0283cb9]
- Updated dependencies [324968e]
- Updated dependencies [7843663]
- Updated dependencies [ce57857]
- Updated dependencies [744a0a3]
- Updated dependencies [c7d4825]
- Updated dependencies [4844840]
- Updated dependencies [fe71032]
- Updated dependencies [74eaab8]
- Updated dependencies [0b788da]
- Updated dependencies [f7a3495]
- Updated dependencies [97f4f8c]
- Updated dependencies [482d34d]
- Updated dependencies [7a25a3e]
- Updated dependencies [305e7fc]
- Updated dependencies [839d1b0]
- Updated dependencies [2fc092b]
- Updated dependencies [2dfe070]
- Updated dependencies [6059b29]
- Updated dependencies [88a072e]
- Updated dependencies [9c577c1]
- Updated dependencies [d4a1a28]
- Updated dependencies [baf9745]
- Updated dependencies [3d8779d]
- Updated dependencies [0bd7dae]
- Updated dependencies [d34f9b6]
- Updated dependencies [57343f7]
- Updated dependencies [271d6bb]
- Updated dependencies [1e20f81]
- Updated dependencies [38472ce]
- Updated dependencies [8b48903]
- Updated dependencies [2d235bc]
- Updated dependencies [aaacf1d]
- Updated dependencies [6548118]
- Updated dependencies [9dacf61]
- Updated dependencies [146c291]
- Updated dependencies [4db1bf1]
- Updated dependencies [e0e4a56]
- Updated dependencies [7aae005]
- Updated dependencies [bdb247d]
- Updated dependencies [d5c91dd]
- Updated dependencies [63b6818]
- Updated dependencies [0e51278]
- Updated dependencies [48203ff]
- Updated dependencies [b6471ba]
- Updated dependencies [ada2869]
- Updated dependencies [d88a47d]
- Updated dependencies [2f1a6f6]
- Updated dependencies [23fc5d6]
- Updated dependencies [2d34f32]
- Updated dependencies [7b1e4a4]
- Updated dependencies [d7c0241]
- Updated dependencies [9e3c485]
- Updated dependencies [e1796ad]
- Updated dependencies [8271c81]
- Updated dependencies [de62769]
- Updated dependencies [c9eb773]
- Updated dependencies [fbc12be]
- Updated dependencies [ec2ede0]
- Updated dependencies [4342c99]
- Updated dependencies [132dd13]
- Updated dependencies [d285bf0]
- Updated dependencies [dfeba25]
- Updated dependencies [9059a94]
- Updated dependencies [0a88a80]
- Updated dependencies [2c1011b]
- Updated dependencies [12bb672]
- Updated dependencies [97233b9]
- Updated dependencies [c199772]
- Updated dependencies [f5a7250]
- Updated dependencies [1a2bb9e]
- Updated dependencies [eea7ccc]
- Updated dependencies [eea7ccc]
- Updated dependencies [097d268]
- Updated dependencies [182bbde]
- Updated dependencies [5ce3705]
- Updated dependencies [24d622b]
- Updated dependencies [0252320]
- Updated dependencies [2eb4724]
- Updated dependencies [e04a0af]
- Updated dependencies [6b97a20]
- Updated dependencies [e7ff9c2]
- Updated dependencies [75237a9]
- Updated dependencies [920f887]
- Updated dependencies [8a017af]
- Updated dependencies [497655f]
- Updated dependencies [ada7012]
- Updated dependencies [3a9ad22]
- Updated dependencies [758ac40]
- Updated dependencies [6d2571f]
- Updated dependencies [a2c2852]
- Updated dependencies [2bf6ef1]
- Updated dependencies [c744c0a]
- Updated dependencies [092d460]
- Updated dependencies [09e16a5]
- Updated dependencies [98bd798]
- Updated dependencies [cbcae14]
- Updated dependencies [8261ff7]
- Updated dependencies [24489f1]
- Updated dependencies [fc28c1d]
- Updated dependencies [6d64785]
- Updated dependencies [00c332b]
- Updated dependencies [b3b43b6]
- Updated dependencies [d93400f]
- Updated dependencies [b1d3945]
- Updated dependencies [134b410]
- Updated dependencies [84e6b05]
- Updated dependencies [cb1f274]
- Updated dependencies [5c28cc7]
- Updated dependencies [b0eb9a5]
- Updated dependencies [17005cc]
- Updated dependencies [e233db9]
- Updated dependencies [176b035]
- Updated dependencies [a83dbb6]
- Updated dependencies [d3a2331]
- Updated dependencies [51297e9]
- Updated dependencies [2d892dd]
- Updated dependencies [156792e]
- Updated dependencies [5ba2ec3]
- Updated dependencies [abb01f1]
- Updated dependencies [e64ae15]
- Updated dependencies [02bdeaa]
- Updated dependencies [66abef3]
- Updated dependencies [25c9a83]
- Updated dependencies [ee5812a]
- Updated dependencies [68fea8b]
- Updated dependencies [c049e74]
- Updated dependencies [bb9794a]
- Updated dependencies [d402e32]
- Updated dependencies [63a8eb4]
- Updated dependencies [9a910c4]
- Updated dependencies [adabccf]
- Updated dependencies [340b6dc]
- Updated dependencies [fe0ae5c]
- Updated dependencies [99fcb4a]
- Updated dependencies [55095cc]
- Updated dependencies [0f1cd83]
- Updated dependencies [a3d4c59]
- Updated dependencies [9be2b59]
- Updated dependencies [922c755]
- Updated dependencies [74832b6]
- Updated dependencies [1aa5026]
- Updated dependencies [ef67b47]
- Updated dependencies [2b80461]
- Updated dependencies [2bdb81f]
- Updated dependencies [cd5fdaa]
- Updated dependencies [b9d5422]
- Updated dependencies [c7448dc]
- Updated dependencies [627382b]
- Updated dependencies [627382b]
- Updated dependencies [a675ad4]
- Updated dependencies [0b31d90]
- Updated dependencies [e75cc3c]
- Updated dependencies [4b58dcf]
- Updated dependencies [c23cfb3]
- Updated dependencies [559041d]
- Updated dependencies [e0d0553]
- Updated dependencies [5100c42]
- Updated dependencies [596090e]
- Updated dependencies [5380daa]
- Updated dependencies [00b38d7]
- Updated dependencies [47a9002]
- Updated dependencies [7056ca5]
- Updated dependencies [731f020]
- Updated dependencies [5eebc9e]
- Updated dependencies [72c1640]
- Updated dependencies [5e5ec9f]
- Updated dependencies [170fd83]
- Updated dependencies [1f05ea4]
- Updated dependencies [922923b]
- Updated dependencies [2cac363]
- Updated dependencies [fc91239]
- Updated dependencies [e6c34f6]
- Updated dependencies [062f5cd]
- Updated dependencies [0318faf]
- Updated dependencies [5d8319f]
- Updated dependencies [43f4766]
- Updated dependencies [4fef271]
- Updated dependencies [8e8ea99]
- Updated dependencies [a484966]
- Updated dependencies [021755a]
- Updated dependencies [b929e0a]
- Updated dependencies [dbd4744]
- Updated dependencies [14a762f]
- Updated dependencies [b146102]
- Updated dependencies [75c0dac]
- Updated dependencies [9bb059d]
- Updated dependencies [07c6f82]
- Updated dependencies [502f179]
- Updated dependencies [f20fe29]
- Updated dependencies [362035c]
- Updated dependencies [7e0bfce]
- Updated dependencies [c120dbd]
- Updated dependencies [32b5831]
- Updated dependencies [875e9ad]
- Updated dependencies [74554a3]
- Updated dependencies [e56112c]
- Updated dependencies [aeaaa44]
- Updated dependencies [43460b9]
- Updated dependencies [44a2332]
- Updated dependencies [f34dda6]
- Updated dependencies [488f4f5]
- Updated dependencies [15f9284]
- Updated dependencies [a4ca69a]
- Updated dependencies [1ff3a8f]
- Updated dependencies [61dd96f]
- Updated dependencies [74fb2f7]
- Updated dependencies [b971924]
- Updated dependencies [6afa59d]
- Updated dependencies [e37ea4d]
- Updated dependencies [8f6d831]
- Updated dependencies [fa29803]
- Updated dependencies [b01bdbc]
- Updated dependencies [adbdbc5]
- Updated dependencies [6cc8dcd]
- Updated dependencies [ba77509]
- Updated dependencies [408ca2e]
- Updated dependencies [ec292cf]
- Updated dependencies [dc0ab6a]
- Updated dependencies [19e58e2]
- Updated dependencies [7e1b048]
- Updated dependencies [342808c]
- Updated dependencies [b3615f1]
- Updated dependencies [0b4022b]
- Updated dependencies [a60c913]
- Updated dependencies [c736eaa]
- Updated dependencies [4d0bd23]
- Updated dependencies [4045781]
- Updated dependencies [ecf56e7]
- Updated dependencies [0e658fb]
- Updated dependencies [9529989]
- Updated dependencies [236cec1]
- Updated dependencies [5c5b67f]
- Updated dependencies [eec56c3]
- Updated dependencies [3f9e2ea]
- Updated dependencies [77f54bf]
- Updated dependencies [ccccdcc]
- Updated dependencies [48c91e9]
- Updated dependencies [2b52a5b]
- Updated dependencies [0f057b6]
- Updated dependencies [3875ae6]
- Updated dependencies [1c16889]
- Updated dependencies [1912237]
- Updated dependencies [fc29c74]
- Updated dependencies [95fb417]
- Updated dependencies [8cbc3c0]
- Updated dependencies [4ec3987]
- Updated dependencies [5b9402d]
- Updated dependencies [2cf9db7]
- Updated dependencies [dc1b986]
- Updated dependencies [655e8c0]
- Updated dependencies [041c8cf]
- Updated dependencies [5dba7f3]
- Updated dependencies [e3277c3]
- Updated dependencies [cc6dfd9]
- Updated dependencies [7536721]
- Updated dependencies [7536721]
- Updated dependencies [9df3934]
- Updated dependencies [0b83e01]
- Updated dependencies [ebc6afe]
- Updated dependencies [6696056]
- Updated dependencies [0e06f3b]
- Updated dependencies [c1dfa52]
- Updated dependencies [afc3b64]
- Updated dependencies [2548ba5]
- Updated dependencies [9282578]
- Updated dependencies [ecf90b2]
- Updated dependencies [2bbb462]
- Updated dependencies [90ff10a]
- Updated dependencies [3bd221d]
- Updated dependencies [2bbebf5]
- Updated dependencies [369bcbe]
- Updated dependencies [3bd28e2]
- Updated dependencies [9347c1f]
- Updated dependencies [c164186]
- Updated dependencies [e7344f0]
- Updated dependencies [4d7e740]
- Updated dependencies [de091b5]
- Updated dependencies [8490127]
- Updated dependencies [6aa3188]
- Updated dependencies [a34c27c]
- Updated dependencies [ae7a35a]
- Updated dependencies [ae0c90c]
- Updated dependencies [cf55914]
- Updated dependencies [17bd318]
- Updated dependencies [681868c]
- Updated dependencies [a9fb83e]
- Updated dependencies [0b866bf]
- Updated dependencies [c839986]
- Updated dependencies [2274894]
- Updated dependencies [e462186]
- Updated dependencies [009da14]
- Updated dependencies [b5853da]
- Updated dependencies [4ac9319]
- Updated dependencies [560b724]
- Updated dependencies [16c5473]
- Updated dependencies [b276d44]
- Updated dependencies [3f86dc5]
- Updated dependencies [aa04ea2]
- Updated dependencies [172b4cf]
- Updated dependencies [4463966]
- Updated dependencies [67c98f6]
- Updated dependencies [b98fbc2]
- Updated dependencies [e7f69db]
- Updated dependencies [b373596]
- Updated dependencies [7465eeb]
- Updated dependencies [84156c7]
- Updated dependencies [e0f17a3]
- Updated dependencies [0bf85ea]
- Updated dependencies [1df29df]
- Updated dependencies [8a44ce7]
- Updated dependencies [ca753c0]
- Updated dependencies [8ecbe0f]
- Updated dependencies [6a4aec7]
- Updated dependencies [d624002]
- Updated dependencies [e4471e6]
- Updated dependencies [e8fcf55]
- Updated dependencies [a08e059]
- Updated dependencies [fe677ae]
- Updated dependencies [fc646cf]
- Updated dependencies [8d1f7ab]
- Updated dependencies [cfc3bcf]
- Updated dependencies [dd1b803]
- Updated dependencies [949e99b]
- Updated dependencies [16c5a33]
- Updated dependencies [16c5a33]
- Updated dependencies [03d6cb0]
- Updated dependencies [9e7824a]
- Updated dependencies [16c5a33]
- Updated dependencies [437bb0d]
- Updated dependencies [49144fc]
- Updated dependencies [e2c4e12]
- Updated dependencies [08c8484]
- Updated dependencies [93cfc3f]
- Updated dependencies [6ac33a5]
- Updated dependencies [cfe2387]
- Updated dependencies [443b2f4]
- Updated dependencies [7e7fab7]
- Updated dependencies [b09ce67]
- Updated dependencies [4df101c]
- Updated dependencies [6a6a17b]
- Updated dependencies [733822c]
- Updated dependencies [e5cf27d]
- Updated dependencies [a91d12a]
- Updated dependencies [bea6d2e]
- Updated dependencies [f415bcf]
- Updated dependencies [615c468]
- Updated dependencies [5f9d7d7]
- Updated dependencies [31d281d]
- Updated dependencies [569d4d2]
- Updated dependencies [9e9bb46]
- Updated dependencies [0d7ed5a]
- Updated dependencies [2aa25ef]
- Updated dependencies [0e1afe8]
- Updated dependencies [288611e]
- Updated dependencies [dfd8e39]
- Updated dependencies [89f87f2]
- Updated dependencies [28ad7e4]
- Updated dependencies [e6b7d8c]
- Updated dependencies [a78f731]
- Updated dependencies [3062e50]
- Updated dependencies [40b315b]
- Updated dependencies [f2c7eef]
- Updated dependencies [7e36a3c]
- Updated dependencies [5a6267f]
- Updated dependencies [0bbe400]
- Updated dependencies [862b6ce]
- Updated dependencies [80153f5]
- Updated dependencies [26daf0b]
- Updated dependencies [826f327]
- Updated dependencies [7e5246d]
- Updated dependencies [c74de10]
- Updated dependencies [db74b16]
- Updated dependencies [2b24b8b]
- Updated dependencies [b810ddb]
- Updated dependencies [7dc45eb]
- Updated dependencies [17e4f52]
- Updated dependencies [dcd3bce]
- Updated dependencies [c5d6b2b]
- Updated dependencies [2d91c9a]
- Updated dependencies [2f122b6]
- Updated dependencies [b285508]
- Updated dependencies [2c31070]
- Updated dependencies [7db1332]
- Updated dependencies [4a1df19]
- Updated dependencies [aeb0557]
- Updated dependencies [1c1b8c8]
- Updated dependencies [05077d4]
- Updated dependencies [ba5927f]
- Updated dependencies [75b2169]
- Updated dependencies [de8c973]
- Updated dependencies [9801da1]
- Updated dependencies [65352b7]
- Updated dependencies [e956924]
- Updated dependencies [2304b16]
- Updated dependencies [c7ad16f]
- Updated dependencies [48efe91]
- Updated dependencies [fb38607]
- Updated dependencies [dc07593]
- Updated dependencies [e967cbd]
- Updated dependencies [9bf5e67]
- Updated dependencies [8255a51]
- Updated dependencies [b2b6a06]
- Updated dependencies [8538edf]
- Updated dependencies [d1c01ff]
- Updated dependencies [6427e2c]
- Updated dependencies [9e1689f]
- Updated dependencies [b057434]
- Updated dependencies [f6ceddc]
- Updated dependencies [92ea760]
- Updated dependencies [4c42fd1]
- Updated dependencies [5f392f0]
- Updated dependencies [a362e0e]
- Updated dependencies [f26fb8e]
- Updated dependencies [bc2ec80]
- Updated dependencies [0da638c]
- Updated dependencies [041d9fd]
- Updated dependencies [f03f6c7]
- Updated dependencies [b8ec127]
- Updated dependencies [cf79182]
- Updated dependencies [e81c4e5]
- Updated dependencies [28f9277]
- Updated dependencies [929d9e3]
- Updated dependencies [8a5240a]
- Updated dependencies [c1d54db]
- Updated dependencies [c7af6bd]
- Updated dependencies [1f0b565]
- Updated dependencies [23aa83c]
- Updated dependencies [357f499]
- Updated dependencies [72eeabd]
- Updated dependencies [80aef80]
- Updated dependencies [c3ebe4a]
- Updated dependencies [65ad77d]
- Updated dependencies [a61ae59]
- Updated dependencies [fb59fb5]
- Updated dependencies [a54ecaa]
- Updated dependencies [854639b]
- Updated dependencies [0780e88]
- Updated dependencies [44c917a]
- Updated dependencies [613d35a]
- Updated dependencies [e08c8b0]
- Updated dependencies [0ee32ed]
- Updated dependencies [2bed4c3]
- Updated dependencies [58b36fa]
- Updated dependencies [4792049]
- Updated dependencies [53ec0b1]
- Updated dependencies [71629a1]
- Updated dependencies [0a56d3b]
- Updated dependencies [f8e5790]
- Updated dependencies [d2c1d19]
- Updated dependencies [681871e]
- Updated dependencies [54e8234]
- Updated dependencies [706ad0f]
- Updated dependencies [288fe9c]
- Updated dependencies [d127f9b]
- Updated dependencies [4bbf766]
- Updated dependencies [c17b494]
- Updated dependencies [a016f08]
- Updated dependencies [d414e2b]
- Updated dependencies [af98a04]
- Updated dependencies [43cbe14]
- Updated dependencies [c86d351]
- Updated dependencies [9cc5010]
- Updated dependencies [6e3462d]
- Updated dependencies [6e3e546]
- Updated dependencies [c4d1759]
- Updated dependencies [f7a9740]
- Updated dependencies [6af2901]
- Updated dependencies [96451ec]
- Updated dependencies [0f38ab0]
- Updated dependencies [cca1dc0]
- Updated dependencies [9cdffbe]
- Updated dependencies [331a1a2]
- Updated dependencies [9788f1e]
- Updated dependencies [980dc78]
- Updated dependencies [5c8f5af]
- Updated dependencies [3cf6449]
- Updated dependencies [3cf6449]
- Updated dependencies [2bd53f1]
- Updated dependencies [576d5df]
- Updated dependencies [5f9f846]
- Updated dependencies [5a95b0e]
- Updated dependencies [5d527f7]
- Updated dependencies [5bf2330]
- Updated dependencies [9165d5c]
- Updated dependencies [d9e1587]
- Updated dependencies [07150b3]
- Updated dependencies [143c715]
- Updated dependencies [fb2bccf]
- Updated dependencies [5b5bd36]
- Updated dependencies [2e8e118]
- Updated dependencies [d2badf7]
- Updated dependencies [d64bcb6]
- Updated dependencies [d4f5232]
- Updated dependencies [396eae3]
- Updated dependencies [ecdfc94]
- Updated dependencies [f04be62]
- Updated dependencies [de1a611]
- Updated dependencies [4fba503]
- Updated dependencies [db76982]
- Updated dependencies [5cf58eb]
- Updated dependencies [66e266c]
- Updated dependencies [3b1dab9]
- Updated dependencies [7607076]
- Updated dependencies [1555ed4]
- Updated dependencies [776d64c]
- Updated dependencies [03b19d9]
- Updated dependencies [6154165]
- Updated dependencies [199002b]
- Updated dependencies [ab450f4]
- Updated dependencies [21ab410]
- Updated dependencies [025588a]
- Updated dependencies [a49e8ae]
- Updated dependencies [8c9bd8f]
- Updated dependencies [5505646]
- Updated dependencies [f3e3d59]
- Updated dependencies [9bd4344]
- Updated dependencies [029d8a4]
- Updated dependencies [4215417]
- Updated dependencies [51efbf1]
- Updated dependencies [9c44eed]
- Updated dependencies [bbca441]
- Updated dependencies [7cd5874]
- Updated dependencies [3cb84d0]
- Updated dependencies [119a02b]
- Updated dependencies [eea8787]
- Updated dependencies [7887077]
- Updated dependencies [29dd1a6]
  - @objectstack/spec@17.5.0
  - @objectstack/platform-objects@17.5.0
  - @objectstack/core@17.5.0
  - @objectstack/types@17.5.0
  - @objectstack/metadata-core@17.5.0
  - @objectstack/formula@17.5.0
  - @objectstack/objectql@17.5.0

## 17.4.0

### Minor Changes

- 9fa5775: feat(plugin-sharing): the `field` sharing recipient is enforced — expanded once per matched record
  
  `ShareRecipientType` gained `field` on the spec side (#14103, maintainer ruling
  B): `sharedWith: { type: 'field', value: '<user-field-name>' }` shares each
  record the rule's criteria match with the user or users named by that column
  on the record. This is the executor half (#15072):
  
  - `SharingRuleService` reads the named user-typed column on each matched
    record. A `multiple: true` column shares with every user it names; a single-
    user column with the one it names. **Fail-closed on empty**: a null or empty
    column materialises no grant — never a match-all principal, never a fallback
    to the record owner. `field` is the only recipient resolved per record; every
    other kind (`user`, `team`, `position`, `business_unit`,
    `unit_and_subordinates`) still expands once per rule.
  - The grants re-materialise on the record's own write: the existing
    `afterUpdate` hook has no changed-field gating, so an update that touches only
    the recipient column re-runs the per-record reconcile, which revokes the
    stale grant and materialises the new one. No second trigger was added.
  - The whole-rule pass (`evaluateRule` — the background re-grant after an
    unbounded bulk write, the `kernel:bootstrapped` backfill and the REST evaluate
    endpoint) derives per-record (record, user) pairs for a `field` rule instead
    of a matched-records × recipients product, so the rule is as correct after a
    bulk write and a restart as it is inline. The recipient-axis revoke
    (`revokeRuleGrantsForRetiredRecipients`) declines `field` rules — they have no
    rule-wide recipient set to retire against.
  - The declared-rule bootstrap seeds `field` rules (previously skipped with a
    warning), the `sys_sharing_rule.recipient_type` select accepts `field`, and
    `defineRule` refuses a `field` recipient whose `recipientId` is not a field
    name (the same grammar the spec applies at parse).
  - An active `field` rule whose column the object does not declare as user-typed
    grants nobody and says so once per rule.
  
  There is no `manager` recipient: "the owner's manager" is a user field the
  application stores on the record, named by a `field` recipient.

### Patch Changes

- be92d46: These fourteen packages now declare `repository.directory`, so their npm pages carry a working "source" deep link to their own directory in the monorepo.
  
  npm renders that field by concatenating it onto `repository.url`. None of these fourteen manifests carried a `repository` block at all, so every one of their npm pages offered no route from the package back to its code — not a broken link, no link. That is what this publishes: the block those pages read, naming each package's own directory.
  
  Nothing else about these packages changes. No export, no runtime behaviour, no dependency and no file in the tarball other than the manifest's own `repository` key. The version bump exists because the fix is only real once it is published: the field lives in the manifest npm serves, so a corrected manifest sitting in the repository leaves the package page exactly as wrong as it was.
  
  The rule behind it is now mechanical rather than remembered — `check:manifest-repository-directory` makes a publishable (non-private) workspace manifest declare the field naming its own directory, so a package added or moved after this cannot quietly go back to having no source link.
- ac6213e: Four server-side authorization sites stop deriving platform-operator authority from a NAME in `ExecutionContext.positions`, and read the ADR-0095 posture rung instead.
  
  `positions[]` is the security axis, so it carries ADR-0057 D4 `sys_user_position` names alongside the built-ins. `sys_user_position` is `apiEnabled` and its `position` values are unconstrained, so a tenant could mint a row spelling `platform_admin` for one of their own users: `resolveUserAuthzGrants` pushed that name straight onto `grants.positions`, while `grants.posture` — derived from the unscoped `admin_full_access` grant and nothing else — correctly stayed `MEMBER`. Every reader of the name therefore answered `true` for a principal enforcement treats as an ordinary member. `resolve-authz-context.ts` states the rule at `hasPlatformAdminStanding` ("read the RUNG — never `positions.includes(...)`"), but a comment is not a gate and these four had not followed it.
  
  Each site now tests `posture === 'PLATFORM_ADMIN'`, byte-for-byte what `hasPlatformAdminStanding` returns:
  
  - **`plugin-sharing`** — `hasPlatformAuthority`. The minted row satisfied `assertResolvableAdminScope`, so an org-less caller holding only the ORG-scoped `manage_sharing` capability was answered with **every tenant's** sharing rules, and could delete platform-global rules. The `manage_platform_settings` capability spelling is unchanged.
  - **`plugin-approvals`** — `isOverrideActor`. This predicate already read the rung and then ORed the name onto it, which is no protection: an OR is only as strong as its weakest arm. Because the platform arm deliberately crosses the tenant wall, the minted row let a member of one organization approve, reject or recall a **different organization's** pending request while holding no slot in its slate. The `ADMIN_FULL_ACCESS` capability arm and both TENANT_ADMIN arms are unchanged.
  - **`runtime`** — the ADR-0126 §5 activation gate. Under a `group` or `isolated` posture this gate is the only thing between a tenant org admin and the **install-wide** `sys_metadata_activation` row, so the minted row reopened #10243 with a durable row behind it.
  - **`plugin-security`** — `derivePosture` in the explain engine. Narrower than the other three, and stated precisely rather than overclaimed: the name-read sat behind an early `ctx.posture` return that `buildContextForUser` always populates, so the shipping path was already gated and a D4 row never moved it. What the read did reach was a posture-less hand-built context, where it made the panel **report** `PLATFORM_ADMIN` for a principal enforcement treats as a MEMBER — a misreport rather than an admission, but in the one tool an administrator opens to check exactly this.
  
  No behaviour changes for a genuine platform operator: their resolved context carries the rung, and the built-in position is still projected onto `positions[]` for display and predicate use. What changes is that the name alone no longer answers the authorization question.
  
  Graded `patch` on the surface it moves: no exported type, signature or contract changes, and no authorable metadata is added, removed or renamed. The only observable difference is that a principal who never held the capability grant stops being admitted — which is the defect, not a feature anyone could have depended on.
- a4816a7: The three provenance-stamp `beforeUpdate` hooks stop re-reading a row the engine has already read, and their contract now states what they actually do on a multi-row update.
  
  `sys_email_template`, `sys_sharing_rule` and `sys_webhook` each carry a hook that stamps `customized: true` when a non-system caller edits a package- or platform-seeded row — the half of seed-not-clobber that detects the admin edit. All three carried the same two comments, and both were assertions about runtime behaviour that runtime measurement falsifies:
  
  - **"multi-row updates (no single `input.id`) are not stamped."** Not true on any engine these packages ship against. A predicate (`multi: true`) update dispatches `beforeUpdate` once per matched row, and every per-row context arrives with `input.id` bound — so the `if (!id) return` guard answered "single write" on every row of a batch and declined nothing. The rows were being stamped all along.
  - **"`previous` is not resolved before beforeUpdate hooks run — read the current row ourselves."** The engine binds `previous` before dispatching `beforeUpdate` on both write shapes, so each hook was issuing its own `find` for a row the engine had just read — on a bulk edit, one extra read **per matched row**.
  
  Observable behaviour is deliberately unchanged: the same rows are stamped, with the same values, and a bulk edit whose matched rows disagree on `managed_by` is still refused by the engine with `MULTI_UPDATE_HOOK_KEY_DIVERGENCE` (HTTP 400) rather than widening one row's stamp across the batch. What changes is the cost and the contract: the redundant per-row read is gone, and the header of each hook now describes the per-row dispatch, the single `SET` clause a predicate write shares, and why declining to stamp on a bulk edit was rejected — unstamped rows are exactly the ones the next boot's seeder overwrites.
- 4db3c61: `publicSharing.enabled` now has one canonical predicate, exported from the package that declares the key.
  
  `isPublicSharingEnabled(schema)` is a new export of `@objectstack/spec/data`, declared in `src/data/object.zod.ts` beside the `publicSharing` block itself — the same shape as the neighbouring `isTenancyDisabled`. It is additive: nothing was removed or narrowed from the spec's public API.
  
  Until now the same policy read existed in two spellings. `@objectstack/plugin-sharing` defined it (for the share-link service's redemption gate and the route probe above it), and `@objectstack/runtime` carried a documented private mirror for its `/share-links` dispatcher domain — copied rather than imported because the plugin is only a **dev** dependency of the runtime. That reasoning was true of that one home and not of the question: both packages already depend on `@objectstack/spec`, so a shared home existed all along and the de-duplication adds no dependency edge. Both surfaces now consume the exported predicate and the runtime copy is deleted.
  
  Behaviour is unchanged, fail-closed included: an absent `publicSharing` block, an absent schema, and an engine that cannot answer `getSchema` at all remain **one** answer, `false`, and only the boolean `true` enables. The two pins that held the copies equal — `share-link-eligibility.test.ts` in the plugin and `share-links-enforcement-context.test.ts` in the runtime, which assert the same observable answer on both surfaces rather than trusting the copy — are unchanged and still green; they are what proves the merge did not move behaviour. The predicate's own contract, which those tests can only observe indirectly, is now pinned directly in `packages/spec/src/data/object.test.ts`.
- 2e35765: The share-link REST surface now derives the tenancy posture before it resolves the caller, so an API key stamped with an organization its owner has left can no longer mint links into that organization.
  
  `resolveAuthzContext` gates every posture-conditional refusal on a `tenancyPosture` its **caller** supplies. `SharingServicePlugin`'s share-link door supplied none, so none of them ran: `organization_required` (`core/security/api-key.ts`), `organization_membership_ended` (`core/security/resolve-authz-context.ts`), and the session arm beside it that drops an `activeOrganizationId` claim no `sys_member` row backs. An API key's tenant is `sys_api_key.active_organization_id` copied verbatim — the caller's own stored claim, never vetted against current membership — so under a wall-enforcing posture (`isolated`, `group`) a key belonging to an ex-member was admitted carrying that organization, and `createLink` minted a capability token on a record inside it. The same door carried the session half: a browser session whose owner had been removed kept its organization claim until the session expired.
  
  Measured at the door, under `isolated`: the ex-member's key went from `200` / `201` with the link landing in the store to `401` / `401` with nothing landing; an organization-less key went from admitted to `401`; an ex-member's *session* now has its stale claim dropped and is refused by Layer 0 at `403` while staying signed in. A current member and an anonymous caller are unchanged in every wiring.
  
  A `tenancy` service that was **never registered** stays a supported composition and resolves quietly to "no posture" — behaviour on an embedding without `plugin-auth` is exactly what it was. A `tenancy` service that **was registered and failed to build** now raises `AuthzStoreUnavailableError`, which reaches the wire as `SERVICE_UNAVAILABLE` / 503 rather than being laundered into a `401`: admission was never decided, so it must not be answered.
- Updated dependencies [fe0d9a4]
- Updated dependencies [ecd2158]
- Updated dependencies [f2b5e46]
- Updated dependencies [2ed6be6]
- Updated dependencies [ed7243d]
- Updated dependencies [6ba0db4]
- Updated dependencies [625b0c3]
- Updated dependencies [233222e]
- Updated dependencies [07f40e5]
- Updated dependencies [ceb4877]
- Updated dependencies [e9fcd6b]
- Updated dependencies [90e7e6d]
- Updated dependencies [2bdabe6]
- Updated dependencies [ca326b5]
- Updated dependencies [8f404a5]
- Updated dependencies [159dbad]
- Updated dependencies [7079694]
- Updated dependencies [7783738]
- Updated dependencies [a56baa2]
- Updated dependencies [68437d4]
- Updated dependencies [abb140c]
- Updated dependencies [8333a6c]
- Updated dependencies [3e3ecb0]
- Updated dependencies [3030369]
- Updated dependencies [4b3955e]
- Updated dependencies [d5d8d50]
- Updated dependencies [e08892d]
- Updated dependencies [ae05f2e]
- Updated dependencies [b548e43]
- Updated dependencies [c463d03]
- Updated dependencies [64bd6a3]
- Updated dependencies [13c48c2]
- Updated dependencies [b0529e1]
- Updated dependencies [66dc6ab]
- Updated dependencies [6f94458]
- Updated dependencies [6e67b86]
- Updated dependencies [132742f]
- Updated dependencies [85a2459]
- Updated dependencies [50dc214]
- Updated dependencies [e89fa92]
- Updated dependencies [e9fcd6b]
- Updated dependencies [8976ea1]
- Updated dependencies [56fe8c2]
- Updated dependencies [acabd24]
- Updated dependencies [ab50c8f]
- Updated dependencies [6491463]
- Updated dependencies [89cf4d6]
- Updated dependencies [21c5dcb]
- Updated dependencies [ddfbf04]
- Updated dependencies [6d4d5d3]
- Updated dependencies [ed5d557]
- Updated dependencies [65846bc]
- Updated dependencies [bca21f7]
- Updated dependencies [e9fcd6b]
- Updated dependencies [316a20f]
- Updated dependencies [2025b1f]
- Updated dependencies [33388f9]
- Updated dependencies [1a7a7c9]
- Updated dependencies [e9fcd6b]
- Updated dependencies [cbca47d]
- Updated dependencies [acf4d38]
- Updated dependencies [ef3a138]
- Updated dependencies [68d5dfd]
- Updated dependencies [3e21cf0]
- Updated dependencies [4cfc93b]
- Updated dependencies [098cbb7]
- Updated dependencies [efd6b43]
- Updated dependencies [859ded3]
- Updated dependencies [fa125f3]
- Updated dependencies [74628d9]
- Updated dependencies [a646120]
- Updated dependencies [6f1ce7d]
- Updated dependencies [7778115]
- Updated dependencies [86c75f4]
- Updated dependencies [2c753fe]
- Updated dependencies [52804cd]
- Updated dependencies [3f89967]
- Updated dependencies [53cf263]
- Updated dependencies [21aabbc]
- Updated dependencies [9c270bb]
- Updated dependencies [76c8c5a]
- Updated dependencies [088f761]
- Updated dependencies [a84e1ce]
- Updated dependencies [bf1054a]
- Updated dependencies [d8d2776]
- Updated dependencies [222dc0f]
- Updated dependencies [e9fcd6b]
- Updated dependencies [32c917d]
- Updated dependencies [f9a3c32]
- Updated dependencies [f502898]
- Updated dependencies [51ae731]
- Updated dependencies [af7edfe]
- Updated dependencies [25a3d91]
- Updated dependencies [b60f48b]
- Updated dependencies [c78c918]
- Updated dependencies [4ca358d]
- Updated dependencies [cf9bda4]
- Updated dependencies [784cb92]
- Updated dependencies [7629f4d]
- Updated dependencies [3bd9b34]
- Updated dependencies [51df9fd]
- Updated dependencies [a7da4de]
- Updated dependencies [de0bcdd]
- Updated dependencies [70f7d6d]
- Updated dependencies [d0ee598]
- Updated dependencies [e9fcd6b]
- Updated dependencies [1b6fe3f]
- Updated dependencies [48b0fcf]
- Updated dependencies [c677cda]
- Updated dependencies [6acb37e]
- Updated dependencies [7797102]
- Updated dependencies [554a160]
- Updated dependencies [f7da71e]
- Updated dependencies [7f745c3]
- Updated dependencies [0a038cc]
- Updated dependencies [26144c2]
- Updated dependencies [e9fcd6b]
- Updated dependencies [97adce2]
- Updated dependencies [a83482c]
- Updated dependencies [5eb24f8]
- Updated dependencies [2a3decc]
- Updated dependencies [cc00df2]
- Updated dependencies [cc00df2]
- Updated dependencies [f4e6adf]
- Updated dependencies [ee4a59b]
- Updated dependencies [4db3c61]
- Updated dependencies [5ca314a]
- Updated dependencies [e0af1a8]
- Updated dependencies [11f848e]
- Updated dependencies [4771bd9]
- Updated dependencies [414c1fc]
- Updated dependencies [22c0279]
- Updated dependencies [c930f85]
- Updated dependencies [0db2947]
- Updated dependencies [92b5d7f]
- Updated dependencies [613bfbd]
- Updated dependencies [abae16a]
- Updated dependencies [e6279dc]
- Updated dependencies [094b8fd]
- Updated dependencies [c7aca0d]
- Updated dependencies [c1d8f98]
- Updated dependencies [8e0b297]
- Updated dependencies [d4f9b2a]
- Updated dependencies [5f7fa1d]
- Updated dependencies [87f0ccc]
- Updated dependencies [aedbaef]
- Updated dependencies [a727043]
- Updated dependencies [c5d6803]
- Updated dependencies [10d05bb]
- Updated dependencies [69602e5]
- Updated dependencies [c3ce76c]
- Updated dependencies [7936b29]
- Updated dependencies [46803fa]
- Updated dependencies [c2a336c]
- Updated dependencies [9f890d3]
- Updated dependencies [0bb2318]
- Updated dependencies [f7db8f4]
- Updated dependencies [1ecee3e]
- Updated dependencies [9408b7f]
- Updated dependencies [ec0a6e7]
- Updated dependencies [2bb0614]
- Updated dependencies [b3820c3]
- Updated dependencies [e9fcd6b]
- Updated dependencies [4df2a98]
- Updated dependencies [9bcd9be]
- Updated dependencies [b398ad2]
- Updated dependencies [eddd612]
- Updated dependencies [99261a7]
- Updated dependencies [81b426f]
- Updated dependencies [001af1c]
- Updated dependencies [fb77aa5]
- Updated dependencies [3d3f60e]
- Updated dependencies [581d8f8]
- Updated dependencies [f81afe3]
- Updated dependencies [40a44b9]
- Updated dependencies [f89812e]
- Updated dependencies [6d7d740]
- Updated dependencies [f7ffbd6]
- Updated dependencies [7a7fb03]
- Updated dependencies [d61d6e3]
- Updated dependencies [8fd246d]
- Updated dependencies [021a735]
- Updated dependencies [7bdb163]
  - @objectstack/spec@17.4.0
  - @objectstack/core@17.4.0
  - @objectstack/objectql@17.4.0
  - @objectstack/platform-objects@17.4.0
  - @objectstack/formula@17.4.0
  - @objectstack/types@17.4.0
  - @objectstack/metadata-core@17.4.0

## 17.3.0

### Minor Changes

- 599515d: Four more system objects declare their polymorphic pointer pair (#11386, ADR-0052 §5, adopting the carrier #11339 landed): `sys_audit_log.record_id`, `sys_approval_request.record_id`, `sys_record_share.record_id` and `sys_share_link.record_id` now carry `referenceVia: 'object_name'`. A seed row addressing one of these by the target's natural key resolves against the object its sibling column names, per row — so a packaged app can ship audit history, pending approvals, record grants and share links that actually attach to the records they are about, and the queries that give each row its meaning (the `{object_name, record_id}` index, the pending-request lock, the sharing middleware's grant lookup, the share link's fail-closed record-existence gate) match on the target's real id.
  
  The accept/reject contract changes with it on those four objects, deliberately and in the already-ruled direction: an unresolvable pointer on a DECLARED pair is a loud, counted failure instead of the old silent verbatim store. On a grant table that is the sharper win — a share whose `record_id` stayed a natural key enforced nothing while displaying as a grant, and was then deleted by the orphan sweep for describing a record that does not exist. Internal-id-shaped values still pass through verbatim, so a demo row about an already-deleted record (an `action: 'delete'` audit row) stays authorable. Undeclared text columns are untouched.
  
  The fifth object surveyed, `sys_automation_run` (`trigger_object` / `trigger_record_id`), deliberately STAYS UNDECLARED. Its pair has the same shape but its rows are not content about a record: a `paused` row is a live continuation the engine rehydrates on boot, terminal rows are telemetry under a 30-day sweep, and the object has no natural key to address rows by. The verdict, its reasons, and what would have to change to flip it are recorded on the field itself and pinned by a test.
- 3f64fe6: `sys_record_share` is tenant-scoped: every grant row now carries `organization_id`, and the rows written before it can be backfilled from the record they grant access to (#14484).
  
  Every `sys_record_share` row on every deployment was written with `organization_id = NULL`: `SharingService.grant` wrote under a bare system context and the row literal never carried the column, so neither the driver's `injectTenantOnInsert` nor the engine's system-write organization rule had anything to stamp from. Reads agreed with writes — the service's own reads are bare-context too — so nothing was visibly broken; what the NULL cost was the cliff: the first tenant-facing read of the table inherits `plugin-security`'s Layer 0, whose strict `organization_id = :tenant` AND-composes over the driver's NULL-tolerant arm and wins, and every existing grant silently disappears — not refused, simply "this person was never granted access". Maintainer ruling 2026-09-02 (decision batch #11 item 3, A adopted — 「#13564 转维护者处理；其他同意」): tenant-scoped, writer-repaired, existing rows backfilled from the record they reference. The per-table order the `sys_file` precedent requires; it covers `sys_record_share` and no other table.
  
  **Writer.** `SharingService.grant` stamps `organization_id` on both halves of its upsert. A rule-materialised grant carries the granting RULE's organization — `SharingRuleService.reconcile` / `reconcileForRecord` now hand `grant` the rule's own `criteriaContext` (`{ isSystem, tenantId: rule.organization_id }`), the same context the rule's criteria sweep ran under, so the grant lands in the organization whose records the rule was allowed to sweep. A direct grant carries the shared RECORD's organization, read off the column its object is walled by (`resolveTenantFieldName`: ADR-0066 opt-out → declared `tenancy.tenantField` → injected `organization_id`), with the acting session's organization as the fallback for a record that carries none — and only for one that carries none: a record whose organization could not be READ is unknown, not organization-less, so that grant carries `null` for the engine's rule below rather than the session's organization (which may not be the record's). The organization rides the write context as `tenantId` as well as the row — the `{ isSystem, tenantId }` shape the #8844 refusal prescribes — so the driver's tenant audit is satisfied and the update half lands through the driver's scope (`organization_id = ? OR IS NULL`, which keeps a pre-repair NULL row in reach). Nothing resolvable ⇒ an explicit `null` on the row, for the engine's ruled rule to decide (below). The service's eleven bare-context READS are unchanged by this change; whether they become tenant-scoped is #13564's question.
  
  **Ledger (`@objectstack/objectql`).** `sys_record_share` leaves `unclassified` in the #13491 per-object tenancy ledger as `tenant-scoped`, with the ruling as the cited fact. Consequence, per the ledger's own admission semantics: an organization-less SYSTEM insert on `sys_record_share` is now derived on a `single` install with exactly one organization and REFUSED loudly on a walled one (`ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED`, status 500) — and the engine no longer auto-mutes the driver's tenant-audit warning for elevated writes on it. The only writer in this repository is repaired in the same change and carries the organization on every path that can resolve one — but two shipped paths still resolve none, and on a walled install they now meet that refusal instead of writing a NULL row. **(a)** A platform-global sharing rule (`organization_id = null`; its sweep runs unscoped) matching an organization-less record: the grant resolves `null`, the engine refuses it, and because `reconcile` has no per-grant catch that rule's reconcile aborts mid-loop — grants already written in the pass stay, the remaining grants and the stale-row revocations of that pass do not happen (the boot backfill logs the rule and continues; the write hooks catch). **(b)** A direct grant whose read of the shared record's organization failed: the acting session's organization is deliberately not substituted, so the grant is refused with the same error rather than written into an organization that may not be the record's. On a `single` install with exactly one organization both derive it; with several, the same `null` is refused as `ambiguous-organization`. A third-party writer that inserts `sys_record_share` under a bare system context on a walled install meets the refusal too, and the refusal message says how to carry the organization.
  
  **Ops: the backfill — dry run first, and by default.** `packages/plugins/plugin-sharing/src/backfill-sys-record-share-organizations.ts` scans only rows whose organization column is unset, re-reads each row's record (`object_name` + `record_id`) at repair time, and stamps the row with the record's own organization off the column that object is walled by. `planSysRecordShareOrganizationBackfill(engine)` reads only and returns a report naming every row it would touch; `runSysRecordShareOrganizationBackfill(engine, { dryRun: false })` writes. Nothing runs at boot and nothing is scheduled: this is an operator-invoked module, run once against an affected install, the posture of both precedents. **Orphans — grant rows whose record no longer exists — are left NULL, counted (`totals.orphans`) and logged, never deleted here:** the "record gone ⇒ the row cannot describe any access" invariant is already owned by the `kernel:bootstrapped` orphan sweep (`sweepOrphanedRecordShares`, #5103), which reclaims exactly that population on the next boot; a second deleter would be the fork `record-orphan-cleanup.ts` exists to prevent. Every other row that cannot be derived — an object with no organization column, a record that carries none, a record whose read failed — stays NULL and is reported by reason, for a dry run too. Idempotent by construction: every scan is `WHERE <organization column> IS NULL` and every write fills that column, so the test suite runs the sweep twice and pins the second run at zero writes.
  
  Publishes no runtime code for the backfill: the module is not exported from the package index and not bundled into `dist` (`tsup` builds `src/index.ts`). It is graded rather than skipped because the release notes are where an operator of an affected install learns the repair exists, what it will and will not touch, and that the dry run comes first.
- fc9ba76: fix(plugin-sharing,spec): hold `publicSharing.eligibility` at redemption, not only at mint (#13608)
  
  **BREAKING** runtime behaviour change on a published package: share links that
  were legitimately minted can now stop resolving without anyone revoking them.
  Shipped as `minor` under the repo's launch-window convention.
  
  `ShareLinkService.createLink()` evaluated the object's declared
  `publicSharing.eligibility` predicate before writing a `sys_share_link` row, and
  nothing evaluated it again. `resolveToken()` checked `revoked_at`, `expires_at`,
  the audience gates, the password and record EXISTENCE — then served whatever
  survived, under the system context, to a caller with no principal at all. So the
  declaration read as a standing policy about which records may be reached
  anonymously, while the platform held it at exactly one instant in a link's life.
  
  The state the predicate reads is the state an editor changes. Publish an article
  `published` + `public`, mint a link, then flip `audience` to `internal` or
  `status` back to `draft`: the object's own policy now says the record is not
  eligible for link sharing, and the old token kept resolving and kept serving the
  record in full. The remedy was to revoke every link on the record by hand, which
  first requires knowing they exist.
  
  It also sat oddly beside its neighbour. In that same `resolveToken()`, the
  record-existence probe is deliberately fail-CLOSED (an unanswered probe denies),
  so a **deleted** record stopped being served immediately while a
  **reclassified** one did not — two failure directions in one door.
  
  **What changed.** `resolveToken()` re-evaluates the predicate against the record
  it is about to serve, through the same `assertEligible` the mint path calls, so
  the two points cannot drift on strictness, on the declared-field binding, or on
  which faults refuse. It is one read either way: when a predicate is declared the
  existence probe's projection widens from `['id']` to the whole row instead of a
  second query being issued, so an object with no `eligibility` key keeps the
  exact probe it always had. Fail-closed, matching mint: a predicate that will not
  compile, faults on the record, or answers anything other than `true` refuses.
  
  **The refusal is deliberately indistinguishable.** For a caller who may hold
  nothing but a token, telling "does not exist" apart from "revoked" apart from
  "no longer eligible" is an existence oracle, so the redemption refusal is the
  same undifferentiated `null` a revoked, expired or unknown token already gets —
  no new error code, no new response branch, and no usage stamp. Over HTTP an
  ineligible link is answered with the generic `404 INVALID_OR_EXPIRED`, byte-for-
  byte what a token that never existed receives. The readable reason a link died
  is written to the server-side log instead.
  
  **Operator impact.** Deployments upgrading across this change can feel it
  immediately: any live link whose record has since moved out of its object's
  `eligibility` predicate stops resolving, with no revocation event and no grace
  period. That is the intent — the alternative is a declared policy the platform
  does not hold — but it is worth measuring before rollout: an object's
  `eligibility` predicate is the thing to read, and the links at risk are those on
  records that no longer satisfy it. An operator who needs such links to keep
  working must widen the predicate; there is no per-link opt-out, deliberately.
  `redactFields` behaviour, the audience/password gates and objects that declare
  no `eligibility` key are all untouched and pinned.
  
  <!-- adr-0087: not-required (no-migration-prescription) Nothing authorable is removed, renamed or re-shaped: `publicSharing.eligibility` keeps its name, its type and its accept-set, and the change is WHEN the platform evaluates it. There is therefore no tombstone for `objectstack migrate meta` to carry and no mechanical rewrite it could perform — a deployment whose links stop resolving must decide whether its own predicate is still the policy it wants, which is an authoring decision no ledger entry can make on its behalf. -->
- 13bf05d: fix(plugin-sharing): hold `publicSharing.enabled` at redemption, not only at mint (#14033)
  
  **BREAKING** runtime behaviour change on a published package: share links that
  were legitimately minted can now stop resolving without anyone revoking them —
  every link on an object whose `publicSharing.enabled` is not `true`. Shipped as
  `minor` under the repo's launch-window convention (a breaking change does not
  burn a major while the stack is in lockstep). No export is added, removed or
  re-shaped; the level carries the breaking banner, not a surface change.
  
  `ShareLinkService.createLink()` refused to mint on an object whose
  `publicSharing` block was absent or had `enabled !== true` (422
  `SHARING_NOT_ENABLED`), and nothing checked the switch again. `resolveToken()`
  checked `revoked_at`, `expires_at`, the audience gates, the password, record
  existence and — since #13608 — the block's `eligibility` predicate, then served
  whatever survived, under the system context, to a caller with no principal at
  all. So the platform held the block's CHILD predicate as a standing policy while
  its PARENT switch governed minting only: an author who turned the whole feature
  off stopped new links and not one existing link, and would have had to narrow
  the predicate to stop anonymous serving — the opposite of what the surface
  reads like. Measured before it was changed: a token minted while the block was
  on kept serving the record in full after the block was turned off.
  
  **What changed.** `resolveToken()` reads the object's CURRENT `publicSharing`
  block on every redemption and refuses when `enabled` is not `true` — before the
  record is read, before the usage stamp, before any sibling key inside the block
  is evaluated. Re-enabling the block restores the same tokens: this is a standing
  policy, not a revocation, and no `sys_share_link` row is touched. How a link was
  minted buys it nothing at redemption — a link minted under a system context or
  the service's `permissive` bypass (the system-context ledger's row 37 path) on a
  switched-off object refuses exactly like one orphaned by an author turning the
  block off, and an object with no `publicSharing` block at all is the same switch
  at its default and refuses too. With the block on, `eligibility` (#13608) and
  the declared `redactFields` (#13856) keep their existing redemption-time
  behaviour; nothing new is evaluated. An object the engine cannot return a
  schema for — no `getSchema` on the engine, or an object not registered at the
  moment of redemption — is `enabled: false` by `getPolicy`'s definition and is
  refused at redemption: fail-closed, the same definition `createLink` uses. The
  #13856 entry's "an opted-out object's links keep resolving with the declared
  redactions" state is superseded: with the block off they do not resolve at all.
  
  **The refusal is deliberately indistinguishable.** It is the same answer a
  revoked, expired, unknown or no-longer-eligible token already gets: the
  undifferentiated `null` — no new error code, no new response branch, and no
  usage stamp. Over HTTP a switched-off link is answered with the generic
  `404 INVALID_OR_EXPIRED`, byte-for-byte what a token that never existed
  receives. The readable reason (`SHARING_NOT_ENABLED`, with the link, object and
  record ids) is written to the server-side log at `warn`, where the eligibility
  refusal already writes its own.
  
  **Operator impact — retroactive, on deploy.** Every live link on an object whose
  `publicSharing` block is currently switched off — or that never declared one —
  stops resolving the moment this version is deployed, with no revocation event
  and no grace period. That is the intent: the alternative is a declared switch
  the platform does not hold. Measure before rollout: the objects to read are
  those whose `publicSharing.enabled` is not `true`, and the links at risk are the
  `sys_share_link` rows naming them (`object_name`). To keep such links working,
  enable the block — and narrow it with `eligibility` / `redactFields` if the
  feature was off for a reason; there is no per-link opt-out, deliberately.
  Minting is unchanged: `createLink` still refuses `SHARING_NOT_ENABLED` for an
  ordinary caller, and the system / `permissive` bypass still mints — what it
  mints simply does not serve until the block is on. The refusal logs one `warn`
  line per refused hit and is not latched, so a retroactive deploy with many live
  links on switched-off objects does not burst the log once and subside: the
  volume tracks traffic, one line per refused hit, for as long as requests keep
  reaching those links — until the block is re-enabled or the links are revoked.
  
  <!-- adr-0087: not-required (no-migration-prescription) Nothing authorable is removed, renamed or re-shaped: `publicSharing.enabled` keeps its name, its type, its default and its accept-set, and the change is WHEN the platform holds it. There is therefore no tombstone for `objectstack migrate meta` to carry and no mechanical rewrite it could perform — a deployment whose links stop resolving must decide whether the block should be on at all, which is an authoring decision no ledger entry can make on its behalf. -->
- 20293d6: fix(sharing): gate the share-link route probe on `publicSharing.enabled`, at both probe sites (#14637)
  
  **BREAKING** runtime behaviour change on a published HTTP path:
  `GET /api/v1/share-links/:token/resolve` answers `404 INVALID_OR_EXPIRED` where
  it used to answer `401 NEEDS_PASSWORD` / `401 WRONG_PASSWORD` /
  `401 SIGN_IN_REQUIRED` / `410 EXPIRED_OR_REVOKED`, for every link whose object
  has `publicSharing.enabled` switched off. Shipped as `minor` under the repo's
  launch-window convention (a breaking change does not burn a major while the
  stack is in lockstep). No published export is added, removed or re-shaped; the
  level carries the breaking banner, not a surface change.
  
  #14033 made `publicSharing.enabled` a standing policy: `resolveToken()` re-reads
  the object's current block on every redemption and refuses a switched-off link
  with the same undifferentiated `null` a revoked, expired, unknown or ineligible
  token gets — because, in that gate's own words, for a caller who may hold
  nothing but a token a distinguishable "sharing is off for this object" is an
  **existence oracle**.
  
  The HTTP layer above it then re-opened exactly that oracle. Both share-link
  surfaces run a row probe after `resolveToken()` returns null, to answer with a
  more useful status, and both answered from the `sys_share_link` row with no
  knowledge of the object's block. So an anonymous caller could still tell a
  real-but-switched-off token from an unknown one three ways: a row carrying
  `password_hash` drew `401 NEEDS_PASSWORD`, the same row with any password drew
  `401 WRONG_PASSWORD` — including a **correct** password, which is both an oracle
  and a lie, since that link can serve nothing — and a row with
  `audience: 'signed_in'` drew `401 SIGN_IN_REQUIRED`. A security property stated
  in one layer and defeated in the layer above it is worse than one never claimed,
  because the next reader believes the comment.
  
  **What changed.** Both probes read the object's standing policy before they
  answer from the row, and when the block is off every arm falls through to the
  generic `404 INVALID_OR_EXPIRED` that unknown, revoked, expired and ineligible
  tokens already give — byte-for-byte the answer a token that never existed
  receives. The `410 EXPIRED_OR_REVOKED` arm is included: gating only the two 401
  arms would leave a third class of link answer and a rule about which arms are
  gated. An object whose schema the engine cannot answer for is `enabled: false`
  by `getPolicy`'s definition and is refused the same way — fail-closed, the same
  definition `createLink` and `resolveToken` already use.
  
  The fix lands at **both** sites in one change, because the probe exists twice:
  `plugin-sharing`'s REST routes, and the `/share-links` dispatcher domain in
  `@objectstack/runtime` that is the designed primary surface for cloud's
  per-environment kernels (`registerShareLinkRoutes: false`). Fixing one would
  have moved the oracle to whichever embedding uses the other.
  
  **Nothing else moves.** With the block ON, every refusal is exactly what it was:
  `NEEDS_PASSWORD`, `WRONG_PASSWORD`, `SIGN_IN_REQUIRED` and `EXPIRED_OR_REVOKED`
  are unchanged in status, code and message, and a correct password or a signed-in
  viewer still resolves the record. Mint-time behaviour is untouched, no
  `sys_share_link` row is written or read differently, and no error code is added
  or retired.
  
  **Consumer impact.** A viewer that branches on the refusal STATUS sees TWO
  changes, for links on a switched-off object only — and the measured consumer
  branches on status alone. On the objectui console at `67dadd6`,
  `apps/console/src/pages/SharedRecordPage.tsx` lines 70-85 dispatch on
  `res.status` and never on the body's error code, so:
  
  - all three 401 arms (`NEEDS_PASSWORD`, `WRONG_PASSWORD`, `SIGN_IN_REQUIRED`)
    rendered the password prompt and now render the 404 copy, "This link is
    invalid or no longer available.";
  - the 410 arm rendered "This link has expired or was revoked." and now renders
    that same 404 copy.
  
  Both shifts are the intended outcome and were accepted with the ruling: a
  correct password on such a link yields nothing, so prompting for one teaches the
  holder to open a door that is bricked up, and "expired or revoked" is a claim
  about a token whose existence the caller must not be able to confirm. Links on
  objects whose block is on are unaffected — prompt, 410 copy and 200 render
  included.
  
  Maintainer ruling 2026-09-03 (decision batch #17, item 1), verbatim 「同意」,
  adopting option A over option B (keep the 401 and document the accepted oracle)
  and option C (gate only the two 401 arms, rejected as proliferation).
  
  <!-- adr-0087: not-required (no-migration-prescription) Nothing authorable is removed, renamed or re-shaped: `publicSharing.enabled` keeps its name, type, default and accept-set, and this change is only WHICH HTTP STATUS the route layer answers with while that switch is off. There is no tombstone for `objectstack migrate meta` to carry and no mechanical rewrite it could perform on any consumer — a deployment that wants the 401 affordance back enables the object's block, which is an authoring decision, not a migration. -->
- 18b53ac: ⚠️ **Published-contract break for external hosts.** The `logger` option on the three
  PUBLICLY EXPORTED options types — `SharingServiceOptions`, `ShareLinkServiceOptions` and
  `SharingRuleServiceOptions` — now **requires** a `warn` channel, and its members carry real
  signatures (`(msg: any, ...rest: any[]) => void`) instead of bare `Function`. A host that
  constructs any of these services with `{ logger: { info, error } }` compiles today and stops
  compiling after this release; add `warn` (or drop the `logger` option) to migrate. Nothing
  about the services' runtime behaviour changes, and no call site inside this package moved:
  the tightening was measured at ZERO compile errors within `plugin-sharing`, so the whole cost
  falls on hosts, which is why it is declared here rather than shipped as a patch.
  
  Why: #9754 rules that a sink declaring an optional `error` must declare a NON-optional
  `warn`, so a durability report always has somewhere to land — an optional `error` beside an
  optional `warn` is a contract that permits silence. These three sinks were red against that
  rule from the day it was written and were only invisible to its checker until #11069 taught it
  to read bare `Function` as a channel. The maintainer ruled on 2026-08-24 (#10556) that they
  tighten rather than stay baselined, shipped `minor` with the break named here.
  
  The bare-`Function` spelling was also its own defect: `Function` is not assignable to a
  concrete signature, so `record-orphan-cleanup.ts` could not tighten its own `MinimalLogger`
  while these producers stayed loose (#10692). That producer-side blocker is now clear.
- b70a55d: fix(plugin-sharing): one refused grant no longer aborts a sharing rule's reconcile pass — its stale-row revocations still run (#14754)
  
  After #14484 `sys_record_share` is `tenant-scoped` in the #13491 ledger, so on a
  walled install an organization-less system insert on it is refused loudly with
  `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` (#8844). `SharingService.grant`
  resolves the organization on every path that can; a platform-global sharing
  rule (`organization_id = null`, its sweep unscoped) materialising a grant onto
  an organization-LESS record resolves none, and meets that refusal.
  
  `SharingRuleService.reconcile` / `reconcileForRecord` had no per-grant catch, so
  the refusal propagated and **that rule's pass aborted mid-loop**. Two things
  were lost, and they are not equally serious:
  
  - the remaining grants — recoverable, the next pass writes them;
  - **the stale-row revocations of that pass** — not recoverable by waiting,
    because every subsequent pass meets the same organization-less record and
    dies in the same place. A stale over-grant of that rule therefore persisted
    indefinitely, and the record kept aborting the pass until it was repaired by
    hand. That is the security-relevant half.
  
  Measured while pinning this, and it sharpens the point: the engine returns
  organization-less rows **last** in a rule's criteria sweep (the driver's
  NULL-org compatibility arm is appended to the scoped arm). So a refused grant
  is nearly always one of the final attempts of a pass, and what an abort
  destroyed was hardly ever "the remaining grants" — it was almost entirely the
  revoke loop that runs after the whole upsert loop.
  
  Both loops now attempt each grant individually. A refusal is logged with the
  rule, object, record, recipient and the engine's own code, counted, and the
  pass **continues** — the remaining grants and, above all, the stale-row
  revocations still run.
  
  **The catch is deliberately narrow.** Only
  `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` is absorbed; every other error
  rethrows unchanged. A catch-all would swallow real defects and report a pass
  that "completed" having written nothing. It would also silently retire a
  reviewed decision: `record-share-organization-stamp.test.ts` deliberately pins
  the abort on the OTHER error a reconcile pass can meet here — the scoped update
  half answering `RECORD_NOT_FOUND` for a row stamped with a different
  organization — which the 2026-09-02 contract review left standing on "loud
  beats a wrong count". Those three pins are unchanged and still green.
  
  **Why `minor` rather than `patch`.** The repair is a bug fix, but it reports
  through a new key. `reconcile` / `reconcileForRecord` / `evaluateRule` /
  `evaluateAllForRecord` now return `SharingRuleReconcilePassResult` — the spec's
  `SharingRuleEvaluationResult` plus `grantsRefused: number` — and that type is
  newly exported from the package index. Purely additive: the contract in
  `@objectstack/spec` is untouched, its six declared fields are unchanged, and a
  consumer typed against `ISharingRuleService` keeps compiling as it did. Same
  shape as `fix(runtime): tell an action handler when its caller-scope record load
  was refused` (#14143), which shipped `minor` for the same reason.
  
  `grantsRefused > 0` does **not** mean the pass failed. It means the pass met a
  record it cannot grant on and carried on — which is the whole point.
  
  **Wire surface — declared, not lifted.** `grantsRefused` reaches the wire.
  `POST /api/v1/sharing/rules/:idOrName/evaluate` is a ledgered **SDK** route —
  `packages/rest/src/rest-route-ledger.ts:390`, the row carrying
  `disposition: 'sdk'` and `client: 'shares.rules.evaluate'` — and its REST handler
  passes the service return value through **unfiltered**
  (`packages/rest/src/rest-server.ts:11108`–`:11109`:
  `const result = await svc.evaluateRule(req.params.idOrName, context ?? {})`
  followed by `res.json(result)`). So the seventh key is on the response body every
  caller of that route already receives. The SDK method declares
  `SharingRuleEvaluationResult` as its resolved type
  (`packages/client/src/index.ts:4766`, unwrapped at `:4771` through
  `unwrapResponse` parameterised on that same type), and that type is the spec's
  six-field contract — so the **declared client type cannot name the seventh key**.
  That is a client-type **lag**, not a contract break: the key is additive on the
  wire, every declared field is unchanged, and a consumer typed against
  `SharingRuleEvaluationResult` keeps compiling exactly as before. Lifting the type
  is not this PR's to do — `SharingRuleEvaluationResult` lives in
  `@objectstack/spec`, a `domain:spec` single-owner file — so the lag is declared
  here and tracked as the follow-up #14969, which lifts `grantsRefused?: number`
  (optional) into `SharingRuleEvaluationResult`.
- 3194c91: ⚠️ **BREAKING (published parameter tightened):** `sweepOrphanedRowsByRecordExistence` —
  publicly exported from `@objectstack/plugin-sharing` — now types its optional `logger`
  parameter as `{ info?, warn }` with real signatures (`(msg: any, ...rest: any[]) => void`)
  and a **required** `warn`, replacing the old `{ info?: Function, warn?: Function }`. A host
  that passed this function a logger without a `warn` member (for example an
  `{ info, error }`-only literal) compiles today and stops compiling after this release. The
  one-line fix: add a `warn` callback to that logger object — or omit the `logger` argument
  entirely, since the parameter itself stays optional. Nothing about the sweep's runtime
  behaviour changes, and no call site in this repo moved: both in-package callers forward the
  owning services' `logger` options, whose `warn` is already required since the producer
  tightening (`SharingServiceOptions` / `ShareLinkServiceOptions` /
  `SharingRuleServiceOptions`) shipped in the previous release.
  
  Why: every report this sweep emits lands on `warn` — the "could not check whether records
  still exist", "stopped early" and "revoked N rows" lines — so a logger without a
  guaranteed `warn` is one the sweep can lose its ONLY output into. That is #9754's
  permit-silence shape, one module downstream of the producers #10556 tightened, and the
  maintainer ruled (#10692, 2026-08-25) that this package's logger contracts refuse it
  loudly at compile time rather than keep it. The bare `Function` members were also their
  own defect: they documented no call shape and caught no arity mistake. The refusal is
  pinned at compile time in `logger-required-warn.pin.ts`, which also pins the three
  publicly exported options types above.
  
  Breaking ships as `minor` per the launch-window convention
  (`scripts/check-changeset-no-major.mjs`).
  
  <!-- adr-0087: not-required (no-migration-prescription) A TypeScript parameter type on one published function tightens; no metadata surface is involved — no Zod schema, no `packages/spec` declaration, no authorable key, no stored representation — so `objectstack migrate meta` has nothing to visit and no conversion-layer entry could replay anything. The affected caller is host CODE, and the compiler names the exact argument at the exact call line on upgrade, which is more precise than a ledger entry; the repair is adding a `warn` callback to that logger object. The sibling host repo objectui was grepped at claim time (ref 194fae18): zero imports of this package and zero warn-less logger literals, so no known caller has code to rewrite. -->
- 65759ba: fix(plugin-sharing): the by-id write denial renders through the Operation
  Message Catalog instead of a hardcoded English sentence (#12260, the consumer
  half of the key #12493 landed)
  
  A user holding object-level allowRead + allowEdit — and no `modifyAllRecords` —
  PATCHed a record they do not own on an object declaring
  `sharingModel: 'public_read'` with `access: { default: 'private' }`. The sharing
  middleware refused, correctly, and the client showed the server's reason
  verbatim to the end user: one hardcoded English sentence naming the object's API
  name and the row's opaque id. In a fully Chinese deployment that was the only
  thing the user was told about why their save failed.
  
  The refusal now renders through the shared Operation Message Catalog in
  `@objectstack/spec/system` under the key `record_write_denied` that #12493
  landed for it — the same mechanism `plugin-security`'s record-level denial
  already uses, which is exactly the comparison the report drew: the same "I can
  see this record but cannot change it" situation showed human language or raw
  English depending on which layer refused. Same resolution ladder (deployment
  override → the caller's locale → `en` → the key), same guarantee that a
  misbehaving i18n service cannot turn a 403 into a 500. All four platform
  locales (`en`, `zh-CN`, `ja-JP`, `es-ES`) ship copy that sends the reader to the
  record's owner or an administrator instead of dead-ending them.
  
  `record_write_denied` is deliberately not `record_access_denied`: this gate
  fires on a row the READ path already admitted, so "You do not have access to
  this record" would be false the moment it rendered. It is one key for BOTH write
  verbs — the user's situation and remedy are identical for `update` and `delete`.
  
  `buildSharingMiddleware` gains an optional third argument, a lazily resolved
  `II18nService.t`-compatible lookup wired by `SharingServicePlugin`, because the
  i18n service is contributed by another plugin and may start later. It is what
  makes the override address the catalog documents,
  `errors.record_write_denied`, take effect for this emitter. The argument is
  additive: every existing caller passes two and is unchanged, and a stack with no
  i18n service still renders the built-in catalog in the caller's locale.
  
  **Not changed: who may write.** The gate is byte-identical — ownership, write
  depth, an edit-level share for `update`, Modify All Data — and the app-authored
  RLS deferral ahead of it is untouched. The `FORBIDDEN:` prefix the REST layer
  classifies 403 on is untouched, and so is the ADR-0111 D10 `delete`-verb
  diagnostic breadcrumb. The verb, object and row id the old sentence carried are
  now developer facts on the error's `developerMessage` and `details` and in the
  log, where a developer reads them and a user never does.

### Patch Changes

- 6a180e4: fix(core,rest,services)!: a permission-store read failure now fails LOUD instead of resolving as an authenticated caller holding zero capabilities (#13279)
  
  **BREAKING** runtime behaviour change on the shared authorization resolver,
  shipped as `minor` under the repo's launch-window convention.
  
  `resolveAuthzContext`'s per-read helper `tryFind` answered a THROWN read exactly
  the way it answered an EMPTY one: `[]`. So an outage of the permission store
  resolved as a well-formed context for an authenticated principal holding no
  capabilities, and the package-management door answered
  `403 FORBIDDEN` — "Reading packages requires the `studio.access` or
  `setup.access` capability." That answer was measured byte-identical
  (`JSON.stringify` equal, against a control that separates two answers which do
  differ) to what a caller who genuinely holds nothing receives. An administrator
  was told they lack a capability, during an outage of the store that holds the
  capability.
  
  Maintainer ruling 2026-08-30, verbatim 「第一批其余同意」: `tryFind` 区分「无行」
  与「读失败」,读失败 fail-loud —— 权限库不可达时不再解析为「已认证零能力」,而是
  响亮拒绝(与真实能力拒绝的 403 可区分)。
  
  Second maintainer ruling the same day (第 5 场总监席决裁批 #9, verbatim 「同意」),
  after implementing the first one showed that "the read failed" is two facts:
  采**选项 A** —— 把 `isMissingTableError` 从 `@objectstack/metadata` 迁至
  `@objectstack/types`(core 已依赖),metadata 保留 re-export 兼容;`tryFind` 仅对
  **未被判定为「表未 provision」**的读失败抛 `AuthzStoreUnavailableError`。
  
  **What changed.** A permission-store read that is issued and throws now raises
  `AuthzStoreUnavailableError`, which carries the EXISTING ADR-0112 wire code
  `SERVICE_UNAVAILABLE` and status `503`. No code is added to the closed wire
  vocabulary and no response envelope gains or loses a key — only which declared
  code an outage selects. Doors that map thrown errors through
  `resolveThrownHttpError` answer 503 with no per-door change.
  
  **What did NOT change**, and is pinned:
  
  - A reachable, genuinely EMPTY store (reads return no rows) still resolves to
    zero capabilities.
  - A genuine capability denial still answers `403 FORBIDDEN` with its message.
  - An ABSENT engine (`ql` unwired, so no read is ever issued) still resolves to
    an empty-but-valid envelope.
  - Anonymous requests never reach the store, so an outage cannot make them loud.
  - A REAL engine whose `sys_*` tables were never provisioned resolves to zero
    capabilities, quietly — pinned to be byte-identical to the empty-store
    envelope, in every dialect spelling and in the production wrapper shape where
    the driver's phrase is on `cause` rather than the outer message.
  
  **The boundary between the two kinds of read failure.** An earlier revision of
  this changeset claimed "embedders without a data plane are unaffected". That
  claim was too broad; it is retracted here, and the gap it named is now closed
  rather than merely disclosed. A read also throws when the table was never
  PROVISIONED — a real engine, wired and reachable, whose `sys_*` tables were
  never created — and that is a supported deployment shape, not an outage. There
  "zero capabilities" is the TRUE answer rather than a fabrication: nothing is
  provisioned, so nothing was withheld. Only an UNREACHABLE store — the ruling's
  own word 不可达 — leaves the capability set unknown, and only an unknown answer
  may not be reported as a denial.
  
  Treating the two alike was measured, not theorised: it turned four CI suites
  red, all from `no such table` on `sys_user` / `sys_member` /
  `sys_user_position` / `sys_user_permission_set`. Ordinary CRUD in
  `@objectstack/client` answered `503`; batch validation errors that owe `400`
  answered `503`, because authorization refused before validation ran; runtime
  notifications answered `401` where authenticated callers must be served `200`;
  and two `.integration.test.ts` noise guards reported that the driver and engine
  diagnostics for `sys_position` stopped being emitted — the eager throw aborted
  the resolution before that later read was ever issued, so a change made to stop
  a failed read being silent had made two other channels silent.
  
  `tryFind` therefore raises `AuthzStoreUnavailableError` only for a read failure
  that is NOT positively identified as an unprovisioned table.
  
  **`isMissingTableError` moved to `@objectstack/types`.** The classifier that
  draws that boundary already existed and was already right — driver-code based
  rather than prose-sniffing, documented so that "cannot say" never means "be
  loud". It lived in `@objectstack/metadata`, which DEPENDS ON `@objectstack/core`,
  so the resolver could not import it. Rather than keep a second copy of a
  security-relevant predicate, the ruling relocated the one classifier to
  `@objectstack/types` — the package core already depends on, and the repo's own
  stated Home rule for a cross-package error predicate ("every consumer of the
  question already depends on it, so adopting the predicate never adds an edge",
  `packages/types/src/unique-violation.ts`). `@objectstack/metadata/errors` still
  exports `isMissingTableError`, re-exported from the new home, so no consumer of
  that published subpath changes.
  
  Its sibling `isSchemaAlreadyExistsError` moved with it — the two are not two
  modules but two signatures over one matcher, and separating them would have
  meant re-rolling the matcher, which is the duplication the module exists to
  prevent. Both are now exported from `@objectstack/types`; the metadata subpath
  deliberately still publishes only `isMissingTableError`, which is the only one
  anything imports through it.
  
  ⚠️ **Signed-off risk, recorded because it is load-bearing.** Gating loudness on
  a driver-error predicate was approved with its false-positive direction stated:
  mis-reading a genuine outage as "table not provisioned" silently restores the
  quiet 403 this change removes, with no thrown error and no other failing test.
  That direction is accepted, not overlooked — the predicate keys on driver codes,
  SQLSTATEs and errnos first, excludes the known superstring traps up front, and
  returns `false` for anything it does not positively recognise, so an
  unrecognised outage stays loud by default. The risk is written beside the
  predicate in `resolve-authz-context.ts` and both directions are pinned by name
  in `authz-store-unavailable.test.ts`. ⛔ Do not widen `isMissingTableError` to
  make a first boot quieter: every widening moves outages into the quiet branch.
  
  **All-transport, not just REST.** Every transport authorizing through
  `resolveAuthzContext` inherits this. Six of the eight production transports
  wrapped the call in a fail-closed `catch` that would have re-silenced the
  outage — measured, not assumed: with the resolver loud but the nets untouched,
  the package door answered `401`, i.e. the outage merely changed disguises. Those
  `catch` blocks now re-raise via `isAuthzStoreUnavailableError` and keep their
  previous behaviour for every other fault. The transport set is rebuilt from
  source and audited for set equality on every test run, so a transport added
  later cannot inherit the old silence unnoticed.
  
  Callers that treat any throw from `resolveAuthzContext` as "anonymous" should
  re-raise `isAuthzStoreUnavailableError(err)` instead: degrading it restores the
  disguise this removes.
  
  <!-- adr-0087: not-required (runtime-interface-only packages/core/src/security/resolve-authz-context.ts#ResolvedAuthzContext, packages/core/src/security/authz-store-unavailable.ts#AuthzStoreUnavailableError) The breaking surface is runtime TypeScript in `@objectstack/core`'s security module and nothing else: `resolveAuthzContext` stops always-resolving and raises `AuthzStoreUnavailableError` when a permission-store read is issued and throws. NO metadata surface is touched in either direction. No Zod schema changes, no `packages/spec` declaration is added or removed, no authorable key moves, no stored row shape changes, and no object definition is edited — a customer's metadata app is byte-for-byte unaffected, so `objectstack migrate meta` has nothing to visit and there is no tombstone to mint. The wire vocabulary is likewise untouched: `SERVICE_UNAVAILABLE` is an EXISTING `StandardErrorCode` member that `HttpStatusErrorCodeMap` already maps to 503, so this change only selects a different DECLARED code for an outage rather than adding one. Both named symbols resolve at HEAD as exported declarations whose files are not `*.zod.ts`, are not under `packages/spec/src/contracts/`, are not object definitions and are not `z.input` projections; neither is referenced in code by any metadata surface (the `packages/spec` hits for `resolveAuthzContext` are comment prose describing the envelope, which this gate masks). The channel that reaches an affected consumer is therefore code review and this changeset, never the upgrade guide: a ledger entry could not express "your fail-closed catch should re-raise this error", because there is no metadata for a migration to rewrite. -->
- e560b4d: Tenant-screen the `sys_business_unit_member` reads, and warn when an active business-unit rule grants nobody.
  
  ⚠️ This entry originally also announced that `BusinessUnitGraphService.orgScope` had been widened to the platform's null-inclusive `(organization_id = ? OR organization_id IS NULL)` screen, fixing the case where a sharing rule naming a **seed-written** business unit granted nobody. That half was **reverted before 17.3 was cut** and does not ship: it re-implemented, a second time and in a second place, the predicate `SqlDriver.applyTenantScope` already owns — the duplication the v18 org-ownership decision (PR #14976) exists to retire — and it had not been released. `orgScope` keeps the strict `organization_id` equality 17.2.0 ships, so a rule naming a seeded unit still expands to nobody. That defect is fixed structurally on the v18 line by the v18 org-ownership decision (PR #14976), C1 (the Default Organization exists before application seed datasets load, and the seed loader stamps `sys_business_unit` seeds). What follows is the part of this change that DOES ship.
  
  The member reads are now tenant-screened, which they were not before. Both `expandUnitMembers` and `expandUsers` queried `sys_business_unit_member` with no organization predicate at all, under a system context that carries no tenant either, so the strict unit screen was the only thing keeping an org-stamped rule away from that unscoped query. This matters independently of the unit screen: other organizations' member rows sit on org-stamped — visible — units too, so a strict unit screen narrows which units are reachable but does not close the unscoped member read. The member screen is strict rather than null-inclusive on purpose: seed replay and elevated system writes both leave `sys_business_unit_member.organization_id` NULL, so a NULL there means unknown tenancy rather than platform-global, and an org-scoped rule does not grant to it. The sibling recipient widths already read their membership rows this way.
  
  An active business-unit rule that expands to no recipients now warns once per rule per process, naming the rule, the object, the recipient kind, the unit and the organization. That is what keeps the remaining seed-data symptom observable at the moment it happens, rather than surfacing only as "the right people cannot see the record".
- 35202f1: fix(plugin-auth,plugin-sharing): a refused bootstrap write stops reading as a clean one (#12981)
  
  Two boot-time seams answered a REFUSED write exactly the way they answer a
  write there was no need to make. Nothing else failed on either path, so the
  deployment kept looking healthy — the durability class AGENTS.md separates
  from the functional one, and the class `check-durability-degradation-log-level`
  exists for and, at these two sites, structurally cannot see (it matches callee
  NAMES from an 18-entry vocabulary, and a seeder reaching storage through
  `ql.insert` is not in it; a green there means NOT MEASURED for the site, never
  "level approved").
  
  **`plugin-auth` — `ensureDefaultOrganization` reported at `warn`.** A refused
  `sys_organization` or `sys_member` insert leaves the platform admin with no
  organization: under multi-org the default `tenant_isolation` RLS policy filters
  their console to zero rows, and under single-org better-auth has no active org
  to resolve, so there is no way to add a user at all (ADR-0081 D1). Both lines
  now report at `error` and each names the consequence AND the remedy, per
  "Degradation log levels". `BootstrapLogger` gains an OPTIONAL `error`
  (`message, error?, meta?` — the spec `Logger` arity, so the kernel logger
  satisfies it as-is) beside its already-required `warn`; the fallback to `warn`
  is mandatory and lives in one helper so no site can forget it. Additive: a host
  passing `{ info, warn }` compiles and behaves exactly as before, and gets the
  same line on the `warn` channel.
  
  **`plugin-sharing` — `backfillPrimaryBu` printed NOTHING when every row was
  refused.** Its per-row `catch { }` counted nothing and its report was gated on
  `updated > 0`, so a pass in which every `sys_user` write was refused emitted
  byte-identical output to a pass with nothing to do, while every affected user
  kept a stale or absent `primary_business_unit_id` and every sharing rule keyed
  on the primary business unit evaluated against the wrong value. Refusals are
  now counted, reported once with the consequence and the remedy, and the summary
  branch is `updated > 0 || refused > 0` — the same suppressor, repaired the same
  way, as `permission-set-drift.ts` in #12970. `backfillPrimaryBu` now answers
  `{ updated, refused }`; the added field is additive and its only in-tree caller
  ignores the result.
  
  `patch` rather than `minor` for both: no entry-barrel surface is added, no
  command or flag, and neither change can turn a previously accepted call into a
  rejected one. The `plugin-sharing` report deliberately stays on `warn` even
  though the consequence is durability-shaped — `OptionalSharingLogger`'s own
  header forbids growing an `error`, and giving that function a stricter sink
  means requiring `warn` on a publicly exported shape, which
  `scripts/optional-error-sink-contract.baseline.json` records in as many words
  as #10556's contract call. What is fixed here is the SILENCE, which needed no
  contract at all; the LEVEL belongs to that card.
- 30928a6: fix(i18n): read the provenance companion at serving time, not only record it (#12642)
  
  Maintainer ruling #12069 Option A (#11671) landed translation provenance as
  **two** halves: `os i18n extract --source-hashes` RECORDS which source revision
  a generated leaf is still a byte copy of, and `withSourceFallback` READS those
  records at serving time and substitutes the current source for a leaf whose
  source has moved underneath it. The recording half was then rolled out to every
  bundle set. The reading half was not — measured on `main`: provenance
  **recorded in 9 of 9** bundle sets and **read at serving time in 1**.
  
  The other eight assembled their `TranslationBundle` straight from the raw
  generated modules and never consulted the companion sitting beside them, so
  they recorded the drift and went on serving the superseded draft. Nothing said
  so: `check:i18n` compares key sets and they still matched, `check:i18n-coverage`
  counts a present leaf as translated, and `check:i18n-stale-fill`'s cross-locale
  rule needs a SECOND locale holding the same stale bytes before it can testify.
  The measured case had one locale and no second witness.
  
  All eight are wired here, in the shape `@objectstack/platform-objects`'s own
  `metadata-translations/index.ts` uses — the committed
  `<locale>.source-hashes.generated.ts` passed as the fourth argument, the third
  left `undefined` because these sets have no hand-authored sections. Provenance
  is now recorded in 9 of 9 sets and served in 9 of 9.
  
  `@objectstack/plugin-webhooks` was the last of them and is the only one whose
  manifest changed: `withSourceFallback` lives in `@objectstack/platform-objects`,
  which that package did not declare. It was **already in that package's install
  closure** through `@objectstack/service-messaging`, so the edge declares a
  resolution that already resolved rather than adding a package to the graph —
  and relying on it undeclared would have been a phantom dependency under this
  repo's strict package manager.
  
  `check:i18n-stale-fill` gains a second verdict, **UNSERVED PROVENANCE**, so this
  cannot silently come apart again: a bundle set that commits a companion and
  does not consult it at serving time now fails the build, including a tenth set
  that lands tomorrow.
  
  **Graded `patch`, and the grade is the interesting part.** No API changes, no
  new exported surface, and no key set moves — substitution was chosen over
  deletion precisely so key-set claims stay put (ruling #8765 Option B). What
  changes is which STRING a stale leaf serves. On this tree that is **zero
  leaves**: a record is only ever written for a leaf that IS a byte copy of the
  current source, so the companions arrive 0-stale by construction. The change is
  in what happens the next time a source string moves — the reader sees the
  English source rather than a superseded draft of it, which is the same
  degradation an untranslated key already produces and not a new state.
- de47336: chore(i18n): roll the generated-leaf provenance companion out to the remaining bundle sets (#12559)
  
  `os i18n extract --source-hashes` (#11671, maintainer ruling #12069 Option A)
  records, per generated translation leaf, the digest of the source revision that
  leaf is **still a byte copy of** — the one signal that tells a stale fill from a
  real translation once the source has moved and the two stopped being
  distinguishable by value. It shipped opt-in, and exactly one of the nine i18n
  bundle sets opted in. A landed detector, a changeset announcing it and a green
  gate read together as *"generated translation staleness is now caught"*; for
  eight of nine sets it was not, and the thing making it not caught was a single
  absent flag in an extract config — invisible from all three of those surfaces.
  
  **All eight remaining sets now opt in** — `plugin-approvals`, `plugin-audit`,
  `plugin-security`, `plugin-sharing`, `plugin-webhooks`, `service-messaging`,
  `service-realtime`, `service-storage`. Each documents `source-hashes` in its
  extract config and commits three `<locale>.source-hashes.generated.ts`
  companions, produced by the same extract run as the bundles they sit beside
  (`check:i18n` compares them byte-for-byte, so they cannot be written by hand).
  `check:i18n` now reports 7 bundles per set where it reported 4, and 11 for
  `platform-objects` where it reported 8.
  
  **Records count what is currently RECORDABLE, never what is covered.** A record
  is written only for a leaf that *is* right now a byte copy of the current
  source, so a fully translated locale starts with an empty table — which is the
  instrument armed, not an instrument that measures nothing: the entry appears by
  itself on the first extract after a leaf becomes a fill. Measured at this
  commit, per set over its three translated locales: `service-messaging` 289,
  `plugin-approvals` 61, `plugin-security` 33, `plugin-webhooks` 20,
  `plugin-audit` 8, `service-storage` 7, `plugin-sharing` 1 (es-ES only; zh-CN and
  ja-JP are fully translated and start empty), `service-realtime` 0 (all three
  locales fully translated). **419 records written across the eight sets, 0
  stale.**
  
  **One extractor fix the rollout forced.** `--source-hashes` had one user, and
  that user commits both generated sections, so the interaction with
  `--no-metadata-forms` had never been exercised. The provenance table is computed
  over every generated section the extractor builds; the eight sets here commit no
  metadata-forms bundle, and their `metadataForms` subtree — absent from their
  merge baseline — arrives as a fresh `--fill=default` copy of `en`, so every leaf
  of it was recordable. First measured on `plugin-audit`: **763 records, of which
  2 were its own objects and 761 were digests of the Studio metadata-form baseline
  `@objectstack/platform-objects` owns.** Those records are unreadable in the
  package holding them and would have rewritten all 24 companions on any unrelated
  `*.form.ts` change in `packages/spec` — the cross-package coupling ADR-0029 D8
  and every `bundle-ownership.test.ts` keep out of committed bundles. The
  companion now covers exactly the sections a run commits, decided by the same two
  predicates that decide the bundle files. `platform-objects` commits both, so its
  three committed companions are byte-for-byte unchanged.
  
  **Grade: `patch`, and behaviour on the day it lands is unchanged for every
  leaf.** A record is written only where a leaf is currently a byte copy of the
  **current** source, so every record written equals the current digest and none
  of them can be stale; the mechanism cannot arrive red. No committed translation
  bundle changed a byte, no public API moved, and no leaf's rendered text changed.
  `narrowToCommittedSections` is new but internal to `@objectstack/cli` — the
  package's entrypoint does not re-export the extractor utils.
  
  **What this does not do**, stated so the boundary is not inferred wrongly a
  second time: these eight sets now *record* provenance. Reading it at serving
  time is `withSourceFallback`, and that is still wired in
  `@objectstack/platform-objects` alone — so a stale fill in one of the eight is
  now recorded and reportable, but not yet substituted at runtime. Tracked
  separately.
- 9e72090: fix(sharing): honour the declared `organizationId` in `managerOf` (#10231)
  
  `ITeamGraphService.managerOf(userId, organizationId?)` declares an organization
  parameter. `TeamGraphService.managerOf` spelled it `_organizationId` and
  discarded it, and the `BusinessUnitGraphService` standalone fallback read
  `sys_user` the same unscreened way — a declared-but-unenforced parameter on a
  security seam, while `expandRoleUsers` on the same class applied
  `organization_id` to its own read.
  
  Both now apply the screen #10153 landed for the identical column
  (`sys_user.manager_id`) on the approvals side: a manager who is **provably**
  outside the caller's organization — membership rows exist for him, none of
  them in that organization — is dropped. The read is `sys_member`, because
  `sys_user` is the global better-auth identity table and carries no
  `organization_id` at all; filtering the `sys_user` read on a column that does
  not exist would match nothing and silently return `null` for every lookup.
  
  The screen is fail-open on an ABSENT tenancy fact (no membership rows, or the
  membership read failed) and issues no query at all when no organization is in
  play, so callers that pass nothing — which is how the parameter is used today —
  are byte-identical to before. The manager cache key is now organization-
  qualified; a user-keyed cache would have served one screened `null` to every
  unscoped reader behind it.
- ad54eb3: feat(tooling): onboard all 14 `packages/plugins/**` packages into `check:test-typecheck` (#14062)
  
  Every plugin package now has a `tsconfig.test.json` compiled by the shared
  `check:test-typecheck` gate, and its `typecheck` script names it. Before this,
  the shrink-only `test-typecheck-debt.json` ratchet said **nothing** about a
  third of the repo's runtime surface: 14 packages, 1 `tsconfig.test.json`
  (`plugin-security`, wired directly to `tsc` rather than to the instrument), and
  0 `check:test-typecheck` scripts.
  
  Onboarded as a family by the director ruling of 2026-09-01 on #14062
  (maintainer verbatim: 「同意」), which also carries the #5286 maintainer
  authority the starting ledgers need. The smaller branch triage recommended —
  declare the instrument's scope and re-site the two compile-time pins — was
  recorded as considered and not taken: an instrument silent over a third of the
  runtime surface is a hole readers generalise across, and that costs more than
  fourteen tsconfigs.
  
  **Measured, not assumed** (at `e80889095`, workspace closure built first). Four
  packages carry residue and therefore a starting ledger — plugin-approvals 324
  over 8 files, plugin-auth 94 over 10, plugin-sharing 3 over 2,
  knowledge-ragflow 3 over 1. The other ten measure **zero** and deliberately get
  no ledger file at all: the gate reads a missing ledger as `{ entries: {} }`, so
  any error there is red immediately with no entry to be added to — strictly
  stronger than a ledger holding nothing, and the call `plugin-security` had
  already recorded for itself.
  
  ⛔ **This does not repair 345 type errors.** Per ruling item 3 it makes the
  ratchet able to *see* them; paydown follows the ratchet's own shrink-only
  discipline on its own cards. No test file is edited here.
  
  Two corrections to the finding's own prose, both measured: the exclusion is
  narrower than "no plugin package compiles its tests" — 9 of the 14 already
  compiled their tests inside the `typecheck`-invoked build config, at zero
  errors — and `exec-context-annotation.pin.ts` is a `.pin.ts`, which
  `**/*.test.ts` never excluded, so its directives were already live. The pin
  this change genuinely makes real is
  `plugin-approvals/src/manager-org-screen-parity.contract.test.ts`, which no tsc
  program had ever read.
- ab47816: revert(plugin-sharing): drop the NULL-inclusive business-unit screen added after 17.2.0
  
  17.3 does not ship the NULL-inclusive business-unit screen added after 17.2.0;
  #14547 remains as in 17.2.0 and is fixed structurally in v18 (the v18 org-ownership decision (PR #14976), C1: the
  Default Organization exists before application seed datasets load, and the seed
  loader stamps `sys_business_unit` seeds).
  
  `BusinessUnitGraphService.orgScope` briefly read
  `$or: [{ organization_id: <rule org> }, { organization_id: null }]` so that an
  org-stamped sharing rule could name a seeded (org-less) `sys_business_unit`
  row. It is restored to the strict `organization_id = <rule org>` equality
  17.2.0 ships. That shape re-implemented, a second time and in a second place,
  the predicate `SqlDriver.applyTenantScope` already owns — the duplication
  the v18 org-ownership decision (PR #14976) exists to retire (#10103 cause 1) — and it had not been released, so
  reverting costs nothing while shipping it would have owed v18 a breaking change
  and a migration.
  
  The other half of the same change is KEPT and is not touched:
  `BusinessUnitGraphService.memberScope` still screens both
  `sys_business_unit_member` reads with a strict equality. Those reads previously
  carried no organization predicate at all, so an org-stamped rule reaching any
  visible unit collected every tenant's membership rows hanging off it; a strict
  unit screen narrows which units are reachable but does not close that, because
  other organizations' member rows sit on org-stamped units too.
  `SharingRuleService.warnOnEmptyUnitExpansion` is also kept: it is what keeps the
  remaining #14547 symptom loud instead of silent.
- 67192ce: fix(plugin-sharing): an object's declared `publicSharing.redactFields` keep applying to share-link redemption after the object opts out (#13856)
  
  `ShareLinkService.getPolicy()` collapsed to an EMPTY policy whenever the
  object's `publicSharing` block had `enabled !== true` — `redactFields: []`
  included. A link minted while the object was opted IN and redeemed after it
  was opted OUT therefore kept resolving and started serving the very fields the
  object declares redacted: turning the feature OFF made the anonymous endpoint
  serve MORE data than it did while the feature was ON. Fail-open in the wrong
  direction, and wrong under either answer to the standing-policy question.
  
  The declared redaction set is now read from the object's declared
  `publicSharing` block regardless of `enabled`, so opting out can never widen
  what an existing token serves. Anonymous redemptions on opted-out objects that
  previously received the declared-redacted fields stop receiving them — that
  narrowing is this fix's intent, declared here rather than smoothed over.
  
  Unchanged, deliberately:
  
  - the `enabled: true` path (declared ∪ per-link union, byte-identical);
  - an object with no `publicSharing` block at all (no redaction set sprouts);
  - the per-link `redact_fields` half of the union;
  - the mint-time opt-in gate (`SHARING_NOT_ENABLED`, 422) and the #13608
    redemption-time eligibility gate;
  - whether an already-minted link should still RESOLVE at all once
    `enabled` is false — that ruling is pending in #14033 and is not
    implemented here in either direction.
- 953a81f: fix(plugin-sharing): a refused `use_count` / `last_used_at` stamp in `resolveToken` is reported as a durability degradation, once, instead of being swallowed (#12981, batch 9)
  
  `ShareLinkService.resolveToken` stamps `use_count` and `last_used_at` on
  `sys_share_link` after every successful resolution. The stamp's `catch` was
  empty ("usage telemetry is a nice-to-have"), so a storage refusal — a
  read-only database, a missing table, a broken system-context write path —
  left the link resolving normally while both counters silently froze.
  
  Those counters are a persistence CLAIM, not telemetry: `sys_share_link`
  declares `use_count` as "Incremented by resolveToken on every successful
  resolution" and `last_used_at` as "Stamped by resolveToken; used by the
  dashboard to highlight active links", and the shipped `active_links` grid
  lists both. After a swallowed refusal an administrator read a count the
  system's own declaration defines, wrong, with no signal anywhere — the
  AGENTS.md "Degradation log levels" shape (persisted state and runtime state
  disagree while nothing looks broken).
  
  **What changed.** The refusal is now reported through the service's existing
  `logger` option — the published `{ info?, warn, error? }` shape — at `error`,
  falling back to the guaranteed `warn` channel when the host sink declares no
  `error`. The line names the consequence (both counters are not being
  persisted; links keep resolving; the `active_links` grid under-counts), the
  fix (resolve the storage refusal named as the cause; refused stamps are not
  replayed), and the cause. It is emitted **once per service instance**, at the
  first refusal, never per request — `resolveToken` runs on every public
  share-link request, and a line per refused stamp would be the flood the rule
  forbids.
  
  **What did NOT change**, and is pinned: the resolution itself (the holder is
  still served, `redactFields` is unchanged, `resolveToken` never throws for a
  refused stamp); the success path (`use_count` still increments and
  `last_used_at` is still stamped on every successful resolution); the public
  HTTP projection; and `ShareLinkServiceOptions` — no member is added or
  widened, so hosts compile exactly as before.
- 6c3f9f5: fix(plugin-sharing): the record-share `$in` guard now tests `record_id` before `String()` coerces it (#13551)
  
  `buildReadFilter` and the bulk-write half of `buildWriteFilter` each turned the
  `sys_record_share` rows granted to the caller into the members of a security
  predicate, `{ id: { $in: [...] } }`, with the same expression:
  
  ```ts
  grants.map((g: any) => String(g.record_id)).filter(Boolean)
  ```
  
  `.filter(Boolean)` reads as "drop rows whose `record_id` is nullish". It cannot:
  `String(null)` is `'null'` and `String(undefined)` is `'undefined'`, and both are
  truthy. The only value that spelling could drop was the empty string, so the
  guard was dead for exactly the case its spelling advertised, and a
  `sys_record_share` row with a nullish `record_id` put the literal string
  `'null'` into the emitted `$in`.
  
  **Direction — this was not an open bypass, and the repair is not a bypass fix.**
  The emitted member is a bogus id that matches no row on any backend, and both
  sites are positive polarity (an OR-ed branch beside the owner match, never
  negated), so a corrupt row lost its grant rather than widening anyone's scope.
  It also took an already-corrupt row to reach at all. What was actually broken is
  the guard's honesty: a reader — or an audit asking which security paths already
  handle nullish ids — would have counted these two sites as covered when they
  provably were not.
  
  Both sites now share one module-private helper that tests the raw column value
  first and coerces after, the shape the sibling id-list guards already use
  (`plugin-sharing`'s own `sharing-rule-service.ts` and `primary-bu-projection.ts`,
  `core`'s `resolve-authz-context.ts`, `plugin-security`'s controlled-by-parent
  `masterIds`, `objectql`'s master-detail parent resolution). Factoring it into one
  helper is deliberate: the expression stood in two places, and repairing one would
  have left the other advertising a guarantee it does not keep.
  
  The non-null path is unchanged. Every non-nullish value still stringifies exactly
  as it did — a driver-numeric primary key still becomes its decimal string — and
  the empty string, the one value the old spelling really did drop, is still
  dropped. The only behavioural difference is that rows with a nullish `record_id`
  now contribute no member at all; when they were the *only* grants, the filter
  collapses to the plain owner match instead of OR-ing in a branch that matched
  nothing.
- 8d06347: The sharing-rule seeder's skip WARN now names WHY a declared rule's CEL `condition` did not translate: `compileCelToFilter`'s `reason` (the aggregatable category) and `detail` (the concrete refused shape, variable path, or parse bound) are carried into the log meta instead of being collapsed to `null` one line before the log that needed them. `celToFilter` keeps its published `Record | null` signature and delegates to the new `celToFilterOutcome` sibling (the `plugin-security` rls-compiler shape from #13942, one seam over). Skip semantics are unchanged — an unlowerable or match-all condition is still never seeded as a permissive match-all rule (ADR-0049).
- aae0cb3: fix(plugin-sharing): let system writes materialize sharing rules — drop the `isSystem` skips in `bindRuleHooks` (#13533)
  
  A criteria sharing rule declares a promise: `status == "approved"` means the
  named recipients can see the record. `bindRuleHooks` did not keep that promise
  when the platform was the writer. Its `afterInsert` and `afterUpdate` hooks
  returned early on `ctx.session.isSystem`, so a system-context write that moved a
  record INTO a rule's criteria materialized no `sys_record_share` row at all.
  
  The path that made this a real outage rather than a boot-time curiosity is
  approval write-back. An approval node with `lockRecord: true` mirrors the
  decision onto the subject record under a system context — that is the only write
  that can land while the record is locked — so a manager approving a leave
  request produced exactly the skip above. A teammate who relied on the rule could
  not see the record, and nothing repaired it until somebody ran
  `POST /api/v1/sharing/rules/:id/evaluate` or restarted the server. The failure
  was invisible from a manager or admin view, which reads through the profile's
  `viewAllRecords` grant and never consults a sharing rule at all.
  
  **What changes.** A system write now materializes exactly as a user write does —
  grants on the way into a rule's criteria, revokes on the way out, per record,
  synchronously with the write. Three early returns are gone: the two on
  `afterInsert` / `afterUpdate`, and the one on the `beforeUpdate` / `beforeDelete`
  row-set stash they depended on (without that stash an `after` hook reads the row
  set as *unbounded*, which would have turned every single-row system update into
  an object-wide revoke plus an asynchronous re-grant). The INFO line that
  announced the skip — `[sharing-rule] sharing materialisation skipped for isSystem
  writes; re-evaluate rules or restart to backfill` — is retired with it, along
  with the `SYSTEM_WRITE_SKIP_NOTICE` constant, which was not exported from the
  package entry point. Operationally this means seed- and import-time system writes
  on rule-covered objects now pay per-record sharing evaluation at write time — the
  cost a user write of the same shape has always paid, with the
  `kernel:bootstrapped` backfill still reconciling behind it.
  
  **What does not change.** `afterDelete` still skips system writes, on separate
  grounds: what it skips is revocation, and `record-share-cascade.ts` delivers that
  on every sharing-capable object, stashing for system writes on its own account.
  The `kernel:bootstrapped` boot backfill still runs and is still needed — it
  reaches rows no hook saw, and it is the only pass that purges a deactivated
  rule's grants. No new option, flag or declarative switch: the fix is the removal.
  
  No published export moves; `SYSTEM_WRITE_SKIP_NOTICE` was never re-exported from
  the package entry point.
- Updated dependencies [809d417]
- Updated dependencies [387e231]
- Updated dependencies [f794e4e]
- Updated dependencies [cae2169]
- Updated dependencies [bd8795e]
- Updated dependencies [b812a54]
- Updated dependencies [2d4fa75]
- Updated dependencies [0e4e51b]
- Updated dependencies [e84bbf6]
- Updated dependencies [effae80]
- Updated dependencies [efb3513]
- Updated dependencies [d62f990]
- Updated dependencies [c45d8e6]
- Updated dependencies [1dcb995]
- Updated dependencies [2e3e8c7]
- Updated dependencies [e621291]
- Updated dependencies [655b106]
- Updated dependencies [40a93b5]
- Updated dependencies [101ad2c]
- Updated dependencies [d5b330d]
- Updated dependencies [dda969c]
- Updated dependencies [1f45690]
- Updated dependencies [277948f]
- Updated dependencies [8bdd955]
- Updated dependencies [54e2d36]
- Updated dependencies [c5a9a43]
- Updated dependencies [b745157]
- Updated dependencies [f3bbbef]
- Updated dependencies [4f24e9d]
- Updated dependencies [e27583e]
- Updated dependencies [4bd6faa]
- Updated dependencies [86cbe37]
- Updated dependencies [6a180e4]
- Updated dependencies [474242f]
- Updated dependencies [63cd487]
- Updated dependencies [bd4aa4e]
- Updated dependencies [803eaab]
- Updated dependencies [f8e8f03]
- Updated dependencies [983edf1]
- Updated dependencies [eae824e]
- Updated dependencies [f6fa22c]
- Updated dependencies [8a483b3]
- Updated dependencies [3bc2e38]
- Updated dependencies [97bcd99]
- Updated dependencies [df59de0]
- Updated dependencies [96e25a8]
- Updated dependencies [713f83f]
- Updated dependencies [77d4b3c]
- Updated dependencies [f75a38a]
- Updated dependencies [bbbac0f]
- Updated dependencies [7a25e7d]
- Updated dependencies [1fa05a6]
- Updated dependencies [c85a265]
- Updated dependencies [dcb10a5]
- Updated dependencies [773a999]
- Updated dependencies [35dffea]
- Updated dependencies [dc7c226]
- Updated dependencies [d8024f0]
- Updated dependencies [8120808]
- Updated dependencies [0010797]
- Updated dependencies [776a098]
- Updated dependencies [5060877]
- Updated dependencies [4f6325d]
- Updated dependencies [52954c0]
- Updated dependencies [2aa8456]
- Updated dependencies [c393b56]
- Updated dependencies [0db5520]
- Updated dependencies [d23ebb9]
- Updated dependencies [93809a3]
- Updated dependencies [7c0d0c3]
- Updated dependencies [daae7aa]
- Updated dependencies [8dc22d6]
- Updated dependencies [fa5d137]
- Updated dependencies [a392dbf]
- Updated dependencies [279431e]
- Updated dependencies [948dd6b]
- Updated dependencies [3b4c56c]
- Updated dependencies [ae8edd2]
- Updated dependencies [e25403c]
- Updated dependencies [a81aa9d]
- Updated dependencies [64baa68]
- Updated dependencies [9fa70d7]
- Updated dependencies [09db64a]
- Updated dependencies [92916e7]
- Updated dependencies [a84f3ea]
- Updated dependencies [f2eaae8]
- Updated dependencies [56c093c]
- Updated dependencies [c09451b]
- Updated dependencies [ba64877]
- Updated dependencies [e7191ce]
- Updated dependencies [7345308]
- Updated dependencies [79b6a22]
- Updated dependencies [30d96ab]
- Updated dependencies [30d96ab]
- Updated dependencies [f658793]
- Updated dependencies [b1b7d60]
- Updated dependencies [0fd4899]
- Updated dependencies [c95ad19]
- Updated dependencies [e58ea8b]
- Updated dependencies [9a71af3]
- Updated dependencies [4a17645]
- Updated dependencies [3795c5f]
- Updated dependencies [8ab926b]
- Updated dependencies [7317cf2]
- Updated dependencies [e25e839]
- Updated dependencies [5997207]
- Updated dependencies [8b13cc8]
- Updated dependencies [00d8f65]
- Updated dependencies [4a4a35d]
- Updated dependencies [4a4a35d]
- Updated dependencies [86e765a]
- Updated dependencies [1d7e76a]
- Updated dependencies [53dc739]
- Updated dependencies [fd289be]
- Updated dependencies [c3c72a4]
- Updated dependencies [03bf7b1]
- Updated dependencies [7bd6447]
- Updated dependencies [86df0c9]
- Updated dependencies [5a22dd7]
- Updated dependencies [f90e820]
- Updated dependencies [18d816a]
- Updated dependencies [e8bd715]
- Updated dependencies [b91c351]
- Updated dependencies [a28a3c0]
- Updated dependencies [200d255]
- Updated dependencies [2852acc]
- Updated dependencies [daeaaf9]
- Updated dependencies [c459da6]
- Updated dependencies [e914733]
- Updated dependencies [1d8ad0f]
- Updated dependencies [9738c35]
- Updated dependencies [f887e52]
- Updated dependencies [881f8d8]
- Updated dependencies [3bfa1e6]
- Updated dependencies [0a8ebf3]
- Updated dependencies [901355c]
- Updated dependencies [34ce8e7]
- Updated dependencies [8542bd4]
- Updated dependencies [2af5eac]
- Updated dependencies [c34f693]
- Updated dependencies [00ff228]
- Updated dependencies [33681ea]
- Updated dependencies [bfe13c8]
- Updated dependencies [0fb3044]
- Updated dependencies [4635f3e]
- Updated dependencies [fd289be]
- Updated dependencies [ee3595c]
- Updated dependencies [09b4f4e]
- Updated dependencies [b2eab95]
- Updated dependencies [93940d4]
- Updated dependencies [3a04b01]
- Updated dependencies [45b9051]
- Updated dependencies [3954fb7]
- Updated dependencies [4805b56]
- Updated dependencies [b9e9227]
- Updated dependencies [6aea1f5]
- Updated dependencies [d395692]
- Updated dependencies [5894d30]
- Updated dependencies [a3765f6]
- Updated dependencies [2d5cee3]
- Updated dependencies [e22158f]
- Updated dependencies [7404925]
- Updated dependencies [0c2334f]
- Updated dependencies [778c59f]
- Updated dependencies [d2619fd]
- Updated dependencies [af56546]
- Updated dependencies [bd0c5cc]
- Updated dependencies [6acb11a]
- Updated dependencies [33c5fd3]
- Updated dependencies [20b0fdb]
- Updated dependencies [905019b]
- Updated dependencies [a286411]
- Updated dependencies [98c0d33]
- Updated dependencies [368a82e]
- Updated dependencies [a3d5724]
- Updated dependencies [93ea19b]
- Updated dependencies [9ee2dcf]
- Updated dependencies [8cb96ec]
- Updated dependencies [8f10a79]
- Updated dependencies [6269a55]
- Updated dependencies [a17da05]
- Updated dependencies [a8c00e2]
- Updated dependencies [a8fac3a]
- Updated dependencies [22e5236]
- Updated dependencies [0fb8760]
- Updated dependencies [e5ce2ed]
- Updated dependencies [be21955]
- Updated dependencies [bc56e18]
- Updated dependencies [be21955]
- Updated dependencies [a9ee989]
- Updated dependencies [4d0d944]
- Updated dependencies [15d58db]
- Updated dependencies [aaa4e65]
- Updated dependencies [d63b014]
- Updated dependencies [9abe4e4]
- Updated dependencies [2cc7122]
- Updated dependencies [50d6c92]
- Updated dependencies [15d55fb]
- Updated dependencies [9e0ba21]
- Updated dependencies [b8562ff]
- Updated dependencies [311433f]
- Updated dependencies [3a86a65]
- Updated dependencies [3e5ad08]
- Updated dependencies [9abe4e4]
- Updated dependencies [4cda78c]
- Updated dependencies [b7131f3]
- Updated dependencies [e5812fa]
- Updated dependencies [7085f90]
- Updated dependencies [dee4dd4]
- Updated dependencies [ce7e497]
- Updated dependencies [c351a84]
- Updated dependencies [51ecb2f]
- Updated dependencies [9086761]
- Updated dependencies [f6344e7]
- Updated dependencies [42a117b]
- Updated dependencies [1401ae7]
- Updated dependencies [4297fe7]
- Updated dependencies [e398863]
- Updated dependencies [d16df74]
- Updated dependencies [d79c602]
- Updated dependencies [f11fc61]
- Updated dependencies [e808890]
- Updated dependencies [8f79379]
- Updated dependencies [e6ca40e]
- Updated dependencies [0c77ea4]
- Updated dependencies [52954c0]
- Updated dependencies [c5b9ccc]
- Updated dependencies [89eb997]
- Updated dependencies [7131f12]
- Updated dependencies [aa5994e]
- Updated dependencies [be93457]
- Updated dependencies [159e05e]
- Updated dependencies [a65db76]
- Updated dependencies [2cf5a96]
- Updated dependencies [15eb2c9]
- Updated dependencies [5691b07]
- Updated dependencies [8ce628a]
- Updated dependencies [2a6122b]
- Updated dependencies [225e769]
- Updated dependencies [8af88dd]
- Updated dependencies [fb5fbb8]
- Updated dependencies [d7b3963]
- Updated dependencies [33184fd]
- Updated dependencies [7c41693]
- Updated dependencies [b72db01]
- Updated dependencies [dce5cd4]
- Updated dependencies [9688f58]
- Updated dependencies [556ebc1]
- Updated dependencies [177ebdc]
- Updated dependencies [8d237b4]
- Updated dependencies [b003cf2]
- Updated dependencies [2d2e6f0]
- Updated dependencies [2d8dd8d]
- Updated dependencies [22d573e]
- Updated dependencies [b5a2398]
- Updated dependencies [348860c]
- Updated dependencies [5383fa6]
- Updated dependencies [5b3ff63]
- Updated dependencies [356bd71]
- Updated dependencies [878aa2e]
- Updated dependencies [1a6a19c]
- Updated dependencies [064d484]
- Updated dependencies [527e050]
- Updated dependencies [dd33bf9]
- Updated dependencies [4cb2a90]
- Updated dependencies [3f64fe6]
- Updated dependencies [fe72aa5]
- Updated dependencies [bc5156f]
- Updated dependencies [5700d83]
- Updated dependencies [df657d9]
- Updated dependencies [9c7d9d4]
- Updated dependencies [21196cf]
- Updated dependencies [74a7804]
- Updated dependencies [a548550]
- Updated dependencies [53d3689]
- Updated dependencies [b3a63d3]
- Updated dependencies [49f0dcf]
- Updated dependencies [033a34c]
- Updated dependencies [4d25d22]
- Updated dependencies [1ffee51]
- Updated dependencies [5ae4303]
- Updated dependencies [ece4dad]
- Updated dependencies [e9b377e]
- Updated dependencies [146f448]
- Updated dependencies [735f5c7]
- Updated dependencies [a7e18de]
- Updated dependencies [366f895]
- Updated dependencies [dc75ba8]
- Updated dependencies [90ff957]
- Updated dependencies [cce0aa9]
- Updated dependencies [e764507]
- Updated dependencies [cff17af]
- Updated dependencies [39404f3]
- Updated dependencies [ca1965f]
- Updated dependencies [8619f95]
- Updated dependencies [b706af9]
- Updated dependencies [db8c288]
- Updated dependencies [0e5fe7f]
- Updated dependencies [add4360]
- Updated dependencies [e0abc38]
- Updated dependencies [fc9ba76]
- Updated dependencies [1272f0a]
- Updated dependencies [0f94cc7]
- Updated dependencies [a11c1a5]
- Updated dependencies [71f9cd1]
- Updated dependencies [ee17d86]
- Updated dependencies [cdbd920]
- Updated dependencies [18c432e]
- Updated dependencies [3c418c4]
- Updated dependencies [fa8715a]
- Updated dependencies [a933ed7]
- Updated dependencies [b3ca463]
- Updated dependencies [a933ed7]
- Updated dependencies [0d4a6a8]
- Updated dependencies [518d5e5]
- Updated dependencies [6643ba1]
- Updated dependencies [eeba2ef]
- Updated dependencies [ec4c4d2]
- Updated dependencies [424f73c]
- Updated dependencies [cccbe51]
- Updated dependencies [a8d6b1d]
- Updated dependencies [e4a7695]
- Updated dependencies [87075b1]
- Updated dependencies [fc58a99]
- Updated dependencies [14cfc00]
- Updated dependencies [1c6f7b4]
- Updated dependencies [e854a53]
- Updated dependencies [dfebfc8]
- Updated dependencies [598b7ec]
- Updated dependencies [d028b37]
- Updated dependencies [f7b25c5]
- Updated dependencies [122ef38]
- Updated dependencies [4a37870]
- Updated dependencies [428f9b2]
- Updated dependencies [aa7ff56]
- Updated dependencies [811a3c2]
- Updated dependencies [1401ae7]
- Updated dependencies [2fd3f1c]
- Updated dependencies [c41b42e]
- Updated dependencies [e49d988]
- Updated dependencies [d41d166]
- Updated dependencies [c4db311]
- Updated dependencies [750fff5]
- Updated dependencies [c19035e]
- Updated dependencies [ececf7a]
- Updated dependencies [d173125]
- Updated dependencies [8eeca27]
- Updated dependencies [8425c17]
- Updated dependencies [a5ef1d8]
- Updated dependencies [87ad30c]
- Updated dependencies [772d5de]
- Updated dependencies [ce80ec2]
- Updated dependencies [9d7f725]
- Updated dependencies [b372318]
- Updated dependencies [97a2263]
- Updated dependencies [29d0676]
- Updated dependencies [0169d49]
- Updated dependencies [6bd3231]
- Updated dependencies [d2b5ba8]
- Updated dependencies [3c1bbd2]
- Updated dependencies [b799ac5]
- Updated dependencies [8f74307]
- Updated dependencies [d23dc08]
- Updated dependencies [038f333]
- Updated dependencies [644ad50]
- Updated dependencies [9735662]
- Updated dependencies [4d5b4f8]
- Updated dependencies [5d16379]
- Updated dependencies [aa0688a]
- Updated dependencies [0da7cd2]
- Updated dependencies [28a5c3e]
- Updated dependencies [4bc18e5]
- Updated dependencies [9f57f1e]
  - @objectstack/spec@17.3.0
  - @objectstack/objectql@17.3.0
  - @objectstack/platform-objects@17.3.0
  - @objectstack/core@17.3.0
  - @objectstack/types@17.3.0
  - @objectstack/metadata-core@17.3.0
  - @objectstack/formula@17.3.0

## 17.2.0

### Minor Changes

- e222a53: **BREAKING** (compile-time only): twelve logger sink types that declared an
  optional `error` now declare a **non-optional** `warn`, so a durability report
  always has somewhere to land (#9754, #10556).
  
  `minor`, not `major`: during the launch window this stack ships breaking changes
  as `minor` — every publishable package versions in lockstep, so a `major` would
  promote the whole release. `patch` would be wrong in the other direction, because
  this *can* break a consumer's build.
  
  `error` stays optional on every one of these types — hosts legitimately inject
  reduced sinks, and requiring `error` was measured and rejected as #9754 option C.
  What changes is that its *absence* now has a declared, guaranteed destination.
  Call sites keep the `logger?.warn?.(…)` spelling as the backstop for hosts the
  type cannot reach, so **no runtime behaviour changes**: nothing that printed
  before stops printing, and nothing silent starts printing.
  
  ### Who has to change, and what to do
  
  Only a caller that hands one of these sinks an object with **no `warn` method** —
  for example `{ info }` or `{ error }` alone. Add a `warn` member; there is no
  rename, no removal, and no stored value or metadata key to rewrite. Every
  construction site inside this repo already supplied one, so the in-repo cost was
  zero; the compile error is reserved for the callers that were silently discarding
  these reports.
  
  The affected types, by package:
  
  - `@objectstack/cloud-connection` — the internal `PluginContext['logger']`
  - `@objectstack/metadata-protocol` — `IndexMigrationLogger`
  - `@objectstack/plugin-approvals` — the internal `MinimalLogger` of `lifecycle-hooks`
  - `@objectstack/plugin-audit` — `AuthEventAuditLogger`, `ReadAuditLogger`
  - `@objectstack/plugin-auth` — `ReconcileMembershipDeps['logger']`, the internal
    `LoggerLike` of `member-role-canonical`, and `AuthManagerOptions['logger']`
  - `@objectstack/plugin-email` — `ReclaimLogger`, via `ReclaimAttachmentContentOptions`
  - `@objectstack/plugin-reports` — `ReportServiceOptions['logger']`
  - `@objectstack/plugin-sharing` — the internal `MinimalLogger` of `bulk-recompute`,
    `rule-hooks` and `record-share-cascade`
  - `@objectstack/plugin-webhooks` — `OptionalLogger`, via `AutoEnqueuerOptions`
  - `@objectstack/service-knowledge` — `KnowledgeLogger`
  
  `AuthManagerOptions['logger']` is the one most likely to be reached from outside:
  `AuthManager` is public surface, its `logger` option stays optional, and a logger
  that *is* supplied must now carry `warn`. The only non-test construction site in
  this repo passes the kernel `Logger`, whose `warn` is already required.
  
  `ReportService` and `AutoEnqueuer` additionally stopped defaulting their logger
  field to `{}`. The field is now honestly optional rather than holding an empty
  object that declared it could report and discarded everything. Behaviour is
  unchanged in both directions.
  
  <!-- adr-0087: not-required (runtime-interface-only packages/plugins/plugin-auth/src/auth-manager.ts#AuthManagerOptions, packages/plugins/plugin-auth/src/reconcile-membership.ts#ReconcileMembershipDeps, packages/metadata-protocol/src/migrations/partial-index-probe.ts#IndexMigrationLogger, packages/plugins/plugin-audit/src/auth-event-audit.ts#AuthEventAuditLogger, packages/plugins/plugin-audit/src/read-audit.ts#ReadAuditLogger, packages/plugins/plugin-reports/src/report-service.ts#ReportServiceOptions, packages/services/service-knowledge/src/knowledge-service.ts#KnowledgeLogger) every tightened type is a plain TypeScript logger interface -- no Zod projection, no metadata surface, and none is referenced by one -- so `objectstack migrate meta` has nothing to rewrite. Nothing is removed or renamed and no stored value moves; the only consumer action is adding a `warn` member at a construction site the compiler names. -->
- 504c8d5: Materialize the RBAC catalog **per organization**, so a walled deployment can
  administer positions, permission sets and sharing rules again (#10103).
  
  On a walled deployment (`group` / `isolated`) every principal — an organization
  owner and a platform admin alike — listed **zero** positions, permission sets
  and sharing rules while the tables held rows. Nothing could be bound through
  Setup, and a declared `hierarchy-security` could never be armed by an operator
  however loudly an app declared it.
  
  Every row in those three tables was organization-less. plugin-security's Layer 0
  composes a strict `organization_id = :tenant` for a walled posture and the
  middleware ANDs it into the read AST over the driver's
  `(organization_id = :tenant OR organization_id IS NULL)`; the conjunction of the
  two is the strict equality alone, so the driver's null arm was annihilated on
  every authenticated read.
  
  **The wall is not changed, at either layer.** The rows get an owner instead:
  
  - `bootstrapDeclaredPositions`, `bootstrapBuiltinRoles`,
    `bootstrapDeclaredPermissions` (plugin-security) and
    `bootstrapDeclaredSharingRules` (plugin-sharing) upsert by
    `(name, organization_id)` and run **one pass per organization** under a walled
    posture — the framework built-ins (`platform_admin`, `org_*`, `everyone`,
    `guest`) included, matching `sys_user_position`, which is already
    per-organization, and matching both objects' own `unique: 'organization'` name
    index.
  - Seeding also fires on **organization creation**, not only at `kernel:ready`, so
    a tenant created after startup does not administer an empty catalog until the
    next restart.
  - `single` posture is **unchanged**: exactly one organization-less pass, which is
    the correct shape there.
  
  An organization-less row is now invalid state under a walled posture. Nothing is
  reaped — grants (`sys_user_position`, `sys_position_permission_set`,
  `sys_user_permission_set`, `sys_record_share`) point at these rows by id, so
  deleting them would revoke standing access with no signal at the moment of loss.
  Instead a per-organization pass that meets pre-fix organization-less rows for
  names it seeds **says so loudly**, naming the rows and the remedy, and still
  creates that organization's own copies. The failure this closes is the silent
  no-op: a tenant-threaded pass that sees the old row through the driver's
  compatibility arm, reads the name as already represented, and creates nothing
  while reporting success.
  
  Two enforcement-plane reads are scoped in the same change, because the exposure
  they carry only exists once per-organization copies exist:
  
  - `resolveUserAuthzContext`'s position name-sweep (`@objectstack/core`) resolved
    `sys_position` by name across **every** organization, so the junction read
    behind it collected another organization's `everyone` binding — a cross-organization
    grant bleed, and an O(organizations) read on the per-request path. It is now
    threaded through the driver's tenant chokepoint, keeping per-request resolution
    O(the caller's own organization's catalog).
  - plugin-security's permission-set `dbLoader` resolved sets by name unscoped,
    with a `limit` equal to the number of names — correct while one row existed per
    name, a truncation the moment copies exist. It is now scoped to the caller's
    organization and its bound widened.
  
  Boot reconciliation is O(changed declarations): each pass reads what its
  organization already has and writes only where a declaration actually differs, so
  the common boot performs no writes at all. Steady state rides the
  organization-creation hook.
  
  Cross-links #10119 / PR #10422, whose criteria-sweep scoping makes per-organization
  sharing rules cheaper than the unscoped sweep they replace.

### Patch Changes

- df287e6: Put `plugin-sharing`'s shared `{ info?, warn? }` logger contract on the precise
  member signature and absorb the third module onto it (#10692). Internal types
  only — no local `MinimalLogger` was ever exported, so there is no published
  surface change and no runtime behaviour change.
  
  `OptionalSharingLogger` in `logger-shapes.ts` shipped with the loose spelling
  `(msg: any, ...rest: any[]) => void`, inherited from the two byte-identical
  declarations it replaced. Its members are now spelled
  `(msg: string, meta?: Record<string, any>) => void`, and
  `sharing-rule-provenance.ts` — which already declared exactly that stricter
  signature under its own local `MinimalLogger` — now imports the shared type
  instead of declaring a seventh copy.
  
  That direction was chosen deliberately over unifying on the loose spelling.
  `(msg: any, ...rest: any[])` documents nothing and catches nothing, which is the
  same complaint this card levels at bare `Function`; folding the stricter module
  onto it would have deleted real checking to buy uniformity. Taking the precise
  spelling instead tightens the two modules that were already on the shared type,
  and buys arity and type checking at all 12 in-module call sites — every one of
  which already passes exactly a string message plus an optional metadata object.
  
  Caller cost is zero: every caller of the three affected binders passes
  `ctx.logger as any` or `undefined`, so no caller constrains the signature.
  
  `check:optional-error-sink` (#9754) membership is unchanged and was verified
  before and after: 37 sinks declare `error`, 12 required, 23 optional beside a
  required `warn`, 2 permit silence, 2 baselined. The shared shape still declares
  no `error` and must not grow one — that would enrol every module using it into
  that gate's population, which is a contract decision for the #10556 family
  rather than a side effect of de-duplication.
  
  `record-orphan-cleanup.ts`'s bare-`Function` members are deliberately untouched:
  tightening them requires tightening two publicly exported option types first,
  which moves that gate's population and remains open on #10692.
- 93304c2: Collapse the two byte-identical `MinimalLogger` declarations in `plugin-sharing`
  onto one shared `OptionalSharingLogger` (#10692). Internal types only — none of
  the seven local `MinimalLogger` interfaces was exported, so no published surface
  and no runtime behaviour changes.
  
  `plugin-sharing/src` declared **seven** module-local interfaces all named
  `MinimalLogger`. The duplication was not the defect; divergence under one name
  was. When #10556 made `bulk-recompute.ts`'s `warn` non-optional, `tsc` reported
  the forwarding modules as:
  
  ```
  Type 'MinimalLogger' is not assignable to type 'MinimalLogger'.
    Two different types with this name exist, but they are unrelated.
  ```
  
  `bu-tree-recompute.ts` and `primary-bu-projection.ts` were byte-identical, so
  they now share one declaration in `logger-shapes.ts`. The new type is
  deliberately given a DIFFERENT name: the next forwarding edge added between it
  and a module that still declares its own `MinimalLogger` produces a diagnostic
  naming two different types, instead of the same name twice.
  
  The other five declarations are left alone, each for a stated reason recorded in
  `logger-shapes.ts`. Three are genuinely different contracts (`bulk-recompute.ts`
  is the guaranteed sink; `rule-hooks.ts` and `record-share-cascade.ts` require
  `warn` because they forward into it). Two are *not* the cheap unification the
  card assumed:
  
  - `sharing-rule-provenance.ts` is `{ info?, warn? }` by optionality but carries a
    stricter member signature, `(msg: string, meta?: Record<string, any>)`.
    Folding it onto the `(msg: any, ...rest: any[])` spelling would delete real
    checking; folding the others onto its spelling would tighten two modules.
  - `record-orphan-cleanup.ts`'s bare `Function` members **cannot** be tightened
    here: `Function` is not assignable to any concrete signature ("Type 'Function'
    provides no match for the signature"), and the two loggers handed to it —
    `SharingServiceOptions['logger']` and `ShareLinkServiceOptions['logger']` —
    are themselves spelled with bare `Function`.
  
  `check:optional-error-sink` (#9754) membership is unchanged and was verified
  before and after: 37 sinks declare `error`, 2 permit silence, 2 baselined. The
  shared shape declares no `error` and must not grow one — that would enrol every
  module using it into that gate's population, which is a contract decision for
  the #10556 family rather than a side effect of de-duplication.
- bc400af: **Behaviour change (narrowing):** an **org-stamped** sharing rule's criteria sweep is now scoped to that rule's own organization, where it previously swept **every** organization's records (#10119).
  
  `SharingRuleService.findMatchingRecords` (the whole-rule evaluation pass) and `recordMatches` (the per-record write-hook pass) ran the rule's criteria query under a bare system context carrying no tenant, for every rule. The recipient half was already org-aware — `expandRecipient` threads `rule.organization_id` into the team / business-unit / position graph services — so a rule stamped with an `organization_id` expanded recipients inside its own organization and then matched records belonging to all the others. `reconcile` materialized the cross product: `sys_record_share` rows granting one organization's users access to another organization's records.
  
  Measured on `main` before the change, through a real `ObjectQL` on a real `SqlDriver`: an `org_a`-stamped rule matched **the same four records as a platform-global rule** (`deal_a1`, `deal_b1`, `deal_b2`, `deal_p1`) and materialized a grant on each; the per-record hook pass minted a grant on `org_b`'s record with `grantsCreated: 1`.
  
  What changes, and for whom:
  
  - **Org-stamped rules** (`organization_id` non-null — what any org admin mints through `defineRule`) now run their criteria query with `tenantId` set to the rule's organization. The platform's existing chokepoint does the rest: `ObjectQLEngine.buildDriverOptions` threads it to `DriverOptions.tenantId` and `SqlDriver.applyTenantScope` emits `(organization_id = ? OR organization_id IS NULL)`. So such a rule matches its own organization's records **plus** platform-owned null-org records, and no other tenant's. `SharingRuleEvaluationResult.matchedRecords` falls accordingly, and the next reconcile pass **revokes** the cross-org `sys_record_share` rows it previously created, through the existing revoke-the-remainder branch — no migration is needed.
  - **Platform-global rules** (`organization_id = null`) are unchanged: they keep the full unscoped sweep, which is their declared behaviour (documented at the `deleteRule` platform-authority guard). Both directions are pinned.
  - **No public contract changes.** No schema, route, error code or accept/reject set moves; the system elevation on the criteria read is retained (the evaluator still sees rows no individual recipient could), only the tenant axis is added.
  
  The cross-org rows this stops creating were **inert** under a walled posture — the Layer-0 tenant wall AND-composes over sharing's Layer-1 widening, so such a grant could not open a read across the wall. The costs were `sys_record_share` bloat (every org-stamped rule scanning the whole table at `limit: 5000`) and a population that is wrong at rest, which any consumer reading `sys_record_share` directly, or any future softening of the wall, would inherit.
- Updated dependencies [8f04d9a]
- Updated dependencies [6936d07]
- Updated dependencies [59eb04d]
- Updated dependencies [9f05b7d]
- Updated dependencies [7d483e1]
- Updated dependencies [530c1df]
- Updated dependencies [3b2af5e]
- Updated dependencies [7d2d112]
- Updated dependencies [5fa0d72]
- Updated dependencies [8cc8401]
- Updated dependencies [02b3b07]
- Updated dependencies [2570ab0]
- Updated dependencies [95437e7]
- Updated dependencies [d23e3a0]
- Updated dependencies [f3a8134]
- Updated dependencies [46d34ab]
- Updated dependencies [914c413]
- Updated dependencies [55809a0]
- Updated dependencies [ee2ff45]
- Updated dependencies [47cd3ec]
- Updated dependencies [1048500]
- Updated dependencies [52db1d1]
- Updated dependencies [5649efb]
- Updated dependencies [9d7d2de]
- Updated dependencies [c815c50]
- Updated dependencies [795ea05]
- Updated dependencies [2306a76]
- Updated dependencies [e5ea701]
- Updated dependencies [26f3588]
- Updated dependencies [a40dcc1]
- Updated dependencies [def0d3e]
- Updated dependencies [8d0bb79]
- Updated dependencies [5acb58d]
- Updated dependencies [2e3cf95]
- Updated dependencies [4c93387]
- Updated dependencies [d728325]
- Updated dependencies [504c8d5]
- Updated dependencies [a037f7c]
- Updated dependencies [3ee8ddf]
- Updated dependencies [16cef97]
- Updated dependencies [a79bd35]
- Updated dependencies [6ceaa4b]
- Updated dependencies [15ea214]
- Updated dependencies [de19489]
- Updated dependencies [c684d00]
- Updated dependencies [d29e271]
- Updated dependencies [923c424]
- Updated dependencies [0ab81d1]
- Updated dependencies [1ec36b7]
- Updated dependencies [5f2e54c]
- Updated dependencies [189373b]
- Updated dependencies [35ad101]
- Updated dependencies [ceb33a9]
- Updated dependencies [dccbcec]
- Updated dependencies [05bc692]
- Updated dependencies [73d9795]
- Updated dependencies [8012960]
- Updated dependencies [266654d]
- Updated dependencies [f34f56b]
- Updated dependencies [f399618]
- Updated dependencies [75e9301]
- Updated dependencies [f334d66]
- Updated dependencies [2810695]
  - @objectstack/platform-objects@17.2.0
  - @objectstack/spec@17.2.0
  - @objectstack/objectql@17.2.0
  - @objectstack/core@17.2.0
  - @objectstack/metadata-core@17.2.0
  - @objectstack/types@17.2.0
  - @objectstack/formula@17.2.0

## 17.1.0

### Minor Changes

- 04d03c3: fix(security): a deactivated `sys_position` stops conferring sharing-rule record shares (#8710)
  
  <!-- adr-0087: not-required (no-migration-prescription) Nothing authorable
  changes. `active` is a ROW property of a `sys_position` record, not a key on any
  `packages/spec` schema, and no exported surface, stored metadata shape or
  recipient vocabulary is added, renamed or retired. The change is a runtime read
  at one call site inside `SharingRuleService`; the remedy for an affected
  deployment is operational (re-activate a position whose shares are still meant
  to flow), not a metadata migration. -->
  
  **BREAKING for deployments that already deactivated a position named as a
  sharing-rule recipient.** Their `sys_record_share` rows are revoked on the next
  evaluation of that rule.
  
  #8613 made `sys_position.active` real at the authorization DERIVATION seam: a
  deactivated position stops carrying its permission sets and its name leaves
  `context.positions`. A sharing rule reaches users by a **second road that never
  passes that seam** — `SharingRuleService.expandRecipient` → `PositionGraphService`
  — so a rule sharing records with `cfo` kept sharing them after `cfo` was
  deactivated, while the `deactivate_position` dialog promises, unqualified:
  
  > Deactivate this position? Users keep their assignment but the position stops
  > granting permissions until re-activated.
  
  A record share is access, so the promise covers it. Maintainer ruling,
  2026-08-15, verbatim: **"Access-conferring paths filter deactivated positions;
  addressing paths do not."**
  
  **What changes at runtime.** When a sharing rule's recipient is a position, the
  evaluator reads the `sys_position` catalogue row and, if it is explicitly
  deactivated, the rule expands to **nobody**:
  
  - no new shares are materialised for that position's holders;
  - the shares it had already materialised are **revoked** on the next
    reconcile — by `evaluateRule`, by the per-record hook pass, and by the
    synchronous recipient-axis revoke (#7729) — because a rule that confers
    nothing has an empty desired set and every existing grant is stale;
  - the verdict is read with `isRowActive` (`@objectstack/core`), the same
    predicate #8613 established, so the 1/0 and `'false'` storage shapes every
    driver produces are judged identically.
  
  This is **not** a refactor and **not** a no-op: it changes who receives record
  shares.
  
  **What deliberately does NOT change**, per the same ruling:
  
  - **approval ROUTING** keeps reading the raw directory — filtering there is
    fail-OPEN (an approval step routing to nobody), #8613's carve-out, reaffirmed;
  - **write gates and blast-radius reads** (`assertAudienceAnchorBindingGate`,
    `setsBoundToPosition`, the delegated-admin surfaces) stay unfiltered, because
    dropping a deactivated row there would make a refused binding permitted and
    narrow a delegate's boundary — access *widening*;
  - `PositionGraphService.expandPositionUsers`, the ADDRESSING primitive, is
    untouched: the filter is at the sharing call site, so moving it down into the
    helper would take the paths above with it. A pin fails if it ever does.
  
  **Rows that keep granting exactly as before:** a position whose `active` column
  is absent or NULL (the predicate is "explicitly deactivated", never "explicitly
  active"), a recipient name with no `sys_position` row at all (the
  `sys_member.role` transition source of ADR-0057 D4), and a position whose
  same-name row was deactivated in *another* organization — `sys_position.name` is
  unique per organization (#8468), so the flag is read off this rule's own
  tenant's row.
  
  **Cost.** One `sys_position` read per distinct position per evaluator pass,
  memoised for that pass only (a memo outliving the pass would make a deactivation
  take effect late). The ruling accepted the extra read explicitly; the sibling
  seam in #8613 needed none because both tables were already at hand there.
  
  **Before upgrading**, list the deactivated positions and check whether any is a
  sharing-rule recipient whose shares are still meant to flow — re-activate those,
  or move the grant onto the rule:
  
  ```
  GET /api/v1/data/sys_position?filters=[["active","=",false]]
  GET /api/v1/data/sys_sharing_rule?filters=[["recipient_type","=","position"]]
  ```
- f8537df: A write refused because a federated object's `owner_id` is the platform's phantom anchor now says so, once per object (#8418).
  
  **No verdict changes.** `checkEdit` / `checkDelete` stay fail-closed exactly as shipped — this adds a diagnostic and nothing else. Maintainer ruling 2026-08-13 (option C on #8418): keep `deny`, make the refusal visible.
  
  What was wrong: on an ADR-0015 federated object with no author-declared `owner_id`, the registry injects the anchor but the platform provisions no column behind it, so the ownership fast path selects `owner_id` off a remote table that does not have it. The SQL driver's recovery ladder DISCARDS a projection naming an unresolvable column and re-runs `select('*')` instead of raising — so `matchesOwnerScope` receives a good row that simply has no `owner_id` key, reads `owner == null`, and refuses. Because nothing threw, `writeGateFailClosed` was never reached and **nothing was logged anywhere**: the operator got a bare 403 with no trace, at every write depth (`org` included — the null-owner short-circuit runs before the scope is consulted). Only a `modifyAllRecords` holder could still write.
  
  `SharingService` now emits `PHANTOM_ANCHOR_WRITE_DENY_NOTICE` at `warn` on that path, naming the object, the owner field and the caller, with both remedies in the wording: declare the real remote owner column, or move the object off an owner-scoped sharing model. The constant is exported so a deployment can match on it.
  
  Deduped **per object**, for the service's lifetime. The condition is a property of the registered schema, identical for every row and every caller, so a bulk write emits one line rather than one per row and one misconfiguration is not multiplied by the principal count.
  
  It fires only on the phantom anchor, never on an ordinary owner-less row: the discrimination is `hasPhantomOwnerAnchor` provenance (is this `owner_id` the platform's injected constant, or a column the author declared?), not `owner == null` and not an `external` test. A federated object with a real declared remote owner column keeps scoping normally and stays silent.
  
  The diagnostic cannot cost a write — it returns `void`, its caller ignores it, and a throwing logger is swallowed, so no ordering of schema lookup, latch and logger can move a verdict.
  
  Also corrected in passing: this package attributed the driver's non-throwing unknown-column recovery to **SQLite specifically**. That understated it — the projection rung is gated by the driver's single shared `isUnresolvableColumnError` predicate, which spells all three dialects it speaks (`no such column`, `column … does not exist`, and since #8926 `Unknown column '…'`), so the silent refusal reproduced on every supported dialect. Wording only; no driver change.

### Patch Changes

- 4ea921c: Repair the ADR-0090 `sys_role` → `sys_position` rename in the es-ES object
  translation bundles, and guard it mechanically.
  
  The rename half-landed in Spanish: an unreviewed substring find-replace produced
  two non-words (`Puestoes` as the plural of `Puesto`, and `contpuesto` where the
  replace ate the unrelated word `control`), while nine further leaves in
  `plugin-security` and three in `plugin-sharing` were missed entirely and still
  named the pre-rename concept. In `plugin-sharing` the same picklist key rendered
  two different ways in one file — `position` was `Puesto` on the sharing rule and
  `posición` on the record share, and `unit_and_subordinates` read `Rol y
  subordinados` (naming the removed role concept) against `Unidad de negocio y
  subordinados` on its sibling.
  
  Spanish-facing admins saw `Puestoes` as the object's plural label in navigation
  and list views, and two different words for one recipient kind across two Setup
  screens.
  
  Two regression guards now cover the classes involved: a malformed-compound and
  stale-term check on the renamed security objects, and a self-consistency check
  asserting that a picklist option key shared by several sharing objects renders
  identically within a locale. Neither needs a reader of the locale to review it.
- b705a6c: Repair the ADR-0090 `sys_role` → `sys_position` rename in the ja-JP object
  translation bundle, and extend the mechanical guard to cover it.
  
  `sys_record_share.fields.recipient_id.help` still read "...ユーザー/グループ/ロールの
  ID" — naming the pre-rename `role` concept — while the same bundle already
  rendered the renamed concept correctly, twice, as `ポジション`
  (`recipient_type.options.position` on both sharing objects), and the English
  source for this exact leaf says `position`. Japanese-facing admins saw the
  stale word in the Setup field-help tooltip for Record Share's `Recipient` field.
  
  `recipient-vocabulary-consistency.test.ts` (added when the es-ES half of this
  same rename damage was repaired) now asserts a ja-JP stale-term rule alongside
  the existing es-ES one, generalised into one per-locale table so a future
  locale's rule is one entry, not a parallel `describe` block. The ja-JP pattern
  excludes `ロールアップ` (rollup) and `ロールバック` (rollback) by lookahead rather
  than `\b`, which does not bound katakana in JS regex (`\w` is ASCII-only) and
  would otherwise match nothing at all.
- fab693b: fix(sharing): `publicSharing.eligibility` binds declared fields through the canonical `materializeDeclaredFields` instead of a local copy (#8489)
  
  `share-link-service.ts` carried its own `bindDeclaredFields` — a hand-written
  mirror of `@objectstack/objectql`'s `materializeDeclaredFields`, named as a copy
  in its own doc comment. It is retired; `assertEligible` now imports the
  canonical helper from `@objectstack/objectql/core` (already a runtime dependency
  of this package), with a spread at the call site because the canonical
  materialises in place.
  
  **This changes eligibility verdicts on exactly one row shape**, and the change
  was accepted knowingly (maintainer ruling, 2026-08-16). The retired mirror bound
  a declared field by key PRESENCE (`!(name in record)`); the canonical binds by
  VALUE (`record[name] === undefined`). They agree on every other input class,
  including a missing or malformed `fields` map, where both return the record
  untouched. Where they differ is a declared field held as an own key whose value
  is `undefined` — a shape `InMemoryDriver` measurably produces (an explicit
  `undefined` on `create` survives to `find`) and `SqlDriver` structurally cannot
  (a SQL NULL arrives as `null`).
  
  On that shape only, with a declared `status`:
  
  | eligibility predicate         | before                         | after                    |
  |:------------------------------|:-------------------------------|:-------------------------|
  | `record.status == null`       | 422 `ELIGIBILITY_UNEVALUABLE`  | **link is minted**       |
  | `has(record.status)`          | 422 `RECORD_NOT_ELIGIBLE`      | **link is minted**       |
  | `!has(record.status)`         | **link was minted**            | 422 `RECORD_NOT_ELIGIBLE` |
  | `record.status == 'published'`| 422 `ELIGIBILITY_UNEVALUABLE`  | 422 `RECORD_NOT_ELIGIBLE` |
  
  The first two rows widen acceptance: the predicate is now *answered* rather than
  faulting on a key CEL reads as absent, and on this fail-closed gate a fault was a
  refusal. The third row is the one that mattered for the decision — it **closes an
  over-acceptance**. `has()` guards an UNDECLARED key and never an empty value once
  bindings are materialised, so `!has(record.<declared field>)` is false; the
  mirror was minting share links there that every other server-side surface
  refuses. The fourth row keeps its direction and changes only its ADR-0112 `code`.
  
  The eligibility pin is rewritten to discriminate (#9085): its previous
  declared-field case passed with the binder fully ablated, because every seeded
  row carried the field it claimed was absent. The replacements use a declared
  field the stored row genuinely does not carry, and fail in opposite directions
  under ablation.
- b53d38e: fix(plugin-sharing): stamp the filter-subtree provenance mark at the read merge, so an author's own cross-field refusal stops being redacted on the sharing-composed path (#8430)
  
  `#8220` declared the filter-subtree provenance mark and set it at two read-scope
  merge boundaries — `plugin-security`'s CRUD injection and `service-analytics`'
  `withReadScope`. `plugin-sharing`'s read path is a **third**: on every read it
  AND-composes an OWD / record-share visibility filter into `ast.where`, and it
  stamped nothing.
  
  Two marks, and they are not the same job:
  
  - **the scopes it injects are marked `'policy'`** — the OWD/record-share read
    filter, the delegator's intersected filter (ADR-0090 D10) and the
    `sys_record_share` self-scope (ADR-0111 D5). **No behaviour change**: an
    unmarked subtree already withheld, so these refusals kept the `#7929`
    redaction before and keep it now. What changes is that the withhold becomes a
    *declared* verdict instead of an accident of the mark's absence — which
    matters because an unmarked node **inherits its ancestor's mark positionally**
    (`resolveFilterSubtreeProvenance`, innermost wins), so an unmarked policy arm
    nested inside a vouched subtree would read as the author's.
  - **the caller's own predicate is vouched `'author'`** immediately before the
    rewrite that would otherwise make it unrecognisable to every later boundary.
    This is the one user-visible change: an author's own `{ $field }` refusal on
    an object with active sharing again names its columns, its operator and its
    reason, instead of the redacted "operands withheld" text.
  
  **The vouch is an identity check, not a heuristic.** The mark is stamped only
  while `ast.where` is still, by object identity, the `where` the caller handed
  the engine. If a sibling middleware already composed into it, or the engine
  rewrote it resolving filter tokens, identity fails and **nothing** is vouched —
  the tree stays unmarked, and unmarked withholds. The arms of a pure
  `{ $and: [ … ] }` root are vouched too, because `composeAnd`'s flattening branch
  spreads that root's arms into a new object and would otherwise drop the vouch
  out of the tree with it (that shape is what the array authoring form lowers to,
  so it is the common case, not an edge one).
  
  **Fail-closed is unchanged in every direction**, and the pins say so at a real
  `SqlDriver`: the injected scope still withholds, a policy arm sitting beside an
  author-vouched arm in the same `$and` still withholds, and a predicate no
  boundary ever vouched still withholds byte-identically to the policy case.
  
  **The write path is untouched.** `buildWriteFilter`'s composition is a different
  question with different consequences and was not declared by `#8220`.
  
  Measured while implementing, and worth recording because the card says
  otherwise: in a stack that composes **both** plugins, the author vouch was
  already surviving. `plugin-security` is registered before `plugin-sharing` on
  both real boot paths and `resolvePluginOrder` preserves insertion order, so
  security vouches first and its mark — which lives on the caller's object —
  travels through this composition untouched. The gap this fixes is a stack that
  mounts `plugin-sharing` **without** `plugin-security`, where nothing else can
  vouch for the caller.
- Updated dependencies [56656aa]
- Updated dependencies [c9f5950]
- Updated dependencies [d6e80b2]
- Updated dependencies [07e630e]
- Updated dependencies [66beee0]
- Updated dependencies [2f65b1b]
- Updated dependencies [720ee95]
- Updated dependencies [f287435]
- Updated dependencies [2782805]
- Updated dependencies [e43d63a]
- Updated dependencies [e374b4d]
- Updated dependencies [9aa8890]
- Updated dependencies [7c9c1dd]
- Updated dependencies [03520eb]
- Updated dependencies [a751f7d]
- Updated dependencies [eccb8b2]
- Updated dependencies [650cd3d]
- Updated dependencies [b735507]
- Updated dependencies [91c6c28]
- Updated dependencies [75b7c24]
- Updated dependencies [d5552ca]
- Updated dependencies [d9813a9]
- Updated dependencies [8640fb2]
- Updated dependencies [2420641]
- Updated dependencies [2ad91c3]
- Updated dependencies [f57fb38]
- Updated dependencies [00777a0]
- Updated dependencies [d491625]
- Updated dependencies [2d0af57]
- Updated dependencies [420804d]
- Updated dependencies [716ac9b]
- Updated dependencies [a38408a]
- Updated dependencies [62b1427]
- Updated dependencies [7ea1372]
- Updated dependencies [23abe27]
- Updated dependencies [985a9cd]
- Updated dependencies [5f5e234]
- Updated dependencies [a8189ae]
- Updated dependencies [26e70fb]
- Updated dependencies [27a567d]
- Updated dependencies [42b05af]
- Updated dependencies [2b292ce]
- Updated dependencies [abcf853]
- Updated dependencies [8b9eba5]
- Updated dependencies [d575779]
- Updated dependencies [94f7ef8]
- Updated dependencies [c5ac5e4]
- Updated dependencies [a777944]
- Updated dependencies [dd88e1c]
- Updated dependencies [856527c]
- Updated dependencies [870f710]
- Updated dependencies [79c46da]
- Updated dependencies [7ff3975]
- Updated dependencies [29d055b]
- Updated dependencies [65589d6]
- Updated dependencies [2c86fe3]
- Updated dependencies [e196c6a]
- Updated dependencies [24173e9]
- Updated dependencies [4ab7523]
- Updated dependencies [19539b4]
- Updated dependencies [f8eb736]
- Updated dependencies [11b779e]
- Updated dependencies [4e71ae1]
- Updated dependencies [739fe5b]
- Updated dependencies [4bfe1a5]
- Updated dependencies [2065e31]
- Updated dependencies [b69d0f5]
- Updated dependencies [4d47afe]
- Updated dependencies [e4e5c6e]
- Updated dependencies [4dfa369]
- Updated dependencies [9a56784]
- Updated dependencies [d00d2f6]
- Updated dependencies [df0c12d]
- Updated dependencies [d31785f]
- Updated dependencies [c308a4f]
- Updated dependencies [5e2f594]
- Updated dependencies [e2899f6]
- Updated dependencies [b6c7690]
- Updated dependencies [855591f]
- Updated dependencies [3851f87]
- Updated dependencies [845e164]
- Updated dependencies [2a29caa]
- Updated dependencies [09a6eee]
- Updated dependencies [1a7f907]
- Updated dependencies [cd455c8]
- Updated dependencies [e1bb0ca]
- Updated dependencies [326f5de]
- Updated dependencies [30d3752]
- Updated dependencies [21995d7]
- Updated dependencies [c80e7ae]
- Updated dependencies [09a9a8a]
- Updated dependencies [07026cf]
- Updated dependencies [5d4f3d5]
- Updated dependencies [4d80e8b]
- Updated dependencies [6a5e6ad]
- Updated dependencies [30b1c63]
- Updated dependencies [7fc01db]
- Updated dependencies [079b457]
- Updated dependencies [e43b211]
- Updated dependencies [890b38f]
- Updated dependencies [8bee54b]
- Updated dependencies [04f8fdb]
- Updated dependencies [7a537ce]
- Updated dependencies [593c4bf]
- Updated dependencies [b2a451f]
- Updated dependencies [6158146]
- Updated dependencies [84cb121]
- Updated dependencies [ca19ee8]
- Updated dependencies [a675b4d]
- Updated dependencies [b887013]
- Updated dependencies [ff08691]
- Updated dependencies [60e0f90]
- Updated dependencies [90c5285]
- Updated dependencies [402c125]
- Updated dependencies [7901b2d]
- Updated dependencies [7c2f386]
- Updated dependencies [56bca91]
- Updated dependencies [b3f9831]
- Updated dependencies [79394d7]
- Updated dependencies [730fd9a]
- Updated dependencies [8a9e7f4]
- Updated dependencies [3d0ded8]
- Updated dependencies [44bc51d]
- Updated dependencies [bbbfcfc]
- Updated dependencies [1258dca]
- Updated dependencies [4639cec]
- Updated dependencies [91c4ff5]
- Updated dependencies [73cfddf]
- Updated dependencies [d634e66]
- Updated dependencies [682b86b]
- Updated dependencies [6a1b45e]
  - @objectstack/spec@17.1.0
  - @objectstack/platform-objects@17.1.0
  - @objectstack/types@17.1.0
  - @objectstack/core@17.1.0
  - @objectstack/objectql@17.1.0
  - @objectstack/metadata-core@17.1.0
  - @objectstack/formula@17.1.0

## 17.0.0

### Major Changes

- 4b6cac7: feat(spec)!: resolve the three cross-form dual-source names — ShareRecipientType, TransformType, suggestFieldType (#4539)

  Three `dual-source-exports.baseline.json` rows where the two declarations
  sharing a name did not even share a FORM (type vs const, or two unrelated
  functions), so a wrong import-path pick had no shape overlap to hide behind
  and failed far from the cause. Each judged against a three-repo import-level
  scan (framework, cloud, objectui — the latter two contained zero references
  to all three names). All three rows are deleted from the baseline.

  **Renamed — `./contracts` `ShareRecipientType` → `RecordShareRecipientType`:**

  Two live concepts shared the name. The security zod enum
  (`user | team | position | unit_and_subordinates | business_unit`) is the
  authorable sharing-RULE recipient vocabulary and keeps the name. The contracts
  type describes a different thing — the `recipient_type` a `sys_record_share`
  ROW may carry — and its claim to "mirror spec/security" had been false since
  `group`→`team`/`guest` were retired there. Its member set is now aligned to
  the storage-side gate it actually mirrors, the `SysRecordShare`
  `recipient_type` select: `role` (never persistable, zero producers) is
  replaced by `position`. Only `user` is enforced (and written) today;
  `ISharingService.grant` keeps refusing every other value (ADR-0078).
  Fix: `import type { ShareRecipientType } from '@objectstack/spec/contracts'`
  (or from `@objectstack/plugin-sharing`, whose re-export is renamed in
  lockstep) → `RecordShareRecipientType`; code that named the `'role'` member
  was describing a value no row could ever hold — use the rule vocabulary
  (`SharingRuleRecipientType`) if a role recipient was meant.

  **Renamed — `./shared` `TransformTypeSchema` / `TransformType` →
  `FieldMappingTransformSchema` / `FieldMappingTransform`:**

  `./data`'s `TransformType` (the authorable import-mapping enum
  `none | constant | lookup | split | join | javascript | map`) is the live
  declaration and keeps the name. `./shared` exported `TransformType` as the
  inferred type of `TransformTypeSchema` — a differently-shaped discriminated
  union of transform CONFIG objects — with zero importers for either name in
  all three repos. The shared pair is renamed (not just the alias deleted):
  the docs generator derives `import type { X }` examples by stripping
  `Schema` from each schema const, so an alias-less `TransformTypeSchema`
  would have kept generating a reference to an export that no longer exists.
  Fix: `TransformTypeSchema` → `FieldMappingTransformSchema`,
  `import type { TransformType } from '@objectstack/spec/shared'` →
  `FieldMappingTransform` (same shape); importers who meant the import-mapping
  enum import `TransformType` from `@objectstack/spec/data`.

  **Renamed — `./data` `suggestFieldType` → `suggestFieldTypeForSqlType`:**

  The only function-kind dual-source. The two implementations were never forks
  of one function — different signatures, semantics and return types:
  `shared/suggestions.zod.ts` (kept on `.` / `./shared` under the original
  name) is the typo-suggester for an invalid authored FieldType
  (`(input: string) => string[]`, alias table + Levenshtein, feeds the zod
  error map), while `data/type-compat.ts` is the deterministic SQL-column →
  FieldType mapper for external-datasource drafts
  (`(rawType, dialect?) => FieldType | undefined`, ADR-0015 §4.6). Same input,
  divergent outputs — `('varchar(255)')` → `[]` vs `'text'`; `('text_area')` →
  `['textarea']` vs `undefined`; `('int')` → `['number']` vs `'number'` — and
  the wrong pick compiled wherever the result was only truthiness-checked
  (`[]` is truthy). Behavioral divergence is now pinned in
  `data/type-compat.test.ts`.
  Fix: `import { suggestFieldType } from '@objectstack/spec/data'` →
  `suggestFieldTypeForSqlType` (same signature); imports from the root entry
  or `./shared` are unaffected.

### Minor Changes

- 1ea6bce: feat(sharing): hierarchy managers may manage shares within their write DEPTH (ADR-0111 D1 DEPTH)

  `canManageShares` gains its named DEPTH extension: a caller whose effective
  WRITE scope on the object is a hierarchy scope (`unit` / `unit_and_below` /
  `own_and_reports`) may now manage shares on a record whose owner falls within
  that scope's owner set — the same set the write filter and `canEdit` already
  honour, resolved by the enterprise `hierarchy-scope-resolver`. This lets a
  manager grant/revoke/list shares on a subordinate's record, matching
  Salesforce (roles above the owner) and Dataverse (the `Share` privilege's BU
  depth), without expanding the MVP owner + Modify-All authority.

  - New `ISecurityService.resolveWriteScope(object, context)` — the effective
    write scope, resolved by the same evaluator the CRUD middleware uses; fails
    closed to `own`. Mirrored on the sharing plugin's structural probe.
  - The gate honours only the three hierarchy scopes. `org` from the probe is
    deliberately ignored: it means both a genuine Modify-All holder (already
    granted via `hasWriteBypass`) AND the fail-OPEN "no permission set mentions
    this object" default, so honouring it here would reopen the hole
    `hasWriteBypass` was chosen to avoid.
  - Fails closed with no security service or no enterprise resolver — the open
    edition stays owner + Modify-All, exactly as before.

- e5e8b10: feat(sharing): a record's share-manager may revoke any share-link on that record (ADR-0111 D8)

  `ShareLinkService.revokeLink` was creator-or-system only, so a record's owner or
  a Modify-All admin could not kill a link someone else minted on their record —
  their record's exposure, but not their link to revoke. Revoke authority now
  also admits a record **share-manager**, probed via the sharing service's
  late-bound `canManageShares` (owner / `modifyAllRecords`). The probe fails
  closed: a deployment without it (or a throwing probe) keeps the pre-D8
  creator-only behaviour. Mint authority is unchanged and now documented as the
  D8 decision it always enforced — the object's `publicSharing` opt-in AND the
  caller's visibility of the record.

- c1dcacd: fix(sharing)!: the share-management surface gains the authorization layer it never had (ADR-0111 P0, #3902)

  Record sharing shipped as a data layer with no authorization of its own: every
  `/data/:object/:id/shares` and `/sharing/rules` route authenticated the caller
  and then ran the service under `SYSTEM_CTX` — any signed-in user could revoke
  anyone's share, enumerate who-can-see-what, write self-grants, and define /
  evaluate org-wide sharing rules. ADR-0111's P0 rulings land here:

  - **D1/D2** — `ISharingService.canManageShares(object, recordId, context)`:
    system, the record's owner, or a holder of Modify All Data (probed via the
    new fail-closed `ISecurityService.hasWriteBypass`). Enforced in the SERVICE,
    so every caller is covered; without plugin-security it fails closed to
    owner-only.
  - **D4** — `revoke` is symmetric with grant, validates the share belongs to the
    URL's record (`NOT_FOUND` on mismatch), and refuses non-`manual` rows
    (`CONFLICT` — a rule-materialised grant would be resurrected by the next
    reconcile).
  - **D5** — `listShares` is management-gated (invisible record → `NOT_FOUND`,
    visible-but-not-manager → `PERMISSION_DENIED`), and the open
    `/data/sys_record_share` read surface is self-scoped: non-admin callers see
    only rows naming them as recipient or grantor.
  - **D6** — the whole `/sharing/rules` surface (list/create/get/delete/evaluate)
    requires the new **`manage_sharing`** capability (D9; seeded into
    `admin_full_access`, `manage_platform_settings` honoured as the legacy
    equivalent), enforced in `SharingRuleService`.
  - **D7** — no inert grants: `recipientType` is narrowed to `user` (the only
    type any gate enforces), grants on objects the sharing gates never consult
    (public model, no `owner_id`, bypass, `controlled_by_parent`) fail with
    `SHARING_NOT_ENABLED` (422), and the manual upsert keys on
    `(object, record, recipient, source)` so manual and rule rows coexist.

  **Breaking** for callers that relied on the missing gate: unauthorized share
  management now fails with 403/404/409/422 instead of silently succeeding, and
  `ISharingService.revoke` gained an optional `scope` parameter. The verb
  boundary (edit ≠ delete, ADR-0111 D3) is NOT in this change — it lands as the
  separate P1.

- ad303ed: fix(sharing)!: an edit-level share no longer grants delete (ADR-0111 D3, the verb boundary)

  `update` and `delete` shared one `canEdit` gate, and `canEdit` accepts an
  `edit`-level share — so one "edit" grant silently conferred delete, the
  opposite error from the retired `full` level. A share widens _which rows_ a
  principal reaches, never _which verbs_ they may use (Salesforce Read/Write
  cannot delete; Dataverse `Delete` is a distinct privilege; Odoo splits
  `write`/`unlink`).

  - `ISharingService.canDelete(object, recordId, context)` — ownership (widened
    by write DEPTH) or the `modifyAllRecords` super-user bypass ONLY; an `edit`
    or legacy `full` share does not confer it. `canEdit` is unchanged (the
    update gate, share included).
  - `SharingService.buildWriteFilter` takes a `verb` parameter: a bulk
    `delete({multi:true})` scopes to the owner/DEPTH set alone (no share
    widening), while a bulk `update` keeps it.
  - The sharing middleware routes `delete` through `canDelete` and logs a
    specific fail-closed reason on denial (ADR-0111 D10).
  - `/security/explain` consults `canDelete` for a `delete` operation, so the
    record-level explanation matches enforcement.

  **Breaking**: a caller who could delete a record _only_ through an edit-level
  share (and holds object-level delete CRUD) can no longer delete it — delete now
  requires ownership, write depth, or Modify All Data. No new delete access level
  is introduced; a future per-record delete grant would be a capability mask
  AND-ed with object CRUD, not a fourth share level.

- dadd1ad: refactor(spec,plugin-sharing): retire the exported `SharingExecutionContext` type (#7218)

  <!-- adr-0087: registered sharing-execution-context-retired -->

  **BREAKING — public surface removal.** `SharingExecutionContext` is deleted from
  `@objectstack/spec` (`contracts/sharing-service`) and from
  `@objectstack/plugin-sharing`, which re-exported it. Both `api-surface/` and
  `export-origins/` snapshots are regenerated accordingly.

  This is the deferred deletion recorded when #7070 split the convergence in two.
  #6523 / PR #7068 converged 36 contract signatures onto the full
  `resolveAuthzContext` envelope (`ExecutionContext`), applying the #6206 ruling —
  enforcement adjudicates on the whole envelope, never a per-site subset. The
  consumer halves then re-annotated the implementations: PR #7140 (identity:
  `plugin-sharing`, `plugin-audit`) and PR #7206 (services: `plugin-approvals`,
  `plugin-reports`). Both landed with the type still exported, because it is
  DEFINED in `packages/spec` and that package's retirement is the spec seat's to
  make. Nothing declares it any more, so it goes.

  **Migration.** Anyone who imported `SharingExecutionContext` from either package
  should import `ExecutionContext` from `@objectstack/spec` instead — the type the
  contracts have declared since #7068. The old shape was six optional fields, all
  of which exist on the envelope with the same names and types, so a value that
  satisfied the retired type already satisfies `ExecutionContext`; only the
  spelling of the annotation changes.

  **No runtime behaviour changes.** The type was erased at compile time and no
  signature's accepted shape moved: the contracts already took the wide envelope.

  **What the retirement did NOT remove — the reason to read the pins.** Deleting
  the type does not make re-narrowing a compile error. Structural subtyping still
  accepts a six-field context where the envelope is expected, so the boundary is
  held by the declared parameter type plus the pins, exactly as before. The three
  `exec-context-annotation.pin.ts` files (`plugin-sharing`, `plugin-approvals`,
  `plugin-reports`) told their failure story as "the parameter narrows back to
  `SharingExecutionContext`", which a deletion would have quietly hollowed out.
  Each now keeps the retired six-field shape as a local, non-exported SPECIMEN
  type and refutes every enforcement parameter against it by type identity, so a
  re-narrowing under ANY name is red — alongside the fresh-literal
  excess-property checks they already carried. `sharing-service.test.ts` in
  `packages/spec` is re-anchored the same way, and its "twin unchanged in shape"
  case becomes a "twin stays retired" case. The narrative the retired type's doc
  block carried (the measured `(context as any).posture` specimen, and why tsc
  cannot police this) moves to the module doc of `contracts/sharing-service`,
  which the contracts and pins now point at.

- f00d8d4: fix(sharing): remove the `full` access level — it promised delete/transfer/share and granted `edit` (#3865)

  `sys_sharing_rule.access_level` / `sys_record_share.access_level` offered three
  levels, the third documented as **Full Access (Transfer, Share, Delete)**. No
  code path granted transfer, re-share, or delete because of it: both enforcement
  sites matched `access_level in ('edit','full')`, so `full` was byte-equivalent
  to `edit`. An admin picking "Full Access" in Setup was told they had granted
  delete rights and had not — declared-but-unenforced metadata (ADR-0078,
  ADR-0049), the same defect that retired the `queue` recipient before it.

  Measured on showcase, a `full` recipient got `read: allowed`, `update: allowed`,
  `delete: DENIED` — and the denial came from `decidedBy=object_crud`, i.e. the
  object-level CRUD gate rejected the delete _before_ sharing was consulted at
  all. That is not an oversight to patch around; it is the model working. Record
  sharing widens **which rows** a principal reaches, never **which verbs** they
  may use — the same split Salesforce enforces (its sharing rules stop at
  Read-Only / Read-Write; Full Access is owner / hierarchy / Modify All only,
  never grantable by a rule) and Dataverse enforces by AND-ing every shared access
  right against the security role's own privilege. Delete and transfer belong to
  ownership, the ADR-0057 DEPTH scopes, and admin scope.

  **What changed**

  - `SharingLevel` (spec/security) and `ShareAccessLevel` (spec/contracts) are now
    `read | edit`. The `Field.select` on both objects offers the same two, so the
    Setup dropdown no longer shows the misleading option.
  - `SharingService.grant()` and `SharingRuleService.defineRule()` gained the
    access-level validation they never had: `full` normalises to `edit`, and an
    unrecognised level is a `VALIDATION_FAILED` (HTTP 400) instead of being
    persisted verbatim as a grant no gate would ever match.
  - Enforcement stays deliberately wider than authoring — the read/write gates
    still match `edit`/`full` — so a row written before this release keeps
    working. Narrowing them would silently _revoke_ access.
  - A boot backfill normalises stored `full` rows on both tables, and the
    `sharing-rule-access-level-full-to-edit` conversion rewrites declarative
    stacks at load, so nothing needs consumer action.

  **Migration.** None. `full` and `edit` were already behaviourally identical, so
  rewriting one to the other cannot change an access decision — unlike the OWD
  `sharingModel: 'full'` alias retired in ADR-0090 D4, which changed posture and
  had to be delegated to the author. A stack that still authors `accessLevel:
'full'` converts at load with a deprecation notice; stored rows normalise at
  next boot. Code that pinned the `ShareAccessLevel` type to `'full'` no longer
  compiles — use `'edit'`.

  Reviving a real per-record delete grant is a separate design (a capability mask
  AND-ed with object CRUD, plus the share-administration model that would have to
  authorise re-sharing), not a fourth enum member.

- ccd9397: fix(security)!: a sharing rule with no criteria now shares NOTHING instead of every record (#3896)

  `SharingRuleSchema` has always required `condition`, and its doc is explicit
  that a predicate the compiler cannot lower is _"skipped and logged — never
  seeded as a permissive match-all (ADR-0049)"_. The declared/seed path honoured
  that. The two other ways to create a rule did not:

  - **`POST {basePath}/sharing/rules`** plucks its body field-by-field into
    `SharingRuleService.defineRule`, which validated `name` / `label` / `object` /
    `recipientType` / `recipientId` — and not `criteria`. A missing, `null`, or
    **misspelled** key (`criterias`) was stored as `criteria_json: null`, answered
    `201` with no warning, and evaluated as
    `find(object, { filter: {}, context: SYSTEM_CTX })`: every record of the
    object, up to 5000, granted to the recipient. Triggering it took a typo, not
    an attacker.
  - **Authoring a rule in Setup** is a direct `sys_sharing_rule` insert, which
    never reaches `defineRule` at all.

  Empty criteria is now rejected everywhere a rule can be written, and — because
  rules created before this gate are already in the table — the evaluator refuses
  to act on one regardless of how it got there.

  - **`defineRule` rejects a match-all criteria** with
    `VALIDATION_FAILED: criteria is required …`, alongside its other required
    fields. Covers the REST endpoint, programmatic callers, and the seeder.
    Rejected shapes: missing / `null` / `''` / `{}` / `[]` / `{ $and: [] }` /
    unparsable JSON (e.g. a CEL source typed into the Criteria box).
  - **The evaluator matches nothing** for such a rule and logs why, so a row
    stored before this release under-shares instead of over-sharing: the next
    reconcile _revokes_ the grants it had materialised. Both evaluation paths are
    covered — the bulk `evaluateRule` and the per-record write-hook path.
  - **`bindRuleCriteriaGuard`** fails `sys_sharing_rule` inserts with no
    criteria as a field-level `VALIDATION_FAILED` (a 400 naming `criteria_json`),
    so the Setup path reports the problem instead of saving an inert rule
    (ADR-0078). Updates are checked only when the patch supplies
    `criteria_json` — switching an over-broad legacy rule off must not require
    inventing a criteria for it first.
  - **The seed bootstrap's "empty condition = match-all" branch is gone**: a
    missing or empty `condition` is now skipped and logged like any other
    non-lowerable one.
  - `POST {basePath}/sharing/rules` also accepts `criteria_json` as an alias for
    `criteria`, matching the snake_case aliases the endpoint already takes for
    `object_name` / `recipient_type` / `access_level`.

  **Migration.** There is no "share every record" sharing rule, and there never
  usefully was one — the shape existed only as a failure mode. A rule that
  relied on it must state its predicate (`criteria: { stage: 'won' }`), or, if
  the object really should be readable by everyone, use the object's
  organization-wide default (`sharingModel`) instead. Rules already stored with
  a null `criteria_json` need no data migration: they stop granting on the next
  evaluation and their existing grants are revoked.

- 503be86: feat(security)!: reconcile the SharingRule authoring surface with the enforced runtime — rename `group` → `team`, add `business_unit`, prune `guest` + owner-type rules (#1878)

  The authoring `ShareRecipientType` enum had drifted behind the ADR-0090 D3
  rename and the enforced runtime: the runtime expands `team` (via
  `sys_team`/`sys_team_member`) and `business_unit`, but the authoring enum
  still offered the pre-rename `group` (silently skipped at seed time) and
  omitted the two live recipients. After this change **every authorable
  recipient and rule type is enforced** — nothing on the SharingRule surface
  validates and then silently does nothing (ADR-0078).

  - **`sharedWith.type: 'group'` → `'team'`** (wire-rename): the enum member is
    renamed to match the runtime vocabulary and now maps through the seed
    bootstrap to the live `TeamGraphService` expansion. Flat `sys_team`
    membership; enforced.
  - **`business_unit` added** to the authoring enum — exactly one business
    unit's members (no subtree; use `unit_and_subordinates` for the subtree).
    The runtime + bootstrap already enforced it; only the enum omitted it.
  - **`guest` removed** — it had no runtime recipient mapping. Anonymous access
    is served by the public-form grant and share links, not sharing rules.
  - **Owner-type rules removed** (`type: 'owner'`, `ownedBy`,
    `OwnerSharingRuleSchema` + its type export): they depend on live
    team/position membership, which the static materialiser cannot track, so
    they validated but never materialised a share. They return as an enforced
    form if membership-reactive re-materialisation is designed.
    `SharingRuleSchema` is now the criteria form; the `queue` recipient stays
    runtime-reserved (no `sys_queue` yet) and deliberately non-authorable.

  **Migration** (stale definitions now fail parse with the valid options listed):

  - `sharedWith: { type: 'group', … }` → `sharedWith: { type: 'team', … }`.
  - `sharedWith: { type: 'guest', … }` → delete the rule; expose the records
    via a public form or share link instead.
  - `type: 'owner'` rules → rewrite as a `type: 'criteria'` rule scoping the
    rows by field values (see the migrated examples:
    `share_open_tasks_with_manager` in app-showcase,
    `share_active_leads_with_manager` in app-crm), or use a scope-depth grant.

  <!-- adr-0087: registered sharing-rule-recipient-reconcile -->

- ba5ff2f: fix(plugin-sharing): deactivating or deleting a sharing rule actually withdraws its grants (#4433, #4434)

  An over-granting sharing rule had no withdrawal path on the product's API
  surface. Deactivating it left every grant it had materialised in place — not on
  the next record touch, not after a full restart — and the DELETE route answered
  500 for both address forms it advertises, so the rule could not be removed
  either. Together that made a too-broad rule unrecoverable short of hand-editing
  `sys_record_share`, against a v17 release note that advertises the opposite
  ("switching a rule off actually withdraws access").

  `minor`, not `patch`: this changes an observable runtime behaviour that
  deployments may have adapted to. A `source: 'rule'` grant whose rule is
  inactive — or whose rule row is gone — now disappears, on the deactivating
  write, on the next touch of the record, and on the next boot. Anything relying
  on those rows surviving deactivation (including data repaired by hand around
  the old behaviour) will see them revoked on upgrade. `DELETE
/api/v1/sharing/rules/:idOrName` also starts succeeding where it used to 500,
  so callers that treated that 500 as "unsupported" will now really delete.

  #4433 — three independent gaps, one per path the report walked:

  - **The deactivating write.** The `sys_sharing_rule` reconcile trigger skipped
    every `isSystem` write, on the theory that those were boot seeding.
    `SharingRuleService.defineRule` — the only implementation behind
    `POST /sharing/rules`, and the documented way to deactivate a rule — writes
    with SYSTEM_CTX unconditionally, because it must reach a platform table the
    sharing middleware otherwise gates. So the skip caught 100% of REST
    authoring: the withdrawal path built by #3821 existed, had tests (against a
    mocked session the real path never sends), and was unreachable in production.
    Now gated on boot phase, which is the question the skip actually meant to
    ask.
  - **The record touch.** `evaluateAllForRecord` listed only active rules, so a
    deactivated rule was absent from the loop entirely and its grants were never
    examined. It now reconciles every rule; an inactive one desires nothing and
    takes the existing revoke-the-remainder branch.
  - **The boot pass.** `backfillRuleGrants` was handed an `activeOnly` list,
    making it structurally incapable of revoking anything. It now walks every
    rule, and a new `sweepOrphanedRuleGrants` retires grants whose rule row is
    gone entirely — unreachable by rule iteration, so they need their own sweep.

  #4434 — `deleteRule` purged `sys_record_share` with a predicate-shaped
  `engine.delete` carrying neither a scalar id nor `multi: true`, the one shape
  the engine's dispatch refuses; it threw before ever reaching the rule row.
  Fixed by routing through the same `SharingService.revoke` path every other
  withdrawal already uses, rather than adding `multi: true` — a rule's grants now
  retire exactly one way instead of two divergent ones.

  The unit fakes are part of the fix: `makeEngine().delete` accepted any `where`,
  which is why #4434 shipped green — the pre-existing "deleteRule drops rule and
  all its grants" test asserted success against a delete the running server
  always rejected. The fakes now mirror the real engine's dispatch guard.

- 54299ca: feat(sharing): `ISharingService` 的每行写判定补三态 —— 放行 / 不表态 / 拒绝(#6428)

  #5492 的维护者裁决(2026-08-07,B 案)分两步兑现两种已声明的写扩权,本次是 **step 1:
  契约与默认实现**。plugin-security 前像门的 provenance 分层合成是 step 2,本次一行未动。

  **为什么二态不够(实测,不是推演)。** `canEdit()` 用同一个 `true` 表达了两件事 ——
  「我有依据放行」与「本服务对这一行根本不设门」。对只**追加**一道门的调用方(sharing
  中间件、`sys_attachment` 父记录门、ADR-0055 master 判定)这没问题:`true` = 「我不拦
  你」。对让这个答案去**顶替另一个权威的地板**的调用方就是 fail-open —— #5492 的 E2 实验
  把前像写门委托给 `canEdit()` 后,在**没有 `owner_id` 列**的对象上,普通成员跨 creator
  的 UPDATE 变成 `ok: true`(main 上是 403),因为平台的 `created_by` 所有权地板正是这类
  对象唯一的行级写门,而一个「不表态」的 `true` 把它盖掉了。

  **新增契约面**(`@objectstack/spec/contracts`):

  - `SharingWriteVerdict = 'allow' | 'abstain' | 'deny'` —— 闭合联合,普通 TS 类型
    (非 zod 派生,不进 ADR-0122 的 pin 计数)。
  - `ISharingService.checkEdit()` / `checkDelete()` —— 三态主形态,动作边界照 ADR-0111 D3
    继承:`edit` 级共享让 `checkEdit` 答 `allow`、同一行 `checkDelete` 仍答 `deny`;两者
    的 `abstain` 集合完全相同(两道门对「哪些对象由共享设门」意见一致,只在动词上分歧)。

  **兼容:`canEdit()` / `canDelete()` 原样保留,语义零漂移。** 它们被定义为三态的
  **投影** `verdict !== 'deny'` —— 从前对 public / 无 owner 字段 / bypass 对象返回的那个
  `true`,现在落在 `abstain` 上,投影回来仍是 `true`。真值表逐分支被测试钉住(9 个分支
  × 两个动词),因为 `resolveSharingCanEdit`(plugin-security)与 `sys_attachment` 父记录
  门读的正是这一列,翻掉任何一格都是本 PR 未触及的包里的静默权限变更。

  **fail-closed 落点:查询失败是 `deny`,永远不是 `abstain`。** 两者对合成方是相反的指令
  (`abstain` 把这一行交给另一个权威,`deny` 就地终结),把失败读成「没有意见」正是造出上述
  fail-open 的那个混淆。默认实现把所有权查询与共享查询整段包在 fail-closed 分支里,并
  `logger.error` 记名,不静默吞。

  **行为变化(一处,方向收紧)**:引擎查询抛错时,`canEdit`/`canDelete` 从**向外抛**改为
  返回 `false`。两个既有调用点本来就在自己那侧 catch 成 `false`(`resolveSharingCanEdit`
  的 #5386 fail-closed、attachment hook 的降级读),所以对它们是同一结果;其余调用点由
  「异常中止写入」变成「403 拒绝写入」,严格不更宽松。

  **解锁**:#5492 step 2 的前像门可以按 provenance 分层合成 —— `abstain` 回落平台所有权
  地板、`allow` 按声明顶替地板、`deny` 维持拒绝 —— 而不必在 security 侧重算一份
  owner/depth/share/bypass(那会是同一契约的第二份实现)。#5491 与 #5492 同批落地。

### Patch Changes

- 32f7188: Recompute `unit_and_subordinates` / `business_unit` sharing-rule grants when the business-unit graph changes.

  **Security:** read access granted through a business-unit sharing rule is now withdrawn immediately when the business unit is moved out of the shared subtree, deactivated or deleted, or when the membership row is removed — previously it survived until the shared record happened to be written next, which put no bound at all on how long a revoked recipient kept reading the record.

  The sharing-rule recompute hooks were registered only on each rule's own object, and nothing was registered on `sys_business_unit` or `sys_business_unit_member`. A rule whose recipient resolves through the business-unit tree therefore never re-materialised its `sys_record_share` grants when the tree or a membership moved. Writes to both tables now drive a recompute: the withdrawal is synchronous and complete before the write returns (scoped by recipient, so it needs no scan of the records the rule matches), and the grant direction — a unit moved _into_ a shared subtree — is queued on the existing re-grant queue.

  Only recipient kinds that actually read the business-unit graph are recomputed (`business_unit`, `unit_and_subordinates`); `user`, `team`, `position` and `queue` rules are untouched by a business-unit write.

- 9b51981: fix(plugin-sharing): the `business_unit` sharing-rule recipient expands exactly one unit, not its whole subtree (#7807)

  ⚠️ **This is an intentional over-grant fix, and it REDUCES visible rows for any
  deployment that authored `business_unit` sharing rules.** Read the migration note
  below before upgrading if you use that recipient kind.

  ## What was wrong

  The two business-unit recipient kinds were **declared** as two different widths
  and **enforced** as the same width. `SharingRuleService.expandRecipient` routed
  both through the identical `BusinessUnitGraphService.expandUsers` call, whose
  first act is a BFS over `parent_business_unit_id` — so the two branches differed
  only in their comments.

  A rule authored as `recipient_type: 'business_unit'`, which the authoring spec
  (`ShareRecipientType`), the org-axis lint red-line table and ADR-0057 D5 all
  describe as _"exactly one business unit's members (no subtree)"_, in fact reached
  that unit **plus every descendant unit's members**. On a three-level tree a rule
  anchored at a division silently granted to every department and office beneath
  it.

  Two consequences, and the second is why this is filed as security rather than
  tidiness: the narrow spelling over-granted **silently**, which is the worst
  failure shape for generated security metadata (an agent that asks for the narrow
  grant should get the narrow grant); and `unit_and_subordinates`, documented as
  the _strictly wider_ grant of the pair, was not wider at all, leaving the
  distinction the lint red-line draws unenforceable in practice.

  ## What changed

  `business_unit` now resolves through a new
  `BusinessUnitGraphService.expandUnitMembers()` — members whose
  `business_unit_id` equals the named unit, with no descent. It keeps every other
  guarantee the subtree walk had: an inactive or out-of-tenant anchor unit
  contributes nobody, and an unreadable unit fails closed rather than granting.

  `unit_and_subordinates` is **unchanged** and keeps the subtree walk — it is the
  kind whose declared semantics _is_ the hierarchy widening (ADR-0057 D5). The two
  kinds remain two kinds; neither is merged into the other or retired.
  `expandUsers()` also keeps its meaning for the `bu:` approver prefix and org
  rollups, which are subtree consumers by contract.

  Grant recomputation on business-unit graph writes (#7729) still covers both
  recipient kinds, because a unit-only expansion still reads `sys_business_unit`
  for its anchor's `active` flag and tenant scope and `sys_business_unit_member`
  for its members. What changed there is blast radius, not coverage: re-parenting a
  unit no longer moves a `business_unit` rule's recipients, while deactivating the
  anchor or editing its membership still does.

  ## Migration

  **In-tree cost is zero** — no shipped example app or seeded rule authors
  `business_unit` (the showcase and CRM apps use `position` and
  `unit_and_subordinates`), so nothing in this repository changes behaviour.

  **Out-of-tree deployments:** if you authored a `business_unit` rule and were
  relying — knowingly or not — on it reaching descendant units, those descendant
  members **lose the grants that rule materialised**. Grants are reconciled on the
  next evaluation pass, so the reduction lands without any action on your part.

  If the subtree reach was what you actually wanted, change the rule's recipient to
  `unit_and_subordinates`, which has always meant exactly that and is unaffected by
  this release. If you wanted the narrow grant, you now have it.

- 2e836de: chore(packaging): CHANGELOG.md ships in every npm tarball (#4261)

  The AGENTS.md post-task checklist requires breaking changesets to carry their
  FROM → TO migration because "this text ships to consumers as `CHANGELOG.md`
  inside the npm package and is what an upgrading agent greps after the tombstone
  error." That delivery path was severed for 68 of the 69 publishable packages:
  npm packs `package.json` / `README*` / `LICENSE*` unconditionally but — unlike
  older npm versions — not `CHANGELOG.md`, and the canonical
  `"files": ["dist", "README.md"]` whitelist never named it. Measured on npm
  10.9.7: `npm pack --dry-run` on `@objectstack/types` shipped 3 files while its
  70KB `CHANGELOG.md` stayed behind. Only `@objectstack/spec` listed it
  explicitly.

  The tombstone-error scenario is precisely the one where the repo is out of
  reach — the upgrading agent has `node_modules` and nothing else — so the
  migration text has to ride in the tarball. Every publishable package now
  declares `CHANGELOG.md` in `files`, and the canonical whitelist is
  `["dist", "README.md", "CHANGELOG.md"]`.

  The other half is the gate: `check:published-files` gains a fifth invariant,
  COMPLETE — a whitelist that fails to cover `CHANGELOG.md` fails the
  always-required lint job, so the next package cannot silently sever the path
  again. `@objectstack/spec`'s per-package EXTRA_ENTRIES exemption dissolves
  into the canonical set.

  Consumer-visible change: one more file per install (the package's changelog,
  e.g. 70.8KB for `@objectstack/types`), and `grep -r "removed key"
node_modules/@objectstack/*/CHANGELOG.md` now finds the migration it was
  promised.

- 7df7c64: feat(sharing): `sys_sharing_rule.criteria_json` is declaratively required (ADR-0113 P2)

  The field the ADR was written for: `required: true` as the write contract —
  insert must provide, update may not null out, legacy null rows rest, an admin
  can still `active: false` an over-broad legacy rule. Deliberately NO
  `storage.notNull`: deployed tenants' legacy nulls are the case the split
  exists for. The Setup form's required marker and client validation now derive
  from the declaration.

  Not breaking: a rule without criteria was already rejected by the #3929 hook
  guard; the guard narrows to the non-null match-all shapes `required` cannot
  express ('{}', vacuous $and/$or, unparsable JSON), `defineRule` keeps the API
  seam, and the evaluator stays fail-closed (ADR-0049).

- b5f9397: fix(sharing,runtime): a `sort` passed straight to the engine never ordered anything; migrate every in-repo engine call to canonical QueryAST keys (#4346)

  Two changes with different weights, from one sweep of every in-repo engine
  call site that still speaks a deprecated alias.

  **The bug — three dropped sorts.** #4346 made the engine fold `filter`→`where`
  and `top`→`limit` on all six methods. The other four pairs in
  `RPC_QUERY_ALIAS_SLOTS` (`select`, `sort`, `skip`, `populate`) are folded at
  the RPC/wire layer only — their values need shape lowering that belongs to
  those layers — and a **direct `engine.find()` never crosses that layer**. Three
  call sites passed `sort` there, so it rode onto the AST untouched, every
  driver's `Array.isArray(query.orderBy)` guard declined to emit an ORDER BY, and
  the query returned an ordinary-looking, arbitrarily-ordered result:

  | call site                           | asked for                                         | actually got                |
  | ----------------------------------- | ------------------------------------------------- | --------------------------- |
  | `share-link-routes.ts`              | shared AI conversation messages, `created_at asc` | messages in arbitrary order |
  | `runtime/domains/share-links.ts`    | same route, runtime-domain copy                   | same                        |
  | `share-link-service.ts` `listLinks` | the 200 most recent share links                   | an arbitrary 200            |

  All three combine the dropped sort with a `limit` — the "latest N" shape whose
  failure #4226 spelled out: an unapplied sort returns rows in arbitrary order,
  which `limit` then slices into an arbitrary page. #4226 fixed that in the wire
  normalizer; these calls sit one layer below it. `listLinks` had no test at all,
  which is why it went unnoticed. Now pinned — on the option bag the engine
  receives, not on row order, because the failure is that the key never becomes
  `orderBy` and a fake engine honouring either spelling would pass either way.

  **The cleanup — 27 no-op renames.** Every remaining in-repo engine call passing
  `filter` now passes `where` (approvals 5, auth 2, reports 6, sharing 11,
  webhooks 2, plus the one `filters` in a spec doc example). These are strict
  no-ops since #4346 folds the alias — the point is that the framework stops
  depending on a spelling it asks users to migrate off, which is a prerequisite
  for ever retiring the aliases. Service-level `filter` PARAMETERS (each
  service's own public API, e.g. `listRequests(filter)`) are deliberately
  untouched — those are not engine option bags.

  Two of the renamed calls were live victims of the #4346 bug rather than
  cosmetic: `auth-manager`'s `stampIdentitySource` read the table's first row via
  `findOne({filter})` and counted the whole table via `count({filter})`, so a
  federated sign-in never stamped `source: 'idp_provisioned'`. #4346 already
  corrected the behaviour; this makes the call say what it means.

- b8c95a6: fix(plugin-sharing): refuse to mint a share row on a federated object whose `owner_id` is the platform's injected anchor (#8119)

  Granting a per-record share on a **federated** (ADR-0015 `external`) object whose
  `owner_id` is the anchor the registry injected — rather than a column the author
  declared on the remote table — used to succeed and persist a `sys_record_share`
  row. That row was inert **by construction**: no read or write verdict can ever
  consult it. `POST /api/v1/data/:object/:id/shares` now answers **422
  `SHARING_NOT_ENABLED`**, the same refusal the guard already gives for public and
  owner-less objects (ADR-0111 D7, closing the ADR-0078 silently-inert trap).

  **Why the anchor is not a column.** `applySystemFields` injects `owner_id` into
  every object that has not opted out, federated ones included, while
  `Engine.syncObjectSchema` returns early for `external != null` and issues no DDL
  — the remote schema is owned externally. So for a federated object `owner_id`
  exists in the registered schema and nowhere else, and the field-existence test
  behind the share-posture guard was answering YES about a column that is not
  there.

  **Measured, not inferred.** On a booted showcase stack with an unstamped
  federated object bound to the remote `customers` table, the single-record
  ownership lookup does **not** raise on SQLite. A projection naming the phantom
  column is _discarded_ and the whole row comes back without it:

  ```
  find(obj, { where:{id:'c1'}, fields:['id','name'] })      -> keys [id, name]
  find(obj, { where:{id:'c1'}, fields:['id','owner_id'] })  -> keys [id, created_at,
      updated_at, name, email, region, lifetime_value]   — no `owner_id` key, no error
  ```

  So the ownership fast-path reads `owner == null` and both write gates answer
  `deny` — silently, for every principal at every write DEPTH including `org`,
  because the null-owner branch short-circuits before the scope is consulted. Only
  the `modifyAllRecords` bypass reaches `allow`, and it does so without reading a
  share row. Refusing the grant therefore costs no live access: the row it declines
  to write could never have granted any.

  **What is deliberately unchanged.** `checkEdit` / `checkDelete` still refuse on
  these objects. That is fail-closed and safe; widening them to `abstain` would
  hand the row to another authority and can turn a refusal into an allow, which is
  a decision recorded on #8119 rather than part of this fix.

  **Unaffected:** every local object; a federated object whose author **declared**
  a real remote `owner_id` (the test is provenance, not `external`, so its shares
  keep working); and the grandfathered `public_read_write` federated objects, which
  are still refused as _public_ by the check that runs first.

- db59e9c: hooks: drop the last three `doc` / `previousDoc` alias reads on a hook context — read the engine's own keys only

  Behaviour is unchanged: every one of these limbs guarded against a producer that
  has never existed, so none of them could be reached.

  - `service-storage` attachment lifecycle read `ctx.result ?? ctx.input.doc ?? ctx.input.data`
  - `plugin-sharing` primary-BU projection read `(ctx.input.data ?? ctx.input.doc).user_id`
  - `runtime`'s hook sandbox read `engineCtx.input ?? engineCtx.doc` and `engineCtx.previous ?? engineCtx.previousDoc`

  Every ObjectQL write context spells the payload `data` — measured and pinned by
  `hook-input-shape-contract.test.ts` in `@objectstack/objectql` ("insert carries
  `data` — never `doc`", #5273). The top-level pair is the same family one level
  up: `HookContextSchema` declares `input` / `result` / `previous` and neither a
  `doc` nor a `previousDoc`, and `engine.ts` — the sole producer of a HookContext
  — builds neither. The limbs survived only because the old `HookContext.input`
  contract table documented insert as `{ doc, options }`; that table was corrected
  in #5668, and the same alias was removed from `trigger-record-change` in #5671.
  These are the remainder (#5906), removed rather than left as a second de-facto
  contract (PD #12).

- fc3a36a: fix(spec,objectql,sharing,storage): a hook can tell a per-row bulk dispatch from a single-record write again (#6966)

  A predicate (`multi: true`) write dispatches its lifecycle hooks **once per
  matched row** — `after*` since #5038, `before*` since #5574 — on a context
  deliberately indistinguishable from a single-id write's, so a handler written
  for one record works unchanged on a batch. That indistinguishability is the
  feature, and it also erased the only signal several handlers had.

  Before #5574 a bulk `before*` fired once with `input.id` present-but-`undefined`,
  so "`input.id` is empty" meant "this call stands for N rows". Guards across the
  platform were written on it. Every one of them **silently inverted** rather than
  failing: a per-row context has an id, so the guard now answers "single write" for
  every row of a batch. Two further assumptions broke with it — that the engine
  reuses one `HookContext` across a write's before/after pair, and that `after*`
  work keyed on the write's row set runs once.

  ### New: `HookContext.dispatch`

  The engine now states the fact rather than leaving it to be inferred:

  ```ts
  ctx.dispatch; // { mode: 'record' | 'per-row', index: number, scope: object } | undefined
  ```

  - `mode` — `'record'` when the call is the caller's whole write; `'per-row'`
    when it is one of N.
  - `index` — position in the fan-out. `index === 0` is how a handler does
    batch-scoped work once instead of N times.
  - `scope` — scratch shared by **every** dispatch of one write, both phases, same
    object identity. This is the seam handlers used to get by stashing on the
    context itself, which only ever worked because a single-id write reuses one
    context across its pair.

  Bound at every write dispatch site — insert, update, delete, both phases.
  Optional, and an absent marker reads as "not a per-row dispatch", so a handler
  reads `ctx.dispatch?.mode === 'per-row'` and existing code keeps its behaviour.
  Reads carry no marker: a read has no fan-out.

  It is deliberately **not** the `isPredicateBulkWrite` discriminator #5574
  retired. That one was removed under ADR-0049 for having neither a producer nor a
  reachable consumer — it inferred "bulk" from `input.id` and `options.multi` at
  the consumer, which is exactly what `asScalarId` stays unexported to prevent
  (#4434 / #4550). This one is produced by the engine at the point the dispatch
  ladder is decided, and the platform's own handlers read it.

  ### Behaviour fixed

  **Sharing rules and the record-share cascade (`@objectstack/plugin-sharing`).**
  The `before*` hook stashes the write's affected row set for the `after*` hook to
  act on. On a predicate write that stash was landing on a per-row context the
  `after` phase never saw, so `readAffectedRows` answered `resolve-failed` and both
  subscribers took their safe branch: every bulk update or delete on a ruled object
  revoked **all** of that object's rule grants and queued a full asynchronous
  re-grant — once per matched row, with the repeats racing each other's re-grants.
  Access was never widened (the trade is the ruling's "over-granting is an
  incident, under-granting is a wobble" direction), but a bounded write now takes
  the bounded path again: the rows are unioned as the engine hands them over, the
  cap still applies to the union, and the `after*` work runs once per write.

  **File-reference ownership (`@objectstack/service-storage`).** The `beforeDelete`
  hook that pre-resolved ids for a `where`-shaped delete was dead on every path,
  and `afterDelete` was falling back to one `sys_file` lookup **per row** where the
  batch fits one `$in`. Both are fixed by the marker, and the pre-resolution query
  is gone entirely — the engine has already matched the rows and hands them over.
  The `beforeUpdate` copy-on-claim pass no longer runs once per row against a
  batch-scoped payload, which also removes a row-conditioned rewrite of a shared
  `SET` clause (out of contract under ADR-0058 Addendum II D3).

  No authored metadata changes, and no write's result, event or return contract
  changes.

- aff9e56: fix(i18n): translate the platform packages' declared surface, and gate all nine bundles instead of one (#3762)

  Only `platform-objects` was wired into a translation-drift check. The other
  **eight** packages shipped a `scripts/i18n-extract.config.ts` that nothing ever
  ran — and four of them had already drifted out of sync with the schema, exactly
  the rot `pnpm check:i18n` exists to catch, one directory over.

  **Translated.** `plugin-security` (45 strings per locale), `plugin-webhooks`
  (15), `plugin-audit` (8), `plugin-sharing` (7) and `service-storage` (7) are now
  at **zero** untranslated declared strings in zh-CN / ja-JP / es-ES — 246
  translations. Most were newly _visible_ rather than newly missing: #3753 taught
  the coverage detector to walk action `params`, `resultDialog`, `listViews` and
  the rest of the declared surface, and these are what it found.

  Wording was harvested from the repo's own bundles wherever a string was already
  translated somewhere (1382 unambiguous source strings), so `Created At` reads
  `创建时间` here because that is what it reads everywhere else, rather than a
  fresh invention. Protocol tokens are deliberately left identical across locales:
  `GET` / `POST` / `PUT` / `PATCH` / `DELETE`, `ETag`, `ACL`, `URL`.

  **Gated.** `scripts/check-i18n-bundles.mjs` replaces the single-package
  `pnpm check:i18n` and checks all nine. It does not restate each package's
  command — it parses the one already documented in that config's own docstring
  and runs it, so the documented regenerate command and the gate cannot diverge.
  The coverage ratchet grows the same way, from `examples/*` to twelve configs;
  eight of them sit at zero, which makes it the strict gate there.

  **Fixed a real truncation bug it exposed.** `os lint --json` on a large config
  came out of a pipe cut off at exactly 65536 bytes — `console.log(big)` followed
  by `process.exit(1)` tears the process down before an async pipe write drains,
  while an interactive run (stdout is a TTY, written synchronously) looks perfect.
  Every scripted consumer silently got invalid JSON. `emitJson` in
  `packages/cli/src/utils/format.ts` waits for the write to drain and sets
  `process.exitCode` instead; `lint`, `i18n check` and `i18n extract` use it.
  Roughly 30 other CLI commands share the pattern and are not touched here.

  The nine documented regenerate commands also gain `--no-metadata-forms` (added
  in #3768), since the Studio metadata-form baseline belongs to `platform-objects`
  alone, not to a copy in every plugin.

  Not fixed here: `platform-objects`' own 77-per-locale gap is `apps.*` /
  `dashboards.*` navigation and widget labels, which live outside the `objects`
  subtree and cannot be scaffolded while the package extracts with
  `--objects-only`. That needs an emit decision first — tracked in #3762.

- 71af9f5: fix(sharing): the criteria-less-rule warn is once per rule per process, plus one boot aggregate (#3929 follow-up)

  Pre-dedup the fail-closed evaluator warned on EVERY pass — per evaluation and
  per reconciled write — so one legacy criteria-less rule could dominate a
  deployment's log. Enforcement is unchanged (such a rule still matches
  nothing and its grants are revoked on reconcile); the warn now fires once
  per rule per process, and the boot backfill emits a single operator-facing
  aggregate (count + rule names + the fix: repair the criteria or set
  active: false).

- d99ff1a: Stop scoping federated (`external`) objects by the phantom `owner_id` anchor

  The ObjectQL registry injects `owner_id` into every object that has not opted out,
  federated ones included, while `Engine.syncObjectSchema` returns early for
  `external != null` and issues no DDL — so on a federated object that column exists in
  the registered schema and in no store. `SharingService.buildReadFilter` and
  `buildWriteFilter` both decided by asking "does this object carry an `owner_id`
  field?", were answered yes, and AND-composed `owner_id = <caller>` (or the ADR-0057
  DEPTH-widened `$in`) onto a query whose backing table has no such column. On SQLite the
  unresolvable identifier degrades to a string literal, so the predicate is
  constant-false — 0 rows, no error, HTTP 200; Postgres and MySQL raise
  `column "owner_id" does not exist`. Either way a federated object under the
  secure-default `private` OWD was unreadable by any principal whose read scope was
  narrower than `org`, and nothing reported why.

  Both filters now apply a provenance test: an `owner_id` that is byte-identical to the
  shipped `OWNER_FIELD_DEF` on an `external` object is the platform's injected anchor,
  not a real owner column, so ownership scoping contributes nothing there. A federated
  object that **declares** a real remote owner column keeps its scoping, and every local
  object is untouched.

- 8e7955b: Refuse deletion of a platform-global sharing rule to org-scoped callers (#7795)

  `SharingRuleService.deleteRule` now requires **platform** authority to delete a
  sharing rule whose `organization_id` is `null` — a row seeded from declared
  metadata that belongs to no organization. A caller holding only the org-scoped
  `manage_sharing` capability is refused with `PERMISSION_DENIED`, which the REST
  layer answers as **403**; the `manage_platform_settings` capability, the
  built-in `platform_admin` position, and system contexts are all still permitted.

  Why: such a rule's criteria query runs unscoped, so deleting it purged **every**
  tenant's `sys_record_share` grants under it — a cross-tenant destructive act
  authorized by a capability declared `scope: 'org'`. Two measured facts made it
  worse: the boot seeder re-creates the rule on the next restart under a _new_ id,
  so the delete was a revocation wearing removal's clothes rather than a removal;
  and the safe lever was unavailable while the destructive one was not — an org
  admin's `active: false` creates a second, org-stamped row and leaves the shared
  rule running, so deletion was the only lever an org admin had over it.

  Deliberately **403, not 404**: the row is intentionally visible — listing,
  reading and evaluating platform-global rules stay open to org admins, exactly as
  shipped — so answering "no such rule" would contradict a read the same caller
  can perform one call earlier. Nothing on the read/evaluate surface changes.

- 7dbf4c3: test: twelve in-memory driver doubles in `plugin-sharing`, `plugin-security` and
  `runtime` conjoin `$or`/`$and` with their sibling filters instead of short-circuiting
  (part of #7620)

  Twelve test files across three packages built an in-memory driver whose `WHERE`
  matcher **returned early** on `$or` (and usually `$and`), discarding every sibling
  equality key in the same object:

  ```ts
  if (Array.isArray(filter.$or)) return filter.$or.some((f) => matches(row, f));
  if (Array.isArray(filter.$and))
    return filter.$and.every((f) => matches(row, f));
  for (const [k, v] of Object.entries(filter)) {
    /* siblings, never reached */
  }
  ```

  A real driver ANDs them. So a query mixing an equality key with a top-level `$or`
  would have been answered on the `$or` alone, handing back rows the sibling key
  would have excluded — not a stricter or looser edge case, a different query, with
  the suite staying green while testing it.

  The fix is the ~2-line change already established by `packages/objectql`'s six
  (#7846) and by several already-corrected siblings in these same two packages
  (`bu-tree-recompute.test.ts`, `recipient-width.test.ts`, `sharing-rule.test.ts`,
  `system-caller-inert-grant.test.ts`, `business-unit-graph.test.ts`): fold the
  combinator check into a guard that only short-circuits on **failure**, so the
  sibling-key loop still runs afterward.

  **This lane's file enumeration differs from the issue body**, which is stale
  (confirmed in-thread): `plugin-sharing/src/sharing-rule.test.ts` was already fixed
  before this PR, and three files this PR fixes were never named in the issue at all
  (`plugin-sharing/src/sharing-service.test.ts`,
  `plugin-security/src/check-only-write-scope.test.ts`,
  `plugin-security/src/select-only-write-visibility.test.ts` — found by re-grepping
  `$or` across both packages' `src/*.test.ts` at this PR's base ref rather than
  trusting the issue's list). Files corrected here:

  - `packages/plugins/plugin-sharing/src/`: `authored-row-write-deferral.test.ts`,
    `boot-backfill.test.ts`, `bulk-recompute.test.ts`, `record-share-cascade.test.ts`,
    `sharing-service.test.ts`, `system-write-skip-notice.test.ts`
  - `packages/plugins/plugin-security/src/`: `authored-row-write-verdict.test.ts`,
    `check-only-write-scope.test.ts`, `row-write-widener-composition.test.ts`,
    `select-only-write-visibility.test.ts`, `vama-write-path-convergence.test.ts`
  - `packages/runtime/src/domains/`: `share-links-enforcement-context.test.ts`

  **All twelve are dormant today — measured, not assumed**, via the same
  `fs.appendFileSync` probe discipline #7846 used (a `console.log` probe was tried
  first, returned nothing, and was correctly distrusted rather than read as "zero
  calls"). Per-package results, with a positive control proving the probe would have
  caught a live case:

  - `plugin-sharing`'s six: **0 combinator calls out of ~1.52M matcher invocations**
    across the six suites (dominated by one bulk-recompute test's own scale; the
    other five totalled ~2,755). Positive control: instrumenting the already-fixed
    `sharing-rule.test.ts` with the identical probe, then reverting it, recorded 151
    `$or` and 3 `$and` calls in the same run — proof the zero above is a real
    absence, not a dead probe.
  - `plugin-security`'s five: **not** all-zero like objectql/sharing — `$and`
    appears 23–71 times per file and `$or` appears twice in one file
    (`authored-row-write-verdict.test.ts`). But every single one of those calls
    carried the combinator as the **only** key in its filter object (`other: []`),
    so early-return and conjoin produce identical results in every case observed —
    dormant in the sense that decides this PR, for a different reason than
    objectql/sharing (never invoked, vs. invoked but never mixed with a sibling).
  - `runtime`'s one file: 1 `$or` and 10 `$and` calls, same "combinator-only, no
    siblings" shape — dormant for the same reason as `plugin-security`.

  No existing test outcome changes anywhere, and none should: `plugin-sharing`
  (21 files / 569 tests), `plugin-security` (52 files / 1037 tests) and `runtime`
  (151 files / 2317 tests) are green before and after, byte-identical assertions.

  **Operator-support measurement, per the card's ask**: unlike the objectql six
  (measured byte-for-byte identical operator support), these twelve are **not** a
  single lowest common denominator. `plugin-sharing`'s matchers mostly support
  `$in`, several add `$ne` or `$gte`/`$gt` (the tree/graph-shaped ones), and
  `sharing-service.test.ts` supports only `$in`. `plugin-security`'s five and the
  `runtime` one are the most uniform subset (`$in` only, identical shape). A shared
  helper across all sixteen files repo-wide would have to be a strict superset or
  force some suites to drop operators they use — a materially different tradeoff
  than the objectql lane's "no lowest common denominator to flatten to" finding.

  Deliberately **not** extracted into a shared helper here either, for the same
  reason `packages/objectql`'s six gave: keeping each test double's substrate
  self-contained so it can fail independently of any other suite's fixture file.
  Where a cross-package helper would live, and whether the missing regression guard
  is worth adding, are open questions for the PM now that all three lanes of #7620
  have landed — not decided in this PR.

- cc2de0e: chore(packaging): 20 packages stop publishing their sources, tests and build tooling (#4248)

  These 20 packages declared no `files` field, so npm fell back to packing the
  whole package directory. `npm pack --dry-run` on `@objectstack/plugin-webhooks`
  listed **21 files** — 15 under `src/`, three of them unit tests
  (`auto-enqueuer.test.ts`, `bootstrap-declared-webhooks.test.ts`, …), plus the
  build-time `scripts/i18n-extract.config.ts`. `dist/` lands on top of that at
  publish time rather than instead of it, so consumers were installing the
  TypeScript sources and the test suite alongside the artifact they asked for.

  Each now declares `"files": ["dist", "README.md"]`, matching the 29 packages
  that already did. Nothing a consumer imports moves: every `main` / `types` /
  `exports` target in all 20 already resolved inside `dist/`, which the new
  `check:published-files` guard verifies rather than assumes. The visible change
  is a smaller install and a smaller dependency-scanning surface — `npm pack` on
  `@objectstack/plugin-webhooks` now yields 2 files plus `dist/`.

  The other half of the fix is the gate. Half the packages declaring `files` and
  half not was the #3786 shape — a hand-copied convention with nothing enforcing
  it, where whoever forgets the line gets no signal at all. `check:published-files`
  (new, wired into the always-required `lint` job) holds every non-private
  workspace package to four invariants: `files` is **declared**; it is
  **sufficient** (covers every entry point, so tightening a whitelist cannot ship
  a package that fails to resolve); it is **minimal** (admits no test, test-harness
  config or build script); and anything beyond `dist` + `README.md` is
  **registered** with a reason, reconciled in both directions so a stale exemption
  is an error rather than dead text. `@objectstack/spec` is the one package with
  registered extras — its `.zod.ts` sources, JSON Schemas, liveness ledgers and
  `CHANGELOG.md` are product, not build input.

  This also closes an assumption #4206 was resting on. Excluding `<pkg>/scripts/**`
  from the docs-drift implementation test is sound only while no package publishes
  `scripts/` as runtime code; that held, but it held because someone read all three
  offenders by hand. It is now checked on every PR.

- 7f955e5: fix(sharing): deleting a record now revokes every `sys_record_share` row on it, whatever the source (#5103)

  A share row says "principal P has level L on (object O, record R)". Delete R and
  the row describes nothing — yet until now it stayed in the table forever.

  #4779 (PR #5102) bound an `afterDelete` for this, but inside the sharing-RULE
  package, where two conditions fenced it in: it revokes only `source: 'rule'`
  rows, and it binds only on objects that appear in `sys_sharing_rule`. So an
  object that uses nothing but MANUAL shares — a `sharingModel: 'private'` object
  with no rule ever configured — had no delete hook at all, and **manual share +
  record delete = a permanent orphan**.

  Today the harm is bounded, and only because record ids are never reused: the
  `record_id IN (…)` predicate `buildReadFilter` emits matches nothing. Nothing
  enforces that assumption. A custom primary key, an import that preserves ids, or
  any future id recycling turns every one of those rows into a real privilege
  escalation — a new record landing on a recycled id inherits the dead record's
  recipients outright. Secondarily, `sys_record_share` grew without bound and
  Setup's Record Shares list showed rows pointing at nothing.

  **What changed**

  - **A record-delete cascade on every sharing-capable object.** `plugin-sharing`
    binds one `beforeDelete`/`afterDelete` pair with no object filter and judges
    the object's sharing posture from its `sharingModel` metadata _per delete_.
    Nothing is enumerated at boot, so nothing goes stale: an object that gains
    `sharingModel` at runtime is covered on its very next delete, with no rebind.
    Bounded deletes (a scalar id, an `$in` list, or a predicate matching at most
    1000 rows) are revoked synchronously and set-based; an unbounded one queues an
    object-scoped orphan sweep instead. System-context deletes cascade too.
  - **A boot-time orphan sweep keyed on record existence.** On
    `kernel:bootstrapped`, share rows whose RECORD no longer exists are revoked —
    historical orphans, rows a failed hook missed, and the one posture the cascade
    deliberately skips (an unmarked system object). This is a different question
    from the existing `sweepOrphanedRuleGrants`, which asks whether the RULE row
    still exists and therefore can never see a manual share. Bounded per boot:
    keyset pages, one batched existence probe per object per page, and a scan cap
    that reports when it stopped early. An object whose existence probe FAILS has
    its rows left in place — "could not ask" is never read as "the record is gone".

  **What did not change**

  Rule _recompute_ still never touches a manual share. That boundary (#5102) is
  the point: while the record exists, a manual grant is a human decision no rule
  evaluation may overrule. Only the record's DELETION revokes it, and only because
  there is no longer anything to have access to.

  New exports for hosts that compose the plugin by hand:
  `bindRecordShareCascade` / `unbindRecordShareCascade`,
  `objectCanCarryRecordShares`, `SharingService.revokeSharesForDeletedRecords`,
  `SharingService.sweepOrphanedRecordShares`, and `effectiveSharingModel`. Nothing
  was removed or renamed; the standard `SharingServicePlugin` composition needs no
  changes.

- 30f1b74: fix(plugins): a declared item reaches its schema intact — retire the `i?.content ?? i` unwrap from plugin read paths (#8378)

  Ten production reads over `SchemaRegistry.listItems` unwrapped every declared
  item as `i?.content ?? i`, presuming a `{ name, content }` storage envelope.
  That envelope has **no producer**. Re-measured at these seams rather than
  inherited from #7519's measurement of `MetadataFacade`:

  - `registerMetadataCollections` (objectql) registers each stack-collection
    element as-is — `registerItem(type, item, 'name')`, no boxing;
  - `loadMetaFromDb` registers `convertStoredItem(JSON.parse(record.metadata))` —
    the parsed body, never the `sys_metadata` row (whose body column is
    `metadata`, not `content`);
  - the facade's own interim boxing of non-object values, the one writer that ever
    produced the shape, was removed by #8349.

  **Removal is a fix, not a cleanup.** None of the types read through these seams
  — `permission`, `position`, `capability`, `object`, `sharingRule`, `webhook`,
  `emailTemplate` — declares a stored `content` key; every one of them rejects it
  as an unrecognized key. So wherever the key did appear the unwrap replaced a
  whole authoring document with one of its values, and `''` — falsy but
  non-nullish — passed `??` and then died at the reader's own `filter(Boolean)`,
  dropping the item with no warning, no count and no row.

  **On email templates the harm was sharpest, and it is the one users will
  notice.** `content` really is a spelling an author can write there:
  `EmailTemplateDefinitionSchema` lists it in its `strictObject` **aliases** table
  (`content: 'bodyHtml'`). That table is a _rejection_ facility, not a conversion —
  it feeds `strictUnknownKeyError`, which runs only on the `unrecognized_keys`
  path and only builds a message; nothing rewrites the key, and the ADR-0087
  conversion layer has no `email_template` entry either. The schema was therefore
  always ready with the author's fix, and the unwrap was the one thing standing
  between the author and it: the HTML string reached
  `EmailTemplateDefinitionSchema.parse()`, which answered `Invalid input: expected
object, received string`, and the boot warning's `name` field came back
  `undefined` — so an operator could not even tell **which** template had failed.

  A template authored with `content` now yields what it was always meant to:

  > Unrecognized key(s) on this email template: `content`. Did you mean
  > `content` → `bodyHtml`?

  …named against the template it came from, and counted as `skipped` rather than
  vanishing.

  No behaviour changes for spec-valid metadata: the reads hand back exactly the
  documents they always did.

- 6e66cbe: fix(plugin-sharing): a deleted record kills its share links — resolve fails closed, and the delete cascades (#5190)

  `ShareLinkService.resolveToken` checked the token, `revoked_at`, `expires_at`,
  the audience and the password — **but never whether the record the link points
  at still exists**. Nothing revoked links on delete either: #5103's cascade
  covers `sys_record_share` only. So a share link outlived its record, kept
  resolving, and kept stamping `use_count` / `last_used_at`.

  That is worse than the `sys_record_share` orphan #5103 fixed, and for a
  structural reason: a share row names its beneficiaries, while a share link is an
  identity-less **capability token** — holding the URL _is_ the authorisation. The
  moment a record id is reused (custom primary keys, an import that preserves ids,
  any future id recycling) a link that morally died with its record starts
  authorising a brand-new record, for whoever kept it.

  Both halves of the fix ship together, and the first does not depend on the
  second having run:

  - **`resolveToken` re-asks whether the record exists**, and returns `null`
    through the _same_ branch as revoked / expired — no distinct code, no distinct
    error, nothing an unauthorised holder can read "that record was deleted" out
    of. The probe sits after the cheap in-memory gates (a revoked link still costs
    no query) and _before_ the usage stamp, so a dead record no longer ticks
    `use_count` / `last_used_at`. It fails **closed**: a probe that throws denies,
    because "cannot ask" must not authorise.
  - **Record deletes now cascade to `sys_share_link`**, on #5103's existing seam
    rather than a parallel one — the same global `beforeDelete` row-set stash, the
    same `afterDelete` set-based revoke, the same serialized sweep queue for
    unbounded deletes, and the same `kernel:bootstrapped` orphan sweep (keyset
    pages, a scan cap that reports itself, one batched existence probe per object
    per page, and rows left strictly alone when that probe fails). The two halves
    are isolated, so a driver error reclaiming grants cannot also skip the tokens.

  The link half judges posture from `publicSharing`, which is _independent_ of
  `sharingModel`: the object most likely to hold links is a platform object that
  opted into link sharing, and that is exactly the object the record-share
  predicate skips. `publicSharing` declared counts even when it is currently
  `enabled: false` — links minted while it was on outlive the flip.

  An orphaned link row is **deleted**, not stamped `revoked_at`: its subject is
  gone, so there is no live link left to keep a revocation record of, and the
  table would otherwise only grow (with Setup's link lists pointing at records
  that no longer exist). Links an admin revokes keep their audit row exactly as
  before.

  No metadata, spec or API shape changes. Deployments see fewer rows in
  `sys_share_link` after the next boot, and links whose record was already deleted
  stop resolving immediately — which is the point.

- 8e13ca8: fix(plugin-sharing): share-link 路由把完整授权信封交给 enforcement,修复 `group` 姿态下建链恒 403(#6206,裁决 A 案的消费半边)

  `SharingServicePlugin` 的 share-link 路由此前在 `resolveAuthzContext` 之后重新
  拼一个四字段对象(`userId` / `tenantId` / `positions` / `permissions`),而这个
  对象被原样当作 enforcement context 喂进 `engine.find` —— 即 [Finding-2]
  「只能为你自己看得见的记录建链接」那道可见性校验。被丢在半路的是
  `accessible_org_ids`、`org_user_ids`、`systemPermissions`、`posture`、
  `tabPermissions`。

  实害(已复现,非仅代码读出):`group` 租户姿态下 `accessible_org_ids` 就是
  Layer 0 那堵墙(ADR-0105 D2),集合缺席即判否(fail closed)。于是可见性校验
  查不到任何行,建链接对**调用方本来读得到的记录**返回
  `403 FORBIDDEN: Not permitted to share <object>/<id>` —— 一个已发布姿态上,
  已发布功能完全不可用。`single` 姿态(默认)不读该字段,行为不变。

  改法按维护者 2026-08-07 的 A 案裁决(契约半边 #6430 / PR #6511 已落):信封
  **整个**透传(`{ ...authz, isSystem: false }`),不再逐字段挑选 —— 逐字段挑选正是
  这条缝出问题的方式,也是下一个新增授权维度会再次漏掉的地方。`posture` 随上下文
  流动、不在 enforcement 处重推(ADR-0095 D2)。窄类型 `ShareLinkExecutionContext`
  保留,但只服务路由自己的 401 判定(认证与否),不再出现在任何裁决路径上。

  `ShareLinkService.createLink` / `revokeLink` / `listLinks` 与 `canManageShares`
  探针的参数类型随之收成完整 `ExecutionContext`,与 #6511 落地的契约一致。

- 4580597: fix(plugin-sharing)!: the share-link routes emit the declared envelope, and the last ratchet retires (#3983)

  The fifth and final drifting route module. Unlike the four in #3843, this one was
  not found by reading — `scripts/check-route-envelope.mjs` surfaced it the moment
  that scan went repo-wide, which is the whole argument for a repo-wide guard over
  per-package copies. It also turned out to be the one where the drift had actually
  **broken shipped SDK methods**, not merely mis-shaped a body.

  ## Two SDK methods did not work on this surface

  Three of these routes are `disposition: 'sdk'` in `runtime/src/route-ledger.ts`,
  and `ObjectStackClient.unwrapResponse` decides a body is an envelope by finding a
  boolean `success`. With no flag it hands back the body verbatim:

  | method                | documented / typed as          | actually returned                           |
  | --------------------- | ------------------------------ | ------------------------------------------- |
  | `shareLinks.create()` | "the link row (incl. `token`)" | `{ link: … }` — so `.token` was `undefined` |
  | `shareLinks.list()`   | `Promise<any[]>`               | `{ links: [] }` — so `.map()` threw         |

  `packages/client/src/admin-surfaces.test.ts` mocks all three as
  `{ success: true, data: <payload> }`. The SDK was written and tested against the
  **dispatcher's** shape and only ever worked there.

  ## This is a convergence, not a redesign

  `runtime/src/domains/share-links.ts` serves the same five paths, and for cloud's
  per-environment kernels it is the _designed primary_ surface
  (`registerShareLinkRoutes: false`). It has always answered in the declared
  envelope. The plugin now answers identically:

  | route                            | was                              | now                                     |
  | -------------------------------- | -------------------------------- | --------------------------------------- |
  | `POST /share-links`              | `{ link }`                       | `{ success: true, data: link }`         |
  | `GET /share-links`               | `{ links }`                      | `{ success: true, data: link[] }`       |
  | `DELETE /share-links/:idOrToken` | `{ ok: true }`                   | `{ success: true, data: { ok: true } }` |
  | `GET /:token/resolve`            | `{ record, link, redactFields }` | `{ success: true, data: { … } }`        |
  | `GET /:token/messages`           | `{ data: rows }`                 | `{ success: true, data: rows }`         |
  | errors                           | `{ error: { code, message } }`   | `{ success: false, error: { … } }`      |

  `data` carries each payload **directly** — `data: links`, not `data: { links }`.
  That is what makes `unwrapResponse` return the same value on both surfaces, and
  it is what the SDK already expected.

  ## Breaking: raw `fetch` callers add one hop

  SDK callers get the fix for free (two of them go from broken to working). Direct
  body readers add `.data`:

  ```diff
  - const { links } = await (await fetch('/api/v1/share-links')).json();
  + const { data: links } = await (await fetch('/api/v1/share-links')).json();
  ```

  `{ ok: true }` on revoke survives, but as the payload rather than as the body: at
  the top level it was a second word for `success`, which #3689 retired from
  storage; under `data` it is what the dispatcher already returned.

  The `error` half was already nested `{ code, message }` — #3675's changeset cited
  this module as the good example of that — so only the `success` flag is new there.
  All eleven codes were already SCREAMING_SNAKE and registered, so ADR-0112 needs
  nothing.

  ## Consumers

  Swept, and the result is smaller than #3983 assumed. The framework has **zero**
  consumers of these routes. In objectui, `ShareDialog` was already dual-shape
  tolerant on all three routes it calls (`body.links ?? body.data`,
  `created.link ?? created.data`, and revoke never reads the body) — it needs no
  change, and it carried that tolerance precisely _because_ both shapes existed in
  the fleet.

  `SharedRecordPage` did need one fix, and it is the kind a shape-swap would have
  missed: it renamed the wire's `redactFields` to `redactedFields` only on the
  _bare_ branch, so on the already-enveloped dispatcher path the "fields are hidden
  by the owner" notice never rendered. Converting this surface would have spread
  that to every share page. Fixed in objectui#2980, which merges first.

  ## Guard

  **7 conformant / 0 ratcheted / 1 exempt**, from 6 / 1 / 1. The ratchet mechanism
  stays for the next module that needs it.

  `privateOk` also got narrowed to what its own doc always claimed — a literal `ok`
  at the **top** of a body, where it competes with `success`. The same literal
  inside `data` is payload, which is what a conformant revoke returns. Four
  self-test assertions pin both readings.

- d5749d7: refactor(types,rest,services,plugin-sharing): one shared writer for the response envelope, and `error.code` is enforced at compile time (#3973)

  `BaseResponseSchema` declares one envelope for every REST body the platform
  emits. It declared it once; the code that _wrote_ it was copied per route
  module. After #3843 and #3983 converted the last drifting one, seven modules
  each carried their own two-line `sendOk` / `sendError` pair — so the envelope's
  shape lived in fourteen places rather than one.

  `pnpm check:route-envelope` proved those seven copies agreed, which is why this
  is a cleanup rather than a bug fix. But a guard proves agreement; it does not
  create it. An eighth module starts by copying the pair again — not
  hypothetically: `share-link-routes.ts` was found already drifting by the
  repo-wide scan, and its drift had broken `client.shareLinks.create()` and
  `.list()` through `unwrapResponse` (#3983).

  ## What moved

  `sendOk` / `sendError` now live once, in `@objectstack/types`
  (`response-envelope.ts`), and all seven modules import them:

  | Module                                |
  | ------------------------------------- |
  | `service-storage/storage-routes.ts`   |
  | `service-settings/settings-routes.ts` |
  | `service-datasource/admin-routes.ts`  |
  | `rest/external-datasource-routes.ts`  |
  | `rest/package-routes.ts`              |
  | `service-i18n/i18n-service-plugin.ts` |
  | `plugin-sharing/share-link-routes.ts` |

  Placement was the open question in #3973, not design. `packages/spec` is
  schemas-only (Prime Directive #2), and the callers span `rest`, four
  `services/*` and one `plugins/*`, which rules out anything depending on them.
  `@objectstack/types` depends on nothing but `@objectstack/spec`, so every caller
  can reach it, and it is already where the repo puts a helper the HTTP boundaries
  share — `looksLikeInternalErrorLeak` (#3867) sits one file over and made the
  same argument first.

  The builders take a structural `{ status(n), json(body) }`, so the package
  imports no HTTP contract at all: `IHttpResponse` satisfies it, and so does the
  `any`-typed `res` the older modules carry.

  ## `error.code` is now checked by the compiler

  All seven copies typed the parameter `code: string`. ADR-0112 (#3841) closed the
  vocabulary — `ErrorCode` is `StandardErrorCode ∪ ERROR_CODE_LEDGER` — but an
  invented code was still caught only at runtime, by a conformance suite parsing a
  driven body, i.e. only on routes some test happened to drive.

  The shared `sendError` types `code` as `ErrorCode`, so an unregistered code now
  fails to compile, at every call site at once:

  ```ts
  sendError(res, 400, "NOT_A_REGISTERED_CODE", "invented");
  // Argument of type '"NOT_A_REGISTERED_CODE"' is not assignable to parameter of type 'ErrorCode'.
  ```

  This cost no call-site churn: every code the seven modules emit was already
  registered.

  ## `extra` is closed at the same place

  `sendError`'s last parameter is `Pick<ApiError, 'category' | 'httpStatus' |
'details' | 'requestId'>` — exactly what `ApiErrorSchema` declares beside `code`
  and `message`.

  It was `Record<string, unknown>` while `settings-routes` still hung `namespace` /
  `key` / `reason` / `fields` beside `code`. Those bodies passed every gate anyway:
  `ApiErrorSchema` is a plain `z.object`, so unknown keys were STRIPPED rather than
  rejected, and `envelopeViolations` inspects only the body's top level —
  conformant _by stripping_ rather than by declaration. #4224 moved that module
  onto `details`, which is what lets the parameter close here. Closing it at the
  shared builder is the part that lasts: an undeclared sibling is now a compile
  error in every module at once, rather than a key that quietly evaporates in
  whichever module reintroduces it.

  ## Nothing changes on the wire

  The seven pairs were identical modulo the optional `status` and `extra`
  parameters this one unions, and each module's driven conformance suite still
  parses its real bodies against the real spec schemas. One internal call site was
  rewritten: `package-routes` passed `details` positionally and now passes
  `{ details }`, producing the same `error.details` it always did.

  ## The guard got stronger

  `scripts/check-route-envelope.mjs` counts response write sites per module. A
  module that routes everything through the shared pair builds **none** itself, so
  the seven now declare `0 / 0 / 0` where they used to declare `2 / 1 / 1`, and the
  shared pair is pinned separately at `2 / 1 / 1` so the invariant stays total for
  the surface rather than per-module. What the count asserts is no longer "your two
  builders are the enveloped ones" but "you have no builders" — and a new route
  that hand-rolls a body still moves it off zero and fails.

- 3415a61: refactor(plugin-sharing,plugin-audit): enforcement implementations annotate the full `ExecutionContext` (#7136)

  The consumer half of #6523. That change converged 36 contract signatures onto
  the complete `resolveAuthzContext` envelope, applying the #6206 ruling —
  enforcement adjudicates on the whole envelope, never a per-site subset. The
  implementations behind those contracts still annotated their own parameters
  with `SharingExecutionContext`, the six-field shape the contracts used to name,
  so nothing they could _read_ had widened.

  `SharingService`, `SharingRuleService`, the sharing exec-context seam and
  plugin-audit's comment-access gates now declare `ExecutionContext` on all 27 of
  those parameters — plus the two return types that produce the contexts feeding
  them — and the casts the narrow annotation forced are gone:

  - `exec-context-seam.testkit.ts` resolved a REAL context and then had to force
    it into the narrow type — `{ ...authz, isSystem: false } as unknown as
SharingExecutionContext`. It now returns what it resolved, so a drift in
    `resolveAuthzContext`'s output reaches the tests that trust this seam instead
    of being absorbed by a double cast.
  - `SharingRuleService`'s system context is typed as the envelope and passed as
    itself, retiring `SYSTEM_CTX as any` at all 10 of its call sites — an erasure
    on an enforcement input switches checking off for the whole argument, not
    just for the readonly-array mismatch that provoked it.
  - The `(context as any).userId` / `.tenantId` reads in `SharingService` now read
    declared fields.

  **No runtime behaviour changes.** The values were always complete — this
  family's damage was type-side — so every gate answers exactly what it answered
  before. Method parameters only WIDEN what they accept, so no caller is affected.

  Two casts are deliberately kept, and are now documented where they sit:
  `__readScope` / `__writeScope` are private keys plugin-security's middleware
  stamps onto the context it forwards and are not fields of the envelope, and
  `organizationId` is not on the envelope at all — that spelling has its own
  history (#5858 / `check:org-identifier`) and was held out of this change.

  Because a re-narrowed annotation would compile, ship and pass every test in
  these packages, the convergence is pinned by a new compile-time module,
  `exec-context-annotation.pin.ts`: it hands each enforcement parameter a fresh
  literal naming envelope-only fields (`posture`, `accessible_org_ids`,
  `org_user_ids`), which TypeScript's excess-property check rejects the moment a
  parameter narrows back, plus negative cases so a parameter erased to `any`
  cannot pass either.

- 17688fe: fix(sharing): the by-id write gate defers to an app-authored RLS widener instead of hard-refusing (#5493)

  HotCRM's 17.0 GA acceptance sweep declared two RLS update-wideners on one
  profile and measured one of them working. On the junction object
  `crm_campaign_member` a non-owner PATCH returned 200; on `crm_campaign` the
  identical shape returned 403 `FORBIDDEN: insufficient privileges to update
crm_campaign`. That sentence is the sharing middleware's, not the row gate's
  `(row-level security)` — so the refusal landed **before** RLS was consulted and
  the declared widener was never asked.

  The discriminator was never "carries sharing rules". It is whether **record
  sharing enforces on the object at all**: `checkEdit` abstains — and `canEdit`
  therefore answers `true`, letting the write through to RLS — when the effective
  sharing model is `public` (which `controlled_by_parent` maps onto) or when the
  schema has no `owner_id` field. A junction lands in that set; an ordinary owned
  business object does not. Same declaration, opposite outcome, split by a
  property no author writes down.

  Row-level write authority is ONE composite determination (maintainer ruling on
  #5492), so the middleware no longer ends the decision by itself. Before it
  hard-refuses a **by-id** update or delete, it asks the security service's
  `ISecurityService.checkAuthoredRowWrite` — the fail-closed verdict landed by
  #5493 step 1 (PR #6841) — whether an **app-authored** (non-floor) row-level
  policy admits this row for this operation. `admit` retracts this authority's
  refusal and hands the row to the security pre-image gate, which composes per
  #6684/#5492 and makes the final row decision. It does not authorize anything on
  its own.

  Everything else is unchanged, deliberately:

  - **The guarded surface does not shrink.** A member with no authored policy, no
    share and no bypass is still refused; a read-level share still never widens a
    write; an `edit`-level share still widens update and not delete (ADR-0111 D3),
    and an update-only authored widener does not open delete either — the verb is
    threaded through to the verdict, not collapsed.
  - **Fail-closed on every non-`admit` outcome.** No security service (a
    deployment without `@objectstack/plugin-security`), a service predating the
    method, a throwing probe, a principal-less context, an on-behalf-of context
    (ADR-0090 D10) and any unrecognised verdict all leave today's refusal
    byte-for-byte intact. The probe is reached through the same structural
    late-binding this plugin already uses for `hasWriteBypass`; no runtime
    dependency on `plugin-security` is introduced.
  - **A creator who is no longer the owner gets nothing back.** The platform's own
    ownership floor (`created_by == current_user.id`, shipped on the additive
    `member_default` baseline) matches a record transferred away from its creator,
    so a deferral keyed on "the composed RLS admits this row" would return
    transferred records to former creators. The verdict is provenance-aware and
    abstains there; the deferral does not widen it.
  - **The bulk path is untouched** — it composes a filter rather than a verdict,
    and is tracked separately (#6736).
  - **Objects with no owner field are untouched** (#6698): sharing abstains, the
    gate never refuses, so the deferral is never reached and the platform
    `created_by` write floor remains their only row-level write gate.

- f226605: fix(plugin-sharing): hierarchy resolver 拿到调用方真实的活动组织(权威 `organizationId`)(#5859)

  `resolveOwnerScopeIds` 构造 `HierarchyScopeContext` 时读的是
  `(context as any).organizationId` —— **仓内没有任何传输层写过这个键**。REST
  (`rest-server.ts`)和 runtime dispatcher(`resolve-execution-context.ts`)都从同一个
  授权解析器 `resolveAuthzContext` 组装执行上下文,活动组织落在 `tenantId`
  (session 路径 = `session.activeOrganizationId`,API-key 路径 = `sys_api_key.organization_id`),
  `ExecutionContext` 的字段注释写的也正是这句。所以这个读取**结构性恒为 `null`**:
  自 ADR-0057 以来,每一次 DEPTH(`unit` / `unit_and_below` / `own_and_reports`)解析
  都是在**没有组织约束**的前提下跑的,而企业版 resolver 只按 `organizationId` 收窄
  自己的 owner 集合 —— 于是整条 DEPTH 租户隔离从未生效。

  爆炸半径不止「共享管理」一路:同一个 owner 集合喂给 `matchesOwnerScope` →
  `canEdit` / `canDelete`,以及批量写路径 `buildWriteFilter`。#5852 的实测里,
  `group` 姿态下的普通成员对**兄弟组织**记录 `POST /data/:obj/:idB/shares` 得到
  **201**;探针那个 app 的写路径另被 `member_default` 的 `owner_only_writes`
  (keyed on `created_by`)挡下,所以只观测到共享管理一路 —— **不带这条 owner-only
  RLS 的部署,跨组织 edit/delete 同样放行**。

  本次修复(producer 半边,契约半边见 #5858 / PR #5973):

  - 权威字段 `organizationId` 由执行上下文的活动组织填充;`tenantId` 作为
    `@deprecated` 兼容别名原样继续携带(不是消费端 `?? tenantId` 兜底 —— 那正是
    #5858 为 resolver 明令排除的宽容消费者形状)。同样的映射在
    `@objectstack/plugin-security` 的 Layer-0 租户墙里早已在用
    (`computeTenantLayer0Filter({ organizationId: context?.tenantId })`),两层
    enforcement 现在按同一个字段的同一个值收窄。
  - 无活动组织时如实传 `null`(契约类型即 `string | null`),空白字符串归一为
    `null`,绝不让一个假的组织 id 混进 resolver 的查询与日志。
  - resolver 抛错的静默回退改为**留声**(`logger.warn`):此前「resolver 炸了」和
    「层级里确实没有别人」在外部完全同形,这也是本缺陷长期不可见的原因之一。

  ## 姿态感知的组织门(user-visible 行为变化)

  `SharingService` 新增一个 late-bound 的 `tenancy` 姿态探针(读法与 `SecurityPlugin`
  为 Layer-0 墙读 `tenancy` 服务的完全一致,由 `SharingServicePlugin` 自动接线),
  按 **ADR-0105 D1** 的既有分叉决定「没有活动组织」意味着什么 —— 与
  `computeTenantLayer0Filter` 对同一问题给出的答案逐条同形:

  - **`single`**(纯单租户,无组织):**行为不变**,DEPTH 照常 widened。此处「没有组织」
    是那一个隐含租户,不是「所有组织」。
  - **`group` / `isolated`**(有墙):权威组织缺失/空白 → **拒绝**,根本不咨询 resolver,
    回落 owner-only 并打一条点名 ADR-0095 D1 / ADR-0105 D1 与 #5973 契约义务的 `warn`。
    即:有墙部署里,缺组织的 owner-scope 解析从「按无租户约束展开」变为「拒绝展开」。
  - **姿态解析不出**(未接线 / 探针抛错 / 词表外的值)→ 按**有墙**处理。未知姿态不是
    `single` 的证据,否则恰恰在配置已经可疑的部署上恢复了展开。

  对已有部署的影响:`single` 部署零变化;`group` / `isolated` 部署中,一个**没有活动
  组织**的调用方将不再通过 DEPTH 拿到跨组织的 owner 集合(共享管理 / edit / delete /
  批量写四条路径同时闭合)。

- fd6572b: feat(plugin-sharing): an `isSystem` write batch that materialises zero sharing grants now says so, once (#6783)

  The sharing-rule record-write hooks skip `isSystem` sessions, so a seed run — or
  any internal write batch — lands rows on an object an **active** sharing rule
  covers and creates no `sys_record_share` rows at all. The skip is correct: the
  `kernel:bootstrapped` backfill reconciles every rule and `evaluateRule` is
  idempotent, so the state heals. What was wrong is that nothing said so.

  hotcrm#640 is the specimen: a fresh install with 9 active sharing rules, 9
  accounts matching their criteria, users holding the right positions — and an
  empty `sys_record_share`. Every visible layer said "configured". The only way to
  learn that the seed path had skipped materialisation was to query the table,
  find it empty, and read `plugin-sharing`'s source.

  **What changed.** The two skips that drop grant materialisation — `afterInsert`
  and `afterUpdate` — now emit one INFO line naming the behaviour and both
  remedies:

  ```
  [sharing-rule] sharing materialisation skipped for isSystem writes; re-evaluate rules or restart to backfill
  ```

  with the object and the active rules on it as metadata.

  **One line per batch, not per row.** The notice is latched per object per hook
  binding generation, so a seed batch writing 500 rows produces exactly one line.
  The defect being fixed is silence; a per-row flood would be the same defect with
  a different symptom. The latch re-arms with the binding — `bindRuleRebindTriggers`
  re-binds the package on every `sys_sharing_rule` write — so a changed rule set
  gets its own notice instead of inheriting the previous generation's silence.

  **INFO, not warn or error**, deliberately: the behaviour is correct and
  self-healing, and warning about a subsystem working as designed is how operators
  learn to ignore it.

  Deliberately unchanged:

  - **The skip itself.** No write now materialises grants that did not before, and
    no `sys_record_share` row is created, updated or revoked by this change.
  - **No new switch or flag.** The notice is unconditional.
  - **`afterDelete` stays silent.** A delete skips _revocation_, not
    materialisation, and the remedy the line names cannot repair that class:
    `evaluateRule` iterates records that still exist, so neither re-evaluating a
    rule nor restarting can reach a grant whose record is gone. That class belongs
    to the record-delete share cascade and the boot orphan sweep.

  The line is a statement about the write path, not a claim that grants were owed —
  whether a given seeded row satisfies a rule's criteria is exactly the query the
  skip exists to avoid, so answering it here would cost the skip its purpose.

- c272e48: fix(plugin-sharing): recompute sharing rules for predicate (`multi`) writes — stale `sys_record_share` grants no longer survive a bulk update (#4779)

  `bindRuleHooks` located the rows to recompute from a single record id:

  ```ts
  const id = String(data?.id ?? ctx?.input?.id ?? "");
  if (!id) return;
  ```

  `ObjectQL.update()` only populates `input.id` when `where.id` is a scalar. A
  predicate write (`multi: true`) routes to `updateMany`, leaves `input.id`
  undefined, and carries no id in its payload — so **every bulk write skipped
  sharing-rule recompute entirely**.

  The consequence is a fail-open on the authorization side. A criteria-based rule
  materialises `sys_record_share` rows; an admin then bulk-updates those records
  out of the criteria (`{ where: { region: 'east' }, multi: true, data: { region:
'west' } }`); nothing recomputes, the grant rows stay in the table, and the
  recipients keep the read/edit access the rule no longer implies. Same family as
  #4757 (`sys_attachment`) and #4778 (approval locks), but better hidden — a stale
  grant is indistinguishable from a legitimate one. The reverse direction (bulk
  update **into** a rule's criteria never granting) was broken too.

  **What changes**

  The hooks now key off the write's ROW SET instead of one id. `beforeUpdate` /
  `beforeDelete` resolve the affected rows from the predicate and stash them on
  the shared hook context (the `before` hook is where it must happen — the write
  is what makes those rows unfindable); the `after` hook acts on them:

  - **Bounded set (≤ 1000 rows, `RULE_RECOMPUTE_ROW_CAP`)** — `evaluateAllForRecord`
    per row, synchronously. Diff-based, so this covers both directions: rows moved
    out of a rule's criteria are revoked, rows moved in are granted.
  - **Unbounded set** (over the cap, `multi: true` with no `where` at all, or a
    resolve that failed) — every `source: 'rule'` grant on the object is revoked
    **synchronously** in one set-based statement, and the deserved grants are
    restored **asynchronously** by reconciling the object's rules.

  **The write is never refused.** Refusing would turn an internal recompute bound
  into a business-visible limit on how many rows an admin may update, reported by
  a subsystem they never configured. The asymmetry it trades on instead:
  over-granting is a security incident, under-granting is an availability wobble.
  So the safety half is always synchronous and complete, and only the expensive
  restoration half is deferred.

  **Operational note.** After a bulk write whose row set could not be bounded,
  recipients may briefly lose access to records they still qualify for, until the
  background re-grant finishes. It is logged with the object and the reason. The
  re-grant is in-process; if it is lost to a crash, the plugin's existing
  `kernel:bootstrapped` backfill re-runs the same idempotent reconcile on the next
  start, and any subsequent `sys_sharing_rule` write reconciles too.

  **Also fixed:** the rule hooks now bind `afterDelete` and retire the deleted
  records' rule grants. Nothing else could: `evaluateRule` iterates records that
  still exist, so a grant whose record is gone was unreachable by every reconcile
  path and outlived restarts. Harmless only while record ids are never reused —
  an assumption nothing in the platform enforces.

  New on `SharingRuleService`: `revokeRuleGrantsForObject`,
  `revokeRuleGrantsForRecords` and `evaluateAllRulesForObject`. Manual
  (`source: 'manual'`) shares are never touched by any of them.

- 225ab04: fix(plugin-sharing): scope `getRule`'s by-id branch to the caller's organization (#7761)

  **Cross-tenant security fix.** `SharingRuleService.getRule` resolved a rule id
  with a bare `{id: idOrName}` predicate and no organization filter, executed
  under the service's `SYSTEM_CTX` so nothing re-scoped it downstream. An
  org-scoped sharing admin who held another organization's opaque `srule_…` id
  could therefore reach that organization's rule through all three verbs that
  resolve through `getRule`:

  - `GET /api/v1/sharing/rules/:id` — read another tenant's rule, including its
    criteria, recipient and access level;
  - `POST /api/v1/sharing/rules/:id/evaluate` — materialise that tenant's grants
    on demand;
  - `DELETE /api/v1/sharing/rules/:id` — delete the rule **and purge every
    `sys_record_share` grant it had materialised**, silently revoking another
    tenant's record access.

  The caller still needed `manage_sharing` (or the legacy
  `manage_platform_settings`) in their own organization, but that is an
  org-scoped capability — `scope: 'org'` in the spec's capability registry — and
  a rule id is not a tenant boundary: ids leak through logs, exports, support
  tickets, and the evaluate endpoint's own `{ruleId}` response.

  The by-id lookup now carries the same tenant predicate the by-name path has
  carried since #7676: `id = {id} AND (organization_id = {orgId} OR
organization_id IS NULL)` when the caller carries an organization. Two
  behaviours are deliberately preserved: a no-org (system / boot) context still
  resolves any row by id, so boot seeding, hooks and backfills are unaffected;
  and a platform-global (`organization_id = null`) row stays reachable by id, for
  symmetry with the by-name path.

  Reaching another organization's rule by id is now indistinguishable from
  addressing one that does not exist — `getRule` answers `null` (REST: 404),
  `evaluateRule` throws `RULE_NOT_FOUND`, and `deleteRule` is a no-op that leaves
  the row and its grants intact.

- d34d9c9: security(plugin-sharing): a `manage_sharing` holder with no ACTIVE organization no longer reads every tenant's sharing rules (#8158)

  `SharingRuleService` decided its admin read scope on the **absence of an
  organization id**, not on system-ness:

  ```ts
  if (!orgId) return where; // unscoped — every tenant's rows
  ```

  That unfiltered branch exists for the system context — boot seeding, the
  reconcile hooks, the backfills — which legitimately reads across tenants. But
  it was reached by any caller whose context happened to carry no organization,
  and the ADR-0111 D6 gate admits any caller holding the **org-scoped**
  `manage_sharing` capability. So an authenticated, non-system caller arriving
  with neither `organizationId` nor `tenantId` received the system read scope:
  `listRules` returned **every organization's** rules, `getRule` resolved any of
  them by id or by name, and `evaluateRule` reached those rows too — a
  cross-tenant **write**, since it reconciles `sys_record_share` grants.

  **That session is reachable in a real deployment**, measured end to end over
  HTTP rather than inferred: a permission-set grant is independent of
  organization membership, and an org-scoped grant still resolves when the caller
  has no active organization to compare it against. A user holding
  `manage_sharing` with no `sys_member` row — a multi-organization deployment
  (whose membership reconciler binds nobody), an `invite-only` deployment, a user
  removed from their organization, an SSO JIT user pending placement — signs in,
  carries the capability, and carries no tenant.

  **The fix** distinguishes "system context" from "no organization id" at the
  decision point instead of conflating them: `adminOrgScope`, `getRule` and
  `findRuleRowByName` (three sites, one shape) now take the execution context,
  and an authenticated caller with no resolvable organization is **refused** with
  `PERMISSION_DENIED` (HTTP 403) naming the missing organization. A refusal
  rather than an empty list, because `manage_sharing` is declared `scope: 'org'`:
  with no organization there is no scope in which it grants anything, and an
  empty answer over rules that exist and are actively granting access reads as
  "this deployment has no sharing rules".

  **Unchanged**, and covered by tests: system contexts keep the unfiltered read
  and the unfiltered seed (boot seeding is untouched); **platform operators**
  (`manage_platform_settings`, or the `platform_admin` position) keep it too,
  with or without an active organization — that is what the platform-only Setup
  sharing pages are, and a single-tenant deployment before its default
  organization is bootstrapped has exactly that caller; and an org-bound admin
  still sees its own organization's rules plus the platform-global ones, exactly
  as #7676 / #7761 left it.

- 647ec8b: fix(driver-sql,sharing): an unsortable query loses its ORDER BY, not its rows (#3821)

  `SqlDriver.find()` already recovered from a SELECT projection naming a column
  the table lacks (retry with `select('*')`, the unknown field is simply absent
  from each row). The identical failure one clause over — an **ORDER BY** column
  the table lacks — fell through to `return []`. Because `count()` is a separate
  statement, the list endpoint answered `HTTP 200` with `records: []` and
  `total: 3`: the rows are there, none are shown, nothing is logged. Same family
  as the `$`-param footgun closed by #2926.

  It surfaced through the Console's sharing-rule **recipient picker**, which
  never listed a single candidate. The client mangled `'name asc'` into
  `0 n,1 a,2 m,…` (fixed separately in objectui) and the driver turned that into
  "no users exist", so no sharing rule could be authored from the UI at all.

  Rows now outrank their order: the retry ladder drops the projection first (the
  likelier culprit and the cheaper thing to lose), then the sort, then gives up.
  A query that cannot be sorted comes back **unordered instead of empty**. Errors
  that are not about an unknown column still propagate untouched.

  **A rule authored in Setup now actually applies — and switching it off actually
  withdraws access.** Writing a `sys_sharing_rule` rebound the per-record hooks,
  which only makes the rule reach records written FROM THEN ON. So an admin who
  created a rule and enabled it saw nothing happen: the recipient's list stayed
  empty until somebody happened to touch each record. The reverse was worse —
  switching a rule OFF, or deleting it, left every grant it had already issued in
  place, and boot backfill only reconciles ACTIVE rules, so those grants outlived
  restarts while the UI displayed the rule as disabled. The reconcile was reachable
  only through `POST /sharing/rules/:id/evaluate`, which the Console never calls.

  Each non-system write to `sys_sharing_rule` now also reconciles that rule's
  grants, chained behind the existing rebind: insert/update run the same
  diff-based `evaluateRule` the REST endpoint runs (it purges when the rule is
  inactive), and delete purges directly via the new
  `SharingRuleService.revokeRuleGrants` — `evaluateRule` can't help there because
  the row is already gone (`RULE_NOT_FOUND`), which is also why a rule deleted
  through the plain data API used to orphan its grants. Seeding and package
  bootstrap write with `isSystem` and are skipped; `kernel:bootstrapped` already
  backfills those. Reconciliation is best-effort and never fails the write.

  **The dialog's help text was engineering notes, shown to tenant admins.** The
  field descriptions on `sys_sharing_rule` render under each input in Setup, and
  they cited ADR numbers, table and column names (`parent_business_unit_id`,
  `sys_business_unit`), enum machine values the dropdown never shows
  (`business_unit`, `team`), a third-party library (better-auth), and engine
  vocabulary ("evaluation", "lifecycle"). Several were also stale: they still told
  admins to type an id or hand-write a `FilterCondition` after those inputs became
  a record picker and a visual builder. Rewritten for the reader who actually sees
  them — the implementation detail was already in the object's doc comment, which
  is where it stays. `criteria_json`'s LABEL loses its "(FilterCondition JSON)"
  suffix for the same reason, and `active` can finally say what it now does:
  turning it off withdraws the access.

  Also refreshes the `sys_sharing_rule` help text in the zh-CN / ja-JP / es-ES
  translation bundles, which still described `recipient_type` in terms of
  `department` (the enum value is `business_unit`) and told admins to enter a
  queue name for `recipient_id` (`queue` was removed in ADR-0078). The es-ES
  option labels for `position` / `unit_and_subordinates` were translated as
  "rol" — corrected to "Puesto" / "Unidad de negocio y subordinados".

- 2465133: fix(plugins): sweep the service-lookup erasures out of the plugin composition roots, and fix the two alias-only HTTP reads it exposed (#4251 B5)

  Batch B5 of the #4251 sweep: the seven remaining `packages/plugins/*` composition
  roots. 35 lookup sites that had been erased to `any` now carry the slot's
  contract, so the compiler checks what each plugin actually calls on the service
  it resolved. The ratchet drops 143 sites / 32 files to 108 / 25.

  **Two real defects, both of the shape this sweep exists to find.** Approvals'
  actionable-link pages (ADR-0043) and sharing's public share-link REST routes each
  read the HTTP server under `http-server` _only_ — the deprecated alias. The
  ledger records `http.server` as canonical and as the only name present on every
  provider path: `runtime.ts`'s `config.server` path registers no alias at all. On
  that path both lookups threw, the surrounding `catch` swallowed it, and the
  routes silently never mounted — approval e-mail action links 404'd and the
  share-link surface was absent, with nothing in the log to say so. Both reads are
  now canonical-first with the alias as fallback, each name in its own `try`
  because `getService` throws on an empty slot (so `a() ?? b()` inside one `try`
  never reaches `b` — the same correction #4393 made in metadata and
  cloud-connection).

  Typing choices follow the batch method: pure data-plane consumers take the
  narrow contract (`IDataEngine` in reports), consumers that bind hook or
  middleware seams take the engine seen whole (`IObjectQLEngine` in approvals,
  sharing and pinyin-search), and slots with no contract get a **named** local
  surface rather than `any` — plugin-email's `MailSettingsSurface`, and the
  surfaces the consuming packages already declared (`ApprovalMessagingSurface`,
  `SharingSecurityProbe`, `ReportEmail`). A named surface that omits a member
  still makes the compiler name every call site; `any` says nothing.

  No behaviour change beyond the two alias reads. No contract changes.

- 8669e5d: Make package-seeded sharing rules visible and addressable by name to org-scoped admins

  Sharing rules seeded from an app or package are defined under the system context, so they are stored with `organization_id = null` (platform-global). `SharingRuleService.listRules` and the by-name fallback of `getRule` scoped their reads with a strict `organization_id = <caller org>` equality, which such a row can never satisfy. An authenticated org-scoped admin therefore saw `GET /api/v1/sharing/rules` return an empty list over a table of active seeded rules, and by-name `GET` and `evaluate` answered 404 `RULE_NOT_FOUND`; only the by-id branch, which was never org-scoped, still worked.

  Both admin reads now match "this organization OR platform-global", mirroring how enforcement has always read these rows under the system context. Consequences worth knowing:

  - Seeded rules now appear in the admin rule list and can be fetched, evaluated and deleted by name. An org admin could already do all three **by row id** — the by-id branch carries no org filter — so this adds an address form and discoverability, not a new authority. Deleting a package-seeded rule remains reversible: the next boot reseeds it.
  - Rules belonging to a **different** organization remain invisible and unresolvable by name; only rows belonging to no organization at all become visible.
  - `defineRule` is deliberately **not** widened. Its existence lookup decides upsert-vs-insert, so widening it would let one organization's admin rewrite a row every other organization reads. A same-named create still produces a row stamped with the caller's own organization, and by-name lookups prefer that row over the platform-global one.
  - Callers passing a context with no organization (boot seeding, rule hooks, backfills, the boot reconcile) are unaffected — that path was already unfiltered and is unchanged.

- 2a18012: fix(plugin-sharing): the ADR-0111 D7 inert-grant guard runs for SYSTEM callers too, so the sharing-rule evaluator can no longer materialise rows no gate consults (#8207)

  `SharingService.grant` skipped **both** of its pre-flights for a system context,
  in one block, under one justification: _"System callers bypass: the rule
  evaluator materialises through here under its own validation."_ The two halves
  ask different questions, and only one of them may vary by caller.

  - **D1, `assertCanManageShares` — an AUTHORIZATION check.** "May this principal
    manage shares on this record?" A sharing rule is not a principal and has no
    ownership to prove, so the system skip is correct and is unchanged.
  - **D7, the inertness guard — not an authorization check.** "Would any gate ever
    read a row on this object?" The gates that would consult the row
    (`buildReadFilter`, `checkEdit`, `checkDelete`) never see the granter, so the
    answer cannot depend on who asks. Exempting the system context made the guard
    answer a question it was not asked.

  **The "own validation" the old comment credited the evaluator with is not
  there.** Measured, one rule per class, `defineRule` then `evaluateRule`, both
  under a system context: a rule against a `public_read_write` object, an
  owner-less object, a `controlled_by_parent` detail, a federated phantom-anchor
  object, or a bypass object was accepted and materialised a real
  `sys_record_share` row — five for five. `defineRule` never reads the object's
  schema, and reconcile hands `grant` whatever `object_name` the rule row carries.
  So an authored sharing rule pointed at any of those objects minted rows that
  looked granted and enforced nothing, which is the ADR-0078 silently-inert trap
  arriving through the one door the guard did not watch.

  The inertness verdict is now computed caller-free and refused for **every**
  caller. Refusing costs no live access on either path: the row it declines to
  write could never have granted any.

  **What deliberately did NOT move.** The existence check stays non-system-only. An
  unresolvable object name is a NOT_FOUND (REST: 404) for a caller who typed it,
  but for the evaluator it is a stored `object_name` meeting an engine that may not
  have that schema registered at this instant — and absence of a schema is absence
  of _evidence_ of inertness, not evidence of it. Hard-failing a reconcile pass on
  that would refuse a write nobody showed to be inert. An engine with no
  `getSchema` at all keeps its existing "it cannot know" skip.

  **Operator-visible effects.** A sharing rule pointed at an object no gate
  consults now fails loudly instead of quietly writing nothing usable. Every system
  caller of `grant` is the rule evaluator's reconcile, and each of its entry points
  already treats a per-rule failure as best-effort: the boot rule backfill, the
  object-wide re-grant and the business-unit re-grant queue log the refusal (naming
  the rule and the reason) and carry on, and the write hooks catch it, so a user's
  insert or update is never failed by it. `POST /api/v1/sharing/rules/:idOrName/evaluate`
  now answers **422 `SHARING_NOT_ENABLED`**, naming the object and the reason,
  instead of burying the diagnosis in a 500 — the same code-to-status pair the
  per-record shares routes already publish. Withdrawal is untouched, so rows minted
  by an earlier build stay purgeable through `deleteRule` and through evaluating a
  deactivated rule.

- b45c71e: fix(plugin-security,plugin-sharing,plugin-webhooks,platform-objects,service-messaging,spec): five tenant-scoped declared unique indexes become per-organization (#8554)

  Five platform objects declared their uniqueness as a table-level index with bare
  `unique: true`. At the DECLARED-index level that is the positional spelling of
  `'global'` — the listed columns verbatim — so on a tenant-scoped object each
  materialized an **installation-wide** unique index. (Field-level `unique: true`
  means the opposite, per-organization, and has since #3696; `packages/lint` names
  that divergence "the #4986 trap" and warns on it via
  `unique/unscoped-declared-index`.) These are the fourth act of the class ruled on
  2026-08-13, after `sys_user_preference` / `sys_capability` (#8461) and
  `sys_position` (#8556).

  | object                        | package             | was                                | now                               |
  | ----------------------------- | ------------------- | ---------------------------------- | --------------------------------- |
  | `sys_permission_set`          | `plugin-security`   | `[name]` global                    | `[name]` per organization         |
  | `sys_sharing_rule`            | `plugin-sharing`    | `[name]` global                    | `[name]` per organization         |
  | `sys_webhook`                 | `plugin-webhooks`   | `[name]` global                    | `[name]` per organization         |
  | `sys_email_template`          | `platform-objects`  | `[name, locale]` global            | `[name, locale]` per organization |
  | `sys_notification_preference` | `service-messaging` | `[user_id, topic, channel]` global | same, per organization            |

  Measured live on a real engine before the fix — two organizations, the same key,
  `OS_TENANCY_POSTURE=isolated`, driving the real shipped declarations. All five
  reproduced identically:

  ```
  org_jia POST the key   → 201
  org_yi  POST the SAME  → 409 UNIQUE_VIOLATION
  org_yi  POST an unused → 201            ← the control that makes it an oracle
  org_yi  GET  the key   → total 0        ← refused by a row it cannot see
  ```

  Two consequences, both removed. **A cross-tenant existence oracle:** the 409 is a
  per-value answer about a row the caller cannot read, so an organization could
  enumerate another organization's permission-set, sharing-rule, webhook and
  template naming. **A functional dead end:** the second organization simply could
  not use the name, and the refusal did not say why. For
  `sys_notification_preference` the shape is the one #8323 measured on
  `sys_user_preference` — a user belonging to two organizations could not hold
  independent per-topic delivery toggles.

  ## ⚠️ Operators: a migration is REQUIRED, and deploying this release is not it

  Respelling a declared index changes its generated **name**. On an existing
  database `initObjects` is additive: it creates the new per-organization composite
  at boot and **never drops the old global index**, which goes on enforcing. Until
  the retirement is applied, a deployed installation that has taken this release is
  still enumerable — that is asserted as a test, not assumed.

  Run the migration:

  ```
  os migrate plan       # shows one `replace_unique_index` per object, categorised `safe`
  os migrate apply      # no --allow-destructive needed
  ```

  Each object plans as **one pure relaxation**, not as two findings. That matters:
  if it read as "composite missing" (safe) plus "old global index orphaned"
  (destructive, opt-in), an operator applying only the safe half would keep the
  global index — keep the defect — while the plan read as applied. The `#8461`
  `replace_unique_index` arm covers all five unchanged (no driver change in this
  release), applies CREATE-before-DROP so uniqueness is never unenforced in
  between, drops the legacy index only once the replacement is confirmed present,
  preserves every row, and converges to no drift.

  Two columns are worth an operator's attention:

  - `sys_notification_preference`'s replacement index name is **hash-suffixed** —
    `uniq_sys_notification_preference_a22d7d27` — because the natural name is 70
    characters and the limit is 60. That is expected, not corruption.
  - Rows with no `organization_id` (platform/seed rows) stay unique **among
    themselves**: the organization key part is NULL-safe
    (`COALESCE(organization_id, '__global__')`, ADR-0120 D3), so seeding by name
    keeps working and a tenant may hold its own row of the same name.

  ## Not breaking

  A relaxation admits key pairs that were previously refused and refuses nothing
  that previously succeeded, so no caller that worked before fails now. Every read
  path for these five objects goes through the tenant-scoped data API, so no
  consumer resolves one of these names across organizations expecting at most one
  row. Shipped as `patch` for that reason — the same call #8556 made for the same
  shape.

  Published text carrying the bare uniqueness claim was corrected at its source and
  the generated reference pages regenerated (`security/permission.mdx`,
  `automation/webhook.mdx`, and `integration/connector.mdx`, which embeds the same
  webhook schema), together with the `sys_permission_set` field description, its
  clone-dialog help text, the `sys_webhook` field description, and the matching
  translation bundles in all four shipped locales.

- 6e6c872: fix(sharing): enforce `publicSharing.eligibility` when a share link is created

  `publicSharing.eligibility` was declared with a TSDoc promising the predicate
  would be evaluated against the candidate record at link creation and refuse with
  422 — and nothing read it. `ShareLinkService.getPolicy()` built its policy from
  the five sibling keys (`enabled`, `allowedAudiences`, `allowedPermissions`,
  `maxExpiryDays`, `redactFields`), all of which were genuinely enforced, and
  skipped this one, so `createLink` ran no predicate at all.

  The consequence was not confined to link creation: `resolveToken` has no auth
  check and reads the record under a system context, so any staff user who could
  read a record could publish it to the open internet past a policy the object
  author wrote specifically to prevent that — with no error raised.

  `createLink` now evaluates the predicate against the candidate record before the
  insert. An ineligible record is refused with `422 RECORD_NOT_ELIGIBLE`, and a
  predicate that cannot be compiled or that faults on the record is refused with
  `422 ELIGIBILITY_UNEVALUABLE` rather than issued past an unanswered policy — a
  restrictive policy must never fail open. Objects that declare no `eligibility`
  key are unaffected, down to the record read's field projection.

  The predicate is evaluated by `@objectstack/formula`'s record-level CEL engine —
  the same evaluator the server-side validation and hook-condition gates use, and
  the same canonical CEL front end sharing rules parse through. Sharing rules
  additionally lower their condition to a pushdown filter because they select a
  set of records inside a query; eligibility judges one record already in hand, so
  record-level constructs such as `has(record.x)` — which the pushdown compiler
  rejects — evaluate normally here.

- 69a89ce: fix(plugin-security,plugin-sharing): the write path consults the View/Modify All Data bypass — one predicate for `security/explain` and `/data` (#4647)

  A **Modify All Data** holder, a `sharingModel: 'private'` object, and a record
  whose `owner_id` is NULL got two opposite answers for one
  (principal, record, operation) triple:

  ```
  POST /api/v1/security/explain  { object, operation: 'update', recordId }
    → allowed: true, layers[vama_bypass]: "View/Modify All Data bypass held
      via [admin_full_access] — ownership and sharing checks are skipped"
  PATCH /api/v1/data/crm_contract/<id>
    → 403 FORBIDDEN
  ```

  Filling `owner_id` in made the same PATCH succeed, so the write path really was
  running the record-level ownership check the bypass layer said had been skipped.
  `sys_attachment`'s `canEdit(parent)` gate agreed with the 403, not with explain.
  Ownerless rows are not exotic: a system-context seed writes them by design (the
  seed loader disables `owner_id` injection).

  **The write path was the side that was wrong.** Modify All Data means an admin
  edits any record regardless of ownership (the Salesforce reference frame this
  platform's `modifyAllRecords` already follows, #1883), so:

  - `SharingService.canEdit` / `canDelete` now consult the super-user write bypass
    **after** ownership and shares have failed, through the existing late-bound
    `ISecurityService.hasWriteBypass` probe. The `sys_attachment`
    `canEdit(parent)` gate and the sharing-rule management gate reach the same
    answer because they call the same function.
  - The bypass they consult and the one `security/explain` reports are now **one
    predicate** — `PermissionEvaluator.superuserBypassSets` — rather than two
    independent readings of the permission sets. A cross-path test pins the triple
    through both `explain` and the real write middleware chain and asserts they
    agree, for update, delete and the attachment gate.

  **The widening is exactly Modify-scoped.** `viewAllRecords` ("View All Data") is
  a read power and never grants write: explain's `vama_bypass` layer is now
  operation-aware, asking for the modify bit on a write and the view bit on a read,
  and a view-only holder is refused on both paths. The probe still fails **closed**
  — no `@objectstack/plugin-security`, a throwing probe, a principal-less or
  on-behalf-of context all degrade to owner-only.

  **Explain payload self-consistency.** For a record-grained request the top-level
  `allowed` and the `record` verdict no longer contradict each other on this
  triple: the row is `visible: true` with `decidedBy: 'vama_bypass'`, the
  `vama_bypass` layer carries its own per-record attribution, and the `sharing`
  layer credits the bypass instead of reporting "no ownership and no edit/full
  share grants write" next to `allowed: true`. Where the bypass is not what
  admitted the row (owner, or an admitting share) the previous `decidedBy` is
  unchanged. Note that for a principal with **no** bypass, an object-level
  `allowed: true` beside `record.visible: false` remains correct and intended —
  `allowed` answers the object question, `record` answers the row question, and it
  is the `record` verdict that the write path mirrors.

- Updated dependencies [50616d9]
- Updated dependencies [430dcc2]
- Updated dependencies [690ccf2]
- Updated dependencies [6a67d7a]
- Updated dependencies [098f4bb]
- Updated dependencies [333a374]
- Updated dependencies [9fe9c1d]
- Updated dependencies [3d5c090]
- Updated dependencies [e5bd768]
- Updated dependencies [08b5a3d]
- Updated dependencies [e027b3e]
- Updated dependencies [48fcf70]
- Updated dependencies [e6ac4bd]
- Updated dependencies [c2429b0]
- Updated dependencies [445a0c2]
- Updated dependencies [d99aeb3]
- Updated dependencies [f6609e6]
- Updated dependencies [4727eb8]
- Updated dependencies [a70358a]
- Updated dependencies [0ecc656]
- Updated dependencies [06772eb]
- Updated dependencies [d4e0809]
- Updated dependencies [80334c7]
- Updated dependencies [f63cd09]
- Updated dependencies [97e7e3c]
- Updated dependencies [ce5242c]
- Updated dependencies [a7163ea]
- Updated dependencies [e6e9379]
- Updated dependencies [257d97a]
- Updated dependencies [5823d59]
- Updated dependencies [3140f9c]
- Updated dependencies [9500ba4]
- Updated dependencies [3ec8186]
- Updated dependencies [6169615]
- Updated dependencies [fa3d0cf]
- Updated dependencies [af5a224]
- Updated dependencies [71f76e1]
- Updated dependencies [37b1346]
- Updated dependencies [a749273]
- Updated dependencies [99736a0]
- Updated dependencies [fe67e34]
- Updated dependencies [b1863a5]
- Updated dependencies [fdb4f50]
- Updated dependencies [270650f]
- Updated dependencies [956e7f9]
- Updated dependencies [3aef718]
- Updated dependencies [1bd5652]
- Updated dependencies [14252d3]
- Updated dependencies [7fb436c]
- Updated dependencies [879ea13]
- Updated dependencies [8828b9e]
- Updated dependencies [ffb003c]
- Updated dependencies [1ea6bce]
- Updated dependencies [c1dcacd]
- Updated dependencies [ad303ed]
- Updated dependencies [32ccb23]
- Updated dependencies [f5a4ef0]
- Updated dependencies [2d3e255]
- Updated dependencies [a8940e4]
- Updated dependencies [7d7521f]
- Updated dependencies [5dc4d02]
- Updated dependencies [f724f69]
- Updated dependencies [98877c9]
- Updated dependencies [98877c9]
- Updated dependencies [53068c1]
- Updated dependencies [ee58392]
- Updated dependencies [f16e54e]
- Updated dependencies [c44dd5e]
- Updated dependencies [06be54e]
- Updated dependencies [28ad90e]
- Updated dependencies [76d74ec]
- Updated dependencies [201b31f]
- Updated dependencies [e6b1b69]
- Updated dependencies [259459d]
- Updated dependencies [3f7f14e]
- Updated dependencies [e2616e0]
- Updated dependencies [6fdc5c6]
- Updated dependencies [8b9d71e]
- Updated dependencies [05154a1]
- Updated dependencies [33f5e23]
- Updated dependencies [259af21]
- Updated dependencies [f8644c7]
- Updated dependencies [306ca50]
- Updated dependencies [840ee4b]
- Updated dependencies [978fed2]
- Updated dependencies [cfc293f]
- Updated dependencies [587fc91]
- Updated dependencies [de70b42]
- Updated dependencies [9b6fe7c]
- Updated dependencies [64cd010]
- Updated dependencies [fb3d99b]
- Updated dependencies [1986594]
- Updated dependencies [6968885]
- Updated dependencies [eaed61f]
- Updated dependencies [52200b4]
- Updated dependencies [cdfbee2]
- Updated dependencies [ad4af62]
- Updated dependencies [debe2f6]
- Updated dependencies [d44dbfa]
- Updated dependencies [29c6c9d]
- Updated dependencies [d21c001]
- Updated dependencies [ad047d2]
- Updated dependencies [8c711fb]
- Updated dependencies [f1cc3a3]
- Updated dependencies [09e4547]
- Updated dependencies [97b0798]
- Updated dependencies [474fe39]
- Updated dependencies [0bc685a]
- Updated dependencies [b949059]
- Updated dependencies [2826d1e]
- Updated dependencies [be1c52c]
- Updated dependencies [c5ff96d]
- Updated dependencies [5a84d41]
- Updated dependencies [84e7be9]
- Updated dependencies [91f4c78]
- Updated dependencies [ddc2527]
- Updated dependencies [820eff9]
- Updated dependencies [a6c3f38]
- Updated dependencies [5fa04fb]
- Updated dependencies [debc23a]
- Updated dependencies [0f8ad09]
- Updated dependencies [ad878e7]
- Updated dependencies [553a47f]
- Updated dependencies [43a7a8d]
- Updated dependencies [a98085f]
- Updated dependencies [20b1a9e]
- Updated dependencies [344a22a]
- Updated dependencies [4827e91]
- Updated dependencies [8d895ff]
- Updated dependencies [86f7a20]
- Updated dependencies [a3a884d]
- Updated dependencies [cfed092]
- Updated dependencies [203a449]
- Updated dependencies [8f9689f]
- Updated dependencies [73f69dc]
- Updated dependencies [04c56aa]
- Updated dependencies [3028326]
- Updated dependencies [f6472d7]
- Updated dependencies [57a3bb3]
- Updated dependencies [b3efeb7]
- Updated dependencies [ddd075a]
- Updated dependencies [88154be]
- Updated dependencies [fe2dfa1]
- Updated dependencies [c497d26]
- Updated dependencies [6f6fec7]
- Updated dependencies [e8dc61e]
- Updated dependencies [9c82146]
- Updated dependencies [5f9a987]
- Updated dependencies [744b8f5]
- Updated dependencies [9f5cc79]
- Updated dependencies [ac37fc6]
- Updated dependencies [9f060e5]
- Updated dependencies [bc17d39]
- Updated dependencies [2f3e793]
- Updated dependencies [4820f55]
- Updated dependencies [462d9c4]
- Updated dependencies [78caf51]
- Updated dependencies [7d21581]
- Updated dependencies [bbdbf28]
- Updated dependencies [37785ed]
- Updated dependencies [62a789b]
- Updated dependencies [2e284b2]
- Updated dependencies [d8e8d9c]
- Updated dependencies [789ad63]
- Updated dependencies [f2445c9]
- Updated dependencies [94e749b]
- Updated dependencies [ea1d916]
- Updated dependencies [3905c00]
- Updated dependencies [4335497]
- Updated dependencies [2af1988]
- Updated dependencies [0af50a3]
- Updated dependencies [1b49eaf]
- Updated dependencies [ae31a19]
- Updated dependencies [b230e5e]
- Updated dependencies [db31402]
- Updated dependencies [5d24f4b]
- Updated dependencies [29b94ed]
- Updated dependencies [07c68b0]
- Updated dependencies [f6cd635]
- Updated dependencies [2e836de]
- Updated dependencies [e0f300b]
- Updated dependencies [0161c7f]
- Updated dependencies [e900015]
- Updated dependencies [db02d47]
- Updated dependencies [b5bdf48]
- Updated dependencies [23338c3]
- Updated dependencies [12a19a8]
- Updated dependencies [5b843fb]
- Updated dependencies [10c4ea9]
- Updated dependencies [62b6a2f]
- Updated dependencies [7e5af5c]
- Updated dependencies [5b4780b]
- Updated dependencies [a933452]
- Updated dependencies [9d1d9c7]
- Updated dependencies [8140915]
- Updated dependencies [a019e52]
- Updated dependencies [e8f8f6c]
- Updated dependencies [41dcda3]
- Updated dependencies [7b48cf9]
- Updated dependencies [b5404f4]
- Updated dependencies [64fc6d5]
- Updated dependencies [b746aa0]
- Updated dependencies [b4487aa]
- Updated dependencies [1007379]
- Updated dependencies [65ca83a]
- Updated dependencies [0bfdf46]
- Updated dependencies [947d4f9]
- Updated dependencies [f764691]
- Updated dependencies [e120a5a]
- Updated dependencies [e5bd2f6]
- Updated dependencies [e9b5265]
- Updated dependencies [e650d67]
- Updated dependencies [121852d]
- Updated dependencies [d8f65fe]
- Updated dependencies [58ffcab]
- Updated dependencies [04476e7]
- Updated dependencies [67bf2e2]
- Updated dependencies [eaaf03c]
- Updated dependencies [d17df80]
- Updated dependencies [7d0e7b5]
- Updated dependencies [c6d1cb4]
- Updated dependencies [6513c17]
- Updated dependencies [462b713]
- Updated dependencies [36030ff]
- Updated dependencies [79228cd]
- Updated dependencies [6117f7b]
- Updated dependencies [48c110e]
- Updated dependencies [87aca93]
- Updated dependencies [e533b0b]
- Updated dependencies [cdf4d9a]
- Updated dependencies [aee1806]
- Updated dependencies [c13350b]
- Updated dependencies [c13350b]
- Updated dependencies [63b33e6]
- Updated dependencies [2c1988c]
- Updated dependencies [9ca2d85]
- Updated dependencies [c13350b]
- Updated dependencies [891d345]
- Updated dependencies [c8124e5]
- Updated dependencies [a52e2ef]
- Updated dependencies [5293114]
- Updated dependencies [376a061]
- Updated dependencies [c142ced]
- Updated dependencies [211abdb]
- Updated dependencies [b3363e9]
- Updated dependencies [eda599e]
- Updated dependencies [a1a4140]
- Updated dependencies [c20b875]
- Updated dependencies [7c7e246]
- Updated dependencies [8e17759]
- Updated dependencies [2ef1807]
- Updated dependencies [c519533]
- Updated dependencies [f35cdc5]
- Updated dependencies [d03fe25]
- Updated dependencies [2a37694]
- Updated dependencies [217e2e6]
- Updated dependencies [2672f85]
- Updated dependencies [b3de0dd]
- Updated dependencies [20bc357]
- Updated dependencies [11066f6]
- Updated dependencies [916af17]
- Updated dependencies [84c86fb]
- Updated dependencies [2a2a9fb]
- Updated dependencies [86a71d1]
- Updated dependencies [c001422]
- Updated dependencies [77022a9]
- Updated dependencies [d5c75e2]
- Updated dependencies [03d26f7]
- Updated dependencies [5966c2a]
- Updated dependencies [2382580]
- Updated dependencies [9ea2bc5]
- Updated dependencies [a2e157c]
- Updated dependencies [95c4227]
- Updated dependencies [2a61116]
- Updated dependencies [52760bf]
- Updated dependencies [5543020]
- Updated dependencies [880d343]
- Updated dependencies [6e82972]
- Updated dependencies [d4df105]
- Updated dependencies [4615a18]
- Updated dependencies [f505689]
- Updated dependencies [d9fa683]
- Updated dependencies [32d3800]
- Updated dependencies [2b63a00]
- Updated dependencies [606d577]
- Updated dependencies [4384921]
- Updated dependencies [55da611]
- Updated dependencies [e2798fa]
- Updated dependencies [3c628ce]
- Updated dependencies [c2d9098]
- Updated dependencies [0fd8556]
- Updated dependencies [3c7bcc0]
- Updated dependencies [4b6cac7]
- Updated dependencies [7631964]
- Updated dependencies [4c45be1]
- Updated dependencies [ac471a0]
- Updated dependencies [6fde910]
- Updated dependencies [60ae58e]
- Updated dependencies [9c82b89]
- Updated dependencies [7f62706]
- Updated dependencies [60cbf9d]
- Updated dependencies [667fa44]
- Updated dependencies [37e38d1]
- Updated dependencies [e906126]
- Updated dependencies [ce92674]
- Updated dependencies [08363a0]
- Updated dependencies [444de5b]
- Updated dependencies [0f17114]
- Updated dependencies [a227ed7]
- Updated dependencies [7cb922e]
- Updated dependencies [1d22114]
- Updated dependencies [1eb13a0]
- Updated dependencies [c52e608]
- Updated dependencies [9613396]
- Updated dependencies [3f7b4ff]
- Updated dependencies [74155c7]
- Updated dependencies [742a6a5]
- Updated dependencies [b5f9397]
- Updated dependencies [db0d53c]
- Updated dependencies [1b2eb1b]
- Updated dependencies [afa6aa5]
- Updated dependencies [ed77493]
- Updated dependencies [6908830]
- Updated dependencies [8b06bba]
- Updated dependencies [58a03d2]
- Updated dependencies [c39d713]
- Updated dependencies [b7d3be4]
- Updated dependencies [afb83d3]
- Updated dependencies [2a0d65e]
- Updated dependencies [2bacd1a]
- Updated dependencies [e47b342]
- Updated dependencies [4c54037]
- Updated dependencies [dc530b4]
- Updated dependencies [9f601e8]
- Updated dependencies [6a9dec6]
- Updated dependencies [0f7157b]
- Updated dependencies [4dc1c7d]
- Updated dependencies [d9bef45]
- Updated dependencies [f598aa8]
- Updated dependencies [4dfd002]
- Updated dependencies [f549a0d]
- Updated dependencies [51c5227]
- Updated dependencies [82da264]
- Updated dependencies [f586f1a]
- Updated dependencies [77be690]
- Updated dependencies [245d1dc]
- Updated dependencies [4ed7ed4]
- Updated dependencies [9b9b70f]
- Updated dependencies [f5a9bc2]
- Updated dependencies [e59786e]
- Updated dependencies [2fa4ca1]
- Updated dependencies [bcf1112]
- Updated dependencies [baeb4f0]
- Updated dependencies [29488cc]
- Updated dependencies [2ad1eba]
- Updated dependencies [881a3cc]
- Updated dependencies [199ec47]
- Updated dependencies [f5a2320]
- Updated dependencies [ad6317b]
- Updated dependencies [811c30c]
- Updated dependencies [a4a85c8]
- Updated dependencies [859cb83]
- Updated dependencies [07a4e26]
- Updated dependencies [9774b78]
- Updated dependencies [d5e9f6e]
- Updated dependencies [8a88885]
- Updated dependencies [deb538f]
- Updated dependencies [b49ccfd]
- Updated dependencies [c7406b0]
- Updated dependencies [5b89711]
- Updated dependencies [edff010]
- Updated dependencies [85d95e7]
- Updated dependencies [08cd163]
- Updated dependencies [0c8a22f]
- Updated dependencies [5f7669e]
- Updated dependencies [becbe53]
- Updated dependencies [b127c8b]
- Updated dependencies [763931e]
- Updated dependencies [ec975f1]
- Updated dependencies [168f60f]
- Updated dependencies [b07d829]
- Updated dependencies [de9af8a]
- Updated dependencies [eb4204b]
- Updated dependencies [a80302a]
- Updated dependencies [a648e96]
- Updated dependencies [a47ac06]
- Updated dependencies [e4c61a7]
- Updated dependencies [cc60165]
- Updated dependencies [474f131]
- Updated dependencies [081aa6f]
- Updated dependencies [91f4c78]
- Updated dependencies [050cd82]
- Updated dependencies [4d552af]
- Updated dependencies [44d677c]
- Updated dependencies [c32944d]
- Updated dependencies [1dd780f]
- Updated dependencies [e8d0c21]
- Updated dependencies [244ca86]
- Updated dependencies [546ab3c]
- Updated dependencies [cafec0a]
- Updated dependencies [58f3220]
- Updated dependencies [07f1822]
- Updated dependencies [c4df271]
- Updated dependencies [c8d6f6e]
- Updated dependencies [0b51bb6]
- Updated dependencies [08f93bc]
- Updated dependencies [d9971d3]
- Updated dependencies [7dc1067]
- Updated dependencies [4f13be2]
- Updated dependencies [a41ba5c]
- Updated dependencies [189854c]
- Updated dependencies [5d4de37]
- Updated dependencies [0e3a226]
- Updated dependencies [92a67f2]
- Updated dependencies [9136327]
- Updated dependencies [bf0ae99]
- Updated dependencies [c7e7900]
- Updated dependencies [edb4af0]
- Updated dependencies [f09a2e7]
- Updated dependencies [eb3e650]
- Updated dependencies [abeb375]
- Updated dependencies [cb3b6cd]
- Updated dependencies [73b7234]
- Updated dependencies [d2b97c3]
- Updated dependencies [61cc079]
- Updated dependencies [45dc446]
- Updated dependencies [0e96e46]
- Updated dependencies [c1d44f7]
- Updated dependencies [cb5a75e]
- Updated dependencies [84b6e58]
- Updated dependencies [f160ba4]
- Updated dependencies [59b794f]
- Updated dependencies [ef4efa8]
- Updated dependencies [cbb6a5c]
- Updated dependencies [fc3a36a]
- Updated dependencies [ab9fb5c]
- Updated dependencies [69787f0]
- Updated dependencies [5d022a1]
- Updated dependencies [290d944]
- Updated dependencies [042b9ee]
- Updated dependencies [55011af]
- Updated dependencies [b25a116]
- Updated dependencies [02dc076]
- Updated dependencies [f985b3f]
- Updated dependencies [795b6e1]
- Updated dependencies [d52d4fe]
- Updated dependencies [742cebb]
- Updated dependencies [175d789]
- Updated dependencies [f549a0d]
- Updated dependencies [127f091]
- Updated dependencies [524151c]
- Updated dependencies [427344c]
- Updated dependencies [8af76ae]
- Updated dependencies [1d4756e]
- Updated dependencies [720c5ad]
- Updated dependencies [a8d1e24]
- Updated dependencies [b85cc54]
- Updated dependencies [a36db28]
- Updated dependencies [7a8476f]
- Updated dependencies [518ca7a]
- Updated dependencies [d1cabaa]
- Updated dependencies [41642b0]
- Updated dependencies [4cca74c]
- Updated dependencies [88ef03e]
- Updated dependencies [9a4932a]
- Updated dependencies [3f8817a]
- Updated dependencies [a2443e3]
- Updated dependencies [e1554b1]
- Updated dependencies [9e2caf3]
- Updated dependencies [53ef057]
- Updated dependencies [4856789]
- Updated dependencies [81ce41a]
- Updated dependencies [85e1e4e]
- Updated dependencies [c3f4916]
- Updated dependencies [55dbbba]
- Updated dependencies [33e0385]
- Updated dependencies [dac6a08]
- Updated dependencies [72c3c86]
- Updated dependencies [3670cf9]
- Updated dependencies [2d8dba3]
- Updated dependencies [7f1a635]
- Updated dependencies [2205363]
- Updated dependencies [09fe58d]
- Updated dependencies [f9fc874]
- Updated dependencies [d62f8eb]
- Updated dependencies [d0a5ceb]
- Updated dependencies [a7586cd]
- Updated dependencies [4c5e80e]
- Updated dependencies [fce8e49]
- Updated dependencies [4b5702a]
- Updated dependencies [011b386]
- Updated dependencies [e18a162]
- Updated dependencies [e98fb14]
- Updated dependencies [394b7a1]
- Updated dependencies [ce92674]
- Updated dependencies [5d3ced9]
- Updated dependencies [0f2fdcd]
- Updated dependencies [d6d1a50]
- Updated dependencies [cf2c9b7]
- Updated dependencies [8ffa8b9]
- Updated dependencies [d127ff0]
- Updated dependencies [674ac99]
- Updated dependencies [833b512]
- Updated dependencies [9881074]
- Updated dependencies [1b9a53b]
- Updated dependencies [36d90fc]
- Updated dependencies [1eadac0]
- Updated dependencies [7777e8f]
- Updated dependencies [c804f19]
- Updated dependencies [7c2f7dd]
- Updated dependencies [9b86cf6]
- Updated dependencies [9b26699]
- Updated dependencies [d063a96]
- Updated dependencies [8825a06]
- Updated dependencies [5087ac6]
- Updated dependencies [6965160]
- Updated dependencies [677b591]
- Updated dependencies [cf7c694]
- Updated dependencies [ddd0f06]
- Updated dependencies [d77d1b7]
- Updated dependencies [0f9faa2]
- Updated dependencies [2d1ddf0]
- Updated dependencies [354b00f]
- Updated dependencies [3de535b]
- Updated dependencies [fe2e15a]
- Updated dependencies [5b79a34]
- Updated dependencies [502564d]
- Updated dependencies [603cab8]
- Updated dependencies [c757854]
- Updated dependencies [471839d]
- Updated dependencies [507b92a]
- Updated dependencies [46365ab]
- Updated dependencies [b508244]
- Updated dependencies [dbe92a7]
- Updated dependencies [df95346]
- Updated dependencies [3dede58]
- Updated dependencies [c6b6bb4]
- Updated dependencies [e1fa8d5]
- Updated dependencies [594508e]
- Updated dependencies [7cf42fe]
- Updated dependencies [5966c2a]
- Updated dependencies [402f534]
- Updated dependencies [59c544d]
- Updated dependencies [0045682]
- Updated dependencies [7309c81]
- Updated dependencies [2f59da0]
- Updated dependencies [114e727]
- Updated dependencies [7372d46]
- Updated dependencies [5e247fd]
- Updated dependencies [a6cd2c1]
- Updated dependencies [fc3a819]
- Updated dependencies [d56012f]
- Updated dependencies [1a53a02]
- Updated dependencies [75fd301]
- Updated dependencies [f78dd83]
- Updated dependencies [a2cd18a]
- Updated dependencies [fdca3a1]
- Updated dependencies [1507ba3]
- Updated dependencies [9051802]
- Updated dependencies [20bc1ec]
- Updated dependencies [1c625ca]
- Updated dependencies [2f8328c]
- Updated dependencies [a954634]
- Updated dependencies [2a6c279]
- Updated dependencies [9319586]
- Updated dependencies [8c8f0df]
- Updated dependencies [8ad609c]
- Updated dependencies [bbee302]
- Updated dependencies [90c2b15]
- Updated dependencies [4638aaa]
- Updated dependencies [0222d3c]
- Updated dependencies [08863dd]
- Updated dependencies [39eb01b]
- Updated dependencies [071d0dc]
- Updated dependencies [f293d45]
- Updated dependencies [56664f5]
- Updated dependencies [71f205d]
- Updated dependencies [f067930]
- Updated dependencies [414395b]
- Updated dependencies [42eeb7d]
- Updated dependencies [31cbe90]
- Updated dependencies [6b7129a]
- Updated dependencies [bf42e76]
- Updated dependencies [edbf873]
- Updated dependencies [c5adfe1]
- Updated dependencies [97ace2a]
- Updated dependencies [26e1029]
- Updated dependencies [0a936ea]
- Updated dependencies [90bbf25]
- Updated dependencies [023c00b]
- Updated dependencies [eb91eba]
- Updated dependencies [42da73d]
- Updated dependencies [01e124d]
- Updated dependencies [1cae606]
- Updated dependencies [ef7b5ef]
- Updated dependencies [9514767]
- Updated dependencies [8f20201]
- Updated dependencies [155507e]
- Updated dependencies [e3c8ed0]
- Updated dependencies [643b7c7]
- Updated dependencies [fa6dd59]
- Updated dependencies [7bba90b]
- Updated dependencies [8813b90]
- Updated dependencies [108ba8d]
- Updated dependencies [2a5f04a]
- Updated dependencies [4f740b0]
- Updated dependencies [55bbefc]
- Updated dependencies [030125b]
- Updated dependencies [7ce02eb]
- Updated dependencies [f1da948]
- Updated dependencies [b9cc17d]
- Updated dependencies [255f2d7]
- Updated dependencies [b4ad984]
- Updated dependencies [bfe689b]
- Updated dependencies [e7a7506]
- Updated dependencies [a9f32df]
- Updated dependencies [aeb9b27]
- Updated dependencies [7d27da0]
- Updated dependencies [d0d5205]
- Updated dependencies [1a15893]
- Updated dependencies [b70e534]
- Updated dependencies [0d24078]
- Updated dependencies [7e05d8e]
- Updated dependencies [8f1851e]
- Updated dependencies [b4b2c7d]
- Updated dependencies [fda61e4]
- Updated dependencies [61ea810]
- Updated dependencies [2233a85]
- Updated dependencies [67452d1]
- Updated dependencies [089767f]
- Updated dependencies [a13827e]
- Updated dependencies [66d99ec]
- Updated dependencies [de43f94]
- Updated dependencies [5b8f95b]
- Updated dependencies [cb43296]
- Updated dependencies [b61afc1]
- Updated dependencies [79021fc]
- Updated dependencies [7733604]
- Updated dependencies [4921a95]
- Updated dependencies [40e420f]
- Updated dependencies [62dd69a]
- Updated dependencies [d13004a]
- Updated dependencies [be7360c]
- Updated dependencies [e15e679]
- Updated dependencies [2ddba89]
- Updated dependencies [2ab1257]
- Updated dependencies [4b0ebdb]
- Updated dependencies [0fc6219]
- Updated dependencies [061406d]
- Updated dependencies [e4c8b6c]
- Updated dependencies [acb10f6]
- Updated dependencies [605e190]
- Updated dependencies [c6c59f1]
- Updated dependencies [b0e78a8]
- Updated dependencies [f31cc8d]
- Updated dependencies [f343dc4]
- Updated dependencies [8269e32]
- Updated dependencies [74f7339]
- Updated dependencies [a6c35a2]
- Updated dependencies [c2f1002]
- Updated dependencies [4cc4fb7]
- Updated dependencies [cc2de0e]
- Updated dependencies [97b6658]
- Updated dependencies [28d1eb7]
- Updated dependencies [06770c0]
- Updated dependencies [2c26040]
- Updated dependencies [f758cec]
- Updated dependencies [5b47ab5]
- Updated dependencies [b09d8d9]
- Updated dependencies [b09d8d9]
- Updated dependencies [8675db6]
- Updated dependencies [b09d8d9]
- Updated dependencies [27358d5]
- Updated dependencies [1c3da1f]
- Updated dependencies [c1f344b]
- Updated dependencies [db48ad5]
- Updated dependencies [3eb1b2b]
- Updated dependencies [9c93465]
- Updated dependencies [a34fd2e]
- Updated dependencies [ebb209c]
- Updated dependencies [76bcb83]
- Updated dependencies [37a8f2b]
- Updated dependencies [e50e479]
- Updated dependencies [c41828d]
- Updated dependencies [3fb42d2]
- Updated dependencies [8e08bc3]
- Updated dependencies [441d79f]
- Updated dependencies [59b85c0]
- Updated dependencies [889ae47]
- Updated dependencies [4f4c3fb]
- Updated dependencies [78f0be8]
- Updated dependencies [65f184b]
- Updated dependencies [6e357ed]
- Updated dependencies [d6938bf]
- Updated dependencies [35f7fb4]
- Updated dependencies [0410522]
- Updated dependencies [63b33e6]
- Updated dependencies [f163028]
- Updated dependencies [814db6d]
- Updated dependencies [a5302c7]
- Updated dependencies [82397b6]
- Updated dependencies [31e0be9]
- Updated dependencies [4bfd455]
- Updated dependencies [ffd2ce2]
- Updated dependencies [4df747c]
- Updated dependencies [2a44c1d]
- Updated dependencies [7084313]
- Updated dependencies [31fb03d]
- Updated dependencies [47a4e67]
- Updated dependencies [f07808c]
- Updated dependencies [91cefb8]
- Updated dependencies [7ffc3d3]
- Updated dependencies [88346ba]
- Updated dependencies [4631592]
- Updated dependencies [62f8017]
- Updated dependencies [32ff033]
- Updated dependencies [a831df1]
- Updated dependencies [f752ee3]
- Updated dependencies [a1b61e0]
- Updated dependencies [cd6b9f2]
- Updated dependencies [9bc846b]
- Updated dependencies [2cb6d3c]
- Updated dependencies [af2a095]
- Updated dependencies [bf478e1]
- Updated dependencies [5ac93d4]
- Updated dependencies [695cfbd]
- Updated dependencies [0e043d8]
- Updated dependencies [93f267f]
- Updated dependencies [7445149]
- Updated dependencies [ec796d5]
- Updated dependencies [071d0dc]
- Updated dependencies [0024abf]
- Updated dependencies [77fadbf]
- Updated dependencies [8dd98bf]
- Updated dependencies [4fedb11]
- Updated dependencies [e87fea1]
- Updated dependencies [c65e529]
- Updated dependencies [0848bea]
- Updated dependencies [d51bed2]
- Updated dependencies [dadd1ad]
- Updated dependencies [acbf364]
- Updated dependencies [3ca34c1]
- Updated dependencies [7adc841]
- Updated dependencies [239c3a3]
- Updated dependencies [b8b3c64]
- Updated dependencies [2f2e63c]
- Updated dependencies [4845f85]
- Updated dependencies [486d526]
- Updated dependencies [94a0bbc]
- Updated dependencies [bf1edef]
- Updated dependencies [d6bfb3d]
- Updated dependencies [8a9c079]
- Updated dependencies [7b005b4]
- Updated dependencies [cc3555e]
- Updated dependencies [a2266a6]
- Updated dependencies [d25a0ec]
- Updated dependencies [5c13368]
- Updated dependencies [89d7b35]
- Updated dependencies [1ee48bc]
- Updated dependencies [94f7b6a]
- Updated dependencies [d13f627]
- Updated dependencies [5c94f83]
- Updated dependencies [ea936f3]
- Updated dependencies [0c0fbd9]
- Updated dependencies [667b83e]
- Updated dependencies [f3141d8]
- Updated dependencies [5487c20]
- Updated dependencies [a841151]
- Updated dependencies [aa8b847]
- Updated dependencies [7687f7b]
- Updated dependencies [5a84d41]
- Updated dependencies [fd3013a]
- Updated dependencies [85ec26d]
- Updated dependencies [73e576f]
- Updated dependencies [f6476fc]
- Updated dependencies [69ac82c]
- Updated dependencies [4e74c18]
- Updated dependencies [8b90d68]
- Updated dependencies [4ac12ef]
- Updated dependencies [478f1fd]
- Updated dependencies [833ed84]
- Updated dependencies [a18abf3]
- Updated dependencies [c6a4eeb]
- Updated dependencies [1659072]
- Updated dependencies [f450ae7]
- Updated dependencies [2680cd3]
- Updated dependencies [abceb0d]
- Updated dependencies [627b188]
- Updated dependencies [8d4eae7]
- Updated dependencies [c5a5996]
- Updated dependencies [0c302a7]
- Updated dependencies [1788e19]
- Updated dependencies [b88f5e8]
- Updated dependencies [857a6cf]
- Updated dependencies [65a3a84]
- Updated dependencies [6633337]
- Updated dependencies [21676eb]
- Updated dependencies [3f296bf]
- Updated dependencies [e474853]
- Updated dependencies [e9cb9ab]
- Updated dependencies [42cc219]
- Updated dependencies [d42a92f]
- Updated dependencies [569611f]
- Updated dependencies [51d74ad]
- Updated dependencies [d7e0b42]
- Updated dependencies [3510e4a]
- Updated dependencies [d5749d7]
- Updated dependencies [f00d8d4]
- Updated dependencies [5326b36]
- Updated dependencies [aa4b90d]
- Updated dependencies [ccd9397]
- Updated dependencies [503be86]
- Updated dependencies [54299ca]
- Updated dependencies [1f6ed16]
- Updated dependencies [db2ea82]
- Updated dependencies [51a587d]
- Updated dependencies [ae490ef]
- Updated dependencies [e124711]
- Updated dependencies [dc61def]
- Updated dependencies [bca935b]
- Updated dependencies [d92c72d]
- Updated dependencies [c54c822]
- Updated dependencies [8dcc0f5]
- Updated dependencies [75b9e51]
- Updated dependencies [f61c8cf]
- Updated dependencies [e3ef52b]
- Updated dependencies [0a2f233]
- Updated dependencies [8621cdd]
- Updated dependencies [251e888]
- Updated dependencies [07f1822]
- Updated dependencies [e336549]
- Updated dependencies [3bb9340]
- Updated dependencies [1e604c4]
- Updated dependencies [04fab5e]
- Updated dependencies [183b4c4]
- Updated dependencies [7f713b6]
- Updated dependencies [d40f43a]
- Updated dependencies [2fdb36e]
- Updated dependencies [5f0852f]
- Updated dependencies [e787608]
- Updated dependencies [6f23667]
- Updated dependencies [cde1975]
- Updated dependencies [20cb232]
- Updated dependencies [e231abb]
- Updated dependencies [0bc685a]
- Updated dependencies [20526f5]
- Updated dependencies [efedd28]
- Updated dependencies [5d21a48]
- Updated dependencies [5278e11]
- Updated dependencies [c5eef1d]
- Updated dependencies [e5e7ee0]
- Updated dependencies [23dba62]
- Updated dependencies [e0f300b]
- Updated dependencies [761a0ba]
- Updated dependencies [c960170]
- Updated dependencies [19365b7]
- Updated dependencies [ba98e26]
- Updated dependencies [b7ed26d]
- Updated dependencies [a2ebea2]
- Updated dependencies [800bdb0]
- Updated dependencies [9d4dfc4]
- Updated dependencies [1059965]
- Updated dependencies [def5919]
- Updated dependencies [ee264b2]
- Updated dependencies [d56bcdb]
- Updated dependencies [26bb053]
- Updated dependencies [ee3bde1]
- Updated dependencies [098b629]
- Updated dependencies [60b672e]
- Updated dependencies [f104bab]
- Updated dependencies [d86815e]
- Updated dependencies [68dea0b]
- Updated dependencies [6b441a8]
- Updated dependencies [64f8cbe]
- Updated dependencies [6cb81c7]
- Updated dependencies [61282f9]
- Updated dependencies [c073b8c]
- Updated dependencies [ce0cfe9]
- Updated dependencies [04f1182]
- Updated dependencies [3a2dde7]
- Updated dependencies [8c20f75]
- Updated dependencies [be87153]
- Updated dependencies [dd0f681]
- Updated dependencies [60f0dd8]
- Updated dependencies [a87c5cd]
- Updated dependencies [a47f338]
- Updated dependencies [b3a3d83]
- Updated dependencies [7a55913]
- Updated dependencies [078e28b]
- Updated dependencies [35accbf]
- Updated dependencies [6038de7]
- Updated dependencies [fc5f536]
- Updated dependencies [0a5dc29]
- Updated dependencies [e13fd91]
- Updated dependencies [5647006]
- Updated dependencies [e654bfd]
- Updated dependencies [01a7337]
- Updated dependencies [b45c71e]
- Updated dependencies [d71ff32]
- Updated dependencies [50185a8]
- Updated dependencies [f8cfbb4]
- Updated dependencies [d6bd5a1]
- Updated dependencies [6e6c872]
- Updated dependencies [2bd4e5e]
- Updated dependencies [2598216]
- Updated dependencies [11949fc]
- Updated dependencies [2c7e62d]
- Updated dependencies [eb95d97]
- Updated dependencies [b098b0e]
- Updated dependencies [4d00b13]
- Updated dependencies [1363084]
- Updated dependencies [488b66c]
- Updated dependencies [148d451]
- Updated dependencies [fa5758e]
- Updated dependencies [38f7e4f]
- Updated dependencies [eb7613c]
- Updated dependencies [c57f3cf]
- Updated dependencies [ecc9110]
- Updated dependencies [9aa5510]
- Updated dependencies [e4c2dc8]
- Updated dependencies [97faca3]
- Updated dependencies [57bab76]
- Updated dependencies [c89d18c]
- Updated dependencies [1bd2795]
- Updated dependencies [f7bd4e2]
- Updated dependencies [694c350]
- Updated dependencies [361bd5b]
- Updated dependencies [aac90a5]
- Updated dependencies [3da3da5]
- Updated dependencies [6ad13bb]
- Updated dependencies [1e6ab15]
- Updated dependencies [b90086a]
- Updated dependencies [129b378]
- Updated dependencies [88f9d94]
- Updated dependencies [8186a70]
- Updated dependencies [a329cca]
- Updated dependencies [c87ef70]
- Updated dependencies [3cb0618]
- Updated dependencies [32a0874]
- Updated dependencies [6eec18c]
- Updated dependencies [4d7bebf]
- Updated dependencies [821ac7a]
- Updated dependencies [8f81731]
- Updated dependencies [7055c22]
- Updated dependencies [785a748]
- Updated dependencies [3af0354]
- Updated dependencies [866ff16]
- Updated dependencies [5a85e67]
- Updated dependencies [4965bfa]
- Updated dependencies [8b50cb3]
- Updated dependencies [551f899]
- Updated dependencies [a0fdc56]
- Updated dependencies [946a131]
- Updated dependencies [909895d]
- Updated dependencies [b95577a]
- Updated dependencies [0dcbc11]
- Updated dependencies [54f479a]
- Updated dependencies [d88f3e9]
- Updated dependencies [ad5fe25]
- Updated dependencies [c183a12]
- Updated dependencies [83c161f]
- Updated dependencies [d8c4957]
- Updated dependencies [b9f930b]
- Updated dependencies [f24cb83]
- Updated dependencies [5dbbb92]
- Updated dependencies [ea90179]
- Updated dependencies [1818998]
- Updated dependencies [ce92674]
- Updated dependencies [5ef0b5b]
- Updated dependencies [8c2db68]
- Updated dependencies [22b5e54]
- Updated dependencies [0166bd5]
- Updated dependencies [3d4c545]
- Updated dependencies [bb7cb41]
- Updated dependencies [8064b07]
- Updated dependencies [09ee21c]
- Updated dependencies [4a56dbd]
- Updated dependencies [289d04a]
- Updated dependencies [f549a0d]
- Updated dependencies [48fbacb]
- Updated dependencies [06df4fa]
- Updated dependencies [3fc2e48]
- Updated dependencies [c9b809f]
- Updated dependencies [e8f435c]
- Updated dependencies [89be40c]
- Updated dependencies [32386f8]
- Updated dependencies [9b702dc]
- Updated dependencies [ab16331]
- Updated dependencies [41610f6]
- Updated dependencies [69f1dfd]
- Updated dependencies [f46e987]
- Updated dependencies [bbe05de]
- Updated dependencies [355e951]
- Updated dependencies [e3a6f6e]
- Updated dependencies [c9bf940]
- Updated dependencies [a1dd1e4]
- Updated dependencies [a682670]
- Updated dependencies [dadb43f]
- Updated dependencies [2b52bc8]
- Updated dependencies [3556b67]
  - @objectstack/spec@17.0.0
  - @objectstack/objectql@17.0.0
  - @objectstack/core@17.0.0
  - @objectstack/platform-objects@17.0.0
  - @objectstack/types@17.0.0
  - @objectstack/metadata-core@17.0.0
  - @objectstack/formula@17.0.0

## 17.0.0-rc.6

### Minor Changes

- dadd1ad: refactor(spec,plugin-sharing): retire the exported `SharingExecutionContext` type (#7218)

  <!-- adr-0087: registered sharing-execution-context-retired -->

  **BREAKING — public surface removal.** `SharingExecutionContext` is deleted from
  `@objectstack/spec` (`contracts/sharing-service`) and from
  `@objectstack/plugin-sharing`, which re-exported it. Both `api-surface/` and
  `export-origins/` snapshots are regenerated accordingly.

  This is the deferred deletion recorded when #7070 split the convergence in two.
  #6523 / PR #7068 converged 36 contract signatures onto the full
  `resolveAuthzContext` envelope (`ExecutionContext`), applying the #6206 ruling —
  enforcement adjudicates on the whole envelope, never a per-site subset. The
  consumer halves then re-annotated the implementations: PR #7140 (identity:
  `plugin-sharing`, `plugin-audit`) and PR #7206 (services: `plugin-approvals`,
  `plugin-reports`). Both landed with the type still exported, because it is
  DEFINED in `packages/spec` and that package's retirement is the spec seat's to
  make. Nothing declares it any more, so it goes.

  **Migration.** Anyone who imported `SharingExecutionContext` from either package
  should import `ExecutionContext` from `@objectstack/spec` instead — the type the
  contracts have declared since #7068. The old shape was six optional fields, all
  of which exist on the envelope with the same names and types, so a value that
  satisfied the retired type already satisfies `ExecutionContext`; only the
  spelling of the annotation changes.

  **No runtime behaviour changes.** The type was erased at compile time and no
  signature's accepted shape moved: the contracts already took the wide envelope.

  **What the retirement did NOT remove — the reason to read the pins.** Deleting
  the type does not make re-narrowing a compile error. Structural subtyping still
  accepts a six-field context where the envelope is expected, so the boundary is
  held by the declared parameter type plus the pins, exactly as before. The three
  `exec-context-annotation.pin.ts` files (`plugin-sharing`, `plugin-approvals`,
  `plugin-reports`) told their failure story as "the parameter narrows back to
  `SharingExecutionContext`", which a deletion would have quietly hollowed out.
  Each now keeps the retired six-field shape as a local, non-exported SPECIMEN
  type and refutes every enforcement parameter against it by type identity, so a
  re-narrowing under ANY name is red — alongside the fresh-literal
  excess-property checks they already carried. `sharing-service.test.ts` in
  `packages/spec` is re-anchored the same way, and its "twin unchanged in shape"
  case becomes a "twin stays retired" case. The narrative the retired type's doc
  block carried (the measured `(context as any).posture` specimen, and why tsc
  cannot police this) moves to the module doc of `contracts/sharing-service`,
  which the contracts and pins now point at.

- 54299ca: feat(sharing): `ISharingService` 的每行写判定补三态 —— 放行 / 不表态 / 拒绝(#6428)

  #5492 的维护者裁决(2026-08-07,B 案)分两步兑现两种已声明的写扩权,本次是 **step 1:
  契约与默认实现**。plugin-security 前像门的 provenance 分层合成是 step 2,本次一行未动。

  **为什么二态不够(实测,不是推演)。** `canEdit()` 用同一个 `true` 表达了两件事 ——
  「我有依据放行」与「本服务对这一行根本不设门」。对只**追加**一道门的调用方(sharing
  中间件、`sys_attachment` 父记录门、ADR-0055 master 判定)这没问题:`true` = 「我不拦
  你」。对让这个答案去**顶替另一个权威的地板**的调用方就是 fail-open —— #5492 的 E2 实验
  把前像写门委托给 `canEdit()` 后,在**没有 `owner_id` 列**的对象上,普通成员跨 creator
  的 UPDATE 变成 `ok: true`(main 上是 403),因为平台的 `created_by` 所有权地板正是这类
  对象唯一的行级写门,而一个「不表态」的 `true` 把它盖掉了。

  **新增契约面**(`@objectstack/spec/contracts`):

  - `SharingWriteVerdict = 'allow' | 'abstain' | 'deny'` —— 闭合联合,普通 TS 类型
    (非 zod 派生,不进 ADR-0122 的 pin 计数)。
  - `ISharingService.checkEdit()` / `checkDelete()` —— 三态主形态,动作边界照 ADR-0111 D3
    继承:`edit` 级共享让 `checkEdit` 答 `allow`、同一行 `checkDelete` 仍答 `deny`;两者
    的 `abstain` 集合完全相同(两道门对「哪些对象由共享设门」意见一致,只在动词上分歧)。

  **兼容:`canEdit()` / `canDelete()` 原样保留,语义零漂移。** 它们被定义为三态的
  **投影** `verdict !== 'deny'` —— 从前对 public / 无 owner 字段 / bypass 对象返回的那个
  `true`,现在落在 `abstain` 上,投影回来仍是 `true`。真值表逐分支被测试钉住(9 个分支
  × 两个动词),因为 `resolveSharingCanEdit`(plugin-security)与 `sys_attachment` 父记录
  门读的正是这一列,翻掉任何一格都是本 PR 未触及的包里的静默权限变更。

  **fail-closed 落点:查询失败是 `deny`,永远不是 `abstain`。** 两者对合成方是相反的指令
  (`abstain` 把这一行交给另一个权威,`deny` 就地终结),把失败读成「没有意见」正是造出上述
  fail-open 的那个混淆。默认实现把所有权查询与共享查询整段包在 fail-closed 分支里,并
  `logger.error` 记名,不静默吞。

  **行为变化(一处,方向收紧)**:引擎查询抛错时,`canEdit`/`canDelete` 从**向外抛**改为
  返回 `false`。两个既有调用点本来就在自己那侧 catch 成 `false`(`resolveSharingCanEdit`
  的 #5386 fail-closed、attachment hook 的降级读),所以对它们是同一结果;其余调用点由
  「异常中止写入」变成「403 拒绝写入」,严格不更宽松。

  **解锁**:#5492 step 2 的前像门可以按 provenance 分层合成 —— `abstain` 回落平台所有权
  地板、`allow` 按声明顶替地板、`deny` 维持拒绝 —— 而不必在 security 侧重算一份
  owner/depth/share/bypass(那会是同一契约的第二份实现)。#5491 与 #5492 同批落地。

### Patch Changes

- db59e9c: hooks: drop the last three `doc` / `previousDoc` alias reads on a hook context — read the engine's own keys only

  Behaviour is unchanged: every one of these limbs guarded against a producer that
  has never existed, so none of them could be reached.

  - `service-storage` attachment lifecycle read `ctx.result ?? ctx.input.doc ?? ctx.input.data`
  - `plugin-sharing` primary-BU projection read `(ctx.input.data ?? ctx.input.doc).user_id`
  - `runtime`'s hook sandbox read `engineCtx.input ?? engineCtx.doc` and `engineCtx.previous ?? engineCtx.previousDoc`

  Every ObjectQL write context spells the payload `data` — measured and pinned by
  `hook-input-shape-contract.test.ts` in `@objectstack/objectql` ("insert carries
  `data` — never `doc`", #5273). The top-level pair is the same family one level
  up: `HookContextSchema` declares `input` / `result` / `previous` and neither a
  `doc` nor a `previousDoc`, and `engine.ts` — the sole producer of a HookContext
  — builds neither. The limbs survived only because the old `HookContext.input`
  contract table documented insert as `{ doc, options }`; that table was corrected
  in #5668, and the same alias was removed from `trigger-record-change` in #5671.
  These are the remainder (#5906), removed rather than left as a second de-facto
  contract (PD #12).

- fc3a36a: fix(spec,objectql,sharing,storage): a hook can tell a per-row bulk dispatch from a single-record write again (#6966)

  A predicate (`multi: true`) write dispatches its lifecycle hooks **once per
  matched row** — `after*` since #5038, `before*` since #5574 — on a context
  deliberately indistinguishable from a single-id write's, so a handler written
  for one record works unchanged on a batch. That indistinguishability is the
  feature, and it also erased the only signal several handlers had.

  Before #5574 a bulk `before*` fired once with `input.id` present-but-`undefined`,
  so "`input.id` is empty" meant "this call stands for N rows". Guards across the
  platform were written on it. Every one of them **silently inverted** rather than
  failing: a per-row context has an id, so the guard now answers "single write" for
  every row of a batch. Two further assumptions broke with it — that the engine
  reuses one `HookContext` across a write's before/after pair, and that `after*`
  work keyed on the write's row set runs once.

  ### New: `HookContext.dispatch`

  The engine now states the fact rather than leaving it to be inferred:

  ```ts
  ctx.dispatch; // { mode: 'record' | 'per-row', index: number, scope: object } | undefined
  ```

  - `mode` — `'record'` when the call is the caller's whole write; `'per-row'`
    when it is one of N.
  - `index` — position in the fan-out. `index === 0` is how a handler does
    batch-scoped work once instead of N times.
  - `scope` — scratch shared by **every** dispatch of one write, both phases, same
    object identity. This is the seam handlers used to get by stashing on the
    context itself, which only ever worked because a single-id write reuses one
    context across its pair.

  Bound at every write dispatch site — insert, update, delete, both phases.
  Optional, and an absent marker reads as "not a per-row dispatch", so a handler
  reads `ctx.dispatch?.mode === 'per-row'` and existing code keeps its behaviour.
  Reads carry no marker: a read has no fan-out.

  It is deliberately **not** the `isPredicateBulkWrite` discriminator #5574
  retired. That one was removed under ADR-0049 for having neither a producer nor a
  reachable consumer — it inferred "bulk" from `input.id` and `options.multi` at
  the consumer, which is exactly what `asScalarId` stays unexported to prevent
  (#4434 / #4550). This one is produced by the engine at the point the dispatch
  ladder is decided, and the platform's own handlers read it.

  ### Behaviour fixed

  **Sharing rules and the record-share cascade (`@objectstack/plugin-sharing`).**
  The `before*` hook stashes the write's affected row set for the `after*` hook to
  act on. On a predicate write that stash was landing on a per-row context the
  `after` phase never saw, so `readAffectedRows` answered `resolve-failed` and both
  subscribers took their safe branch: every bulk update or delete on a ruled object
  revoked **all** of that object's rule grants and queued a full asynchronous
  re-grant — once per matched row, with the repeats racing each other's re-grants.
  Access was never widened (the trade is the ruling's "over-granting is an
  incident, under-granting is a wobble" direction), but a bounded write now takes
  the bounded path again: the rows are unioned as the engine hands them over, the
  cap still applies to the union, and the `after*` work runs once per write.

  **File-reference ownership (`@objectstack/service-storage`).** The `beforeDelete`
  hook that pre-resolved ids for a `where`-shaped delete was dead on every path,
  and `afterDelete` was falling back to one `sys_file` lookup **per row** where the
  batch fits one `$in`. Both are fixed by the marker, and the pre-resolution query
  is gone entirely — the engine has already matched the rows and hands them over.
  The `beforeUpdate` copy-on-claim pass no longer runs once per row against a
  batch-scoped payload, which also removes a row-conditioned rewrite of a shared
  `SET` clause (out of contract under ADR-0058 Addendum II D3).

  No authored metadata changes, and no write's result, event or return contract
  changes.

- 8e13ca8: fix(plugin-sharing): share-link 路由把完整授权信封交给 enforcement,修复 `group` 姿态下建链恒 403(#6206,裁决 A 案的消费半边)

  `SharingServicePlugin` 的 share-link 路由此前在 `resolveAuthzContext` 之后重新
  拼一个四字段对象(`userId` / `tenantId` / `positions` / `permissions`),而这个
  对象被原样当作 enforcement context 喂进 `engine.find` —— 即 [Finding-2]
  「只能为你自己看得见的记录建链接」那道可见性校验。被丢在半路的是
  `accessible_org_ids`、`org_user_ids`、`systemPermissions`、`posture`、
  `tabPermissions`。

  实害(已复现,非仅代码读出):`group` 租户姿态下 `accessible_org_ids` 就是
  Layer 0 那堵墙(ADR-0105 D2),集合缺席即判否(fail closed)。于是可见性校验
  查不到任何行,建链接对**调用方本来读得到的记录**返回
  `403 FORBIDDEN: Not permitted to share <object>/<id>` —— 一个已发布姿态上,
  已发布功能完全不可用。`single` 姿态(默认)不读该字段,行为不变。

  改法按维护者 2026-08-07 的 A 案裁决(契约半边 #6430 / PR #6511 已落):信封
  **整个**透传(`{ ...authz, isSystem: false }`),不再逐字段挑选 —— 逐字段挑选正是
  这条缝出问题的方式,也是下一个新增授权维度会再次漏掉的地方。`posture` 随上下文
  流动、不在 enforcement 处重推(ADR-0095 D2)。窄类型 `ShareLinkExecutionContext`
  保留,但只服务路由自己的 401 判定(认证与否),不再出现在任何裁决路径上。

  `ShareLinkService.createLink` / `revokeLink` / `listLinks` 与 `canManageShares`
  探针的参数类型随之收成完整 `ExecutionContext`,与 #6511 落地的契约一致。

- 3415a61: refactor(plugin-sharing,plugin-audit): enforcement implementations annotate the full `ExecutionContext` (#7136)

  The consumer half of #6523. That change converged 36 contract signatures onto
  the complete `resolveAuthzContext` envelope, applying the #6206 ruling —
  enforcement adjudicates on the whole envelope, never a per-site subset. The
  implementations behind those contracts still annotated their own parameters
  with `SharingExecutionContext`, the six-field shape the contracts used to name,
  so nothing they could _read_ had widened.

  `SharingService`, `SharingRuleService`, the sharing exec-context seam and
  plugin-audit's comment-access gates now declare `ExecutionContext` on all 27 of
  those parameters — plus the two return types that produce the contexts feeding
  them — and the casts the narrow annotation forced are gone:

  - `exec-context-seam.testkit.ts` resolved a REAL context and then had to force
    it into the narrow type — `{ ...authz, isSystem: false } as unknown as
SharingExecutionContext`. It now returns what it resolved, so a drift in
    `resolveAuthzContext`'s output reaches the tests that trust this seam instead
    of being absorbed by a double cast.
  - `SharingRuleService`'s system context is typed as the envelope and passed as
    itself, retiring `SYSTEM_CTX as any` at all 10 of its call sites — an erasure
    on an enforcement input switches checking off for the whole argument, not
    just for the readonly-array mismatch that provoked it.
  - The `(context as any).userId` / `.tenantId` reads in `SharingService` now read
    declared fields.

  **No runtime behaviour changes.** The values were always complete — this
  family's damage was type-side — so every gate answers exactly what it answered
  before. Method parameters only WIDEN what they accept, so no caller is affected.

  Two casts are deliberately kept, and are now documented where they sit:
  `__readScope` / `__writeScope` are private keys plugin-security's middleware
  stamps onto the context it forwards and are not fields of the envelope, and
  `organizationId` is not on the envelope at all — that spelling has its own
  history (#5858 / `check:org-identifier`) and was held out of this change.

  Because a re-narrowed annotation would compile, ship and pass every test in
  these packages, the convergence is pinned by a new compile-time module,
  `exec-context-annotation.pin.ts`: it hands each enforcement parameter a fresh
  literal naming envelope-only fields (`posture`, `accessible_org_ids`,
  `org_user_ids`), which TypeScript's excess-property check rejects the moment a
  parameter narrows back, plus negative cases so a parameter erased to `any`
  cannot pass either.

- 17688fe: fix(sharing): the by-id write gate defers to an app-authored RLS widener instead of hard-refusing (#5493)

  HotCRM's 17.0 GA acceptance sweep declared two RLS update-wideners on one
  profile and measured one of them working. On the junction object
  `crm_campaign_member` a non-owner PATCH returned 200; on `crm_campaign` the
  identical shape returned 403 `FORBIDDEN: insufficient privileges to update
crm_campaign`. That sentence is the sharing middleware's, not the row gate's
  `(row-level security)` — so the refusal landed **before** RLS was consulted and
  the declared widener was never asked.

  The discriminator was never "carries sharing rules". It is whether **record
  sharing enforces on the object at all**: `checkEdit` abstains — and `canEdit`
  therefore answers `true`, letting the write through to RLS — when the effective
  sharing model is `public` (which `controlled_by_parent` maps onto) or when the
  schema has no `owner_id` field. A junction lands in that set; an ordinary owned
  business object does not. Same declaration, opposite outcome, split by a
  property no author writes down.

  Row-level write authority is ONE composite determination (maintainer ruling on
  #5492), so the middleware no longer ends the decision by itself. Before it
  hard-refuses a **by-id** update or delete, it asks the security service's
  `ISecurityService.checkAuthoredRowWrite` — the fail-closed verdict landed by
  #5493 step 1 (PR #6841) — whether an **app-authored** (non-floor) row-level
  policy admits this row for this operation. `admit` retracts this authority's
  refusal and hands the row to the security pre-image gate, which composes per
  #6684/#5492 and makes the final row decision. It does not authorize anything on
  its own.

  Everything else is unchanged, deliberately:

  - **The guarded surface does not shrink.** A member with no authored policy, no
    share and no bypass is still refused; a read-level share still never widens a
    write; an `edit`-level share still widens update and not delete (ADR-0111 D3),
    and an update-only authored widener does not open delete either — the verb is
    threaded through to the verdict, not collapsed.
  - **Fail-closed on every non-`admit` outcome.** No security service (a
    deployment without `@objectstack/plugin-security`), a service predating the
    method, a throwing probe, a principal-less context, an on-behalf-of context
    (ADR-0090 D10) and any unrecognised verdict all leave today's refusal
    byte-for-byte intact. The probe is reached through the same structural
    late-binding this plugin already uses for `hasWriteBypass`; no runtime
    dependency on `plugin-security` is introduced.
  - **A creator who is no longer the owner gets nothing back.** The platform's own
    ownership floor (`created_by == current_user.id`, shipped on the additive
    `member_default` baseline) matches a record transferred away from its creator,
    so a deferral keyed on "the composed RLS admits this row" would return
    transferred records to former creators. The verdict is provenance-aware and
    abstains there; the deferral does not widen it.
  - **The bulk path is untouched** — it composes a filter rather than a verdict,
    and is tracked separately (#6736).
  - **Objects with no owner field are untouched** (#6698): sharing abstains, the
    gate never refuses, so the deferral is never reached and the platform
    `created_by` write floor remains their only row-level write gate.

- fd6572b: feat(plugin-sharing): an `isSystem` write batch that materialises zero sharing grants now says so, once (#6783)

  The sharing-rule record-write hooks skip `isSystem` sessions, so a seed run — or
  any internal write batch — lands rows on an object an **active** sharing rule
  covers and creates no `sys_record_share` rows at all. The skip is correct: the
  `kernel:bootstrapped` backfill reconciles every rule and `evaluateRule` is
  idempotent, so the state heals. What was wrong is that nothing said so.

  hotcrm#640 is the specimen: a fresh install with 9 active sharing rules, 9
  accounts matching their criteria, users holding the right positions — and an
  empty `sys_record_share`. Every visible layer said "configured". The only way to
  learn that the seed path had skipped materialisation was to query the table,
  find it empty, and read `plugin-sharing`'s source.

  **What changed.** The two skips that drop grant materialisation — `afterInsert`
  and `afterUpdate` — now emit one INFO line naming the behaviour and both
  remedies:

  ```
  [sharing-rule] sharing materialisation skipped for isSystem writes; re-evaluate rules or restart to backfill
  ```

  with the object and the active rules on it as metadata.

  **One line per batch, not per row.** The notice is latched per object per hook
  binding generation, so a seed batch writing 500 rows produces exactly one line.
  The defect being fixed is silence; a per-row flood would be the same defect with
  a different symptom. The latch re-arms with the binding — `bindRuleRebindTriggers`
  re-binds the package on every `sys_sharing_rule` write — so a changed rule set
  gets its own notice instead of inheriting the previous generation's silence.

  **INFO, not warn or error**, deliberately: the behaviour is correct and
  self-healing, and warning about a subsystem working as designed is how operators
  learn to ignore it.

  Deliberately unchanged:

  - **The skip itself.** No write now materialises grants that did not before, and
    no `sys_record_share` row is created, updated or revoked by this change.
  - **No new switch or flag.** The notice is unconditional.
  - **`afterDelete` stays silent.** A delete skips _revocation_, not
    materialisation, and the remedy the line names cannot repair that class:
    `evaluateRule` iterates records that still exist, so neither re-evaluating a
    rule nor restarting can reach a grant whose record is gone. That class belongs
    to the record-delete share cascade and the boot orphan sweep.

  The line is a statement about the write path, not a claim that grants were owed —
  whether a given seeded row satisfies a rule's criteria is exactly the query the
  skip exists to avoid, so answering it here would cost the skip its purpose.

- 2465133: fix(plugins): sweep the service-lookup erasures out of the plugin composition roots, and fix the two alias-only HTTP reads it exposed (#4251 B5)

  Batch B5 of the #4251 sweep: the seven remaining `packages/plugins/*` composition
  roots. 35 lookup sites that had been erased to `any` now carry the slot's
  contract, so the compiler checks what each plugin actually calls on the service
  it resolved. The ratchet drops 143 sites / 32 files to 108 / 25.

  **Two real defects, both of the shape this sweep exists to find.** Approvals'
  actionable-link pages (ADR-0043) and sharing's public share-link REST routes each
  read the HTTP server under `http-server` _only_ — the deprecated alias. The
  ledger records `http.server` as canonical and as the only name present on every
  provider path: `runtime.ts`'s `config.server` path registers no alias at all. On
  that path both lookups threw, the surrounding `catch` swallowed it, and the
  routes silently never mounted — approval e-mail action links 404'd and the
  share-link surface was absent, with nothing in the log to say so. Both reads are
  now canonical-first with the alias as fallback, each name in its own `try`
  because `getService` throws on an empty slot (so `a() ?? b()` inside one `try`
  never reaches `b` — the same correction #4393 made in metadata and
  cloud-connection).

  Typing choices follow the batch method: pure data-plane consumers take the
  narrow contract (`IDataEngine` in reports), consumers that bind hook or
  middleware seams take the engine seen whole (`IObjectQLEngine` in approvals,
  sharing and pinyin-search), and slots with no contract get a **named** local
  surface rather than `any` — plugin-email's `MailSettingsSurface`, and the
  surfaces the consuming packages already declared (`ApprovalMessagingSurface`,
  `SharingSecurityProbe`, `ReportEmail`). A named surface that omits a member
  still makes the compiler name every call site; `any` says nothing.

  No behaviour change beyond the two alias reads. No contract changes.

- Updated dependencies [3d5c090]
- Updated dependencies [e5bd768]
- Updated dependencies [e027b3e]
- Updated dependencies [c2429b0]
- Updated dependencies [445a0c2]
- Updated dependencies [f6609e6]
- Updated dependencies [a70358a]
- Updated dependencies [97e7e3c]
- Updated dependencies [8828b9e]
- Updated dependencies [53068c1]
- Updated dependencies [ee58392]
- Updated dependencies [f16e54e]
- Updated dependencies [06be54e]
- Updated dependencies [259459d]
- Updated dependencies [3f7f14e]
- Updated dependencies [6968885]
- Updated dependencies [eaed61f]
- Updated dependencies [debe2f6]
- Updated dependencies [97b0798]
- Updated dependencies [5fa04fb]
- Updated dependencies [ad878e7]
- Updated dependencies [43a7a8d]
- Updated dependencies [73f69dc]
- Updated dependencies [04c56aa]
- Updated dependencies [3028326]
- Updated dependencies [b3efeb7]
- Updated dependencies [ddd075a]
- Updated dependencies [88154be]
- Updated dependencies [fe2dfa1]
- Updated dependencies [6f6fec7]
- Updated dependencies [e8dc61e]
- Updated dependencies [2f3e793]
- Updated dependencies [d8e8d9c]
- Updated dependencies [94e749b]
- Updated dependencies [ea1d916]
- Updated dependencies [ae31a19]
- Updated dependencies [b230e5e]
- Updated dependencies [5d24f4b]
- Updated dependencies [29b94ed]
- Updated dependencies [07c68b0]
- Updated dependencies [f6cd635]
- Updated dependencies [e0f300b]
- Updated dependencies [10c4ea9]
- Updated dependencies [62b6a2f]
- Updated dependencies [5b4780b]
- Updated dependencies [a933452]
- Updated dependencies [8140915]
- Updated dependencies [7b48cf9]
- Updated dependencies [b5404f4]
- Updated dependencies [f764691]
- Updated dependencies [e120a5a]
- Updated dependencies [e9b5265]
- Updated dependencies [e650d67]
- Updated dependencies [04476e7]
- Updated dependencies [79228cd]
- Updated dependencies [b3363e9]
- Updated dependencies [2ef1807]
- Updated dependencies [d03fe25]
- Updated dependencies [2672f85]
- Updated dependencies [11066f6]
- Updated dependencies [916af17]
- Updated dependencies [84c86fb]
- Updated dependencies [2a2a9fb]
- Updated dependencies [a2e157c]
- Updated dependencies [95c4227]
- Updated dependencies [2a61116]
- Updated dependencies [d4df105]
- Updated dependencies [55da611]
- Updated dependencies [e2798fa]
- Updated dependencies [0fd8556]
- Updated dependencies [6fde910]
- Updated dependencies [9c82b89]
- Updated dependencies [74155c7]
- Updated dependencies [742a6a5]
- Updated dependencies [6908830]
- Updated dependencies [8b06bba]
- Updated dependencies [b7d3be4]
- Updated dependencies [2a0d65e]
- Updated dependencies [4c54037]
- Updated dependencies [0f7157b]
- Updated dependencies [d9bef45]
- Updated dependencies [f549a0d]
- Updated dependencies [82da264]
- Updated dependencies [f586f1a]
- Updated dependencies [9b9b70f]
- Updated dependencies [f5a9bc2]
- Updated dependencies [881a3cc]
- Updated dependencies [ad6317b]
- Updated dependencies [d5e9f6e]
- Updated dependencies [8a88885]
- Updated dependencies [5f7669e]
- Updated dependencies [becbe53]
- Updated dependencies [b127c8b]
- Updated dependencies [a80302a]
- Updated dependencies [474f131]
- Updated dependencies [050cd82]
- Updated dependencies [4d552af]
- Updated dependencies [44d677c]
- Updated dependencies [c32944d]
- Updated dependencies [1dd780f]
- Updated dependencies [cafec0a]
- Updated dependencies [c8d6f6e]
- Updated dependencies [92a67f2]
- Updated dependencies [9136327]
- Updated dependencies [bf0ae99]
- Updated dependencies [edb4af0]
- Updated dependencies [f09a2e7]
- Updated dependencies [cb3b6cd]
- Updated dependencies [73b7234]
- Updated dependencies [d2b97c3]
- Updated dependencies [59b794f]
- Updated dependencies [fc3a36a]
- Updated dependencies [69787f0]
- Updated dependencies [5d022a1]
- Updated dependencies [042b9ee]
- Updated dependencies [55011af]
- Updated dependencies [f549a0d]
- Updated dependencies [a36db28]
- Updated dependencies [3f8817a]
- Updated dependencies [a2443e3]
- Updated dependencies [e1554b1]
- Updated dependencies [53ef057]
- Updated dependencies [4856789]
- Updated dependencies [c3f4916]
- Updated dependencies [33e0385]
- Updated dependencies [2205363]
- Updated dependencies [09fe58d]
- Updated dependencies [d0a5ceb]
- Updated dependencies [e18a162]
- Updated dependencies [d6d1a50]
- Updated dependencies [d127ff0]
- Updated dependencies [c804f19]
- Updated dependencies [9b86cf6]
- Updated dependencies [8825a06]
- Updated dependencies [5087ac6]
- Updated dependencies [6965160]
- Updated dependencies [2d1ddf0]
- Updated dependencies [354b00f]
- Updated dependencies [3de535b]
- Updated dependencies [fe2e15a]
- Updated dependencies [dbe92a7]
- Updated dependencies [c6b6bb4]
- Updated dependencies [59c544d]
- Updated dependencies [2f59da0]
- Updated dependencies [114e727]
- Updated dependencies [5e247fd]
- Updated dependencies [1a53a02]
- Updated dependencies [1507ba3]
- Updated dependencies [8ad609c]
- Updated dependencies [bbee302]
- Updated dependencies [08863dd]
- Updated dependencies [56664f5]
- Updated dependencies [31cbe90]
- Updated dependencies [bf42e76]
- Updated dependencies [90bbf25]
- Updated dependencies [eb91eba]
- Updated dependencies [42da73d]
- Updated dependencies [643b7c7]
- Updated dependencies [bfe689b]
- Updated dependencies [d0d5205]
- Updated dependencies [1a15893]
- Updated dependencies [b70e534]
- Updated dependencies [2233a85]
- Updated dependencies [de43f94]
- Updated dependencies [62dd69a]
- Updated dependencies [e15e679]
- Updated dependencies [2ab1257]
- Updated dependencies [4cc4fb7]
- Updated dependencies [28d1eb7]
- Updated dependencies [2c26040]
- Updated dependencies [f758cec]
- Updated dependencies [3fb42d2]
- Updated dependencies [78f0be8]
- Updated dependencies [35f7fb4]
- Updated dependencies [a5302c7]
- Updated dependencies [82397b6]
- Updated dependencies [4df747c]
- Updated dependencies [7084313]
- Updated dependencies [47a4e67]
- Updated dependencies [91cefb8]
- Updated dependencies [9bc846b]
- Updated dependencies [0e043d8]
- Updated dependencies [4fedb11]
- Updated dependencies [dadd1ad]
- Updated dependencies [2f2e63c]
- Updated dependencies [486d526]
- Updated dependencies [89d7b35]
- Updated dependencies [d13f627]
- Updated dependencies [a841151]
- Updated dependencies [85ec26d]
- Updated dependencies [f6476fc]
- Updated dependencies [4ac12ef]
- Updated dependencies [1788e19]
- Updated dependencies [b88f5e8]
- Updated dependencies [42cc219]
- Updated dependencies [d42a92f]
- Updated dependencies [51d74ad]
- Updated dependencies [d7e0b42]
- Updated dependencies [3510e4a]
- Updated dependencies [aa4b90d]
- Updated dependencies [54299ca]
- Updated dependencies [1f6ed16]
- Updated dependencies [dc61def]
- Updated dependencies [251e888]
- Updated dependencies [183b4c4]
- Updated dependencies [2fdb36e]
- Updated dependencies [e787608]
- Updated dependencies [20526f5]
- Updated dependencies [c5eef1d]
- Updated dependencies [e0f300b]
- Updated dependencies [761a0ba]
- Updated dependencies [d86815e]
- Updated dependencies [61282f9]
- Updated dependencies [be87153]
- Updated dependencies [60f0dd8]
- Updated dependencies [a87c5cd]
- Updated dependencies [a47f338]
- Updated dependencies [e13fd91]
- Updated dependencies [2bd4e5e]
- Updated dependencies [2598216]
- Updated dependencies [2c7e62d]
- Updated dependencies [eb7613c]
- Updated dependencies [ecc9110]
- Updated dependencies [f7bd4e2]
- Updated dependencies [361bd5b]
- Updated dependencies [129b378]
- Updated dependencies [88f9d94]
- Updated dependencies [1818998]
- Updated dependencies [09ee21c]
- Updated dependencies [f549a0d]
- Updated dependencies [3fc2e48]
- Updated dependencies [e8f435c]
- Updated dependencies [41610f6]
- Updated dependencies [c9bf940]
- Updated dependencies [a682670]
  - @objectstack/spec@17.0.0-rc.6
  - @objectstack/objectql@17.0.0-rc.6
  - @objectstack/platform-objects@17.0.0-rc.6
  - @objectstack/formula@17.0.0-rc.6
  - @objectstack/core@17.0.0-rc.6
  - @objectstack/types@17.0.0-rc.6

## 17.0.0-rc.5

### Patch Changes

- Updated dependencies [e8f8f6c]
- Updated dependencies [7f713b6]
- Updated dependencies [c960170]
- Updated dependencies [def5919]
- Updated dependencies [ee3bde1]
- Updated dependencies [ce0cfe9]
- Updated dependencies [1363084]
- Updated dependencies [148d451]
  - @objectstack/spec@17.0.0-rc.5
  - @objectstack/objectql@17.0.0-rc.5
  - @objectstack/core@17.0.0-rc.5
  - @objectstack/formula@17.0.0-rc.5
  - @objectstack/platform-objects@17.0.0-rc.5
  - @objectstack/types@17.0.0-rc.5

## 17.0.0-rc.4

### Patch Changes

- 7f955e5: fix(sharing): deleting a record now revokes every `sys_record_share` row on it, whatever the source (#5103)

  A share row says "principal P has level L on (object O, record R)". Delete R and
  the row describes nothing — yet until now it stayed in the table forever.

  #4779 (PR #5102) bound an `afterDelete` for this, but inside the sharing-RULE
  package, where two conditions fenced it in: it revokes only `source: 'rule'`
  rows, and it binds only on objects that appear in `sys_sharing_rule`. So an
  object that uses nothing but MANUAL shares — a `sharingModel: 'private'` object
  with no rule ever configured — had no delete hook at all, and **manual share +
  record delete = a permanent orphan**.

  Today the harm is bounded, and only because record ids are never reused: the
  `record_id IN (…)` predicate `buildReadFilter` emits matches nothing. Nothing
  enforces that assumption. A custom primary key, an import that preserves ids, or
  any future id recycling turns every one of those rows into a real privilege
  escalation — a new record landing on a recycled id inherits the dead record's
  recipients outright. Secondarily, `sys_record_share` grew without bound and
  Setup's Record Shares list showed rows pointing at nothing.

  **What changed**

  - **A record-delete cascade on every sharing-capable object.** `plugin-sharing`
    binds one `beforeDelete`/`afterDelete` pair with no object filter and judges
    the object's sharing posture from its `sharingModel` metadata _per delete_.
    Nothing is enumerated at boot, so nothing goes stale: an object that gains
    `sharingModel` at runtime is covered on its very next delete, with no rebind.
    Bounded deletes (a scalar id, an `$in` list, or a predicate matching at most
    1000 rows) are revoked synchronously and set-based; an unbounded one queues an
    object-scoped orphan sweep instead. System-context deletes cascade too.
  - **A boot-time orphan sweep keyed on record existence.** On
    `kernel:bootstrapped`, share rows whose RECORD no longer exists are revoked —
    historical orphans, rows a failed hook missed, and the one posture the cascade
    deliberately skips (an unmarked system object). This is a different question
    from the existing `sweepOrphanedRuleGrants`, which asks whether the RULE row
    still exists and therefore can never see a manual share. Bounded per boot:
    keyset pages, one batched existence probe per object per page, and a scan cap
    that reports when it stopped early. An object whose existence probe FAILS has
    its rows left in place — "could not ask" is never read as "the record is gone".

  **What did not change**

  Rule _recompute_ still never touches a manual share. That boundary (#5102) is
  the point: while the record exists, a manual grant is a human decision no rule
  evaluation may overrule. Only the record's DELETION revokes it, and only because
  there is no longer anything to have access to.

  New exports for hosts that compose the plugin by hand:
  `bindRecordShareCascade` / `unbindRecordShareCascade`,
  `objectCanCarryRecordShares`, `SharingService.revokeSharesForDeletedRecords`,
  `SharingService.sweepOrphanedRecordShares`, and `effectiveSharingModel`. Nothing
  was removed or renamed; the standard `SharingServicePlugin` composition needs no
  changes.

- 6e66cbe: fix(plugin-sharing): a deleted record kills its share links — resolve fails closed, and the delete cascades (#5190)

  `ShareLinkService.resolveToken` checked the token, `revoked_at`, `expires_at`,
  the audience and the password — **but never whether the record the link points
  at still exists**. Nothing revoked links on delete either: #5103's cascade
  covers `sys_record_share` only. So a share link outlived its record, kept
  resolving, and kept stamping `use_count` / `last_used_at`.

  That is worse than the `sys_record_share` orphan #5103 fixed, and for a
  structural reason: a share row names its beneficiaries, while a share link is an
  identity-less **capability token** — holding the URL _is_ the authorisation. The
  moment a record id is reused (custom primary keys, an import that preserves ids,
  any future id recycling) a link that morally died with its record starts
  authorising a brand-new record, for whoever kept it.

  Both halves of the fix ship together, and the first does not depend on the
  second having run:

  - **`resolveToken` re-asks whether the record exists**, and returns `null`
    through the _same_ branch as revoked / expired — no distinct code, no distinct
    error, nothing an unauthorised holder can read "that record was deleted" out
    of. The probe sits after the cheap in-memory gates (a revoked link still costs
    no query) and _before_ the usage stamp, so a dead record no longer ticks
    `use_count` / `last_used_at`. It fails **closed**: a probe that throws denies,
    because "cannot ask" must not authorise.
  - **Record deletes now cascade to `sys_share_link`**, on #5103's existing seam
    rather than a parallel one — the same global `beforeDelete` row-set stash, the
    same `afterDelete` set-based revoke, the same serialized sweep queue for
    unbounded deletes, and the same `kernel:bootstrapped` orphan sweep (keyset
    pages, a scan cap that reports itself, one batched existence probe per object
    per page, and rows left strictly alone when that probe fails). The two halves
    are isolated, so a driver error reclaiming grants cannot also skip the tokens.

  The link half judges posture from `publicSharing`, which is _independent_ of
  `sharingModel`: the object most likely to hold links is a platform object that
  opted into link sharing, and that is exactly the object the record-share
  predicate skips. `publicSharing` declared counts even when it is currently
  `enabled: false` — links minted while it was on outlive the flip.

  An orphaned link row is **deleted**, not stamped `revoked_at`: its subject is
  gone, so there is no live link left to keep a revocation record of, and the
  table would otherwise only grow (with Setup's link lists pointing at records
  that no longer exist). Links an admin revokes keep their audit row exactly as
  before.

  No metadata, spec or API shape changes. Deployments see fewer rows in
  `sys_share_link` after the next boot, and links whose record was already deleted
  stop resolving immediately — which is the point.

- f226605: fix(plugin-sharing): hierarchy resolver 拿到调用方真实的活动组织(权威 `organizationId`)(#5859)

  `resolveOwnerScopeIds` 构造 `HierarchyScopeContext` 时读的是
  `(context as any).organizationId` —— **仓内没有任何传输层写过这个键**。REST
  (`rest-server.ts`)和 runtime dispatcher(`resolve-execution-context.ts`)都从同一个
  授权解析器 `resolveAuthzContext` 组装执行上下文,活动组织落在 `tenantId`
  (session 路径 = `session.activeOrganizationId`,API-key 路径 = `sys_api_key.organization_id`),
  `ExecutionContext` 的字段注释写的也正是这句。所以这个读取**结构性恒为 `null`**:
  自 ADR-0057 以来,每一次 DEPTH(`unit` / `unit_and_below` / `own_and_reports`)解析
  都是在**没有组织约束**的前提下跑的,而企业版 resolver 只按 `organizationId` 收窄
  自己的 owner 集合 —— 于是整条 DEPTH 租户隔离从未生效。

  爆炸半径不止「共享管理」一路:同一个 owner 集合喂给 `matchesOwnerScope` →
  `canEdit` / `canDelete`,以及批量写路径 `buildWriteFilter`。#5852 的实测里,
  `group` 姿态下的普通成员对**兄弟组织**记录 `POST /data/:obj/:idB/shares` 得到
  **201**;探针那个 app 的写路径另被 `member_default` 的 `owner_only_writes`
  (keyed on `created_by`)挡下,所以只观测到共享管理一路 —— **不带这条 owner-only
  RLS 的部署,跨组织 edit/delete 同样放行**。

  本次修复(producer 半边,契约半边见 #5858 / PR #5973):

  - 权威字段 `organizationId` 由执行上下文的活动组织填充;`tenantId` 作为
    `@deprecated` 兼容别名原样继续携带(不是消费端 `?? tenantId` 兜底 —— 那正是
    #5858 为 resolver 明令排除的宽容消费者形状)。同样的映射在
    `@objectstack/plugin-security` 的 Layer-0 租户墙里早已在用
    (`computeTenantLayer0Filter({ organizationId: context?.tenantId })`),两层
    enforcement 现在按同一个字段的同一个值收窄。
  - 无活动组织时如实传 `null`(契约类型即 `string | null`),空白字符串归一为
    `null`,绝不让一个假的组织 id 混进 resolver 的查询与日志。
  - resolver 抛错的静默回退改为**留声**(`logger.warn`):此前「resolver 炸了」和
    「层级里确实没有别人」在外部完全同形,这也是本缺陷长期不可见的原因之一。

  ## 姿态感知的组织门(user-visible 行为变化)

  `SharingService` 新增一个 late-bound 的 `tenancy` 姿态探针(读法与 `SecurityPlugin`
  为 Layer-0 墙读 `tenancy` 服务的完全一致,由 `SharingServicePlugin` 自动接线),
  按 **ADR-0105 D1** 的既有分叉决定「没有活动组织」意味着什么 —— 与
  `computeTenantLayer0Filter` 对同一问题给出的答案逐条同形:

  - **`single`**(纯单租户,无组织):**行为不变**,DEPTH 照常 widened。此处「没有组织」
    是那一个隐含租户,不是「所有组织」。
  - **`group` / `isolated`**(有墙):权威组织缺失/空白 → **拒绝**,根本不咨询 resolver,
    回落 owner-only 并打一条点名 ADR-0095 D1 / ADR-0105 D1 与 #5973 契约义务的 `warn`。
    即:有墙部署里,缺组织的 owner-scope 解析从「按无租户约束展开」变为「拒绝展开」。
  - **姿态解析不出**(未接线 / 探针抛错 / 词表外的值)→ 按**有墙**处理。未知姿态不是
    `single` 的证据,否则恰恰在配置已经可疑的部署上恢复了展开。

  对已有部署的影响:`single` 部署零变化;`group` / `isolated` 部署中,一个**没有活动
  组织**的调用方将不再通过 DEPTH 拿到跨组织的 owner 集合(共享管理 / edit / delete /
  批量写四条路径同时闭合)。

- c272e48: fix(plugin-sharing): recompute sharing rules for predicate (`multi`) writes — stale `sys_record_share` grants no longer survive a bulk update (#4779)

  `bindRuleHooks` located the rows to recompute from a single record id:

  ```ts
  const id = String(data?.id ?? ctx?.input?.id ?? "");
  if (!id) return;
  ```

  `ObjectQL.update()` only populates `input.id` when `where.id` is a scalar. A
  predicate write (`multi: true`) routes to `updateMany`, leaves `input.id`
  undefined, and carries no id in its payload — so **every bulk write skipped
  sharing-rule recompute entirely**.

  The consequence is a fail-open on the authorization side. A criteria-based rule
  materialises `sys_record_share` rows; an admin then bulk-updates those records
  out of the criteria (`{ where: { region: 'east' }, multi: true, data: { region:
'west' } }`); nothing recomputes, the grant rows stay in the table, and the
  recipients keep the read/edit access the rule no longer implies. Same family as
  #4757 (`sys_attachment`) and #4778 (approval locks), but better hidden — a stale
  grant is indistinguishable from a legitimate one. The reverse direction (bulk
  update **into** a rule's criteria never granting) was broken too.

  **What changes**

  The hooks now key off the write's ROW SET instead of one id. `beforeUpdate` /
  `beforeDelete` resolve the affected rows from the predicate and stash them on
  the shared hook context (the `before` hook is where it must happen — the write
  is what makes those rows unfindable); the `after` hook acts on them:

  - **Bounded set (≤ 1000 rows, `RULE_RECOMPUTE_ROW_CAP`)** — `evaluateAllForRecord`
    per row, synchronously. Diff-based, so this covers both directions: rows moved
    out of a rule's criteria are revoked, rows moved in are granted.
  - **Unbounded set** (over the cap, `multi: true` with no `where` at all, or a
    resolve that failed) — every `source: 'rule'` grant on the object is revoked
    **synchronously** in one set-based statement, and the deserved grants are
    restored **asynchronously** by reconciling the object's rules.

  **The write is never refused.** Refusing would turn an internal recompute bound
  into a business-visible limit on how many rows an admin may update, reported by
  a subsystem they never configured. The asymmetry it trades on instead:
  over-granting is a security incident, under-granting is an availability wobble.
  So the safety half is always synchronous and complete, and only the expensive
  restoration half is deferred.

  **Operational note.** After a bulk write whose row set could not be bounded,
  recipients may briefly lose access to records they still qualify for, until the
  background re-grant finishes. It is logged with the object and the reason. The
  re-grant is in-process; if it is lost to a crash, the plugin's existing
  `kernel:bootstrapped` backfill re-runs the same idempotent reconcile on the next
  start, and any subsequent `sys_sharing_rule` write reconciles too.

  **Also fixed:** the rule hooks now bind `afterDelete` and retire the deleted
  records' rule grants. Nothing else could: `evaluateRule` iterates records that
  still exist, so a grant whose record is gone was unreachable by every reconcile
  path and outlived restarts. Harmless only while record ids are never reused —
  an assumption nothing in the platform enforces.

  New on `SharingRuleService`: `revokeRuleGrantsForObject`,
  `revokeRuleGrantsForRecords` and `evaluateAllRulesForObject`. Manual
  (`source: 'manual'`) shares are never touched by any of them.

- 69a89ce: fix(plugin-security,plugin-sharing): the write path consults the View/Modify All Data bypass — one predicate for `security/explain` and `/data` (#4647)

  A **Modify All Data** holder, a `sharingModel: 'private'` object, and a record
  whose `owner_id` is NULL got two opposite answers for one
  (principal, record, operation) triple:

  ```
  POST /api/v1/security/explain  { object, operation: 'update', recordId }
    → allowed: true, layers[vama_bypass]: "View/Modify All Data bypass held
      via [admin_full_access] — ownership and sharing checks are skipped"
  PATCH /api/v1/data/crm_contract/<id>
    → 403 FORBIDDEN
  ```

  Filling `owner_id` in made the same PATCH succeed, so the write path really was
  running the record-level ownership check the bypass layer said had been skipped.
  `sys_attachment`'s `canEdit(parent)` gate agreed with the 403, not with explain.
  Ownerless rows are not exotic: a system-context seed writes them by design (the
  seed loader disables `owner_id` injection).

  **The write path was the side that was wrong.** Modify All Data means an admin
  edits any record regardless of ownership (the Salesforce reference frame this
  platform's `modifyAllRecords` already follows, #1883), so:

  - `SharingService.canEdit` / `canDelete` now consult the super-user write bypass
    **after** ownership and shares have failed, through the existing late-bound
    `ISecurityService.hasWriteBypass` probe. The `sys_attachment`
    `canEdit(parent)` gate and the sharing-rule management gate reach the same
    answer because they call the same function.
  - The bypass they consult and the one `security/explain` reports are now **one
    predicate** — `PermissionEvaluator.superuserBypassSets` — rather than two
    independent readings of the permission sets. A cross-path test pins the triple
    through both `explain` and the real write middleware chain and asserts they
    agree, for update, delete and the attachment gate.

  **The widening is exactly Modify-scoped.** `viewAllRecords` ("View All Data") is
  a read power and never grants write: explain's `vama_bypass` layer is now
  operation-aware, asking for the modify bit on a write and the view bit on a read,
  and a view-only holder is refused on both paths. The probe still fails **closed**
  — no `@objectstack/plugin-security`, a throwing probe, a principal-less or
  on-behalf-of context all degrade to owner-only.

  **Explain payload self-consistency.** For a record-grained request the top-level
  `allowed` and the `record` verdict no longer contradict each other on this
  triple: the row is `visible: true` with `decidedBy: 'vama_bypass'`, the
  `vama_bypass` layer carries its own per-record attribution, and the `sharing`
  layer credits the bypass instead of reporting "no ownership and no edit/full
  share grants write" next to `allowed: true`. Where the bypass is not what
  admitted the row (owner, or an admitting share) the previous `decidedBy` is
  unchanged. Note that for a principal with **no** bypass, an object-level
  `allowed: true` beside `record.visible: false` remains correct and intended —
  `allowed` answers the object question, `record` answers the row question, and it
  is the `record` verdict that the write path mirrors.

- Updated dependencies [9fe9c1d]
- Updated dependencies [d4e0809]
- Updated dependencies [f724f69]
- Updated dependencies [28ad90e]
- Updated dependencies [f8644c7]
- Updated dependencies [306ca50]
- Updated dependencies [978fed2]
- Updated dependencies [cfc293f]
- Updated dependencies [de70b42]
- Updated dependencies [64cd010]
- Updated dependencies [fb3d99b]
- Updated dependencies [cdfbee2]
- Updated dependencies [29c6c9d]
- Updated dependencies [d21c001]
- Updated dependencies [f1cc3a3]
- Updated dependencies [ddc2527]
- Updated dependencies [553a47f]
- Updated dependencies [a3a884d]
- Updated dependencies [cfed092]
- Updated dependencies [c497d26]
- Updated dependencies [bbdbf28]
- Updated dependencies [2e284b2]
- Updated dependencies [3905c00]
- Updated dependencies [4335497]
- Updated dependencies [1b49eaf]
- Updated dependencies [0161c7f]
- Updated dependencies [e900015]
- Updated dependencies [b5bdf48]
- Updated dependencies [a019e52]
- Updated dependencies [64fc6d5]
- Updated dependencies [b746aa0]
- Updated dependencies [947d4f9]
- Updated dependencies [d8f65fe]
- Updated dependencies [58ffcab]
- Updated dependencies [eaaf03c]
- Updated dependencies [d17df80]
- Updated dependencies [7d0e7b5]
- Updated dependencies [6513c17]
- Updated dependencies [c142ced]
- Updated dependencies [eda599e]
- Updated dependencies [c001422]
- Updated dependencies [77022a9]
- Updated dependencies [52760bf]
- Updated dependencies [5543020]
- Updated dependencies [880d343]
- Updated dependencies [6e82972]
- Updated dependencies [4615a18]
- Updated dependencies [2b63a00]
- Updated dependencies [7f62706]
- Updated dependencies [667fa44]
- Updated dependencies [37e38d1]
- Updated dependencies [0f17114]
- Updated dependencies [1eb13a0]
- Updated dependencies [c52e608]
- Updated dependencies [afa6aa5]
- Updated dependencies [afb83d3]
- Updated dependencies [4dfd002]
- Updated dependencies [77be690]
- Updated dependencies [811c30c]
- Updated dependencies [b49ccfd]
- Updated dependencies [c7406b0]
- Updated dependencies [85d95e7]
- Updated dependencies [168f60f]
- Updated dependencies [244ca86]
- Updated dependencies [546ab3c]
- Updated dependencies [58f3220]
- Updated dependencies [07f1822]
- Updated dependencies [0b51bb6]
- Updated dependencies [08f93bc]
- Updated dependencies [d9971d3]
- Updated dependencies [eb3e650]
- Updated dependencies [abeb375]
- Updated dependencies [ef4efa8]
- Updated dependencies [cbb6a5c]
- Updated dependencies [290d944]
- Updated dependencies [02dc076]
- Updated dependencies [795b6e1]
- Updated dependencies [175d789]
- Updated dependencies [55dbbba]
- Updated dependencies [72c3c86]
- Updated dependencies [7f1a635]
- Updated dependencies [e98fb14]
- Updated dependencies [5d3ced9]
- Updated dependencies [0f2fdcd]
- Updated dependencies [8ffa8b9]
- Updated dependencies [674ac99]
- Updated dependencies [1b9a53b]
- Updated dependencies [1eadac0]
- Updated dependencies [7c2f7dd]
- Updated dependencies [9b26699]
- Updated dependencies [502564d]
- Updated dependencies [471839d]
- Updated dependencies [46365ab]
- Updated dependencies [b508244]
- Updated dependencies [594508e]
- Updated dependencies [1c625ca]
- Updated dependencies [71f205d]
- Updated dependencies [414395b]
- Updated dependencies [c5adfe1]
- Updated dependencies [26e1029]
- Updated dependencies [1cae606]
- Updated dependencies [108ba8d]
- Updated dependencies [b9cc17d]
- Updated dependencies [b4ad984]
- Updated dependencies [a9f32df]
- Updated dependencies [aeb9b27]
- Updated dependencies [7d27da0]
- Updated dependencies [0d24078]
- Updated dependencies [089767f]
- Updated dependencies [5b8f95b]
- Updated dependencies [2ddba89]
- Updated dependencies [e4c8b6c]
- Updated dependencies [acb10f6]
- Updated dependencies [1c3da1f]
- Updated dependencies [a34fd2e]
- Updated dependencies [37a8f2b]
- Updated dependencies [441d79f]
- Updated dependencies [889ae47]
- Updated dependencies [4f4c3fb]
- Updated dependencies [7adc841]
- Updated dependencies [4845f85]
- Updated dependencies [bf1edef]
- Updated dependencies [7b005b4]
- Updated dependencies [94f7b6a]
- Updated dependencies [5c94f83]
- Updated dependencies [73e576f]
- Updated dependencies [2680cd3]
- Updated dependencies [c5a5996]
- Updated dependencies [db2ea82]
- Updated dependencies [51a587d]
- Updated dependencies [ae490ef]
- Updated dependencies [f61c8cf]
- Updated dependencies [e3ef52b]
- Updated dependencies [07f1822]
- Updated dependencies [04fab5e]
- Updated dependencies [efedd28]
- Updated dependencies [5278e11]
- Updated dependencies [23dba62]
- Updated dependencies [ba98e26]
- Updated dependencies [d56bcdb]
- Updated dependencies [f104bab]
- Updated dependencies [fc5f536]
- Updated dependencies [f8cfbb4]
- Updated dependencies [488b66c]
- Updated dependencies [c89d18c]
- Updated dependencies [aac90a5]
- Updated dependencies [1e6ab15]
- Updated dependencies [c87ef70]
- Updated dependencies [3cb0618]
- Updated dependencies [32a0874]
- Updated dependencies [7055c22]
- Updated dependencies [785a748]
- Updated dependencies [3af0354]
- Updated dependencies [866ff16]
- Updated dependencies [5a85e67]
- Updated dependencies [946a131]
- Updated dependencies [909895d]
- Updated dependencies [c183a12]
- Updated dependencies [8064b07]
- Updated dependencies [4a56dbd]
- Updated dependencies [06df4fa]
- Updated dependencies [2b52bc8]
  - @objectstack/spec@17.0.0-rc.4
  - @objectstack/types@17.0.0-rc.4
  - @objectstack/core@17.0.0-rc.4
  - @objectstack/platform-objects@17.0.0-rc.4
  - @objectstack/objectql@17.0.0-rc.4
  - @objectstack/formula@17.0.0-rc.4

## 17.0.0-rc.2

### Major Changes

- 4b6cac7: feat(spec)!: resolve the three cross-form dual-source names — ShareRecipientType, TransformType, suggestFieldType (#4539)

  Three `dual-source-exports.baseline.json` rows where the two declarations
  sharing a name did not even share a FORM (type vs const, or two unrelated
  functions), so a wrong import-path pick had no shape overlap to hide behind
  and failed far from the cause. Each judged against a three-repo import-level
  scan (framework, cloud, objectui — the latter two contained zero references
  to all three names). All three rows are deleted from the baseline.

  **Renamed — `./contracts` `ShareRecipientType` → `RecordShareRecipientType`:**

  Two live concepts shared the name. The security zod enum
  (`user | team | position | unit_and_subordinates | business_unit`) is the
  authorable sharing-RULE recipient vocabulary and keeps the name. The contracts
  type describes a different thing — the `recipient_type` a `sys_record_share`
  ROW may carry — and its claim to "mirror spec/security" had been false since
  `group`→`team`/`guest` were retired there. Its member set is now aligned to
  the storage-side gate it actually mirrors, the `SysRecordShare`
  `recipient_type` select: `role` (never persistable, zero producers) is
  replaced by `position`. Only `user` is enforced (and written) today;
  `ISharingService.grant` keeps refusing every other value (ADR-0078).
  Fix: `import type { ShareRecipientType } from '@objectstack/spec/contracts'`
  (or from `@objectstack/plugin-sharing`, whose re-export is renamed in
  lockstep) → `RecordShareRecipientType`; code that named the `'role'` member
  was describing a value no row could ever hold — use the rule vocabulary
  (`SharingRuleRecipientType`) if a role recipient was meant.

  **Renamed — `./shared` `TransformTypeSchema` / `TransformType` →
  `FieldMappingTransformSchema` / `FieldMappingTransform`:**

  `./data`'s `TransformType` (the authorable import-mapping enum
  `none | constant | lookup | split | join | javascript | map`) is the live
  declaration and keeps the name. `./shared` exported `TransformType` as the
  inferred type of `TransformTypeSchema` — a differently-shaped discriminated
  union of transform CONFIG objects — with zero importers for either name in
  all three repos. The shared pair is renamed (not just the alias deleted):
  the docs generator derives `import type { X }` examples by stripping
  `Schema` from each schema const, so an alias-less `TransformTypeSchema`
  would have kept generating a reference to an export that no longer exists.
  Fix: `TransformTypeSchema` → `FieldMappingTransformSchema`,
  `import type { TransformType } from '@objectstack/spec/shared'` →
  `FieldMappingTransform` (same shape); importers who meant the import-mapping
  enum import `TransformType` from `@objectstack/spec/data`.

  **Renamed — `./data` `suggestFieldType` → `suggestFieldTypeForSqlType`:**

  The only function-kind dual-source. The two implementations were never forks
  of one function — different signatures, semantics and return types:
  `shared/suggestions.zod.ts` (kept on `.` / `./shared` under the original
  name) is the typo-suggester for an invalid authored FieldType
  (`(input: string) => string[]`, alias table + Levenshtein, feeds the zod
  error map), while `data/type-compat.ts` is the deterministic SQL-column →
  FieldType mapper for external-datasource drafts
  (`(rawType, dialect?) => FieldType | undefined`, ADR-0015 §4.6). Same input,
  divergent outputs — `('varchar(255)')` → `[]` vs `'text'`; `('text_area')` →
  `['textarea']` vs `undefined`; `('int')` → `['number']` vs `'number'` — and
  the wrong pick compiled wherever the result was only truthiness-checked
  (`[]` is truthy). Behavioral divergence is now pinned in
  `data/type-compat.test.ts`.
  Fix: `import { suggestFieldType } from '@objectstack/spec/data'` →
  `suggestFieldTypeForSqlType` (same signature); imports from the root entry
  or `./shared` are unaffected.

### Minor Changes

- ba5ff2f: fix(plugin-sharing): deactivating or deleting a sharing rule actually withdraws its grants (#4433, #4434)

  An over-granting sharing rule had no withdrawal path on the product's API
  surface. Deactivating it left every grant it had materialised in place — not on
  the next record touch, not after a full restart — and the DELETE route answered
  500 for both address forms it advertises, so the rule could not be removed
  either. Together that made a too-broad rule unrecoverable short of hand-editing
  `sys_record_share`, against a v17 release note that advertises the opposite
  ("switching a rule off actually withdraws access").

  `minor`, not `patch`: this changes an observable runtime behaviour that
  deployments may have adapted to. A `source: 'rule'` grant whose rule is
  inactive — or whose rule row is gone — now disappears, on the deactivating
  write, on the next touch of the record, and on the next boot. Anything relying
  on those rows surviving deactivation (including data repaired by hand around
  the old behaviour) will see them revoked on upgrade. `DELETE
/api/v1/sharing/rules/:idOrName` also starts succeeding where it used to 500,
  so callers that treated that 500 as "unsupported" will now really delete.

  #4433 — three independent gaps, one per path the report walked:

  - **The deactivating write.** The `sys_sharing_rule` reconcile trigger skipped
    every `isSystem` write, on the theory that those were boot seeding.
    `SharingRuleService.defineRule` — the only implementation behind
    `POST /sharing/rules`, and the documented way to deactivate a rule — writes
    with SYSTEM_CTX unconditionally, because it must reach a platform table the
    sharing middleware otherwise gates. So the skip caught 100% of REST
    authoring: the withdrawal path built by #3821 existed, had tests (against a
    mocked session the real path never sends), and was unreachable in production.
    Now gated on boot phase, which is the question the skip actually meant to
    ask.
  - **The record touch.** `evaluateAllForRecord` listed only active rules, so a
    deactivated rule was absent from the loop entirely and its grants were never
    examined. It now reconciles every rule; an inactive one desires nothing and
    takes the existing revoke-the-remainder branch.
  - **The boot pass.** `backfillRuleGrants` was handed an `activeOnly` list,
    making it structurally incapable of revoking anything. It now walks every
    rule, and a new `sweepOrphanedRuleGrants` retires grants whose rule row is
    gone entirely — unreachable by rule iteration, so they need their own sweep.

  #4434 — `deleteRule` purged `sys_record_share` with a predicate-shaped
  `engine.delete` carrying neither a scalar id nor `multi: true`, the one shape
  the engine's dispatch refuses; it threw before ever reaching the rule row.
  Fixed by routing through the same `SharingService.revoke` path every other
  withdrawal already uses, rather than adding `multi: true` — a rule's grants now
  retire exactly one way instead of two divergent ones.

  The unit fakes are part of the fix: `makeEngine().delete` accepted any `where`,
  which is why #4434 shipped green — the pre-existing "deleteRule drops rule and
  all its grants" test asserted success against a delete the running server
  always rejected. The fakes now mirror the real engine's dispatch guard.

### Patch Changes

- Updated dependencies [430dcc2]
- Updated dependencies [e6ac4bd]
- Updated dependencies [80334c7]
- Updated dependencies [ce5242c]
- Updated dependencies [a7163ea]
- Updated dependencies [e6e9379]
- Updated dependencies [257d97a]
- Updated dependencies [98877c9]
- Updated dependencies [98877c9]
- Updated dependencies [c44dd5e]
- Updated dependencies [e6b1b69]
- Updated dependencies [ad047d2]
- Updated dependencies [2826d1e]
- Updated dependencies [5a84d41]
- Updated dependencies [20b1a9e]
- Updated dependencies [203a449]
- Updated dependencies [ac37fc6]
- Updated dependencies [4820f55]
- Updated dependencies [462d9c4]
- Updated dependencies [7d21581]
- Updated dependencies [f2445c9]
- Updated dependencies [23338c3]
- Updated dependencies [5b843fb]
- Updated dependencies [b4487aa]
- Updated dependencies [65ca83a]
- Updated dependencies [67bf2e2]
- Updated dependencies [c6d1cb4]
- Updated dependencies [462b713]
- Updated dependencies [36030ff]
- Updated dependencies [6117f7b]
- Updated dependencies [e533b0b]
- Updated dependencies [cdf4d9a]
- Updated dependencies [aee1806]
- Updated dependencies [c13350b]
- Updated dependencies [c13350b]
- Updated dependencies [63b33e6]
- Updated dependencies [9ca2d85]
- Updated dependencies [c13350b]
- Updated dependencies [891d345]
- Updated dependencies [a52e2ef]
- Updated dependencies [5293114]
- Updated dependencies [20bc357]
- Updated dependencies [5966c2a]
- Updated dependencies [2382580]
- Updated dependencies [d9fa683]
- Updated dependencies [3c7bcc0]
- Updated dependencies [4b6cac7]
- Updated dependencies [7631964]
- Updated dependencies [4c45be1]
- Updated dependencies [ac471a0]
- Updated dependencies [60ae58e]
- Updated dependencies [ce92674]
- Updated dependencies [9f601e8]
- Updated dependencies [51c5227]
- Updated dependencies [a4a85c8]
- Updated dependencies [07a4e26]
- Updated dependencies [ec975f1]
- Updated dependencies [eb4204b]
- Updated dependencies [4f13be2]
- Updated dependencies [61cc079]
- Updated dependencies [0e96e46]
- Updated dependencies [cb5a75e]
- Updated dependencies [84b6e58]
- Updated dependencies [f160ba4]
- Updated dependencies [b25a116]
- Updated dependencies [d52d4fe]
- Updated dependencies [742cebb]
- Updated dependencies [127f091]
- Updated dependencies [ce92674]
- Updated dependencies [cf2c9b7]
- Updated dependencies [833b512]
- Updated dependencies [0f9faa2]
- Updated dependencies [7cf42fe]
- Updated dependencies [5966c2a]
- Updated dependencies [f78dd83]
- Updated dependencies [a2cd18a]
- Updated dependencies [4638aaa]
- Updated dependencies [0222d3c]
- Updated dependencies [071d0dc]
- Updated dependencies [0a936ea]
- Updated dependencies [023c00b]
- Updated dependencies [155507e]
- Updated dependencies [7bba90b]
- Updated dependencies [7e05d8e]
- Updated dependencies [061406d]
- Updated dependencies [c1f344b]
- Updated dependencies [9c93465]
- Updated dependencies [ebb209c]
- Updated dependencies [63b33e6]
- Updated dependencies [2a44c1d]
- Updated dependencies [695cfbd]
- Updated dependencies [7445149]
- Updated dependencies [071d0dc]
- Updated dependencies [0848bea]
- Updated dependencies [d51bed2]
- Updated dependencies [b8b3c64]
- Updated dependencies [1ee48bc]
- Updated dependencies [0c0fbd9]
- Updated dependencies [f3141d8]
- Updated dependencies [5a84d41]
- Updated dependencies [fd3013a]
- Updated dependencies [21676eb]
- Updated dependencies [e336549]
- Updated dependencies [d40f43a]
- Updated dependencies [e5e7ee0]
- Updated dependencies [a2ebea2]
- Updated dependencies [800bdb0]
- Updated dependencies [26bb053]
- Updated dependencies [04f1182]
- Updated dependencies [5647006]
- Updated dependencies [50185a8]
- Updated dependencies [d6bd5a1]
- Updated dependencies [38f7e4f]
- Updated dependencies [c57f3cf]
- Updated dependencies [97faca3]
- Updated dependencies [ad5fe25]
- Updated dependencies [ea90179]
- Updated dependencies [ce92674]
- Updated dependencies [5ef0b5b]
- Updated dependencies [48fbacb]
- Updated dependencies [355e951]
- Updated dependencies [dadb43f]
  - @objectstack/spec@17.0.0-rc.2
  - @objectstack/objectql@17.0.0-rc.2
  - @objectstack/platform-objects@17.0.0-rc.2
  - @objectstack/core@17.0.0-rc.2
  - @objectstack/types@17.0.0-rc.2
  - @objectstack/formula@17.0.0-rc.2

## 17.0.0-rc.1

### Minor Changes

- 1ea6bce: feat(sharing): hierarchy managers may manage shares within their write DEPTH (ADR-0111 D1 DEPTH)

  `canManageShares` gains its named DEPTH extension: a caller whose effective
  WRITE scope on the object is a hierarchy scope (`unit` / `unit_and_below` /
  `own_and_reports`) may now manage shares on a record whose owner falls within
  that scope's owner set — the same set the write filter and `canEdit` already
  honour, resolved by the enterprise `hierarchy-scope-resolver`. This lets a
  manager grant/revoke/list shares on a subordinate's record, matching
  Salesforce (roles above the owner) and Dataverse (the `Share` privilege's BU
  depth), without expanding the MVP owner + Modify-All authority.

  - New `ISecurityService.resolveWriteScope(object, context)` — the effective
    write scope, resolved by the same evaluator the CRUD middleware uses; fails
    closed to `own`. Mirrored on the sharing plugin's structural probe.
  - The gate honours only the three hierarchy scopes. `org` from the probe is
    deliberately ignored: it means both a genuine Modify-All holder (already
    granted via `hasWriteBypass`) AND the fail-OPEN "no permission set mentions
    this object" default, so honouring it here would reopen the hole
    `hasWriteBypass` was chosen to avoid.
  - Fails closed with no security service or no enterprise resolver — the open
    edition stays owner + Modify-All, exactly as before.

- e5e8b10: feat(sharing): a record's share-manager may revoke any share-link on that record (ADR-0111 D8)

  `ShareLinkService.revokeLink` was creator-or-system only, so a record's owner or
  a Modify-All admin could not kill a link someone else minted on their record —
  their record's exposure, but not their link to revoke. Revoke authority now
  also admits a record **share-manager**, probed via the sharing service's
  late-bound `canManageShares` (owner / `modifyAllRecords`). The probe fails
  closed: a deployment without it (or a throwing probe) keeps the pre-D8
  creator-only behaviour. Mint authority is unchanged and now documented as the
  D8 decision it always enforced — the object's `publicSharing` opt-in AND the
  caller's visibility of the record.

- c1dcacd: fix(sharing)!: the share-management surface gains the authorization layer it never had (ADR-0111 P0, #3902)

  Record sharing shipped as a data layer with no authorization of its own: every
  `/data/:object/:id/shares` and `/sharing/rules` route authenticated the caller
  and then ran the service under `SYSTEM_CTX` — any signed-in user could revoke
  anyone's share, enumerate who-can-see-what, write self-grants, and define /
  evaluate org-wide sharing rules. ADR-0111's P0 rulings land here:

  - **D1/D2** — `ISharingService.canManageShares(object, recordId, context)`:
    system, the record's owner, or a holder of Modify All Data (probed via the
    new fail-closed `ISecurityService.hasWriteBypass`). Enforced in the SERVICE,
    so every caller is covered; without plugin-security it fails closed to
    owner-only.
  - **D4** — `revoke` is symmetric with grant, validates the share belongs to the
    URL's record (`NOT_FOUND` on mismatch), and refuses non-`manual` rows
    (`CONFLICT` — a rule-materialised grant would be resurrected by the next
    reconcile).
  - **D5** — `listShares` is management-gated (invisible record → `NOT_FOUND`,
    visible-but-not-manager → `PERMISSION_DENIED`), and the open
    `/data/sys_record_share` read surface is self-scoped: non-admin callers see
    only rows naming them as recipient or grantor.
  - **D6** — the whole `/sharing/rules` surface (list/create/get/delete/evaluate)
    requires the new **`manage_sharing`** capability (D9; seeded into
    `admin_full_access`, `manage_platform_settings` honoured as the legacy
    equivalent), enforced in `SharingRuleService`.
  - **D7** — no inert grants: `recipientType` is narrowed to `user` (the only
    type any gate enforces), grants on objects the sharing gates never consult
    (public model, no `owner_id`, bypass, `controlled_by_parent`) fail with
    `SHARING_NOT_ENABLED` (422), and the manual upsert keys on
    `(object, record, recipient, source)` so manual and rule rows coexist.

  **Breaking** for callers that relied on the missing gate: unauthorized share
  management now fails with 403/404/409/422 instead of silently succeeding, and
  `ISharingService.revoke` gained an optional `scope` parameter. The verb
  boundary (edit ≠ delete, ADR-0111 D3) is NOT in this change — it lands as the
  separate P1.

- ad303ed: fix(sharing)!: an edit-level share no longer grants delete (ADR-0111 D3, the verb boundary)

  `update` and `delete` shared one `canEdit` gate, and `canEdit` accepts an
  `edit`-level share — so one "edit" grant silently conferred delete, the
  opposite error from the retired `full` level. A share widens _which rows_ a
  principal reaches, never _which verbs_ they may use (Salesforce Read/Write
  cannot delete; Dataverse `Delete` is a distinct privilege; Odoo splits
  `write`/`unlink`).

  - `ISharingService.canDelete(object, recordId, context)` — ownership (widened
    by write DEPTH) or the `modifyAllRecords` super-user bypass ONLY; an `edit`
    or legacy `full` share does not confer it. `canEdit` is unchanged (the
    update gate, share included).
  - `SharingService.buildWriteFilter` takes a `verb` parameter: a bulk
    `delete({multi:true})` scopes to the owner/DEPTH set alone (no share
    widening), while a bulk `update` keeps it.
  - The sharing middleware routes `delete` through `canDelete` and logs a
    specific fail-closed reason on denial (ADR-0111 D10).
  - `/security/explain` consults `canDelete` for a `delete` operation, so the
    record-level explanation matches enforcement.

  **Breaking**: a caller who could delete a record _only_ through an edit-level
  share (and holds object-level delete CRUD) can no longer delete it — delete now
  requires ownership, write depth, or Modify All Data. No new delete access level
  is introduced; a future per-record delete grant would be a capability mask
  AND-ed with object CRUD, not a fourth share level.

- ccd9397: fix(security)!: a sharing rule with no criteria now shares NOTHING instead of every record (#3896)

  `SharingRuleSchema` has always required `condition`, and its doc is explicit
  that a predicate the compiler cannot lower is _"skipped and logged — never
  seeded as a permissive match-all (ADR-0049)"_. The declared/seed path honoured
  that. The two other ways to create a rule did not:

  - **`POST {basePath}/sharing/rules`** plucks its body field-by-field into
    `SharingRuleService.defineRule`, which validated `name` / `label` / `object` /
    `recipientType` / `recipientId` — and not `criteria`. A missing, `null`, or
    **misspelled** key (`criterias`) was stored as `criteria_json: null`, answered
    `201` with no warning, and evaluated as
    `find(object, { filter: {}, context: SYSTEM_CTX })`: every record of the
    object, up to 5000, granted to the recipient. Triggering it took a typo, not
    an attacker.
  - **Authoring a rule in Setup** is a direct `sys_sharing_rule` insert, which
    never reaches `defineRule` at all.

  Empty criteria is now rejected everywhere a rule can be written, and — because
  rules created before this gate are already in the table — the evaluator refuses
  to act on one regardless of how it got there.

  - **`defineRule` rejects a match-all criteria** with
    `VALIDATION_FAILED: criteria is required …`, alongside its other required
    fields. Covers the REST endpoint, programmatic callers, and the seeder.
    Rejected shapes: missing / `null` / `''` / `{}` / `[]` / `{ $and: [] }` /
    unparsable JSON (e.g. a CEL source typed into the Criteria box).
  - **The evaluator matches nothing** for such a rule and logs why, so a row
    stored before this release under-shares instead of over-sharing: the next
    reconcile _revokes_ the grants it had materialised. Both evaluation paths are
    covered — the bulk `evaluateRule` and the per-record write-hook path.
  - **`bindRuleCriteriaGuard`** fails `sys_sharing_rule` inserts with no
    criteria as a field-level `VALIDATION_FAILED` (a 400 naming `criteria_json`),
    so the Setup path reports the problem instead of saving an inert rule
    (ADR-0078). Updates are checked only when the patch supplies
    `criteria_json` — switching an over-broad legacy rule off must not require
    inventing a criteria for it first.
  - **The seed bootstrap's "empty condition = match-all" branch is gone**: a
    missing or empty `condition` is now skipped and logged like any other
    non-lowerable one.
  - `POST {basePath}/sharing/rules` also accepts `criteria_json` as an alias for
    `criteria`, matching the snake_case aliases the endpoint already takes for
    `object_name` / `recipient_type` / `access_level`.

  **Migration.** There is no "share every record" sharing rule, and there never
  usefully was one — the shape existed only as a failure mode. A rule that
  relied on it must state its predicate (`criteria: { stage: 'won' }`), or, if
  the object really should be readable by everyone, use the object's
  organization-wide default (`sharingModel`) instead. Rules already stored with
  a null `criteria_json` need no data migration: they stop granting on the next
  evaluation and their existing grants are revoked.

### Patch Changes

- 2e836de: chore(packaging): CHANGELOG.md ships in every npm tarball (#4261)

  The AGENTS.md post-task checklist requires breaking changesets to carry their
  FROM → TO migration because "this text ships to consumers as `CHANGELOG.md`
  inside the npm package and is what an upgrading agent greps after the tombstone
  error." That delivery path was severed for 68 of the 69 publishable packages:
  npm packs `package.json` / `README*` / `LICENSE*` unconditionally but — unlike
  older npm versions — not `CHANGELOG.md`, and the canonical
  `"files": ["dist", "README.md"]` whitelist never named it. Measured on npm
  10.9.7: `npm pack --dry-run` on `@objectstack/types` shipped 3 files while its
  70KB `CHANGELOG.md` stayed behind. Only `@objectstack/spec` listed it
  explicitly.

  The tombstone-error scenario is precisely the one where the repo is out of
  reach — the upgrading agent has `node_modules` and nothing else — so the
  migration text has to ride in the tarball. Every publishable package now
  declares `CHANGELOG.md` in `files`, and the canonical whitelist is
  `["dist", "README.md", "CHANGELOG.md"]`.

  The other half is the gate: `check:published-files` gains a fifth invariant,
  COMPLETE — a whitelist that fails to cover `CHANGELOG.md` fails the
  always-required lint job, so the next package cannot silently sever the path
  again. `@objectstack/spec`'s per-package EXTRA_ENTRIES exemption dissolves
  into the canonical set.

  Consumer-visible change: one more file per install (the package's changelog,
  e.g. 70.8KB for `@objectstack/types`), and `grep -r "removed key"
node_modules/@objectstack/*/CHANGELOG.md` now finds the migration it was
  promised.

- 7df7c64: feat(sharing): `sys_sharing_rule.criteria_json` is declaratively required (ADR-0113 P2)

  The field the ADR was written for: `required: true` as the write contract —
  insert must provide, update may not null out, legacy null rows rest, an admin
  can still `active: false` an over-broad legacy rule. Deliberately NO
  `storage.notNull`: deployed tenants' legacy nulls are the case the split
  exists for. The Setup form's required marker and client validation now derive
  from the declaration.

  Not breaking: a rule without criteria was already rejected by the #3929 hook
  guard; the guard narrows to the non-null match-all shapes `required` cannot
  express ('{}', vacuous $and/$or, unparsable JSON), `defineRule` keeps the API
  seam, and the evaluator stays fail-closed (ADR-0049).

- b5f9397: fix(sharing,runtime): a `sort` passed straight to the engine never ordered anything; migrate every in-repo engine call to canonical QueryAST keys (#4346)

  Two changes with different weights, from one sweep of every in-repo engine
  call site that still speaks a deprecated alias.

  **The bug — three dropped sorts.** #4346 made the engine fold `filter`→`where`
  and `top`→`limit` on all six methods. The other four pairs in
  `RPC_QUERY_ALIAS_SLOTS` (`select`, `sort`, `skip`, `populate`) are folded at
  the RPC/wire layer only — their values need shape lowering that belongs to
  those layers — and a **direct `engine.find()` never crosses that layer**. Three
  call sites passed `sort` there, so it rode onto the AST untouched, every
  driver's `Array.isArray(query.orderBy)` guard declined to emit an ORDER BY, and
  the query returned an ordinary-looking, arbitrarily-ordered result:

  | call site                           | asked for                                         | actually got                |
  | ----------------------------------- | ------------------------------------------------- | --------------------------- |
  | `share-link-routes.ts`              | shared AI conversation messages, `created_at asc` | messages in arbitrary order |
  | `runtime/domains/share-links.ts`    | same route, runtime-domain copy                   | same                        |
  | `share-link-service.ts` `listLinks` | the 200 most recent share links                   | an arbitrary 200            |

  All three combine the dropped sort with a `limit` — the "latest N" shape whose
  failure #4226 spelled out: an unapplied sort returns rows in arbitrary order,
  which `limit` then slices into an arbitrary page. #4226 fixed that in the wire
  normalizer; these calls sit one layer below it. `listLinks` had no test at all,
  which is why it went unnoticed. Now pinned — on the option bag the engine
  receives, not on row order, because the failure is that the key never becomes
  `orderBy` and a fake engine honouring either spelling would pass either way.

  **The cleanup — 27 no-op renames.** Every remaining in-repo engine call passing
  `filter` now passes `where` (approvals 5, auth 2, reports 6, sharing 11,
  webhooks 2, plus the one `filters` in a spec doc example). These are strict
  no-ops since #4346 folds the alias — the point is that the framework stops
  depending on a spelling it asks users to migrate off, which is a prerequisite
  for ever retiring the aliases. Service-level `filter` PARAMETERS (each
  service's own public API, e.g. `listRequests(filter)`) are deliberately
  untouched — those are not engine option bags.

  Two of the renamed calls were live victims of the #4346 bug rather than
  cosmetic: `auth-manager`'s `stampIdentitySource` read the table's first row via
  `findOne({filter})` and counted the whole table via `count({filter})`, so a
  federated sign-in never stamped `source: 'idp_provisioned'`. #4346 already
  corrected the behaviour; this makes the call say what it means.

- 71af9f5: fix(sharing): the criteria-less-rule warn is once per rule per process, plus one boot aggregate (#3929 follow-up)

  Pre-dedup the fail-closed evaluator warned on EVERY pass — per evaluation and
  per reconciled write — so one legacy criteria-less rule could dominate a
  deployment's log. Enforcement is unchanged (such a rule still matches
  nothing and its grants are revoked on reconcile); the warn now fires once
  per rule per process, and the boot backfill emits a single operator-facing
  aggregate (count + rule names + the fix: repair the criteria or set
  active: false).

- cc2de0e: chore(packaging): 20 packages stop publishing their sources, tests and build tooling (#4248)

  These 20 packages declared no `files` field, so npm fell back to packing the
  whole package directory. `npm pack --dry-run` on `@objectstack/plugin-webhooks`
  listed **21 files** — 15 under `src/`, three of them unit tests
  (`auto-enqueuer.test.ts`, `bootstrap-declared-webhooks.test.ts`, …), plus the
  build-time `scripts/i18n-extract.config.ts`. `dist/` lands on top of that at
  publish time rather than instead of it, so consumers were installing the
  TypeScript sources and the test suite alongside the artifact they asked for.

  Each now declares `"files": ["dist", "README.md"]`, matching the 29 packages
  that already did. Nothing a consumer imports moves: every `main` / `types` /
  `exports` target in all 20 already resolved inside `dist/`, which the new
  `check:published-files` guard verifies rather than assumes. The visible change
  is a smaller install and a smaller dependency-scanning surface — `npm pack` on
  `@objectstack/plugin-webhooks` now yields 2 files plus `dist/`.

  The other half of the fix is the gate. Half the packages declaring `files` and
  half not was the #3786 shape — a hand-copied convention with nothing enforcing
  it, where whoever forgets the line gets no signal at all. `check:published-files`
  (new, wired into the always-required `lint` job) holds every non-private
  workspace package to four invariants: `files` is **declared**; it is
  **sufficient** (covers every entry point, so tightening a whitelist cannot ship
  a package that fails to resolve); it is **minimal** (admits no test, test-harness
  config or build script); and anything beyond `dist` + `README.md` is
  **registered** with a reason, reconciled in both directions so a stale exemption
  is an error rather than dead text. `@objectstack/spec` is the one package with
  registered extras — its `.zod.ts` sources, JSON Schemas, liveness ledgers and
  `CHANGELOG.md` are product, not build input.

  This also closes an assumption #4206 was resting on. Excluding `<pkg>/scripts/**`
  from the docs-drift implementation test is sound only while no package publishes
  `scripts/` as runtime code; that held, but it held because someone read all three
  offenders by hand. It is now checked on every PR.

- 4580597: fix(plugin-sharing)!: the share-link routes emit the declared envelope, and the last ratchet retires (#3983)

  The fifth and final drifting route module. Unlike the four in #3843, this one was
  not found by reading — `scripts/check-route-envelope.mjs` surfaced it the moment
  that scan went repo-wide, which is the whole argument for a repo-wide guard over
  per-package copies. It also turned out to be the one where the drift had actually
  **broken shipped SDK methods**, not merely mis-shaped a body.

  ## Two SDK methods did not work on this surface

  Three of these routes are `disposition: 'sdk'` in `runtime/src/route-ledger.ts`,
  and `ObjectStackClient.unwrapResponse` decides a body is an envelope by finding a
  boolean `success`. With no flag it hands back the body verbatim:

  | method                | documented / typed as          | actually returned                           |
  | --------------------- | ------------------------------ | ------------------------------------------- |
  | `shareLinks.create()` | "the link row (incl. `token`)" | `{ link: … }` — so `.token` was `undefined` |
  | `shareLinks.list()`   | `Promise<any[]>`               | `{ links: [] }` — so `.map()` threw         |

  `packages/client/src/admin-surfaces.test.ts` mocks all three as
  `{ success: true, data: <payload> }`. The SDK was written and tested against the
  **dispatcher's** shape and only ever worked there.

  ## This is a convergence, not a redesign

  `runtime/src/domains/share-links.ts` serves the same five paths, and for cloud's
  per-environment kernels it is the _designed primary_ surface
  (`registerShareLinkRoutes: false`). It has always answered in the declared
  envelope. The plugin now answers identically:

  | route                            | was                              | now                                     |
  | -------------------------------- | -------------------------------- | --------------------------------------- |
  | `POST /share-links`              | `{ link }`                       | `{ success: true, data: link }`         |
  | `GET /share-links`               | `{ links }`                      | `{ success: true, data: link[] }`       |
  | `DELETE /share-links/:idOrToken` | `{ ok: true }`                   | `{ success: true, data: { ok: true } }` |
  | `GET /:token/resolve`            | `{ record, link, redactFields }` | `{ success: true, data: { … } }`        |
  | `GET /:token/messages`           | `{ data: rows }`                 | `{ success: true, data: rows }`         |
  | errors                           | `{ error: { code, message } }`   | `{ success: false, error: { … } }`      |

  `data` carries each payload **directly** — `data: links`, not `data: { links }`.
  That is what makes `unwrapResponse` return the same value on both surfaces, and
  it is what the SDK already expected.

  ## Breaking: raw `fetch` callers add one hop

  SDK callers get the fix for free (two of them go from broken to working). Direct
  body readers add `.data`:

  ```diff
  - const { links } = await (await fetch('/api/v1/share-links')).json();
  + const { data: links } = await (await fetch('/api/v1/share-links')).json();
  ```

  `{ ok: true }` on revoke survives, but as the payload rather than as the body: at
  the top level it was a second word for `success`, which #3689 retired from
  storage; under `data` it is what the dispatcher already returned.

  The `error` half was already nested `{ code, message }` — #3675's changeset cited
  this module as the good example of that — so only the `success` flag is new there.
  All eleven codes were already SCREAMING_SNAKE and registered, so ADR-0112 needs
  nothing.

  ## Consumers

  Swept, and the result is smaller than #3983 assumed. The framework has **zero**
  consumers of these routes. In objectui, `ShareDialog` was already dual-shape
  tolerant on all three routes it calls (`body.links ?? body.data`,
  `created.link ?? created.data`, and revoke never reads the body) — it needs no
  change, and it carried that tolerance precisely _because_ both shapes existed in
  the fleet.

  `SharedRecordPage` did need one fix, and it is the kind a shape-swap would have
  missed: it renamed the wire's `redactFields` to `redactedFields` only on the
  _bare_ branch, so on the already-enveloped dispatcher path the "fields are hidden
  by the owner" notice never rendered. Converting this surface would have spread
  that to every share page. Fixed in objectui#2980, which merges first.

  ## Guard

  **7 conformant / 0 ratcheted / 1 exempt**, from 6 / 1 / 1. The ratchet mechanism
  stays for the next module that needs it.

  `privateOk` also got narrowed to what its own doc always claimed — a literal `ok`
  at the **top** of a body, where it competes with `success`. The same literal
  inside `data` is payload, which is what a conformant revoke returns. Four
  self-test assertions pin both readings.

- d5749d7: refactor(types,rest,services,plugin-sharing): one shared writer for the response envelope, and `error.code` is enforced at compile time (#3973)

  `BaseResponseSchema` declares one envelope for every REST body the platform
  emits. It declared it once; the code that _wrote_ it was copied per route
  module. After #3843 and #3983 converted the last drifting one, seven modules
  each carried their own two-line `sendOk` / `sendError` pair — so the envelope's
  shape lived in fourteen places rather than one.

  `pnpm check:route-envelope` proved those seven copies agreed, which is why this
  is a cleanup rather than a bug fix. But a guard proves agreement; it does not
  create it. An eighth module starts by copying the pair again — not
  hypothetically: `share-link-routes.ts` was found already drifting by the
  repo-wide scan, and its drift had broken `client.shareLinks.create()` and
  `.list()` through `unwrapResponse` (#3983).

  ## What moved

  `sendOk` / `sendError` now live once, in `@objectstack/types`
  (`response-envelope.ts`), and all seven modules import them:

  | Module                                |
  | ------------------------------------- |
  | `service-storage/storage-routes.ts`   |
  | `service-settings/settings-routes.ts` |
  | `service-datasource/admin-routes.ts`  |
  | `rest/external-datasource-routes.ts`  |
  | `rest/package-routes.ts`              |
  | `service-i18n/i18n-service-plugin.ts` |
  | `plugin-sharing/share-link-routes.ts` |

  Placement was the open question in #3973, not design. `packages/spec` is
  schemas-only (Prime Directive #2), and the callers span `rest`, four
  `services/*` and one `plugins/*`, which rules out anything depending on them.
  `@objectstack/types` depends on nothing but `@objectstack/spec`, so every caller
  can reach it, and it is already where the repo puts a helper the HTTP boundaries
  share — `looksLikeInternalErrorLeak` (#3867) sits one file over and made the
  same argument first.

  The builders take a structural `{ status(n), json(body) }`, so the package
  imports no HTTP contract at all: `IHttpResponse` satisfies it, and so does the
  `any`-typed `res` the older modules carry.

  ## `error.code` is now checked by the compiler

  All seven copies typed the parameter `code: string`. ADR-0112 (#3841) closed the
  vocabulary — `ErrorCode` is `StandardErrorCode ∪ ERROR_CODE_LEDGER` — but an
  invented code was still caught only at runtime, by a conformance suite parsing a
  driven body, i.e. only on routes some test happened to drive.

  The shared `sendError` types `code` as `ErrorCode`, so an unregistered code now
  fails to compile, at every call site at once:

  ```ts
  sendError(res, 400, "NOT_A_REGISTERED_CODE", "invented");
  // Argument of type '"NOT_A_REGISTERED_CODE"' is not assignable to parameter of type 'ErrorCode'.
  ```

  This cost no call-site churn: every code the seven modules emit was already
  registered.

  ## `extra` is closed at the same place

  `sendError`'s last parameter is `Pick<ApiError, 'category' | 'httpStatus' |
'details' | 'requestId'>` — exactly what `ApiErrorSchema` declares beside `code`
  and `message`.

  It was `Record<string, unknown>` while `settings-routes` still hung `namespace` /
  `key` / `reason` / `fields` beside `code`. Those bodies passed every gate anyway:
  `ApiErrorSchema` is a plain `z.object`, so unknown keys were STRIPPED rather than
  rejected, and `envelopeViolations` inspects only the body's top level —
  conformant _by stripping_ rather than by declaration. #4224 moved that module
  onto `details`, which is what lets the parameter close here. Closing it at the
  shared builder is the part that lasts: an undeclared sibling is now a compile
  error in every module at once, rather than a key that quietly evaporates in
  whichever module reintroduces it.

  ## Nothing changes on the wire

  The seven pairs were identical modulo the optional `status` and `extra`
  parameters this one unions, and each module's driven conformance suite still
  parses its real bodies against the real spec schemas. One internal call site was
  rewritten: `package-routes` passed `details` positionally and now passes
  `{ details }`, producing the same `error.details` it always did.

  ## The guard got stronger

  `scripts/check-route-envelope.mjs` counts response write sites per module. A
  module that routes everything through the shared pair builds **none** itself, so
  the seven now declare `0 / 0 / 0` where they used to declare `2 / 1 / 1`, and the
  shared pair is pinned separately at `2 / 1 / 1` so the invariant stays total for
  the surface rather than per-module. What the count asserts is no longer "your two
  builders are the enveloped ones" but "you have no builders" — and a new route
  that hand-rolls a body still moves it off zero and fails.

- Updated dependencies [6a67d7a]
- Updated dependencies [48fcf70]
- Updated dependencies [0ecc656]
- Updated dependencies [06772eb]
- Updated dependencies [3ec8186]
- Updated dependencies [b1863a5]
- Updated dependencies [270650f]
- Updated dependencies [956e7f9]
- Updated dependencies [3aef718]
- Updated dependencies [ffb003c]
- Updated dependencies [1ea6bce]
- Updated dependencies [c1dcacd]
- Updated dependencies [ad303ed]
- Updated dependencies [32ccb23]
- Updated dependencies [f5a4ef0]
- Updated dependencies [2d3e255]
- Updated dependencies [7d7521f]
- Updated dependencies [5dc4d02]
- Updated dependencies [05154a1]
- Updated dependencies [9b6fe7c]
- Updated dependencies [8c711fb]
- Updated dependencies [09e4547]
- Updated dependencies [91f4c78]
- Updated dependencies [820eff9]
- Updated dependencies [8d895ff]
- Updated dependencies [f6472d7]
- Updated dependencies [78caf51]
- Updated dependencies [62a789b]
- Updated dependencies [789ad63]
- Updated dependencies [2af1988]
- Updated dependencies [0af50a3]
- Updated dependencies [2e836de]
- Updated dependencies [12a19a8]
- Updated dependencies [41dcda3]
- Updated dependencies [c8124e5]
- Updated dependencies [a1a4140]
- Updated dependencies [c20b875]
- Updated dependencies [2a37694]
- Updated dependencies [217e2e6]
- Updated dependencies [86a71d1]
- Updated dependencies [d5c75e2]
- Updated dependencies [03d26f7]
- Updated dependencies [4384921]
- Updated dependencies [3c628ce]
- Updated dependencies [7cb922e]
- Updated dependencies [1d22114]
- Updated dependencies [b5f9397]
- Updated dependencies [ed77493]
- Updated dependencies [58a03d2]
- Updated dependencies [c39d713]
- Updated dependencies [dc530b4]
- Updated dependencies [e59786e]
- Updated dependencies [bcf1112]
- Updated dependencies [9774b78]
- Updated dependencies [b07d829]
- Updated dependencies [a648e96]
- Updated dependencies [a47ac06]
- Updated dependencies [e4c61a7]
- Updated dependencies [cc60165]
- Updated dependencies [081aa6f]
- Updated dependencies [91f4c78]
- Updated dependencies [e8d0c21]
- Updated dependencies [45dc446]
- Updated dependencies [c1d44f7]
- Updated dependencies [ab9fb5c]
- Updated dependencies [f985b3f]
- Updated dependencies [9a4932a]
- Updated dependencies [f9fc874]
- Updated dependencies [011b386]
- Updated dependencies [9881074]
- Updated dependencies [7777e8f]
- Updated dependencies [507b92a]
- Updated dependencies [7309c81]
- Updated dependencies [20bc1ec]
- Updated dependencies [90c2b15]
- Updated dependencies [39eb01b]
- Updated dependencies [42eeb7d]
- Updated dependencies [01e124d]
- Updated dependencies [55bbefc]
- Updated dependencies [7ce02eb]
- Updated dependencies [a13827e]
- Updated dependencies [7733604]
- Updated dependencies [40e420f]
- Updated dependencies [d13004a]
- Updated dependencies [be7360c]
- Updated dependencies [cc2de0e]
- Updated dependencies [5b47ab5]
- Updated dependencies [b09d8d9]
- Updated dependencies [b09d8d9]
- Updated dependencies [8675db6]
- Updated dependencies [b09d8d9]
- Updated dependencies [3eb1b2b]
- Updated dependencies [59b85c0]
- Updated dependencies [6e357ed]
- Updated dependencies [d6938bf]
- Updated dependencies [31e0be9]
- Updated dependencies [4bfd455]
- Updated dependencies [ffd2ce2]
- Updated dependencies [62f8017]
- Updated dependencies [a831df1]
- Updated dependencies [f752ee3]
- Updated dependencies [a1b61e0]
- Updated dependencies [cd6b9f2]
- Updated dependencies [2cb6d3c]
- Updated dependencies [af2a095]
- Updated dependencies [bf478e1]
- Updated dependencies [ec796d5]
- Updated dependencies [77fadbf]
- Updated dependencies [e87fea1]
- Updated dependencies [c65e529]
- Updated dependencies [3ca34c1]
- Updated dependencies [239c3a3]
- Updated dependencies [94a0bbc]
- Updated dependencies [d6bfb3d]
- Updated dependencies [a2266a6]
- Updated dependencies [d25a0ec]
- Updated dependencies [5c13368]
- Updated dependencies [667b83e]
- Updated dependencies [627b188]
- Updated dependencies [8d4eae7]
- Updated dependencies [857a6cf]
- Updated dependencies [65a3a84]
- Updated dependencies [d5749d7]
- Updated dependencies [ccd9397]
- Updated dependencies [bca935b]
- Updated dependencies [d92c72d]
- Updated dependencies [c54c822]
- Updated dependencies [8dcc0f5]
- Updated dependencies [75b9e51]
- Updated dependencies [0a2f233]
- Updated dependencies [8621cdd]
- Updated dependencies [6f23667]
- Updated dependencies [5d21a48]
- Updated dependencies [19365b7]
- Updated dependencies [b7ed26d]
- Updated dependencies [68dea0b]
- Updated dependencies [64f8cbe]
- Updated dependencies [b3a3d83]
- Updated dependencies [7a55913]
- Updated dependencies [35accbf]
- Updated dependencies [6038de7]
- Updated dependencies [eb95d97]
- Updated dependencies [e4c2dc8]
- Updated dependencies [1bd2795]
- Updated dependencies [8186a70]
- Updated dependencies [a329cca]
- Updated dependencies [6eec18c]
- Updated dependencies [4d7bebf]
- Updated dependencies [821ac7a]
- Updated dependencies [8f81731]
- Updated dependencies [4965bfa]
- Updated dependencies [8b50cb3]
- Updated dependencies [8c2db68]
- Updated dependencies [22b5e54]
- Updated dependencies [0166bd5]
- Updated dependencies [9b702dc]
- Updated dependencies [ab16331]
  - @objectstack/spec@17.0.0-rc.1
  - @objectstack/objectql@17.0.0-rc.1
  - @objectstack/platform-objects@17.0.0-rc.1
  - @objectstack/core@17.0.0-rc.1
  - @objectstack/formula@17.0.0-rc.1
  - @objectstack/types@17.0.0-rc.1

## 17.0.0-rc.0

### Minor Changes

- f00d8d4: fix(sharing): remove the `full` access level — it promised delete/transfer/share and granted `edit` (#3865)

  `sys_sharing_rule.access_level` / `sys_record_share.access_level` offered three
  levels, the third documented as **Full Access (Transfer, Share, Delete)**. No
  code path granted transfer, re-share, or delete because of it: both enforcement
  sites matched `access_level in ('edit','full')`, so `full` was byte-equivalent
  to `edit`. An admin picking "Full Access" in Setup was told they had granted
  delete rights and had not — declared-but-unenforced metadata (ADR-0078,
  ADR-0049), the same defect that retired the `queue` recipient before it.

  Measured on showcase, a `full` recipient got `read: allowed`, `update: allowed`,
  `delete: DENIED` — and the denial came from `decidedBy=object_crud`, i.e. the
  object-level CRUD gate rejected the delete _before_ sharing was consulted at
  all. That is not an oversight to patch around; it is the model working. Record
  sharing widens **which rows** a principal reaches, never **which verbs** they
  may use — the same split Salesforce enforces (its sharing rules stop at
  Read-Only / Read-Write; Full Access is owner / hierarchy / Modify All only,
  never grantable by a rule) and Dataverse enforces by AND-ing every shared access
  right against the security role's own privilege. Delete and transfer belong to
  ownership, the ADR-0057 DEPTH scopes, and admin scope.

  **What changed**

  - `SharingLevel` (spec/security) and `ShareAccessLevel` (spec/contracts) are now
    `read | edit`. The `Field.select` on both objects offers the same two, so the
    Setup dropdown no longer shows the misleading option.
  - `SharingService.grant()` and `SharingRuleService.defineRule()` gained the
    access-level validation they never had: `full` normalises to `edit`, and an
    unrecognised level is a `VALIDATION_FAILED` (HTTP 400) instead of being
    persisted verbatim as a grant no gate would ever match.
  - Enforcement stays deliberately wider than authoring — the read/write gates
    still match `edit`/`full` — so a row written before this release keeps
    working. Narrowing them would silently _revoke_ access.
  - A boot backfill normalises stored `full` rows on both tables, and the
    `sharing-rule-access-level-full-to-edit` conversion rewrites declarative
    stacks at load, so nothing needs consumer action.

  **Migration.** None. `full` and `edit` were already behaviourally identical, so
  rewriting one to the other cannot change an access decision — unlike the OWD
  `sharingModel: 'full'` alias retired in ADR-0090 D4, which changed posture and
  had to be delegated to the author. A stack that still authors `accessLevel:
'full'` converts at load with a deprecation notice; stored rows normalise at
  next boot. Code that pinned the `ShareAccessLevel` type to `'full'` no longer
  compiles — use `'edit'`.

  Reviving a real per-record delete grant is a separate design (a capability mask
  AND-ed with object CRUD, plus the share-administration model that would have to
  authorise re-sharing), not a fourth enum member.

- 503be86: feat(security)!: reconcile the SharingRule authoring surface with the enforced runtime — rename `group` → `team`, add `business_unit`, prune `guest` + owner-type rules (#1878)

  The authoring `ShareRecipientType` enum had drifted behind the ADR-0090 D3
  rename and the enforced runtime: the runtime expands `team` (via
  `sys_team`/`sys_team_member`) and `business_unit`, but the authoring enum
  still offered the pre-rename `group` (silently skipped at seed time) and
  omitted the two live recipients. After this change **every authorable
  recipient and rule type is enforced** — nothing on the SharingRule surface
  validates and then silently does nothing (ADR-0078).

  - **`sharedWith.type: 'group'` → `'team'`** (wire-rename): the enum member is
    renamed to match the runtime vocabulary and now maps through the seed
    bootstrap to the live `TeamGraphService` expansion. Flat `sys_team`
    membership; enforced.
  - **`business_unit` added** to the authoring enum — exactly one business
    unit's members (no subtree; use `unit_and_subordinates` for the subtree).
    The runtime + bootstrap already enforced it; only the enum omitted it.
  - **`guest` removed** — it had no runtime recipient mapping. Anonymous access
    is served by the public-form grant and share links, not sharing rules.
  - **Owner-type rules removed** (`type: 'owner'`, `ownedBy`,
    `OwnerSharingRuleSchema` + its type export): they depend on live
    team/position membership, which the static materialiser cannot track, so
    they validated but never materialised a share. They return as an enforced
    form if membership-reactive re-materialisation is designed.
    `SharingRuleSchema` is now the criteria form; the `queue` recipient stays
    runtime-reserved (no `sys_queue` yet) and deliberately non-authorable.

  **Migration** (stale definitions now fail parse with the valid options listed):

  - `sharedWith: { type: 'group', … }` → `sharedWith: { type: 'team', … }`.
  - `sharedWith: { type: 'guest', … }` → delete the rule; expose the records
    via a public form or share link instead.
  - `type: 'owner'` rules → rewrite as a `type: 'criteria'` rule scoping the
    rows by field values (see the migrated examples:
    `share_open_tasks_with_manager` in app-showcase,
    `share_active_leads_with_manager` in app-crm), or use a scope-depth grant.

### Patch Changes

- aff9e56: fix(i18n): translate the platform packages' declared surface, and gate all nine bundles instead of one (#3762)

  Only `platform-objects` was wired into a translation-drift check. The other
  **eight** packages shipped a `scripts/i18n-extract.config.ts` that nothing ever
  ran — and four of them had already drifted out of sync with the schema, exactly
  the rot `pnpm check:i18n` exists to catch, one directory over.

  **Translated.** `plugin-security` (45 strings per locale), `plugin-webhooks`
  (15), `plugin-audit` (8), `plugin-sharing` (7) and `service-storage` (7) are now
  at **zero** untranslated declared strings in zh-CN / ja-JP / es-ES — 246
  translations. Most were newly _visible_ rather than newly missing: #3753 taught
  the coverage detector to walk action `params`, `resultDialog`, `listViews` and
  the rest of the declared surface, and these are what it found.

  Wording was harvested from the repo's own bundles wherever a string was already
  translated somewhere (1382 unambiguous source strings), so `Created At` reads
  `创建时间` here because that is what it reads everywhere else, rather than a
  fresh invention. Protocol tokens are deliberately left identical across locales:
  `GET` / `POST` / `PUT` / `PATCH` / `DELETE`, `ETag`, `ACL`, `URL`.

  **Gated.** `scripts/check-i18n-bundles.mjs` replaces the single-package
  `pnpm check:i18n` and checks all nine. It does not restate each package's
  command — it parses the one already documented in that config's own docstring
  and runs it, so the documented regenerate command and the gate cannot diverge.
  The coverage ratchet grows the same way, from `examples/*` to twelve configs;
  eight of them sit at zero, which makes it the strict gate there.

  **Fixed a real truncation bug it exposed.** `os lint --json` on a large config
  came out of a pipe cut off at exactly 65536 bytes — `console.log(big)` followed
  by `process.exit(1)` tears the process down before an async pipe write drains,
  while an interactive run (stdout is a TTY, written synchronously) looks perfect.
  Every scripted consumer silently got invalid JSON. `emitJson` in
  `packages/cli/src/utils/format.ts` waits for the write to drain and sets
  `process.exitCode` instead; `lint`, `i18n check` and `i18n extract` use it.
  Roughly 30 other CLI commands share the pattern and are not touched here.

  The nine documented regenerate commands also gain `--no-metadata-forms` (added
  in #3768), since the Studio metadata-form baseline belongs to `platform-objects`
  alone, not to a copy in every plugin.

  Not fixed here: `platform-objects`' own 77-per-locale gap is `apps.*` /
  `dashboards.*` navigation and widget labels, which live outside the `objects`
  subtree and cannot be scaffolded while the package extracts with
  `--objects-only`. That needs an emit decision first — tracked in #3762.

- 647ec8b: fix(driver-sql,sharing): an unsortable query loses its ORDER BY, not its rows (#3821)

  `SqlDriver.find()` already recovered from a SELECT projection naming a column
  the table lacks (retry with `select('*')`, the unknown field is simply absent
  from each row). The identical failure one clause over — an **ORDER BY** column
  the table lacks — fell through to `return []`. Because `count()` is a separate
  statement, the list endpoint answered `HTTP 200` with `records: []` and
  `total: 3`: the rows are there, none are shown, nothing is logged. Same family
  as the `$`-param footgun closed by #2926.

  It surfaced through the Console's sharing-rule **recipient picker**, which
  never listed a single candidate. The client mangled `'name asc'` into
  `0 n,1 a,2 m,…` (fixed separately in objectui) and the driver turned that into
  "no users exist", so no sharing rule could be authored from the UI at all.

  Rows now outrank their order: the retry ladder drops the projection first (the
  likelier culprit and the cheaper thing to lose), then the sort, then gives up.
  A query that cannot be sorted comes back **unordered instead of empty**. Errors
  that are not about an unknown column still propagate untouched.

  **A rule authored in Setup now actually applies — and switching it off actually
  withdraws access.** Writing a `sys_sharing_rule` rebound the per-record hooks,
  which only makes the rule reach records written FROM THEN ON. So an admin who
  created a rule and enabled it saw nothing happen: the recipient's list stayed
  empty until somebody happened to touch each record. The reverse was worse —
  switching a rule OFF, or deleting it, left every grant it had already issued in
  place, and boot backfill only reconciles ACTIVE rules, so those grants outlived
  restarts while the UI displayed the rule as disabled. The reconcile was reachable
  only through `POST /sharing/rules/:id/evaluate`, which the Console never calls.

  Each non-system write to `sys_sharing_rule` now also reconciles that rule's
  grants, chained behind the existing rebind: insert/update run the same
  diff-based `evaluateRule` the REST endpoint runs (it purges when the rule is
  inactive), and delete purges directly via the new
  `SharingRuleService.revokeRuleGrants` — `evaluateRule` can't help there because
  the row is already gone (`RULE_NOT_FOUND`), which is also why a rule deleted
  through the plain data API used to orphan its grants. Seeding and package
  bootstrap write with `isSystem` and are skipped; `kernel:bootstrapped` already
  backfills those. Reconciliation is best-effort and never fails the write.

  **The dialog's help text was engineering notes, shown to tenant admins.** The
  field descriptions on `sys_sharing_rule` render under each input in Setup, and
  they cited ADR numbers, table and column names (`parent_business_unit_id`,
  `sys_business_unit`), enum machine values the dropdown never shows
  (`business_unit`, `team`), a third-party library (better-auth), and engine
  vocabulary ("evaluation", "lifecycle"). Several were also stale: they still told
  admins to type an id or hand-write a `FilterCondition` after those inputs became
  a record picker and a visual builder. Rewritten for the reader who actually sees
  them — the implementation detail was already in the object's doc comment, which
  is where it stays. `criteria_json`'s LABEL loses its "(FilterCondition JSON)"
  suffix for the same reason, and `active` can finally say what it now does:
  turning it off withdraws the access.

  Also refreshes the `sys_sharing_rule` help text in the zh-CN / ja-JP / es-ES
  translation bundles, which still described `recipient_type` in terms of
  `department` (the enum value is `business_unit`) and told admins to enter a
  queue name for `recipient_id` (`queue` was removed in ADR-0078). The es-ES
  option labels for `position` / `unit_and_subordinates` were translated as
  "rol" — corrected to "Puesto" / "Unidad de negocio y subordinados".

- Updated dependencies [50616d9]
- Updated dependencies [08b5a3d]
- Updated dependencies [d99aeb3]
- Updated dependencies [4727eb8]
- Updated dependencies [f63cd09]
- Updated dependencies [6169615]
- Updated dependencies [fa3d0cf]
- Updated dependencies [af5a224]
- Updated dependencies [71f76e1]
- Updated dependencies [37b1346]
- Updated dependencies [a749273]
- Updated dependencies [99736a0]
- Updated dependencies [fe67e34]
- Updated dependencies [fdb4f50]
- Updated dependencies [1bd5652]
- Updated dependencies [14252d3]
- Updated dependencies [7fb436c]
- Updated dependencies [879ea13]
- Updated dependencies [201b31f]
- Updated dependencies [e2616e0]
- Updated dependencies [6fdc5c6]
- Updated dependencies [8b9d71e]
- Updated dependencies [33f5e23]
- Updated dependencies [259af21]
- Updated dependencies [587fc91]
- Updated dependencies [1986594]
- Updated dependencies [ad4af62]
- Updated dependencies [d44dbfa]
- Updated dependencies [474fe39]
- Updated dependencies [0bc685a]
- Updated dependencies [b949059]
- Updated dependencies [be1c52c]
- Updated dependencies [c5ff96d]
- Updated dependencies [84e7be9]
- Updated dependencies [a6c3f38]
- Updated dependencies [debc23a]
- Updated dependencies [0f8ad09]
- Updated dependencies [8f9689f]
- Updated dependencies [57a3bb3]
- Updated dependencies [5f9a987]
- Updated dependencies [9f060e5]
- Updated dependencies [bc17d39]
- Updated dependencies [db02d47]
- Updated dependencies [0bfdf46]
- Updated dependencies [48c110e]
- Updated dependencies [87aca93]
- Updated dependencies [376a061]
- Updated dependencies [7c7e246]
- Updated dependencies [f35cdc5]
- Updated dependencies [9ea2bc5]
- Updated dependencies [32d3800]
- Updated dependencies [c2d9098]
- Updated dependencies [a227ed7]
- Updated dependencies [9613396]
- Updated dependencies [e47b342]
- Updated dependencies [4ed7ed4]
- Updated dependencies [2fa4ca1]
- Updated dependencies [f5a2320]
- Updated dependencies [deb538f]
- Updated dependencies [5b89711]
- Updated dependencies [0c8a22f]
- Updated dependencies [763931e]
- Updated dependencies [de9af8a]
- Updated dependencies [c4df271]
- Updated dependencies [a41ba5c]
- Updated dependencies [189854c]
- Updated dependencies [5d4de37]
- Updated dependencies [0e3a226]
- Updated dependencies [524151c]
- Updated dependencies [1d4756e]
- Updated dependencies [720c5ad]
- Updated dependencies [a8d1e24]
- Updated dependencies [d1cabaa]
- Updated dependencies [41642b0]
- Updated dependencies [4cca74c]
- Updated dependencies [88ef03e]
- Updated dependencies [9e2caf3]
- Updated dependencies [81ce41a]
- Updated dependencies [85e1e4e]
- Updated dependencies [dac6a08]
- Updated dependencies [394b7a1]
- Updated dependencies [677b591]
- Updated dependencies [d77d1b7]
- Updated dependencies [5b79a34]
- Updated dependencies [c757854]
- Updated dependencies [e1fa8d5]
- Updated dependencies [402f534]
- Updated dependencies [0045682]
- Updated dependencies [2a5f04a]
- Updated dependencies [4f740b0]
- Updated dependencies [030125b]
- Updated dependencies [67452d1]
- Updated dependencies [4921a95]
- Updated dependencies [0fc6219]
- Updated dependencies [605e190]
- Updated dependencies [c6c59f1]
- Updated dependencies [b0e78a8]
- Updated dependencies [f31cc8d]
- Updated dependencies [f343dc4]
- Updated dependencies [8269e32]
- Updated dependencies [74f7339]
- Updated dependencies [a6c35a2]
- Updated dependencies [c2f1002]
- Updated dependencies [8e08bc3]
- Updated dependencies [f163028]
- Updated dependencies [f07808c]
- Updated dependencies [7ffc3d3]
- Updated dependencies [88346ba]
- Updated dependencies [4631592]
- Updated dependencies [32ff033]
- Updated dependencies [5ac93d4]
- Updated dependencies [93f267f]
- Updated dependencies [0024abf]
- Updated dependencies [acbf364]
- Updated dependencies [5487c20]
- Updated dependencies [aa8b847]
- Updated dependencies [7687f7b]
- Updated dependencies [1659072]
- Updated dependencies [abceb0d]
- Updated dependencies [0c302a7]
- Updated dependencies [6633337]
- Updated dependencies [f00d8d4]
- Updated dependencies [503be86]
- Updated dependencies [5f0852f]
- Updated dependencies [cde1975]
- Updated dependencies [20cb232]
- Updated dependencies [e231abb]
- Updated dependencies [0bc685a]
- Updated dependencies [11949fc]
- Updated dependencies [b098b0e]
- Updated dependencies [4d00b13]
- Updated dependencies [9aa5510]
- Updated dependencies [57bab76]
- Updated dependencies [b90086a]
- Updated dependencies [b95577a]
- Updated dependencies [54f479a]
- Updated dependencies [83c161f]
- Updated dependencies [d8c4957]
- Updated dependencies [f24cb83]
- Updated dependencies [5dbbb92]
- Updated dependencies [69f1dfd]
  - @objectstack/spec@17.0.0-rc.0
  - @objectstack/objectql@17.0.0-rc.0
  - @objectstack/platform-objects@17.0.0-rc.0
  - @objectstack/core@17.0.0-rc.0
  - @objectstack/formula@17.0.0-rc.0

## 16.1.0

### Patch Changes

- Updated dependencies [212b66a]
- Updated dependencies [d10c4dc]
- Updated dependencies [9e45b63]
- Updated dependencies [b20201f]
  - @objectstack/platform-objects@16.1.0
  - @objectstack/spec@16.1.0
  - @objectstack/core@16.1.0
  - @objectstack/formula@16.1.0
  - @objectstack/objectql@16.1.0

## 16.0.0

### Patch Changes

- 22013aa: **Split the overloaded `managedBy: 'system'` bucket into engine-owned vs. admin-writable, and enforce engine-owned writes (ADR-0103, #3220).** The `system` bucket conflated two incompatible write policies: rows a platform service owns end to end (never user-written), and platform-defined schema whose rows are legitimately admin/user-writable. It carried the same all-false affordance row as `better-auth`/`append-only` but, unlike `better-auth`, had no engine enforcement — a wildcard admin could raw-write these rows through the generic data API (ADR-0049 gap).

  Rather than add a new `managedBy` enum value (which would fall through to fully-editable `platform` defaults on already-deployed Console clients), the write policy is now the **resolved affordance** (`resolveCrudAffordances` = bucket default + `userActions`), and _engine-owned_ is defined as a `system`/`append-only` object that grants no write:

  - **Writable set declares `userActions`** — the RBAC link tables (`sys_user_position`, `sys_user_permission_set`, `sys_position_permission_set`), `sys_user_preference`, `sys_approval_delegation`, and the messaging config grids (`sys_notification_preference` / `…_subscription` / `…_template`) now declare `userActions: { create, edit, delete: true }`. The affordance is a declaration only — the `DelegatedAdminGate` / RLS / permission sets remain the authz.
  - **Engine-owned objects locked to reads** — `apiMethods: ['get','list']` added where absent (jobs, notifications, approval request/approver/token/action, `sys_record_share`, `sys_automation_run`, mail/settings/secret audit, the messaging delivery pipeline). `sys_secret` is explicitly read-locked (an empty `apiMethods` array fails open).
  - **`sys_import_job`** stays engine-owned: the REST import route now writes its job rows `isSystem`-elevated (attribution preserved via the explicit `created_by` stamp) and the object is locked to `['get','list']`.
  - **New engine write guard** (`assertEngineOwnedWriteAllowed`, plugin-security) fail-closed rejects user-context generic writes to engine-owned `system`/`append-only` objects, keyed off the resolved affordance; `isSystem` and context-less engine/service writes bypass by construction. Wired into the security middleware alongside the other data-layer gates.
  - **`reconcileManagedApiMethods`** (objectql registry) now runs for **every** managed bucket, not just `better-auth`: any advertised write verb an object's resolved affordances forbid is stripped at registration with a warning (the drift backstop, ADR-0049).
  - **`/me/permissions` clamp** (plugin-hono-server) now clamps `system`/`append-only` as well as `better-auth`, so the client hint reflects `permission ∩ guard`.

  **Potentially breaking:** a downstream/third-party `system` object that advertised generic write verbs relying on today's fail-open behaviour will have those verbs stripped (with a warning) and user-context generic writes to it rejected. Declare `userActions` opening the verbs the object legitimately takes from a user context. `better-auth` keeps plugin-auth's identity write guard unchanged; the row-level `managed_by` provenance vocabulary (ADR-0066) is a different axis and is untouched.

- 62a2117: **Split the overloaded `managedBy: 'system'` bucket with an explicit `engine-owned` value (ADR-0103 addendum, #3343).** ADR-0103 deferred the enum split ("revisitable later as a rename") because a new `managedBy` value would fall through to the fully-editable `platform` default on deployed Console clients. Both reasons against it are now retired — the server-side write guard / `apiMethods` reconciliation / `/me/permissions` clamp make that fallthrough cosmetic (the write is rejected regardless of what the client renders), and objectui#2712 closed the UI union — so v16 lands it, **additively**.

  - **New enum value `engine-owned`** with the same all-locked default affordance row as `system` (`create/import/edit/delete: false`, `exportCsv: true`). It joins `ENGINE_OWNED_BUCKETS` (the engine write guard) and `GUARDED_WRITE_BUCKETS` (the `/me/permissions` clamp); the guard, `reconcileManagedApiMethods`, and the clamp mechanisms are unchanged — `engine-owned` is an explicit member of the set they already covered by resolved affordance.
  - **20 objects relabelled `system → engine-owned`** — the ones the engine owns end to end and that declared no write-opening `userActions` (the metadata store, jobs, approval runtime rows, sharing rows, `sys_automation_run`, the messaging delivery/receipt pipeline, `sys_secret`, settings). One-line, behaviour-identical per object.
  - **8 admin/user-writable objects keep `managedBy: 'system'`** (the RBAC link tables, `sys_user_preference`, `sys_approval_delegation`, the messaging config grids) — `system` now reads as "engine-managed schema, writable via `userActions`".

  Behaviour-, enforcement- and wire-identical: resolved affordances, the guard verdict, the 405 `apiMethods` reconciliation, and the permissions clamp are the same before and after — this is a self-documenting relabel, not a policy change. No data migration (`managedBy` is schema metadata) and no code branches on the `'system'` literal. Retiring the overloaded `system` entirely (moving the 8 writable objects to a dedicated bucket) is a breaking rename deferred to v17.

- Updated dependencies [f972574]
- Updated dependencies [6289ec3]
- Updated dependencies [22013aa]
- Updated dependencies [3ad3dd5]
- Updated dependencies [8efa395]
- Updated dependencies [3a18b60]
- Updated dependencies [a8aa34c]
- Updated dependencies [e057f42]
- Updated dependencies [a3823b2]
- Updated dependencies [bc65105]
- Updated dependencies [43a3efb]
- Updated dependencies [524696a]
- Updated dependencies [6b51346]
- Updated dependencies [80273c8]
- Updated dependencies [fdc244e]
- Updated dependencies [bfa3c3f]
- Updated dependencies [5e3301d]
- Updated dependencies [dd9f223]
- Updated dependencies [46e876c]
- Updated dependencies [2ea08ee]
- Updated dependencies [7125007]
- Updated dependencies [5f05de2]
- Updated dependencies [021ba4c]
- Updated dependencies [158aa14]
- Updated dependencies [62a2117]
- Updated dependencies [d2723e2]
- Updated dependencies [674457a]
- Updated dependencies [fefcd54]
- Updated dependencies [beaf2de]
- Updated dependencies [369eb6e]
- Updated dependencies [06ff734]
- Updated dependencies [b659111]
- Updated dependencies [5754a23]
- Updated dependencies [6c270a6]
- Updated dependencies [290e2f0]
- Updated dependencies [668dd17]
- Updated dependencies [8abf133]
- Updated dependencies [e0859b1]
- Updated dependencies [04ecd4e]
- Updated dependencies [4d5a892]
- Updated dependencies [16cebeb]
- Updated dependencies [86d30af]
- Updated dependencies [8923843]
- Updated dependencies [ea32ec7]
- Updated dependencies [a2795f6]
- Updated dependencies [f16b492]
- Updated dependencies [4b6fde8]
- Updated dependencies [2018df9]
- Updated dependencies [fc5a3a2]
- Updated dependencies [8ff9210]
  - @objectstack/spec@16.0.0
  - @objectstack/platform-objects@16.0.0
  - @objectstack/objectql@16.0.0
  - @objectstack/core@16.0.0
  - @objectstack/formula@16.0.0

## 16.0.0-rc.1

### Patch Changes

- 62a2117: **Split the overloaded `managedBy: 'system'` bucket with an explicit `engine-owned` value (ADR-0103 addendum, #3343).** ADR-0103 deferred the enum split ("revisitable later as a rename") because a new `managedBy` value would fall through to the fully-editable `platform` default on deployed Console clients. Both reasons against it are now retired — the server-side write guard / `apiMethods` reconciliation / `/me/permissions` clamp make that fallthrough cosmetic (the write is rejected regardless of what the client renders), and objectui#2712 closed the UI union — so v16 lands it, **additively**.

  - **New enum value `engine-owned`** with the same all-locked default affordance row as `system` (`create/import/edit/delete: false`, `exportCsv: true`). It joins `ENGINE_OWNED_BUCKETS` (the engine write guard) and `GUARDED_WRITE_BUCKETS` (the `/me/permissions` clamp); the guard, `reconcileManagedApiMethods`, and the clamp mechanisms are unchanged — `engine-owned` is an explicit member of the set they already covered by resolved affordance.
  - **20 objects relabelled `system → engine-owned`** — the ones the engine owns end to end and that declared no write-opening `userActions` (the metadata store, jobs, approval runtime rows, sharing rows, `sys_automation_run`, the messaging delivery/receipt pipeline, `sys_secret`, settings). One-line, behaviour-identical per object.
  - **8 admin/user-writable objects keep `managedBy: 'system'`** (the RBAC link tables, `sys_user_preference`, `sys_approval_delegation`, the messaging config grids) — `system` now reads as "engine-managed schema, writable via `userActions`".

  Behaviour-, enforcement- and wire-identical: resolved affordances, the guard verdict, the 405 `apiMethods` reconciliation, and the permissions clamp are the same before and after — this is a self-documenting relabel, not a policy change. No data migration (`managedBy` is schema metadata) and no code branches on the `'system'` literal. Retiring the overloaded `system` entirely (moving the 8 writable objects to a dedicated bucket) is a breaking rename deferred to v17.

- Updated dependencies [6289ec3]
- Updated dependencies [8efa395]
- Updated dependencies [bfa3c3f]
- Updated dependencies [7125007]
- Updated dependencies [62a2117]
- Updated dependencies [674457a]
- Updated dependencies [06ff734]
  - @objectstack/spec@16.0.0-rc.1
  - @objectstack/platform-objects@16.0.0-rc.1
  - @objectstack/formula@16.0.0-rc.1
  - @objectstack/objectql@16.0.0-rc.1
  - @objectstack/core@16.0.0-rc.1

## 16.0.0-rc.0

### Patch Changes

- 22013aa: **Split the overloaded `managedBy: 'system'` bucket into engine-owned vs. admin-writable, and enforce engine-owned writes (ADR-0103, #3220).** The `system` bucket conflated two incompatible write policies: rows a platform service owns end to end (never user-written), and platform-defined schema whose rows are legitimately admin/user-writable. It carried the same all-false affordance row as `better-auth`/`append-only` but, unlike `better-auth`, had no engine enforcement — a wildcard admin could raw-write these rows through the generic data API (ADR-0049 gap).

  Rather than add a new `managedBy` enum value (which would fall through to fully-editable `platform` defaults on already-deployed Console clients), the write policy is now the **resolved affordance** (`resolveCrudAffordances` = bucket default + `userActions`), and _engine-owned_ is defined as a `system`/`append-only` object that grants no write:

  - **Writable set declares `userActions`** — the RBAC link tables (`sys_user_position`, `sys_user_permission_set`, `sys_position_permission_set`), `sys_user_preference`, `sys_approval_delegation`, and the messaging config grids (`sys_notification_preference` / `…_subscription` / `…_template`) now declare `userActions: { create, edit, delete: true }`. The affordance is a declaration only — the `DelegatedAdminGate` / RLS / permission sets remain the authz.
  - **Engine-owned objects locked to reads** — `apiMethods: ['get','list']` added where absent (jobs, notifications, approval request/approver/token/action, `sys_record_share`, `sys_automation_run`, mail/settings/secret audit, the messaging delivery pipeline). `sys_secret` is explicitly read-locked (an empty `apiMethods` array fails open).
  - **`sys_import_job`** stays engine-owned: the REST import route now writes its job rows `isSystem`-elevated (attribution preserved via the explicit `created_by` stamp) and the object is locked to `['get','list']`.
  - **New engine write guard** (`assertEngineOwnedWriteAllowed`, plugin-security) fail-closed rejects user-context generic writes to engine-owned `system`/`append-only` objects, keyed off the resolved affordance; `isSystem` and context-less engine/service writes bypass by construction. Wired into the security middleware alongside the other data-layer gates.
  - **`reconcileManagedApiMethods`** (objectql registry) now runs for **every** managed bucket, not just `better-auth`: any advertised write verb an object's resolved affordances forbid is stripped at registration with a warning (the drift backstop, ADR-0049).
  - **`/me/permissions` clamp** (plugin-hono-server) now clamps `system`/`append-only` as well as `better-auth`, so the client hint reflects `permission ∩ guard`.

  **Potentially breaking:** a downstream/third-party `system` object that advertised generic write verbs relying on today's fail-open behaviour will have those verbs stripped (with a warning) and user-context generic writes to it rejected. Declare `userActions` opening the verbs the object legitimately takes from a user context. `better-auth` keeps plugin-auth's identity write guard unchanged; the row-level `managed_by` provenance vocabulary (ADR-0066) is a different axis and is untouched.

- Updated dependencies [f972574]
- Updated dependencies [22013aa]
- Updated dependencies [3ad3dd5]
- Updated dependencies [3a18b60]
- Updated dependencies [a8aa34c]
- Updated dependencies [e057f42]
- Updated dependencies [a3823b2]
- Updated dependencies [bc65105]
- Updated dependencies [43a3efb]
- Updated dependencies [524696a]
- Updated dependencies [6b51346]
- Updated dependencies [80273c8]
- Updated dependencies [fdc244e]
- Updated dependencies [5e3301d]
- Updated dependencies [dd9f223]
- Updated dependencies [46e876c]
- Updated dependencies [2ea08ee]
- Updated dependencies [5f05de2]
- Updated dependencies [021ba4c]
- Updated dependencies [158aa14]
- Updated dependencies [d2723e2]
- Updated dependencies [fefcd54]
- Updated dependencies [beaf2de]
- Updated dependencies [369eb6e]
- Updated dependencies [b659111]
- Updated dependencies [5754a23]
- Updated dependencies [6c270a6]
- Updated dependencies [290e2f0]
- Updated dependencies [668dd17]
- Updated dependencies [8abf133]
- Updated dependencies [e0859b1]
- Updated dependencies [04ecd4e]
- Updated dependencies [4d5a892]
- Updated dependencies [16cebeb]
- Updated dependencies [86d30af]
- Updated dependencies [8923843]
- Updated dependencies [ea32ec7]
- Updated dependencies [a2795f6]
- Updated dependencies [f16b492]
- Updated dependencies [4b6fde8]
- Updated dependencies [2018df9]
- Updated dependencies [fc5a3a2]
  - @objectstack/spec@16.0.0-rc.0
  - @objectstack/objectql@16.0.0-rc.0
  - @objectstack/platform-objects@16.0.0-rc.0
  - @objectstack/core@16.0.0-rc.0
  - @objectstack/formula@16.0.0-rc.0

## 15.1.1

### Patch Changes

- @objectstack/spec@15.1.1
- @objectstack/core@15.1.1
- @objectstack/objectql@15.1.1
- @objectstack/formula@15.1.1
- @objectstack/platform-objects@15.1.1

## 15.1.0

### Minor Changes

- f531a26: feat(plugin-sharing): sys_sharing_rule provenance + seed-not-clobber (#2909 P0/T1). The object gains readonly `managed_by` (unified A4 tri-state platform/package/admin) and `customized` columns; declared rules seed with `managed_by: 'package'`. defineRule in seed mode adopts pristine/legacy rows (package upgrades stay deliverable) but never overwrites admin-authored or customized rows — an admin's `active: false` on an over-sharing rule now survives redeploys instead of being resurrected at boot. A beforeUpdate hook stamps `customized` on any non-system edit of a seeded rule. Deliberately NO write gate: sharing rules remain a first-class admin authoring surface (ADR-0094 addendum tradeoff).

### Patch Changes

- f531a26: feat(kernel): add `kernel:bootstrapped` lifecycle anchor — the phase that fires after every `kernel:ready` handler has settled but before `kernel:listening` (HTTP socket open). `kernel:ready` handlers run sequentially in plugin-registration order, so a handler that consumes data produced by a later-starting plugin (e.g. the security bootstrap seeds `sys_position`; the app plugin's seed loader inserts records) would race the very rows it needs. `kernel:bootstrapped` is the correct anchor for reconcile/backfill work: every producer's ready handler has finished by the time it fires. Both `ObjectKernel` and `LiteKernel` trigger it. The sharing-rule boot backfill moves from `kernel:listening` to `kernel:bootstrapped` (semantics-only; behaviour unchanged).
- f531a26: fix(security): guard the `owner_id` ownership anchor and scope bulk writes to owner-visible rows (#3004, #2982)

  Two write-path holes on the row-ownership anchor (`owner_id`), the column OWD
  row-level scoping keys off to decide who may update/delete a record.

  - **#3004 — client-writable, unguarded `owner_id`.** The anchor is deliberately
    not `readonly` (ownership is transferable), so the static-readonly strip never
    covered it and FLS doesn't gate it by default. A non-privileged writer could
    therefore `insert` a record under someone else's name (forge) or `update` one
    to a new owner (transfer / disown), evading the owner gate that governs
    update/delete. The security middleware (plugin-security step 3.5) now treats
    `owner_id` as system-managed for non-privileged writers: on insert an empty
    value is auto-stamped to the acting user (batch rows too — previously only the
    single-record path stamped, leaving bulk-inserted rows NULL-owned and
    invisible to their creator), and a supplied foreign owner is denied; on update
    a supplied `owner_id` is a transfer/disown and is denied — the unchanged no-op
    echo of a form save is tolerated via a pre-image compare, and a bulk
    change-set carrying `owner_id` fails closed. A non-scalar `owner_id`
    (array/object) is rejected outright rather than string-coerced, and the
    change-set membership test uses own-property semantics so a polluted
    prototype cannot spoof an ownership write. Both require the transfer grant
    (`allowTransfer`, or `modifyAllRecords` which implies it) to proceed. System
    context (`ctx.isSystem`) stays fully exempt (OAuth provisioning / cron
    snapshots / seed claims / migrations), and under delegation both principals
    must hold the grant (ADR-0090 D10 intersection). Note a REST **import** runs
    under the importer's own context (not `isSystem`), so a non-privileged user
    importing a CSV whose `owner_id` column names other users is correctly denied
    unless they hold the transfer grant — administrators (who carry
    `modifyAllRecords`) are unaffected.

  - **#2982 — bulk writes skipped owner scoping on OWD-`private` objects.** A
    `update({ multi: true })` / bulk delete rebuilt the driver AST from
    `options.where` AFTER the middleware chain, discarding the owner/RLS write
    filter that plugin-sharing (`buildWriteFilter`) and plugin-security compose
    onto `opCtx.ast` — so a member's bulk write hit every matching row, including
    peers'. The engine now seeds `opCtx.ast` from the caller's predicate BEFORE the
    chain (the same seam reads use) and hands the middleware-composed AST to
    `driver.updateMany` / `driver.deleteMany`, so bulk writes are constrained to the
    rows the caller may edit — matching single-id write behavior. `delete` now
    applies the same scalar-`id` guard `update` already had, so an id-list bulk
    delete (`where: { id: { $in: […] } }, multi: true`) is owner-scoped too, and
    both multi branches fail CLOSED (throw) rather than silently rebuilding an
    unscoped predicate if the row-scoping AST is ever absent.

    Consequences of routing bulk writes through the AST: the anti-oracle
    predicate guard now also applies to bulk `update`/`delete` (a bulk write
    filtering on an FLS-unreadable field is rejected, as reads already are), and a
    principal-less (no-`userId`, non-system) bulk write on an owner-scoped object
    now correctly affects zero rows instead of all of them.

  Proven end-to-end on the real showcase app
  (`packages/qa/dogfood/test/owner-anchor-and-bulk-writes.dogfood.test.ts`) and pinned
  in the ADR-0096 authz-conformance ledger (`ownership-anchor-guard`,
  `bulk-write-owner-scoping`).

- f531a26: fix(security): close three execution-surface authz holes surfaced by the #2849 class sweep (#2980, #2981, #2982)

  Three independent, confirmed-exploitable defects where an execution surface
  ignored the caller's identity or fell open on a missing one. Each is fixed at
  its own enforcement point; none change behaviour for correctly-scoped callers.

  - **#2980 — reports IDOR + scheduled-report RLS bypass.** `ReportService`
    discarded the caller's context and read/wrote `sys_saved_report` with a system
    context, so any authenticated user could read, delete, or overwrite any saved
    report by id (cross-owner / cross-tenant), and `listReports` enumerated all
    owners. `getReport`/`deleteReport`/`saveReport`/`listReports` are now
    owner-scoped (system read of the protection-locked metadata object, but
    authorization enforced by owner match); create/overwrite can no longer spoof
    ownership. Scheduled dispatch no longer runs `isSystem` (which emailed the
    target object's entire table past the owner's RLS): it resolves the owner to a
    real RLS-bearing context via a new `resolveOwnerContext` seam and **fails
    closed** (skips + marks the schedule failed) when the owner can't be resolved,
    rather than running elevated. Wiring that resolver is the reports-surface
    consumer of ADR-0073's user-less identity resolution.

  - **#2981 — knowledge/RAG retrieval fall-open.** `applyPermissionFilter` returned
    every hit when the context was missing _or_ system. A missing identity is no
    longer treated as a grant: object-backed hits fail closed (dropped, keeping
    ACL-less file/http hits), and only an **explicit** system context passes
    through. Closes the agent path where an omitted `ToolExecutionContext.actor`
    yielded unfiltered semantic search over the whole corpus.

  - **#2982 — bulk-write OWD gap.** `update({multi:true})` / `deleteMany` had no
    single id to `canEdit`-gate, so owner scoping was skipped on private (and
    public_read) objects. A new `SharingService.buildWriteFilter` (the edit-set
    analogue of `buildReadFilter`) is AND-ed into the write AST for multi writes,
    constraining them to rows the caller may edit — including the on-behalf-of
    delegator intersection.

  Tracked as the motivating evidence of ADR-0096 (execution-surface identity
  admission); the mechanism that would prevent the class structurally is separate.

- f531a26: fix(plugin-sharing): reconcile every active sharing rule once at boot (#2926 ③). Rule grants are materialized by write hooks, which deliberately skip `isSystem` writes — so seed-loader records never produced `sys_record_share` rows and demo data shipping with matching sharing rules was broken out of the box until each record was touched at runtime. The boot backfill runs on `kernel:listening` — the phase the kernel fires only after every `kernel:ready` handler has settled, including the AppPlugin seed loader — so the reconcile sees the seeded rows rather than racing them. It is idempotent (diff-based reconcile) and best-effort per rule so one broken rule cannot block startup.
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [3fe9df1]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [4109153]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [627f225]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [f531a26]
- Updated dependencies [d75c7ac]
- Updated dependencies [f531a26]
  - @objectstack/spec@15.1.0
  - @objectstack/objectql@15.1.0
  - @objectstack/platform-objects@15.1.0
  - @objectstack/core@15.1.0
  - @objectstack/formula@15.1.0

## 15.0.0

### Patch Changes

- Updated dependencies [02a014b]
- Updated dependencies [28b7c28]
- Updated dependencies [13749ec]
- Updated dependencies [e62c233]
- Updated dependencies [ed61c9b]
- Updated dependencies [31d04d4]
  - @objectstack/platform-objects@15.0.0
  - @objectstack/spec@15.0.0
  - @objectstack/core@15.0.0
  - @objectstack/objectql@15.0.0
  - @objectstack/formula@15.0.0

## 14.8.0

### Patch Changes

- Updated dependencies [16b4bf6]
- Updated dependencies [16b4bf6]
- Updated dependencies [10e8983]
- Updated dependencies [607aaf4]
- Updated dependencies [bb71321]
  - @objectstack/spec@14.8.0
  - @objectstack/platform-objects@14.8.0
  - @objectstack/core@14.8.0
  - @objectstack/formula@14.8.0
  - @objectstack/objectql@14.8.0

## 14.7.0

### Minor Changes

- d6a72eb: Field metadata gains a `widget` override (`FieldSchema.widget`) — names a
  registered form component (resolved as `field:<widget>`) to render a field with,
  overriding the default widget derived from `type` and degrading back to it when
  unregistered. The generic object form already honored this hint (objectui
  `ObjectForm`/`form.tsx` resolve `widget || type`); this promotes it to a
  first-class, liveness-classified authoring property so any config object can ask
  for a picker instead of a raw input.

  `sys_sharing_rule` uses it so the Setup **New Sharing Rule** form is
  pick-not-type instead of asking admins to hand-enter machine data:

  - `object_name` → `object-ref` (choose a registered object by name)
  - `criteria_json` → `filter-condition` (visual criteria builder scoped to the
    chosen object's fields; `dependsOn: object_name`)
  - `recipient_id` → `recipient-picker` (record picker whose target follows
    `recipient_type`; `dependsOn: recipient_type`)

  Also removes the `queue` recipient type: it is declared-but-unenforced (the
  evaluator expands no users for it), so offering it authored a silently-inert rule
  (ADR-0078). i18n bundles regenerated. Requires the matching objectui widgets; the
  fields degrade to their `type` renderer where those aren't loaded.

### Patch Changes

- Updated dependencies [d6a72eb]
  - @objectstack/spec@14.7.0
  - @objectstack/core@14.7.0
  - @objectstack/formula@14.7.0
  - @objectstack/objectql@14.7.0
  - @objectstack/platform-objects@14.7.0

## 14.6.0

### Patch Changes

- Updated dependencies [609cb13]
- Updated dependencies [ce6d151]
- Updated dependencies [8f4a261]
  - @objectstack/spec@14.6.0
  - @objectstack/platform-objects@14.6.0
  - @objectstack/objectql@14.6.0
  - @objectstack/core@14.6.0
  - @objectstack/formula@14.6.0

## 14.5.0

### Minor Changes

- f70eb2c: ADR-0090 D10 — agent/service intersection runtime. When a request's principal acts `onBehalfOf` a user (an AI agent or a service acting for a person), the effective permission is now the INTERSECTION of the principal's own grants and the delegator's grants — never the union. Confused-deputy prevention: an over-privileged agent may never see or touch anything the user it stands in for could not, and vice-versa. Previously `principalKind:'agent'` / `onBehalfOf` was a P1 context shape the evaluator did not read.

  The intersection is applied at EVERY axis, gated on the presence of the delegation link so the ordinary (non-delegated) path is byte-identical:

  - **plugin-security** middleware — the delegator's effective permission sets are reconstructed once (fail-CLOSED if the delegator no longer exists — a dangling link is denied, not resolved to the additive baseline) and AND-composed into: the required-capability gate, object CRUD, field-level security (read mask + write forbid + predicate-oracle guard), the row-level `using` pre-image on by-id writes, the `check` post-image, and the RLS read-filter injection. View/Modify-All only survives when BOTH principals hold it.
  - **plugin-sharing** middleware — the OWD/record-sharing owner-match is IDENTITY-scoped, so it re-runs the visibility filter (and `canEdit`) under the delegator's own identity + depth and AND-s it in. An agent with View-All acting on behalf of a plain member therefore sees exactly that member's own rows — not everyone's, and not nothing.
  - **explain engine** — every layer reports the narrower verdict when `onBehalfOf` is set, so the D6 access explanation stays truthful for delegated principals; a dangling delegator is reported as a fail-closed deny.

  First-cut scope (documented in code + covered by tests): one delegation hop (the `onBehalfOf` shape carries a single delegator, and any single-hop intersection is a safe lower bound on a true multi-hop chain); tenant-scoped substitution bags (`tenantId`, `org_user_ids`, `email`) are inherited from the live principal, while person-specific membership bags left unresolved narrow rather than widen. The agent grant-ceiling lint (D10 rule 2) is a follow-up — the runtime intersection already caps the agent regardless of what its own sets carry, and a lint needs an agent-set designation convention that does not yet exist.

- 01274eb: **Security fix (#2851): the share-link HTTP routes no longer trust spoofable identity headers, and the service enforces ownership.**

  The raw-app share-link routes (`POST/GET/DELETE /api/v1/share-links`, registered by `SharingServicePlugin`) derived the caller from `x-user-id` / `x-tenant-id` request headers, and the service ignored the caller context on revoke. So a client could forge link attribution, enumerate another user's link tokens (`GET ?createdBy=<victim>` → tokens that resolve records under a system context, bypassing RLS), and revoke arbitrary users' links.

  Fixes:

  - **Verified identity.** `SharingServicePlugin` now derives the caller (and their positions/permissions) from the platform's verified resolution (`resolveAuthzContext` — session / API key / OAuth), never from headers. The route default is SECURE (anonymous). Create / list / revoke require a signed-in principal (401 otherwise); the public `/:token/resolve` route stays public (the token is the authorization) but keys its `audience: 'signed_in'` check off the verified session rather than a spoofable `x-user-id`.
  - **List scoping.** `GET /api/v1/share-links` is forced to the caller's own links — a client can no longer pass `?createdBy=<victim>` to enumerate others' tokens.
  - **Revoke ownership.** `revokeLink` now requires the caller to be the link's creator (system/internal callers bypass). Previously the caller context was ignored, so anyone could revoke any link (sharing DoS).
  - **Create access check.** `createLink` verifies the record is visible to the caller (read under the caller's own RLS) before minting a link — you can only share a record you can actually see. Internal (system) callers are unchanged.

  `ShareLinkExecutionContext` gains optional `positions` / `permissions` so the record-access check evaluates the real principal.

  Found by an adversarial security review of the request→ExecutionContext trust boundary (companion to the settings-routes fix, #2848).

### Patch Changes

- Updated dependencies [526805e]
- Updated dependencies [d79ca07]
- Updated dependencies [33ebd34]
- Updated dependencies [c044f08]
- Updated dependencies [01274eb]
- Updated dependencies [8f23746]
- Updated dependencies [b97af7e]
- Updated dependencies [6da03ee]
  - @objectstack/spec@14.5.0
  - @objectstack/platform-objects@14.5.0
  - @objectstack/objectql@14.5.0
  - @objectstack/core@14.5.0
  - @objectstack/formula@14.5.0

## 14.4.0

### Minor Changes

- 82e745e: ADR-0091 L1 — grant validity windows: effective-dated assignments, resolution-time filtering, explain expired state, authoring lint.

  - **plugin-security (objects)**: `sys_user_position` and `sys_user_permission_set` gain the D1 lifecycle columns — `valid_from`, `valid_until` (half-open `[from, until)`, UTC; null = unbounded, existing rows unchanged), `reason`, `delegated_from`, `last_certified_at`, `certified_by`.
  - **core**: new shared predicate `isGrantActive` / `isGrantExpired` (`@objectstack/core`), and `resolveAuthzContext` now filters BOTH grant tables through it (D2, fail-closed — an expired unscoped `admin_full_access` grant no longer derives `platform_admin`). Present-but-unparseable bounds fail closed.
  - **plugin-security (explain)**: `buildContextForUser` applies the same filter and returns `expiredGrants`; the principal layer reports the dedicated "held until … — expired" contributor state so "why did access disappear" is self-answering. Spec `ExplainLayerSchema` contributors gain an optional `state: 'active' | 'expired'`.
  - **plugin-sharing**: `PositionGraphService.expandPositionUsers` filters expired holders — sharing-rule recipients stop including them at resolution time.
  - **lint (D7)**: two new error rules over seed data — `security-grant-expired-at-authoring` (a `valid_until` in the past, or unparseable, is a grant that can never resolve) and `security-delegation-missing-reason` (a `delegated_from` row without `reason` breaks the D3 dual audit). Also re-exported the missing `SECURITY_MASTER_DETAIL_UNGRANTED` constant.

  No background job is involved anywhere — per ADR-0049, an expired grant simply stops resolving, in every edition.

### Patch Changes

- Updated dependencies [7953832]
- Updated dependencies [82e745e]
- Updated dependencies [f3035bd]
- Updated dependencies [82c0d94]
- Updated dependencies [7449476]
  - @objectstack/spec@14.4.0
  - @objectstack/objectql@14.4.0
  - @objectstack/platform-objects@14.4.0
  - @objectstack/core@14.4.0
  - @objectstack/formula@14.4.0

## 14.3.0

### Patch Changes

- Updated dependencies [2a71f48]
- Updated dependencies [02f6af4]
- Updated dependencies [ff648ad]
- Updated dependencies [c1064f1]
  - @objectstack/platform-objects@14.3.0
  - @objectstack/spec@14.3.0
  - @objectstack/objectql@14.3.0
  - @objectstack/core@14.3.0
  - @objectstack/formula@14.3.0

## 14.2.0

### Patch Changes

- Updated dependencies [ac8f029]
- Updated dependencies [4ab9958]
  - @objectstack/spec@14.2.0
  - @objectstack/platform-objects@14.2.0
  - @objectstack/core@14.2.0
  - @objectstack/formula@14.2.0
  - @objectstack/objectql@14.2.0

## 14.1.0

### Patch Changes

- Updated dependencies [5a8465f]
- Updated dependencies [7f8620b]
- Updated dependencies [82ba3a6]
  - @objectstack/spec@14.1.0
  - @objectstack/core@14.1.0
  - @objectstack/formula@14.1.0
  - @objectstack/objectql@14.1.0
  - @objectstack/platform-objects@14.1.0

## 14.0.0

### Patch Changes

- 0a8e685: ADR-0090 permission-model zoo + docs alignment.

  **Showcase (`@objectstack/example-showcase`)** now exercises the full Permission
  Model v2 authoring surface and is guarded by a new runtime dogfood test
  (`showcase-permission-zoo.dogfood.test.ts`): typed `definePosition`/
  `definePermissionSet`/`defineSharingRule` factories; six flat positions (the
  stale pre-D3 `parent` fields are gone); permission sets covering CRUD+FLS+RLS,
  org-depth read/write asymmetry (`readScope: 'org'` / `writeScope: 'own'`),
  View-All (auditor) and Modify-All (ops) bypasses, `systemPermissions`
  (`setup.access`), the `isDefault` everyone-suggestion (incl. personal-data
  grants on the `private`-OWD note object), a guest-safe set for the `guest`
  anchor (D9), and a delegated-administration `adminScope` bounded to a seeded
  `sys_business_unit` subtree (D12). Objects gain `externalSharingModel` dials
  (D11). A committed `access-matrix.json` opts the showcase into the D6 snapshot
  gate. Hierarchy depths (`own_and_reports`/`unit`/`unit_and_below`) are
  deliberately NOT authored — they are enterprise (`hierarchy-security`) and the
  open runtime fails closed; BU-shaped visibility is demonstrated via the
  enforced `unit_and_subordinates` sharing-rule recipient instead.

  **`@objectstack/spec`**: `defineStack` strict cross-reference validation no
  longer rejects permission grants or seed datasets that target platform-provided
  objects (`sys_`/`cloud_`/`ai_` prefixes) — a delegated-admin set carrying CRUD
  on the RBAC link tables (ADR-0090 D12) and an app seeding the business-unit
  tree are legitimate shapes; the typo net stays intact for the stack's own
  objects. Stale pre-ADR-0090 vocabulary in zod docstrings (rls/territory/
  sharing/tool/agent) is rewritten; the auto-generated references (including the
  previously missing `security/explain.mdx`) are regenerated.

  **Docs**: `protocol/objectql/security.mdx` rewritten to the v2 model (no
  profiles, positions, canonical OWD four + D1 private default +
  `externalSharingModel`, position-scoped RLS, enforced sharing recipients);
  `isProfile` scrubbed from every authoring example; the dead
  `/docs/references/identity/role` link fixed; implementation-status and
  plugin READMEs aligned. Remaining rename misses are tracked in #2722
  (RLSUserContext.role), #2723 (portal `profiles`), #2724 (sys_record_share
  `role` enum).

- afa8115: ADR-0090 vocabulary leftovers (#2722, #2723, #2724) — the last "role"/"profile"
  surfaces are renamed one-step, no aliases (launch-window discipline).

  **`PortalSchema.profiles` → `positions`** (#2723, D2 removal miss). FROM → TO:
  `profiles: ['client_portal_user']` → `positions: ['client_portal_user']` —
  portal admission is now position-scoped; use the built-in `guest` position
  for anonymous-only portals. The removed `profiles` key is a loud tombstone:
  authoring it fails with the prescription instead of silently stripping. The
  showcase Client Portal is migrated and now admits a real declared position
  (`client_portal_user`).

  **`RLSUserContextSchema.role` → `positions`** (#2722, D3 rename miss). FROM →
  TO: `role: string | string[]` → `positions: string[]` — matches the runtime
  shape the RLS compiler resolves as `current_user.positions`. No runtime
  consumer read the old field (the compiler has its own context type); public
  export names are unchanged.

  **`sys_record_share.recipient_type` `'role'` → `'position'`** (#2724, D3).
  The record-share enum and the `ShareRecipientType` contract type now match
  the already-migrated spec zod enum. No stored-data migration is required:
  no reader expands non-`user` record-share rows (rules materialize per-user
  grants), so legacy `'role'` rows were inert. The plugin-sharing translation
  bundles are regenerated — fixing the pre-stale `sys_sharing_rule` options
  block too — with zh-CN/ja-JP labels patched per the generated-file contract
  (业务单元及下级 / ビジネスユニットと下位階層).

- Updated dependencies [0a8e685]
- Updated dependencies [afa8115]
- Updated dependencies [80f12ca]
- Updated dependencies [332b711]
- Updated dependencies [e2fa074]
- Updated dependencies [23c8668]
- Updated dependencies [29f017d]
- Updated dependencies [afa8115]
- Updated dependencies [216fa9a]
- Updated dependencies [6c22b12]
- Updated dependencies [d0531c4]
- Updated dependencies [cff5aac]
  - @objectstack/spec@14.0.0
  - @objectstack/platform-objects@14.0.0
  - @objectstack/objectql@14.0.0
  - @objectstack/core@14.0.0
  - @objectstack/formula@14.0.0

## 13.0.0

### Major Changes

- 6d83431: ADR-0090 P1 breaking wave — permission model v2 concept convergence.

  Pre-launch one-step renames and secure defaults (no compatibility aliases, per
  ADR-0090 D3/D4 superseding ADR-0057 D5/D7's alias discipline):

  - `sys_role` → `sys_position`, `sys_user_role` → `sys_user_position` (field
    `role` → `position`), `sys_role_permission_set` → `sys_position_permission_set`
    (field `role_id` → `position_id`); `RoleSchema`/`defineRole` →
    `PositionSchema`/`definePosition` with **no `parent`** (positions are flat;
    hierarchy lives on the business-unit tree).
  - `ExecutionContext.roles[]` → `positions[]`; the EvalUser/CEL contract
    `current_user.roles` → `current_user.positions` (formula validators updated);
    stack property `roles:` → `positions:`; metadata kinds `role`/`profile` →
    `position` (profile kind removed).
  - `isProfile` removed from `PermissionSetSchema` (ADR-0090 D2); `isDefault`
    narrows to an install-time suggestion; `appDefaultProfileName` →
    `appDefaultPermissionSetName` (isDefault-only).
  - OWD enum drops legacy aliases `read`/`read_write`/`full`; new optional
    `externalSharingModel` (external dial, `private` default) lands as P1 spec
    shape (ADR-0090 D11).
  - **Secure default (D1)**: a custom object with an owner field and NO
    `sharingModel` now resolves `private` (was: fully public). System objects
    keep their explicit posture. Unrecognised stored values fail closed.
  - ExecutionContext gains the P1 principal-taxonomy shape (D10):
    `principalKind` / `audience` / `onBehalfOf` (optional, semantics phase in
    later).
  - Sharing recipients: `role` → `position` (expanded via `sys_user_position`
    ∪ the better-auth membership transition source); `role_and_subordinates`
    removed — `unit_and_subordinates` now expands the business-unit subtree
    (finishes ADR-0057 D5's re-homing).

### Patch Changes

- Updated dependencies [6d83431]
- Updated dependencies [01917c2]
- Updated dependencies [b271691]
- Updated dependencies [a5a1e41]
- Updated dependencies [466adf6]
- Updated dependencies [5be00c3]
- Updated dependencies [466adf6]
- Updated dependencies [a1766fe]
- Updated dependencies [2bee609]
- Updated dependencies [9fa84f9]
- Updated dependencies [fc7e7f7]
  - @objectstack/spec@13.0.0
  - @objectstack/core@13.0.0
  - @objectstack/objectql@13.0.0
  - @objectstack/formula@13.0.0
  - @objectstack/platform-objects@13.0.0

## 12.6.0

### Patch Changes

- Updated dependencies [6cebf22]
- Updated dependencies [21420d9]
  - @objectstack/spec@12.6.0
  - @objectstack/core@12.6.0
  - @objectstack/formula@12.6.0
  - @objectstack/objectql@12.6.0
  - @objectstack/platform-objects@12.6.0

## 12.5.0

### Patch Changes

- Updated dependencies [8b3d363]
  - @objectstack/spec@12.5.0
  - @objectstack/objectql@12.5.0
  - @objectstack/core@12.5.0
  - @objectstack/formula@12.5.0
  - @objectstack/platform-objects@12.5.0

## 12.4.0

### Patch Changes

- Updated dependencies [60dc3ba]
- Updated dependencies [1dd5dfd]
  - @objectstack/spec@12.4.0
  - @objectstack/objectql@12.4.0
  - @objectstack/core@12.4.0
  - @objectstack/formula@12.4.0
  - @objectstack/platform-objects@12.4.0

## 12.3.0

### Patch Changes

- Updated dependencies [5a0da03]
- Updated dependencies [e7eceec]
  - @objectstack/objectql@12.3.0
  - @objectstack/spec@12.3.0
  - @objectstack/core@12.3.0
  - @objectstack/formula@12.3.0
  - @objectstack/platform-objects@12.3.0

## 12.2.0

### Patch Changes

- 4f5b791: Wire three more Studio-authored metadata surfaces at runtime (#2605 — the
  "declared but never wired" family, following the #2596 hooks template).

  **Authored actions now execute (#2605 item 1).** `engine.executeAction`'s map
  was only ever populated from the app bundle at boot, so a published `action`
  row (standalone or embedded in an authored object's `actions[]`) was stored
  and listed but never executable — before OR after a restart. Now:

  - `AppPlugin` installs a QuickJS-sandboxed default action runner at boot
    (`engine.setDefaultActionRunner`), the action-path twin of the #2596 hook
    body runner. Opt out with `OS_DISABLE_AUTHORED_ACTIONS=1`.
  - `ObjectQLPlugin` re-registers runtime-authored actions from their
    `sys_metadata` rows under `packageId: 'metadata-service'` at
    `kernel:ready`, on `metadata:reloaded`, and on `action`/`object` protocol
    mutations — saves, publishes, edits, and deletes take effect live.
    Package-artifact actions are excluded (AppPlugin owns those; re-registering
    would clobber their handlers).

  **Authored translations reach the i18n runtime (#2591).** `translation`
  metadata items (single-locale `AppTranslationBundle` payloads; locale from
  `_meta.locale`, a top-level `locale`, or a BCP-47-shaped item name) now load
  into the i18n service as a separate authored layer that overlays static
  bundles. Both adapters carry the layer — service-i18n's `FileI18nAdapter`
  AND the kernel's in-memory fallback (`createMemoryI18n`), which is what dev
  and standalone stacks actually run. The shared sync
  (`wireAuthoredTranslationSync`, exported from `@objectstack/core`, wired by
  the runtime's AppPlugin and by I18nServicePlugin with single-owner
  semantics) runs at `kernel:ready`, on `metadata:reloaded`, and on
  `translation` protocol mutations, with clear-then-reload semantics so
  deleted items/keys stop resolving instead of lingering in the deep-merged
  map.

  **Sharing rules created at runtime bind without a restart (#2592).**
  `bindRuleHooks` was boot-only, so the first rule authored at runtime for an
  object with no boot-time rule silently never evaluated (rule authoring is a
  data insert — `metadata:reloaded` never fires). The sharing plugin now binds
  afterInsert/afterUpdate/afterDelete triggers on `sys_sharing_rule` that
  unbind + re-bind the rule-hook package from a fresh `listRules()`, serialized
  so overlapping writes can't leave a stale snapshot bound, and fail-safe so a
  rebind failure never fails the rule write.

- Updated dependencies [fce8ff4]
- Updated dependencies [3962023]
- Updated dependencies [2bb193d]
- Updated dependencies [0426d27]
- Updated dependencies [da807f7]
- Updated dependencies [4f5b791]
  - @objectstack/spec@12.2.0
  - @objectstack/objectql@12.2.0
  - @objectstack/core@12.2.0
  - @objectstack/formula@12.2.0
  - @objectstack/platform-objects@12.2.0

## 12.1.0

### Patch Changes

- Updated dependencies [93e6d02]
  - @objectstack/spec@12.1.0
  - @objectstack/core@12.1.0
  - @objectstack/formula@12.1.0
  - @objectstack/objectql@12.1.0
  - @objectstack/platform-objects@12.1.0

## 12.0.0

### Patch Changes

- Updated dependencies [a8df396]
- Updated dependencies [e695fe0]
- Updated dependencies [07f055c]
- Updated dependencies [7c09621]
- Updated dependencies [2d567cb]
- Updated dependencies [24b62ee]
- Updated dependencies [7709db4]
- Updated dependencies [2082109]
- Updated dependencies [7c09621]
- Updated dependencies [c2fdbf9]
- Updated dependencies [9860de4]
- Updated dependencies [069c205]
  - @objectstack/spec@12.0.0
  - @objectstack/platform-objects@12.0.0
  - @objectstack/objectql@12.0.0
  - @objectstack/core@12.0.0
  - @objectstack/formula@12.0.0

## 11.10.0

### Patch Changes

- 6a9397e: Retire the deprecated `compactLayout` alias for `highlightFields` (framework#2536, closes the ADR-0085 deprecation window).

  - `ObjectSchema` no longer declares `compactLayout`: `create()` rejects it like any unknown key; lenient `parse()` strips it (no silent aliasing).
  - The parse-time alias AND the `highlightFields → compactLayout` back-fill transition mirror are removed from `normalizeSemanticRoleAliases`. Served metadata now carries the canonical key only.
  - All remaining first-party authors (27 system objects across plugin-audit / approvals / security / sharing / webhooks / service-storage / automation / messaging / realtime — missed by the #2521 sweep, caught by the type gate) renamed to `highlightFields`.
  - The downstream smoke pin moves to hotcrm v1.2.2 (hotcrm#424: same rename + deps ^11.7.0).
  - Consumers were switched in objectui#2168 and shipped via the console pin bump (#2526); this closes the window scheduled there. The dogfood mirror assertion (#2528) flips to `compactLayout: undefined` in this same change, per the plan it carried.

  Version note: minor, not major — the key was deprecated-with-alias for a full release window, all first-party consumers/authors are migrated, and the spec api-surface gate reports no export changes (same documented-exception path as the ADR-0085 removals in 11.7.0). External metadata still authoring `compactLayout` will now fail `create()` loudly with the standard unknown-key error naming the key.

- Updated dependencies [6a9397e]
- Updated dependencies [c0efe5d]
  - @objectstack/spec@11.10.0
  - @objectstack/core@11.10.0
  - @objectstack/formula@11.10.0
  - @objectstack/objectql@11.10.0
  - @objectstack/platform-objects@11.10.0

## 11.9.0

### Patch Changes

- Updated dependencies [d3595d9]
  - @objectstack/spec@11.9.0
  - @objectstack/core@11.9.0
  - @objectstack/formula@11.9.0
  - @objectstack/objectql@11.9.0
  - @objectstack/platform-objects@11.9.0

## 11.8.0

### Patch Changes

- Updated dependencies [53d491a]
- Updated dependencies [b84726b]
  - @objectstack/platform-objects@11.8.0
  - @objectstack/spec@11.8.0
  - @objectstack/core@11.8.0
  - @objectstack/objectql@11.8.0
  - @objectstack/formula@11.8.0

## 11.7.0

### Patch Changes

- Updated dependencies [5178906]
  - @objectstack/spec@11.7.0
  - @objectstack/platform-objects@11.7.0
  - @objectstack/core@11.7.0
  - @objectstack/formula@11.7.0
  - @objectstack/objectql@11.7.0

## 11.6.0

### Patch Changes

- @objectstack/spec@11.6.0
- @objectstack/core@11.6.0
- @objectstack/objectql@11.6.0
- @objectstack/formula@11.6.0
- @objectstack/platform-objects@11.6.0

## 11.5.0

### Patch Changes

- Updated dependencies [6ee4f04]
- Updated dependencies [c1e3a65]
  - @objectstack/spec@11.5.0
  - @objectstack/core@11.5.0
  - @objectstack/formula@11.5.0
  - @objectstack/objectql@11.5.0
  - @objectstack/platform-objects@11.5.0

## 11.4.0

### Patch Changes

- Updated dependencies [5821c51]
- Updated dependencies [a0fce3f]
  - @objectstack/spec@11.4.0
  - @objectstack/core@11.4.0
  - @objectstack/formula@11.4.0
  - @objectstack/objectql@11.4.0
  - @objectstack/platform-objects@11.4.0

## 11.3.0

### Patch Changes

- Updated dependencies [58e8e31]
- Updated dependencies [b4a5df0]
  - @objectstack/spec@11.3.0
  - @objectstack/core@11.3.0
  - @objectstack/formula@11.3.0
  - @objectstack/objectql@11.3.0
  - @objectstack/platform-objects@11.3.0

## 11.2.0

### Patch Changes

- Updated dependencies [d0f4b13]
- Updated dependencies [302bdab]
  - @objectstack/spec@11.2.0
  - @objectstack/core@11.2.0
  - @objectstack/formula@11.2.0
  - @objectstack/objectql@11.2.0
  - @objectstack/platform-objects@11.2.0

## 11.1.0

### Patch Changes

- Updated dependencies [cbc8c02]
- Updated dependencies [07c2773]
- Updated dependencies [d7a88df]
- Updated dependencies [4f8f108]
- Updated dependencies [ce0b4f6]
- Updated dependencies [90bce88]
- Updated dependencies [3209ec6]
- Updated dependencies [e011d42]
- Updated dependencies [6e5bdd5]
- Updated dependencies [13dbcf2]
- Updated dependencies [9ccfcd6]
- Updated dependencies [ecf193f]
- Updated dependencies [51bec81]
- Updated dependencies [3e593a7]
- Updated dependencies [fdb41c0]
- Updated dependencies [63d5403]
  - @objectstack/platform-objects@11.1.0
  - @objectstack/core@11.1.0
  - @objectstack/objectql@11.1.0
  - @objectstack/spec@11.1.0
  - @objectstack/formula@11.1.0

## 11.0.0

### Patch Changes

- Updated dependencies [4d99a5c]
- Updated dependencies [9b5bf3d]
- Updated dependencies [cb5b393]
- Updated dependencies [ab5718a]
- Updated dependencies [61d441f]
- Updated dependencies [c224e18]
- Updated dependencies [d616e1d]
- Updated dependencies [4845c12]
- Updated dependencies [c1a754a]
- Updated dependencies [6fbe91f]
- Updated dependencies [715d667]
- Updated dependencies [5eef4cf]
- Updated dependencies [72759e1]
- Updated dependencies [6c4fbd9]
- Updated dependencies [ef3ed67]
- Updated dependencies [359c0aa]
- Updated dependencies [cd51229]
- Updated dependencies [7697a0e]
- Updated dependencies [e7e04f1]
- Updated dependencies [cfd5ac4]
- Updated dependencies [2be5c1f]
- Updated dependencies [ad143ce]
- Updated dependencies [5c4a8c8]
- Updated dependencies [3afaeed]
- Updated dependencies [5737261]
- Updated dependencies [a619a3a]
- Updated dependencies [f44c1bd]
- Updated dependencies [8801c02]
- Updated dependencies [3d04e06]
- Updated dependencies [4a84c98]
- Updated dependencies [c715d25]
- Updated dependencies [aa33b02]
- Updated dependencies [d980f0d]
- Updated dependencies [a658523]
- Updated dependencies [82ff91c]
- Updated dependencies [638f472]
  - @objectstack/objectql@11.0.0
  - @objectstack/platform-objects@11.0.0
  - @objectstack/spec@11.0.0
  - @objectstack/formula@11.0.0
  - @objectstack/core@11.0.0

## 10.3.0

### Patch Changes

- Updated dependencies [211425e]
  - @objectstack/objectql@10.3.0
  - @objectstack/spec@10.3.0
  - @objectstack/core@10.3.0
  - @objectstack/formula@10.3.0
  - @objectstack/platform-objects@10.3.0

## 10.2.0

### Patch Changes

- Updated dependencies [b496498]
  - @objectstack/spec@10.2.0
  - @objectstack/core@10.2.0
  - @objectstack/formula@10.2.0
  - @objectstack/objectql@10.2.0
  - @objectstack/platform-objects@10.2.0

## 10.1.0

### Patch Changes

- Updated dependencies [49da36e]
- Updated dependencies [ac79f16]
  - @objectstack/spec@10.1.0
  - @objectstack/core@10.1.0
  - @objectstack/formula@10.1.0
  - @objectstack/objectql@10.1.0
  - @objectstack/platform-objects@10.1.0

## 10.0.0

### Major Changes

- e16f2a8: **BREAKING:** the system object `sys_department` is renamed to `sys_business_unit`
  — object + member table (`sys_department_member` → `sys_business_unit_member`),
  fields, and i18n — with **no compatibility alias**. Any deployment holding
  `sys_department` rows, or metadata that references the object by name (lookups,
  list views, queries, sharing/approval scopes), must migrate to `sys_business_unit`.
  A renamed shipped system object is a breaking change to the platform's public
  data surface, so this lands as a **major**. Verified per ADR-0059's pre-publish
  hotcrm gate: no published downstream consumer references the old name.

  ADR-0057 — ERP authorization core. Adds permission-grant access DEPTH
  (`own`/`own_and_reports`/`unit`/`unit_and_below`/`org`), renames `sys_department`
  → `sys_business_unit` (no aliases — see BREAKING above), introduces the platform-owned
  `sys_user_position` assignment, and seeds stack-declared `roles`/`sharingRules` into
  `sys_position`/`sys_sharing_rule` at boot (closes #2077). Hierarchy-relative scopes are
  delegated to a pluggable `IHierarchyScopeResolver` (open edition fails closed to
  owner-only; `defineStack` errors without `requires: ['hierarchy-security']`). Also
  fixes a latent over-grant where `engine.find({ filter })` was ignored (driver reads
  `where`) — normalized `filter`→`where` in the engine.

### Minor Changes

- 30c0313: Add `sys_user.primary_business_unit_id` projection (ADR-0057 addendum D12).

  Adds a denormalised `primary_business_unit_id` lookup to `sys_user`, maintained
  by plugin-sharing as a projection of `sys_business_unit_member.is_primary`
  (insert/update/delete hooks + a boot-time backfill). This makes "pick people by
  business unit" — the Dataverse _filtered lookup_ / ServiceNow _reference
  qualifier_ interaction — expressible as a plain `where: { primary_business_unit_id: X }`
  (and thus as a `lookupFilters` picker filter) with **zero** query-engine change,
  without traversing the membership junction. `sys_business_unit_member` remains
  the effective-dated, matrix-friendly source of truth; the new column is a
  maintained projection, not a second source. Home is plugin-sharing (always
  loaded, owns the BU graph) rather than plugin-org-scoping, so the projection
  works in single-tenant deployments too. Picker filtering by BU is therefore an
  **open** (non-enterprise) capability — only hierarchy _rollup_ stays paid.

- cfd86ce: ADR-0058 — expression & predicate surface unification. Adds the canonical
  CEL→FilterCondition pushdown compiler in `@objectstack/formula`
  (`compileCelToFilter`, `isPushdownableCel`, `lowerCelAst`) plus an in-memory
  `matchesFilterCondition` backend (one AST, three backends). `plugin-security`
  (RLS `using`, via a SQL bridge) and `plugin-sharing` (`celToFilter`) cut over to
  it, retiring the bespoke regex/field-equality front-ends. Compound sharing
  conditions now compile and enforce end-to-end (closes #1887). The RLS `check`
  clause is now enforced on the write post-image (insert/by-id update), fail-closed.
  Non-pushdownable predicates (arithmetic, functions, subqueries, cross-object) are
  an authoring compile error, never silently dropped (ADR-0049/0055).

### Patch Changes

- ce13bb8: Single-tenant audit follow-ups (ADR-0057):

  - **`sys_member` / `sys_invitation`**: make `organization_id` optional (same class as the
    sys_business_unit/sys_team fix #2178). Single-tenant has no org row and no auto-stamp;
    multi-tenant still auto-stamps via OrgScopingPlugin with null-org rows hidden by
    tenant-isolation RLS (fail-closed). Completes the org-scoped identity graph's
    single-tenant consistency.
  - **`BusinessUnitGraphService.headOf()`**: add the missing `orgScope()` org filter (it
    queries under SYSTEM_CTX, bypassing RLS, so the scope is the only isolation). Previously
    `headOf(buId)` read a business unit's `manager_user_id` by id alone — a cross-organization
    leak in multi-tenant. Now consistent with `descendants()`. +regression test.

- Updated dependencies [d7ff626]
- Updated dependencies [2a1b16b]
- Updated dependencies [2256e93]
- Updated dependencies [7108ff3]
- Updated dependencies [30c0313]
- Updated dependencies [e16f2a8]
- Updated dependencies [cfd86ce]
- Updated dependencies [e411a82]
- Updated dependencies [ae271d0]
- Updated dependencies [61ed5c7]
- Updated dependencies [a581385]
- Updated dependencies [d5f6d29]
- Updated dependencies [220ce5b]
- Updated dependencies [3efe334]
- Updated dependencies [0df063e]
- Updated dependencies [ce13bb8]
- Updated dependencies [feead7e]
- Updated dependencies [6ca20b3]
- Updated dependencies [5f875fe]
- Updated dependencies [b469950]
- Updated dependencies [47d978a]
- Updated dependencies [48a307a]
- Updated dependencies [25fc0e4]
  - @objectstack/spec@10.0.0
  - @objectstack/objectql@10.0.0
  - @objectstack/platform-objects@10.0.0
  - @objectstack/formula@10.0.0
  - @objectstack/core@10.0.0

## 9.11.0

### Minor Changes

- 2365d07: feat(sharing): configurable role-hierarchy widening — `unit_and_subordinates` recipient (ADR-0056 D6)

  Role-hierarchy access widening ("a manager sees records shared with their team") is now
  **implemented and configurable per sharing rule**, not a hardcoded no-op. The
  `unit_and_subordinates` recipient (declarable on `sys_sharing_rule.recipient_type`) expands,
  at evaluation time, to the named role **plus every subordinate role** by walking the
  `sys_position.parent` hierarchy via a new `PositionGraphService` (mirroring the department/team
  graphs; cycle-safe). Previously `Role.parent` was declared but never consumed — a silent
  no-op flagged by the ADR-0056 audit. This is the Salesforce "grant access using hierarchies"
  model expressed declaratively: each rule chooses whether to roll up the hierarchy. Unit-proven
  (role-graph traversal, subordinate-user expansion, cycle safety); the recipient is added to
  the authoring select + the `SharingRuleRecipientType` contract.

### Patch Changes

- e7f6539: feat(spec,sharing): canonical OWD vocabulary on `object.sharingModel` (ADR-0056 D1)

  Reconciles the Org-Wide-Default naming so authors use ONE vocabulary. `object.sharingModel`
  now accepts the canonical OWD names — `private` | `public_read` | `public_read_write` |
  `controlled_by_parent` — alongside the legacy `read` / `read_write` / `full` aliases (kept,
  non-breaking). The sharing runtime maps them onto the three enforced behaviours
  (`public_read` ≡ legacy `read` = everyone reads / owner writes; `public_read_write` =
  unscoped). Unknown values remain rejected by the enum (authoring-time, fail-closed). The
  showcase announcement now declares the canonical `public_read`, exercised end-to-end by the
  public-read dogfood proof.

- Updated dependencies [e7f6539]
- Updated dependencies [2365d07]
- Updated dependencies [6595b53]
- Updated dependencies [fa8964d]
- Updated dependencies [36138c7]
- Updated dependencies [a8e4f3b]
- Updated dependencies [4c213c2]
- Updated dependencies [2afb612]
  - @objectstack/spec@9.11.0
  - @objectstack/objectql@9.11.0
  - @objectstack/core@9.11.0
  - @objectstack/platform-objects@9.11.0

## 9.10.0

### Patch Changes

- Updated dependencies [db02bd5]
- Updated dependencies [641675d]
- Updated dependencies [94e9040]
- Updated dependencies [4331adb]
- Updated dependencies [1f88fd9]
- Updated dependencies [1f88fd9]
- Updated dependencies [e2b5324]
- Updated dependencies [fd07027]
  - @objectstack/spec@9.10.0
  - @objectstack/platform-objects@9.10.0
  - @objectstack/objectql@9.10.0
  - @objectstack/core@9.10.0

## 9.9.1

### Patch Changes

- @objectstack/spec@9.9.1
- @objectstack/core@9.9.1
- @objectstack/objectql@9.9.1
- @objectstack/platform-objects@9.9.1

## 9.9.0

### Patch Changes

- Updated dependencies [84249a4]
- Updated dependencies [44c5348]
- Updated dependencies [11af299]
- Updated dependencies [d5774b5]
- Updated dependencies [bfa3102]
- Updated dependencies [134043a]
- Updated dependencies [67c29ee]
- Updated dependencies [90108e0]
- Updated dependencies [9afeb2d]
- Updated dependencies [6bec07e]
- Updated dependencies [601cc11]
- Updated dependencies [d99a75a]
- Updated dependencies [575448d]
  - @objectstack/spec@9.9.0
  - @objectstack/objectql@9.9.0
  - @objectstack/core@9.9.0
  - @objectstack/platform-objects@9.9.0

## 9.8.0

### Patch Changes

- Updated dependencies [76ac582]
- Updated dependencies [97c55b3]
- Updated dependencies [1b1f490]
- Updated dependencies [884bf2f]
  - @objectstack/objectql@9.8.0
  - @objectstack/spec@9.8.0
  - @objectstack/core@9.8.0
  - @objectstack/platform-objects@9.8.0

## 9.7.0

### Patch Changes

- @objectstack/objectql@9.7.0
- @objectstack/spec@9.7.0
- @objectstack/core@9.7.0
- @objectstack/platform-objects@9.7.0

## 9.6.0

### Patch Changes

- Updated dependencies [d1e930a]
- Updated dependencies [71578f2]
- Updated dependencies [5e3a301]
- Updated dependencies [5db2742]
- Updated dependencies [b04b7e3]
- Updated dependencies [d13df3f]
  - @objectstack/spec@9.6.0
  - @objectstack/objectql@9.6.0
  - @objectstack/core@9.6.0
  - @objectstack/platform-objects@9.6.0

## 9.5.1

### Patch Changes

- Updated dependencies [ee72aae]
  - @objectstack/spec@9.5.1
  - @objectstack/core@9.5.1
  - @objectstack/objectql@9.5.1
  - @objectstack/platform-objects@9.5.1

## 9.5.0

### Patch Changes

- Updated dependencies [d08551c]
- Updated dependencies [5be7102]
- Updated dependencies [707aeed]
- Updated dependencies [7a103d4]
- Updated dependencies [4b01250]
  - @objectstack/spec@9.5.0
  - @objectstack/platform-objects@9.5.0
  - @objectstack/core@9.5.0
  - @objectstack/objectql@9.5.0

## 9.4.0

### Patch Changes

- Updated dependencies [060467a]
- Updated dependencies [c1dfe34]
- Updated dependencies [0856476]
- Updated dependencies [fef38ec]
- Updated dependencies [3e675f6]
- Updated dependencies [b678d8c]
- Updated dependencies [b678d8c]
- Updated dependencies [b678d8c]
- Updated dependencies [b678d8c]
- Updated dependencies [b678d8c]
- Updated dependencies [b678d8c]
  - @objectstack/spec@9.4.0
  - @objectstack/objectql@9.4.0
  - @objectstack/core@9.4.0
  - @objectstack/platform-objects@9.4.0

## 9.3.0

### Patch Changes

- Updated dependencies [1ada658]
- Updated dependencies [6259882]
- Updated dependencies [3219191]
- Updated dependencies [290f631]
- Updated dependencies [50b7b47]
- Updated dependencies [f15d6f6]
- Updated dependencies [f8684ea]
- Updated dependencies [c802327]
- Updated dependencies [b4765be]
- Updated dependencies [b10aa78]
- Updated dependencies [2796a1f]
  - @objectstack/spec@9.3.0
  - @objectstack/objectql@9.3.0
  - @objectstack/platform-objects@9.3.0
  - @objectstack/core@9.3.0

## 9.2.0

### Patch Changes

- Updated dependencies [2f57b75]
- Updated dependencies [2f57b75]
  - @objectstack/spec@9.2.0
  - @objectstack/core@9.2.0
  - @objectstack/objectql@9.2.0
  - @objectstack/platform-objects@9.2.0

## 9.1.0

### Patch Changes

- Updated dependencies [b9062c9]
  - @objectstack/spec@9.1.0
  - @objectstack/core@9.1.0
  - @objectstack/objectql@9.1.0
  - @objectstack/platform-objects@9.1.0

## 9.0.1

### Patch Changes

- Updated dependencies [1817845]
  - @objectstack/spec@9.0.1
  - @objectstack/core@9.0.1
  - @objectstack/objectql@9.0.1
  - @objectstack/platform-objects@9.0.1

## 9.0.0

### Patch Changes

- Updated dependencies [4c3f693]
- Updated dependencies [0bf39f1]
- Updated dependencies [f533f42]
- Updated dependencies [1c83ee8]
  - @objectstack/spec@9.0.0
  - @objectstack/core@9.0.0
  - @objectstack/objectql@9.0.0
  - @objectstack/platform-objects@9.0.0

## 8.0.1

### Patch Changes

- @objectstack/spec@8.0.1
- @objectstack/core@8.0.1
- @objectstack/objectql@8.0.1
- @objectstack/platform-objects@8.0.1

## 8.0.0

### Patch Changes

- Updated dependencies [a46c017]
- Updated dependencies [b990b89]
- Updated dependencies [99111ec]
- Updated dependencies [d5a8161]
- Updated dependencies [5cf1f1b]
- Updated dependencies [9ef89d4]
- Updated dependencies [e6374b5]
- Updated dependencies [3306d2f]
- Updated dependencies [c262301]
- Updated dependencies [bc44195]
- Updated dependencies [9e2e229]
- Updated dependencies [345e189]
  - @objectstack/spec@8.0.0
  - @objectstack/objectql@8.0.0
  - @objectstack/core@8.0.0
  - @objectstack/platform-objects@8.0.0

## 7.9.0

### Patch Changes

- Updated dependencies [ac1fc4c]
- Updated dependencies [ac1fc4c]
- Updated dependencies [ac1fc4c]
  - @objectstack/objectql@7.9.0
  - @objectstack/spec@7.9.0
  - @objectstack/core@7.9.0
  - @objectstack/platform-objects@7.9.0

## 7.8.0

### Patch Changes

- Updated dependencies [06f2bbb]
- Updated dependencies [a75823a]
- Updated dependencies [4fbb86a]
- Updated dependencies [e631f1e]
- Updated dependencies [6fc2678]
- Updated dependencies [36719db]
- Updated dependencies [424ab26]
  - @objectstack/spec@7.8.0
  - @objectstack/objectql@7.8.0
  - @objectstack/core@7.8.0
  - @objectstack/platform-objects@7.8.0

## 7.7.0

### Patch Changes

- Updated dependencies [b391955]
- Updated dependencies [f06b64e]
- Updated dependencies [023bf93]
- Updated dependencies [764c747]
  - @objectstack/spec@7.7.0
  - @objectstack/platform-objects@7.7.0
  - @objectstack/objectql@7.7.0
  - @objectstack/core@7.7.0

## 7.6.0

### Patch Changes

- Updated dependencies [955d4c8]
- Updated dependencies [c4a4cbd]
- Updated dependencies [b046ec2]
- Updated dependencies [2170ad9]
- Updated dependencies [02d6359]
- Updated dependencies [7648242]
- Updated dependencies [8fa1e7f]
- Updated dependencies [7ae6abc]
- Updated dependencies [55866f5]
- Updated dependencies [60f9c45]
  - @objectstack/spec@7.6.0
  - @objectstack/objectql@7.6.0
  - @objectstack/platform-objects@7.6.0
  - @objectstack/core@7.6.0

## 7.5.0

### Patch Changes

- @objectstack/spec@7.5.0
- @objectstack/core@7.5.0
- @objectstack/objectql@7.5.0
- @objectstack/platform-objects@7.5.0

## 7.4.1

### Patch Changes

- @objectstack/spec@7.4.1
- @objectstack/core@7.4.1
- @objectstack/objectql@7.4.1
- @objectstack/platform-objects@7.4.1

## 7.4.0

### Minor Changes

- e478e0c: ADR-0029 K2 — security domain ownership (RBAC + sharing) + Setup nav contributions.

  Moves the security objects out of the `@objectstack/platform-objects` monolith
  into the two capability plugins that already register and operate them, split by
  concern (the two are orthogonal — sharing objects never reference RBAC objects):

  - **`@objectstack/plugin-security`** (RBAC) gains `sys_position`,
    `sys_permission_set`, `sys_user_permission_set`, `sys_position_permission_set`,
    and the `defaultPermissionSets` seed (which its `bootstrap-platform-admin`
    already consumes). The RBAC + default-permission-set tests move with them.
  - **`@objectstack/plugin-sharing`** gains `sys_record_share`,
    `sys_sharing_rule`, `sys_share_link`.
  - `@objectstack/platform-objects` no longer defines/exports any security
    objects; the `/security` subpath is now an empty barrel. Runtime is unchanged
    (both plugins already registered these objects at runtime).

  **D7 navigation** — the Setup app's `group_access_control` is now assembled from
  three sources: `plugin-security` contributes Roles / Permission Sets (priority
  100), `plugin-sharing` contributes Sharing Rules / Record Shares (priority 200),
  and `platform-objects` keeps only API Keys (`sys_api_key`, an identity object,
  priority 300) — preserving the original menu order.

  **i18n (D8)** — the objects are removed from the `platform-objects` i18n extract
  config; existing generated bundles keep working at runtime (object-name keyed).
  Migrating the i18n extraction to the owning plugins remains the tracked
  follow-up.

### Patch Changes

- 4404572: ADR-0029 D8 — migrate i18n ownership for the moved domains to their plugins.

  The object translations for the domains decomposed in K2.a/K2.b/K2 previously
  lived in the `@objectstack/platform-objects` generated bundles even though the
  objects now live in their capability plugins. This moves each domain's i18n
  extraction + bundles to the owning plugin, preserving every hand-translated
  string (zh-CN / ja-JP / es-ES):

  - Each plugin gains a build-time `scripts/i18n-extract.config.ts` and a
    `src/translations/` bundle (`{locale}.objects.generated.ts` + an `index.ts`
    barrel), generated with `os i18n extract` and self-baselined so re-runs
    preserve translations.
  - Each plugin loads its bundle at runtime on `kernel:ready` via
    `i18n.loadTranslations` (the i18n service is optional — load is best-effort).
    - `plugin-webhooks` ← `sys_webhook`, `sys_webhook_delivery`
    - `plugin-approvals` ← `sys_approval_request`, `sys_approval_action`
    - `plugin-security` ← `sys_position`, `sys_permission_set`,
      `sys_user_permission_set`, `sys_position_permission_set`
    - `plugin-sharing` ← `sys_record_share`, `sys_sharing_rule`, `sys_share_link`
  - `@objectstack/platform-objects` translation bundles are regenerated to drop
    those objects' keys (its extract config already excluded them); all other
    objects' translations and the metadata-form bundles are preserved.

  Net runtime effect is unchanged (same translations load, now contributed by the
  package that owns each object) — closing the D8 follow-up tracked since K2.a.

- Updated dependencies [23c7107]
- Updated dependencies [c72daad]
- Updated dependencies [4404572]
- Updated dependencies [eea3f1b]
- Updated dependencies [e478e0c]
- Updated dependencies [4cc2ced]
- Updated dependencies [13632b1]
- Updated dependencies [f115182]
- Updated dependencies [2faf9f2]
- Updated dependencies [2faf9f2]
- Updated dependencies [2faf9f2]
- Updated dependencies [2faf9f2]
- Updated dependencies [a6d4cbb]
- Updated dependencies [58b450b]
- Updated dependencies [82eb6cf]
- Updated dependencies [c381977]
- Updated dependencies [13d8653]
- Updated dependencies [ff3d006]
- Updated dependencies [5e831de]
  - @objectstack/spec@7.4.0
  - @objectstack/objectql@7.4.0
  - @objectstack/platform-objects@7.4.0
  - @objectstack/core@7.4.0

## 7.3.0

### Patch Changes

- Updated dependencies [5e7c554]
  - @objectstack/spec@7.3.0
  - @objectstack/core@7.3.0
  - @objectstack/objectql@7.3.0
  - @objectstack/platform-objects@7.3.0

## 7.2.1

### Patch Changes

- Updated dependencies [9096dfe]
  - @objectstack/objectql@7.2.1
  - @objectstack/spec@7.2.1
  - @objectstack/core@7.2.1
  - @objectstack/platform-objects@7.2.1

## 7.2.0

### Patch Changes

- @objectstack/spec@7.2.0
- @objectstack/core@7.2.0
- @objectstack/objectql@7.2.0
- @objectstack/platform-objects@7.2.0

## 7.1.0

### Patch Changes

- Updated dependencies [6228609]
- Updated dependencies [47a92f4]
  - @objectstack/platform-objects@7.1.0
  - @objectstack/spec@7.1.0
  - @objectstack/objectql@7.1.0
  - @objectstack/core@7.1.0

## 7.0.0

### Patch Changes

- Updated dependencies [74470ad]
- Updated dependencies [d29617e]
- Updated dependencies [dc72172]
- Updated dependencies [d29617e]
- Updated dependencies [010757b]
- Updated dependencies [257954d]
  - @objectstack/spec@7.0.0
  - @objectstack/platform-objects@7.0.0
  - @objectstack/core@7.0.0
  - @objectstack/objectql@7.0.0

## 6.9.0

### Patch Changes

- @objectstack/spec@6.9.0
- @objectstack/core@6.9.0
- @objectstack/objectql@6.9.0
- @objectstack/platform-objects@6.9.0

## 6.8.1

### Patch Changes

- @objectstack/spec@6.8.1
- @objectstack/core@6.8.1
- @objectstack/objectql@6.8.1
- @objectstack/platform-objects@6.8.1

## 6.8.0

### Patch Changes

- Updated dependencies [6e88f77]
- Updated dependencies [c8b9f57]
- Updated dependencies [45d27c5]
  - @objectstack/spec@6.8.0
  - @objectstack/objectql@6.8.0
  - @objectstack/platform-objects@6.8.0
  - @objectstack/core@6.8.0

## 6.7.1

### Patch Changes

- @objectstack/spec@6.7.1
- @objectstack/core@6.7.1
- @objectstack/objectql@6.7.1
- @objectstack/platform-objects@6.7.1

## 6.7.0

### Patch Changes

- Updated dependencies [430067b]
- Updated dependencies [4f9e9d4]
- Updated dependencies [4f9e9d4]
  - @objectstack/spec@6.7.0
  - @objectstack/platform-objects@6.7.0
  - @objectstack/core@6.7.0
  - @objectstack/objectql@6.7.0

## 6.6.0

### Patch Changes

- Updated dependencies [a49cfc2]
  - @objectstack/spec@6.6.0
  - @objectstack/core@6.6.0
  - @objectstack/objectql@6.6.0
  - @objectstack/platform-objects@6.6.0

## 6.5.1

### Patch Changes

- @objectstack/spec@6.5.1
- @objectstack/core@6.5.1
- @objectstack/objectql@6.5.1
- @objectstack/platform-objects@6.5.1

## 6.5.0

### Patch Changes

- @objectstack/spec@6.5.0
- @objectstack/core@6.5.0
- @objectstack/objectql@6.5.0
- @objectstack/platform-objects@6.5.0

## 6.4.0

### Patch Changes

- Updated dependencies [f8651cc]
- Updated dependencies [f8651cc]
- Updated dependencies [0bf6f9a]
  - @objectstack/spec@6.4.0
  - @objectstack/core@6.4.0
  - @objectstack/objectql@6.4.0
  - @objectstack/platform-objects@6.4.0

## 6.3.0

### Patch Changes

- @objectstack/spec@6.3.0
- @objectstack/core@6.3.0
- @objectstack/objectql@6.3.0
- @objectstack/platform-objects@6.3.0

## 6.2.0

### Patch Changes

- Updated dependencies [b4c74a9]
  - @objectstack/spec@6.2.0
  - @objectstack/core@6.2.0
  - @objectstack/objectql@6.2.0
  - @objectstack/platform-objects@6.2.0

## 6.1.1

### Patch Changes

- @objectstack/spec@6.1.1
- @objectstack/core@6.1.1
- @objectstack/objectql@6.1.1
- @objectstack/platform-objects@6.1.1

## 6.1.0

### Patch Changes

- Updated dependencies [93c0589]
  - @objectstack/spec@6.1.0
  - @objectstack/core@6.1.0
  - @objectstack/objectql@6.1.0
  - @objectstack/platform-objects@6.1.0

## 6.0.0

### Patch Changes

- Updated dependencies [629a716]
- Updated dependencies [dbc4f7d]
- Updated dependencies [944f187]
  - @objectstack/spec@6.0.0
  - @objectstack/platform-objects@6.0.0
  - @objectstack/core@6.0.0
  - @objectstack/objectql@6.0.0

## 5.2.0

### Patch Changes

- Updated dependencies [bab2b20]
- Updated dependencies [fa011d8]
- Updated dependencies [f0f7c27]
- Updated dependencies [b806f58]
  - @objectstack/platform-objects@5.2.0
  - @objectstack/spec@5.2.0
  - @objectstack/core@5.2.0
  - @objectstack/objectql@5.2.0

## 5.1.0

### Patch Changes

- Updated dependencies [75f4ee6]
- Updated dependencies [823d559]
  - @objectstack/spec@5.1.0
  - @objectstack/platform-objects@5.1.0
  - @objectstack/objectql@5.1.0
  - @objectstack/core@5.1.0

## 5.0.0

### Patch Changes

- Updated dependencies [5e9dcb4]
- Updated dependencies [f139a24]
- Updated dependencies [4eb9f8c]
- Updated dependencies [2f7e42a]
- Updated dependencies [602cce7]
- Updated dependencies [1e625b8]
- Updated dependencies [6ee42b8]
- Updated dependencies [888a5c1]
- Updated dependencies [5cfdc85]
- Updated dependencies [09f005a]
- Updated dependencies [7825394]
- Updated dependencies [96ad4df]
- Updated dependencies [2f9073a]
  - @objectstack/objectql@5.0.0
  - @objectstack/platform-objects@5.0.0
  - @objectstack/spec@5.0.0
  - @objectstack/core@5.0.0

## 4.2.0

### Patch Changes

- Updated dependencies [2869891]
  - @objectstack/spec@4.2.0
  - @objectstack/objectql@4.2.0
  - @objectstack/core@4.2.0
  - @objectstack/platform-objects@4.2.0

## 4.1.1

### Patch Changes

- @objectstack/spec@4.1.1
- @objectstack/core@4.1.1
- @objectstack/objectql@4.1.1
- @objectstack/platform-objects@4.1.1

## 4.0.1

### Patch Changes

- Updated dependencies [2108c30]
- Updated dependencies [23db640]
- Updated dependencies [5683206]
- Updated dependencies [f0b3972]
- Updated dependencies [0e63f2f]
  - @objectstack/spec@4.1.0
  - @objectstack/objectql@4.1.0
  - @objectstack/core@4.1.0
  - @objectstack/platform-objects@4.1.0
