Files
Dario LipicarandClaude Opus 5 937f17ed01 feat(cdylib): define logos_module_accept_inbound_token (#151)
* feat(cdylib): define logos_module_accept_inbound_token

logos-protocol only DECLARES the module-impl C ABI; every language backend
owes each definition. A missing one links clean and dies at dlopen, on Linux
only — macOS links plugins -undefined dynamic_lookup and hides it entirely.

Also fixes a misrouted diagnostic in the ABI check. The at-nextmaj MAJOR probe
ran before the export diff, so an export that NOTHING defines was reported as
"a version guard testing MINOR without MAJOR" — the wrong lesson, sending the
reader to fix a guard that is not there. The probe is now gated on the symbol
being present at the current MINOR, with a self-test over synthetic sets
because both diagnostics are inline shell and otherwise untestable.

Requires logos-protocol fix/token-direction-key-namespace (59b27ef).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(deps): relock logos-protocol to 42460e5b (0.8.0), which is what makes the ABI check non-vacuous

WHAT MOVED

  logos-protocol  480f40ff (0.5.0)  ->  42460e5b (0.8.0)

Nothing else in the lock changed. The input tracks a branch rather than a
rev, so the update moved it on its own.

WHY IT HAD TO

This PR's definition of logos_module_accept_inbound_token is guarded on
protocol >= 0.8, so at the locked 0.5 the emitter wrote NOTHING and
checks.<sys>.module-impl-abi passed with the feature entirely absent. That
check diffs the emitted export set against the list the PINNED logos-protocol
declares, and 0.5 declares ten exports, none of them the inbound door. The PR
was green because the check could not see the thing the PR adds.

Measured rather than argued. Deleting the whole emitter block from
cpp-generator/experimental/lidl_gen_cdylib.cpp:

  at 480f40ff (0.5.0) -- GREEN, i.e. the check was vacuous
      logos-protocol 0.5.0 declares 10 module-impl exports
      [A: --from-header, header-first] defines all 10 declared module-impl exports.
      /nix/store/mlqs29va7lx4m49cclni6pf01yg7n2js-logos-cpp-sdk-module-impl-abi-tests

  at 42460e5b (0.8.0) -- RED, naming the missing export
      FAIL: [A: --from-header, header-first] does not define every module-impl
      C ABI export.
        DECLARED by logos-protocol but NOT DEFINED by this backend:
            - logos_module_accept_inbound_token
      (version probe: 7 exports at MINOR=0, 11 at MINOR=8 -- one short)

Restoring the block returns the check to green at the SAME store path it had
before the deletion, so the red is attributable to the emitter and to nothing
else in the tree.

CHECKS

Every check the flake exposes, built individually on x86_64-linux at the new
lock. Substituters restricted to cache.nixos.org because cache.nix.logos.co
is returning 502, so these are builds rather than cache hits.

  checks.x86_64-linux.generator-cli
    /nix/store/ndimz2vnkrqlms1pl6bi0jhci8snzh82-logos-cpp-sdk-generator-cli-tests
  checks.x86_64-linux.module-impl-abi
    /nix/store/dncpnlql0jlk1yhzygnfchcjrxh1ndf7-logos-cpp-sdk-module-impl-abi-tests
  checks.x86_64-linux.tests
    /nix/store/za8digicp97vd1aqis3x5ypnbwbnqz5r-logos-cpp-sdk-tests-0.2.0

module-impl-abi now reports, for all four generator configurations
(--from-header, --lidl, zero-method, records+events):

  logos-protocol 0.8.0 declares 12 module-impl exports; resolving generated
  code at LOGOS_PROTOCOL_VERSION_MINOR=8
  version probe: 7 exports at MINOR=0, 12 at MINOR=8
  defines all 12 declared module-impl exports.

The Darwin checks were not built; no macOS builder was available.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 18:02:14 -03:00
..