Skip to content

.NET: [BREAKING] Graduate FileMemoryProvider#7114

Open
westey-m wants to merge 1 commit into
microsoft:mainfrom
westey-m:dotnet-graduate-filememoryprovider
Open

.NET: [BREAKING] Graduate FileMemoryProvider#7114
westey-m wants to merge 1 commit into
microsoft:mainfrom
westey-m:dotnet-graduate-filememoryprovider

Conversation

@westey-m

Copy link
Copy Markdown
Contributor

Motivation & Context

The .NET HarnessAgent and its supporting building blocks are being graduated out of experimental/preview status so the harness can ship GA (tracked by #6964). FileMemoryProvider — the harness's durable, owner-keyed file-memory building block — was still marked [Experimental(MAAI001)], which prevented it (and anything built on it) from being consumed without opting into experimental diagnostics. This PR graduates that provider and its directly related public types.

Description & Review Guide

  • What are the major changes?
    Removed the [Experimental(MAAI001)] attribute (and the now-orphaned using System.Diagnostics.CodeAnalysis; / using Microsoft.Shared.DiagnosticIds; usings) from the four FileMemory public types:

    • FileMemoryProvider
    • FileMemoryProviderOptions
    • FileMemoryState
    • FileListEntry
  • What is the impact of these changes?
    These four types become part of the stable public API surface — callers no longer need #pragma warning disable MAAI001 (or an equivalent NoWarn) to use them. Graduating public API out of experimental is a breaking change for existing experimental consumers, hence the [BREAKING] prefix.

    Note: FileMemoryProvider's public constructor still takes an AgentFileStore, which remains [Experimental] (out of scope for this PR). Constructing the provider therefore still touches an experimental type until AgentFileStore is graduated separately.

  • What do you want reviewers to focus on?
    That the graduation scope is limited to exactly these four FileMemory types and that no behavior changed — this is an attribute/using-only diff (4 files, 13 deletions).

Related Issue

Related to #6964 (umbrella tracking issue — intentionally left open, this PR graduates only the FileMemoryProvider types).

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI review requested due to automatic review settings July 14, 2026 14:58
@giles17 giles17 added the .NET Usage: [Issues, PRs], Target: .Net label Jul 14, 2026
@giles17 giles17 added the breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible label Jul 14, 2026

Copilot AI 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.

Pull request overview

This PR graduates the .NET harness FileMemory public types out of experimental/preview by removing [Experimental(MAAI001)] annotations and now-unused related using directives, making these types part of the stable public API surface.

Changes:

  • Removed [Experimental(DiagnosticIds.Experiments.AgentsAIExperiments)] from FileMemoryProvider, FileMemoryProviderOptions, FileMemoryState, and FileListEntry.
  • Removed orphaned using System.Diagnostics.CodeAnalysis; / using Microsoft.Shared.DiagnosticIds; directives from the affected files.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileMemoryProvider.cs Removes experimental attribute/diagnostic imports to make the provider stable API.
dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileMemoryProviderOptions.cs Removes experimental attribute/diagnostic imports to make options stable API.
dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileMemoryState.cs Removes experimental attribute/diagnostic imports to make state type stable API.
dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileListEntry.cs Removes experimental attribute/diagnostic imports to make list entry type stable API.

@github-actions github-actions 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.

Automated Code Review

Reviewers: 5 | Confidence: 96%

✓ Correctness

This PR cleanly removes the [Experimental(DiagnosticIds.Experiments.AgentsAIExperiments)] attribute and associated using directives from exactly four FileMemory types: FileListEntry, FileMemoryProvider, FileMemoryProviderOptions, and FileMemoryState. No behavioral code was changed. The removed using System.Diagnostics.CodeAnalysis; and using Microsoft.Shared.DiagnosticIds; directives are confirmed orphaned — no other references to those namespaces remain in the affected files. The graduation scope matches the PR description precisely.

✓ Security Reliability

This PR is a clean, attribute-only diff that removes the [Experimental(MAI001)] attribute and its associated using directives from four FileMemory public types (FileListEntry, FileMemoryProvider, FileMemoryProviderOptions, FileMemoryState). No behavioral code was changed. The removed usings (System.Diagnostics.CodeAnalysis and Microsoft.Shared.DiagnosticIds) are confirmed to be orphaned after the attribute removal. No security or reliability concerns arise from graduating these types out of experimental status.

✓ Test Coverage

This PR removes [Experimental] attributes from four FileMemory types (FileListEntry, FileMemoryProvider, FileMemoryProviderOptions, FileMemoryState). It is a purely attribute/using-removal diff with no behavioral changes. Existing tests in FileMemoryProviderTests.cs (49 tests) and HarnessAgentTests.cs (3 tests) comprehensively cover the behavior of these types — constructor validation, file CRUD, state management, thread safety, and integration. The remaining #pragma warning disable MAAI001 in the test file guards other still-experimental types (AIContextProvider.InvokingContext, AIContext), not the graduated types. No API surface approval tests exist for these types, but that is a pre-existing gap unrelated to this PR. No test coverage issues arise from this change.

✓ Failure Modes

This PR cleanly removes the [Experimental(MAI001)] attribute and its associated using directives from four FileMemory public types (FileListEntry, FileMemoryProvider, FileMemoryProviderOptions, FileMemoryState). The changes are purely declarative — no behavioral code was modified. There are no silent failures, swallowed exceptions, partial writes, or other operational failure modes introduced by this diff. The remaining using statements and class definitions are intact and correct in all four files.

✗ Design Approach

The main design gap is that FileMemoryProvider is being graduated as stable even though its only public construction path still requires the experimental AgentFileStore surface, so consumers still need to opt into MAI001 to actually use the provider. I did not find other design-approach issues in the attribute-only diff.

Flagged Issues

  • Graduating FileMemoryProvider alone does not achieve the stated consumption goal, because its only public constructor still requires AgentFileStore, which remains [Experimental] (dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileMemoryProvider.cs:103, dotnet/src/Microsoft.Agents.AI/Harness/FileStore/AgentFileStore.cs:25-26). A caller that tries to instantiate the newly-stable provider still hits the same experimental warning path.

Automated review by westey-m's agents

@github-actions

Copy link
Copy Markdown
Contributor

Flagged issue

Graduating FileMemoryProvider alone does not achieve the stated consumption goal, because its only public constructor still requires AgentFileStore, which remains [Experimental] (dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileMemoryProvider.cs:103, dotnet/src/Microsoft.Agents.AI/Harness/FileStore/AgentFileStore.cs:25-26). A caller that tries to instantiate the newly-stable provider still hits the same experimental warning path.


Source: automated DevFlow PR review

@westey-m westey-m marked this pull request as ready for review July 15, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible .NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants