u/AWildMonomAppears

The missing primitive in every agent harness is a protected region

I wrote a post about why agentic coding falls off a cliff after a few weeks. Coding agents have no equivalent of the source/assembly boundary a compiler gives us. Prompt, code, tests, and previous agent output are all editable and all treated as input. A week-three "simplify this" prompt can quietly drop a GDPR consent check or weaken a fraud cap with tests still passing. I call it logic drift: a locally valid edit preserves the shape of the code but weakens an earlier constraint. It already hit the Linux kernel, where an AI patch dropped a __read_mostly annotation that looked like trivial cleanup.

The piece walks through why discipline, traditional process (tests, types, CODEOWNERS), and current harness features (AGENTS.md, Cursor rules, Claude Code hooks, Copilot instructions) don't fix it. They're advisory, the agent can ignore them silently. My argument is that the missing primitive is harness-enforced protected regions at statement granularity, something like a # lock: comment that the harness rejects patches against unless the user explicitly unlocks. Until a harness ships that, the only boundary that holds is one the agent can't see, which today mostly means micro repos, sparse checkouts, sandboxes, write allowlists.

reddit.com
u/AWildMonomAppears — 3 days ago
▲ 11 r/Kotlin

Rewrote some Kotlin libraries to take strings out of the API. The libraries are the kind where users define their own variables (streaming aggregator, SMT solver), and the naive design is a string-keyed map with casts at every read:

val budget = problem["budget"] as IntVar // compiles, may crash at runtime

First, I tried arity-indexed products: the types stayed end-to-end as schemas combined, but call sites read by position and two stats sharing a trait made the extensions ambiguous. I wasn't happy with it so I cut it. Second, typed keys declared by hand, which kills the cast but leaves you tracking keys yourself and writing each name as a string next to the property already carrying it. Third, schema as a singleton object with property delegates auto-registering keys, the same pattern as Exposed for SQL tables:

object HttpMetrics : StatSchema() {
    val requests  by stat(Sum().withValue(1.0))
    val latencyMs by stat(DDSketch())
}

snap[HttpMetrics.requests].sum

Renaming a property updates every call site, and the schema is a @Serializable kotlinx.serialization value. The same definition gives you compile-time typed access on the producer side and round-trips intact to a downstream service that doesn't share your Kotlin code. Most schema libraries pick one or the other; combining both feels new, and is particularly needed in cloud setups where schemas sometime need to be in YAML or cross service boundaries. Generic version pulled out as https://github.com/Eignex/skema (0.1.0); full writeup at https://eignex.com/posts/from-stringly-to-strongly-typed/

u/AWildMonomAppears — 7 days ago

There is growing AI slop on social media. Recommender systems push what works and there is some slop that works for someone approximately like you. These systems are functioning exactly as intended, which means the issue is what they're optimizing for. Not AI.

u/AWildMonomAppears — 11 days ago
▲ 29 r/Kotlin

I wrote a library called kencode for packing structured data into short URL-safe strings, and in the process ended up really appreciating how kotlinx.serialization is designed.

The short version: because kotlinx does its codegen at compile time, the format implementation sees a stream of typed calls instead of a reflection loop. That makes it easy to do tricks that would be painful otherwise, like packing all boolean fields and nullability flags into a shared bitmask.

u/AWildMonomAppears — 21 days ago