PBSOI CISG MVP v0.4 — Impact Engine

/mnt/data/PBSOI_CISG_MVP_v0.4/semantic_diff_demo/target · Python repository · evidence-grounded static graph

4
Files
30
Nodes
40
Edges
12
Impact targets
7
Data values
1
State regions
1
Defects
2
Motifs

MVP pipeline

Repository → CISG → Data/State Closure → Impact Engine → review scope

v0.4 separates one-hop direct evidence from bounded derived impact. Derived impact uses resolved local-call reachability and shared-state coupling; it is review scope, not a claim that every reachable entity will change at runtime.

Metrics

{
  "loaded_files": 4,
  "nodes": 30,
  "edges": 40,
  "node_types": {
    "file": 4,
    "function": 4,
    "control": 2,
    "data_value": 7,
    "state_region": 1,
    "data_use": 2,
    "data_sink": 4,
    "effect": 1,
    "boundary_call": 3,
    "data_phi": 1,
    "data_undefined": 1
  },
  "edge_types": {
    "contains": 4,
    "imports": 2,
    "controls": 2,
    "defines": 8,
    "reads_state": 1,
    "writes_state": 1,
    "contains_data": 6,
    "flows_to": 3,
    "returns_value": 4,
    "effect": 1,
    "calls": 5,
    "guards": 1,
    "phi_input": 2
  },
  "resolved_local_calls": 2,
  "boundary_calls": 3,
  "findings_by_category": {
    "defect": 1
  },
  "findings_by_severity": {
    "high": 1
  },
  "motif_instances": 2,
  "motif_clusters": 1,
  "data_values": 7,
  "phi_nodes": 1,
  "data_edges": 18,
  "alias_edges": 0,
  "state_regions": 1,
  "state_reads": 1,
  "state_writes": 1,
  "module_binding_reads": 0,
  "exception_handlers": 0,
  "explicit_raises": 0,
  "unresolved_local_uses": 1,
  "warnings": 0
}

Highest review breadth

KindTargetReview breadthPath
function8app.py
function7extra.py
function7helper.py
state_region1
function0bad.py

Warnings

  • None

Impact Engine

Direct = one-hop graph evidence. Derived = bounded resolved call paths + shared-state coupling. No single impact score is treated as truth.

Choose a target.

Code-Induced Semantic Graph

Overview shows 8 of 8 file/class/function entities. Full graph is in cisg.json / cisg.graphml.
app.pyapp.py{"id": "file_13cce7fd076299c8", "type": "file", "label": "app.py", "path": "app.py", "module": "app", "status": "observed", "confidence": 1.0, "evidence": {"path": "app.py", "line": 1, "end_line": 13, "source_hash": "2ec088553b6e6f879a433343eeb5787d1f3ae618fea1700e555576f1617c8fb2", "source_kind": "code"}}rootroot{"id": "fn_4e3d7579479d3d25", "type": "function", "label": "root", "path": "app.py", "module": "app", "symbol": "root", "async": false, "status": "observed", "confidence": 1.0, "evidence": {"path": "app.py", "line": 6, "end_line": 13, "source_hash": "2ec088553b6e6f879a433343eeb5787d1f3ae618fea1700e555576f1617c8fb2", "source_kind": "code"}, "motif_signature": "motif_exact_76a7c07a99b2", "motif_coarse_signature": "motif_coarse_ebd08e25cf76", "features": {"controls": ["with_scope"], "effects": ["file_io"], "state_reads": 1, "state_writes": 1, "state_read_targets": ["app:global:CACHE"], "state_write_targets": ["app:global:CACHE"], "local_calls": 2, "boundary_calls": 3}}bad.pybad.py{"id": "file_5ea031f3fad82a13", "type": "file", "label": "bad.py", "path": "bad.py", "module": "bad", "status": "observed", "confidence": 1.0, "evidence": {"path": "bad.py", "line": 1, "end_line": 4, "source_hash": "fa44a6a601b5f7c68da73595b30fa2a1944eeaab51e7dcbdb52828ecb0b093a2", "source_kind": "code"}}brokenbroken{"id": "fn_3ea4a988ecfabd70", "type": "function", "label": "broken", "path": "bad.py", "module": "bad", "symbol": "broken", "async": false, "status": "observed", "confidence": 1.0, "evidence": {"path": "bad.py", "line": 1, "end_line": 4, "source_hash": "fa44a6a601b5f7c68da73595b30fa2a1944eeaab51e7dcbdb52828ecb0b093a2", "source_kind": "code"}, "motif_signature": "motif_exact_33da3ae324f9", "motif_coarse_signature": "motif_coarse_e6dd3d82f5ef", "features": {"controls": ["branch"], "effects": [], "state_reads": 0, "state_writes": 0, "state_read_targets": [], "state_write_targets": [], "local_calls": 0, "boundary_calls": 0}}extra.pyextra.py{"id": "file_4d74821404433b49", "type": "file", "label": "extra.py", "path": "extra.py", "module": "extra", "status": "observed", "confidence": 1.0, "evidence": {"path": "extra.py", "line": 1, "end_line": 2, "source_hash": "447d7f48d560011b5f744931ff87d1284705dbedc18599487dcd90ca32d89273", "source_kind": "code"}}persistpersist{"id": "fn_381caeb25920760b", "type": "function", "label": "persist", "path": "extra.py", "module": "extra", "symbol": "persist", "async": false, "status": "observed", "confidence": 1.0, "evidence": {"path": "extra.py", "line": 1, "end_line": 2, "source_hash": "447d7f48d560011b5f744931ff87d1284705dbedc18599487dcd90ca32d89273", "source_kind": "code"}, "motif_signature": "motif_exact_83e42922287b", "motif_coarse_signature": "motif_coarse_fca123bd72d6", "features": {"controls": [], "effects": [], "state_reads": 0, "state_writes": 0, "state_read_targets": [], "state_write_targets": [], "local_calls": 0, "boundary_calls": 0}}helper.pyhelper.py{"id": "file_a687d2222eff87c4", "type": "file", "label": "helper.py", "path": "helper.py", "module": "helper", "status": "observed", "confidence": 1.0, "evidence": {"path": "helper.py", "line": 1, "end_line": 2, "source_hash": "ae12b83043de4abfc42b6f4826ae17dce8077ac3189cee4137fcd08c7a103603", "source_kind": "code"}}helperhelper{"id": "fn_48ffdf8ff0705994", "type": "function", "label": "helper", "path": "helper.py", "module": "helper", "symbol": "helper", "async": false, "status": "observed", "confidence": 1.0, "evidence": {"path": "helper.py", "line": 1, "end_line": 2, "source_hash": "ae12b83043de4abfc42b6f4826ae17dce8077ac3189cee4137fcd08c7a103603", "source_kind": "code"}, "motif_signature": "motif_exact_83e42922287b", "motif_coarse_signature": "motif_coarse_fca123bd72d6", "features": {"controls": [], "effects": [], "state_reads": 0, "state_writes": 0, "state_read_targets": [], "state_write_targets": [], "local_calls": 0, "boundary_calls": 0}}

Node evidence

Click a node.

SSA-like data flow

Local data footprint feeds Impact Engine but is not transitive across function boundaries.

RelationSourceTargetEvidenceStatus
flows_tof#1expr@11app.py:11observed
flows_toold#1expr@11app.py:11observed
flows_tox#0expr@12app.py:12observed
returns_valuex#0return@13app.py:13observed
guardsflag#0branchbad.py:2observed
phi_inputvalue#1value#2bad.py:2strongly_inferred
phi_inputvalue:undefinedvalue#2bad.py:2unresolved
returns_valuevalue#2return@4bad.py:4observed
returns_valuex#0return@2extra.py:2observed
returns_valuex#0return@2helper.py:2observed

State regions

AccessFunctionRegionKindEvidence
reads_staterootapp:global:CACHEmodule_globalapp.py:8
writes_staterootapp:global:CACHEmodule_globalapp.py:9

Module binding reads

FunctionBindingEvidence

Explicit exception flow

RelationSourceTargetEvidenceStatus

Findings

SeverityClassTypeLocationSymbolEvidence statement
highdefectpossibly_undefined_localbad.py:4brokenLocal variable 'value' may be undefined on at least one reaching control-flow path.

Deterministic motif candidates

KindPathSymbolConfidenceStructural rule
read_modify_writeapp.pyroot0.86same function reads and writes the same state target
resource_scopeapp.pyroot0.92with/async-with establishes bounded resource scope

Name-independent structural signature clusters

Motif IDMembersIdentity basis
motif_coarse_fca123bd72d62name-independent coarse structural feature signature

Per-file SHA-256

PathBytesSHA-256
app.py2242ec088553b6e6f87…
bad.py66fa44a6a601b5f7c6…
extra.py29447d7f48d560011b…
helper.py32ae12b83043de4abf…

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