Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(graph): an advisory, board or investor role is not an employment start
garrytan0b3027972978
diff --git a/docs/eval/decisions/p5-delta-2026-10-05/preregistration.md b/docs/eval/decisions/p5-delta-2026-10-05/preregistration.mdindex ea860f59e5..72be6b3dd2 100644--- a/docs/eval/decisions/p5-delta-2026-10-05/preregistration.md+++ b/docs/eval/decisions/p5-delta-2026-10-05/preregistration.md@@ -11,6 +11,7 @@ it. Sealed runs are executed by the custodian only; the custodian pins the delta|---|---|---|---|| Validity ranges on typed relation lines stored as dated edge transitions (producer `inline`, `src/core/link-effective.ts`) | `line_grammar.effective_ranges` | on | off (ships off) || Wanted rows recorded on the remote `put_page` write path (link-effect hook) | added with the hook; ships off | on | off |+| Temporal-evidence lexicon: an advisory, board or investor role ("Took an advisory role with [X]") is not an employment start (`NOT_EMPLOYMENT_ROLE` guard on `EMPLOYMENT.start` in `src/core/link-temporal-evidence.ts`) | none (evidence derivation) | kept | reverted before landing || Link typing changes made when the edge-validity schema merged: the verb is read at the link's own position in the window; links joined only by commas or conjunctions share the verb before the first; a `mentions` edge to a target the page also links with a typed edge is dropped | none (extraction behavior) | kept | reverted to the frozen build's typing before landing |## Hypotheses, metrics and bars@@ -30,6 +31,12 @@ appear. Bars: recall ≥ 0.95, within 0.02 of the local arm, non-entity noise 0world-v1 seeds (not 1–3) and the temporal-edges held-out set. Metrics: `anyTypeMatch` per gold edge and live-relationship accuracy. Bars: noninferior at tolerance 0.01 on both.+**H10, temporal-evidence lexicon.** The edge-validity plan's temporal-edges held-out set C (custodian mode), run as a+noninferiority guard on every gate that plan preregistered, plus the retrieval-feedback plan's E5 wrong-closure probe+(pages with one long employment stint and a later dated "Took an advisory role with [X]" line on a page that also+asserts works_at to X). Arms: the delta build vs the same build with the guard removed. Bars: 0 wrong closures on the+E5 probe (exact); every edge-validity gate noninferior at tolerance 0.01. Run by the custodian (P0).+Guardrails: LongMemEval-S `recall_all@5` noninferior (tolerance 0.01); N4 resolver no new wrong merge (exact).## Dev disclosures@@ -46,6 +53,8 @@ hides the edge from default reads and `as_of` finds it.for `line_grammar.effective_ranges` on category runners (they take `search.*` pins only today).2. H8: H4's sequential-write runner with an HTTP-transport arm.3. H9: a type-accuracy runner that imports an overlay build's extractor (`--gbrain`) and writes receipt rows.+4. H10: the temporal-edges set C runner in custodian mode with every edge-validity gate, the E5 wrong-closure probe,+ and a no-guard arm (the delta build with `NOT_EMPLOYMENT_ROLE` removed).## Budgetdiff --git a/src/core/link-temporal-evidence.ts b/src/core/link-temporal-evidence.tsindex 4029bd42d4..2c90bd6276 100644--- a/src/core/link-temporal-evidence.ts+++ b/src/core/link-temporal-evidence.ts@@ -65,11 +65,13 @@ const ROLE = String.raw`(?:[\w&./-]+\s+){0,4}?`;const NOT_PAST_ROLE = String.raw`(?!(?:promoted|hired|named|appointed|made|elected|brought|recently|just|newly|now|still|currently)\b)`;/** Present perfect ("has worked at", "have spent years at") describes a job that is still going. */const NOT_PERFECT = String.raw`(?<!\b(?:has|have|'s|’s)\s+(?:\w+\s+)?)`;+/** Advisory, board and investor roles ("took an advisory role with") are not jobs. */+const NOT_EMPLOYMENT_ROLE = String.raw`(?!(?:\w+\s+){0,1}?(?:advis\w*|board|investor|investing|investment|angel|observer)\b)`;const OWNED = String.raw`(?:(?:her|his|their|my|the)\s+)?(?:time|stint|tenure|role|job|run)\s+`;const EMPLOYMENT = {end: new RegExp(String.raw`\b(?:left|leaving|departed(?:\s+from)?|quit|resigned(?:\s+as\s+${ROLE})?(?:\s+from|\s+at)?|stepped\s+down(?:\s+as\s+${ROLE})?(?:\s+from|\s+at)?|stepped\s+away\s+from|moved\s+on\s+from|(?:moved|switched|transitioned|jumped)\s+(?:over\s+|out\s+)?from|(?:was\s+)?laid\s+off\s+(?:from|by|at)|(?:was\s+)?let\s+go\s+(?:from|by)|(?:was\s+)?fired\s+(?:from|by)|no\s+longer\s+(?:at|with|works\s+at|working\s+at)|exited|parted\s+ways\s+with|retired\s+from|(?:wrapped\s+up|finished|ended|concluded)\s+(?:${OWNED})?(?:at|with)|last\s+day\s+at|departure\s+from)\s*$`, 'i'),- start: new RegExp(String.raw`\b(?:(?:re-?)?join(?:ed|s|ing)?(?:\s+${ROLE}(?:at|as))?|(?:was\s+)?hired\s+(?:by|at|as\s+${ROLE}at)|started\s+(?:at|with|working\s+(?:at|for)|(?:a\s+)?new\s+(?:role|job|position)\s+at)|became\s+${ROLE}(?:at|of)|promoted\s+to\s+${ROLE}(?:at|of)|signed\s+on\s+(?:at|with)|named\s+${ROLE}(?:at|of)|accepted\s+(?:an?\s+)?(?:offer|role|position|job)\s+(?:at|with|from)|took\s+(?:an?\s+|the\s+)?(?:\w+\s+){0,2}?(?:role|job|position)\s+(?:at|with)|came\s+(?:on\s+board|aboard)\s+(?:at|with)|went\s+to\s+work\s+(?:at|for)|returned\s+to)\s*$`, 'i'),+ start: new RegExp(String.raw`\b(?:(?:re-?)?join(?:ed|s|ing)?(?:\s+${ROLE}(?:at|as))?|(?:was\s+)?hired\s+(?:by|at|as\s+${ROLE}at)|started\s+(?:at|with|working\s+(?:at|for)|(?:a\s+)?new\s+(?:role|job|position)\s+at)|became\s+${ROLE}(?:at|of)|promoted\s+to\s+${ROLE}(?:at|of)|signed\s+on\s+(?:at|with)|named\s+${ROLE}(?:at|of)|accepted\s+(?:an?\s+)?(?:offer|role|position|job)\s+(?:at|with|from)|took\s+(?:an?\s+|the\s+)?${NOT_EMPLOYMENT_ROLE}(?:\w+\s+){0,2}?(?:role|job|position)\s+(?:at|with)|came\s+(?:on\s+board|aboard)\s+(?:at|with)|went\s+to\s+work\s+(?:at|for)|returned\s+to)\s*$`, 'i'),past: new RegExp(String.raw`\b(?:previously(?:\s+worked)?\s+(?:at|with|for)|formerly(?:\s+${ROLE})?\s*(?:at|of|with)|former\s+${ROLE}(?:at|of|with)|ex-[\w-]+\s+(?:at|of)|used\s+to\s+work\s+(?:at|for)|${NOT_PERFECT}worked\s+(?:at|for|with)|${NOT_PERFECT}spent\s+(?:[\w-]+\s+){1,4}?(?:at|with)|(?:his|her|their|my)\s+(?:time|stint|tenure)\s+at|stint\s+at|was\s+${NOT_PAST_ROLE}${ROLE}(?:at|of)|alum(?:nus|na|ni)?\s+of)\s*$`, 'i'),};diff --git a/test/link-temporal-evidence.test.ts b/test/link-temporal-evidence.test.tsindex 2d91b33d95..e6e82fd0dd 100644--- a/test/link-temporal-evidence.test.ts+++ b/test/link-temporal-evidence.test.ts@@ -34,6 +34,23 @@ describe('dated timeline cues', () => {expect(brief(ev.transitions)).toEqual(['acme-example:advises:end:2024-06-01:timeline']);});+ test('an advisory, board or investor role is not an employment start (one long stint stays one stint)', () => {+ const rows = [row('companies/acme-example', 'works_at'), row('companies/acme-example', 'advises')];+ const timeline = [+ '- **2015-01-05** | linkedin — Joined [Acme](companies/acme-example)',+ '- **2023-09-01** | linkedin — Took an advisory role with [Acme](companies/acme-example)',+ '- **2024-02-01** | note — took a board observer role at [Acme](companies/acme-example)',+ '- **2024-05-01** | note — took an investor role with [Acme](companies/acme-example)',+ ].join('\n');+ expect(brief(derive('Alice works at [Acme](companies/acme-example).', timeline, rows).transitions).filter(t => t.includes(':works_at:')))+ .toEqual(['acme-example:works_at:start:2015-01-05:timeline']);+ });++ test('taking an ordinary role is still an employment start', () => {+ const ev = derive('', '- **2024-06-01** | note — took the CTO role at [Acme](companies/acme-example)', [row('companies/acme-example', 'works_at')]);+ expect(brief(ev.transitions)).toEqual(['acme-example:works_at:start:2024-06-01:timeline']);+ });+test('a meeting with a former employer is not a start', () => {const ev = derive('', '- **2026-01-10** | cal — Coffee with the [Acme](companies/acme-example) team', [row('companies/acme-example', 'works_at')]);expect(ev.transitions).toEqual([]);