You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-2Lines changed: 32 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,10 @@ Full writeup: [samples/basic_demo_logic_gov/logic/readme_logic](https://apilogic
179
179
```
180
180
Customers should not be able to create new orders if they have unresolved past due letters.
181
181
```
182
-
Since the engine resolves dependencies at load time, adding this rule doesn't touch the 5 you already have — no regeneration, no regression risk. An AI rewriting procedural code from scratch would have to re-touch all of it, with more surface area for a missed path and more tokens spent doing it.
182
+
Notice what just happened — two things, easy to miss:
183
+
184
+
-**You didn't do archaeology.** No opening `check_credit.py` to find where this belongs, no tracing the other 5 rules to check for conflicts. Auto-ordering means there's no maintenance hunt — you declare the rule, the engine places it.
185
+
-**AI-only would have to rebuild.** Without the engine, an AI rewriting procedural code from scratch would have to re-read and re-touch all 5 existing rules to check for dependencies — more surface area for a missed path, more tokens spent doing it. Here, the engine resolves dependencies at load time, so adding this rule doesn't touch the rest — no regeneration, no regression risk.
183
186
184
187
</details>
185
188
@@ -228,6 +231,13 @@ It didn't figure that out on its own. It was told to, in detail, by **Context En
228
231
-**Directs rules, not code.** When you ask for business logic, CE steers the AI toward the *right* rule type (sum vs. count vs. Allocate vs. Request Pattern) for what you actually asked for, instead of letting it default to the procedural code it's seen a million times in training.
229
232
-**Trains the AI to automate everything above, and to help you when it breaks.** EAI's 2-message Kafka pattern, the AI/Request Pattern wiring, Executable Requirements' pre-coding schema assessment — all of it is documented training material (`docs/training/*`) the AI reads *before* writing your code, not generic knowledge it's guessing from. Ask "what are rules?" or "how do rules work?" — or, without an AI handy, just read [samples/basic_demo_logic_gov/logic/readme_logic](https://apilogicserver.github.io/Docs/samples/basic_demo_logic_gov/logic/readme_logic) — same material.
230
233
234
+
<detailsmarkdown>
235
+
<summary>The AI was trained on this material — can you trust its answers?</summary>
236
+
237
+
<br>Don't take them on faith. Ask the same question a different way, or ask something not covered here — like where this architecture breaks down. If it just recites the same lines back, you've caught it. If it reasons, that's the test passing.
238
+
239
+
</details>
240
+
231
241
**The "can't be bypassed" claim, named:** rules aren't called from your code — they're wired into a single SQLAlchemy `before_flush` listener, installed once at server start. Every write, from any path — API, custom endpoint, Kafka consumer, agent — passes through that one listener before it commits. There's no second door.
232
242
233
243
This is why the same prompt produces a governed system, not a working-but-ungoverned demo. Details: [3-Legged Stool](https://apilogicserver.github.io/Docs/Customs-readme-full/#3-legged-stool).
@@ -238,7 +248,6 @@ This is why the same prompt produces a governed system, not a working-but-ungove
238
248
- Is this a black box? How do I debug a rule chain?
239
249
- What does it take to migrate off this if we ever wanted to?
240
250
- How does this perform at scale?
241
-
- How is this different from AI tools like Copilot or Cursor writing the same logic directly?
242
251
- What does this integrate with — APIs, workflows, agents, MCP?
243
252
- Does this work with my existing database?
244
253
@@ -248,6 +257,27 @@ More background: [Eval Guide](https://apilogicserver.github.io/Docs/Eval/).
248
257
249
258
250
259
260
+
<detailsmarkdown>
261
+
<summary>🔑 Why not just let AI write the code?</summary>
262
+
263
+
<br>
264
+
265
+
Even if AI generates perfect procedural code — and it doesn't, reliably — you still have a governance problem.
266
+
267
+
5 declarative rules are readable. Auditable. The next developer can understand them, compliance can sign off on them, and when something goes wrong you can debug them. That's not a convenience — it's a requirement.
268
+
269
+
Our A/B test on a 3-table system measured this directly: 5 declarative rules vs. ~220 lines of AI-generated procedural code — a 44X reduction. That 44X compounds: a larger system needs proportionally more procedural code to cover the same change paths, while the rule count grows with the requirements, not with the paths. Code nobody can read, verify, or safely change. Unreadable at scale is ungovernable at scale.
270
+
271
+
And there's a structural problem underneath: procedural code cannot represent transitive dependencies reliably. The AI diagnosed this itself — *"Business logic is not a coding problem. It's a dependency graph problem."* That's not a capability gap. No amount of AI capability fixes a representation problem.
272
+
273
+
You already saw the evidence for this above — [the two files side by side](samples/basic_demo_logic_gov/logic/procedural/credit_service.py). This is why that comparison exists.
274
+
275
+
The full case — with the A/B test, the governance argument, and the scalability problem — is at [Why GenAI-Logic](https://www.genai-logic.com/#h.yo3meupszav4).
276
+
277
+
</details>
278
+
279
+
280
+
251
281
<detailsmarkdown>
252
282
<summary>🔨 Go deeper — 30-45 min guided tour</summary>
0 commit comments