Tom Heffernan

heffnt@gmail.com
GitHub: github.com/Heffnt

I build software by directing AI agents, and have since ChatGPT first came out. I went from pasting code into ChatGPT, to Cursor, to Claude Code, and then built my own environment for working with agents, Jarvis, which I now use for all my work with agents. I am finishing an M.S. in Artificial Intelligence at Worcester Polytechnic Institute.

tom.quest is my website and the front end of Jarvis. Its public pages are this one and the projects below; behind sign-in, it is where I talk with my agents, watch what each one is doing, and read what changed. Agents build and change it like the rest of Jarvis, and every change reaches it through the same program that decides what takes effect.

My focus is the quality of code that agents build. Quality is two things: what code costs to change, and how well it does what its owner intends. Agents left to themselves erode both. Each sees only part of the system, so it fixes problems by adding, and every change gets more expensive; rules given to agents in prose wear off, so the code drifts from what was meant. My approach is to turn my words into precise laws, build code with the properties that let those laws be proven, and let programs rather than agents decide what takes effect. It matters beyond software: proven code is how we will control AI more capable than us.

  • M.S. in Artificial Intelligence, Worcester Polytechnic Institute, May 2027.
  • B.A. in Computer Science, Colorado College, 2024.

Projects

Jarvis

2026 to now

My environment for working with agents: AI agents that build and change its own code for one user, through a single program that decides what takes effect. Over 6,000 commits since February, all written by agents.

tom.quest

2026 to now

This site and the tools on it, built with agents; about 2,700 commits since January.

Boolean backdoors in language models

WPI, 2024 to 2026

Led a research project on backdoor attacks whose trigger is a logical combination of words. Directed agents to build its framework, ComplexMultiTrigger: about 168,500 lines of Python reimplementing about 38 published detection, defense and interpretability methods, with fine-tuning sweeps over 10 open models on a 16-GPU cluster.

[placeholder: code link to the ComplexMultiTrigger repository]

DAGverse: Building Document-Grounded Semantic DAGs from Scientific Papers

arXiv preprint, 2026; co-author with Shu Wan, Saketh Vishnubhatla, Iskander Kushbay, Aaron Belikoff, Raha Moraffah and Huan Liu

A framework and dataset (108 expert-validated examples) for recovering the causal graphs drawn in scientific papers, together with the text that explains them.

paper

Causal reasoning benchmark

WPI

A benchmark that tests language models on the implicit causal relationships in research papers, using the causal graphs the papers draw; I brought up DeepSeek-R1 (671 billion parameters) across H200 GPUs for it.

What are the Biases in My Word Embedding?

Microsoft Research, 2018; AIES 2019

As a research intern with Adam Kalai, an unsupervised algorithm that finds biases in word embeddings from their geometry.

THMM

A 16-bit CPU I designed and wired by hand in Logisim in 2022, without AI, then ported to TypeScript with agents so it runs on tom.quest, with a compiler that targets it.

simulatorcode

Transformer viewer

An interactive view of a transformer’s layers, on placeholder data.

open

Point cloud viewer

An interactive viewer for 3D LiDAR scans.

open

Arc lights

A web control for the LED light ring in my room; guests change its pattern and brightness from their phones, and I can pause guest control.

open

Perfume brewer

A multiplayer game for my Dungeons & Dragons group: players join and brew magical perfumes from a crafting system our DM designed.

open

Tom’s vision for code quality

Quality, and how to get there

I judge code by the two things anyone who depends on it actually cares about: what it costs to change, and whether it does what they intend. The usual measures of quality, such as lines of code, test coverage, complexity scores and style, are proxies for those two. Proxies can be met while the code gets worse, and agents meet whatever they are measured by. So I measure the two directly.

Cost to change is what it takes to make a change correctly. In a low-quality code base an agent cannot tell what impact its change will have, so it iterates many times, reads a lot of code, changes code in many different places, and is likely to break something along the way. In a high-quality code base the part an agent can see tells it everything it needs, and the change is small and right the first time. I measure cost with benchmark changes: a fresh agent makes the same small standard change from the same request, and every step is timed.

Cost to change covers:

  • time from a request to the change being live, waiting included
  • tokens spent, including code read again and again
  • attempts wasted: blocked, failed, superseded or reverted
  • code read and code touched per change
  • things broken along the way

Alignment with intent is judged against the laws of the specification, which state what I want in claims precise enough to prove; proving every one of them is the aim. Laws can only be proven about code that has certain properties, such as one home, and those properties are also what make change cheap.

Alignment with intent covers:

  • every behavior exists because my words ask for it
  • nothing my words forbid can happen
  • no bugs, crashes or other failures, which no one intends
  • the laws hold, ideally by proof

Agents do not produce such code on their own. An agent’s task names one fault, and its view covers one part of the system. Adding a mechanism is safe from that view; removing one requires knowing everything that depends on it. So agents fix by adding, a tendency known in people as addition bias, and each addition makes the next change more expensive. Their tests are written by the same kind of model that wrote the code, so they confirm what the author believed. Jarvis, built by agents for one user, has grown to about 735,000 lines of code and tests.

How to get there comes down to two things: enforcing laws with guards, and rebuilding instead of patching.

Guards. A guard is anything that passes, refuses or reverts a change, and it names the law it guards. A guard with no law is deleted; a law with no guard is marked unguarded. Tests, type checks, static rules, replays of real traffic and proofs are all guards of one kind: which one a change needs depends on what it protects against, never on its type. A test is used only where a proof or a guarantee cannot do the job, and proof is the aim. A guard is trusted only after a deliberately broken case has made it act. Guards run in the one program through which every change lands: a change that can be undone goes live at once and is reverted by that program if a guard fails; a change that cannot be undone waits for every guard.

Rebuild, don’t patch. A degraded part is not repaired; it is rebuilt from its specification beside the running one.

  1. Two agents that have not seen each other’s work write the part’s laws from my words, one claim each. Where they differ becomes a question for me.
  2. Real traffic through the old part is recorded, and the laws are run over the recording, which shows how often the old part already breaks them.
  3. An agent that has seen the laws but not the code writes one guard per law, and for each a deliberately broken version the guard must catch.
  4. An agent that has seen neither the guards nor the old code builds the new part. A critical part is built twice, by different models.
  5. The recording is replayed through the new part, and every difference from the old one is settled by the laws. Differences between the two builds that the laws cannot settle are the questions only I can answer.
  6. The new part runs beside the old on live input, acting on nothing, then takes over in the smallest slice first, with a program ready to undo the switch.
  7. It is done only when the old code is deleted.

When I rebuilt the program that starts and runs agents in Jarvis, the second build passed all 33 guards where the first passed 24. Their 90 differences settled by the laws in all but two cases, which were questions only I could answer. Once the code is verified independently, what remains is intent.

The specification

These are the most important laws of the specification I hold Jarvis to, and they would hold for any code base built by agents. Proving each one is the aim; today they are held by guards to differing degrees.

LawHow it helps code qualityFrom my experience
One home: everything the system knows or does exists in exactly one place, findable from wherever it is needed.An agent that changes a thing changes it everywhere, and its local view holds everything it needs; nothing drifts out of step.I told agents which account to use first, but my rule lived only in our conversations, while the written instructions they read said the opposite. Two versions of one rule disagreed: I restated mine seven times in three weeks, and agents kept breaking it.
Programs write the verdicts: whether a change landed, is live, passed or is done is written by a program, never by the agent that did the work.Progress is measured by what is true, not by what an agent believes, so broken work cannot pass as finished.Twice an agent said a step that later work depended on was finished when it was not, and both times the work built on top of it failed.
Nothing judges itself: the judge of a change shares nothing with the change.A guard written apart from the code tests what the code should do, so it catches mistakes the author could not see.A program that sends alerts recorded every alert as sent, daily for two weeks, while sending was actually switched off. It was the only judge of its own work, so nobody noticed.
A guard counts only after a deliberately broken case has made it act.Guards that cannot fail are found and fixed, so the safety they promise is real.A rule was meant to give tests more memory whenever a test run was stopped for using too much. The record of a stopped run lacked the one detail the rule looked for, so it never acted. One deliberately stopped run would have shown that.
A change that cannot be undone waits for every guard; one that can goes live at once and is undone by a program if a guard fails.Most changes go live in minutes without waiting for slow guards, and a bad one costs nothing because it is taken back.A risky change went live, failed its guards and was taken back automatically, three times over two days, with nothing lost.
The code that runs is the code its guards ran on.Every guarantee applies to the program actually running, so guards are not wasted on a different version.The program that accepts changes once fell back to an older copy of itself that no guard had run on. For 38 minutes it wrongly refused four good changes.
Every wait has a deadline set when it begins, and every request ends in a result or an error by then.Failures surface at once instead of hiding as silence, so they are fixed where they happen.A recovery program waited twelve hours for something, with no time limit. When it finally acted, its information was out of date, and it rolled the whole system back 111 changes.

Beside the laws are measures that only have a direction, with no threshold: time from push to landed, time from request to live, time that guards add before a change is live, lines and bytes of code, files owned by no part, imports across parts, places with two writers, and cycles between parts. Each should only go down.

Why it matters

Intent. Everything starts from what a person, or a society, wants, in their own words. For one person, their words are the source; shared intent needs a collective process, and I think governments must do that work, or AI will follow whoever engages with it most.

Specification. Words are turned into laws precise enough to prove, each a single claim tied to the words it came from. Today that translation is mostly done by AI models, which can misread; I want it done by autoformalization with a guarantee that each law is faithful to the words.

Proven code. A proof covers every possible case, where a test covers only the ones tried, and checking a proof is easier than producing it: a small program can check reasoning no person could have produced. But proofs are only practical about code of high quality. When everything has one home, a law about a thing is proven in one place; when each part has its own small set of laws, parts are proven one at a time; and when the specification is precise, there is something exact to prove. The properties that make code cheap to change are the same ones that make it provable.

Control. AI acts in the world only through software: its sandbox, its permissions, the systems it reaches. If that software is proven to have the properties we specify, it bounds what the AI can do however capable it becomes, and a program, not another AI, can monitor what it says. Another AI cannot be the check: it makes mistakes, it can collude, and it can be fooled by adversarial inputs.