land: views-superseded-generation-cleanup

Merged
AF
2d ago
+2460-140

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Reclaims superseded view generations after publication for V1 and V2 views, and gives retention a fair, bounded sweep across both layouts.

  • Generation cleanup now uses its own durable cursor and 64-view batch instead of the root-retirement deadline, which recursive byte accounting could consume before any view was visited and which restarted from the first member on every family visit. Families resolve independently and publish owners only after a complete membership census, so one corrupt registry keeps its views protected without starving healthy-family cleanup, cursor progress, or root-retirement work.
  • After settlement releases the commit barrier, a per-view worker removes superseded generations while preserving pins, readers, shared derived owners, and live SQLite connections; registered V2 sweeps hold the family barrier during unlink and report reclaimed bytes from metadata-only unlinks.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was found.

Summary

Reclaims superseded V1 and V2 view generations after publication.

  • Published views remove old generations while keeping files that are still in use.
  • Retention reaches V1 and V2 views in rotating batches of 64.

All three previous findings are addressed: nested V2 views are included, reclaimed bytes are counted, and family lookup errors are isolated. The supplied threads have no comment numbers, so they have no numbered entries above.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  P[Publication finishes] --> W[Per-view cleanup worker]
  R[Retention pass] --> C[Durable 64-view cursor]
  C --> F[Resolve each family separately]
  F --> S[Generation sweep]
  W --> S
  S --> G[Check current generation and protections]
  G --> K[Keep protected files]
  G --> D[Detach obsolete files under admission barrier]
  D --> U[Unlink detached files and count bytes]

Reviews (7) · Last reviewed commit: "mason: park post-publication cleanup whi..." · Reviewed by Greptile