Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(privacy): takes test fixtures use a placeholder holder name
garrytan08a3d5c770d7
diff --git a/test/takes-engine.test.ts b/test/takes-engine.test.tsindex bafc409375..514dcb2db7 100644--- a/test/takes-engine.test.ts+++ b/test/takes-engine.test.ts@@ -39,8 +39,8 @@ describe('addTakesBatch + listTakes', () => {test('inserts a batch and round-trips through listTakes', async () => {const inserted = await engine.addTakesBatch([{ page_id: alicePageId, row_num: 1, claim: 'CEO of Acme', kind: 'fact', holder: 'world', weight: 1.0 },- { page_id: alicePageId, row_num: 2, claim: 'Strong technical founder', kind: 'take', holder: 'garry', weight: 0.85 },- { page_id: alicePageId, row_num: 3, claim: 'Will reach $50B', kind: 'bet', holder: 'garry', weight: 0.65 },+ { page_id: alicePageId, row_num: 2, claim: 'Strong technical founder', kind: 'take', holder: 'dana', weight: 0.85 },+ { page_id: alicePageId, row_num: 3, claim: 'Will reach $50B', kind: 'bet', holder: 'dana', weight: 0.65 },]);expect(inserted).toBe(3);@@ -53,7 +53,7 @@ describe('addTakesBatch + listTakes', () => {test('upsert path: re-inserting the same row updates fields', async () => {await engine.addTakesBatch([- { page_id: alicePageId, row_num: 2, claim: 'Best technical founder in batch', kind: 'take', holder: 'garry', weight: 0.9 },+ { page_id: alicePageId, row_num: 2, claim: 'Best technical founder in batch', kind: 'take', holder: 'dana', weight: 0.9 },]);const takes = await engine.listTakes({ page_id: alicePageId });const row2 = takes.find(t => t.row_num === 2);@@ -71,9 +71,9 @@ describe('addTakesBatch + listTakes', () => {});test('listTakes filters by holder', async () => {- const garryTakes = await engine.listTakes({ holder: 'garry' });- expect(garryTakes.every(t => t.holder === 'garry')).toBe(true);- expect(garryTakes.length).toBeGreaterThan(0);+ const danaTakes = await engine.listTakes({ holder: 'dana' });+ expect(danaTakes.every(t => t.holder === 'dana')).toBe(true);+ expect(danaTakes.length).toBeGreaterThan(0);});test('listTakes filters by kind', async () => {@@ -84,7 +84,7 @@ describe('addTakesBatch + listTakes', () => {test('takesHoldersAllowList filters out non-allowed holders', async () => {const worldOnly = await engine.listTakes({ takesHoldersAllowList: ['world'] });expect(worldOnly.every(t => t.holder === 'world')).toBe(true);- // garry takes exist but aren't returned+ // dana takes exist but aren't returnedconst allTakes = await engine.listTakes({});expect(allTakes.length).toBeGreaterThan(worldOnly.length);});@@ -111,7 +111,7 @@ describe('searchTakes', () => {{page_id: acmePageId, row_num: 50,claim: 'Acme will consolidate the mid-market vertical SaaS landscape through disciplined acquisitions and a shared billing platform over the next five years',- kind: 'bet', holder: 'garry', weight: 0.6,+ kind: 'bet', holder: 'dana', weight: 0.6,},]);const hits = await engine.searchTakes('consolidate');@@ -136,7 +136,7 @@ describe('supersedeTake', () => {const { oldRow, newRow } = await engine.supersedeTake(alicePageId, 3, {claim: 'Will reach $40B',kind: 'bet',- holder: 'garry',+ holder: 'dana',weight: 0.7,});expect(oldRow).toBe(3);@@ -157,34 +157,34 @@ describe('resolveTake + immutability', () => {test('resolves a bet with metadata', async () => {// Add a fresh bet to resolveawait engine.addTakesBatch([- { page_id: alicePageId, row_num: 10, claim: 'Series A within 12 months', kind: 'bet', holder: 'garry', weight: 0.6 },+ { page_id: alicePageId, row_num: 10, claim: 'Series A within 12 months', kind: 'bet', holder: 'dana', weight: 0.6 },]);await engine.resolveTake(alicePageId, 10, {outcome: true,value: 15_000_000,unit: 'usd',source: 'crustdata',- resolvedBy: 'garry',+ resolvedBy: 'dana',});const [resolved] = await engine.listTakes({ page_id: alicePageId, resolved: true });expect(resolved.resolved_outcome).toBe(true);expect(resolved.resolved_value).toBe(15_000_000);expect(resolved.resolved_unit).toBe('usd');- expect(resolved.resolved_by).toBe('garry');+ expect(resolved.resolved_by).toBe('dana');});test('TAKE_ALREADY_RESOLVED on re-resolve attempt', async () => {await expect(- engine.resolveTake(alicePageId, 10, { outcome: false, resolvedBy: 'garry' }),+ engine.resolveTake(alicePageId, 10, { outcome: false, resolvedBy: 'dana' }),).rejects.toThrow(/TAKE_ALREADY_RESOLVED/);});// v0.30.0: 3-state quality input + back-compat outcome alias.test('v0.30.0: resolve with --quality correct writes both columns', async () => {await engine.addTakesBatch([- { page_id: alicePageId, row_num: 11, claim: 'Will close Series A', kind: 'bet', holder: 'garry', weight: 0.7 },+ { page_id: alicePageId, row_num: 11, claim: 'Will close Series A', kind: 'bet', holder: 'dana', weight: 0.7 },]);- await engine.resolveTake(alicePageId, 11, { quality: 'correct', resolvedBy: 'garry' });+ await engine.resolveTake(alicePageId, 11, { quality: 'correct', resolvedBy: 'dana' });const takes = await engine.listTakes({ page_id: alicePageId, resolved: true });const r = takes.find(t => t.row_num === 11)!;expect(r.resolved_quality).toBe('correct');@@ -193,9 +193,9 @@ describe('resolveTake + immutability', () => {test('v0.30.0: resolve with --quality partial writes (partial, NULL)', async () => {await engine.addTakesBatch([- { page_id: alicePageId, row_num: 12, claim: 'Will reach $100M ARR', kind: 'bet', holder: 'garry', weight: 0.55 },+ { page_id: alicePageId, row_num: 12, claim: 'Will reach $100M ARR', kind: 'bet', holder: 'dana', weight: 0.55 },]);- await engine.resolveTake(alicePageId, 12, { quality: 'partial', resolvedBy: 'garry' });+ await engine.resolveTake(alicePageId, 12, { quality: 'partial', resolvedBy: 'dana' });const takes = await engine.listTakes({ page_id: alicePageId, resolved: true });const r = takes.find(t => t.row_num === 12)!;expect(r.resolved_quality).toBe('partial');@@ -204,9 +204,9 @@ describe('resolveTake + immutability', () => {test('v0.30.0 (back-compat): outcome=true → quality=correct (legacy v0.28 callers)', async () => {await engine.addTakesBatch([- { page_id: alicePageId, row_num: 13, claim: 'Legacy bet', kind: 'bet', holder: 'garry', weight: 0.8 },+ { page_id: alicePageId, row_num: 13, claim: 'Legacy bet', kind: 'bet', holder: 'dana', weight: 0.8 },]);- await engine.resolveTake(alicePageId, 13, { outcome: true, resolvedBy: 'garry' });+ await engine.resolveTake(alicePageId, 13, { outcome: true, resolvedBy: 'dana' });const takes = await engine.listTakes({ page_id: alicePageId, resolved: true });const r = takes.find(t => t.row_num === 13)!;expect(r.resolved_quality).toBe('correct');@@ -215,10 +215,10 @@ describe('resolveTake + immutability', () => {test('v0.30.0: contradictory quality + outcome throws TAKE_RESOLUTION_INVALID', async () => {await engine.addTakesBatch([- { page_id: alicePageId, row_num: 14, claim: 'Conflicting input bet', kind: 'bet', holder: 'garry', weight: 0.5 },+ { page_id: alicePageId, row_num: 14, claim: 'Conflicting input bet', kind: 'bet', holder: 'dana', weight: 0.5 },]);await expect(- engine.resolveTake(alicePageId, 14, { quality: 'correct', outcome: false, resolvedBy: 'garry' }),+ engine.resolveTake(alicePageId, 14, { quality: 'correct', outcome: false, resolvedBy: 'dana' }),).rejects.toThrow(/TAKE_RESOLUTION_INVALID/);});@@ -227,7 +227,7 @@ describe('resolveTake + immutability', () => {engine.supersedeTake(alicePageId, 10, {claim: 'Series B within 6 months',kind: 'bet',- holder: 'garry',+ holder: 'dana',weight: 0.4,}),).rejects.toThrow(/TAKE_RESOLVED_IMMUTABLE/);@@ -250,21 +250,21 @@ describe('v0.30.0 getScorecard', () => {// 4 bets at varied weights, mixed outcomes — matches the unit-test// hand-calc in takes-resolution.test.ts so we can sanity-check Brier.await engine.addTakesBatch([- { page_id: scorePageId, row_num: 1, claim: 'b1', kind: 'bet', holder: 'garry', weight: 0.9 },- { page_id: scorePageId, row_num: 2, claim: 'b2', kind: 'bet', holder: 'garry', weight: 0.6 },- { page_id: scorePageId, row_num: 3, claim: 'b3', kind: 'bet', holder: 'garry', weight: 0.7 },- { page_id: scorePageId, row_num: 4, claim: 'b4', kind: 'bet', holder: 'garry', weight: 0.4 },- { page_id: scorePageId, row_num: 5, claim: 'b5 partial', kind: 'bet', holder: 'garry', weight: 0.5 },+ { page_id: scorePageId, row_num: 1, claim: 'b1', kind: 'bet', holder: 'dana', weight: 0.9 },+ { page_id: scorePageId, row_num: 2, claim: 'b2', kind: 'bet', holder: 'dana', weight: 0.6 },+ { page_id: scorePageId, row_num: 3, claim: 'b3', kind: 'bet', holder: 'dana', weight: 0.7 },+ { page_id: scorePageId, row_num: 4, claim: 'b4', kind: 'bet', holder: 'dana', weight: 0.4 },+ { page_id: scorePageId, row_num: 5, claim: 'b5 partial', kind: 'bet', holder: 'dana', weight: 0.5 },]);- await engine.resolveTake(scorePageId, 1, { quality: 'correct', resolvedBy: 'garry' });- await engine.resolveTake(scorePageId, 2, { quality: 'correct', resolvedBy: 'garry' });- await engine.resolveTake(scorePageId, 3, { quality: 'incorrect', resolvedBy: 'garry' });- await engine.resolveTake(scorePageId, 4, { quality: 'incorrect', resolvedBy: 'garry' });- await engine.resolveTake(scorePageId, 5, { quality: 'partial', resolvedBy: 'garry' });+ await engine.resolveTake(scorePageId, 1, { quality: 'correct', resolvedBy: 'dana' });+ await engine.resolveTake(scorePageId, 2, { quality: 'correct', resolvedBy: 'dana' });+ await engine.resolveTake(scorePageId, 3, { quality: 'incorrect', resolvedBy: 'dana' });+ await engine.resolveTake(scorePageId, 4, { quality: 'incorrect', resolvedBy: 'dana' });+ await engine.resolveTake(scorePageId, 5, { quality: 'partial', resolvedBy: 'dana' });});test('counts correct/incorrect/partial; accuracy excludes partial', async () => {- const card = await engine.getScorecard({ holder: 'garry', domainPrefix: 'companies/scorecard-fixture' }, undefined);+ const card = await engine.getScorecard({ holder: 'dana', domainPrefix: 'companies/scorecard-fixture' }, undefined);expect(card.correct).toBe(2);expect(card.incorrect).toBe(2);expect(card.partial).toBe(1);@@ -274,7 +274,7 @@ describe('v0.30.0 getScorecard', () => {});test('Brier excludes partial: hand-calculated reference == 0.205', async () => {- const card = await engine.getScorecard({ holder: 'garry', domainPrefix: 'companies/scorecard-fixture' }, undefined);+ const card = await engine.getScorecard({ holder: 'dana', domainPrefix: 'companies/scorecard-fixture' }, undefined);// Per-row Brier (correct ∨ incorrect only):// (0.9-1)^2 = 0.01// (0.6-1)^2 = 0.16@@ -286,24 +286,24 @@ describe('v0.30.0 getScorecard', () => {test('PRIVACY: SQL allow-list filter — hidden-holder rows contribute zero', async () => {// Add a take from a different holder (e.g., harj). The scorecard with- // allow-list ['garry'] must NOT count that take in any aggregate.+ // allow-list ['dana'] must NOT count that take in any aggregate.const p = await engine.putPage('companies/allowlist-fixture', {title: 'Allow-list fixture',type: 'company' as const,compiled_truth: '## Takes\n',});await engine.addTakesBatch([- { page_id: p.id, row_num: 1, claim: 'garry bet', kind: 'bet', holder: 'garry', weight: 0.7 },+ { page_id: p.id, row_num: 1, claim: 'dana bet', kind: 'bet', holder: 'dana', weight: 0.7 },{ page_id: p.id, row_num: 2, claim: 'harj bet', kind: 'bet', holder: 'harj-taggar', weight: 0.6 },]);- await engine.resolveTake(p.id, 1, { quality: 'correct', resolvedBy: 'garry' });+ await engine.resolveTake(p.id, 1, { quality: 'correct', resolvedBy: 'dana' });await engine.resolveTake(p.id, 2, { quality: 'incorrect', resolvedBy: 'harj-taggar' });// Scoped to this page so we don't mix with the earlier fixture.- const allowedGarry = await engine.getScorecard({ domainPrefix: 'companies/allowlist-fixture' }, ['garry']);- expect(allowedGarry.correct).toBe(1);- expect(allowedGarry.incorrect).toBe(0);- expect(allowedGarry.resolved).toBe(1);+ const allowedDana = await engine.getScorecard({ domainPrefix: 'companies/allowlist-fixture' }, ['dana']);+ expect(allowedDana.correct).toBe(1);+ expect(allowedDana.incorrect).toBe(0);+ expect(allowedDana.resolved).toBe(1);const trustedFull = await engine.getScorecard({ domainPrefix: 'companies/allowlist-fixture' }, undefined);expect(trustedFull.resolved).toBe(2);@@ -322,14 +322,14 @@ describe('v0.30.0 getCalibrationCurve', () => {test('bins resolved bets by stated weight; partial excluded; harj non-allowed contributes zero', async () => {// The cross-suite state has accumulated several resolved bets; rather// than couple to exact totals, assert the structural invariants:- // (1) all returned buckets contain garry rows only when allow-list is garry+ // (1) all returned buckets contain dana rows only when allow-list is dana// (2) the unfiltered count INCLUDES at least one harj row that the// allow-listed call does NOT include// (3) partial bets never appear (Brier excludes them by definition)- const garryAll = await engine.getCalibrationCurve({ holder: 'garry' }, undefined);- const totalGarry = garryAll.reduce((s, b) => s + b.n, 0);- expect(totalGarry).toBeGreaterThan(0);- for (const b of garryAll) {+ const danaAll = await engine.getCalibrationCurve({ holder: 'dana' }, undefined);+ const totalDana = danaAll.reduce((s, b) => s + b.n, 0);+ expect(totalDana).toBeGreaterThan(0);+ for (const b of danaAll) {// observed in [0, 1]; predicted in [0, 1)if (b.observed !== null) { expect(b.observed).toBeGreaterThanOrEqual(0); expect(b.observed).toBeLessThanOrEqual(1); }if (b.predicted !== null) { expect(b.predicted).toBeGreaterThanOrEqual(0); expect(b.predicted).toBeLessThan(1.001); }@@ -341,12 +341,12 @@ describe('v0.30.0 getCalibrationCurve', () => {const trustedAll = await engine.getCalibrationCurve({}, undefined);const totalTrusted = trustedAll.reduce((s, b) => s + b.n, 0);- const garryOnly = await engine.getCalibrationCurve({}, ['garry']);- const totalGarry = garryOnly.reduce((s, b) => s + b.n, 0);+ const danaOnly = await engine.getCalibrationCurve({}, ['dana']);+ const totalDana = danaOnly.reduce((s, b) => s + b.n, 0);// Harj has at least one resolved binary bet from the allowlist fixture.- // The allow-list MUST drop it strictly: garry-only count < trusted count.- expect(totalGarry).toBeLessThan(totalTrusted);+ // The allow-list MUST drop it strictly: dana-only count < trusted count.+ expect(totalDana).toBeLessThan(totalTrusted);});});diff --git a/test/takes-fence-read-ops.test.ts b/test/takes-fence-read-ops.test.tsindex efc64c9af0..7c9e35521c 100644--- a/test/takes-fence-read-ops.test.ts+++ b/test/takes-fence-read-ops.test.ts@@ -17,7 +17,7 @@* 2. MCP-bound caller (allow-list set) sees `compiled_truth` with the* fence stripped.* 3. The strip applies regardless of allow-list contents — even an- * allow-list of `['garry', 'brain', 'world']` (i.e., everything) still+ * allow-list of `['dana', 'brain', 'world']` (i.e., everything) still* strips, because the allow-list's PRESENCE signals an MCP-bound* caller. This is the key insight: the allow-list is identity, not* filter scope, for read-op redaction.@@ -44,7 +44,7 @@ ${TAKES_FENCE_BEGIN}| # | claim | kind | who | weight | since | source ||---|-------|------|-----|--------|-------|--------|| 1 | CEO of Acme | fact | world | 1.0 | 2017-01 | Crustdata |-| 2 | Strong technical founder | take | garry | 0.85 | 2026-04 | OH |+| 2 | Strong technical founder | take | dana | 0.85 | 2026-04 | OH || 3 | Seemed burned out | hunch | brain | 0.4 | 2026-04 | OH |${TAKES_FENCE_END}@@ -100,11 +100,11 @@ describe('C4: get_page takes-fence redaction (#728)', () => {test('MCP caller with permissive allow-list (everything) STILL strips fence (presence = identity)', async () => {// Critical invariant: the ALLOW-LIST PRESENCE flags the caller as// MCP-bound. The contents of the allow-list don't loosen the redaction —- // even ['world','garry','brain'] still strips, because takes_list /+ // even ['world','dana','brain'] still strips, because takes_list /// takes_search are the typed surfaces for take inspection. get_page is// not an authorized take-reading channel.const result = await dispatchToolCall(engine, 'get_page', { slug: PAGE_SLUG }, {- remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'garry', 'brain'],+ remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'dana', 'brain'],});const page = parseResult(result) as { compiled_truth: string };expect(page.compiled_truth).not.toContain(TAKES_FENCE_BEGIN);diff --git a/test/takes-fence.test.ts b/test/takes-fence.test.tsindex 5b96e7e187..750dffb588 100644--- a/test/takes-fence.test.ts+++ b/test/takes-fence.test.ts@@ -19,9 +19,9 @@ ${TAKES_FENCE_BEGIN}| # | claim | kind | who | weight | since | source ||---|-------|------|-----|--------|-------|--------|| 1 | CEO of Acme | fact | world | 1.0 | 2017-01 | Crustdata |-| 2 | Strong technical founder | take | garry | 0.85 | 2026-04-29 | OH 2026-04-29 |-| 3 | ~~Will reach $50B~~ | bet | garry | 0.7 | 2026-04-29 → 2026-06 | superseded by #4 |-| 4 | Will reach $30B | bet | garry | 0.55 | 2026-06 | revised after Q2 |+| 2 | Strong technical founder | take | dana | 0.85 | 2026-04-29 | OH 2026-04-29 |+| 3 | ~~Will reach $50B~~ | bet | dana | 0.7 | 2026-04-29 → 2026-06 | superseded by #4 |+| 4 | Will reach $30B | bet | dana | 0.55 | 2026-06 | revised after Q2 |${TAKES_FENCE_END}## Notes@@ -101,8 +101,8 @@ describe('parseTakesFence', () => {| # | claim | kind | who | weight | since | source ||---|-------|------|-----|--------|-------|--------|| 1 | Valid row | fact | world | 1.0 | 2026-01 | source |-| 2 | Bad weight | take | garry | not-a-number | 2026-01 | x |-| 3 | Unknown kind | wibble | garry | 0.5 | 2026-01 | x |+| 2 | Bad weight | take | dana | not-a-number | 2026-01 | x |+| 3 | Unknown kind | wibble | dana | 0.5 | 2026-01 | x || zzz | Bad rownum | fact | world | 1.0 | 2026-01 | x |${TAKES_FENCE_END}`;const { takes, warnings } = parseTakesFence(body);@@ -175,7 +175,7 @@ describe('upsertTakeRow', () => {const { body, rowNum } = upsertTakeRow(SAMPLE_BODY, {claim: 'Best founder I have met this batch',kind: 'take',- holder: 'garry',+ holder: 'dana',weight: 0.95,sinceDate: '2026-05-01',source: 'OH 2026-05-01',@@ -231,7 +231,7 @@ describe('supersedeRow', () => {const { body, oldRowNum, newRowNum } = supersedeRow(SAMPLE_BODY, 2, {claim: 'Strongest technical founder I have met',kind: 'take',- holder: 'garry',+ holder: 'dana',weight: 0.95,sinceDate: '2026-05-01',source: 'OH 2026-05-01',@@ -288,8 +288,8 @@ describe('v0.30.0 resolution columns', () => {const RESOLVED_BODY = `# Some Page\n\n## Takes\n\n${TAKES_FENCE_BEGIN}| # | claim | kind | who | weight | since | source | resolved | quality | evidence | value | unit | by ||---|-------|------|-----|--------|-------|--------|----------|---------|----------|-------|------|----|-| 1 | First bet | bet | garry | 0.7 | 2026-04 | OH | 2026-04-30 | correct | Series A closed | 50 | usd | garry |-| 2 | Pending bet | bet | garry | 0.6 | 2026-04 | OH | | | | | | |+| 1 | First bet | bet | dana | 0.7 | 2026-04 | OH | 2026-04-30 | correct | Series A closed | 50 | usd | dana |+| 2 | Pending bet | bet | dana | 0.6 | 2026-04 | OH | | | | | | |${TAKES_FENCE_END}\n`;test('parses v0.30-shape fence: resolved row has resolution fields populated', () => {@@ -304,7 +304,7 @@ ${TAKES_FENCE_END}\n`;resolvedEvidence: 'Series A closed',resolvedValue: 50,resolvedUnit: 'usd',- resolvedBy: 'garry',+ resolvedBy: 'dana',});});@@ -370,7 +370,7 @@ ${TAKES_FENCE_END}\n`;expect(roundTripped[0].resolvedEvidence).toBe('Series A closed');expect(roundTripped[0].resolvedValue).toBe(50);expect(roundTripped[0].resolvedUnit).toBe('usd');- expect(roundTripped[0].resolvedBy).toBe('garry');+ expect(roundTripped[0].resolvedBy).toBe('dana');});test('REGRESSION (codex F3): updating an unrelated row preserves resolution on the resolved row', () => {@@ -424,7 +424,7 @@ ${TAKES_FENCE_END}\n`;const { body: nextBody, rowNum } = upsertTakeRow(RESOLVED_BODY, {claim: 'Brand new bet',kind: 'bet',- holder: 'garry',+ holder: 'dana',weight: 0.4,active: true,});@@ -448,7 +448,7 @@ ${TAKES_FENCE_END}\n`;const { body: nextBody } = supersedeRow(RESOLVED_BODY, 1, {claim: 'Updated bet',kind: 'bet',- holder: 'garry',+ holder: 'dana',weight: 0.5,});const { takes } = parseTakesFence(nextBody);diff --git a/test/takes-mcp-allowlist.test.ts b/test/takes-mcp-allowlist.test.tsindex 6d635258f7..b4dbf99146 100644--- a/test/takes-mcp-allowlist.test.ts+++ b/test/takes-mcp-allowlist.test.ts@@ -30,10 +30,10 @@ beforeAll(async () => {title: 'Alice', type: 'person', compiled_truth: '## Takes\n',});alicePageId = alice.id;- // Seed three takes by three holders. Public fact, garry's bet, brain's hunch.+ // Seed three takes by three holders. Public fact, dana's bet, brain's hunch.await engine.addTakesBatch([{ page_id: alicePageId, row_num: 1, claim: 'CEO of Acme', kind: 'fact', holder: 'world', weight: 1.0 },- { page_id: alicePageId, row_num: 2, claim: 'Strong technical founder', kind: 'take', holder: 'garry', weight: 0.85 },+ { page_id: alicePageId, row_num: 2, claim: 'Strong technical founder', kind: 'take', holder: 'dana', weight: 0.85 },{ page_id: alicePageId, row_num: 3, claim: 'Seemed burned out in last OH', kind: 'hunch', holder: 'brain', weight: 0.4 },]);});@@ -54,7 +54,7 @@ describe('per-token takes-holder allow-list — takes_list', () => {});const takes = parseResult(result) as Array<{ holder: string; claim: string }>;const holders = takes.map(t => t.holder).sort();- expect(holders).toEqual(['brain', 'garry', 'world']);+ expect(holders).toEqual(['brain', 'dana', 'world']);});test('allow-list ["world"] (default-deny token) returns ONLY world holders', async () => {@@ -67,13 +67,13 @@ describe('per-token takes-holder allow-list — takes_list', () => {expect(takes[0].claim).toBe('CEO of Acme');});- test('allow-list ["world", "garry"] returns world + garry, hides brain hunches', async () => {+ test('allow-list ["world", "dana"] returns world + dana, hides brain hunches', async () => {const result = await dispatchToolCall(engine, 'takes_list', { page_slug: 'people/alice-example' }, {- remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'garry'],+ remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'dana'],});const takes = parseResult(result) as Array<{ holder: string }>;const holders = takes.map(t => t.holder).sort();- expect(holders).toEqual(['garry', 'world']);+ expect(holders).toEqual(['dana', 'world']);});test('allow-list with no overlap returns empty (no fallback to default)', async () => {@@ -99,8 +99,8 @@ describe('per-token takes-holder allow-list — takes_search', () => {remote: false,});const hits = parseResult(result) as Array<{ holder: string }>;- // 'Strong technical founder' (garry) should match- expect(hits.some(h => h.holder === 'garry')).toBe(true);+ // 'Strong technical founder' (dana) should match+ expect(hits.some(h => h.holder === 'dana')).toBe(true);});});@@ -121,7 +121,7 @@ describe('per-token takes-holder allow-list — get_page body channel', () => {'\n| # | claim | kind | who | weight | since | source |\n' +'|---|---|---|---|---|---|---|\n' +'| 1 | CEO of Widget | fact | world | 1.0 | 2017-01 | Crustdata |\n' +- '| 2 | Strong technical founder | take | garry | 0.85 | 2026-04-29 | OH |\n' ++ '| 2 | Strong technical founder | take | dana | 0.85 | 2026-04-29 | OH |\n' +'| 3 | Seemed burned out in last OH | hunch | brain | 0.4 | 2026-05-01 | private |\n\n' +`${TAKES_FENCE_END}\n` +'\nFooter content stays.\n';@@ -139,7 +139,7 @@ describe('per-token takes-holder allow-list — get_page body channel', () => {expect(page.compiled_truth).not.toContain(TAKES_FENCE_END);expect(page.compiled_truth).not.toContain('Strong technical founder');expect(page.compiled_truth).not.toContain('Seemed burned out');- expect(page.compiled_truth).not.toContain('| garry |');+ expect(page.compiled_truth).not.toContain('| dana |');expect(page.compiled_truth).not.toContain('| brain |');// Surrounding body kept intact.expect(page.compiled_truth).toContain('Footer content stays.');@@ -156,7 +156,7 @@ describe('per-token takes-holder allow-list — get_page body channel', () => {test('fuzzy resolution path also strips for remote token', async () => {const result = await dispatchToolCall(engine, 'get_page', { slug: 'people/bob-example', fuzzy: true }, {- remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'garry'],+ remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'dana'],});const page = parseResult(result) as { compiled_truth: string };// Allow-list does not yet re-render filtered rows; whole fence is stripped.@@ -209,7 +209,7 @@ describe('think op — read-only on remote callers (Lane D landed)', () => {// configured machine fires a real LLM call and the warning flips to// LLM_OUTPUT_NOT_JSON. runThink then returns gather-only + NO_ANTHROPIC_API_KEY.const result = await withoutAnthropicKey(() => dispatchToolCall(engine, 'think', { question: 'q', save: true, take: true }, {- remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'garry', 'brain'],+ remote: true, sourceId: 'default', takesHoldersAllowList: ['world', 'dana', 'brain'],}));const env = parseResult(result) as {remote_persisted_blocked: boolean;diff --git a/test/takes-resolution.test.ts b/test/takes-resolution.test.tsindex 5b8972492d..5773427e9f 100644--- a/test/takes-resolution.test.ts+++ b/test/takes-resolution.test.ts@@ -14,35 +14,35 @@ import { GBrainError } from '../src/core/types.ts';describe('deriveResolutionTuple', () => {test('quality=correct → (correct, true)', () => {- expect(deriveResolutionTuple({ quality: 'correct', resolvedBy: 'garry' })).toEqual({+ expect(deriveResolutionTuple({ quality: 'correct', resolvedBy: 'dana' })).toEqual({quality: 'correct',outcome: true,});});test('quality=incorrect → (incorrect, false)', () => {- expect(deriveResolutionTuple({ quality: 'incorrect', resolvedBy: 'garry' })).toEqual({+ expect(deriveResolutionTuple({ quality: 'incorrect', resolvedBy: 'dana' })).toEqual({quality: 'incorrect',outcome: false,});});test('quality=partial → (partial, null)', () => {- expect(deriveResolutionTuple({ quality: 'partial', resolvedBy: 'garry' })).toEqual({+ expect(deriveResolutionTuple({ quality: 'partial', resolvedBy: 'dana' })).toEqual({quality: 'partial',outcome: null,});});test('outcome=true (back-compat alias) → (correct, true)', () => {- expect(deriveResolutionTuple({ outcome: true, resolvedBy: 'garry' })).toEqual({+ expect(deriveResolutionTuple({ outcome: true, resolvedBy: 'dana' })).toEqual({quality: 'correct',outcome: true,});});test('outcome=false (back-compat alias) → (incorrect, false)', () => {- expect(deriveResolutionTuple({ outcome: false, resolvedBy: 'garry' })).toEqual({+ expect(deriveResolutionTuple({ outcome: false, resolvedBy: 'dana' })).toEqual({quality: 'incorrect',outcome: false,});@@ -50,7 +50,7 @@ describe('deriveResolutionTuple', () => {test('quality wins when both inputs supplied AND consistent', () => {// outcome=true is consistent with quality=correct; quality wins.- expect(deriveResolutionTuple({ quality: 'correct', outcome: true, resolvedBy: 'garry' })).toEqual({+ expect(deriveResolutionTuple({ quality: 'correct', outcome: true, resolvedBy: 'dana' })).toEqual({quality: 'correct',outcome: true,});@@ -58,22 +58,22 @@ describe('deriveResolutionTuple', () => {test('contradictory quality + outcome throws TAKE_RESOLUTION_INVALID', () => {expect(() =>- deriveResolutionTuple({ quality: 'correct', outcome: false, resolvedBy: 'garry' })+ deriveResolutionTuple({ quality: 'correct', outcome: false, resolvedBy: 'dana' })).toThrow(GBrainError);expect(() =>- deriveResolutionTuple({ quality: 'partial', outcome: true, resolvedBy: 'garry' })+ deriveResolutionTuple({ quality: 'partial', outcome: true, resolvedBy: 'dana' })).toThrow(GBrainError);});test('neither field set throws TAKE_RESOLUTION_INVALID', () => {expect(() =>- deriveResolutionTuple({ resolvedBy: 'garry' })+ deriveResolutionTuple({ resolvedBy: 'dana' })).toThrow(GBrainError);});// v0.36.1.1 R1-class: 'unresolvable' joins partial as null-outcome.test('R1: quality=unresolvable → (unresolvable, null)', () => {- expect(deriveResolutionTuple({ quality: 'unresolvable', resolvedBy: 'garry' })).toEqual({+ expect(deriveResolutionTuple({ quality: 'unresolvable', resolvedBy: 'dana' })).toEqual({quality: 'unresolvable',outcome: null,});@@ -84,10 +84,10 @@ describe('deriveResolutionTuple', () => {// before the schema CHECK fires. unresolvable requires null outcome —// same shape as partial.expect(() =>- deriveResolutionTuple({ quality: 'unresolvable', outcome: true, resolvedBy: 'garry' })+ deriveResolutionTuple({ quality: 'unresolvable', outcome: true, resolvedBy: 'dana' })).toThrow(GBrainError);expect(() =>- deriveResolutionTuple({ quality: 'unresolvable', outcome: false, resolvedBy: 'garry' })+ deriveResolutionTuple({ quality: 'unresolvable', outcome: false, resolvedBy: 'dana' })).toThrow(GBrainError);});});diff --git a/test/takes-source-scope.test.ts b/test/takes-source-scope.test.tsindex 9825eb5715..bc995774dc 100644--- a/test/takes-source-scope.test.ts+++ b/test/takes-source-scope.test.ts@@ -31,14 +31,14 @@ beforeAll(async () => {const pageB = await engine.putPage('people/b-ex', { title: 'B', type: 'person', compiled_truth: '## Takes\n' }, { sourceId: 'tenant-b' });await engine.addTakesBatch([- { page_id: pageA.id, row_num: 1, claim: 'Acme founder will raise a Series A', kind: 'bet', holder: 'garry', weight: 0.7 },+ { page_id: pageA.id, row_num: 1, claim: 'Acme founder will raise a Series A', kind: 'bet', holder: 'dana', weight: 0.7 },{ page_id: pageA.id, row_num: 2, claim: 'Acme founder went public', kind: 'bet', holder: 'world', weight: 0.6 },- { page_id: pageB.id, row_num: 1, claim: 'Beta founder will exit big', kind: 'bet', holder: 'garry', weight: 0.8 },+ { page_id: pageB.id, row_num: 1, claim: 'Beta founder will exit big', kind: 'bet', holder: 'dana', weight: 0.8 },]);// Resolve so the scorecard/curve aggregates have correct/incorrect rows.- await engine.resolveTake(pageA.id, 1, { quality: 'correct', resolvedBy: 'garry' });+ await engine.resolveTake(pageA.id, 1, { quality: 'correct', resolvedBy: 'dana' });await engine.resolveTake(pageA.id, 2, { quality: 'incorrect', resolvedBy: 'world' });- await engine.resolveTake(pageB.id, 1, { quality: 'correct', resolvedBy: 'garry' });+ await engine.resolveTake(pageB.id, 1, { quality: 'correct', resolvedBy: 'dana' });});afterAll(async () => {@@ -85,7 +85,7 @@ describe('getScorecard / getCalibrationCurve — EXISTS pages.source_id scope',});test('getScorecard source scope AND holder allow-list compose', async () => {- // tenant-a bets: garry(correct) + world(incorrect); allow-list world → 1 bet+ // tenant-a bets: dana(correct) + world(incorrect); allow-list world → 1 betexpect((await engine.getScorecard({ sourceIds: ['tenant-a'] }, ['world'])).total_bets).toBe(1);});diff --git a/test/takes-write-ops.test.ts b/test/takes-write-ops.test.tsindex 317c0930ea..b3c59cc4d9 100644--- a/test/takes-write-ops.test.ts+++ b/test/takes-write-ops.test.ts@@ -90,7 +90,7 @@ describe('takes_add', () => {test('holder fence: outside-allow-list holder denies with an explicit authority error', async () => {const res = await dispatchToolCall(engine, 'takes_add', {- slug: 'people/alice-example', claim: 'Private hunch', kind: 'hunch', holder: 'people/garry-example',+ slug: 'people/alice-example', claim: 'Private hunch', kind: 'hunch', holder: 'people/dana-example',}, { ...STDIO_WORLD });expect(res.isError).toBe(true);const body = parsed(res);@@ -117,7 +117,7 @@ describe('takes_add', () => {test('trusted local caller is unfenced', async () => {const res = await dispatchToolCall(engine, 'takes_add', {- slug: 'people/alice-example', claim: 'Owner-held view', kind: 'bet', holder: 'people/garry-example', weight: 0.8,+ slug: 'people/alice-example', claim: 'Owner-held view', kind: 'bet', holder: 'people/dana-example', weight: 0.8,}, { ...LOCAL });expect(parsed(res).row_num).toBe(2);});@@ -166,7 +166,7 @@ describe('takes_update + holder row fence', () => {});test('[CEO-F4] fenced row and missing row share the not_found shape (no existence leak)', async () => {- // Row 2 is holder people/garry-example — outside the world allow-list.+ // Row 2 is holder people/dana-example — outside the world allow-list.const fenced = await dispatchToolCall(engine, 'takes_update', {slug: 'people/alice-example', row_num: 2, weight: 0.1,}, { ...STDIO_WORLD });@@ -424,7 +424,7 @@ describe('takes-write adversarial regressions (F1 cross-holder / P1-2 containmenFENCE_HEADER,FENCE_SEP,'| 1 | Ships consensus fact | fact | world | 0.8 | 2026-01 | public |',- '| 2 | Private cross-holder finding | finding | people/garry-example | 0.6 | 2026-02 | owner note |',+ '| 2 | Private cross-holder finding | finding | people/dana-example | 0.6 | 2026-02 | owner note |',TAKES_FENCE_END,'',].join('\n'),@@ -451,7 +451,7 @@ describe('takes-write adversarial regressions (F1 cross-holder / P1-2 containmenconst onDisk = readFileSync(join(repo, `${F1_SLUG}.md`), 'utf-8');expect(onDisk).toContain('Private cross-holder finding');expect(onDisk).toContain('| finding |'); // the skipped row's kind cell intact- expect(onDisk).toContain('people/garry-example');+ expect(onDisk).toContain('people/dana-example');// And the valid row was NOT mutated (weight untouched).expect(onDisk).toContain('| 1 | Ships consensus fact | fact | world | 0.8 |');});