Expand description
bvisor-core — platform-agnostic boundary contract.
ZERO OS code, ZERO BatPak writes in the Backend trait.
bvisor is a sync-first boundary supervisor. The Boundary Adapter Layer (BAL,
prose only) lowers admitted Capabilitys + HostControls from a
BoundaryPlan into honest platform Backends; the BoundaryRunner
SEALS a BoundaryReport and the host PERSISTS it into BatPak.
The loop (sealing ownership made precise):
BoundarySpec asks (Capabilities + HostControls + workload)
BoundaryPlanner admits → BoundaryPlan (inert IR, bound to backend + machine profile; fail-closed)
Backend OBSERVES → BoundaryReportBody (unsealed facts; no hashing, no BatPak)
BoundaryRunner SEALS → BoundaryReport (canonicalize + body_hash) [SEALED ≠ persisted]
Host PERSISTS → appends 0xE event into BatPak [now durable; replay reconstructs]C0 scope: the pure contract + a fail-closed planner + the honest
InertBackend. No real OS backends, no SimBackend, no host wiring yet.
Modules§
- linux
- Linux backend — landlock + cgroup-v2 + launcher-process confinement.
- macos
- macOS backend — Seatbelt (
sandbox_init) confinement (scaffolding). - wasm
- Wasm backend — wasmi + WASI-preopen confinement.
- windows
- Windows backend — AppContainer + Job Object confinement (scaffolding).
Structs§
- Admission
Inputs - The normalized, immutable admission inputs —
(S,P,V,L,Q,B)reduced to the membrane-relevant encoded form. Probed and normalized ONCE; fed to both paths. - Admission
Program - A bounded, canonical admission decision circuit. Constructing one proves the canonical-topological invariant (operands reference strictly-earlier nodes, arity matches the op); deeper acceptance — vocabulary closure, width/arity typing, structural limits, canonical re-encoding — is the independent validator’s contract (step 3).
- Admission
Program Hash - Canonical content hash of an
crate::contract::admission::AdmissionProgram(H_A) — the digest of the bounded, validated admission circuit. - Admission
Shape - The shape of a full admission instance — how many requirements / budget dimensions and the per-aspect lane widths the compiled circuit reads.
- Admitted
Budget - One dimension’s ADMITTED contract.
- Admitted
Budgets - The complete admitted budget
B_Abound into aBoundaryPlan. - Admitted
Requirement - One admitted requirement with its verdict and the ACTUAL mechanism chosen.
- Artifact
Fix - An interrupted disposition the host must finish idempotently before the
boundary is settled (re-promote / re-discard the artifact, then record the
Appliedphase). - Artifact
Id - Lifecycle identity of one artifact OCCURRENCE.
- Artifact
Reality - What the host INDEPENDENTLY observes about one artifact’s bytes on
open(). - Attempt
Id - Opaque identity of ONE attempt to run a plan.
- Backend
Id - Stable identity of a backend FAMILY (
"inert","linux","wasm", …). - Backend
Profile - TYPED planning view, derived DETERMINISTICALLY from a raw snapshot. The planner consults THIS, never the map.
- Backend
Profile Hash - Canonical hash of a
crate::BackendProfileSnapshot. - Backend
Profile Snapshot - RAW probe facts — portable, string-ish, persisted in the plan + report for AUDIT/REPLAY ONLY. NEVER consulted directly at admission.
- Backend
Registry - Holds the registered backends, keyed by
BackendId. - Boundary
- A boundary in lifecycle state
S. NOTClone/Copy: transitions moveself, so a consumed state cannot be reused (a retry mints a new attempt). - Boundary
Disposition Event - 0xE/0x004 — a post-report artifact disposition decision/result, appended by the host.
- Boundary
Plan - Admitted authority + controls. INERT typed data — not bytecode/executable. Bound to ONE backend AND the machine profile it was admitted against.
- Boundary
Plan Hash - Canonical content hash of a
crate::BoundaryPlan(itsplan_id). - Boundary
Planner - Admits a
BoundarySpecagainst a chosen backend, FAIL-CLOSED. - Boundary
Recovery Event - 0xE/0x003 — a typed, replayable startup-reconciliation verdict.
- Boundary
Report - SEALED = canonicalized + body_hash. NOT persisted; the host appends it (0xE).
- Boundary
Report Body - OBSERVED facts, unsealed. Returned by
crate::Backend::execute. - Boundary
Report Event - 0xE/0x002 — a sealed
BoundaryReport, appended by the host. - Boundary
Report Hash - Canonical
body_hashover acrate::BoundaryReportBody. - Boundary
Run - A driven boundary run: pumped one
RunStepat a time. - Boundary
Runner - Executes a plan via its bound backend, then SEALS the observed body.
- Boundary
Spec - The caller’s request: authority + controls + workload + budgets + evidence.
- Boundary
Started Event - 0xE/0x001 — a sealed
BoundaryPlan, durably appended by the host AT RUN-START (gated toDurablebefore the backend executes). - Budget
Availability - One dimension’s PROFILE:
P_d = (available, actual-guarantee, available-evidence, mechanism). Probed and declared by the backend. - Budget
Inputs - One budget dimension’s full admission inputs (the per-dimension
Bslice): the request(limit, derived-minimum, guarantee, evidence)vs the backend’s availability(available, guarantee, evidence). The membrane passes the dimension iffD ≤ L ∧ L ≤ A ∧ G_req ≤ G_avail ∧ E_req ⊆ E_avail(the two-phase admission ofcrate::contract::budget, flattened to a single pass bit here — the per-dimension reason selector is a later step). - Budget
Profile - The complete profile
B_P— seven dimensions of host capability. - Budget
Refusal - A budget refusal: the first failing dimension and its reason.
- Budget
Request - One dimension’s REQUEST:
R_d = (limit, min-guarantee, required-evidence). - Budget
Requirements - The complete request
B_R— seven branded, fixed-unit dimensions.ProcessCountandHandleCountcarryu32-valued counts in theirlimit; the rest carry theu64unit named on the field. - Budget
Witness - One dimension’s execution witness:
W_d = (L, G, E, M, O, R, F). - Budget
Witnesses - The seven execution witnesses the report carries — one per fixed budget dimension, in canonical order, with FIXED observed-usage semantics (per field).
- Canonical
Policy - The canonical normal form of one capability POLICY: a family tag, a variant
discriminant, and the normalized (sorted + deduplicated) payload. Two values
are
==iff the policies they were normalized from are SEMANTICALLY IDENTICAL (modulo syntactic list ordering). The wrapped bytes ARE the canonical form; equality is byte equality, so the §2 law reduces to a byte comparison. - Capture
Refs - References to captured standard streams (not the bytes themselves).
- Cert
Node - One node’s entry in a
ProgramCertificate. - Circuit
Builder - Builds an
AdmissionProgramby appending nodes in canonical order. Every constructor returns theNodeIdof the node just appended; because nodes are only ever appended, operands always reference strictly-earlier nodes — the canonical-topological invariant holds by construction. - Content
Hash - blake3 content hash of an artifact’s bytes — its BYTE identity.
- Decision
- The decision
Eproduces: the admission bit, the first-failed-membrane refusal code (meaningful whenadmitisfalse), and the per-membrane pass/fail bits. - Denied
Attempt - An attempt the boundary blocked.
- Derived
Minimums - The cross-dimensional derived structural minimums
DerivedMinimum_d(S,L)— the floor each dimension’s limit must meet (e.g. a native launch ⇒process ≥ 1). - Disposition
State - The folded disposition state of one artifact (from its 0x004 phases).
- EnvEntry
- One admitted environment binding: a variable
nameand where its value comes from (EnvSource). The value is NEVER ambient — it is a literal or a lease ref. - Evidence
Requirements - What evidence the caller requires the report to carry. Minimal in C0.
- Evidence
Set - A set of
EvidenceClaims — the evidence a backend can produce (the “available” set) or a caller requires (the “required” set). - Inert
Backend - The honest no-confinement reference backend.
- Input
Decl - A declared input lane.
- Input
Slot - Index of a declared input lane, referenced by
NodeOp::Input. - Lane
- A value lane: a sequence of bits, least-significant bit first. Its length is the lane’s bit width.
- Lookup
Table - A frozen lookup table for
NodeOp::BoundedLookup: the index operand selects one entry. Bounded —entries.len()and each entry’s length are structurally limited. - Lowering
Schedule - A validated, ordered, canonical schedule of primitives to lower.
- MapSecret
Resolver - An explicit in-memory
SecretResolverfor tests + simple host wiring: a fixedref-id → valuetable. An unknown ref fails closed withSecretResolveError::Unknown. NOT a production secret store (it holds values in process memory); it exercises the JIT-resolve + fail-closed contract. - Mechanism
Digest - A
blake3digest of a backend’s MECHANISM string for a requirement key (§1’sH_M). The coupling law binds a productionEnforcedclaim to aProvenledger row ONLY when the row’s digest matches the digest of the mechanism the backend would actually use — so a backend cannot satisfy the gate by swapping in a different (unproven) mechanism under the same key. - NetDest
- A single allow-listed network destination (host + port), inert evidence.
- Node
- One circuit node: an op, its operand edges, and its declared output width.
- NodeId
- Index of a node within an
AdmissionProgram’s canonical node array. - Observed
Fact - A fact the backend OBSERVED about what actually happened.
- Outputs
- The program’s declared outputs (plan §2): the admission bit, a refusal-code lane (the first-failed membrane index), and one pass/fail bit per membrane.
- PathSet
- A declared set of filesystem roots a
Capability::Filesystemis scoped to. - Planned
- An admitted, machine-bound plan. The next legal move is
Boundary::start. - Planner
Inputs - The normalized inputs for the current planner contract — produced by a single probe/classify pass and fed byte-for-byte to both the imperative reference and the shadow circuit.
- Primitive
Decl Inputs - One declared primitive in the membrane’s bounded universe (its position in
ScheduleInputs::declarationsis its indexp ∈ 0..N). This is the TRUSTED declaration the schedule is checked against — the planner authenticated it, and a slot’s claimed digest must reproducedecl_digest/param_digestexactly. - Primitive
Id - Stable identity of a
ConfinePrimitivewithin a backend’s primitive set. - Primitive
Version - A primitive declaration’s revision, paired with
PrimitiveIdto bind a schedule entry to the EXACT declaration it was compiled from. - Privilege
- A privilege a primitive requires in order to lower.
- Profile
Facts - The concrete, TYPED machine facts a
ProfileFlooris checked against — the probe truths a backend derives once at construction (the live landlock ABI, and whether the kernel exposes atomiccgroup.kill/ thepids.peakwitness). - Profile
Floor - The MINIMUM machine facts a qualification covers (§3 PROFILE-CLASS): the floor
predicate a production profile must DOMINATE (
p_prod ⊒ floor) for aProvenreceipt earned at the floor to transfer to it. - Program
Certificate - The frozen proof certificate the compiler
Cemits and the independent validator re-checks (plan §3): the canonical per-node levels/widths/edges, the counts, the total bit-depth, and the digest. The validator recomputes every field rather than trusting it. - Program
Limits - The structural bounds: a widest-lane cap, a polynomial node bound, and a logarithmic depth bound.
- Proof
Receipt - Archived evidence that the QF_BV qualification gate ran and PASSED for a specific
circuit (identified by the canonical SMT input digest). Retained as gate evidence;
a release that treats the circuit as authority must carry a receipt whose
smt_digestmatches the current circuit and whose verdicts are all correct. - Qualification
Row - One committed row of the qualification LEDGER (§1
Qualification(p,k)joined to its profile-class + mechanism digest + proof receipt). The ledger is the REPOSITORY’s independent record; a backend never authors it. - Quarantine
Record - One orphan (proc / fd / dir) swept during a
RolledBackreconciliation. - Recovery
Probe - INDEPENDENTLY observed host reality at
open()— NOT a backend self-report. - Reported
- A reported attempt: the sealed terminal evidence is in hand. The next legal
move is
Boundary::into_report_event(the host persists 0x002). - Requirement
Inputs - One requirement’s admission inputs (the per-requirement slice of
V/Q). - RunView
- A PURE projection of one attempt, folded from its durable 0xE events.
- Scaffolding
Backend - A scaffolding backend: honest family support, empty machine ceiling.
- Schedule
Entry - One entry of a canonical
LoweringSchedule. - Schedule
Inputs - The normalized, immutable schedule-membrane inputs — the trusted declaration
universe
D, the supplied orderL, and the spec’s required coverageR(S). Probed and normalized ONCE; fed identically to the imperative reference and (next) the shadow circuit. - Schedule
Shape - The fixed shape + derived lane widths a compiled schedule circuit reads.
- Schedule
Slot Inputs - One slot of the supplied schedule
L: which declared primitive it places, plus the digests it CLAIMS for that slot (authenticated against the trusted declaration). - Seccomp
Evidence - The D6 evidence binding for ONE compiled launcher seccomp filter.
- Secret
Ref - An OPAQUE, typed reference to a leased secret. NEVER carries a value — only an
identifier a
crate::SecretResolverdereferences in the parent at launch time. Serializing this (in a plan or report) leaks only the ref string, never a secret. - Spec
- A proposed boundary, not yet admitted. Carries the request and the chosen
backend; the next legal move is
Boundary::plan. - Staged
Artifact - A record of an artifact the boundary STAGED (produced + quarantined).
- Started
- A started attempt (one
AttemptId). The next legal move isBoundary::into_reportedonce the runner seals aBoundaryReport. - StdStreams
- Which standard streams the host captures around the boundary.
- Support
Matrix - What a backend FAMILY can THEORETICALLY do. Static, per-backend-kind, TYPED.
- Support
Verdict - The full support answer for one requirement: a PRODUCT of the two orthogonal
axes —
Enforcement(how strongly held) andEvidenceSet(what can be witnessed). The matrix grades both; planning floors both viaSelf::meet. - Translated
Circuit - A circuit translated to SMT-LIB2: the input declarations + node definitions, and
the SMT name of the
admitoutput (a 1-bit lane). - Width
- The bit width of a value lane. A node’s declared output width; also the width
of an input lane. Always
1 ..= MAX_WIDTH.
Enums§
- Admission
Divergence - A typed shadow disagreement — a hard gauntlet finding, never silently ignored.
- Admission
Outcome - The canonical admission decision both paths must agree on.
- Boundary
Finding - A deterministic structural finding, sorted before the body is hashed.
- Boundary
Requirement - The unit the matrix/profile classifies: a guest
CapabilityOR a host-provisionedHostControl. Oneclassify, one path throughplan(). - Budget
Dimension - The fixed seven budget dimensions, in canonical order.
- Budget
Failure - Why one budget dimension was refused. The canonical reason ORDER is fixed (and must match the circuit + shadow + JSON projection + solver model): the intrinsic derived-minimum check comes FIRST (the request is internally incoherent, independent of any backend), THEN backend adjudication — capacity, then guarantee, then evidence — so the first-failing reason is deterministic.
- Budget
Finding - The terminal budget finding for a dimension (
F_d). - Capability
- Guest-invokable admitted authority policy (grants AND restrictions).
- Commit
Durability - GUARANTEE: how durable a committed artifact is.
- Compare
Rel - A fixed-width unsigned comparison relation carried by
NodeOp::Compare. - Disposition
Action - What the host decided to do with a produced (staged) artifact.
- Disposition
Phase - The lifecycle phase a
BoundaryDispositionEventrecords for one artifact. - Enforcement
- The enforcement-strength axis of a support verdict.
- EnvLower
Error - Why an
EnvPolicy::Exactcould not be LOWERED to a concrete envp: either the table is contract-invalid (EnvPolicyError) or a lease failed to resolve (SecretResolveError). Both fail the launch closed — the target never runs. - EnvPolicy
- Environment-variable policy (proof-spine §5 D2 —
Environment::Exact). - EnvPolicy
Error - Why an
EnvPolicy::Exacttable is contract-invalid. The contract fails CLOSED on the FIRST violation (admission refuses before any execution). Every variant names a malformed class the §4 oracle’s fail-closed branch plants. - EnvSource
- Where an
EnvEntry’s value comes from. ALiteralcarries the value inline (durable); aSecretLeasecarries only an opaque REF — the value is resolved in the parent immediately before launch and NEVER persisted (proof-spine §5 D2 + §8 Vault-style JIT secrets). - Eval
Error - Why a program could not be evaluated over a given input vector. Every variant is
a fail-closed typed refusal;
Enever panics. - Evidence
Claim - One kind of evidence a backend can produce for a requirement.
- Exit
Status - Process exit status, portably encoded (no OS
ExitStatustype). - FdPolicy
- Host-fd inheritance policy: none by default, explicit fds only.
- FsAccess
- Filesystem access grant.
- FsConfinement
- GUARANTEE: “reads/writes confined to the declared scope” — not a mechanism.
- Guarantee
Profile - The quantitative enforcement semantics actually supplied for a dimension (
E_d). “Enforced” without overshoot numbers is too vague for timers, sampled memory, CPU accounting, and network mediation — so a mediated guarantee carries them. - Host
Control - Host-provisioned lifecycle controls applied around the boundary.
- Kill
Guarantee - GUARANTEE: how complete a kill is.
- Kill
Target - GUARANTEE: what a kill targets.
- Lifecycle
Error - Why a lifecycle transition refused. Distinct from
PlanError(admission) andcrate::RecoveryClassification(reconciliation): this is the typestate validating a semantic relation the substrate cannot prove on its own. - Limit
Violation - Why a program exceeds the structural limits.
- Lowering
Error - Why a set of primitives could not be compiled into a
LoweringSchedule. The compiler fails closed: any inconsistency aborts rather than emitting a partial or out-of-order schedule. - Lowering
Phase - The ordered setup phase a primitive lowers in.
- MinGuarantee
- The minimum acceptable guarantee a requirement may demand. A caller may demand
MediatedorEnforced— neverUnsupported(that is only a backend answer). - NetPolicy
- GUARANTEE: deny vs scoped-allow (a policy, not a mechanism).
- NodeOp
- The FROZEN, CLOSED node vocabulary. This is the entire instruction set an
AdmissionProgrammay use; the validator rejects anything else. Adding an op is a schema bump (seeADMISSION_PROGRAM_SCHEMA_VERSION) — deliberately NOT#[non_exhaustive], because “frozen” and “open for extension” contradict. - Outcome
- Run-time terminal outcome. DISTINCT from
crate::RecoveryClassification, which is a startup-reconciliation verdict. - Path
View - GUARANTEE: a path view private to this boundary (not a mechanism).
- Plan
Error - Why a boundary could not be planned. The planner fails closed: any unsupported REQUIRED requirement aborts admission rather than degrading.
- Program
Error - Why a node array could not form a well-formed canonical
AdmissionProgram. Constructor-level structural faults only; full vocabulary/width/limit validation is the step-3 validator’s job. - Proof
Gate Error - Why a proof receipt does NOT qualify the circuit as authority.
- Proof
Status - Whether the compiled admission circuit has passed its full-width equivalence proof and may be treated as authoritative, or is still a candidate behind the authoritative imperative reference.
- QfBv
Error - Why an admission circuit could not be translated to SMT-LIB2.
- Qualification
Status - What the repository has INDEPENDENTLY qualified about a capability claim.
Distinct from
Enforcement(the runtime claim a backend makes). - Recovery
Action - The PURE decision
reconcilereaches for one in-flight attempt. The host APPLIES it (sweep / finish / refuse), then appends the 0x003 verdict fromRecoveryAction::classification. - Recovery
Classification - A reconciliation verdict for one in-flight boundary on
open(). - Requirement
Kind - The classification key: a requirement’s CANONICAL POLICY identity (proof-spine §2), one key per semantically-distinct policy.
- RunStep
- One discrete step of a driven boundary run.
- Schedule
Divergence - A typed schedule-membrane shadow disagreement — a hard gauntlet finding.
- Schedule
Outcome - The canonical schedule-membrane decision the imperative reference and the shadow circuit must agree on.
- Schedule
Refusal - Why the schedule membrane refused, in canonical priority order. The numeric
ScheduleRefusal::codeis the stable selector the circuit and shadow trace agree on (0= admitted). - Seccomp
Action Kind - One seccomp ACTION a policy may resolve to (proof-spine §5 D6: the
“kernel-supported action profile”). A stable, assembler-independent mirror of the
actions our policy model uses, so the evidence records WHAT the kernel must honor
without leaking seccompiler’s type into the pure contract.
Errnocarries the returned errno so two policies that deny via different errnos stay distinct. - Seccomp
Arch - The LITTLE-ENDIAN architectures a launcher seccomp filter targets (proof-spine §5 D6: “seccompiler supports LE x86_64/aarch64/riscv64”). The BPF arch-audit preamble is arch-specific, so the same policy compiles to DIFFERENT bytes per arch — the digest binds the exact target.
- Seccomp
Observed Mode - The kernel-observed seccomp mode of a confined child, read at S10 install time
from
/proc/<pid>/status(Seccomp:/Seccomp_filters:). Defined here so the evidence type is complete now; S7 never constructs one (the field staysNone). - Secret
Resolve Error - Why a
SecretRefcould not be resolved to a value. Carried back so the backend fails closed (refuses the launch) rather than running with a missing secret. - Spawn
Policy - The admitted CHILD-TASK policy — what new tasks (threads / processes) the confined workload may itself create. The three variants are FROZEN SEMANTICS (proof-spine §2/§6/S6): they are an object-capability ATTENUATION ladder (§8 seL4/Capsicum), strictest first. The VARIANT is the policy (no payload).
- Validation
Error - Why a program failed validation. The validator fails closed on the FIRST fault; each variant names a malformed class its red fixtures prove it catches.
- Workload
- What the boundary runs.
Wasmis always present in the type; a real wasm backend is gated later, but the contract stays uniform.
Constants§
- ADMISSION_
CIRCUIT_ PROOF - The admission circuit’s source-declared proof status. It STAYS
PromotionCandidate: promoting the circuit to authority (bindingH_A) requires the QF_BV qualification gate, and a release that treats the circuit as authority is blocked until a validProofReceiptcovering the current circuit exists. The dual path stays fail-closed meanwhile — the imperative reference decides. - ADMISSION_
PROGRAM_ SCHEMA_ VERSION - Wire schema version of the frozen IR. The vocabulary, encoding, limits, depth model, and certificate shape are FROZEN at this version; any change to them is a schema bump, not an in-place edit.
- BOUNDARY_
PLAN_ SCHEMA_ VERSION - Schema version for
BoundaryPlanbodies. - BOUNDARY_
REPORT_ SCHEMA_ VERSION - Schema version for
BoundaryReportBodybodies. - FROZEN_
LIMITS - The frozen limit constants. Provisional values, pinned until a schema bump:
generous enough for a 12-membrane admission circuit over capped requirement /
evidence / budget inputs, while keeping
|V|polynomial andD(A) = O(log W). - LINUX_
QUALIFICATION_ LEDGER - The COMMITTED Linux qualification ledger (S1): the CURRENTLY-PROVEN cells, each citing its real passing oracle(s), plus the explicitly-stated non-proven cells.
- MAX_
ENV_ ENTRIES - The maximum number of entries an
EnvPolicy::Exacttable may declare. A defensible cap (kernelARG_MAXadmits far more, but a confined workload that genuinely needs hundreds of explicit env vars is pathological — the cap bounds the admitted table and the canonical-key payload). 256 covers every realistic declared environment with headroom. - MAX_
ENV_ TOTAL_ BYTES - The maximum total byte budget of an
EnvPolicy::Exacttable, summed over everynameand every inlineLiteralvalue (aSecretLeaseref counts its ref bytes, not a resolved value — the value is unknown at admission). 128 KiB is a defensible fraction of a typical 2 MiBARG_MAX/env budget, leaving ample room for argv. - MAX_
LOOKUP_ ENTRIES - The frozen upper bound on a
LookupTable’s entry count — keeps a bounded lookup actually bounded regardless of key width. - MAX_
PRIMITIVES - The bounded universe size the
u64bitset encoding supports. A lowering schedule names a handful of primitives; this ceiling is far above any real plan and exists only so theindex → bitmapping is total without a wider word. - MAX_
WIDTH - The widest single lane the frozen limits admit. Sized to cover a 64-bit budget word and a 64-element capability/evidence bitset with headroom; the 7-dimension budget vector is seven separate lanes, never one wide lane.
- WASM_
QUALIFICATION_ LEDGER - The committed Wasm qualification ledger. Every production
EnforcedWasm ceiling cell has aProvenrow backed by the live grid oracle; structurally unsupported native cells are stated explicitly and stay absent from the ceiling.
Traits§
- Backend
- A platform boundary backend. OBSERVES only; never seals or writes BatPak.
- Boundary
State - Sealed marker bound for the
Boundarytypestate parameter. - Primitive
Decl - One composable confinement mechanism. The planning + evidence surface; see
the module-level layering note for why
lower/rollbackarrive with the executor. - Secret
Resolver - Resolves an opaque
SecretRefto its concrete value, JIT, in the parent. A resolver is the host hook the backend calls immediately before launch; the returned value is written ONLY into the child’s envp and never persisted.
Functions§
- adjudicate_
dimension - Adjudicate ONE dimension’s coherent request against the backend’s available
capacity, FAIL-CLOSED in canonical reason order (capacity → guarantee →
evidence). The intrinsic derived-minimum check (
L_d ≥ D_d) is a SEPARATE, EARLIER phase inbudget_admit; a dimension reaching here has already passed it, so this never returnsBudgetFailure::BelowDerivedMinimum. - budget_
admit - Admit all seven dimensions in two phases, returning the admitted contract or the FIRST failing dimension + reason in canonical order.
- budget_
membrane_ equivalence_ smt - Emit the full SMT-LIB2 script proving the compiled budget membrane equivalent to
the imperative reference over the WHOLE input space, plus non-vacuity. The three
(check-sat)results a conforming solver must return, in order, are:unsat(equivalence),sat(admit reachable),sat(refusal reachable). - budget_
planted_ disagreement_ smt - Emit the PLANTED-DISAGREEMENT script: the same compiled circuit against a
reference with a deliberately weakened dimension-0 capacity check (
<not≤). A conforming solver MUST returnsat— a model where they differ. This is the negative control: it proves the equivalence query can DETECT a real disagreement, so the genuineunsatis not vacuously true over an always-equal encoding. - classify_
via_ primitives - Classify a requirement against a set of primitives, FAIL-CLOSED.
- compile_
admission - Compile the FULL admission circuit: the six membranes composed in the fixed canonical order with the ordered priority-encoder refusal (kernel plan §6 + the lowering-schedule membrane of track A).
- compile_
budget_ detail - Compile the budget DETAIL selector circuit: its
refusal_codeis the packed(first-failing dimension, that dimension's first-failing reason)—0if every dimension passes. Reads the same7·dimsbudget lanes ascompile_budget_membrane. A bounded priority encoder: within a dimension the reasons are ordered (intrinsic highest), and across dimensions the lowest index wins — matching the imperative reference’s first-failure semantics exactly. - compile_
budget_ membrane - Compile the budget membrane: admit iff every dimension passes the two-phase
check
D_d ≤ L_d ∧ L_d ≤ A_d ∧ G_d ≤ E_d ∧ Q_d ⊆ C_d. Reads7·dimsinput lanes in canonical order: limit, available, derived-min (eachbudget_width), guarantee-required, guarantee-available (each 2-bit), evidence-required, evidence-available (eachevidence_width). - compile_
conflict_ membrane - Compile the conflict-freedom membrane: admit iff no present set intersects its
forbidden set. Reads
2·reqsbitset lanes ofwidth. - compile_
evidence_ membrane - Compile the evidence membrane: admit iff each requirement’s required evidence ⊆
the backend’s available evidence. Reads
2·reqsbitset lanes ofevidence_width. - compile_
profile_ drift_ membrane - Compile the profile-drift membrane: admit iff the planned profile hash equals the live re-probed one — fails closed if the machine changed.
- compile_
schedule - Compile selected primitives into a canonical, validated
LoweringSchedule— the deterministic backend-side compilerK:(S,P,D)→L, FAIL-CLOSED. - compile_
schedule_ membrane - Compile the standalone schedule membrane: admit iff the supplied schedule passes all
nine checks; the refusal code is the first-failing check’s
ScheduleRefusal::code. This is the circuit the shadow evaluates for the per-schedule reason detail. - compile_
support_ membrane - Compile the support membrane: admit iff every requirement’s enforcement is at
least
Mediated(2-bit codes0Unsupported,1Mediated,2Enforced). - compose_
membranes - Compose ordered membrane bits into
(admit, refusal_code):admitis their conjunction (a balanced AND tree);refusal_codeis the 1-based index of the FIRST failing membrane (0when all pass) — a bounded priority encoder built right-to-left so an earlier failure overrides a later one. - decode_
validated - The untrusted-bytes wall: decode a program, validate it, and require the bytes to be its canonical encoding (so a valid-but-non-canonical encoding is rejected).
- derive_
minimums - Compute the cross-dimensional derived structural minimums
DerivedMinimum_d(S)— the floor each budget dimension’s requested limit must meet, from what the spec structurally implies (kernel plan §7). The values are SYMBOLIC structural floors (a nonzero1, the 3 standard descriptors), not precise resource sizing: they encode coherence, e.g. a launched workload needs ≥1 process and nonzero time/cpu/memory; requested network access cannot be 0 bytes. - enforced_
claim_ is_ qualified - The coupling-law check at a single (key, profile, claim) point: a runtime
Enforcementclaim is admissible against a qualification only when either the claim is notEnforced, or the qualification isProven. (The full gate also matches the profile floor and mechanism digest — those live in the ledger + the integrity gate; this is the pointwise core, kept here so it is unit-testable and shared by the runtime if it ever consults a qualification.) - evaluate
- Evaluate
programover the input vectorinputs(indexed by input slot). - linux_
ledger_ row - Look up the committed Linux ledger row for a requirement key (the lookup the
coupling gate uses).
None⇒ the key is not in the ledger at all (which, for anEnforcedproduction cell, is itself a coupling violation). - linux_
mechanism - Derive the
MechanismDigestfor a Linux mechanism string built the waybackend_impl::mechanismbuilds it:"{id}:{primitive}:{enforcement:?}". The ledger is committedconst, but a digest is a runtime blake3, so the ledger stores the SOURCE mechanism string and the coupling test re-derives the digest; this helper keeps the two spellings (ledger vs. backend) in one place. - lower_
env - LOWER an admitted
EnvPolicy::Exactto the concretename → valueenvp the launcher serves tofexecve(proof-spine §5 D2 lowering). Re-validates the table (defense in depth — admission already validated it, but lowering is the last gate before the value materializes), then resolves everyEnvSource::SecretLeasein the PARENT viaresolver. Entry ORDER is preserved (the table is already a validated function name → value); the result is exactly the child’s environment, nothing inherited. - planner_
reference - The authoritative imperative decision for the current planner contract.
- planner_
shadow_ check - Run both paths over the same normalized planner inputs and return the
authoritative outcome, or a typed
AdmissionDivergenceon disagreement. - reconcile
- Reconcile one in-flight attempt: PURE decision over what the events SAY
(
RunView) vs what the world IS (RecoveryProbe). Walks the §13 crash windows in order of severity, fail-closed. - reference_
admission - The authoritative imperative admission decision over normalized inputs.
- reference_
schedule_ admission - The authoritative imperative schedule decision over normalized inputs: the
first-failing check in canonical priority order, or
ScheduleOutcome::Admitted. Total and fail-closed — never panics on adversarial input. - run_
confined - Plan
specagainstbackend, execute it, and return the sealedBoundaryReport— the one-call form of theregistry → plan → runpipeline. - schedule_
refusal - The first-failing
ScheduleRefusalin canonical priority order, orNonewhen the schedule is admitted. Factored so the circuit-equivalence proof can drive the reference directly. The structural checks (1)–(2) run first and build the verifiedpresent/posview; the order-sensitive checks (3)–(9) are then one short-circuit chain over that view (each is its own bounded predicate). - schedule_
shadow_ check - Run both paths over the identical normalized inputs and return the authoritative
outcome — or a typed
ScheduleDivergenceif the shadow circuit disagrees. - shadow_
check - Run both paths over the identical normalized inputs and return the authoritative
outcome — or a typed
AdmissionDivergenceif the shadow circuit disagrees. - shape_
of - Derive the lossless
ScheduleShapeforinputs: every lane is wide enough to hold the largest value it carries, so circuit and reference agree on the exactu64domain (no truncation modeling). - smt_
digest - The canonical digest of an SMT input — the circuit’s proof identity. A receipt must carry this exact digest (over the genuine equivalence script) to qualify the circuit.
- translate
- Translate a validated
AdmissionPrograminto SMT-LIB2 declarations + node definitions. Every input lane becomes a freeBitVec; every node becomes adefine-funover earlier nodes; theadmitoutput is named for assertion. - validate
- Validate a program against the structural limits, FAIL-CLOSED on the first
fault, returning the independently re-derived
ProgramCertificateon success. - verify_
certificate - Verify a claimed certificate by independently re-deriving it.
- verify_
receipt - Verify a receipt qualifies the circuit identified by
expected_digestas authority: matching digest, primary[unsat, sat, sat], independentunsat, plantedsat. Any failure leaves the circuit aProofStatus::PromotionCandidate. - wasm_
ledger_ row - Look up the committed Wasm ledger row for a requirement key.
- wasm_
mechanism - Derive the
MechanismDigestsource string for a Wasm mechanism.
Type Aliases§
- Digest32
- 32-byte blake3 digest, matching BatPak’s evidence-report identity width.