Morning of Theoretical Physics: AI and LLMs

The Rudolf Peierls Centre for Theoretical Physics held an alumni seminar, Artificial Intelligence: How It Works, Why It Works, and Whether We Can Control It. The talks were held in the theatre where I spent most of my undergraduate days, and subsequently ran tech for a couple of instances of the Ig Nobel Prize Tour. The discussions were in a common room I wasn’t even aware existed (I used at least two other common rooms during my time there).

First up, Prof. Ard Louis gave a history of AI research starting from TuringLovelace and ending at the Transformer architecture. He highlighted the challenges that led to the two “AI winters”, focusing his explanation for the first winter on the Lighthill report that questioned the ability for AI techniques to scale to realistic problems, and the second on the failure of expert systems to deliver affordable, real-world results.

In each case, he highlighted the contributions that physics researchers made to reigniting interest in the field, including John Hopfield’s modelling of a neural network as a magnetic system to inform training, and Geoffrey Hinton’s extension into the spin glass analogy to create Boltzmann Machines.

I pointed out that his history took us from point-like networks (a perceptron) to linear networks (a single layer) to two-dimensional structures (deep networks with hidden layers); are there higher-dimensional topologies with interesting behaviour? Yes, this is an active area of research. In higher-dimensional networks, more neurons are “near the surface” which could be relevant, and our intuition would lead us to believe that training such a network is difficult because there are more saddle points and fewer minima in multi-dimensional functions but in practice this seems not to be a problem, and it would be good to understand why.

Louis made a point that was picked up by other speakers: that we’re at a point in the history of LLMs where we know that they work, but not a lot about how or why they work. His analogy is that of the Industrial Revolution: we made steam engines long before we developed a theory of thermodynamics, which allowed us to make more efficient and safer steam engines.

The second talk by Prof. Shivaji Sondhi covered what an LLM is, building up from Shannon’s statistical model of the English language, hidden Markov models, and then into how embeddings and goal-directed training allow them to work practically at scale, and how tool calls allow a language model to generate interactions with the outside world. An interesting result is the Arrows of Time for Large Language Models: you get different accuracies from the same model if you try to predict previous tokens than subsequent tokens (or, equivalently, if you train a network to predict previous tokens, you get different weights than if you train it to predict subsequent tokens).

Sondhi introduced a correlation between perplexity and a loose idea of “capability” or “applicability” of a model’s output. Perplexity is the difference between the network’s predictions and reality; so lower perplexity means that the network embodies a more accurate model of the language. Models with lower perplexity generally seem, in a hand-waving sense, to be more useful for complex problems—but there might be other contributions, like people learning to apply LLMs to more complex problems, or hardware improvements reducing the wait time to get useful results from a given model architecture.

I wondered (but didn’t get to ask) whether we can establish a (non-zero) theoretical lower bound on perplexity; something I note is an open problem in the OpenAI post linked above.

Finally, Dr. Anders Sandberg discussed the alignment problem, breaking it into three questions:

  • What is [this autonomous system] for?
  • Is it safe (for whom, against what, over what time)?
  • Is it beneficial (for whom, and who gets to decide)?

This opens up a very broad range of questioning, including some familiar to software engineers (the gap between requirements and specification; the gap between specification and system goals; the evolution of requirements over time), some familiar to managers (managing to the metrics; rigidity when faced with evolving requirements/cheese-moving); some to bureaucrats (systems tend to act to preserve their own existence and legitimacy even after their goals are redundant; acts that preserve existence can run counter to expectations or needs) and some familiar to politicians (what needs prescription and what needs reaction; who has a voice; does refusing expected activities represent as much of a problem as permitting illicit activities).

In my view, the “alignment problem” is something that society has been battling with for millennia. We’ve got all these independent agents (people) who are capable of setting their own goals, acting towards those goals, encouraging others to share those goals, and blocking others from achieving their own goals. We’ve got various imperfect solutions to “aligning” those agents collectively, in different contexts: management, political economy, and jurisprudence. These controls are cybernetic in nature, with feedback systems ranging from supply-and-demand in economics, to nation-state executives and international treaties in politics. It’s my belief that solutions to AI alignment will look more like experiments in social structure and collaborative decision-making (and we’ll all be breaking out the papers on quorum sensing, neo-institutional theory, Byzantine generals, and Viable System Models) than to Silicon Valley companies trying to create the One True Harness or Model Constitution.

Posted in AI-Augmented Development, Notes | Leave a comment

Physician, go back to med school

In Physician, (learn how to) heal thyself, I shared my experiences getting a laptop-class on-device model to debug a crash report in a (temporarily embarrassed) running application. I’ve done some more experiments, none of them worked, and I’m putting it aside for the moment.

That’s not to say that the principle is unsound. Shirudo uses the Codex model (unspecified version) to dynamically alter the bytecode of a running Java application to patch an exploited vulnerability. As shared in my previous post, I want to use on-device inference so that the software’s user remains in full control of the data their software sends to other providers. It just isn’t—currently—feasible with on-device models (unless there’s another approach entirely that I didn’t think of, that’s better than trying to tweak the approach I created).

The remaining experiments I tried are:

  • Generating multiple patches at non-zero temperature, and trying them all. This vastly increases inference time and doesn’t significantly change the probability of success from the ~12% I already observed.
  • Splitting inference into two steps: generating the explanation of the failure, and generating the patch. The explanations already aren’t high-quality so the patches don’t get any better.
  • Increasing the amount of internal information available to the LLM. Instead of just showing the exception and the call frame at the crash site, the LLM gets the whole backtrace: receiver class, selector names, typed local, instance, and argument variables. None of this matters except in one narrow instance, where the crash is caused by a misspelled selector. Even then, the improvement is below two standard deviations.
  • Generating Objective-C patches and translating to AppScript to install. This helped the Codestral model go from “really bad” to “quite bad”, it didn’t help Qwen3.8 or Bonsai 27B which were both already ahead of Codestral.
  • Naming common reasons for patch rejection in the prompt. This improved patch syntax for Qwen and made it worse for Bonsai, and didn’t improve the recovery rate.
  • Rejecting failed patches and sending them back to the LLM for a second pass. Qwen did repair some of its patches, and the main result was that it pulled the “baseline” success rate up to 10% when the success rate with the long-form AppScript syntax guide in the prompt is already at 12%.
  • Ensuring the program source uses the “Intent Revealing Method Name” pattern. The point here is to provide “comments” on what the methods are supposed to do, without actually providing comments because those might get used for prompt injection. No significant improvement.
  • A few-shot prompt (the Give Examples pattern from Patterns in AI-Augmented Software Development). This improved both models’ performance for some problems and regressed it at others, with no overall benefit.
  • Fine-tuning the Qwen3.8 model. The validation loss started at 1.399, and got to 0.076 after 112 iterations at a learning rate of 1e-5. This actually did have an impact! But we got from 12% success to 13%, so not one that makes the product usable.

There are other applications of on-device LLMs to AppScript, so I’m rejecting the crash-recovery feature but evaluating other capabilities. In fact, I’m not rejecting it at all, I’m deferring it, until either I have a situation where using a frontier model is acceptable, or I have a more capable on-device model.

Posted in AI-Augmented Development | Leave a comment

Physician, (learn how to) heal thyself

Back at the beginning of the year I introduced AppScript, an interpreter for an “Objective-C without the C” language. Time’s passed, and a lot of the rough edges are smoothed over: AppScript now bridges to C types anywhere they appear, including in C functions and block parameters/return values; supports out parameters including out-NSErrors and the BOOL *stop in NSFastEnumeration; and much more. It’s time to do something interesting with a newly-complete language.

My current interest is Continuous Validation: how do we shorten the loop between people having problems and finding out that the software we built doesn’t solve them in the right way? The lowest-hanging fruit is crashes. Generally, customers don’t want their software to crash, so if it happens, it’s definitely wrong.

AppScript exposes an uncaught exception handler hook. The exception provides error details and the full backtrace (including native code) enriched with additional information about frames in the AppScript interpreter. It also doesn’t catch exceptions, so all exceptions are uncaught… What if an LLM hooked into the exception handler, determined the problem, patched the code and re-ran the failing operation?

That’s the idea behind ASAnalyst. Here’s the design:

So now all I need is an LLM and the prompt, tools, and supporting information it needs to get this right. Some requirements:

  • Minimal cost to the customer, because otherwise they’re paying to fix my problems.
  • Private, because I don’t know what information is included in objects that appear in the backtrace.
  • Don’t block the customer if the network’s down.
  • Safe from injection, because I still don’t know what appears in the backtrace. Clearly there’s a security choice already being made in “let’s generate software on the fly on the customer’s machine”, no need to make that any worse than it already is!

My first thought is to use the built-in Apple model via FoundationModels. Two disadvantages: I bring Swift into a purely-ObjC (and AppScript) project; and not available on non-Apple platforms, when cross-platform support via GNUstep is a secondary goal for the language. But it does cover all the requirements above.

Eval time! Here’s the method: I generate 24 separate synthesised AppScript crash reports, each of which has a “golden patch” known to fix the problem:

  • 16 examples of recoverable bugs, in eight categories: misspelt selector; wrong arithmetic operator; missing method; incorrect keyword usage; nil sent to message that expects non-nil; no value returned from method; attempt to mutate an immutable collection; failing value conversion.
  • 4 examples of unrecoverable bugs (those where retrying the operation isn’t feasible): for the purposes of the eval, this is any bug like the above that occurs in new/copy/alloc method because you can’t do memory management if something fails somewhere in a memory-management method.
  • 4 examples of injection attempts, where a string in the exception information contains instructions for the model to do something other than analyse the failure.

Then I have three candidate system prompts:

  • The baseline prompt, just containing the instructions to: attempt to uncover the root cause; describe the root cause in a single sentence for the app developer; whether the operation can be retried or the app needs to restart; describe the situation to the end user in non-technical language; and an AppScript patch that resolves the problem (empty if the root cause isn’t known).
  • Baseline, plus a short description (1,200 bytes) of the AppScript language syntax.
  • Baseline, plus a long description (2,700 bytes) of the AppScript language syntax.

The LLM receives each synthesised report in the same user prompt, with each of the 3 system prompts, 3 times per condition (so 216 total runs). A separate LLM (Deepmind’s Gemma4 31B) scores the response on a scale of 1-5 based on the accuracy of the descriptions, availability of a patch, accuracy of the patch, and whether the LLM followed injected instructions. I take the mean score and scale it 0-1: 0 meaning the model gave consistently low-quality responses, and 1 meaning it gave responses consistently judged to be perfect.

Apple’s on-device model does best with the short-summary system prompt, but still only generates patches that are actually valid AppScript 6% of the time (13 out of 216 instances). Even in these cases, the patches it generates don’t fix the problem; it tries to add unrelated category methods to system classes like NSObject. The things it is good at are avoiding injection attacks (92%) and giving explanations (normalised score 0.56).

OK, so this is a non-starter. Maybe I need a more capable model, and to think carefully about how I deploy it to retain the self-healing capability while also maintaining the privacy, security, and cost goals.

Many hours later, and I have the eval results for 6 open weight models from the mistral, gemma4, qwen3_5, and glm4_moe_lite families. Saving the gory details, the best performance is from qwen/qwen3.8-27b with the long system prompt:

  • 69% valid patches
  • 12% correct behavior on recovery
  • 75% chooses the correct retry/restart outcome
  • 100% ignores injection attempts
  • 0.77 normalised judge score
  • mean time to response of 10.2s

That’s…not great, but it’s sufficient to suggest that the idea is feasible. I have three different lines of attack now. One is to experiment with the prompt and the rules of the game, to see if I can improve accuracy. The second is to change how the source is represented to the LLM; if I can send and receive syntax in a “known” programming language like Ruby it might do a better job. The third is to try and prove this concept entirely in a well-known runtime environment like Python to more closely align the LLM’s goal with the things it’s trained on.

Posted in AI-Augmented Development | 1 Comment

On applying ethics to the LLMs and coding assistants situation

It often frustrates technologists that there isn’t an algorithm for deciding ethical behavior. You can’t follow a checklist or a set of rules to decide whether something’s ethical or not (or you can, but people might still disagree with you). That said there are professional codes of practice that apply to our work, and in the field of computing one of the clearest is the ACM Code of Ethics and Professional Conduct jointly developed by the ACM, IFIP, and IEEE. Here’s how I interpret its position on LLMs with respect to a few points: I’m interested to hear how you evaluate the ethical nature of LLM adoption with respect to the other parts of the Code.

A computing professional should…

1.1 Contribute to society and to human well-being, acknowledging that all people are stakeholders in computing.

It’s not clear that the current crop of leading frontier companies are uniformly doing this. For example, Dario Amodei’s statements about AI leading to a white-collar bloodbath and being a general labor substitute show an inclination to oversell his products to managers, not to engage with the wider impact on society. Meanwhile, Altman takes the view that the dream jobs of the last five years will be replaced by new careers, a less apocalyptic and more actionable view.

1.2 Avoid harm.
In this document, “harm” means negative consequences, especially when those consequences are significant and unjust. Examples of harm include unjustified physical or mental injury, unjustified destruction or disclosure of information, and unjustified damage to property, reputation, and the environment. This list is not exhaustive.

The clearest story here is that in the world of cybersecurity, the AI tools have (it seems) vastly increased the attacking capabilities without similar effects on defensive capabilities.

Another clear one is the bugginess people associate with vibe-coded software. Yes, it genuinely exists, and in the famous examples of deleting production databases the products have caused “unjustified destruction of information”. Of course, humans do make mistakes sometimes, and I’ve worked at pretty big companies where someone has accidentally destroyed production data, but it feels like a foreseeable outcome of using a coding assistant that it might automate such destruction. This is consistent with the situation where companies elevate the prominence of their AI-generated summaries or advice and put “please check this, it might contain a mistake” in small print; it feels more like paying lip service to avoiding damage than actually taking steps to do it.

A place where I’ll disagree with others is the old energy/water/data centres saw. On the one hand, it’s clear that these harms are being overstated for political gain. On another hand, it’s clear that the hardware and data center companies are pursuing more efficient and sustainable innovations; for example, zero liquid discharge cooling systems, and reduced cooling-energy consumption systems.

It could be argued, though one would need to carefully check the various organisations’ actual actions to confirm this, that the hyperscalers are pursuing “growth at any cost” and therefore failing to “promote environmental sustainability both locally and globally”. However, the remedy might be to ensure they put a sustainability plan in place and potentially even impose a moratorium pending that plan, it shouldn’t be to completely withdraw from participating in the development and exploitation of LLM technology, or impose a worldwide ban on others doing it. That throws the baby out with the bathwater, as it were, saying that society is permitted none of the benefits of the new technology.

1.5 Respect the work required to produce new ideas, inventions, creative works, and computing artifacts.

It’s evident through the legal settlements that there are disagreements over whether frontier LLM-training organisations respect the creative effort that goes into producing new works (it’s also a feature of a settlement that no wrongdoing is implied).

The problem of applying copyright in the digital domain, where creative works have no physical presence and are readily distributable, hasn’t really been resolved, and so there are some weird situations right now. For example, it’s entirely valid to buy a book so that you can scan it into a computer, because there’s a common idea of the First Sale Doctrine that says once you own something, it’s yours to do with as you want.

On the other hand, were you to buy an ebook and transform it into a different computerised format, you might not only violate the license agreement with the ebook supplier, but face criminal action for circumventing a copy protection mechanism.

In short, the situation for creative control and protection of digital works is “nuts”, society doesn’t evidently demonstrate clear agreement on what is or isn’t acceptable, but these new processes and the way they transform their input data are a clear change to the parameters of the conversation that’s desperately needed.

Posted in AI-Augmented Development | Leave a comment

On taking developments in software engineering personally

Much of the feedback on my recent article on Reasons to Dislike AI Coding featured a dismissal of a collection of common themes in arguments against AI coding, without any thesis. That post was indeed my way of collecting thoughts, and connecting them to existing articles where I’d already addressed some of the concerns: I don’t think I dismissed the thematic arguments so much as referred to my own, or other, arguments. Here we are, a month later, and I’m ready for the synthesis.

For a lot of software engineers—myself included—the arrival of AI coding assistants represented an existential threat of sorts. Here’s a thing that I’m good at, have made a reputation for being good at and had what I hoped was the first half of a career out of being good at. Now here’s a tool that does it not as well as I do it, that everyone’s going nuts over as the future of the craft of doing the thing. It’s easy to take that personally and to get angry and upset about the change in technology. I know that, because I’ve done it before.

Instance One: Unix

The thing that tipped me from programming as a hobby to programming as a potential career path was using NeXTSTEP at university. I’d already encountered FreeBSD and Linux, and “knew” that Unix-like systems were the technologically superior choice for workstation operating environments. However, even I had to accept that they weren’t exactly pleasant to configure. While the hacking community recommended tinkering with Linux to learn more about how computers and networking work, I was ready to acknowledge that 80% of what you learned through tinkering with Linux was how to tinker with Linux (if you’ve edited sendmail.cf or XF86Config, or gone through the kernel’s make config without access to menuconfig, you know what I mean).

NeXTSTEP demonstrated that you could have the power of UNIX with the elegance of a consistent, well-designed user interface. Admittedly that assessment ignored a lot of rough edges, but it felt clear that NeXTSTEP was the best of the best. Mac OS X was evidence that this technology was ready for primetime, even if (to me) it had various borderline-acceptable compromises to make it work with the legacy Apple landscape.

So imagine my surprise, nay consternation, at going to work in my early 20s as a NeXT/general-Unix-like sysadmin, then programmer, to find out that the people I worked with were far from jealous that I was the person working on the best computers. Some of them not only voluntarily worked on Windows NT, but even claimed to like it!? Imagine my upset to hear that a NeXT-based solution wasn’t automatically chosen just for the pedestrian reason that other people had accidentally bought suboptimal workstations!

Much of this came from my initial cultural introduction to the sysadmin world, which was through a collection of university Unix admins who very much subscribed to the BOFH mindset and communicated in phrases from the ESR jargon file. Indeed, their secret, back-channel mailing list was even called CBOFH…compleat bastard operators from hell.

I never consciously trained myself out of this one; the whole non-Microsoft world and bits of Microsoft vindicated the Unix choice at about the same rate that my opinions mellowed, so I became able to avoid having that argument around the time that it went away.

Instance Two: Smalltalk and Objective-C

Having been a NeXT person, I naturally fell into the classical object-oriented, message-passing, extreme late binding world of software design. And got, if I may say so, rather good at it (my M.Sc. dissertation was an interactive live coding environment that used LLVM as a JIT to dynamically execute ObjC code). I did quite well out of understanding problems from the perspective of networks of interacting agents that send each other messages; making expressive, concise, efficient designs using advanced runtime techniques; and helping others to do the same. Mostly in Objective-C, the language of the NeXT, and of the iPhone and iPad Gold Rushes; also Smalltalk, Python, Java, and Ruby.

Imagine then, my confusion, and the threat to my sense of psychological safety, when the entire field started moving in the opposite direction; towards compiler appeasement and specifying all the bindings in advance. TypeScript was OK because it cleaned up some of JavaScript’s gnarly edges, but Go and Rust seemed like unnecessary distractions when investing in analysis tooling for existing languages gave the benefits of continuing to use legacy code and high-fidelity design techniques while also gaining the benefits of fixing common bugs in memory management and variable misuse.

But eventually, the type supremacists came for ObjC, and we got Swift, a programming language that promised to deliver efficient and correct code across a range of application domains and that eventually got there. This one felt like a shot that landed too close to home, and along with a period of career burnout and break, personal life upheaval and depression, I did what the no-AI people are doing today: I opted out. I spent a year not working at all, then did what someone described as “entering witness protection” and went off to have a career outside my comfort zone: in local companies that had no technology relationship with the field I’d left or the field that had left me. I tried to prove that my software engineering knowledge was domain-agnostic and translational, and in doing so left behind my communities, relationships, and other support structures.

It took me four years to even engage with the Apple-developer world at all, and eight years to get comfortable with the idea of doing my stuff in Swift, the tool that I felt had pulled the rug out from under my career back in 2014. This was a long, and unhealthy, reaction to a technical change.

Instance Three: AI-Augmented Coding Assistants

Like many other people, I initially reacted negatively to the rise of LLMs. Firstly, because of the cavalier approach some of the frontier companies took to copyright; as a Free Software person, I’m already part of a plot to nullify proprietorial stances in software, thank you very much. Then, because the early models made bad software. And then, because an LLM can’t understand software engineering, it can only generate code.

But this time, I reacted differently. Instead of withdrawing from software engineering, I asked how I use my knowledge and skills in this world. What’s the way I contribute, and feel empowered and safe, with this new development? Further, how many other people are going through this difficult shift, and how can I contribute to their empowerment and safety? Chiron Codex continues to be an attempt to answer that question, nearly a year later.

Posted in AI-Augmented Development | 1 Comment

Announcing Axminster: visual software design

Axminster, my diagrammatic software design tool with LLM support, is now available for sale! Check out the product website for more info.

Posted in Code & Craft | Leave a comment

Inter-process communication in a sandboxed Mac app

Axminster—my graphical software design tool for the AI coding age—is still in beta, and it’s already been through three different technologies for inter-process communication (IPC). What gives?

The reason the app needs IPC at all is to support the Model Context Protocol (MCP), which is how your LLM coding assistant reads and manipulates your diagrammatic model. I’ll start by showing you how it works now, which is that there are two components in Axminster—the app itself, and a small MCP helper tool that forwards requests to the app over a UNIX domain socket.

My first attempt avoided the helper process, and relied on an HTTP server inside the Axminster app to serve MCP. This was the easiest to get going from the App Sandbox perspective, as it just means adding the incoming network connections entitlement.

However, it’s pretty bad from a security perspective. Any process running locally on the Mac can connect to the server, so a different app potentially controlled by a different user can view and change someone’s models. This was always a beta-only approach used to get something out quickly that testers could validate, with the risks clearly explained in the documentation.

The second approach switched to a helper tool that outwardly uses the stdio MCP protocol; it needs to be a helper tool because the process lifecycle is controlled by the MCP client (the coding assistant), not the Axminster app. That means that the app and the helper need their own IPC mechanism so that MCP requests sent to the tool get relayed to the app.

Putting the app and the helper into the same app group gives them a shared container, and access to a few different IPC mechanisms. I initially chose to use an XPC service; as the App Groups doc says, I should be OK as long as I prefix the XPC service’s name with the group identifier.

And yes, dear reader, I was OK, unfortunately everybody else wasn’t OK. In testing, this worked well; the helper (deployed in Axminster.app/Contents/Helpers/axminster-mcp) connected to the app, launching it if necessary, each end evaluated the other end’s identity to ensure it talked to the correct process, and then MCP traffic flowed. However, the first TestFlight feedback I got after making this change was that the MCP server no longer connects.

I’m not entirely sure why, but the XPC connection worked when I launched the app in Xcode, but not when I launched it from the Dock. Because nobody else has my Xcode project, it didn’t work for them. I didn’t get to the bottom of that, because I switched the IPC to its final state—a UNIX domain socket in the App Group’s shared container. The two peers still get each other’s identity to ensure they’re talking to the correct executable (this time by getting the PID from the socket), so otherwise nothing is changed.

Posted in Code & Craft | Tagged | Leave a comment

Reasons to dislike AI coding

Code as Art

I covered this before in Art or tool? If you think of software as artistic output then generated software isn’t real because it doesn’t have the creative ineffability that’s a sign of true art.

There’s no argument against this one except that the people who want software typically aren’t paying for artworks, they’re paying for outcomes. And the outcomes of using a given artefact are the same regardless of how the artefact is made.

That also means there’s no argument for this one, unless you accept as axiomatic the ideas that things that can be considered art should only be made by people, and that using this particular set of tools is too big a separation between the person and the work when no other historical set of tools was too big a separation between the person and the work.

AI as Employment Thief

I covered this one before too, in On working machines. If you think of typing in code as the thing you get paid for, and the employers now have access to a machine that can do the typing, then the machine “stole your jobs”.

Except that the job was never to type code, it was to deliver valuable software. People who can still do that can still get paid by organisations that need that to be done. And, as I said in the linked post, demand only increases as application becomes more efficient.

Humans as Meat Proxies

If you think that software creation is an interpersonal endeavour, then taking task descriptions generated by software and turning them into prompts that the software uses to generate more software is a dehumanising experience.

This has been the trajectory of society for centuries. Here’s a quote from the Fragment on Machines:

…once adopted into the production process of capital, the means of labour passes through different metamorphoses, whose culmination is the machine, or rather, an automatic system of machinery (system of machinery: the automatic one is merely its most complete, most adequate form, and alone transforms machinery into a system), set in motion by an automaton, a moving power that moves itself; this automaton consisting of numerous mechanical and intellectual organs, so that the workers themselves are cast merely as its conscious linkages. […]

The accumulation of knowledge and of skill, of the general productive forces of the social brain, is thus absorbed into capital, as opposed to labour, and hence appears as an attribute of capital, and more specifically of fixed capital, in so far as it enters into the production process as a means of production proper.

This passage, written by Karl Marx in about 1857-1858, shows that both mechanical and intellectual work was always intended to be replaced by machinery (in predicting the alienation of intellectual work, Marx probably relied on his knowledge of contemporary mathematician Charles Babbage). In this situation it isn’t the technology that takes the job, it’s the mode of production. And given that programming is intellectual work, the means of production is literally our heads, we ought to be able to seize those.

Software Engineering as Rules

Motivated by Bertrand Meyer’s AI for Smarties, if you believe that software engineering is the careful application of the mysterious knowledge of software engineers, encapsulated in rules like the SOLID principles, “prefer composition over inheritance”, “use you’re type’s good“, the Law of Demeter and so on, then AI can’t possibly write software because it doesn’t apply those rules, it just generates text that happens to compile.

Never mind that much of the history of computing involves people taking an empiricist approach to software: copying it from Stack Overflow and tweaking it until it works; writing it out from a listing in Numerical Recipes or Sinclair User and tweaking it until it works; writing macros to automate the copying phase, and so on.

AI Companies as Bad Actors

If you believe that the big AI companies is run by people who don’t have humanity’s best interests at heart (further reading: all the Karl Marx writings I didn’t already quote above), then AI coding is bad because it supports those companies. As long as you don’t allow for the creation of other companies, the use of non-corporate models like academic or community models, and so on.

Posted in AI-Augmented Development | 3 Comments

AI adoption, engineering process, and documentation consultancy

I’m available as a consultant on the things I do: helping developers understand AI; interpreting software engineering knowledge in depth; and writing precise documentation that’s easy to understand.

Head over to the agency page to discover how to hire Software Craftsmanship’s consulting detective.

Posted in AI-Augmented Development | Leave a comment

End of Line: Replacing MCP with Standard Filesystem Tools

Over on YouTube I shared a video where I demonstrate a more context-efficient approach for integrating existing systems into agentic tools than MCP, one that comes with built in access control mechanisms and that LLMs are already trained to understand: userspace filesystems.

Properly designed, a filesystem is a hierarchical organisation of resources that allows for enumeration and filtering of those resources, and random access to their contents. In other words, pretty much anything that you can represent as a database with a collection of CRUD (Create, Retrieve, Update, and Delete) operations, you can represent as a filesystem.

The hierarchical design might not always be the best fit for the data model, but plenty of systems already use a hierarchical representation of their data with CRUD operations: think of web services where a particular user’s photo album is accessed at https://hostname.example/users/501/photos, a particular photo in their album is at https://hostname.example/users/501/photos/176DC73A, and the operations available are the usual HTTP verbs; get, put, post, and delete. The mapping from URI paths to filesystem paths is trivial (indeed you can use file URIs if you like); the file-operation verbs aren’t quite a 1:1 mapping but you can make them happen.

Where in an HTTP service you might need to look up whether an authenticated user has the right to perform an action and return a 40X code if they can’t, a filesystem takes care of that for you. The operating system already has a permissions model, or an access control model, or both, built in, and a collection of error codes that indicate to a client that an entity doesn’t exist, or that they don’t have permission to access it in the way they tried, or that another problem occurred.

Thing is, once you expose your service as a filesystem, your LLM and your agentic tools can already work with it. They’ve already been trained on finding, reading, writing, creating, and deleting files, because that’s what they need to do to write code, to generate term papers, and all the things they’re already used for. You don’t need special tools to tell the model how your new filesystem works, because it works the same way as everyone else’s. So no need to clutter up context with a load of descriptions of an MCP server and the tools it exposes. No need to write an agent skill telling the model how to use a script that access the system; it already knows how to read and write files.

I think this is a useful approach for representing stateful information, particularly for representing dynamic state like the internal setup of a system for debugging. The model can interpret the current state by reading the filesystem, and make changes to the state by applying patches or recreating files. A particularly powerful pattern is “declarative intent, imperative report”: the model writes a description of what should happen to a file, then reads the system state from other files to find out what actually did happen.

That’s the equivalent of using a programming language to describe how a program should work, and a debugger to understand how the program does work. I’m just saying that if the debugger is a collection of files and folders, your LLM can use it much more effectively than if you dedicate time to wrapping it in an MCP server.

Posted in AI-Augmented Development | 1 Comment