The Std surface — std-typed signatures over a QVariant + LogosAPIClient
body — no longer had a caller. `interface: "universal"` modules moved to
`lp` (std types over the Qt-free logos-protocol C ABI), and nothing else
ever selected it, so every Std branch was dead weight sitting in front of
the two live ones.
`--api-style=std` is now rejected with a message naming the retirement
rather than aliased to `qt`. A stale caller that still passes it wants
std signatures; handing it the Qt surface would fail later, further from
the cause.
The collapse is deliberate about the branches where Std was tested BEFORE
Qt, since a naive "delete the block containing ApiStyle::Std" changes Qt
output:
- makeHeader's include block tested Std first, so its `else` is the Qt
include list — the Qt includes are kept and promoted, not deleted.
- recordToWireExpr / recordFromWireExpr returned the Qt map form from a
guarded `if` and the Std form from the function's trailing `return`.
The guard is dropped and the Qt form promoted to the tail; deleting
only the trailing return would have left a path falling off the end.
- The private-member `else if (!events.isEmpty())` arm reads as an event
test but was Std-only; the Qt arm (m_eventReplica + m_eventSource)
survives, so setEventSource/trigger still have their storage.
- `if (apiStyle == Qt || !events.isEmpty())` is a disjunction, not an
Std branch: it unwraps to an unconditional emit, keeping
ensureReplica()'s declaration next to its definition.
- `isRec || style == Std` loses only the right disjunct — dropping
`isRec ||` would double-wrap record fields in QVariant::fromValue.
mapParamTypeStd / mapReturnTypeStd / isStdRefType stay: they are the
shared std type table that ApiStyle::Lp reaches through the non-Qt arm of
paramTypeFor / returnTypeFor / byRefFor and directly from lpPushExpr /
lpFromJsonExpr.
Verified by output equivalence rather than by the build succeeding: the
generator was run over 13 fixture cases (the full_api contract as both a
bound interface and a baked dep, three record-bearing contracts incl.
map-of-record fields, the chat module's production contract, and a
no-events contract) for both qt and lp, before and after. `diff -r` over
the 194 resulting files reports no differences, and the experimental
--lidl backends are byte-identical too. Test suite: 180/180, unchanged.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* Add per-event documentation + getPluginEvents introspection
Mirror the per-method documentation pipeline for events. Events
(declared in a universal module's logos_events: section) now carry a
description parsed from their /// doc comments, and are introspectable
at runtime via a new getPluginEvents framework call.
- lidl_ast: EventDecl gains a description field.
- impl_header_parser: capture the event's doc comment (previously
discarded) and an optional metadata.json events[].description.
- lidl_gen_provider: generated universal provider emits
getEvents() override, mirroring getMethods() (name/signature/
parameters/description; no returnType/isInvokable — events are void).
- logos_provider_object: default-empty virtual getEvents() so the
legacy provider path and QtProviderObject inherit empty.
- module_proxy / qt_provider_object: intercept getPluginEvents next to
the getPluginMethods special-case.
- docs: spec + README event-documentation notes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add unit tests for event documentation + getEvents generation
Address review feedback (#71): cover the event-introspection paths that
previously only had method-side tests.
- impl_header_parser test: assert metadata.json events[].description is
parsed; new documented_events fixture asserts `///` doc-comment
capture on a logos_events: block (multi-line joined with \n,
adjacent-only, plain // ignored).
- lidl_gen_provider test: assert the generated dispatch contains
getEvents() emitting each event's name/signature/parameters and an
escaped description, and that events carry no returnType/isInvokable.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Fold event introspection into getMethods() to keep the provider ABI stable
The previous approach added a getEvents() virtual to LogosProviderObject,
which inserted a new vtable slot and shifted every later slot — an ABI
break that would misdispatch virtual calls whenever an old and new
host/module were mixed across the in-process plugin boundary.
Instead, report events INSIDE the existing getMethods() call: it now
returns the module's whole interface, with each entry tagged
type "method" or "event" (events omit returnType/isInvokable). The
provider vtable is therefore byte-for-byte unchanged, so old/new hosts
and modules stay binary-compatible — a new host reading an old module
sees no event entries (zero events), and an old host reading a new
module just ignores the "type" field (cosmetic). An entry with no
"type" is treated as a method.
- logos_provider_object.h: remove the getEvents() virtual; document that
getMethods() carries both, and why.
- generator (lidl_gen_provider): emit events as type "event" entries
inside getMethods(); tag methods type "method"; no getEvents() output.
- module_proxy / qt_provider_object: getPluginMethods()/getPluginEvents()
are now type-filtered views of getMethods(), plus a new
getPluginInterface() returning the whole list. (These are name-
dispatched Q_INVOKABLEs, not vtable surface — adding them is safe.)
- tests: generator asserts events fold into getMethods() tagged "event";
ModuleProxy asserts the three filtered views; parser tests unchanged.
- docs: spec/project/docs/README updated, incl. an ABI rationale note.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* parse adjacent method comments to populate description
* preserve line breaks in method descriptions
Join doc-comment lines with newlines instead of spaces (markers stripped,
leading/trailing blank lines dropped, interior blanks kept), and escape \n
when emitting the description into the generated getMethods(). Both codegen
paths updated; docs corrected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* don't count braces inside comment lines (impl-header parser)
A brace in a doc/line comment (e.g. `/// returns { ... }`) no longer affects
class-scope tracking, which previously could make the parser think the class
ended early and drop later declarations. Addresses review feedback on #70.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>