Documentation
¶
Overview ¶
Package runtimegraph provides concrete graph lifecycle management for MALT. A graph represents a scoped collection of arcs authenticated by structure commitments. This file contains the sentinel errors and GraphState type.
Package runtimegraph provides ArcTable-backed graph runtime wiring for MALT. Runtime graph values do not own authoritative heads or freshness policy.
Package runtimegraph provides graph lifecycle management for MALT. A graph is runtime metadata for reopening a namespace with a compatible backend profile. It does not own an authoritative result root or freshness policy. The current daemon path creates an ad hoc default Graph instead of exposing this lifecycle manager as a public API. This file contains the Store and Manager types.
Index ¶
- Variables
- type GraphMeta
- type GraphState
- type Manager
- func (m *Manager) CreateGraph(ctx context.Context, id string, backend string, arcTableType string) (*GraphMeta, error)
- func (m *Manager) DeleteGraph(ctx context.Context, id string) error
- func (m *Manager) FreezeGraph(ctx context.Context, id string) error
- func (m *Manager) GetGraph(ctx context.Context, id string) (*GraphMeta, error)
- func (m *Manager) ListGraphs(ctx context.Context) ([]*GraphMeta, error)
- func (m *Manager) RequireActive(ctx context.Context, id string) (*GraphMeta, error)
- type Option
- type Options
- type RuntimeGraph
- type Store
- func (s *Store) Create(ctx context.Context, g *GraphMeta) error
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) Get(ctx context.Context, id string) (*GraphMeta, error)
- func (s *Store) List(ctx context.Context) ([]*GraphMeta, error)
- func (s *Store) Update(ctx context.Context, g *GraphMeta) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("graph not found") ErrAlreadyExists = errors.New("graph already exists") ErrDeleted = errors.New("graph is deleted") ErrFrozen = errors.New("graph is frozen") ErrInvalidState = errors.New("invalid graph state") )
Sentinel errors.
Functions ¶
This section is empty.
Types ¶
type GraphMeta ¶
type GraphMeta struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Backend string `json:"backend"` // per-graph commitment scheme used when reopening the graph
ArcTableType string `json:"arctable_type"` // node-scoped ArcTable compatibility requirement for this graph
State GraphState `json:"state"`
}
GraphMeta represents a MALT graph with metadata.
type GraphState ¶
type GraphState string
GraphState represents the lifecycle state of a graph.
const ( StateActive GraphState = "active" StateFrozen GraphState = "frozen" StateDeleted GraphState = "deleted" )
Graph state constants.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages graph lifecycle: creation, access, and state transitions. It coordinates graph metadata with ArcTable namespaces and commitment backend selection, but it intentionally does not track an authoritative head root.
func (*Manager) CreateGraph ¶
func (m *Manager) CreateGraph(ctx context.Context, id string, backend string, arcTableType string) (*GraphMeta, error)
CreateGraph creates a new graph metadata entry with the given runtime profile. The graph starts in the "active" state without publishing any root.
func (*Manager) DeleteGraph ¶
DeleteGraph soft-deletes a graph (sets state to "deleted").
func (*Manager) FreezeGraph ¶
FreezeGraph transitions a graph to the "frozen" state. Frozen graphs cannot be updated but can still be read.
func (*Manager) GetGraph ¶
GetGraph retrieves a graph by ID. Returns ErrNotFound if the graph doesn't exist, ErrDeleted if it's deleted.
func (*Manager) ListGraphs ¶
ListGraphs returns all active and frozen graphs.
type Option ¶
type Option func(*Options)
Option configures a Graph instance.
func WithCommitmentScheme ¶
func WithCommitmentScheme(scheme commitment.IndexCommitment) Option
WithCommitmentScheme sets the commitment scheme for this Graph. Default: KZG.
func WithNamespace ¶
WithNamespace sets the ArcTable namespace for this Graph. Default: the graph's ID.
type Options ¶
type Options struct {
Scheme commitment.IndexCommitment
Namespace string
}
Options holds configuration for Graph creation.
type RuntimeGraph ¶
type RuntimeGraph struct {
// contains filtered or unexported fields
}
RuntimeGraph is a per-graph runtime composition of semantic implementations, resolver, and writer. It does not own authoritative heads or freshness policy. The root CID is always supplied by callers.
func NewGraph ¶
NewGraph creates a new per-graph instance with its own semantic layer, resolver, and writer.
Parameters:
- id: unique graph identifier
- arctable: shared ArcTable (namespace by namespace) — from Node
- opts: functional options (WithCommitmentScheme, WithNamespace, etc.)
func (*RuntimeGraph) ListSemantic ¶
func (g *RuntimeGraph) ListSemantic() list.Semantics
ListSemantic returns the per-graph list semantic.
func (*RuntimeGraph) Namespace ¶
func (g *RuntimeGraph) Namespace() string
Namespace returns the ArcTable namespace for this graph.
func (*RuntimeGraph) Resolver ¶
func (g *RuntimeGraph) Resolver() graph.Resolver
Resolver returns the per-graph resolver.
func (*RuntimeGraph) Semantic ¶
func (g *RuntimeGraph) Semantic() mapping.Semantics
Semantic returns the per-graph keyed-map semantic.
func (*RuntimeGraph) Writer ¶
func (g *RuntimeGraph) Writer() graph.Writer
Writer returns the per-graph writer.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists and retrieves graph metadata.
func NewStore ¶
func NewStore(kv kvstore.KVStore) *Store
NewStore creates a new graph metadata store backed by a KVStore.