Afunana
Afunana Documentation

Engineering & Design Principles

How Afunana is built — correct, lean, generic, performant, scalable, and sustainable.

← All docs

Afunana is built to run inside the most conservative environments there are — banks, insurers, and government IT — and to keep running, unattended, for years. That constraint shaped every engineering decision: the system has to be correct, lean, observable, and cheap to maintain, not merely feature-rich. This page describes the principles behind the codebase and the concrete mechanisms that enforce them.

Correctness first — deterministic where it counts, AI where it helps

The structural backbone — how programs call each other, which fields flow where, where a parameter's size disagrees across a boundary — is computed deterministically, by parsing the source, not by asking a model. AI is used only for the one thing it is genuinely better at: explaining code in business language.

That split is the single most important design decision in the product. It means the maps, cross-references, and silent-failure checks are reproducible and auditable, and the probabilistic component is contained to the documentation layer — where every claim is traced back to a source line a human can verify. Nothing that must be exact is left to a guess.

Lean by construction

Generic and extensible — one model for every platform

IBM i (COBOL / RPG / CL / DDS), Oracle (PL/SQL), and plain SQL are each extracted into one common internal model, then documented, quality-checked, and searched the same way. Adding a platform means teaching the extractor to populate that model; the documentation, chat, data dictionary, and checks downstream come along for free. z/OS mainframe COBOL is on the roadmap on exactly this foundation.

The same genericity applies to AI: every model call goes through one governed gateway, so supporting a new provider or model is a configuration change, not code scattered across the system.

Best practices, enforced by architecture — not by convention

Good structure here is load-bearing, not aspirational:

Performant

Scales with the estate

Sustainable and maintainable

The real cost of software is the years after it ships, so the codebase is built to stay cheap to own:

Secure and operable by design

Security is part of the architecture, not a layer bolted on: secrets resolve from your own vault or a mounted secret store (never from application data), access is role-based, the audit log is tamper-evident, and the whole system can run fully air-gapped. The Security Architecture and System Architecture pages cover these in depth.