Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (claude): ship seed songs with a fixed originInstanceId sentinel

[._.]/ Adam Eivy2ab03e414df3
diff --git a/data.reference/brain/songs.json b/data.reference/brain/songs.json
index 509579ced9..a48ce70be8 100644
--- a/data.reference/brain/songs.json
+++ b/data.reference/brain/songs.json
@@ -21,7 +21,8 @@
"notes": "Arpeggiated 6/8 — the classic pattern. Traditional song, public domain.",
"attachments": [],
"createdAt": "2026-07-15T00:00:00.000Z",
- "updatedAt": "2026-07-15T00:00:00.000Z"
+ "updatedAt": "2026-07-15T00:00:00.000Z",
+ "originInstanceId": "seed"
},
"song-seed-hotrs-piano": {
"title": "House of the Rising Sun",
@@ -44,7 +45,8 @@
"notes": "Roll the chords in 6/8; melody sits on top of Am–C–D–F. Traditional song, public domain.",
"attachments": [],
"createdAt": "2026-07-15T00:00:00.000Z",
- "updatedAt": "2026-07-15T00:00:00.000Z"
+ "updatedAt": "2026-07-15T00:00:00.000Z",
+ "originInstanceId": "seed"
},
"song-seed-hotrs-ukulele": {
"title": "House of the Rising Sun",
@@ -67,7 +69,8 @@
"notes": "Same shapes as guitar — Am, C, D, F, E are all first-position on uke. Traditional song, public domain.",
"attachments": [],
"createdAt": "2026-07-15T00:00:00.000Z",
- "updatedAt": "2026-07-15T00:00:00.000Z"
+ "updatedAt": "2026-07-15T00:00:00.000Z",
+ "originInstanceId": "seed"
}
}
}
diff --git a/scripts/migrations/190-seed-songbook-songs.test.js b/scripts/migrations/190-seed-songbook-songs.test.js
index f73b9c2e78..7b4b77952f 100644
--- a/scripts/migrations/190-seed-songbook-songs.test.js
+++ b/scripts/migrations/190-seed-songbook-songs.test.js
@@ -109,7 +109,7 @@ describe('migration 190 — seed songbook songs', () => {
it('seeds the SHIPPED reference records against a real repo layout shape', async () => {
// Sanity-pin the shipped seed file: three instrument variants of the same
- // public-domain song, no originInstanceId, stable ids.
+ // public-domain song, stable ids, and a FIXED originInstanceId sentinel.
const shipped = JSON.parse(readFileSync(new URL('../../data.reference/brain/songs.json', import.meta.url), 'utf-8'));
const ids = Object.keys(shipped.records);
expect(ids.sort()).toEqual(['song-seed-hotrs-guitar', 'song-seed-hotrs-piano', 'song-seed-hotrs-ukulele']);
@@ -117,7 +117,13 @@ describe('migration 190 — seed songbook songs', () => {
const rec = shipped.records[id];
expect(rec.title).toBe('House of the Rising Sun');
expect(rec.artist).toBe('Traditional');
- expect(rec.originInstanceId).toBeUndefined(); // boot backfill stamps it
+ // Seed records MUST ship a fixed originInstanceId: boot backfill stamps
+ // a per-install id onto records missing one, which would make the same
+ // seed hash differently on every peer — permanently defeating the brain
+ // reconcile checksum's cheap convergence check and forcing full snapshot
+ // exchanges every sync cycle. A fixed sentinel keeps all installs
+ // byte-identical. Any future seeded brain record needs the same.
+ expect(rec.originInstanceId).toBe('seed');
expect(rec.attachments).toEqual([]);
expect(rec.content.format).toBe('tab');
expect(rec.content.text).toContain('There is a house in New Orleans');