Documentation
¶
Overview ¶
cmd/backfill_valid_until — R-S2
Backfills the `valid_until` field onto reflection-origin insights that were stored before commit 1b3e482 wired WithValidUntil into the reflection engine. Those insights have valid_until=0 (missing key in Qdrant) but should carry a 30-day TTL computed from their created_at timestamp.
Three-phase flow:
SCAN — enumerate type=insight memories with source:reflection tag (or
source=system + reflection_source_ids); filter for valid_until == 0.
PATCH — for each candidate, set valid_until = created_at + 30d.
Skipped when --dry-run=true (default).
VERIFY — re-fetch patched IDs; assert valid_until > 0 for each.
Flags:
--dry-run (default true) scan + report only --verify (default false) run VERIFY phase after PATCH --qdrant-url override cfg.QdrantURL --collection override cfg.CollectionName