gunk-dev/the-valley
the-valley:ida-e3da913idearaw

A build service owns build requests, results and logs

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

Body

Three client-side attempts at asking the worker for a commit's checks showed what a client cannot own: a request's lifetime, the result of a request, and the build's output. A client can be killed at any moment, a diagnostics stream is not a record, and logs filed under the worker's own runs are hard to ask for.

The direction: building is a service of the valley. A caller submits a build of a commit's checks and gets an identifier. The service owns the request's lifetime (it ends when the work ends or expires), records a durable result per build, keeps the output where the caller can read and follow it, and reports state without the caller reconstructing it from telemetry. Landing still judges signed evidence; the service's result says what happened to a build.

Questions for the architecture review: whether the check worker becomes this service or sits behind it; whether a build is addressed by the service's own identifier, ignorant of projects, with project access checked in front; how results and logs are retained; how a client is told (events rather than polling); and what of today's check requests, telemetry log tails and `valley checks --build` it replaces.

Until then `valley checks --build` (oc-547a848) lands as a stopgap with its limits stated, and oc-37c94d5 adds reading a build log by run and check.

Comments

  1. contributor2026-11-15 15:51 UTC
    Evidence for the review, from fixing valley checks --build: a failed build has no durable result. A pass is signed evidence and is recovered by reading refs; a failure exists only as records in the worker's telemetry stream, which drops records by design when two are emitted at once. A client waiting on a build whose failure record was dropped has nothing to end its wait but its time limit. Build logs are likewise kept by Nix on the builder and reached by `nix log`, with a bounded copy in telemetry. A build service would own the request, its result (pass or fail) and its log as durable facts.
  2. contributor2026-11-16 01:48 UTC
    Operator's thought, 2026-11-16: TPMs as the basis for registering a trusted builder pool. A builder enrolls a signing key with evidence that it is bound to that machine's TPM, the way a human approval key now enrolls with a YubiKey attestation: the registry entry carries the evidence and the compiler verifies it against a manufacturer root it pins. That would make `bound: "host"` checkable for builders instead of declared.
    
    What a TPM adds beyond key binding: a quote of measured boot state, so a pool could admit only builders that booted a known system. What stands in the way: TPMs sign with RSA and NIST P-256, not Ed25519, and the registry and note format accept only Ed25519. Options to weigh at the review: a second key class for builders; or an Ed25519 key sealed to the TPM (usable only on that machine, but in memory while in use, so weaker than a key that never leaves). A TPM has no presence check, so this is for machine keys only, never approvals.
  3. contributor2026-11-16 14:57 UTC
    Scope decision from the operator: the build service design also covers execution that is not a build. The cases in view are jobs that perform an effect with a credential after a change lands: deploying a release to a hosting provider, syncing DNS records, bumping a pinned input in another project. Today a valley host can check a change and cannot run such a job; projects that need one keep it outside the valley.
    
    So the design question widens from "who owns build requests, results and logs" to "who owns execution requests": what may run, triggered by which recorded event, with which credentials, on which runners, and what record and logs it leaves. Builds are the case with no credentials and no effect. Deploy targets sharing one release and effect model (ida-1c6ac56) and the release environment question (qn-f924f58) meet here.
    
    Until that design exists, deployments run effects with their own tooling outside the-valley.