Skip to content

Compliance Audit ​

Every material decision produces an auditable record. This is the third of the three concerns that matching and compliance sit alongside — without it, neither of the other two can be defended after the fact.

Required fields ​

For every material decision:

  • event ID
  • subject — journey, match and/or booking
  • action performed
  • decision
  • policy version
  • rule code — which rule produced it
  • reason codes
  • timestamp
  • actor or system
  • request ID
  • relevant input references

rule code is a code from the registry in Compliance Engine, not a free text key. An undefined term cannot be queried, and a rule that cannot be named cannot be reviewed.

Explainability ​

An administrator must be able to reconstruct any decision:

FieldWhy it is required
Decisionthe outcome
Policy versionthe ruleset in force
Rules evaluatedwhat was checked — absence is as important as presence
Rules passedwhat was satisfied
Rules failedwhat was not
Evidencethe data behind each result
Timestampwhen
Actor / systemwho or what decided
Algorithm versionwhich engine build
Previous decisionswhether this supersedes an earlier decision

The pass/fail split matters most. A verdict with no rule breakdown is an instruction, not a record.

Immutability ​

Compliance decisions are append-only.

A previous decision is never silently overwritten. When a decision changes:

text
Decision #1
    │
    ▼
Decision #2
    │
    ▼
Decision #3

The complete history remains available and queryable.

Enforcement is at the database role level: the application role holds INSERT and SELECT on compliance_decisions and audit_logs, and no UPDATE or DELETE. A rule enforced only in application code is a convention; a rule enforced by grants is a control.

Storage ​

sql
compliance_decisions   -- the engine's answers, append-only
compliance_events      -- matters needing human attention, with resolution
audit_logs             -- who did what, append-only

A decision and an event are different things and are stored separately. One match can produce a decision and no event — a clean ALLOW generates no work. Or several events and one decision. Keeping them apart stops a high-volume decision log from drowning the queue that needs a person.

Policy change and history ​

Historical decisions remain explainable after a policy change.

Because every decision records the policy_version it was made under, a reviewer looking at a journey approved six months ago can be shown the exact ruleset that approved it, rather than today's rules. Without this, a policy change silently rewrites the apparent meaning of every past decision.

Policy changes must not rewrite historical decisions. Activation of a new ruleset is a new row in policy_versions; it never mutates an old one.

Administrative actions ​

All administrative operations are audited:

  • account restriction or suspension
  • verification override
  • rule configuration changes
  • policy version activation
  • event resolution
  • regulatory export

The audit record captures actor, action, resource, before and after values, and a hashed IP. Administrative access is role-based, least-privilege, time-limited where appropriate, and audited.

KHAWI — same route, go together.