← zhaoyu.io

Engineering Notes

Architectural decisions, performance constraints, and trade-offs from production: CNBC-scale edge systems, AI-agent engineering, and the discipline that holds them together.

  • ReliabilityVerificationAI Engineering

    Your Checks Are Lying to You

    Run this in any repo with a gating script: ./check.sh | head -40; echo $?. If the gate fails, you still see 0, because without pipefail, $? is head's exit status, not the gate's. I measured it on a real gate in my own st…

  • Agent ArchitectureAI EngineeringRetrieval

    Agents Re-Derive Judgment You Already Paid For

    Every agent session starts from a blank context window, so it re-derives judgment you already paid for. You settle a tradeoff in March; in August an agent proposes the option you rejected, reasoning its way there with fu…

  • System Prompt ArchitectureLLM MechanicsAI Engineering

    Reinforcement Anchors Beat Emphasis: Compressing a Production System Prompt

    Production system prompts bloat by a predictable mechanism. The model does something wrong, so you add an instruction telling it not to. When that doesn't stick, you add a more forcefully worded one. NEVER do X. In capit…

  • Agent ArchitectureEngineering ManagementAI Engineering

    The Agent Run Is the New Unit of Work, and Reviewing It Is Management

    The genuinely new moment in AI-assisted engineering is not the chat answer; you watched that get produced and judged it in real time. It's when an agent comes back with finished work: it read the folder, edited the files…

  • Agent ArchitectureReliabilityEngineering Management

    Agents Degrade Quietly: Maintenance Is Where the Value Compounds

    Building an agent produces a visible artifact (there was nothing, now there is a working agent), so it reads as progress. Maintaining one produces no artifact; at best, nothing happens. So effort flows to building, and t…

  • AI EngineeringAgent ArchitectureSpecification

    Spec Quality Is the Bottleneck Now, Not Implementation Speed

    The industry is measuring AI-assisted development with the wrong unit of analysis. Code-generation speed is the vanity metric; the METR result everyone cites (experienced developers who felt 20% faster while measuring sl…

  • Agent ArchitectureReliabilityDistributed Systems

    Agent Failures Are Loop Failures, Not Intelligence Failures

    Every agent failure I've debugged this year decomposes the same way. The agent didn't lack intelligence. The loop lacked definition. It wandered out of scope because no boundary was stated. It "finished" without finishin…

  • AI EngineeringSEOStructured Data

    Why I Made This Site Readable by Machines, Not Just Humans

    A site now has two kinds of reader, and only one of them renders a page. Crawlers, retrieval pipelines, and agents pull the raw document straight into a context window and answer out of it, so a site built only for a per…

  • AI EngineeringAgent ArchitectureCareer

    The Three Tiers of Using AI, and Why Only Two of Them Still Differentiate You

    There's a real difference between using AI as a faster typist (autocomplete, chat-assisted edits, "fix this bug for me") and delegating a bounded unit of work to an agent that plans, executes across multiple files, and h…

  • AI EngineeringProductivityMeta

    Building with AI: The Compound Advantage

    I built most of this site through Claude Code as a deliberate workflow: the components, the type errors that blocked deploys, and the notes themselves all went through the same loop of prompting and review. The obvious c…

  • ArchitectureDistributed SystemsState Management

    The Front End Is a Distributed System, Starting with the URL

    Filter a dashboard, refresh the page, and the filter is gone. Send the link to a colleague and they see a different view. The usual diagnosis is that the state was never persisted, and the usual fix is a client store, wh…

  • React PerformanceHCI60fps

    Decoupling State from Render in LLM Streaming

    The naive way to build a streaming AI interface is to pipe a Server-Sent Events stream straight into a React state setter: a chunk arrives, setState(prev => prev + chunk) fires, the component re-renders. At sub-50ms toke…