npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@h2loop/hydron-formal-verification

v1.0.3

Published

Formal verification for Hydron: requirements to ACSL contracts to Frama-C/WP proofs, with per-requirement evidence for regulated embedded C

Readme

Hydron formal verification

Prove that your C code meets its requirements, with Frama-C, from one Hydron command.

/prove docs/requirements.md

Hydron reads the requirements, finds the functions that implement each one, writes the pre- and postconditions (ACSL contracts) for them, runs the Frama-C/WP prover, explains every goal it could not prove, confirms real defects by running them, and gives you a per-requirement report. Your source files are never modified: contracts go into proof copies under fv/proofs/, and the prover refuses a copy whose code differs from yours.

Quick start

  1. Install: hydron plugin add @h2loop/hydron-formal-verification (or hydron plugin add <path>).
  2. /fv-setup: finds Frama-C (native, or a Docker image it can pull or build for you), reads compile_commands.json for include paths and defines, and picks the target machine model (ARM Cortex-M/R, PowerPC, AVR, x86). Writes fv/hydron-fv.json.
  3. /prove <what>: any of
    • a requirements file or Doorstop folder: /prove reqs/ /prove docs/srs.csv
    • requirement IDs: /prove REQ-003 REQ-007
    • a source file or functions: /prove src/pid.c /prove pid_update
    • nothing: Hydron looks for the requirements itself.
  4. Read the reply, or fv/REPORT.md at any time (/fv-report refreshes it).
  5. Review each contract against its requirement (the report shows both, plus the contract in plain words). When it says what the requirement means: /fv-approve REQ-003. CI (script/fv-ci.ts) passes a proved requirement only once its current contract is approved; --allow-unreviewed relaxes that while a project is being set up.
  6. For a requirement in the assuming state, accept each remaining check you take responsibility for: /fv-accept <goal> because <reason>.

Optional checks (off unless you say yes)

A proof shows that the code agrees with its contract. It does not show that the contract says everything the requirement says. Two optional checks help with that. In fv/hydron-fv.json, set each to ask (the default: Hydron asks you at the start of /prove), on (always) or off (never, and Hydron does not ask).

| Setting | What it does | What it costs | |---|---|---| | "mutation" | After the proofs, changes the code of each proved requirement in small ways (< to <=, == to !=, + to -, a constant plus one), one at a time on a scratch copy, and proves again. A change that no proof notices shows behaviour the contract does not state. Results in fv/REPORT.md and fv/mutation.json. Run it any time with /fv-mutate. | About one proof run per change; 10 changes per requirement by default. | | "contractFirst" | You approve each requirement's contract (requires, ensures, assigns) before Hydron proves it and writes loop annotations. After that, any change to the approved contract makes the requirement failed. | Your review time during the run. |

{ "mutation": "ask", "contractFirst": "off" }

Headless runs (hydron run) cannot ask, so there both checks run only when set to on.

What a result means

| Status | Meaning | |---|---| | proved | Every contract clause for the requirement and every runtime-safety goal (overflow, out-of-bounds, invalid pointer, shift, division) in its functions is proved, and no dead code was found. | | partial | Proved, but the contract states only part of the requirement; the report says which part is not covered. | | conditional | Proved, but only for callers that respect a precondition no proved call checks (an entry point's input ranges, for example). The report lists each one; your approval of the contract confirms who guarantees them. | | assuming | The requirement's own contract clauses are proved, but other checks in its functions are not (a Frama-C limit, a prover timeout, a runtime goal no test reproduced). The report lists each one under "Holds only if these unproved checks hold". Fix the cause, or accept each check by name with /fv-accept <goal> because <reason>; CI passes it only when all are accepted. | | failed | A runtime defect reproduced by a witness program on the original code, a code/requirement mismatch, dead code, or (contract-first mode) a contract changed after you approved it: triggering values, the witness output and a proposed fix are in the findings. An unreproduced runtime goal never makes a requirement failed. | | open | Goals remain unproved: the requirement's own clauses, or checks with no explanation yet. | | stale | The code, proof copy, fv/assumptions.h or settings changed after its functions were last proved, or a function has not been proved yet. Re-run /prove. | | unformalizable | Not expressible as a function contract (timing, scheduling, hardware behaviour). Verify by test. |

A proof is only as good as its contract, which is why contracts need your sign-off, and why the sign-off is tied to the exact contract text (editing a contract later shows changed-since-approval).

What it does not prove

Read this before you use a report as certification evidence.

  • Only what the contract states. "Proved" means: for every input that meets the function's preconditions, there is no runtime error and every postcondition holds. The report shows each contract in full, preconditions included, and needs your approval.
  • Preconditions are assumed. A precondition counts as checked only where Frama-C proved it at a call, in a function it proved. Where no proved call checks it (an entry point, or callers in code that was not proved), the requirement shows as conditional.
  • Not covered: timing and scheduling, concurrency and interrupts (the analysis is sequential), hardware behaviour, the compiler and linker, and functions with no body in the analysed files (their contracts in fv/assumptions.h are assumed and listed in the report).
  • Target approximation. Integer sizes and alignment come from a machine model (arm_eabi_32, ppc_32_eabi, ...) that approximates your cross-compiler. Check that it matches your target.
  • C only. Frama-C proves C99/C11. C++ files are refused with a message.
  • Tool qualification. Frama-C, Alt-Ergo, Why3 and this plugin are not qualified under DO-330 or ISO 26262-8. Use the results as supporting evidence (for example under DO-333) with your own tool confidence assessment. The report records the exact tool versions and command for each proof, and script/fv-ci.ts re-runs every proof in CI without any AI.

What it needs

  • Frama-C 32.1 with Alt-Ergo, either on PATH or through Docker (hydron-fv:32.1 built from docker/Dockerfile, or the official framac/frama-c:32.1). Air-gapped sites: build or pull once elsewhere, docker save, docker load.
  • Requirements in Doorstop, CSV (DOORS/Polarion/Jama/Excel exports), Markdown/text, JSON or YAML.
  • Tested on macOS (arm64) with Docker. Linux and Windows (x64, arm64; Windows through Docker Desktop) use the same code paths but have not been tested yet.

Files it writes (all under fv/, commit them)

hydron-fv.json settings · assumptions.h contracts for library/RTOS/HAL code that is not proved (you review these) · requirements.json · plan.json · proofs/ · results/ · findings.json · approvals.json · mutation.json (optional mutation check) · REPORT.md · status.json (machine-readable, for traceability) · .runs/ raw prover logs (gitignored).

For developers

  • Design and every decision: DECISIONS.md.
  • Library: lib/ (requirements parsing, ACSL identity/line mapping, Frama-C runner, status). Tools: handlers/fv_*.ts, registered in plugins/index.ts. Agent: agents/formal-verifier.md. Skill: skills/acsl-contracts/.
  • Tests: bun test test. Typecheck: tsgo --noEmit -p tsconfig.json.
  • Benchmarks: in h2loop/hydron-fv-benchmarks, which pins this plugin as a submodule and runs and grades it.