fix: backfill sessions indexed before content hashing #21

Merged
david merged 1 commits from fix/session-backfill into main 2026-11-05 03:42:04 +00:00
Owner

Closes #20. Follow-up to #19.

The watermark only revisits sessions newer than the last run, so anything indexed before content hashing existed could never gain reasoning. And a missing stored hash was read as "unchanged" when it actually means "no evidence".

  • Missing hash → write once, then the hash makes later sweeps cheap.
  • knox ingest sessions --all ignores the watermark for a one-time backfill.

Ran it against the real index: 20.6 s, then 59 ms warm.

Two accounting notes, because the numbers look wrong at first glance and are not:

  • observations rows without a hash remain (~1085). That is the append-only log — old rows keep whatever they had.
  • 119 sessions still have a hashless latest row: the observation layer skipped them because their content is byte-identical. Correct behaviour; the next real change writes a hashed row.
Closes #20. Follow-up to #19. The watermark only revisits sessions newer than the last run, so anything indexed before content hashing existed could never gain reasoning. And a missing stored hash was read as "unchanged" when it actually means "no evidence". - Missing hash → write once, then the hash makes later sweeps cheap. - `knox ingest sessions --all` ignores the watermark for a one-time backfill. Ran it against the real index: 20.6 s, then 59 ms warm. Two accounting notes, because the numbers look wrong at first glance and are not: - `observations` rows without a hash remain (~1085). That is the append-only log — old rows keep whatever they had. - 119 sessions still have a hashless *latest* row: the observation layer skipped them because their content is byte-identical. Correct behaviour; the next real change writes a hashed row.
david added 1 commit 2026-11-05 03:41:55 +00:00
fix: backfill sessions indexed before content hashing (#20)
build / test (push) Has been cancelled
build / image (push) Has been cancelled
8d3851e638
The watermark means a sweep only ever revisits sessions updated since the last
run, so sessions indexed before content hashing existed would never pick up
reasoning. Also treats a missing stored hash as 'cannot prove current' rather
than 'unchanged'.

Adds 'knox ingest sessions --all' to ignore the watermark for a one-time
backfill.
david merged commit 25987d1108 into main 2026-11-05 03:42:04 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: david/knox#21