← Back to Pull requests

feat(core)!: add no_std allocation-free command encoding #63

Open
unknown opened this pull request with 207 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 08, 2026 01:10 UTC
Author

Summary

Fixes https://github.com/datdenkikniet/ipmi-rs/issues/8

  • Add no_std support to ipmi-rs-core.

  • Add an allocation-free EncodeIpmiCommand API that writes command data into caller-provided storage.

  • - Keep the existing owned Message and variable-length response APIs behind the alloc feature.
  • Preserve Message::from(command) through a blanket conversion.

  • ~~- Add a borrowed SetLanConfigParametersRef variant.~~
  • Remove avoidable allocations from formatting and parsing helpers.

  • Add CI coverage for a bare-metal thumbv7em-none-eabihf build.
  • Usage

    use ipmi_rs_core::{
        app::GetChannelInfo,
        connection::{Channel, EncodeIpmiCommand},
    };
    
    let command = GetChannelInfo::new(Channel::Current);
    let mut data = [0_u8; 1];
    let request = command.encode_request(&mut data)?;
    
    assert_eq!(request.data(), &[0x0e]);
     

    Use the allocation-free configuration with:

    ipmi-rs-core = { version = "0.6.0", default-features = false }
     

    The existing owned APIs remain available with default features or explicitly with features = ["alloc"].

    Breaking change

    IpmiCommand now extends EncodeIpmiCommand. External command implementations must provide their request NetFn, command byte, encoded length, and
    buffer-writing implementation.

    Verification

    - Tested default, alloc, time, log, all-feature, and no-default-feature configurations.

    Because we're not on 1.x release yet, I figured it's ok to break the library with the EncodeIpmiCommand API. If you'd prefer adding this in a purely non-breaking way, I can.

    Clippy not addressed because #62 addresses it.

    Diff: 207 lines (+155 / -52) across 2 files Reviewer: datdenkikniet Review duration: 85368m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.43) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 207 lines diff across 2 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.319
    Real PR Conversation Timeline
    1 comments
    "Review active on #63"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.4% (MEDIUM) · Higher = larger blast radius
    43.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.9% · Lower = rushed or shallow review
    40.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.6% · Safe to merge
    25.6%