Skip to content

feat(consensus): multi-agent consensus verification and token budget slashing (Closes #854) - #858

Open
Trunal2005 wants to merge 1 commit into
Shinraya-Tech-Labs:mainfrom
Trunal2005:feat/854-multi-agent-consensus-engine
Open

Trunal2005 wants to merge 1 commit into
Shinraya-Tech-Labs:mainfrom
Trunal2005:feat/854-multi-agent-consensus-engine

Conversation

@Trunal2005

@Trunal2005 Trunal2005 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #854

Summary of Changes

  • Multi-Agent Consensus Verification Protocol (panoptis/consensus/):
    • Implemented ConsensusEngine (panoptis/consensus/engine.py) with semantic agreement matrix generation using normalized term-frequency cosine similarity metrics.
    • Implemented Byzantine Fault Tolerant (BFT) quorum detection (quorum_pct, default 0.66) supporting weighted voting stakes across agent responses.
    • Computes divergence scores against the consensus cluster center to detect outlier or hallucinating agent outputs.
  • Automated Byzantine Detection & Token Budget Slashing (panoptis/governance/slasher.py):
    • Implemented TokenBudgetSlasher tracking agent violation histories and penalizing rogue agents with automated quota deductions (default 50% slash) and voting weight demotions.
    • Enforces three-strike suspension with full token quota revocation for repeat offenders, alongside probation recovery and administrative restoration.
  • Consensus Observability & Telemetry Stream (panoptis/telemetry/consensus_telemetry.py):
    • Emits structured consensus telemetry rounds capturing winner selections, agreement scores, quorum ratios, and audit logs of slashing actions.
  • Unit & Simulation Test Suite (tests/test_consensus.py):
    • Added 7 comprehensive test scenarios:
      1. Cosine similarity baseline metrics.
      2. 3-agent swarm with 1 faulty agent (BFT 2/3 quorum reached, faulty agent slashed).
      3. 5-agent swarm with 2 rogue agents (BFT 3/5 quorum reached, rogue agents slashed).
      4. Unanimous consensus across honest agents (zero slashing).
      5. Deadlock consensus failure when responses diverge completely.
      6. Three-strike repeat violation triggering complete suspension and quota revocation.
      7. Telemetry round emission and recent event history retrieval.

Verification

  • pytest tests/test_consensus.py -v — 7/7 tests passed.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 PR Test Results

Check Result
Tests (pytest tests/) ❌ failure
Lint (ruff check .) ❌ failure
Coverage (panoptis) 84.02%

Python 3.12 · commit d9bada9

@sreerevanth

Copy link
Copy Markdown
Collaborator

@Trunal2005 tests failing ! :(

This branch has not been deployed

No deployments
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.

[FEATURE]: Multi-Agent Consensus Verification Engine with Byzantine Fault Tolerance & Token Budget Slashing [Level 3]

2 participants