mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-08-27 15:51:10 +00:00
* test(abi): assert the generated cdylib defines every declared module-impl export
logos-protocol DECLARES the module-impl C ABI; this generator emits the
definitions. Those are independent facts, and the gap has shipped twice —
grant_host_services at protocol 0.3, the teardown pair at 0.5 — each time
as an "undefined symbol" at dlopen, on Linux only, with the runtime still
reporting the module as LOADED.
checks.<system>.module-impl-abi generates in all four shapes the emitter
can be reached in — --from-header, --lidl, a zero-method module, and one
with records and events — and diffs what each DEFINES against the list
logos-protocol publishes (packages.<sys>.module-impl-abi, protocol#66).
Both the list and the protocol version come from that one output, so there
is no version arithmetic here and nothing hardcoded.
The interesting part is what makes this NOT vacuous, because the obvious
implementation is. The generated .cpp carries the version guards as TEXT,
so a plain grep counts all ten exports at every protocol version and the
check would pass forever. unifdef resolves them — but unifdef given an
expression it cannot evaluate exits 0 and leaves the text alone, which
looks exactly like "nothing was conditional". So:
* no residual '#if/#else/#endif' may survive the resolution;
* the same pipeline runs twice, at the real MINOR and at MINOR=0, and
the MINOR=0 set must be a STRICT SUBSET of the real one.
That second assertion is the headline guard. It fires if unifdef no-opped,
if the version never reached it, or if the extraction were counting
mentions rather than definitions — without naming a single symbol or
version, so it does not go stale as the ABI grows.
Proven to fail. Commenting out the logos_module_string_free emission turns
it red naming that symbol, while `tests` and `generator-cli` both stay
GREEN — this is the only thing in the repo that notices a deleted export.
Moving the teardown guard from >= 5 to >= 6 turns it red naming both
teardown symbols, with the probe moving 10 -> 8, so the version resolution
is live rather than a name list.
CI runs it: ci.yml only ever built '.#tests' plus three binaries, so the
`checks` attrset was never evaluated at all — generator-cli has never run.
TODO in flake.nix: logos-protocol is rev-pinned to the protocol#66 branch.
Re-point at master once it merges; a rev pin never moves under
`nix flake update`, so leaving it would freeze the declared side.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore(deps): track logos-protocol master now that module-impl-abi has landed
logos-protocol#66 merged as 480f40f, so the temporary rev pin can go. A rev
pin never moves under `nix flake update`, so leaving it would freeze the
DECLARED side of this check at 0.5 and quietly stop catching anything a
later protocol adds — the exact silence the check exists to break.
Restores the master-tracking comment the pin displaced, with a line noting
that checks.module-impl-abi now also consumes
packages.<system>.module-impl-abi from this input.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>