@haverstack/core 0.34.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/dist/access.d.ts +39 -34
  3. package/dist/access.d.ts.map +1 -1
  4. package/dist/access.js +94 -68
  5. package/dist/access.js.map +1 -1
  6. package/dist/changes.d.ts +22 -33
  7. package/dist/changes.d.ts.map +1 -1
  8. package/dist/changes.js +34 -48
  9. package/dist/changes.js.map +1 -1
  10. package/dist/combine.d.ts.map +1 -1
  11. package/dist/combine.js +7 -0
  12. package/dist/combine.js.map +1 -1
  13. package/dist/grants.d.ts +78 -33
  14. package/dist/grants.d.ts.map +1 -1
  15. package/dist/grants.js +164 -72
  16. package/dist/grants.js.map +1 -1
  17. package/dist/index.d.ts +2 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/query-validation.d.ts +20 -1
  21. package/dist/query-validation.d.ts.map +1 -1
  22. package/dist/query-validation.js +107 -3
  23. package/dist/query-validation.js.map +1 -1
  24. package/dist/record-changes.d.ts +71 -63
  25. package/dist/record-changes.d.ts.map +1 -1
  26. package/dist/record-changes.js +129 -85
  27. package/dist/record-changes.js.map +1 -1
  28. package/dist/scoped-stack.d.ts +118 -116
  29. package/dist/scoped-stack.d.ts.map +1 -1
  30. package/dist/scoped-stack.js +210 -188
  31. package/dist/scoped-stack.js.map +1 -1
  32. package/dist/stack.d.ts +143 -160
  33. package/dist/stack.d.ts.map +1 -1
  34. package/dist/stack.js +271 -225
  35. package/dist/stack.js.map +1 -1
  36. package/dist/testing.d.ts +3 -8
  37. package/dist/testing.d.ts.map +1 -1
  38. package/dist/testing.js +42 -49
  39. package/dist/testing.js.map +1 -1
  40. package/dist/types.d.ts +128 -101
  41. package/dist/types.d.ts.map +1 -1
  42. package/dist/types.js.map +1 -1
  43. package/dist/validate.d.ts.map +1 -1
  44. package/dist/validate.js +0 -2
  45. package/dist/validate.js.map +1 -1
  46. package/dist/wire-record.d.ts.map +1 -1
  47. package/dist/wire-record.js.map +1 -1
  48. package/package.json +1 -1
@@ -6,22 +6,44 @@
6
6
  * The equality helpers answer it against a proposed write, so the no-op
7
7
  * decision and a change event's `ops` are the same comparison and can never
8
8
  * disagree. The projections answer it against a reader: a soft-deleted
9
- * Record is its tombstone, and a snapshot's `permissions` are owner-only
10
- * audit data.
9
+ * Record is its tombstone, and a journal entry names the ACL it moved
10
+ * only to a reader who could have moved it.
11
11
  *
12
12
  * See docs/spec/events.md § The event shape and docs/spec/versioning.md
13
13
  * § The tombstone is literal.
14
14
  */
15
- import type { Association, AssociationChange, ChangeOp, EntityId, Permission, RecordChanges, RecordVersion, RelationshipTarget, StackRecord } from './types.js';
15
+ import type { Association, AssociationChange, AuthorityAssociation, ChangeOp, DataAssociation, EntityId, PermissionGrantee, RecordChanges, RecordJournalEntry, RelationshipTarget, StackRecord } from './types.js';
16
16
  /**
17
17
  * Association identity — what dissociate() matches and a second associate()
18
18
  * of the same reference is a repeat of. Matches the SQLite adapter's
19
19
  * association primary key (kind, label, file_id, related_scope, related_id,
20
- * related_ns, related_stack), which is why an attachment's
20
+ * related_ns, related_stack, related_role), which is why an attachment's
21
21
  * `attachmentRecordId` is absent here: it annotates a reference rather than
22
- * naming one. See docs/spec/data-model.md § Associations.
22
+ * naming one. `related_role` is in both because member and admin name two
23
+ * different sets of people, so two group grantees differing only by role
24
+ * are two elements. See docs/spec/data-model.md § Associations.
23
25
  */
24
26
  export declare function associationEqual(a: Association, b: Association): boolean;
27
+ /**
28
+ * Structural equality per grantee arm. `role` is required, so there is no
29
+ * absent-means-any spelling to normalize.
30
+ */
31
+ export declare function granteeEqual(a: PermissionGrantee, b: PermissionGrantee): boolean;
32
+ /**
33
+ * Whether an association carries authority rather than data — the partition
34
+ * `StackRecord.permissions` and `StackRecord.associations` project, and the
35
+ * line `associate()`/`dissociate()` refuse to cross.
36
+ * See docs/spec/access-control.md § Record-level permissions.
37
+ */
38
+ export declare function isAuthorityAssociation(a: Association): a is AuthorityAssociation;
39
+ /**
40
+ * One stored association set split into the two the record presents. An app
41
+ * editing tags never sees the authority half, so it cannot drop it.
42
+ */
43
+ export declare function partitionAssociations(associations: Association[]): {
44
+ associations: DataAssociation[];
45
+ permissions: AuthorityAssociation[];
46
+ };
25
47
  /**
26
48
  * Identity plus every annotation outside it, so a write that only re-points
27
49
  * an attachment association's `attachmentRecordId` still counts as a
@@ -40,24 +62,21 @@ export declare function associationIdentical(a: Association, b: Association): bo
40
62
  export declare function stripAssociationAnnotation(association: Association): Association;
41
63
  /**
42
64
  * What a `changes.associations` list moves against a record's current
43
- * associations, one tagged edit per association — the same comparison
44
- * `changeSetOps` decides `associate`/`dissociate` from, so which ops fired
45
- * and what these report can never disagree.
65
+ * associations, one tagged edit per association.
46
66
  *
47
- * An entry that matches something already there by identity displaced it
48
- * rather than joining it, which is a `repoint`: the association is still
49
- * on the record and only its annotation moved, so no `remove` can describe
50
- * it. `previous` is the prior association in full, annotation included —
51
- * the only place an overwritten or removed `attachmentRecordId` survives.
67
+ * An entry matching something already there by identity displaced it rather
68
+ * than joining it, which is a `repoint`: the association is still on the
69
+ * record and only its annotation moved, so no `remove` can describe it.
70
+ * `previous` is the prior association in full, annotation included — the
71
+ * only place an overwritten or removed `attachmentRecordId` survives.
52
72
  * See docs/spec/journal.md § The entry.
53
73
  */
54
74
  export declare function associationDelta(before: Association[], after: Association[]): AssociationChange[];
55
75
  /**
56
- * The two flat lists a change frame carries, derived from the tagged
57
- * list. The feed reports what is true now, so a `repoint` appears only
58
- * under its new value and a `remove` by identity alone — the prior state
59
- * the journal keeps has no place on a notification.
60
- * See docs/spec/events.md § The event shape.
76
+ * The two flat lists a change frame carries, derived from the tagged list.
77
+ * The feed reports what is true now, so a `repoint` appears only under its
78
+ * new value and a `remove` by identity alone — the prior state the journal
79
+ * keeps has no place on a notification.
61
80
  */
62
81
  export declare function feedAssociationDelta(changes: AssociationChange[]): {
63
82
  added: Association[];
@@ -65,7 +84,6 @@ export declare function feedAssociationDelta(changes: AssociationChange[]): {
65
84
  };
66
85
  /** Structural equality per target arm — what dissociate() matches on. */
67
86
  export declare function targetEqual(a: RelationshipTarget, b: RelationshipTarget): boolean;
68
- export declare function permissionEqual(a: Permission, b: Permission): boolean;
69
87
  /**
70
88
  * A change set has to name at least one aspect. Refused rather than read
71
89
  * as a no-op: it addresses nothing, so there is nothing it could have
@@ -76,72 +94,48 @@ export declare function permissionEqual(a: Permission, b: Permission): boolean;
76
94
  export declare function assertNonEmptyChangeSet(changes: RecordChanges): void;
77
95
  /**
78
96
  * Which aspects a change set actually moves, against the record as it
79
- * stands — the no-op decision and the change event's `ops` are the same
80
- * comparison, so they can never disagree. A key naming the value a record
81
- * already holds contributes nothing.
82
- *
83
- * `merged` is the content the patch produces, computed once by the
97
+ * stands. A key naming the value a record already holds contributes
98
+ * nothing. `merged` is the content the patch produces, computed once by the
84
99
  * caller that had to validate it anyway.
85
- * See docs/spec/events.md § The event shape.
86
100
  */
87
101
  export declare function changeSetOps(existing: StackRecord, changes: RecordChanges, merged: Record<string, unknown> | undefined): ChangeOp[];
88
102
  /**
89
- * Whether a change set's ops advance `version`/`updatedAt` at all.
90
- * `associate`/`dissociate` don't — a change set touching only
91
- * `associations` is a no-bump write, same as calling associate()/
92
- * dissociate() directly. Every other op does. See
93
- * docs/spec/versioning.md § Version history.
103
+ * Whether a change set's ops advance `version`/`updatedAt` at all. After the
104
+ * no-bump set above, this is `patch` and the whole-record verbs.
94
105
  */
95
106
  export declare function bumpsVersion(ops: ChangeOp[]): boolean;
96
107
  /**
97
- * Whether `ifVersion` applies to a change set. A set whose only key is
98
- * `associations` carries no precondition — it composes regardless of write
99
- * order, the same reason associate()/dissociate() take none. Any other
100
- * aspect named restores the guard over the whole call.
101
- *
102
- * Read off the keys the caller wrote rather than the ops the set turns out
103
- * to move, so a stale caller is told its version is stale whatever its
104
- * patch says — including when the patch restates what the record already
105
- * holds. See docs/spec/versioning.md § Optimistic concurrency.
108
+ * Whether `ifVersion` applies to a change set. A set naming only keys from
109
+ * the no-precondition list above carries none; any other aspect named
110
+ * restores the guard over the whole call. Read off the keys the caller
111
+ * wrote rather than the ops the set turns out to move, so a stale caller is
112
+ * told its version is stale whatever its patch says.
106
113
  */
107
114
  export declare function takesIfVersion(changes: RecordChanges): boolean;
108
115
  /**
109
- * The change set narrowed to the aspects that actually moved. An adapter
110
- * is handed this rather than what the caller wrote, so restating an aspect
116
+ * The change set narrowed to the aspects that actually moved. An adapter is
117
+ * handed this rather than what the caller wrote, so restating an aspect
111
118
  * cannot rewrite it: `unlisted: true` on an already-unlisted record would
112
- * otherwise drag `unlistedAt` forward, moving the record's publish moment
113
- * with no op reporting it. It also keeps the adapter contract honest —
114
- * every key an adapter receives is one it must write.
119
+ * otherwise drag `unlistedAt` forward with no op reporting it. Every key an
120
+ * adapter receives is one it must write.
115
121
  */
116
122
  export declare function effectiveChanges(changes: RecordChanges, ops: ChangeOp[]): RecordChanges;
117
123
  /**
118
124
  * Whether a merge patch produced the content the record already held.
119
- * Compared by serialization: content is JSON by construction — it round
120
- * trips through storage that way — and a patch preserves key order for
121
- * every field it does not name, so the encoding of an unchanged record is
122
- * stable. A reordering patch that changes nothing else is the one case
123
- * this reports as a change, which costs an empty version rather than a
124
- * wrong answer.
125
+ * Compared by serialization: content is JSON by construction and a patch
126
+ * preserves key order for every field it does not name, so an unchanged
127
+ * record encodes stably. A reordering patch that changes nothing else is
128
+ * the one case this reports as a change, costing an empty version rather
129
+ * than a wrong answer.
125
130
  */
126
131
  export declare function contentEqual(a: Record<string, unknown>, b: Record<string, unknown>): boolean;
127
- export declare function permissionsEqual(a: Permission[], b: Permission[]): boolean;
128
- /**
129
- * Ensures `creator` carries an `admin` relationship association, adding one
130
- * if it's not already present. Used to bootstrap a `_group` record's first
131
- * admin at create time.
132
- */
133
- export declare function stampGroupAdmin(associations: Association[] | undefined, creator: EntityId): Association[];
132
+ /** Bootstraps a `_group` record's first admin at create time. */
133
+ export declare function stampGroupAdmin(associations: DataAssociation[] | undefined, creator: EntityId): DataAssociation[];
134
134
  /**
135
135
  * Whether a Record is a `_group`, in any of its type versions — the family
136
136
  * whose roster rules apply.
137
137
  */
138
138
  export declare function isGroupRecord(record: StackRecord): boolean;
139
- /**
140
- * Drops a snapshot's `permissions` — owner-only audit data, never served
141
- * to a non-owner history reader. `entityId` (change attribution) stays.
142
- * See docs/spec/versioning.md § History access.
143
- */
144
- export declare function stripVersionPermissions(version: RecordVersion): RecordVersion;
145
139
  /**
146
140
  * The tombstone a soft-deleted Record is presented as. `permissions` is
147
141
  * retained because it decides whether the caller may undelete; history is
@@ -151,4 +145,18 @@ export declare function stripVersionPermissions(version: RecordVersion): RecordV
151
145
  export declare function tombstoneOf(record: StackRecord): StackRecord;
152
146
  /** A soft-deleted Record presented as its tombstone; anything else untouched. */
153
147
  export declare const presentDeleted: (record: StackRecord) => StackRecord;
148
+ /**
149
+ * Whether a tagged edit moved an authority element, reading whichever half
150
+ * of the pair carries one. The delta is one list across the partition, so
151
+ * every consumer that serves one half alone asks this.
152
+ */
153
+ export declare function movesAuthority(change: AssociationChange): boolean;
154
+ /**
155
+ * A journal entry as a reader who cannot reshare sees it: the authority
156
+ * half of its delta dropped, the `permissions` op left standing, so the
157
+ * entry still names *that* the ACL moved. Passing the mutate-surface gate
158
+ * buys the record's content history, which is not a route to its sharing
159
+ * graph. See docs/spec/journal.md § Reading it.
160
+ */
161
+ export declare function withoutAuthorityChanges(entry: RecordJournalEntry): RecordJournalEntry;
154
162
  //# sourceMappingURL=record-changes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"record-changes.d.ts","sourceRoot":"","sources":["../src/record-changes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB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AY,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,OAAO,CAErD;AAcD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAI9D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,aAAa,CAUvF;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAE5F;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAC7B,YAAY,EAAE,eAAe,EAAE,GAAG,SAAS,EAC3C,OAAO,EAAE,QAAQ,GAChB,eAAe,EAAE,CAcnB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAY5D;AAED,iFAAiF;AACjF,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,KAAG,WACJ,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,CAKrF"}
@@ -6,8 +6,8 @@
6
6
  * The equality helpers answer it against a proposed write, so the no-op
7
7
  * decision and a change event's `ops` are the same comparison and can never
8
8
  * disagree. The projections answer it against a reader: a soft-deleted
9
- * Record is its tombstone, and a snapshot's `permissions` are owner-only
10
- * audit data.
9
+ * Record is its tombstone, and a journal entry names the ACL it moved
10
+ * only to a reader who could have moved it.
11
11
  *
12
12
  * See docs/spec/events.md § The event shape and docs/spec/versioning.md
13
13
  * § The tombstone is literal.
@@ -19,11 +19,17 @@ import { SYSTEM_TYPES, RECORD_CHANGE_KEYS } from './types.js';
19
19
  * Association identity — what dissociate() matches and a second associate()
20
20
  * of the same reference is a repeat of. Matches the SQLite adapter's
21
21
  * association primary key (kind, label, file_id, related_scope, related_id,
22
- * related_ns, related_stack), which is why an attachment's
22
+ * related_ns, related_stack, related_role), which is why an attachment's
23
23
  * `attachmentRecordId` is absent here: it annotates a reference rather than
24
- * naming one. See docs/spec/data-model.md § Associations.
24
+ * naming one. `related_role` is in both because member and admin name two
25
+ * different sets of people, so two group grantees differing only by role
26
+ * are two elements. See docs/spec/data-model.md § Associations.
25
27
  */
26
28
  export function associationEqual(a, b) {
29
+ // Never "the same one": naming a malformed association is
30
+ // validateAssociation()'s job, which this must reach without throwing.
31
+ if (!a || !b)
32
+ return false;
27
33
  if (a.kind !== b.kind || a.label !== b.label)
28
34
  return false;
29
35
  if (a.kind === 'attachment' && b.kind === 'attachment')
@@ -31,8 +37,46 @@ export function associationEqual(a, b) {
31
37
  if (a.kind === 'relationship' && b.kind === 'relationship') {
32
38
  return targetEqual(a.target, b.target);
33
39
  }
40
+ if (a.kind === 'permission' && b.kind === 'permission') {
41
+ return granteeEqual(a.grantee, b.grantee);
42
+ }
34
43
  return true;
35
44
  }
45
+ /**
46
+ * Structural equality per grantee arm. `role` is required, so there is no
47
+ * absent-means-any spelling to normalize.
48
+ */
49
+ export function granteeEqual(a, b) {
50
+ if (!a || !b)
51
+ return false;
52
+ if (a.scope !== b.scope)
53
+ return false;
54
+ if (a.scope === 'entity' && b.scope === 'entity')
55
+ return a.entityId === b.entityId;
56
+ if (a.scope === 'group' && b.scope === 'group') {
57
+ return a.groupId === b.groupId && a.role === b.role;
58
+ }
59
+ return false;
60
+ }
61
+ /**
62
+ * Whether an association carries authority rather than data — the partition
63
+ * `StackRecord.permissions` and `StackRecord.associations` project, and the
64
+ * line `associate()`/`dissociate()` refuse to cross.
65
+ * See docs/spec/access-control.md § Record-level permissions.
66
+ */
67
+ export function isAuthorityAssociation(a) {
68
+ return a?.kind === 'permission' || a?.kind === 'anyone';
69
+ }
70
+ /**
71
+ * One stored association set split into the two the record presents. An app
72
+ * editing tags never sees the authority half, so it cannot drop it.
73
+ */
74
+ export function partitionAssociations(associations) {
75
+ return {
76
+ associations: associations.filter((a) => !isAuthorityAssociation(a)),
77
+ permissions: associations.filter(isAuthorityAssociation),
78
+ };
79
+ }
36
80
  /**
37
81
  * Identity plus every annotation outside it, so a write that only re-points
38
82
  * an attachment association's `attachmentRecordId` still counts as a
@@ -63,15 +107,13 @@ export function stripAssociationAnnotation(association) {
63
107
  }
64
108
  /**
65
109
  * What a `changes.associations` list moves against a record's current
66
- * associations, one tagged edit per association — the same comparison
67
- * `changeSetOps` decides `associate`/`dissociate` from, so which ops fired
68
- * and what these report can never disagree.
110
+ * associations, one tagged edit per association.
69
111
  *
70
- * An entry that matches something already there by identity displaced it
71
- * rather than joining it, which is a `repoint`: the association is still
72
- * on the record and only its annotation moved, so no `remove` can describe
73
- * it. `previous` is the prior association in full, annotation included —
74
- * the only place an overwritten or removed `attachmentRecordId` survives.
112
+ * An entry matching something already there by identity displaced it rather
113
+ * than joining it, which is a `repoint`: the association is still on the
114
+ * record and only its annotation moved, so no `remove` can describe it.
115
+ * `previous` is the prior association in full, annotation included — the
116
+ * only place an overwritten or removed `attachmentRecordId` survives.
75
117
  * See docs/spec/journal.md § The entry.
76
118
  */
77
119
  export function associationDelta(before, after) {
@@ -88,11 +130,10 @@ export function associationDelta(before, after) {
88
130
  .map((previous) => ({ op: 'remove', previous })));
89
131
  }
90
132
  /**
91
- * The two flat lists a change frame carries, derived from the tagged
92
- * list. The feed reports what is true now, so a `repoint` appears only
93
- * under its new value and a `remove` by identity alone — the prior state
94
- * the journal keeps has no place on a notification.
95
- * See docs/spec/events.md § The event shape.
133
+ * The two flat lists a change frame carries, derived from the tagged list.
134
+ * The feed reports what is true now, so a `repoint` appears only under its
135
+ * new value and a `remove` by identity alone — the prior state the journal
136
+ * keeps has no place on a notification.
96
137
  */
97
138
  export function feedAssociationDelta(changes) {
98
139
  return {
@@ -115,19 +156,6 @@ export function targetEqual(a, b) {
115
156
  return a.ns === b.ns && a.id === b.id;
116
157
  return false;
117
158
  }
118
- export function permissionEqual(a, b) {
119
- if (a.access !== b.access)
120
- return false;
121
- if (a.access === 'public')
122
- return true;
123
- if (a.access === 'entity' && b.access === 'entity') {
124
- return a.entityId === b.entityId && a.read === b.read && a.write === b.write;
125
- }
126
- if (a.access === 'group' && b.access === 'group') {
127
- return a.groupId === b.groupId && a.role === b.role && a.read === b.read && a.write === b.write;
128
- }
129
- return false;
130
- }
131
159
  /**
132
160
  * A change set has to name at least one aspect. Refused rather than read
133
161
  * as a no-op: it addresses nothing, so there is nothing it could have
@@ -137,21 +165,16 @@ export function permissionEqual(a, b) {
137
165
  */
138
166
  export function assertNonEmptyChangeSet(changes) {
139
167
  // Presence, not truthiness: `unlisted: false` and `parentId: null` are
140
- // aspects this call names, and reading them as absent would drop a
141
- // change the caller asked for.
168
+ // aspects this call names.
142
169
  if (RECORD_CHANGE_KEYS.some((key) => changes[key] !== undefined))
143
170
  return;
144
171
  throw new StackQueryError('A change set names at least one of: ' + RECORD_CHANGE_KEYS.join(', ') + '.');
145
172
  }
146
173
  /**
147
174
  * Which aspects a change set actually moves, against the record as it
148
- * stands — the no-op decision and the change event's `ops` are the same
149
- * comparison, so they can never disagree. A key naming the value a record
150
- * already holds contributes nothing.
151
- *
152
- * `merged` is the content the patch produces, computed once by the
175
+ * stands. A key naming the value a record already holds contributes
176
+ * nothing. `merged` is the content the patch produces, computed once by the
153
177
  * caller that had to validate it anyway.
154
- * See docs/spec/events.md § The event shape.
155
178
  */
156
179
  export function changeSetOps(existing, changes, merged) {
157
180
  const ops = [];
@@ -160,7 +183,8 @@ export function changeSetOps(existing, changes, merged) {
160
183
  if (changes.parentId !== undefined && changes.parentId !== (existing.parentId ?? null)) {
161
184
  ops.push('reparent');
162
185
  }
163
- if (changes.permissions && !permissionsEqual(existing.permissions ?? [], changes.permissions)) {
186
+ if (changes.permissions &&
187
+ associationDelta(existing.permissions ?? [], changes.permissions).length > 0) {
164
188
  ops.push('permissions');
165
189
  }
166
190
  if (changes.associations) {
@@ -176,36 +200,53 @@ export function changeSetOps(existing, changes, merged) {
176
200
  return ops;
177
201
  }
178
202
  /**
179
- * Whether a change set's ops advance `version`/`updatedAt` at all.
180
- * `associate`/`dissociate` don't — a change set touching only
181
- * `associations` is a no-bump write, same as calling associate()/
182
- * dissociate() directly. Every other op does. See
183
- * docs/spec/versioning.md § Version history.
203
+ * The ops whose prior state the journal already carries in full, so a
204
+ * snapshot would preserve nothing a restore could not otherwise reach. A
205
+ * change set naming only these is a no-bump write.
206
+ * See docs/spec/versioning.md § Version history.
207
+ */
208
+ const NO_BUMP_OPS = new Set([
209
+ 'associate',
210
+ 'dissociate',
211
+ 'permissions',
212
+ 'reparent',
213
+ 'unlist',
214
+ 'list',
215
+ ]);
216
+ /**
217
+ * Whether a change set's ops advance `version`/`updatedAt` at all. After the
218
+ * no-bump set above, this is `patch` and the whole-record verbs.
184
219
  */
185
220
  export function bumpsVersion(ops) {
186
- return ops.some((op) => op !== 'associate' && op !== 'dissociate');
221
+ return ops.some((op) => !NO_BUMP_OPS.has(op));
187
222
  }
188
223
  /**
189
- * Whether `ifVersion` applies to a change set. A set whose only key is
190
- * `associations` carries no precondition — it composes regardless of write
191
- * order, the same reason associate()/dissociate() take none. Any other
192
- * aspect named restores the guard over the whole call.
193
- *
194
- * Read off the keys the caller wrote rather than the ops the set turns out
195
- * to move, so a stale caller is told its version is stale whatever its
196
- * patch says — including when the patch restates what the record already
197
- * holds. See docs/spec/versioning.md § Optimistic concurrency.
224
+ * The keys that guard nothing, because none of them moves `version` — a
225
+ * precondition on it would fence a write that the number it names cannot
226
+ * describe. See docs/spec/versioning.md § Optimistic concurrency.
227
+ */
228
+ const NO_PRECONDITION_KEYS = new Set([
229
+ 'associations',
230
+ 'permissions',
231
+ 'parentId',
232
+ 'unlisted',
233
+ ]);
234
+ /**
235
+ * Whether `ifVersion` applies to a change set. A set naming only keys from
236
+ * the no-precondition list above carries none; any other aspect named
237
+ * restores the guard over the whole call. Read off the keys the caller
238
+ * wrote rather than the ops the set turns out to move, so a stale caller is
239
+ * told its version is stale whatever its patch says.
198
240
  */
199
241
  export function takesIfVersion(changes) {
200
- return RECORD_CHANGE_KEYS.some((key) => key !== 'associations' && changes[key] !== undefined);
242
+ return RECORD_CHANGE_KEYS.some((key) => !NO_PRECONDITION_KEYS.has(key) && changes[key] !== undefined);
201
243
  }
202
244
  /**
203
- * The change set narrowed to the aspects that actually moved. An adapter
204
- * is handed this rather than what the caller wrote, so restating an aspect
245
+ * The change set narrowed to the aspects that actually moved. An adapter is
246
+ * handed this rather than what the caller wrote, so restating an aspect
205
247
  * cannot rewrite it: `unlisted: true` on an already-unlisted record would
206
- * otherwise drag `unlistedAt` forward, moving the record's publish moment
207
- * with no op reporting it. It also keeps the adapter contract honest —
208
- * every key an adapter receives is one it must write.
248
+ * otherwise drag `unlistedAt` forward with no op reporting it. Every key an
249
+ * adapter receives is one it must write.
209
250
  */
210
251
  export function effectiveChanges(changes, ops) {
211
252
  const effective = {};
@@ -224,24 +265,16 @@ export function effectiveChanges(changes, ops) {
224
265
  }
225
266
  /**
226
267
  * Whether a merge patch produced the content the record already held.
227
- * Compared by serialization: content is JSON by construction — it round
228
- * trips through storage that way — and a patch preserves key order for
229
- * every field it does not name, so the encoding of an unchanged record is
230
- * stable. A reordering patch that changes nothing else is the one case
231
- * this reports as a change, which costs an empty version rather than a
232
- * wrong answer.
268
+ * Compared by serialization: content is JSON by construction and a patch
269
+ * preserves key order for every field it does not name, so an unchanged
270
+ * record encodes stably. A reordering patch that changes nothing else is
271
+ * the one case this reports as a change, costing an empty version rather
272
+ * than a wrong answer.
233
273
  */
234
274
  export function contentEqual(a, b) {
235
275
  return JSON.stringify(a) === JSON.stringify(b);
236
276
  }
237
- export function permissionsEqual(a, b) {
238
- return a.length === b.length && a.every((p, i) => permissionEqual(p, b[i]));
239
- }
240
- /**
241
- * Ensures `creator` carries an `admin` relationship association, adding one
242
- * if it's not already present. Used to bootstrap a `_group` record's first
243
- * admin at create time.
244
- */
277
+ /** Bootstraps a `_group` record's first admin at create time. */
245
278
  export function stampGroupAdmin(associations, creator) {
246
279
  const list = associations ?? [];
247
280
  const alreadyAdmin = list.some((a) => a.kind === 'relationship' &&
@@ -262,17 +295,6 @@ export function stampGroupAdmin(associations, creator) {
262
295
  export function isGroupRecord(record) {
263
296
  return baseIdOf(record.typeId) === SYSTEM_TYPES.GROUP;
264
297
  }
265
- /**
266
- * Drops a snapshot's `permissions` — owner-only audit data, never served
267
- * to a non-owner history reader. `entityId` (change attribution) stays.
268
- * See docs/spec/versioning.md § History access.
269
- */
270
- export function stripVersionPermissions(version) {
271
- if (version.permissions === undefined)
272
- return version;
273
- const { permissions: _permissions, ...rest } = version;
274
- return rest;
275
- }
276
298
  /**
277
299
  * The tombstone a soft-deleted Record is presented as. `permissions` is
278
300
  * retained because it decides whether the caller may undelete; history is
@@ -294,4 +316,26 @@ export function tombstoneOf(record) {
294
316
  }
295
317
  /** A soft-deleted Record presented as its tombstone; anything else untouched. */
296
318
  export const presentDeleted = (record) => record.deletedAt ? tombstoneOf(record) : record;
319
+ /**
320
+ * Whether a tagged edit moved an authority element, reading whichever half
321
+ * of the pair carries one. The delta is one list across the partition, so
322
+ * every consumer that serves one half alone asks this.
323
+ */
324
+ export function movesAuthority(change) {
325
+ return isAuthorityAssociation(change.op === 'remove' ? change.previous : change.association);
326
+ }
327
+ /**
328
+ * A journal entry as a reader who cannot reshare sees it: the authority
329
+ * half of its delta dropped, the `permissions` op left standing, so the
330
+ * entry still names *that* the ACL moved. Passing the mutate-surface gate
331
+ * buys the record's content history, which is not a route to its sharing
332
+ * graph. See docs/spec/journal.md § Reading it.
333
+ */
334
+ export function withoutAuthorityChanges(entry) {
335
+ if (!entry.associations?.some(movesAuthority))
336
+ return entry;
337
+ const data = entry.associations.filter((c) => !movesAuthority(c));
338
+ const { associations: _authority, ...rest } = entry;
339
+ return data.length ? { ...rest, associations: data } : rest;
340
+ }
297
341
  //# sourceMappingURL=record-changes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record-changes.js","sourceRoot":"","sources":["../src/record-changes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAa9D;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAc,EAAE,CAAc;IAC7D,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IAC3D,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC;IACrF,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QAC3D,OAAO,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAAc,EAAE,CAAc;IACjE,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACvD,OAAO,CAAC,CAAC,CAAC,kBAAkB,IA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