Skip to content

Make the construction request JSON round-trip stable - #269

Merged
brad-richardson merged 1 commit into
mainfrom
fix/request-json-roundtrip
Aug 7, 2026
Merged

Make the construction request JSON round-trip stable#269
brad-richardson merged 1 commit into
mainfrom
fix/request-json-roundtrip

Conversation

@brad-richardson

Copy link
Copy Markdown
Owner

The first real dry-run of the July build failed admission:

dispatch request differs from the canonical reviewed request

Not tampering. admit-dispatch re-derives the request and compares it against the json.loads'd dispatch input, and the task_caps spec 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.

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.
@brad-richardson
brad-richardson merged commit 4e1093e into main Aug 7, 2026
12 checks passed
@brad-richardson
brad-richardson deleted the fix/request-json-roundtrip branch August 7, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant