You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Built the complete Stage 1 skeleton for the CSIG research project: a directed acyclic graph archive that represents agent variants as nodes and self-improvement edits as directed edges, with structured modification descriptors, persistence, and querying.
Files Created
Core Library (csig/)
File
Description
csig/__init__.py
Package initialiser; re-exports all public symbols for clean imports (from csig import CSIGraph, CSIGNode, ...)
csig/schemas.py
Dataclass definitions for CSIGNode, CSIGEdge, ModificationDescriptor, and DiffStats with full to_dict() / from_dict() round-trip serialisation
csig/taxonomy.py
10-label modification-type taxonomy as module-level constants plus ALL_MOD_TYPES frozenset and is_valid_mod_type() validator
csig/graph.py
CSIGraph class backed by networkx.DiGraph with 12 methods: add_node, add_edge, get_node, get_parent, get_children, get_ancestors, get_descendants, get_edges_by_mod_type, query_nodes_by_context, save, load, summary
csig/diff_parser.py
Rule-based diff engine using difflib.SequenceMatcher; compares strings or file-sets and returns DiffStats plus inferred module names
csig/classifier.py
Keyword-rule classifier that infers modification types from filenames, module names, keywords, and rationale text (~30 substring rules)
csig/persistence.py
Standalone JSON (batch) and JSONL (streaming/append) save/load helpers for nodes and edges
Scripts
File
Description
build_toy_csig.py
Synthetic demo — constructs a 5-node / 4-edge DAG simulating an EHR agent improving over 4 iterations, saves/reloads the graph, and runs sample queries
test_csig.py
Automated test suite — 26 tests covering schemas, taxonomy, graph operations, cycle detection, persistence round-trips, diff parsing, and classifier accuracy
Configuration
File
Description
requirements.txt
Single dependency: networkx>=3.0
Output (generated at runtime)
File
Description
output/toy_csig.json
Serialised toy graph produced by build_toy_csig.py
Schemas Implemented
CSIGNode
Field
Type
Purpose
node_id
str
Unique identifier (auto-generated 12-char hex if omitted)