amalgm 0.1.199 → 0.1.200

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amalgm",
3
- "version": "0.1.199",
3
+ "version": "0.1.200",
4
4
  "description": "Amalgm local computer runtime: login, MCP, chat, events, previews, and tunnels.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -353,6 +353,7 @@ test('peer records and earlier local history survive later publishes', async ()
353
353
  wall: 'code-project@3',
354
354
  project: repoKey,
355
355
  machine: 'machine-b',
356
+ mutationId: 'mut_project_peer',
356
357
  publishedAt: '2026-07-19T00:00:00.000Z',
357
358
  cards: [{ card: 'repo-card@2', machine: 'machine-b', replica: 'rpl_peer', path: '/work/app', head: { branch: 'preview' } }],
358
359
  });
@@ -407,6 +408,7 @@ test('wall compaction deletes only records superseded for every machine', () =>
407
408
  wall: 'code-project@3',
408
409
  project: repoKey,
409
410
  machine,
411
+ mutationId: `mut_project_${machine}_${value}`,
410
412
  cards: [{ value }],
411
413
  });
412
414
  const oldA = line('machine-a', 'old-a');
@@ -422,12 +424,36 @@ test('wall compaction deletes only records superseded for every machine', () =>
422
424
  assert.equal(compacted.includes(oldB), false);
423
425
  });
424
426
 
427
+ test('an unordered legacy record cannot pin wall compaction', () => {
428
+ const unordered = JSON.stringify({
429
+ wall: 'code-project@3',
430
+ project: repoKey,
431
+ machine: '16.612Z',
432
+ cards: [{ value: 'corrupted-legacy-record' }],
433
+ });
434
+ const ordered = (machine) => JSON.stringify({
435
+ wall: 'code-project@3',
436
+ project: repoKey,
437
+ machine,
438
+ mutationId: `mut_project_${machine}`,
439
+ cards: [{ value: machine }],
440
+ });
441
+ const latestA = ordered('machine-a');
442
+ const latestB = ordered('machine-b');
443
+
444
+ assert.equal(
445
+ compactWallText(`${unordered}\n${latestA}\n${latestB}\n`, repoKey),
446
+ `${latestA}\n${latestB}\n`,
447
+ );
448
+ });
449
+
425
450
  test('a concurrent deletion-only compaction and append commute in Yjs', () => {
426
451
  const Y = require('yjs');
427
452
  const line = (machine, value) => JSON.stringify({
428
453
  wall: 'code-project@3',
429
454
  project: repoKey,
430
455
  machine,
456
+ mutationId: `mut_project_${machine}_${value}`,
431
457
  cards: [{ value }],
432
458
  });
433
459
  const oldA = line('machine-a', 'old-a');
@@ -135,6 +135,7 @@ function parseWallLine(line) {
135
135
  entry?.wall !== WALL_CONTRACT
136
136
  || !entry.project
137
137
  || !entry.machine
138
+ || !entry.mutationId
138
139
  || !Array.isArray(entry.cards)
139
140
  ) return null;
140
141
  return entry;