Skip to content

design: move ci.events webhook ledger from Supabase to Turso staging #5693

Done

Description

@dezren39

Design scope only — no data moves in this issue's first pass.

What moves

  • From: Supabase (muse-dev2) ci.events (10,952 live rows, 31.8 MB — ~2.9 KB/row of jsonb webhook payload)
  • To: Turso, staging tier, partitioned by day/repo

Why

A pure append-only CI webhook ledger: 10,957 inserts / 0 updates in the stats window since 2026-10-29, no foreign keys, read by scan (its one view, ci.recent_failures, is a filtered scan). It is the fastest-growing table in the project by bytes and has no transactional consumer — under the §9 placement rule it is a Turso stream, not Postgres state.

Design doc: §9 of doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision/ (PR #5667, addendum PR #5689).

Risks

  • The webhook receiver is a live write path — cutover must not drop events during deploys (receiver-side buffering or dual-write).
  • recent_failures consumers (alerting? dashboards?) must be inventoried first; failure-visibility must not regress during the move.
  • Retention is currently unbounded; the Turso design should state a retention window rather than replicating unbounded growth.

Sketch of steps

  1. Inventory the receiver(s) and every reader of ci.events / ci.recent_failures.
  2. Design the Turso table + a recent_failures-equivalent query; set retention (propose 90 days hot, cold export beyond).
  3. Dual-write at the receiver, backfill the retention window, diff failure queries.
  4. Flip readers, stop the Postgres write, keep the Postgres table read-only for one retention window before any drop decision (separate approval).

Links: design doc PR #5667 · addendum PR #5689 · tracking dezren39/hatch-personal#21

Acceptance criteria

  • A design record (on this issue or a linked doc/PR) specifies the Turso staging shape for ci.events, partitioned by day/repo.
  • The webhook receiver cutover cannot drop events (receiver-side buffering or dual-write is specified), and ci.recent_failures consumers are inventoried with failure-visibility preserved.
  • A retention window for the Turso copy is stated rather than replicating unbounded retention.
  • Follow-on implementation issues are filed and linked; no data moves under this design issue itself.

Activity

  1. added
    queue/queued
    task/triage
    work/assigned
    queue/claimed
    status/in-progress
    and removed
    queue/queued
    on Nov 5, 2026
  2. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (triage)

    Triage findings (verified fresh 2026-11-05):

    1. Design basis is on main. PR docs: Scaler-era Atlas/Turso data architecture revision #5667 (Scaler-era Atlas/Turso data architecture revision) and PR docs: Supabase placement audit addendum (§9) — what moves out of Postgres #5689 (Supabase placement audit addendum, §9) are both MERGED. The design doc doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision/ names issue design: move ci.events webhook ledger from Supabase to Turso staging #5693 for ci.events: 10,952 rows / 31.8 MB, 10,957 inserts / 0 updates in the window — a pure append-only stream, matching the issue's placement argument.
    2. The inventory cannot be done by repo grep alone. Code search for ci.events and ci.recent_failures in developing-today/code hits ONLY the design doc — the webhook receiver and the view's consumers live outside this repo's code (Supabase-side objects and/or external alerting/dashboards). The follow-up's inventory step must enumerate Supabase-side views/functions and external consumers explicitly, with not-found results stated, not assumed.
    3. Gates preserved: this issue is design-scope only for its first pass (no data moves), and step 4's Postgres drop requires separate approval — the follow-up is scoped to steps 1–2 (inventory + Turso table / recent_failures-equivalent query / retention design, proposing the issue's 90-days-hot window) and explicitly excludes dual-write, backfill, and any cutover.

    Disposition: follow-up triage/design task enqueued in this pass (see addendum). Issue #5693 stays open for it.

  3. removed
    status/in-progress
    queue/claimed
    work/assigned
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · addendum to task 10129 triage

  5. added
    queue/queued
    and removed
    queue/queued
    on Nov 5, 2026
  6. 96 remaining items

  7. removed
    priority/normal
    on Nov 29, 2026
  8. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Priority validation 2026-11-29 (Felix): priority/normal + priority/low → priority/low — dual-band resolved: the only remainder is dropping the ci.events archive after the 2027-02-04 retention boundary plus Drew's drop decision (parked, date-gated, do-when-convenient); the removed priority/normal was a census-pass addition over Drewry's own priority/low.

  9. added
    effort/s
    area/infra
    and removed
    priority/low
    on Nov 29, 2026
  10. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Gaps found: duplicate priority labels (priority/normal and priority/low); no effort/* and no app//area/ label; no acceptance criteria section.
    Strengths: the ledger is characterised exactly (10,952 rows, ~2.9 KB/row of webhook payload, insert-only, no FKs, read by scan), the fastest-growing-table observation is recorded, and the risks name the live receiver write path and the unbounded retention this design should fix. Design source linked (§9, PR #5667 / #5689).
    Actions: removed priority/low (priority/normal kept, matching its sibling migration designs #5690/#5692/#5695); added labels effort/s and area/infra; appended a ## Acceptance criteria section derived from the body's own scope (original text untouched). Parked labels left as they stand.

  11. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Priority flag 2026-11-29 (Felix lane 0640-DI) — Drewry-set band stripped by bot churn; NOT re-applied by this lane.

    A full-pool band sweep found this issue carrying no priority band. The label-event record shows why:

    • 2026-11-29T14:06:05Z — dezren39 (Drewry) personally set priority/low.
    • 2026-11-29T14:30:24Z — developing-today-fleet[bot] added priority/normal (creating a dual band over Drewry's).
    • 2026-11-29T16:07:20Z — the bot removed priority/normal.
    • 2026-11-29T16:18:40Z — the bot removed priority/low — leaving the issue with no band at all.

    Per the priority doctrine, a band Drewry set personally is never overridden by a lane — so this lane has not re-applied or changed anything, and records the provenance here for Felix/Drewry. The evident intended state is exactly one band, priority/low (Drewry's, 14:06:05Z); restoring it is a one-click label add for Felix or Drewry. The bot's add-then-remove-both sequence looks like the bulk-label wave's dual-resolution pass resolving the dual by deleting both sides instead of keeping the owner's.

  12. added
    priority/low
    on Nov 29, 2026
  13. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Felix (2026-11-29): restored priority/low. Provenance (per lane 0640-DI's flag 7262968377): Drewry personally set priority/low today at 14:06:05Z; the fleet bot's bulk dual-resolution then removed it at 16:18:40Z, leaving the issue band-less. This restores Drewry's own recorded band — no lane judgment substituted. The issue now carries exactly one band.

  14. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Claim — lane 1907-P (Archer, charlie ADVANCE run 2026-11-29 19:07 CST).

    Taking #5693 as a design-only landing: inventory the ci.events webhook receiver(s) and every reader of ci.events / ci.recent_failures on current main, author the dated design record in doc/ (Turso staging shape partitioned by day/repo, no-drop cutover via dual-write/buffering, stated retention window), file and link the follow-on implementation issues, and close this issue against that record. No data moves under this issue.

    Note the premise check this design must answer honestly: the muse-dev2 Supabase project has since been removed (#13245 / #16822 record), so the record will state where the ledger's write path stands today and design against that, not against the 2026-11-04 snapshot alone.

  15. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Resolution — lane 1907-P (Archer, charlie ADVANCE 2026-11-29). #5693 is closed by PR #17036 (merged 2026-11-30T01:34:33Z, merge commit 5d03a8d), which adds the §9 closeout addendum to the design record doc/2026-11-24T00-15-00Z_design_ci-events-turso-ledger/ and its missing doc/README.md index entry.

    Acceptance, verified firsthand this run: (1) Turso staging shape in record §4; (2) no-drop cutover (parallel webhook, dedupe-key parity, fail-delivery-on-error) + sole live reader (morning readout) inventoried in §4/§6/§7; (3) 90-day hot retention stated, prune tool landed in PR #10047 (MERGED 2026-11-14, merge 3b4cb17, re-verified this run); (4) follow-on slices executed under PR #10047 / wave plan #6581, and the one remaining follow-on — the Postgres archive-drop decision — is moot: the muse-dev2 project has been deleted (#16822; Worker README closeout), and the gate's protective purpose was already met by the 11,203/11,203 dedupe-key parity proof. Remaining open question (cold export past 90 days) is Drew's call and outside this issue's acceptance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/infradesign/supabase-turso-migrationeffort/sepic/turso-cloudflarekind/designpriority/lowqueue/parkedstatus/parkedtask/triage

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions