Skip to main content

Module dataflow

Module dataflow 

Source
Expand description

Intra-process data-flow edges (Plan competitive-harvest t-002, slice 4).

Distinct from the contract-keyed cross-service layer: a data-flow edge is a direct symbol→symbol link within one process recording that a value at a call site flows into a callee’s parameter (arg → param). No contract, no cross-repo matching — it’s the “argument-to-parameter” half of what codebase-memory-mcp calls DATA_FLOWS.

Detection is split like the endpoint layer: a language adapter reports DetectedDataFlow (call site + argument + position, by qname); the index pipeline resolves the callee’s parameter name (from its signature) and symbol identity to produce a DataFlowEdge.

Structs§

DataFlowEdge
A resolved data-flow edge: a value flows from a call site in from into param of the callee to.
DetectedDataFlow
A data-flow site detected by an adapter, before the pipeline resolves the callee’s parameter name and symbol identity. The adapter knows the callee by qname and the argument’s position; the pipeline maps position → param name using the callee’s signature.

Enums§

DataFlowKind
How a value reaches its sink. Currently only argument→parameter; field-access chains are a planned addition.

Functions§

edges_from_tree
Flatten the on-disk data-flow registry (from_symbol_id → [DataFlowEdge]) into a flat list. Malformed entries are skipped.
parse_params
Extract positional parameter names from a function signature, e.g. "def get_user(id, name=None, *args)" → ["id", "name"]. Skips *args/**kwargs and the self/cls receiver. Language-agnostic enough for the common name(params) shape.
resolve_edge
Resolve a detected data-flow site into a DataFlowEdge, given a way to look up a qname’s symbol_id and a callee’s parameter list. Returns None when the caller or callee can’t be resolved, or the arg position has no corresponding parameter.