Skip to content

Commit 6d45cd9

Browse files
committed
Complete SQL and model flow stage with R37 verification evidence
1 parent 327ba94 commit 6d45cd9

215 files changed

Lines changed: 7530 additions & 190 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,3 +626,9 @@ A bounded website qualification candidate contains the20-project historical runt
626626
- Database cluster communication, including partition movement, MUST use native Orleans grains or Grain Services and actual Orleans silo discovery. Do not implement custom TCP/socket listeners, HTTP peer RPC, or silo addresses inferred from public HTTP endpoints and fixed ports. Public SDK/SQL/MCP transports retain their defined client contracts; they are not cluster coordination transports.
627627
- Tests which qualify cluster or partition-movement behavior MUST start the actual Orleans cluster through the existing Aspire-owned topology and exercise its real native calls and public SDK/MCP operations. A manual loopback network, direct journal submission in place of Orleans execution, or a separate substitute cluster cannot qualify that behavior.
628628
- Replace the custom movement transport and its exclusive network helpers together with the native implementation and meaningful complete operation flows. Preserve server-authenticated peer identity, native MAC/fingerprint bytes, current membership and physical owner checks, node-local storage ownership, RF3 acknowledgement, admission limits, cancellation and joined shutdown. Retain original failures as evidence without keeping a rejected runtime fallback.
629+
630+
## Library reuse and owner approval, owner direction 2026-10-13
631+
632+
- Before implementing infrastructure or a parser ourselves, evaluate existing Microsoft libraries first when their native contracts fit the product. Compare other maintained libraries where they fit better; preserve the explicitly selected Orleans, ZoneTree and ManagedCode ownership boundaries.
633+
- Every new library adoption requires the owner's explicit approval for that library. Before asking, prepare a concrete reviewable comparison covering purpose, exact package/version and license, dialect/API fit, resource and cancellation contracts, integration scope, existing code it would replace, and meaningful qualification. Research or a link supplied by the owner is not approval to add the dependency or change the product dialect. Existing explicitly approved libraries retain their authorization; this does not revoke the standing scoped ManagedCode repair/release workflow.
634+
- Reuse syntax parsing or infrastructure without confusing it with delivered database semantics. A parser/AST library does not by itself provide execution, persisted authorization, Orleans coordination, ZoneTree durability or client interoperability. Record performance claims only from the required measured evidence.

‎Directory.Packages.props‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
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.0" />
10+
<PackageVersion Include="ZoneTree" Version="2.0.1" />
1111
<PackageVersion Include="ZoneTree.FullTextSearch" Version="1.0.9" />
1212
<PackageVersion Include="ManagedCode.Communication" Version="10.3.7" />
1313
<PackageVersion Include="ManagedCode.Communication.AspNetCore" Version="10.3.7" />
1414
<PackageVersion Include="ManagedCode.Communication.Orleans" Version="10.3.7" />
15-
<PackageVersion Include="ManagedCode.TimeSeries" Version="10.1.1" />
16-
<PackageVersion Include="ManagedCode.Storage.FileSystem" Version="10.1.2" />
17-
<PackageVersion Include="ManagedCode.Orleans.Graph" Version="10.4.4" />
18-
<PackageVersion Include="ManagedCode.Orleans.Identity.Core" Version="10.4.0" />
19-
<PackageVersion Include="ManagedCode.MCPGateway" Version="0.4.17" />
20-
<PackageVersion Include="ManagedCode.MarkdownLd.Kb" Version="0.2.10" />
15+
<PackageVersion Include="ManagedCode.TimeSeries" Version="10.1.2" />
16+
<PackageVersion Include="ManagedCode.Storage.FileSystem" Version="10.1.4" />
17+
<PackageVersion Include="ManagedCode.Orleans.Graph" Version="10.4.5" />
18+
<PackageVersion Include="ManagedCode.Orleans.Identity.Core" Version="10.4.2" />
19+
<PackageVersion Include="ManagedCode.MCPGateway" Version="0.4.23" />
20+
<PackageVersion Include="ManagedCode.MarkdownLd.Kb" Version="0.2.17" />
2121
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.10.0" />
2222
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.12" />
2323
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.12" />
@@ -53,7 +53,7 @@
5353
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.19.0" />
5454
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.19.0" />
5555
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.19.0" />
56-
<PackageVersion Include="TUnit" Version="1.73.19" />
56+
<PackageVersion Include="TUnit" Version="1.74.0" />
5757
<!-- One native Microsoft engine: MTP collects test processes; the same-version CLI collects owned RF3 containers. -->
5858
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.12.0" />
5959
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Native remote graph operations, ASP.NET authentication, Event JOIN and composed-
113113

114114
Product functional coverage is **unmeasured**. Public performance figures require original GitHub measurements; process-kill tests do not prove power-loss durability.
115115

116-
Latest [local development checkpoint](docs/implementation/stage64-r36-development-20261013.json): Release build passed; 99 of 125 selected Unit cases passed and 26 failed. The RF3 selection was refused before resource startup, so no RF3 case executed in this checkpoint. Full Linux qualification remains open.
116+
Latest [local development checkpoint](docs/implementation/stage64-r37-development-20261013.json): Release build and formatter verification passed; 123 of 138 selected Unit cases passed and 15 failed. The RF3 run was cancelled after 24 failed cases; 53 selected cases were not executed. Runner joins completed, while RF3 cleanup and full Linux qualification remain open.
117117

118118
[Task tracker](docs/implementation/status.json) · [SQL conformance](docs/implementation/sql-client-conformance.json) · [Coverage](docs/Features/CodeQuality.md) · [Benchmark methodology](docs/Features/BenchmarkComparisons/Methodology.md) · [Published benchmarks](https://www.keyload.cloud/#benchmarks)
119119

‎docs/ADR/ADR-065-full-sql-client-compatibility.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,28 @@ Native Close(statement) and unnamed replacement retire portals referencing that
325325
Whole Unit flows use actual ZoneTree owners, independently literal rows/source identities, valid signed cursor continuation, malformed/unsupported refusal followed by healthy repair, current policy epochs, original-token pre-cancel controls, full raw image/position/identity conservation, byte-exact original receipt replay and two same-volume cold opens. Whole Aspire RF3 flows use genuine TLS raw frames where protocol controls are required, pinned Npgsql prepared/unprepared commands, SDK and official MCP SQL/AST, complete literal results, current policy denial/repair, minimum-token full document reads, original GUID receipt replay, no partial replies, and two real cold waves after every caller/transport is disposed. Positive Execute reuses the genuine original admitted Npgsql cancellation/ProducerDisposed flow with the default all-rows setting; it does not claim positive-limit-specific admission progress.
326326

327327
QueryPage.CutPosition remains opaque local metadata in RF3 and is never compared to replicated receipt positions. Public document/outbox equality is caller-visible conservation, not physical owner/incarnation or raw-store proof. AC-FEED-REFUSAL-AUTHORITY-002 remains OPEN. A deterministic genuine receiver failure at ErrorResponse publication has not yet been proven; the failure-ledger fix is source-bound and that regression gate remains OPEN. New-role compilation/native UID census, Linux RF3/fault/resource/endurance and full SQL/client conformance remain required; no current runtime result is inferred from these prepared texts. The authentic R35 DI startup failures precede protocol work and stay immutable; their minimal certificate registration correction and the original minimum-token oracle correction are separate retained parent-owned patches.
328+
329+
330+
### Native ErrorResponse receiver-failure operation (next guarded source candidate)
331+
332+
REQ/AC-SQLC-007/008 and REQ/AC-CLIENT-CONNECTION-001/002 under ADR-065/125 require the original native operation error to remain first when publishing its safe ErrorResponse fails. This candidate arms only the existing private, authenticated three-voter test profile: actual persisted Query revocation causes PermissionDenied in the genuine native Execute. A bounded closed witness records that the real ErrorResponse was encoded before the original configured control-flush deadline holds delivery. The exact owned TLS receiver is then aborted; actual ConnectionClosed releases the hold and the original FlushAsync observes the original linked cancellation token. No exception, fake producer, fake RequestContext, payload-bearing diagnostic or artificial endpoint is injected.
333+
334+
The same owner retains primary object identity before actual flush failure through backend, catalog, credential, transport connection and connection-grain cleanup. Binary create-only owner/arm/witness records are session/voter bound, byte/count limited and atomically published; successful cleanup is proved before deleting the fixture-owned controls, and failures retain originals. The original control-flush deadline includes the hold; no timeout, session capacity, frame/reply limit or native authorization rule is increased.
335+
336+
The full Q1/Q2 Aspire RF3 cases preserve complete caller-visible document/outbox images, exact persisted denied/restored principals, original command-GUID receipts, genuine minimum-token document reads and independent literal SQL/AST full pages. After fresh policy repair they exercise real Npgsql prepared/unprepared, SDK and official MCP callers, then two original-volume cold continuations after original caller/receiver task disposal. Public query cuts remain opaque and are not compared with replicated receipt positions. This is N-only source evidence; compilation, actual runtime, Linux fault/resource qualification and full SQL/client compatibility remain open.
337+
338+
REQ-SQLC-006 / AC-SQLC-006 (SQLC-READ), REQ/AC-QUERY-004/005/006 and ADR-065: source candidate SQL.NullDistinct.v1 adds IS DISTINCT FROM and IS NOT DISTINCT FROM through the existing canonical Predicate nodes. For two present non-null scalar operands DISTINCT means existing not-equal; two JSON nulls are not distinct and exactly one JSON null is distinct. KeyLoad MISSING remains distinct from JSON null: either missing operand yields unknown for both forms, preserving NOT/AND/OR three-valued behavior. Existing incompatible non-null scalar types still refuse Validation; no implicit coercion is introduced. This is the bounded comparison family, not SELECT DISTINCT, set operators or full SQL.
339+
340+
The parser requires exact identifier-kind IS/[NOT]/DISTINCT/FROM tokens and a real bounded operand; it lowers into existing Comparison, NullTest, Logical and Negation nodes, then the unchanged normalizer charges the entire expansion, query bytes, token/depth limits, field Use, original cancellation and read view. No new serialized predicate node, wire contract, public endpoint, authority store, fallback or budget is introduced.
341+
342+
SqlNullDistinctWholeFlowTests and SqlNullDistinctRf3WholeFlowTests independently author literal outputs and equivalent ASTs for null/non-null/missing/self/NOT/OR cases. The genuine native ZoneTree and Aspire RF3 Npgsql prepared/unprepared/SDK/official MCP flows include malformed grammar refusal, original-token pre-cancel control, persisted Query denial and exact epoch repair, a real acknowledged bool-vs-decimal source mutation causing whole-query Validation with no partial page, exact revision-CAS repair, immutable original seed/fault/repair receipt replay, and healthy continuation through two same-volume/actual-container cold waves. Unit checks full raw image/position/identity; public RF3 checks exact full document images with real minimum tokens plus outbox conservation. RF3 QueryPage cut stays opaque; no physical owner/cut or admitted-cancellation claim is added.
343+
344+
Native preview/new-file absence is source evidence only. New-role compilation, actual native identities, original operation/failure/cold joins, Linux RF3 and full client conformance remain OPEN. Existing SELECT DISTINCT remains unsupported.
345+
346+
```mermaid
347+
flowchart LR
348+
A[Bounded IS DISTINCT FROM syntax] --> B[Existing canonical predicate lowering]
349+
B --> C[Fresh policy and charged authorized read]
350+
C --> D[Whole literal SQL and independent AST results]
351+
D --> E[Type refusal exact repair and two cold continuations]
352+
```

‎docs/ADR/ADR-125-connection-owned-execution.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,3 +508,35 @@ REQ/AC-AUTH-ASPNET-003, REQ/AC-AUTH-004/005 and AC-CRS-006 retain the original A
508508
This test-only extension changes no product API, format, scope, scheduling, clock, quota or timeout and adds no Test/Args/UID. Existing AcCrs058 independently covers real same-HTTP2-connection tenant overlap/cancellation and native producer settlement; existing native scope cases cover previous RequestContext restoration on cancellation/disposal/terminal, without promoting C0 to RF3. Existing AcMcp002CurrentPersistedPrincipalControlsEachCallAfterDiscovery remains the independent true all-three same-volume cold/full-receipt/replay gate. Do not cold-restart this shared keyed concurrent fixture or replace those cases. Fresh compiled UID discovery, native50/SIMD execution, Linux and coverage gates remain OPEN until exact-source execution; source preview is not runtime proof.
509509

510510
The private integration successor retains all actual concurrent task faults/cancellations after both operations join, using the existing native ServerFailureObserver on separate per-operation ledgers and ordered aggregation. It does not replace work, modify scheduling/deadlines, use fake tasks or share a mutable failure list across concurrent continuations. This corrects new test-owner error retention only; compiler/runtime qualification remains OPEN.
511+
512+
513+
### Exact native decimal parameter binding — guarded source contract
514+
515+
REQ/AC-SQLC-005/007/008, REQ/AC-QUERY-004/006 and ADR-065/125 extend the existing TLS/API-key profile with numeric OID 1700 for exact .NET decimal values. Parse accepts the same bounded parameter slots; Bind decodes text or native base-10000 numeric framing before unchanged canonical JSON parameter dispatch. Finite values must fit the native 96-bit coefficient and scale 0–28 exactly. No rounding, truncation, floating-point conversion, arbitrary-precision allocation, new dispatcher or retained grant is introduced. Malformed numeric framing/sign/digits/exponent syntax is Validation. NaN/infinities, nonrepresentable finite values and binary dscale hiding nonzero precision are UnsupportedCapability. The last refusal deliberately differs from PostgreSQL's permissive hidden-digit truncation; the closed profile does not advertise general PostgreSQL numeric compatibility. Trailing zero coefficient normalization preserves mathematical value, not original numeric display scale.
516+
517+
All existing frame/parameter/session/read/output byte limits, TimeProvider deadlines, native Communication result ownership, one connection grain and separate request grain, persisted API-key verification and fresh per-operation permissions remain. QueryPage results remain one whole canonical JSONB image; local cuts are opaque. PostgresDecimalRf3WholeFlowTests is a prepared whole genuine Aspire RF3 scenario: real Npgsql10.0.3 prepared/unprepared decimal parameters at extrema and fractional precision, SDK/official MCP SQL plus independent AST parity, literal complete pages, malformed/unsupported native Bind then Sync and healthy Bind on the original TLS owner, current Query revoke/exact restore, original-token pre-cancel control, minimum-token full document/outbox conservation, original seed GUID receipt replay and two existing same-volume cold waves after every transport is joined/disposed. It makes no admitted-cancel, physical owner, performance, Linux or full SQL qualification claim. Fresh source integration, compilation, exact native census and original runtime gates remain OPEN.
518+
519+
```mermaid
520+
flowchart LR
521+
Numeric[Bounded native numeric Bind] --> Exact[Exact decimal admission]
522+
Exact --> Auth[Fresh persisted authorization]
523+
Auth --> CQRS[Original connection owned CQRS]
524+
CQRS --> Whole[Whole canonical JSONB result]
525+
Numeric --> Refusal[Validation or explicit Unsupported]
526+
Refusal --> Sync[Original Sync and healthy Bind]
527+
```
528+
529+
### Native signed Int16 parameter binding — next guarded source contract
530+
531+
REQ/AC-SQLC-005/007/008 and REQ/AC-QUERY-004/006 under ADR-065/125 add PostgreSQL int2 OID21 to the same closed native TLS/API-key parameter profile. Bind accepts exactly two big-endian bytes for binary Int16, or invariant signed integral text within -32768..32767. The canonical JSON numeric value is exact; it uses the original parameter dictionary, query normalizer, source policy and native CQRS admission. Wrong binary width, malformed integral text and overflow return the existing Validation error; other unsupported OIDs keep their original UnsupportedCapability. Existing frames/slots/retained grants, query read/output budgets and operation/admission/deadlines are unchanged. No new query syntax, lossy conversion, fallback dispatcher, numeric domain expansion or general PostgreSQL compatibility is promised.
532+
533+
PostgresInt16Rf3WholeFlowTests is a prepared genuine Aspire RF3 whole operation: built-in Npgsql Smallint prepared/unprepared execution at signed extrema and ordinary values, SDK and official MCP SQL and independent AST full literal pages; original native Parse then malformed/overflow Bind refusal, Sync and fresh healthy Bind on the same TLS owner; persisted Query revoke/exact whole-principal repair and both public APIs plus Npgsql refusal; original-token pre-cancel control; exact original seed GUID receipt replay; minimum-token full literal documents/outbox conservation; and two real cold waves after original callers and native transports join/dispose. Query cuts stay opaque. Native semantic binding, original runtime, Linux/fault/resource and complete SQL/client qualification remain OPEN.
534+
535+
```mermaid
536+
flowchart LR
537+
Int16[Bounded int2 native Bind] --> Exact[Exact signed Int16 JSON value]
538+
Exact --> Auth[Current persisted permission]
539+
Auth --> CQRS[Original connection owner CQRS]
540+
Int16 --> Refusal[Validation]
541+
Refusal --> Sync[Same owner Sync and healthy Bind]
542+
```

0 commit comments

Comments
 (0)