feat(nexus)!: port kernel to no_std (core+alloc) (#279)#303
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ack (#279) Turns off thiserror default features at the workspace (workspace inheritance cannot override default-features), re-enabling `std` on the three std crates (store/fjall/postgres) and via nexus's new additive `std` default feature. Excludes `nexus` from workspace-hack (hakari final-excludes) so no std leaks into the no_std kernel build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…or (#279) Adds `#![cfg_attr(not(feature = "std"), no_std)]`; production kernel is pure `core` (no allocator), with `alloc` pulled in only under `test`/`testing`. Swaps `std::` -> `core::` in aggregate/message/id/version. The public `Aggregate::Error: core::error::Error` bound is the freeze-relevant change. Verified: builds `--no-default-features` for thumbv7em-none-eabihf (strong, std-free) and wasm32-unknown-unknown; std + all-features unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds nexus-nostd (thumbv7em-none-eabihf, the std-free strong gate) and nexus-wasm (wasm32-unknown-unknown) as `nix flake check` derivations, so CI stays "just run nix flake check". Both build --no-default-features. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 tasks
Contributor
Author
|
Follow-up filed: #304 — a no_std compile smoke-test that gates the derive macro output ( |
#279) Task 3 dropped the workspace-hack edge from nexus and hakari added thiserror to workspace-hack; Cargo.lock must reflect both or CI's --locked build fails. (Local gate passed against the dirty tree; the committed tree was stale.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 tasks
joeldsouzax
added a commit
that referenced
this pull request
Jul 8, 2026
#279 (PR #303) made the kernel no_std and added flake gates that build it `--no-default-features` for thumbv7em + wasm32. Those prove the *core* is no_std, but never compile the *output* of `#[nexus::aggregate]` / `#[derive(DomainEvent)]` for a no_std target — the macro source was only grepped for `std::`, which is weak. Add `nexus-nostd-smoketest`: a `#![no_std]` crate defining an aggregate via both macros + `Handle` impls, entirely in `core` (`Events<E, 0>`, no allocator). Both flake gates now also build it `--features derive` for thumbv7em + wasm32, so a macro emitting a `std::` path fails the bare-metal build. The probe lives behind the `derive` feature; `nexus`/`thiserror` are optional and pulled only by it (`nexus/derive` is additive, not `nexus/std`). Excluded from workspace-hack (like `nexus`) so no std edge reaches the bare-metal build. Logic correctness stays covered on the host by the nexus-cross-crate-test suite — this is a compile probe. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #279.
Ports
crates/nexustono_stdbehind an additivestddefault feature, and moves public error bounds fromstd::error::Errortocore::error::Error(freeze-relevant — breaking to change after 1.0).What
#![cfg_attr(not(feature = "std"), no_std)]; the production kernel is purecore(no allocator), withallocpulled in only undertest/testing.std::→core::inaggregate.rs,message.rs,id.rs,version.rs. TheAggregate::Error: core::error::Errorbound is the freeze-relevant change.thiserrormade no_std at the workspace (default-features = false); the three std crates (store/fjall/postgres) opt back in viafeatures = ["std"]. Workspace dependency inheritance cannot overridedefault-features, hence the per-crate opt-in.nexusexcluded fromworkspace-hack(hakarifinal-excludes) so its std deps can't leak into the kernel build.wasm32-unknown-unknown+thumbv7em-none-eabihf; twonix flake checkgates (nexus-wasm,nexus-nostd) build the kernel--no-default-featuresfor both.thumbv7emis the strong, std-free gate.Verification
nix flake checkgreen, now includingnexus-wasm ✅andnexus-nostd ✅.thumbv7embuild went RED → GREEN (wascan't find crate for std).testingbuilds unchanged.Scope
Kernel only. Full store no_std is tracked as pre-freeze follow-ups #300 (extract
nexus-wake) → #301 (store no_std + error bounds) → #302 (no_stdWakeSourcebridge).Design + plan:
docs/superpowers/specs/2026-07-06-no-std-kernel-design.md,docs/superpowers/plans/2026-07-06-no-std-kernel.md.🤖 Generated with Claude Code