Share generic differential test traces
Moves independent fixture initialization and ordered trace capture into acyclic-test-support, generic over the state, result, and event type. Both journal-publication and pinned-read differential tests now use it directly; filesystem lanes can reuse it without depending on Harness. Native custody/accounting sampling stays in Harness unchanged.
The shared helper is 54 lines. A shrinking property checks separate initializations, complete results and ordered events; its missing-preflight variant must fail the same equality. Controls also cover panic cleanup, mismatched types, nested capture and event destructors that record during cleanup. Existing byte/error/trace/accounting comparisons and exact allocation/frame assertions remain.
Main added chunk publication to accounted journal appends after the original oracle was written. Preserve that step in the independent reference and pin its resulting 64-byte frame increase; otherwise the existing admission-boundary comparison fails even without this extraction.
Decisions: capture is current-thread only; callers define their own static event type. Hooks remain cfg(test), so production has zero recording work before and after. No new dependencies or locks.
Validation (bb1, debug; compilation excluded from suite runtimes):
- Shared support: 9 passed, 0.0034 s at
0ddfa164f, including reentrant inactive-event destruction during fixture initialization. - Journal publication: 5 passed, 3.55 s.
- Pinned reads: 2 passed, 0.56 s.
- Windows GNU library/test cross-check for both touched crates: passed, 189.35 s compilation.
- Shared support Clippy,
--no-deps -- -D warnings: passed, 1.21 s.
Focused commands:
Q:\lanes\bs.ps1 cargo test --locked -p acyclic-test-support --lib
Q:\lanes\bs.ps1 cargo test --locked -p acyclic-harness --lib --features filesystem-local,native-execution,test-support,grpc filesystem::execution_journal::publication_future_tests
Q:\lanes\bs.ps1 cargo test --locked -p acyclic-harness --lib --features filesystem-local,native-execution,test-support,grpc filesystem::pinned_read_tests
Q:\lanes\bs.ps1 cargo check --locked -p acyclic-test-support -p acyclic-harness --lib --tests --features filesystem-local,native-execution,test-support,grpc --target x86_64-pc-windows-gnu
Final native library build: 133.22 s. Focused suites ran directly from the built binaries. Remote job: 1792215319260-2539948 (exit 0).
Summary by cubic
Moves independent fixture initialization and ordered trace capture from acyclic-harness into acyclic-test-support, generic over event type. Both journal-publication and pinned-read differential tests now use the shared helper directly, and filesystem lanes can reuse it without depending on Harness.
- Native custody/accounting sampling stays in Harness unchanged.
- The shared helper is current-thread only; it restores trace state after panics, rejects mismatched event types and nested capture, and drops inactive events after releasing the TLS borrow so their destructors can record.
- Hooks remain
cfg(test), so production code records nothing before or after. - Journal-publication diffs publish the accounted chunk before sampling, matching main; the 64-byte frame increase is pinned in the admission-boundary assertions, and a new unmetered task-file reference reproduces the erroneous unconditional publication so trace divergence is caught.
- Shrinking property test covers separate initializations, complete ordered events, missing-preflight failure, panic cleanup, nested capture, and event destructors that record during reset.
Review fix (0ddfa164f): inactive events stay outside the TLS callback and are dropped after its borrow is released. The regression covers both a direct inactive call and both independent fixture initializations. Restoring the previous record implementation makes that exact regression fail with RefCell already borrowed (0.0016 s). The touched shared crate passed Windows GNU lib/tests (1.55 s) and Clippy --no-deps -- -D warnings (0.32 s). Other previously green results above are unchanged. Remote job: 1792216491248-2709289.
Review fix (f17af1546754d9f025af390f188530e405a5ecd5): the reference calls publish_chunk only with io.is_some(), matching current main. The new regression initializes independent task-owned journals with task files, the real task host/lease and bounded session budgets. It compares complete request bodies, raw journal records, referenced publication bytes, task-file bytes and ordered traces. The negative control restores the extra unmetered chunk write: canonical outputs stay identical, but the same full comparison rejects the additional 0:chunk file. #839's pending behavior change is left to that PR.
Final focused bb1 validation (job 1792217800382-2762413, exit 0): new regression 0.156 s; all 6 publication tests / 4.598 s; 2 pinned-read tests / 0.925 s. Tests ran directly from the built binary. Native library test compilation 156.41 s; Windows GNU Harness lib/tests cross-check 36.88 s, both excluded from suite timings. Existing exact frame/allocation and admission/custody assertions pass unchanged. Batching remains a separate follow-up after this PR merges.