Skip to content

Commit b36fd11

Browse files
committed
test(era-hop): convergence assertions pin the RDR-180 full-digest identity
The walk now fully converges (engine 0.1.11->0.1.51, all five collections service=12 seeded=12, ladder clean, idempotent second walk) — the single remaining failure was the harness itself still asserting the PRE-RDR-180 32-char identity: expected_reid derived sha256[:32] and the conformance sweep required len==32, so it flagged the CORRECT 64-hex ids as 'non-32-char id(s) present'. Expected ids now derive the full digest; the sweep requires 64. nexus-i5rbk / RDR-185 era-hop
1 parent 3aee846 commit b36fd11

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

tests/e2e/migration-rehearsal/rehearse_era_hop.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,10 @@ for name, want in seeded.items():
309309
# 2. Wire re-id: the legacy ids are GONE and the derived ones are PRESENT.
310310
# `existing_ids(collection, ids)` returns the subset of *ids* present, so
311311
# each direction is an exact membership probe. Exactness matters here more
312-
# than usual: a 16-char legacy id is a strict PREFIX of its 32-char
313-
# successor (both are sha256 of the same text), so any substring-flavoured
314-
# check would report success against a store that never converged at all.
312+
# than usual: a 16-char legacy id is a strict PREFIX of its 64-hex
313+
# successor (both are sha256 of the same text — RDR-180: the FULL digest
314+
# is the canonical identity), so any substring-flavoured check would
315+
# report success against a store that never converged at all.
315316
for coll, old_ids in legacy.items():
316317
target = cross.get(coll, coll)
317318
want_new = expected.get(coll, [])
@@ -328,7 +329,7 @@ for coll, old_ids in legacy.items():
328329
print(f" {target}: {len(missing_new)} derived id(s) absent: {missing_new[:3]}")
329330
fails += 1
330331
if not still_legacy and not missing_new:
331-
print(f" {target}: all {len(old_ids)} legacy ids -> their derived 32-char chashes")
332+
print(f" {target}: all {len(old_ids)} legacy ids -> their derived full-digest chashes")
332333
333334
# 3. Nothing non-conformant anywhere in the migrated collections — the
334335
# membership probes above are per-id, so this catches a stray id neither
@@ -337,14 +338,14 @@ for name in seeded:
337338
target = cross.get(name, name)
338339
try:
339340
bad_len = sorted(
340-
cid for cid, _ in t3.list_chunks_with_metadata(target) if len(cid) != 32
341+
cid for cid, _ in t3.list_chunks_with_metadata(target) if len(cid) != 64
341342
)
342343
except Exception as e:
343344
print(f" {target}: list_chunks_with_metadata() error: {e}"); fails += 1; continue
344345
if bad_len:
345-
print(f" {target}: non-32-char id(s) present: {bad_len[:3]}"); fails += 1
346+
print(f" {target}: non-64-hex id(s) present: {bad_len[:3]}"); fails += 1
346347
if not fails:
347-
print(" every migrated collection holds only conformant 32-char chunk ids")
348+
print(" every migrated collection holds only conformant 64-hex chunk ids")
348349
349350
sys.exit(1 if fails else 0)
350351
PY

tests/e2e/migration-rehearsal/seed_legacy.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -629,17 +629,18 @@ def main() -> int:
629629
if era_hop:
630630
# The driver asserts the CONVERGENCE, so it needs the before-state: the
631631
# exact legacy ids that must no longer exist anywhere post-walk, and the
632-
# text they were derived from (the rung recomputes sha256(text)[:32] on
633-
# the wire, so the expected new id is derivable here too — that is the
634-
# whole point of wire re-id, and it makes the assertion exact rather
635-
# than a "looks 32-char" shape check).
632+
# text they were derived from (the rung recomputes the FULL
633+
# sha256(text) hexdigest on the wire — the RDR-180 canonical identity;
634+
# nexus-i5rbk widened the transform to the 32-hex era class too — so
635+
# the expected new id is derivable here, and it makes the assertion
636+
# exact rather than a "looks conformant" shape check).
636637
out["legacy_ids"] = {
637638
_ERA_LEGACY: chashes[_ERA_LEGACY],
638639
_ERA_NOTE: chashes[_ERA_NOTE],
639640
}
640641
out["expected_reid"] = {
641-
_ERA_LEGACY: [_chash(f"era legacy chunk {i:04d}") for i in range(n)],
642-
_ERA_NOTE: [_chash(f"era note chunk {i:04d}") for i in range(n)],
642+
_ERA_LEGACY: [_sha_full(f"era legacy chunk {i:04d}") for i in range(n)],
643+
_ERA_NOTE: [_sha_full(f"era note chunk {i:04d}") for i in range(n)],
643644
}
644645
out["sourceless"] = sorted(_SOURCELESS)
645646
if rdr180:

0 commit comments

Comments
 (0)