gunk-dev/the-valley
the-valley:oc-4a48ff8outcomedone

The check worker builds several ready changes at once, and takes on new ones while long batches run

State
done
Created
2026-11-03 by contributor
Changes
  • valley:the-valley/ktmvkmkpuspmtpzypptksslostvuvlun

Body

Measured 2026-11-03 on the deployment host: a pass runs one change's batch at a time, and the oneshot unit starts no second pass while one runs. ovrm v6 and smuk v2, ready at 14:16–14:17, waited about 22 minutes behind yvup (7 min) and a downstream project's wnzs (19 min), then built in 78 s.

Outcome: a pass schedules. It runs up to N batches at once, and picks up newly ready changes while long batches run, so a short change never waits behind a long one.

Plan and critique: consult thread worker-concurrency (codex critic, 2026-11-03).

Comments

  1. contributor2026-11-03 18:23 UTC
    Design, 2026-11-03, after a codex critic review (consult thread worker-concurrency).
    
    The pass stays a oneshot and becomes one scheduler loop. The loop alone owns admission, publication, failures.json, wake handling and telemetry. Each batch is one attest child, and children return immutable completion results to the loop. Up to `services.valley.worker.batches` batches run at once (default 2). The loop re-lists when a batch ends, when wake marks arrive, and at the worker's interval.
    
    The critic's points, all in the brief:
    - **Memory:** maxJobs applies per daemon connection, so batches multiplies buildSlots × maxJobs. Keep N at 2 until measured.
    - **Deduplication:** by destination attestation ref (project, tree, signer), reserved through publication. attest's update-ref is unconditional.
    - **Wake marks:** they are invalidation signals. Never call claimWake again while holding the claim. Acknowledge only after a complete scan. The worker's own pushes cost at most one extra scan.
    - **failures.json pruning:** only after complete scans, never pruning a running key. Save each completed failure promptly.
    - **A failed origin read:** stop admitting, drain the children, leave the claim unacknowledged, then fail.
    - **Telemetry:** an explicit attempt identity on every record, and a snapshot of all active batches.
    - **The interval:** passed in explicitly, since OnUnitInactiveSec gives no recovery passes while the oneshot is activating.
    
    Launched as run 20261103-1823-9c212906.
  2. contributor2026-11-03 20:13 UTC
    Implementation review (codex critic, 2026-11-03 20:12Z): no blocking defect. Medium findings: attest_run missing from batch.end and backoff; the interval parser rejects systemd month and year spans; no direct test of a fatal read with children running. Low: seen and said grow over a long pass. The stale-queue trade-off is accepted and to be documented. worker-e2e grew to 712 s in the guest. A follow-up round on ktmv addresses all of these.
  3. contributor2026-11-03 21:20 UTC
    Change valley:the-valley/ktmvkmkpuspmtpzypptksslostvuvlun landed: v2 as bd760cae2dad89c77d0985cdd15c4501a22e7bd3.
    
    Every change the knot links has landed and it has no active children, so klaus set it done.