From 3cf9e091a921a4d04ebab765d9c76a39fca3259c Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sat, 21 Nov 2026 06:00:54 +0100 Subject: [PATCH] build(shell): name Crafter.Graphics at a commit of its master, and answer a compositor's resize with a frame The app was built against a checkout of Crafter.Graphics given with --graphics=, because the text-input purposes it asks the input method for were uncommitted work in one checkout. They are on Crafter.Graphics' master since a9ce1a0, so project.cpp names the library as a GitProject at that commit, as it names Crafter.Network and Crafter.DB. --graphics= is gone, and with it $NOSTRO_GRAPHICS in build-aarch64.sh and the workflow's step that cloned the branch claude/nostro-app, which the forge never had: neither job of the workflow could have built the app. That master also has 89111e0, which the window was not written against. A size the compositor configures is no longer taken in the configure's listener. The listener keeps it and fires onFrameOwed, and the next Render() makes the swapchain again, fires onResize from inside itself, and answers the configure with that frame's buffer. The window draws on demand, so: - Shell::Window asks for a frame from onFrameOwed. Without it nothing draws the frame that answers the configure, and the window keeps its old size until something else changes on it. - Canvas::Reconcile no longer turns the compositor's sizes into Resize(pixels). The library takes the size asked for last, whoever asked, so that call took the configured size's place, and with it came back the surface a dp larger than configured that 89111e0 had ended (Crafter.Graphics #201). It now sizes the window only where the library does not: the app's own size (--size, SetSize, --scale); the size that comes with a new window (#166), handed over in deferredLogicalWidth, where the library's listener keeps every later one; and a scale the display changes to by itself (#165), through RebuildSwapchain. The last two reach into the library's own state, and go once the library does them. The text-input API on master is the one the app was written against: nothing changed there. Looked at on 2026-11-20 on the made-up system, on a desktop (KWin at a scale of 1.85), with WAYLAND_DEBUG=1 on the app: - The accounts at 420x760: the start, and resize:600,800 from --poke, the app's own size. Each size reaches the surface once, with the first buffer drawn for it. - The same window given 760x532 by the compositor (a KWin script that sets its frameGeometry): the configure is kept, a frame is asked for, and set_destination(760, 532), the acknowledgement and the first buffer of 1406x985 go out together. A temporary probe had that frame's draw list reach 1406x985: it is laid out for the new size. - 421x761, whose pixels at 1.85 are no whole number: it opens as 422x762, since the app's own size goes through Resize in pixels. The notes say so. - --scale 2 --size 360x760, the cards and the pay form filled in from --poke, with resize:400,700: the compositor's sizes are passed over. - The --debug-api build driven with crafter-debug: Window_Resize, Ui_Tap, ui.texts and a screenshot. The two paths that are a phone's, a size in the first configure and a scale named after the first frames, were tried only with the values put in by hand in a temporary probe. Nothing was looked at on a phone, and what the input method is told was not read off the wire: the test window never had the keyboard. 17 tests pass and the four lint passes report nothing. The app, its --debug-api build, the fake system, the x86_64 Flatpak bundle and both aarch64 Flatpaks (build-aarch64.sh) build. Co-Authored-By: Claude Fable 5.2 --- .forgejo/workflows/flatpak.yaml | 31 +---------- AGENTS.consumer.md | 2 +- AGENTS.template.md | 28 +++++----- implementations/Nostro.Ui.Shell-Canvas.cpp | 61 ++++++++++++++-------- implementations/Nostro.Ui.Shell-Window.cpp | 15 +++++- interfaces/Nostro.Ui.Shell-Canvas.cppm | 21 ++++---- packaging/flatpak/build-aarch64.sh | 5 +- project.cpp | 20 ++++--- 8 files changed, 94 insertions(+), 89 deletions(-) diff --git a/.forgejo/workflows/flatpak.yaml b/.forgejo/workflows/flatpak.yaml index bf7153a..c036716 100644 --- a/.forgejo/workflows/flatpak.yaml +++ b/.forgejo/workflows/flatpak.yaml @@ -27,9 +27,6 @@ name: Flatpak # - The repository is public by the time a tag is pushed: the release checks read the forge without a login, and a # private repository answers them with a 404. # - The runner's config has to allow the four volumes of `publish`, of which crafter-flatpak-nostro-cache is new. -# - The app is built against a Crafter.Graphics checkout for as long as project.cpp takes one (--graphics=): the -# branch $GRAPHICS_REF has to be on the forge. Once project.cpp names Crafter.Graphics at a commit itself, the -# step that fetches it goes, and $NOSTRO_GRAPHICS with it. # # Crafter.Build's, Crafter.Review's and imsd-messages' workflows publish into the same repository: each holds # /var/www/flatpak/.publish.lock while it commits and updates the summary, and so does this one. @@ -60,10 +57,6 @@ env: REPO_DIR: /srv/flatpak/repo # A release tag carries a signature Forgejo verifies for this address. RELEASE_SIGNER: jorijnvdgraaf@catcrafts.net - # The Crafter.Graphics the app is built against: see the head of this file. - GRAPHICS_URL: https://forgejo.catcrafts.net/Catcrafts/Crafter.Graphics.git - GRAPHICS_REF: claude/nostro-app - GRAPHICS_DIR: /home/build/Crafter.Graphics jobs: check: @@ -119,21 +112,11 @@ jobs: # environment until Crafter.Build's issue #46 is fixed (AGENTS.template.md, Code style). run: runuser -u build -- flatpak run --env=CPLUS_INCLUDE_PATH=/app/include/c++/v1 "$CRAFTER_REF" lint --banks=bunq - - name: Crafter.Graphics - run: | - set -eu - rm -rf "$GRAPHICS_DIR" - if ! runuser -u build -- git clone --quiet --depth 1 --branch "$GRAPHICS_REF" "$GRAPHICS_URL" "$GRAPHICS_DIR"; then - echo "no $GRAPHICS_REF at $GRAPHICS_URL: the app is built against it, see the head of .forgejo/workflows/flatpak.yaml" >&2 - exit 1 - fi - echo "Crafter.Graphics $(git -C "$GRAPHICS_DIR" rev-parse HEAD)" - - name: Sysroot run: runuser -u build -- packaging/flatpak/make-aarch64-sysroot.sh - name: Build - run: runuser -u build -- env NOSTRO_GRAPHICS="$GRAPHICS_DIR/project.cpp" packaging/flatpak/build-aarch64.sh repo "$BRANCH" + run: runuser -u build -- packaging/flatpak/build-aarch64.sh repo "$BRANCH" publish: if: github.event_name == 'push' @@ -197,16 +180,6 @@ jobs: # Against the fake bunq and the fake system bus the tests bring: no bank and no system bus is reached. run: runuser -u build -- flatpak run "$CRAFTER_REF" test --banks=bunq - - name: Crafter.Graphics - run: | - set -eu - rm -rf "$GRAPHICS_DIR" - if ! runuser -u build -- git clone --quiet --depth 1 --branch "$GRAPHICS_REF" "$GRAPHICS_URL" "$GRAPHICS_DIR"; then - echo "no $GRAPHICS_REF at $GRAPHICS_URL: the app is built against it, see the head of .forgejo/workflows/flatpak.yaml" >&2 - exit 1 - fi - echo "Crafter.Graphics $(git -C "$GRAPHICS_DIR" rev-parse HEAD)" - - name: Sysroot run: runuser -u build -- packaging/flatpak/make-aarch64-sysroot.sh @@ -214,7 +187,7 @@ jobs: # repo is made anew, as dist is below: root bundles and publishes from it. run: | rm -rf repo - runuser -u build -- env NOSTRO_GRAPHICS="$GRAPHICS_DIR/project.cpp" packaging/flatpak/build-aarch64.sh repo "$BRANCH" + runuser -u build -- packaging/flatpak/build-aarch64.sh repo "$BRANCH" - name: Bundle # dist is made anew: the release carries every file in it, and a checkout can bring a dist of its own, or a diff --git a/AGENTS.consumer.md b/AGENTS.consumer.md index 45e6578..9223b26 100644 --- a/AGENTS.consumer.md +++ b/AGENTS.consumer.md @@ -12,7 +12,7 @@ Everything is in `namespace Nostro`: the OpenSSL helpers in `Nostro::Crypto`, th - `GitProject` with nostro's repository, or `LocalProject({ .projectFile = "/project.cpp", .args = nostroArgs })` for a checkout, into `cfg.dependencies`. `nostroArgs` is your own `ProjectArgs()` plus `--lib` and `--banks=bunq`, built once inside `CrafterBuildProject`: without `--lib` nostro's `project.cpp` returns the CLI executable configuration (with the library as its dependency, which you cannot import from), and without `--banks=` it throws "must enable atleast one bank" and the whole build stops at load. `--banks=` is a comma-separated list and `bunq` is the only name it accepts. - `--dbus` with `--lib` adds the partitions that talk to nostrod, `:Bus`, `:Client` and `:Daemon`, and links `-lsystemd` (sd-bus) for you; it needs bunq on, since the wire carries bunq's types. Without it the library does not depend on libsystemd. `--product=checkout` instead returns the `nostro-checkout` library alone: the module `Nostro.Checkout`, needing neither `--lib` nor `--banks=`, and linking libsystemd and nothing else of nostro's (no OpenSSL, Crafter.Network or Crafter.DB). -- nostro strips its own args (`--lib`, `--banks=`, `--dbus`, `--product=`, `--graphics=`, `--debug-api`, `--coverage`, `--profile-runtime=`) from what it hands its dependencies and forwards the rest, adding `--no-quic` for Crafter.Network: nostro speaks HTTP/1.1 only, and msquic would tie the binary to the building user's cache. A consumer that also loads Crafter.Network gives it that same list, `--no-quic` included, and Crafter.DB the list without it, or the build stops with two loads that disagree on their args. +- nostro strips its own args (`--lib`, `--banks=`, `--dbus`, `--product=`, `--debug-api`, `--coverage`, `--profile-runtime=`) from what it hands its dependencies and forwards the rest, adding `--no-quic` for Crafter.Network: nostro speaks HTTP/1.1 only, and msquic would tie the binary to the building user's cache. A consumer that also loads Crafter.Network gives it that same list, `--no-quic` included, and Crafter.DB the list without it, or the build stops with two loads that disagree on their args. - nostro's `project.cpp` loads two build helpers by `#pragma crafter dependency`, Crafter.LintRules and, at a pinned commit, Crafter.Debug's: loading nostro fetches and builds both for the host, whatever is built of it. Crafter.Debug's library itself is only in nostro's own app, under `--debug-api`. - What comes with it: Crafter.Network (with Crafter.Thread behind it), Crafter.DB, `-lssl -lcrypto`, and with `--dbus` `-lsystemd`, all as link flags you do not declare. Nothing in nostro uses the thread pool, so `ThreadPool::Start()` is not needed for it. - Defines do not cross a dependency. nostro compiles with `NOSTRO_BUNQ_ENABLED`, `NOSTRO_OPENSSL_ENABLED` and, under `--dbus`, `NOSTRO_DBUS_ENABLED`, and the PCMs carry the result: `import Nostro;` exports `BunqConnector` and `Client`, and `EnabledBanks` lists bunq, whatever your configuration defines (nostro's own CLI compiles without them). Your own `#ifdef NOSTRO_BUNQ_ENABLED` sees it only when you push the same `Define` into your `cfg.defines`, as nostro's CLI configuration does with `execfg.defines = libcfg.defines`. diff --git a/AGENTS.template.md b/AGENTS.template.md index e4c19e7..f4384e9 100644 --- a/AGENTS.template.md +++ b/AGENTS.template.md @@ -31,7 +31,7 @@ Five C++26 modules, and a sixth in one build: | `implementations/nostro-app.cpp` | The app's `main`: the command line, the parts put together, the toolkit's gallery (`--gallery`) and a player of input scripts (`--poke`). | | `interfaces/Nostro.DebugCommands.cppm`, `implementations/Nostro.DebugCommands.cpp` | The commands, watches, events and checks of the app's `--debug-api` build; see "Looking at the app". | | `assets/` | Noto Sans Regular and Medium with their licence (`OFL.txt`); the app's build puts the fonts beside the executable. | -| `project.cpp` | The build description: reads `--banks=`, `--lib`, `--dbus`, `--product=`, `--graphics=`, `--debug-api`, `--coverage` and `--profile-runtime=`, forwards the other args to the dependencies (with `--no-quic` for Crafter.Network, except in the app's debug build), returns the product. It names each dependency at a commit ("Dev environment"). It also holds what the app is as a Flatpak (`app.flatpak`) and the `fake` run script. | +| `project.cpp` | The build description: reads `--banks=`, `--lib`, `--dbus`, `--product=`, `--debug-api`, `--coverage` and `--profile-runtime=`, forwards the other args to the dependencies (with `--no-quic` for Crafter.Network, except in the app's debug build), returns the product. It names each dependency at a commit ("Dev environment"). It also holds what the app is as a Flatpak (`app.flatpak`) and the `fake` run script. | | `packaging/dbus/` | The published D-Bus interfaces, `net.catcrafts.Nostro1.xml` and `net.catcrafts.Nostro1.Checkout.xml`. | | `packaging/system/` | What a Flatpak cannot install: the polkit policy, the D-Bus policy and activation files, `nostrod.service`, the sysusers entry, the `nostro` command, `install.sh` and `uninstall.sh`. | | `.forgejo/workflows/flatpak.yaml` | The one workflow: the tests and both aarch64 Flatpaks for a pull request or a run by hand, and for a signed tag `X.Y.Z` their publication; see "Releasing". | @@ -124,16 +124,16 @@ The app end to end: - Which bank an account is with makes no difference outside the settings. No screen there names a bank, or a way to connect to one, in the app's own words: it says "your bank". `ShouldDriveTheApp` fails on a frame that does, excepting what nostrod and the bank say themselves: a note about a connector, a refusal with the call it refused, a link the bank made. What does differ by bank is asked of `:Banks`: a connection that pays between the user's own accounts only, as bunq's through OAuth, is `Connection::ownAccountsOnly`. It is marked Limited, a payment from it to anyone else is saved as a draft, and it cannot pay a request or a shop. - Adding a connection is three pages, from the settings and from the welcome alike: the banks (`add`), the bank's ways (`add:bunq`) and the way's form (`add:bunq:key`). The first two are built from `:Banks`. The form is the bank's own to draw and to check, in a file of the bank's (`Nostro.App-Bunq.cpp`), and its button ends in `App::Connect`, which is every bank's. - **The screens** (`implementations/Nostro.App-Screens.cpp`, and a bank's own forms in that bank's file) are functions from that state to a frame. A window under 600 dp wide shows one page at a time, with the app's places along its bottom; a wider one has them down its left side, and from 900 dp the accounts too. A screen that shows the bank's own state (the accounts, an account, the cards) reads it again four ways, all one action (`Refresher`): Refresh in the bar, F5, Ctrl+R, and the page pulled down at its top. The README's "The app" says what each screen is for. -- **The window** (`Nostro.Ui.Shell`) is one sd-event loop that carries the compositor's connection, nostrod's bus, the desktop portal's bus and the timers. `Window` turns Crafter.Graphics' events into the `Context`'s, bringing time up to each and building a stale frame again first, and does what the `Context` wants afterwards (`Settle`, which the loop calls from a post source after every source that ran). A frame is drawn only when the compositor asks for one after something changed: an idle window draws nothing. `Canvas` turns a `DrawList` into Crafter.Graphics' items, one dispatch per batch, from a pool of buffers per frame in flight. `Portal` reads the desktop's colour scheme and accent, and asks the desktop to open an address. +- **The window** (`Nostro.Ui.Shell`) is one sd-event loop that carries the compositor's connection, nostrod's bus, the desktop portal's bus and the timers. `Window` turns Crafter.Graphics' events into the `Context`'s, bringing time up to each and building a stale frame again first, and does what the `Context` wants afterwards (`Settle`, which the loop calls from a post source after every source that ran). A frame is drawn only when the compositor asks for one after something changed, or when it waits for one itself, having asked for another size (`onFrameOwed`): an idle window draws nothing. `Canvas` turns a `DrawList` into Crafter.Graphics' items, one dispatch per batch, from a pool of buffers per frame in flight. `Portal` reads the desktop's colour scheme and accent, and asks the desktop to open an address. - **`nostro-app`** puts them together, and has what looking at the window without a hand on it takes: `--size`, `--scale` (a phone's density on a desktop's display), `--theme`, `--route`, `--screenshot`, `--poke` and `--gallery`. It makes itself undumpable once the portal has seen it. Closing the window while a change is under way takes the window down and keeps the process until the answer has come. ## Dev environment crafter-build is the only build tool. It compiles with its clang 23 and libc++, `-std=c++26` and `import std;`, and links `-lssl -lcrypto`, and `-lsystemd` for anything with D-Bus in it (libsystemd's `sd-bus.h` and `sd-event.h`; crafter-build's Flatpak SDK has them). nostrod's Flatpak is made by flatpak-builder, the app's by crafter-build itself (`--packaging=flatpak`; `project.cpp` was written against crafter-build 6.3.0), and the aarch64 ones by the two scripts in `packaging/flatpak/`. -- Every dependency `project.cpp` names is at a commit: Crafter.Network (nostro builds it `--no-quic`, so without msquic) and Crafter.DB are `GitProject`s with a `.commit`, and Crafter.LintRules and Crafter.Debug's build helper `#pragma crafter dependency` lines with `commit ""`. crafter-build clones each from `forgejo.catcrafts.net` once and builds from that clone, and the notes at the end of this file are those commits' notes. They were pinned on 2026-11-19, to what the tests had run against that day: a build runs each dependency's own `project.cpp` and links its code into the program that holds every user's bank keys. Moving one forward is a change to `project.cpp`, with the tests run again. -- Two things still follow a branch, so a build still needs the network. Crafter.Thread comes behind Crafter.Network, whose own project file names it without a commit: pinning it is Crafter.Network's to do. And the app's `--debug-api` build takes Crafter.Network without a commit, because Crafter.Debug does: with one library named two ways crafter-build stops with "module Crafter.Network is built twice for nostro-app", as tried on 2026-11-19. -- The app needs a Wayland compositor and a Vulkan device to run, and nothing else of nostro does. No test opens a window. `--product=app` takes `--graphics=` for now: the app asks the input method for a field's purpose and hints (`TextInputPurpose`), which Crafter.Graphics' master does not have. The change is meant for its branch `claude/nostro-app`. On 2026-11-19 neither was on the forge: it was uncommitted work in one local checkout, so the app could be built on that machine and nowhere else, CI included. Once it is pushed, CI finds it by that branch's name; once it is merged, name Crafter.Graphics as a `GitProject` at a pinned commit in `project.cpp` and drop the flag, and the workflow's step that fetches it. +- Every dependency `project.cpp` names is at a commit: Crafter.Network (nostro builds it `--no-quic`, so without msquic), Crafter.DB and, for the app, Crafter.Graphics are `GitProject`s with a `.commit`, and Crafter.LintRules and Crafter.Debug's build helper `#pragma crafter dependency` lines with `commit ""`. crafter-build clones each from `forgejo.catcrafts.net` once and builds from that clone, and the notes at the end of this file are those commits' notes. They were pinned on 2026-11-19, to what the tests had run against that day: a build runs each dependency's own `project.cpp` and links its code into the program that holds every user's bank keys. Moving one forward is a change to `project.cpp`, with the tests run again. Crafter.Graphics was pinned on 2026-11-20, to its master of that day (`a9ce1a0`), the first with the text-input purposes the app asks the input method for. No test opens a window, so moving that one forward is checked by looking ("Looking at the app"): the window at its start, resized by the compositor and by the app, and at a `--scale`. +- Three things still follow a branch, so a build still needs the network. Crafter.Thread comes behind Crafter.Network, whose own project file names it without a commit: pinning it is Crafter.Network's to do. Crafter.Event, Crafter.Math, Crafter.Asset and the Khronos headers come behind Crafter.Graphics in the same way. And the app's `--debug-api` build takes Crafter.Network without a commit, because Crafter.Debug does: with one library named two ways crafter-build stops with "module Crafter.Network is built twice for nostro-app", as tried on 2026-11-19. +- The app needs a Wayland compositor and a Vulkan device to run, and nothing else of nostro does. No test opens a window. Until 2026-11-20 `--product=app` took a checkout of Crafter.Graphics to build against (`--graphics=`), for a change that was not on its master yet. The flag is gone: `project.cpp` passes one it is given on to the dependencies like any arg it does not know. - The app's `--debug-api` build links Crafter.Debug, which talks QUIC: that one build has Crafter.Network with msquic (crafter-build builds it with CMake once, for minutes, and keeps it in its cache), and its binaries carry a runpath into that cache. - Where the connectors live depends on who runs the library. nostrod's worker keeps each user's under `/users//`: `connectors.json`, the transaction tables, `checkouts.cdb`, `checkout-account` and `owner`, with `` from `--state`, else `$XDG_DATA_HOME`, else `$HOME/.local/share`. Installed, that is `/var/lib/nostro/.var/app/net.catcrafts.Nostrod/data/`, readable by the user `nostro` alone. The library used directly reads `connectors.json` from `$XDG_CONFIG_HOME/.config/nostro/` (sic, see "Gotchas") or `$HOME/.config/nostro/`, and keeps the transaction tables under `$XDG_CACHE_HOME/nostro/transactions/` or `$HOME/.cache/nostro/transactions/`. A real connectors file holds a real API key: point every experiment elsewhere. - No test uses the system bus: they run on `tests/Support/FakeBus.inc`. Running anything by hand that talks to `net.catcrafts.Nostro1` reaches the installed nostrod, if there is one, and its dialogs: the CLI, and the app, which reads the accounts as soon as it starts. A Flatpak sandbox with the system bus (`flatpak run`) sets `DBUS_SYSTEM_BUS_ADDRESS` itself, over an `--env` of yours: keep a sandboxed experiment off the bus with `--nosocket=system-bus`. To look at the app, run it on the made-up system, `nostro-fake-system`, which sets that address for what it starts ("Looking at the app"). @@ -147,19 +147,19 @@ crafter-build --banks=bunq --product=daemon # nostrod: bin/nostrod-/n crafter-build --product=checkout # the Nostro.Checkout library alone; no bank needed crafter-build --banks=bunq --lib # the library alone (what a consumer builds), without D-Bus crafter-build --banks=bunq --lib --dbus # the library with :Bus, :Client and :Daemon -crafter-build --banks=bunq --product=app --graphics=/project.cpp # the app: bin/nostro-app-/nostro-app +crafter-build --banks=bunq --product=app # the app: bin/nostro-app-/nostro-app crafter-build --banks=bunq --product=fake-system # nostro-fake-system: a fake bus and a fake bunq with nostrod on them -crafter-build --banks=bunq --product=app --graphics=… --debug-api # the app with Crafter.Debug, the fake system, and build/crafter-debug -crafter-build --banks=bunq --product=app --graphics=… --debug-api run fake [-- ] # that app on the fake system +crafter-build --banks=bunq --product=app --debug-api # the app with Crafter.Debug, the fake system, and build/crafter-debug +crafter-build --banks=bunq --product=app --debug-api run fake [-- ] # that app on the fake system crafter-build --debug --banks=bunq # debug build crafter-build -v --banks=bunq # with the compiler commands crafter-build clean # delete bin/ and build/ crafter-build test --banks=bunq # the tests in tests/, against a fake bunq; none talks to bunq itself tests/coverage.sh [profile runtime] # the tests with coverage: a report per file and every line no test ran crafter-build lint --banks=bunq # the Crafter.LintRules lite rules project.cpp registers, report only -crafter-build lint --banks=bunq --product=app --graphics=… [--debug-api] # the same over the toolkit, the app and its window +crafter-build lint --banks=bunq --product=app [--debug-api] # the same over the toolkit, the app and its window flatpak run --filesystem= org.flatpak.Builder --user --force-clean --repo=/repo --state-dir=/state /build packaging/flatpak/net.catcrafts.Nostrod.yaml -crafter-build --banks=bunq --product=app --graphics=… --packaging=flatpak --march=x86-64-v3 --mtune=generic bundle # the app's Flatpak as one file; `install` installs it for you instead +crafter-build --banks=bunq --product=app --packaging=flatpak --march=x86-64-v3 --mtune=generic bundle # the app's Flatpak as one file; `install` installs it for you instead packaging/flatpak/make-aarch64-sysroot.sh && packaging/flatpak/build-aarch64.sh # both Flatpaks for aarch64, into a repository ``` @@ -181,7 +181,6 @@ The workflow was written on 2026-11-19 and pushed without having run once: its f - A runner, which it has. The `flatpak` runner is the Catcrafts organisation's and serves that organisation's repositories. The repository was first pushed to `jorijnvdgraaf/Nostro`, where no runner would have taken a job, and was moved to `Catcrafts/Nostro` the same day. - The repository public by the time a tag is pushed. The release checks read the forge without a login, as imsd-messages' do, and a private repository answers them with a 404. After the move it was private. - The runner's config has to allow the four volumes `publish` mounts. Three are the ones imsd-messages' job mounts; `crafter-flatpak-nostro-cache` is new. -- Crafter.Graphics' text-input change on the forge, as the branch the workflow's `GRAPHICS_REF` names ("Dev environment"). Until then the app's build fails in the step that fetches it, and with it both jobs. Only aarch64 is published, a phone's architecture. An x86_64 machine builds its own Flatpaks with the commands above, which the README's "Installing" does not say yet. The system files are not in a release either: they come from a checkout (`packaging/system/install.sh`) or the Arch package. @@ -239,7 +238,7 @@ A bug fix comes with a test that fails without it, and states in its commit how What a test cannot show (that the window draws what the frame says, in the right place, on a real display; the pointer, a finger, the keyboard, the input method) is looked at, on a made-up system so that nobody's bank is in it: - `nostro-fake-system` (`--product=fake-system`, `tests/FakeSystem/main.cpp`) is the tests' fake bus and fake bunq with a real nostrod on them: `nostro-fake-system [--dir ] [--port ] [--polkit allow|password|deny|dismiss|absent|silent|slow] [--empty] [--run ]`. It fills the bank with a made-up user (three accounts, three months of payments, three cards of which one is frozen and one virtual, a request sent and one received, a schedule, a draft, and a second connection through OAuth), and runs the program with `DBUS_SYSTEM_BUS_ADDRESS` pointing at the fake bus. `--empty` starts from the welcome and prints the made-up bank's API key; `--polkit` is what every request for a password is answered with; `--bank-delay ` is how long the made-up bank takes over each answer. -- Without a hand on it: `nostro-app --size 420x760 --theme light --route account: --poke "wait:2500;tap:110,200;shot:"` plays input into the window library's own events, so the window's listeners run as for a real pointer, and writes screenshots. Steps are separated by `;` and positions are in dp: `tap:x,y`, `hold:x,y,ms`, `drag:x1,y1,x2,y2,ms`, `move:x,y`, `press:x,y` and `release` (a finger kept down between them), `right:x,y`, `wheel:x,y,detents`, `key:Name`, `text:…`, `preedit:…`, `delete:before,after`, `resize:w,h`, `wait:ms`, `shot:file`. `--scale 3 --size 360x760` draws a phone's screen on a desktop's display. `--gallery widgets|list|text` shows the toolkit's widgets in the app's place and asks nostrod nothing. +- Without a hand on it: `nostro-app --size 420x760 --theme light --route account: --poke "wait:2500;tap:110,200;shot:"` plays input into the window library's own events, so the window's listeners run as for a real pointer, and writes screenshots. Steps are separated by `;` and positions are in dp: `tap:x,y`, `hold:x,y,ms`, `drag:x1,y1,x2,y2,ms`, `move:x,y`, `press:x,y` and `release` (a finger kept down between them), `right:x,y`, `wheel:x,y,detents`, `key:Name`, `text:…`, `preedit:…`, `delete:before,after`, `resize:w,h`, `wait:ms`, `shot:file`. `--scale 3 --size 360x760` draws a phone's screen on a desktop's display. `--gallery widgets|list|text` shows the toolkit's widgets in the app's place and asks nostrod nothing. The player stamps what it plays with the host's clock, and what a real pointer sends carries the compositor's: a pointer that crosses the window while a script runs can make the script's taps miss, as one did on 2026-11-20, so keep it off the window, and read a run that went wrong for a `wl_pointer.enter` (`WAYLAND_DEBUG=1`). - With an agent's hand on it: the `--debug-api` build and `./build/crafter-debug` (the Crafter.Debug notes at the end of this file). `crafter-build … --debug-api run fake [the fake system's options] [-- the app's options]` starts the app on the fake system, in the background since it does not exit. Then: - `get app.screen`, `get ui.texts` (every line the screen shows), `get ui.regions` (what can be pressed, by key, in dp), `get 'window.*'`; - `call Ui_Tap key=account.pay`, `Ui_Type text=…` into the field that has the focus, `Ui_Key key=Tab`, `Ui_LongPress`, `Ui_Focus`, `Ui_TapAt`, `Ui_Drag`, `Ui_Wheel`, `App_Navigate route=cards`, `Ui_Theme scheme=dark`, `Window_Resize width= height=`; @@ -250,7 +249,7 @@ What a test cannot show (that the window draws what the frame says, in the right ## Code style -- `crafter-build lint --banks=bunq` reports nothing, and neither does it with `--product=app --graphics=…`, with `--debug-api` added, and with `--product=fake-system`: the first reaches the library, the CLI and the tests, and only the others the toolkit's, the app's and the window's sources. A finding at a C boundary (`main`'s `argv`, a `char*` an OpenSSL or POSIX call hands out) is suppressed with `// lint-disable-next-line ` and a comment saying why; anything else is fixed. The rules that need an AST cannot parse a file that `#include`s a standard header before `import std;` (the twelve that include `json.hpp`: four in the library, seven tests and the fake system), because the lint's libclang does not find libc++'s headers, so lint exits 1 for those alone until Crafter.Build issue #46 is fixed. Until then, name the headers through the environment and every rule runs on every file: `CPLUS_INCLUDE_PATH=`, which is `/app/include/c++/v1` in crafter-build's Flatpak (`flatpak run --env=CPLUS_INCLUDE_PATH=/app/include/c++/v1 net.catcrafts.CrafterBuild lint …`). Prefer C headers (``, not ``) elsewhere. Tests are linted like the rest. `const-local` sees `bool` and the built-in types, not `std::size_t` or `std::int32_t`: those are made `const` by hand. Lint a product after building it: the AST rules read that product's module files, and against ones from before a change they report nonsense, such as a vector of a type they do not find yet as a local that is never modified. +- `crafter-build lint --banks=bunq` reports nothing, and neither does it with `--product=app`, with `--debug-api` added, and with `--product=fake-system`: the first reaches the library, the CLI and the tests, and only the others the toolkit's, the app's and the window's sources. A finding at a C boundary (`main`'s `argv`, a `char*` an OpenSSL or POSIX call hands out) is suppressed with `// lint-disable-next-line ` and a comment saying why; anything else is fixed. The rules that need an AST cannot parse a file that `#include`s a standard header before `import std;` (the twelve that include `json.hpp`: four in the library, seven tests and the fake system), because the lint's libclang does not find libc++'s headers, so lint exits 1 for those alone until Crafter.Build issue #46 is fixed. Until then, name the headers through the environment and every rule runs on every file: `CPLUS_INCLUDE_PATH=`, which is `/app/include/c++/v1` in crafter-build's Flatpak (`flatpak run --env=CPLUS_INCLUDE_PATH=/app/include/c++/v1 net.catcrafts.CrafterBuild lint …`). Prefer C headers (``, not ``) elsewhere. Tests are linted like the rest. `const-local` sees `bool` and the built-in types, not `std::size_t` or `std::int32_t`: those are made `const` by hand. Lint a product after building it: the AST rules read that product's module files, and against ones from before a change they report nonsense, such as a vector of a type they do not find yet as a local that is never modified. - The first two lines of every source are `// SPDX-License-Identifier: LGPL-3.0-only`, or `GPL-3.0-only` in a source of the app (design rule 13 says which is which), and `// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®`, then a blank line. `project.cpp` carries them too. - Four-space indentation, LF, K&R braces with `} else {`, one declaration per statement. `if(`, `for(`, `while(`, `switch(` without a space in most files (`:Utils` has the space; match the file). Lines run long rather than wrap. - `import std;` everywhere; `#include`s only in a global module fragment (`module;` first), and only for OpenSSL, the vendored `json.hpp`, sd-bus and sd-event, and the POSIX calls of `:File`, `:Connector` and nostrod. `namespace fs = std::filesystem;` where paths appear. @@ -317,7 +316,7 @@ The checklist, from the bunq connector: - A write is never replayed by the transport (fresh connection) and only resent by nostro after a 429, which bunq refuses before acting. An IBAN's check digits are verified before anything is sent. - TLS is Crafter.Network's default `TLSClientCredentials{}`: the chain against the system store and the hostname. Do not reach for `insecureNoServerValidation`. - The private key signs every request body (`SignBody`, RSA SHA-256). Key material lives in `Crypto::Key`s (freed with the last copy) for the process's life; there is no zeroisation. -- `project.cpp` executes the `project.cpp` of each dependency on every build, and the Flatpak build does the same with the network on. Those it names itself are at a commit since 2026-11-19: Crafter.Network, Crafter.DB, Crafter.LintRules and Crafter.Debug's build helper ("Dev environment"). What still follows a branch, fetched from the Catcrafts Forgejo at HEAD: Crafter.Thread, which Crafter.Network names; in the app's build Crafter.Graphics, a checkout given with `--graphics=`, which brings Crafter.Event, Crafter.Math, Crafter.Asset and the Khronos headers, unpinned; and in its debug build Crafter.Debug's library with a Crafter.Network that has msquic in it. Pin those where they are named for a build that is reproducible and offline after the first fetch. +- `project.cpp` executes the `project.cpp` of each dependency on every build, and the Flatpak build does the same with the network on. Those it names itself are at a commit: Crafter.Network, Crafter.DB, Crafter.LintRules and Crafter.Debug's build helper since 2026-11-19, and Crafter.Graphics, for the app, since 2026-11-20 ("Dev environment"). What still follows a branch, fetched at HEAD: Crafter.Thread, which Crafter.Network names; in the app's build what Crafter.Graphics names, which is Crafter.Event, Crafter.Math and Crafter.Asset from the Catcrafts Forgejo and the Khronos headers from GitHub; and in its debug build Crafter.Debug's library with a Crafter.Network that has msquic in it. Pin those where they are named for a build that is reproducible and offline after the first fetch. - `install.sh --repo` installs from an unsigned local repository, for a build of your own, and so does a bundle crafter-build made. A published Flatpak comes from the GPG-signed Catcrafts remote, which is how the README installs both: the remote `catcrafts`, added from `https://flatpak.catcrafts.net/catcrafts.flatpakrepo`, Crafter.Build's own remote. `install.sh` without `--repo` installs from that remote in the system installation, where nostrod runs from, and does not add it itself. On 2026-11-19 the remote did not carry nostro's two Flatpaks yet: the README describes the channel they are to be published on. The two `.flatpakref`s in `packaging/flatpak/` carry the same placeholder for the key as Crafter.Build's, for the publishing side to fill in, which is the workflow's `publish` job. The key it signs with lives on the runner's host and never in the forge, and a release is published only for a tag the owner signed ("Releasing"). - Input from the bank is parsed with nlohmann/json's `at()` and `get()`, which throw on a missing key or a wrong type: a malformed response is an exception, not undefined behaviour. `ParseAmount` and `ParseTimestamp` reject anything outside their grammar. @@ -329,6 +328,7 @@ The state of the code on 2026-11-19; each is a fact to work with. - `crafter-build -r` passes the program it runs no arguments, and the app has a few: that is what the `fake` script is for, and `--poke` with `--screenshot` for a run without a hand on it. - Crafter.Debug counts a frame each time it is given the loop's thread, every 50 ms, whatever the window drew: `wait --frames` measures time there. Wait for the event `FrameRendered` for a frame, and for a condition (`wait 'app.busy == false'`) for an answer: `wait --event AnswerArrived` only hears an answer that comes after it started, and nostrod's has often come by then. - `crafter-debug screenshot -o ` writes inside the client's sandbox, whose `/tmp` is its own: leave `-o` out, for `build/crafter-debug-shots/`, or name a path the sandbox shares with the host. +- A size the compositor asks for (a dragged border, a tile, a phone's on-screen keyboard) is Crafter.Graphics' to take, and it takes it with a frame: the configure only keeps the size and fires `onFrameOwed`, and the next `Render()` makes the window's images again, fires `onResize` from inside itself, and answers the compositor with that frame's buffer. The window draws on demand, so `Shell::Window` asks for that frame from `onFrameOwed`: without it the compositor waits, and the window keeps its old size until something else changes on it. Its `onResize` listener lays the screens out again while that frame is being started, which is why `Canvas::Render` reads its list late. `Canvas::Reconcile` sizes the window only where the library does not, and two of the three reach into the library's own state, to be taken out again once the library does them: the size that comes with a new window, which is the whole screen on a phone (Crafter.Graphics #166; handed over in `deferredLogicalWidth`, where the library's listener keeps every later one), and a scale the display changes to by itself (#165; `RebuildSwapchain`). The third is the app's own size (`--size`, `SetSize`), which goes through `Resize`, in pixels: where dp times the scale is not a whole number the window comes out a dp larger than asked, 421 dp at a scale of 1.85 as 422. Looked at on 2026-11-20 on a desktop, KWin at a scale of 1.85, with the window resized by a KWin script and what the surface was sent read with `WAYLAND_DEBUG=1`. The two that are a phone's, the first size and a scale that comes late, were only tried there with the values put in by hand: on a phone they are still to be looked at. - Crafter.Graphics' text size is the height from the top of the ascenders to the bottom of the descenders, not the em: the design's 16 dp body text is about 11.7 dp of em. `Nostro.Ui`'s sizes are in that measure, and a label drawn beside a larger text shares its baseline only when it is put there (`DialogSheet` does). - Text on a screen cannot be selected: the toolkit has a selection inside a text field and nowhere else. What is worth taking along is copied whole by a press instead: a line of a sheet (`ValueRow`, `copy. for now: the branch claude/nostro-app", graphicsArgName)); - } - Configuration* graphics = LocalProject({ .projectFile = graphicsProject, .args = depArgs }); + // The window library, at the commit the window was last looked at against, like networkCommit above: no test + // opens a window, so moving this one forward is checked by looking (AGENTS.template.md, "Looking at the app"). + // Its own project file names Crafter.Event, Crafter.Math, Crafter.Asset and the Khronos headers without a + // commit, so those still follow their branches. + constexpr std::string_view graphicsCommit = "a9ce1a02e8a9dbc01ef766483fd9bcb4d9470d6c"; + Configuration* graphics = GitProject({ + .source = { .url = "https://forgejo.catcrafts.net/Catcrafts/Crafter.Graphics.git", .commit = std::string(graphicsCommit) }, + .args = depArgs, + }); Configuration* shell = new Configuration(ShellLibrary(args, ui, graphics)); Configuration app; app.path = "./";