| 1 | --- |
| 2 | type: idea |
| 3 | id: ida-62a7a3b |
| 4 | status: raw |
| 5 | title: A project's automation has no home on the host — and leaving it on the mirror destroys work |
| 6 | created: 2026-07-31 |
| 7 | source: cosmo readiness analysis, 2026-07-31 |
| 8 | --- |
| 9 | |
| 10 | # A project's automation has no home on the host |
| 11 | |
| 12 | The bus publishes `ref-updated` and nothing subscribes. A valley host today has no place to put a |
| 13 | program that reacts to a project's events, and no place to put a program that runs on a schedule. |
| 14 | Automation a project depends on therefore has nowhere to land at migration, and — the sharper half |
| 15 | of this — the automation it leaves behind on the GitHub mirror does not merely stop working. It |
| 16 | silently destroys its own output. |
| 17 | |
| 18 | ## Two shapes, not one |
| 19 | |
| 20 | cosmo carries three bots, and they are two different shapes: |
| 21 | |
| 22 | - **Reactive to a ref update.** `update-klaus.yml` and `update-the-valley.yml` fire on |
| 23 | `repository_dispatch` and bump exactly one flake input each. Their input is an upstream push. That |
| 24 | is precisely what `ref-updated` already carries ([schema/events.cue](../../schema/events.cue)) — |
| 25 | the event exists, the subscriber does not. |
| 26 | - **Scheduled.** `update-flake-lock.yml` runs nightly on cron, does a full `nix flake update`, opens |
| 27 | a pull request, and enables auto-merge on it. Its input is a clock. Nothing on the host owns a |
| 28 | clock that can start work inside a project. |
| 29 | |
| 30 | The reactive shape currently runs _through_ GitHub even for a repo whose origin is already |
| 31 | sovereign. the-valley's mirror push triggers its own `.github/workflows/notify-cosmo.yml`, which |
| 32 | sends a `repository_dispatch` to cosmo, which opens the bump PR. Migrating cosmo moves the sink of |
| 33 | that chain onto the valley host while the relay in the middle is still a GitHub Action reacting to a |
| 34 | mirror push. The chain does not survive being cut in one place. |
| 35 | |
| 36 | ## Leaving them running is worse than losing them |
| 37 | |
| 38 | A publication mirror receives `main` and the tags and nothing else; every other head found there is |
| 39 | deleted on the next push ([[dcr-24d62f7]] |
| 40 | ([dcr-24d62f7-publication-mirror-not-review-queue.md](../decisions/dcr-24d62f7-publication-mirror-not-review-queue.md))). |
| 41 | Applied to a bot that writes to the mirror, that invariant has two consequences: |
| 42 | |
| 43 | - A branch the bot opens on the mirror is removed by the next unpublish sweep, so the pull request |
| 44 | it opened points at a deleted branch. |
| 45 | - `main` is replicated with a forced refspec, so a bot pull request that does auto-merge on the |
| 46 | mirror is overwritten by the next push from the primary. The bump is reported as merged and then |
| 47 | is not there. |
| 48 | |
| 49 | Both failures are quiet. The bot's own run succeeds. Removing these workflows is therefore part of |
| 50 | the migration itself, not cleanup that can follow it. The general form: a publication mirror is a |
| 51 | strictly downstream surface, and anything that writes to one loses its work without being told. |
| 52 | |
| 53 | ## What would close it |
| 54 | |
| 55 | Something on the host that holds credentials, acts, and records what it did — the actuator shape in |
| 56 | [[ida-f1b39e8]] |
| 57 | ([ida-f1b39e8-outbound-effects-pass-through-an-actuator.md](./ida-f1b39e8-outbound-effects-pass-through-an-actuator.md)). |
| 58 | The effects these bots need are small and enumerable: edit `flake.lock`, and request integration of |
| 59 | the result. That is a good first vocabulary precisely because it is short. |
| 60 | |
| 61 | This is |
| 62 | [roadmap Phase 5](../../design/roadmap.md#phase-5--effectful-reactions-armstrong-as-controller) |
| 63 | territory — the first phase in which anything subscribes to an event and acts on it. |
| 64 | |
| 65 | ## Open |
| 66 | |
| 67 | - Whether a scheduled trigger belongs on the host at all. A nightly dependency bump is a standing |
| 68 | intention, and standing intentions may be better expressed as demand on the outcome graph |
| 69 | ([[ida-3145b7a]] ([ida-3145b7a-demand-pressure.md](./ida-3145b7a-demand-pressure.md))) than as a |
| 70 | cron entry the host owns. |
| 71 | - Whether a reaction that opens work for review needs a change object to open it against |
| 72 | ([[ida-93e4f91]] ([ida-93e4f91-changes-not-branches.md](./ida-93e4f91-changes-not-branches.md))), |
| 73 | which would make these bots depend on the integrator rung rather than only on the reaction rung. |