Context
PR #89 establishes the invariant FuncInfo.Settled => types, effects, direct callees, and a non-nil immutable CFG result are published. Several consumers enforce portions of that contract independently, with repeated cache lookup and ICE wording.
Proposed cleanup
- centralize specialization cache lookup and settled-state validation in a small helper that adds caller/context information to ICEs
- keep CFG presence validation even at call sites that currently consume only effects; it is part of the global publication invariant
- consolidate repeated
settled specialization has no CFG result checks without weakening staged publication
- simplify thin graph/callee collector wrappers where doing so improves navigation
- consider splitting the larger
validateStatementEffect invariant switch into focused validators while keeping panics for impossible internal states
Constraints
- no behavior or diagnostic-policy change
- no defaulting missing published facts to empty values
- preserve
Settled as the single publication gate and keep graph/replay ordering deterministic
This is a low-priority readability/refactoring follow-up after PR #89.
Context
PR #89 establishes the invariant
FuncInfo.Settled => types, effects, direct callees, and a non-nil immutable CFG result are published. Several consumers enforce portions of that contract independently, with repeated cache lookup and ICE wording.Proposed cleanup
settled specialization has no CFG resultchecks without weakening staged publicationvalidateStatementEffectinvariant switch into focused validators while keeping panics for impossible internal statesConstraints
Settledas the single publication gate and keep graph/replay ordering deterministicThis is a low-priority readability/refactoring follow-up after PR #89.