Skip to content

MC/DC coverage for verification functions via witness (WASM harness) #128

Description

@avrabe

Goal

Re-evaluate the coverage of sigil's verification functions with MC/DC (Modified Condition/Decision Coverage) using pulseengine/witness, instead of the line-coverage heuristic used in #127.

This is the rigorous follow-up to #127. MC/DC is the coverage criterion DO-178C Level A / DO-333 actually require — it proves each condition in a compound boolean independently flips the outcome, which line coverage (and CRAP) cannot. witness measures it post-rustc/LLVM lowering on the shipped Wasm, and emits an in-toto coverage predicate that sigil itself can consume — the witness↔sigil integration is designed in.

witness v0.22.0 was verified working locally (leap-year fixture → 1/1 decisions full MC/DC).

Why this isn't a one-shot

witness instruments a Wasm module and invokes its exports with typed args, reconstructing MC/DC from branch counters. sigil's wsc-component.wasm exports only the WASI CLI run entry — not granular verification functions — so it can't be measured directly.

It needs a dedicated witness harness crate:

  • A new wasm32-wasip2 crate (the wsc lib already builds for wasip2) that exports scenario-driven wrappers, e.g. run_verify_multi_scenario(scenario: i32) -> i32.
  • Each scenario constructs a fixture and calls the real verification function, with inputs crafted to flip one MC/DC condition at a time — this is the MC/DC test-design work, and it is the actual value.
  • witness instrument + witness run --invoke → per-decision truth tables → witness predicate → signed in-toto coverage predicate.

Scope

Target the #127 punch-list verifiers, highest-risk first:

  • PublicKey::verify_multi
  • verify_attestation_signature
  • AirGappedVerifier::verify_signature
  • KeylessVerifier::verify
  • RekorKeyring::verify_inclusion_proof

Outcome

MC/DC truth tables for the verification decision logic — certification-grade evidence, feedable into rivet as requirement-to-test traceability and into sigil's own attestation chain as a coverage predicate. This supersedes the line-coverage view of #127 for these functions.

Related: #127 (cargo-crap line-coverage punch list).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions