Symptom
On 3.1.0 the graph never builds. /api/graph/progress reports
phase: "starting", pct: 0.0 and never advances; Graph, Brain, Knowledge, Board and Wiki stay
empty. Trace is unaffected — it does not go through this builder. Nothing is lost or corrupted:
the build dies before reading anything.
[cortex] background build error: module 'cortex_viz.server.graph_event_stream' has no attribute 'reset'
File "cortex_viz/server/graph_build_run.py", line 155, in run_build
_events.reset()
AttributeError
Root cause — and what it is not
45d4a80 deleted the module-level emit/close/reset forwarders from graph_event_stream,
justified in the code as: they "had never had a caller in this repository's history".
That premise is false. They had four:
| caller |
call |
graph_build_run.py:155 |
_events.reset() |
graph_build_run.py:234 |
_events.emit(...) |
graph_build_run.py finally |
_ev.close() |
graph_build_merge.py:136 |
events.emit(...) — handed the module, per its own docstring |
The commit's other stated reason is the real defect: emit grew an event_meta parameter and the
forwarder silently dropped it. That is a bug in the forwarder, and the reason to fix it. It was
used instead as the reason to delete it — so the root cause (a forwarder that had drifted out of
sync with the method it forwards to) was never addressed, and the deletion took four working
callers down with it.
The module is also published API: dropping three public functions in a patch-level move breaks any
consumer outside this repository, not just these callers.
What the fix must do
Restore the three forwarders plugged and functional — not route the callers around them:
Acceptance criteria
Notes
Verified locally that restoring the call path makes the build run to completion (baseline_ready,
85 hooks, 49 discussion_agents, 36752 memories, then layout bake (DrL)). PR #133 took the wrong
route — it adapted the callers to the deletion, which dresses a removal up as a solution — and is
closed in favour of this issue. Its analysis of the failure is still accurate and reusable.
See also the silent-close() defect, filed separately: it survives this fix independently.
Symptom
On 3.1.0 the graph never builds.
/api/graph/progressreportsphase: "starting", pct: 0.0and never advances; Graph, Brain, Knowledge, Board and Wiki stayempty. Trace is unaffected — it does not go through this builder. Nothing is lost or corrupted:
the build dies before reading anything.
Root cause — and what it is not
45d4a80deleted the module-levelemit/close/resetforwarders fromgraph_event_stream,justified in the code as: they "had never had a caller in this repository's history".
That premise is false. They had four:
graph_build_run.py:155_events.reset()graph_build_run.py:234_events.emit(...)graph_build_run.pyfinally_ev.close()graph_build_merge.py:136events.emit(...)— handed the module, per its own docstringThe commit's other stated reason is the real defect:
emitgrew anevent_metaparameter and theforwarder silently dropped it. That is a bug in the forwarder, and the reason to fix it. It was
used instead as the reason to delete it — so the root cause (a forwarder that had drifted out of
sync with the method it forwards to) was never addressed, and the deletion took four working
callers down with it.
The module is also published API: dropping three public functions in a patch-level move breaks any
consumer outside this repository, not just these callers.
What the fix must do
Restore the three forwarders plugged and functional — not route the callers around them:
emit(label, nodes, edges, *, chunk=1000, event_meta=None)— forwards every parameter,event_metaincluded. The drift that motivated the deletion is what gets fixed here.close()andreset()restored, delegating to the singleton.graph_build_run.pyandgraph_build_merge.pykeep calling the module — unchanged.decision that was withdrawn.
Acceptance criteria
get_stream().emit's forwarder carriesevent_metathrough to what a subscriber receives —the exact drift that started this. It must fail against the pre-
45d4a80forwarder.cannot drift apart again. Every existing merge test injects a fake stream, which is why none of
them caught this: the defect was in how the caller obtains the stream, not in what it does
with it.
startingand reacheslayout bake, with zerobackground build errorin the log.Notes
Verified locally that restoring the call path makes the build run to completion (baseline_ready,
85 hooks, 49 discussion_agents, 36752 memories, then
layout bake (DrL)). PR #133 took the wrongroute — it adapted the callers to the deletion, which dresses a removal up as a solution — and is
closed in favour of this issue. Its analysis of the failure is still accurate and reusable.
See also the silent-
close()defect, filed separately: it survives this fix independently.