@hydranium/glsp-server 1.0.0-next.8 → 1.0.0-next.85

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 (68) hide show
  1. package/README.md +11 -2
  2. package/lib/command/hydranium-glsp-recording-command.d.ts +21 -21
  3. package/lib/command/hydranium-glsp-recording-command.d.ts.map +1 -1
  4. package/lib/command/hydranium-glsp-recording-command.js +24 -25
  5. package/lib/command/hydranium-glsp-recording-command.js.map +1 -1
  6. package/lib/launcher/hydranium-glsp-server.d.ts +4 -3
  7. package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -1
  8. package/lib/launcher/hydranium-glsp-server.js +4 -3
  9. package/lib/launcher/hydranium-glsp-server.js.map +1 -1
  10. package/lib/messages/index.d.ts +24 -0
  11. package/lib/messages/index.d.ts.map +1 -0
  12. package/lib/messages/index.js +24 -0
  13. package/lib/messages/index.js.map +1 -0
  14. package/lib/state/abstract-hydranium-glsp-state.d.ts +65 -42
  15. package/lib/state/abstract-hydranium-glsp-state.d.ts.map +1 -1
  16. package/lib/state/abstract-hydranium-glsp-state.js +58 -41
  17. package/lib/state/abstract-hydranium-glsp-state.js.map +1 -1
  18. package/lib/state/full-text-hydranium-glsp-state.d.ts +3 -3
  19. package/lib/state/full-text-hydranium-glsp-state.d.ts.map +1 -1
  20. package/lib/state/full-text-hydranium-glsp-state.js +4 -3
  21. package/lib/state/full-text-hydranium-glsp-state.js.map +1 -1
  22. package/lib/state/reconcile-source-model-write.d.ts +7 -6
  23. package/lib/state/reconcile-source-model-write.d.ts.map +1 -1
  24. package/lib/state/reconcile-source-model-write.js +7 -7
  25. package/lib/state/reconcile-source-model-write.js.map +1 -1
  26. package/lib/state/reconciling-multi-document-glsp-state.d.ts +32 -12
  27. package/lib/state/reconciling-multi-document-glsp-state.d.ts.map +1 -1
  28. package/lib/state/reconciling-multi-document-glsp-state.js +44 -17
  29. package/lib/state/reconciling-multi-document-glsp-state.js.map +1 -1
  30. package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts +3 -3
  31. package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts.map +1 -1
  32. package/lib/state/reconciling-transfer-hydranium-glsp-state.js +6 -6
  33. package/lib/state/reconciling-transfer-hydranium-glsp-state.js.map +1 -1
  34. package/lib/storage/hydranium-glsp-storage.d.ts +187 -69
  35. package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
  36. package/lib/storage/hydranium-glsp-storage.js +209 -80
  37. package/lib/storage/hydranium-glsp-storage.js.map +1 -1
  38. package/lib/storage/index.d.ts +1 -1
  39. package/lib/storage/index.js +1 -1
  40. package/lib/storage/save-delivery-policy.d.ts +46 -0
  41. package/lib/storage/save-delivery-policy.d.ts.map +1 -0
  42. package/lib/storage/{save-conflict-policy.js → save-delivery-policy.js} +7 -8
  43. package/lib/storage/save-delivery-policy.js.map +1 -0
  44. package/lib/validation/diagnostic-markers.d.ts +2 -2
  45. package/lib/validation/diagnostic-markers.d.ts.map +1 -1
  46. package/lib/validation/diagnostic-markers.js +7 -0
  47. package/lib/validation/diagnostic-markers.js.map +1 -1
  48. package/lib/validation/hydranium-glsp-model-validator.d.ts.map +1 -1
  49. package/lib/validation/hydranium-glsp-model-validator.js +1 -1
  50. package/lib/validation/hydranium-glsp-model-validator.js.map +1 -1
  51. package/package.json +17 -8
  52. package/src/command/hydranium-glsp-recording-command.ts +25 -25
  53. package/src/launcher/hydranium-glsp-server.ts +4 -3
  54. package/src/messages/index.ts +25 -0
  55. package/src/state/abstract-hydranium-glsp-state.ts +85 -51
  56. package/src/state/full-text-hydranium-glsp-state.ts +5 -4
  57. package/src/state/reconcile-source-model-write.ts +15 -12
  58. package/src/state/reconciling-multi-document-glsp-state.ts +46 -18
  59. package/src/state/reconciling-transfer-hydranium-glsp-state.ts +7 -7
  60. package/src/storage/hydranium-glsp-storage.ts +234 -89
  61. package/src/storage/index.ts +1 -1
  62. package/src/storage/save-delivery-policy.ts +44 -0
  63. package/src/validation/diagnostic-markers.ts +10 -3
  64. package/src/validation/hydranium-glsp-model-validator.ts +3 -3
  65. package/lib/storage/save-conflict-policy.d.ts +0 -56
  66. package/lib/storage/save-conflict-policy.d.ts.map +0 -1
  67. package/lib/storage/save-conflict-policy.js.map +0 -1
  68. package/src/storage/save-conflict-policy.ts +0 -52
@@ -20,6 +20,7 @@ import { DefaultModelState, SOURCE_URI_ARG } from '@eclipse-glsp/server';
20
20
  import { Emitter } from 'vscode-jsonrpc';
21
21
  import { inject, injectable, optional } from 'inversify';
22
22
  import { DocumentState, URI } from '@hydranium/langium';
23
+ import { asSnapshotVersion } from '@hydranium/protocol';
23
24
  import { HydraniumTypes } from './hydranium-shared-core-services.js';
24
25
  import { ModelReadyTimeoutError } from './model-ready-timeout-error.js';
25
26
  /**
@@ -82,8 +83,8 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
82
83
  _sourceUri;
83
84
  _sourceRoot;
84
85
  _tracer;
85
- _version = 0;
86
- /** Based-on versions of the secondary write set, keyed by URI. See {@link trackSecondaryDocument}. */
86
+ _basedOn = asSnapshotVersion(0);
87
+ /** Snapshot versions of the secondary write set, keyed by URI. See {@link trackSecondaryDocument}. */
87
88
  _secondaryVersions = new Map();
88
89
  /** Backing emitter for {@link onSecondaryUrisChanged}; fired only on a membership change. */
89
90
  secondaryUrisChangedEmitter = new Emitter();
@@ -103,7 +104,7 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
103
104
  setSourceRoot(uri, root) {
104
105
  this._sourceUri = uri;
105
106
  this._sourceRoot = root;
106
- this._version = this.readDocumentVersion(uri);
107
+ this._basedOn = this.readSnapshotVersion(uri);
107
108
  // Re-read the secondary write set for the same reason the primary is
108
109
  // re-read: the write that brought us here advanced their versions too, and
109
110
  // a stale based-on version would gate the NEXT command against a
@@ -112,7 +113,7 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
112
113
  this.refreshSecondaryVersions();
113
114
  this.set(SOURCE_URI_ARG, uri);
114
115
  this._tracer = this.baseTracer.withUri(uri);
115
- this.tracer.debug(`Captured source root at doc.version=v${this._version}`);
116
+ this.tracer.debug(`Captured source root at doc.version=v${this._basedOn}`);
116
117
  this.checkDeclaredLanguage(uri);
117
118
  this.index.indexSourceRoot(root, uri);
118
119
  }
@@ -218,32 +219,40 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
218
219
  return this._tracer ?? this.baseTracer;
219
220
  }
220
221
  /**
221
- * Text-document version captured at the last {@link setSourceRoot}
222
- * call. Mirrors the server-side `TextDocuments.version(uri)` counter
223
- * at that point in time — frozen until the next `setSourceRoot`, then
224
- * re-read from `LangiumDocuments`.
222
+ * Snapshot version taken at the last {@link setSourceRoot} call — frozen
223
+ * until the next one, then re-read from the document store.
225
224
  *
226
225
  * Threaded by `HydraniumGlspRecordingCommand` into
227
- * {@link updateSourceModel}'s optional `version` parameter so the
228
- * downstream `ModelService.update` / `.save` call can opt into the
229
- * conflict gate against the captured based-on version. See
226
+ * {@link updateSourceModel} so the downstream `ModelService.update` /
227
+ * `.save` call gates against what the command was authored on. See
230
228
  * `@hydranium/protocol#ConflictError` for the detection contract.
231
229
  *
230
+ * **This, not a number read at write time, is what a write must be gated
231
+ * on.** A version read when the write is issued is the store's current one,
232
+ * so it matches by construction and the gate can never fire.
233
+ */
234
+ get basedOn() {
235
+ return this._basedOn;
236
+ }
237
+ /**
238
+ * Text-document version of {@link basedOn}. Mirrors the server-side
239
+ * `TextDocuments.version(uri)` counter as of the snapshot.
240
+ *
232
241
  * Falls back to `0` when the document is absent from `LangiumDocuments`
233
- * at capture time — the same observable state callers see for a doc
234
- * that was never opened. Callers that need to distinguish
242
+ * when the snapshot is taken — the same observable state callers see for a
243
+ * doc that was never opened. Callers that need to distinguish
235
244
  * "never-versioned" from "v0" must consult the document registry
236
245
  * directly.
237
246
  */
238
247
  get version() {
239
- return this._version;
248
+ return this._basedOn;
240
249
  }
241
250
  // ============================================================
242
251
  // Secondary documents — the write set beyond the primary
243
252
  // ============================================================
244
253
  /**
245
- * Register `uri` as a document this state also writes, capturing its current
246
- * text-document version.
254
+ * Register `uri` as a document this state also writes, snapshotting its
255
+ * current text-document version.
247
256
  *
248
257
  * A diagram whose layout lives in its own file, or whose canvas creates
249
258
  * elements in a referenced semantic document, writes more than the document
@@ -256,7 +265,7 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
256
265
  * identified once the operation names the node. What the framework supplies
257
266
  * is the part an adopter cannot reconstruct after the fact — the version each
258
267
  * document was at BEFORE the command mutated anything (see
259
- * {@link capturedVersionOf}). Idempotent; registering the primary is ignored,
268
+ * {@link snapshotVersionOf}). Idempotent; registering the primary is ignored,
260
269
  * since {@link version} already tracks it. Registering a URI not already in
261
270
  * the set fires {@link onSecondaryUrisChanged}.
262
271
  */
@@ -265,7 +274,7 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
265
274
  return;
266
275
  }
267
276
  const added = !this._secondaryVersions.has(uri);
268
- this._secondaryVersions.set(uri, this.readDocumentVersion(uri));
277
+ this._secondaryVersions.set(uri, this.readSnapshotVersion(uri));
269
278
  if (added) {
270
279
  this.secondaryUrisChangedEmitter.fire();
271
280
  }
@@ -283,14 +292,15 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
283
292
  }
284
293
  /**
285
294
  * Fires whenever the secondary write set gains or loses a URI — never when a
286
- * tracked document's captured version is merely refreshed, which happens on
295
+ * tracked document's snapshot version is merely refreshed, which happens on
287
296
  * every {@link setSourceRoot} and changes nothing a subscriber cares about.
288
297
  *
289
298
  * **This exists so no caller has to know when the set can change.** The set is
290
299
  * usually discovered rather than known, and the discovery point is an
291
- * operation handler naming a node — not a capture. A subscriber that instead
292
- * re-derived the set after each capture would miss exactly that case, and miss
293
- * it silently: the document would simply never be watched, with nothing logged.
300
+ * operation handler naming a node — not a read of the source root. A
301
+ * subscriber that instead re-derived the set after each such read would miss
302
+ * exactly that case, and miss it silently: the document would simply never be
303
+ * watched, with nothing logged.
294
304
  * Announcing the change here moves the obligation to the one place that can
295
305
  * always discharge it.
296
306
  *
@@ -307,35 +317,42 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
307
317
  return [...this._secondaryVersions.keys()];
308
318
  }
309
319
  /**
310
- * Based-on version captured for `uri` — {@link version} for the primary, the
311
- * value captured at {@link trackSecondaryDocument} (refreshed by
312
- * {@link setSourceRoot}) for a secondary, `undefined` for anything untracked.
320
+ * Snapshot version for `uri` — {@link basedOn} for the primary, the version
321
+ * taken at {@link trackSecondaryDocument} (refreshed by {@link setSourceRoot})
322
+ * for a secondary, `undefined` for anything untracked.
313
323
  *
314
- * `undefined` rather than `0` for an untracked URI deliberately: `0` is a real
324
+ * `undefined` rather than v0 for an untracked URI deliberately: `0` is a real
315
325
  * version meaning "present but never edited", so collapsing the two would let
316
- * a caller gate a write against a document it never captured.
326
+ * a caller gate a write against a document this state never read.
317
327
  */
318
- capturedVersionOf(uri) {
328
+ snapshotVersionOf(uri) {
319
329
  if (uri === this._sourceUri) {
320
- return this._version;
330
+ return this._basedOn;
321
331
  }
322
332
  return this._secondaryVersions.get(uri);
323
333
  }
324
334
  /**
325
- * Read a document's current text-document version through the model service's
326
- * canonicalizing gateway, so a URI spelled through a symlink still resolves to
327
- * the document keyed by its real path rather than stranding at `0` (which
328
- * would silently weaken the conflict gate). Optional-chained on `textDocument`
329
- * so a fixture that omits it does not throw; real Langium documents always
330
- * populate it.
335
+ * Read a document's version out of the live store and mark it as a snapshot,
336
+ * through the model service's canonicalizing gateway so a URI spelled through
337
+ * a symlink still resolves to the document keyed by its real path rather than
338
+ * stranding at `0` (which would silently weaken the conflict gate).
339
+ *
340
+ * **Call this only at the point the source root is read.** It is the one
341
+ * place the framework turns a live version into a snapshot one, and the value
342
+ * is true only because that is where it is called. Called at write time it
343
+ * answers with the version the write is about to be compared against, so the
344
+ * gate passes unconditionally.
345
+ *
346
+ * Falls back to v0 for a URI the store does not know, matching what
347
+ * {@link version} reports for a document that was never opened.
331
348
  */
332
- readDocumentVersion(uri) {
333
- return this.sharedServices.model.ModelService.getDocument(uri)?.textDocument?.version ?? 0;
349
+ readSnapshotVersion(uri) {
350
+ return this.sharedServices.model.ModelService.snapshot(uri)?.version ?? asSnapshotVersion(0);
334
351
  }
335
- /** Re-read every registered secondary's version from the document store. */
352
+ /** Re-take every registered secondary's snapshot version from the document store. */
336
353
  refreshSecondaryVersions() {
337
354
  for (const uri of [...this._secondaryVersions.keys()]) {
338
- this._secondaryVersions.set(uri, this.readDocumentVersion(uri));
355
+ this._secondaryVersions.set(uri, this.readSnapshotVersion(uri));
339
356
  }
340
357
  }
341
358
  /**
@@ -382,8 +399,8 @@ let AbstractHydraniumGlspState = class AbstractHydraniumGlspState extends Defaul
382
399
  const timeout = new Promise((resolve, reject) => {
383
400
  timer = this.sharedServices.Clock.setTimer(() => {
384
401
  const elapsed = Math.round(stopwatch.elapsedMs);
385
- // Via the canonicalizing gateway (see `readDocumentVersion`), so a
386
- // symlinked `_sourceUri` is not reported as a hard timeout.
402
+ // Through the model service's canonicalizing gateway, so a symlinked
403
+ // `_sourceUri` is not reported as a hard timeout.
387
404
  const doc = this.sharedServices.model.ModelService.getDocument(uri);
388
405
  if (doc && doc.state >= state) {
389
406
  this.logger.warn(`Missed '${DocumentState[state]}' notification after ${elapsed}ms; document is already at state ` +
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-hydranium-glsp-state.js","sourceRoot":"","sources":["../../src/state/abstract-hydranium-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;;AAElF,OAAO,EAAE,iBAAiB,EAAqB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAc,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAgB,aAA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OAOG;IACO,sBAAsB,CAAC,KAAoB,EAAE,OAAe;QACnE,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;QAChD,MAAM,SAAS,GAAG,SAAS,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QACvF,OAAO,IAAI,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvF,CAAC;;AAja6D;IAA7D,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC;;kEAA0D;AAWlD;IAAjD,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;;oEAA8C;AAQpC;IAAjD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC;;8DAAwC;AA8ET;IAA5D,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;IAAE,QAAQ,EAAE;;mEAAmD;AAlGnF,0BAA0B;IAD/C,UAAU,EAAE;GACS,0BAA0B,CAgd/C"}
@@ -8,7 +8,7 @@
8
8
  ********************************************************************************/
9
9
  import { type JsonModelState } from '@eclipse-glsp/server';
10
10
  import { type AstNode } from '@hydranium/langium';
11
- import { type MaybePromise } from '@hydranium/protocol';
11
+ import { type BasedOn, type MaybePromise } from '@hydranium/protocol';
12
12
  import { AbstractHydraniumGlspState } from './abstract-hydranium-glsp-state.js';
13
13
  /** Whole-document-text source model: the serialised text of the source root. */
14
14
  export interface FullTextSourceModel {
@@ -29,7 +29,7 @@ export interface FullTextSourceModel {
29
29
  * because serialization may be async; the sync fast path is preserved.
30
30
  * - {@link updateSourceModel} pushes the text back through
31
31
  * `ModelService.update` (which accepts a raw text payload) and captures the
32
- * re-parsed root.
32
+ * re-parsed root, gated on the caller's `basedOn`.
33
33
  *
34
34
  * No `baseline` / conflict reconcile: a whole-document model has exactly one
35
35
  * field, so every concurrent edit is a same-field collision and undo / redo
@@ -38,6 +38,6 @@ export interface FullTextSourceModel {
38
38
  */
39
39
  export declare class FullTextHydraniumGlspState<TRoot extends AstNode> extends AbstractHydraniumGlspState<TRoot, FullTextSourceModel> implements JsonModelState<FullTextSourceModel> {
40
40
  get sourceModel(): MaybePromise<FullTextSourceModel>;
41
- updateSourceModel(model: FullTextSourceModel): Promise<void>;
41
+ updateSourceModel(model: FullTextSourceModel, basedOn?: BasedOn): Promise<void>;
42
42
  }
43
43
  //# sourceMappingURL=full-text-hydranium-glsp-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"full-text-hydranium-glsp-state.d.ts","sourceRoot":"","sources":["../../src/state/full-text-hydranium-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IACjC,IAAI,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBACa,0BAA0B,CAAC,KAAK,SAAS,OAAO,CAC1D,SAAQ,0BAA0B,CAAC,KAAK,EAAE,mBAAmB,CAC7D,YAAW,cAAc,CAAC,mBAAmB,CAAC;IAE9C,IAAI,WAAW,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAInD;IAEK,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAQpE"}
1
+ {"version":3,"file":"full-text-hydranium-glsp-state.d.ts","sourceRoot":"","sources":["../../src/state/full-text-hydranium-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IACjC,IAAI,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBACa,0BAA0B,CAAC,KAAK,SAAS,OAAO,CAC1D,SAAQ,0BAA0B,CAAC,KAAK,EAAE,mBAAmB,CAC7D,YAAW,cAAc,CAAC,mBAAmB,CAAC;IAE9C,IAAI,WAAW,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAInD;IAEK,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,GAAE,OAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CASrG"}
@@ -31,7 +31,7 @@ import { AbstractHydraniumGlspState } from './abstract-hydranium-glsp-state.js';
31
31
  * because serialization may be async; the sync fast path is preserved.
32
32
  * - {@link updateSourceModel} pushes the text back through
33
33
  * `ModelService.update` (which accepts a raw text payload) and captures the
34
- * re-parsed root.
34
+ * re-parsed root, gated on the caller's `basedOn`.
35
35
  *
36
36
  * No `baseline` / conflict reconcile: a whole-document model has exactly one
37
37
  * field, so every concurrent edit is a same-field collision and undo / redo
@@ -44,11 +44,12 @@ let FullTextHydraniumGlspState = class FullTextHydraniumGlspState extends Abstra
44
44
  const text = serializer.serializeAst(this._sourceRoot);
45
45
  return isPromiseLike(text) ? text.then(value => ({ text: value })) : { text };
46
46
  }
47
- async updateSourceModel(model) {
47
+ async updateSourceModel(model, basedOn = this.basedOn) {
48
48
  const document = await this.sharedServices.model.ModelService.update({
49
49
  uri: this._sourceUri,
50
50
  model: model.text,
51
- clientId: this.clientId
51
+ clientId: this.clientId,
52
+ basedOn
52
53
  });
53
54
  this.setSourceRoot(this._sourceUri, document.root);
54
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"full-text-hydranium-glsp-state.js","sourceRoot":"","sources":["../../src/state/full-text-hydranium-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAqB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAOhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BACV,SAAQ,0BAAsD;IAG9D,IAAI,WAAW;QACZ,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QACrH,MAAM,IAAI,GAAG,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvD,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAA0B;QAC/C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;YAClE,GAAG,EAAE,IAAI,CAAC,UAAU;YACpB,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,QA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AC,YAAY,CAAC,MAAM,CAAC;YAClE,GAAG,EAAE,IAAI,CAAC,UAAU;YACpB,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO;SACT,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAa,CAAC,CAAC;IAC/D,CAAC;CACH,CAAA;AAnBY,0BAA0B;IADtC,UAAU,EAAE;GACA,0BAA0B,CAmBtC"}
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { type ConflictResolver, type Logger } from '@hydranium/protocol';
9
+ import { type BasedOn, type ConflictResolver, type Logger } from '@hydranium/protocol';
10
10
  /**
11
11
  * The I/O and policy a {@link reconcileSourceModelWrite} call needs. Deliberately
12
12
  * a plain record rather than a base class: the states that use it differ in what
@@ -16,11 +16,12 @@ import { type ConflictResolver, type Logger } from '@hydranium/protocol';
16
16
  */
17
17
  export interface SourceModelWriteHooks<TModel> {
18
18
  /**
19
- * Write `model` and capture the resulting state. Called with a `baseVersion`
20
- * on the first attempt (opting into the `ConflictError` gate) and without one
21
- * on the merged / forced retries, where the point is to land the write.
19
+ * Write `model` and record the resulting state. Called with the caller's own
20
+ * `basedOn` on the first attempt (opting into the `ConflictError` gate) and
21
+ * with `'anything'` on the merged / forced retries, where the reconcile has
22
+ * already decided to win and the point is to land the write.
22
23
  */
23
- persist(model: TModel, baseVersion?: number): Promise<void>;
24
+ persist(model: TModel, basedOn: BasedOn): Promise<void>;
24
25
  /** Current server-side projection, or `undefined` when unavailable. */
25
26
  refetch(): Promise<TModel | undefined>;
26
27
  /** Last in-sync projection the user's intent is measured against. */
@@ -39,5 +40,5 @@ export interface SourceModelWriteHooks<TModel> {
39
40
  * re-thrown untouched — this function only knows how to handle the specific
40
41
  * failure of "the based-on version was superseded".
41
42
  */
42
- export declare function reconcileSourceModelWrite<TModel extends object>(model: TModel, version: number | undefined, hooks: SourceModelWriteHooks<TModel>): Promise<void>;
43
+ export declare function reconcileSourceModelWrite<TModel extends object>(model: TModel, basedOn: BasedOn, hooks: SourceModelWriteHooks<TModel>): Promise<void>;
43
44
  //# sourceMappingURL=reconcile-source-model-write.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-source-model-write.d.ts","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM;IAC1C;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,uEAAuE;IACvE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,iBAAiB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAClE,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
1
+ {"version":3,"file":"reconcile-source-model-write.d.ts","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAExG;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM;IAC1C;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,uEAAuE;IACvE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,iBAAiB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAClE,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
@@ -16,9 +16,9 @@ import { isConflictError } from '@hydranium/protocol';
16
16
  * re-thrown untouched — this function only knows how to handle the specific
17
17
  * failure of "the based-on version was superseded".
18
18
  */
19
- export async function reconcileSourceModelWrite(model, version, hooks) {
19
+ export async function reconcileSourceModelWrite(model, basedOn, hooks) {
20
20
  try {
21
- await hooks.persist(model, version);
21
+ await hooks.persist(model, basedOn);
22
22
  }
23
23
  catch (err) {
24
24
  if (!isConflictError(err)) {
@@ -27,19 +27,19 @@ export async function reconcileSourceModelWrite(model, version, hooks) {
27
27
  const outcome = await hooks.conflictResolver.resolve(hooks.baseline ?? model, model, () => hooks.refetch());
28
28
  switch (outcome.status) {
29
29
  case 'merged':
30
- await hooks.persist(outcome.merged);
30
+ await hooks.persist(outcome.merged, 'anything');
31
31
  return;
32
32
  case 'no-op':
33
- hooks.logger.debug(`updateSourceModel no-op (v${err.expected} → v${err.actual}); already in sync`);
33
+ hooks.logger.debug(`updateSourceModel no-op (v${err.expectedVersion} → v${err.actualVersion}); already in sync`);
34
34
  return;
35
35
  case 'conflict':
36
- hooks.logger.warn(`updateSourceModel conflict (v${err.expected} → v${err.actual}); dropping the diagram edit — ` +
36
+ hooks.logger.warn(`updateSourceModel conflict (v${err.expectedVersion} → v${err.actualVersion}); dropping the diagram edit — ` +
37
37
  'a foreign writer changed the same field');
38
38
  hooks.onConflictDropped();
39
39
  return;
40
40
  case 'unavailable':
41
- hooks.logger.warn(`updateSourceModel refetch unavailable (v${err.expected} → v${err.actual}); forcing without version`);
42
- await hooks.persist(model);
41
+ hooks.logger.warn(`updateSourceModel refetch unavailable (v${err.expectedVersion} → v${err.actualVersion}); forcing without version`);
42
+ await hooks.persist(model, 'anything');
43
43
  return;
44
44
  }
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-source-model-write.js","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAsC,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA0B1F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC5C,KAAa,EACb,OAA2B,EAC3B,KAAoC;IAEpC,IAAI,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACZ,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC;QACb,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5G,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,QAAQ;gBACV,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO;YACV,KAAK,OAAO;gBACT,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,QAAQ,OAAO,GAAG,CAAC,MAAM,oBAAoB,CAAC,CAAC;gBACnG,OAAO;YACV,KAAK,UAAU;gBACZ,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,gCAAgC,GAAG,CAAC,QAAQ,OAAO,GAAG,CAAC,MAAM,iCAAiC;oBAC3F,yCAAyC,CAC9C,CAAC;gBACF,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBAC1B,OAAO;YACV,KAAK,aAAa;gBACf,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,GAAG,CAAC,QAAQ,OAAO,GAAG,CAAC,MAAM,4BAA4B,CAAC,CAAC;gBACxH,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO;QACb,CAAC;IACJ,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"reconcile-source-model-write.js","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAoD,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA2BxG;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC5C,KAAa,EACb,OAAgB,EAChB,KAAoC;IAEpC,IAAI,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACZ,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC;QACb,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5G,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,QAAQ;gBACV,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;gBAChD,OAAO;YACV,KAAK,OAAO;gBACT,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,oBAAoB,CAAC,CAAC;gBACjH,OAAO;YACV,KAAK,UAAU;gBACZ,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,gCAAgC,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,iCAAiC;oBACzG,yCAAyC,CAC9C,CAAC;gBACF,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBAC1B,OAAO;YACV,KAAK,aAAa;gBACf,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,2CAA2C,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,4BAA4B,CACpH,CAAC;gBACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;gBACvC,OAAO;QACb,CAAC;IACJ,CAAC;AACJ,CAAC"}
@@ -8,7 +8,7 @@
8
8
  ********************************************************************************/
9
9
  import { type JsonModelState } from '@eclipse-glsp/server';
10
10
  import { type AstNode } from '@hydranium/langium';
11
- import { type TransferElement } from '@hydranium/protocol';
11
+ import { type BasedOn, type TransferElement } from '@hydranium/protocol';
12
12
  import { AbstractHydraniumGlspState } from './abstract-hydranium-glsp-state.js';
13
13
  /**
14
14
  * Source model spanning more than one document: the primary document's
@@ -65,9 +65,10 @@ export interface MultiDocumentSourceModel<TPrimary extends TransferElement = Tra
65
65
  * a based-on version, so a concurrent foreign edit to one is overwritten rather
66
66
  * than reconciled. Gating them too would need a per-document reconcile whose
67
67
  * outcomes can disagree (merge one, conflict another) with no way to un-write the
68
- * merged one — the atomicity problem again, one layer up. The captured versions
69
- * ARE available via {@link AbstractHydraniumGlspState.capturedVersionOf}, so an
70
- * adopter that wants a coarser check can compare before writing.
68
+ * merged one — the atomicity problem again, one layer up. An adopter that wants
69
+ * a coarser check overrides {@link secondaryBasedOn} to return the version
70
+ * {@link AbstractHydraniumGlspState.snapshotVersionOf} already holds, and takes
71
+ * on the partial-write window named there.
71
72
  */
72
73
  export declare class ReconcilingMultiDocumentGlspState<TRoot extends AstNode, TPrimary extends TransferElement = TransferElement> extends AbstractHydraniumGlspState<TRoot, MultiDocumentSourceModel<TPrimary>> implements JsonModelState<MultiDocumentSourceModel<TPrimary>> {
73
74
  /**
@@ -111,14 +112,14 @@ export declare class ReconcilingMultiDocumentGlspState<TRoot extends AstNode, TP
111
112
  * `ConflictError` from the primary, reconcile via the injected policy exactly
112
113
  * as the single-document state does — the orchestration is shared.
113
114
  */
114
- updateSourceModel(model: MultiDocumentSourceModel<TPrimary>, version?: number): Promise<void>;
115
+ updateSourceModel(model: MultiDocumentSourceModel<TPrimary>, basedOn?: BasedOn): Promise<void>;
115
116
  /**
116
117
  * Write hook — secondaries first (ungated), primary last (gated on
117
- * `baseVersion`). The order is the failure-mode choice documented on the
118
+ * `basedOn`). The order is the failure-mode choice documented on the
118
119
  * class, not incidental: override this when the primary is the document the
119
120
  * others REFERENCE, since then this order writes the references first.
120
121
  */
121
- protected persist(model: MultiDocumentSourceModel<TPrimary>, baseVersion?: number): Promise<{
122
+ protected persist(model: MultiDocumentSourceModel<TPrimary>, basedOn: BasedOn): Promise<{
122
123
  root: TRoot;
123
124
  }>;
124
125
  /**
@@ -138,16 +139,35 @@ export declare class ReconcilingMultiDocumentGlspState<TRoot extends AstNode, TP
138
139
  * it is also cheap enough to run per document per write.
139
140
  */
140
141
  protected hasChanged(baseline: object | undefined, candidate: object): boolean;
141
- /** Write the primary document, opting into the conflict gate when `baseVersion` is given. */
142
- protected persistPrimary(model: TPrimary, baseVersion?: number): Promise<{
142
+ /** Write the primary document, opting into the conflict gate unless `basedOn` is `'anything'`. */
143
+ protected persistPrimary(model: TPrimary, basedOn: BasedOn): Promise<{
143
144
  root: TRoot;
144
145
  }>;
145
146
  /**
146
- * Write one secondary document. Ungated by design (see the class doc); override
147
- * alongside {@link persistPrimary} when the round-trip differs per document
148
- * role — a layout file and a semantic file need not share a serializer.
147
+ * Write one secondary document, gated on whatever {@link secondaryBasedOn}
148
+ * returns. Override alongside {@link persistPrimary} when the round-trip
149
+ * differs per document role — a layout file and a semantic file need not
150
+ * share a serializer.
149
151
  */
150
152
  protected persistSecondary(uri: string, model: TransferElement): Promise<void>;
153
+ /**
154
+ * What a secondary write declares it was based on. Default `'anything'` —
155
+ * ungated, because gating the whole set needs a per-document reconcile whose
156
+ * outcomes can disagree, with no way to un-write an already-merged sibling.
157
+ *
158
+ * **The hook exists so that opting in is an override rather than a
159
+ * reimplementation.** The state already holds what such a check needs
160
+ * ({@link AbstractHydraniumGlspState.snapshotVersionOf}), and returning that
161
+ * value here is the whole opt-in; without it the only place to put the
162
+ * comparison is a copy of {@link persistSecondary}, which then has to be kept
163
+ * in step with the framework's write call.
164
+ *
165
+ * **Opting in buys a conflict report and costs atomicity.** A gated secondary
166
+ * throws mid-set, after earlier secondaries have already been written, and if
167
+ * the reconcile then drops the edit those writes stay. Weigh that against the
168
+ * default, which lets a foreign edit to a secondary be overwritten silently.
169
+ */
170
+ protected secondaryBasedOn(_uri: string): BasedOn;
151
171
  /**
152
172
  * Refetch hook — the current settled projection across the write set, used by
153
173
  * the conflict resolver to replay the user's intent against fresh state.
@@ -1 +1 @@
1
- {"version":3,"file":"reconciling-multi-document-glsp-state.d.ts","sourceRoot":"","sources":["../../src/state/reconciling-multi-document-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAA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G,OAAO,CAAC;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;IAclH;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAI9E,6FAA6F;cAC7E,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;IAU/F;;;;OAIG;cACa,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpF;;;;;;OAMG;cACa,OAAO,IAAI,OAAO,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IAelF,wFAAwF;IACxF,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAKnE,oFAAoF;IACpF,SAAS,CAAC,WAAW,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC;CAGtF"}
1
+ {"version":3,"file":"reconciling-multi-document-glsp-state.d.ts","sourceRoot":"","sources":["../../src/state/reconciling-multi-document-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF;;;;;;;;;GASG;AACH,MAAM,WAAW,wBAAwB,CAAC,QAAQ,SAAS,eAAe,GAAG,eAAe;IACzF,gFAAgF;IAChF,OAAO,EAAE,QAAQ,CAAC;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;IAU3F;;;;;OAKG;cACa,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IASpF;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjD;;;;;;OAMG;cACa,OAAO,IAAI,OAAO,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IAelF,wFAAwF;IACxF,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAKnE,oFAAoF;IACpF,SAAS,CAAC,WAAW,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC;CAGtF"}
@@ -54,9 +54,10 @@ import { reconcileSourceModelWrite } from './reconcile-source-model-write.js';
54
54
  * a based-on version, so a concurrent foreign edit to one is overwritten rather
55
55
  * than reconciled. Gating them too would need a per-document reconcile whose
56
56
  * outcomes can disagree (merge one, conflict another) with no way to un-write the
57
- * merged one — the atomicity problem again, one layer up. The captured versions
58
- * ARE available via {@link AbstractHydraniumGlspState.capturedVersionOf}, so an
59
- * adopter that wants a coarser check can compare before writing.
57
+ * merged one — the atomicity problem again, one layer up. An adopter that wants
58
+ * a coarser check overrides {@link secondaryBasedOn} to return the version
59
+ * {@link AbstractHydraniumGlspState.snapshotVersionOf} already holds, and takes
60
+ * on the partial-write window named there.
60
61
  */
61
62
  let ReconcilingMultiDocumentGlspState = class ReconcilingMultiDocumentGlspState extends AbstractHydraniumGlspState {
62
63
  /**
@@ -115,10 +116,10 @@ let ReconcilingMultiDocumentGlspState = class ReconcilingMultiDocumentGlspState
115
116
  * `ConflictError` from the primary, reconcile via the injected policy exactly
116
117
  * as the single-document state does — the orchestration is shared.
117
118
  */
118
- async updateSourceModel(model, version) {
119
- return reconcileSourceModelWrite(model, version, {
120
- persist: async (candidate, baseVersion) => {
121
- const { root } = await this.persist(candidate, baseVersion);
119
+ async updateSourceModel(model, basedOn = this.basedOn) {
120
+ return reconcileSourceModelWrite(model, basedOn, {
121
+ persist: async (candidate, candidateBasedOn) => {
122
+ const { root } = await this.persist(candidate, candidateBasedOn);
122
123
  this.setSourceRoot(this._sourceUri, root);
123
124
  },
124
125
  refetch: () => this.refetch(),
@@ -130,11 +131,11 @@ let ReconcilingMultiDocumentGlspState = class ReconcilingMultiDocumentGlspState
130
131
  }
131
132
  /**
132
133
  * Write hook — secondaries first (ungated), primary last (gated on
133
- * `baseVersion`). The order is the failure-mode choice documented on the
134
+ * `basedOn`). The order is the failure-mode choice documented on the
134
135
  * class, not incidental: override this when the primary is the document the
135
136
  * others REFERENCE, since then this order writes the references first.
136
137
  */
137
- async persist(model, baseVersion) {
138
+ async persist(model, basedOn) {
138
139
  for (const [uri, secondary] of Object.entries(model.secondaries)) {
139
140
  if (this.hasChanged(this.baseline?.secondaries[uri], secondary)) {
140
141
  await this.persistSecondary(uri, secondary);
@@ -145,7 +146,7 @@ let ReconcilingMultiDocumentGlspState = class ReconcilingMultiDocumentGlspState
145
146
  // captured rather than round-tripping the document for no reason.
146
147
  return { root: this._sourceRoot };
147
148
  }
148
- return this.persistPrimary(model.primary, baseVersion);
149
+ return this.persistPrimary(model.primary, basedOn);
149
150
  }
150
151
  /**
151
152
  * Whether `candidate` differs from the baseline projection of the same
@@ -166,23 +167,49 @@ let ReconcilingMultiDocumentGlspState = class ReconcilingMultiDocumentGlspState
166
167
  hasChanged(baseline, candidate) {
167
168
  return baseline === undefined || JSON.stringify(baseline) !== JSON.stringify(candidate);
168
169
  }
169
- /** Write the primary document, opting into the conflict gate when `baseVersion` is given. */
170
- async persistPrimary(model, baseVersion) {
170
+ /** Write the primary document, opting into the conflict gate unless `basedOn` is `'anything'`. */
171
+ async persistPrimary(model, basedOn) {
171
172
  const document = await this.sharedServices.model.ModelService.update({
172
173
  uri: this._sourceUri,
173
174
  model,
174
175
  clientId: this.clientId,
175
- baseVersion
176
+ basedOn
176
177
  });
177
178
  return document;
178
179
  }
179
180
  /**
180
- * Write one secondary document. Ungated by design (see the class doc); override
181
- * alongside {@link persistPrimary} when the round-trip differs per document
182
- * role — a layout file and a semantic file need not share a serializer.
181
+ * Write one secondary document, gated on whatever {@link secondaryBasedOn}
182
+ * returns. Override alongside {@link persistPrimary} when the round-trip
183
+ * differs per document role — a layout file and a semantic file need not
184
+ * share a serializer.
183
185
  */
184
186
  async persistSecondary(uri, model) {
185
- await this.sharedServices.model.ModelService.update({ uri, model, clientId: this.clientId });
187
+ await this.sharedServices.model.ModelService.update({
188
+ uri,
189
+ model,
190
+ clientId: this.clientId,
191
+ basedOn: this.secondaryBasedOn(uri)
192
+ });
193
+ }
194
+ /**
195
+ * What a secondary write declares it was based on. Default `'anything'` —
196
+ * ungated, because gating the whole set needs a per-document reconcile whose
197
+ * outcomes can disagree, with no way to un-write an already-merged sibling.
198
+ *
199
+ * **The hook exists so that opting in is an override rather than a
200
+ * reimplementation.** The state already holds what such a check needs
201
+ * ({@link AbstractHydraniumGlspState.snapshotVersionOf}), and returning that
202
+ * value here is the whole opt-in; without it the only place to put the
203
+ * comparison is a copy of {@link persistSecondary}, which then has to be kept
204
+ * in step with the framework's write call.
205
+ *
206
+ * **Opting in buys a conflict report and costs atomicity.** A gated secondary
207
+ * throws mid-set, after earlier secondaries have already been written, and if
208
+ * the reconcile then drops the edit those writes stay. Weigh that against the
209
+ * default, which lets a foreign edit to a secondary be overwritten silently.
210
+ */
211
+ secondaryBasedOn(_uri) {
212
+ return 'anything';
186
213
  }
187
214
  /**
188
215
  * Refetch hook — the current settled projection across the write set, used by
@@ -1 +1 @@
1
- {"version":3,"file":"reconciling-multi-document-glsp-state.js","sourceRoot":"","sources":["../../src/state/reconciling-multi-document-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EA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ACJ,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAA0B,CAAa,EAAE,WAAW,EAAE,CAAC;IACnG,CAAC;IAED,wFAAwF;IAC9E,eAAe,CAAC,GAAW;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC;QACzF,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACpD,CAAC;IAED,oFAAoF;IAC1E,WAAW,CAA8C,IAAa;QAC7E,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAiB,CAAC;IAChG,CAAC;CACH,CAAA;AA1KY,iCAAiC;IAD7C,UAAU,EAAE;GACA,iCAAiC,CA0K7C"}
1
+ {"version":3,"file":"reconciling-multi-document-glsp-state.js","sourceRoot":"","sources":["../../src/state/reconciling-multi-document-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAmB9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEI,IAAM,iCAAiC,GAAvC,MAAM,iCACV,SAAQ,0BAAqE;IAG7E;;;;OAIG;IACO,QAAQ,CAAsC;IAExD;;;;;;;;;;OAUG;IACH,IAAI,WAAW;QACZ,MAAM,WAAW,GAAoC,EAAE,CAAC;QACxD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACpC,MAAM,UAAU,GAAG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