Repository navigation
Commit aae0cb3
* fix(plugin-sharing): let system writes materialize sharing rules
`bindRuleHooks` returned early on `ctx.session.isSystem` in `afterInsert` and
`afterUpdate`, so a system-context write that moved a record into a sharing
rule's criteria materialized no `sys_record_share` row. Approval write-back is
exactly that write — an approval node with `lockRecord: true` mirrors the
decision onto the subject record under a system context, because while the
record is locked no other write can land — so a teammate who depended on the
criteria rule could not see an approved record until somebody re-evaluated the
rule or restarted the server.
Removes three early returns: the two named above, and the one on the
`beforeUpdate` / `beforeDelete` row-set stash they depended on. That third one
is load-bearing: without a stash `readAffectedRows` reports the row set as
`unbounded`, which would have sent every single-row system update down the
object-wide revoke plus asynchronous re-grant branch instead of the per-record
recompute. Retires the `SYSTEM_WRITE_SKIP_NOTICE` channel that announced the
skip.
`afterDelete` keeps its skip on separate grounds — its payload is revocation,
which `record-share-cascade.ts` delivers for system writes on its own account.
The two pins of the old behaviour are reversed and registered rather than
deleted: `system-write-skip-notice.test.ts` is renamed to
`system-write-materialisation.test.ts` and carries a row-by-row register of
every old expectation against its new counterpart, and `bulk-recompute.test.ts`
keeps its case under a docblock recording what it used to assert and why.
`content/docs/permissions/system-context.mdx` is updated because
`check:system-context-census` requires it: the page anchors every `isSystem`
read site and states census-derived counts, and three sites vanished.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* chore(sharing): regenerate the isSystem census page and the engine-double ledger after merging main
Discharges the os-regen deferral the merge commit recorded.
`content/docs/permissions/system-context.mdx` is os-regen-driven and both sides
moved it, so the merge sequence took main's side and this commit re-applies the
branch's hand-written half on top: row 30 now describes the one surviving skip
(`afterDelete`, whose payload `record-share-cascade.ts` delivers) instead of all
four, rough edge 2 records the reversal rather than the retired INFO notice, and
the seven census-derived counts move with the population. Re-derived on the
merged tree rather than carried over — `check:system-context-census` reports
"OK — 106 elevation read sites in 20 packages across 45 files, all anchored;
140 anchors resolve, 27 declared non-read".
`scripts/engine-double-contract.pinned.json` learns the test file's new path.
The two rows are repathed, not renumbered: `--write` reports "692 (file, verb)
row(s), 2 added or grown, 2 lost. No seam losses — this regeneration only
records new seams."
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* chore(sharing): re-anchor the isSystem census page after the second main merge
Patch round 1. `content/docs/permissions/system-context.mdx` is os-regen-driven
and both sides moved it again, so the merge stopped there and neither side could
simply win: main's #14383 (#12981 batch 9) moved row 37's `share-link-service.ts`
anchors by +6, while this branch moved row 36's `sharing-plugin.ts` anchor by +11
and rewrote row 30 plus rough edge 2. The resolution takes row 37 from main and
row 36 from this branch — the two sides moved different rows, so there was no
real overlap, only the driver's refusal to text-merge a generated page.
Verified by re-deriving rather than by inspection: `check:system-context-census`
reports "OK — 106 elevation read sites in 20 packages across 45 files, all
anchored; 140 anchors resolve, 27 declared non-read".
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* docs(sharing): patch round 2 — deferred-revoke precision, bu-tree docblock, operator cost sentence
Documentation-only follow-up on the contract review's non-blocking §5 notes
2, 3 and 4. No code path changes: the only .ts edit is a docblock body.
- system-context.mdx row 30: "Lose: nothing" glossed the one shape where the
cascade's delivery is the queued orphan sweep rather than a synchronous
revoke. The cell now says the revoke is delivered but deferred on the
unbounded shape.
- bu-tree-recompute.ts: the docblock still described bindRuleHooks'
materialisation skip as current. It now says what bindRuleHooks does after
this change and why this file's own hooks never skipped system writes.
- changeset: one sentence on the operator-visible cost of seed- and
import-time system writes on rule-covered objects, and "unexported" becomes
"not exported from the package entry point". Level stays patch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* chore(sharing): re-anchor the isSystem census page after the fourth main merge
Discharges the os-regen deferral recorded by the merge commit. Pure
re-anchoring: 20 insertions / 20 deletions, all of them line numbers the
generator re-derived from the merged tree (main moved engine.ts,
sharing-service.ts, auth-plugin.ts, rest-server.ts and last-admin-guard.ts).
No prose changed on either side -- normalising every digit away leaves the
before/after byte-identical.
The engine-double-contract ledger needed no repair: its textual auto-merge was
already byte-exact, and `--write` reported 697 rows with 0 added, 0 grown and
0 lost.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent b3a63d3 commit aae0cb3
10 files changed
Lines changed: 759 additions & 519 deletions
File tree
- .changeset
- content/docs/permissions
- packages/plugins/plugin-sharing/src
- scripts
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
| 137 | + | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
| 221 | + | |
221 | 222 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
228 | 246 | | |
229 | 247 | | |
230 | 248 | | |
| |||
251 | 269 | | |
252 | 270 | | |
253 | 271 | | |
254 | | - | |
| 272 | + | |
255 | 273 | | |
256 | 274 | | |
257 | 275 | | |
| |||
308 | 326 | | |
309 | 327 | | |
310 | 328 | | |
311 | | - | |
| 329 | + | |
312 | 330 | | |
313 | 331 | | |
314 | 332 | | |
315 | | - | |
316 | | - | |
| 333 | + | |
| 334 | + | |
317 | 335 | | |
318 | 336 | | |
319 | 337 | | |
| |||
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
343 | 347 | | |
344 | 348 | | |
345 | 349 | | |
346 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
347 | 370 | | |
348 | 371 | | |
| 372 | + | |
349 | 373 | | |
350 | 374 | | |
351 | 375 | | |
352 | 376 | | |
353 | 377 | | |
354 | | - | |
355 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
356 | 381 | | |
357 | 382 | | |
358 | 383 | | |
| |||
0 commit comments