pub fn install_for_pkg_test(lua: &Lua) -> LuaResult<()>Expand description
Install the production alc.* primitive surface plus the mock layer
on lua for use by the alc_pkg_test sandbox.
Spec authors get:
- the full
alc.*surface thatalc_runexposes (stateless helpers likealc.json_encode,alc.fingerprint,alc.parse_number,alc.fuzzy.*, plus stateful helpers backed by in-memory per-VM tempdirs foralc.state.*andalc.card.*); alc.llm/alc.llm_batch/alc.forkas stubs that error out when called without awith_alc({ llm = … }, …)override;- a Pure-Lua mock layer (
with_alc(overrides, fn),alc_mock.install/restore,alc.spy(name, default_fn?)).
Invariant (enforced by tests/bridge_sandbox_parity.rs):
production primitive surface ⊆ test sandbox primitive surface.
Every key reachable on _G.alc after a successful production
register call is also reachable after install_for_pkg_test.
The per-VM tempdir backing state_store / card_store is held on
the Lua VM via set_app_data and dropped together with the VM.