Skip to content

chore(maf): migrate to schema 0.3.0 (Edition 2024) - #37

Merged
alexeyzimarev merged 2 commits into
mainfrom
chore/maf-schema-0.3.0
Apr 29, 2026
Merged

alexeyzimarev merged 2 commits into
mainfrom
chore/maf-schema-0.3.0

Conversation

@alexeyzimarev

Copy link
Copy Markdown
Member

Summary

  • Bump MAF Python's kurrent-agent-schema floor to 0.3.0 and align its protobuf floor with the schema's new >= 6.32 runtime.
  • MAF .NET ProjectReference auto-tracks the in-repo schema; only the README dependency listing needed bumping to 0.3.0.
  • Wire format is unchanged at the protobuf level, but Edition 2024's explicit-presence default means JSON now emits explicitly-set zero scalars that proto3 silently dropped (e.g. "message_index": 0). One Python wire-format test updated to assert the new behaviour, sibling test added to keep the unset-omission case covered, stale "proto3 omits default scalars" comments dropped on both sides.

Test plan

  • MAF .NET — dotnet run against Kurrent.AgentFramework.IntegrationTests: 138/138 pass.
  • MAF Python — pytest --timeout=120 excluding tests/test_fact_extraction.py: 121/121 pass in 2.67s.
  • MAF Python — each tests/test_fact_extraction.py test in single-test isolation: 8/8 pass. (Pre-existing intra-file persistent-subscription flakiness when the file's tests run sequentially — unrelated to this migration; tracked separately.)

🤖 Generated with Claude Code

Bump MAF Python and MAF .NET to canonical schema 0.3.0. Schema 0.3.0
ships the v2 protos rebased on `edition = "2024"` with explicit field
presence as the default. The protobuf wire format is unchanged, but
JSON serialisation now emits explicitly-set zero-valued scalars
(`message_index = 0`, `turn_index = 0`, ...) that proto3 silently
dropped.

- MAF Python: bump `kurrent-agent-schema >= 0.3.0` and align the
  `protobuf` floor with the schema's new `>= 6.32` runtime requirement.
- MAF .NET: ProjectReference already tracks the in-repo schema; only
  the README dependency listing needed bumping to 0.3.0.
- Tests: `test_user_message_wire_format` (Python) updated to assert the
  Edition 2024 explicit-presence behaviour (zero is emitted). Added a
  sibling `test_user_message_unset_index_is_omitted` so the
  unset-omission case stays covered. Stale "proto3 omits default
  scalars" comments dropped from the eval round-trip tests on both
  sides; the existing defensive `.get(..., 0)` / `GetIntOrDefault`
  reads happen to be wire-shape agnostic, so no other test changes
  were needed.

Verified: MAF .NET 138/138 integration tests pass; MAF Python 121/121
non-fact_extraction tests pass, all 8 fact_extraction tests pass in
single-test isolation (pre-existing intra-file persistent-subscription
flakiness, unrelated).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Migrate MAF to schema 0.3.0 (Edition 2024)

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Migrate MAF to protobuf schema 0.3.0 with Edition 2024
• Update Python dependencies: kurrent-agent-schema >= 0.3.0, protobuf >= 6.32
• Update .NET README schema version to 0.3.0
• Adjust wire-format tests for explicit field presence behavior
Diagram
flowchart LR
  A["Schema 0.2.1<br/>proto3"] -->|"Edition 2024<br/>explicit presence"| B["Schema 0.3.0<br/>Edition 2024"]
  B -->|"Python deps"| C["kurrent-agent-schema >= 0.3.0<br/>protobuf >= 6.32"]
  B -->|".NET deps"| D["README updated<br/>to 0.3.0"]
  B -->|"JSON wire format"| E["Zero scalars<br/>now emitted"]
  E -->|"Test updates"| F["Assert explicit zeros<br/>Add unset omission test"]
Loading

Grey Divider

File Changes

1. microsoft-agent-framework/python/pyproject.toml Dependencies +2/-2

Update Python schema and protobuf dependencies

• Bump kurrent-agent-schema floor from 0.2.1 to 0.3.0
• Bump protobuf floor from 5.27 to 6.32 to align with schema requirements

microsoft-agent-framework/python/pyproject.toml


2. microsoft-agent-framework/dotnet/README.md 📝 Documentation +1/-1

Update .NET schema version documentation

• Update Kurrent.Agent.Schema version from 0.1.0 to 0.3.0 in dependency listing
• Add clarification that schema v2 now uses Edition 2024 protos

microsoft-agent-framework/dotnet/README.md


3. microsoft-agent-framework/python/tests/test_serialization.py 🧪 Tests +14/-5

Update wire-format tests for Edition 2024 behavior

• Update test_user_message_wire_format to assert that explicitly-set zero values (e.g.,
 message_index = 0) are now emitted in JSON per Edition 2024 explicit presence
• Add new test_user_message_unset_index_is_omitted test to verify unset fields remain absent from
 JSON
• Remove stale proto3 default-omission comments that no longer apply

microsoft-agent-framework/python/tests/test_serialization.py


View more (2)
4. microsoft-agent-framework/python/tests/test_eval.py 🧪 Tests +0/-3

Remove stale proto3 omission comment

• Remove outdated comment about proto3 JSON canonical form omitting default-valued scalars
• Defensive .get(..., 0) read remains compatible with new explicit presence behavior

microsoft-agent-framework/python/tests/test_eval.py


5. microsoft-agent-framework/dotnet/tests/Kurrent.AgentFramework.IntegrationTests/EvalRunnerTests.cs 🧪 Tests +0/-2

Remove stale proto3 omission comment

• Remove outdated comment about proto3 JSON canonical form omitting default-valued fields
• Defensive GetIntOrDefault read remains compatible with new explicit presence behavior

microsoft-agent-framework/dotnet/tests/Kurrent.AgentFramework.IntegrationTests/EvalRunnerTests.cs


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Protobuf floor too low ☑ 🐞 Bug ☼ Reliability
Description
microsoft-agent-framework/python allows protobuf >=6.32, but the in-repo kurrent_agent_schema
generated modules validate a minimum runtime of 6.32.1, so resolving protobuf 6.32.0 would raise at
import time. This makes installation/runtime brittle despite the schema upgrade being otherwise
wire-compatible.
Code

microsoft-agent-framework/python/pyproject.toml[22]

+  "protobuf >= 6.32, < 8",
Evidence
The MAF Python package’s dependency floor permits protobuf 6.32.0, while the schema’s generated
protobuf modules explicitly call ValidateProtobufRuntimeVersion(6, 32, 1, ...) and the schema’s own
pyproject comment states the embedded runtime is 6.32.1; this combination means a resolver can pick
a runtime that the generated code rejects at import time.

microsoft-agent-framework/python/pyproject.toml[14-24]
schema/python/kurrent_agent_schema/_generated/kurrent/agent/v2/events_pb2.py[5-19]
schema/python/pyproject.toml[14-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
MAF Python’s `pyproject.toml` currently allows `protobuf >= 6.32`, but the generated schema code enforces `ValidateProtobufRuntimeVersion(6, 32, 1, ...)`. That means an environment resolving `protobuf==6.32.0` would fail at import-time when loading `kurrent_agent_schema`.

## Issue Context
The in-repo schema’s own `pyproject.toml` comment indicates the codegen embeds a 6.32.1 runtime floor, but the declared dependency is still `>= 6.32`.

## Fix Focus Areas
- microsoft-agent-framework/python/pyproject.toml[14-24]
- schema/python/pyproject.toml[14-18]

## Suggested change
Update dependency floors to `protobuf >= 6.32.1, < 8` so package metadata matches the generated code’s runtime requirement.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread microsoft-agent-framework/python/pyproject.toml Outdated
The 0.3.0 wheel's generated `_pb2.py` files call
`ValidateProtobufRuntimeVersion(6, 32, 1, ...)` at import time, which
rejects protobuf 6.32.0. The declared floor was `>= 6.32`, letting a
resolver pick a runtime the package itself refuses to load. Tighten
both the schema package and the MAF Python consumer to `>= 6.32.1`
and ship the corrected schema as 0.3.1.

No code or wire-format changes; only dependency metadata.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexeyzimarev
alexeyzimarev merged commit cb87354 into main Apr 29, 2026
2 checks passed
@alexeyzimarev
alexeyzimarev deleted the chore/maf-schema-0.3.0 branch April 29, 2026 11:01
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