File size: 1,165 Bytes
921d377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Branching subsystem — graph construction, validation, simulation.

Submodules:

  graph.py       Pure data structures (BranchGraph / GraphNode /
                 GraphEdge) + validation helpers. No persistence.
  builder.py     build_graph(intent) → BranchGraph
                 Deterministic heuristic today; LLM-swap-in point.
  merge.py       Merge-point detection: collapses same-content
                 leaf siblings into a single shared ending.
  simulator.py   walk_paths(graph) → every viewer path the runtime
                 could produce. Used by QA + analytics preview.

All modules work on in-memory BranchGraph objects; persistence is
a separate concern (repo.create_node / create_edge).
"""
from .builder import build_graph
from .graph import (
    BranchGraph,
    GraphEdge,
    GraphNode,
    GraphValidationError,
    validate_graph,
)
from .merge import collapse_merge_points
from .simulator import enumerate_paths, walk_paths

__all__ = [
    "BranchGraph",
    "GraphEdge",
    "GraphNode",
    "GraphValidationError",
    "validate_graph",
    "build_graph",
    "collapse_merge_points",
    "enumerate_paths",
    "walk_paths",
]