PROOF LIBRARY / TechArticle

AI coding needs two sources of truth

A repository can prove what the system does. It cannot, by itself, prove why the team chose it. Reliable agents need current code evidence and governed intent without confusing the two.

Archival paper evidence connected to a source ledger by a blue provenance thread.

The failure that looks like success

Imagine an agent asked to change an authentication path. It finds a clean helper, follows the call graph, updates the tests and produces a plausible patch. The code compiles. The explanation is fluent. Yet the change quietly removes a constraint agreed after an incident six months earlier: a constraint that lives in a decision note, not in the function name.

Now reverse the problem. Give the agent the decision note but not the current implementation. It confidently explains the intended control while editing a file that was replaced two releases ago. The answer is aligned with history and wrong about the repository.

Both failures come from the same design mistake: treating all context as one undifferentiated source of truth. “More context” is not a sufficient architecture. An engineering agent needs to answer two different questions:

  1. What does the system do at this commit?
  2. What did the team decide, under which constraints, and is that decision still approved?

ProofGit is built for the first question. ProofMEM is built for the second. The distinction is more important than the product boundary, because it determines how an answer can be checked.

An engineering task receives current, commit-pinned repository evidence from ProofGit and separately receives approved intent from ProofMEM before a person reviews the proposed change.
Two authorities stay labelled: repository evidence for what is true in code, governed intent for what the team meant.

Repository truth has coordinates

A useful code answer should be able to name its evidence: repository, file, exact line range, commit and blob. Without those coordinates, “the code says” is only a claim about code.

This is why repository retrieval is a distinct problem rather than a thin wrapper around a general chat model. Agent Retrieval Bench treats retrieval across repositories as its own evaluation target. That framing matches what we saw while building our own tools: a model can be capable of writing code and still start from the wrong file, a stale summary, or an implementation that merely resembles the relevant one.

ProofGit creates a companion summary repository for eligible source files. Those summaries are versioned artifacts, not a hidden cache. Search can find a concept, words used in summaries, or an exact identifier in source. A result carries the lines behind the claim and the commit the evidence belongs to. If the source blob has changed, the summary can be treated as stale rather than silently presented as current.

That is evidence, not omniscience. A summary is model-written and can be incomplete. Retrieval can miss the right file. Generated code still needs tests and review. The advantage is that a reviewer has somewhere precise to look.

Intent truth needs governance

Team intent has different failure modes. A transcript can contain a decision, a rejected alternative, a temporary workaround and an unverified guess in adjacent messages. Saving all four as “memory” makes recall larger without making it safer.

MemDev-Bench is useful here because it examines memory in software development as a system-level concern. Other research has also shown the downside of irrelevant memory, while A-MemGuard focuses on the security consequences of persistent agent memory. The common lesson is not that memory is bad. It is that persistence changes the trust model.

Intent needs ownership, scope, review and a way to reverse a bad entry. A durable note should say what was decided, why it matters and how to verify it. It should not become true merely because an agent wrote it. That is the authority ProofMEM is designed to hold.

Why one giant context window does not solve this

A larger context window can carry more tokens. It does not establish freshness, provenance or approval. It also does not tell the agent which source wins when current code and an old decision disagree.

The mechanism matters:

  • repository evidence is refreshed against Git objects and cited to exact source;
  • durable intent is admitted through a governed write path and recalled within scope;
  • the task assembles both into separately labelled sections;
  • the agent proposes a change;
  • a person reviews the evidence, the intended constraint and the patch.

Keeping the authorities separate makes disagreement visible. If ProofMEM says “retain the compatibility path” and ProofGit shows that the path no longer exists, the agent should not smooth over the conflict. It should surface it as a decision that needs attention.

What this changes for an engineering leader

The management question is not “Are our agents faster?” Speed is easy to demonstrate on a happy path. The harder question is whether the organisation can inspect how an agent reached an answer and correct the context that shaped it.

Two sources of truth create a practical review model:

  • Freshness: Is the repository evidence current for the target commit?
  • Provenance: Can a reviewer open the exact lines?
  • Authority: Was the recalled intent approved, and by whom?
  • Scope: Was that intent meant for this repository, client or team?
  • Reversibility: Can a mistaken memory be rejected or superseded?
  • Human control: Did a person approve the effect, not merely the prose?

This does not eliminate hallucination. It narrows the space in which an unsupported answer can hide.

Limitations and design choices

ProofGit does not prove that source code is correct, secure or compliant. It proves where a repository claim came from and whether the supporting summary matches the recorded source object. ProofMEM does not automatically correct bad memories. Its value comes from making proposed knowledge governable. Neither product replaces tests, code review, threat modelling or engineering judgement.

The two products also keep separate accounts, subscriptions and authorities. Caveau Harness can assemble their outputs at task time, but that bridge does not turn one product into a feature of the other.

An operating pattern, not a prompt trick

The two-authority model works best when it is visible in the engineering workflow. At task start, identify the target repository and revision. Retrieve the smallest useful set of code evidence, then retrieve approved intent for the relevant team or project. Present them under separate headings. If either source is missing, say so instead of filling the gap with general knowledge.

After the agent proposes a change, review the evidence path as well as the diff. Did the answer cite the function that actually owns the behavior? Did a decision apply to this repository or merely resemble the task? Did the implementation change invalidate the old intent? Those questions are quick when the context carries coordinates and authority; they are expensive when a reviewer has to reconstruct the agent's path from prose.

The result can also improve the organisation's records. A code change may reveal that an approved decision is stale. That should create a reviewable proposal to supersede the intent, not an automatic rewrite. Conversely, an active decision may reveal that the implementation drifted. That should create an engineering task backed by the conflicting evidence. In both cases, disagreement becomes useful work rather than context the model silently reconciles.

The next action

Pick one recurring engineering question that currently consumes ten minutes of repository archaeology: “Where is tenant isolation enforced?”, “Which path publishes a social post?”, or “What code owns this migration?” Pair a repository, ask the question, and inspect whether the answer gives you the exact source lines at the commit. That is the first ProofGit value: not a smoother paragraph, but a claim you can open and check.

Sources and further reading

  1. Agent Retrieval Bench
  2. MemDev-Bench
  3. A-MemGuard