MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / test_per_key_independence

Function test_per_key_independence

tests/workflow/test_journal.py:32–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31
32def test_per_key_independence():
33 # Path-based keys: changing one call does NOT invalidate an independent
34 # sibling at a different path (more precise than linear-prefix divergence).
35 prior = {
36 (0,): JournalRecord(fingerprint(_spec("a")), "ra"),
37 (1,): JournalRecord(fingerprint(_spec("b")), "rb"),
38 (2,): JournalRecord(fingerprint(_spec("c")), "rc"),
39 }
40 j = Journal(prior)
41 assert j.lookup((0,), _spec("a")) == "ra" # hit
42 assert j.lookup((1,), _spec("CHANGED")) is MISS # changed -> miss
43 assert j.lookup((2,), _spec("c")) == "rc" # independent -> still hit
44
45
46def test_nested_path_keys_are_distinct():

Callers

nothing calls this directly

Calls 5

lookupMethod · 0.95
JournalRecordClass · 0.90
fingerprintFunction · 0.90
JournalClass · 0.90
_specFunction · 0.85

Tested by

no test coverage detected