# Plain-Text Context Architecture: Cutting $150/Day Agent API Burn and Scaling HTTP 206 Audio

*2026-12-03*

## Executive Summary

Autonomous CLI coding agents routinely re-transmit 100,000 to 240,000 repository tokens across dozens of metered API round-trips, burning $20 to $150+ per engineer per afternoon while suffering context-window decay and vendor lock-in. Shifting working state into local plain-text Git commits and trimmed 64,000-token briefings collapses marginal AI inference and text-to-speech spend to flat-rate baseline costs. Across four production passes, this architecture sealed standalone HTTP specification origins against cross-domain redirect leaks and deployed 34 multi-voice MP3 briefings over native HTTP 206 byte-range streams without interrupting an active 5-hour, 10-minute listener.

## Architecture & Protocol Mechanics

- **Deterministic Context Slicing:** Read-only preflight probes package only active file seams rather than accumulating volatile vendor chat history, cutting planning payloads from 240,827 tokens to 63,956 tokens (73.4% reduction) before code generation begins.
- **Strict Origin Diodes (RFC 9110):** Removing catch-all `301 Moved Permanently` fallbacks and cross-domain discovery links on `rfc9110.org` and `rfc9111.io` enforces standalone origin isolation, returning deterministic `HTTP 404 Not Found` responses on unmapped routes. Where secondary domains share legacy redirect maps, prefix-priority Nginx locations (`^~`) must precede `try_files` so root-level map rules do not shadow valid local directory indexes.
- **Build-Decoupled HTTP 206 Media Delivery:** Static site generators purge output directories on rebuild. Mounting rendered audio behind an Nginx `location ^~ /audio/` alias outside the ephemeral webroot—with explicit `audio/mpeg` MIME declarations and Xing seek tables—preserves kernel `sendfile` throughput and RFC 9110 `HTTP 206 Partial Content` byte-range scrubbing for locked mobile screens across virtual hosts from one shared directory.
- **Content-Addressed Local Synthesis (RFC 9111 Hygiene):** Local Piper ONNX models resampled via `ffmpeg` (16.0 kHz, 19.2 kHz, and 22.05 kHz PCM normalized onto a 24.0 kHz master at 64 kbps mono MP3) hash sanitized spoken scripts with SHA-256 outside Git, preventing metadata edits from invalidating rendered audio caches.

## Verifiable Wire Audit

Verify byte-range audio delivery on `sunpug.io` and non-redirecting origin isolation on `rfc9110.org` and `rfc9111.io`:

    curl -sI -H "Range: bytes=0-1023" https://sunpug.io/audio/raw/shors-algorithm-haskell-io-not-multiverses.mp3 | grep -iE "^HTTP/|content-type|accept-ranges"
    # Expected: HTTP/2 206, content-type: audio/mpeg, accept-ranges: bytes

    curl -sI https://rfc9110.org/nonexistent-audit-path | head -n 1
    # Expected: HTTP/2 404 (zero 301 cross-origin redirect leakage)

- **Idempotent Build Latency:** Repeat publish sweeps across all 34 episodes complete in under 0.2 seconds via SHA-256 manifest verification (`0` redundant re-encodes).
- **Zero-Downtime NixOS Activation:** Declarative `nixos-rebuild switch` reloaded `nginx.service` in place while preserving a continuous 5-hour, 10-minute live stream session.
- **Wire Attribution Hygiene:** Origin IP-hash logs flagged one datacenter `Chrome/124.0` host (`195.178.*.*`) sweeping four UTM-tagged social URLs (`?src=fb`, `?src=linkedin`, `?src=discord`) within 3 seconds (`13:40:12–13:40:15`), preventing automated link verification from distorting campaign attribution.

## Decision Criteria

- **Cap Metered Agentic Loops:** Audit engineering workflows for repetitive full-repository token transmission and standardize local plain-text context slicing for routine multi-file changes.
- **Isolate Media From Ephemeral Build Trees:** Serve static audio and binary artifacts via persistent Nginx aliases outside build-wiped webroots, enforcing explicit MIME types and `HTTP 206` byte-range verification in CI.
- **Enforce `404` Over Fallback `301` on Standalone Portals:** Audit virtual host rules and shared redirect maps so domain-isolated technical properties never leak mistyped requests or crawler equity upstream.
- **Filter Sub-5-Second IP Bursts Before Attribution:** Correlate UTM referrals against raw edge IP-hash timestamps to strip headless link-sweeper traffic prior to analytics ingestion.

---

[← Deterministic Python Boundaries and Edge-Cached Delivery Outperform Autonomous AI Loops](/briefs/speaking-human-ai-fails-python-pivot/) · [All Briefs](/briefs/) · [Isolating Headless Crawler /null Floods via RFC 9110 Wire Telemetry →](/briefs/metas-headless-crawler-null-404-logs/)
