Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(facts): facts that open with a log word now link to the one entity they name
garrytan2b5257a5ffa9
diff --git a/src/core/facts/subject-infer.ts b/src/core/facts/subject-infer.tsindex 07a16b599f..46057d86da 100644--- a/src/core/facts/subject-infer.ts+++ b/src/core/facts/subject-infer.ts@@ -105,13 +105,14 @@ const SENTENCE_OPENERS = new Set(['not', 'no', 'yes', 'after', 'before', 'during', 'since', 'until', 'while', 'per', 'via', 're', 'fyi', 'update', 'updated','lunch', 'dinner', 'breakfast', 'coffee', 'drinks', 'call', 'sync', 'standup', 'interview', 'demo', 'pitch', 'board','favorite', 'favourite', 'birthday', 'anniversary', 'allergic', 'vegetarian', 'vegan', 'lives', 'lived', 'works', 'worked',+ 'captured', 'watched', 'reviewed', 'logged',]);/**- * #7405: record-label openers ("Invoice total ...", "Work session ..."). Like SENTENCE_OPENERS they are no name evidence+ * #7405: record-label openers ("Invoice total ...", "Work session ...", "Notes from ..."). Like SENTENCE_OPENERS they are no name evidence* when they open a sentence and resolve to no page, but they are never shed from a candidate, so "Work Example" stays a name.*/-const LABEL_OPENERS = new Set(['work', 'invoice', 'invoiced', 'billed', 'receipt', 'payment']);+const LABEL_OPENERS = new Set(['work', 'invoice', 'invoiced', 'billed', 'receipt', 'payment', 'notes', 'capture', 'log', 'review', 'watch']);/** #7405: ISO 4217 codes; one counts as a unit (not a name) only where every use sits next to an amount ("CHF 80", "80 CHF"). */const CURRENCY_CODES = new Set(Intl.supportedValuesOf('currency'));diff --git a/test/facts-subject-infer.test.ts b/test/facts-subject-infer.test.tsindex eddc1eae6d..5cb3ca9124 100644--- a/test/facts-subject-infer.test.ts+++ b/test/facts-subject-infer.test.ts@@ -172,6 +172,25 @@ describe('inferFactSubject reasons', () => {});});+describe('capture-stream openers (#8656)', () => {+ const cases: Case[] = [+ { fact: 'Notes from the Acme Example call', expect: 'companies/acme-example' },+ { fact: 'Watched the Acme Example demo with the team', expect: 'companies/acme-example' },+ { fact: 'Captured Acme Example pricing for the renewal', expect: 'companies/acme-example' },+ { fact: 'Logged a call with Alice Example about hiring', expect: 'people/alice-example' },+ { fact: "Reviewed Alice Example's proposal", expect: 'people/alice-example' },+ { fact: 'Review of the Acme Example contract', expect: 'companies/acme-example' },+ { fact: 'Notes Example joined Acme Example', expect: null },+ ];+ for (const c of cases) {+ test(`${c.fact} -> ${c.expect}`, async () => {+ for (const mode of ['write', 'relink'] as const) {+ expect((await inferFactSubject(engine, 'default', { fact: c.fact, mode })).slug).toBe(c.expect);+ }+ });+ }+});+describe('literal Unicode subject slugs (#6620)', () => {for (const mode of ['write', 'relink'] as const) {test(`${mode}: resolves complete Unicode paths at punctuation boundaries`, async () => {