Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
mergedhumanPR #244Coordination

fix: verify correlated majority evidence in Lab consensus

Fix a false-positive in the current Lab consensus evaluator. It previously counted delivered prepare_ack events and entries in the proposer’s acks list without independently establishing distinct eligible voters or binding the…

Author

JamesCarnley avatar

@JamesCarnley

github profile →
Status
Merged
Merged on
Sep 4
Branch
fix/lab-quorum-evidence

Description

The pitch.

## Summary

Fix a false-positive in the current Lab consensus evaluator. It previously counted delivered prepare_ack events and entries in the proposer’s acks list without independently establishing distinct eligible voters or binding the acknowledgements to the proposed value.

The evaluator now:
- Checks every commit against the configured single proposer, value, and majority threshold.
- Correlates each counted voter through message IDs, delivery observations, and the original prepare conversation, including recipient, run, time/order and recorded delivery rejection.
- Rejects duplicate voter claims, ambiguous send records and contradictory evidence. Missing chain records remain not_enough_evidence.
- Preserves valid duplicate deliveries and ignores responses from uncounted outsiders.
- Requires acceptor agreement on the configured proposed value, rather than any common value.
- Advances the Lab evaluator to lab-0.2.4 so previous evaluator results are not silently replayed as equivalent.

## Scope and credit

Selected requirement rescue from #171 by @saurabhvmagdum: distinct-voter quorum evidence must be checked rather than inferred from event counts. Related historical quorum/lock evidence discussion also appears in #191.

This is newly implemented for current main’s single-proposer majority simulation. It does not port the old BFT plugin, add peer-signature verification, provide a BFT certificate, change agent runtime behavior, or establish cross-view Byzantine safety. Broader signed-vote, fixed-membership, equivocation and view-change profiles remain separate design work. The source PR will be closed with precise partial-scope credit only after this replacement lands.

## Verification

- Baseline: 307 tests passed.
- Initial new regressions: 25 failed and 5 passed against the old evaluator.
- Final candidate: 342 tests passed, 8 existing warnings.
- Focused final scenario/coverage/upstream/bundle checks: 95 passed.
- Includes an independent literal trace, real bundled consensus run, valid duplicate-delivery control, missing-evidence controls, later-invalid-commit check, uncounted outsider control and bundle replay.
- A genuine consensus bundle produced before this change reports: evaluator version differs: bundle lab-0.2.3, local lab-0.2.4; reproducibility not checked.
- Local self-review, not an independent-agent review.

Run: `PYTHONPATH=src python -m pytest -q -p no:cacheprovider`

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/244/head:pr-244
git checkout pr-244