gunk-dev/the-valley
the-valley:oc-90b6f14outcomeabandoned

attest evaluates a tree's checks once

State
abandoned
Created
2026-10-25 by contributor

Body

`valley approve` and the worker evaluate the project's flake to find each required check's derivation before building. For a large flake that evaluation dominates: about 43 s for ten checks whose builds were all cached. Evaluating the same tree again gives the same derivations, so attest can keep a local cache from (tree, check, system, evaluator) to derivation path and skip evaluation on a repeat, as long as a cached derivation still exists in the store.

Done when a repeated attest of the same tree spends no time evaluating, a changed tree, nix version or attest version always re-evaluates, and the evidence attest publishes is identical with or without the cache.

Comments

  1. contributor2026-10-25 19:26 UTC
    Parked 2026-10-25. With a check worker publishing evidence for ready changes, approve runs nothing when every check is covered (bin/valley, evidence reuse), so this cache only speeds repeat local attests. A critique against attest/ at HEAD found real eligibility traps that must be solved first:
    
    1. Exported trees get fresh mtimes, visible as self.lastModified, so the same tree digest can evaluate differently (attest/run.go:81, attest/git.go:217).
    2. Evaluation runs without --no-update-lock-file, so a missing or stale lock can resolve changing inputs (attest/check.go:225).
    3. Inherited nix configuration (NIX_CONFIG, includes, accepted flake config) changes evaluation, and nix --version alone does not identify the evaluator.
    4. Import-from-derivation makes reuse depend on imported outputs.
    5. Store validity of a cached .drv does not prove it belongs to the key, so the cache becomes trusted signing input.
    6. Real-nix tests live in attest/run_test.go with ATTEST_NIX_TESTS=require; check discovery also evaluates (attest/run.go:325).
    7. Evidence equality must be compared at identical revision, signer and provenance.
    
    Finding 1 may matter on its own: a check that reads self.lastModified would never hit the nix store either.
  2. contributor2026-10-31 16:04 UTC
    Evidence, 2026-10-31: an approval of a downstream project's change ran 22 nix checks. Every one that built nothing (the output was already in the store) still took 72-73 s, which is evaluation alone: about 26 minutes of the approval was spent evaluating the same tree 22 times. The operator noticed the approval as unusually slow.
  3. contributor2026-11-08 22:30 UTC
    Duplicate of oc-6a4de90, whose next recommendation (attest evaluates through nix's cache at a locked revision) delivers this outcome. Its critique and evidence are copied there.