| 1 | --- |
| 2 | type: outcome |
| 3 | id: oc-87deec8 |
| 4 | status: open |
| 5 | title: The valley can host cosmo |
| 6 | created: 2026-07-31 |
| 7 | blocked_by: [oc-f3bcfd0, ida-7638082, ida-62a7a3b, ida-b037dc9, ida-a0e5d03] |
| 8 | --- |
| 9 | |
| 10 | # The valley can host cosmo |
| 11 | |
| 12 | cosmo is the NixOS configuration that builds five machines, one of which is the pilot host that |
| 13 | serves the valley. It is the obvious second project to migrate, and it is the first project whose |
| 14 | requirements exceed what a valley host serves. This outcome is done when cosmo's canonical origin is |
| 15 | the valley host, its changes are gated at least as well as they are gated today, the automation it |
| 16 | depends on still runs, and its machines deploy without reading GitHub. |
| 17 | |
| 18 | ## What the host serves today, and why it was enough once |
| 19 | |
| 20 | A valley host serves exactly four things: a bare git repository per project, publication mirrors, a |
| 21 | host-level restic backup, and a `ref-updated` bus ([schema/valley.cue](../../schema/valley.cue), |
| 22 | [schema/events.cue](../../schema/events.cue), [nix/valley-host.nix](../../nix/valley-host.nix)). |
| 23 | |
| 24 | That was enough for the pilot repo because the pilot repo's gate is a human reading a diff, its only |
| 25 | consumer is a flake input, and it is the only repository the host's single replication identity has |
| 26 | had to authenticate for. Each of those three facts stops being true with cosmo, and a fourth |
| 27 | requirement — automation — has no equivalent on the host at all. |
| 28 | |
| 29 | ## The four gaps |
| 30 | |
| 31 | **No verification gate.** cosmo's gate is a `pull_request` workflow, and S1 direct-push mode has no |
| 32 | pull request for it to attach to, so the gate does not degrade at migration — it disappears. |
| 33 | [[ida-7638082]] |
| 34 | ([ida-7638082-host-has-no-check-runner.md](../ideas/ida-7638082-host-has-no-check-runner.md)). |
| 35 | |
| 36 | **Automation has nowhere to land, and its current home destroys work.** Three GitHub bots keep |
| 37 | cosmo's flake inputs current, in two distinct shapes — one scheduled, two reacting to an upstream |
| 38 | ref update. Nothing on the host consumes an event and acts, and nothing on the host owns a clock. |
| 39 | Worse, leaving the bots on the mirror is not neutral: the mirror's unpublish sweep deletes their |
| 40 | branches and the forced `main` refspec overwrites their merges, both silently. [[ida-62a7a3b]] |
| 41 | ([ida-62a7a3b-reactions-have-no-home.md](../ideas/ida-62a7a3b-reactions-have-no-home.md)). |
| 42 | |
| 43 | **Consumers read GitHub.** Every cosmo machine auto-upgrades nightly from `github:patflynn/cosmo`, |
| 44 | the pilot host's converge unit both resolves and fetches from GitHub, and cosmo pins the-valley from |
| 45 | its GitHub mirror. Sovereignty of the write path does not make the read path sovereign. |
| 46 | [[ida-b037dc9]] |
| 47 | ([ida-b037dc9-consumers-read-the-mirror.md](../ideas/ida-b037dc9-consumers-read-the-mirror.md)). |
| 48 | |
| 49 | **The second mirror has no identity.** The host's one deploy key is already spent on the-valley, and |
| 50 | GitHub allows a given deploy key on one repository. The migration runbook flagged this fork as |
| 51 | deferred until the second migration; cosmo is the second migration. [[ida-a0e5d03]] |
| 52 | ([ida-a0e5d03-second-mirror-identity.md](../ideas/ida-a0e5d03-second-mirror-identity.md)). |
| 53 | |
| 54 | ## Protection comes before the move |
| 55 | |
| 56 | cosmo's authoritative branches need a protection block before cosmo moves onto the valley. Every |
| 57 | project a host serves runs the push policy, but a project without protection protects no ref, so any |
| 58 | key that can push could move its `main`. cosmo's machines deploy from that branch, and its release |
| 59 | tags are verified on the machines. So the declaration that moves cosmo also protects its `main` and |
| 60 | names a grant opening its release tags to the principal that signs them |
| 61 | ([bd-75c8721](../bugs/bd-75c8721-pushes-could-write-any-namespace.md)). |
| 62 | |
| 63 | ## The phase mapping — what hosting cosmo pulls forward |
| 64 | |
| 65 | **cosmo readiness is not an increment on Phase 1.** This is the decision-relevant content of this |
| 66 | node. Mapped against [roadmap.md](../../design/roadmap.md), the four gaps land like this: |
| 67 | |
| 68 | | Gap | Where it closes | |
| 69 | | ---------------------- | ----------------------------------------------------------------------------- | |
| 70 | | No verification gate | Phase 2 **and** Phase 3 — attestations, then an integrator that requires them | |
| 71 | | Automation has no home | Phase 5 — the first phase in which anything subscribes and acts | |
| 72 | | Consumers read GitHub | Phase 5 if convergence is the valley's job; today, if it is cosmo's own | |
| 73 | | Second mirror identity | Phase 0 — the only gap that is present-phase work | |
| 74 | |
| 75 | The verification gap needs both of Phases 2 and 3, not either. A policy without an attestation is a |
| 76 | document; an attestation without an integrator is a receipt nobody checks; and the integrator's |
| 77 | refusal only exists because of Phase 3's `pre-receive` invariant. The path-scoped policy that would |
| 78 | govern it is already designed ([[ida-1ec03b1]] |
| 79 | ([ida-1ec03b1-path-scoped-verification-policy.md](../ideas/ida-1ec03b1-path-scoped-verification-policy.md))) |
| 80 | and its CUE schema is settled in [[dcr-f41f718]] |
| 81 | ([dcr-f41f718-declared-verification-policy.md](../decisions/dcr-f41f718-declared-verification-policy.md)) |
| 82 | — so what is missing is not the design but the two mechanisms that make it bind. |
| 83 | |
| 84 | So hosting cosmo properly would pull Phases 2, 3, and 5 forward, ahead of S1's own last two |
| 85 | unchecked boxes: a week of real human and agent work without GitHub, and a migration-plus-restore |
| 86 | runbook that is repeatable for the next repo. The roadmap sequences by validation gate, and the |
| 87 | gates of Phases 2, 3, and 5 are about the contributor protocol's ergonomics, pull-based integration, |
| 88 | and reactive controllers — none of them is "a second project is hosted". Hosting cosmo is not a |
| 89 | reason to reorder them; it is a reason to know that it would. |
| 90 | |
| 91 | The competing reading deserves stating, because it is the same argument S1 already accepted once. |
| 92 | S1's direct-push interim mode is deliberately degraded, on the theory that feeling a gate's absence |
| 93 | is the validation signal that motivates building it. Migrating cosmo now, gate and all, would be |
| 94 | that theory applied again. The difference is stakes, and only stakes: the interim mode's pain is a |
| 95 | human merging diffs by hand in the pilot repo, while cosmo's is an unchecked change to the |
| 96 | configuration of five machines that a timer deploys within the hour. |
| 97 | |
| 98 | The cheap half is available regardless. Repointing cosmo's converge unit, `autoUpgrade`, and its |
| 99 | the-valley input at sovereign URLs is a change to one project's configuration and needs nothing new |
| 100 | from the valley — see the reachability question in [[ida-b037dc9]]. |
| 101 | |
| 102 | ## A note that is not a blocker |
| 103 | |
| 104 | cosmo configures classic-laddie, and classic-laddie is the host that would serve cosmo. A cosmo |
| 105 | change that breaks the valley host, sshd, or tailscale removes the push access needed to land the |
| 106 | fix. This is a recovery-path property rather than a blocker: every clone is complete, restic sits |
| 107 | behind the primary ([[oc-9949561]] |
| 108 | ([oc-9949561-push-replication.md](./oc-9949561-push-replication.md))), and the machine can be |
| 109 | repaired at the console or from any clone. It is worth naming because it raises the cost of an |
| 110 | unchecked change, which is the whole argument in [[ida-7638082]]. |
| 111 | |
| 112 | ## Why this outcome depends on S1 rather than the reverse |
| 113 | |
| 114 | One of S1's unchecked acceptance boxes is that the migration-plus-restore runbook exists and is |
| 115 | repeatable for the next repo, and cosmo is that next repo — which invites hanging [[oc-f3bcfd0]] |
| 116 | ([oc-f3bcfd0-s1-holds.md](./oc-f3bcfd0-s1-holds.md)) off this outcome. That would be false twice |
| 117 | over. The box asks for a repeatable runbook, not for a second migration to have happened; and making |
| 118 | S1 depend on this outcome would make S1 wait on Phase 5. The truthful edge runs the other way: this |
| 119 | outcome sits downstream of S1, because cosmo does not migrate onto a host whose durability story is |
| 120 | not yet established. |