Repository navigation
Merged
Conversation
…om (REQ-SEED-001) varve seed <DIR> copies the pin's layer and every layer it composes into one OCI layout per layer under DIR, each usable as a realm mirrors entry. Bytes are copied, never re-encoded: the retained signed envelope, payloads re-hashed against the signed digests, the cached baseline status, the cached signed line index and carried attestations. Shims and the env script are never read. DIR must be absolute and new, empty or a previous seed (marker file); a realm requiring a signed index refuses a store that holds none, before any write. The far store verifies everything against its own realm root, unchanged. seed.rs gets its own mutants shard; docs topic and agent command table updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…the docs The clause-3 scan now requires a FILE of the source store to carry its path (shims are links to the varve binary and proved nothing). Every refusal asserts exit code 1 and usage 2. A never-installed store taking a seed through mirrors is pinned as the first-contact refusal it is, and cmd-seed.md states that limit for composed pins and that signed-index is only refused where the realm is known. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…bsent one Mutation testing of IndexCache::envelope_bytes (which seed reads) found the NotFound guard unkilled; a seed for a signed-index realm could otherwise be written without the index it needs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…he realm before Maintainer decision 2026-11-11: keep the first-contact rule. A store that has never installed from the realm makes first contact through the primary; --from covers a non-composed pin's root layer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
A re-seed exported with force into the existing <layer>-<hex> directory, and write_oci_layout follows symlinks, so a symlinked layout dir, index.json or blob planted in a previous seed made varve overwrite files outside DIR. Layers are now exported into a fresh staging directory (create_dir) inside DIR and moved into place afterwards, removing any existing entry without following a symlink. A DIR that is itself a symlink is refused. The logic moves from main.rs into varve_core::seed::write_seed so it is mutation-tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
The staging in the previous commit makes the main.rs claim true: tests tamper the composed layer's installed payload (written second) and assert a new DIR is not created at all and a previous good seed is unchanged after a failed re-seed. The command's doc comment now says what is refused up front and what staging covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…forces it (F3)
Clause 2 said "a store that has installed from this realm before"; the rule
(FirstContactNeedsPrimary { line }) is per line. Same maintainer decision,
stated precisely; cmd-seed.md reworded to agree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…d (F4) Names the root by --layer/--digest so only the include's realm decides; hardcoding signed_index to false for it turns this test red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…igest (F5) The default pin path was refused earlier by resolve, so dropping missing.push went unnoticed; this path reaches it. Removing the push turns the test red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
resolve_realm(..).ok() turned a malformed or unreadable varve-realms.toml into "realm unknown" and skipped the signed-index check. NoRealmsFile and Undefined still mean no obligation; every other realm error refuses and names the file. The decision lives in seed::realm_obligation so it is mutation-tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…omic final moves Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
A mutant that let claim_destination accept a relative path created relative/seed in the crate dir of cargo-mutants' scratch copy; it persisted and failed this test for every later mutant, masking real misses. A Drop guard now removes what the probe may have created, on pass, fail or panic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
…ions check_destination on a regular file, remove_entry beneath a regular file (ENOTDIR), and write_seed's cleanup of a destination it created versus one that was already there, each driven by a layer whose payload was tampered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
varve seed <DIR>for REQ-SEED-001. It writes the layers this store has installed into a directory that another store can install from, with no network and no registry credential. Each layer gets its own OCI layout underDIR, in the form a realm'smirrorsentry accepts.The case: a container's store is a separate store from its host's. After a pin change the container refetched a composed layer from the registry and needed the credential, although the host store already held every byte.
What it does
Which layers: by default the pinned layer and every layer it composes, transitively. A composed layer that is not installed here refuses and names that layer; it does not produce a smaller seed.
--layer <id> --digest sha256:…seeds one installed layer and the layers it composes.What it copies: bytes, never re-encoded:
Shims and the env script are never read.
Where it writes:
DIRmust be absolute, not a symlink, and new, empty or a previous seed (marked by a file).DIRand moved into place only when all of them succeeded. A refusal in any layer leavesDIRas it was. An existing layer directory is removed and replaced, never written into; a symlink in its place is removed, not followed.The far store verifies everything against its own realm root, unchanged.
One platform per seed: a seed holds the payloads this store installed, for one platform.
Requirement change (maintainer decision, 2026-11-11)
Clause 2 of REQ-SEED-001 now covers "a store that has installed this line from this realm before". The first-contact rule stays. A store that has never installed from a realm makes first contact through the primary, and
--fromcovers a non-composed pin's root layer.cmd-seed.mdstates this limit for composed pins.Tests
crates/varve/tests/seed.rscovers end to end:IndexCache::envelope_bytes, which seed reads, found itsNotFoundguard unkilled. Without that guard, a seed for a signed-index realm could be written without the index it needs. A lineindex test now asserts that an unreadable cached index is an error, not an absent one.Review
A fresh-context review of 3ba3c42 confirmed that a seed with one tampered byte is refused by the far store, and that the foreign-directory and missing-index refusals go red when broken. It found:
DIRindex.jsona failed seed left ["2026.08.0-…", "varve-seed.json"]false: "Unexpected success"--layer/--digesthad no test (exit 0, one layer seeded, when broken)missing.push: "Unexpected success"The seed logic moved from
main.rsintovarve_core::seed::write_seed, so the seed mutation shard now covers it.CI's mutation run on f88f64b missed 4 mutants that my local run had reported caught:
claim_destinationcreaterelative/seedin cargo-mutants' scratch copy. That directory persisted, anda_relative_destination_is_refused_and_names_whythen failed for every later mutant, whatever it mutated.Limits, documented in
cmd-seed.md(f88f64b):DIRleaves a staging directory, and the next run then refusesDIRas not a seed.Local gates, on f88f64b (tests and mutants re-run on 0429ff7)
cargo fmt --check-D warningscargo test --workspace --no-fail-fastrivet validate,rivet check verification-evidencetools/systest/install-shadow.shcargo deny checktools/check-py-floor.py(Python 3.9.6), shellcheck 0.11.0-S warningMutants: full shards, CI's command,
-j 2.varvecmds.rschanged, on 3ba3c42 (its files unchanged since)main.rsandlineindex.rs, both excused inmutation-scope.toml. The CLI paths are covered bytests/seed.rs.🤖 Generated with Claude Code
https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu