r/softwarearchitecture • • 11h ago

Discussion/Advice How do you manage business rules that change more frequently than your application code?

0 Upvotes

A question for software architects:

How do you manage business rules that change more frequently than your application code?

In many systems, pricing, eligibility, validation and approval logic end up scattered across services, buried in conditionals and understood by only a few developers.

Would you rather:

  • Keep them in application code?
  • Use a dedicated rules engine?
  • Manage them through decision tables?

I'm interested in how teams handle testing, versioning and auditing when business rules change.


r/softwarearchitecture • • 18h ago

Discussion/Advice Explicit state machines and AI

12 Upvotes

Hi,

I've been a SWE for 7 years. I mainly did full stack with Java backend applications that are essentially CRUD.

I'm currently experimenting with a kind of fully automated development process via AI agents and found that telling the AI to use explicit state gave very good results whereas without I always had issues like buttons that shouldn't be there. E.g. a delete button that I could press even though I did not even create the entity yet.

I am wondering why I never encountered explicit state machines in my projects. I guess it creates too much overhead and cost for most projects. And for most projects it is not a big deal to just have implicit state machines. But with the emergence of AI coding I have a feeling that explicit state machines should become a standard in any software project. Or am I missing something?

I also feel like they will become the aspect of the code that humans can better review and own in a time where the software becomes more and more like a black box.

Edit:

What I am essentially trying to figure out is, if it will be ever detrimental if I tell AI to do explicit state machines in all of my projects?


r/softwarearchitecture • • 2h ago

Discussion/Advice Schrödinger’s ticket: what should a tool return when a write times out?

0 Upvotes

Here’s one I keep running into. An AI agent asks a tool to create a ticket. The tool calls the real API, the request times out, and now the tool has to tell the agent something, ideally the truth.

The truth is awkward. Until someone reads it back, that ticket is both created and not created, which is fine for cats and terrible for billing.

If the tool says “failed”, the agent does what any of us would and retries, and if the first request did land you now own two tickets. If it says “success”, it’s guessing with confidence, which is a career path but not a protocol. For most of these tools those are the only two words they know.

Some context: MCP servers are the wrappers agents use to call real APIs. We read the source of 100 popular ones that have write tools (read, not run). Of the 42 that wrap a web API, 39 have no way to say “I don’t know if that write happened”. Across all 100:

What the write tool can reportServers
Success or failure, machine-readable44 of 100
“Outcome unknown”, machine-readable7 of 100
A signal that the call is safe to repeat17 of 100

The irony is that most of the APIs underneath already have the pieces: ETags, idempotency keys, 409s. The wrappers drop them somewhere on the way to the agent.

We went with an explicit “unknown” result plus a hint about whether a retry is safe. The other way is to say “failed” and lean on idempotency keys, so a retry can’t double-write. Which would you pick for a caller that can’t walk over and ask someone?

Write-up with the full method and data: 100 MCP servers, what their writes report. I’m the author and I run IsoKron.


r/softwarearchitecture • • 19h ago

Tool/Product CodeNib: a wiki and architecture map generated from your repository

Thumbnail gallery
17 Upvotes

CodeNib is an open-source tool that writes a wiki for a repository. The wiki starts from a map: each area of the code is assigned to a node, and arrows show their relations in the code.

Every area has its page. The overview page starts at a public entry point and walks the main call path step by step, and each step has its location in the repo.

Wikis to browse, no account needed:

For your own repository, the CodeNib Wiki GitHub Action is one workflow file. It writes the pages in your CI with a model key you provide, publishes them to GitHub Pages, and stay synced with your code in main.


r/softwarearchitecture • • 8h ago

Discussion/Advice Plato's Sophist and Statesman are basically SWEs modeling sessions

13 Upvotes

He basically just exposes in poetic words a large class hierarchy he already created(probably in his working sessions). He was worried about same questions SWEs were worried just few years ago - how to create a right abstraction, how to create correct subclasses out of one main class (to "cut" class into several subclasses).

It seems to me he also did architectural diagrams (modeling), but we don't have any artifacts of him using UML or something similar.