Commit 31bbe02
committed
fix(parser): use real content digest for Shelley skip
Replace the additive/byte-length Shelley change signal with two
per-conversation signals so the sync skip cannot miss a rewrite:
- file_mtime stays the conversation's real updated_at timestamp. It must
remain a true timestamp because ListSessionsModifiedBetween filters
file_mtime <= now for PG/DuckDB push; a synthetic future value dropped
a just-synced Shelley row from a same-second push until a later run.
- file_hash holds a content digest over the conversation's messages,
computed identically by the meta skip query and the parse loop. It is
length-framed, so it detects appends, in-place rewrites, and
length-preserving same-second edits that a byte-length signal misses.
The bulk skip now compares the stored file_hash via GetFileHashByPath
alongside file_mtime. Computing the digest reads message payloads, which
the sub-second-timestamped siblings (Zed, Kiro) avoid; Shelley's
second-precision updated_at makes the read the price of not silently
skipping a rewrite. ShelleySourceMtime keeps a watcher-only change signal
(updated_at plus a sub-second digest term), compared for inequality and
never range-filtered.1 parent 9a52b29 commit 31bbe02
5 files changed
Lines changed: 268 additions & 157 deletions
File tree
- internal
- db
- parser
- sync
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1517 | 1517 | | |
1518 | 1518 | | |
1519 | 1519 | | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
1520 | 1539 | | |
1521 | 1540 | | |
1522 | 1541 | | |
| |||
0 commit comments