gunk-dev/the-valley
the-valley:qn-3387debquestionopen

Where does a broken host automation reach the operator?

State
question or idea
Created
2026-11-19 by contributor

Body

A valley host runs a set of automations: check workers, integrators, restackers, mirrors, the identity compiler, publishers, backups, convergence, and soon jobs that hold credentials such as deploys. `valley telemetry sources` is their inventory and state, and `read` and `follow` show their runs. All of it is pull. A source that goes `failed`, or one that is quietly not doing its job, raises nothing: not in `valley pending`, which is the list of what needs the operator, and not in any client that follows changes. An operator learns of it by asking, or by noticing its consequence later.

Three things are missing and may or may not be one answer:

1. **Attention.** Where a failed or stalled automation reaches the person responsible, and what distinguishes "needs you" from "retrying, will recover".
2. **Granularity.** A source is a kind of automation; the operator's question is about a thing: this project's mirror, this change's checks, this app's deployment. Should state be reported per subject?
3. **Inventory beyond the host's own services.** Jobs a project declares (a deploy, a DNS sync, a scheduled update) and automations that run on clients have no place in the inventory today.

Constraints: the platform serves any operator on any host and is tuned to none; wake on events, not timers; the valley does mechanics and reports, clients and people judge; each building block understandable on its own; no new architecture ahead of the design work on executing jobs (ida-e3da913), which this question should inform.

Wanted: candidate answers with their trade-offs, smallest first.

Comments

  1. contributor2026-11-19 01:42 UTC
    Two independent proposals, from models of two families reading the code at main.
    
    Both agree on the first two steps, which fix the case that raised the question:
    1. `valley pending` also asks the collector for `sources` (it already opens a collector read per host for check costs) and prints a `host` line above "needs you" for each source that is failed, stale or unavailable, with the unit and a `see:` command; nothing when healthy; carried in `--json`.
    2. Declaring a mirror on an existing project queues its first push at activation (`valley-init` already creates each publish queue), so a new mirror either pushes or shows up as failing.
    
    They differ on where per-subject state lives.
    
    A. In telemetry. One new noun, a subject keyed by (source, project, key), with a `subject.state` record (state, desired, observed, last_ok, since, failures, next_retry, reason) written on transitions by instrumented producers, synthesised per unit instance for uninstrumented ones, and reported by clients through the existing report path. `valley pending` hides ok and running and promotes a retrying failure after a client threshold. `follow` moves from a one-second poll to inotify. Its own objection: observe is a host-wide grant, so a contributor cannot see their own project's broken mirror and any observer sees everyone's.
    
    B. In project storage. Generalise the outcome the integrator already writes: an automation records its last word about a subject at `refs/the-valley/outcomes/<automation>/<subject>` (want, have, result of begun, done, failed or uncertain, next of retry, input or none, reason), on transitions only. `valley pending` reads the namespace in the listing it already makes and computes "behind" as have differing from main at read time, so no heartbeat or staleness timer exists. A job whose effect cannot be repeated writes `begun` first, and whatever restarts it records a found `begun` as uncertain: the one requirement placed on an execution service. Every write is a ref move the bus already carries. Its own objection: it adds a namespace, a schema and hook rules for a problem seen once, and earns its cost only if credentialed jobs are coming.
    
    Both decline: host-side alert rules, severities, acknowledgement, a health screen, a prober that polls mirrors.
    
    Each ends on a question for the operator. A: should a declared-but-never-run automation be converged at activation, or wait for the next landing? B: is hearing at the next `valley pending` enough, or must a failure reach the operator while they are not looking? If the latter, the missing piece is a bus remote clients can reach.