Skip to content

fix(extract-timeline-from-meetings): bump pages.updated_at for touched entities#2500

Open
pablofavre12 wants to merge 3 commits into
garrytan:masterfrom
pablofavre12:fix/update-pages-updated-at-from-meetings
Open

fix(extract-timeline-from-meetings): bump pages.updated_at for touched entities#2500
pablofavre12 wants to merge 3 commits into
garrytan:masterfrom
pablofavre12:fix/update-pages-updated-at-from-meetings

Conversation

@pablofavre12

Copy link
Copy Markdown

When projecting timeline entries from meetings onto entity pages (attendees and body mentions), the entity pages get new timeline_entries but their pages.updated_at is left behind. This causes get_health to report them as stale.

Bump updated_at on every touched entity page after the batch insert so the health metric stays honest.

pablofavre12 and others added 3 commits June 22, 2026 20:47
…ine backfill (#4)

* fix(health): timeline_coverage_score tracks entity coverage, not whole-brain density

The brain_score timeline component divided (pages with any timeline entry)
by (ALL pages), so a brain whose entity pages were fully covered still
scored ~1/15 once it accumulated leaf docs that never get a timeline by
design. The displayed `timeline_coverage` is entity-scoped (person/company),
but the score came from an unrelated whole-brain density: a brain showing
timeline_coverage 0.92 scored 1/15; one at 0.67 scored 2/15 (more coverage,
lower score).

Score now derives from the entity-scoped timeline_coverage it already
displays, in both engines (pglite + postgres, kept in lockstep). Drops the
now-unused pages_with_timeline query column. Adds a regression test that
seeds full entity coverage amid many timeline-less leaf docs and asserts the
score follows the entity fraction (15), not the deflated density (~1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(timeline): apply_timeline_baseline — creation-date backfill lifts coverage

The contradiction-probe timeline writer only materializes entries for pages
with a detectable temporal contradiction — a minority — so timeline_coverage
plateaus well below 1 even on a well-maintained brain (a brain sat at 0.67
with no path to improve). This adds an opt-in, idempotent baseline pass: for
every entity page (person/company) with no timeline yet, write one "Page
created" entry dated at the page's earliest known instant (first
page_versions snapshot, else created_at), sourced 'baseline' so synthetic
rows stay distinguishable from substantive ones.

- New Engine.applyTimelineBaseline(opts?) in both engines (pglite + postgres,
  lockstep), idempotent via the (page_id, date, summary, source) dedup index
  plus a NOT EXISTS guard; source-scoped when a sourceId is given.
- New `apply_timeline_baseline` op: scope=write, localOnly (host/CLI
  maintenance surface, like reindex/extract — sidesteps remote cross-source
  trust). Threads ctx.sourceId.
- Direct INSERT carries the system-of-record allow comment.
- Tests: entity-only scoping, idempotency, source filter, coverage lift.

Pairs with the timeline_coverage_score fix: score now honest AND reachable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…_baseline (#5)

Version-stamp release for the timeline-coverage work merged in #4 (eb64a2c):
- fix(health): timeline_coverage_score derives from entity-scoped coverage
- feat(timeline): apply_timeline_baseline opt-in creation-date backfill

VERSION + package.json → 0.42.49.0, CHANGELOG entry, lockfile refreshed.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@time-attack time-attack added the low-value Low signal: conflicts, no CI, noise — not Wave 1 label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

low-value Low signal: conflicts, no CI, noise — not Wave 1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants