Skip to content

fix(fork): merge upstream 96e887b into patch/event-history-retention - #184

Merged
fireboltdude1357 merged 170 commits into
patch/event-history-retentionfrom
fix/event-history-retention-upstream-96e887b
Nov 3, 2026
Merged

fireboltdude1357 merged 170 commits into
patch/event-history-retentionfrom
fix/event-history-retention-upstream-96e887b

Conversation

@fireboltdude1357

Copy link
Copy Markdown
Owner

The fork's nightly build fails because patch/event-history-retention conflicts with upstream 96e887b in seven files: ProjectionMaintenance.ts, OrchestrationEventStore.ts, DatabaseStorage.ts, ws.ts, FoundationPersistence.test.ts and two docs.

Upstream pingdotgg#29806 prunes the event log with its own design. Every 6 hours it records the log head as a mark, and once the mark is a day old it deletes covered events. It keeps each stream's newest event, thread.created, running run.updated events and referenced prompt anchors. Resumes from a cursor below prunedThroughSequence load a snapshot. The patch, from pingdotgg#28144 (still open), does the same job with per-thread replay floors in orchestration_v2_event_retention. Re-applying it would run two pruners over the same log.

This takes upstream's pruner and drops the patch's: its ProjectionMaintenance pass, its replayFloor checks in ws.ts, and its tests. One gap is left. A server that ran the patch, like stl-wsl, already deleted events below each thread's floor, but upstream's prunedThroughSequence starts at 0 until its first pass a day later. Until then, a client resuming from an old cursor would replay with gaps instead of loading a snapshot. So the patch now only:

  • keeps creating orchestration_v2_event_retention at startup with IF NOT EXISTS, so the table is always there to read, and
  • makes prunedThroughSequence return the higher of upstream's mark and the table's highest replay_floor. A new test in ProjectionMaintenance.test.ts covers it.

Once upstream's mark passes the old floors, the bridge does nothing, and the patch can be deleted from fork-patches.txt.

On a scratch stack of upstream 96e887b with all 23 patches and the fix branches for event-history-retention and timeline-index-reuse, pnpm install --no-frozen-lockfile, vp run typecheck (40 of 40) and vp test run on the 45 test files the patches touch plus ProjectionMaintenance.test.ts, ws.test.ts and FoundationPersistence.test.ts (1134 tests) all pass.

Made by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

juliusmarminge and others added 30 commits November 2, 2026 11:43
…PR update (pingdotgg#29369)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…hile this device's sign-in loads (pingdotgg#29352)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…time (pingdotgg#29301)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
)

## Problem

PR watches stopped after eight failed host reads, so a prolonged network outage prevented later CI and review updates from reaching the thread.

## Change

Keep watches active after provider failures reported as `failed`. Read detail and activity concurrently without allowing an activity failure to cancel or hide a permanent detail failure. Repeated known permanent failures still stop the watch and notify the agent; rate limits still pause reads. Non-rate-limited GitHub HTTP 403 responses and GraphQL `FORBIDDEN` responses now use a distinct `forbidden` reason so access refusals are counted instead of retried indefinitely. GraphQL error types survive the client mapping, after the existing requested-reviewer fallback.

The provider's `failed` category also includes unclassified host and decode errors. Those continue retrying at the existing two-minute cadence until the watch ends or is stopped. A fixed outage deadline would recreate the recovery failure for longer outages.

## Scope and approval

This is a focused fix for an obvious bug in existing PR watch recovery, covered by the small bug-fix exception in CONTRIBUTING.md. The changes cover watcher recovery, a GitHub failure classification needed to preserve permanent-error handling, and their regression tests. The new server-side `forbidden` reason does not change RPC contracts or add settings.

## Verification

`vp run check:changed` passed, including 154 tests across five files. Regression coverage includes a 30-minute outage followed by one CI-success notification, mixed activity/detail failures, resetting a prior failure count, and repeated forbidden reads stopping the watch. Provider tests distinguish HTTP 403 and exclusively permanent GraphQL refusals from retryable HTTP 503 and mixed or untyped GraphQL errors. The mixed-failure and GraphQL classification cases failed before their fixes. Seven focused requested-reviewer fallback/refusal tests also pass.

Model: GPT 6.1 Sol. Harness: Codex.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…diff load (pingdotgg#27833)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…29640)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…tgg#29644)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Henry Stern <6068107+hstern@users.noreply.github.com>
Co-authored-by: Ashish Patil <7754022+ash663@users.noreply.github.com>
Co-authored-by: TinBane <363069+TinBane@users.noreply.github.com>
…tgg#29680)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
…d newest usage (pingdotgg#29648)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ar again without going into focus mode (pingdotgg#26690)

Co-authored-by: nibarAhmed <nibarahmed0@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
…g#26833)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…otgg#29775)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…very poll (pingdotgg#29813)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…er a branch rename (pingdotgg#26125)

Co-authored-by: maria-rcks <maria@kuuro.net>
…Code (pingdotgg#27438)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
juliusmarminge and others added 29 commits November 3, 2026 11:11
…oading it (pingdotgg#29893)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…oved or steered (pingdotgg#29904)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… it inherited (pingdotgg#29794)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…r hosts' tokens (pingdotgg#29554)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
… release (pingdotgg#30319)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…9916)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…pen (pingdotgg#29263)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ed thread (pingdotgg#29643)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… source (pingdotgg#29013)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…#28135)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…h to Privacy Mode (pingdotgg#28097)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…son from hub rows (pingdotgg#28065)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ned-in hosts (pingdotgg#27840)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…9806)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…managed Codex (pingdotgg#30004)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ingdotgg#29862)

Co-authored-by: Matthew Feroz <136640686+MatthewFeroz@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
PR discovery used the full shell snapshot, which derived activity and counted historical items across active threads. Read only PR metadata and its event sequence in one transaction, then decode after releasing the reader. Preserve settled backfill, targeted refreshes, legacy PR normalization, and guarded updates.

Validation: check:changed passed with 80 tests after merging main; CI passed on 988187f. Native Electron measurements and a concurrent-write control confirmed metadata parity and coherent sequences. Synthetic measurements cover PR reads and service initialization, not full desktop startup.

Model: GPT 6.1 Sol. Harness: Codex in T3 Code.
…h behind (pingdotgg#29781)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alex Jankowiak <alexjankowiak@nebius.com>
…ngdotgg#27760)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…otgg#27763)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Problem

Several read-only queries in projection reads, legacy shell reconciliation, and peer link lookups ran on the SQLite writer. This added avoidable work to the writer connection and could delay writes.

## Change

Marked `getThreadProjection`, the independent legacy importer selectors, and peer link reads with the SQLite `readOnly` context marker. The full projection read uses one reader transaction so concurrent commits cannot mix its local and inherited history. Reads inside existing write transactions retain the writer and see uncommitted changes. Added file-backed routing coverage for reader selection and transaction visibility.

## Scope and approval

This is a focused fix for missing read-only routing boundaries identified in the parent audit. It changes no SQL selection logic or pool configuration. Full projection reads now hold one consistent snapshot.

## Verification

The file-backed tests recorded projection queries, importer selectors, and peer link lookups on reader connections. They also confirmed that reads inside write transactions see uncommitted projection, repair, shell, and link updates. A deterministic concurrent-commit regression failed before the projection transaction fix and passes afterward. Focused suites passed, with 90 tests. `vp run check:changed` passed, including 72 tests in its final run, and `git diff --check` passed.

No startup time saving was measured. The existing shell snapshot query cost is unchanged.

GPT 6.1 Sol, Codex
Add guarded partial indexes for delegated recovery candidate selectors and retain existing recovery eligibility. Include migration and query-plan regression coverage, plus preview-upgrade expectations.

GPT 6.1 Sol, Codex.
Upstream pingdotgg#29806 prunes covered events with its own design, so this takes
upstream's pruner and drops the patch's. What stays is a bridge: servers
that ran the patch already deleted events below each thread's replay
floor, so prunedThroughSequence also reads those floors and resumes below
them load a snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fireboltdude1357
fireboltdude1357 merged commit 18e6b45 into patch/event-history-retention Nov 3, 2026
2 checks passed
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.