# A Forge program on rust-crate/std

One kernel, compiled to Rust (`src/lib.rs`, the Rust member) as the library of a crate that builds on THIS host
with the required cargo and rustc, over Forge's Rust runtime `monogate-sys` (`runtime/monogate-sys`) and the
`libm` crate it wraps (`vendor/libm`) -- both VENDORED into the program, the second pinned by `Cargo.lock`. Every
cargo command runs `--offline --locked`: nothing is fetched or resolved, and every byte compiled is in the
program's identity (`build/dependencies.json`). Its one test is a generated harness (`tests/harness.rs`). `std`:
the crate links Rust's standard library and runs hosted on the machine that ran the commands; nothing here claims
a `no_std` or embedded target. `program.json` names the kernel, the platform specification, the toolchain
requirements and lockfiles, the Python lock (`python.lock`) and the three identities, and carries the evidence
vector. What a machine HAS -- each tool's version and installation fingerprint, under the label
`FORGE_MACHINE_LABEL` gives it -- is recorded in each run's evidence, never in the program's identity.

| command          | dimension    | what a PASS establishes                                          |
|------------------|--------------|------------------------------------------------------------------|
| `make`           | build        | see `program.json` -> `establishes`                              |
| `make run`       | execution    | (`cargo test`: the harness, built afresh, runs every input)      |
| `make check`     | differential | (the Rust member against the exact-real oracle, under its bound) |
| `make reproduce` | --           | (two rebuilds from the recorded inputs; compare identities)      |

The sentence each command's PASS establishes is in `program.json`, copied from the platform
specification; nothing here restates it. Synthesis, timing and hardware are NOT_APPLICABLE on this platform.

THE HARNESS reads words, never decimals: one call per line, each parameter's binary64 bit pattern as 16 hex
digits, and writes one result bit pattern per call (`cargo test --test harness -- INPUTS OUTPUTS`; `harness =
false`, so no libtest captures its stderr). A violated contract prints `EML contract violated: <msg>` on stderr
and calls `std::process::abort()` (SIGABRT, no unwinding) -- the line C writes, in every build profile.

THE BOUND each result is judged against is the kernel's float64 accuracy certificate over its declared box
(`build/contract.json`). The crate links the `libm` crate (a port of musl's libm), not glibc, so a kernel whose
certificate rests on a glibc primitive contract is refused here.

Builds are scrubbed of the build directory (`CARGO_ENCODED_RUSTFLAGS=--remap-path-prefix=<program>=.`), run with
an empty `CARGO_HOME` (no user configuration), every `CARGO_*`, `RUSTC*` and `RUSTUP_TOOLCHAIN` variable removed,
one job at a time. Cargo still reads a `.cargo/config.toml` in any ancestor directory of the program, and rustup's
proxy a `rust-toolchain(.toml)`; the commands do not run (NOT_RUN) when one exists. Inside the program, a file it
does not record (a `build.rs`, say: cargo would compile it) refuses every command.

What this directory is NOT:

- **Not deployable by virtue of passing.** It was built and run on this host; a passing `make check` says
  nothing about another toolchain, target or machine.
- **Not a change to the kernel's status.** The kernel's status in Forge's verification index is shown
  beside this program's evidence and never merged with it.
- **Not a proof.** The differential is evidence about the inputs it ran (recorded in
  `check/inputs.json`), never about all inputs.

This file, the `Makefile`, `Cargo.toml` and `.cargo/config.toml` are SCAFFOLD: conventional glue, tested and
never proved, and never counted toward any verified figure.
