1
Files
32
Nodes
48
Edges
10
Data values
2
Phi
2
State regions
1
Explicit raises
1
Defects
1
Motifs
MVP pipeline
Repository → Source fingerprint → AST/Symbols → SSA-like Data Flow → State Regions → Exception Flow → Typed CISG → Findings / Motifs
v0.2 adds versioned local values, conservative phi merges, state regions, explicit raise/except flow, and definition-time alias edges. Dynamic points-to and concurrency remain unresolved by design.
Metrics
{
"loaded_files": 1,
"nodes": 32,
"edges": 48,
"node_types": {
"file": 1,
"class": 1,
"method": 2,
"function": 1,
"data_value": 10,
"state_region": 2,
"control": 4,
"module_binding": 1,
"data_phi": 2,
"data_sink": 4,
"exception_handler": 1,
"exception_event": 1,
"boundary_call": 1,
"data_undefined": 1
},
"edge_types": {
"contains": 4,
"defines": 12,
"writes_state": 3,
"controls": 4,
"reads_state": 2,
"reads_binding": 1,
"flows_to": 3,
"aliases_at_definition": 1,
"guards": 3,
"phi_input": 4,
"contains_data": 4,
"returns_value": 3,
"contains_exception_handler": 1,
"raises": 1,
"caught_by": 1,
"calls": 1
},
"resolved_local_calls": 0,
"boundary_calls": 1,
"findings_by_category": {
"defect": 1
},
"findings_by_severity": {
"high": 1
},
"motif_instances": 1,
"motif_clusters": 0,
"data_values": 10,
"phi_nodes": 2,
"data_edges": 26,
"alias_edges": 1,
"state_regions": 2,
"state_reads": 2,
"state_writes": 3,
"module_binding_reads": 1,
"exception_handlers": 1,
"explicit_raises": 1,
"unresolved_local_uses": 1,
"warnings": 0
}Warnings
- None
Code-Induced Semantic Graph
Overview shows 5 of 5 file/class/function entities. Full graph is in cisg.json / cisg.graphml.
Node evidence
Click a node.
SSA-like data flow
Shows local value flow, phi inputs, control guards, returns/yields, and definition-time alias edges. Full export: dataflow.json.
| Relation | Source | Target | Evidence | Status |
|---|---|---|---|---|
| flows_to | value#0 | alias#1 | sample.py:10 | observed |
| aliases_at_definition | value#0 | alias#1 | sample.py:10 | observed |
| guards | flag#0 | branch | sample.py:11 | observed |
| flows_to | alias#1 | result#1 | sample.py:12 | observed |
| phi_input | result#1 | result#3 | sample.py:11 | strongly_inferred |
| phi_input | result#2 | result#3 | sample.py:11 | strongly_inferred |
| flows_to | self#0 | previous#1 | sample.py:15 | observed |
| guards | result#3 | branch | sample.py:19 | observed |
| returns_value | previous#1 | return@22 | sample.py:22 | observed |
| returns_value | result#3 | return@23 | sample.py:23 | observed |
| guards | flag#0 | branch | sample.py:26 | observed |
| phi_input | only_some_paths#1 | only_some_paths#2 | sample.py:26 | strongly_inferred |
| phi_input | only_some_paths:undefined | only_some_paths#2 | sample.py:26 | unresolved |
| returns_value | only_some_paths#2 | return@28 | sample.py:28 | observed |
State regions
Mutable state is restricted to self/cls fields, explicit globals, and conservative container regions. Read-only module constants/type aliases are kept separately as bindings.
| Access | Function | Region | Kind | Evidence |
|---|---|---|---|---|
| writes_state | Counter.__init__ | sample:Counter:self.cache | object_field | sample.py:6 |
| reads_state | Counter.update | sample:Counter:self.cache | object_field | sample.py:15 |
| writes_state | Counter.update | sample:Counter:self.cache | object_field | sample.py:16 |
| reads_state | Counter.update | sample:global:GLOBAL_COUNT | module_global | sample.py:17 |
| writes_state | Counter.update | sample:global:GLOBAL_COUNT | module_global | sample.py:17 |
Module binding reads
| Function | Binding | Evidence |
|---|---|---|
| Counter.update | sample:binding:LIMIT | sample.py:23 |
Explicit exception flow
| Relation | Source | Target | Evidence | Status |
|---|---|---|---|---|
| raises | Counter.update | raise ValueError | sample.py:20 | observed |
| caught_by | raise ValueError | except ValueError | sample.py:20 | strongly_inferred |
Findings
| Severity | Class | Type | Location | Symbol | Evidence statement |
|---|---|---|---|---|---|
| high | defect | possibly_undefined_local | sample.py:28 | intentionally_broken | Local variable 'only_some_paths' may be undefined on at least one reaching control-flow path. |
Deterministic motif candidates
| Kind | Path | Symbol | Confidence | Structural rule |
|---|---|---|---|---|
| read_modify_write | sample.py | Counter.update | 0.86 | same function reads and writes the same state target |
Name-independent structural signature clusters
| Motif ID | Members | Identity basis |
|---|
Per-file SHA-256
| Path | Bytes | SHA-256 |
|---|---|---|
| sample.py | 617 | e58875698fb2fefc… |
Epistemic contract
observed
- Python AST definitions
- imports
- call syntax
- control syntax
- source spans
- local file hashes
- SSA-like local definitions/uses
- self/cls/explicit-global state accesses
- module-binding reads
- explicit raise/except syntax
- definition-time Python name aliases
strongly_inferred
- local call target resolution
- parameter-container state regions
- effect hints
- branch/loop phi merges
- explicit exception catch matching
- structural motif candidates
unresolved
- runtime dispatch
- reflection
- native extension behavior
- external library semantics
- precise heap points-to beyond definition-time alias
- dynamic exception behavior from calls
- concurrency semantics