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
address review (claude): reject trailing-garbage birth dates; null-proto execution-domain map
[._.]/ Adam Eivybc26c56e0a61
diff --git a/server/services/character.js b/server/services/character.jsindex af97f14400..72a3d2224a 100644--- a/server/services/character.js+++ b/server/services/character.js@@ -61,7 +61,11 @@ export function usableBirthDate(birthDate) {if (!m) return false;const y = Number(m[1]), mo = Number(m[2]), d = Number(m[3]);const dt = new Date(Date.UTC(y, mo - 1, d));- return dt.getUTCFullYear() === y && dt.getUTCMonth() + 1 === mo && dt.getUTCDate() === d;+ if (dt.getUTCFullYear() !== y || dt.getUTCMonth() + 1 !== mo || dt.getUTCDate() !== d) return false;+ // The prefix regex alone would pass "1990-05-10garbage", which the consumers'+ // full-string `new Date(birthDate)` rejects — status would say 'ok' while the+ // level derives null, the exact disagreement this predicate exists to prevent.+ return !Number.isNaN(new Date(birthDate).getTime());}// Pure: fractional years lived since birthDate (whole years + progress toward the nextdiff --git a/server/services/character.test.js b/server/services/character.test.jsindex 62d32894a5..bcebae7610 100644--- a/server/services/character.test.js+++ b/server/services/character.test.js@@ -117,6 +117,11 @@ describe('birthDateStatusFrom (#2757)', () => {expect(characterService.birthDateStatusFrom('0', true, now)).toBe('invalid');expect(characterService.birthDateStatusFrom('1990/05/15', true, now)).toBe('invalid');});+ it('reports invalid when a valid date prefix has unparseable trailing garbage', () => {+ // The prefix regex alone passes this, but `new Date()` rejects the full+ // string — status must not say 'ok' while the level derives null.+ expect(characterService.birthDateStatusFrom('1990-05-10garbage', true, now)).toBe('invalid');+ });it('accepts a full ISO timestamp (legacy/migrated storage), not just YYYY-MM-DD', () => {expect(characterService.birthDateStatusFrom('1984-01-01T00:00:00.000Z', true, now)).toBe('ok');});diff --git a/server/services/layeredIntelligence.js b/server/services/layeredIntelligence.jsindex 8063f8f6ab..c639db4f52 100644--- a/server/services/layeredIntelligence.js+++ b/server/services/layeredIntelligence.js@@ -1144,7 +1144,11 @@ export function computeExecutionByDomain(outcomes = []) {if (!recordsByScope.has(scope)) recordsByScope.set(scope, []);recordsByScope.get(scope).push(r);}- const byDomain = {};+ // Null prototype: `scope` is an LLM-authored free string, and a "__proto__"+ // key on a plain object would silently rewrite the prototype instead of+ // adding a bucket — vanishing from Object.entries while lookups read the+ // prototype object.+ const byDomain = Object.create(null);for (const [scope, records] of recordsByScope) {const completed = records.length;const succeeded = records.filter(r => r.executionOutcome === 'success').length;diff --git a/server/services/layeredIntelligence.test.js b/server/services/layeredIntelligence.test.jsindex 9afa84c63f..c046671564 100644--- a/server/services/layeredIntelligence.test.js+++ b/server/services/layeredIntelligence.test.js@@ -457,6 +457,16 @@ describe('computeExecutionByDomain (#2765)', () => {});});+ it('buckets a "__proto__" scope as data instead of rewriting the prototype', () => {+ const byDomain = computeExecutionByDomain([+ { scope: '__proto__', executionOutcome: 'success' }+ ]);+ // A plain {} would swallow this key into the prototype: absent from+ // Object.entries yet truthy on lookup — inconsistent gate-vs-prompt views.+ expect(Object.keys(byDomain)).toEqual(['__proto__']);+ expect(byDomain['__proto__'].completed).toBe(1);+ });+it('carries the dominant per-domain failure causes in failureSummary (#2764 §3)', () => {const byDomain = computeExecutionByDomain([{ scope: 'loop-meta', executionOutcome: 'failure', failureCategory: 'planning' },