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 — fleet-queue: agent.events Turso sink verbs + health terminal counters (#5690) by developing-today[bot] · Pull Request #6762 · developing-today/code

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 7, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Stacked on #6755 (base queue/6741-turso-backend) — review/merge that one first. Resolves the agent.events blocker for #5690; outage context #6619.

Why

The migration classified agent.events as an append stream → Turso but left it on Postgres "blocked by design" on transactional coupling with the queue core (Gate-1 audit: supabase/turso-migration/consumer-audit-5690.md in hatch-personal). #6755 moved the queue core (whose RPCs are the coupled writers). This PR handles the stream itself.

Coupling verdict (full inventory in the new doc)

  • Only the queue RPC family writes events atomically with task state — preserved by construction in the Turso backend (same dispatch, same database); the one honest deviation is pipeline-statement atomicity vs PG's single transaction, recorded in the doc.
  • The FK to agent.tasks does not carry (different id spaces) — historical import targets a separate archive table at cutover, never the live table.
  • The only semantic blocker was revalidate_parked_tasks()'s event_seen EXISTS subquery, which cannot query across databases. Its replacement primitive is built here (/events-seen); the sweeper design is step C3 of the procedure.
  • repo_queue_health's terminal counters dissolve in Turso — events ⋈ tasks is a local JOIN, restored in /health here.
  • The non-queue writers (github-ci webhooks ≈23% of the stream, fleet-fetch) have no coupling at all; both get AGENT_EVENTS_SINK=pg|dual|turso flips, default pg (Edge Function change in hatch-personal, fleet-fetch in ~/tools — landed alongside, referenced in the doc).

What changed

  • turso_queue.rs (Turso backend only; PG dispatch untouched): events indexes (kind, created_at), (created_at); verbs POST /events-append, /events-seen, /events-count, /events-prune (prune_events port, self-logging); /health gains terminal_events_24h / terminal_events_7d; unit tests for append parsing + prune cutoff.
  • doc/fleet/agent-events-turso.md: inventory, verdict, C1–C7 cutover procedure (dual-write → health parity → revalidator sweeper → PG-gated historical import at a max(id) watermark → writer flips → prune/backup re-point → close-out).
  • queue-turso-cutover.md: cross-reference from the events bullet.

Verification (live, muse-queue)

Side broker instance (own port + socket, QUEUE_BROKER_BACKEND=turso) against the real muse-queue DB:

  • /events-append → {"id":10,"kind":"sink_proof"}; /events-seen hit {seen:true,count:1} and miss {seen:false,count:0} correct; /events-count per-kind 1, total 10; missing kind → exit 2 kind is required.
  • /events-prune {keep_days:3650} → deleted:0, self-logged events_pruned (row 11).
  • /health → terminal_events_24h:2, terminal_events_7d:2 for the proof queue (the JOIN counting fleet-queue: Turso backend for the queue core (muse-queue) (#6741) #6755's two completed proof tasks).
  • Independent readback via turso db shell: rows 10–11 present; indexes events_kind_ts, events_created created by schema ensure.
  • cargo test -p fleet-queue --features queue-broker --lib: 75 passed.

Known environment caveats: cargo clippy is blocked here by a pre-existing sccache/rustc version clash (E0514 on untouched crates); cargo fmt --check disagrees with the entire branch under this toolchain (24 hunks including untouched files), so new code follows the file's existing style.

Not in this PR / still PG-gated

Historical export at a watermark (needs one green PG window or a verified DIY-backup restore), the revalidator sweeper implementation (C3, designed), cron disables and any drop decision (Drew's call). No defaults flipped, nothing deleted.


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
@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 7, 2026 04:12
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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: 7abc2a4d-2ff4-4bdc-9f71-52df544e8308

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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.

Base automatically changed from queue/6741-turso-backend to main November 7, 2026 04:34
@dezren39 dezren39 mentioned this pull request Nov 7, 2026
Turso replacement for the queue core: dedicated muse-queue DB + fleet queue-broker Turso backend #6741
Closed
developing-today[bot] and others added 2 commits November 6, 2026 23:28
developing-today[bot] repo-worker-code-g
fleet-queue: agent.events Turso sink verbs + health terminal counters (…
22d05c1
…#5690)

Stacked on #6755 (queue/6741-turso-backend). Resolves the agent.events blocker left by the queue-core Turso backend: the stream stays blocked only where Postgres is genuinely required (historical export), everything else now exists behind the same QUEUE_BROKER_BACKEND=turso selection. The Postgres dispatch and the production default are untouched.

turso_queue.rs: events indexes (kind, created_at) and (created_at) in the idempotent schema ensure; POST /events-append (sink for non-queue writers), /events-seen (the event_seen ready-condition primitive replacing the revalidate_parked_tasks EXISTS subquery), /events-count (observability parity), /events-prune (prune_events port, self-logging); /health restores terminal_events_24h/7d per queue via the local events-join-tasks query (the repo_queue_health view fields). Unit tests for append parsing and prune cutoff.

doc/fleet/agent-events-turso.md: full writer/reader inventory (evidence: hatch-personal consumer-audit-5690), the coupling verdict, and the C1-C7 cutover procedure covering the github-ci Edge Function and fleet-fetch AGENT_EVENTS_SINK flips, the broker-side revalidator sweeper design, the PG-gated historical import at a max(id) watermark, prune and backup re-pointing. queue-turso-cutover.md cross-references it.

Verified live against muse-queue with a side broker instance (own port/socket): append returned id 10, events-seen hit/miss correct, counts correct, kind-required validation fires, prune at keep_days=3650 deleted 0 and self-logged, health rows carry terminal_events_24h/7d = 2 from the proof cycle; independent turso CLI readback shows rows 10-11 and both new indexes. cargo test -p fleet-queue --features queue-broker --lib: 75 passed. cargo clippy blocked by a pre-existing sccache/rustc version clash in this environment (E0514 on untouched crates); cargo fmt --check disagrees with the whole branch under this toolchain (24 hunks incl. untouched files), so style follows the file as-is.
repo-worker-code-g
docs(fleet): agent.events sink target is fleet-queue after the #6741 …
9e6fa1c
…rename
@dezren39
dezren39 force-pushed the events/5690-turso-sink branch from bf26319 to 9e6fa1c Compare November 7, 2026 05:34
@developing-today
developing-today Bot merged commit 3dcc610 into main Nov 7, 2026
4 checks passed

Uh oh!

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

@developing-today
developing-today Bot deleted the events/5690-turso-sink branch November 7, 2026 05:35
This was referenced Nov 7, 2026
design: move agent append streams (agent.events, agent.quota_records) from Supabase to Turso staging #5690
Open
infra: repo-queue PostgREST timeout: global failures lane-visible again — recurrence after #6450 closed (2026-11-06 21:15-21:31Z) #6619
Closed
This was referenced Nov 7, 2026
design: move ci.events webhook ledger from Supabase to Turso staging #5693
Open
pm-stack decision sets v2: rich questions, event log, submit API + activity webhook/hook #9335
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dezren39 dezren39 Awaiting requested review from dezren39

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

0 participants

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.