Skip to content

feat(compliance): add deterministic audit report builder - #203

Open
woahwhattheheck wants to merge 18 commits into
Raegis-RWA:mainfrom
woahwhattheheck:sol56/raegis40-compliance-audit-report-20261006
Open

woahwhattheheck wants to merge 18 commits into
Raegis-RWA:mainfrom
woahwhattheheck:sol56/raegis40-compliance-audit-report-20261006

Conversation

@woahwhattheheck

@woahwhattheheck woahwhattheheck commented Oct 6, 2026 •

Copy link
Copy Markdown

Closes #40

Summary

  • add a typed, deterministic compliance audit report builder over caller-supplied protocol evidence
  • expose the builder both as buildComplianceAuditReport(...) and client.compliance.buildAuditReport(...)
  • fail closed on ambiguous or invalid evidence/check inputs with stable typed error codes
  • reject untyped runtime status values outside pass|warn|fail|unknown
  • reject untyped runtime evidence sources outside protocol|sdk|operator instead of emitting impossible source values
  • document deterministic ordering, status precedence, evidence requirements, and the non-advice boundary
  • add focused Jest coverage for deterministic output, evidence failures, runtime source/status validation, and ComplianceModule integration
  • link the feature from README and the API reference

Boundaries

The builder performs no RPC calls and does not discover or independently verify evidence. It summarizes caller-supplied protocol observations only. A report is not a legal, financial, regulatory, KYC, AML, or transfer-eligibility determination.

Overall status precedence is fail > unknown > warn > pass. Non-unknown findings require known evidence references. Findings/evidence are normalized into stable order so the same logical input produces deterministic report structure.

Current carrier

  • exact head: fa9d7c0d904029f574a63134d9f326abd657a171
  • sponsor base: 69fff2c7e8c6fe801428fc1bb71d064c5c94949c
  • 12 commits, 7 changed files, +587/-0

Acceptance criteria traceability

Acceptance criterion Implementation Evidence
Builder implemented or specified src/compliance-audit.ts, src/compliance.ts standalone + ComplianceModule APIs
Edge cases/failure states handled ComplianceAuditInputError stable codes malformed runtime statuses and evidence sources are rejected before report construction; existing tests cover unknown refs and evidence-required behavior
Security/compliance assumptions documented docs/compliance-audit-report.md explicit caller-supplied/no-hidden-I/O/non-advice boundary
Tests/fixtures/checklists added tests/compliance-audit.test.ts deterministic ordering/status precedence + reference/source/status failures + module delegation
README/docs discovery README + API reference links to the dedicated guide
Aegis ecosystem compatibility additive package-root export + ComplianceModule delegate no dependency, RPC, signing, or contract behavior changes

Focused evidence and limits

Current provider readback confirms the source guard accepts only protocol, sdk, or operator, raises stable INVALID_EVIDENCE_SOURCE for other runtime values, and retains INVALID_STATUS for unsupported runtime statuses. The focused regression supplies external-registry as an untyped source and requires the stable rejection.

Exact current blobs:

  • src/compliance-audit.ts: 4ae06d3a6aaae8f56026a0796d147a508022c912
  • tests/compliance-audit.test.ts: 369f103c809e6926c7c4b5a6bf128f06cf5ca6b3
  • docs/compliance-audit-report.md: a615eeeb6fea20967a8df269a5769b9821298334

No broad local suite, build, hosted-CI-green result, bounty award, invoice, or payout is claimed by this metadata closeout.

Compensation request

Claimant and payee: @woahwhattheheck. This completed contribution is submitted through the issue's GrantFox route. Please confirm assignment/acceptance, the applicable payable amount, payout method, and timing. No award, invoice, or payment is claimed received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SDK compliance audit report builder

1 participant