Skip to content

Commit b2cc588

Browse files
Copilotfermga
andcommitted
Fix coherence tests: Add IL stabilization for SHA→AL reactivation
- Update test_coherence_ct_tracking.py: Add Coherence() before reactivation in loops - Update test_coherence_dnfr_reduction.py: Add IL step for coherent frequency transitions (3 tests) - All tests now follow canonical pattern: SHA → IL → AL (zero → medium → high) - Fixes 4 failing tests that were using direct SHA → AL transitions in loops Co-authored-by: fermga <203334638+fermga@users.noreply.github.com>
1 parent 4519660 commit b2cc588

File tree

3 files changed

+24
-601
lines changed

3 files changed

+24
-601
lines changed

tests/unit/operators/test_coherence_ct_tracking.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,12 @@ def test_coherence_tracking_accumulates():
356356
G.nodes[node][DNFR_PRIMARY] = 0.30
357357

358358
# Apply Coherence 3 times in canonical sequences
359-
for _ in range(3):
359+
# First sequence
360+
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
361+
362+
# Subsequent sequences need reactivation: SHA → IL → AL
363+
for _ in range(2):
364+
Coherence()(G, node) # Reactivate from silence (zero → medium)
360365
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
361366

362367
# Verify 3 tracking events logged

tests/unit/operators/test_coherence_dnfr_reduction.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ def test_coherence_multiple_applications_converge_to_zero():
170170
G.nodes[node][DNFR_PRIMARY] = initial_dnfr
171171

172172
# Apply Coherence operator 10 times in canonical sequences
173-
for _ in range(10):
173+
# First application
174+
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
175+
176+
# Subsequent applications need reactivation: SHA → IL → AL
177+
for _ in range(9):
178+
Coherence()(G, node) # Reactivate from silence
174179
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
175180

176181
final_dnfr = G.nodes[node][DNFR_PRIMARY]
@@ -229,7 +234,12 @@ def test_coherence_telemetry_accumulates():
229234
G.nodes[node][DNFR_PRIMARY] = 0.20
230235

231236
# Apply Coherence 3 times in canonical sequences
232-
for _ in range(3):
237+
# First application
238+
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
239+
240+
# Subsequent applications need reactivation
241+
for _ in range(2):
242+
Coherence()(G, node) # Reactivate from silence
233243
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
234244

235245
# Verify 3 telemetry events logged
@@ -346,7 +356,12 @@ def test_coherence_nodal_equation_compliance():
346356
G.nodes[node][DNFR_PRIMARY] = initial_dnfr
347357

348358
# Apply Coherence multiple times in canonical sequences
349-
for i in range(5):
359+
# First application
360+
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
361+
362+
# Subsequent applications need reactivation
363+
for i in range(4):
364+
Coherence()(G, node) # Reactivate from silence
350365
run_sequence(G, node, [Emission(), Reception(), Coherence(), Silence()])
351366

352367
# Verify ΔNFR is decreasing

0 commit comments

Comments
 (0)