Skip to content

ADR-0004 — Compliance is a terminal gate, not a weighted signal

Status: Accepted · Date: 2026-08-03

Context

The agent architecture treats each analyst as a contributor to a combined score. Shariah compliance could be modelled the same way — a Compliance Advisor agent emitting a signal that the aggregator weights alongside fundamentals and technicals. That would be architecturally uniform and would let the system express nuance about borderline cases.

Decision

Compliance is not a signal. It is a deterministic gate that runs first and terminates the pipeline on anything other than COMPLIANT. It has no weight, no vote, and no score contribution. UNCERTAIN excludes the candidate exactly as NON_COMPLIANT does.

Rationale

A weight can be outvoted. Any weighted scheme has a combination of inputs where sufficiently strong financials overcome a compliance penalty. For the user this system is built for, that outcome is not a trade-off to be optimised — it is a failure that invalidates the product entirely. The only way to guarantee it cannot occur is to remove the arithmetic that could produce it.

It is cheap and terminal. Compliance evaluation is arithmetic over stored fundamentals. Running it before the agent fan-out eliminates most of the universe for a fraction of a cent, which is what makes daily screening of thousands of instruments economically viable (04 §10).

It must fail closed. A missing debt figure cannot mean "probably fine." Uncertainty about permissibility is not permission, so UNCERTAIN excludes. This is the opposite of how the rest of the system handles missing data — elsewhere, missing inputs lower confidence — and the asymmetry is deliberate.

It constrains capabilities, not just candidates. Because compliance is absolute, the trading engine simply lacks short selling, margin, interest accrual, and conventional derivatives (06 §9). These are absences in the domain model, not disabled features. A feature flag can be flipped by a bug; a missing code path cannot.

Consequences

Positive. No configuration produces a non-compliant recommendation. Large cost saving on the daily screen. Rejections are explainable in full, which makes the "Why not?" view possible and is where compliance trust is actually earned.

Negative. No expression of nuance in borderline cases — an instrument at 30.1% debt against a 30% threshold fails exactly as one at 60% does. Mitigated by the drift monitoring in 05 §5, which warns as an instrument approaches a threshold, and by making the threshold itself user-configurable through rule packs.

Fail-closed also means data gaps reduce the investable universe. This is the correct direction to err, and the excluded candidates are shown with their specific missing input, so the gap is visible and actionable rather than mysterious.

Rejected alternative. A "compliance score" from 0 to 1 with a user-set cut-off. This is the same gate with extra steps, and it invites the interpretation that 0.7 is "mostly halal" — a framing the system has no standing to offer.