amalgm 0.1.213 → 0.1.214

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.213",
3
+ "version": "0.1.214",
4
4
  "description": "Amalgm local computer runtime: login, MCP, chat, events, previews, and tunnels.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -507,6 +507,21 @@ test('a losing commit is parked, the winning card lands exactly, and losing work
507
507
  assert.equal(fs.readFileSync(path.join(repo, 'local-dirty.txt'), 'utf8'), 'also uncommitted\n');
508
508
  assert.equal((await git(repo, 'status', '--porcelain')).trim().length > 0, true);
509
509
  assert.deepEqual(readRepoState('root:test').parked.map((entry) => entry.oid), [losingOid]);
510
+
511
+ await git(repo, 'add', '.');
512
+ await git(repo, 'commit', '-m', 'fold parked work');
513
+ const foldedOid = (await git(repo, 'rev-parse', 'HEAD')).trim();
514
+ const foldedCard = card(repo, foldedOid, 3);
515
+ const folded = await materializeRepo(foldedCard, {
516
+ repoKey: 'root:test',
517
+ card: foldedCard,
518
+ transitions: [],
519
+ parked: [],
520
+ });
521
+
522
+ assert.equal(folded.state, 'in-sync');
523
+ assert.deepEqual(readRepoState('root:test').parked, []);
524
+ assert.equal((await git(repo, 'rev-parse', `refs/amalgm/parked/${losingOid}`)).trim(), losingOid);
510
525
  });
511
526
 
512
527
  test('rail-parked peer commits become one staged checkpoint on every machine', async () => {
@@ -120,6 +120,15 @@ test('only a value different from both the materialized baseline and the rail is
120
120
  branches: [{ name: 'main', oid: oidC }],
121
121
  };
122
122
  assert.equal(hasLocalContribution(local, remoteAdvance, baseline), false);
123
+ assert.equal(hasLocalContribution(local, remoteAdvance, baseline, {
124
+ checkpoint: 'repo-checkpoint@7',
125
+ machine: 'machine-a',
126
+ branch: 'main',
127
+ baseOid: oidA,
128
+ from: { revision: null, indexDiff: '', worktreeDiff: '' },
129
+ to: { revision: 'old-work', indexDiff: '', worktreeDiff: 'patch' },
130
+ parked: [],
131
+ }), false);
123
132
  assert.equal(hasLocalContribution(
124
133
  {
125
134
  head: { branch: 'main', oid: oidB, detached: false },
@@ -513,7 +513,6 @@ async function materializeRepo(localCardInput, plan) {
513
513
  : refreshed;
514
514
  const previous = readRepoState(plan.repoKey);
515
515
  const parked = uniqueParked([
516
- ...(previous?.parked || []),
517
516
  ...(plan.parked || []),
518
517
  ...(cardResult.parked || []),
519
518
  ]);
@@ -260,7 +260,8 @@ function hasLocalContribution(card, plan, baseline, checkpoint = null, previousC
260
260
  }
261
261
 
262
262
  if (
263
- checkpoint
263
+ onRail
264
+ && checkpoint
264
265
  && checkpoint.baseOid === card.head?.oid
265
266
  && checkpoint.branch === card.head?.branch
266
267
  ) {