@davesheffer/hunch 1.41.1 → 1.41.2

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.
@@ -170,8 +170,14 @@ export function mergeLedgers(base, ours, theirs) {
170
170
  seen.set(k, e);
171
171
  order.push(e);
172
172
  } };
173
- for (const e of base?.events ?? [])
174
- add(e);
173
+ const ourIdentities = new Set(ours.events.map(eventIdentity));
174
+ const theirIdentities = new Set(theirs.events.map(eventIdentity));
175
+ // Base is a merge ancestor, not a source of history both clones have compacted away.
176
+ for (const e of base?.events ?? []) {
177
+ const key = eventIdentity(e);
178
+ if (ourIdentities.has(key) || theirIdentities.has(key) || (e.seq > ours.floor_seq && e.seq > theirs.floor_seq))
179
+ add(e);
180
+ }
175
181
  for (const e of ours.events)
176
182
  add(e);
177
183
  for (const e of theirs.events)
@@ -180,7 +186,6 @@ export function mergeLedgers(base, ours, theirs) {
180
186
  // side 1 iff theirs holds it and neither ours nor base does. Deciding by object identity
181
187
  // (`includes`) would instead put anything ours compacted away — base's object, which `add`
182
188
  // keeps — after its same-`at` siblings and silently reorder a batch both sides already had.
183
- const ourIdentities = new Set(ours.events.map(eventIdentity));
184
189
  const baseIdentities = new Set((base?.events ?? []).map(eventIdentity));
185
190
  const theirsOnly = (e) => {
186
191
  const k = eventIdentity(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davesheffer/hunch",
3
- "version": "1.41.1",
3
+ "version": "1.41.2",
4
4
  "mcpName": "io.github.davesheffer/hunch",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Dave Sheffer <dave.sheffer1@gmail.com>",
package/server.json CHANGED
@@ -7,13 +7,13 @@
7
7
  "source": "github"
8
8
  },
9
9
  "websiteUrl": "https://www.hunchmemory.com",
10
- "version": "1.41.1",
10
+ "version": "1.41.2",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "registryBaseUrl": "https://registry.npmjs.org",
15
15
  "identifier": "@davesheffer/hunch",
16
- "version": "1.41.1",
16
+ "version": "1.41.2",
17
17
  "runtimeHint": "npx",
18
18
  "packageArguments": [
19
19
  {