Files
Dario LipicarandClaude Opus 5 b485589b6e refactor(plugins): admit consumers through the shared verb (#42)
* refactor(plugins): admit consumers through the shared verb

Replaces this host's own copy of the isolate/mint/register sequence — a
second, independent implementation of what basecamp also did — with
logos::admitConsumer. Net -14 lines.

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

* chore(deps): move onto logos-protocol 0.8 and logos-plugin-qt master

This is the reason PR #42 was red. logos-plugin-qt#26 made protocol 0.8 a
HARD FLOOR for every consumer of logos-qt-host — cpp/logos_provider_object.cpp
and cpp/qt_provider_object.cpp call TokenManager::saveInboundToken unguarded —
so plugin-qt and protocol move together or not at all. This app was pinned at
plugin-qt 1aa3e31c, which predates #26 and therefore does not ship
cpp/logos_consumer.h, so the admit-consumer commit failed to compile:

  app/mainwindow.h:8:10: fatal error: logos_consumer.h: No such file or directory

  logos-protocol   480f40ff -> 42460e5b  (0.7 -> 0.8, protocol#73)
  logos-plugin-qt  1aa3e31c -> 048152f2  (plugin-qt#26)
  logos-liblogos   b2a9a0ba -> 5c095129  (liblogos#186, NOT MERGED YET)

logos-liblogos is a branch pin, not a master URL, because #186 is the liblogos
half of this same wave and is still open. Retire it for a plain master URL once
that lands.

Two `follows` added on logos-liblogos. They are REDUNDANT TODAY, and that is
stated because it was measured rather than assumed: with the pin above,
liblogos#186's lock already names plugin-qt 048152f2 — this root's rev — so
adding or removing them leaves 3 logos-qt-host derivations and ONE in the
runtime closure, unchanged. The agreement is a coincidence of two locks.

They are kept because they make it a constraint, and because the very next step
breaks it. nix/app.nix:173 copies ${logosLiblogos}/lib/* into this app's lib/
while the binary links logos-qt-host directly. Point this input back at plain
master — which is exactly what retiring the pin does — and liblogos carries its
own plugin-qt again: liblogos master bfbb1998 pins 1aa3e31c, ships a qt-host at
kdz79ljg… against this root's ka5vgzb8…, and the two liblogos_qt_host.so files
differ byte-wise (measured with cmp, differ at byte 41). The app would then LINK
one host runtime and SHIP another in the same directory — the
duplicate-TokenManager defect that builds clean and only shows up at runtime as
refused calls. logos-protocol follows one hop down because logos-qt-host is
compiled against protocol's headers.

Verified by BUILDING every output individually with --print-out-paths on a
24-core x86_64-linux box, 7/7 non-empty:

  packages  default  smoke-test  symbol-gate  symbol-gate-negative
  checks    smoke-test  symbol-gate  symbol-gate-negative

symbol-gate is the measurement that matters, not a formality: it asserts each
runtime type is defined by EXACTLY ONE image, and it passes — as does
symbol-gate-negative, the planted-duplicate control that proves the gate can
still fail.

Closure audit on packages.x86_64-linux.default (373 paths):

  logos-qt-host      1  ka5vgzb8…-logos-qt-host-0.1.0
  logos-protocol     1 derivation at 0.8, 3 outputs (lib, headers, join)

The lib/liblogos_qt_host.so this app ships compares BYTE-IDENTICAL to the one
inside that store path, so the linked host and the shipped host are one image
rather than two that merely agree. logos-view-module-runtime is still unrelocked
and contributes lib/liblogos_view_module_runtime.a; it was checked rather than
assumed — the archive defines ZERO TokenManager symbols, so it carries no second
runtime into the app binary.

NOT covered here: this box builds x86_64-linux only. aarch64-linux, both macOS
systems and the Windows cross-target were not built.

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

* bump

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 22:12:46 -03:00

116 lines
5.1 KiB
Nix

{
description = "Logos Standalone App — generic Qt shell for loading and testing Logos UI plugins";
inputs = {
logos-nix.url = "github:logos-co/logos-nix";
nixpkgs.follows = "logos-nix/nixpkgs";
logos-cpp-sdk.url = "github:logos-co/logos-cpp-sdk";
logos-protocol.url = "github:logos-co/logos-protocol";
logos-plugin-qt.url = "github:logos-co/logos-plugin-qt";
logos-liblogos.url = "github:logos-co/logos-liblogos";
logos-design-system.url = "github:logos-co/logos-design-system";
logos-view-module-runtime.url = "github:logos-co/logos-view-module-runtime";
logos-qt-mcp.url = "github:logos-co/logos-qt-mcp";
};
outputs = { self, nixpkgs, logos-nix, logos-cpp-sdk, logos-protocol, logos-plugin-qt, logos-liblogos, logos-design-system, logos-view-module-runtime, logos-qt-mcp }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
inherit system;
pkgs = import nixpkgs { inherit system; };
logosSdk = logos-cpp-sdk.packages.${system}.default;
logosProtocolPkg = logos-protocol.packages.${system}.default;
logosQtHost = logos-plugin-qt.packages.${system}.logos-qt-host;
logosLiblogos = logos-liblogos.packages.${system}.default;
logosDesignSystem = logos-design-system.packages.${system}.default;
logosViewModuleRuntime = logos-view-module-runtime.packages.${system}.default;
logosQtMcp = logos-qt-mcp.packages.${system}.default;
});
in
{
packages = forAllSystems ({ pkgs, logosSdk, logosProtocolPkg, logosQtHost, logosLiblogos, logosDesignSystem, logosViewModuleRuntime, logosQtMcp, ... }:
let
app = import ./nix/app.nix {
inherit pkgs logosSdk logosProtocolPkg logosQtHost logosLiblogos logosDesignSystem logosViewModuleRuntime logosQtMcp;
src = ./.;
};
in
{
inherit app;
default = app;
# Smoke test: validates binary starts and Qt/libs resolve correctly
smoke-test = import ./nix/smoke-test.nix { inherit pkgs; appPkg = app; };
# One-runtime symbol gate. This app loads THIRD-PARTY plugins
# in-process, so a duplicate TokenManager here surfaces as refused
# calls in someone else's plugin, with no build diagnostic.
symbol-gate = import ./nix/symbol-gate.nix { inherit pkgs; appPkg = app; };
# Negative control, shipped WITH the gate: plants a real duplicate
# definer and asserts the gate rejects it. An absence assertion that
# has never been seen to fail is indistinguishable from a broken one.
symbol-gate-negative = import ./nix/symbol-gate.nix {
inherit pkgs; appPkg = app; negativeControl = true;
};
# MCP server (Node.js) for connecting Claude Code / MCP clients
mcp-server = logos-qt-mcp.packages.${pkgs.system}.mcp-server;
# Full logos-qt-mcp package (includes test-framework, mcp-server, qt-plugin)
# Use: nix build .#logos-qt-mcp -o result-mcp
inherit logosQtMcp;
logos-qt-mcp = logosQtMcp;
}
);
checks = forAllSystems ({ pkgs, system, ... }: {
smoke-test = self.packages.${system}.smoke-test;
symbol-gate = self.packages.${system}.symbol-gate;
symbol-gate-negative = self.packages.${system}.symbol-gate-negative;
});
apps = forAllSystems ({ pkgs, system, ... }:
{
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/logos-standalone-app";
};
}
);
# Reusable test builder for UI plugin integration tests.
# Usage: logos-standalone-app.lib.mkPluginTest { pkgs, pluginPkg, testFile, ... }
lib = forAllSystems ({ pkgs, system, ... }:
let
standaloneApp = self.packages.${system}.default;
logosQtMcp = logos-qt-mcp.packages.${system}.default;
in {
mkPluginTest = import ./nix/mkPluginTest.nix { inherit standaloneApp logosQtMcp; };
}
);
devShells = forAllSystems ({ pkgs, logosSdk, logosProtocolPkg, logosQtHost, logosLiblogos, logosViewModuleRuntime, ... }: {
default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.cmake pkgs.ninja pkgs.pkg-config ];
buildInputs = [
pkgs.qt6.qtbase
pkgs.qt6.qtremoteobjects
pkgs.zstd
pkgs.krb5
pkgs.abseil-cpp
];
shellHook = ''
export LOGOS_CPP_SDK_ROOT="${logosSdk}"
export LOGOS_QT_HOST_ROOT="${logosQtHost}"
export LOGOS_PROTOCOL_ROOT="${logosProtocolPkg}"
export LOGOS_LIBLOGOS_ROOT="${logosLiblogos}"
export LOGOS_VIEW_MODULE_RUNTIME_ROOT="${logosViewModuleRuntime}"
echo "logos-standalone-app dev shell"
'';
};
});
};
}