LLM context rot isn't a bug. It's a mathematical property of how the attention mechanism works. Three interacting failure modes (softmax's sum-to-one constraint, RoPE's distance decay, and causal masking's primacy bias) combine to produce the U-shaped attention curve where models attend well to the beginning and end of context but lose the middle. Understanding the mechanism changes how you…
LLM context windows have a marketed size and a useful size, and they're not the same number. Research shows quality degrades gradually based on absolute token count, not fill percentage, and a 1M-token model at 40% full is far more degraded than a 200K model at 40%. Here's the research behind the Smart Zone, the Warn Zone, and the Dumb Zone, plus a Claude Code statusline that tracks which zone…
Opus 5 scores 96.0% on SWE-bench Verified vs Opus 4.6's 80.8%, a 15-point gap. But on blind user-preference coding leaderboards, Opus 4.6 ranks 4th (ELO 1547) while Opus 5 ranks 11th (ELO 1530). Synthetic benchmarks and human preference are telling opposite stories. I ran a two-round adversarial research workflow to figure out which signal to trust and landed on a mixed-model strategy.
The retrieval pipeline returned chunks that mentioned vaccination schedules but didn't contain the actual schedule data. The model saw evidence that was on-topic but empty of the answer - and correctly refused. The root cause wasn't the model, the reranker, or the query. It was the chunking strategy splitting tables and structured data away from the prose that named them.
Same question, same branch, same retrieval, same 10 evidence chunks with identical rerank scores - and one deployment refused while another answered with full clinical detail. The root cause wasn't retrieval. It was the LLM making a borderline judgment call on evidence that covered half the question well and the other half barely at all.
Vector search finds the right chunk but ranks it badly and waves through near-garbage that's vaguely on-topic. Reranking fixes that with a second model - a cross-encoder that reads the query and each chunk together instead of comparing two frozen vectors. The whole trick is affording an expensive judge by only running it on the cheap stage's survivors.
Most env-var validation checks that values exist. That catches missing config but misses the worse case - a value that is present, valid in shape, and silently wrong. Here is the asymmetric pattern for separating loud failures from silent ones in a Next.js server.
When one Go struct legitimately serves multiple consumer roles - producer, service, admin - declare three interfaces and let DI cache the singleton at the wide type while each consumer holds only the methods it can call. Same shape as io.ReadWriteCloser in the stdlib.
Most SQS idempotency guides reach for Redis dedupe keys or dedupe tables. If your worker's job ends in a terminal state-machine transition, the row's own status column is already the lock - and one UPDATE statement is the entire safety story.
A talk I gave to the Airvet engineering org on working with AI coding agents - the mental model, context engineering, and the Research → Plan → Implement loop that ties them together.
A talk I gave to the Airvet engineering org as a primer on AI - what GPT and RAG actually are, how neural networks, tokens, and embeddings fit together, and why the difference matters.
Solving Firebase Auth redirect issues on Vercel by implementing a proxy solution to handle SAML SSO authentication and resolve missing initial state errors.
Automatically format and lint code with Git hooks using Husky, Prettier, ESLint, precise-commits and lint-staged for pre-commit and pre-push workflows.
A practical guide to working with JavaScript Promises - from basic chaining and resolve/reject behavior to .catch, Promise.all fail-fast handling, and async/await error patterns.
Understanding the io.Reader and io.Writer interfaces in Go, and how accepting an io.Writer parameter makes your code flexible across files, HTTP responses, stdout, and in-memory buffers.
Deploying a Go service to a single AWS EC2 instance as a hardened systemd service - cross-compiling the binary, copying it across, creating a non-root service user, configuring systemd with the right hardening directives, and handling graceful shutdown.
A guide to implement authentication and authorization in AWS API Gateway, covering Cognito User Pools, IAM roles, and API keys with practical examples.
Bridging CloudFormation-generated runtime values - DynamoDB table names, API Gateway URLs, ARNs that do not exist until deployment - into a local .env file using the serverless-export-env plugin.
A detailed guide to using Serverless Framework pseudo parameters for referencing Lambda functions and other AWS resources in your serverless applications.
How the browser turns CSS changes into pixels - the five stages of the render pipeline, why some CSS properties trigger the full pipeline and others skip most of it, and how to avoid jank by understanding which path your changes take.
There are two caching strategies on the web: fingerprinted-immutable URLs and server-revalidated mutable content. Pick one per resource. Most caching confusion comes from conflating no-cache, no-store, and must-revalidate.
A closure is a function bundled with the lexical environment it was created in. That environment survives because the closure holds a reference to it - which is why each call to a function factory returns an independent counter.
How JavaScript actually shares methods between objects - the prototype chain, what `new` really does, and how ES6 class syntax maps onto the same underlying machinery.
A mental model for useEffect: moving past the lifecycle (mount/update/unmount) mindset to thinking about effects as a way to synchronize side effects with React state and props.
When to reach for useReducer over useState, and why. The Dan Abramov framing: dispatch tells the reducer what happened, the reducer decides how state changes - so the component never needs to know the update logic.