Skip to content

Commit 3eab1ed

Browse files
committed
fix(verif): wire E2 N-scan ablation env vars into production code path
The E2 verification campaign defines two conditions (cortex_full, cortex_flat) by setting CORTEX_DECAY_DISABLED=1, CORTEX_HEAT_CONSTANT=0.5, CORTEX_CONSOLIDATION_DISABLED=1. n_scan_runner.py:_apply_condition sets them, but no production code was reading them — the first E2 run came back with cortex_full and cortex_flat metrics IDENTICAL at N=1k and N=10k, making E2 a placebo run. Fix: - mcp_server/core/pg_recall.py compute_pg_weights() honours CORTEX_DECAY_DISABLED=1 OR CORTEX_HEAT_CONSTANT (any value): heat weight forced to 0.0 in WRRF fusion. Heat at constant value cannot discriminate by ranking; equivalent to flat-importance baseline for retrieval purposes. - mcp_server/handlers/consolidation/cls.py run_cls_cycle() returns the empty-stats dict immediately when CORTEX_CONSOLIDATION_DISABLED=1, skipping episodic-to-semantic abstraction. Smoke: baseline heat weight = 0.3, both env vars set → heat = 0.0. Source: tasks/verification-protocol.md E2; benchmarks/lib/n_scan_runner.py.
1 parent 3a0d6f8 commit 3eab1ed

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

mcp_server/core/pg_recall.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,21 @@ def compute_pg_weights(
131131
132132
Derives base weights from core_weights (from query_intent) when available,
133133
then applies intent-specific PG overrides.
134+
135+
Verification ablation hooks (Popper C2 — operator-disablable mechanism):
136+
- ``CORTEX_DECAY_DISABLED=1``: forces heat weight to 0.0 so the
137+
thermodynamic decay signal cannot enter the WRRF fusion. Disabling
138+
heat is equivalent to "flat heat" for ranking purposes — Cortex
139+
degenerates to vector + FTS + ngram, the flat-importance baseline.
140+
- ``CORTEX_HEAT_CONSTANT=<float>``: same effect on the weight (heat
141+
cannot discriminate when constant), kept as a separate var so the
142+
n_scan harness can force a specific constant heat at write time and
143+
confirm the ranker reproduces flat baseline at read time.
144+
Source: tasks/verification-protocol.md E2 (N-scan); env vars defined
145+
by benchmarks/lib/n_scan_runner.py:_apply_condition.
134146
"""
147+
import os as _os
148+
135149
cw = core_weights or {}
136150
# Vector is always 1.0 in the PG path — it's the primary discovery signal.
137151
# Other signals derived from core_weights (intent system) when available,
@@ -146,6 +160,10 @@ def compute_pg_weights(
146160
overrides = _PG_INTENT_OVERRIDES.get(intent)
147161
if overrides:
148162
base.update(overrides)
163+
if _os.environ.get("CORTEX_DECAY_DISABLED") == "1" or _os.environ.get(
164+
"CORTEX_HEAT_CONSTANT"
165+
):
166+
base["heat"] = 0.0
149167
return base
150168

151169

mcp_server/handlers/consolidation/cls.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ def run_cls_cycle(
5252
) -> dict:
5353
"""Run CLS consolidation: episodic → semantic pattern extraction.
5454
55+
Verification ablation hook: when ``CORTEX_CONSOLIDATION_DISABLED=1``
56+
is set (E2 N-scan condition `cortex_flat`), this returns the zero
57+
state immediately. No episodic-to-semantic abstraction runs; the
58+
flat-importance store is never enriched with patterns. Source:
59+
tasks/verification-protocol.md E2; benchmarks/lib/n_scan_runner.py.
60+
"""
61+
import os as _os
62+
63+
if _os.environ.get("CORTEX_CONSOLIDATION_DISABLED") == "1":
64+
return dict(_EMPTY_CLS_STATS)
65+
66+
5567
Pattern extraction (`plan_cls_consolidation`) and causal-edge
5668
discovery (`_discover_causal_edges`) sample up to 2000 episodic
5769
memories eachraised from 500 after Feynman's audit of darval's

0 commit comments

Comments
 (0)