Sourceling
A retrieval agent over a customer’s own documents, built to answer the question the thesis above left open: what happens when the rules stop being instructions to a model and become part of the system around it. The tenant filter is a database policy. An answer that fails its citation check is not sent.
The constraint that mattered most
In a regulated file, a wrong answer with a confident citation is worse than no answer, because the citation is what stops the reader checking. The thesis found where that breaks: asked directly for a program, the system logged that it must not produce one and produced one. The rule was in the prompt, and the prompt is advice.
The threshold is 0.80 on citation accuracy, and it is a judgement rather than a measurement. Nobody has scored this system against labelled answers, so I know what the number does and not whether it is the right number. Saying which of the two it is costs nothing and is the first thing a reviewer would ask.
How it works
The bug that decided the isolation model
Row-level security was on from the first migration and it was doing nothing. The application connected as the database owner, and an owner bypasses the policies it owns. Every tenant query ran against every tenant’s rows, and a test that connected the same way passed, because it was asking the database the same question the broken product was asking.
The fix is a second role. Migration 0007 creates a login role that is not a superuser and may not bypass row-level security, forces the policies on every tenant table so ownership stops being an exemption, and leaves migrations running as the owner. The application now connects as the role that cannot turn the rule off.
It is the same shape as the rest of the page. The isolation was correct as a configuration and absent as a guarantee, and the difference only showed once something was connecting that could not opt out.
The product






For the technical reader
How it is built, enforced and checked
Architecture
Ten agent steps, each owning one model role, so the cheap model routes and grades and the expensive one only writes. Both search arms run in one Postgres, which is why the two rankings can be fused by position instead of by score.
Enforcement
The tenant filter is a database policy under a role that cannot bypass it. The citation check blocks at 0.80 and sends a failure back to retrieval. A step that raises degrades the turn to a refusal rather than dropping the connection.
Checked
Fifty-six decision records, thirteen written specifications, and 974 backend tests across a hundred and fifty files, with a golden question set per vertical. Continuous integration has still never finished a run, for a reason given below.
What is broken, and what I would do differently
Both halves of the gate could pass without checking anything, and I found the second half by running the system to take the first set of pictures. The faithfulness scorer returned a passing score when its model could not be loaded. The citation score started at 1.0 and was recalculated only when there were citations to check, so an answer carrying none scored perfectly.
That second case was not theoretical. Routing generation through a gateway rather than calling the model directly returns the answer without the citation data, so the run stored an empty citation list, a citation score of 1.0 and a passing verdict. The answer was correct and the evidence was the right evidence. The gate that exists to establish that had nothing to measure and reported the best score available.
What this page said at the time was that an empty result is not a passing result, and that a missing citation set should be treated as a failure rather than as nothing to do. That is now what happens. The prefilter that could not load was deleted rather than repaired, because the skip it bought fell back to the audit that passes vacuously. The judge runs on every turn and every tier. The recorded verdict is three-valued, so a turn that nothing assessed is stored as nothing assessed instead of being rounded up to a pass.
Fig. 07 is what the gateway path does today. The answer ships, carries no citations, and the trail row for it reads gate=not run. An ungated answer may ship; it may never look gated. Fig. 06 has both kinds of row in one table.
The two smaller cases of code describing itself generously are closed as well. The rate limiter keeps its window in Redis now, shared by every worker, and the file records the period when its comment described Redis and its code did not. The daily token budget is read at the point every provider call passes through. Ingestion runs in its own worker process rather than inside the request that started it.
What is still open is the part that matters most. The three accuracy numbers this argument rests on have never been measured against a labelled set, so the threshold remains a choice rather than a result. Continuous integration has never finished a run either: the workflows exist and fired on this branch's own pull request, and every job was refused before it started because the account's minutes are spent. Until that is paid, every green in that repository is a claim made on my own machine. The repository is private and I walk through it on a screen, including the parts above.
Happy to walk through any of these in detail, including the parts that went wrong.