fix(routes): /api/graph/edges must not write the canonical snapshot #161
Reference in New Issue
Block a user
Delete Branch "fix/graph-edges-no-canonical-clobber"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This route called
engram_save()over~/.neuron/engram/snapshot.json— the engram server's canonical store — then read it back, to answer a read query.It was a regression introduced tonight. The defect had been fixed once (export moved to a scratch path). In the
@routedispatch conversion (#157), the hand-written dispatch block held the fixed version and the@route-decorated copy held the unfixed one — the merge kept the decorated copy. Calling the endpoint afterward overwrote the canonical snapshot and immediately preceded an engram crash loop.Now calls
engram_edges_json(limit, offset)(el#127) — the builtin this route's own TODO asked for — readingg->edgesdirectly. No file is written or read. Bounded by default (limit 1000, offset supported), so the unbounded whole-graph read that fell over isn't reachable by default.Verified: the same request that previously rewrote
snapshot.jsonnow leaves it byte-identical (sha256 unchanged before/after) and returns real edge records with every persisted field.