Skip to content

Commit e784480

Browse files
committed
Extend SQL literals and operation flows; record R42 checks
1 parent 3eb0fff commit e784480

69 files changed

Lines changed: 6781 additions & 110 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.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ KL‑029 now satisfies its original projection rebuild, checkpoint recovery and
115115

116116
Full product functional coverage remains **unqualified**. A focused local run measured **25.73% lines / 19.63% branches** across 13 reported production modules; its 147 functional cases included four failures. Runner controls and load tests contributed no coverage. Public performance figures require original GitHub measurements; process-kill tests do not prove power-loss durability.
117117

118-
The latest [development checkpoint](docs/implementation/stage64-r41-development-20261013.json) has clean build and formatting checks: unit **234/240**, process recovery **11/13**, no skips. Eight failures, fresh RF3 and complete Linux qualification remain open.
118+
The latest [development checkpoint](docs/implementation/stage64-r42-development-20261013.json) has clean build and formatting checks: unit **246/250**, process recovery **33/35**, no skips or prior-pass regressions. Three prior failures now pass; six failures, fresh RF3 and complete Linux qualification remain open.
119119

120120
[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)
121121

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,3 +449,27 @@ flowchart LR
449449
Refusal --> Repair[No effects / exact repair / original healthy owner]
450450
Repair --> Cold[Original receipts and two cold continuations]
451451
```
452+
### NEXT closed hexadecimal integer literal source
453+
454+
REQ-SQLC-006 / AC-SQLC-006 SQLC-LEX/READ and REQ/AC-QUERY-004/005/006, ADR-065: NEXT guarded SQL.HexadecimalIntegerLiteral.v1 recognizes 0x/0X with hexadecimal digits and the current adjacent literal sign, preserving raw token text and existing bounded lexer checks. Native first-party Char.IsAsciiHexDigit and UInt128.TryParse(span, AllowHexSpecifier, InvariantCulture) decode the magnitude only within the existing exact decimal integer domain; empty/malformed prefix and magnitude above decimal.MaxValue refuse original safe Validation. No custom arbitrary-precision provider or package. Decimal/scientific/leading-point forms stay unchanged. Binary/octal, hexadecimal fractional forms, visual separators and general unary/arithmetic remain explicit UnsupportedCapability. This is not complete PostgreSQL integer type inference/literal grammar or full SQL compatibility.
455+
456+
The same approved ValueOperand, normalizer, fresh field/resource authorization, connection-owned Orleans execution, node-local bounded cut/read/output/depth/cancellation and public canonical result remain. Unsigned LIMIT/OFFSET/FETCH still use NumberStyles.None and reject hexadecimal counts. Preserve original SqlNullDistinctWholeFlowTests/SqlNullDistinctRf3WholeFlowTests declarations/Args/UIDs. Independent complete SQL/AST upper/lower/sign/range/IN/distinctness/decimal-boundary rows and quoted-string control, malformed/overflow and unsupported/count refusal followed by healthy results on the same original SDK/MCP/Npgsql owner, real Boolean type fault then original/hex SQL+independent AST refusal before exact revision3 repair/full receipts, persisted policy denial/restoration, original-token pre-cancel/healthy, full Unit raw image/cut/identity and public RF3 document/outbox parity, original GUID seed/fault/repair replay and two owned cold continuations are required. Source N/native admission/compiler/runtime/Linux/resource/recovery/fullSQL and physical-owner gates remain independent OPEN.
457+
458+
```mermaid
459+
flowchart LR
460+
Hex[0x integer / adjacent sign] --> Lex[Original bounded raw token]
461+
Lex --> Framework[Native UInt128 / decimal-domain bound]
462+
Framework --> AST[Existing ValueOperand / fresh authority / cut]
463+
AST --> Rows[Independent complete SQL and AST rows]
464+
AST --> Refusal[Malformed / overflow / unsupported / count / policy]
465+
Refusal --> Healthy[No effects / original owner / exact repair]
466+
Healthy --> Cold[Original receipts and two cold owners]
467+
```
468+
469+
470+
NEXT hex operation coverage also reuses the original PostgresNativeSessionRf3Tests scalar/join instances and existing PostgresRf3Parity caller/wire scopes: three independently true exact decimal-domain hexadecimal predicates precede the original ORDER BY and preserve each full original seeded page through actual SDK/MCP and Npgsql simple/prepared execution. This does not add seed fields, AST capabilities, request declarations, deadlines, or physical-owner/cut correlation. Original whole owner/no-effect/receipt/policy/cancellation/cold lifecycle remains; dedicated Q2 numeric-field type-repair and new-hex independent AST lowering beyond the scalar full-flow stay separate OPEN, not inferred from parity.
471+
REQ-SQLC-006 / AC-SQLC-006 SQLC-LEX and REQ/AC-QUERY-004/005/006, ADR-065: NEXT guarded SQL.EscapeStringLiteral.v1 accepts adjacent E/e single-quoted string literals using C-style escapes, octal/hex UTF-8 byte escapes and validated Unicode scalar/surrogate-pair escapes (u/U widths may be mixed; a backslash-x without hex digits is the literal x), lowered to the same original String ValueOperand. Invalid UTF-8, malformed Unicode, NUL, incomplete escape/quote refuse the existing fixed Validation diagnostic; ordinary strings, quoted identifiers, parameters and original unsupported operations remain unchanged. Native PostgreSQL positional-parameter rewriting must preserve escaped quotes and literal $n content and map only actual external parameters to original source positions. Native .NET Rune/UTF8Encoding/ArrayBufferWriter are used with original source/token/read/depth/output bounds and original cancellation; no package, AST/version/serializer, authorization, connection owner, admission quota or deadline changes. Independent complete scalar SQL/AST literal pages, real SDK/official MCP/Npgsql simple/prepared parity and a genuine bound positional argument outside an escaped literal, malformed refusal followed by healthy operation on the original connection, current persisted query-policy denial and exact epoch restoration, real retained scalar-type fault and revision3 repair, original-token pre-cancellation, seed/fault/repair receipt replay, complete Unit raw image/position/identity and RF3 public document/outbox image, warm and two original owned cold waves are required. Public query cuts remain opaque. Physical-owner correlation, admitted row-progress cancellation, native binding/compilation/runtime/Linux RF3/resource/recovery and full SQL/client compatibility remain separate OPEN; this is a prepared source contract, not delivered capability.
472+
473+
REQ-SQLC-006 / AC-SQLC-006 SQLC-LEX, ADR-065: NEXT SQL.StringContinuation.v1 joins single-quoted fragments separated by ASCII SQL whitespace/line-comments containing actual CR or LF. Same-line fragments, block-comment-only separators, prefixed later fragments, dollar/bit/U& literals remain unsupported. E escaping is inherited across subsequent plain fragments and UTF-8 byte validation occurs after the whole literal; each original fragment consumes the unchanged token budget. Original source retention, cancellation/deadlines, persisted policy, read cuts and complete caller/receipt/cold contracts remain unchanged. Source/compiler/runtime/Linux qualification and physical owner correlation remain OPEN.
474+
475+
The existing whole operation also requires explicit same-line/block-comment/later-prefix UnsupportedCapability and incomplete/invalid-byte Validation, exact native SQLSTATE, complete no-effects and healthy continuation on the same real SDK/MCP/Npgsql connection. A genuine source-sized empty-fragment operation exceeds original MaxQueryTokens while fitting the byte bound, then returns the full healthy original page. UTF-8 bytes spanning segments, literal $n through prepared/unprepared binding, current-policy/type repair, original receipt replay and two cold continuations remain literal full-result assertions; no new case UID or transport architecture is introduced.

‎docs/Features/BackupRestore.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,3 +1411,15 @@ After the existing genuinely authorized SetDispatch(false) and its successful na
14111411
The SAME original OldCursorAndLeasesStayFencedAfterAuthorizedResumeTwoColdAndHealthyDelivery operation explicitly commits SetDispatch(false) in its real source before capture. Require its full successful original result, complete stored outcome bytes, exact committed false bytes and no-effect matching replay. The archive therefore contains an active canonical dispatch record rather than relying on absent-record fallback.
14121412

14131413
After native restore, require independently authored committed true bytes before and after the existing real paused queue/group refusals, original failed outcomes and denied operator-resume checks. The actual restore writer already resets that record in its atomic authority reconciliation before publication; no product change or identity-file workaround is needed. Then retain the existing genuine generation2 reconciliation, authorized resume, canonical false authority, complete original cursor/lease failures, stored result replay, two joined cold owners and independently healthy event5/queue settlement. Full original source image/cut and every archive byte remain unchanged. This extends the original case without changing its declaration, Args or native identity; current compilation, execution, RF3 and Linux qualification remain pending.
1414+
1415+
### Original AC-BACKUP-003/004: complete resumed healthy queue ledger
1416+
1417+
The original restored-token whole flow preserves three distinct immediate queue admissions: subscription processing in the original source enqueues derived (sequence1); the existing authorized generation2 continuation publishes event4 and enqueues healthy (sequence2); the final independent continuation publishes event5 and enqueues resumed-token-healthy (sequence3). Matching command/inbox replay and refused old-token operations do not allocate another sequence, and ACK retains the admitted sequence. These are independently authored operation counts, not an expected value read from the returned inspection.
1418+
1419+
Require the complete final Acked MessageInspection with attempts1, stateVersion3, readySequence3, null scheduling/expiry/lease-owner/payload/header fields and leaseVersion1. Preserve every original full delivery/event/receipt/stored-outcome/source/archive/dispatch/current-authority/no-effect assertion and both joined cold owners. This repairs the R41 literal oracle after the full event4 continuation; the immutable R41 failed result remains historical failure. No product counter, deadline, clock, signature, budget, original case/Args/UID or API changes; native execution and required Linux/RF3 qualification remain open.
1420+
1421+
### Original AC-BACKUP-006: unavailable suffix of original packed archive
1422+
1423+
REQ/AC-BACKUP-001/002/006 require a physically truncated genuine original one-file Cartograph archive to refuse unpack without publishing a usable backup. Bounded pieces are internal records of the one .ctg file; there are no fabricated external piece files or rewritten catalogs. Retain the actual original native refusal object/type/HResult/text, all primary/cleanup failures, unchanged truncated bytes and absent or preserved-empty output/private mode, with no owned staging residue. The real CLI restore of that rejected output retains the existing FormatUnsupported Problem and joined process/readers/disposal.
1424+
1425+
Exact original-byte repair at the SAME archive path and SAME output must then execute actual CLI unpack/restore, preserve every original backup/source byte and whole literal model, admit an independently literal native healthy commit, and retain complete target bytes/identity/cut across two joined cold owners. No archive format, parser, library, error mapping, budget, deadline or authority contract changes. Existing cases/Args/UIDs remain; new native identities are unknown until actual compiled discovery. Source/N preparation does not establish CLI/runtime/Linux, RF3, admitted cancellation, memory bounds or power-loss qualification.

‎docs/Features/ClientApi.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,3 +1528,27 @@ flowchart LR
15281528
Refusal --> Repair[No effects / exact repair / original healthy owner]
15291529
Repair --> Cold[Original receipts and two cold continuations]
15301530
```
1531+
### NEXT closed hexadecimal integer literal source
1532+
1533+
REQ-SQLC-006 / AC-SQLC-006 SQLC-LEX/READ and REQ/AC-QUERY-004/005/006, ADR-065: NEXT guarded SQL.HexadecimalIntegerLiteral.v1 recognizes 0x/0X with hexadecimal digits and the current adjacent literal sign, preserving raw token text and existing bounded lexer checks. Native first-party Char.IsAsciiHexDigit and UInt128.TryParse(span, AllowHexSpecifier, InvariantCulture) decode the magnitude only within the existing exact decimal integer domain; empty/malformed prefix and magnitude above decimal.MaxValue refuse original safe Validation. No custom arbitrary-precision provider or package. Decimal/scientific/leading-point forms stay unchanged. Binary/octal, hexadecimal fractional forms, visual separators and general unary/arithmetic remain explicit UnsupportedCapability. This is not complete PostgreSQL integer type inference/literal grammar or full SQL compatibility.
1534+
1535+
The same approved ValueOperand, normalizer, fresh field/resource authorization, connection-owned Orleans execution, node-local bounded cut/read/output/depth/cancellation and public canonical result remain. Unsigned LIMIT/OFFSET/FETCH still use NumberStyles.None and reject hexadecimal counts. Preserve original SqlNullDistinctWholeFlowTests/SqlNullDistinctRf3WholeFlowTests declarations/Args/UIDs. Independent complete SQL/AST upper/lower/sign/range/IN/distinctness/decimal-boundary rows and quoted-string control, malformed/overflow and unsupported/count refusal followed by healthy results on the same original SDK/MCP/Npgsql owner, real Boolean type fault then original/hex SQL+independent AST refusal before exact revision3 repair/full receipts, persisted policy denial/restoration, original-token pre-cancel/healthy, full Unit raw image/cut/identity and public RF3 document/outbox parity, original GUID seed/fault/repair replay and two owned cold continuations are required. Source N/native admission/compiler/runtime/Linux/resource/recovery/fullSQL and physical-owner gates remain independent OPEN.
1536+
1537+
```mermaid
1538+
flowchart LR
1539+
Hex[0x integer / adjacent sign] --> Lex[Original bounded raw token]
1540+
Lex --> Framework[Native UInt128 / decimal-domain bound]
1541+
Framework --> AST[Existing ValueOperand / fresh authority / cut]
1542+
AST --> Rows[Independent complete SQL and AST rows]
1543+
AST --> Refusal[Malformed / overflow / unsupported / count / policy]
1544+
Refusal --> Healthy[No effects / original owner / exact repair]
1545+
Healthy --> Cold[Original receipts and two cold owners]
1546+
```
1547+
1548+
1549+
NEXT hex operation coverage also reuses the original PostgresNativeSessionRf3Tests scalar/join instances and existing PostgresRf3Parity caller/wire scopes: three independently true exact decimal-domain hexadecimal predicates precede the original ORDER BY and preserve each full original seeded page through actual SDK/MCP and Npgsql simple/prepared execution. This does not add seed fields, AST capabilities, request declarations, deadlines, or physical-owner/cut correlation. Original whole owner/no-effect/receipt/policy/cancellation/cold lifecycle remains; dedicated Q2 numeric-field type-repair and new-hex independent AST lowering beyond the scalar full-flow stay separate OPEN, not inferred from parity.
1550+
REQ-SQLC-006 / AC-SQLC-006 SQLC-LEX and REQ/AC-QUERY-004/005/006, ADR-065: NEXT guarded SQL.EscapeStringLiteral.v1 accepts adjacent E/e single-quoted string literals using C-style escapes, octal/hex UTF-8 byte escapes and validated Unicode scalar/surrogate-pair escapes (u/U widths may be mixed; a backslash-x without hex digits is the literal x), lowered to the same original String ValueOperand. Invalid UTF-8, malformed Unicode, NUL, incomplete escape/quote refuse the existing fixed Validation diagnostic; ordinary strings, quoted identifiers, parameters and original unsupported operations remain unchanged. Native PostgreSQL positional-parameter rewriting must preserve escaped quotes and literal $n content and map only actual external parameters to original source positions. Native .NET Rune/UTF8Encoding/ArrayBufferWriter are used with original source/token/read/depth/output bounds and original cancellation; no package, AST/version/serializer, authorization, connection owner, admission quota or deadline changes. Independent complete scalar SQL/AST literal pages, real SDK/official MCP/Npgsql simple/prepared parity and a genuine bound positional argument outside an escaped literal, malformed refusal followed by healthy operation on the original connection, current persisted query-policy denial and exact epoch restoration, real retained scalar-type fault and revision3 repair, original-token pre-cancellation, seed/fault/repair receipt replay, complete Unit raw image/position/identity and RF3 public document/outbox image, warm and two original owned cold waves are required. Public query cuts remain opaque. Physical-owner correlation, admitted row-progress cancellation, native binding/compilation/runtime/Linux RF3/resource/recovery and full SQL/client compatibility remain separate OPEN; this is a prepared source contract, not delivered capability.
1551+
1552+
REQ-SQLC-006 / AC-SQLC-006 SQLC-LEX, ADR-065: NEXT SQL.StringContinuation.v1 joins single-quoted fragments separated by ASCII SQL whitespace/line-comments containing actual CR or LF. Same-line fragments, block-comment-only separators, prefixed later fragments, dollar/bit/U& literals remain unsupported. E escaping is inherited across subsequent plain fragments and UTF-8 byte validation occurs after the whole literal; each original fragment consumes the unchanged token budget. Original source retention, cancellation/deadlines, persisted policy, read cuts and complete caller/receipt/cold contracts remain unchanged. Source/compiler/runtime/Linux qualification and physical owner correlation remain OPEN.
1553+
1554+
The existing whole operation also requires explicit same-line/block-comment/later-prefix UnsupportedCapability and incomplete/invalid-byte Validation, exact native SQLSTATE, complete no-effects and healthy continuation on the same real SDK/MCP/Npgsql connection. A genuine source-sized empty-fragment operation exceeds original MaxQueryTokens while fitting the byte bound, then returns the full healthy original page. UTF-8 bytes spanning segments, literal $n through prepared/unprepared binding, current-policy/type repair, original receipt replay and two cold continuations remain literal full-result assertions; no new case UID or transport architecture is introduced.

0 commit comments

Comments
 (0)