Skip to content

Commit 6c2108d

Browse files
committed
release 0.0.2 with quality gates
1 parent 73d7cbb commit 6c2108d

47 files changed

Lines changed: 951 additions & 200 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.editorconfig‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ dotnet_style_collection_initializer = true:warning
3131
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
3232
dotnet_style_readonly_field = true:warning
3333

34+
# Keep semantic numeric limits and repeated protocol text named in product code.
35+
[src/**/*.cs]
36+
dotnet_diagnostic.S109.severity = warning
37+
dotnet_diagnostic.S1192.severity = warning
38+
3439
[tests/**/*.cs]
3540
dotnet_diagnostic.CA1707.severity = none
3641
dotnet_diagnostic.CA1716.severity = none

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
id: version
2121
attributes:
2222
label: Package version
23-
placeholder: 0.0.1
23+
placeholder: 0.0.2
2424
validations:
2525
required: true
2626
- type: input

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: dotnet build ManagedCode.FileContext.slnx --configuration Release --no-restore
3939

4040
- name: Test with coverage
41-
run: dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=${{ github.workspace }}/TestResults/coverage /p:CoverletOutputFormat=opencover
41+
run: dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=${{ github.workspace }}/TestResults/coverage
4242

4343
- name: Pack
4444
run: dotnet pack src/ManagedCode.FileContext/ManagedCode.FileContext.csproj --configuration Release --no-build --output artifacts

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
- name: Build
5959
run: dotnet build ManagedCode.FileContext.slnx --configuration Release --no-restore
6060

61-
- name: Test
62-
run: dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build
61+
- name: Test with coverage
62+
run: dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build /p:CollectCoverage=true
6363

6464
- name: Pack
6565
run: dotnet pack src/ManagedCode.FileContext/ManagedCode.FileContext.csproj --configuration Release --no-build --output artifacts -p:IncludeSymbols=false

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to ManagedCode.FileContext are documented here.
44

5+
## 0.0.2 - 2026-09-03
6+
7+
- Enforce a 95% product line-coverage gate in local and CI coverage runs.
8+
- Add centrally managed Roslynator, Meziantou, and Sonar static analysis with magic-number and repeated-string diagnostics.
9+
- Replace semantic default literals with the public `FileContextDefaults` contract and centralize tool descriptions.
10+
- Stream and bound individual range lines so giant unterminated lines cannot cause proportional memory allocation.
11+
- Exercise every Agent Framework file-context tool through real filesystem and LlmTck integration tests, including a sparse 1 GiB allocation boundary.
12+
513
## 0.0.1 - 2026-09-03
614

715
- Adapt ManagedCode.Storage `IStorage` to Microsoft Agent Framework `AgentFileStore`.

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Issues and focused pull requests are welcome.
1212
dotnet restore ManagedCode.FileContext.slnx
1313
dotnet format ManagedCode.FileContext.slnx --verify-no-changes --no-restore
1414
dotnet build ManagedCode.FileContext.slnx --configuration Release --no-restore
15-
dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build
15+
dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build /p:CollectCoverage=true
1616
```
1717

1818
4. Explain public API, dependency, configuration, and security changes in the pull request.
1919

20-
Keep product code provider-neutral: concrete storage providers and LlmTck belong in tests or host applications. Do not commit credentials, generated test artifacts, or packages. NuGet publication is performed only by the repository release workflow.
20+
The test command enforces at least 95% total line coverage for product code. Keep product code provider-neutral: concrete storage providers and LlmTck belong in tests or host applications. Do not commit credentials, generated test artifacts, or packages. NuGet publication is performed only by the repository release workflow.

‎Directory.Build.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<AnalysisMode>Recommended</AnalysisMode>
1313
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1414
<NoWarn>$(NoWarn);CS1591;MAAI001</NoWarn>
15-
<Version>0.0.1</Version>
15+
<Version>0.0.2</Version>
1616
<PackageVersion>$(Version)</PackageVersion>
1717
</PropertyGroup>
1818

‎Directory.Packages.props‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
55
</PropertyGroup>
6+
<ItemGroup>
7+
<GlobalPackageReference Include="Meziantou.Analyzer" Version="3.0.200" PrivateAssets="all" />
8+
<GlobalPackageReference Include="Roslynator.Analyzers" Version="5.0.0" PrivateAssets="all" />
9+
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.33.0.1635" PrivateAssets="all" />
10+
</ItemGroup>
611
<ItemGroup>
712
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
813
<PackageVersion Include="coverlet.msbuild" Version="10.0.1" />
@@ -24,7 +29,7 @@
2429
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.11" />
2530
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
2631
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.400" />
27-
<PackageVersion Include="OpenAI" Version="2.13.0" />
32+
<PackageVersion Include="OpenAI" Version="2.12.0" />
2833
<PackageVersion Include="Shouldly" Version="4.3.0" />
2934
<PackageVersion Include="xunit" Version="2.9.3" />
3035
<PackageVersion Include="xunit.runner.visualstudio" Version="4.0.0" />

‎README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
66
[![.NET 10](https://img.shields.io/badge/.NET-10.0-512BD4)](https://dotnet.microsoft.com/)
77

8-
Storage-backed file tools and Markdown knowledge-graph context for Microsoft Agent Framework.
8+
Bounded, provider-neutral file tools and Markdown knowledge-graph context for Microsoft Agent Framework.
99

1010
`ManagedCode.FileContext` turns any [`ManagedCode.Storage.Core.IStorage`](https://github.com/managedcode/Storage) implementation into an Agent Framework file context. An agent can read, list, grep, create, edit, and delete files through the framework's standard `file_access_*` tools; use bounded line-range and metadata tools for large files; and build/search/export a linked-data graph from Markdown through [`ManagedCode.MarkdownLd.Kb`](https://github.com/managedcode/markdown-ld-kb).
1111

@@ -40,7 +40,7 @@ flowchart LR
4040
## Install
4141

4242
```bash
43-
dotnet add package ManagedCode.FileContext --version 0.0.1
43+
dotnet add package ManagedCode.FileContext --version 0.0.2
4444
```
4545

4646
Add one concrete ManagedCode.Storage provider to the host application. For a local filesystem:
@@ -185,15 +185,17 @@ Product code references only `ManagedCode.Storage.Core`; it does not depend on a
185185

186186
## Tests
187187

188-
The test suite uses real filesystem storage. The tool-loop integration test starts a real ManagedCode.LlmTck HTTP server, returns an OpenAI-compatible `file_access_read` call, lets Agent Framework invoke the storage-backed tool, verifies the tool result was sent back to the model endpoint, and then receives the final response. No live model or API key is required.
188+
The integration-first test suite uses a unique real filesystem root per test. LlmTck HTTP replays invoke every advertised `file_access_*` and `file_context_*` tool through the actual Agent Framework function loop, then assert the resulting file content or structured tool result. A sparse 1 GiB file scenario verifies bounded range reads, allocation limits, and fail-fast handling for an oversized single line. No live model or API key is required.
189189

190190
```bash
191191
dotnet restore ManagedCode.FileContext.slnx
192192
dotnet format ManagedCode.FileContext.slnx --verify-no-changes
193193
dotnet build ManagedCode.FileContext.slnx --configuration Release
194-
dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release
194+
dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release /p:CollectCoverage=true
195195
```
196196

197+
The coverage command enforces at least 95% line coverage for the product assembly and writes an OpenCover report under the test project's `TestResults/coverage` directory.
198+
197199
## Documentation
198200

199201
- [Architecture](docs/Architecture.md)
@@ -205,7 +207,7 @@ dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.cs
205207

206208
## Release policy
207209

208-
The package version is defined in `Directory.Build.props`. Pull requests and `main` run the required `build-and-test` workflow. NuGet publication is allowed only from the tag-driven GitHub Actions release workflow, and a tag such as `v0.0.1` must exactly match the evaluated package version. The repository intentionally provides no local publish script.
210+
The package version is defined in `Directory.Build.props`. Pull requests and `main` run the required `build-and-test` workflow. NuGet publication is allowed only from the tag-driven GitHub Actions release workflow, and a tag such as `v0.0.2` must exactly match the evaluated package version. The repository intentionally provides no local publish script.
209211

210212
## License
211213

‎docs/API/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The primary entry points are:
55
- `ManagedCodeStorageFileStore` — use when a raw Microsoft `AgentFileStore` is required.
66
- `FileContextProvider` — add one provider to an Agent Framework agent to receive standard file tools plus range, metadata, and graph tools.
77
- `IFileContext` — call the extended context operations directly from application code.
8+
- `FileContextDefaults` — reuse the package's named default limits and selectors when configuring or documenting a host.
89
- `AddManagedCodeFileContext(...)` — register the default storage-backed context services with Microsoft dependency injection.
910
- `AddKeyedManagedCodeFileContext(...)` — bind the context services to a keyed `IStorage` registration.
1011

0 commit comments

Comments
 (0)