gunk-dev/the-valley
the-valley:oc-cff5a23outcomedone

The host admits check requests and the worker builds them after ready changes and follow runs

State
done
Created
2026-11-13 by contributor
Changes
  • valley:the-valley/vuwvqnmoqyrnzpzkonquwxuwpwkonpru

Body

The host side of author-requested checks.

- The hook (`valleyhook`) admits a new ref kind, `refs/the-valley/check-requests/<principal>/<worktree>/<attempt>`, pointing at a commit. A named principal creates, replaces and deletes requests under its own prefix; a holder of the approve grant may delete any; a soft bound limits how many a principal holds in a project.
- The check worker lists a project's requests and builds each one's required nix checks as it does a ready head's, after batches for ready changes and follow runs, with no preemption. A request's batch is stopped when its ref moves or goes and no ready version holds its tree. A request whose batch failed is not built again until its ref changes or is seen gone.
- Evidence is published as any other and lets nothing land.
- Telemetry names each batch's class, and readers tell a follow run from a request by it.

Comments

  1. contributor2026-11-13 21:44 UTC
    Independent review of the build at 52a6e1e (second model family, 4 minutes). Sent back as a fix round:
    
    Blocker — status/worker.go, request/assess/project: file a request in an early-scanned project for a commit containing a submodule and a change requiring a nix check. Tree hashing rejects the submodule; assess propagates that error, aborting the entire scan before later projects’ ready changes are reached. Every pass repeats this without marking the request failed. Treat unsupported request content as a request-local terminal failure and continue scanning.
    
    Should-fix — status/worker.go, scan/project/readsRequests: an early project’s 32 requests undergo fetching, derivation and full-tree hashing before a later project’s ready work is discovered. Thus requests delay ready work even with every batch slot empty; that assessment cost has no bound here. Discover higher-priority work across all projects before assessing requests.
    
    Should-fix — status/worker.go, listRequests/project/assess: list a running request into pending, then let reap collect its failure before request processes that pending entry. complete writes the failure marker, but neither request nor assess checks it, so admission can immediately rebuild the unchanged request. Recheck the ref-and-head marker during assessment/admission.
    
    Should-fix — status/worker.go, stopSuperseded/assess: the same-tree departure preserves signing safety but can strand work. Start request A requiring check X, delete A, and retain request B with the same tree but a different merge base requiring X and Y. B’s assessment keeps A running; A publishes X, after which the immutable worker ref makes B terminally incomplete. Preserve the batch only if its checks plus existing evidence cover B’s requirements, or restore the brief’s cancellation rule.
    
    Should-fix — status/mainstate.go, mainLines; status/checkcost.go, readBuilds/parsePage: exclusion depends on seeing a request’s batch boundary. During a long batch, its start can leave the bounded telemetry window while a failed check.result remains and its end has not occurred. That result has no class and can mark main “muddy.” Carry class on individual check results rather than relying on boundary correlation.
    
    Note — valleyhook/checkrequest.go, checkRequests/checkCheckRequest; status/worker.go, project/attest: 32 bounds outstanding names, not expenditure. Concurrent creates can exceed it; moving existing refs permits unlimited churn. Even 32 static requests can occupy min(32, batches) slots indefinitely, and completed requests remain eligible for repeated assessment. Tree sizes, build duration, cumulative evidence and output storage have no request-specific bound. Document these limits; stronger guarantees require declared resource limits and serialized admission.
    
    I found no ownership, case, trailing-component, lookalike, symbolic-ref, non-commit-target or protection bypass. Other namespace dispatch remains intact. Requests publish under the same evidence ref and signer as ready work and cannot authorize a landing; arbitrary commit contents were already pushable through topic refs.
    
    The single most valuable change is to defer request assessment until every project’s ready and follow work has been discovered.
  2. contributor2026-11-13 22:22 UTC
    Second independent review, of head b37d07c. Sent back as a second fix round; the blocker is fixed at its root by letting the worker add missing checks to evidence it already published:
    
    Original findings: (1) closed in request/assess/unbuildable; (2) the original cross-project delay is closed in scan, with a scheduler exception below; (3) closed in marked/request/assess; (4) only partly closed in stopSuperseded, because cancellation can leave publishable evidence; (5) the off-main boundary-loss case is closed in mainLines, but another masking case remains.
    
    Blocker affecting ready work — assess/stopSuperseded: request A builds X; ready B needs X and Y on the same tree, through a different merge base or policy. B marks the destination wanted and waits for A. A publishes X; subsequent assessments refuse to build Y because the worker ref exists. Ready work is stranded, with an operator workaround required. Fix: support adding missing checks to existing worker evidence; cancellation alone cannot handle evidence already published.
    
    Should-fix, ready/follow — assess/change/follows/project: a non-origin coverage error returns false, nil, so change reports read=true. An existing build/push backoff can consequently be pruned without being read; stopSuperseded can also cancel useful same-tree work because wanted was never set. More seriously, if the follow walk succeeds but its subsequent coverage read fails transiently, follows writes quietMain with an empty Wait, suppressing retries on that tip. Ready changes themselves remain eligible and get a diagnostic. Fix: distinguish unread assessment from successfully finding nothing runnable; unread heads must prevent pruning, cancellation and quiet-main updates.
    
    Should-fix, follow display — mainLines: X fails on main’s tip; later, a request passes X on a different tree belonging to an older walked commit. The loop encounters that pass first and breaks, hiding the tip failure and reporting clearing. Fix: select results per tree and prevent an ancestor’s later result from overriding a descendant’s failure.
    
    Should-fix, scheduling — scan/readRequests/reap: one request occupies the only slot while ready A remains queued. A becomes superseded by a version needing no checks. The next scan finds no higher-class work and enters phase two; the running request then completes. readRequests calls reap, which starts old A through admit(false), and request assessment continues while ready work runs. Fix: discard the obsolete queue before phase two. I found no path admitting an old request queue: admit(false) blocks those jobs.
    
    Should-fix, requests only; finding 4 remains partial — stopSuperseded/complete/assess: A builds X, disappears, and B needs X,Y on the same tree. Cancellation reaches A after its local update-ref; complete records cancellation but leaves that ref. B subsequently publishes the stored X-only ref, then becomes terminally incomplete. A successful completion racing cancellation has the same outcome. Fix: permit additive completion, or explicitly handle cancelled artifacts and late successful publication.
    
    Should-fix, requests only — project/prune/readRequests/publish: a request’s push fails and records backoff. On the next scan, project prunes before request assessment; no met entry preserves that push key. Assessment immediately retries the stored ref, resetting the backoff repeatedly. Fix: retain request push failures until request assessment accounts for them, independently of wanted.
    
    Note on origin errors: coverageIn/cover wrap both direct evidence listing/fetch failures. However, readSigners→hostSigners already converts origin-read failures into a diagnostic and empty coverage, and follows already absorbs failed main-walk reads. Those pre-existing paths need error propagation if every origin failure must stop the pass.
    
    I found no policy-directory leak in projectRead/release, including error exits.
    
    The single most valuable change is to let ready work add missing notes to existing worker evidence using the additive publication mechanism already available to follow runs.
  3. contributor2026-11-13 23:14 UTC
    Third independent review, of head 568c4c9: no blocker. Marked ready at that head; the four should-fix findings are filed as follow-ups.
    
    No blocker found in this diff. The earlier missing-check blocker, unread-assessment finding, main-display masking, obsolete-queue admission, cancelled-artifact incompleteness, and request push-backoff pruning are closed. I found no successful assess path that reports unread forever.
    
    Should-fix, ready work can remain stranded — assess: origin holds an admissible X note for attribute A, but current policy requires X=B. The worker correctly avoids replacing it, but its recommended recovery is ineffective: coverage classifies that mismatch as failed, and [approve](status/approve.go:817) refuses even with --build-here. This is an existing constraint, not a new blocker. Fix the diagnostic to report the actual obstruction and a valid recovery, such as changing the tree or check identity.
    
    Should-fix, ready delay and wasted work — attest/complete/assess: an additive batch stores its notes, then its push fails. Complete records a build failure; assess ignores the stored notes because origin already holds the ref. Backoff prevents rebuilding every pass, but every expired retry reruns attest, starting with a 15-minute delay instead of the ordinary push recovery. Fix: retry stored additions through the union-and-lease publisher without rebuilding.
    
    Should-fix, requests only — complete: that same additive push failure permanently marks the request spent, even when every check passed. A transient publication failure therefore strands that request until its ref changes. Fix: distinguish publication failure from check failure and retain publication retries.
    
    Should-fix, destination race that can delay ready work — stopSuperseded/attest/complete: cancellation kills attest while its git push is running; complete releases the destination, and a subsequent batch for that destination can start before the surviving git exits. [gitRemote](attest/git.go:55) gives that child no parent-death handling. Leases protect origin’s notes, but the destination lock does not cover this interval; duplicate work and push failures remain possible. Fix: retain the destination through publisher termination.
    
    Note, publication safety — publishOnto/checkAttestationUpdate: I found no path dropping an existing origin note or publishing evidence for the wrong tree. Publication preserves held entries, leases the remote update, and the hook verifies preservation and subject identity. The local ref can temporarily contain only the latest batch’s notes.
    
    The single best improvement is a resumable, worker-owned additive publication step that retries stored notes and holds the destination until publication finishes.
  4. contributor2026-11-14 02:16 UTC
    Version 4 (ddd19df) changes only the worker end-to-end test: the scenario that lands a floor withdraws two changes earlier scenarios left ready, so the worker extends one change's evidence, not three. No worker code changed from version 3.
    
    The worker built version 3's 28 checks together and the end-to-end check took 930 s against a 541 s median, which read as a regression. It was not: built at main, at this head and at main again on one machine, the test took 1,179 s, 1,467 s and 1,542 s, with 32 worker passes in each and 1,246, 1,209 and 1,265 ssh logins. All 28 checks pass on the worker at ddd19df.
  5. contributor2026-11-14 02:25 UTC
    Change valley:the-valley/vuwvqnmoqyrnzpzkonquwxuwpwkonpru landed: v4 as 8bf5a934d291942f955c6a318f60652e2974c4a6.
    
    Every change the knot links has landed and it has no active children, so klaus set it done.