| 1 | --- |
| 2 | type: idea |
| 3 | id: ida-a0e5d03 |
| 4 | status: raw |
| 5 | title: The second mirrored project needs a mirror identity the schema does not declare |
| 6 | created: 2026-07-31 |
| 7 | source: 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 |
| 13 | that credentials are the host's concern and are not declared there. That holds exactly as long as |
| 14 | the host mirrors one repository. GitHub accepts a given deploy key on one repository only, and |
| 15 | the-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 |
| 17 | a decision about identity, so cosmo's migration is where the deferral runs out. |
| 18 | |
| 19 | The fork is already recorded as deferred, at step 4 of qinling's migrate-and-restore runbook: GitHub |
| 20 | allows a deploy key on only one repo, so the next repo needs either per-repo keys with ssh host |
| 21 | aliases or a machine-user account — unresolved, decide at the second migration. cosmo is the second |
| 22 | migration. 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 | |
| 37 | If a mirror has to name the identity it authenticates with, that is the first field that pushes |
| 38 | machine integration into a domain model that has deliberately kept it out. The current split is |
| 39 | explicit: the-valley defines what a host serves, and consumers supply data directory, unix user, and |
| 40 | SSH keys ([[dcr-0f5d9b1]] |
| 41 | ([dcr-0f5d9b1-cue-config-host-module.md](../decisions/dcr-0f5d9b1-cue-config-host-module.md))). An |
| 42 | identity _name_ is arguably not a credential and could sit in the model as a key the installer |
| 43 | resolves — but the same argument was available for every deployment concern the split rejected, so |
| 44 | it deserves the decision it has not had. |
| 45 | |
| 46 | The alternative is to keep the model silent and let the installer route by mirror URL, which keeps |
| 47 | the 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. |