Autonomous research harness for the P vs NP proof desk at pequalnp.com.
The desk hands out steps: one Lean 4 statement each, held on a lease. The worker takes a step, runs research rounds with local Ollama models (plan an experiment, write a Python trial, a Lean helper or a candidate proof, check it), checks every result with Lean on your machine, and has a candidate that Lean accepts read by a critical verifier before it tells you. You push the one-file branch to your fork, open the pull request, and mark the step submitted. The canvas shows the step, every round, the models and their numbers, the metrics and the log, and carries every control.
local models (Ollama) verifiers: a local model, an API, a web chat
plan, write, iterate read a candidate Lean accepted
| |
v v
[PLAN] -> [EXECUTE] -> [CHECK] -> [VERIFY] -> [PUBLISH]
Lean on the project's you: push, open the
your host checker and pull request, mark
the verifiers submitted
Nothing here claims a theorem is proved. A candidate is "checked" when the project's pinned Lean toolchain accepted it with only the three standard axioms and the independent checks agreed; the project's own checker on the pull request has the last word.
-
A Python trial or a shell command from a model runs with no network, a read-only home and write access only to its scratch directory (user, network, mount and PID namespaces, Landlock, resource limits). No container engine is needed. docs/CONFINE.md has the details.
-
The worker does not push (unless you turn on "push a checked proof"), never opens a pull request, and never tells the desk a step is submitted. Every step's work is kept as a zip.
- Linux (tested on x86-64) with unprivileged user namespaces and Landlock (kernel 5.13 or newer; most current distributions qualify; on Ubuntu 24.04 and later see User namespaces).
- Python 3.10 or newer (the worker uses only the standard library), git, curl, tmux, and the GitHub CLI signed in to your account.
- elan for Lean, and disk for the Mathlib cache (about 6 GB).
- Ollama and a GPU. The default models,
qwen3.8:27bandqwen2.5-coder:14b, are sized for an 8 GB card; any models you pull can take their place. - For the canvas: a C11 compiler, pkg-config, SDL3 (3.2 or newer), FreeType, and an OpenGL 3.3 or OpenGL ES 3.0 driver.
- Optional: Node.js 20 or newer (runs the project's own checker before a
proof counts),
notify-send(desktop alerts), Chromium and Xephyr (for browser-driven web chat verifiers), libdense'slibdense_sched.so(a Python scheduler with the same behavior is used without it).
Clone this repository (or unpack a release zip), then from its top directory:
bash scripts/install-host.sh # checks the host; --apply installs what it can (Debian family)
make && make test # the canvas, and the tests (no desk, model or Lean needed)
gh auth login && gh auth setup-git
ollama pull qwen3.8:27b && ollama pull qwen2.5-coder:14b
bash scripts/start-worker.sh # the worker, in tmux (Ctrl+b then d detaches)
bash scripts/start-canvas.sh # the canvas, in a second terminalThe canvas opens on the Setup plate on the first run.
The left half holds the settings a new installation needs, grouped and explained (hover a setting for what it does). The right half checks the host and says, for each item, what is wrong and how to fix it:
- Fill from the GitHub CLI sets your handle (your GitHub login: the desk credits steps to it) and your noreply commit email, which keeps your address private on the public commit.
- Create the fork makes your fork of
open-goat/pequalnp-proofson GitHub. Proof branches are pushed there. - Clone the project clones the project into the project clone folder
(
~/pequalnp-proofsby default) and fetches the Mathlib cache. - Lean, Node.js, Ollama, the models and the sandbox are checked too.
Press Save after changing settings; they are written to
config/dragonslayer.json. When the banner says READY, press Run.
Press S at any time to come back to Setup.
Run (top bar, or Space) takes a step from the desk and keeps running rounds. Take step and Hard take one without running; Pause stops after the running action; Stop ends it now.
The step plate shows the leased statement exactly as it must be proved, the lease clock, the desk's context, sketch and dead ends, and the current draft. The pipeline shows who serves each stage and how far the step has come; the rounds plate lists every round and what it established.
When a candidate passes Lean, the project's checker and the verifiers,
the alert band lights up (with a chime and a desktop notification).
Open Controls, press Push to fork, run the gh pr create command
it shows (Copy PR command puts it on the clipboard), then press Mark
submitted. The verdict arrives as a comment on the pull request.
The Agents plate holds the model registry: each model's roles (P planner, E executor, V verifier, F finalizer), priority, and numbers (calls, errors, latency percentiles, tokens, cost). Add a model by provider (Ollama, any OpenAI-compatible endpoint, Anthropic), or ask Ollama what it has.
Local models pulls a GGUF model from Hugging Face into Ollama: paste a repository, list its quantizations (each says whether it fits your GPU), set the roles and context, and pull.
Web chats: a verifier can also be a chat site you are signed in to (claude.ai, chatgpt.com, venice.ai), driven in a browser on its own display. These entries are off by default. Driving a consumer chat page from a program may be against a service's terms: read them before you enable one, and prefer the service's API where it offers one. docs/WEB-CHAT.md explains the browser, the APIs and the by-hand relay.
Every event of every session, searchable (plain, fuzzy or regular expression, with a case toggle), filtered by level; click a line to see all of it.
| Key | Plate |
|---|---|
| S | Setup |
| 1 | The step |
| 2 | The pipeline |
| 3 | The rounds |
| 4 | The artifact (the selected round's file and evidence, the candidate, the notes) |
| 5 | The agents (models, web chats, local models) |
| 6 | Controls |
| 7 | The relay (a verifier you answer by hand) |
| 8 | The metrics (latency percentiles, the GPU, Ollama, the scheduler, totals) |
| 9 | The log |
| 0 | The overview |
Drag to pan, wheel to zoom, click a plate to open it. Tab goes to the next plate, Space runs or pauses, Esc leaves a plate, F11 toggles fullscreen, Q quits the canvas (the worker keeps running).
The worker runs without the canvas, and every control is a command:
cd python
python3 -m dragonslayer status --config ../config/dragonslayer.json
python3 -m dragonslayer cmd run --config ../config/dragonslayer.json
python3 -m dragonslayer cmd take_step hard=1 --config ../config/dragonslayer.json
python3 -m dragonslayer cmd release reason=missing_lemma --config ../config/dragonslayer.json
python3 -m dragonslayer cmd push --config ../config/dragonslayer.json
python3 -m dragonslayer cmd mark_submitted --config ../config/dragonslayer.jsonStop the worker with bash scripts/start-worker.sh --stop.
- One step at a time: the worker holds one step and runs one round at a time.
- Reductions and search shards are not supported; a shard assignment is worked as an ordinary step.
- Linux only: the sandbox needs Linux namespaces and Landlock.
Ubuntu 24.04 restricts unprivileged user namespaces through AppArmor, so
the sandbox cannot start (install-host.sh says "unshare -r -n
refused", and Setup shows the sandbox in yellow). The worker still runs,
but the commands models run would have your network and a writable home.
Two ways to lift the restriction, both decisions for the machine's
administrator:
-
for
unshareonly, with an AppArmor profile (note that this lets any user of the machine create user namespaces throughunshare):printf 'abi <abi/4.0>,\ninclude <tunables/global>\nprofile unshare /usr/bin/unshare flags=(unconfined) {\n userns,\n}\n' | sudo tee /etc/apparmor.d/unshare-userns sudo apparmor_parser -r /etc/apparmor.d/unshare-userns
-
or system-wide:
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0(add it to a file in/etc/sysctl.d/to keep it after a reboot).
| Where | What |
|---|---|
config/dragonslayer.json |
your settings (written from config/dragonslayer.example.json on the first start; Setup edits them) |
config/models.json |
your model registry (from config/models.example.json; the Agents plate edits it) |
~/.local/state/dense-dragonslayer/ |
the worker's state: snapshot.json, events.jsonl, commands/, jobs/, archive/<step>.zip (docs/PROTOCOL.md) |
~/.config/dense-dragonslayer/camera.txt |
where the canvas camera was |
Your two config files are not tracked by git, so git pull leaves them
alone.
| Piece | Language | What it does |
|---|---|---|
python/dragonslayer/ |
Python 3.10+, standard library only | the worker: desk protocol, job directories, rounds, model providers, sandbox, Lean checks, publication, Setup, the state directory |
src/app/, src/view/ |
C11, SDL3, FreeType, OpenGL | the canvas: twelve plates on one zoomable world, reading the snapshot and writing commands |
config/ |
JSON | the example settings, the example model registry, the web chat site adapters |
scripts/ |
shell, Python | the host check, the tmux start scripts, the demo state and the screenshots, the release zip |
tests/ |
Python, C | the worker against a fake desk, fake models and a fake Lean (with the real sandbox and real git); the browser driver against a fake DevTools server; the canvas's command and snapshot code |
skills/ |
Markdown | instructions for an agent helping on a step by hand |
- docs/OPERATIONS.md: first run, the daily loop, models, upgrading, recovery
- docs/DESIGN.md: the architecture and why it is shaped this way
- docs/CONFINE.md: how model commands are contained without a container engine
- docs/WEB-CHAT.md: web chat verifiers in a browser, the APIs, the relay
- docs/DESK.md: the desk protocol and the file rules the worker enforces
- docs/PROTOCOL.md: the state directory, the snapshot and the commands
- AGENTS.md and skills/pequalnp-step: for an agent helping on a step by hand
- CONTRIBUTING.md, SECURITY.md, CHANGELOG.md
MIT, see LICENSE. Bundled third-party components (cJSON, the Liberation fonts) keep their own licenses: see THIRD_PARTY_NOTICES.md. The pequalnp-proofs project, Lean, Mathlib and the models you run have their own terms. dense-dragonslayer is an independent tool, not an official part of the pequalnp.com project.








