Skip to content

[freeze] no_std smoke-test: compile-gate derive macro output for thumbv7em + wasm #304

Description

@joeldsouzax

Why

#279 (PR #303) made the nexus kernel no_std and added two flake gates (nexus-nostd = thumbv7em, nexus-wasm) that build the kernel bare --no-default-features. Those gates prove the core compiles no_std, but they do not exercise two feature paths on a no_std target:

  1. derive — the #[nexus::aggregate] / #[derive(DomainEvent)] macro output. During [freeze][T1] no_std kernel: port nexus to core+alloc (public error bounds are freeze-relevant) — or drop the IoT claim #279 the macro source was only grepped for std:: (weak); nothing actually compiles generated code for a no_std target. This is the real downstream use case — Bombay-SDK chore(events): release v0.1.1 #7 ("KERI on phone") uses the derive macros on the no_std kernel. If a macro ever emits a std:: path, a no_std consumer breaks and we only find out downstream.
  2. testing — the fixture's alloc::vec::Vec path on no_std+alloc is ungated.

Freeze-relevant: the derive-on-no_std guarantee is what the IoT/embedded README claim actually rests on.

What

  • Add a minimal #![no_std] compile smoke-test crate (pure core, Events<E, 0> so no allocator needed) that defines an aggregate using BOTH #[nexus::aggregate] and #[derive(DomainEvent)], plus a Handle impl.
  • Wire it into the nexus-nostd + nexus-wasm flake gates (build --no-default-features --features derive for both targets). If the macro output isn't core-clean, it fails to compile for thumbv7em.
  • Optionally a second tiny target that builds the testing fixture no_std+alloc (needs a #[global_allocator] or an alloc-providing target) to gate path Versioning #2.

This is the standard way to test a no_std lib: compile-for-target with the real public API + macros; run logic on the host (already covered by nextest on std).

Acceptance

  • a #![no_std] crate using the derive macros compiles for thumbv7em-none-eabihf + wasm32-unknown-unknown under nix flake check
  • gate fails if a macro emits a std:: path

From #279 / PR #303 review (2026-07-06).

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-freezePre-1.0 API-freeze hardening (breaking-to-change-later)area: kernelnexus crate (aggregate/saga/events)

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions