Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

typing unit U1 (dev rework): an adviser phrase on another entry is not this link's

garrytan61934b561708
diff --git a/src/core/link-typing-units.ts b/src/core/link-typing-units.ts
index 0005c3f487..b735b716f1 100644
--- a/src/core/link-typing-units.ts
+++ b/src/core/link-typing-units.ts
@@ -138,6 +138,7 @@ export function unitVerbVeto(v: VetoInput): string | null {
if (v.rule.verb === 'advises' && typingUnitEnabled('U1')) {
if (U1_NEGATED_BEFORE.test(v.context.slice(Math.max(0, v.start - 40), v.start))) return 'unit.u1.negated';
if (v.rule.id === 'unit.u1.adviser' && thirdPartyBefore(v.context, v.start)) return 'unit.u1.third_party';
+ if (v.rule.id === 'unit.u1.adviser' && !sameClauseAsLink(v)) return 'unit.u1.other_entry';
}
if (typingUnitEnabled('U3')) {
if (v.rule.id === 'verb.invested_in.board_seat' && !v.investorPrior?.()
diff --git a/test/helpers/typing-unit-examples.ts b/test/helpers/typing-unit-examples.ts
index 72e6d404f8..e342483266 100644
--- a/test/helpers/typing-unit-examples.ts
+++ b/test/helpers/typing-unit-examples.ts
@@ -86,6 +86,11 @@ const U1: TypingExample[] = [
off: { types: ['mentions'] }, on: { types: ['mentions'] } },
{ id: 'u1-third-party-friend-advising', unit: 'U1', target: ACME, content: page(`Alice introduced a friend who is now advising ${L(ACME)}.`),
off: { types: ['mentions'] }, on: { types: ['mentions'] } },
+ // An adviser phrase on the next timeline entry, whose own link the 240-character window cuts off, is not this link's.
+ { id: 'u1-next-entry-adviser-not-borrowed', unit: 'U1', target: ACME,
+ content: page(`Alice signed on with ${L(ACME)} as product manager and remains on the team. She also works at ${L(BETA)}.`,
+ [`**2014-11-27** | linkedin — Signed on with ${L(ACME)} as product manager (EU platform)`, `**2023-03-27** | note — Signed on as an adviser to ${L(BETA)}`]),
+ off: { types: ['mentions'] }, on: { types: ['mentions'] } },
{ id: 'u1-concurrent-role', unit: 'U1', target: ACME, content: page(`Alice works at ${L(BETA)} and is an adviser to ${L(ACME)}.`),
off: { types: ['mentions'] }, on: { types: ['advises'] } },
{ id: 'u1-concurrent-role-employer-kept', unit: null, target: BETA, content: page(`Alice works at ${L(BETA)} and is an adviser to ${L(ACME)}.`),