mirror of
https://github.com/logos-co/logos-test-modules.git
synced 2026-08-27 18:21:07 +00:00
One contract had two providers answering different SHAPES. test_fullapi_ext_rust.lidl declared `echoOptional(v: ?tstr) -> result`; test_fullapi_ext_cpp is header-first and kept deriving `-> ?tstr` from `std::optional<std::string> echoOptional(...)`. Carried as known-ext.json's `ext-optional-return-changed-on-one-provider`, and visible on a second surface as `ext-optional-return-shape-through-the-qt-proxy`. THE WORKAROUND OUTLIVED ITS CAUSE. `-> result` was chosen because `logos-qt-generator --backend consumer` REFUSED `-> ?T` -- null was also how a failed call reported itself on that path, so an empty ?T and a failure were one wire value. That gate is retired: `lidlTypeToQt` maps `?T` to std::optional<T>, so the empty answer is std::nullopt, an inhabitant of its own, and failure travels on logos::CallError, decided by the C ABI return code and never by the value's null-ness. So `-> ?tstr` is emittable today, it is what the C++ provider already derives, and it is what the case table already expects. Reverting the Rust side is what makes the two agree; the alternative (moving C++ to `-> result`) would have meant changing the expectations to match a workaround for a constraint that no longer exists. Changed together, because a proxy that forwards a shape must declare the same one: the Rust LIDL and its impl (`Option<String>` in and out, no success flag standing in for presence), the qtproxy's own interfaces/full_api_ext.lidl, and the qtproxy impl's echoOptional -- which now forwards through sOptStr rather than sResult, and renders with rOpt rather than rResult in the exercise-all and async blocks. Both registry entries are retired. The proxy one had a SECOND, independent half -- a Qt wrapper that could not decode a reply returned a default-constructed LogosResult, and that default is byte-for-byte a provider refusal -- which is fixed in logos-qt-sdk#44 and logos-cpp-sdk#150 and stands whichever shape the contract had chosen. Recorded in the `fixed` entry, because retiring it here without naming that half would credit the shape change with more than it did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>