Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

W5: inferred closures are upper bounds and an explicit end replaces them; the legacy copier refuses a brain with page versions; since_supplied probe (passes on master, item dropped)

garrytana3450c3f646e
diff --git a/src/core/link-relationship-notes.ts b/src/core/link-relationship-notes.ts
index c5d1f28150..896dae9c78 100644
--- a/src/core/link-relationship-notes.ts
+++ b/src/core/link-relationship-notes.ts
@@ -4,7 +4,8 @@
* compiled context). One batched read of relationship state per call.
*
* "now: works_at widget-co (since 2025-03-01); ended: works_at acme-example
- * (2025-03-01)". Ended relationships the summary still names always appear
+ * (2025-03-01)"; "(by 2025-03-01)" when only the nightly check's inferred closure dates the end, an upper
+ * bound. Ended relationships the summary still names always appear
* (with a stale-summary warning); other ended ones are capped at the latest
* three. Only state relations (works_at, advises, …) take part, and a page
* with no ended relationship gets no note.
@@ -21,7 +22,7 @@ type RawExec = { executeRaw<R = Record<string, unknown>>(sql: string, params?: u
export interface NoteSubject { slug: string; source_id: string; summary?: string | null }
-interface NoteEdge { type: string; slug: string; title: string; status: RelationshipStatus | 'reference'; since: string | null; until: string | null }
+interface NoteEdge { type: string; slug: string; title: string; status: RelationshipStatus | 'reference'; since: string | null; until: string | null; untilUpperBound: boolean }
export const relationshipNoteKey = (sourceId: string, slug: string): string => `${sourceId}\u0000${slug}`;
@@ -39,7 +40,7 @@ function renderNote(summary: string, edges: NoteEdge[]): string | undefined {
const others = ended.filter(e => !named(e)).sort((a, b) => (b.until ?? '').localeCompare(a.until ?? '')).slice(0, NOTE_ENDED_CAP);
const parts = [
...(live.length ? [`now: ${live.map(e => `${e.type} ${short(e)}${e.since ? ` (since ${e.since})` : ''}`).join(', ')}`] : []),
- `ended: ${[...stale, ...others].map(e => `${e.type} ${short(e)} (${e.until ?? 'date unknown'})`).join(', ')}`,
+ `ended: ${[...stale, ...others].map(e => `${e.type} ${short(e)} (${e.until ? `${e.untilUpperBound ? 'by ' : ''}${e.until}` : 'date unknown'})`).join(', ')}`,
];
if (stale.length) parts.push(`summary may be stale: it still names ${stale.map(short).join(', ')}`);
return parts.join('; ');
@@ -58,8 +59,11 @@ export async function loadRelationshipNotes(
const notes = new Map<string, string>();
if (subjects.length === 0) return notes;
const privacy = opts.excludePrivate ? ` AND ${privatePagesFilterFragment('t')} AND ${privateLinkOriginFilterFragment('l')}` : '';
- const rows = await engine.executeRaw<{ from_slug: string; source_id: string; to_slug: string; to_title: string | null; link_type: string }>(
- `SELECT f.slug AS from_slug, f.source_id, t.slug AS to_slug, t.title AS to_title, l.link_type${TEMPORAL_LINK_SELECT_SQL}
+ const endBy = (producer: string) => `EXISTS (SELECT 1 FROM link_transitions x WHERE x.from_page_id = l.from_page_id AND x.to_page_id = l.to_page_id
+ AND x.link_type = l.link_type AND x.kind = 'end' AND x.occurred_on = lr_t.last_end AND x.producer ${producer})`;
+ const rows = await engine.executeRaw<{ from_slug: string; source_id: string; to_slug: string; to_title: string | null; link_type: string; last_end: string | null; end_upper_bound: boolean | null }>(
+ `SELECT f.slug AS from_slug, f.source_id, t.slug AS to_slug, t.title AS to_title, l.link_type, lr_t.last_end::text AS last_end,
+ (${endBy("= 'dream'")} AND NOT ${endBy("<> 'dream'")}) AS end_upper_bound${TEMPORAL_LINK_SELECT_SQL}
FROM links l
JOIN pages f ON f.id = l.from_page_id
JOIN pages t ON t.id = l.to_page_id
@@ -77,6 +81,7 @@ export async function loadRelationshipNotes(
edges.set(`${r.link_type}\u0000${r.to_slug}`, {
type: r.link_type, slug: r.to_slug, title: r.to_title ?? '', status: r.status,
since: last?.from ?? null, until: last?.until ?? null,
+ untilUpperBound: r.end_upper_bound === true && last?.until != null && last.until === String(r.last_end).slice(0, 10),
});
bySubject.set(key, edges);
}
diff --git a/src/core/link-validity.ts b/src/core/link-validity.ts
index 9f95f48ad5..ae13663620 100644
--- a/src/core/link-validity.ts
+++ b/src/core/link-validity.ts
@@ -152,6 +152,11 @@ export interface RelationshipState {
disputed: boolean;
/** Present-tense assertions that a later dated end overrides. */
staleAssertions: number;
+ /**
+ * The last end is an upper bound: only an inferred closure (producer `dream`, the nightly check's date arithmetic)
+ * dates it, so the relationship ended on or before `lastEnd`, not on it.
+ */
+ lastEndUpperBound: boolean;
}
/**
@@ -172,6 +177,8 @@ export interface RelationshipState {
* ended at an unknown date (no stints); undated present from another origin
* → disputed (kept live, flagged). With a dated start and no dated end, past
* assertions never close the stint: only a dated end does.
+ * 5. An inferred end (producer `dream`: the nightly check closed the stint on the date a conflicting
+ * relationship started) is an upper bound. An explicit end of the same stint replaces it, earlier or later.
* Event relations: [earliest dated occurrence, inf), or (-inf, inf) undated.
*/
export function buildRelationshipState(
@@ -181,21 +188,23 @@ export function buildRelationshipState(
): RelationshipState {
const undatedPresent = assertions.filter(a => a.tense === 'present').length;
const undatedPast = assertions.filter(a => a.tense === 'past').length;
- const events = dedupeEvents(transitions);
+ const events = semantics === 'state' ? withoutOverriddenInferredEnds(dedupeEvents(transitions)) : dedupeEvents(transitions);
const starts = events.filter(e => e.kind === 'start').map(e => e.date);
- const ends = events.filter(e => e.kind === 'end').map(e => e.date);
+ const ends = events.filter(e => e.kind === 'end');
+ const lastEnd = ends.at(-1) ?? null;
const base = {
semantics,
firstStart: starts[0] ?? null,
lastStart: starts.length ? starts[starts.length - 1] : null,
- lastEnd: ends.length ? ends[ends.length - 1] : null,
+ lastEnd: lastEnd?.date ?? null,
+ lastEndUpperBound: lastEnd?.inferred === true,
undatedPresent,
undatedPast,
};
if (semantics === 'event') {
const first = events.length ? events[0].date : null;
- return { ...base, stints: [{ from: first, until: null }], disputed: false, staleAssertions: 0 };
+ return { ...base, lastEndUpperBound: false, stints: [{ from: first, until: null }], disputed: false, staleAssertions: 0 };
}
if (events.length === 0) {
@@ -233,18 +242,31 @@ function pastFromOtherOrigin(assertions: readonly AssertionEvidence[]): boolean
return assertions.some(a => a.tense === 'past' && !presentOrigins.has(a.originPageId));
}
-function dedupeEvents(transitions: readonly TransitionEvidence[]): Array<{ kind: TransitionKind; date: string }> {
- const seen = new Set<string>();
- const out: Array<{ kind: TransitionKind; date: string }> = [];
+interface StateEvent { kind: TransitionKind; date: string; inferred: boolean }
+
+/** One event per (kind, date); an end is inferred only when every transition behind it is a `dream` closure. */
+function dedupeEvents(transitions: readonly TransitionEvidence[]): StateEvent[] {
+ const byKey = new Map<string, StateEvent>();
for (const t of transitions) {
const date = dateKey(t.occurredOn);
if (!date) continue;
const key = `${t.kind}:${date}`;
- if (seen.has(key)) continue;
- seen.add(key);
- out.push({ kind: t.kind, date });
+ const inferred = t.kind === 'end' && t.producer === 'dream';
+ const seen = byKey.get(key);
+ if (seen) seen.inferred &&= inferred;
+ else byKey.set(key, { kind: t.kind, date, inferred });
}
- return out.sort((a, b) => a.date < b.date ? -1 : a.date > b.date ? 1 : a.kind === b.kind ? 0 : a.kind === 'end' ? -1 : 1);
+ return [...byKey.values()].sort((a, b) => a.date < b.date ? -1 : a.date > b.date ? 1 : a.kind === b.kind ? 0 : a.kind === 'end' ? -1 : 1);
+}
+
+/**
+ * Drops an inferred end when an explicit end closes the same stint: the explicit date is when it ended, the inferred
+ * one only bounds it. A stint runs from a start to the next start (an implicit stint before the first start).
+ */
+function withoutOverriddenInferredEnds(events: StateEvent[]): StateEvent[] {
+ const stintOf = (date: string) => events.filter(e => e.kind === 'start' && e.date <= date).at(-1)?.date ?? null;
+ const explicit = new Set(events.filter(e => e.kind === 'end' && !e.inferred).map(e => stintOf(e.date)));
+ return events.filter(e => !(e.kind === 'end' && e.inferred && explicit.has(stintOf(e.date))));
}
/** Merge touching/overlapping stints and drop empty ones (until <= from). */
diff --git a/src/core/persistence/maintenance.ts b/src/core/persistence/maintenance.ts
index e73a81733b..c8e01f99ec 100644
--- a/src/core/persistence/maintenance.ts
+++ b/src/core/persistence/maintenance.ts
@@ -82,6 +82,7 @@ export async function assertLegacyEngineMigration(engine: SqlEngine, migration:
const [row] = await engine.executeRaw<{ present: boolean }>(`SELECT EXISTS(SELECT 1 FROM ${table}) AS present`);
if (row?.present) held.push(table);
}
+ if (!held.length && migration.side === 'source') await assertNoPageHistory(engine, migration);
if (!held.length) return;
const ledger = held.includes('belief_events') ? ' The belief ledger (belief_events) is recorded history no Markdown rebuild can recover.' : '';
const why = `The ${migration.side === 'source' ? 'brain' : 'target datastore'} has rows in ${held.join(', ')}, and the engine copier cannot carry request IDs, withdrawals, canonical ownership or the belief ledger.${ledger}`;
@@ -92,6 +93,22 @@ export async function assertLegacyEngineMigration(engine: SqlEngine, migration:
{ why, reason: 'persistence_history', docs: ENGINE_MIGRATION_DOCS, fix: engineMigrationFix(migration, why) });
}
+/**
+ * The legacy copier re-creates pages with new ids and copies no page versions, so a brain with versions would arrive
+ * without its page history. It refuses instead and names how many versions it would discard; graduation carries them.
+ */
+async function assertNoPageHistory(engine: SqlEngine, migration: EngineMigrationSide): Promise<void> {
+ const [row] = await engine.executeRaw<{ n: number | null }>(
+ "SELECT CASE WHEN to_regclass('page_versions') IS NULL THEN 0 ELSE (SELECT count(*)::int FROM page_versions) END AS n");
+ const versions = Number(row?.n ?? 0);
+ if (!versions) return;
+ const why = `The brain has ${versions} page version${versions === 1 ? '' : 's'} (the history get_versions and page-at-time reads), and the engine copier re-creates pages without them, so the copy would discard all ${versions}.`;
+ throw opError('writer_coordinator_required',
+ `Engine migration would discard ${versions} page version${versions === 1 ? '' : 's'}.`,
+ 'Keep this datastore; nothing changed. Ask the user how to proceed.',
+ { why, reason: 'page_history', docs: ENGINE_MIGRATION_DOCS, fix: engineMigrationFix(migration, why) });
+}
+
/** Legacy reinit may rename only after acquiring the stable sibling kernel lock. */
export async function backupUnmanagedPglite(dataDir: string, backupDir: string): Promise<void> {
assertManagedFilesystemWrite(dataDir);
diff --git a/test/belief-ledger-w5-time-model.test.ts b/test/belief-ledger-w5-time-model.test.ts
new file mode 100644
index 0000000000..b6fd78a042
--- /dev/null
+++ b/test/belief-ledger-w5-time-model.test.ts
@@ -0,0 +1,71 @@
+/**
+ * W5 time-model fixes (10x plan, wave 4a): an inferred closure is an upper bound and an explicit end replaces it,
+ * on PGLite and on Postgres when DATABASE_URL is set; and the `since_supplied` probe the plan required before any
+ * takes change (a late-captured take keeps its valid time, and an update without `since` keeps the stored one).
+ */
+import { describe, expect, test } from 'bun:test';
+import { loadRelationshipNotes, relationshipNoteKey } from '../src/core/link-relationship-notes.ts';
+import { testBackends } from './helpers/test-backends.ts';
+import { beliefBrain, beliefEngineCase, type BeliefBrain } from './helpers/belief-ledger.ts';
+import { PGLiteEngine } from '../src/core/pglite-engine.ts';
+import type { BrainEngine } from '../src/core/engine.ts';
+import { isolatedPersistencePostgres } from './helpers/persistence-postgres.ts';
+import { assertLegacyEngineMigration } from '../src/core/persistence/maintenance.ts';
+
+const person = (lines: string[]) => ['---', 'type: person', 'title: Alice Example', '---', 'Alice is CTO of Widget.', '', '## Timeline', '', ...lines, ''].join('\n');
+const JOINED_ACME = '- **2019-02-01** | linkedin — Joined [Acme](../companies/acme-example) as CTO';
+const JOINED_WIDGET = '- **2025-03-01** | linkedin — Joined [Widget](../companies/widget-co) as CTO';
+const INFERRED = '- **2025-03-01** | gbrain-dream (inferred) — Ended works_at [[companies/acme-example]] (superseded by works_at companies/widget-co)';
+const note = async (b: BeliefBrain) => (await loadRelationshipNotes(b.engine, [{ slug: 'people/alice-example', source_id: b.sourceId, summary: '' }], { excludePrivate: false }))
+ .get(relationshipNoteKey(b.sourceId, 'people/alice-example'));
+const takes = async (b: BeliefBrain, slug: string) => b.engine.executeRaw<{ row_num: number; since_date: string | null; weight: number }>(
+ 'SELECT t.row_num, t.since_date::text AS since_date, t.weight FROM takes t JOIN pages p ON p.id = t.page_id WHERE p.source_id = $1 AND p.slug = $2 ORDER BY t.row_num', [b.sourceId, slug]);
+
+for (const engineCase of testBackends().map(beliefEngineCase)) {
+ describe(`W5 time model (${engineCase.name})`, () => {
+ const brain = (run: (b: BeliefBrain) => Promise<void>) => beliefBrain(run, { managed: true, databaseUrl: engineCase.databaseUrl });
+
+ test('a closure only the nightly check dated reads as an upper bound; an explicit end on either side of it replaces it', () => brain(async b => {
+ await b.put('companies/acme-example', '---\ntype: company\ntitle: Acme\n---\nA company.\n');
+ await b.put('companies/widget-co', '---\ntype: company\ntitle: Widget\n---\nAnother company.\n');
+ await b.put('people/alice-example', person([JOINED_ACME, JOINED_WIDGET, INFERRED]));
+ expect(await note(b)).toContain('ended: works_at acme-example (by 2025-03-01)');
+ const [acme] = await b.engine.executeRaw<{ last_end: string }>(`SELECT lr.last_end::text AS last_end FROM link_relationships lr
+ JOIN pages t ON t.id = lr.to_page_id WHERE t.source_id = $1 AND t.slug = 'companies/acme-example' AND lr.scope = 'all'`, [b.sourceId]);
+ expect(acme!.last_end).toBe('2025-03-01');
+ // The gap: an explicit end before the next job dates it exactly.
+ await b.put('people/alice-example', person([JOINED_ACME, '- **2024-06-01** | linkedin — Left [Acme](../companies/acme-example)', JOINED_WIDGET, INFERRED]));
+ expect(await note(b)).toContain('ended: works_at acme-example (2024-06-01)');
+ // An explicit end after the inferred closure (a notice period) replaces it too; before W5 the earlier inferred date won.
+ await b.put('people/alice-example', person([JOINED_ACME, JOINED_WIDGET, INFERRED, '- **2025-06-01** | linkedin — Left [Acme](../companies/acme-example)']));
+ expect(await note(b)).toContain('ended: works_at acme-example (2025-06-01)');
+ }), 120_000);
+
+ test('the legacy engine copier refuses a brain whose page versions it would discard, and names how many', async () => {
+ let engine: BrainEngine; let close: () => Promise<void>;
+ if (engineCase.databaseUrl) ({ engine, close } = await isolatedPersistencePostgres(engineCase.databaseUrl));
+ else { const pglite = new PGLiteEngine(); await pglite.connect({}); await pglite.initSchema(); engine = pglite; close = () => pglite.disconnect(); }
+ try {
+ const side = { side: 'source' as const, from: engine.kind as 'pglite' | 'postgres', to: (engine.kind === 'pglite' ? 'postgres' : 'pglite') as 'pglite' | 'postgres' };
+ await assertLegacyEngineMigration(engine, side);
+ await engine.putPage('notes/history', { type: 'note', title: 'History', compiled_truth: 'first body' });
+ for (let i = 0; i < 3; i++) await engine.createVersion('notes/history');
+ await expect(assertLegacyEngineMigration(engine, side)).rejects.toMatchObject({
+ code: 'writer_coordinator_required', reason: 'page_history', message: 'Engine migration would discard 3 page versions.' });
+ } finally { await close(); }
+ }, 120_000);
+
+ test('since_supplied probe: a late-captured take keeps its valid time, and an update without since keeps the stored one', () => brain(async b => {
+ const slug = 'companies/acme-example';
+ await b.put(slug, '---\ntype: company\ntitle: Acme\n---\nA company.\n');
+ const added = await b.op('takes_add', { slug, claim: 'Acme will double revenue', kind: 'bet', holder: 'brain', weight: 0.6, since: '2020-05-01' });
+ expect(added).toMatchObject({ row_num: 1 });
+ expect(await takes(b, slug)).toEqual([{ row_num: 1, since_date: '2020-05-01', weight: 0.6 }]);
+ await b.op('takes_update', { slug, row_num: 1, weight: 0.8 });
+ expect(await takes(b, slug)).toEqual([{ row_num: 1, since_date: '2020-05-01', weight: 0.8 }]);
+ const today = new Date().toISOString().slice(0, 10);
+ await b.op('takes_add', { slug, claim: 'Acme will hire a CFO', kind: 'bet', holder: 'brain', weight: 0.5 });
+ expect((await takes(b, slug))[1]).toMatchObject({ row_num: 2, since_date: today });
+ }), 120_000);
+ });
+}
diff --git a/test/engine-migration-refusal.test.ts b/test/engine-migration-refusal.test.ts
index 0cf7696800..b15712b0bf 100644
--- a/test/engine-migration-refusal.test.ts
+++ b/test/engine-migration-refusal.test.ts
@@ -88,6 +88,37 @@ describe('history refusal names the refusing side', () => {
});
});
+describe('page history refusal', () => {
+ let bare: PGLiteEngine;
+ beforeAll(async () => {
+ bare = new PGLiteEngine();
+ await bare.connect({});
+ await bare.initSchema();
+ }, 120_000);
+ afterAll(async () => { await bare.disconnect(); });
+
+ test('a brain with no journal but with page versions is refused, naming how many versions the copy would discard', async () => {
+ await assertLegacyEngineMigration(bare, { side: 'source', from: 'pglite', to: 'postgres' });
+ await bare.putPage('notes/history', { type: 'note', title: 'History', compiled_truth: 'first body' });
+ const page = (await bare.getPage('notes/history'))!;
+ await bare.createVersion('notes/history');
+ await bare.createVersion('notes/history');
+ expect(Number((await bare.executeRaw<{ n: number }>('SELECT count(*)::int AS n FROM page_versions WHERE page_id = $1', [page.id]))[0]!.n)).toBe(2);
+ const e = await refusal(() => assertLegacyEngineMigration(bare, { side: 'source', from: 'pglite', to: 'postgres' }));
+ expect(e.code).toBe('writer_coordinator_required');
+ expect(e.reason).toBe('page_history');
+ expect(e.message).toBe('Engine migration would discard 2 page versions.');
+ expect(e.why).toContain('copy would discard all 2');
+ expect(envelope(e, cli).fix).toMatchObject({ next: 'ask_user', verify: { argv: expect.arrayContaining(VERIFY) } });
+ const e2 = await refusal(() => runMigrateEngine(bare, ['--to', 'postgres', '--url', 'postgresql://user@localhost:1/never']));
+ expect(e2.reason).toBe('page_history');
+ });
+
+ test('the target side is not refused for versions (an empty target is checked by the journal tables)', async () => {
+ await assertLegacyEngineMigration(bare, { side: 'target', from: 'pglite', to: 'postgres' });
+ });
+});
+
describe('managed-brain refusal', () => {
beforeAll(async () => { await engine.executeRaw('UPDATE persistence_brain SET enabled = true WHERE singleton = 1'); });
afterAll(async () => { await engine.executeRaw('UPDATE persistence_brain SET enabled = false WHERE singleton = 1'); });
diff --git a/test/link-validity.test.ts b/test/link-validity.test.ts
index 6d0bf7952a..46f0df7fc6 100644
--- a/test/link-validity.test.ts
+++ b/test/link-validity.test.ts
@@ -12,6 +12,7 @@ import {
const start = (d: string, origin: number | null = 1): TransitionEvidence => ({ kind: 'start', occurredOn: d, producer: 'timeline', originPageId: origin });
const end = (d: string, origin: number | null = 1): TransitionEvidence => ({ kind: 'end', occurredOn: d, producer: 'timeline', originPageId: origin });
+const inferredEnd = (d: string): TransitionEvidence => ({ kind: 'end', occurredOn: d, producer: 'dream', originPageId: 1 });
const present = (origin = 1): AssertionEvidence => ({ tense: 'present', originPageId: origin });
const past = (origin = 1): AssertionEvidence => ({ tense: 'past', originPageId: origin });
@@ -113,6 +114,39 @@ describe('buildRelationshipState — state relations', () => {
});
});
+describe('buildRelationshipState — inferred closures are upper bounds (W5)', () => {
+ test('a stint closed only by the nightly check ends by that date, an upper bound', () => {
+ const s = buildRelationshipState('state', [present()], [start('2019-02-01'), inferredEnd('2025-03-01')]);
+ expect(s.stints).toEqual([{ from: '2019-02-01', until: '2025-03-01' }]);
+ expect(s).toMatchObject({ lastEnd: '2025-03-01', lastEndUpperBound: true });
+ });
+
+ test('an explicit end closes the stint at the gap, earlier than the inferred closure', () => {
+ const s = buildRelationshipState('state', [present()], [start('2019-02-01'), end('2024-06-01'), inferredEnd('2025-03-01')]);
+ expect(s.stints).toEqual([{ from: '2019-02-01', until: '2024-06-01' }]);
+ expect(s).toMatchObject({ lastEnd: '2024-06-01', lastEndUpperBound: false });
+ });
+
+ test('an explicit end later than the inferred closure replaces it (the inferred date only bounded it)', () => {
+ const s = buildRelationshipState('state', [present()], [start('2019-02-01'), inferredEnd('2025-03-01'), end('2025-06-01')]);
+ expect(s.stints).toEqual([{ from: '2019-02-01', until: '2025-06-01' }]);
+ expect(s).toMatchObject({ lastEnd: '2025-06-01', lastEndUpperBound: false });
+ });
+
+ test('an explicit end of another stint does not override the inferred closure of this one; same-date evidence is exact', () => {
+ const s = buildRelationshipState('state', [], [start('2015-01-01'), end('2018-06-01'), start('2021-02-01'), inferredEnd('2025-03-01')]);
+ expect(s.stints).toEqual([{ from: '2015-01-01', until: '2018-06-01' }, { from: '2021-02-01', until: '2025-03-01' }]);
+ expect(s.lastEndUpperBound).toBe(true);
+ expect(buildRelationshipState('state', [], [start('2019-02-01'), inferredEnd('2025-03-01'), end('2025-03-01')]).lastEndUpperBound).toBe(false);
+ });
+
+ test('order invariance holds with inferred and explicit ends mixed', () => {
+ const ev = [start('2019-02-01'), inferredEnd('2025-03-01'), end('2025-06-01', 2), start('2026-01-01')];
+ const baseline = JSON.stringify(buildRelationshipState('state', [], ev));
+ for (const p of [ev, [...ev].reverse(), [ev[2]!, ev[0]!, ev[3]!, ev[1]!]]) expect(JSON.stringify(buildRelationshipState('state', [], p))).toBe(baseline);
+ });
+});
+
describe('buildRelationshipState — event relations', () => {
test('events never end and are invisible before their date', () => {
const s = buildRelationshipState('event', [present()], [start('2019-03-01'), end('2024-01-01')]);