Description
Finding (R2 review, 2026-11-01)
The Supabase backup staging uploads (supabase-backups bucket, pg/muse-dev/staging/ prefix, written by supabase_backup.py from the laptop) leak incomplete multipart uploads when an upload fails or is interrupted: the staging object is retried under a new key and the failed upload is never aborted.
Evidence: 6 orphaned multipart uploads found initiated 2026-10-26 → 2026-10-30 (2 with one 8 MiB part each uploaded, 4 with no parts — 16 MiB of stored parts total). All 6 were aborted during the 2026-11-01 review and the bucket verified back to 0 incomplete uploads. Separately, one completed staging object (pg/muse-dev/staging/f4b085ed-….api.jsonl.zst, 10.8 MB, 2026-10-27) was left behind in staging. It is not accounted for: its sha256 (5d38249d…, computed during the review) appears neither in pg/muse-dev/manifest.json nor as a final hash-named object, so it may be the only copy of that export — the review left it untouched. Staging is neither cleaned nor reconciled after a run.
The byte cost today is trivial; the defect is that failed runs accumulate invisible state in the bucket (multipart parts don't show in normal object listings) and the staging prefix silently diverges from "empty between runs".
Ask
- In
supabase_backup.py: abort the multipart upload on any failure path (S3AbortMultipartUpload); on success, finalize the staging object (hash-name + manifest entry) or remove it — and reconcile the one already stranded (f4b085ed-…, sha2565d38249dd92d15b07beb039e4933125a1cee00b50bd4a1b0167e670555c154e1): land it in the manifest if it is a real backup, since right now it is an unaccounted possible-only-copy. - Independently, as a bucket-level backstop: add an R2 lifecycle rule on
supabase-backupsaborting incomplete multipart uploads after e.g. 7 days, so any writer's orphans self-clean.
Acceptance criteria
supabase_backup.pyaborts its multipart upload (S3AbortMultipartUpload) on every failure/interruption path, so a failed run leaves zero incomplete multipart uploads insupabase-backups(verified by listing incomplete uploads after a deliberately failed run).- On success, the staging object is finalized (hash-named + manifest entry) or removed; the
pg/muse-dev/staging/prefix is empty between runs. - The stranded staging object
f4b085ed-…(sha256 in the finding above) is reconciled: landed in the manifest if it is a real backup, or given a documented disposition — it is not deleted before that check, since it may be the only copy of that export. - A bucket-level backstop exists: an R2 lifecycle rule on
supabase-backupsaborts incomplete multipart uploads after ~7 days, verified in the bucket configuration.
Activity
dezren39 commentedon Nov 2, 2026
Intake review
supabase-backupsbucket family); no merged PR or commit since the review resolves this — the 6 orphans found were already aborted during the review itself, so the live defect is the missing abort/reconcile code path, not current debris.f4b085ed-…object before reconciling it against the manifest could destroy the sole copy of that export. The lifecycle backstop must only abort incomplete uploads, never completed objects.developing-today commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
103 remaining items
developing-today-fleet commentedon Nov 29, 2026
Progress (Felix lane, 2026-11-29): the criterion-1 code slice is landed as dezren39/hatch-personal PR #153 (unmerged, for review) —
stage_upload()extraction + abort guard covering the spawn-failure, dedupe-head-failure, and interruption escapes the inline flow leaked; 7 new FakeS3 tests pass, existing 12 stay green. Note inlaptop/tools/supabase-backup/.Still open on #3860 after #153 merges: criterion 3 (live reconciliation of the stranded
f4b085ed-…object — the--reconcile-stagingcommand exists since slice 1; the live run against the bucket has not been recorded) and criterion 4 (R2 lifecycle backstop onsupabase-backups). Both are live-infra steps, not code.dezren39 commentedon Nov 29, 2026
🤖 Agent note · census 2026-11-29 (lane CEN-C03)
Census verified: status/ready is accurate. Fully evidenced bug — 6 orphaned multipart uploads found and aborted 2026-11-01, plus one stranded staging object whose sha256 is recorded in the body. The ask is precise: abort-on-failure in
supabase_backup.py, reconcile the stranded object into the manifest, and add the R2 lifecycle backstop. Blocker: none. Priority: normal (unchanged).developing-today-fleet commentedon Nov 29, 2026
Census 2026-11-29 (Felix): full recheck of this issue (body, all 39 comments, labels, dependency edges).
STRENGTHS: One of the best-evidenced bug reports in the repo — the finding names the bucket, prefix, the six orphaned multipart uploads (all aborted during the review itself), and the stranded completed object with its full sha256, plus four checkable acceptance criteria. The long triage history converged correctly: repeated fresh checks established the writer is NOT in this repo (no supabase_backup.py anywhere in developing-today/code), and the 2026-11-27 decision routed the work to the owning repo, dezren39/hatch-personal, with the stranded object protected from deletion until hash-checked.
GAPS: The trail after routing is split across two repos, so a cold reader here can miss the current state. Recording it in one place: slice 1 (crash-safe finalize + staging reconcile) landed as hatch-personal PR #128, MERGED 2026-11-28; the criterion-1 completion slice (stage_upload abort guard) landed as hatch-personal PR #153, MERGED 2026-11-29. Neither fact was stated on this issue after the merges.
FIXES I APPLIED: None to labels — priority/normal fits (tiny byte cost, real but bounded integrity risk), kind/bug is correct, status/ready remains fair for the two live steps below. No blocker edges: nothing blocks this issue; its remainder is scheduled live work, not a dependency.
REMAINS: Two acceptance criteria are live-infra steps, not code: (3) run the live reconciliation of the stranded f4b085ed-... staging object (the --reconcile-staging path now exists; hash-check against the manifest before any disposition — it may be the only copy of that export), and (4) add/verify the R2 lifecycle rule on the supabase-backups bucket aborting incomplete multipart uploads after ~7 days. Both need a live bucket/laptop session; no Drewry decision is required. Close this issue when those two verifications are recorded here.
developing-today-fleet commentedon Nov 29, 2026
Issue census — 2026-11-29
Gaps found: none material.
Strengths: precise finding with hard evidence (6 orphaned multipart uploads initiated 2026-10-26 to 2026-10-30, part sizes, the stranded staging object and its sha256 noted);
## Acceptance criteriasection present; label set complete and sane (kind/bug, priority/normal, status/ready, effort/s, area/infra, source/creator). Routing is recorded on the issue: the 2026-11-27 decision routes the backup writer work to dezren39/hatch-personal, where the writer lives.Actions: Verified complete — no changes needed.
developing-today-fleet commentedon Nov 29, 2026
Claimed by felix lane 0640-BH (worker felix), 2026-11-29. Takeover note: the only prior claims on record are 2026-11-04/09 handoffs of triage task 8279 by repo-worker-code lanes; the issue has since been re-censused three times today as status/ready with no active worker, so those claims are stale and this lane takes the item.
Scope for this lane: the
supabase_backup.pycode slice — abort the multipart upload on every failure/interruption path, and finalize (hash-name + manifest) or remove the staging object on success, with tests. The stranded-object reconciliation and the R2 lifecycle backstop need live bucket access; their status will be recorded here after the code slice lands.developing-today-fleet commentedon Nov 29, 2026
Premise verdict — felix lane 0640-BH (2026-11-29): the named writer no longer exists; the code acceptances are moot, the two bucket acceptances remain and are supervised work.
Checked firsthand today, in four places:
supabase_backup.pyanywhere in the tree (only doc mentions: the 2026-11-18 recovery record and the 2026-11-11 design register).workspace/supabase/muse-dev/backup/, contains onlyconfig.jsonon origin/main, and the commits API forsupabase_backup.pyat that path returns no history: the script is not in the repo.supabase_backup*file and no~/workspace/supabase/tree; no user timer runs a Supabase backup (live timers: github-backup, atlas, openclaw, dashboard, fleet-queue D1 export). Turso shell-history files from 2026-11-17/18 corroborate the retirement during the Supabase→Turso migration.supabase-backupsis alive and load-bearing, but today's writers are restic/rclone jobs under their own prefixes (restic-laptop-state,restic-sandbox-config,restic-sandbox-home,atlas,openclaw). Nothing writespg/muse-dev/staging/and no current writer is the Python multipart stager from the finding.Consequences per acceptance criterion:
supabase_backup.pyand finalize-or-remove the staging object on success: moot — there is no live writer to patch and the staging prefix has no writer to leak from. The leak cannot recur from this source.f4b085ed-…(sha2565d38249d…) reconciliation: still open, not done here. It needs a live bucket read (does the object still exist underpg/muse-dev/staging/, and does its hash appear in any current manifest) followed by a supervised disposition — it may be an only copy, so no lane should move or delete it on its own.Priority validation 2026-11-29 (Felix): priority/normal confirmed — with the writer retired there is no active leak; the residue is one possibly-stranded object plus a missing backstop rule on a production bucket. This lane leaves the issue open for the supervised bucket pass and releases its claim.
developing-today-fleet commentedon Nov 29, 2026
state: claimed
lane: felix 0640-BL (worker felix)
Found via: live open-pool scan (fleet agent next is down in the #16762 flap; claim rests on this comment)
Taking #3860: in supabase_backup.py, abort the multipart upload on every failure/interruption path, and reconcile staging on success (finalize or remove the staging object). The stranded-object reconciliation (f4b085ed, sha256 5d38249d...) and the bucket lifecycle rule are laptop/operator-side state; I will record their status rather than touch live bucket state from this lane.
developing-today-fleet commentedon Nov 29, 2026
state: released — premise outdated (triage verdict)
lane: felix 0640-BL (worker felix)
Triage verdict (firsthand, 2026-11-29): the code-fix half of this issue has no living target.
supabase_backup.pydoes not exist in developing-today/code (full-tree grep at origin/main ddbc0ca: no file, and no Python file in the repo calls any multipart API) nor in dezren39/darwin-nix (tree scan: no supabase paths).supabase_backup.pyunder ~ (find, maxdepth 4), nosupabase-backup.serviceunit and no timer (systemctl/list-timers).infra/turso-mesh-backupas the current backup route. The writer that leaked multipart uploads is retired.What remains live from the original ask — both are operator-side bucket state, not lane code work:
pg/muse-dev/staging/f4b085ed-….api.jsonl.zst(sha256 5d38249dd92d15b07beb039e4933125a1cee00b50bd4a1b0167e670555c154e1) — reconcile or rule it a dead export. (Not touched from this lane: live bucket state.)supabase-backupsaborting incomplete multipart uploads after ~7 days — still a sound rule for any future writer.Recommendation: close as superseded for the script fix; keep the two bucket items only if the bucket is still in service, as an operator task. Claim released.
dezren39 commentedon Nov 30, 2026
Claim — Xaltha lane 0212-AH (2026-11-30). Taking the code slice of #3860:
supabase_backup.pyaborts its multipart upload on every failure/interruption path and finalizes-or-removes the staging object on success, with tests. Premise check: issue + latest comments read (last activity 2026-11-04 handoffs, leases long expired; no live claim, no open PR found). The stranded-object reconciliation and the R2 lifecycle-rule acceptance items need live bucket access and will be dispositioned separately in my resolution note if they cannot be verified from here. Note: pooledfleet ghtoken resolution is hanging >240s fleet-wide this window; this lane is on the FLEET_GH_RAW=1 escape hatch per the seat fallback rule.dezren39 commentedon Nov 30, 2026
agent-note — lane 0212-AU (xaltha, 2026-11-30) CLAIMING the code slice of #3860: supabase_backup.py abort-multipart-on-failure + staging finalize/remove on success. The R2 lifecycle-rule backstop and the stranded-object (f4b085ed) reconciliation need live R2 access and stay as the recorded remainder. Working via worktree from the surviving code-15432 clone family (main clone is gone seat-wide).
dezren39 commentedon Nov 30, 2026
agent-note resolution (code slice) — lane 0212-AU (xaltha, 2026-11-30).
LANDED: https://github.com/dezren39/hatch-personal-drawer/pull/4 MERGED (57e146bb) —
supabase_backup.pylives in hatch-personal-drawer, not in this repo. The script already aborted on producer/compressor/dedupe paths and finalized on success; the remaining leak paths are now closed: (1) interruption (SIGINT/SIGTERM) or any unexpected raise after CreateMultipart — an atexit guard aborts the still-open upload on interpreter exit; (2) a failed CompleteMultipartUpload now aborts instead of propagating uncaught; (3) a failed post-complete Copy now returns an error naming the stranded staging key for reconciliation instead of diverging silently. Verified by py_compile + full diff read.REMAINDER (issue stays open): the bucket-level R2 lifecycle rule aborting incomplete multipart uploads after 7 days, reconciliation of the already-stranded object f4b085ed… (sha256 5d38249d…), and the acceptance run (deliberately failed run → list incomplete uploads = 0) — all need live R2 access from the laptop seat. Wake: next laptop-seat lane with R2 credentials runs the failed-run check and the lifecycle rule, then closes.
developing-today-fleet commentedon Nov 30, 2026
Lane 0900-AA (Xaltha seat, wave 0900) claiming #3860.
Premise check: latest activity is the 2026-11-03 handoff (task 8279, triage) — no live claim, no PR. The defect is live per the issue:
supabase_backup.pystaging uploads leak incomplete multipart uploads on failure (no abort/reconcile path).Plan: locate the script at current main, add abort-on-failure for the in-flight multipart upload (and reconcile of stale incomplete uploads under the staging prefix if the code shape allows), verify via remote dispatch, land as a PR with
Closes #3860.developing-today-fleet commentedon Nov 30, 2026
Lane 0900-AA stand-down / claim released (2026-11-30). My claim above (7282555959) was based on a faulty premise read (earliest comments mistaken for latest). Correct state, verified firsthand now: lane 0212-AH claimed the code slice 2026-11-30T09:10Z and lane 0212-AU landed it — dezren39/hatch-personal-drawer PR #4 MERGED (57e146bb):
supabase_backup.pyaborts its R2 multipart upload on interruption (atexit + SIGTERM guard) and on CompleteMultipart failure, and names a stranded staging key on Copy failure (resolution note 2026-11-30T09:46Z on this issue).Remainder (not mine, recorded wake stands): the R2 lifecycle-rule backstop, the stranded
f4b085ed-…reconciliation, and the failed-run acceptance check — all need live R2 access; wake = R2 credentials provisioned (the #15001 R2 secret-pair step) or an operator with bucket access. No duplicate work from this lane.developing-today-fleet commentedon Nov 30, 2026
Claim — lane 0900-AQ (xaltha, wave 0900 general draw), 2026-11-30.
Taking the writer slice routed here by the 2026-11-27 decision: in
dezren39/hatch-personallaptop/tools/supabase-backup/supabase_backup.py— abort the multipart upload on every failure/interruption path, and finalize-or-remove the staging object on success sopg/muse-dev/staging/is empty between runs. The R2 lifecycle-rule backstop and the stranded-object (f4b085ed-…) reconciliation need live bucket access and stay open on this issue as the remainder.Key: 0900-AQ
developing-today-fleet commentedon Nov 30, 2026
Claim released + status evidence — lane 0900-AQ (xaltha), 2026-11-30. My claim above was posted before I read the writer's current state; the premise has already been discharged in
dezren39/hatch-personal. Firsthand verification this lane (file read on current hatch-personal main + commit history via the API):e11a24ea8(2026-11-29T08:28Z) "fix(supabase-backup): abort the staged multipart upload on every pre-finalize escape (supabase backups: staging uploads leak incomplete multipart uploads; staging never reconciled #3860)" —stage_upload()guard inlaptop/tools/supabase-backup/supabase_backup.py: every pre-finalize escape (compressor spawn failure, dedupe head() failure, KeyboardInterrupt, handled failures) aborts the multipart upload best-effort before propagating;test_upload_abort.py(7 FakeS3-oracle tests) + existing suites pass per the commit record.147f42936(2026-11-27T14:37Z) "supabase_backup: crash-safe finalization + stranded-staging reconcile (supabase backups: staging uploads leak incomplete multipart uploads; staging never reconciled #3860 slice 1)" — copy → manifest write → staging delete ordering, staging deleted only after verified manifest entry + final copy exist;reconcile_staging_object+--reconcile-stagingflag hash-check a stranded staging key against manifest + finals and land it before removing staging;test_finalize.py(8 new tests).What remains open on this issue (all live-bucket work, none of it code):
supabase-backups= 0.--reconcile-staginghas actually been run against the live stranded objectf4b085ed-…(sha2565d38249dd92d15b07beb039e4933125a1cee00b50bd4a1b0167e670555c154e1) — the code path exists; no run record found on this issue.supabase-backupsaborting incomplete multipart uploads after ~7 days, verified in bucket configuration.Wake: a seat/lane with live R2 access to the
supabase-backupsbucket runs (1) and (2), applies/verifies (3), and closes this issue with the listings as evidence. No code work remains for a code lane.Key: 0900-AQ