Twenty-four libraries and thirty-one functions
15-02-2026
The engine's reusable parts live in two directories. libs/ holds twenty-four of them, the substantial things: AI, DB, DOM, CSS, Fields, Files, Loaders. functions/ holds thirty-one, the small ones: a helper here, a formatter there.
An app names what it wants from them in data/app.json, and only those are loaded and built:
"libs": ["DB/DB", "DB/MySQL", "model", "payload"]
That declaration is the thing worth defending. An app carries what it lists and nothing else, so a release contains no mail code if the app never sends mail, and reading the list tells you what the app is made of without reading the app.
The split between the two directories is less certain. A library and a helper function genuinely differ in size, which is what made two directories feel natural, but size is not what an app cares about. An app cares which things it wants, and asking it to know whether the thing it wants counts as a library or a function is asking it to know about the engine's filing system. Two directories also mean two lookup rules and two places to check when something is missing.
Beside them sit classes/, functions.php and the constants block, which have carried their names through every rewrite because they kept their meaning.