fix(extract-timeline-from-meetings): bump pages.updated_at for touched entities#2500
Open
pablofavre12 wants to merge 3 commits into
Open
fix(extract-timeline-from-meetings): bump pages.updated_at for touched entities#2500pablofavre12 wants to merge 3 commits into
pablofavre12 wants to merge 3 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.