跪拜 Guibai
← All articles
Architecture · LLM

Two Developers, 8,000 km Apart, Independently Built the Same AI Agent Architecture in the Same Month

By YuhaoLin2005 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

When two engineers on opposite sides of the world converge on the same architecture in the same month, the problem is real and the solution is structural, not stylistic. Deterministic, out-of-loop rule gates are becoming the standard answer to agent non-compliance, and both a production npm package and a reproducible research toolkit are available now.

Summary

Lin Yuhao, a 21-year-old student in China, and René Zander, a 32-year-old developer in Germany, independently built architecturally identical systems for enforcing rules on AI agents. Both use deterministic file-system checks, exit codes, and regex — with zero model involvement in the verification loop — to solve the same structural problem: LLMs cannot reliably verify their own output.

The convergence is not a coincidence. Self-verification fails because generation and verification share the same probability distribution; an agent that can be talked into breaking a rule has no rule at all. Across 200 trials, mechanical gates produced zero violations wherever they applied.

Zander's skillgate ships as a production-grade npm package covering the mechanical-gate layer. Lin's paper-validator adds four more layers: a safety pre-processor, neural gates that measure whether rules actually shift token-probability distributions, causal encoding experiments showing prose rules outperform code rules for reasoning depth, and a drift-prediction layer built on 12 features from 34 sessions. All experiments are reproducible with a single command.

Takeaways
Two developers independently shipped deterministic rule-gate systems for AI agents in July 2026 — one as an npm package, one as a Python research toolkit.
Both systems keep the model entirely out of the verification loop, using file-system checks, exit codes, and regex to enforce rules.
Across 200 trials, mechanical gates produced zero violations wherever they could be applied.
skillgate adds an instruction-sync gate that tracks drift between CLAUDE.md, AGENTS.md, and .cursor/rules — a feature the other system plans to adopt.
paper-validator adds four layers beyond mechanical gates: a safety pre-processor, neural gates measuring logprob shifts, causal encoding experiments, and drift prediction.
Neural-gate measurements on DeepSeek showed a constraint effect size of d=+0.578 with a Bayes Factor of 282,399.
Prose-formatted rules produced a constant ~0.25 SD reasoning advantage over code-formatted rules, while code-plus-gate yielded perfect compliance but the shallowest reasoning.
All paper-validator experiments are reproducible with a single command: `python -m paper_validator claim --claim all --trials 30`.
Conclusions

The parallel invention is strong evidence that deterministic out-of-loop verification is not a design preference but an engineering necessity driven by the mathematical structure of LLM generation.

Calling self-verification the 'Prose Barrier' captures a genuine structural limit: an agent grading its own output uses the same distribution it used to generate it, so no independent check exists.

The finding that prose rules outperform code rules for reasoning depth — while code-plus-gate yields perfect compliance but shallow thinking — suggests a tradeoff between enforced compliance and cognitive engagement that most agent designs ignore.

Measuring whether a constraint actually shifts logprob distributions at decision tokens, rather than just checking output, opens a window into whether rules change model behavior or merely change wording.

The instruction-sync gate tracking drift across CLAUDE.md, AGENTS.md, and .cursor/rules addresses a practical pain point that most agent workflows haven't yet instrumented.

Concepts & terms
Prose Barrier
The structural unreliability of LLM self-verification: because generation and verification share the same probability distribution P(token|context;θ), an agent cannot independently check its own output any more than a student can independently grade their own exam.
Mechanical Gate
A deterministic rule check — file existence, exit code, regex match — that runs entirely outside the model's generation loop, bypassing the Prose Barrier by never reading what the model wrote.
Neural Gate
A verification method that measures whether a constraint actually shifts the logprob distribution at decision tokens, revealing whether a rule changed the model's internal processing or merely changed its surface wording.
Causal Encoding
An experimental layer testing how rule format (syllogistic, imperative, or prose) causally affects reasoning quality, finding that prose rules yield deeper reasoning while code-plus-gate yields perfect compliance but shallow thinking.
Instruction-Sync Gate
A skillgate feature that tracks drift between instruction files like CLAUDE.md, AGENTS.md, and .cursor/rules, detecting when agent configuration documents fall out of alignment.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗