Conversation
ymichael
marked this pull request as ready for review
September 17, 2026 02:02
ymichael
force-pushed
the
feat/completed-item-start-compaction
branch
from
September 17, 2026 22:13
63de451 to
0763e77
Compare
ymichael
force-pushed
the
feat/completed-item-start-compaction
branch
from
September 18, 2026 01:26
0763e77 to
f312cf6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Settled item lifecycles retain separate starts and deltas after PR1 pruning. This implements the revised first-position PR2 design independently of #3802, preserving visible history while removing redundant physical rows. Rebased onto
0bb64f3789, including main's reader fixes #3874 and #3876.The earlier implementation also counted compacted physical rows against timeline work limits, causing some pages to reconstruct much more history and read slower. The final reader counts reconstructed records, fetches metadata alongside selected rows, avoids duplicate parsing, and reuses reconstruction within explicit memory-accounting limits.
What changed
item/completed, its completion ID, payload and original timestamp; move its physical sequence to the first eligible lifecycle position. One versioned internal metadata column preserves original ordering, timing and necessary start/delta content. Eligible completed command deltas may become empty timing markers.Design and raw contract · Verification and limitations.
How you verified
The final timing harness uses the same ES-module Drizzle and native SQLite drivers as the app and asserts constructor identity. Earlier harnesses mixed a CommonJS driver with an ES-module schema, so their timing figures are superseded. Measurements cover the complete server timeline builder, excluding HTTP/browser rendering. Application-cold means empty per-connection JS caches, not cold disk. Results use private full database copies and production SQLite cache/mmap settings on a shared host; they are not traffic-weighted latency guarantees.
Maintenance remains asynchronous, with existing SQLite limitations. The historical worker pass took 304.5 seconds of processing; a short scheduling sample estimated about 107 idle hours for catch-up, not an end-to-end guarantee. Compaction performs no synchronous ingestion writes. Historical samples still observed 322 ms live / 372 ms background stalls; a controlled replay isolated checkpoint cost. No checkpoint setting was changed and no sub-50 ms cap is claimed. This reader performance pass does not establish new maintenance bounds.
Evidence: parent thread
thr_vmdgc3ke5y,pr2-perf-fix/report.md, finalproduction-*scripts/results and test logs; original worker evidence inpr2-review/final. Both copies are mode 0600 and contain zero Connect records across seven plugin-ID tables. No live database or copied Connect credentials/configuration were used. No merge or deployment.