Commit b70a55d
* fix(plugin-sharing): per-grant catch in both reconcile loops so a refused grant no longer aborts the pass
After #14484 `sys_record_share` is tenant-scoped in the #13491 ledger, so an
organization-less system insert on it is refused loudly with
`ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` on a walled install. A platform-global
sharing rule materialising a grant onto an organization-less record resolves no
organization and meets that refusal; with no per-grant catch it propagated and
that rule's reconcile pass aborted mid-loop, taking the pass's stale-row
revocations with it. Those revocations are the security-relevant half: a stale
over-grant persisted across every later pass, which met the same record and
died in the same place.
Both loops now attempt each grant individually. A refusal is logged with the
rule, object, record, recipient and the engine's code, counted in the pass
result, and the pass continues.
The catch is narrow — only `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED` is
absorbed. `record-share-organization-stamp.test.ts` deliberately pins the abort
on the other error a pass can meet here (the scoped update half answering
`RECORD_NOT_FOUND`), a shape the 2026-09-02 contract review left standing; a
catch-all would retire that decision as a side effect.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* docs(permissions): re-anchor the system-context census to the two shifted elevation reads
`check:check-system-context-census` failed with pure line rot: the per-grant
catch added 37 lines above `sharing-rule-service.ts`'s two `context?.isSystem`
elevation reads, so the census page's anchors pointed at :157/:382 while the
reads now sit at :194/:419. Re-anchored with the gate's own `--fix`; no prose
and no behaviour changed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* docs(permissions): re-derive the row-39 census anchors on the merged tree
The merge with origin/main moved `sharing-rule-service.ts` — main added the
`warnOnEmptyUnitExpansion` limb above both elevation reads — so the anchors
this branch re-anchored before the merge point at the pre-merge lines. Machine
re-derived with `pnpm gen:system-context-census`; nothing hand-edited.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* docs(permissions): re-derive the system-context census anchors on the merged tree
The os-regen merge driver does not text-merge this file. Regenerated with
`pnpm gen:system-context-census` on the committed merge, as its own commit:
main's line rot (rows 21, 56, 63 and the misconception table) is re-anchored,
and row 39's branch anchors are re-derived unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WXyGTWPbbreqXow7Z2pZCk
* chore(spec): record the plugin-sharing organization-refusal MATCH as a provenance waiver (#14937)
`check:error-code-provenance` scans for `constdef` stamp sites and cannot tell
a package that RECOGNISES a registered code from one that EMITS it. The
per-grant catch added for #14754 spells the engine's refusal code once, as
`ENGINE_ORGANIZATION_REFUSAL_CODE`, and compares an incoming `err.code`
against it — the gate reads that as an unlisted stamp site under
`@objectstack/plugin-sharing`.
Adjudicated on #14937 (maintainer ruling A, 2026-09-04): record it as a
`PROVENANCE_WAIVERS` row naming `@objectstack/objectql` — the real emitter,
whose owner key already carries the code (#8844) — rather than widening the
gate or evading it with a bare inline literal. The row comes out together with
the stamp site when #14936 lands and objectql publishes a recognizer.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WXyGTWPbbreqXow7Z2pZCk
* docs(changeset): declare the wire surface `grantsRefused` reaches, and the client-type lag
The evaluate route is a ledgered SDK route whose handler passes the service
return value through unfiltered, so the seventh key is on the response body
every caller already receives. The SDK method's declared resolved type is the
spec's six-field `SharingRuleEvaluationResult`, which cannot name it — a
client-type lag, additive on the wire, tracked as #14969. Declared here rather
than lifted, because the spec type is a `domain:spec` single-owner file.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WXyGTWPbbreqXow7Z2pZCk
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 96b4af8 commit b70a55d
6 files changed
Lines changed: 700 additions & 66 deletions
File tree
- .changeset
- content/docs/permissions
- packages
- plugins/plugin-sharing/src
- spec/src/api
Lines changed: 79 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
0 commit comments