November 16, 2026•9 min read•...

edge_parity: Dual-Mode CLI and stdio MCP Engine for Edge Invariant Verification in Native Rust

RustMCPCLIAEOSEOCloudflare PagesArchitecture

Dual-Mode Edge Invariant Verification: CLI + stdio MCP Server

When maintaining programmatic directories, high-volume documentation hubs, or serverless web applications deployed to Cloudflare Pages and modern edge CDNs, deployment failures rarely occur in your application framework itself. Instead, they manifest as subtle, silent edge invariant violations:

  • A generated build crosses Cloudflare Pages' strict 20,000-file free tier limit, failing mid-upload.
  • Internal links point to missing clean-URL routes (/path/index.html vs. /path) or reference non-existent #fragment element IDs on the target page.
  • Monetization and affiliate funnels (/claim/ or /go/) leak crawl equity because an author forgot rel="nofollow" or omitted funnel noindex, nofollow robot directives.
  • Google Consent Mode v2 (gtag('consent', 'default')) fails to fire synchronously in <head>, exposing the domain to ad monetization halts or privacy non-compliance.
  • AI answer engines (PerplexityBot, OAI-SearchBot, Claude-SearchBot) are inadvertently blocked in robots.txt alongside bulk training harvesters, destroying Answer Engine Optimization (AEO) visibility.
┌────────────────────────────────────────────────────────────────────────┐
│                      edge_parity Engine Workflow                       │
│                                                                        │
│   [ Local dist/ Directory ]                 [ Live Edge Host ]         │
│              │                                       │                 │
│              ▼                                       ▼                 │
│   Parallel Dist Engine (rayon)              Live Probe (tokio)         │
│   ├── 20,000-File Cap Enforcer              ├── HTTP 2xx Invariants    │
│   ├── Sitemap & Search Index Parity         ├── /llms.txt Discovery    │
│   ├── Clean URL & Fragment ID Hash          ├── Consent Mode Checks    │
│   └── BM25 siteRadius Topic Drift           └── Funnel Tag Guards      │
│              │                                       │                 │
│              └───────────────────┬───────────────────┘                 │
│                                  │                                     │
│                                  ▼                                     │
│            [ Deterministic AEO + SEO Scorer (0-100) ]                  │
│            ├── 50 pts AEO: AI Bots, /llms.txt, JSON-LD                 │
│            ├── 50 pts SEO: TTFB, Canonical, RSS, Headings              │
│            └── Top-5 ROI Actionable Remediation Ranking                │
│                                  │                                     │
│                    ┌─────────────┴─────────────┐                       │
│                    ▼                           ▼                       │
│             Native CLI Exit             stdio MCP Server               │
│          (CI/CD 0 pass, 1 fail)          (rmcp 3.2.0 Tools)            │
└────────────────────────────────────────────────────────────────────────┘

Historically, teams attempt to catch these regressions using fragile PowerShell scripts, custom Python web scrapers, or slow third-party SEO crawl services that cost hundreds of dollars per month.

edge_parity replaces this ad-hoc tooling with a single, standalone native Rust binary (edge_parity.exe) operating in dual mode: an ultra-fast developer CLI and an in-memory Model Context Protocol (stdio MCP) server powered by rmcp 3.2.0.


Core Architectural Components

The engine is engineered around modular subsystems separating local filesystem verification, asynchronous HTTP network probing, and algorithmic topical-drift analysis:

Source FileModule Responsibility
src/main.rsCLI dispatcher (scan-dist, probe-edge, verify, score), --mcp stdio daemon entrypoint, --json structured formatting, and CI exit-code signaling (0 pass, 1 fail).
src/dist_scan.rsHigh-throughput offline dist/ parity engine: file-limit auditing, sitemap*.xml and search-index.json disk reconciliation, clean-URL and #fragment ID existence checks, rel="nofollow" verification, gtag consent enforcement, and BM25 siteRadius calculation.
src/edge_probe.rsConcurrency-bounded live HTTP probe across /, /robots.txt, /llms.txt, /ads.txt, /feed.xml, /sitemap.xml, /BingSiteAuth.xml, and sample hub/entity/funnel endpoints.
src/scorer.rsDeterministic 100-point (50 AEO + 50 SEO) URL evaluation engine with <sitemapindex> child-sitemap recursive sampling, BM25 semantic centroid calculation, and Top-5 ROI remediation ranking.
src/mcp.rsEdgeParityServer exposing scan_dist_parity, probe_live_edge, verify_site_parity, and score_url_aeo_seo as agentic tool calls over rmcp stdio().

1. Offline dist/ Parity Engine: Catching Defects Before Deployment

Running edge_parity scan-dist validates static build output in memory before a single byte touches a deployment pipeline. Built on rayon data parallelism and HashSet<PathBuf> indexation, it evaluates tens of thousands of static files in sub-second time:

  • 20,000-File Cloudflare Pages Threshold: Cloudflare Pages Free tier rejects deployments exceeding 20,000 assets. edge_parity acts as an immediate CI circuit breaker if file_count >= max_files.
  • Sitemap & Search Index Disk Parity: Every <loc> entry inside sitemap.xml and every record inside search-index.json is checked against disk (dist/<path>, dist/<path>/index.html, or dist/<path>.html). If a build compiler outputs orphaned routes or phantom sitemap URLs, the scan fails immediately with exact path locations.
  • Fragment Identifier (#id) Validation: Broken on-page navigation frustrates users and confuses search spiders. When an internal anchor links to /docs/architecture#actor-tree, edge_parity strips the query string and lazily verifies that id="actor-tree" actually exists in the target HTML file.
  • Commercial Funnel Guardrails: Enforces that every link pointing to affiliate, monetization, or checkout redirects (/claim/ or /go/) carries rel="nofollow", and guarantees that funnel target pages contain <meta name="robots" content="noindex, nofollow">.
  • Google Consent Mode v2 Inspection: Automatically inspects the HTML <head> for gtag( or googletagmanager.com references. If analytics scripts are present, it guarantees gtag('consent', 'default', ...) is declared synchronously before any tags fire.

2. Live Edge Probing: Validating Production Invariants

Static build files do not always mirror production behavior: Cloudflare Workers, custom _headers rules, reverse proxies, and CDN edge rewrites can alter response headers or break routing.

The probe-edge engine executes a bounded-concurrency HTTP sweep using reqwest and tokio::sync::Semaphore (configured across 1..=16 concurrent channels, defaulting to 8):

  • Core Root Invariant Probe: Concurrently checks critical discovery assets: /, /robots.txt, /llms.txt, /ads.txt, /feed.xml, /sitemap.xml, and /BingSiteAuth.xml.
  • Response Integrity: Validates HTTP 2xx statuses, ensures funnel headers enforce noindex, nofollow, and verifies that live CDN headers mirror required security policies (X-Content-Type-Options: nosniff, Strict-Transport-Security).

3. The 100-Point AEO + SEO Scorer & Top-5 ROI Remediation

The edge_parity score command provides an automated, objective evaluation of any live website on a deterministic 100-point rubric split evenly between Answer Engine Optimization (50 pts) and Technical SEO (50 pts):

#### Answer Engine Optimization (50 Points)

  1. AI Search Crawler Access (12 pts): Evaluates robots.txt specifically for search and grounding bots (OAI-SearchBot, Claude-SearchBot, PerplexityBot). Rather than a binary pass/fail, it verifies that conversational search engines can cite content even if bulk training scrapers (Bytespider, CCBot) are blocked.
  2. /llms.txt Discovery (12 pts): Inspects the presence of an /llms.txt file structured according to the llmstxt.org specification and verifies the discovery header <link rel="describedby" href="/llms.txt"> in HTML <head>.
  3. JSON-LD Entity Provenance (14 pts): Checks for typed Schema.org entities (WebSite, TechArticle, Person, Organization) containing authoritative provenance attributes (datePublished, dateModified, isBasedOn, and sameAs entity cross-links).
  4. Extractable Fact Density (12 pts): Measures non-boilerplate prose density, penalizing conversational fluff while rewarding structured factual containers (<table>, <dl>, <ul>).

#### Technical SEO (50 Points)

  1. HTTP Status & TTFB (8 pts): Sub-second Time to First Byte (TTFB <= 800ms) and clean HTTP 200 response.
  2. Sitemap & Robots Linkage (8 pts): Validates sitemap declaration within robots.txt and XML validity.
  3. Canonical & Metadata Tags (10 pts): Confirms valid <link rel="canonical">, descriptive <title>, and concise meta descriptions.
  4. Heading Hierarchy & Asset Alt (8 pts): Enforces a single logical <h1> and descriptive alt tags on all imagery.
  5. Internal Links & Topical Focus (8 pts): Validates internal routing and calculates BM25 topical coherence.
  6. Security Headers & Syndication (8 pts): Checks for HSTS, X-Content-Type-Options, and valid RSS/Atom /feed.xml.
=== AEO + SEO Scorecard: https://aiyoda.app ===
Overall: 94/100 (A) | AEO: 48/50 | SEO: 46/50 | TTFB: 112ms | Elapsed: 430ms
Sampled Pages: 5 | Mean siteRadius: 0.5164 | p95: 0.5443
Checks:
  [PASS] [AEO] AI Crawler robots.txt Access         12/12 — Search bots (Perplexity, OAI-SearchBot) allowed
  [PASS] [AEO] /llms.txt & describedby Discovery    12/12 — /llms.txt present and linked via rel="describedby"
  [PASS] [AEO] JSON-LD Entity & Provenance          14/14 — WebSite schema with dateModified & sameAs
  [WARN] [AEO] Extractable Answer & Fact Density    10/12 — High factual density across markdown containers
  [PASS] [SEO] HTTP Status & TTFB                    8/8  — HTTP 200 in 112ms TTFB
  [PASS] [SEO] sitemap.xml & robots.txt Linkage      8/8  — Clean sitemap cross-linkage
  [PASS] [SEO] Canonical & Meta Tags                10/10 — Canonical matched, meta descriptions populated
  [PASS] [SEO] Heading Hierarchy & Image Alt         8/8  — Single H1 per view, 100% alt coverage
  [PASS] [SEO] Internal Links & Topical Focus        8/8  — Mean siteRadius = 0.5164 (<= 0.85 threshold)
  [PASS] [SEO] Security Headers & /feed.xml          8/8  — HSTS + nosniff verified, /feed.xml active

Algorithmic Topical Coherence: The BM25 siteRadius Gate

A common failure mode in programmatic web generation is semantic drift: generating thousands of thin, disconnected doorway pages that trigger search engine spam classifiers.

edge_parity introduces an algorithmic guardrail: the BM25 siteRadius metric. During sitemap sampling, the engine constructs a document-term frequency matrix (TF-IDF/BM25) across sampled pages, computes the site's semantic centroid, and calculates the cosine distance of each individual page from that centroid:

cosine_distance(document_vector, site_centroid) = 1 - cosine_similarity(document_vector, site_centroid)
  • Cohesive Architectural Hub: mean_site_radius <= 0.60. All pages reinforce core topical expertise (systems engineering, Rust, distributed telemetry, compiler architecture).
  • Permissible Domain Breadth: 0.60 < mean_site_radius <= 0.85. Acceptable topical variance across distinct product verticals.
  • Semantic Drift / Doorway Spam Warning: mean_site_radius > 0.85 or p95_site_radius > 0.90. Indicates disconnected keyword stuffing, prompting CI rejection.

Model Context Protocol (MCP) Integration

Rather than requiring developers to switch back and forth between terminal windows and AI chat prompts, edge_parity exposes its entire verification pipeline directly to AI coding agents via rmcp 3.2.0 over stdio:

{
  "mcpServers": {
    "edge_parity": {
      "command": "C:\\Antigravity projects\\Rust\\target\\release\\edge_parity.exe",
      "args": ["--mcp"],
      "disabled": false
    }
  }
}

This enables AI agents pairing on web codebases to autonomously execute:

  • scan_dist_parity(dist_dir, base_url, max_files): Run immediately after static build scripts to catch broken anchors or file limit violations.
  • probe_live_edge(base_url, sample_paths, funnel_paths): Run post-deploy to verify edge routing.
  • score_url_aeo_seo(url, sample): Score the live site and immediately extract prioritized Top-5 ROI fixes into the agent's active planning context.

Frequently Asked Questions (AEO & AI Search Reference)

What is the primary difference between AI Search Crawlers and AI Training Scrapers in robots.txt policies?

AI Search Crawlers (such as OAI-SearchBot, Claude-SearchBot, and PerplexityBot) query live web pages on demand to ground real-time conversational answers and provide direct clickable citations and traffic back to the source domain. In contrast, AI Training Scrapers (such as Bytespider, CCBot, and historical bulk harvesters) recursively scrape entire sites to hoard text datasets for offline model weights, providing zero referral traffic. The edge_parity engine explicitly parses robots.txt per User-Agent block to verify that site architectures grant search and grounding bots access to static content and technical articles while maintaining strict disallow directives against bulk training scrapers and sensitive backend microservice proxy paths (/api/, /apps/, /books/, /war/).

How does the BM25 siteRadius metric detect programmatic doorway spam and topical drift?

The BM25 siteRadius metric evaluates topical coherence across static websites and programmatic directories by analyzing term frequencies across sampled pages. The engine constructs a multi-dimensional term frequency matrix, calculates the mathematical centroid of the site's overall content, and computes the cosine distance between each individual page vector and that central vector (cosine_distance = 1 - cosine_similarity). A tightly focused technical domain maintains a mean_site_radius <= 0.60 and p95_site_radius <= 0.85. If programmatic expansion creates disjointed, keyword-stuffed landing pages unrelated to the core domain, the metric spikes above 0.85, triggering an automated warning or CI failure before search engine spam algorithms penalize the domain.

Why does edge_parity implement both a native developer CLI and a stdio Model Context Protocol (MCP) server?

edge_parity is built in dual mode (CLI + stdio MCP) to unify human developer workflows, continuous integration pipelines, and autonomous AI coding agents under a single deterministic engine. As a native CLI, it executes in sub-second time (<1s–3s) using Rust's rayon and tokio runtimes, returning standard OS exit codes (0 for clean validation, 1 for failure) for pre-commit hooks and GitHub Actions. As an rmcp 3.2.0 stdio server, it exposes native JSON-RPC tools (scan_dist_parity, probe_live_edge, verify_site_parity, score_url_aeo_seo) directly to AI development tools (such as Antigravity, Cursor, and Claude Desktop), allowing autonomous agents to inspect build output, diagnose edge regressions, and verify audit compliance without leaving the chat interface.


Architectural Conclusions

Modern web deployments have outgrown manual checklists and slow external crawling tools. By compiling filesystem inspection, concurrent edge probing, and AEO/SEO scoring into a single native Rust binary, edge_parity establishes a deterministic verification gate.

Whether invoked as a sub-second pre-commit check, integrated into CI/CD pipelines, or exposed over the Model Context Protocol to guide autonomous coding agents, it ensures that every edge invariant—from Cloudflare Pages file limits to AI search discovery—is verified before and after code hits production.

Thanks for reading! Support our development efforts.
Support AIYoda on Ko-fi