AIMUG Panama · 30 November 2026
Spec-driven and proof-driven development, tried on an emergency text network for the Azuero coast.
Colin McNamara
Who I am
Field CTO, AHEAD
Open source
vLLM Semantic Router, Dataplane & Networking Working Group
Standards
IETF agentproto, review comments accepted into the requirements draft
Thank you
Paul and Geraldine, who hosted me in Panama, and their son Max. After the quake they organized resources, built apps and showed up for their neighbors.
The claim
So I check the code against the requirement instead of reading every line.
That only works if the agent can't change the requirement.
The agent writes code to meet it, and I decide when it changes.
Formal verification · November 2026
Nobody read it
17 million lines of Lean, a language for proofs that a computer checks step by step.
What people checked
About three lines, already in Lean's shared math library. The proof had to prove that exact statement.
Independent checkers replayed the proof against it. Trust moved from the proof to the statement.
Spec-driven development
What it gets right
You write what the code has to do in a markdown file, and the agent builds from it.
Missing
Most requirements stay prose that a person or a model reads. Few get a check of their own.
Missing
None of the tools I looked at stop the agent from editing the spec it's building from.
Where spec-driven meets proof-driven
Prose
A person reads it and decides.
Tests
Fixed cases that pass or fail.
Property tests
One rule, checked on many random cases.
Contracts
Conditions written into the code itself.
Proofs
A checker proves the rule for all inputs.
Spec-driven development is the bottom rung and formal verification is the top. Each requirement goes as high as its wording allows.
The lab
| Spec could be met | 72 of 72 | fixed the bug |
| Spec couldn't be met, agent could edit it | 14 of 18 | changed the spec, and said so |
| Spec locked | 18 of 18 | stopped and asked me |
Lab runs, November 2026: one task, three coding agents.
Standing specs
The owner
In its own change that touches only the spec, so it gets reviewed by itself.
The agent
Writes code until the checks pass. If they can't pass, it stops and asks.
The reviewer
For a change that leaves the spec alone, that diff is empty, and the checks show what held.
The case study
A text network for the Azuero coast, planned with AI agents over a weekend.
9 October 2026 · Azuero, Panama
An M7.5 quake hit near Tonosí.
The next one could knock out the cell towers.
Magnitude 7.5 as reported by SINAPROC. USGS reported 7.7.
The plan · 12 sites in three phases
25–32%Phase 1 uses three hilltops from Cañas to Búcaro
52–61%Phase 2 adds Pedasí and inland hills for 7 sites
64–74%Phase 3 reaches Cambutal to the west with all 12
Solar LoRa radios on hilltops pass texts along with no cell service, grid power or internet. Nothing is built yet.
Estimated population in reach: the low end treats trees as walls, the high end uses bare terrain. The radios run open source MeshCore firmware at 915 MHz.
Where it broke
Pixel lookup
We read the 38 m pixel next door. Correcting the lookup moved hilltop pins up to 30 m.
Line of sight
We sampled the ground every 30 m, so a narrow ridge could slip between samples.
73% → 64%of people in reach with trees as walls. Tonight's figures use the corrected run.
The spec for the mesh model
Proofs
The math of the pixel lookup and the path tracer, in Dafny.
Property tests
Line of sight works both ways, and coverage agrees with the link check.
Tests
Terrain input, tree loss, short paths, lengths, towers, budget and the published numbers.
Prose
Report both scenarios. Radio-test every site before mounting.
That's where each one is checked today. Six of the 13 could go as high as a proof.
Requirements at their rungs
R2 · Proofs
A path is clear only if the ray is above the terrain of every pixel it crosses, however briefly. The math is proved, and property tests check the code.
R8 · Tests
Every km of coast on a page has to trace to a length the model stored in km. A test scans the pages.
R12 · Prose
Give coverage with bare terrain and with trees as walls. Nothing can pass or fail it until radios are up, so I review it.
Property tests
R3 · Both ways
If hill A can see hill B, B can see A. On the old code, 24 of 150 random pairs worked only one way.
R2 · Every pixel
One tall pixel on a path has to block it. The old coverage code walked past 80 of 150.
R4 · One rule
The coverage check and the link check must agree on every pair. The old code disagreed on 16 of 150.
All three pass on the fixed code.
Proof-driven
predicate Contains(i: int, x: real) {
i as real <= x < i as real + 1.0
}
lemma PixelOfCorrect(x: real)
ensures Contains(PixelOf(x), x)
Dafny checks this for every real number. The old rounding lookup fails the same statement: a point at 0.75 is in pixel 0, and rounding picks pixel 1.
The path tracer's math is proved too. The proofs cover the math, and property tests check that the Python follows it.
Hindsight check
| Old code | Fixed code | |
| Read the pixel next door | fails | passes |
| Skipped narrow ridges | fails | passes |
| Judged phones at the wrong ground | fails | passes |
| Kept terrain spikes and sea above zero | fails | passes |
| Counted tree loss under the ground | fails | passes |
| Called a blocked short path clean | fails | passes |
| Showed 107 samples as 107 km | fails | old deck still says it |
I wrote these checks after the audit, so this is an upper bound. They also found the map drawing code still using the old method.
Who can change the spec
AGENTS.md
If a spec can't be met, stop and ask the owner. Never edit it.
Claude Code
A test session tried to edit the spec and was refused.
My git server
A push that changed the spec was rejected, even from my own key.
CODEOWNERS
Any change to the spec needs my review on GitHub.
Before the spec was locked
What failed
It compared each km on a page with an independent estimate, within 15%. The estimate came out at 142 km against the stored 164 km.
What the agent did
Now every km on a page has to trace exactly to a stored km value, with a loose 20% guard.
I hadn't approved the spec yet. It's disclosed in the retro, and approving the change is my call.
Next
Running now: a model that never saw the audit writes its own spec from the old code. Our guess, written down before it ran: it catches about 3 of the 7 bugs.
Then, from December into Q1 2027, we measure real links against the model.
Testing the predictions
We predict two of the three Phase 1 links pass and one fails direct. A text can still go around it through the third hill.
Three nodes go up between December and Q1 2027, one on a temporary 8 m mast. We'll log each link and rerun the model before we buy the rest.
Try this Tuesday
One
Mark which specs an agent may edit, and which it may only satisfy.
How: put the protected ones in one folder and name an owner in CODEOWNERS.
Two
Make the protected ones read-only for the agent.
How: a deny rule in the agent's settings, and a protected path on your git server.
Three
Tell your agents to stop and ask when a spec can't be met.
How: one line in AGENTS.md and CLAUDE.md, which the agents read.
Four
Give one crisp requirement a property test.
How: write the rule once and let a tool like Hypothesis try random cases.
The mesh repo does all four. The next slide has the files.
The files
CODEOWNERS
# The spec is owned by Colin. /spec/ @colinmcnamara
.claude/settings.json
{ "permissions": {
"deny": ["Edit(/spec/**)"] } }AGENTS.md
If a spec can't be met, stop and ask the owner; never edit spec/. Don't weaken a check, loosen a tolerance or skip a case to pass.
A property test (illustrative, Hypothesis)
@given(points, points)
def test_line_of_sight_both_ways(a, b):
assert visible(a, b) == visible(b, a)On the server: a protected path for spec/** (Forgejo), or required code-owner review (GitHub). When you review: git diff main -- spec/
Meetup projects
Grab radios and repeaters and hack on them together.
Write a check-in bot or a quake-alert bot, or build a surf report board.
Get official notices onto every language channel on the mesh.
In Pedasí, take one phone per carrier to the beaches and log the signal.
About $16,000 by phase: field test $652, core $3,308, Pedasí and inland $5,713, west and south $4,224, plus $2,085 contingency.
It's on GitHub at github.com/colinmcnamara/azuero-mesh-spec: public data, about 1,300 lines of Python, and a spec you can run against it.
Credits
Terrain: AWS Terrain Tiles, with SRTM and GMTED2010 courtesy of the U.S. Geological Survey and ETOPO1 from NOAA. The signal model uses resampled elevations from the University of Bristol's FABDEM V1-2 (CC BY-NC-SA 4.0).
Surface: produced using Copernicus WorldDEM-30 © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved.
Trees: © ESA WorldCover project 2021, contains modified Copernicus Sentinel data (2021) processed by the ESA WorldCover consortium (CC BY 4.0). Meta and WRI canopy height (CC BY 4.0), source imagery © 2016 Maxar.
People: WorldPop 2025 (CC BY 4.0). Google Open Buildings v3 (CC BY 4.0).
Cell check: Colin McNamara analyzed the Q3 2026 mobile tiles from Speedtest® by Ookla® Global Fixed and Mobile Network Performance Maps, accessed via AWS on 28 November 2026. Ookla trademarks used under license and reprinted with permission. These datasets and their adaptations here are shared under CC BY-NC-SA 4.0.
Map data © OpenStreetMap contributors. Tower sites: ASEP Panamá registry. Solar: NASA POWER. 3D: three.js (MIT). Slides: reveal.js (MIT).
Azuero Mesh · AIMUG Panama
On the mesh model it's me. The agents run the spec, and when they can't meet it, they stop and ask.
Colin McNamara · Questions?