Repository navigation
test(mech): random properties for what a session hands its target and leaves in the registry - #125
Merged
Merged
Conversation
… leaves in the registry - and the policy value read by its writer's marker Step 2e of the random-property plan, the mechanism crate: three properties, each beside its code, with oracles from a model or from the system itself. - The command line: whatever the program path and the arguments hold, `CommandLineToArgvW` - the system's own reader, imported in the test - reads back the path and every argument unchanged. A zero character is refused naming where it stood (R4-N16). - The WebView2 policy value, on a scratch key of HKCU with the calls production makes: the look a session takes before it writes, the write, another session's look, the removal - after each step the key holds exactly what the model says. - The environment block: every entry the session does not name reaches it unit for unit, every variable of the session's stands once with its last value, sorted by name without regard to case. The registry property found two faults, fixed here and named in CHANGELOG.md: - The first marker of a value was read, and a session puts its own last, after whatever `*` held. A `*` carrying a marker made a session's value somebody else's - left in the registry while the session said it was removed, or removed by another session while its writer ran - and a broken one hid a dead session's value from every later look. The last marker is read. - A look removed `*` when it carried the marker of a core that is gone. Names no session writes under are skipped. The weekly search gets a mechanism part with its canary, a path for pull requests, and the guard's floor goes from four places to five. Mutation registry 956 to 961: one entry from the history of each property (P9, the live-owner scan, R4-N17) and one for each fix, all caught. The anchor of `r4-15 s15 without surrogate repair` had gone stale in step 2a and is put right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Step 2e of the random-property plan, the last of step 2:
chrono-mech, the crate that touches the system - what a session hands its target (the command line, the environment block) and what it leaves in the machine registry (the WebView2 policy value of--elevated-embedded).Properties (3, each in a
mod propertiesbeside its code)lib.rspolicy_valuewv2entries)environmentThe oracles are the system's or a model's, not the code under test:
launch_linebuilds is read back byCommandLineToArgvW, the system's own reader (imported withraw-dylibin the test, asloader_failure.rsdoes, so thewindowscrate gets no new feature). Program paths are drawn from pieces of names Windows takes, every mark a command line could take for its own among them (spaces,&,%,^,!, parentheses,;,=, Polish letters, CJK, emoji, a share, a verbatim drive, a relative path). Arguments are drawn from pieces holding every separator a parser might split on, quotes, and runs of backslashes before a quote, the end, a letter and a space. A zero character, by name in the path, the working folder or an argument, is refused naming where it stood (R4-N16).HKCUwith the calls production makes, as the unit tests ofpolicy_value.rsdo. The*value is absent, not text, or switches with gaps of every kind - the port switch in each form, near misses, whole markers of other cores, broken ones. Beside it stand the tester's values, numbers, and values written the way a session writes one, by cores alive or gone, the key's default value among the names. The road is the one production takes: the session's own look for leftovers, the write, another session's look with the writer alive or gone, the removal. After every step the key holds exactly what the model says, value for value, and exists exactly when it should.Fixed
The registry property found two faults on its first cases:
*into its value and puts its own marker last, so a*that carries a marker - a tester who copied a session's value there - made the value look like another core's. The session then left its value in the machine registry while saying it was removed, and another session's look removed it while it ran. A broken marker in*hid a dead session's value from every later look. The last marker is read now.*when it carried the marker of a core that is gone, though no session writes under*(or under the key's default value). Names no session writes under are skipped.CHANGELOG.mdnames both. Each has a unit test of its own.Weekly search
A
mechanismpart insearch.ymlwith its canary (crates/mech/src/search.rs) and the path that runs it on a pull request - sosearch.ymlruns on this one. The registry property takes about 2.5 ms a case, so the part searches 150 000 cases, about six minutes on the machine that measured it. The floor ofweekly_search.rsgoes from four places with properties to five.Measured
chrono-mech --lib129 to 135 tests, the three properties in 0.7 s. The guardshygiene,names,shape,weekly_search,components,architecture,wire_keys, clippy, clippy-pin and lint-ps green.r4-15 s15 without surrogate repairhad gone stale in step 2a (c859e29) - that line gained a?- and is put right, caught again.Not in this step
A batch script's line: the interpreter is its own reader, and a script cannot write back an argument holding
&,|or^, so the measured rows inbatch.rsstay its guard.tree::descendants(its three hazards have unit tests, and a reachability model would restate the code),host_zone(checked against the system for every year aSYSTEMTIMEholds), and the session family ofending.rs, a candidate for step 5, sequences on a live core.🤖 Generated with Claude Code