test(discovery): synthesize a scored run without a guest - #61
Closed
pengyuzhang wants to merge 1 commit into
Closed
Conversation
The scoring engine is built before any VM exists, which means it needs input before any VM exists too. This produces a run directory shaped exactly like one a real guest leaves behind - two snapshots and a manifest.actual.json - with defects injected on purpose so the scorer has something to find. The defects are chosen to exercise every outcome the scorer can produce: a miss, a duplicate, an invention a negative control explains, and one nothing explains. A fixture containing only successes tests nothing but the happy path. It is not a substitute for a captured run, and every directory it writes says so in its own metadata. A synthetic run proves the scorer computes what we think it computes; only a real one says anything about the collector. recorded/ is the load-bearing directory. Runs checked in there become the scoring engine's own fixtures: change the scorer, replay every recorded run, see exactly which verdicts moved.
This was referenced Aug 22, 2026
lghupan
approved these changes
Aug 23, 2026
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.
Stacked on #60.
The scoring engine is built before any VM exists, so it needs input before any VM exists too.
What it produces
A run directory shaped exactly like one a real guest leaves behind —
before.json,after.json,manifest.actual.json,canaries.json— built from the manifest, with defects injected on purpose.The injected defects exercise every outcome the scorer can produce: a miss, a duplicate spanning several entries, an invention a negative control explains, and one nothing explains. A fixture containing only successes tests nothing but the happy path.
--cleaninjects nothing, which is how the "a correct collector scores a clean sheet" case gets exercised — the half that is easy to forget, and the half that decides whether the instrument raises false alarms.This is not a captured run
Every directory it writes carries
"synthetic": truein its own metadata, and a later PR asserts that it does. A synthetic run proves the scorer computes what we think it computes. Only a real one says anything about the collector.recorded/is load-bearingRuns checked in there become the scoring engine's own fixtures: change the scorer, replay every recorded run, see exactly which verdicts moved. That property is what lets the scoring work happen at all before there is a VM to run against, and what keeps it honest afterwards.
The checked-in
synthetic-linux/is byte-for-byte reproducible from the manifest:Verification