Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,40 @@ jobs:
# abigail-tools provides abidw/abidiff for the ABI drift gate (below).
run: sudo apt-get update && sudo apt-get install -y xvfb ccache ninja-build zstd abigail-tools

- name: Install wasi-sdk 27
shell: bash
run: |
set -euo pipefail
version="27.0"
archive="${RUNNER_TEMP}/wasi-sdk-${version}.tar.gz"
install_dir="${RUNNER_TEMP}/wasi-sdk-${version}"
url="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-27/wasi-sdk-${version}-x86_64-linux.tar.gz"

curl -fsSL --retry 5 --retry-all-errors "${url}" -o "${archive}"
mkdir -p "${install_dir}"
tar -xzf "${archive}" --strip-components=1 -C "${install_dir}"
echo "PJ_WASI_SDK_ROOT=${install_dir}" >> "${GITHUB_ENV}"
"${install_dir}/bin/clang++" --version

- name: Install Wasmer C API 7.0.1
shell: bash
run: |
set -euo pipefail
version="7.0.1"
archive="${RUNNER_TEMP}/wasmer-${version}.tar.gz"
install_dir="${RUNNER_TEMP}/wasmer-${version}"
url="https://github.com/wasmerio/wasmer/releases/download/v${version}/wasmer-linux-amd64.tar.gz"

curl -fsSL --retry 5 --retry-all-errors "${url}" -o "${archive}"
mkdir -p "${install_dir}"
tar -xzf "${archive}" -C "${install_dir}"
test -f "${install_dir}/include/wasm.h"
test -f "${install_dir}/include/wasmer.h"
test -f "${install_dir}/lib/libwasmer.a"
nm -g --defined-only "${install_dir}/lib/libwasmer.a" > "${RUNNER_TEMP}/wasmer-symbols.txt"
grep -q wasmer_metering_set_remaining_points "${RUNNER_TEMP}/wasmer-symbols.txt"
echo "PJ_WASMER_ROOT=${install_dir}" >> "${GITHUB_ENV}"

- name: Configure ccache
# Compiler-output cache for our own C++ — complementary to the Conan
# cache (which holds prebuilt third-party packages, not our objects).
Expand Down Expand Up @@ -207,11 +241,21 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DPJ_WASI_SDK_ROOT=${PJ_WASI_SDK_ROOT}
-DPJ_WASMER_ROOT=${PJ_WASMER_ROOT}
-DPJ_ENABLE_ABI_CHECK=ON

- name: Build
run: cmake --build build

- name: WASI parser-module conformance
run: |
cmake --build build --target parser_module_wasm_conformance_fixture
ctest --test-dir build -L wasi --output-on-failure

- name: Wasmer parser-module execution
run: ctest --test-dir build -L wasmer --output-on-failure

- name: ABI drift gate
# Mechanically enforces the Release Versioning policy (CLAUDE.md): a non-MAJOR
# change must not break ABI. Diffs the mock_data_source_plugin canary DSO against
Expand Down
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,60 @@
All notable changes to `plotjuggler_sdk` are recorded here. Versioning policy is in
[`CLAUDE.md`](./CLAUDE.md) → "Release Versioning".

## [0.23.0]

### Feature: sandboxed wasm parser modules and authoring preset (MINOR)

Functional parser modules can now be validated, compiled once, and executed as
WASI reactors through the pinned Wasmer 7.0.1 C API:

- The wasm loader admits only reactors with the frozen operational signatures,
`_initialize`, exactly one manifest section, bounded exported memory, no
start function, and the v1 empty import allow-list.
- Store-per-instance execution copies ABI blocks through guest allocation,
revalidates linear-memory ranges after every guest call, preserves host
payload splice semantics, and classifies traps or metering exhaustion as
contract violations.
- Instruction metering, declared-memory caps, and pure session admission
budgets bound calls, artifact size, modules, claims, instances, and aggregate
declared memory. Adversarial trap, infinite-loop, memory-growth, and
quarantine-replay fixtures pin the failure behavior.
- The installed `pj-wasm-embed-manifest` frontend embeds or verifies exact
manifest bytes and performs the shared static ABI audit.
- `pj_add_parser_module(... TARGETS wasm)` provides the wasi-sdk 27 C++17
reactor preset, manifest embedding, and post-link audit; `TARGETS native wasm`
emits both artifacts from one author source.

The wasm execution libraries remain optional when `PJ_WASMER_ROOT` is unset.

## [0.22.0]

### Feature: extensible parser routing and functional parser modules (MINOR)

Parser selection can now be described, resolved, and executed through stable,
additive SDK contracts:

- The new `pj.parser_route_claims.v1` extension reports exact scalar/object
handler claims, while `pj.parser_functional.v2` adds the object splice sink
without changing the frozen v1 declarations.
- The parser-module ABI defines lifecycle exports, little-endian binding/input/
output codecs, canonical-object splice eligibility, and native or wasm
manifest delivery.
- The host claim catalog validates module manifests and synthesized plugin
claims. Its deterministic resolver applies exact/wildcard, provenance,
priority, pin, probe-cache, and fail-closed selection policy.
- The native loader and per-instance runtime validate exports, lifecycle
results, descriptors, and splices, with contract-strike quarantine and
session-disable behavior.
- The standalone header-only C++17 authoring kit provides bounded CDR/protobuf
readers and field locators, time normalization, canonical PointCloud/Image
output builders, and the complete native functional-module export wrapper.
- A shared wasm custom-section codec embeds exact manifest bytes. The wasi-sdk
27 compile gate statically audits reactor exports and their frozen wasm
signatures, manifest delivery, and absence of native-only metadata exports.

All additions preserve the existing plugin ABI and protocol versions.

## [0.21.0]

### Fix: convenience registerService honors its documented assertion (PATCH)
Expand Down
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ two modules below have no own CLAUDE.md.
PointCloud, CompressedPointCloud, OccupancyGrid(+Update), Mesh3D, VideoFrame,
SceneEntities, RobotDescription, CameraInfo, Log, ImageAnnotations, FrameTransforms, PosesInFrame, VoxelGrid) and their 15
wire codecs (RobotDescription carries source text as-is — no codec), the C-ABI protocol headers for
DataSource/MessageParser/Toolbox + the C++ SDK base classes / host-view helpers built on them.
DataSource/MessageParser/Toolbox + the C++ SDK base classes / host-view helpers built on them, the
standalone C++17 functional parser-module authoring kit (`pj_base/parser_module/`), and the host-side
wasm parser-module manifest custom-section codec.
- **pj_plugins** — host-side loaders + RAII handles + plugin **discovery** (directory scan +
embedded-manifest inspection) for four plugin families (DataSource, MessageParser, Dialog, Toolbox),
parser claim admission/resolution and native functional parser-module execution,
config-envelope helpers, and the **dialog C ABI** (`pj_plugins/dialog_protocol/`). The
duplicate-resolution *catalog* (which copy wins by priority/version/compatibility) is host policy
and lives in the app (`pj_runtime`), built on these discovery primitives. Note the split: the DataSource/MessageParser/Toolbox C-ABI
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(GNUInstallDirs) # CMAKE_INSTALL_LIBDIR, etc. used by PjPluginManifest
include(PjPluginManifest)
include(PjParserModule)

# ---------------------------------------------------------------------------
# Options
Expand Down Expand Up @@ -104,6 +105,8 @@ find_package(FastFloat REQUIRED)
# Modules
# ---------------------------------------------------------------------------

set(PJ_SDK_WITH_WASMER OFF)

if(PJ_BUILD_TESTS)
enable_testing()
endif()
Expand All @@ -122,6 +125,7 @@ endif()
# Exported CMake namespace: plotjuggler_sdk::
# Components:
# base — vocabulary types (always available)
# parser_module — standalone header-only functional module authoring kit
# plugin_sdk — plugin-author surface: base + dialog SDK + parser SDK
# plugin_host — host-side loaders (data_source, message_parser, toolbox,
# dialog, catalogs)
Expand Down Expand Up @@ -153,6 +157,8 @@ if(PJ_INSTALL_SDK)
"${CMAKE_CURRENT_BINARY_DIR}/plotjuggler_sdkConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/plotjuggler_sdkConfigVersion.cmake"
cmake/PjPluginManifest.cmake
cmake/PjParserModule.cmake
cmake/parser_module_wasi_no_io_stubs.cpp
DESTINATION ${PJ_PACKAGE_CMAKE_DIR}
)
endif()
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.21.0
0.23.0
Loading
Loading