| 1 | --- |
| 2 | type: decision |
| 3 | id: dcr-24d62f7 |
| 4 | status: decided |
| 5 | title: A mirror publishes main and tags — the review queue is not published |
| 6 | created: 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 |
| 12 | branch found on a mirror is removed on the next push. Topic branches live only on the primary until |
| 13 | they are integrated. |
| 14 | |
| 15 | Until now the mirror hook pushed `+refs/heads/*:refs/heads/*`, so every branch reached the mirror |
| 16 | the instant it reached the primary. On a public mirror that makes _pending review_ and _published_ |
| 17 | the same state: work that has not been read yet is already the project's public face, and |
| 18 | withdrawing it means deleting a branch from a repo other people may have fetched. |
| 19 | |
| 20 | The mirror exists so that consumers can fetch what the project has integrated, and so that |
| 21 | GitHub-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 |
| 23 | queue. 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 |
| 26 | replication layer, "a hot, independent, offsite second copy within seconds of every push". That |
| 27 | remains true for integrated history, which is what a restore has to recover. It is no longer true |
| 28 | for a topic branch: between its push to the primary and its integration, the only offsite copy is |
| 29 | the nightly restic snapshot. S1's "two independent places within minutes" therefore holds for |
| 30 | integrated work and not for in-flight branches. This is accepted deliberately — the exposure window |
| 31 | is 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 |
| 34 | only considers glob refspecs). A separate best-effort sweep does it: list the mirror's heads, delete |
| 35 | every one that is not `main`. The sweep is deliberately independent of the replication push — it |
| 36 | never changes whether that push is reported as succeeding, and a mirror that refuses the deletion |
| 37 | costs a log line. It reads only `refs/heads`, so a namespace the mirror owns and the primary cannot |
| 38 | write — 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 |
| 41 | does; that would be a request for a second, differently-scoped mirror rather than a reason to widen |
| 42 | this one. |