Beispiel
r-efi 5.3.0
Verifiziertes Beispiel für cargo r-efi 5.3.0. Der Vertrag lief auf rust 1 · linux alpine/x64 · docker und bestand: assert Boolean represents UEFI boolean…
sha256:54f8583a136bedfc745ac518292c965920a552b6d159f5994a5ce7485de10a21
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
linux · alpine · musl x64 cargo
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1rust:1-alpine@sha256:a10e64dd139b… |
2026-10-11 |
Fall
HOW- Ziel
- verify pkg:cargo/r-efi@5.3.0
- Pakete
- Erstellt
- 2026-10-11T13:25:04Z
Contract
- assert Boolean represents UEFI boolean with 1-byte size, maps 0 to FALSE and non-zero to TRUE, and compares equal to bool
- assert Status distinguishes SUCCESS, error codes, and warning codes with is_error and is_warning
- assert Status converts into Result<Status, Status> mapping errors to Err and success or warnings to Ok
- assert Guid from_fields and from_bytes correctly encode little-endian UEFI GUIDs and round-trip via as_fields and as_bytes
- assert base UEFI primitive types Char8, Char16, Handle, Event, and Guid match mandated ABI sizes and alignments
Dateien
- Cargo.lock
- Cargo.toml
- NOTES.md
- PROMPT.md
- csx.json
- spec.json
- src/lib.rs
- test/contract.rs
Quelltext
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "r-efi"
version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "sample-r-efi"
version = "1.0.0"
dependencies = [
"r-efi",
]
[package]
name = "sample-r-efi"
version = "1.0.0"
edition = "2021"
publish = false
[dependencies]
r-efi = "=5.3.0"
[[bin]]
name = "contract"
path = "test/contract.rs"
# r-efi 5.3.0 Base Environment and Status/Guid Contracts
## What `search_known_solution` answered
`search_known_solution` returned `NO_SAFE_MATCH` for `pkg:cargo/r-efi@5.3.0`.
## What a model would have written instead
A model might assume UEFI enumerations are native Rust enums rather than constants with type aliases, or assume `Guid` alignment is 8 bytes according to the UEFI specification rather than 4 bytes for EDK2 compatibility. It might also assume `Boolean` is a standard Rust `bool` instead of a 1-byte `repr(C)` wrapper where any non-zero value represents `true`.
## How the wrong version fails
Using Rust enums fails to accommodate reserved vendor ranges. Assuming 8-byte `Guid` alignment produces layout mismatches with EDK2 structures. Assuming `Boolean` is `bool` fails FFI stability because `bool` does not guarantee `u8` binary representation with non-zero true semantics.
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:cargo/r-efi@5.3.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/r-efi@5.3.0
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:5a6e074a878d3a42a0e6b7228ff0b1385b7fd4ed594ab6eea91928d54c7376e2","contract":["assert Boolean represents UEFI boolean with 1-byte size, maps 0 to FALSE and non-zero to TRUE, and compares equal to bool","assert Status distinguishes SUCCESS, error codes, and warning codes with is_error and is_warning","assert Status converts into Result\u003cStatus, Status\u003e mapping errors to Err and success or warnings to Ok","assert Guid from_fields and from_bytes correctly encode little-endian UEFI GUIDs and round-trip via as_fields and as_bytes","assert base UEFI primitive types Char8, Char16, Handle, Event, and Guid match mandated ABI sizes and alignments"],"goal":"verify pkg:cargo/r-efi@5.3.0","kind":"HOW","packages":["pkg:cargo/r-efi@5.3.0"],"schemaVersion":1},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","distro":"alpine","ecosystem":"cargo","libc":"musl","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/r-efi@5.3.0"],"schemaVersion":1,"subject":"pkg:cargo/r-efi@5.3.0","verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify pkg:cargo/r-efi@5.3.0",
"kind": "HOW",
"packages": [
"pkg:cargo/r-efi@5.3.0"
]
}
//! Clean-room verification sample for r-efi.
pub use r_efi::*;
use core::mem::{align_of, size_of};
use r_efi::base::{Boolean, Char8, Char16, Event, Guid, Handle, Status};
use r_efi::efi;
fn main() {
// 1. Boolean represents UEFI boolean with 1-byte size, maps 0 to FALSE and non-zero to TRUE, and compares equal to bool
assert_eq!(size_of::<Boolean>(), 1);
assert_eq!(align_of::<Boolean>(), 1);
assert_eq!(Boolean::FALSE, false);
assert_eq!(Boolean::TRUE, true);
assert_ne!(Boolean::FALSE, Boolean::TRUE);
assert_eq!(Boolean::from(0u8), Boolean::FALSE);
assert_eq!(Boolean::from(1u8), Boolean::TRUE);
assert_eq!(Boolean::from(42u8), Boolean::TRUE);
assert_eq!(bool::from(Boolean::FALSE), false);
assert_eq!(bool::from(Boolean::TRUE), true);
// 2. Status distinguishes SUCCESS, error codes, and warning codes with is_error and is_warning
assert_eq!(Status::SUCCESS.as_usize(), 0);
assert!(!Status::SUCCESS.is_error());
assert!(!Status::SUCCESS.is_warning());
assert!(Status::INVALID_PARAMETER.is_error());
assert!(!Status::INVALID_PARAMETER.is_warning());
assert!(Status::UNSUPPORTED.is_error());
assert!(Status::BUFFER_TOO_SMALL.is_error());
assert!(!Status::WARN_BUFFER_TOO_SMALL.is_error());
assert!(Status::WARN_BUFFER_TOO_SMALL.is_warning());
// 3. Status converts into Result<Status, Status> mapping errors to Err and success or warnings to Ok
let ok_res: Result<Status, Status> = Status::SUCCESS.into();
assert_eq!(ok_res, Ok(Status::SUCCESS));
let warn_res: Result<Status, Status> = Status::WARN_BUFFER_TOO_SMALL.into();
assert_eq!(warn_res, Ok(Status::WARN_BUFFER_TOO_SMALL));
let err_res: Result<Status, Status> = Status::INVALID_PARAMETER.into();
assert_eq!(err_res, Err(Status::INVALID_PARAMETER));
// 4. Guid from_fields and from_bytes correctly encode little-endian UEFI GUIDs and round-trip via as_fields and as_bytes
let fields = (
0x12345678u32,
0xabcd,
0xef01,
0x23,
0x45,
&[0x67, 0x89, 0xab, 0xcd, 0xef, 0x01],
);
let guid_from_f = Guid::from_fields(fields.0, fields.1, fields.2, fields.3, fields.4, fields.5);
let expected_bytes: [u8; 16] = [
0x78, 0x56, 0x34, 0x12, // time_low (LE)
0xcd, 0xab, // time_mid (LE)
0x01, 0xef, // time_hi (LE)
0x23, // clk_seq_hi
0x45, // clk_seq_lo
0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, // node
];
let guid_from_b = Guid::from_bytes(&expected_bytes);
assert_eq!(guid_from_f, guid_from_b);
assert_eq!(guid_from_f.as_bytes(), &expected_bytes);
assert_eq!(guid_from_b.as_fields(), fields);
// 5. Base UEFI primitive types Char8, Char16, Handle, Event, and Guid match mandated ABI sizes and alignments
assert_eq!(size_of::<Char8>(), 1);
assert_eq!(align_of::<Char8>(), 1);
assert_eq!(size_of::<Char16>(), 2);
assert_eq!(align_of::<Char16>(), 2);
assert_eq!(size_of::<Handle>(), size_of::<usize>());
assert_eq!(align_of::<Handle>(), align_of::<usize>());
assert_eq!(size_of::<Event>(), size_of::<usize>());
assert_eq!(align_of::<Event>(), align_of::<usize>());
assert_eq!(size_of::<Guid>(), 16);
assert_eq!(align_of::<Guid>(), 4);
// Flat efi namespace exports
assert_eq!(efi::Status::SUCCESS, Status::SUCCESS);
assert_eq!(efi::Boolean::TRUE, Boolean::TRUE);
println!("All pkg:cargo/r-efi@5.3.0 contract assertions passed successfully.");
}
Ursprungs-Seeder
anonym