gunk-dev/the-valley

dcr-24d62f7-publication-mirror-not-review-queue.md

source5bb3a7736fe4main's published tip history
2.5 KiB · Rendered
1---
2type: decision
3id: dcr-24d62f7
4status: decided
5title: A mirror publishes main and tags — the review queue is not published
6created: 2026-07-25
7---
8
9# The mirror is a publication mirror, not a copy of the primary
10
11**Decided 2026-07-25.** A declared mirror receives `main` and the tags, and nothing else. Any other
12branch found on a mirror is removed on the next push. Topic branches live only on the primary until
13they are integrated.
14
15Until now the mirror hook pushed `+refs/heads/*:refs/heads/*`, so every branch reached the mirror
16the instant it reached the primary. On a public mirror that makes _pending review_ and _published_
17the same state: work that has not been read yet is already the project's public face, and
18withdrawing it means deleting a branch from a repo other people may have fetched.
19
20The mirror exists so that consumers can fetch what the project has integrated, and so that
21GitHub-hosted consumers can depend on it at all. It is not the durability layer — restic is
22([dcr-d7952bc](./dcr-d7952bc-phase0-replication-github-transitional.md)) — and it is not the review
23queue. Narrowing it costs nothing it was actually for.
24
25**What this changes about [[dcr-d7952bc]].** That decision counts GitHub as Phase 0's live
26replication layer, "a hot, independent, offsite second copy within seconds of every push". That
27remains true for integrated history, which is what a restore has to recover. It is no longer true
28for a topic branch: between its push to the primary and its integration, the only offsite copy is
29the nightly restic snapshot. S1's "two independent places within minutes" therefore holds for
30integrated work and not for in-flight branches. This is accepted deliberately — the exposure window
31is a branch's review latency, and the alternative is publishing everything unread.
32
33**Mechanism.** The heads refspec names one ref, so `git push --prune` no longer prunes heads (prune
34only considers glob refspecs). A separate best-effort sweep does it: list the mirror's heads, delete
35every one that is not `main`. The sweep is deliberately independent of the replication push — it
36never changes whether that push is reported as succeeding, and a mirror that refuses the deletion
37costs a log line. It reads only `refs/heads`, so a namespace the mirror owns and the primary cannot
38write — GitHub's read-only `refs/pull/*` — is never touched.
39
40**Revisit trigger.** A consumer that needs to fetch pre-integration work from a mirror. Today nobody
41does; that would be a request for a second, differently-scoped mirror rather than a reason to widen
42this one.