Repository navigation
feat(gate): discover a fixture-repo corpus, and collapse nine copies of the materializer - #191
Merged
wenzowski merged 1 commit intoAug 9, 2026
Conversation
…of the materializer The corpus is committed data under crates/batten/tests/fixtures/repos/, each fixture carrying its config, its payload, and a hand-authored `expected` naming the argv, the exit code and the byte-exact stdout. The driver (tests/fixture_repos.rs) carries zero fixture facts and has no accept/bless mode: an expectation rewritten from observed output would agree with any behaviour at all. Because a discovery harness passes vacuously when it discovers nothing, the obligations are asserted rather than argued — discovery is exact rather than merely non-empty (a missing `expected` is an error, never a skip), the comparator is negatively self-tested in memory, every RuleKind::ALL variant is covered with the spawning kind driven by `enforce`, and every fixture runs twice for byte-stability. Corpus files are committed with a trailing `.in` so a fixture may carry a shape this repo's own gates refuse. The materializer was re-typed once per integration target and the copies had already diverged on the two behaviours that decide hermeticity: cli.rs's builder did not clear its scratch directory (312b320 was that drift being repaired one file at a time), and the copied `fn batten()` scrubbed no environment at all. Both are now unconditional in tests/common/mod.rs, and the scrub list is derived by walking SURFACE rather than copied, so a flag that mints a new BATTEN_ variable is scrubbed the day it lands. The repo-agnosticism half is policy-engine-first: a `forbid` rule over crates/batten/tests/** in the committed batten.toml. "At least one fixture per rule" cannot be a rule — its domain is the engine's own RuleKind table, not the repository's files — so it lands as a #[test] over that table instead. Refs: CLOUD-63
CLOUD-63 Build a fixture-repo test harness
Why Definition of done
Acceptance
Refinement — Ready (a discovered on-disk fixture corpus; the driver carries no fixture facts) Refinement gate: Definition of Ready & Done. This body carries only specializations.
|
wenzowski
marked this pull request as ready for review
August 9, 2026 16:14
Contributor
Author
|
/fast-forward |
wenzowski
deleted the
wenzowski/cloud-63-build-a-fixture-repo-test-harness
branch
August 9, 2026 16:19
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.
Lands CLOUD-63.
crates/batten/tests/fixtures/repos/<name>/) is committed data: config, payload, and a hand-authoredexpectedpinning argv, exit code and byte-exact stdout. No accept/bless mode — an expectation rewritten from observed output would agree with any behaviour at all.tests/fixture_repos.rs) carries zero fixture facts. Because a discovery harness passes vacuously when it discovers nothing, the obligations are asserted: discovery is exact (a missingexpectedis an error, never a skip), the comparator is negatively self-tested in memory, everyRuleKind::ALLvariant is covered with the spawning kind driven byenforce, every fixture runs twice, and every committed corpus file is inert (.in).cli.rs's builder did not clear its scratch directory, and the copiedfn batten()scrubbed no environment at all. Both are unconditional intests/common/mod.rs, and the scrub list is derived by walkingSURFACErather than copied — a flag that mints a newBATTEN_variable is scrubbed the day it lands.forbidrule overcrates/batten/tests/**in the committedbatten.toml. "At least one fixture per rule" cannot be a rule — its domain is the engine's ownRuleKindtable, not the repository's files — so it lands as a#[test]over that table instead.mise run verifygreen. 395 cargo tests, no warnings.Refs: CLOUD-63
Generated by Claude Code