Repository navigation
The server's replay of what the browser hands over judges as the browser did, by random roads - #364
Merged
Conversation
…ser did, by random roads A property walks seven forms by random roads of up to thirty steps, each answer one a person could give and each row one the buttons allow, and asks the replay of a JSON copy of value() for the same verdict, errors, pages walked past, stored value and every field's reading. It fails against the engines before #358 and #363, against one that strips a skipped page's answers from value(), and against one whose server ignores disabled rules. It found one disagreement on main: a rule reading an answer that a hiding clears in the same pass decides as though it were still there, because the pass reads the answers as it began. Both ways round: the browser can refuse what the server accepts, and accept and send what the server refuses, on a field it shows as optional or on one it does not show at all. That road is pinned as debt in four cases (A2, arc42 §11) and left out of the forms until its fix.
|
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.
Hazard A2 says the browser and the server must not disagree about a submission. The one engine build (0006) answers that only for the same road. The browser reaches its answers one at a time and keeps state between passes: what is hidden, which pages are walked past, which rows exist. The server builds an engine once, from what the browser hands over. Three defects in the last week were that disagreement by another road: #358, and two in #363.
packages/core/src/replay.test.tsis a fast-check property, test-only. It works like this:visiblerule on a skipped page, arequiredby rule, computed fields in groups and rows,minItems, defaults,clearOnHide: falseand adisabledrule.value()must give the same verdict, errors, skipped pages andsubmission(), and the same value, visibility, requiredness and disabledness of every field.Shown to fail against the engines before #358 and #363 (with
submission()aliased so they compile), against one that leaves a skipped page's answers out ofvalue(), and against one whose server ignoresdisabledrules. Onmain, three searches of 4,000 runs per form found nothing. A normal run takes about 4 s.What it found on
main, pinned as debt rather than fixed here. A rule that reads an answer which a hiding clears in the same pass decides as though the answer were still there. The pass reads the answers as it began, and avisiblerule's clear only reaches the store. Both ways round:Four cases in the test assert the disagreement as it is, and each flips against an engine with the debt fixed. The seven forms leave that road out until its fix, which comes in its own PR. SAFETY-ANALYSIS A2 and arc42 §11 record it.
What the walks do not cover, stated in A2:
An earlier version tolerated A3's stale computed value, and that let #358's defect through; it was removed.
Documents: SAFETY-ANALYSIS A2, arc42 §10 and §11,
LIFECYCLE.md, and 0006's Verified by. Run locally: lint, format check, the core typecheck, and the core and docs suites.