| 1 | # Verification that can travel with a change |
| 2 | |
| 3 | The-valley's strongest verification idea is that a check result should remain useful when work moves |
| 4 | between machines, authors, and integration attempts. A developer should not have to repeat an |
| 5 | expensive computation merely because another service wants to see it happen. That idea has strong |
| 6 | foundations in build systems, incremental computation, and database concurrency control. Its |
| 7 | difficult part is establishing what the computation actually means, who can be trusted to report it, |
| 8 | and when its result still applies. |
| 9 | |
| 10 | This chapter's research conclusion is favorable to portable evidence and selective reuse. It is |
| 11 | considerably less favorable to treating signed local execution plus eventual auditing as a |
| 12 | substitute for a protected verification boundary in adversarial settings. Those are separate |
| 13 | architectural choices. The first does not require the second. |
| 14 | |
| 15 | This is a research assessment of repository commit `5bb3a7736fe49b0cc4914299b142c0c9bafb6870`, with |
| 16 | external sources consulted on 2026-09-20. It is not a change to project policy. **Established |
| 17 | result** means a result or construction in the cited literature; **documented behavior** means a |
| 18 | system's published contract; **inference** means this report's reasoning about the-valley; |
| 19 | **recommendation** means a proposed direction; **hypothesis** means something requiring measurement. |
| 20 | The [annotated source register](./sources-verification.md) records reading depth and limitations. |
| 21 | |
| 22 | ## 1. What exists, and what remains a claim |
| 23 | |
| 24 | The repository contains substantial verification machinery. The |
| 25 | [attestation helper](../../attest/run.go) exports a committed tree, runs selected checks, records |
| 26 | their subjects and results, signs statements, and stores them in Git refs. |
| 27 | [Verification](../../attest/verify.go) checks statement syntax, schema, signatures, and optionally |
| 28 | the subject tree. It does not independently execute the claimed check. The |
| 29 | [integrator](../../integrator/refs.go) computes a candidate landing, derives requirements from its |
| 30 | own policy sources, gathers evidence, and asks the |
| 31 | [verdict library](../../integrator/verdict/verdict.go) whether that evidence transfers. Its |
| 32 | protected-ref update uses compare-and-swap. |
| 33 | |
| 34 | The distinction between implementation and aspiration matters. The |
| 35 | [roadmap](../../design/roadmap.md#phase-6--trust-backstop) places witness rebuilding and the |
| 36 | transparency log in a later phase. A signed statement about execution is implemented. The inspected |
| 37 | implementation does not yet provide independent re-verification of those local execution claims. Nor |
| 38 | is a quantitative assurance level established merely by describing a future trust score. |
| 39 | |
| 40 | The current design separates two claims. A pure check claims that a fixed computation over fixed |
| 41 | inputs produced a result. An effectful check claims that an environment observed a result at a |
| 42 | particular time. That distinction is valuable. It should be supplemented by several independent |
| 43 | acceptance questions: |
| 44 | |
| 45 | | Question | What can answer it? | What does not answer it? | |
| 46 | | ------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------- | |
| 47 | | Are these the bytes the signer signed? | Signature verification and unambiguous encoding | Whether the signer told the truth | |
| 48 | | Does the evidence describe the required computation? | Binding to the approved definition, inputs, platform, and policy | A familiar check name | |
| 49 | | Does the required computation support the claimed result? | A trusted execution boundary, independent execution, or suitable proof | A self-reported executable hash | |
| 50 | | Is that computation an adequate test of the desired property? | Specification, test design, review, and empirical validation | Reproducibility alone | |
| 51 | | Is accepting it authorized now? | Current authorization and revocation policy | An old valid signature alone | |
| 52 | |
| 53 | These are not five competing definitions of trust. They are five obligations that an acceptance |
| 54 | decision can accidentally collapse into one green result. |
| 55 | |
| 56 | A successful independent rerun supports the claimed result under the rerun's assumptions. It does |
| 57 | not prove that the signer's particular historical execution occurred. A policy concerned only with |
| 58 | the result may find the rerun sufficient. A policy requiring evidence of who executed what at a |
| 59 | particular time needs a trustworthy contemporaneous observation as well. |
| 60 | |
| 61 | The current implementation is a useful base because it already exposes the subject, predicate, |
| 62 | signer, and transfer decision separately. The research priority is to make each obligation explicit |
| 63 | at those existing boundaries, before adding a reputation system whose score might conceal which |
| 64 | obligation remains unsatisfied. |
| 65 | |
| 66 | ## 2. When equal inputs justify reusing a result |
| 67 | |
| 68 | For a deterministic function, equal inputs imply equal outputs. The engineering work is deciding |
| 69 | what counts as the function and all its inputs. Consider a check that compiles a package and runs |
| 70 | its tests. Its inputs include the package source, tests, compiler, libraries, flags, generated data, |
| 71 | and any runtime behavior on which the answer depends. If the check consults a remote feature flag or |
| 72 | the host clock, those observations also matter. |
| 73 | |
| 74 | Dolstra's Nix thesis gives the foundational approach: describe builds as functions of explicit |
| 75 | dependencies and identify derivations so their results can be reused and composed. Its discussion of |
| 76 | purity also recognizes that hashing cannot itself prevent undeclared environmental influence. The |
| 77 | lesson is an explicit model with stated assumptions, not a proof that every command launched by Nix |
| 78 | is pure. [V01 — Dolstra, 2006](https://edolstra.github.io/pubs/phd-thesis.pdf) |
| 79 | |
| 80 | Three terms need separate meanings. **Hermeticity** restricts what a computation can observe. |
| 81 | **Determinism** says repeated execution under the specified conditions has the same result. |
| 82 | **Reproducibility** says another party can recreate the specified artifacts. The Reproducible Builds |
| 83 | definition deliberately includes source, environment, and instructions, and compares selected |
| 84 | artifacts rather than every incidental log. |
| 85 | [V09 — Reproducible Builds definitions](https://reproducible-builds.org/docs/definition/) |
| 86 | |
| 87 | A sandbox can improve hermeticity while leaving scheduling nondeterminism. A deterministic program |
| 88 | can reproducibly calculate the wrong answer. A complete source archive can become impossible to |
| 89 | rebuild when an essential external input disappears. These are different failure modes and should |
| 90 | produce different diagnoses. |
| 91 | |
| 92 | The empirical evidence supports Nix's practical value without proving universal purity. Malka, |
| 93 | Zacchiroli, and Zimmermann recreated historical build environments and rebuilt 14,452 of 14,461 |
| 94 | previously successful jobs from one old revision. The experiment reused cached dependencies; it did |
| 95 | not rebuild the complete historical dependency closure from source. It also left bit-for-bit |
| 96 | artifact reproducibility outside scope. Its preliminary failure analysis identifies sandbox leakage |
| 97 | and flaky tests. A rebuild-success percentage must not be presented as a byte-reproducibility |
| 98 | percentage. |
| 99 | [V10 — Reproducibility of Build Environments through Space and Time](https://arxiv.org/html/2402.00424v1) |
| 100 | |
| 101 | ### A concrete limitation of the current digest |
| 102 | |
| 103 | The helper's [`drvInputs`](../../attest/check.go) queries direct references of a derivation. |
| 104 | [`inputsDigest`](../../attest/digest.go) hashes their sorted path strings. Separately, `evalClosure` |
| 105 | hashes the derivation file. This is a commitment to Nix's symbolic dependency identity. It is not an |
| 106 | independent observation and hash of every byte actually read during execution. |
| 107 | |
| 108 | That distinction does not make the design automatically unsound. A dependency graph can be |
| 109 | represented transitively by hashes that name other hashed objects. However, correctness then depends |
| 110 | on what those names guarantee. Nix distinguishes content-addressed store objects from |
| 111 | input-addressed objects; one must not silently equate a recipe-derived path with a measured |
| 112 | output-content hash. |
| 113 | [V06 — Nix content-addressing documentation](https://nix.dev/manual/nix/2.28/store/store-object/content-address) |
| 114 | |
| 115 | **Inference:** the reportable claim should be narrower than “the complete observed input closure has |
| 116 | this digest.” It is “this runner resolved this derivation and these dependency identities.” An |
| 117 | implementation that wants the stronger claim must establish the store's integrity, the addressing |
| 118 | modes it permits, the execution restrictions, and the role of substituted dependencies. The output |
| 119 | digest helps compare outputs. It does not retroactively establish how an untrusted machine produced |
| 120 | them. |
| 121 | |
| 122 | The Nix manual documents configurable sandbox paths, exceptions for fixed-output derivation |
| 123 | networking, and signature requirements for importing non-content-addressed paths. Those controls |
| 124 | demonstrate that the daemon configuration and cache trust are part of the execution boundary. They |
| 125 | cannot be inferred from the word `nix` in a statement. |
| 126 | [V04 — Nix configuration reference](https://nix.dev/manual/nix/2.28/command-ref/conf-file) |
| 127 | |
| 128 | ## 3. The closest intellectual relatives are build systems and selective testing |
| 129 | |
| 130 | _Build Systems à la Carte_ separates scheduling from deciding whether existing results remain valid. |
| 131 | It also distinguishes dependencies known before execution from dependencies discovered during |
| 132 | execution, and traces that validate a result from traces that recover a cached result. This |
| 133 | vocabulary is directly useful: the-valley's integrator combines an integration scheduler with a |
| 134 | validator of previously recorded computation. Those components can evolve independently. |
| 135 | [V02 — Mokhov, Mitchell, and Peyton Jones, 2018](https://www.microsoft.com/en-us/research/uploads/prod/2018/03/build-systems.pdf) |
| 136 | |
| 137 | The lesson from self-adjusting computation is that incrementality requires dependency information |
| 138 | whose collection is itself sound. Acar and colleagues combine recorded dynamic dependencies with |
| 139 | memoization to update computations after changes. Their results show substantial speedups on |
| 140 | suitable workloads, alongside tracing and storage costs. They do not establish that an arbitrary |
| 141 | shell process's reads can be represented cheaply or completely. |
| 142 | [V03 — Acar et al., 2009](https://www.philinelabs.net/~ktangwon/papers/toplas09.pdf) |
| 143 | |
| 144 | Safe regression-test selection asks a closely related question: which old tests must execute again |
| 145 | after a program changes? Rothermel and Harrold prove safety under explicit conditions, where safety |
| 146 | means retaining every previously available test capable of exposing a fault in the modified program. |
| 147 | This does not imply that the available test suite detects every fault. That boundary is especially |
| 148 | useful for interpreting the-valley's claims about semantic conflicts. |
| 149 | [V27 — Rothermel and Harrold, 1997](https://www.cs.purdue.edu/homes/xyzhang/spring07/Papers/p173-rothermel.pdf) |
| 150 | |
| 151 | **Inference:** the-valley can aim for two progressively stronger statements: |
| 152 | |
| 153 | 1. Every reused result equals the result that its approved check would produce on the candidate |
| 154 | landing. |
| 155 | 2. The approved collection of checks is adequate for the project's acceptance requirements. |
| 156 | |
| 157 | The first is an evidence-reuse property. The second is a software-assurance property. A perfect |
| 158 | implementation of the first leaves the second open. Documentation saying semantic interference is |
| 159 | “caught by construction” should specify that construction's test coverage and dependency |
| 160 | assumptions. |
| 161 | |
| 162 | ### The economic tradeoff is the size of the dependency set |
| 163 | |
| 164 | Suppose a spelling check reads all of a repository because its derivation takes the repository root |
| 165 | as its source. A change to a Go package now changes the spelling check's input identity, even if the |
| 166 | check examines only Markdown. Reverification is conservative and potentially wasteful. Filtering the |
| 167 | source set to Markdown can improve reuse, but only if configuration, dictionaries, includes, and |
| 168 | file discovery remain accounted for. |
| 169 | |
| 170 | Conversely, suppose a test enumerates a directory and reads whichever configuration files exist. A |
| 171 | trace that records only the files opened on the previous run may miss a newly added file. The |
| 172 | directory listing, including the prior absence of a name, was an input too. “Track files read” is |
| 173 | not yet a complete dependency model. |
| 174 | |
| 175 | Bazel's documentation gives practical examples of hermeticity failures, including host tools, |
| 176 | timestamps, and writing into the source tree. Its remote cache distinguishes action-result metadata |
| 177 | from content-addressed output storage. This is relevant prior art for both disciplined dependency |
| 178 | declarations and the separate trust required in the mapping from an action to its claimed output. |
| 179 | [V07 — Bazel hermeticity](https://bazel.build/basics/hermeticity), |
| 180 | [V08 — Bazel remote caching](https://bazel.build/remote/caching) |
| 181 | |
| 182 | **Recommendation:** keep conservative whole-check invalidation as the baseline. Introduce finer |
| 183 | source sets only with tests that attempt to change omitted inputs. Compare saved execution against |
| 184 | the cost of maintaining those declarations. Precise reuse is valuable when it is demonstrably |
| 185 | cheaper than rerunning the check; it is not an end in itself. |
| 186 | |
| 187 | ## 4. A signed executable hash is not evidence that the executable ran |
| 188 | |
| 189 | The [verification mechanism stack](../../design/verification.md#the-mechanism-stack) overstates |
| 190 | several guarantees. These overstatements matter because they concern the adversarial case that local |
| 191 | verification must eventually address. |
| 192 | |
| 193 | Consider this failure trace: |
| 194 | |
| 195 | 1. An attester has an authorized signing key and control of its own machine. |
| 196 | 2. It computes the expected tree and derivation identifiers without executing the check. |
| 197 | 3. It writes the identifier of the approved attestation tool into a statement. |
| 198 | 4. It invents a passing result and signs the statement directly. |
| 199 | |
| 200 | No modified-tool hash must appear. The attacker is choosing the statement's bytes. A verifier learns |
| 201 | that the key endorsed those bytes, not that the named tool produced them. Local root can likewise |
| 202 | suppress local observations. A sandbox controlled by the same adversary is not an independent |
| 203 | observer of that adversary. |
| 204 | |
| 205 | This is a protocol-level counterexample, not a claim that the existing operator is malicious. The |
| 206 | current trust model can be entirely appropriate for an operator's own devices and agents. The |
| 207 | inaccurate part is claiming that these mechanisms force a malicious signer to leave detectable |
| 208 | evidence of how it lied. |
| 209 | |
| 210 | Hardware-backed remote attestation offers a different trust boundary. The RATS architecture |
| 211 | separates an attester's evidence, a verifier's appraisal, reference values, and the relying party's |
| 212 | decision. A protected measurement can support a claim about an execution environment when its |
| 213 | binding and freshness are established. It still needs an appraisal policy and a trusted measurement |
| 214 | chain. [V23 — RFC 9334](https://www.rfc-editor.org/rfc/rfc9334.html) |
| 215 | |
| 216 | **Recommendation:** keep three deployment profiles conceptually distinct: trusted personal |
| 217 | attesters; delegated builders whose signing authority is protected from submitted code; and |
| 218 | independent witnesses that check selected claims. A project may combine them. A numeric score should |
| 219 | never make the first profile appear cryptographically equivalent to the second. |
| 220 | |
| 221 | Independent execution also needs an independence definition. Two witnesses using the same |
| 222 | compromised compiler or binary cache can agree on a malicious artifact. Thompson's compiler attack |
| 223 | is the classic illustration of a toolchain reproducing a compromise even when inspected source no |
| 224 | longer contains it. |
| 225 | [V24 — Reflections on Trusting Trust](https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf) |
| 226 | |
| 227 | The practical requirement is not unlimited diversity at any cost. It is identifying which common |
| 228 | failures a second witness is intended to exclude: a dishonest author, a corrupted machine, a |
| 229 | poisoned cache, a compromised compiler, or a flawed test. Each requires a different kind of |
| 230 | independence. |
| 231 | |
| 232 | ## 5. What the supply-chain standards already solve |
| 233 | |
| 234 | The supply-chain ecosystem contains several distinct layers. Treating them as interchangeable makes |
| 235 | both adoption and criticism less precise. |
| 236 | |
| 237 | | Prior art | Its useful contribution | Its boundary | |
| 238 | | ----------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | |
| 239 | | in-toto | Authorized steps and continuity between their inputs and outputs | Correctness still depends on the authorized process and trust assumptions | |
| 240 | | in-toto Statement | A subject digest and a typed claim about it | The predicate defines the claim's meaning | |
| 241 | | DSSE | A signed encoding that binds payload bytes and payload type | An envelope does not evaluate the payload's truth | |
| 242 | | SLSA Build track | Requirements for provenance generation and builder isolation | A level is about meeting requirements, not counting security mechanisms | |
| 243 | | Sigstore | Identity-linked signing and transparent signature history | Consumers still decide acceptable identities and claims | |
| 244 | | TUF | Secure distribution of current trusted metadata despite several compromise and replay threats | It does not execute a build or determine whether a test is adequate | |
| 245 | |
| 246 | The in-toto paper is particularly relevant because it treats the connections between steps as |
| 247 | security-critical. A project layout defines authorized functionaries and artifact rules; signed |
| 248 | links record their work. This is close to the-valley's desire to compose evidence from multiple |
| 249 | tools without giving a single forge ownership of the workflow. |
| 250 | [V15 — Torres-Arias et al., 2019](https://www.usenix.org/system/files/sec19-torres-arias.pdf) |
| 251 | |
| 252 | The Statement specification already separates subject from predicate type. Pure verification and |
| 253 | effectful observation can therefore be different predicates without abandoning interoperability. The |
| 254 | [current local statement schema](../../schema/attestation.cue) has a similar conceptual separation, |
| 255 | though its serialized protocol is its own. |
| 256 | [V16 — in-toto Statement v1](https://in-toto.io/Statement/v1) |
| 257 | |
| 258 | DSSE authenticates the payload's exact serialized bytes together with its type, using an unambiguous |
| 259 | encoding. It does not require all producers to canonicalize an application document into a universal |
| 260 | byte representation before verifying the supplied bytes. The-valley's text format can still have |
| 261 | independent benefits for readability and deterministic production; those benefits should justify its |
| 262 | maintenance cost. |
| 263 | [V18 — DSSE protocol](https://github.com/secure-systems-lab/dsse/blob/master/protocol.md) |
| 264 | |
| 265 | **Recommendation:** preserve a precise internal claim model and implement an explicit interoperable |
| 266 | representation at the boundary. Re-encoding a statement changes its signed bytes. An adapter should |
| 267 | either preserve the original signed object or produce a new, clearly attributed statement; it should |
| 268 | not pretend signatures survive arbitrary translation. |
| 269 | |
| 270 | ### The SLSA comparison needs correction |
| 271 | |
| 272 | The claim of being “roughly SLSA Level 3” is not supported by the mechanism stack. SLSA v1.2 Build |
| 273 | L3 requires provenance strongly resistant to forgery by tenants, a trusted control plane, protected |
| 274 | signing material, and build isolation. Its hosted requirement excludes builds on an individual's |
| 275 | workstation. Reproducibility and periodic sampling do not, by themselves, satisfy those |
| 276 | requirements. [V17 — SLSA v1.2 build requirements](https://slsa.dev/spec/v1.2/build-requirements) |
| 277 | |
| 278 | This is not a reason to imitate a hosted forge. It is a reason to describe the actual trust |
| 279 | boundary. The-valley could integrate evidence from a conforming builder, and the specification |
| 280 | allows systems involving independent rebuilders as build platforms. Any level claim would still |
| 281 | require a concrete mapping of the entire deployment to the requirements. A per-check attestation is |
| 282 | also a different object from complete provenance for a released artifact. |
| 283 | |
| 284 | Sigstore's use of short-lived certificates and transparency improves identity binding and |
| 285 | auditability. Its documentation explicitly assigns monitoring responsibilities to users. It does not |
| 286 | turn a signature into proof of successful computation. Whether to use its public services, privately |
| 287 | operate components, or retain local keys is a deployment decision with operational and trust |
| 288 | consequences. [V19 — Sigstore security model](https://docs.sigstore.dev/about/security/) |
| 289 | |
| 290 | ## 6. Integration is concurrency control over evidence, with qualifications |
| 291 | |
| 292 | Kung and Robinson's optimistic concurrency control separates speculative work from validation and |
| 293 | publication. Transactions proceed on local state; validation checks the conditions required for a |
| 294 | serial order. Their argument assumes individual transactions preserve the relevant integrity |
| 295 | conditions. Mapping this to code integration is fruitful only if the-valley states what its checks |
| 296 | establish and what their dependency sets include. |
| 297 | [V11 — Kung and Robinson, 1981](https://www.eecs.harvard.edu/~htk/publication/1981-tods-kung-robinson.pdf) |
| 298 | |
| 299 | The project already has the essential outline. Prepare a candidate against a target snapshot. |
| 300 | Determine which results remain applicable. Publish only if the target still has the expected value. |
| 301 | A lost compare-and-swap race causes reconsideration. This avoids silently landing a candidate |
| 302 | validated against the wrong target. |
| 303 | |
| 304 | However, the analogy does not make software meaning transactional. A check may omit an important |
| 305 | behavior. Two changes can preserve every tested property while jointly violating an untested one. |
| 306 | Crystal's empirical work established that collaboration conflicts include build and test failures |
| 307 | beyond overlapping textual edits, and explored speculative analysis for earlier detection. It |
| 308 | supports testing combinations, not the inference that clean textual merges or finite tests establish |
| 309 | semantic compatibility. |
| 310 | [V12 — Brun et al., 2011](https://people.cs.umass.edu/~brun/pubs/pubs/Brun11fse.pdf) |
| 311 | |
| 312 | ### Reuse needs a computation identity and an acceptance identity |
| 313 | |
| 314 | A useful proposed model has two independent questions: |
| 315 | |
| 316 | ```text |
| 317 | Computation identity: |
| 318 | approved check definition + resolved inputs + runner semantics + platform |
| 319 | |
| 320 | Acceptance decision: |
| 321 | computation result + applicable policy + authorized signer(s) |
| 322 | + freshness/revocation state + candidate landing |
| 323 | ``` |
| 324 | |
| 325 | This is a design proposal, not a new wire format. A policy change need not invalidate a genuinely |
| 326 | identical computation. It may change whether that result is sufficient. Conversely, preserving a |
| 327 | check's display name must not conceal a change to its executable definition. |
| 328 | |
| 329 | There are three distinct failure traces worth testing against the implementation: |
| 330 | |
| 331 | **Candidate-controlled no-op.** Policy requires `unit-tests`; the candidate changes that derivation |
| 332 | to create an output immediately. The attestation truthfully reports success. A witness faithfully |
| 333 | rebuilds the no-op and agrees. The repository already records this exposure in |
| 334 | [bd-eaefe82](../../.the-valley/bugs/bd-eaefe82-check-definitions-come-from-the-branch.md). Its |
| 335 | suggestion that witness re-derivation would eventually detect a check that computes nothing does not |
| 336 | follow: detecting the wrong check requires comparing against an approved definition or semantic |
| 337 | expectation. |
| 338 | |
| 339 | **Same tree, different named computation.** The helper accepts a check name mapped to an attribute. |
| 340 | The evidence collector extracts the name and result but does not retain the attribute in the |
| 341 | verdict's evidence structure. The pure `unmoved` rule accepts an otherwise admissible passing |
| 342 | statement when the subject tree is unchanged, without recomputing the expected derivation. Thus a |
| 343 | same-tree shortcut has a stronger precondition than the implementation visibly establishes: the |
| 344 | statement must name the computation policy required. This is a static code-review finding, not a |
| 345 | reported end-to-end exploit. |
| 346 | |
| 347 | **Effectful label substitution.** The verdict retains an effectful observation's result and |
| 348 | timestamp, but not the command or environment identity recorded in its statement. It can therefore |
| 349 | decide freshness without itself comparing those fields to the required command. Again, upstream |
| 350 | guarantees could change the assessment; the inspected verdict path does not establish that binding. |
| 351 | A trustworthy signer can still make a configuration mistake, so this issue is not limited to |
| 352 | malicious keys. |
| 353 | |
| 354 | **Recommendation:** establish computation identity before applying any transfer shortcut. Keep it |
| 355 | separate from the policy digest in the transfer record. Resolve instance-mandated definitions from |
| 356 | an independently authorized source. For changes to checks, run both the incumbent acceptance check |
| 357 | and the proposed check where feasible; authorize the transition explicitly when compatibility is |
| 358 | impossible. This permits improvements to tests without letting a proposal silently lower its own |
| 359 | bar. |
| 360 | |
| 361 | ### Cheap validation is a hypothesis about the runner |
| 362 | |
| 363 | `attest inputs` calls `nix eval` and is described as building nothing. Nix's import-from-derivation |
| 364 | feature can pause evaluation to realize a derivation. Its manual explicitly documents disabling this |
| 365 | behavior. Therefore evaluation-only latency needs an enforced restriction, rather than a comment in |
| 366 | the integrator. |
| 367 | [V05 — Nix import from derivation](https://nix.dev/manual/nix/2.28/language/import-from-derivation) |
| 368 | |
| 369 | Even with that restriction, evaluation, source materialization, and hashing have costs. A serial |
| 370 | controller can bottleneck while doing those operations before its small atomic ref update. The size |
| 371 | of the atomic operation and the end-to-end service rate are different measurements. The |
| 372 | [current closure collector](../../integrator/evidence.go) runs an `attest inputs` subprocess per |
| 373 | pure check, so repeated exports and evaluation are concrete costs to measure. |
| 374 | |
| 375 | ### Merge queues are a baseline and a possible complement |
| 376 | |
| 377 | Zuul tests speculative combinations in parallel. Later queued changes include earlier ones; a failed |
| 378 | predecessor causes affected work to restart. Its adjustable window limits wasted speculation. |
| 379 | GitHub's merge queue likewise validates temporary combinations incorporating the target and |
| 380 | preceding queued work. These are substantial existing solutions to integration throughput, not |
| 381 | merely serialized CI gates. |
| 382 | [V13 — Zuul project gating](https://zuul-ci.org/docs/zuul/latest/gating.html), |
| 383 | [V14 — GitHub merge queues](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) |
| 384 | |
| 385 | **Hypothesis:** a hybrid may improve some mixed workloads. Reuse unchanged per-check evidence first. |
| 386 | Speculatively execute only invalidated checks on likely future landings. Reduce speculation when |
| 387 | failures or conflicts rise. Reserve an integration opportunity for changes that repeatedly lose |
| 388 | races. The hybrid adds scheduling and bookkeeping costs, and failed speculation can waste execution. |
| 389 | It should be compared experimentally; there is no basis yet for claiming one queue policy works best |
| 390 | for every repository. |
| 391 | |
| 392 | ## 7. Effectful checks are observations with assumptions |
| 393 | |
| 394 | A check against a live API may be useful even though it cannot be replayed exactly. Its result means |
| 395 | the observed interaction succeeded under the conditions recorded. A ten-minute acceptance window |
| 396 | means the project accepts an observation up to ten minutes old. It does not mean the service |
| 397 | remained healthy during those ten minutes. |
| 398 | |
| 399 | The repository's path-class rule adds a separate assumption: intervening changes outside the class |
| 400 | do not affect the observation's applicability. That assumption can be wrong if a shared |
| 401 | configuration file, service dependency, or credential policy sits outside the class. The time bound |
| 402 | and the dependency scope should be reviewed independently. |
| 403 | |
| 404 | The RATS freshness discussion similarly recognizes that state can change immediately after evidence |
| 405 | is produced; freshness is a policy choice about acceptable recentness. |
| 406 | [V23 — RFC 9334, section 10](https://www.rfc-editor.org/rfc/rfc9334.html#section-10) That is a |
| 407 | useful interpretation for ordinary test observations too, without claiming they are hardware |
| 408 | attestations. |
| 409 | |
| 410 | The [current verdict](../../integrator/verdict/verdict.go) rejects observations whose calculated age |
| 411 | reaches the validity window. Static inspection shows no rejection of negative age. A future |
| 412 | timestamp is consequently a concrete test case. The larger issue is defining acceptable clock skew, |
| 413 | which clock supplies time, and whether a trusted receipt or challenge is required. A sender's |
| 414 | signature authenticates its stated time; it does not make the clock accurate. |
| 415 | |
| 416 | Not every nondeterministic check belongs in the same category as a live API test. Luo and colleagues |
| 417 | studied flaky-test fixes and identified multiple causes of unstable outcomes. A race or test-order |
| 418 | dependence can exist inside an otherwise isolated environment. Marking the wrapper `nix` does not |
| 419 | eliminate that behavior. |
| 420 | [V26 — Luo et al., 2014](https://mir.cs.illinois.edu/marinov/publications/LuoETAL14FlakyTestsAnalysis.pdf) |
| 421 | |
| 422 | **Recommendation:** define admissible result types. A deterministic check can have an equality-based |
| 423 | result. A statistical benchmark may need a sample size, distribution summary, and acceptance rule. A |
| 424 | live-service observation needs environment and time context. A flaky deterministic check should |
| 425 | trigger investigation of its purity claim, rather than acquire an arbitrary expiration that conceals |
| 426 | the defect. |
| 427 | |
| 428 | ## 8. Transparency records claims; revocation changes what may rely on them |
| 429 | |
| 430 | A transparency log can make a submitted statement discoverable and make alterations detectable. It |
| 431 | does not determine whether the statement is true. Certificate Transparency also distinguishes |
| 432 | inclusion from consistent views of history; a dishonest log can present conflicting histories unless |
| 433 | other participants compare or witness checkpoints. Monitors must look for the failures that matter. |
| 434 | [V21 — RFC 9162, security considerations](https://www.rfc-editor.org/rfc/rfc9162.html#section-11) |
| 435 | |
| 436 | Tessera is a plausible implementation component, not a complete operational policy. Its documented |
| 437 | lifecycle distinguishes sequencing an entry, integrating it into the tree, and publishing a signed |
| 438 | checkpoint. Its publishing machinery supports witness policies. The-valley would still need to |
| 439 | choose which stage permits integration and what happens when publication or witnesses are |
| 440 | unavailable. [V22 — Tessera documentation](https://github.com/transparency-dev/tessera) |
| 441 | |
| 442 | There is a related crash boundary in the existing integrator. [`land`](../../integrator/refs.go) |
| 443 | moves the protected ref before storing the transfer evidence. It reports subsequent failures, but a |
| 444 | crash can still leave a landed change without the intended durable record. Composing and signing |
| 445 | before the ref move reduces one failure class; it does not atomically publish evidence alongside the |
| 446 | landing. |
| 447 | |
| 448 | **Recommendation:** investigate a Git ref transaction covering the target and evidence refs, or a |
| 449 | durable intent record with recovery. For an external log, specify a two-stage protocol with a |
| 450 | recoverable intermediate state. The experiment is a process kill at every persistence boundary, |
| 451 | followed by a new controller reconstructing what happened. “Every landing has evidence” should be |
| 452 | tested as a storage invariant. |
| 453 | |
| 454 | Revocation presents another distinction. An old statement can remain authentic while becoming |
| 455 | unacceptable. A signing key may be revoked; a check definition may be disallowed; a vulnerability |
| 456 | database may advance; or a policy may require a stronger builder. TUF's role separation, version |
| 457 | checks, expiration, and key-update procedures are important prior art for distributing current trust |
| 458 | information and resisting stale metadata. |
| 459 | [V20 — TUF specification](https://theupdateframework.github.io/specification/latest/) |
| 460 | |
| 461 | **Inference:** a useful revocation record names the affected authority or statement, the reason, the |
| 462 | effective interval, and the dependent decisions requiring reconsideration. A reverse index from |
| 463 | attestations to transfers, releases, and deployments becomes operationally important. Pure |
| 464 | computation results need not expire merely because time passes, but permission to rely on them can |
| 465 | change. |
| 466 | |
| 467 | Revocation also does not undo consequences. An already deployed secret leak cannot be reversed by |
| 468 | withdrawing an attestation. The architecture's tradeoff therefore needs an explicit exposure budget: |
| 469 | which actions may proceed before independent verification, how far their outputs may propagate, and |
| 470 | which actions require verification first. |
| 471 | |
| 472 | ## 9. What random witness sampling can and cannot promise |
| 473 | |
| 474 | Sampling can make repeated dishonesty increasingly likely to be discovered. It cannot guarantee |
| 475 | discovery of a particular unsampled statement. The following calculation is this report's elementary |
| 476 | probability model, not an empirical estimate of the-valley's security. |
| 477 | |
| 478 | Suppose each false statement is independently sampled with probability `p`. Suppose a sampled false |
| 479 | statement is always detected by an honest witness, and the attacker cannot choose its behavior after |
| 480 | learning the sample decision. After `m` false statements: |
| 481 | |
| 482 | ```text |
| 483 | P(no detection) = (1 - p)^m |
| 484 | P(at least one detection) = 1 - (1 - p)^m |
| 485 | ``` |
| 486 | |
| 487 | At `p = 0.01`, one false statement has a 99% chance of escaping this sampling scheme. One hundred |
| 488 | false statements have about a 36.6% chance of all escaping. Reaching a 95% probability of detecting |
| 489 | at least one requires 299 false statements. The expected number of false statements up to and |
| 490 | including first detection is 100; that expectation is not a maximum. |
| 491 | |
| 492 | If an audit detects a sampled false statement with probability `q`, independent of selection, |
| 493 | replace `p` by `p*q`. A witness that reruns a candidate-controlled no-op has `q = 0` for the defect |
| 494 | “this check does not test what policy intended.” Increasing sampling does not fix that defect. |
| 495 | |
| 496 | These equations also exclude correlated witness failures, compromised samplers, adaptive attacks, |
| 497 | and delayed audit execution. A high historical success score gives no mathematical assurance against |
| 498 | a signer that behaves honestly until one valuable attack. Multiple new identities can undermine |
| 499 | reputation unless identity creation itself has a controlled cost or authorization boundary. |
| 500 | |
| 501 | **Recommendation:** select audits after the statement is irrevocably committed, using randomness the |
| 502 | producer cannot predict or steer cheaply. Separate two aims: estimating routine error rates and |
| 503 | deterring targeted abuse. Random sampling serves the first well under suitable assumptions. The |
| 504 | second may require mandatory independent verification for high-impact changes, protected builder |
| 505 | keys, or limits on what unverified outputs can authorize. |
| 506 | |
| 507 | A confidence statement also needs a denominator. If no failures appear in `n` independent, |
| 508 | representative audits, a one-sided 95% upper bound for a stable defect rate is `1 - 0.05^(1/n)`, |
| 509 | approximately `3/n` for large `n`. With 300 clean audits, this is about 1%. It says nothing |
| 510 | comparable about an adaptive adversary's next submission. Calling it an attester's universal trust |
| 511 | probability would be misleading. |
| 512 | |
| 513 | Finally, sampling without a response mechanism only produces observations. Useful operation requires |
| 514 | a disagreement state, preservation of both runs, diagnosis of nondeterminism, and a rule for pausing |
| 515 | dependent decisions. Automatic punishment on first mismatch risks treating an honest witness that |
| 516 | exposed a flaky check as the attacker. |
| 517 | |
| 518 | ## 10. A research program that can discriminate between designs |
| 519 | |
| 520 | The most useful next work is a small set of falsifiable experiments. Each should compare a concrete |
| 521 | baseline, measure costs, and exercise a failure mode that normal successful builds would miss. |
| 522 | |
| 523 | | Experiment | Baseline and variation | What would change the design decision? | |
| 524 | | ------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | |
| 525 | | Reuse on real history | Recheck everything; whole-tree cache; current per-check transfer; narrower source sets | Saved compute and landing latency justify declaration complexity without changed results | |
| 526 | | Controlled interference | Changes to imports, generated files, directory membership, lockfiles, platform, and check definitions | Any false reuse requires repairing the dependency or identity model before optimizing further | |
| 527 | | Same-tree evidence substitution | Keep subject and check name; alter attribute, command, environment, or approved definition | Every mismatch is rejected before the unchanged-tree shortcut | |
| 528 | | Local forgery | An authorized key signs a fabricated passing statement and the approved tool identifier | Demonstrates exactly which deployment profiles need a separate execution authority | |
| 529 | | Genuine witness independence | Rebuild with a fresh store; shared cache; separate cache; altered environment | Distinguishes actual independent execution from repeated trust in the same cached artifact | |
| 530 | | Purity stress | Vary clock, CPU count, scheduling, locale, kernel, and allowed sandbox settings | Determines which checks qualify for deterministic reuse and what platform identity must include | |
| 531 | | Evaluation cost | Warm/cold caches, import-from-derivation, large flakes, many required checks | Establishes whether the integrator must cache evaluation, parallelize preparation, or restrict runner features | |
| 532 | | Queue contention | Replay identical arrivals through sequential, speculative, reuse-only, and hybrid queues | Compare completed landings, wasted computation, tail latency, and starvation rather than only average throughput | |
| 533 | | Evidence durability | Crash before and after each ref, evidence, memo, and log publication operation | Recovery restores a complete account without silently reclassifying an incomplete landing | |
| 534 | | Revocation response | Revoke a signer or definition after several dependent integrations and releases | Every affected dependency is found, and consumers converge within a measured interval | |
| 535 | |
| 536 | **Hypothesis:** dependency breadth and evaluation overhead will decide the value of selective reuse |
| 537 | more often than signature-verification cost. A source filter that inadvertently includes the entire |
| 538 | repository may erase most of the intended advantage. This should be established by historical replay |
| 539 | before designing elaborate attester economics. |
| 540 | |
| 541 | **Hypothesis:** checks that use many global fixtures will benefit more from speculation and batching |
| 542 | than from finer evidence transfer. Conversely, isolated documentation and component checks should |
| 543 | transfer frequently. A single aggregate cache-hit rate could hide this split; results should be |
| 544 | reported per check family and by computation cost. |
| 545 | |
| 546 | One experiment must address the meaning of “passed.” The oracle literature studies how tests obtain |
| 547 | an expected answer, including specifications, contracts, derived oracles, and metamorphic relations. |
| 548 | It shows why automating execution does not finish automating judgment. |
| 549 | [V25 — Barr et al., 2015](https://discovery.ucl.ac.uk/id/eprint/1471263/1/06963470.pdf) |
| 550 | |
| 551 | For the-valley, mutate both code and its candidate-supplied tests. Compare incumbent tests, |
| 552 | candidate tests, external invariants, and independent review. The aim is not to assign one universal |
| 553 | quality score. It is to find changes for which execution evidence looks impeccable while the |
| 554 | intended requirement is no longer being tested. This is especially relevant when the same agent can |
| 555 | write the implementation, test, and account of success. |
| 556 | |
| 557 | ## 11. The promising solution space |
| 558 | |
| 559 | The strongest version of this architecture makes evidence portable while keeping acceptance |
| 560 | contextual. Execution produces a claim with a precise computation identity. Integration checks |
| 561 | whether that computation still applies and whether its evidence is currently acceptable. Release or |
| 562 | deployment can impose stronger requirements than integration without discarding the earlier |
| 563 | evidence. |
| 564 | |
| 565 | Several design choices remain legitimate: |
| 566 | |
| 567 | - A personal installation can trust local machine keys and use occasional independent checks to |
| 568 | catch mistakes. |
| 569 | - A collaborative project can accept local results for fast feedback while requiring a protected |
| 570 | builder for selected acceptance predicates. |
| 571 | - A high-assurance release can require several independent rebuilds, durable transparency evidence, |
| 572 | and explicit authorization of check-definition changes. |
| 573 | - A low-conflict project can use a simple queue and rely on build-cache reuse, avoiding a more |
| 574 | sophisticated integrator until measurements justify one. |
| 575 | |
| 576 | The strongest objection is that existing build caches and merge queues may already capture most of |
| 577 | the performance benefit. The-valley must demonstrate an additional benefit in portable authority, |
| 578 | partial re-attestation, host independence, or explanatory records. Moving familiar mechanisms into |
| 579 | new formats without improving one of those outcomes would not justify their operational cost. |
| 580 | |
| 581 | The corresponding opportunity is substantial. A transfer statement can explain exactly why earlier |
| 582 | evidence still supports a new landing. That is more informative than a historical green badge |
| 583 | detached from its assumptions. The research recommendation is to pursue that explanation as the core |
| 584 | contribution, with conservative identity binding and explicit trust profiles. Reputation, universal |
| 585 | purity claims, and mandatory transparency infrastructure should follow only where their measured |
| 586 | benefit and threat model warrant them. |