Repository navigation
perf(history): skip unchanged partial-tail reads and SQLite metadata rewrites - #7680
Conversation
Cache only successful stable partial-tail observations per database handle, bound to exact file identity, nanosecond timestamps and read bounds. Preserve index integrity gates, newline offsets and worker snapshot fences. Add six focused regressions in the existing history worker suite. Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
…rk767-dev-bd5-20261024
|
Caution Review failedThe pull request is closed. Finishing Touches
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
…-unchanged-partial-tail # Conflicts: # tests/claude-integration/claude-picker-upload.test.ts
|
Integration evidence (owner decision decision:b607a677, approved): after #7627 landed the maintainer merged origin/dev into this branch, leaving only this PR's own change (history partial-tail ingestion (src/routing/history/ingest.ts)); independent gpt-6.1-sol review PASS at exact head 1aaf1ed. Exact-head PR CI run 40156531500 and exact-head ci.yml lane=all run 40156827556 (maintainer mirror branch at this SHA) both succeeded. Static merge simulation on current dev ac65aa7 (this Mac): dev=ac65aa79246e69e2cc3b2d6707d1ee88fc1b880c base=323a5e11772c38c15b271d23c7696c5947bb97da pr_files= 2 overlap=[]; merge clean; install exit=0; gui install exit=0; tsc exit=0; tsc doctor exit=0; structure:check exit=0; privacy:scan exit=0; layout+ratchet guards exit=0 54 pass 0 fail ; Merged by the triage manager as maintainer integration (MAINTAINERS.md, dev only) with green exact-head PR CI, an independent review PASS, and the owner's approval of this bundle. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Avoid rereading an unchanged unterminated request-history ledger tail and rewriting the same SQLite metadata on every refresh. Retain one small observation per live database handle, keyed by path, exact bigint file revision, next offset and optional end offset; no ledger bytes are cached.
Keep expected-file identity checks before the skip and preserve the surrounding schema, quick-check, source identity and truncation gates. Clear observations on reset/source replacement and before a new attempt; publish a new observation only after successful ingestion and metadata updates with an unchanged final file revision.
Verification
Candidate
a70ae65a14faa36da3029ce649339f839594ad7dnormally mergesdev@0aeaf0cb6b0a7c2f117d8c75f8fa396cf2ea6e39and shared #7627 (f011a94be1b468b7b785cb54976d4cb4a9b6a563). Runtime andtestRunnerBunare both pinned to 1.4.4. The PR remains based ondev.Current candidate validation: Official native Windows Bun 1.4.4,
CI=true bun test --isolate --timeout 60000, fresh processes for the history rebuild-worker and index files: 42 passed / 0 failed / 0 skipped / 1,688 assertions. Reference TypeScript, official Structure and skill-surface checks, and all 13 changed-file privacy/size/diff checks passed. All six units returned native exit 0 and complete child output; matching installed dependencies were reused without reinstalling.Both change-owned blobs remain unchanged; the 11-file Bun baseline is shared with #7627.
Previously reported at
c6261d671b709580ceea3ac2830303a3b7a27717: official Bun 1.4.4 on Windows passed 42 tests / 0 failures / 1,688 assertions intests/usage/request-history-rebuild-worker.test.tsandtests/usage/request-history-index.test.ts. TypeScript, Structure, diff and privacy/size checks over both changed files passed; unrelated sparse-absent paths were not evaluated. The earlier isolated dependencies matched their frozen inputs without reinstalling. These results are historical, not refreshed-candidate validation.Independent source review covered append/truncate/replacement, path/offset changes, reset, expected identity, failed reads and mutation during a read. Exact restored-mtime behavior, split UTF-8 and injected transaction/metadata failures were reviewed but not separately exercised by the new cases. Production callers do not wrap all ingestion in an outer rollback transaction; no broader durability guarantee is claimed.
Focused checks used the shared-worktree resource exception. Full-suite and native macOS/Linux coverage, benchmarks and final-head CI remain pending; earlier source-head CI is not current-merge success.
Checklist
Co-authored-by: luvs01 27862058+luvs01@users.noreply.github.com