Skip to content

test(conformance): fix the custom catalog and multi-catalog fixtures - #3267

Merged
nan-yu merged 1 commit into
mainfrom
test/conformance-fixtures
Oct 16, 2026
Merged

nan-yu merged 1 commit into
mainfrom
test/conformance-fixtures

Conversation

@nan-yu

@nan-yu nan-yu commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes to the shared conformance fixtures (the YAML cases under conformance/agent/ and the data under conformance/test_data/).

  1. Chart.caption in custom_catalog_v1_0.json is a DynamicString, as a caption in a published catalog would be. Two Express cases in multi_catalog_formats.yaml (test_express_compile_variable_holding_function_call_with_catalog_override and test_express_compile_function_catalog_override_in_expression_and_action) pass a formatString(...) call to the caption. They pass on main only because Express output skips some catalog checks. Once feat(python/agent)!: make the Parser stateless; always validate; add ResponseStream #3269 checks it like direct JSON output, a plain-string caption rejects them. The four direct JSON prompt goldens that embed the catalog are updated.
  2. Since a caption now accepts a binding, test_compile_express_binding_a_static_property_is_a_validation_error can no longer use Chart([1, 2], $/caption) to show that binding a static property fails. It binds Gauge.value, which is still a plain number, so the case keeps testing the same rule. The TypeScript unit tests that used the old input and the old prompt signature follow.
  3. The inline catalogs in multi_catalog_formats.yaml reference common_types.json, the file the protocol publishes, instead of common.json, which doesn't exist.

Testing

  1. Python: uv run pytest python/a2ui_agent/tests (1290 passed).
  2. TypeScript: yarn test in typescript/agents/a2ui_agent (757 passed).
  3. Dart: dart test in dart/a2ui_agent.

1. `Chart.caption` in `custom_catalog_v1_0.json` is a `DynamicString`, as
   a caption in a published catalog would be. The prompt goldens that
   embed the catalog are updated.
2. The Express case that binds a path to a property with a static type
   uses `Gauge($/value)`, since `Chart.caption` now accepts a binding. The
   TypeScript unit tests that used the old fixture follow.
3. The inline catalogs in `multi_catalog_formats.yaml` reference
   `common_types.json`, the file the protocol publishes, instead of
   `common.json`, which doesn't exist.

Signed-off-by: Nan Yu <nanyu@google.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the caption property of the Chart component in the custom catalog from a static string to a dynamic string (DynamicString from common_types.json). Consequently, the conformance tests, prompt generator expectations, and compiler unit tests have been updated to reflect this change (e.g., using Gauge($/value) instead of Chart to test forbidden databindings on static properties). Additionally, schema references in multi_catalog_formats.yaml have been corrected from common.json to common_types.json. There are no review comments, and I have no feedback to provide.

@nan-yu
nan-yu added this pull request to stack #3275 October 16, 2026 19:09

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is .txt the best extension for these files?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .txt fits: these are verbatim goldens that every SDK compares byte-for-byte, and the content is headings mixed with raw JSON rather than real Markdown, so .md would just get rendered on GitHub. It also matches the existing prompt goldens in conformance/test_data/skills/ (express_base_rules.txt, express_catalog_instructions.txt).


### Catalog Schema:
{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://a2ui.org/conformance/test_data/catalogs/custom_catalog_v1_0.json","protocolVersion":"1.0","title":"Conformance Custom Catalog (v1.0)","description":"A second catalog used by the multi catalog and capability negotiation cases. Its component and function names do not overlap with the basic catalog, so a case can tell the two apart by name alone.","catalogId":"conformance/custom","components":{"Chart":{"type":"object","description":"Plots a series of numbers.","properties":{"component":{"const":"Chart"},"values":{"type":"array","items":{"type":"number"}},"caption":{"type":"string"}},"required":["component","values"]},"Gauge":{"type":"object","description":"Shows a single value on a scale.","properties":{"component":{"const":"Gauge"},"value":{"type":"number"}},"required":["component","value"]}},"functions":{"percent":{"type":"object","description":"Renders a ratio as a percentage string.","returnType":"string","properties":{"@call":{"const":"percent"},"args":{"type":"object","properties":{"value":{"type":"number"}},"required":["value"],"unevaluatedProperties":false}},"required":["@call","args"]}},"$defs":{"anyComponent":{"oneOf":[{"$ref":"#/components/Chart"},{"$ref":"#/components/Gauge"}]},"anyFunction":{"oneOf":[{"$ref":"#/functions/percent"}]}}}
{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://a2ui.org/conformance/test_data/catalogs/custom_catalog_v1_0.json","protocolVersion":"1.0","title":"Conformance Custom Catalog (v1.0)","description":"A second catalog used by the multi catalog and capability negotiation cases. Its component and function names do not overlap with the basic catalog, so a case can tell the two apart by name alone.","catalogId":"conformance/custom","components":{"Chart":{"type":"object","description":"Plots a series of numbers.","properties":{"component":{"const":"Chart"},"values":{"type":"array","items":{"type":"number"}},"caption":{"$ref":"common_types.json#/$defs/DynamicString"}},"required":["component","values"]},"Gauge":{"type":"object","description":"Shows a single value on a scale.","properties":{"component":{"const":"Gauge"},"value":{"type":"number"}},"required":["component","value"]}},"functions":{"percent":{"type":"object","description":"Renders a ratio as a percentage string.","returnType":"string","properties":{"@call":{"const":"percent"},"args":{"type":"object","properties":{"value":{"type":"number"}},"required":["value"],"unevaluatedProperties":false}},"required":["@call","args"]}},"$defs":{"anyComponent":{"oneOf":[{"$ref":"#/components/Chart"},{"$ref":"#/components/Gauge"}]},"anyFunction":{"oneOf":[{"$ref":"#/functions/percent"}]}}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these schemas are oneliners, it's suuuuper hard to review what's changing here. Is this generated or maintained by hand?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're SDK output: the Direct JSON prompt generator serializes schemas compactly on purpose to save tokens, and all three SDKs compare the rendered prompt byte-for-byte against these files, so a bad edit fails CI everywhere. In this PR the only change in each of the four goldens is Chart.caption: "type":"string" → "$ref":"common_types.json#/$defs/DynamicString", mirroring the fixture change in custom_catalog_v1_0.json. git diff --word-diff makes it easy to spot.

@nan-yu
nan-yu merged commit d1ba35c into main Oct 16, 2026
51 checks passed
@nan-yu
nan-yu deleted the test/conformance-fixtures branch October 16, 2026 22:34
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI Oct 16, 2026
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.

2 participants