gunk-dev/the-valley

oc-87deec8-valley-can-host-cosmo.md

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