Skip to content

chore(fork): carry the event-history-retention patch - #173

Merged
fireboltdude1357 merged 1 commit into
patch/releasefrom
chore/carry-event-history-retention
Nov 2, 2026
Merged

fireboltdude1357 merged 1 commit into
patch/releasefrom
chore/carry-event-history-retention

Conversation

@fireboltdude1357

Copy link
Copy Markdown
Owner

Problem

The stl-wsl database is 42 GB, and most of it is thread event history nothing reads. Upstream pingdotgg#28144 prunes thread events older than a day while keeping the projections that threads are read from.

Change

Adds event-history-retention patch/event-history-retention pingdotgg/t3code#28144 to .github/fork-patches.txt, with a comment for whoever drops it later.

The patch branch is pingdotgg#28144's head merged with the fork's current upstream base (84537c4dd9), plus three commits:

  • The PR's migration 77 is replaced by CREATE TABLE IF NOT EXISTS at the end of runMigrations. Upstream already took id 77, and the migrator skips every id at or below the highest recorded, so a fork-only id would make the database skip upstream's next migration.
  • The prompt-reference check in the retention delete now matches aggregate_kind, so SQLite seeks idx_orch_events_stream_sequence instead of scanning every event written since the pass began. A Sol review found it, and EXPLAIN QUERY PLAN on a copy of the real database confirms the new plan.
  • The PR's stale "migration 77" comment and migration file are gone.

When pingdotgg#28144 lands upstream, its migration has to use IF NOT EXISTS before this line is removed. Otherwise servers that already have the table fail to start.

Verification

  • On a restored copy of the stl-wsl database, retention plus VACUUM went from 42.44 GB to 18.93 GB and deleted 3,625,700 events. 400 thread snapshots and the shell snapshot read byte-identical before and after.
  • node scripts/fork-sync.ts --force --base 84537c4dd9 merges every patch and builds 0.1.7-nightly.20261102.409301.
  • The retention, migration and storage tests pass on the patch branch (9 files, 80 tests), and the server typechecks.
  • The patched server boots on a restored copy in a namespace with no network and read-only /home.

Review tier: 8/10, prunes history on the daily-driver database

One-way door: pruned events are gone from statev2.sqlite, and the server refuses a projection rebuild afterwards. A restic snapshot is the way back.

Blast radius: the event store, replay to reconnecting clients, and startup migrations on every fork server

Written by Claude Opus 5.5 in Claude Code, running in T3 Code.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between c7a625b and f545ec1.

Files selected for processing: 1
  • .github/fork-patches.txt

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Walkthrough

The ordered nightly patch list now includes event-history-retention, mapped to its patch directory and an upstream pull request. Comments describe its startup table creation and a migration change noted before the patch is dropped.

Changes: Nightly patch list

Layer / File(s) Summary
Add event history retention mapping
.github/fork-patches.txt
Adds event-history-retention to the ordered patch list, mapped to patch/event-history-retention and pingdotgg/t3code#28144. Comments describe startup table creation and an upstream migration change before the patch is dropped.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested labels: coderabbit-queue

Merge Risk: Minimal · up to f545e

The patch-list change is ready to merge with no identified blocking risk.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: carrying the event-history-retention patch in the fork.
Description check Passed The description is mostly complete. It includes the problem, change details, upstream issue reference, verification results, risks, recovery information, and agent details. It does not use a separate …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is mostly complete. It includes the problem, change details, upstream issue reference, verification results, risks, recovery information, and agent details. It does not use a separate “Scope and approval” heading or state explicit maintainer approval, but the relevant scope and justification are described in the Change section.

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@fireboltdude1357
fireboltdude1357 merged commit 7d73cab into patch/release Nov 2, 2026
2 checks passed
@fireboltdude1357
fireboltdude1357 deleted the chore/carry-event-history-retention branch November 2, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant