You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(harness): ab-diff — extend the issue-#36 tolerance to transactions (wholly-absent-block predicate) (#49)
* fix(harness): ab-diff — extend the issue-#36 tolerance to transactions (wholly-absent-block predicate)
The A/B soak differ already tolerates the known issue #36 onlyB row-loss class
(rows present in leg B, absent in leg A) for the logs and blocks tables, but any
onlyB transaction still classified as UNEXPECTED → FAIL. The hourly finalized-overlap
cross-validation proved the tx facet is real and is the SAME leg-A loss one table
deeper: a batch of B-only transactions all sat in blocks WHOLLY ABSENT from leg A
(at those heights leg A has zero blocks / zero logs / zero txs; leg B has the block
plus its logs plus its txs), the upper span exactly matching the already-tolerated
logs/blocks span.
Extend the tolerance to onlyB transactions with a STRICT predicate: an onlyB tx is
tolerated-as-#36 IFF its block is wholly absent from leg A (no leg-A block row at that
(chain, block_number)) AND the block is at/above the per-chain realtime-era floor
within the open window. The wholly-absent-block set is the blocks-table onlyB set the
blocks classifier already computes. Anything else — most importantly an onlyB tx whose
block EXISTS in leg A (a tx-level-only loss) — stays UNEXPECTED → FAIL: that is a
genuinely new divergence class and must keep failing loudly.
- new pure exported classifyOnlyBTx: the per-tx predicate (wholly-absent-block gate +
classifyOnlyBRow's floor/window logic verbatim).
- new pure exported classifyOnlyBTxDiff: folds the tolerance into a classifyTxDiff
result — tolerated onlyB txs leave unexpectedB and are counted in toleratedIssue36;
onlyA (realtime-parent-tx-gap), sharedMismatch, #27 and #32 facets untouched.
- diffTx now carries each onlyB tx's block number; compareChain builds the
wholly-A-absent set from blocksRes.onlyBRows and FAILS CLOSED (empty set → tolerate
nothing) when the blocks onlyB stream was capped or its collector cross-check failed,
so an untrustworthy evidence source can never widen the tolerance.
- toleratedIssue36 gains a transactions sub-object (per-chain counts) in both the
aggregate and the human-readable TOLERATED echo line, with the same
"REMOVE when issue #36 is resolved" note.
Tests: +16 (classifyOnlyBTx / classifyOnlyBTxDiff strictness + tolerated + mix +
fail-closed, e2e through compareChain, reporting). Full repo-tests suite
284 → 300, all green. Mutation-verified both ways (loosen the predicate → the
strictness tests fail; drop the tolerance → the tolerated-case tests fail).
Rider (labels only, zero behavior change): the deploy-helpers "(F5)" test pins the
runCli derive-database-url loop's last-DATABASE_URL selection, a SEPARATE loop from
filterCarriedEnv (already pinned by its own unit test); its name/comment now say so.
Refs #36
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* test(harness): pin the !collector.ok half of the tx-tolerance fail-closed gate
The absentBlocks guard `blocksRes.capped || !blocksCollector.ok` had its
`capped` half covered by test #138, but the `!blocksCollector.ok` half was
untested — mutating the expression to drop only that conjunct left the whole
suite green (a silent coverage gap). Add a sibling E2E test: blocks NOT
capped, but the onlyB collector received 1 row while diff.onlyB=2 (a silent
wiring drop), so crossCheckOnlyBCollector returns {ok:false}. The
otherwise-tolerable onlyB tx in that block must stay in unexpectedB and the
run must FAIL. Mutation-verified both ways.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
// One human-readable line for a run that carried tolerated issue #36 onlyB rows (empty string ⇒ print
@@ -2130,7 +2299,7 @@ export function formatToleratedIssue36Line(tolerated) {
2130
2299
2131
2300
return(
2132
2301
`TOLERATED (known issue #36 — REMOVE when issue #36 is resolved (A repaired or leg retired)): `+
2133
-
`${tolerated.count} onlyB rows leg A lost (logs:${tolerated.logs?.count??0} blocks:${tolerated.blocks?.count??0}; per-chain ${breakdown})`
2302
+
`${tolerated.count} onlyB rows leg A lost (logs:${tolerated.logs?.count??0} blocks:${tolerated.blocks?.count??0} transactions:${tolerated.transactions?.count??0}; per-chain ${breakdown})`
0 commit comments