Fileset delivery plan
The reviewable implementation sequence for SPEC.md. Each milestone lands code, tests and the evidence its gate names. Decisions and open questions live in decisions.md.
Status (November 10, 2026): M0 is delivered (PR #507), with its git check-ignore -v parity gate. M1–M7 and M9, with E0, are delivered with their gates; the state of each requirement is in the SPEC's evidence ledger. The work resumes as the file-system layer of the build graph: every listing the graph makes is a fileset resolution, so the build graph's E2 needs M1–M3, and M5 for the listing digests its planning read set records (D44).
Dependency graph
E0 event-horizon admission primitive (decisions.md A6)
│
M0 GitIgnoreRule provenance ───────────────┐
│ │
M1 IR + algebra + in-memory driver │
│ │
M2 prefix lattice + verdicts │
│ │
M3 resolution machine + three drivers ◄────┘ (needs E0)
│
M4 ignore scopes on the immutable chain ── behaviour-preservation gate
│
M5 FSO vocabulary + scheme declarations
│
M6 content-addressing schemes ── decided by decisions.md A19
│
M7 subtree cache
│
M9 consumer migration + deletion of the old modulesM0 is independent of everything and useful on its own. E0 gates only M3. The Merkle decision that blocked M6 is A19.
Milestones
M0 — GitIgnoreRule provenance
Scope. Each parsed rule gains the path of the .gitignore that declared it and its 1-based line number. No other behaviour changes.
Why first. It is a prerequisite for FSI3 and for any decision-trace tooling, it is independently useful (it gives the existing walker git check-ignore -v parity), and retrofitting provenance into a compiled matcher later is expensive.
Gate. On a fixture with nested .gitignore files, the reported file and line match git check-ignore -v for every path.
M1 — The IR, the algebra, and the in-memory driver
Scope. FSV1–FSV5, FSG1–FSG4, the D combinator API, and the in-memory driver (FSD2) with its tree-literal fixture format.
Gate. The brute-force differential oracle agrees with the compiled predicate on the whole fixture set. Allocation instrumentation shows zero allocation on the evaluation path.
Delivered. Modules fileset/pattern.d, value.d, tree_literal.d; oracles and fixtures in fileset/testing.d; the audit in fileset/allocation_audit.d. Two scope items finish in M3, because both need a resolution: FSV4's empty-directory report is part of the resolution result, and FSD2's driver is M3's adapter instantiated over MemVfs. M1 delivers the tree-literal format and the MemVfs it builds. FSG2 is checked by M4's differential gate.
M2 — The prefix lattice and verdicts
Scope. FSA1–FSA6: root derivation, the three directory verdicts, undecided, forced entry, static emptiness.
Gate — the load-bearing one. For every fileset in the fixture set, the planned resolution and a brute-force walk that ignores all verdicts produce the same member set. Any member the plan misses is a FSA1 violation. This gate is what makes the optimizer safe to make cleverer later, and it must run on every fixture for the life of the library.
Delivered. fileset/plan.d: plan derives the start roots and the static-emptiness diagnostic, and rootState positions an evaluator at a root. The gate lives in fileset/testing.d beside M1's and runs over the same fixture set: plannedWalk follows the plan and the verdicts, and is the reference the M3 machine must match. FSA5 is partial until M4. Only a root .gitignore exists as a leaf before then.
M3 — The resolution machine and three drivers
Scope. FSM1–FSM7, the synchronous driver, and the event-horizon driver. Depends on E0.
Gate. All three drivers produce byte-identical results over one fixture set. The machine's modules import nothing that performs I/O — checked by grep, not by inspection.
Delivered. fileset/machine.d (the machine), driver.d (the one adapter and PathCollector) and driver_loop.d (the event-horizon executor); E0 is sparkles.event_horizon.admission. The machine reports units, incomplete entries and errors. A Plan start root whose directory is absent holds no member and is not reported. The gate is fileset.gate.m3.threeBackends, beside fileset.gate.m3.machineAgreesWithOracles, which holds the machine to M1's and M2's oracles on the whole fixture set. FSV4 and FSD2, moved from M1, are delivered here. FSM5's order and FSE1, FSE2 and FSS6's scheme halves wait for M5.
M4 — Ignore scopes, and the behaviour-preservation gate
Scope. FSI1–FSI4 — the immutable arena-backed chain replacing the push/pop stack.
Gate (a milestone gate, not merely a test). The old walker and the new machine are run over real repository trees, and their results compared. Every divergence is either explained by FSG2 (the anchoring change) and recorded, or fixed. Nothing is deleted until this evidence exists.
Delivered as fileset.gate.m4.behaviourPreservation, deleted with the old walker in M9. Two more classes are accepted beside FSG2: a divergence where git agrees with the machine (the old walker's defect) and one FSA5's forced entry explains. The record, over this repository and ten others, linux among them, is A17.
M5 — The FSO vocabulary and scheme declarations
Gate. A scheme declaring no metadata provably issues no stat. The a versus a.b fixture distinguishes narOrder from gitTreeOrder. A fold scheme with none ordering fails to compile.
Delivered: fileset/fso.d (the vocabulary and the declarations) and fileset/scheme.d (resolveScheme, FsoRef, PathScheme). The machine orders units, requests declared metadata, reads link targets, and hands a fold the directories above its start roots (A18). The three gate conditions are fileset.scheme.FSS2.metadata, fileset.scheme.FSS1.orders and fileset.scheme.FSS5.foldNeedsOrder. FSS8 was partial until M6 gave the supplied tree a type.
M6 — Content-addressing schemes
Decided by A19.
Scope. The generic parts of A19 (MerkleFold, Serial, Tee), the castore, NAR and git instances (BLAKE3 from sparkles.base.hash.blake3), and the sibling contract under docs/specs/build-primitives/content-addressing/. FSS8 gets its type: a supplied bao outboard, verified instead of read.
Order within the milestone.
- The oracles in the dev shell: Snix from its own repository, and Nix's
nix hash path, which every Nix host has. MerkleFold, with the D1 spike refactored into its git instance, whichgit write-treechecks without new tooling.- castore with BLAKE3, the default identity.
Serialand NAR, which may need the stream'sleavefrom A19.Teeof castore and NAR, so NarHash is stored beside the identity (D2).
Gate. Each instance matches its oracle on the fixture set, including the ordering fixture and a case-collision fixture. A Tee reads each file once.
Progress: all five steps are delivered. content_addressing/merkle.d holds the shell, git.d and castore.d the instances; content_addressing.git.writeTree checks SHA-1 and SHA-256 against git write-tree, and content_addressing.castore.snix checks castore against Snix, on the hazard, case-collision, fixture and 200 random trees. nar.d holds NAR, a stream declaring the new leave; content_addressing.nar.dump checks it against nix-store --dump on the same trees. The tee is NarScheme!(H, Ref, Dirs), NAR with Merkle encodings beside it, and CastoreNar stores the NarHash beside the identity; content_addressing.tee.readsOnce is the gate's "reads each file once". The sibling contract, content-addressing/, was accepted by the owner on 2026-11-09, with its decisions: C1 stores NarHash beside the id, C2 makes iroh's outboard the supplied tree, and C3 has an id name only the members' tree. outboard.d holds FSS8's type, which MerkleFold takes through a Supply, checked against bao-tree (CAO1, CAO2). M6 is complete.
M7 — The subtree cache
Scope. Cross-run caching of subtree digests plus a staleness heuristic, under A9.
Gate. The cache is advisory: with the cache deleted, results are identical and only slower. A fault-injection case in which the heuristic reports "unchanged" for changed content must fail the suite — the oracle is tested, not only the implementation.
Progress: delivered, as FSC1–FSC6 and A20. The cache lives in content_addressing/cache.d, where SubtreeCache is the cache and CachedFold the fold that keeps one. Its staleness check needed a file's change time, which the VFS gained for it (DV32). Its oracle, cacheDivergence, runs the fold over a script of changes, and after each change compares the cached id with a cold run's. With the cache deleted, the ids are the same and every file is read again. Three lying validators each make the oracle fail, and the real one passes the same scripts.
M9 — Migration and deletion
Scope. apps/hue (picker_sources.d, site.d, picker_grep.d), libs/docs/source_set.d, libs/core-cli/examples/tree.d, and the build-primitives example. passesGlobs is imported directly by two of those and needs its own answer — most likely it becomes a fileset expression and those call sites lose their bespoke glob layer.
Gate. M4's divergence record is closed, all consumers are on the new API, and the old modules are deleted in the same PR that removes the last consumer.
Progress: delivered. fileset/listing.d is the consumers' API: listRepository resolves a fileset at the enclosing repository's root through RingVfs, withGlobs is the explorer's include/exclude precedence, and GlobFilter and GlobSet replace passesGlobs for one path at a time. source_set.d, hue's pickers, site discovery and explorer, and both examples are on it, and dir_walk.d, glob_walk.d and gitignore.d are deleted, with M4's gate; gitGlobMatch, which selects packages by name, moved to workspace/select.d. Consumers' globs were reviewed against A17: the repository ships none to them, and the site's srcExclude keeps VitePress's own matcher, which reads **/ as filesets do.
What is deliberately not here
The textual query language is a separate track, grounded by fileset-languages. It targets this IR and must not constrain it; the parser lands only once the IR is stable, which is after M2.