A build plan can now write its next page.
Farid Zakaria's experiment uses Nix dynamic derivations to build a chain whose next step depends on the previous step's output. A die roll decides whether the chain stops or emits another derivation. Only the first box exists when evaluation begins. The later boxes are written by builders while the build is underway.[1]
The dice are a teaching device, not a build recommendation. The useful part is the change in scheduling. The complete graph does not need to exist before execution starts.
That changes what "dry run" can promise.
A conventional build graph supports a strong preview. Tools can inspect dependencies, compare closures, and estimate work before builders run. If a step emits another derivation, the initial preview can show the producer but not the full graph produced from its result.
Unknown is not nondeterministic. It means the answer arrives later.
Keep those terms separate. A dynamic graph may resolve to the same graph for the same inputs every time. A fully known graph can still contain an impure step. Nix documents dynamic derivations and impure derivations as separate experimental features. The first permits derivation outputs to introduce more derivations. The second permits differing outputs and network access.[2]
Randomness makes a good flare and a bad default.
The Reproducible Builds project gives the plain rule: random data makes builds unreproducible. If a tool needs random-like input, use a predetermined seed from a recorded source.[3]
For a dynamic build, record the values that choose the next branch. Save the emitted derivations or an equivalent resolved graph. Then replay from the same inputs and compare the result. You are not trying to force every build into a static plan. You are making late discovery inspectable.
Review the graph in two exposures.
- Capture the graph visible before any builder runs.
- Pin every input that can select a later branch.
- Log each newly emitted derivation with its parent and output.
- Save the final resolved graph beside the build result.
- Replay once with matched inputs and compare graph and output hashes.
Do not label this proof of safety. A repeated route can repeat a bad action. The two exposures answer a narrower question: what work was planned, what work appeared later, and can another operator reproduce that route?