Core Layer

The core package is the foundation of the platform. It contains no framework dependencies — no SQLAlchemy, no PySide6, no external I/O. Everything here is pure Python and is safe to import in any context including headless tests.

Conceptual Model

graph LR
    WS[Workspace] -->|owns many| G[Graph]
    G -->|contains| N[Node]
    G -->|contains| E[Edge]
    E -->|from| N
    E -->|to| N
    TX[Transaction] -->|targets| G
    TX -->|records| CR[ChangeRecord]
    GE[GraphEngine] -->|commits| TX
    GE -->|reads/writes via| GR[GraphRepository]

A Workspace holds one or more Graphs. Each Graph aggregates Nodes and directed Edges. Changes are batched into Transactions and applied atomically by the GraphEngine, which persists them through a GraphRepository.

Modules in this Layer

Module Purpose
core.identifiers NewType ID wrappers to prevent cross-entity ID confusion
core.node Immutable Node value-object
core.edge Immutable Edge value-object
core.graph Mutable Graph aggregate root
core.transaction Transaction + transaction() context manager
core.engine GraphEngine + abstract GraphRepository