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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: address review — mirror the graph summary field order, make the capo-0 omission explicit (#4105)
[._.]/ Adam Eivyc38f2663dfb9
diff --git a/server/services/brainGraph.js b/server/services/brainGraph.jsindex 069b276f7c..e2465db6bc 100644--- a/server/services/brainGraph.js+++ b/server/services/brainGraph.js@@ -67,7 +67,13 @@ const entityLabel = (record) => record.name || record.title || '(untitled)';// SongBook record — an untyped chain would put `[object Object]` in the// tooltip. `artist` sits ahead of `notes` so a song reads as "who plays it"// rather than whatever practice note happens to be attached.-const SUMMARY_FIELDS = ['context', 'oneLiner', 'artist', 'notes', 'content'];+//+// Kept identical to `BODY_FIELDS` in client/src/components/brain/tabs/BrainGraph.jsx:+// the detail panel falls back to this server-computed summary when the full+// record hasn't loaded, so a different field order would make the text jump on+// load. `description` is inert here (no entity store carries it — goals set+// their summary directly below) but stays in the list so the two can't drift.+const SUMMARY_FIELDS = ['description', 'context', 'oneLiner', 'artist', 'notes', 'content'];const entitySummary = (record) => {for (const field of SUMMARY_FIELDS) {if (typeof record[field] === 'string' && record[field]) return record[field];diff --git a/server/services/brainMemoryBridge.js b/server/services/brainMemoryBridge.jsindex 33b699ac5a..7131692273 100644--- a/server/services/brainMemoryBridge.js+++ b/server/services/brainMemoryBridge.js@@ -170,7 +170,10 @@ function composeSongContent(r) {const setup = [r.key && `Key: ${r.key}`,r.tuning && `Tuning: ${r.tuning}`,- r.capo ? `Capo: ${r.capo}` : null+ // `capo: 0` is the schema default and means "no capo" — not "capo at fret+ // 0" — so it is legitimately omitted rather than rendered as `Capo: 0`.+ // Explicit `> 0` so the intent doesn't read as an accidental truthiness bug.+ r.capo > 0 ? `Capo: ${r.capo}` : null].filter(Boolean);if (setup.length) parts.push(setup.join(' · '));if (r.notes) parts.push(r.notes);diff --git a/server/services/brainMemoryBridge.test.js b/server/services/brainMemoryBridge.test.jsindex b5d04c8256..85642c13f9 100644--- a/server/services/brainMemoryBridge.test.js+++ b/server/services/brainMemoryBridge.test.js@@ -582,14 +582,21 @@ describe('brainMemoryBridge — SongBook enrollment (issue #4105)', () => {expect(payload.content.length).toBeLessThan(1000);});- it('omits the setup line entirely when a song has no key/tuning/capo', async () => {+ it('omits the setup line when a song has no key/tuning and capo is the 0 default', async () => {const bridge = await loadBridge();+ // `capo: 0` is the schema default meaning "no capo" — not a capo at fret 0+ // — so it contributes nothing, and with no key/tuning the line disappears.const payload = bridge.brainRecordToMemory('songs', {id: 's2', title: 'Bare Song', capo: 0, content: { format: 'tab', text: '' }});expect(payload.content).toBe('Song: Bare Song');++ // A real capo still renders, so the omission above is the 0 default and not+ // the whole field being dropped.+ const capoed = bridge.brainRecordToMemory('songs', { id: 's3', title: 'Capoed', capo: 3 });+ expect(capoed.content).toBe('Song: Capoed\nCapo: 3');});it('re-embeds a song on :upserted through the debounced queue', async () => {