Skip to content

fix: level-gate the call-graph solve at -a 1 #31

Description

@rahlk

Type: fix · Branch:fix/issue-31-level-gate-callgraph · Part of epic #26

Problem

provider.build(...) runs unconditionally (src/core.ts:34), including at -a 1 where the emitter discards the result (emission gated to level >= 2, emit.ts:345). The heavier Jelly leg runs for nothing; this violates "the cheap path stays cheap" (dataflow-graphs.md:208).

Change

constcg=opts.analysisLevel>=2
? provider.build({ project, symbol_table,root: opts.input, log,phantoms: opts.phantoms})
: {edges: [],external_symbols: {},synthesized_callables: {}};

L3+ is unaffected (L3 ≥ 2). Verify no L1 emit path reads provider externals/synthesized (schema declares both L2 → expected safe).

Acceptance

  • The call-graph solve (incl. Jelly) does not run at -a 1.
  • -a 2/3/4 output unchanged; the monotonicity gate proves -a 1 output is byte-invariant.

Files:src/core.ts, lock-in test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions