Skip to content

Commit ffe03f2

Browse files
committed
Adopt native ZoneTree MVCC and refresh published packages
Use ZoneTree 2.0.6 transactions and retained read snapshots at data epoch 8. Remove the superseded value header path and its exclusive support. Clear the physical logical image before applying a complete journal checkpoint so deleted disk records cannot reappear. Validation: restore, full formatting and verification, all 21 Debug projects with warnings as errors, governance, source closure, shard partition and 3309-case discovery pass. Focused checks pass: 261 storage, 215 process recovery, four checkpoint, two deleted-range SQL, ONE/RF3 SDK/MCP/SQL gates and targeted settlement/text/restart cases. Combined-source Linux release qualification and released-image benchmarks remain required.
1 parent 85932f8 commit ffe03f2

59 files changed

Lines changed: 524 additions & 584 deletions

File tree

Some content is hidden

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

‎AGENTS.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ stop that approach and remove your own speculative additions. Apply this rule
1313
immediately, including to your previous changes, while preserving unrelated work
1414
and required correctness gates.
1515

16+
KeyLoad is under development. Replace superseded implementations completely when
17+
adopting an approved new design. Remove their exclusive helpers, contracts, tests
18+
and documentation together. Keep one current implementation; do not preserve old
19+
formats, backward compatibility routes or conversion mechanisms. The native
20+
ZoneTree MVCC storage adoption uses the current data epoch across storage and
21+
internal request purposes.
22+
1623
## Product and runtime
1724

1825
KeyLoad is one database for AI agents. Documents, typed tables, graphs,

‎Directory.Packages.props‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageVersion Include="Cartograph" Version="0.1.0-alpha" />
99
<PackageVersion Include="Cartograph.Catalog" Version="0.1.0-alpha" />
10-
<PackageVersion Include="ZoneTree" Version="2.0.5" />
10+
<PackageVersion Include="ZoneTree" Version="2.0.6" />
1111
<PackageVersion Include="ZoneTree.Analytics" Version="1.0.2" />
1212
<PackageVersion Include="ZoneTree.FullTextSearch" Version="1.1.0" />
1313
<PackageVersion Include="ManagedCode.Communication" Version="10.3.20" />
@@ -18,7 +18,7 @@
1818
<PackageVersion Include="ManagedCode.Storage.Server" Version="10.1.7" />
1919
<PackageVersion Include="ManagedCode.Orleans.Graph" Version="10.4.8" />
2020
<PackageVersion Include="ManagedCode.Orleans.Identity.Core" Version="10.4.2" />
21-
<PackageVersion Include="ManagedCode.MCPGateway" Version="2.3.2" />
21+
<PackageVersion Include="ManagedCode.MCPGateway" Version="2.3.3" />
2222
<PackageVersion Include="ManagedCode.MarkdownLd.Kb" Version="0.2.18" />
2323
<!-- Central transitive dependency used by Aspire and StreamJsonRpc. -->
2424
<PackageVersion Include="MessagePack" Version="3.1.12" />
@@ -31,18 +31,18 @@
3131
<PackageVersion Include="System.IO.Hashing" Version="10.0.14" />
3232
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="2.3.0" />
3333
<PackageVersion Include="ModelContextProtocol.Core" Version="2.3.0" />
34-
<PackageVersion Include="Microsoft.Orleans.Server" Version="10.4.1" />
35-
<PackageVersion Include="Microsoft.Orleans.Client" Version="10.4.1" />
34+
<PackageVersion Include="Microsoft.Orleans.Server" Version="10.4.2" />
35+
<PackageVersion Include="Microsoft.Orleans.Client" Version="10.4.2" />
3636
<PackageVersion Include="ManagedCode.Orleans.RapidMembership" Version="10.4.6" />
37-
<PackageVersion Include="Microsoft.Orleans.Streaming" Version="10.4.1" />
38-
<PackageVersion Include="Microsoft.Orleans.Reminders" Version="10.4.1" />
39-
<PackageVersion Include="Microsoft.Orleans.Journaling" Version="10.4.1-alpha.1" />
40-
<PackageVersion Include="Microsoft.Orleans.DurableJobs" Version="10.4.1-alpha.1" />
41-
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="10.4.1" />
42-
<PackageVersion Include="Microsoft.Orleans.Serialization" Version="10.4.1" />
43-
<PackageVersion Include="Microsoft.Orleans.Serialization.SystemTextJson" Version="10.4.1" />
44-
<PackageVersion Include="Microsoft.Orleans.CodeGenerator" Version="10.4.1" />
45-
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="10.4.1" />
37+
<PackageVersion Include="Microsoft.Orleans.Streaming" Version="10.4.2" />
38+
<PackageVersion Include="Microsoft.Orleans.Reminders" Version="10.4.2" />
39+
<PackageVersion Include="Microsoft.Orleans.Journaling" Version="10.4.2-alpha.1" />
40+
<PackageVersion Include="Microsoft.Orleans.DurableJobs" Version="10.4.2-alpha.1" />
41+
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="10.4.2" />
42+
<PackageVersion Include="Microsoft.Orleans.Serialization" Version="10.4.2" />
43+
<PackageVersion Include="Microsoft.Orleans.Serialization.SystemTextJson" Version="10.4.2" />
44+
<PackageVersion Include="Microsoft.Orleans.CodeGenerator" Version="10.4.2" />
45+
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="10.4.2" />
4646
<!-- Orleans' existing Roslyn dependency; analyzer tests select SDK compiler assets. -->
4747
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="5.9.0" />
4848
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.9.0" />
@@ -72,7 +72,7 @@
7272
<PackageVersion Include="MySqlConnector" Version="2.6.2" />
7373
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="10.0.14" />
7474
<PackageVersion Include="RabbitMQ.Client" Version="7.2.2" />
75-
<PackageVersion Include="StackExchange.Redis" Version="3.4.20" />
75+
<PackageVersion Include="StackExchange.Redis" Version="3.4.29" />
7676
<PackageVersion Include="MongoDB.Driver" Version="3.13.0" />
7777
<PackageVersion Include="KurrentDB.Client" Version="1.6.1" />
7878
</ItemGroup>

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ for ownership, distributed queries and open qualification gates.
185185
|---|---|
186186
| [.NET 10](https://github.com/dotnet/runtime) | C# end to end, pooled buffers, `Span<T>` and SIMD intrinsics; speedups need measurements |
187187
| [Orleans](https://github.com/dotnet/orleans) | The whole cluster: membership, routing, placement, migration, communication, data copies through grain calls and generated binary serialization |
188-
| [ZoneTree](https://github.com/ZoneTree/ZoneTree) | Embedded ordered storage and a write-ahead log for every model; data stays on its node |
188+
| [ZoneTree](https://github.com/ZoneTree/ZoneTree) | Native MVCC transactions and consistent snapshots over each node's ordered data |
189189
| [ZoneTree.FullTextSearch](https://github.com/ZoneTree/ZoneTree.FullTextSearch) | full-text indexing on the same storage foundation |
190190
| [Aspire](https://github.com/dotnet/aspire) | Owns server startup, required infrastructure, readiness and cleanup |
191191

‎docs/ADR/ADR-005-canonical-keyspace-codec.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ flowchart LR
3838
This decision adds REQ-KEYCODEC-001..004 and AC-KEYCODEC-001..004 in
3939
[StorageRecovery](../Features/StorageRecovery.md). This freezes validation of
4040
the existing format; every byte emitted for a supported valid existing key
41-
remains unchanged. Identity digests, aliases/Ids, current data epoch7, journals,
41+
remains unchanged. Identity digests, aliases/Ids, current data epoch8, journals,
4242
cluster and public wire DTOs remain unchanged. Unsupported data epochs fail closed.
4343

4444
The v1 type order is missing10, null11, bool20, int64/normalized int30, decimal31,

‎docs/ADR/ADR-060-internal-serialization.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Status: Accepted. Current owner direction: 2026-10-19.
44

55
## Decision
66

7-
The official Orleans 10.4.1 generated serializer owns binary encoding, decoding,
7+
The official Orleans 10.4.2 generated serializer owns binary encoding, decoding,
88
type metadata, object references, collections and field evolution. KeyLoad has no
99
custom field codec, binary grammar, assembly-name selector, per-assembly service
1010
provider cache, wire walker or replacement JSON DOM serialization model.
1111

1212
The shared serialization entry uses one standard `AddSerializer` registration
1313
and native pooled sessions. `JsonElement` alone uses the official
14-
`Microsoft.Orleans.Serialization.SystemTextJson` 10.4.1 codec; other attributed
14+
`Microsoft.Orleans.Serialization.SystemTextJson` 10.4.2 codec; other attributed
1515
contracts use generated binary codecs. This is an explicit type registration,
1616
not a general-purpose JSON serializer selection rule.
1717

‎docs/ADR/ADR-105-published-nuget-upgrade.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ADR-105: Published NuGet dependency refresh
22

33
Status: Accepted; local dependency integration checked. Complete delivered-source qualification remains open.
4-
Date: 2026-10-29.
4+
Date: 2026-10-30.
55
Feature: [RepositoryGovernance](../Features/RepositoryGovernance.md).
66

77
## Context and decision
@@ -12,10 +12,10 @@ the configured NuGet.org feed. Use the newest published stable release. Cartogra
1212
and Cartograph.Catalog have only their existing 0.1.0-alpha release; keep that
1313
published version. Do not introduce previews into stable package families.
1414

15-
The 2026-10-29 feed audit selects Orleans 10.4.1, with Journaling and Durable
16-
Jobs at 10.4.1-alpha.1, ManagedCode.Storage.Server/FileSystem 10.1.7 and
15+
The 2026-10-30 feed audit selects ZoneTree 2.0.6 and Orleans 10.4.2, with Journaling and Durable
16+
Jobs at 10.4.2-alpha.1, ManagedCode.Storage.Server/FileSystem 10.1.7 and
1717
TUnit/TUnit.Aspire 1.76.45. The existing transitive Orleans.Client and
18-
Orleans.Reminders dependencies are centrally pinned to 10.4.1 so the runtime
18+
Orleans.Reminders dependencies are centrally pinned to 10.4.2 so the runtime
1919
family remains aligned. The remaining central pins, Aspire.AppHost.Sdk and the
2020
existing local tools are already current.
2121
RapidMembership 10.4.6 is rebuilt against Orleans 10.4.1 in its owning repository.
@@ -58,9 +58,10 @@ flowchart LR
5858

5959
## Rollout, rollback and failure contracts
6060

61-
No KeyLoad schema, serializer aliases/field IDs, protocol, persisted authority,
62-
cluster membership or node-local ownership changes are selected. The existing
63-
recovery/serialization tests must detect dependency incompatibility. No compatibility or performance claim follows from version alignment or compilation.
61+
Serializer aliases/field IDs, cluster membership and node-local ownership stay
62+
with their current owners. The native MVCC storage format and data epoch are
63+
specified in [NativeMvcc](../Features/StorageRecovery/NativeMvcc.md). The existing
64+
recovery/serialization tests must detect dependency integration defects. No compatibility or performance claim follows from version alignment or compilation.
6465
Restore failure, downgrade, analyzer failure, runtime regression or missing
6566
infrastructure leaves qualification open. A reproducible dependency defect must
6667
be repaired at its actual owner; never suppress diagnostics to complete refresh.

‎docs/Architecture.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ volume's locking and flush behavior.
154154

155155
Sources: [Orleans stateless workers](https://learn.microsoft.com/en-us/dotnet/orleans/grains/stateless-worker-grains),
156156
[grain directory](https://learn.microsoft.com/en-us/dotnet/orleans/host/grain-directory),
157-
and [the pinned ZoneTree WAL open contract](https://github.com/ZoneTree/ZoneTree/blob/dea002a935e0de8ed6bae98b526556c440b6b467/src/ZoneTree/WAL/Sync/SyncFileSystemWriteAheadLog.cs).
157+
and [the pinned ZoneTree WAL open contract](https://github.com/ZoneTree/ZoneTree/blob/bd11bd6d2b6ce022acd009ac5b31a254f09b7655/src/ZoneTree/WAL/Sync/SyncFileSystemWriteAheadLog.cs).
158158

159159
Credentials and authorization policies are persisted in the database; callers
160160
never supply trusted roles. Standard ASP.NET Core authentication admits HTTP,

‎docs/Features/InternalSerialization.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# InternalSerialization
22

3-
The official Orleans 10.4.1 generated serializer encodes owned internal DTOs.
3+
The official Orleans 10.4.2 generated serializer encodes owned internal DTOs.
44
[ADR-060](../ADR/ADR-060-internal-serialization.md) defines the current contract.
55
Public HTTP/MCP JSON, exact user content, sortable keys, opaque ZoneTree bytes,
66
canonical hashes and blob payloads retain their concrete owning boundaries.

‎docs/Features/OrleansExecution/CapabilityReview.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ The review covers the capability families in the
2424
the [overview](https://learn.microsoft.com/en-us/dotnet/orleans/overview), linked
2525
Learn topics, and APIs/source at
2626
[v10.4.0](https://github.com/dotnet/orleans/releases/tag/v10.4.0). The current
27-
central packages use [10.4.1](https://github.com/dotnet/orleans/releases/tag/v10.4.1),
28-
with Journaling and Durable Jobs at 10.4.1-alpha.1. Updating packages does not
27+
central packages use [10.4.2](https://github.com/dotnet/orleans/releases/tag/v10.4.2),
28+
with Journaling and Durable Jobs at 10.4.2-alpha.1. Updating packages does not
2929
qualify the runtime criteria below or repeat every original source review.
3030

3131
`Source-present` means code or registration exists, not that its runtime gates
@@ -52,7 +52,7 @@ architecture judgments; no measured speed or memory benefit is inferred.
5252
| Activation state and caches — [lifecycle](https://learn.microsoft.com/en-us/dotnet/orleans/grains/grain-lifecycle) | Candidate: bounded validated caches rebuilt after migration. | Read-cut/policy-epoch identity, byte budget, invalidation and restart tests; never write or credential authority. |
5353
| `IPersistentState<T>` — [persistence](https://learn.microsoft.com/en-us/dotnet/orleans/grains/grain-persistence/) | Candidate: bounded snapshots through a ZoneTree adapter; no product grain uses it. | ETag CAS and uncertain-write recovery; never two writable copies of canonical state. |
5454
| Transactions — [transactions](https://learn.microsoft.com/en-us/dotnet/orleans/grains/transactions) | Candidate: short multi-grain transactions or a cross-partition SQL stage; current atomic batches are same-partition. | ZoneTree calls do not enlist automatically; an adapter must persist prepare/commit/abort to ReplicaCount copies with acknowledgement from every configured copy and define read visibility before any ACID claim. |
55-
| JournaledGrain and Orleans.Journaling — [journaling](https://github.com/dotnet/orleans/blob/v10.4.0/src/Orleans.Journaling/README.md) | Source-present under RuntimeJournal: the ZoneTree-backed journal provider used by Durable Jobs (10.4.1-alpha.1). Defer whole-history LogStorage. | binary format, ETag fencing, replay/compaction/corruption tests; recovery journals stay distinct. |
55+
| JournaledGrain and Orleans.Journaling — [journaling](https://github.com/dotnet/orleans/blob/v10.4.0/src/Orleans.Journaling/README.md) | Source-present under RuntimeJournal: the ZoneTree-backed journal provider used by Durable Jobs (10.4.2-alpha.1). Defer whole-history LogStorage. | binary format, ETag fencing, replay/compaction/corruption tests; recovery journals stay distinct. |
5656
| Durable Jobs — [README](https://github.com/dotnet/orleans/blob/v10.4.0/src/Orleans.DurableJobs/README.md) | Source-present: job handlers for due, ANN projection and time-series chunk work; persisted, at-least-once. | Idempotent effects, occurrence fences, missed-due restart and cancel/dispatch-race tests; a running attempt may finish after cancellation. |
5757
| Grain timers and reminders — [timers](https://learn.microsoft.com/en-us/dotnet/orleans/grains/timers-and-reminders) | Selected: the timer flush of StatelessWorker batches (not yet in source). Candidate: reminders for rare reconciliation; no provider today. | Bounded callback, joined disposal and a typed interval; a timer stops with its activation and never holds a durable schedule. |
5858

‎docs/Features/StorageRecovery.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Detailed contracts by topic:
88

99
- Format and identity: [CurrentFormat](StorageRecovery/CurrentFormat.md), [IdentityAuthorityAdmission](StorageRecovery/IdentityAuthorityAdmission.md), [DispatchIdentityPublication](StorageRecovery/DispatchIdentityPublication.md), [MetadataRegularFileReader](StorageRecovery/MetadataRegularFileReader.md), [OwnerLockRegularFile](StorageRecovery/OwnerLockRegularFile.md).
1010
- Journal and checkpoint: [WriteThroughJournal](StorageRecovery/WriteThroughJournal.md), [JournalOriginalFailure](StorageRecovery/JournalOriginalFailure.md), [CheckpointOriginalCause](StorageRecovery/CheckpointOriginalCause.md), [SeededRedoCorruption](StorageRecovery/SeededRedoCorruption.md), [RecoveryFaultRootRetention](StorageRecovery/RecoveryFaultRootRetention.md).
11-
- Read cuts: [RuntimeReadCuts](StorageRecovery/RuntimeReadCuts.md), [TransactionalReadViewOperation](StorageRecovery/TransactionalReadViewOperation.md), [CapturedReadSelectedCancellation](StorageRecovery/CapturedReadSelectedCancellation.md), [LiveRangeSelectedCancellation](StorageRecovery/LiveRangeSelectedCancellation.md), [ValueHeaderRefusal](StorageRecovery/ValueHeaderRefusal.md).
11+
- Read cuts: [NativeMvcc](StorageRecovery/NativeMvcc.md), [RuntimeReadCuts](StorageRecovery/RuntimeReadCuts.md), [TransactionalReadViewOperation](StorageRecovery/TransactionalReadViewOperation.md), [CapturedReadSelectedCancellation](StorageRecovery/CapturedReadSelectedCancellation.md), [LiveRangeSelectedCancellation](StorageRecovery/LiveRangeSelectedCancellation.md).
1212

1313
REQ-STORAGE-HOST-COMPOSITION-001 / AC-STORAGE-HOST-COMPOSITION-001: PartitionDatabaseComposition owns validation of the original host constructor inputs. PartitionHost invokes it at the same point before directory/storage acquisition, retaining the exact null checks and NodeOptions.Validate order. Ordered owner construction, rollback, materializer/verifier joins, store-close gate and all original failures remain unchanged. Existing host lifecycle, recovery and Aspire cluster whole operations plus the unchanged type200/function64 build gates verify this responsibility move; it introduces no new lifetime, operational policy or storage contract.
1414

@@ -97,7 +97,7 @@ REQ-STORAGE-014 / AC-RC-003 (also AC-AISQL-014): the unchanged receipt is writte
9797

9898
## Descending bounded borrowed ranges
9999

100-
REQ-STORAGE-013 / AC-RANGE-REV-001..003 ([ADR-052](../ADR/ADR-052-timeseries-bounded-aggregates.md)) accept the additive VisitReverseRange contract with the same exclusive bounds and borrowed lifetime as VisitRange. Private cursor, bounds and merge behavior are verified by real-store ReverseRangeTests, ReverseTransactionRangeTests and ReverseRangeResourceTests; interface and facade/budget forwarding stay unchanged. prefix-bounded NoRefresh reverse seek and SortedSet reverse enumeration preserve staged tombstones/replacements without complete buffering. Exact observer/lookahead/cancel/early-stop and healthy-following-operation tests are mandatory, with all existing forward tests preserved. seek failure disposal is covered by source/lifetime review, not by an executed fake fault case.
100+
REQ-STORAGE-013 / AC-RANGE-REV-001..003 ([ADR-052](../ADR/ADR-052-timeseries-bounded-aggregates.md)) accept the additive VisitReverseRange contract with the same exclusive bounds and borrowed lifetime as VisitRange. Private cursor, bounds and merge behavior are verified by real-store ReverseRangeTests, ReverseTransactionRangeTests and ReverseRangeResourceTests; interface and facade/budget forwarding stay unchanged. prefix-bounded native MVCC reverse seek and SortedSet reverse enumeration preserve staged tombstones/replacements without complete buffering. Exact observer/lookahead/cancel/early-stop and healthy-following-operation tests are mandatory, with all existing forward tests preserved. seek failure disposal is covered by source/lifetime review, not by an executed fake fault case.
101101

102102
```mermaid
103103
flowchart LR

0 commit comments

Comments
 (0)