Repository navigation
Rust #325: route query arguments the server cannot decode - #849
Conversation
|
Source review of exact One existing boundary should remain explicit: PHP’s “array” also permits named arguments. Server 2.11.5 locks Core 2.15.1 ( A concrete additional case is a declared This review covers source and fixture expectations. I did not execute the Rust or HTTP tests. Follow-up on exact Hosted qualification for exact |
Published Server decodes a query's arguments only to check them against a query contract the run's start recorded (validateContractedQueryArguments). A run that declares no queries routes the query with its arguments as given, so its worker receives even a blob that does not decode; a declared query refuses such arguments before routing, with PHP's message and validation_errors. Native refused any undecodable blob at admission with a bare invalid_query_arguments. The query-arguments fixture records both against published 2.11.5. The port log's stale "Start build-id pin" gap is corrected: native has pinned starts since #696. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0f80dad to
0d854ac
Compare
|
Thanks for the named-argument review. You're right: a string-keyed Avro map decodes to a PHP array, and with a durable query contract Core normalizes it as named arguments ( At
No runtime source changed. I'll port |
|
Published Server checks a declared query's arguments with Workflow's
WorkflowQueryContract::validatedArgumentsForRun: a string-keyed map is
taken as named arguments, positional ones are matched in order, defaults
are filled in and variadics collected, and each violation is reported
with its own message under validation_errors ("argument validation
failed"). The worker receives the normalized positional list, encoded
again. A declared query without a parameter contract takes a list as given
and refuses named arguments.
Native checked positional arguments only, refused a map, reported every
violation as a bare invalid_query_arguments and refused some contracts as
unsupported. query_contract.rs ports the normalization and PHP's declared
type rules; the query-contract-arguments fixture records twelve cases
against published Server 2.11.5. Found in review of #849.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published Server checks a declared query's arguments with Workflow's
WorkflowQueryContract::validatedArgumentsForRun: a string-keyed map is
taken as named arguments, positional ones are matched in order, defaults
are filled in and variadics collected, and each violation is reported
with its own message under validation_errors ("argument validation
failed"). The worker receives the normalized positional list, encoded
again. A declared query without a parameter contract takes a list as given
and refuses named arguments.
Native checked positional arguments only, refused a map, reported every
violation as a bare invalid_query_arguments and refused some contracts as
unsupported. query_contract.rs ports the normalization and PHP's declared
type rules; the query-contract-arguments fixture records twelve cases
against published Server 2.11.5. Found in review of #849.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published Server checks a declared query's arguments with Workflow's
WorkflowQueryContract::validatedArgumentsForRun: a string-keyed map is
taken as named arguments, positional ones are matched in order, defaults
are filled in and variadics collected, and each violation is reported
with its own message under validation_errors ("argument validation
failed"). The worker receives the normalized positional list, encoded
again. A declared query without a parameter contract takes a list as given
and refuses named arguments.
Native checked positional arguments only, refused a map, reported every
violation as a bare invalid_query_arguments and refused some contracts as
unsupported. query_contract.rs ports the normalization and PHP's declared
type rules; the query-contract-arguments fixture records twelve cases
against published Server 2.11.5. Found in review of #849.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published Server checks a declared query's arguments with Workflow's
WorkflowQueryContract::validatedArgumentsForRun: a string-keyed map is
taken as named arguments, positional ones are matched in order, defaults
are filled in and variadics collected, and each violation is reported
with its own message under validation_errors ("argument validation
failed"). The worker receives the normalized positional list, encoded
again. A declared query without a parameter contract takes a list as given
and refuses named arguments.
Native checked positional arguments only, refused a map, reported every
violation as a bare invalid_query_arguments and refused some contracts as
unsupported. query_contract.rs ports the normalization and PHP's declared
type rules; the query-contract-arguments fixture records twelve cases
against published Server 2.11.5. Found in review of #849.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published Server checks a declared query's arguments with Workflow's
WorkflowQueryContract::validatedArgumentsForRun: a string-keyed map is
taken as named arguments, positional ones are matched in order, defaults
are filled in and variadics collected, and each violation is reported
with its own message under validation_errors ("argument validation
failed"). The worker receives the normalized positional list, encoded
again. A declared query without a parameter contract takes a list as given
and refuses named arguments.
Native checked positional arguments only, refused a map, reported every
violation as a bare invalid_query_arguments and refused some contracts as
unsupported. query_contract.rs ports the normalization and PHP's declared
type rules; the query-contract-arguments fixture records twelve cases
against published Server 2.11.5. Found in review of #849.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published Server checks a declared query's arguments with Workflow's
WorkflowQueryContract::validatedArgumentsForRun: a string-keyed map is
taken as named arguments, positional ones are matched in order, defaults
are filled in and variadics collected, and each violation is reported
with its own message under validation_errors ("argument validation
failed"). The worker receives the normalized positional list, encoded
again. A declared query without a parameter contract takes a list as given
and refuses named arguments.
Native checked positional arguments only, refused a map, reported every
violation as a bare invalid_query_arguments and refused some contracts as
unsupported. query_contract.rs ports the normalization and PHP's declared
type rules; the query-contract-arguments fixture records twelve cases
against published Server 2.11.5. Found in review of #849.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



Part of #325.
What changes
Published Server decodes a query's arguments only to check them against a query contract the run's start recorded (
WorkflowQueryTaskBroker::query,validateContractedQueryArguments):422 invalid_query_arguments, the messageWorkflow query [<name>] arguments could not be decoded.andvalidation_errors.arguments: ["Query arguments could not be decoded."]. Arguments that decode to a scalar rather than a PHP array get the "must decode to an array" variant. No query task is created.Not ported here (recorded in the port log): a string-keyed map is also a PHP array. With a durable query contract, Core normalizes it as named arguments (
WorkflowQueryContract::normalizeNamedArguments), validates each parameter with its own messages, and re-encodes the positional result for the worker. Native still refuses a map, and reports contract violations as a bareinvalid_query_arguments. The next PR portsWorkflowQueryContract.Native decoded every query's arguments at admission and refused an undecodable or non-list blob with a bare
invalid_query_arguments, whatever the run declared.Native now:
queries::read_arguments,QueryArguments);check_query_contract, only for a declared query, with PHP's message andvalidation_errors.The port log's "Start build-id pin" entry was stale: native has pinned starts since #696 (
build_pins.rs). It is corrected here.Contract
The new
query-argumentsfixture runs over raw HTTP on protocol 1.20 in a fresh namespace. Its fixture key isquery_argument_routing, because aquery_argumentsfield already belongs tostate-queries. It records against published 2.11.5:Each run receives an undecodable blob (
AAAA) and the avro encoding of a single string. Embedded applications have no worker protocol, so the case is explicitly inapplicable there. The probe retries lock-pressure refusals like the other probes. Contract:query-arguments-contract.mjs. Its unit test is registered inserver-parity.yml.Verification (run locally on the Rust dev host)
Fixture: recorded against published 2.11.5 on fresh SQLite state, and against a native image built from this branch. Both pass.
Native tests (SQLite, after rebasing onto Rust #325: store search attributes named on a workflow start #848, in this branch's own cargo target directory):
cargo test --test execution621 passed,cargo test --lib347 passed.New tests in
query_argument_routing.rs:validation_errors.Both fail on the previous source. The existing query tests pass (32).
Node: the contract, runner and fixture-selection unit tests pass (297).
Not run locally: PostgreSQL and MySQL; CI runs them.
Checkpoint:
docs/rust-server-port-checkpoints/2026-10-28-query-arguments.md.🤖 Generated with Claude Code