@crossworks/content-core 0.232.224 → 0.232.228

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": "@crossworks/content-core",
3
- "version": "0.232.224",
3
+ "version": "0.232.228",
4
4
  "description": "Browser-safe content logic — markdown, blocks, pages, tables, formulas — shared by the server and any client. Zero server deps by design: nothing here may reach @mantle/db, node-only APIs, or the network (the jackdaw-repo-split P0 boundary).",
5
5
  "exports": {
6
6
  "./block-diff": "./src/block-diff.ts",
@@ -29,7 +29,7 @@
29
29
  "./thinking-tiers": "./src/thinking-tiers.ts"
30
30
  },
31
31
  "dependencies": {
32
- "@mantle/client-types": "npm:@crossworks/client-types@0.232.224",
32
+ "@mantle/client-types": "npm:@crossworks/client-types@0.232.228",
33
33
  "marked": "^18.0.11",
34
34
  "mathjs": "15.2.0"
35
35
  },
@@ -79,9 +79,15 @@ describe('legacyCategoryToKind', () => {
79
79
  expect(legacyCategoryToKind('identity')).toBe('identity');
80
80
  expect(legacyCategoryToKind('goal')).toBe('goal');
81
81
  });
82
+ it('reads background life areas as identity, unless the row has a mood', () => {
83
+ for (const c of ['family', 'relationships', 'faith', 'health']) {
84
+ expect(legacyCategoryToKind(c)).toBe('identity');
85
+ expect(legacyCategoryToKind(c, 'reflective')).toBe('context');
86
+ }
87
+ });
82
88
  it('maps every other legacy life area (and none) to context', () => {
83
89
  expect(legacyCategoryToKind('work')).toBe('context');
84
- expect(legacyCategoryToKind('faith')).toBe('context');
90
+ expect(legacyCategoryToKind('reflection')).toBe('context');
85
91
  expect(legacyCategoryToKind('emotion')).toBe('context');
86
92
  expect(legacyCategoryToKind(null)).toBe('context');
87
93
  });
@@ -64,13 +64,22 @@ export function kindLane(key: string | null): JournalLane {
64
64
  return found?.lane ?? 'user';
65
65
  }
66
66
 
67
+ /** Legacy life areas that describe WHO the user is (background), not what
68
+ * happened lately. Spike 10 (dev-brain page 60a2f51e): mapping these to
69
+ * `context` let the newest-first cap drop a personal brain's family, faith
70
+ * and health baseline entries from every prompt. */
71
+ const LEGACY_BACKGROUND = new Set(['family', 'relationships', 'faith', 'health']);
72
+
67
73
  /** Map a legacy pre-v2 `category` value to a kind, for rows written before
68
- * the kind vocabulary existed. `identity`/`goal` carry over; every other
69
- * life area (work, family, faith, health, emotion, …) reads as `context`.
70
- * Only consulted when a row has no `kind`. */
71
- export function legacyCategoryToKind(category: string | null): KindKey {
74
+ * the kind vocabulary existed. `identity`/`goal` carry over; background life
75
+ * areas (family, relationships, faith, health) read as `identity`, unless the
76
+ * row carries a `mood`: a mood-era entry is a reflection on a moment, so it
77
+ * reads as `context`. Everything else (work, emotion, reflection, ad hoc
78
+ * categories) reads as `context`. Only consulted when a row has no `kind`. */
79
+ export function legacyCategoryToKind(category: string | null, mood: string | null = null): KindKey {
72
80
  if (category === 'identity') return 'identity';
73
81
  if (category === 'goal') return 'goal';
82
+ if (category && LEGACY_BACKGROUND.has(category) && !mood) return 'identity';
74
83
  return 'context';
75
84
  }
76
85