Skip to content

Commit 57532cd

Browse files
committed
Fix native C1 capture ownership and current WAL preflight
1 parent ad2b862 commit 57532cd

22 files changed

Lines changed: 789 additions & 93 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ jobs:
213213
docker-rf3:
214214
name: Test three-node database
215215
runs-on: ubuntu-latest
216-
timeout-minutes: 60
216+
timeout-minutes: 180
217217
steps:
218218
- name: Download source code
219219
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎README.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,14 @@ source/test-image identity verification, without skips. Later native codec and
342342
captured-envelope criteria now close **KL-007**, with all19 mapped cases passing
343343
in both modes and all33 owned source files bound to the original compiled images.
344344
The newer cross-process ownership and read-cut regressions pass locally; their
345-
original Linux results remain pending. Six focused local Docker RF3 flows now
345+
task acceptance remains open. The [newer original Linux run at 6816ae91](https://github.com/managedcode/KeyLoad/actions/runs/37560457057/job/112596312154)
346+
passed normal and scalar **2,767/2,767**, recovery **235/235** and same-job native
347+
source/test-image identity checks. Its RF3 job was canceled near the original
348+
60-minute aggregate budget without producing a completed RF3 report. That job
349+
now has 180 minutes, with individual scenario deadlines and gates unchanged.
350+
All six unchanged native Aspire logger-control flows pass locally, including
351+
caller cancellation and original task settlement; these model/logger controls
352+
do not qualify Docker database execution. Six focused local Docker RF3 flows
346353
pass through the real SDK and official MCP clients, covering native schema
347354
discovery and autonomous saga timeout/replay. The owned image lifecycle also
348355
passes prepare, verify, cleanup and repeated cleanup. Full Linux RF3,

‎docs/ADR/ADR-057-orleans-atomic-wal.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ complete-envelope/current-header proof gaps. They remain open and do not gain
5656
qualification from this sequence guard or a development build. The ADR remains Accepted until its full original
5757
unit/process/RF3 and current resource evidence exists.
5858

59+
## Complete current-frame payload-length regression
60+
61+
TASK-WAL-LENGTH-MISMATCH is test-only under REQ-STORAGE-017 / AC-WAL-003. The
62+
existing preflight operation test adds one-byte-short declared payload-length
63+
arguments to both direct ZoneTree open and the real CrashHost inspector. The
64+
frame remains physically complete and follows a real committed prefix; both
65+
paths must return the existing Corruption category, leave the entire provider
66+
file/tree inventory unchanged, and settle owner-lock cleanup. No production
67+
format, cap, error category, or torn-tail behavior changes. The already-covered
68+
short-header suffix remains an incomplete-tail case and is truncated only by
69+
ordinary recovery. The regression is not qualified until root joins actual
70+
normal/scalar and applicable recovery evidence.
71+
5972
## Native codec refinement from exact-source CI
6073

6174
Run37077856823 at6ad4741a7 disproved the authored1024-byte size assertion and overflow-rejection protocol fixture. centrally pinned Orleans NullableCodec's generic codec resolution uses ReadOnlyMemoryCodec<byte> with per-byte tagged fields. Accept the framework's closed native IFieldCodec<ReadOnlyMemory<byte>> → ReadOnlyMemoryOfByteCodec registration, with no custom wire codec. Nullable nonnull values then use native length-prefixed raw bytes. The original size/4096-byte assertions remain unchanged and passed in that native qualification. The current generated Orleans codec uses the accepted closed native memory codec; no custom JSON or alternate-format decoder is supported. The active identity/WAL/checkpoint values and exact bytes remain those frozen in CurrentFormat.

‎docs/ADR/ADR-074-aspire-owned-test-entry.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,31 @@ image/receipt/label/config-ID gates and refusal of any referencing container;
271271
no force/prune or unrelated resource changes. Keep original failed cleanup and
272272
owned diagnostic removal receipts distinct from the corrected canonical flow.
273273
This command repair adds no resource, deadline, dependency or product contract.
274+
275+
TASK-TEST-RF3-AGGREGATE-BUDGET, under REQ/AC-TEST-010, increases only the
276+
docker-rf3 GitHub job's aggregate budget from60 to180 minutes. Original
277+
run37560457057 at6816ae91 ended near its60-minute ceiling after its native RF3
278+
step started, without producing an original RF3 TRX. Its separate verify job
279+
passed2767 normal,2767 scalar and235 recovery cases. This timing supports an
280+
aggregate-budget diagnosis; it does not identify an individual case failure.
281+
Ordered stages: root freezes this contract and the TestInfrastructure evidence;
282+
changes that single workflow budget; retains all native suites, coverage/source
283+
identity checks, per-case deadlines and artifacts; verifies the next original
284+
Linux run. No cancellation or missing report becomes success. Rollback restores
285+
only the aggregate budget; no product, format, topology or dependency changes.
286+
287+
TASK-TEST-LOCAL-CURRENT-WAVE under REQ/AC-TEST-015 follows R183's pre-start
288+
GitHub-only receipt rejection. Freeze the linked current homogeneous local-wave
289+
contract; privately factor the existing LocalRf3ImageIdentity native identity
290+
read and join it in RequestCqrsRf3ImageProof; join its model proof before wave
291+
start and actual container proof after native readiness; build and run original
292+
due and catalog-mismatch SDK/MCP whole flows; retain owned image cleanup and
293+
fresh Linux qualification. Expected references, current input digest, labels,
294+
config ID and exclusive local/GitHub environments all remain mandatory. No
295+
registry digest is fabricated, default CI gate bypassed or deadline extended.
296+
Root owns integration and evidence. Rollback removes only local-wave admission;
297+
the native preparation/cleanup producer and default CI path retain their gates.
298+
The identity crossing start/readiness is the actual pre-start verifier return:
299+
VerifyModelAsync returns it to a WaveStartup local, then the same value supplies
300+
started-container checks. Early ReadAsync selects the validated reference only.
301+
Keep existing caller maps; no ambient state or extra identity carrier is needed.

‎docs/ADR/ADR-082-native-cqrs-streams.md‎

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ publication or the complete ADR.
156156
TASK-CRS-DIAG-JOIN-ORACLE implements REQ/AC-CRS-DIAG-005. Aspire 13.6
157157
`WatchAnySubscribersAsync` reports global subscriber changes and cannot certify
158158
that this wave's original resource watchers have settled. Keep it for admission
159-
before `AppHost.StartAsync`, then join the same memoized capture disposal and
159+
before `AppHost.StartAsync` and bounded nonblocking diagnostics of completed
160+
transitions at fixed completion/cleanup checkpoints, then join the same memoized capture disposal and
160161
original `Task.WhenAll` watcher set after the actual resource `Complete` calls;
161162
only afterward dispose/join the admission observer or publish evidence. Add a
162163
real `ResourceLoggerService` test consumer on a separate actual model resource
@@ -239,3 +240,59 @@ evidence; dependency_closeout owns the guarded diagnostics packet correction.
239240
TASK-CRS-DIAG-COMPLETION-OBSERVATION is accepted before implementation under REQ/AC-CRS-DIAG-003/005/006. The linked NativeCqrsRequestV2 contract freezes fixed per-node native Complete-start/return, original-task and drain-token observations at the existing calls/awaits, bounded to the unchanged 2,048-byte context. Preserve all original native work, ordering, failure/fatal priority and cleanup even when observation fails. Existing real Aspire whole-flow cases and fresh exact-source Linux RF3 artifacts provide verification; root owns integration and qualification. The exact existing and optional role paths, private agent scope and observation-only rollback are in the feature contract. No production/public/persisted contract or dependency changes; source reasoning does not prove the initiating failure.
240241

241242
TASK-CRS-DIAG-CLEANUP-JOIN-ORDER, accepted before code under REQ/AC-CRS-DIAG-005, corrects only `RequestCqrsRf3DiagnosticsTestScope.DisposeAsync` to join original diagnostic captures before disposing its independent consumer. The linked feature freezes pinned Aspire close/join semantics, the retained AppHost lifetime, all bounded waits and original/fatal cleanup errors. Stages are freeze, root call-order correction, strict build/format, and existing real Aspire whole-flow/fresh Linux verification. No source-only timeout-cause or qualification claim is permitted; rollout/rollback changes only the same scope order.
243+
244+
TASK-C1-BOUNDED-SUBSCRIBER-DIAGNOSIS implements the linked DIAG-005/006
245+
refinement in the existing ClusterRouting diagnostics observer, cleanup and
246+
test scope, with feature-local transition/stream-completion helpers. Freeze the
247+
same-enumerator single-reader contract first; join the guarded diagnostic code;
248+
run the original native Aspire case; interpret fixed masks/counts alongside the
249+
original capture-task states. No added consumer or wait, raw resource names,
250+
payloads, topology, timeout or publication rule is allowed. At most three
251+
successful completed events are consumed at each fixed checkpoint; unsuccessful
252+
or ended moves stay with the original join owner and remain ambiguous here.
253+
Root owns integration and gates. Rollback removes these optional diagnostics
254+
without changing any original native task, assertion or completion contract.
255+
256+
TASK-C1-LOGGER-MODEL-CONTROL follows the linked DIAG-003/005/006 contract and
257+
R177 original native failure evidence. Ordered stages: freeze the exact internal
258+
selector/trust/ownership contract; root joins AppHostControlOptions, its native
259+
registration, KeyLoadAppHostApplication and the existing diagnostics argument
260+
helper; build; run the unchanged native logger-control whole flows; retain the
261+
separate real RF3 gates. The admitted scope composes the actual AddKeyLoad graph
262+
and builds it, returning before RunAsync; the testing wrapper retains disposal.
263+
Reject mixed modes without changing ordinary selection behavior or inherited
264+
immutable image provenance. No shadow graph, fake logger, private resolver,
265+
timeout change, original-task shortcut or evidence-schema change is allowed.
266+
Rollback removes only selector/branch/opt-in. Source and R177 prove unexpected
267+
ordinary startup in the control scope; they do not prove logger-key drift or
268+
the initiating cause of the full Linux RF3 cohort failures.
269+
270+
TASK-C1-DIAGNOSTIC-READ-CANCEL-001 refines the optional subscriber observation
271+
under DIAG-005/006 after R179. Freeze the linked exact diagnostic-task predicate
272+
and admission-reader ownership transfer; root joins the two guarded observer
273+
helpers; build; run all unchanged native logger-control whole flows. A pending
274+
move created only by diagnostic drain is normal cleanup cancellation only when
275+
it was incomplete immediately before owned cancellation, is canceled at join,
276+
and the caller stayed uncanceled through join. An original admission reader
277+
adopting that move removes its diagnostic tag. Keep actual cancellation, join
278+
and disposal, terminal task state, all other failures and their ordering.
279+
Rollback removes only that diagnostic lifetime refinement. No task abandonment,
280+
deadline, original-task assertion, production or persisted contract changes.
281+
282+
TASK-C1-ADMISSION-MOVE-STATUS-002, under DIAG-005/006, preserves the exact
283+
original admission task in lifecycle evidence after optional diagnostics read
284+
later moves. R182's five passes and one cancellation-status assertion failure
285+
remain original failed-cohort evidence. Freeze the linked task-reference
286+
contract, join only the subscriber observer, build and rerun all six unchanged
287+
native flows. This observation neither creates nor owns another task and does
288+
not change cancellation, joins, assertions, deadlines or the context schema.
289+
Rollback removes only that separate reference; all broader gates remain open.
290+
291+
TASK-TEST-LOCAL-CURRENT-WAVE is accepted for existing current homogeneous C1
292+
waves under the linked TestInfrastructure contract and ADR-074. Root freezes
293+
the exact local identity/model/started-container joins, then reviews the guarded
294+
three-helper packet and runs actual due/catalog SDK/MCP flows. Preserve all
295+
original production assertions, signed controls, tasks, deadlines and cleanup.
296+
It grants no GitHub provenance or delivered RF3 qualification to a local image;
297+
default native CI digest/manifest verification remains mandatory. No public,
298+
persisted, authorization, topology or dependency contract changes.

‎docs/Features/ClusterRouting/NativeCqrsRequestV2.md‎

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,10 @@ the original joins have completed. Caller cancellation must not become a
695695
successful capture or erase its primary failure.
696696

697697
REQ-CRS-DIAG-005 / AC-CRS-DIAG-005 refines the native completion oracle:
698-
`WatchAnySubscribersAsync` is used only to observe the required pre-start
699-
admission. Its global `AnySubscribers` changes are never proof that this wave's
698+
`WatchAnySubscribersAsync` observes the required pre-start admission and may
699+
diagnose already-completed transitions at the fixed resource-completion,
700+
pre-fallback and post-original-join checkpoints. Its global `AnySubscribers`
701+
changes are never proof that this wave's
700702
three captures have completed, because another native consumer may remain
701703
subscribed. After completing the three captured resource streams, join the same
702704
memoized diagnostics disposal and every original watcher task/enumerator before
@@ -708,6 +710,70 @@ scope cleanup. Repeated disposal, fail-closed publication, original task
708710
settlement, cleanup and fatal/error preservation remain asserted. No parser,
709711
artifact shape, cap, topology or timeout is changed.
710712

713+
TASK-C1-BOUNDED-SUBSCRIBER-DIAGNOSIS refines REQ/AC-CRS-DIAG-005/006 without
714+
changing the completion oracle. Reuse the same native observer enumerator with
715+
one read owner; consume at most three successful, already-completed transitions
716+
per checkpoint, without waiting for another event or creating another consumer.
717+
Record only fixed node masks, bounded counts and explicit ambiguity in a fixed
718+
failure diagnostic. Aggregate subscriber state cannot identify this wave's
719+
watchers. Failed, canceled and ended moves remain with their original join
720+
owner, preserving failure order. The original three capture tasks and existing
721+
deadlines decide success; join them before observer disposal and publication.
722+
Root joins the reviewed feature-local observer, cleanup and scope helpers, then
723+
reruns the original native Aspire failure case before interpreting its evidence.
724+
This diagnostic stage does not establish a timeout cause or qualify RF3.
725+
726+
TASK-C1-LOGGER-MODEL-CONTROL refines REQ/AC-CRS-DIAG-003/005/006 for the
727+
existing native logger-control scope. R177 records actual ordinary AppHost
728+
startup during that scope and original captures pending until fallback; the
729+
aggregate transitions remain ambiguous and do not establish logger-key drift.
730+
Only this scope selects `KeyLoadTests:LoggerModelControl=true`. Admit that exact
731+
true-only value without descendants, selected suite, comparison/benchmark,
732+
TwoRf3, request probe, protocol cohort or local-image preparer. Require its
733+
existing explicit ephemeral DataRoot and ports; permit ordinary inherited
734+
immutable image references/provenance from the full RF3 suite. Compose the same
735+
authoritative AddKeyLoad graph and Build, then return before RunAsync. The native
736+
testing wrapper owns disposal after all original logger/observer tasks join.
737+
Keep actual ResourceLoggerService/IResource APIs, assertions, failure priority
738+
and the 45-second deadline. Actual ClusterFixture and C1 Wave startup, readiness,
739+
SDK/MCP operations and RF3 qualification stay unchanged and mandatory. This
740+
control qualifies native logger/model lifetime only, never Docker or database
741+
RF3. Root joins the four guarded AppHost/options/scope-argument files and runs
742+
the unchanged positive, independent-consumer, cancellation and early-completion
743+
whole flows; rollback removes only this opt-in and branch.
744+
745+
TASK-C1-DIAGNOSTIC-READ-CANCEL-001 refines that diagnostic lifetime after R179:
746+
the original three captures completed without fallback, but a drain-created
747+
pending move made observer-owned shutdown cancellation fail ObserverJoin.
748+
Tag only that exact optional move; transfer it out of diagnostic ownership if
749+
the original admission reader adopts it. Keep the same cancellation/join/dispose
750+
sequence. Its cancellation is normal cleanup only if it was pending immediately
751+
before owned cancellation, is canceled at join, and the caller stayed uncanceled
752+
through join. Retain terminal task state and every fault, preexisting/admission
753+
or caller cancellation, callback/disposal failure and original error ordering.
754+
Root joins the two guarded observer/transition helpers and runs all unchanged
755+
native logger whole flows; no task is abandoned and no deadline changes.
756+
757+
TASK-C1-ADMISSION-MOVE-STATUS-002 refines that observation after R182 passed
758+
five of six original logger-control flows. Optional diagnostic moves overwrote
759+
the shared last-move reference after the actual admission move was canceled.
760+
Retain the exact latest original admission-reader task separately: initialize
761+
it from the native first move and update it only when that reader adopts or
762+
creates its next move. AdmissionMove reports this task's actual status, even
763+
after later diagnostics. This reference owns no new work. Root joins the
764+
guarded observer correction and reruns all six unchanged native cases; retain
765+
the original failed receipt, assertions, deadlines, joins and failure ordering.
766+
767+
TASK-TEST-LOCAL-CURRENT-WAVE applies the linked TestInfrastructure REQ/AC-TEST-015
768+
local image contract to these current homogeneous RF3 waves. Reuse the same
769+
owned native verifier and actual three-container config-ID checks; reject mixed
770+
expected references and never synthesize GitHub digest/provenance. Root freezes
771+
ADR-074/082 before the guarded three-helper packet, builds and runs original
772+
due and catalog fault flows through real SDK/MCP clients. Keep unique request
773+
grains, signed controls, resource deadlines and joined cleanup unchanged.
774+
Local passes cannot close the separate exact-source Linux gates. Rollback
775+
removes only this explicit local-wave branch and retains default fail-closed CI.
776+
711777
REQ-CRS-DIAG-006 / AC-CRS-DIAG-006 adds test-only first-failure lifecycle
712778
evidence before changing any cancellation behavior. Retain at most 2,048 UTF-8
713779
bytes using fixed stage/task labels, native `TaskStatus` and boolean

‎docs/Features/StorageRecovery.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,25 @@ post-cleanup receipt cancellation risk without altering production data.
448448
|REQ-STORAGE-018 current-version fence and restore|AC-WAL-004 current checkpoint/empty/refusal and InstallSnapshot/restore identity preservation|
449449
|REQ-STORAGE-019 authentic qualification|AC-WAL-005 full Release/formatter/governance and exact-SHA GitHub unit/process-recovery/RF3 SDK+MCP; speed and power-loss unclaimed|
450450

451+
### TASK-WAL-LENGTH-MISMATCH complete-frame regression
452+
453+
TASK-WAL-LENGTH-MISMATCH refines existing REQ-STORAGE-017 / AC-WAL-003 only.
454+
`NativeStoreOpenPreflightTests.R12Ac002CompleteCorruptionRejectsBeforeAnyProviderFileChanges`
455+
adds direct-open and real CrashHost-inspector arguments for an otherwise complete
456+
current WAL frame whose declared payload length is one byte shorter than its
457+
actual serialized payload. Both paths must return the existing exact
458+
`ErrorCode.Corruption`, preserve the complete provider file/tree hash inventory,
459+
and release the owner lock. The test begins with an actual committed ZoneTree
460+
record and a valid preceding frame; it does not add a frame-size limit or change
461+
reader behavior.
462+
463+
The short-header case is already covered by
464+
`R12Ac002IncompleteCurrentTailIsOnlyTruncatedByOrdinaryRecovery`: it is an
465+
incomplete-tail recovery case, not a corruption oracle. Existing truncation and
466+
committed-prefix assertions remain unchanged. This proposal adds regression
467+
evidence only; fresh normal/scalar and required recovery/RF3 gates remain open
468+
until their actual reports are joined.
469+
451470
```mermaid
452471
flowchart LR
453472
Transaction[Owned ordered transaction] --> Codec[Orleans generated binary payload]

0 commit comments

Comments
 (0)