Skip to content
trestoncuzzortPublic

About

automated formal verfication system for code

Resources

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

2,665 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dawnr

dawnr is research software for coding with language models and checking generated programs against tests and formal specifications. It combines a local developer assistant, a configurable model gateway, document tools, and a small specification language backed by formal verifiers.

The research question behind the project is whether training on examples that survive behavioral tests and formal checks can make a small model more capable per parameter than training on ordinary code. That is a question being investigated, not a result this repository claims to have proved.

What Dawnr does

  • Works on a code repository. The terminal assistant reads files, proposes reviewed edits, journals accepted changes for /undo, and runs approved commands in a sandbox. Network access for the assistant is off unless you enable --online.
  • Generates and checks small programs. dawnr ask, spec, prove, and verify use the t language to express program requirements, test candidate behavior, and run formal checks. dawnr check replays a saved certificate without asking a model.
  • Helps with documents and arithmetic. dawnr cite answers from supplied documents with quotations, dawnr extract returns values with their source sentences, and dawnr calc checks a proposed number against separately evaluated arithmetic.
  • Connects to other tools. The local interface can be exposed through the browser UI, a local HTTP API, or MCP. User-configured MCP servers, hooks, and skills are extensions with their own trust boundaries.
  • Contains research and evaluation code. The repository records training data preparation, model experiments, verifier evaluations, selected PX4 source comparisons, and a separate experimental CBMC gate for C functions.

Install and connect a model

The current source checkout does not bundle model weights or install an inference server. Configure a model provider after installation:

git clone https://github.com/trestoncuzzort/dawnr
cd dawnr
./install.sh
export PATH="$HOME/.local/bin:$PATH"
dawnr model connect

The guided setup supports OpenAI, OpenRouter, Gemini, Amazon Bedrock API keys, Anthropic, Ollama, LM Studio, and custom OpenAI-compatible endpoints. Local model servers must be installed and started separately. Hosted providers receive the prompts sent to them. API keys are read from environment variables and are not stored in Dawnr's provider configuration. For Bedrock, the preset uses AWS_BEARER_TOKEN_BEDROCK.

After connecting, run Dawnr from the repository you want it to work in:

cd /path/to/your/project
dawnr doctor
dawnr do "Explain this project's structure and tests" --read-only

dawnr model test NAME checks chat, tool calling, and JSON Schema output with three small provider requests. They may incur provider charges. Use dawnr model test NAME --quick for a chat-only check. Support for tools and structured output varies by provider and model. Streaming and image messages are not supported by the gateway. See the user guide for setup, privacy, and provider details.

How program checking works

The t language describes inputs, preconditions, postconditions, code, and loop invariants. Its supported fragment is lowered to seven verifier backends: Dafny, Verus, SPARK, Frama-C, Lean 4, Rocq, and F*. A checked program is also paired with a deliberately broken variant. A strong result requires the real program to verify and the broken one to be refuted with a concrete counterexample. Not every construct is supported by every backend, and the interactive proof commands require at least one prover by default. A missing or unfinished prover is not a pass.

For dawnr ask, the system generates a candidate and tests it, compares its specification with a separately generated Python reference, checks candidate outputs against the examples, and runs available proof backends. You can save the evidence and replay it later:

dawnr ask "Return the larger of two integers." \
  --test "assert larger(3, 5) == 5" \
  --test "assert larger(-2, -1) == -1" \
  --save-python larger.py --certificate larger.cert.json
dawnr check larger.cert.json

A proof establishes that a program meets its specification under the stated assumptions. It does not establish that the specification captures what the person intended. Reference comparisons and tests reduce that risk but cannot eliminate missing requirements or edge cases. A certificate records checks that can be replayed; it does not certify the user's intent.

The t engine has its own repository. This checkout keeps a pinned copy beside Dawnr's data-pipeline scripts. The language and verifier coverage are described in the syntax guide and engine notes. The language does not currently model heaps, floating-point arithmetic, or concurrency.

The separate native C gate uses CBMC on individual functions with an explicit machine model, assumptions, and bounds. It is not one of the seven t backends, does not cover an entire application, and does not establish the absence of every kind of undefined behavior. See the native cases guide.

What the model results do and do not show

The latest published release recorded in this repository is dawnr 6.0.2. It carries the same model as 6.0.0; its application fixes do not claim a model improvement. The current source checkout uses configurable providers instead of installing those historical weights. See the release record and model card for the released model and its measured results.

The model experiments are limited and have not established the project's training hypothesis. In the recorded benchmark work, models trained here have not beaten the Phi-4-mini baseline. The benchmark is narrow, and base models may have seen its problems during pretraining. Treat model scores as results for their stated datasets and procedures, not as evidence of general coding ability. The limitations, corrections, and measurements explain failed approaches and changes to earlier conclusions.

Selected areas of the repository

Path Contents
bin/dawnr, install.sh Command-line entry point, model gateway setup, and installation.
locallm/ Assistant, provider gateway, document tools, training and evaluation code.
t/ Pinned t engine copy, program pipeline, data tools, tests, and experiment records.
t/flight/ Bounded models and comparisons for selected PX4 routines.
release/ Released model cards and release evidence.
docs/ User guide, command reference, and measured results.
internal/ Research notes, design records, and historical handoffs.

The project focuses on coding, reasoning, program verification, and training data. It does not provide desktop automation or general computer administration. For development instructions, see CONTRIBUTING.md. For license terms, see LICENSE, NOTICE, and DISCLAIMERS.md.

About

automated formal verfication system for code

Resources

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages