feat: integrate confidential ballot provider evidence

This commit is contained in:
2026-08-02 03:41:05 +02:00
parent 133e55987e
commit 11b946ea78
4 changed files with 36 additions and 1 deletions
+13
View File
@@ -275,6 +275,13 @@ class CommitteeBallotFinalizer:
expected_revision=voting_expected_revision,
idempotency_key=f"committee:{idempotency_key}",
)
assurance_profile = str(
ballot.get("assurance_profile") or "recorded"
).strip()
if assurance_profile != "recorded" and not result.evidence:
raise CommitteeWorkspaceError(
"Provider-backed Voting results require sanitized provider evidence."
)
choices = tuple(str(item) for item in current.attributes.get("choices", ()))
if set(result.counts) != set(choices):
raise CommitteeWorkspaceError(
@@ -301,6 +308,12 @@ class CommitteeBallotFinalizer:
"voting_ballot_id": voting_ballot_id,
"voting_ballot_revision": result.revision,
"voting_result_sha256": result.result_sha256,
"voting_assurance_profile": assurance_profile,
"voting_provider_id": ballot.get("provider_id"),
"voting_provider_ballot_ref": ballot.get("provider_ballot_ref"),
"voting_provider_evidence": [
dict(item) for item in result.evidence
],
"counts": {key: int(value) for key, value in result.counts.items()},
"weighted_counts": {
key: int(value) for key, value in result.weighted_counts.items()
+3 -1
View File
@@ -219,7 +219,9 @@ DOCUMENTATION = (
"effects. Committee does not own generic Mandate or Decision persistence; optional "
"providers resolve and record those objects when installed, while a protected local "
"projection preserves the bounded fallback. Provider-bound ballots are finalized "
"through adapter capabilities without retaining individual ballots."
"through adapter capabilities without retaining individual ballots. Voting-backed "
"results preserve sanitized provider assurance evidence and never promote the "
"uncertified local confidential reference provider to a certified profile."
),
layer="available",
documentation_types=("admin", "user"),