Skip to content

Commit 0c2f479

Browse files
committed
fix: qualify native coverage selection and event recovery
1 parent 517f4b7 commit 0c2f479

51 files changed

Lines changed: 63038 additions & 209 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.

‎.github/workflows/build-and-tests.yml‎

Lines changed: 68 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ jobs:
245245
- name: Build the complete native coverage cohort
246246
run: dotnet build KeyLoad.slnx --no-restore --configuration Release
247247
- name: Prepare original source and test-image receipts
248+
id: coverage-source
248249
shell: pwsh
249250
run: |
250251
$root = $env:GITHUB_WORKSPACE
@@ -255,59 +256,90 @@ jobs:
255256
"KEYLOAD_PRODUCT_COVERAGE_SOURCE_MANIFEST=$evidence/functional-coverage.production-source-manifest.json" | Add-Content $env:GITHUB_ENV
256257
- name: Test three-node database with .NET and MCP clients
257258
run: node scripts/Features/TestInfrastructure/run-tests.mjs --KeyLoadTests:Suite=rf3 --KeyLoadTests:ResultsDirectory=TestResults/rf3-required --KeyLoadTests:ReportTrx=true
258-
- name: Collect four native functional coverage cohorts
259+
- name: Reconcile original native full and five-group discovery in both modes
260+
id: native-census
261+
if: ${{ !cancelled() && steps.coverage-source.outcome == 'success' }}
262+
shell: pwsh
263+
run: |
264+
& pwsh -NoLogo -NoProfile -File scripts/Features/CodeQuality/functional-coverage.workflow-discovery.ps1 `
265+
-Repository $env:GITHUB_WORKSPACE `
266+
-EvidenceRoot (Join-Path $env:GITHUB_WORKSPACE 'TestResults/functional-coverage/rf3')
267+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
268+
- name: Execute full censuses and twelve original covered suite inputs
259269
id: functional-coverage
270+
if: ${{ !cancelled() && steps.native-census.outcome == 'success' }}
260271
shell: pwsh
261272
run: |
262-
$common = @(
263-
'scripts/Features/TestInfrastructure/run-tests.mjs',
264-
'--KeyLoadTests:ReportTrx=true',
265-
'--KeyLoadTests:CoverageSettings=scripts/Features/CodeQuality/functional-coverage.production.settings.xml',
266-
'--KeyLoadTests:CoverageFormat=coverage')
267-
& node @common '--KeyLoadTests:Suite=unit' '--KeyLoadTests:Filter=/*/*/(PartitionQueryAuthorizationTests|PartitionQueryCancellationTests|PartitionQueryContractTests|PartitionQueryGrantTests|PartitionQueryMcpContractTests|PartitionQueryMergeTests|PartitionQueryPublicAuthorizationTests|PartitionQueryPublicBudgetTests|PartitionQueryPublicContractTests|PartitionQueryPublicMergeTests|SqlInnerJoinBudgetTests|SqlInnerJoinCancellationTests|SqlInnerJoinDeclaredProjectionTests|SqlInnerJoinExecutionTests|SqlInnerJoinLifecycleTests|SqlInnerJoinOrdinalOrderTests|SqlInnerJoinRowAuthorizationTests|DocumentIndexCommittedScanTests)/*' `
268-
'--KeyLoadTests:ResultsDirectory=TestResults/functional-coverage/rf3/unit' `
269-
'--KeyLoadTests:CoverageOutput=TestResults/functional-coverage/rf3/unit/coverage.coverage'
270-
$unitExitCode = $LASTEXITCODE
271-
"unit_exit_code=$unitExitCode" | Add-Content $env:GITHUB_OUTPUT
272-
& node @common '--KeyLoadTests:Suite=unit-scalar' '--KeyLoadTests:Filter=/*/*/(PartitionQueryAuthorizationTests|PartitionQueryCancellationTests|PartitionQueryContractTests|PartitionQueryGrantTests|PartitionQueryMcpContractTests|PartitionQueryMergeTests|PartitionQueryPublicAuthorizationTests|PartitionQueryPublicBudgetTests|PartitionQueryPublicContractTests|PartitionQueryPublicMergeTests|SqlInnerJoinBudgetTests|SqlInnerJoinCancellationTests|SqlInnerJoinDeclaredProjectionTests|SqlInnerJoinExecutionTests|SqlInnerJoinLifecycleTests|SqlInnerJoinOrdinalOrderTests|SqlInnerJoinRowAuthorizationTests|DocumentIndexCommittedScanTests)/*' `
273-
'--KeyLoadTests:ResultsDirectory=TestResults/functional-coverage/rf3/unit-scalar' `
274-
'--KeyLoadTests:CoverageOutput=TestResults/functional-coverage/rf3/unit-scalar/coverage.coverage'
275-
$scalarExitCode = $LASTEXITCODE
276-
"scalar_exit_code=$scalarExitCode" | Add-Content $env:GITHUB_OUTPUT
277-
& node @common '--KeyLoadTests:Suite=recovery' `
278-
'--KeyLoadTests:Filter=/*/*/CommandIdempotencyProcessRecoveryTests/*' `
279-
'--KeyLoadTests:ResultsDirectory=TestResults/functional-coverage/rf3/recovery' `
280-
'--KeyLoadTests:CoverageOutput=TestResults/functional-coverage/rf3/recovery/coverage.coverage'
281-
$recoveryExitCode = $LASTEXITCODE
282-
"recovery_exit_code=$recoveryExitCode" | Add-Content $env:GITHUB_OUTPUT
283-
& node @common '--KeyLoadTests:Suite=rf3' `
284-
'--KeyLoadTests:Filter=/*/*/(PartitionQueryPublicRf3Tests|McpDocumentCrudParityTests|RelationalSqlRf3JoinTests|RelationalSqlRf3JoinAuthorizationTests|RelationalSqlRf3JoinBudgetTests|RelationalSqlRf3JoinCancellationTests|RelationalSqlRf3JoinReadCutTests)/*' `
285-
'--KeyLoadTests:ResultsDirectory=TestResults/functional-coverage/rf3' `
286-
'--KeyLoadTests:CoverageOutput=TestResults/functional-coverage/rf3/coverage.coverage' `
287-
'--KeyLoadTests:NativeCoverage:ServerMode=rf3-original-node-v1' `
288-
"--KeyLoadTests:NativeCoverage:SourceManifest=$env:KEYLOAD_PRODUCT_COVERAGE_SOURCE_MANIFEST"
289-
$rf3ExitCode = $LASTEXITCODE
290-
"rf3_exit_code=$rf3ExitCode" | Add-Content $env:GITHUB_OUTPUT
291-
if ($unitExitCode -ne 0 -or $scalarExitCode -ne 0 -or $recoveryExitCode -ne 0 -or $rf3ExitCode -ne 0) {
292-
exit 1
293-
}
273+
& pwsh -NoLogo -NoProfile -File scripts/Features/CodeQuality/functional-coverage.workflow-collect.ps1 `
274+
-Repository $env:GITHUB_WORKSPACE `
275+
-EvidenceRoot (Join-Path $env:GITHUB_WORKSPACE 'TestResults/functional-coverage/rf3') `
276+
-SourceManifestPath $env:KEYLOAD_PRODUCT_COVERAGE_SOURCE_MANIFEST
277+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
278+
- name: Verify original coverage source and test-image receipts after all children settle
279+
id: coverage-source-after
280+
if: ${{ !cancelled() && steps.coverage-source.outcome == 'success' }}
281+
shell: pwsh
282+
run: |
283+
& pwsh -NoLogo -NoProfile -File scripts/Features/CodeQuality/functional-coverage.production-source-manifest.ps1 `
284+
-Mode verify -Root $env:GITHUB_WORKSPACE `
285+
-EvidenceRoot (Join-Path $env:GITHUB_WORKSPACE 'TestResults/functional-coverage/rf3')
286+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
294287
- name: Assemble product descriptor from original reports
295288
id: product-descriptor
296289
if: ${{ success() }}
297290
shell: pwsh
298291
env:
299-
UNIT_EXIT_CODE: ${{ steps.functional-coverage.outputs.unit_exit_code }}
300-
SCALAR_EXIT_CODE: ${{ steps.functional-coverage.outputs.scalar_exit_code }}
301292
RECOVERY_EXIT_CODE: ${{ steps.functional-coverage.outputs.recovery_exit_code }}
302293
RF3_EXIT_CODE: ${{ steps.functional-coverage.outputs.rf3_exit_code }}
303294
run: |
304295
& pwsh -NoLogo -NoProfile -File scripts/Features/CodeQuality/functional-coverage.native-product-descriptor.ps1 `
305296
-Repository $env:GITHUB_WORKSPACE `
306297
-SourceManifestPath $env:KEYLOAD_PRODUCT_COVERAGE_SOURCE_MANIFEST `
307298
-ResultsRoot (Join-Path $env:GITHUB_WORKSPACE 'TestResults/functional-coverage/rf3') `
308-
-UnitExitCode ([int]$env:UNIT_EXIT_CODE) -ScalarExitCode ([int]$env:SCALAR_EXIT_CODE) `
299+
-UnitRunStatusPath (Join-Path $env:GITHUB_WORKSPACE 'TestResults/functional-coverage/rf3/functional-coverage.unit-run-status.v1.json') `
309300
-RecoveryExitCode ([int]$env:RECOVERY_EXIT_CODE) -Rf3ExitCode ([int]$env:RF3_EXIT_CODE)
310301
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
302+
- name: Exercise original product admission and copied TRX denial with healthy re-admission
303+
id: product-admission
304+
if: ${{ success() }}
305+
env:
306+
KEYLOAD_NATIVE_PRODUCT_ADMISSION_REQUIRED: 'true'
307+
KEYLOAD_NATIVE_PRODUCT_DESCRIPTOR_PATH: ${{ github.workspace }}/TestResults/functional-coverage/rf3/functional-coverage.native-product-descriptor.v1.json
308+
run: node scripts/Features/TestInfrastructure/run-tests.mjs --KeyLoadTests:Suite=unit '--KeyLoadTests:Filter=/*/*/NativeCoverageMergeTests/*' --KeyLoadTests:ResultsDirectory=TestResults/native-product-admission --KeyLoadTests:ReportTrx=true
309+
- name: Verify original product-admission test and closed phase receipt
310+
if: ${{ !cancelled() && steps.product-admission.outcome != 'skipped' }}
311+
shell: pwsh
312+
run: |
313+
$ErrorActionPreference = 'Stop'
314+
Set-StrictMode -Version Latest
315+
$directory = Join-Path $env:GITHUB_WORKSPACE 'TestResults/native-product-admission'
316+
$reports = @(Get-ChildItem -LiteralPath $directory -Filter '*.trx' -File -Recurse)
317+
$receipts = @(Get-ChildItem -LiteralPath $directory -Filter 'native-product-admission-phase.v1.json' -File -Recurse)
318+
if ($reports.Count -ne 1 -or $receipts.Count -ne 1 -or $receipts[0].Length -le 0 -or $receipts[0].Length -gt 65536) {
319+
throw 'Exactly one original TRX and bounded product-admission receipt are required.'
320+
}
321+
[xml] $trx = Get-Content -LiteralPath $reports[0].FullName -Raw
322+
$counts = $trx.TestRun.ResultSummary.Counters
323+
if ([int] $counts.total -ne 1 -or [int] $counts.executed -ne 1 -or [int] $counts.passed -ne 1 -or [int] $counts.failed -ne 0) {
324+
throw 'The real product-admission whole operation must execute and pass.'
325+
}
326+
. ./scripts/Features/CodeQuality/functional-coverage.native-merge.inputs.ps1
327+
$bytes = [IO.File]::ReadAllBytes($receipts[0].FullName)
328+
$document = [Text.Json.JsonDocument]::Parse([ReadOnlyMemory[byte]]::new($bytes))
329+
try { Assert-FcNativeJsonUnique $document.RootElement }
330+
finally { $document.Dispose() }
331+
$phase = ConvertFrom-Json ([Text.Encoding]::UTF8.GetString($bytes)) -AsHashtable
332+
Assert-FcNativeExactKeys $phase @('schemaVersion','phase','descriptorSha256','healthyAdmissions','rejectedAdmissions','rejectedOutcome')
333+
$descriptor = Join-Path $env:GITHUB_WORKSPACE 'TestResults/functional-coverage/rf3/functional-coverage.native-product-descriptor.v1.json'
334+
foreach ($name in @('schemaVersion','healthyAdmissions','rejectedAdmissions')) {
335+
if ($phase[$name] -isnot [int] -and $phase[$name] -isnot [long]) { throw 'Invalid product phase integer.' }
336+
}
337+
if ($phase.schemaVersion -ne 1 -or $phase.phase -cne 'product-admission' -or
338+
$phase.descriptorSha256 -cne (Get-FileHash $descriptor -Algorithm SHA256).Hash.ToLowerInvariant() -or
339+
$phase.healthyAdmissions -ne 2 -or $phase.rejectedAdmissions -ne 1 -or
340+
$phase.rejectedOutcome -cne 'An original native test outcome report does not match the exact contributor inventory.') {
341+
throw 'The product-admission phase does not bind the original descriptor and complete flow.'
342+
}
311343
- name: Validate and merge native product coverage
312344
if: ${{ success() }}
313345
shell: pwsh

‎README.md‎

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -339,31 +339,15 @@ outbox, **KL-024** time-series ordering/idempotency and **KL-025** reference
339339
ranges/aggregates. Each closure is bound to its original criteria and Linux
340340
operation evidence. Complete feature and cluster qualification remains open.
341341

342-
Current source includes bounded Q2/AST2 same-partition relational INNER JOIN,
343-
52 JOIN rejection scenarios, graph mutation/atomic-retry and traversal deadline
344-
flows, vector atomic rejection flows and 12 public SDK/official MCP rejection
345-
flows. C# fixtures own fresh-image Aspire preparation, RF3 readiness and joined
346-
cleanup. Three GPT-6.1 Sol workers prepare disjoint implementation and complete
347-
operation batches while the integration owner validates stable compiled cohorts.
348-
Local full native normal and scalar suites passed **2876/2876 each**, and process
349-
recovery passed **236/236** on their retained compiled cohort. Final Release build
350-
and formatter passed after import-order and test identity corrections; eight real
351-
Aspire-owned RF3 SQL JOIN/schema/auth/budget/cancellation/read-cut operations passed
352-
**8/8** through .NET and official MCP clients. Exact-source Linux and complete RF3
353-
qualification, six-silo membership, full SQL/client protocol, FK, KL-075 scaling,
354-
functional coverage, endurance and release gates remain open. The
355-
[status tracker](docs/implementation/status.json) retains the original failures,
356-
source/report hashes and each qualification boundary.
357-
358-
Functional coverage excludes load/comparison runs and admits complete operation
359-
flows only. The current registry selects **94 contributors**: 41 normal, 41
360-
scalar, one recovery and eleven RF3 cases. Selection is not measured coverage.
361-
The first historical Query profile bound 25 cases and 103 source files. Scoped
362-
local KeyCodec coverage records **202/203 executable lines** across three files,
363-
with all 19 native cases passing normal and scalar; branch coverage is unmeasured.
364-
The complete sixteen-module/RF3-server product cohort remains **unmeasured**.
365-
See the [coverage contract](docs/Features/CodeQuality.md) for source/contributor
366-
binding, native report preservation and the required product-admission flow.
342+
Current source includes bounded same-partition relational INNER JOIN and shared
343+
SDK, MCP and SQL operations across the database models. Complete RF3 fault
344+
qualification, full SQL and its native client protocol, foreign keys, scaling and
345+
endurance remain in progress. The [status tracker](docs/implementation/status.json)
346+
records the actual source, test results and remaining acceptance gates.
347+
348+
Complete product functional coverage remains **unmeasured**. The
349+
[coverage contract](docs/Features/CodeQuality.md) admits whole operation flows,
350+
excludes load and comparison runs, and requires matching source and build reports.
367351

368352
| Ready to try (in source, covered by tests) | Still in progress |
369353
|---|---|

‎docs/ADR/ADR-002-command-idempotency.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,13 @@ full-partition replay and owned restart also pass. This task-local result does
122122
not mark the complete DocumentStorage/Messaging/EventStreams feature contracts,
123123
full Linux RF3, coverage, endurance, external effects or power-loss durability
124124
qualified. This ADR remains Accepted while its broader feature gates are open.
125+
126+
127+
## TASK-EVENT-APPEND-SEEDED-CRASH-001 implementation contract
128+
129+
Accepted private scope; implementation/qualification pending. Canonical requirements and exact AC-EVENT-CRASH-001/002 are frozen in [EventStreams](../Features/EventStreams.md#task-event-append-seeded-crash-001), covering original KL083/KL091 plus REQ-MSG-005/AC-MSG-005 and REQ/AC-STORAGE-006/007. This is an additive current-format test mode, not a product seam or new storage contract.
130+
131+
1. Freeze the seeded same-domain doc+Exact1 append+queue command and seven original pre/post-commit/apply cuts before implementation.
132+
2. CrashHost/EventStreams/Contracts and Helpers implement scenario/data; root joins its one existing CrashHostApplication dispatch arm. RecoveryTests/EventStreams/Cases, Processes and Assertions implement genuine native child kill/join/reopen and literal complete-prefix/receipt/replay/healthy flow. Reuse actual CanonicalCrashBoundary and bounded CommandIdempotencyProcessChild original readers/exit; no output-hook replacement or after-ACK substitute.
133+
3. Root verifies source guards, unchanged original modes/serialization/options, complete original child and store-lock joins, numeric400/200/64/depth3 limits, then formats/builds and executes the exact seven new cases and full native recovery. Retain exact CrashHost DLL/PDB/source/runtime identities, native arguments/marker/cut/index/exit/readers and original reports. New output does not qualify an unexecuted gate.
134+
4. Mandatory Linux exact-SHA full normal/scalar/recovery/RF3/coverage gates remain unchanged. No migration, dependency, trust, public protocol or deadline changes. Rollback removes the additive mode/cases and linked task contracts only. Root owns private-packet join and final gates; no parallel shared writer.

0 commit comments

Comments
 (0)