Skip to content
quarry View Ticket
Login

View Ticket

2026-09-24
00:52 • Ticket [0c731b1455] Should deleted repositories be recoverable, and for how long? status still Closed with 1 other change artifact: 46da3df4c6 user: zeitgeist
2026-08-23
12:15 • Closed ticket [0c731b1455]. artifact: 337ad74f8f user: ai-local
2026-08-19
12:10 • Ticket [0c731b1455]: 1 change artifact: 3f63e44c06 user: dmestas
11:04 • Ticket [0c731b1455]: 2 changes artifact: 873d2921d0 user: dmestas
2026-08-18
18:40 • Ticket [0c731b1455]: 1 change artifact: db31c7f01e user: dmestas
11:51 • New ticket [0c731b1455]. artifact: afa9aa3b53 user: dmestas

Should deleted repositories be recoverable, and for how long?

Closed0c731b1455ef5277b789f0c86a7d1e48b214eca4Created 104.5 days agoUpdated 67.9 days ago
Description2026-08-18 11:51:12
`repo.delete` is immediate and total: the store, the derived index, and every forge row keyed to the repository. There is no undo. The question is whether deleted repositories should survive for a grace period — GitHub keeps them 90 days, restorable by an admin.

Worth deciding deliberately rather than by default, because the two obvious answers are both wrong in different ways.

## zit already has an opinion, and it is not "30 days"

`zit purge` moves check-ins to a **graveyard**: `zit purge list` shows what is there, `zit purge undo ID` restores it, `zit purge obliterate ID` discards it for good. Three states, restored explicitly, never on a timer.

Its documentation also draws the line this ticket has to draw:

> This is the tool for the ordinary accident — an `add .` that swept in a build tree, noticed before anyone else has the check-in. It is **NOT a takedown**: a purge is local, so a peer that already holds the content keeps it… Use `zit shun` when the content must never exist here again.

and:

> The graveyard is local and disposable, like the undo journal: it is never an artifact, never syncs, and is not carried by a clone. Losing it costs recoverability, not data.

That is the whole design in two paragraphs, and quarry should use the same vocabulary rather than invent one. A forge whose "delete" means one thing and whose store's "purge" means another is a forge nobody can reason about.

## Why a plain 30-day window is the wrong default

**It collides with the reason people delete things urgently.** The most common urgent deletion is "this repository contains something it should not" — a key, a customer file, a private repository that was briefly public. For that user, "we kept it for 30 days" is the failure, not the feature. A retention window has to be something the deleting user can see and override at the moment of deletion, not a silent policy.

**Disk is not free here.** tcl's store is 335 MB and tk's 277 MB. A fleet that holds every deleted repository for a month is sized for its deletions as well as its contents, and nothing currently reports how much the graveyard holds.

**Name reuse is unresolved.** Delete `foo`, create a new `foo`, then restore the old one — into what name? Either deletion reserves the name for the window (surprising: you cannot recreate a repository you just deleted) or restore has to rename (surprising in the other direction). GitHub reserves. Whichever is chosen has to be chosen, not discovered.

**And quarry's deletion is already narrower than it looks.** The store is destroyed only when quarry created it; adopted stores are only unregistered, and `repo.remove` — which leaves everything on disk — already IS the recoverable path for the common case. Some of the demand for a grace period is met by the operation that already exists, and the surfaces should say so more clearly.

## Shape worth considering

1. **A graveyard, not a timer.** Deletion moves the store aside and records a row: repository, when, by whom, reason. `repo.graveyard` lists it, `repo.restore` brings one back, `repo.obliterate` finishes the job. Same three states as zit, same words. 2. **Retention as an operator policy, not a product promise.** `--graveyard-days N`, default off or short. Off means today's behaviour, which is honest. 3. **An escape hatch at the point of deletion.** `obliterate: true` on `repo.delete` skips the graveyard entirely, for the leaked-secret case. The UI should offer it plainly rather than hiding it behind a second workflow. 4. **Say which one is happening.** The confirmation must state whether the data is recoverable, because "delete" currently means destroyed and would come to mean something else. 5. **Report what the graveyard holds** on `/fleet`, next to the ingest health. An invisible store of deleted repositories is how a disk fills.

## What this does NOT cover

Content already pushed to a peer. As zit says, a purge is local and a peer that holds the content keeps it. Deleting a repository from quarry does not unpublish anything anybody cloned, and no retention policy changes that. If quarry ever needs a takedown story it is `zit shun`, and that is a different ticket.

## Related

- `a78a1bd913` — repository lifecycle, where deletion landed. - `8152617b99` — bound and queue expensive work: obliterating a large store is bulk-lane work.

2026-08-23 12:15:49

Decided 2026-08-23. Answering the question this ticket asks, so it closes; the verbs it implies are lifecycle work and belong to a78a1bd913.

Should deleted repositories be recoverable? Yes, by moving them aside — never by a timer.

For how long? Until an operator says otherwise. quarry makes no retention promise at all.

The reasoning

The expensive part of GitHub's 90-day model is the TIMER, not the graveyard. A timer needs a reaper, quota accounting and a disk-full story: three mechanisms to make one undo button work, which fails the smol contract's "programs that can be finished". A graveyard with no timer needs none of them — it is a rename. That is zit's design (purge list / undo / obliterate, explicit-only, never on a clock), and it is why zit's design is right.

A retention window we advertise and do not enforce would also break the standing invariant: never show false data.

The decisions

  1. repo.remove is the default verb in the UI. It already exists — "stop serving a repository; the store on disk is left untouched" — and is already the recoverable path for the common case. Much of the demand for a grace period is met by an operation we shipped and never advertised. The surfaces must say what it leaves behind.

  2. repo.delete moves the store to a graveyard rather than unlinking it. Three states, zit's: repo.graveyard lists, repo.restore brings one back, repo.obliterate finishes the job. quarry stops being the thing that destroys a store by default.

  3. No retention timer — absent, not merely off. Retention is the operator's filesystem and backup policy. quarry's job is to REPORT what the graveyard holds, on /fleet beside ingest health, because an invisible store of deleted repositories is how a disk fills. mv and rm already exist and are better at this than we would be.

  4. obliterate: true at the point of deletion, offered plainly rather than hidden behind a second workflow. The urgent deletion is the leaked-secret one, and for that user "we kept it for 30 days" is the failure, not the feature. A policy built for the accidental case must not slow the deliberate one.

  5. No name reservation. A name is a mount point; the store is the identity, which is the fossil-compatible view. Restoring into a name something else now occupies requires an explicit new name rather than clobbering or refusing. Deliberately unlike GitHub: reserving means you cannot recreate a repository you just deleted, which surprises the common case to protect the rare one.

  6. The graveyard is local and disposable. Never an artifact, never syncs, not carried by a clone — zit's rule verbatim. Losing it costs recoverability, not data.

  7. The confirmation states two things: whether this deletion is recoverable, and that it does not unpublish anything a peer already holds. Deleting from quarry is not a takedown; that is zit shun, and a different ticket.

One deviation from the shape proposed above

This ticket proposed repo.restore; zit's word is purge undo. Keeping repo.restore: repo.undo reads as "undo the last repository operation", a different and more dangerous-sounding thing. Two verbs match zit exactly, the third is disambiguated deliberately rather than by accident — worth stating, since matching zit's vocabulary was this ticket's own principle.