All systems
Personal Project · 2026 All three layers live since August 2026

Automated drift detection and enforcement for multi-agent AI coordination

Or: the case study about the audit trail that caught itself lying.

Architecture Automation AI Systems GitHub Actions
1

The Problem

Three AI tools, one body of work, no shared memory

I work across three separate AI interfaces on the same body of work. One is for strategy and writing, one for design, one for code. Each one is its own project with its own memory. All three connect to the same GitHub repos, so in theory they're looking at the same source of truth. In practice, "connected to the repo" and "knows what changed in the repo" are two different things. Ship something in the coding tool and the writing tool has no idea unless something tells it. Redesign a section in the design tool and the coding tool will happily build against the old version. Every session starts by trusting whatever it already assumes, not by checking.

That's not a hypothetical. It already cost real time once: a writing session drafted new content for a site section that had already been built and shipped, on a completely different template, because nothing had told that session the section existed yet.

In fairness to the AI, I wasn't the reliable one in that story either. I hadn't remembered the page was already live. Turns out the human in the loop needs the changelog just as much as the sessions do.

2

The Approach

Assume the rule will get missed, then plan for it

The instinct when something like this happens is to patch it and move on. I audited first instead. What that turned up wasn't one gap. It was a hierarchy of trust I hadn't been honest with myself about. Every session starts from an instruction: check the changelog, log what changed. That instruction lives in Custom Instructions for the writing and design tools, and in a reference file for the coding tool. But an instruction is a starting point, not a guarantee. It isn't even version-controlled, so there's no way to detect if what a session is actually reading has drifted from what it's supposed to say.

So the real design question wasn't "how do I get every session to follow the rule." It was "given that the rule will sometimes not get followed, what catches it, and how many chances does it get." That's why there are three separate enforcement layers instead of one polished one. Each catches the same underlying failure at a different point, on the assumption that the starting instruction alone can't be trusted to hold.

One more deliberate choice, not an oversight: the writing and design tools can read the coordination repo, but they can't write to it. A connector exists that would remove that friction. I didn't use it. Giving a chat session push access to the main branch is a bigger tradeoff than the convenience is worth. The friction of a manual handoff is the boundary, kept on purpose.

3

What I Built

Three layers, each catching the same failure at a different point

Layer one, mechanical. A GitHub Action that runs on every push to the coordination repo's main branch. It fails the commit check if it sees a versioned filename, a Word doc or PDF newly tracked as a file, or content changed with no matching log entry in the same push. It runs identically no matter where the push comes from: the command line, a coding session, or someone uploading a file straight through GitHub's own site. A false positive turned up in this layer on August 31. Pushes that only touched the decisions log were wrongly failing. It now accepts either log file and reports every violation in a run instead of stopping at the first.

Layer two, semantic. A scheduled session, every Sunday, that reads across all five repos and opens a flagged issue when it finds drift the first layer can't see: two documents that now contradict each other, a "revisit this if X happens" note where X already happened, a summary file that's fallen out of sync with the thing it summarizes. This one's live, not a future plan. That's worth saying plainly, since it's easy to undersell a background process nobody sees running. One dead end along the way: a version of this built to run inside a GitHub Action instead of as a scheduled session was built and working the same day, and pulled the same day, once its first real run showed the scheduled version already covered the same ground. The reason it nearly got built twice is the same problem the page is about: the routine had never been written down anywhere, so no session knew it existed. Built, tested, recognized as redundant, retired instead of kept around out of sunk cost.

Layer three, discipline. A skill called /align, invoked in a coding session whenever it's carrying something over from writing or design work: a decision, a draft, a piece of content that needs to actually land in the repo. Its most important step happens before anything gets written: check whether anything since that handoff was made has already overtaken it. A handoff that arrives describing work that's since been cut, or a decision that's since been reversed, gets caught here rather than committed as if it were still current.

The log format itself asks for a "why" next to every "what changed," so three sessions with no shared memory are reasoning from the same goal instead of only inheriting the same file state. That's real value. It's just not enforcement, which is what layers one through three are for.

4

Architecture

Five repos, two levels of access

incitechange.com (public, GitHub Pages)
  -- site source only: HTML/CSS/JS/images/data
  -- no planning docs, ever. A private doc landed here once
     by accident and was live with no auth. That's the incident
     the whole split traces back to.

incitechange-workspace (private, no Pages)
  -- the hub: changelog, decision log, per-project summaries,
     content drafts, design-review material
  -- mechanical layer lives here as a GitHub Action
  -- discipline layer runs as a skill, /align, invoked from a
     coding session. It lives at the user level, not tracked in
     this repo.

three more project repos (job search tool, learning tracker,
a private local-only journal)
  -- each keeps its own repo and its own build-level reference doc
  -- summarized, not duplicated, in the hub, so the writing and
     design tools can orient without needing every repo connected

Coding sessions: full read and write, local clone, pull and push
Writing and design sessions: read-only, manual sync, no write path
How the five repos split, and who can write where.

Coordination model

Five-repo split. One public site, one private hub, three project repos.

Access model

Full read/write for coding sessions. Read-only, manual sync for writing and design sessions. Deliberate, not a limitation.

Enforcement

Three layers. Mechanical (every push), semantic (weekly), discipline (/align, on demand).

Status

All three layers live as of August 31, 2026.

5

The Evidence

The audit trail that caught itself

Building the mechanical check surfaced a problem in the exact file it was built to protect. A run of changelog entries were all dated the same day, when the actual work had happened across an eleven-day gap. It was a plain copy-forward error, never checked against the real dates. I caught it by comparing git's own commit history against every entry header, and corrected it in the same session that had just finished building the automated check.

An audit trail that's been checked against ground truth and fixed once it was found wrong is a stronger claim than one that's just never been checked. This one has been checked, once, by the system meant to protect it, against itself.

6

Lessons & Results

Diagnose before you prescribe

Diagnose before you prescribe. The first version of "fix this" is usually a patch on the symptom, not the cause. Verify against what's actually true, not what you're assuming is still accurate, including your own past output. And automation solves the specific failure mode it's built for. It doesn't solve every failure mode just because it's automated, which is why this ended up as three layers instead of one.

There's a second kind of discipline in here worth naming separately from "catch the mistake after it happens": recognizing unnecessary work before it ships, even work that's already built and functioning, and killing it instead of keeping it around because it exists. The retired duplicate check is a small example, but it's a different muscle than the date-catch story. One is about correcting an error, the other is about not shipping redundancy in the first place.

The opening story taught one more thing: the gap isn't only an AI problem. I forgot the page was live too, and the same log that briefs the sessions briefs me.

Closed a specific, already-occurred failure mode: cross-session work built on stale assumptions.

Proven under real conditions. It caught a real error in its own output, and it caught its own redundant tooling before that shipped either.

Decision history is a search, not a meeting.

Declined a technically available shortcut (direct write access for the writing and design tools) because the friction it removes is a governance boundary, not a bug.

The pattern transfers. Source of truth, clear ownership, and layered verification are the same shape you'd want managing multiple vendors or contractors as well as multiple AI tools.