gunk-dev/the-valley

ida-62a7a3b-reactions-have-no-home.md

sourcee1a293f6bde4main's published tip history
4.0 KiB · Rendered
1---
2type: idea
3id: ida-62a7a3b
4status: raw
5title: A project's automation has no home on the host — and leaving it on the mirror destroys work
6created: 2026-07-31
7source: cosmo readiness analysis, 2026-07-31
8---
9
10# A project's automation has no home on the host
11
12The bus publishes `ref-updated` and nothing subscribes. A valley host today has no place to put a
13program that reacts to a project's events, and no place to put a program that runs on a schedule.
14Automation a project depends on therefore has nowhere to land at migration, and — the sharper half
15of this — the automation it leaves behind on the GitHub mirror does not merely stop working. It
16silently destroys its own output.
17
18## Two shapes, not one
19
20cosmo 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
30The reactive shape currently runs _through_ GitHub even for a repo whose origin is already
31sovereign. the-valley's mirror push triggers its own `.github/workflows/notify-cosmo.yml`, which
32sends a `repository_dispatch` to cosmo, which opens the bump PR. Migrating cosmo moves the sink of
33that chain onto the valley host while the relay in the middle is still a GitHub Action reacting to a
34mirror push. The chain does not survive being cut in one place.
35
36## Leaving them running is worse than losing them
37
38A publication mirror receives `main` and the tags and nothing else; every other head found there is
39deleted on the next push ([[dcr-24d62f7]]
40([dcr-24d62f7-publication-mirror-not-review-queue.md](../decisions/dcr-24d62f7-publication-mirror-not-review-queue.md))).
41Applied 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
49Both failures are quiet. The bot's own run succeeds. Removing these workflows is therefore part of
50the migration itself, not cleanup that can follow it. The general form: a publication mirror is a
51strictly downstream surface, and anything that writes to one loses its work without being told.
52
53## What would close it
54
55Something 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)).
58The effects these bots need are small and enumerable: edit `flake.lock`, and request integration of
59the result. That is a good first vocabulary precisely because it is short.
60
61This is
62[roadmap Phase 5](../../design/roadmap.md#phase-5--effectful-reactions-armstrong-as-controller)
63territory — 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.