Repository navigation
fix(acquisition): harden live freshness and reparse writes - #714
Conversation
Store live watcher cursor records with byte offset, last complete newline, parser fingerprint, content fingerprint, and stable source identity. The watcher now reingests same-size rewrites, truncation rewrites, legacy size-only cursor rows, and parser-fingerprint changes instead of relying on byte size alone. Forward Drive acquisition observation and progress callbacks through the Drive raw stream so remote acquisition participates in the same diagnostics surface as local sources. Ref #620
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 35 minutes and 33 seconds.Comment |
Polylogue Proof PackRefs: Affected Domains
Additional routed domains with zero affected claims
Focused Gates
Required PR Gates
Optional Confidence Gates
Known Gaps
Oracle / Cost
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d018f45151
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary Make live ingestion cursor decisions content-aware and preserve forced reparse replacement semantics. This PR records richer live cursor state, stops deriving watcher source names from parent directories, forwards Drive acquisition diagnostics through the raw stream, and folds in the pending forced-reparse write fix from the other-agent workstream. ## Problem #620 tracks that live ingestion used byte size as truth: same-size rewrites could be skipped, parser changes could not invalidate cursor state, partial trailing lines did not leave a replay boundary, and watcher source names could become arbitrary directory names. Drive raw acquisition also bypassed the observation/progress diagnostics used by local sources. The pending force-write ingestion fix also needed cleanup before incorporation: the uncommitted hunk allowed same-hash forced reparses to append new message rows while leaving old rows behind, and one SQL condition was initially placed in the update expression rather than the `WHERE` predicate. ## Solution - Add `CursorRecord` and extend `live_cursor` with byte offset, last complete newline, parser fingerprint, content fingerprint, source name, and optional last-record timestamp fields, including migration for old size-only rows. - Make `LiveWatcher` skip only when size, content fingerprint, and parser fingerprint all match, and persist the configured `WatchSource.name` instead of `path.parent.name`. - Leave the replay offset at the last complete newline when a file has a partial trailing JSONL line, while still using the existing full-file parser path for now. - Forward Drive raw acquisition observation/progress callbacks through `iter_drive_raw_stream()` and `iter_drive_raw_data()`. - Preserve forced reparse replacement behavior in sync ingest and keep the large ingest file under the configured file budget. ## Verification - `ruff check polylogue/pipeline/services/acquisition_streams.py polylogue/sources/drive/__init__.py polylogue/sources/live/cursor.py polylogue/sources/live/watcher.py tests/unit/pipeline/test_acquisition_streams.py tests/unit/sources/test_live_watcher.py tests/unit/sources/test_source_laws.py` - `ruff format --check polylogue/pipeline/services/acquisition_streams.py polylogue/sources/drive/__init__.py polylogue/sources/live/cursor.py polylogue/sources/live/watcher.py tests/unit/pipeline/test_acquisition_streams.py tests/unit/sources/test_live_watcher.py tests/unit/sources/test_source_laws.py` - `pytest -q tests/unit/pipeline/test_acquisition_streams.py tests/unit/sources/test_live_watcher.py` - `pytest -q tests/unit/sources/test_source_laws.py -k 'drive_raw_data'` - `pytest -q tests/unit/pipeline/test_ingest_batch.py` - `devtools render-all --check` - `devtools verify-topology` - `devtools affected-obligations --path polylogue/sources/live/watcher.py --path polylogue/sources/live/cursor.py --path polylogue/sources/drive/__init__.py --path polylogue/pipeline/services/acquisition_streams.py` - `devtools verify --quick` - pre-push hook: `devtools verify --quick` Ref #620 Ref #618
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Make live ingestion cursor decisions content-aware and preserve forced reparse replacement semantics. This PR records richer live cursor state, stops deriving watcher source names from parent directories, forwards Drive acquisition diagnostics through the raw stream, and folds in the pending forced-reparse write fix from the other-agent workstream.
Problem
#620 tracks that live ingestion used byte size as truth: same-size rewrites could be skipped, parser changes could not invalidate cursor state, partial trailing lines did not leave a replay boundary, and watcher source names could become arbitrary directory names. Drive raw acquisition also bypassed the observation/progress diagnostics used by local sources.
The pending force-write ingestion fix also needed cleanup before incorporation: the uncommitted hunk allowed same-hash forced reparses to append new message rows while leaving old rows behind, and one SQL condition was initially placed in the update expression rather than the
WHEREpredicate.Solution
CursorRecordand extendlive_cursorwith byte offset, last complete newline, parser fingerprint, content fingerprint, source name, and optional last-record timestamp fields, including migration for old size-only rows.LiveWatcherskip only when size, content fingerprint, and parser fingerprint all match, and persist the configuredWatchSource.nameinstead ofpath.parent.name.iter_drive_raw_stream()anditer_drive_raw_data().Verification
ruff check polylogue/pipeline/services/acquisition_streams.py polylogue/sources/drive/__init__.py polylogue/sources/live/cursor.py polylogue/sources/live/watcher.py tests/unit/pipeline/test_acquisition_streams.py tests/unit/sources/test_live_watcher.py tests/unit/sources/test_source_laws.pyruff format --check polylogue/pipeline/services/acquisition_streams.py polylogue/sources/drive/__init__.py polylogue/sources/live/cursor.py polylogue/sources/live/watcher.py tests/unit/pipeline/test_acquisition_streams.py tests/unit/sources/test_live_watcher.py tests/unit/sources/test_source_laws.pypytest -q tests/unit/pipeline/test_acquisition_streams.py tests/unit/sources/test_live_watcher.pypytest -q tests/unit/sources/test_source_laws.py -k 'drive_raw_data'pytest -q tests/unit/pipeline/test_ingest_batch.pydevtools render-all --checkdevtools verify-topologydevtools affected-obligations --path polylogue/sources/live/watcher.py --path polylogue/sources/live/cursor.py --path polylogue/sources/drive/__init__.py --path polylogue/pipeline/services/acquisition_streams.pydevtools verify --quickdevtools verify --quickRef #620
Ref #618