What it does
The size of the whole system, each figure saying what it counts, measured from the main line of the repository (the count of application code includes the command scripts that have no file ending):
- 19,810 lines of application code of which 9,831 lines are Python, 4,735 lines are 23 command scripts with no file ending (
bin/doctor,bin/setup,bin/touch,bin/gateand the rest), 3,197 lines are shell, 671 lines are database SQL, 531 lines are CSS and 354 lines are JavaScript. - 20,593 lines of tests in 138 files (20,259 lines in the 129 Python test modules under
tests/), with 1,060 test cases. - 8,406 lines of HTML in 11 pages, 48,622 lines of Markdown, 49,745 lines of Markdown and YAML, and a tree of 121,117 lines of text in 557 tracked files.
- 14 numbered database changes (
state/schema/001_init.sqlto014_capability_manifest_versioning.sql, 575 lines) that build 8 data tables, shared across machines. - 141 commits on the main line, 131,150 lines inserted and 5,559 removed over the history; the busiest days carried 36 and 26 commits.
- 16 controls and 15 executable contracts in
controlkit(3,654 lines), 13 hook scripts (2,477 lines), 16 skills (1,619 lines), 2 MCP services in this repository (2,003 lines), 18 AST rules, 9 vocabulary catalogs, 1,012 lines in the doctor and 158 in the reality probe, and 40 files underbin/(7,879 lines).
The parts, each as a thing people and agents use:
orientand the federation. One briefing call and ten services: what the estate is, what the AI may do in each repository, live state, traps, open findings, decisions and the routing table; eight code graphs of about 71,600 nodes with 56 questions between them; and the knowledge store with fourteen tools. Described at full length under "How he built it".- The knowledge store. Findings, decisions and traps in one shared database with a severity, six fixed states, citations and a decision chain; 24 numbered traps; 14 drafted tickets and two full diagnoses.
controlkit. The single program every event of the AI tool goes through: 16 controls, 15 contracts, fail closed.- The tier model, the deny matrix and the five-layer push defense. What the AI may do per repository, the permission file compiled from data, and five independent blocks between local work and production, installed in all eight estate repositories by one command.
- The anti-sycophancy harness. Premature-stop gate, nine vocabulary catalogs, an anti-pattern classifier of eight classes, the question-tool guard, handoff protection and the META-LOOP.
- The review and evidence machinery. The severity rubric, the three-reviewer adversarial review harness, cross-agent attestation, the plan execution harness with its mutation probe, plan scope freeze and scope-diff, the engineer pipeline of five skills and the five-step diagnostic protocol.
- The doctor and the reality probe. Twenty-one blocks of checks in about three seconds, which attempt the forbidden act, and a probe that runs the real hook as its own process and reads the exit code.
- The ledgers. The append-only audit ledger and decision supersession.
- The estate analysis. The estate intelligence corpus, the cross-pattern synthesis, the strangler-fig pilot with its characterization tests (1,051 lines under
pilots/), universal code-touch mode, reflex injection, and the specification of the Reality Reconciliation Engine. - Project Oracle. The 24-metric page for the owner and the project manager: 1,699 lines of Python in
oracle/, 2,480 lines of dashboard HTML, four snapshot generators, the live ticket ingest and a daily refresh job (a launchd definition). - The people-facing documents. The onboarding guide, the operations handbook, the code-verification brief, "Using AI well", the roadmap site (5,925 lines of HTML across the guides and roadmap), the agency portal specification, the audit-product extraction plan, the competitive gap analysis and the hiring evaluation kit (7 files, 262 lines, in
hiring/). - Setup and operation. One-command setup (
bin/setup, 277 lines), the permission-file renderer (bin/render-config, 382 lines), the mirror sync, the graph indexer, the audit spool reconciler and the Oracle refresh.
The ledgers, in full
- The append-only audit ledger. Every action that matters (a finding recorded, a decision made, a ticket drafted, an index run, a control refusing, an override used) writes one row. A rule inside the database refuses to change or delete a row, and no agent can argue with a database. He calls it the non-memory property: it is not a conversation an agent recalls, it is the record of what the AI did. A deferral cannot be recorded unless a matching decision exists. A row that cannot be written is parked and replayed later through the same rules, and a write into an empty placeholder database is refused. When an agent uses an override, that use is recorded before it takes effect.
- Decision supersession. A decision that replaces another points at it. Policy changes are never edits: the blanket no-write rule, the tier model that replaced it and the three lines that later withdrew editing are each a dated decision with its reason, and each can be asked for.
The guards and the operating machinery, one by one
- The Bash command segmenter (
controlkit/segment.py, tested intests/test_segment.py). It splits any command the AI writes into its separate commands, on newlines and on;,&&,||and|even when they are not space-padded, strips leadingKEY=VALassignments and every redirection with its target, so the first word of each piece is the real program being run. Both branch guards use this one segmenter, so a branch creation buried anywhere in a long command line is still seen. - The branch-hygiene creation guard (
controlkit/controls/branch_hygiene_guard.py). Refuses to let an agent start a new branch (git checkout -b,git switch -c,git branch <name>) while an unmerged branch it authored still exists; deleting and the other branch-management commands always pass. - The commit-orphan gate (
controlkit/controls/commit_orphan_gate.py, with its own contract file). Blocks a commit made on one branch while a second authored branch is still unmerged intoorigin/main; committing on the orphan itself is always allowed, because that is how it is resolved. Both guards introduce anUNVERIFIABLEanswer that is distinct from "empty", so a check that cannot be made is not mistaken for a clean one. - The main-branch commit block (
controlkit/controls/block_main_commit.py). Refuses a commit made onmainand puts the exact corrective command (git checkout -b <feature> origin/main) in the refusal. - The Bash redirection guard (
controlkit/controls/redirection_guard.py). Reads the raw command text before the shell does and blocks any>,>>, numbered-descriptor form (2>,1>>) orteewhose target resolves into the read-only estate. - The render-config sentinel gate (
controlkit/controls/workbench_sentinel_gate.py). Blocks an edit to a workbench-tier estate repository until the sentinel left by the permission-file renderer exists, so work cannot start under a deny matrix that was never rendered. - The skill-active edit gate (
controlkit/controls/skill_active_gate.py). Refuses edits while a plan task is pinned but the skill that should be running it is not, or when the two name different tasks; the pin and the marker themselves stay editable, being the mechanism's own state. - The handoff-protection gate (
controlkit/controls/protect_handoffs.py). Blocks any write underplans/handoffs/unless the operator authorised it, by a consume-on-use sentinel or by an authorising phrase in his last message. - The manifest-validator write gate (
controlkit/controls/touch_manifest_validator.py). Beforebin/touchruns, proves the estate manifest exists and parses, the repository is in it, the manifest passes its JSON Schema, and the driver script and harness directory exist and are executable. - The allow-path sweep (
bin/lib/antisyc_allowpath_sweep.py). Reads the source of every control with Python's parser, finds every route by which a guard could let something through, and fails the build, and the doctor, if one is not written down in the Enforcement Preconditions doctrine. - Audit emission, spool and reconciliation (
bin/lib/emit_audit.py,bin/reconcile-audit-spool, 187 lines). Every audit row is written to the shared store or parked in a local spool and replayed later through the same rules; the emitter re-runs itself under the project's own Python when the store needs a library the calling shell's Python lacks. - The store cutover (
bin/migrate-to-turso, 183 lines, and the store adapter). One setting selects a local file or a remote database for every consumer; the access token sits in a synced file referenced by path, so it never enters git and a second Mac needs no copy step; the doctor prints the store address with the token stripped. - Continuous integration (
.github/workflows/ci.yml, 125 lines). Two jobs on every push: the full test suite on a pinned Python, with a pinned version of the syntax scanner and a synthetic machine configuration built so the real generators run without the operator's machine, plus a JSON check of five configuration files; and a syntax check of every shell script inbin/,scripts/and the hook folder. - The secret-leak defence. Three layers: a pre-commit scan of the staged changes for secrets (
.githooks/pre-commit), a test that no tracked file holds a token-shaped string, and drafted tickets that cite file and line without ever reproducing a secret value. - The pre-push gate (
.githooks/pre-push). A push is a backup, so the hook refuses nothing: the test suite and the hermeticity ratchet run in CI on every push, and the staged secret scan stays in pre-commit.bin/install-legacy-hooks(107 lines) installs the estate-side hooks of the five-layer defence. - One-command setup (
bin/setup, 277 lines): eleven idempotent steps, three machine modes, a dry run, and the doctor passing as the success test;bin/clone-legacy(63 lines) clones the eight repositories from the manifest. - The mirror sync (
bin/sync-legacy, 189 lines). Fetches and fast-forwards the eight read-only mirrors, writes one line per run tostate/sync-log.jsonland one audit event, and runs every thirty minutes under a launchd agent (built from a template) that the renderer installs. - The README and its live images (
bin/regen-readme-assets, 245 lines). A full technical presentation of the system whose three hero images are rebuilt from live state: a real doctor run, a real briefing response and a query of the most connected code across four technologies. - The Oracle live ingest (
bin/oracle-jira-auth, 172 lines;oracle/metrics/jira_live_source.py, 192 lines;bin/oracle-refresh, 48 lines). A one-time browser sign-in using OAuth 2.0 three-legged authorisation, which serves exactly one request on a local port to catch the code, keeps the rotating refresh token in a private file, and feeds the same interface as the saved export, so the dashboard recomputes from the live board and deploys on a daily schedule without a person. - The Oracle scope firewall and snapshots. A positive list of the eight production repositories that every findings-sourced metric must pass, and four frozen data sources (findings, commits, change requests across the four production web applications, tickets), each with a refusing loader and a pure transform, so every displayed number can be recomputed from a file in the repository. The metric catalogue is
oracle/metrics/catalog.py(367 lines). - The regulator-portal pages. Three published pages and a seven-part buildable epic that answer the owner's question whether an inspector can scan a code on a piece of equipment and see only the documents their agency is responsible for: a capability audit, an architecture page with a two-level access model and a record-retention tag set, and a plain-language overview.
- The verified-citation blueprint programme. Eleven coordinated specification sheets for a separate read-only oversight product (an analysis engine proposes, a model-free verifier confirms, confirmed claims append to a record), with a 66-task build graph, and a decision to keep the principle and drop the rest.
How the estate was analysed and its modernisation planned
- The estate intelligence corpus. The seed of
orientholds the estate as measured: lines per application, the largest files (one of 16,535 lines serving 143 endpoints), 1,386 public endpoints in one application, and the twin-model pattern. A second document rebuilds the history of the work from the ticket system's export, 5,966 rows by 3,913 columns, and from 20,628 commits. The usual data library cannot read that export, where one column name repeats 3,642 times, so a purpose-written parser was used and every row was checked for length before anything was counted. Two facts about the data come before any interpretation, every number carries the method that produced it, and the document ends by separating what is verified from what is not. It refuses its own most tempting conclusion: a ticket that cannot be traced to code measures traceability, not unfinished work, and it says so. - The cross-pattern synthesis. Three independent sources (the code history, the tickets, a recorded 77-minute working session) are set against each other, and only what all three corroborate is reported, as six patterns. It separates two questions that had been run together, whether a ticket is done and what the code does, and sets the design rule that follows: answer the one that can be checked.
- Bring-up overlays. Two of the applications are run locally without changing one tracked file: corrected files are mounted over the originals when the container starts.
- The strangler-fig pilot. The owner wanted a plain yes or no on whether AI could work on the oldest code without breaking production. The answer was built, not written: one fourteen-year-old application booted in a container against a copy of its staging database, its source mounted read-only, with tests that capture what its sign-in does today (status codes, cookies and their rotation, database rows, redirects). Those characterization tests are the parity contract a new implementation must meet. Strangler-fig, growing the new beside the old until it takes over, was chosen because it needs no write to the old code.
- Universal code-touch mode and the driver interface. A small kernel (open a session, run the quality gate, write the audit rows) with one driver per technology behind a fixed contract that was written before any driver existed. A repository with no tests gets its own exit code. A repository is promoted on a mutation that must break a test, not on having tests.
- Reflex injection. A six-layer design for making sure an agent performs a required reflex (this trigger, that tool call) whichever part of its instructions it happens to be reading.
- The Reality Reconciliation Engine (RRE-001). He took the pattern this project had found, AI working safely on old code, and turned it outward into a specification for a separate product: an engine that reconciles what a business's records say against what physical reality shows and stages or commits corrections, each with a way back worked out in advance. Version 1.1 came from five reviews by AI systems from three vendors.
- The agency portal: Story 0 blocks the rest. The owner asked whether a regulator's inspector could scan a code on a piece of equipment and see only the documents their agency is responsible for. The answer came as a capability audit, an architecture page with a record-retention taxonomy, a plain-language overview and a seven-story specification under one governing rule: the first story hardens access control, and no agency login is created until that story is verified.
- The audit-product extraction plan. A plan to lift the read, cite and record core into a small separate product for IT staff. The cut is mapped to three entanglements in named files, and an audit pass is given a measurable definition: every hotspot the graph shows surveyed, every confirmed defect holding a reproduction and a citation, every serious one a diagnosis, no edit to the estate and no secret value in any record.
- The hiring evaluation kit. A kit a fresh agent runs against a candidate for the engineer who would work beside him. Evidence channels are ranked (a résumé is hearsay and can only disqualify; a recorded interview shows behaviour under pressure; a paid work sample is the truth) and a weaker channel never outvotes a stronger one. The role is defined on three axes, each split into what can be taught and what cannot. Because a wrong hire would hold technical authority over an operator who judges work by evidence rather than by reading every line, the kit calibrates toward rejection, and it is built so that reciting his doctrine earns nothing.
- The competitive gap analysis. Thirteen dimensions on which a named product does something this one does not, each tagged as a gap, a deliberate trade-off or part of the stated goal. It opens with two rules to re-verify before acting and a section headed "What NOT to lose", naming the combination the research found in no other product: an add-only findings record, review by an independent sceptic, one operator on a flat subscription, and code analysis joined to a tickets-and-code page for the owner.
Receipts and Project Oracle: claims a person can check
- Receipts. The product designed from this project's findings, with its own page (Receipts). A receipt is a claim attached to a real thing a person can open: a file and line with the quoted text, a commit, a ticket, a number that can be recomputed, or a proven absence. Every claim the AI makes becomes a typed
Citation. One function,verify, which uses no AI model, is the only code allowed to turn it into aVerifiedCitation. A claim that fails is deleted and never shown. What passes is added to a record locked three ways: a database rule, the type system, and a chain of fingerprints that can be re-verified from its first entry. No column for a grade, score or verdict exists. - Principle kept without the cathedral. Having specified Receipts to building depth, he kept its one load-bearing rule and its metric catalog and dropped the chained ledger, the branded verifier and the 66-task plan. The rule: the AI never computes a displayed number; every number is a deterministic query that anyone can recompute and trace to its source.
- Project Oracle. One private page for two readers: seven headline numbers for the owner's monthly look, and a working board for the project manager. Each of its 24 metrics is one pure, named function over a frozen snapshot, and the engine and the checker call the same function. No clock is read inside a query: a "last twelve months" window ends at the latest activity in the data, never at today's date. Every data type in it is fixed once made, so a snapshot cannot change between computing a number and checking it.
- Frontend first. He had the page designed and hosted ahead of the metric engine behind it, so that the page would decide what the engine needed and nothing more would be built.
- The design brief. He gave the designing agent the data, the two readers, the story the numbers tell and five hard technical limits, and deliberately gave it no visual direction at all.
- The declarative metric catalog. A metric is a data record written in a closed vocabulary of comparisons (equals, is in, greater than, is not empty, has a link, length of, days between). Someone who does not program can read and change it, and no logic can be slipped into it.
- Frozen snapshots with their recipe. Tickets, commits, change requests and findings are each frozen into a committed file with the exact command that regenerates it and a fixed sort, so the file comes out byte for byte the same.
- The scope firewall. The page shows the estate and never the tool that audits it. The findings store also holds what the control plane records against itself, and counting every row would put the tool's own work in front of the owner as the estate's. A positive list of the eight applications sits at one choke point, and the loader refuses any row outside it. The same page cannot leak what it counts: the snapshot holds only an id, a severity, a status and a repository, never a finding's text.
- No verdict. Colour is a display setting computed when the page draws and never stored, and per-developer figures carry no colour at all. The instrument reports and people judge.
- Population on every figure. Each metric states what it was measured over. Cycle time is published twice, on the tickets that carry a resolution date and on all done tickets, the second labelled an upper bound. A proxy is named as a proxy where it is defined. The arithmetic is locked (whole days, nearest-rank percentiles) so anyone gets the same integer from the same export, and each ratio declares the tolerance within which a recomputation must agree.
- Pending tiles and the derived "As of". A metric not yet wired appears as a visibly empty tile, never as an invented number. The page's date label is derived from the data and set to the most cautious of the four sources.
- Identity by account, not by name. Two people at the estate share a first name, and matching by name would have mixed them up. The list of leavers uses account identifiers, was derived from the export, and was admitted only after it reproduced three known figures. Each developer's several commit addresses resolve to one person through a versioned map, and an unknown address goes into a bucket labelled unattributed.
- A grounding test for every metric. A metric is accepted when a test reproduces its known value from the real export.
- One interface, two sources. The whole metric layer ran unchanged when its source moved from the export file to the ticket system's live interface, because the new adapter imitates the old file's column names. The estate's account had simple access tokens switched off, so the full three-step sign-in was built from the standard library alone, with a refresh credential that changes on every use and is written back each time. The daily job is written to run from the project manager's own machine as its lasting home, so the page does not depend on Maxwell.
- Zero AI at view time. The page is static: no server, no database, no model, no network call, behind a login limited to the estate's people, at no running cost. A check fails the build on any AI library, and text an AI wrote is escaped like any untrusted input.
How it reaches the people who own and run the estate
- A finding becomes a ticket in a fixed form: why it matters, what happens now, what should happen, how to reproduce it, an implementation note, the branch to target, and a label marking it as drafted by AI. The AI drafts. Only his explicit promotion sends one into the suppliers' queue.
- The code-verification brief. One page for the manager at the staging gate, in that reader's own terms: a code reader that reports to you, with its limits listed (it does not decide what a bug is, make or move a ticket, contact a developer or change code). You never take its word; you open the file. It ends with one thing to try: one ticket, a few minutes, your call.
- "Using AI well". A guide for readers new to AI. Its method is a short list of habits that need no technical skill: you do not trust AI, you operate it, never on its word and always on the receipt.
- The onboarding guide and the operations handbook. A step-by-step guide for a Windows user that makes a measured promise (about 60 minutes to install, about 30 seconds a bug after that) and a plain-English handbook in nine sections: filing a bug, writing a ticket for the suppliers, asking and diagnosing, reviewing a change request, the daily loop. Both are published as a small documentation site.
- Project Oracle gives the owner the state of the estate in seconds, and the agency overview explains a design in five plain steps with no code.
- The roadmap. A site generated from a state file in which every item is restated in plain English and carries a
verifiedflag and adiscrepancynote, so a status that was only reported is told apart from one that was checked. - Maxwell directs the agents and judges their work by the evidence the machine produces instead of reading every line. What reaches him is the
orientsummary, the doctor's PASS, WARN or FAIL with a remedy on every failure, decisions already made and offered with one reason, an error reported as what was done, what it caused and what is proposed, and change requests opened without his asking. The decisions kept for him and the owner are promoting a ticket, promoting a tier and setting policy.
What was built
- The federation: the orientation service, the knowledge-store service with fourteen tools, and eight graph services over about 71,600 nodes, with 56 graph questions between them.
controlkit, with sixteen controls and fifteen executable contracts.- The doctor (1,012 lines, twenty-one blocks), the reality probe, 129 test modules of 20,259 lines, and a build pipeline that creates a synthetic machine identity so the real generators run.
- The five-layer push defense in all eight estate repositories, and the renderer that compiles the permission file.
- The store's schema in fourteen migrations, shared across machines, with machine and operator on every row.
- One-command setup for a new machine in eleven steps and three machine modes.
- A mirror service that refreshes all eight repositories every thirty minutes and refuses to pull over local changes or a diverged copy.
- Sixteen skills, fourteen drafted tickets and two full diagnoses.
- Project Oracle: the metric engine, four snapshot generators, the live ticket ingest, a daily job that recomputes and republishes, the two-view page and three explanatory pages.
- The estate documents, the onboarding guide (1,734 lines), the team guide (1,850 lines), the operations handbook, the roadmap site and the five-stage hiring kit.
- The pilot's container stack with its characterization tests, and bring-up overlays for two applications.
- A README whose pictures are real runs of the doctor, of
orientand of a graph query, regenerated from live state by one command. - Twelve numbered plans and twenty-two session handoffs.
What it achieved
- 1.78 million lines in eight repositories and four technologies are answerable by file and line through about 71,600 graph nodes.
- One call of about 3 KB replaces about 30 KB of reading at the start of every session and every helper.
- The control plane audits its own code harder than it audits the estate.
- Every metric on Project Oracle was accepted by a test that reproduces its known value from the real data.
- Each class of AI mistake is now stopped by a mechanism, named where it is enforced: an agent grading its own work, by the three-reviewer harness and the database rule; a severity rating changed with no reviewer, by the four-fact rubric; an agent abandoning approved tasks, by the stop gate and the menu guard; a guard that looks alive while allowing everything, by the typed kernel, the contracts and the reality probe; a branch built on commits that exist on one machine only, by the branch rules; a secret written into a file, by a refusal before the save.
- 141 commits and 70 numbered change requests, 131,150 lines inserted and 121,117 lines of text in the tree; 58 recorded agent sessions, the largest of which sent out 310 helpers.
- Receipts' spine was built on real data in two days, and twelve fresh reviews tested it for forged citations and leaked keys.
The problem it solves
- He knew this estate from the inside. It is the property software suite whose original products he had designed, and he came back to it as its only operator, working through AI alone.
- No agent can hold 1.78 million lines, and he judges the work by the evidence the machine produces instead of reading every line. An agent turned loose to search the whole estate fills its working memory with noise and then answers confidently from the noise. One file alone runs to 16,535 lines. So the estate had to answer questions, not be read.
- AI agents are infrastructure. He gave the layer beneath the coding assistant the rigour a company gives its billing system: its own tests, its own health check, its own audit record.
- The danger was never the old code. It was an AI with write access to software more than a hundred people use every day. He made capability something granted one repository at a time, after it is shown, and built it so that it can be withdrawn in three lines.
- An agent that finds a secret in the code wants to be helpful and rotate it or scrub the history, which breaks the operating rules. The answer on every tier: record the finding and stop.
- Words steer an AI reviewer. Tell it the code is "legacy" and written by a "vendor", and it finds what the words promised. So the words are removed before the code is shown.
- An agent grades its own work: left to itself, the agent that did the work marks its own findings and changes severity ratings with no reviewer named. He moved the rule into the database, where it cannot be talked round.
- A reviewer asked for a severity answers a different question: it will rate a serious flaw as minor because fixing it is awkward. He saw that the fault lay in the rating system, which let one label mix how bad a thing is with how hard it is to fix.
- A guard can be dead and look alive: a check that reads a field the real event does not carry allows every turn, and nothing in a test or a settings file shows it. He built an architecture that proves each guard against the real event.
- A gate that opens on something the agent itself wrote (a marker file, a typed phrase, a tag) is a gate the agent can walk through. He named that as the root pattern and built the cure for the pattern.
- No enforcement is total, and pretending it is, is how breaches happen. What his guards cannot see is written into the agents' own instructions.
- A wrong rule in shared memory misleads every agent that reads it. A rule is withdrawn by writing its opposite, and the old row stays as the record.
- An agent stops early and calls it prudence: it abandons approved tasks partway, or offers to stop minutes into a short task. It also reads his casual wording as an instruction. He ruled that the fix must not depend on how he phrases a request.
- His own description of the problem could capture the harness built from it. He added a reviewer from a different AI vendor that never sees his vocabulary.
- An answer to "is this feature built?" read from the local copies comes from code the team does not run, because they lag the tested branch by hundreds to thousands of commits. He pointed the whole system at the tested branch in one change.
- None of the estate's 5,966 tickets says what "done" means. So "is this ticket done?" cannot be answered by anyone, and "what does the code do?" can. The tool answers the second and never pretends at the first.
- A finding is only useful if it reaches the person who acts on it through him. So it has to arrive as evidence he can open and carry into the conversation himself.
- Agents kept turning an observation into a rule: the suppliers press the merge button, so the suppliers must decide. The owner holds the deed. He had that wording removed everywhere and wrote the difference into the traps.
- An AI must never compute a number that a person will act on, and a page about the estate must never show the tool's own faults as the estate's.
- A save must never be refused for a reason that has nothing to do with the work. He ruled that a commit is a save and a push is a backup.
How he built it
Maxwell builds by directing AI agents. What follows is each mechanism, under its real name.
What the AI must treat as true: getting a true answer about code it has never read
orient, first. Every session and every helper agent makes one call before its first reply, even to a greeting. It returns in about 3 KB what would otherwise take about 30 KB of file reading: what the estate is and who owns it, what the agent may do in each repository, the live state of all eight repositories, the active traps, the open findings by severity, the latest decisions, the routing table of services and the working rules. It is composed afresh on every call from the store, the eight graphs, the sync log and the manifest, so no two agents start from different pictures and none starts from a stale one. A hook, a check the AI tool runs by itself at a fixed moment, injects the instruction at the start of a session and again after a long conversation is compressed. If the service cannot be reached, the agent stops and says so.- The federation is the API. Ten services reached through MCP (Model Context Protocol, the standard way an AI tool calls an outside service): one for orientation, one for the knowledge store, and eight code graphs, one per repository. Agents ask the services and do not open the files behind them. It is federated because the estate is: eight repositories in four technologies (Laravel 8, CodeIgniter 2.1.4, Swift, and Kotlin with Java), each with its own age, shape and blind spots. One graph per repository means an agent loads only the one it needs, each graph reports its own health (node count, share of the code extracted, source commit, age in days), a weak graph cannot hide inside a strong average, and a ninth repository is one line in the manifest. The rule is written as a principle, so it covers services that do not exist yet. Opening the files directly would bypass three things the services protect: the counters that show which knowledge nobody uses, the add-only audit trail, and the chain that says which decision replaced which. One exception is named: when a service is itself broken, reading its files to repair it is right, and the bypass is written into the audit record so it can be seen.
- The code-graph federation. Each repository is indexed into a graph of its named parts and how they connect, about 71,600 nodes across the eight. Every graph answers the same seven questions (search, one node, its neighbours, the most-connected nodes, the shortest path between two, a cluster, statistics), 56 in all. An agent resolves a name to a file and line through the graph and reads only that range. Searching a whole repository to discover things is banned by name in the working rules, because that is what floods an agent's working memory. One question shows each application's pressure points at once: the files of 9,000 to 16,500 lines, and four pairs of near-identical models where a fix to one silently needs the other.
- Quality-gated graph swaps, on the subscription. The full, meaning-level indexing run goes through the Claude subscription he already pays for, with no metered billing. If more than 25% of a run's chunks fail, the new graph is refused and the last good one stays. The indexer writes nothing into the estate: it copies each application's tested branch into the workbench and indexes the copy.
- Audit the staging branch, never the local checkout. Each application's tested code lives on its integration branch, which is named differently in one application than in the other three. The manifest names each application's branch,
orientreports how far behind each local copy is, the graphs are built from that branch, and agents read the named branch without switching to it, because switching inside a mirror would break the sync that keeps it current. - The single manifest. One file lists the eight repositories with their branch, language, tier and driver. The hook text, the indexer, the sync job, the permission file, the doctor's checks and the federation table are all generated from it, and a test asserts that they agree.
- The knowledge store: findings, decisions and traps. Fourteen tools over one shared database that every machine points at. A finding carries a severity, a short summary, how to reproduce it and its citations, and moves through six fixed states. A decision carries its reasons and evidence and can name the decision it replaces, so a fresh agent sees the current ruling and the trail behind it and does not reopen it. Every read stamps the row, so the store can list what nobody has looked at in a given number of days: his test of whether it holds knowledge or is a graveyard. Every row records which machine, which operator and which session wrote it.
- The trap catalog. Twenty-four numbered traps, each a mistake an agent must not make, shown to every agent in
orientas one line each, with the full rule fetched on demand. Thirteen are facts about the estate (the old framework runs a PHP that cannot parse modern code; a widely used code-analysis tool does not support PHP), three are the operating rules, and eight are behaviours of the AI itself. A trap can be a test to run with the expected answer written beside it: before drafting a ticket for a custom error-reporting layer, plant an error and check that the standard kit misses it, and the trap says it will not. - Every claim cites. A claim about code names the repository, file and line. A claim about production names the error's signature. A claim about a change request names the changed lines and the acceptance criterion. A claim with no citation is marked
PENDING_EVIDENCEand cannot carry weight. - The anchor-date rule. When an agent reads history (commit logs, file dates, old handoffs), "last week" resolves against the date of the source and never against today.
- One source for the operating mode. What the AI may do in each repository is derived at the moment of asking from the manifest and the deny matrix. Every place that states it (the instruction file,
orient, the hook, the README) is checked against that derivation by a test that was written failing first. The permission an agent reads cannot drift from the permission in force. - One rulebook, two AI tools. The instruction file for a second AI tool, Codex, is generated from the first, with the hooks mirrored. Nobody edits the copy.
- The operating clauses. Fifteen short clauses loaded at the start of every session, ten that hold in any project and five for this estate. Among them: the most dangerous failure is a confident, plausible answer; every refusal is a claim that can be proved false, so cite three pieces or retract it; labels that imply authority are banned; no guessing at the operator's state; never decline to continue because of "context pressure"; run it, read the output, then claim.
Keeping the old system out of new work
The property suite's rebuild calls its version of this the contamination firewall. Here it is three mechanisms.
- Subagent isolation for read-existing-code. Any task that reads the estate's code runs in a fresh helper agent with no earlier conversation. The only channel in is the written brief, there is no back-and-forth inside it, and the working rules are repeated in every brief because a helper inherits nothing. The old code is read where it cannot spread into the session that plans or writes.
- Redacted framing. Before any of the estate's code is shown to an AI for review, the brief is stripped of the words that would tell it what to find: "legacy", "vendor", "subcontractor", "poorly-written", "rebuild", the audit score, the suppliers' names, the project's own name and the names of the traps, along with first-person ownership ("my code") and urgency ("blocker", "deadline"). A small library does the stripping and is precise enough to leave file paths and class names whole. His name for the reason is bias-recovery mitigation: an instruction to ignore a label does not remove the label.
- The AST rule pack. Every file an agent writes is scanned at once by structure, not by text, against eighteen rules. Nine are written for the estate's PHP. Eight of those catch insecure or obsolete PHP (passwords hashed with MD5, database functions PHP removed years ago,
eval, a secret with a hard-coded fallback, untrusted data unserialised, shell commands built from request input), so a pattern carried over from the old code is caught the moment it is written. One runs the other way and catches modern PHP written into the old framework, where it would not parse. Two more rules police the control kernel itself.
What the AI is blocked from doing
- The tier model and the capability assessment phase. Each repository has a tier. In the workbench tier, the four web applications, AI may edit and save locally on a
sandbox/branch and nothing more. In the advisory tier, the four mobile applications, it reads, answers, records findings, diagnoses, drafts tickets and comments on change requests. A read-only tier exists for reference. The files say plainly that this is the owner's policy while AI capability is being assessed and that tiers are promoted as capability is shown. The AI's own writable space, the workbench, is a separate folder, so no AI file ever lands inside the estate. - The deny matrix and its renderer. The permission file on each machine is generated from two data files: the manifest (which repository is in which tier) crossed with the deny matrix (which actions each tier forbids). Editing tools are refused outright on protected paths, and about seventy command patterns catch deletion, copying, moving, in-place editing and every history-changing git command aimed at the estate. The renderer owns exactly five keys of that file and preserves everything else.
- The 5-layer push defense. Five independent layers stand between an agent's local work and a production server, built on the premise that any one of them will be evaded: the command patterns (L1); a hook installed in each estate repository that always refuses a push (L2); each repository's push address rewritten to a name that does not exist, so a push that slips past the matcher fails when the network looks the name up (L3); an audit that counts every repository's unpushed commits (L4); and a guard that refuses any commit on a default branch (L5). One command installs the hooks and the dead push address in every estate repository from the manifest.
- Honest gaps (T-016). No matcher sees everything. The instruction file lists, by class, exactly what this one cannot see (a redirect inside a command, a path built while a script runs, a path passed as a variable), which layer catches each one anyway, and what is left to the agent's own obedience, which he calls the honor system. The README says the same in public.
- Enforcement Preconditions and the ratchet. The cure for the gate that opens on the agent's own token has three parts: weld each obligation to an act the agent cannot avoid, such as its own commit message; fail closed when a condition cannot be checked; and keep the root of the audit trail out of the agent's reach. What cannot be closed without breaking a legitimate use is written down as nine numbered entries, EP-001 to EP-009, each naming the guard, the condition, why it cannot be removed, how it is hardened and which other layer catches abuse. A test fails the build if that list and the code disagree, and a sweep reads the source of every control to find new openings of the same shape.
- The secret boundary. Named sensitive files may never be read into a brief or an audit record. Findings are recorded by file and line without repeating a single secret value. The catch sits before the save: staged changes are scanned, a hit refuses the commit, and the only allowance is one named fingerprint at a time.
- controlkit, the fail-closed control kernel. Every event the AI tool fires (a session starting, a tool about to run, a tool just run, the agent stopping, a helper stopping) goes to one program. It reads the event into a typed model, runs every control registered for that event in a fixed order and stops at the first refusal, giving the reason. Five kinds of failure all end in a refusal: an unknown control, an unreadable event, a mismatched event, a control that crashes, and a control that returns something that is not a decision. A check that cannot assess the state answers "unverifiable", which is kept apart from "nothing found" and refuses. A helper's stop passes through the same controls as the main agent's, so a helper cannot say what the main agent could not. Among its sixteen controls it refuses: a commit on the main branch; a new branch while the agent's earlier one is unmerged, and a commit that would advance past such an orphan; a redirect that writes into the estate; an edit to a workbench-tier repository on a machine where the push defense has not been installed; an edit while a plan task is pinned and its skill is not the one running; a handoff he did not authorise; a code-touch session against a repository whose manifest row, driver or test harness is missing; banned deferral wording written into a plan; a stop that abandons approved work; a claim that a plan is complete while an approved task has no evidence; and a question menu that offers stopping as one of the choices. Each refusal names the command that puts things right.
- Control contracts and the contract meta-test. Every control ships with examples that must be refused and examples that must be allowed. A test runs each one through the same entry point a real hook uses and fails the build if a "must refuse" example gets through. A guard cannot be built, tested and left unwired.
- Withdrawing a capability cleanly ("paused, not deleted"). Three lines turn editing off for every copy of the estate on any machine, using the permission system's own rule that a refusal beats a grant. The tier model, the push defense and the engineer pipeline are untouched, so the capability returns when those three lines are removed. The instruction file tells agents the resulting block is intended, so that none of them diagnoses it as a fault and works round it.
- Branch hygiene. A branch built on commits that exist on one machine only can collide with everyone else's work, so branching follows five rules: branch from the shared copy, one task to one branch to one merge, never commit on main, clear merged branches at once, and no second branch while the first is unmerged. Each refusal message names the reason and gives the exact command that fixes it.
- A commit is a save. What stays on the save path is local and instant: the secret scan, a check that a pinned task's commit touches only its own files, and the wording lint on plans. Nothing on it may need a service or take time, and a push cannot be refused at all. The proof of a task moved to the evidence gate an agent runs before claiming it, and the test suite moved to the shared build server on every push. Every hint at skipping a check was removed from the messages: bypass is banned.
- Push at every landable point. Agents push their branch and open a change request at each point where work could land and at the end of every plan phase, without being asked. The cautious operating mode is named in the file as no reason to hold work back.
- Least-privilege skills. Sixteen single-purpose roles, each declaring the tools it may use. The question-answering skill cannot write. The reviewers hold no write tools at all. The promote skill cannot post into the suppliers' ticket project.
Keeping an agent at work: the anti-sycophancy harness
- The anti-sycophancy harness. He named five ways the AI gave way: reading his casual words as his state of mind and suggesting a stop, splitting a task into "another session" unasked, stopping partway through, letting his tone soften its fixes, and claiming its working memory was full when it was not. He had the research gathered (five causes, 21 sources) and set it beside his own catalogue of 96 patterns in 11 families. The design has five layers and one constraint: it lives in hooks, gates and records, never in how he words a request. Every firing writes an audit row, so he can see how often each mechanism fired and how often a failure got through.
- The premature-stop gate and the vocabulary catalogs. Nine catalogs hold the wording of the failure: deferral, time-framing, handing the decision back, leaving itself a way out, winding down, surrendering to "context pressure", early celebration, refusing like a receptionist, and guessing at his mood. When an agent tries to stop on such wording, the stop is refused. He can authorise one stop: the override lasts sixty seconds and is used up by that stop, so it cannot be saved for later.
- The anti-pattern classifier. A small, cheap model at a fixed setting reads each final message against eight named classes. Four refuse the turn (time-framing, routing the decision back to him, multiple-choice menus, cutting scope), two attach a warning, and two look for missing citations and for carrying on silently past an error. It refuses when the model call itself fails and never stores a verdict that came from a failure.
- The question-tool stop-option guard. The same failure has a second form: a menu that offers "stop" beside the real choices. That menu is refused before he sees it. The agent may still ask about stopping in plain words.
- Handoff protection. A handoff written without his say-so is a way of stopping early with paperwork. Writing one needs his authorisation, and one authorisation covers one handoff.
- The META-LOOP. A skill that takes one observed failure and turns it into a permanent mechanical block, so that each correction he makes becomes part of the harness.
- Harness-Capture Detection. Every layer above is built from his own account of the problem, so the harness could come to flatter him. On a schedule, an AI from a different vendor reviews a sample of sessions against his stated goals, with no access to his catalogue, his wording or the audit records.
- The two-option rule on errors. On any error an agent either fixes the cause or stops and reports what it did, what that caused and what it proposes. Carrying on silently is forbidden.
- Decisions belong to the engineer. When the next step can be worked out from the facts, the agent makes the call and presents it with one reason. It does not hand the question back to him.
- Startable infrastructure is never a blocker. Anything that can simply be started (a container, a local database, a tunnel) is started. Reporting it as a prerequisite is named as the error, because he pays for execution and not for runbooks.
Who checks whom
- Cross-agent attestation. The database refuses any record of task evidence whose attesting agent is missing or is the same agent that did the work, and refuses evidence that is empty. A task cannot be claimed until every task before it holds such a record from a different agent. The rule sits at three layers: the database, the claim, and the evidence gate.
- The severity rubric. Reviewers do not assign severity. They report four facts from fixed lists (the worst case, how likely it is to fire, who is affected, how many independent defences remain) and a small pure program computes the severity and shows which row it matched. A label that disagrees with the computation is rejected.
- The adversarial review harness. At each phase boundary and at the end of a plan, three fresh reviewers run at once, each with one fixed lens: correctness, plan against implementation, and architecture. The text they see is redacted first. They hold no write tools. Each records its verdict under its own identity, and any one failure halts the work. A step stands in front of them: the test suite runs first, and a failing suite ends the review before any reviewer is asked.
- The plan execution harness. A written plan becomes tasks with a dependency order, and each task names the command whose output is its evidence. Tasks run one at a time: claim, pin, build, run the evidence command, have a fresh agent attest, record, and commit exactly one task. A mutation probe changes a line of source, confirms the tests fail, restores it and confirms they pass, so a green suite has to prove it is connected to the code.
- Plan scope freeze and scope-diff. When a plan is loaded, its approved task list is written into the add-only audit record, outside the plan file an agent can edit. When an agent claims the plan is complete, the delivered evidence is compared with that list and the stop is refused if an approved task has none. The earliest record of a plan is the baseline, so reloading a plan cannot quietly shrink it.
- The engineer pipeline. On a workbench-tier repository a fix moves through five skills: diagnose; contract (success criteria, each with the command that will prove it, and a plan of layers); build (one commit per layer on a sandbox branch); review (a fresh helper, given redacted text, scores the change against each criterion with file and line); and verify (the quality gate, the doctor, the test suite and the full audit trail). Nothing is pushed.
- The five-step diagnostic protocol. Reproduce, locate, compare with history, three competing hypotheses each with what would disprove it, and a two-track fix (the smallest that works and the ideal), so the choice of scope stays with the owner. "Reproduced" is a list of the concrete acts that confirmed it, and each trap consulted is recorded.
- Advisory review of the suppliers' work. A change request from the suppliers is read against its ticket and given one verdict per acceptance criterion (
PASS,LIKELY_PASS,FAIL,NEEDS_INFO), each with file and line. The AI comments. It never merges and never blocks. The files keep an observation apart from an authority: who presses the merge button is an observation, and the right to decide who merges is the owner's. - The roofer analogy. The owner holds the deed and the roofer does the shingles, so nobody asks the roofer for the deed. Credentials, database copies, certificates and settings are collected from the owner's own accounts by a written checklist. The suppliers are asked only the five things that live in their heads.
- The contribution model. Five roles and what each may land: the operator (the only one who merges, through the same change-request route as everyone), AI agents (change requests only, never the main branch, never skipping a check), outside contributors, the estate's owner (who sets policy and promotes tiers), and the suppliers (tickets flow to them; they do not merge here). The main branch is protected on the server, and that setting is itself recorded as a decision.
- Handoffs, the deviations register and the open-loops register. A handoff carries what was done with its commit references, the audit rows that prove each review, the doctor's exact counts with every failure explained, and a checklist of commands with expected output for the next session to run. Gaps between a plan and what was built go into a deviations register.
Proving the guards work
- The doctor. One command runs twenty-one blocks of checks in about three seconds. It does not read settings and report them. It tries to alter and then to delete a row of the audit record and passes only if the database refuses both; it builds a throwaway repository and attempts the forbidden commit; it calls the real services. His rule for it: demonstrate, don't claim. Every probe only reads, so the doctor cannot itself push to production even if the defences were down.
- The reality probe. It feeds every control an event shaped exactly like the real thing, runs the real hook as its own process and reads the exit code the operating system returns. Its only judgment is the comparison of two integers, outside the AI's reasoning and outside the test framework.
- Tests of the harness itself. 129 test modules with no product under test. They check the hook's output, that the deny rules match the written policy, that the schema applies to a fresh database, every control's refusals, that no committed file holds a token, that no test reaches the real store, and that every file a document cites exists.
Named concepts
The named concepts, defined
orient · orient first · The federation is the API · federation-first · the workbench · the single manifest · the knowledge store · findings, decisions, traps · decision supersession · stale_records · the trap catalog · Every claim cites · PENDING_EVIDENCE · Audit the staging branch, never the local checkout · audit_ref · behind_staging · the anchor-date rule · Subagent isolation for read-existing-code · Redacted framing · bias-recovery mitigation · the AST rule pack · the tier model (workbench, advisory, read-only) · the capability assessment phase · sandbox branches · the deny matrix · the 5-layer push defense (L1 to L5) · honest gaps · the honor system · Enforcement Preconditions (EP-001 to EP-009) · the ratchet · fail closed · controlkit · control contracts · must_block and must_allow · paused, not deleted · branch hygiene · A commit is a save · least-privilege skills · the Anti-Sycophancy Operating Clauses · run, read, then claim · the roofer analogy · the anti-sycophancy harness · the premature-stop gate · the vocabulary catalogs · the anti-pattern classifier · the question-tool stop-option guard · the META-LOOP · Harness-Capture Detection · the two-option rule on errors · Decisions belong to the engineer · Startable infrastructure is never a blocker · cross-agent attestation · task_evidence · evidence_shape · the severity rubric · the four facts · the adversarial review harness · plan scope freeze · scope-diff · the engineer pipeline · the five-step diagnostic protocol · the contribution model · the deviations register · the open-loops register · the doctor · Demonstrate, don't claim · the reality probe · the append-only audit ledger · the non-memory property · the estate intelligence corpus · the cross-pattern synthesis · the strangler-fig pilot · characterization tests · universal code-touch mode · the driver interface · reflex injection · the Reality Reconciliation Engine · Story 0 · Receipts · a receipt · Citation · VerifiedCitation · verify · Principle kept without the cathedral · Project Oracle · the AI never computes a displayed number · the declarative metric catalog · the scope firewall · no verdict · pending tiles · frontend first · zero AI at view time · the code-verification brief · You don't trust AI, you operate it · UNVERIFIABLE · the Bash command segmenter · the allow-path sweep · the render-config sentinel · a push is a backup · akf-gate · PASS, FAIL and VOID · signed runtime receipts · canonical reopen
What it shows
He can set AI up to work truthfully and safely on a system far too large for any agent to read, by replacing what an agent would have to remember, believe or promise with services that answer, records that cannot be altered and guards proven by attack, and he can carry what it finds to the people who own the system and run it every day.