<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nick-111</title>
    <description>The latest articles on DEV Community by Nick-111 (@senlin).</description>
    <link>https://dev.to/senlin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3993859%2F540fb5d1-0e4f-4f2a-9d35-36adf34836bb.png</url>
      <title>DEV Community: Nick-111</title>
      <link>https://dev.to/senlin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/senlin"/>
    <language>en</language>
    <item>
      <title>I Built a Machine-Verifiable Contract System for Python Code — Here's How It Works</title>
      <dc:creator>Nick-111</dc:creator>
      <pubDate>Sat, 20 Jun 2026 12:28:57 +0000</pubDate>
      <link>https://dev.to/senlin/i-built-a-machine-verifiable-contract-system-for-python-code-heres-how-it-works-3ifo</link>
      <guid>https://dev.to/senlin/i-built-a-machine-verifiable-contract-system-for-python-code-heres-how-it-works-3ifo</guid>
      <description>&lt;p&gt;I Built a Machine-Verifiable Contract System for Python Code — Here's How It Works&lt;br&gt;
Last week I wrote about building a governance layer for an autonomous AI system. One module got more questions than anything else: ContractVerifier.&lt;/p&gt;

&lt;p&gt;People asked: "How do you automatically verify that code matches its documentation?" and "Does this actually catch bugs?"&lt;/p&gt;

&lt;p&gt;Here's the deep dive.&lt;/p&gt;

&lt;p&gt;The Problem&lt;br&gt;
I have 1,240 Python files. When I change a function signature in one module, at least three things can break silently:&lt;/p&gt;

&lt;p&gt;The INTERFACE.md for that module is now wrong&lt;br&gt;
Every caller that uses the old signature is now broken (but Python won't tell you until runtime)&lt;br&gt;
Any test that mocks the old function name now tests nothing&lt;br&gt;
In a team, code review catches some of this. In a solo autonomous system with 380K lines, there is no code review. There's only the CI pipeline.&lt;/p&gt;

&lt;p&gt;I needed the CI pipeline to understand Python code.&lt;/p&gt;

&lt;p&gt;The Core Idea: AST → Contract → Verification&lt;br&gt;
ContractVerifier has three stages:&lt;/p&gt;

&lt;p&gt;Stage 1: Extract the truth. Parse the actual Python source with ast, walk every node, and extract every public function, class, method, and async function — with their full signatures, return types, docstrings, and raised exceptions.&lt;/p&gt;

&lt;p&gt;Stage 2: Generate the contract. Write an INTERFACE.md that formally lists every public API entry, grouped by kind, with machine-parseable structure.&lt;/p&gt;

&lt;p&gt;Stage 3: Verify the contract. Compare the generated INTERFACE.md against the actual code. Any mismatch — a function in code but not in docs, or in docs but not in code — is a violation.&lt;/p&gt;

&lt;p&gt;The key word is machine-parseable. This is not documentation for humans. It's a verifiable behavior specification that a script can check.&lt;/p&gt;

&lt;p&gt;Stage 1: Walking the AST&lt;br&gt;
Here's what the AST visitor extracts from a single Python file:&lt;/p&gt;

&lt;h1&gt;
  
  
  From hermes/strategies/grid_strategy.py
&lt;/h1&gt;

&lt;p&gt;class GridStrategy:&lt;br&gt;
    def place_orders(self, mid_price: float, levels: int = 5) -&amp;gt; list[Order]:&lt;br&gt;
        """Place grid orders around a mid price."""&lt;br&gt;
        ...&lt;/p&gt;

&lt;p&gt;async def run_grid_loop(symbol: str, interval: int = 60) -&amp;gt; None:&lt;br&gt;
    """Main grid trading loop."""&lt;br&gt;
    ...&lt;br&gt;
The visitor produces:&lt;/p&gt;

&lt;p&gt;GridStrategy                          kind=class        signature=class GridStrategy&lt;br&gt;
GridStrategy.place_orders             kind=method       signature=place_orders(mid_price: float, levels: int = 5) -&amp;gt; list[Order]&lt;br&gt;
run_grid_loop                         kind=async_function  signature=run_grid_loop(symbol: str, interval: int = 60) -&amp;gt; None&lt;br&gt;
It handles relative imports (resolving from . import X to full dotted paths), nested classes, async functions, and exception tracking. It knows when it's inside an &lt;strong&gt;init&lt;/strong&gt;.py and adjusts the module name accordingly.&lt;/p&gt;

&lt;p&gt;The visitor is ~140 lines of AST walking code. No regex, no string matching — it uses the same parser that Python itself uses.&lt;/p&gt;

&lt;p&gt;Stage 2: Generating the Contract&lt;br&gt;
The contract generator takes the extracted API entries and produces an INTERFACE.md:&lt;/p&gt;

&lt;h1&gt;
  
  
  INTERFACE.md — hermes.strategies.grid_strategy
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Auto-generated by ARES ContractGenerator at 2026-06-20 10:15:00&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Module Info
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Path&lt;/strong&gt;: &lt;code&gt;hermes/strategies/grid_strategy.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lines&lt;/strong&gt;: 312&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public APIs&lt;/strong&gt;: 8&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Public API
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Classs
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;class GridStrategy&lt;/code&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Grid trading strategy with configurable level count and spacing.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Line&lt;/strong&gt;: 24&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Methods
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;GridStrategy.place_orders(mid_price: float, levels: int = 5) -&amp;gt; list[Order]&lt;/code&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Place grid orders around a mid price.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Returns&lt;/strong&gt;: &lt;code&gt;list[Order]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Line&lt;/strong&gt;: 45&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Async Functions
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;run_grid_loop(symbol: str, interval: int = 60) -&amp;gt; None&lt;/code&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Main grid trading loop.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Line&lt;/strong&gt;: 287&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Dependencies
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;hermes.exchanges.adapter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shared.models&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Imported By
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;hermes.live_runner&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scripts.run_grid&lt;/code&gt;
Two output formats: per-module (one INTERFACE.md per Python file) and consolidated (one INTERFACE.md summarizing an entire package). The consolidated format uses &lt;strong&gt;N modules&lt;/strong&gt; | &lt;strong&gt;M public APIs&lt;/strong&gt; | &lt;strong&gt;K lines&lt;/strong&gt; in the header for the parser to detect the format automatically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stage 3: Verification&lt;br&gt;
This is where it gets useful. ContractVerifier.verify() compares the INTERFACE.md against the actual code:&lt;/p&gt;

&lt;p&gt;verifier = ContractVerifier()&lt;br&gt;
report = verifier.verify(&lt;br&gt;
    "hermes/strategies/grid_strategy.py",&lt;br&gt;
    "hermes/strategies/INTERFACE.md"&lt;br&gt;
)&lt;br&gt;
It returns:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "consistent": false,&lt;br&gt;
  "module": "hermes/strategies/grid_strategy.py",&lt;br&gt;
  "code_api_count": 8,&lt;br&gt;
  "doc_api_count": 7,&lt;br&gt;
  "missing_in_doc": ["GridStrategy.cancel_all_orders"],&lt;br&gt;
  "missing_in_code": ["GridStrategy.old_legacy_method"]&lt;br&gt;
}&lt;br&gt;
Two violations:&lt;/p&gt;

&lt;p&gt;missing_in_doc: cancel_all_orders exists in the code but nobody documented it. This blocks the build — you either document it or you explain why it shouldn't be public.&lt;/p&gt;

&lt;p&gt;missing_in_code: old_legacy_method is in the INTERFACE.md but the code removed it. The contract is stale. This also blocks the build — regenerate the contract.&lt;/p&gt;

&lt;p&gt;batch_verify() does this for every INTERFACE.md in a directory tree, handling both single-module and consolidated formats automatically.&lt;/p&gt;

&lt;p&gt;The CI Gate That Makes It Real&lt;br&gt;
Generating contracts is easy. Enforcing them is what matters.&lt;/p&gt;

&lt;p&gt;CiEnforcer has three gates. Gate 2 is the contract gate:&lt;/p&gt;

&lt;p&gt;def _gate_contract(self, modified, deleted):&lt;br&gt;
    for mod_path in modified:&lt;br&gt;
        py_mtime = source_file.stat().st_mtime&lt;br&gt;
        md_mtime = interface_md.stat().st_mtime&lt;br&gt;
        if py_mtime &amp;gt; md_mtime:&lt;br&gt;
            # Source was edited after the contract was generated.&lt;br&gt;
            # Contract is stale. BLOCK.&lt;br&gt;
            violations.append(...)&lt;br&gt;
The check is timestamp-based, not content-based. This is deliberate: comparing timestamps is O(1) and happens before any commit lands. Full AST verification (Stage 3) runs in the nightly audit. The timestamp gate catches 95% of contract drift at commit time with zero overhead.&lt;/p&gt;

&lt;p&gt;The complete enforcement flow:&lt;/p&gt;

&lt;p&gt;git commit&lt;br&gt;
  → pre-commit hook&lt;br&gt;
    → CiEnforcer.enforce(modified=["hermes/strategies/grid_strategy.py"])&lt;br&gt;
      → Gate: dead code      → PASS (not a new module)&lt;br&gt;
      → Gate: contract       → BLOCK (source modified, INTERFACE.md stale)&lt;br&gt;
      → Gate: integration    → PASS&lt;/p&gt;

&lt;p&gt;Commit rejected. Run:&lt;br&gt;
  python scripts/_ares_gen_contracts.py&lt;br&gt;
  git add hermes/strategies/INTERFACE.md&lt;br&gt;
  git commit&lt;br&gt;
The Bonus: Automatic Test Generation&lt;br&gt;
Once you have formal contracts, you can generate tests from them. ContractTestGenerator produces two types:&lt;/p&gt;

&lt;p&gt;Provider stub tests — verify the module's public API is importable and has the expected attributes:&lt;/p&gt;

&lt;p&gt;def test_GridStrategy_place_orders_stub():&lt;br&gt;
    from hermes.strategies.grid_strategy import GridStrategy&lt;br&gt;
    assert hasattr(GridStrategy, 'place_orders')&lt;br&gt;
Consumer mock tests — scaffold for verifying that callers use the API correctly:&lt;/p&gt;

&lt;p&gt;def test_GridStrategy_place_orders_consumer_mock():&lt;br&gt;
    from unittest.mock import patch&lt;br&gt;
    with patch("hermes.strategies.grid_strategy.GridStrategy.place_orders") as mock_fn:&lt;br&gt;
        # Replace with actual consumer import&lt;br&gt;
        pass&lt;br&gt;
These are scaffolds, not complete tests. They ensure every contract entry has a corresponding test file. Fill in the actual assertions as you use each API. If you delete a function, the stub test fails because hasattr returns False. If you rename a method, the mock target breaks.&lt;/p&gt;

&lt;p&gt;What This Doesn't Solve&lt;br&gt;
ContractVerifier tells you whether the code matches the documented interface. It does NOT tell you:&lt;/p&gt;

&lt;p&gt;Whether the interface is well-designed. A function that takes 15 parameters can be perfectly documented and still terrible.&lt;/p&gt;

&lt;p&gt;Whether the behavior is correct. def withdraw(amount: float) -&amp;gt; bool can return False for every call and still be contract-compliant. The contract verifies the signature, not the semantics.&lt;/p&gt;

&lt;p&gt;Whether the contract is complete. A module can have 100% contract compliance and still have undocumented side effects (file I/O, network calls, database writes).&lt;/p&gt;

&lt;p&gt;These are fundamental limitations of any static analysis approach. The contract verifies form, not function.&lt;/p&gt;

&lt;p&gt;The next layer — runtime monitoring via ActivityMonitor — catches some of what static analysis misses. If a function's contract says it returns bool but it actually raises an unhandled exception 5% of the time, the runtime monitor catches that. The contract verifier doesn't.&lt;/p&gt;

&lt;p&gt;Connection to AI Safety&lt;br&gt;
The AI safety community has a concept called behavioral specification: how do you formally specify what an AI agent should do, and then verify it does that?&lt;/p&gt;

&lt;p&gt;ContractVerifier is a micro-scale implementation of this idea applied to Python modules. The "agent" is a Python file. The "behavioral specification" is INTERFACE.md. The "verification" is the AST comparison.&lt;/p&gt;

&lt;p&gt;This is obviously not a solution to the full AI alignment problem. But it's a concrete, working example of the pattern: specify → verify → enforce. If you're designing governance infrastructure for multi-agent systems where each agent is a Python module (or an LLM with tool calls), this pattern scales.&lt;/p&gt;

&lt;p&gt;The key insight I'd offer to anyone building agent governance systems: don't make the specification and the verification the same person. The closed evaluation loop I wrote about last week applies here too. If the same code generates the contract and verifies it, you haven't proven anything — you've proven the generator and verifier agree with each other.&lt;/p&gt;

&lt;p&gt;The only real verification is external use. In ContractVerifier's case, that means: someone else running it on their codebase and finding violations I never anticipated.&lt;/p&gt;

&lt;p&gt;What's Next&lt;br&gt;
I'm extracting ContractVerifier as the next open-source module from ARES. Same approach as dead-scanner: zero dependencies, pure Python, works on any project.&lt;/p&gt;

&lt;p&gt;If you're interested in the intersection of static analysis, CI enforcement, and AI governance — I'd like to hear from you. Especially if you're working on similar problems at the agent level rather than the module level.&lt;/p&gt;

&lt;p&gt;GitHub: github.com/Nick-lll/dead-scanner X: x.com/senlin&lt;/p&gt;

&lt;p&gt;This is part 2 of a series on building governance infrastructure for autonomous AI systems. Part 1: Building a Governance Layer Without Knowing AI Safety Existed&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>api</category>
    </item>
    <item>
      <title>Building a Governance Layer for an Autonomous AI System Without Knowing AI Safety Existed</title>
      <dc:creator>Nick-111</dc:creator>
      <pubDate>Sat, 20 Jun 2026 09:38:30 +0000</pubDate>
      <link>https://dev.to/senlin/building-a-governance-layer-for-an-autonomous-ai-system-without-knowing-ai-safety-existed-i85</link>
      <guid>https://dev.to/senlin/building-a-governance-layer-for-an-autonomous-ai-system-without-knowing-ai-safety-existed-i85</guid>
      <description>&lt;p&gt;Building a Governance Layer for an Autonomous AI System Without Knowing AI Safety Existed&lt;br&gt;
I spent one month building an autonomous multi-agent trading system alone. Six engines, sixty trading strategies, twenty-five ML models, 8,600 tests. After 380,000 lines of Python, I discovered something that changed how I think about AI systems entirely.&lt;/p&gt;

&lt;p&gt;The strategies don't make money. But the governance layer I built to manage them might be more valuable than any trading strategy.&lt;/p&gt;

&lt;p&gt;What I Built&lt;br&gt;
ZEUS is an autonomous trading system with six engines: HERMES (execution), ATHENA (ML/quant), AEGIS (security), APOLLO (evolution), HADES (infrastructure), and ARES (governance).&lt;/p&gt;

&lt;p&gt;ARES is the one that matters for this post. It has 12 modules designed to answer a single question: how do you know if any part of your autonomous system is broken?&lt;/p&gt;

&lt;p&gt;The answer turned out to be surprisingly close to what the AI Safety community calls "agent governance infrastructure." I just didn't know that term when I built it.&lt;/p&gt;

&lt;p&gt;The Problem: Solo Development at Scale&lt;br&gt;
When you write 380,000 lines of code alone in one month, you hit a wall that has nothing to do with programming skill. You open a file you wrote three weeks ago and have no idea if it's still used. You find modules that import other modules that import modules that go nowhere. You discover that 40% of your "production system" is dead code that nothing touches.&lt;/p&gt;

&lt;p&gt;This isn't a code quality problem. It's a system observability problem. In a traditional team, institutional knowledge tells you what's alive and what's dead. When you're one person and Claude, that institutional knowledge lives in your head — and your head is unreliable.&lt;/p&gt;

&lt;p&gt;So I built tools to externalize it.&lt;/p&gt;

&lt;p&gt;The ARES Governance Stack&lt;br&gt;
Here's what 12 modules of AI system governance looks like in practice:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Module Vitality: SilenceScanner
The most fundamental question: is this module alive?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;SilenceScanner parses the entire Python AST, builds a directed import graph, and classifies every module into five categories:&lt;/p&gt;

&lt;p&gt;truly_dead: Exported symbols exist but nothing references them. These are candidates for deletion.&lt;br&gt;
fake_alive: Imported by something that is itself dead. A zombie module — looks alive, does nothing.&lt;br&gt;
standalone: CLI scripts, database migrations, build tools. No imports in, but that's by design.&lt;br&gt;
island: Imported by something, but missing its INTERFACE.md contract. It works, but nobody can verify it does what it claims.&lt;br&gt;
structural: &lt;strong&gt;init&lt;/strong&gt;.py files and API surfaces. The skeleton that holds everything together.&lt;br&gt;
The key insight: not all unreferenced code is dead. A database migration script has zero imports because it's called by Alembic at deploy time, not by other Python modules. If you flag it as "dead," you'll break production. SilenceScanner knows the difference because it has a taxonomy of standalone patterns (CLI, migrations, build scripts, test infra, server entrypoints).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Contract Compliance: ContractVerifier
Once you know which modules are alive, the next question: do they do what they claim?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ContractVerifier reads Python AST, generates an INTERFACE.md describing every public function, class, and method with their signatures, and then verifies that the actual code matches the documented contract.&lt;/p&gt;

&lt;p&gt;This is not documentation for humans. It's a machine-verifiable behavior contract. If you change a function signature without updating the contract, CI blocks the merge. If you add a new public method without documenting it, CI blocks the merge.&lt;/p&gt;

&lt;p&gt;In AI Safety terms: this is a basic form of behavioral specification enforcement. The system cannot drift from its documented behavior without explicit approval.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dependency Graph Analysis: IntegrationGraph
Builds a directed graph of all module dependencies. Detects:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Dead ends: modules that import nothing and are imported by nothing. True orphans.&lt;br&gt;
Cycles: A imports B imports C imports A. These are maintainability time bombs.&lt;br&gt;
Hubs: modules imported by 50+ others. Changes here have massive blast radius.&lt;br&gt;
Bridges: modules that are the sole connection between two subsystems. Single points of failure.&lt;br&gt;
This matters because in an autonomous system, dependency structure is attack surface. A cycle means a bug in one module can propagate back to itself through the loop. A hub means a single module's failure cascades to half the system.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Gate Enforcement: CiEnforcer
Three automated gates run before any commit lands:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Dead code gate: any new truly_dead module blocks the build. (Standalone modules are exempt.)&lt;br&gt;
Contract gate: any public function without a contract entry blocks the build.&lt;br&gt;
Integration gate: any new cycle or orphan blocks the build.&lt;br&gt;
The gates are enforced by the CI pipeline — not by human code review. This is crucial because humans get tired, miss things, or make exceptions. Automated gates don't.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Technical Debt Tracking: DebtTracker
Zero tolerance. Any module flagged as dead, any contract violation, any integration gap — it gets a debt item with a timestamp and severity. The CI gate treats all debt as blocking.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This sounds extreme. In a team setting, you'd negotiate debt. In a solo autonomous system, there's nobody to negotiate with. Either the debt is real (fix it now) or the rule is wrong (change the rule). No exceptions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Runtime Monitoring: ActivityMonitor
Static analysis tells you what the code says. Runtime monitoring tells you what it does.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ActivityMonitor hooks into the production event bus and counts every inter-module call. A module that appears alive in the import graph but has zero runtime calls in 24 hours is fake-alive — it exists, it's wired up, but nothing actually uses it.&lt;/p&gt;

&lt;p&gt;7-12. Lifecycle, Self-Destruct, Negotiation, Twin, Patterns, Health&lt;br&gt;
The remaining modules handle what happens after you detect a problem:&lt;/p&gt;

&lt;p&gt;LifecycleManager: four-stage module lifecycle (active → deprecated → removed → archived). No module gets deleted without going through this pipeline.&lt;br&gt;
SelfDestructManager: orchestrates the deactivation of silent modules. No Python file just gets rm -rf'd — that breaks imports. Deactivation means: log the dependency tree, verify no live callers, move to archive, regenerate contracts, verify the build still passes.&lt;br&gt;
NegotiationRegistry: before a module calls another module's function, it checks the version contract. If the callee's interface has changed, the caller gets a warning before production breaks.&lt;br&gt;
DigitalTwin: a sandboxed copy of the dependency graph where you can simulate removing a module and see what breaks. Like git branch for architecture changes.&lt;br&gt;
PatternMiner: five anti-pattern detection engines — circular dependency, god module (too many imports), shotgun surgery (too many callers), feature envy (importing across unrelated subsystems), and unstable dependency (depending on a module that changes frequently).&lt;br&gt;
HealthScorer: 0-100 score per module based on four weighted factors: references (30%), contract compliance (20%), test coverage (25%), runtime call count (25%).&lt;br&gt;
What I Got Wrong&lt;br&gt;
Here's the honest part.&lt;/p&gt;

&lt;p&gt;For months, ARES reported: zero dead modules, 100% contract compliance, health score 100, all six engines rated 3/3.&lt;/p&gt;

&lt;p&gt;This was a lie. Not an intentional lie — a structural lie.&lt;/p&gt;

&lt;p&gt;When the same person designs the scoring criteria, writes the scoring tools, runs the scoring process, and interprets the results, the output is guaranteed to look good. I had built a closed evaluation loop — a system that validates itself against standards it defined for itself.&lt;/p&gt;

&lt;p&gt;This is not unique to my project. Every AI system that evaluates its own safety without external reference points has this problem. If you define "safe" as "passes my safety tests," and you wrote the safety tests, you haven't proven safety — you've proven that your tests match your assumptions.&lt;/p&gt;

&lt;p&gt;The only way to break the loop is to expose the system to an evaluation framework you don't control.&lt;/p&gt;

&lt;p&gt;For a trading system, that's the market. Sharpe ratios don't care about your self-assessment. For an AI safety tool, that's external users. GitHub issues, bug reports, people using your tool in ways you didn't anticipate.&lt;/p&gt;

&lt;p&gt;What I'm Doing About It&lt;br&gt;
I extracted the first module — SilenceScanner — as a standalone open-source tool:&lt;/p&gt;

&lt;p&gt;pip install dead-scanner&lt;br&gt;
dead-scanner /path/to/your/project&lt;br&gt;
GitHub: github.com/Nick-lll/dead-scanner&lt;/p&gt;

&lt;p&gt;It's MIT licensed, zero dependencies, pure Python. It works on any Python project. It's not the most sophisticated module in ARES — ContractVerifier and PatternMiner are deeper — but it's the one that's easiest to verify independently. Download it, run it, and in 30 seconds you know whether it's useful.&lt;/p&gt;

&lt;p&gt;I expect to be wrong about a lot of things. Maybe dead module detection isn't as valuable as I think. Maybe the classification taxonomy needs adjustment. Maybe the whole approach of static analysis + graph theory is the wrong frame.&lt;/p&gt;

&lt;p&gt;That's exactly why I'm doing this. I need to be wrong in public, with data, so I can become less wrong. The alternative — being wrong in private while the system tells me everything is 100% — is far worse.&lt;/p&gt;

&lt;p&gt;Connection to AI Safety&lt;br&gt;
I didn't build ARES because I read AI safety papers. I built it because managing a 380,000-line autonomous system alone forced me to solve problems that the AI safety community has been thinking about for years:&lt;/p&gt;

&lt;p&gt;Behavioral specification: how do you verify an agent does what it claims?&lt;br&gt;
Containment: how do you safely decommission an agent without breaking the system?&lt;br&gt;
Observability: how do you know if any part of the system has silently stopped working?&lt;br&gt;
Dependency integrity: how do you prevent a failure in one agent from cascading to others?&lt;br&gt;
These are not theoretical problems when you have 60 strategies running autonomous trading loops. A "hallucination" in this context isn't a weird chatbot response — it's a trade at the wrong size, or a position held through a stop-loss because the risk module was silently deactivated.&lt;/p&gt;

&lt;p&gt;ARES is not a solution to AI safety. It's a set of concrete engineering patterns that address a subset of AI governance problems at the module/agent level. I'm sharing them because I suspect other people building autonomous agent systems are hitting similar walls, and the patterns might be useful even if the implementation is imperfect.&lt;/p&gt;

&lt;p&gt;What I'm Looking For&lt;br&gt;
I'm not selling anything. I'm not raising money. I'm looking for:&lt;/p&gt;

&lt;p&gt;Technical feedback: what am I wrong about? What would you do differently?&lt;br&gt;
Related work: are there papers, projects, or people I should be reading?&lt;br&gt;
Collaboration: if you're working on AI agent governance, observability, or safety infrastructure, I want to talk.&lt;br&gt;
If you're at Anthropic, DeepMind, or any team working on making AI systems more governable — I'd especially like to hear from you. I built this in isolation. I know there's a lot I'm missing. I want to learn from people who've been thinking about these problems longer than I have.&lt;/p&gt;

&lt;p&gt;I built a trading system that doesn't make money. But the governance layer I built to manage it — contract compliance, lifecycle management, dead code detection, dependency graph analysis, pattern mining, digital twin simulation — might actually be useful to people building autonomous AI systems. I open-sourced the first module. If this resonates, reach out: github.com/Nick-lll&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5axcvkx4y478g0xo595i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5axcvkx4y478g0xo595i.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>governance</category>
    </item>
  </channel>
</rss>
