Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(content-repair): rename a sentinel constant gitleaks read as a key; record the history-only fingerprints
garrytanfdf4cc16ddd1
diff --git a/.gitleaksignore b/.gitleaksignoreindex c360d2dbde..69dbb9d5a4 100644--- a/.gitleaksignore+++ b/.gitleaksignore@@ -21,3 +21,8 @@ ee280a34288d697285fd41c35d423e49b61fe54d:CHANGELOG.md:sourcegraph-access-token:17530e1d4a813209c1033f9fe2a1349b2610c2357:TODOS.md:sourcegraph-access-token:3917530e1d4a813209c1033f9fe2a1349b2610c2357:TODOS.md:sourcegraph-access-token:23237530e1d4a813209c1033f9fe2a1349b2610c2357:CHANGELOG.md:sourcegraph-access-token:11+# #6377 content-repair lane (GBRA-72): a test constant named SECRET holding a synthetic sentinel sentence in+# test/content-repair-judgment.test.ts and test/repair-slug-conflicts.test.ts (commit ac6e0868) read as generic-api-key;+# the tree renamed the constant. These history-only fingerprints are not secrets.+ac6e0868219439a6594d9fce0e016da203c6c4fc:test/content-repair-judgment.test.ts:generic-api-key:21+ac6e0868219439a6594d9fce0e016da203c6c4fc:test/repair-slug-conflicts.test.ts:generic-api-key:58diff --git a/test/content-repair-judgment.test.ts b/test/content-repair-judgment.test.tsindex e47219f344..d022eaf952 100644--- a/test/content-repair-judgment.test.ts+++ b/test/content-repair-judgment.test.ts@@ -18,7 +18,7 @@ import type { ChatResult } from '../src/core/ai/gateway.ts';import { buildJudgmentPrompt, JUDGMENT_HEAD_LINES, JUDGMENT_MAX_MENTIONS, JUDGMENT_PROMPT_VERSION, judgmentParticipant, parseJudgmentAnswer, parseJudgmentText,type JudgmentInput } from '../src/core/content-repair/judgment.ts';-const SECRET = 'Sentinelbodyqx9 lives elsewhere';+const SENTINEL_BODY = 'Sentinelbodyqx9 lives elsewhere';const result = (text: string, stopReason: ChatResult['stopReason'] = 'end'): ChatResult => ({ text, blocks: [], stopReason, usage: { input_tokens: 10, output_tokens: 5, cache_read_tokens: 0, cache_creation_tokens: 0 },model: 'anthropic:claude-opus-5-5', providerId: 'anthropic' });@@ -69,7 +69,7 @@ describe('buildJudgmentPrompt', () => {expect(user).toContain('later lines mentioning the other slug:');expect(user).toContain('The newer file people/alice-example-2 repeats this page.');expect(user).not.toContain('Line 65 of filler.');- expect(user).not.toContain(SECRET);+ expect(user).not.toContain(SENTINEL_BODY);expect(JUDGMENT_PROMPT_VERSION).toBe(1);});diff --git a/test/repair-slug-conflicts.test.ts b/test/repair-slug-conflicts.test.tsindex 36f445a18f..7c55ea0444 100644--- a/test/repair-slug-conflicts.test.ts+++ b/test/repair-slug-conflicts.test.ts@@ -55,7 +55,7 @@ const commit = (root: string, message = 'content') => { git(root, 'add', '-A');const quiet = { info() {}, warn() {}, error() {} };// Body text that must never leave a file through a hold, a receipt, a result field or a commit message.-const SECRET = 'Sentinelbodyzr9 moved to Lisbon';+const SENTINEL_BODY = 'Sentinelbodyzr9 moved to Lisbon';const WHY = 'Both describe the same synthetic founder.';const page = (title: string, type: string, body: string, extra = '') => `---\ntitle: ${title}\ntype: ${type}\n${extra}---\n${body}\n`;const answer = (text: string, stop: ChatResult['stopReason'] = 'end'): ChatResult => ({ text, blocks: [], stopReason: stop,@@ -130,7 +130,7 @@ test('deterministic tier: a stray slug (no page, no file) and a slug naming a paconst s = await managed({'companies/acme-example.md': page('Acme Widgets', 'company', 'A synthetic company.'),'people/carol-example.md': page('Carol Example', 'person', 'A synthetic person.'),- 'notes/stray.md': page('Stray Note', 'note', `A note from a template. ${SECRET}`, 'slug: notes/nowhere-at-all\n'),+ 'notes/stray.md': page('Stray Note', 'note', `A note from a template. ${SENTINEL_BODY}`, 'slug: notes/nowhere-at-all\n'),'people/bob-example.md': page('Bob Example', 'person', 'A synthetic person who works at the company.', 'slug: companies/acme-example\n'),});expect((await s.sync()).held_count).toBe(2);@@ -155,7 +155,7 @@ test('deterministic tier: a stray slug (no page, no file) and a slug naming a paconst applied = await s.run({ apply: true, expect: hashOf(preview) });expect(applied).toMatchObject({ mode: 'apply', applied: 2, repaired: 2, outcomes: { repaired: 2 } });expect(calls).toHaveLength(0);- expect(s.read('notes/stray.md')).toBe(page('Stray Note', 'note', `A note from a template. ${SECRET}`));+ expect(s.read('notes/stray.md')).toBe(page('Stray Note', 'note', `A note from a template. ${SENTINEL_BODY}`));expect(s.read('people/bob-example.md')).not.toContain('slug:');expect((await engine.getPage('people/bob-example', { sourceId: s.id }))?.compiled_truth).toContain('works at the company');const holds = await s.holds();@@ -178,7 +178,7 @@ test('deterministic tier: a stray slug (no page, no file) and a slug naming a patest('model tier: a duplicate pair is judged at apply time; merge_into writes nothing and names the canonical for a person; the memo spends nothing twice; remove_slug applies through the coordinated path', () => each(async () => {const s = await managed({'people/alice-example.md': page('Alice Example', 'person', 'A synthetic founder, first met in 2024.'),- 'people/alice-example-2.md': page('Alice Example', 'person', `A synthetic founder. Possible duplicate of people/alice-example. ${SECRET}`, 'slug: people/alice-example\n'),+ 'people/alice-example-2.md': page('Alice Example', 'person', `A synthetic founder. Possible duplicate of people/alice-example. ${SENTINEL_BODY}`, 'slug: people/alice-example\n'),'people/dan-example.md': page('Dan Example', 'person', 'A synthetic engineer.'),'people/dan-other.md': page('Dan Other Example', 'person', 'A different synthetic person.', 'slug: people/dan-example\n'),});