Post

Increasingly convinced that specs are now the source and that code is an artifact akin to a lockfile.

34 reposts415 likes

As I said in an earlier reply, I've mused for decades on that, given a sufficiently detailed spec. "Sufficiently" is doing all the work of course. I remember laboring over a detailed but still insufficient functional spec, let alone the associated requirements gathering and system analysis.

Right. I would almost argue that a judicious lack of detail is a desirable, if not necessary, attribute of specs. The art is pinning the details that matter and leaving the rest for contextual decision-making

True that. I remember coming up with the wording of an error dialog during coding, and concede that a agent probably has enough info for that. But I also word it with knowledge of the user's demographic.

An analogy I've been using in a work SDD environment is a video editing project and a render. People getting over the hump of the code being a render you view, see a mistake in, modify the project, re-render...and then throw away the original render, has been the friction point.

Oh that's been how I see things for a minute now. I barely care about the source code anymore, the spec is sacred. If the code breaks a model can re-make it by following the spec. If the spec is wrong ... well god help us.

I believe in the Law of Inverse Complexity, which states that the easier it is to write down a requirement, the harder it will be to implement :-)

ok I wouldn't put quite it like this, and I say this as someone for whom conversations with claude are a first-class object and have been for like the past year

well, for one thing, specs can be misunderstood or mistaken or their translations may have unintentional side effects, and you can't tell sometimes what the overall effect of a system would be at scale or in edge cases. in many non-trivial instances you can't get 1:1 parity in the translation,

you can't directly EXECUTE the spec, you can't interrogate it online, and sometimes it takes less information to just have the code than the overall spec justifying it takes up; natural language shifts and changes in different times and places and contexts,

Spec-driven development is extremely useful, and that's what planning is done properly. Although, at least for now, plans have to be relatively small and digestible. The problem with specs-as-source is that if the spec was sufficiently complete it would (almost) be the source code itself.

Specs are great but insufficient, I find. They need to be accompanied by additional lower level architectural requirements and considerations: requirements around information hiding, acceptable code complexity, module boundaries etc. A lot of these are enforceable via static analysis tooling

See? See?! And here I was even envisioning @blowdart.me in a dark office corner film-noir style cackling with delight as I wrote that. And a spoon sticking out from a half-eaten can of beans on the desk.

Barry Dorrans@blowdart.me

Honestly I would welcome developers writing specs again because without a spec you can’t threat model effectively.

our team has gone full spec-driven. It was an interesting challenge as we are very opinionated on design, which doesn't translate to words, but we worked out a solid workflow there

Only half serious, but a lot of the practice of formal specification boils down to "how much can we simplify our model of the system and still have something useful enough for analysis?" Like do we have to specify that a particular batch job runs nightly, or is "it runs sometimes" enough?

BMAD-style spec-driven development makes sense for an AI SDLC, but I've been using an Agent Agency model instead: one agent per service, so tribal knowledge gets captured, not just specs. Specs are our best intentions; what actually ships drifts.

Specs as intent and shipping as drift is what I would keep in view. An agent per service captures the tribal knowledge but it also captures the drift as if it were the spec, and then nothing tells you which way the build has wandered.

Isolating a program from complex systems for testing is a lot of effort. Often solved with dependency injection of mocks, or exterior composition (to mocks). Mocks can drift and DI introduces codepath complexity. So: Build mock env from specs

Distributing software libraries for multiple languages is extremely costly for a software company (such as bluesky). Quality drifts between languages, maintenance burden is huge. So: Build _ API in our teams' lang from specs

Enduring specs protect users but shift complexity into adapters, migrations and ops, creating hidden integration cost. Do you prioritise stable external contracts or internal simplicity when planning a regeneration?

This one might be too extravagant so we'll see, but... Writing software for each platform (native ios, native android, web, etc) is extremely costly and requires middleware ecosystems like react native So: Build app for target platform from specs

Amending upstream is extremely hard to do. Monkeypatching, inheritance, configuration (if allowed), or forking. So: import spec, amend with your specs, lock in with tests

Ok ok wait, then you build a reference endpoint - a server that's basically a dummy, no live data, stateless as far as possible - that can be used during development to verify against. Then it's basically a oneshot project to build apps on any platform, any language.

“Nondeterministicly build other platform from specs” is a bandaid. If the spec is precise enough to do that effectively, it will look *a lot* like real code. And If we’re close to real code, we might as well be writing it with a compiler.

YES! I have been saying this, but it's good to hear it from a dev more senior than I am. We have to adjust our mental framework to stop expecting a code base that doesn't change, and instead, create a spec-base that is exhaustively detailed and says exactly what tests it needs to pass.

The only reason we need the code base not to change/evolve is that we have an incomplete set of tests due to "undocumented features". (e.g. the code is creating a race condition, and if it wins when it's supposed to lose, or loses when it's supposed to win, it fails.)

Software is specification, but precise. It's mostly that the languages we write software in suck. The way that they suck is that they flatten complexity at different levels of abstraction.

A function is a proof of the theorem that is that function's type. It's a fact about the universe. We build more complex theorems out of simpler ones; the top-level theorem (articulated as a spec) is simply that, the top level, not all the layers below it.

Yeah, I started thinking about this back in May, talking with other leaders who've gone through "AI Transformation" in their business. I don't think we're *quite* there yet – I think there's another piece of it. Tracing the model, weights, harness, memory and other pieces used too.

Feels like immutability is too strong a word to use here, since the code output would be still nondeterministic output. But yes, overall, this is the trajectory I see too.

I'm iffy about some of the spec-driven coding stuff, but that's mighty close to putting the code *behind* the tool where the human can't get unfettered access. The tool can distill the codebase in a durable way because it can't be backdoored, and (re)builds solely from its internal representation.

Are you using a spec “framework” like openspec or anything like that? Like where someone would start to guide their agents to write good specs?

I think spec writing for agents demands specificity that conflicts with the “move fast and break shit” mentality that increasingly permeated software development over the last decade plus. The quality of the thing being built benefits from the clarity and context, regardless of who/what codes it.

I don't actually know enough to confidently comment on what you're saying. From what I can understand, though, it would make sense that something like Bluesky would have to be written from a more theoretical standpoint than something you sit around and babysit.

I’d say that from the very early days of computing, we have always had one version of the program for humans to read and another for machines to execute. Those have diverged more and more over the years. This is just pushing the abstraction frontier (much?) higher than before.

I strongly suspect current AIs will indeed change how most people write code, although I'm not sure what the next stable plateau will look like. Also, it probably won't affect literally everyone. After all, some people still write assembly by hand today.

What's funny is there were some half-hearted attempts to formulate specification languages over the years, but it remained a shitshow But that's not a problem for the models I do use RFC 8174 for MUST SHOULD MAY for familiarity, and in case I need to read the spec

Wonderful article. It is correct that one of its primary intents was to visualize and reason about a system under construction and as a consequence, most of the artifacts I expected one to make using the UML would be thrown away. I’d add that a…

The biggest issue with all of these diagramming and notation languages is that they are impenetrable to outsiders. I spent weeks on a system architecture in ArchiMate but explaining hash line vs solid line with a solid diamond vs open arrow meant I had to bin it and redraw it using flowcharts

Also, purely fwiw, I think ultimately whatever standard emerges is going to have to be text based. That's people want to write and read. That's the domain models swim in. Diagrams are just too labor intensive and take up too much space on the page :( As much as I love UML

UML is, in my opinion, like quicksand for a project, or a bunch of nails thrown in the road. Closer to punishment than anything else. maybe agents can use it to keep sub agents in line better though

See that's why I say it was the *methodology* of UML that dragged it down. The graphs are expressive, but the methodology behind them is a slog Also, constructing diagrams is a burden compared to just typing stuff in imho a formal specification language would have to dodge both of those

I'm playing with using specs to generate a project that manages itself with constructs within its own code, with the goal that there'll be a kind of "second-order" spec that is type-safe and compiler-verified. Right now it just generates its own CLAUDE.md files but it might get weird soon.

Yes, but this isn't a new thing. Moggi (I think) talked about it in papers in the late 80s or early 90s. Well-typed programs are already this way; the code is a static artifact of the program's behavior at runtime.

I think your right but it also feels like we’re not quite there yet. Or is this now your practical day to day? And if so what does that look like for you folks? Would love a blog sized expansion of this idea

We've always been spec heavy with the protocol, but now all new software projects since the start of the year have been spec first

My take is that it's actually the user's prompt which is the real source and the specs themselves are (often) just such an artifact - often AI slop and not designed to be actually read.

If it's a library, I'm pretty interested in seeing the public API. I'll ask the AI to give me the API so I can review it before it goes to work. That seems like a pretty big chunk of a spec? In some cases, a spec might be considered the cross-language equivalent of an API.

from a post a few months ago people hated ;) "..Once the full specs are described, all UI, surfaces, endpoints, interfaces, every single thing the program *does*, the code can just be kept for historical reference, the spec becomes the valuable artifact and can be used to re-create it."

I also think that under a certain complexity threshold, the set of prompts that created that thing are much more important than people think rn. I'm finding good, clear prompting is a challenge for some people, even some very good coders. that results in churn, 'why does this model suck now'