Architecture Audit 2026-05 (Historical)
Faraid Engine — Architecture & Efficiency Audit
Section titled “Faraid Engine — Architecture & Efficiency Audit”Date: 2026-05-06 Scope:
packages/core,packages/api,packages/server,packages/webStatus of math: correct (after findings/13) and now formally generalised by findings/16. Status of code: mathematically faithful, structurally fragmented.
0. What changed in findings/ and what it means for the code
Section titled “0. What changed in findings/ and what it means for the code”| New / updated finding | Mathematical content | Code-level consequence |
|---|---|---|
| findings/16 — unified (S, w, A) schema | All 12 extension variants are one operator parameterised by scenario set, weight function, and aggregation rule. | ✅ Implemented — @faraid/extensions with scenarioExtension(F, S, w, A) primitive and 12 instances. |
| findings/11 §4.2 — Chain Forest (Gharqā) | Multi-root chain with TILD/ṬARIF cycle-breaking. | ✅ Implemented — gharqa-hanbali.ts in @faraid/extensions. |
| findings/10 D16/D17/D18 | New config toggles: hamlScenarioSet, khunthaAggregation, gharqaMutualInheritance. | ✅ Implemented — in MadhhabConfig (core) and MadhhabConfigSchema (domain). |
5. Hit-list status
Section titled “5. Hit-list status”| Tier | Item | Status |
|---|---|---|
| T0-1 | Create @faraid/domain | ✅ Done — commit 35a0ec8 |
| T0-2 | Delete response-schemas.ts | ✅ Done — commit 66382ef |
| T0-3 | Strip .passthrough() | ✅ Done — commit 35a0ec8 |
| T0-5 | Lift α₂ to shared helper alpha2.ts | ✅ Done — commit c4963f4 |
| T1-1 | @faraid/extensions + scenarioExtension | ✅ Done — commit 221fb86 |
| T1-2 | Missing extensions (Ḥaml, Khunthā, Gharqā) | ✅ Done — commit 221fb86 |
| T1-3 | BaseSolver in @faraid/api | ✅ Done — commit c4963f4 |
| T2-1 | Demote /scenario route | ✅ Done — commit 4c9ffd9 |
| T2-2 | Delete dead code (apiResolve, corpus-utils) | ✅ Done — commit c4963f4 |
| T3 | Cache residual in phase4 | ✅ Done — commit 4c9ffd9 |
| T3 | eslint-plugin-boundaries | ✅ Done — commit c4963f4 |
For the full original audit text, see docs/audit-2026-05.md in the git repository.