Skip to content

test: add invariant suite for JailingPolicy#30

Merged
fgimenez merged 2 commits into
mainfrom
fgimenez/jailing-policy-invariants
Jul 17, 2026
Merged

test: add invariant suite for JailingPolicy#30
fgimenez merged 2 commits into
mainfrom
fgimenez/jailing-policy-invariants

Conversation

@fgimenez

Copy link
Copy Markdown
Contributor

asana: https://app.asana.com/0/1213822431665320/1214550222776111

Adds Foundry invariant coverage for JailingPolicy, which previously had only unit tests. A JailingHandler drives a single heartbeat round through vote → finalize → recordRound → enforceOne / enforceAll, tracking ghost state for votes, enforcement and timestamps.

Invariants:

  • roundRecord is immutable once set and consistent with manager.roundOutcome.
  • The number of enforced flags is bounded by committee size and matches the handler's monotonic ghost counter.
  • Correct voters (verdict matching outcome) and verdict==3 voters are never enforced.
  • Inconclusive outcomes never produce any enforcement.
  • Enforced operators remain isJailed for the full jail window after enforcement.
  • The recorded committee root matches the manager's stored root.

@fgimenez
fgimenez requested a review from jcabrero May 12, 2026 08:19
@fgimenez
fgimenez merged commit 27f9b22 into main Jul 17, 2026
2 checks passed
@fgimenez
fgimenez deleted the fgimenez/jailing-policy-invariants branch July 17, 2026 16:30
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.

1 participant