From cce4239636443d34ed6dbd9b5b14838d4fbb6330 Mon Sep 17 00:00:00 2001 From: Dario Gabriel Lipicar Date: Mon, 10 Aug 2026 19:18:10 -0300 Subject: [PATCH] fix(doctests): track two upstream changes the specs still assert against CI has been red on every run since the dependencies moved underneath it. The repo itself has not changed -- master's HEAD IS the commit that last went green, on 2026-07-22 -- but logos-tutorial has no flake.lock: the specs scaffold projects that resolve `github:logos-co/...` fresh at run time, so the same commit passes or fails depending on the day. Both failures below are the specs asserting behaviour that upstream deliberately changed. 1. INTEGER WIDTH: `int` -> `qlonglong` in the generated Qt surface. `lm methods` now reports `qlonglong add(qlonglong a, qlonglong b)` where the spec expected `int add(int a, int b)`. This is the LIDL type contract: one type per language, integers 64-bit throughout, no widening or narrowing. The tutorial's explanation was not merely stale -- it documented the OLD BUG as intended behaviour, telling the reader that their `int64_t` "shows up as `add(int,int)`". That silent 64->32 narrowing is exactly what the type contract removed. The bullet now says the width is preserved and why that matters, which is the part a tutorial is for. Only tutorial-wrapping-c-library asserts generator OUTPUT, so only it moves. The `int` in tutorial-cpp-ui-app is C++ the reader writes themselves (`.rep` SLOTs and their own `override` declarations), where the reader picks the type -- that spec passes, and is deliberately left alone. 2. BASECAMP NAVIGATION: the Settings section was renamed and its tab removed. `click("Modules")` failed with "No clickable element found with text 'Modules'". On basecamp master the section label is now "Module Inspector" (SettingsView.qml:53), and the "Core Modules" tab is gone -- it was split into its own view, which ModuleInspectorView.qml:18 says in as many words ("Formerly the 'Core Modules' tab of ModulesView"). So the tab-click step is deleted rather than renamed, and the objectName the Interface screen is opened through is `moduleInspectorView`, not `coreModulesView`. Verified against origin/master of logos-basecamp, which is what CI builds: `openInterface(name)` still exists (ModuleInspectorView.qml:46), and the surrounding anchors "Settings", "Sections", "Dashboard" are all still there. NOT ADDRESSED HERE, because it is not a tutorial bug: the third failure, `persistenceDir` not containing `calc-data`, is a real regression in logos-logoscore-cli. daemon_state.cpp:264 applies `--persistence-path` only `if (cfg.dirs.data.empty())`, and dirs.data has a default -- so an explicitly passed CLI flag loses to a default, silently. The spec is right and should stay red until that is fixed. --- tests/tutorial-qml-ui-app.test.yaml | 17 ++++++-------- tests/tutorial-wrapping-c-library.test.yaml | 26 ++++++++++----------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/tests/tutorial-qml-ui-app.test.yaml b/tests/tutorial-qml-ui-app.test.yaml index 301b436..6d1443b 100644 --- a/tests/tutorial-qml-ui-app.test.yaml +++ b/tests/tutorial-qml-ui-app.test.yaml @@ -697,17 +697,14 @@ sections: action: wait_for texts: ["Sections"] timeout: 60000 - - name: "Open the Modules system view" + - name: "Open the Module Inspector" text: | The doc comments you wrote on `calc_module`'s methods and events in - Part 1 also surface in basecamp. Open **Settings → Modules → Core - Modules**, then open `calc_module`'s **Interface** — each method and - event shows its `description`. + Part 1 also surface in basecamp. Open **Settings → Module + Inspector**, then open `calc_module`'s **Interface** — each method + and event shows its `description`. action: click - target: "Modules" - - name: "Switch to the Core Modules tab" - action: click - target: "Core Modules" + target: "Module Inspector" - name: "calc_module is listed" action: wait_for texts: ["calc_module"] @@ -718,7 +715,7 @@ sections: - name: "Open calc_module's Interface screen" action: call_method find_by: "objectName" - find_value: "coreModulesView" + find_value: "moduleInspectorView" method: "openInterface" args: ["calc_module"] - name: "Method and event descriptions render (single- and multi-line)" @@ -732,7 +729,7 @@ sections: post_text: | The result `8` comes back from `calc_module`: pressing **Add** calls `logos.callModule("calc_module", "add", [3, 5])`, which basecamp routes to your core module and back to the QML view. Both modules — the `calc_module` core plugin and the `calc_ui` view plugin — are loaded from the `basecamp-data` directory you installed them into. - The **Interface** screen (Settings → Modules → Core Modules → *Interface*) lists every method **and event** with the `description` from its doc comment — the same docs `lm` and `logoscore module-info` showed in Part 1, here in the GUI. Multi-line `///` comments render as multiple lines, exactly as written. + The **Interface** screen (Settings → Module Inspector → *Interface*) lists every method **and event** with the `description` from its doc comment — the same docs `lm` and `logoscore module-info` showed in Part 1, here in the GUI. Multi-line `///` comments render as multiple lines, exactly as written. The sidebar labels each UI plugin by its `name` from `metadata.json`, which is why the tab reads `calc_ui`. diff --git a/tests/tutorial-wrapping-c-library.test.yaml b/tests/tutorial-wrapping-c-library.test.yaml index 9c7c825..29c764d 100644 --- a/tests/tutorial-wrapping-c-library.test.yaml +++ b/tests/tutorial-wrapping-c-library.test.yaml @@ -595,10 +595,10 @@ sections: # macOS ./lm/bin/lm methods result/lib/calc_module_plugin.dylib expect_contains: - - "int add(int a, int b)" - - "int multiply(int a, int b)" - - "int factorial(int n)" - - "int fibonacci(int n)" + - "qlonglong add(qlonglong a, qlonglong b)" + - "qlonglong multiply(qlonglong a, qlonglong b)" + - "qlonglong factorial(qlonglong n)" + - "qlonglong fibonacci(qlonglong n)" - "QString libVersion()" - "Description: Adds two integers and returns the sum." - "Defined as n * (n-1) * ... * 1, with 0! = 1." @@ -613,25 +613,25 @@ sections: Plugin Methods: =============== - int add(int a, int b) - Signature: add(int,int) + qlonglong add(qlonglong a, qlonglong b) + Signature: add(qlonglong,qlonglong) Invokable: yes Description: Adds two integers and returns the sum. - int multiply(int a, int b) - Signature: multiply(int,int) + qlonglong multiply(qlonglong a, qlonglong b) + Signature: multiply(qlonglong,qlonglong) Invokable: yes Description: Multiplies two integers and returns the product. - int factorial(int n) - Signature: factorial(int) + qlonglong factorial(qlonglong n) + Signature: factorial(qlonglong) Invokable: yes Description: Computes the factorial n! of a non-negative integer. Defined as n * (n-1) * ... * 1, with 0! = 1. - int fibonacci(int n) - Signature: fibonacci(int) + qlonglong fibonacci(qlonglong n) + Signature: fibonacci(qlonglong) Invokable: yes Description: Returns the nth Fibonacci number (0-indexed). @@ -652,7 +652,7 @@ sections: Three things to notice: - - **Signatures are Qt-typed** (`int`, `QString`) even though you wrote `int64_t` / `std::string`. That's the generated glue: `lm` reports the wire types the synthesized Qt plugin exposes, so `int64_t add(int64_t, int64_t)` shows up as `add(int,int)`. + - **Signatures are Qt-typed** (`qlonglong`, `QString`) even though you wrote `int64_t` / `std::string`. That's the generated glue: `lm` reports the wire types the synthesized Qt plugin exposes, so `int64_t add(int64_t, int64_t)` shows up as `add(qlonglong,qlonglong)`. Note the width is **preserved** — `qlonglong` is Qt's 64-bit integer, not `int`. Each type in the contract maps to exactly one type per language, and integers are 64-bit throughout, so a value that fits your `int64_t` cannot be silently truncated on the way across. - **Each `Description` is your doc comment**, carried through the module's method introspection. Plain `//` comments (like the type-mapping note in the header) are deliberately ignored, so only intentional docs surface; an undocumented method simply omits it. - **Line breaks are preserved** — a single-line comment renders inline; a multi-line comment (`factorial`, `libVersion`, `libVersionNotify`) keeps its breaks. The same descriptions appear in `logoscore module-info` and Basecamp's Methods list.