GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(pm-stack): health snapshot, incremental reconcile streams, single-flight, cached attention (#9850) by dezren39 · Pull Request #10466 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 15, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Refs #9850 — round 2. The round-1 fix (PR #10084) isolated the /health client and batched the writes, but the stalls came back: the projector was marked down twice more on the new build (2026-11-15 01:49Z and 02:55Z, ~3 min each), and /api/attention.json timed out four times in a row at the 03:00 CT reconcile fire on 2026-11-15 (35 s client timeouts, load 14→26) after flapping three times on 2026-11-14. This PR removes the mechanisms instead of widening the margins. The sentinel is unchanged — it was correctly reporting real stalls.

Root cause

  1. The reconcile reviews stream ignored its cursor. Every pass re-read the full PR list and made one GitHub call per PR — for developing-today/code that is 4,758 PRs — then upserted every review found: the journal shows reviews: written=5433 ms=1692265 (28 minutes of sustained writes) and whole passes of ~11.5k rows taking 22–35 minutes, recurring roughly hourly. The prs stream likewise re-upserted all ~4,757 PRs every pass.
  2. /health still did live DB work on the request path (a COUNT over three tables, 5 s timeout → 503). Any contention past 5 s — the mega-pass write flood above, on a loaded box — became a sentinel "down" even though the process never died.
  3. POST /reconcile had no single-flight: the timer fires every ~15 min regardless, so passes overlapped and multiplied the load.
  4. The aggregator's /api/attention.json re-assembled the whole view on every request (no caching), so under CPU load each request cost seconds — measured live 2026-11-15: avg 0.98 s, worst completed 24.8 s, four consecutive 35 s timeouts at the 03:00 CT reconcile fire. It was the one assembly not behind the codebase's TodayCache.

Fix

  • Projector /health serves a background-refreshed snapshot (15 s refresh): zero DB work on the request path. A snapshot older than 120 s answers 503 health_snapshot_stale — a genuinely wedged event loop cannot refresh, so real death still reads as down; a dead process cannot answer at all. Without a snapshot provider (tests, embedders) the previous bounded live probe runs unchanged.
  • Reviews stream is incremental: candidates are PRs updated inside the cursor window (cursor − 5 min overlap), the PR list walk is newest-first and stops at the window edge, and a fetched PR still returns its full review list, so nothing is skipped permanently. Cursor semantics unchanged (max submitted_at; advances even when a PR errors — the projector(reconcile): reviews stream is not actually guarded per-PR — one PR's failing reviews endpoint aborts the whole stream, later PRs never reconcile, and the run reports written: 0 despite successful upserts #2745 contract). Measured on the live projection: 4,758 seated PRs vs 15 updated in the last 20 minutes — a pass now fetches tens of PRs instead of thousands.
  • prs stream: same newest-first early stop; rows at or below the cursor are not re-upserted (safe: the cursor only covers PRs an earlier unfiltered pass already upserted from pulls data); the cursor still advances over the full walk.
  • POST /reconcile is single-flight in serve(): a trigger during a running pass returns 200 {ok: true, skipped: "reconcile_in_progress"}.
  • Aggregator: attentionContext is wrapped in the existing TodayCache idiom (pm-stack(aggregator): /board, /api/board.json, /api/overview.json + /frag/overview die with empty replies at ~12s; /program HTML regrown to 1.16MB #5082) — 10 s TTL, coalesced loads, stale-while-revalidate — one cache per census variant, invalidated on the same freshness notices as the today/overview caches.

Evidence

  • New regression tests: reviews-stream incremental sweep (seeded cursor → only the updated PR is fetched), prs no-re-upsert below cursor, /health serves the snapshot with a wedged DB, stale snapshot → 503, reconcile gate no-op.
  • Projector suite: 142 pass, 0 fail. Aggregator attention suites pass. Note: aggregator test/today-cache-1179.test.ts currently fails its 5 s hook timeout on pristine main as well under this box's load (verified both trees back to back) — pre-existing, unrelated to this change; the cache primitive itself is untouched.
  • Live A/B on a copy of the production DB (old code vs this branch): unloaded /health 4.3 ms (old, live query) vs 0.9 ms (new, snapshot, snapshotAgeMs present). A local write flood does not reproduce the production stall physics (production writes queue on a remote libSQL service; a local WAL file answers readers instantly), so the request-path invariant is proven by the wedged-DB test instead: /health answers 200 from the snapshot while its DB client throws on every call.
  • Production sampler (1 Hz, 502 samples, 2026-11-15 02:50–03:18 CT): /health max 299 ms, zero non-200; /api/attention.json avg 982 ms, worst completed 24.8 s, 4 timeouts of 35 s at 03:00–03:02 CT while load rose 13.9 → 26.1 — the flap this PR's cache removes.

Deploy note: takes effect at the next switch after merge (server code is read at start). The soak gate on #9850 (gate-code-9850-soak) should restart from this deploy.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
repo-worker-tmp-code-b
fix(pm-stack): health snapshot, incremental reconcile streams, single…
59119b4
…-flight, cached attention (#9850)
@dezren39
dezren39 requested a review from a team as a code owner November 15, 2026 09:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T09:04:42.031678Z
We couldn’t complete this review. Comment @codex review to try again.
59119b4 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 21013b4a-8720-4db5-820d-896daa059f8b
Commits

Reviewing files that changed from the base of the PR and between 9ce1dbf and 59119b4.

Files selected for processing: 6

  • pm-stack/aggregator/src/server.ts
  • pm-stack/projector/src/github.ts
  • pm-stack/projector/src/reconcile.ts
  • pm-stack/projector/src/server.ts
  • pm-stack/projector/test/health-isolation.test.ts
  • pm-stack/projector/test/reconcile.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 15, 2026
pm-projector /health stalls >=90s under load - sentinel down alerts fire while the process never restarts #9850
Open
aggregator today-cache-1179 test: 5s hook timeout under load (fails on pristine main) #10467
Closed
@github-actions github-actions Bot assigned dezren39 Nov 15, 2026
@dezren39
dezren39 merged commit 3a0eca5 into main Nov 15, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the fix/9850-health-attention branch November 15, 2026 22:10
This was referenced Nov 15, 2026
config: rename system1 -> systemone, opencode-zen-plans -> zen-plans; beam-plan fronts workhorse #10557
Merged
laptop-autocommit-openclaw death spiral: 131MB live sqlite tracked in git, push can never succeed, ~10 cores burned every minute #10559
Closed
config: restore _claude/_muse/_commandcode doors; bump fork pin to 5b65c2a2 (opencode#2479 + #2466) #10564
Merged
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.