Skip to content

[vulcan] minigraf_bug: MiniGrafDb::drop() writes to the graph file uncond #226

Closed

Description

@adityamukho

Description: MiniGrafDb::drop() writes to the graph file unconditionally, even for read-only handles — corrupting any other open instance of the same file.

Reproduction: open DB handle A, register rules, write several datoms, checkpoint. Then in a subprocess, open handle B to the same file, do a read-only query, let B go out of scope (del fires). Back in the parent process, handle A can no longer write — raises either "Serde Deserialization Error" or "Page N out of bounds (total pages: N)".

Evidence: the graph file's mtime and size both change after the read-only subprocess exits (size grew by 4 KB in testing), confirming Drop writes to the file even when no user-visible mutations occurred.

Impact: any architecture where two processes open the same graph file (e.g. a persistent MCP server + a per-turn hook subprocess) will have the persistent process's write handle silently broken after the hook exits. Data written before the hook opened the file is preserved, but no further writes from the first handle succeed.

Expected: Drop on a read-only (no-write) handle should not modify the file, or at minimum should not invalidate other open handles to the same file.

Workaround applied in mcp_server.py: track graph file mtime; reopen + re-register session rules whenever an external modification is detected before the next write.

Error:

Serde Deserialization Error / Page N out of bounds (total pages: N)

Auto-routed to minigraf repo based on content

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions