Make the construction request JSON round-trip stable - #269
Merged
Conversation
The first real dry-run failed admission with 'dispatch request differs from the canonical reviewed request'. The cause was not tampering: the task_caps spec paths were Python tuples, and admit-dispatch compares a json.loads'd request against a freshly derived one, where the tuples came back as lists. Every dispatch would have failed, and the message names no field, so it reads like a forged request. Paths are now JSON-native lists, and a round-trip test covers the whole request rather than that one field -- any future value whose type does not survive JSON fails in CI instead of at dispatch.
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.
The first real dry-run of the July build failed admission:
Not tampering.
admit-dispatchre-derives the request and compares it against thejson.loads'd dispatch input, and thetask_capsspec paths were Python tuples — which come back from JSON as lists.["a","b"] != ("a","b"), so the comparison fails and every dispatch would have failed this way.The failure mode is worse than the bug: the message names no field, so it reads like a forged or stale request rather than a container type.
Fixed by making the paths JSON-native, and covered by a test over the whole request rather than that one field — any future value whose Python type doesn't survive JSON now fails in CI instead of at dispatch. Verified failing-first by reintroducing a single tuple.
Working as intended, incidentally: this is precisely what the dry-run rung exists to catch, and it cost a runner minute instead of a planet run.
Full suite: 1,829 passed, 2 skipped.