You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Base branch: tamirdresher-microsoft-durable-state-schema-2-contract
Depends on schema contract PR #92 at eff12f41d3923d0123310a178b9dd6a0df61fb56.
This PR must not merge or activate schema 2.0 before #92 and its cross-runtime reader/consumer rollout gates are accepted.
Summary
Add passive .NET DTO, source-generation, conversion, and fail-closed validation support for the durable agent state schema 2.0 contract defined by #92.
What changed
Preserve existing .NET legacy state support for exact schema snapshots 1.0.0, 1.1.0, and 1.2.0.
Preserve mailbox identity and consistency with exact ordinal correlation comparisons and linear cross-map validation.
Support the accepted lossless shared message shapes: developer role, object or verbatim string function arguments, URI content with omitted media type, and explicit opaque JSON values.
Preserve optional terminal value absence separately from explicit null, false, zero, empty string, array, and object.
Preserve declared extensionData separately from undeclared future JSON fields at their original object locations.
Use an explicitly marked .NET unknown-content envelope so producer JSON that merely resembles internal metadata remains opaque and lossless.
Keep opaque session JSON object-only, cloned away from caller-owned document lifetime, and inert with no runtime type activation.
Validate RFC 3339 timestamps with mandatory seconds and explicit offsets, exact schema versions, typed known fields, receipt/result invariants, and diagnostic truncation evidence.
The production durable-state converter still rejects reading and writing schema 2.0 with a mailbox-aware activation error. New state continues to default to 1.2.0.
This layer exposes only an explicit internal passive contract path for serializer/fixture tests and later deliberate activation. Layer 2 must implement mailbox-aware entity execution and polling before production 2.0 reads/writes are enabled.
History binding
historyBinding remains an optional, opaque, separately versioned runtime profile using the #92 spelling. The shared .NET DTO preserves any JSON value without interpreting nested owner fields, inferring defaults, or restricting transitions. A relying C# profile may be validated and enforced by layer 3.
Atomic boundary
When a later layer activates schema 2.0, one successful durable entity operation must atomically commit its terminal result and matching receipt with the entity-local session continuation, ingestion bookkeeping, transcript, TTL, optional binding, and local control state. External provider writes and tool side effects are outside that entity-local transaction.
Adds passive .NET DTO, conversion, source-generation, and fail-closed validation support for durable agent state schema 2.0 while keeping production activation disabled.
Changes:
Adds schema 2.0 terminal, receipt, mailbox, truncation, and history-binding models.
Preserves legacy snapshots and lossless JSON/message conversions.
Adds validation, fixtures, tests, documentation, logging, and changelog coverage.
This revised-schema write guard only checks activation; after it passes, WriteValue calls Data.Validate, whose legacy branch checks revised top-level fields but never runs the transcript/content shape validation used by ReadElement. Consequently, a 1.2.0 state containing a developer role (or a legacy function-call string argument) can be serialized, and a 2.0.0 state with missing required content fields can likewise emit JSON that the shared schema rejects. Please apply the same version-aware structural validation to the serialized data before writing (or add equivalent model validation) so the writer remains fail-closed.
This entry links to tamirdresher/agent-framework-durable-extension#1, which is the earlier schema 1.2 foundation PR, not this schema 2.0 pull request (#93). The package changelog should link the new entry to the PR that introduces this change.
Base automatically changed from
tamirdresher-microsoft-durable-state-schema-2-contract to
mainSeptember 12, 2026 12:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add passive .NET DTO, source-generation, conversion, and fail-closed validation support for the durable agent state schema 2.0 contract defined by #92.
What changed
valueabsence separately from explicit null, false, zero, empty string, array, and object.extensionDataseparately from undeclared future JSON fields at their original object locations.Activation boundary
The production durable-state converter still rejects reading and writing schema 2.0 with a mailbox-aware activation error. New state continues to default to 1.2.0.
This layer exposes only an explicit internal passive contract path for serializer/fixture tests and later deliberate activation. Layer 2 must implement mailbox-aware entity execution and polling before production 2.0 reads/writes are enabled.
History binding
historyBindingremains an optional, opaque, separately versioned runtime profile using the #92 spelling. The shared .NET DTO preserves any JSON value without interpreting nested owner fields, inferring defaults, or restricting transitions. A relying C# profile may be validated and enforced by layer 3.Atomic boundary
When a later layer activates schema 2.0, one successful durable entity operation must atomically commit its terminal result and matching receipt with the entity-local session continuation, ingestion bookkeeping, transcript, TTL, optional binding, and local control state. External provider writes and tool side effects are outside that entity-local transaction.
Not in this PR
Validation
Microsoft.Agents.AI.DurableTask.UnitTeststests passed in Release664db2dcontains noschemas/changesgit diff --checkpassedgpt-5.6-solformal review: ACCEPTStack
This is the .NET implementation layer directly above #92. Every descendant durable-history layer must rebase onto this PR's new head.