Commit Graph
2 Commits
Author SHA1 Message Date
Dario Lipicar 1a4fa6fc20 doctest: make the bad-bind step outcome-agnostic (#69)
* doctest: make the bad-bind step outcome-agnostic

Asserting status:error relied on the inner call to a missing module
blocking long enough to time out the outer RPC. With faster failure
detection the plain-int typed wrapper returns the type's default and the
outer call reports ok — both surfaces are legitimate, and which one wins
is a platform/timing race (consistently the fast path on Linux since the
transport extraction, still the slow path on macOS). Assert on the
stable part and teach the real contract: bad binds fail at call time;
methods that need caller-visible errors should return result.

* doctest(qml-ui): gate the Modules click on a wait_for

Right after the calculator round-trip the shell is still settling; on a
busy CI runner the Modules entry can take longer than the click action's
retry budget to materialize (flipped red on both platforms in one run,
green the previous hour, identical pins). Same pattern the spec already
uses for the post-launch wait.

* doctest(qml-ui): open Settings before clicking Modules

The Modules entry lives in the Settings left rail; clicking it cold
relied on incidental tree state (passed or failed depending on whether
the entry happened to be materialized). Mirror the basecamp doctests'
proven sequence: click Settings, wait for the view, then click Modules.

* tutorial: demonstrate the CallError out-param on bound interface calls

Generated typed wrappers now take an optional trailing
logos::CallError* — sumVia checks it and returns -1 when the inner call
fails (err.code == "object_unavailable" for a missing module), so the
bad-bind lesson no longer depends on which way the failure-timing race
falls. The doctest assert stays tolerant of the slow-transport
outer-timeout surface.
2026-06-12 23:59:40 -03:00
Dario LipicarandClaude Opus 4.7 c9f47391e5 feat: dependency interfaces — executable tutorial + guide (#64)
* feat: dependency interfaces tutorial (executable)

Add tests/tutorial-interface-dependencies.test.yaml — an executable
logos-doctest tutorial that builds calc_via_interface: a module declaring a
`calculator` interface and binding it to calc_module at runtime. Covers typed
sync/async/event calls, the no-validation rule, and the cross-repo interface
form. Registered in run.sh and CI (run + generate). Documents
interface_dependencies + bind_<interface> in the developer guide.

Depends on logos-cpp-sdk#74, logos-module-builder#108, logos-plugin-qt#8 —
the published flakes must carry these before the tutorial runs green in CI
(same release gating as the Composing Modules tutorial).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* address review: self-valid interface header + accurate CI step

- Interface calculator.h includes logos_module_context.h so the logos_events
  token is defined (valid C++ standalone); prose updated accordingly.
- CI step name/comment now reflect the third tutorial leaf
  (tutorial-interface-dependencies), not just the UI chain + Composing Modules.
(Copilot review, PR #64.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* rerun

* rerun

* fix(tutorial): correct the no-validation negative test

Binding to a module that isn't loaded does NOT return a silent default — the
inner remote call fails and propagates, so `logoscore call ... sumVia
no_such_module` exits non-zero with RPC_FAILED. The step asserted "result":0
and let the non-zero exit fail the doctest step. Reframe it accurately: a bad
bind surfaces as an ordinary RPC failure (not a crash); absorb the exit with
`|| true`, capture stderr, and assert `"status":"error"`. Fix the prose and the
recap row to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-05 22:19:30 -03:00