Skip to content

fix(canonical-formats): read versions from typed legacy formats - #1757

Open
bokelley wants to merge 2 commits into
mainfrom
fix/typed-legacy-format-version-projection
Open

bokelley wants to merge 2 commits into
mainfrom
fix/typed-legacy-format-version-projection

Conversation

@bokelley

@bokelley bokelley commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Typed LegacyFormat inputs lost their VAST/DAAST versions during structural projection, even though the equivalent dictionary projected correctly. Normalize Pydantic models before collecting versions so nested typed requirements and root-model version lists follow the same registry resolution and advisory behavior as dictionary inputs.

Refs #1750. Generated models, schema pins and registry precedence are unchanged. Missing versions still fail closed.

Give the context-ID integration test fixture the unique private name _ContextIdEchoHandler. This prevents another test module’s _EchoHandler registration from hiding create_media_buy during full-suite collection. The test assertions and library behavior are unchanged.

Validation

  • Full local gates in Docker: make lint, make typecheck-all, and make test passed. 18595 passed, 2729 skipped, 10 deselected, 1 xfailed, 1017 warnings in 3745.97s (1:02:25); coverage 92.14%.
  • Docker: 96 tests passed across v1 projection, round trips and the registry.
  • The five new versioned-model parity cases failed before the fix; both missing-version controls passed.
  • Normal commit hooks passed: formatting, Ruff, source/adopter type checks, Bandit and file checks.
  • Independent code and security reviews found no remaining issues.

SDK 10 forward port: #1759.

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Oct 31, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ladon verdict: Approve

Approve — clean, well-scoped bug fix with no blocking or medium findings.

What I checked:

  • The fix normalizes BaseModel inputs via model_dump(exclude_none=True) in _v1_version_constraints before walking, so typed LegacyFormat inputs no longer lose VAST/DAAST versions during structural projection (v1_to_v2.py:180). This restores the function's documented "tolerates both dict and model" contract.
  • Parity with the dict path is asserted directly (from_model == from_dict), and fail-closed behavior on versionless formats is preserved and tested (test_typed_versionless_format_still_fails_closed).
  • Private helper only — no public-surface, wire-shape, or discriminated-union change. The fix: conventional-commit prefix is correct; no semver break involved.
  • No type-system import layering, generated-code, credential, or CI-gate concerns touched. New test coverage added for the fixed branch.

Decision table: no critical/high/medium findings; gated_paths is false; high_risk is false; no no-auto-approve team match; no prior decision. Falls through to row 9.

Note: review_decision is REVIEW_REQUIRED, but since gated_paths is false, row 2 does not apply and this does not block approval.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ladon verdict: Approve

Approve — behavior-neutral test rename, no blocking or medium findings.

This is a subsequent review on a prior approve. The delta since the prior pass is a single commit renaming the test-local handler _EchoHandler → _ContextIdEchoHandler in tests/integration/test_a2a_context_id.py to prevent another module's _EchoHandler registration from shadowing create_media_buy during full-suite collection. The reviewer confirms the rename is complete (all 5 sites: 1 def + 4 call sites renamed, no stray references; private, not exported) and behavior-neutral.

No new findings. No critical/high/medium findings surfaced. Changes are confined to canonical-format translation code plus tests — no public-API/export changes, no generated-code edits, no gated paths, no high-risk files.

Decision table: rows 1–8 do not fire (no findings, gated_paths false, high_risk false, no team gate, prior decision was approve not escalate). Falls through to row 9 → approve.

This branch has not been deployed

No deployments
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