@davoodmehraban89 / Aram-2 Mirror · read-only / commits / edbfb58
Fork 0

Mirrored from https://github.com/davoodmehraban89/Aram.git

Synced Dec 3, 22:00 UTC

fix(desktop): validate reconciliation object and kind before provenance checks

davoodmehraban89 committed Oct 31, 2026 at 21:42 UTC edbfb58b3798811dbc0748fcaae5adbac461f800
1 file changed +4 -2
backend/src/aram_backend/desktop_five_statement_integrity.py
+4 -2
@@ -40,6 +40,10 @@ def validate_desktop_pipeline_result(result: FiveStatementPipelineResult) -> Non
40 )
41 if result.kind != "UNAPPROVED_FIVE_STATEMENT_PIPELINE_CANDIDATE":
42 raise CoverageError("DESKTOP_PREVIEW_PIPELINE_KIND_INVALID")
43 + if type(result.reconciliation) is not CrossStatementReconciliation:
44 + raise CoverageError("DESKTOP_PREVIEW_RECONCILIATION_TYPE_INVALID")
45 + if result.reconciliation.kind != "UNAPPROVED_CROSS_STATEMENT_RECONCILIATION":
46 + raise CoverageError("DESKTOP_PREVIEW_RECONCILIATION_KIND_INVALID")
47 _require_false(result, (
48 "source_ledger_completeness_verified", "accounting_policy_authorized",
49 "independently_reviewed", "trusted_approvals",
@@ -94,8 +98,6 @@ def validate_desktop_pipeline_result(result: FiveStatementPipelineResult) -> Non
98 "independently_reviewed", "releasable")
99 _require_false(candidate, flags)
100 reconciliation = result.reconciliation
97 - if type(reconciliation) is not CrossStatementReconciliation:
98 - raise CoverageError("DESKTOP_PREVIEW_RECONCILIATION_TYPE_INVALID")
101 if (len(source_hashes) != 1
102 or reconciliation.source_sha256 not in source_hashes
103 or reconciliation.same_source_snapshot is not True):