gunk-dev/the-valley

ida-a0e5d03-second-mirror-identity.md

sourcefdd1d5be78f1main's published tip history
3.2 KiB · Rendered
1---
2type: idea
3id: ida-a0e5d03
4status: raw
5title: The second mirrored project needs a mirror identity the schema does not declare
6created: 2026-07-31
7source: cosmo readiness analysis, 2026-07-31
8---
9
10# The second mirrored project needs an identity the schema does not describe
11
12[schema/valley.cue](../../../schema/valley.cue)'s `mirrors` field declares URLs and says outright
13that credentials are the host's concern and are not declared there. That holds exactly as long as
14the host mirrors one repository. GitHub accepts a given deploy key on one repository only, and
15the-valley's mirror has already consumed the host's replication identity — the single
16`valley-git-ssh-key` the git user pushes with. A second mirrored project cannot authenticate without
17a decision about identity, so cosmo's migration is where the deferral runs out.
18
19The fork is already recorded as deferred, at step 4 of qinling's migrate-and-restore runbook: GitHub
20allows a deploy key on only one repo, so the next repo needs either per-repo keys with ssh host
21aliases or a machine-user account — unresolved, decide at the second migration. cosmo is the second
22migration. This node states the fork and does not take it.
23
24## The two ways out
25
26- **Per-repository deploy keys plus ssh host aliases.** Each mirror URL names an alias, and the git
27 user's ssh config maps each alias to its own key. Blast radius stays per repository, and no GitHub
28 account is created. The cost is that the fanout lives in ssh config the schema cannot see, so the
29 declaration and the thing that makes it work drift apart silently — a mirror URL that names an
30 unconfigured alias looks fine and fails only in a log line, because replication is best-effort.
31- **One GitHub machine user.** A single account whose key authorizes every mirrored repository. One
32 credential, one rotation, no per-repo fanout. The cost is a second GitHub identity to own and
33 audit, and a credential whose reach grows with every repository added.
34
35## What it costs the schema either way
36
37If a mirror has to name the identity it authenticates with, that is the first field that pushes
38machine integration into a domain model that has deliberately kept it out. The current split is
39explicit: the-valley defines what a host serves, and consumers supply data directory, unix user, and
40SSH keys ([[dcr-0f5d9b1]]
41([dcr-0f5d9b1-cue-config-host-module.md](../decisions/dcr-0f5d9b1-cue-config-host-module.md))). An
42identity _name_ is arguably not a credential and could sit in the model as a key the installer
43resolves — but the same argument was available for every deployment concern the split rejected, so
44it deserves the decision it has not had.
45
46The alternative is to keep the model silent and let the installer route by mirror URL, which keeps
47the schema clean at the price of a declaration that cannot be validated on its own.
48
49## Related
50
51- [[oc-87deec8]]
52 ([oc-87deec8-valley-can-host-cosmo.md](../outcomes/oc-87deec8-valley-can-host-cosmo.md)) — the
53 outcome this blocks; the only one of its blockers that is Phase 0 work.
54- [[bd-8a591dc]]
55 ([bd-8a591dc-machine-credentials-never-expire.md](../bugs/bd-8a591dc-machine-credentials-never-expire.md))
56 — whichever way the fork is taken, the credential it creates is another permanent grant.