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.
Type: fix · Branch:
fix/issue-31-level-gate-callgraph· Part of epic #26Problem
provider.build(...)runs unconditionally (src/core.ts:34), including at-a 1where the emitter discards the result (emission gated tolevel >= 2,emit.ts:345). The heavier Jelly leg runs for nothing; this violates "the cheap path stays cheap" (dataflow-graphs.md:208).Change
L3+ is unaffected (L3 ≥ 2). Verify no L1 emit path reads provider externals/synthesized (schema declares both L2 → expected safe).
Acceptance
-a 1.-a 2/3/4output unchanged; the monotonicity gate proves-a 1output is byte-invariant.Files:
src/core.ts, lock-in test.