Skip to main content

Module structural_source

Module structural_source 

Source
Expand description

Structural Source compiler (Wave 14, Level 2 of the context stack, docs/SYSTEM_DESIGN.md Wave 14): a semantic skeleton of an implementation slice. Denser than signature compression: per symbol it preserves the signature plus the calls, state access, events, contracts, and control skeleton the extractor actually evidenced — and never fabricates sequence beyond CFG/flow truth.

Every unit carries provenance back to the exact source (source: <path>:L<start>-L<end>, representation, revision) so compressed output is never mistaken for source text.

§CFG/control evidence the store actually holds

The indexer records, per symbol entity (write.rs): call_order (callee -> min lexical order), call_blocks (callee -> nearest control-block kind: if/else/for/while/try/catch/match/switch/with/do/ loop/finally/select), awaited_calls, call_returns (callees whose result is consumed — the return evidence), and conditional_calls (older fallback: callees inside any branch, kind unknown). Control blocks carry no nesting depth and no condition expressions — the skeleton therefore emits one control line per callee, labeled by the callee, with that callee’s lines nested beneath it.

Functions§

render_structural
Render units as the spec’s format:
resolve_handle_to_path
Resolve a repository-relative path or an scc:// handle to a path. Stale handles refuse; the file is left unread. Never guesses a target.
structural_source
Build structural-source units for the requested paths (deduped, order preserved), capped at max_units. Files unknown to the trusted view or containing no symbols produce no unit.