feat(variant): disk-verify the source manifest, fail-loud (REQ-265c)#719
Merged
Conversation
…bases (REQ-265c)
`rivet variant manifest` emitted each binding's `source:` globs unverified —
a manifest pointing at nonexistent directories exited 0, so an auditor
relying on it could not tell the sources were absent (DD-077 slice c).
Now the command verifies every glob's literal base directory (the leading
path components before the first `*`/`?`/`[`/`{`) against disk under the
project root, and:
- always WARNS loudly on stderr for a missing base (text and json), and
adds a `source_warnings` array to the JSON output;
- under a new `--strict` flag, escalates a missing base to a nonzero exit —
mirroring `validate --strict-variants`.
Verification is host-side (rivet-cli), not in the composition core, so the
wasm seam is untouched. A pattern that begins with a wildcard is anchored at
the root and skipped; a literal path with no metacharacters is checked whole.
Tests: warns-but-exits-0 on a missing base, `--strict` fails, and no warning
when the base exists. Confirmed with the variant_manifest suite (6 passing),
cli_commands (157 passing — clap-change guard), clippy --all-targets clean,
rivet validate + docs check PASS.
Slice (d) `export --variant` and serve manifest-surfacing remain; REQ-265
stays proposed until they land.
Refs: REQ-265, DD-077
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
REQ-265 slice c — disk-verify the variant source manifest (v0.29.0)
rivet variant manifest(the audit-facing per-feature source manifest) emittedeach binding's
source:globs unverified — a manifest pointing atnonexistent directories exited 0, so an auditor relying on it couldn't tell the
sources were absent. DD-077 slice (c).
Change
The command now verifies every glob's literal base directory (the leading
path components before the first
*/?/[/{) against disk under theproject root:
adds a
source_warningsarray to the JSON output;--strictflag, escalates a missing base to a nonzeroexit — mirroring
validate --strict-variants(REQ-261).A wildcard-leading pattern is anchored at the root and skipped; a literal path
with no metacharacters is checked whole. Verification is host-side
(rivet-cli) — the composition core and wasm seam are untouched.
Tests
manifest_warns_on_missing_source_base— warns on stderr + JSON, exits 0.manifest_strict_fails_on_missing_source_base—--strict→ nonzero exit.manifest_no_warning_when_source_base_exists— a present base is silent.Verification
variant_manifest suite 6 pass (3 new + 3 regression) · cli_commands 157
pass (clap-change guard) ·
clippy --all-targets(1.97.0) clean ·rivet validate+docs checkPASS.Slice (d)
export --variant+ serve manifest-surfacing remain; REQ-265 staysproposeduntil they land.Refs: REQ-265, DD-077
🤖 Generated with Claude Code