core(message): Msg model + size-tripwire derive (#114)#137
Merged
Conversation
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.
Card #114. Adds the
Msgmarker trait (bombay-core) carrying a per-slot bytebudget (default 256 B), and
#[derive(Msg)](bombay_macros) which emits theimpl Msgplus a compile-time static-assert that trips whensize_ofof themessage exceeds its budget — making the mailbox's by-value slot-size discipline a
real compile error instead of a silence-able clippy lint.
#[msg(budget = N)]overrides the budget; generics and unions are rejected with spanned errors.
Scope per the card's finalized closed-enum model:
handlestays with #116, thereply port with #115. Does not touch
Mailboxed(arbitrarytype Msgstillcompiles). Path is
::bombay_core(spine not yet behind the umbrella).Tested: native runtime tests (generated impl + override),
parse_budgetunittests (present/absent/non-integer/bare/unknown-key, plus duplicate/negative/
overflow rejection), direct
syn::parse_str::<DeriveMsg>guard tests forgeneric/union rejection, and paired
compile_faildoctests (tripwire fires,boxing fixes it, budget escape, generic/union rejection). Coverage recorded in
docs/testing/coverage-baseline.md; the
Msgtrait's default const is pinned by aunit test (cargo-mutants mutates function bodies only, so it yields no signal for
a trait-const-only module).
Design: docs/superpowers/specs/2026-07-05-msg-model-size-tripwire-design.md