Sites 0.4.0: lifecycle, export, GC #6

Merged
oliver.maklott merged 1 commit from phase-9 into main 2026-11-20 11:52:50 +01:00

Phase 9 of the Sites plan (spec S13), the last pack phase.

  • Space hooks (spaceLifecycleHooks, Limedoc 0.85.0): closed / archive-started take every site in the space subtree offline (notice space-closed). frozen only refuses publishing, which was already checked at publish time; reopen/thaw allows it again.
  • Deprovision hook: releases in every target are revoked and the person's sites go offline (owner-deprovisioned), with no export. On a merge (mergedInto), the sites stay and belong to the surviving account.
  • Reconcile (startup hook, every 5 min, onBusy: 'skip' across instances) repeats the space rule for missed hooks. A site whose folder is gone goes offline only when the folder is seen missing on two passes ≥ 10 min apart, so an index hiccup never takes a site down.
  • ZIP export (GET sites/:id/export): the published snapshot as served, available to the owner, approvers and admins while online and for 30 days after takedown; panel link "Download the published version". The ZIP writer is small and has no dependency (deflate-raw + CRC-32).
  • GC (hourly): content not referenced by sites, kept desired states or the library catalog is deleted only after it has been unreferenced for 1 h. GC shares a content lock with publishes and library adds (lock order content → site), so an old object cannot be reused at the moment it is deleted.
  • takeDownSites(ids, …) is factored out of takeDownSitesOf. Notice texts are added for the new reasons.

Tests: ZIP (CRC vector, inflate round trip), closed vs frozen space, deprovision vs merge, reconcile on the 2nd look, GC grace and 30-day retention. Pack suite 63/63.

Also checked: loading the pack with bootstrapPluginsForTest(['sites']) and firing core's runSpaceLifecycleHooks / runSubjectDeprovisionHooks takes the right sites down. This was a throwaway check because it imports plugin-sdk/host.

🤖 Generated with Claude Code

Phase 9 of the Sites plan (spec S13), the last pack phase. - **Space hooks** (`spaceLifecycleHooks`, Limedoc 0.85.0): `closed` / `archive-started` take every site in the space subtree offline (notice `space-closed`). `frozen` only refuses publishing, which was already checked at publish time; reopen/thaw allows it again. - **Deprovision hook**: releases in every target are revoked and the person's sites go offline (`owner-deprovisioned`), with no export. On a merge (`mergedInto`), the sites stay and belong to the surviving account. - **Reconcile** (startup hook, every 5 min, `onBusy: 'skip'` across instances) repeats the space rule for missed hooks. A site whose folder is gone goes offline only when the folder is seen missing on two passes ≥ 10 min apart, so an index hiccup never takes a site down. - **ZIP export** (`GET sites/:id/export`): the published snapshot as served, available to the owner, approvers and admins while online and for 30 days after takedown; panel link "Download the published version". The ZIP writer is small and has no dependency (deflate-raw + CRC-32). - **GC** (hourly): content not referenced by sites, kept desired states or the library catalog is deleted only after it has been unreferenced for 1 h. GC shares a `content` lock with publishes and library adds (lock order content → site), so an old object cannot be reused at the moment it is deleted. - `takeDownSites(ids, …)` is factored out of `takeDownSitesOf`. Notice texts are added for the new reasons. Tests: ZIP (CRC vector, inflate round trip), closed vs frozen space, deprovision vs merge, reconcile on the 2nd look, GC grace and 30-day retention. Pack suite 63/63. Also checked: loading the pack with `bootstrapPluginsForTest(['sites'])` and firing core's `runSpaceLifecycleHooks` / `runSubjectDeprovisionHooks` takes the right sites down. This was a throwaway check because it imports `plugin-sdk/host`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Phase 9: lifecycle hooks, reconcile, ZIP export, garbage collection. Release 0.4.0.
All checks were successful
Publish / dev-image (pull_request) Successful in 0s
Publish / test (pull_request) Successful in 58s
Publish / pack-and-publish (pull_request) Has been skipped
15558420e7
A closed or archived space takes its sites offline; a frozen one only
refuses publishing. Deprovisioning revokes releases and takes sites down
(a merge hands them to the surviving account). A 5-minute reconcile
repeats the rules and removes sites whose folder is gone on two looks.
Owners and approvers download the published snapshot as ZIP while online
and for 30 days after. The collector deletes content unreferenced for an
hour, under one lock with publish and library writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
limedoc-plugins/sites!6
No description provided.