Files
Garry TanandClaude Fable 5 19a291e897 fix(effective-date): rank content_created_at with its provenance — stop reindex flipping deliberate date fields
Review fixes for the #2754 takeover:

1. content_created_at was ranked ABOVE event_date/date/published/filename
   while both in-tree writers (import-file, the backfill script) derive it
   from frontmatter.created — the chain's explicitly WEAKEST content
   signal. Import computed source='date' for a created+date page, then the
   first 'gbrain reindex-frontmatter' (which reads the persisted column)
   silently flipped effective_date to the created value. The column now
   ranks just above the frontmatter.created rung (still repairs the
   incident class: created-only pages beat the row-timestamp fallback),
   and import passes contentCreatedAt through so import and reindex
   compute identical results. Regression test added.

2. ESCAPE '\\' (2-char escape string) made every --slug-prefix run die
   with "invalid escape string" — in the new backfill script and the
   pre-existing copy in backfill-effective-date.ts. Both now send a
   single-char escape. Verified against PGLite.

3. Scrubbed a personal-brain entity slug from test/effective-date.test.ts
   per the repo privacy rule (generic placeholder instead).

typecheck clean; 412 tests across the touched suites pass; jsonb guards
clean; end-to-end PGLite smoke (fresh bootstrap + v125 migration + script
step 1 with --slug-prefix + effective_date re-walk) verified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 11:41:15 -07:00
..