Engine reference — generated from the canonical engineering source. Do not edit this page by hand.
Boundary option contracts — the vendored-library truth chain
Class: Sol calls vendored libraries (erlexec, gun, msgpack, chumak, epgsql) with literal option tuples. Every gate this repo ran could pass a permanently broken boundary call:
| Gate | What it checks | Why it missed G77 |
|---|---|---|
| xref | calls exist with that arity | option contents are data |
| mock_parity_lint | mock function/arity vs production | fun(_Cmd, _Opts) -> … is parity-perfect and content-blind |
| pin tests | what WE pass | pins the bug as the contract when the knowledge is wrong |
| dialyzer (absent) | success typing | would flag the exec class, NOT the gun class (map types admit extra keys) |
The concrete 2026-09 event: the closeout “fixed” the registry rsync
leg by moving {timeout, …} into exec:run/3’s third argument — a real but
non-throwing option — while element 1 of the same list,
{stdout, stderr_to_stdout}, threw Invalid stdout option stderr_to_stdout
on every call. The fix was written from the memory of the correct
sol_gpu_probe.erl lesson (“{timeout, Ms} is NOT a valid erlexec 2.3.4 cmd
option — verified”, ) without executing the boundary once. Five
siblings shipped the same way: gun transport_opts in the OAuth store and
plugin-bridge https paths (gun 2.x refuses with {error, {options, …}} —
the open failed CLOSED, an availability defect, not a silent TLS downgrade),
the bare stderr_stdout atom in the offsite backup ({invalid_option, stderr_stdout} on every invocation), {stdin, [Data]} in the keyring (the
tuple value is a FILENAME; data-at-spawn does not exist), and {stdout, ""}
in the container paths ("" is an empty redirect FILENAME — the port
answers “stdout - atom or string value in tuple required”).
Two further properties of the same boundary, both now machine-pinned:
Sync-mode erlexec timeouts do not bound the child. run/3’s Timeout
bounds only the spawn RPC; wait_for_ospid_exit/4 is a receive with no
after. A “timeout” rsync ran until it finished. Killing the Erlang
worker does not kill the OS child either (no link/monitor ⇒ no
caller-death cleanup) — the proven orphaned-rsync case behind the
registry prepare staging reappearing after cleanup.
The exec port’s list-form argv is execve(2) — no PATH lookup. A
bare "rsync"/"secret-tool" argv head answers
{error, [{exit_status, 256}]} (“cannot execute”) on every host even
with a valid option list; binaries must be resolved
(os:find_executable/1) before the call. Also: a single-element list of
one string IS that string, and erlexec routes printable-string commands
differently from true argv lists. And wait_for_ospid_exit reports the
RAW waitpid status (exit(1) arrives as {exit_status, 256},
exit(3) as 768).
The three-mechanism prevention chain
- Golden option-spec lint —
ci/boundary_option_golden.json(accepted option sets extracted from the vendoredcheck_cmd_options/ guncheck_options/ msgpackoptions/ epgsqlconnect_optionsources, sha256-tripped to the vendored files) +ci/boundary_option_lint.py: every literal option list atexec:*/gun:open/msgpack:*/chumak:set_socket_option/epgsql:connectcall sites inserver/srcmust be in the golden for that library+version. The epgsql leg ( ) validates BOTHconnect_optsshapes with one key set — the list-formconnect(Host, User, Pass, [{Key, …}])arms and the flat map-formconnect(#{Key => …})probe — and value-checkssslto boolean | required. A vendored bump without a golden refresh fails loudly;--refreshre-pins (review the sets in the same change). This is the machine-checked-constants doctrine: the library truth lives in an artifact the linter executes, never in prose or memory. - Boundary-truth CT —
server/test/sol_boundary_contract_SUITE.erl: one case per boundary asserting LIBRARY ACCEPTANCE against the real compiled libraries (never a mock), including a real rsync transfer throughsol_registry:do_rsync/2, real gun opens for the OAuth and plugin-bridge maps, the real stdin-data path, and a container drill on no-op runtimes. Re-introducing any pre-fix shape reds the suite (the mutation proof is in the phase record). This is the only mechanism that catches “key accepted but not consumed” and version drift that slips a golden refresh. - exec chokepoint —
sol_exec:run/2,3(+run_watch/5,run_with_stdin/4,stop/1): non-sync spawn with themonitoroption, a receive-afterTOTAL timeout, a guaranteedexec:stopon expiry (bounded mailbox drain), flat-binary output, stdin data via post-spawnexec:send, and a watch protocol that reports the exec child handle so a backstop killer can take the OS child down with its Erlang worker (sol_registry’s prepare leg). Enforced byci/exec_chokepoint_lint.py+ci/exec_run_sites_baseline.txt(shrink-only): the remaining raw sites are the non-sync long-lived streaming spawns where a sync chokepoint does not apply.
Rules for the next boundary fix
- Do not fix from memory or prose — run the boundary once (the boundary
CT is the harness;
sol_test_helpers:ensure_erlexec_root_user/0already solved the exec-port root shim). - New literal option shapes must land in the golden in the same commit
(
--refreshre-pins hashes; sets are reviewed by hand against the new vendored source). - New bounded OS command →
sol_exec:run/2,3, never a rawexec:run(the chokepoint lint rejects new raw sites). - Data to a child’s stdin →
sol_exec:run_with_stdin/4(post-spawnexec:send); there is no data-at-spawn option in erlexec. - Resolve binaries (
os:find_executable/1) before list-form exec calls; argv heads areexecved verbatim.
Owners: the golden + lints live in ci/ (required lint-suite battery),
the boundary CT in server/test (required server-ct battery), the
chokepoint in server/src/sol_exec.erl. See
plan/archive/v0748-v0763-post-release-truth-hardening/phase--boundary-option-truth.md for the implementation
record and D-numbers.