From d735097376cefa79765410716a8fca560ccb2a80 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 14 Sep 2026 21:26:26 -0700 Subject: [PATCH] fix(desktop): keep createdBy=learn through the starmap share code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The share-code codec encodes createdBy through a fixed table that only knew none/agent/user, so idxOf returned 0 for 'learn' and a learned skill round-tripped as createdBy: null. The 2-bit field has a free slot, so 'learn' now occupies it, and metaBadges labels agent- and learn-created skills alike as 'learned' — matching the Python side, where both values count as learning signals. Review finding: learn nodes lost createdBy in share-code round-trip. --- apps/desktop/src/app/starmap/share-code.test.ts | 2 +- apps/desktop/src/app/starmap/share-code.ts | 2 +- apps/desktop/src/app/starmap/text.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/app/starmap/share-code.test.ts b/apps/desktop/src/app/starmap/share-code.test.ts index 6cf33f869f..ea7f8ce94f 100644 --- a/apps/desktop/src/app/starmap/share-code.test.ts +++ b/apps/desktop/src/app/starmap/share-code.test.ts @@ -29,7 +29,7 @@ function sampleGraph(): StarmapGraph { }, { category: 'devops', - createdBy: null, + createdBy: 'learn', id: 'skill-b', kind: 'skill', label: 'skill-b', diff --git a/apps/desktop/src/app/starmap/share-code.ts b/apps/desktop/src/app/starmap/share-code.ts index 7531715408..d800e40ab1 100644 --- a/apps/desktop/src/app/starmap/share-code.ts +++ b/apps/desktop/src/app/starmap/share-code.ts @@ -20,7 +20,7 @@ const trim = (s: string): string => (s.length > MAX_LABEL ? s.slice(0, MAX_LABEL const KINDS = ['skill', 'memory'] as const const STATES = ['active', 'archived', 'disabled', 'draft'] as const const MEM_SOURCES = ['none', 'memory', 'profile'] as const -const CREATED_BY = ['none', 'agent', 'user'] as const +const CREATED_BY = ['none', 'agent', 'user', 'learn'] as const const REC_BITS = 12 // time position resolution: 1/4096 of the span — sub-pixel here. const REC_MAX = (1 << REC_BITS) - 1 diff --git a/apps/desktop/src/app/starmap/text.ts b/apps/desktop/src/app/starmap/text.ts index c0563d046f..d13edb8643 100644 --- a/apps/desktop/src/app/starmap/text.ts +++ b/apps/desktop/src/app/starmap/text.ts @@ -23,7 +23,7 @@ export function metaBadges(n: StarmapNode): string[] { } else { out.push(n.category) - if (n.createdBy === 'agent') { + if (n.createdBy === 'agent' || n.createdBy === 'learn') { out.push('learned') }