Writing
What I'm learning, made useful.
Notes on backend engineering, distributed systems, applied AI, and the decisions that make software last.
Agent Architecture: Should the Program or the Model Decide the Next Step
The difference between Workflow, Autonomous, and Hybrid is not the framework but who decides the next step. This article covers when each pattern fits, how each one fails, and a selection method that starts from task conditions.
Making Agent Output Verifiable: Specs, Context, and Checks
Three words separate one person writing code with AI from enterprise-grade delivery: reliable, efficient, sustainable. This piece covers spec-driven development, context engineering, verifiers, and Skill assets, and how the engineering center of gravity has moved from Prompt to Harness.
LLM Runtime: Which Layer Should Own Rate Limits, Retries, and Routing
Once the second business, the second provider, and the second tenant show up, calling the SDK directly is no longer enough. This piece covers the responsibility boundary of an LLM Runtime, multi-model routing, reliability under high concurrency, and how to choose an observability approach.
Where the Cost of a Model Call Comes From, and Where It Can Go Wrong
Token, Context, Prefill, Decode, and caching determine an Agent’s cost and latency; hallucination and Prompt Injection determine the floor of its risk. Without understanding these, none of the later architectural trade-offs has a basis.
Five Questions to Answer Before Putting Agents into Production
Cost and risk, who holds control, how delivery is verified, which layer owns model calls, and how it is evaluated after launch: answer these in order before writing Agent code.
Work Habits I Changed as My Scope Grew
Over years on commerce, risk, and fintech platforms, I stopped measuring a good week by features shipped and started measuring decision quality, blast radius, and whether the team works without me.
Rebuilding a Real-Time Risk Platform: Decision Record
After separating rule management, stream processing, and decision records, P99 decision latency fell from minutes to under a minute. The trade-offs, and which choices I would make again.
Local RAG Design: Store the Evidence First, Then Retrieve
How mt_rag separates replayable evidence, rebuildable query views, verified graph paths, and bounded generation—and why current source still wins.
Why a Code Hit Is Not Yet an Answer
Engineering retrieval has to bind results to a repository, a commit, and a symbol; a hit that is missing, stale, or from the wrong repository is only a locating lead.
Turning Retrieval Candidates into an Engineering Conclusion You Can Deliver
Retrieval finds the entry point and the original source confirms the fact; the final answer must keep verified, inferred, and unknown apart.
One Question, Three Sources: How Far Code, Jira, and Confluence Can Each Answer It
The hard part of cross-source retrieval is not finding more text; it is judging what the requirement, the design, and the current code can each prove.
When Local RAG Is Worth Calling, and When Reading the Source Is Faster
Am I missing a fact, or an entry point? That one question decides whether to retrieve at all.
How My AI Development Workflow Changed: From a Harness to Lightweight Prompts to Enterprise Agents
First a self-built Harness to make up for what models could not do, then a cut down to lightweight Prompts and four gates after Codex 5.6, then the same principles applied to enterprise Agents. What each step removed and kept.
Goal Routing: Deciding Permissions and Done Criteria by Request Type
Routing is not about labeling a request. It first determines which side effects this request authorizes and what evidence counts as done.
Patch Promotion: Writing Changes from an Isolated Environment Back Safely
PatchBundleV1 packages candidate file states from an isolated environment into a verifiable artifact, which a trusted Host then writes in journaled steps, reads back, and seals with an immutable receipt.
Loading Context on Demand: How It Works and What It Costs
Using evidence priority, rebuildable handles, and freshness fingerprints to control the material each round of reasoning actually needs to see.
The Stage Graph: Managing Task Stages with a Dependency Graph
Using a verifiable DAG to express node dependencies, execution authority, completion barriers, failure propagation, and recovery boundaries.
State, Events, and Artifacts: Recording Task Progress So It Can Be Resumed
Using revision/CAS, lease fencing, causal event chains, and content hashes to turn recovery and auditing from model narration into a verifiable protocol.
Verification and Readback: What Tests, CI, and Production Each Prove
From local tests to production readback, every layer of evidence must be bound to an explicit scope of conclusion, and none can substitute for another.
Multi-Agent Review: Splitting the Work, Isolating It, and Combining Results
Controlling multi-Agent collaboration with risk-driven selection, immutable execution plans, isolated context, completion barriers, and evidence-backed reports.
Write Grants and Isolated Workspaces: Limiting Which Files an Agent Can Change
StageWriteGrantV1 compresses task permission into a one-time capability bound to a version, paths, operations, and an executor instance, enforced jointly by an isolated worktree and layer-by-layer readback.
Why the LLM Controller Is Allowed at Most Two Retrieval Rounds
System Shadow starts from the original question; the LLM may rerank or request one supplementary retrieval, but it cannot override deterministic evidence checks or search without bound.
Why a Local Immutable CAS Holds the Evidence Foundation
Vector stores and graph databases are rebuildable projections; the CAS stores raw data, IR, and the CPG, and a Manifest Generation references those immutable objects.
Balancing 70/30 Hybrid Retrieval and the Graph Anchor
Vector, keyword, parent-child context, and verified graph paths are combined in layers so that similar content is never mistaken for proof of a call.
How Incremental Projection Lets Vector, Keyword, and Graph Evolve Independently
Layered hashes, a delta planner, consumer cursors, and shadow projections together handle updates, failure recovery, and rollback.
Why Vector, Keyword, and Neo4j Use Different Stores
Semantic similarity, exact identifiers, and relationship traversal are three different query problems; forcing them into one database sacrifices correctness and explainability.
Why DocumentIR, Issue IR, and CodeIR Have to Be Split
Documents, tickets, and code have different structures; only with a typed IR in place first can you chunk correctly, build the graph, and keep traceable locations.
Four Safety Gates for Coding Agents: Which Actions Need Confirmation First
Let the Agent handle routine work on its own; production, persistent data, cost, and irreversible actions need a stated risk and explicit confirmation first.
The Overall Architecture of an AI Development Harness
A file-based control layer for an AI development workflow: how it records progress, recovers from interruptions, and limits write access.