Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /dislovelhl_enhanced-agent-bus /deliberation_layer /__init__.py
| """ | |
| ACGS-2 Deliberation Layer | |
| Constitutional Hash: 608508a9bd224290 | |
| High-performance deliberation layer with: | |
| - ML-powered impact scoring (ONNX/PyTorch with fallback cascade) | |
| - Event-driven vote collection via Redis pub/sub | |
| - Multi-stakeholder consensus with weighted voting | |
| - Enterprise-scale support (100+ concurrent sessions, >6000 RPS) | |
| """ | |
| import sys | |
| from types import ModuleType | |
| from typing import Any, cast | |
| from . import integration, multi_approver | |
| from .deliberation_queue import DeliberationQueue, DeliberationTask | |
| from .federated_judge_anchor import ( | |
| FederatedJudgeAnchor, | |
| FederatedQuorumResult, | |
| JudgeMember, | |
| JudgeSignature, | |
| verify_federated_result, | |
| ) | |
| from .frozen_judge_anchor import ( | |
| FJACandidate, | |
| FJADecisionReason, | |
| FJAQuorumResult, | |
| FrozenJudgeAnchorProtocol, | |
| FrozenJudgeQuorum, | |
| InMemoryFrozenJudgeAnchor, | |
| ) | |
| from .graphrag_integration import GraphRAGContextEnricher | |
| from .redis_integration import ( | |
| REDIS_AVAILABLE, | |
| RedisDeliberationQueue, | |
| RedisVotingSystem, | |
| get_redis_deliberation_queue, | |
| get_redis_voting_system, | |
| ) | |
| from .vote_collector import ( | |
| EventDrivenVoteCollector, | |
| VoteEvent, | |
| VoteSession, | |
| get_vote_collector, | |
| reset_vote_collector, | |
| ) | |
| from .voting_service import Election, Vote, VotingService, VotingStrategy | |
| # Ensure module aliasing across package import paths | |
| _module = sys.modules.get(__name__) | |
| if _module is not None: | |
| sys.modules.setdefault("enhanced_agent_bus.deliberation_layer", _module) | |
| sys.modules.setdefault("enhanced_agent_bus.deliberation_layer", _module) | |
| sys.modules.setdefault("core.enhanced_agent_bus.deliberation_layer", _module) | |
| sys.modules.setdefault("enhanced_agent_bus.deliberation_layer.integration", integration) | |
| sys.modules.setdefault("enhanced_agent_bus.deliberation_layer.integration", integration) | |
| sys.modules.setdefault("core.enhanced_agent_bus.deliberation_layer.integration", integration) | |
| # Lazy import for impact_scorer - requires numpy (optional ml dependency) | |
| _impact_scorer_module: ModuleType | None = None | |
| def _get_impact_scorer_module() -> ModuleType: | |
| """Lazy load impact_scorer module to avoid numpy import errors.""" | |
| global _impact_scorer_module | |
| if _impact_scorer_module is None: | |
| try: | |
| from . import impact_scorer as _module | |
| _impact_scorer_module = _module | |
| except ImportError as e: | |
| raise ImportError( | |
| f"impact_scorer requires numpy. Install with: pip install enhanced-agent-bus[ml]. Error: {e}" | |
| ) from e | |
| assert _impact_scorer_module is not None | |
| return _impact_scorer_module | |
| def __getattr__(name: str) -> Any: | |
| """Lazy attribute access for impact_scorer exports.""" | |
| if name in ("ImpactScorer", "calculate_message_impact", "get_impact_scorer"): | |
| module = _get_impact_scorer_module() | |
| return getattr(module, name) | |
| raise AttributeError(f"module {__name__!r} has no attribute {name!r}") | |
| __all__ = [ | |
| # Redis Integration | |
| "REDIS_AVAILABLE", | |
| # Deliberation Queue | |
| "DeliberationQueue", | |
| "DeliberationTask", | |
| "Election", | |
| "EventDrivenVoteCollector", | |
| # Federated Judge Anchor (fFJA) — t-of-N threshold extension | |
| "FederatedJudgeAnchor", | |
| "FederatedQuorumResult", | |
| "JudgeMember", | |
| "JudgeSignature", | |
| "verify_federated_result", | |
| # Frozen Judge Anchor | |
| "FJACandidate", | |
| "FJADecisionReason", | |
| "FJAQuorumResult", | |
| "FrozenJudgeAnchorProtocol", | |
| "FrozenJudgeQuorum", | |
| "InMemoryFrozenJudgeAnchor", | |
| # Impact Scorer (lazy loaded) | |
| "ImpactScorer", | |
| "RedisDeliberationQueue", | |
| "RedisVotingSystem", | |
| "Vote", | |
| # Event-Driven Vote Collector | |
| "VoteEvent", | |
| "VoteSession", | |
| # Voting Service | |
| "VotingService", | |
| "VotingStrategy", | |
| "calculate_message_impact", | |
| "get_impact_scorer", | |
| "get_redis_deliberation_queue", | |
| "get_redis_voting_system", | |
| "get_vote_collector", | |
| # Multi-approver workflow | |
| "multi_approver", | |
| "reset_vote_collector", | |
| # GraphRAG context enrichment | |
| "GraphRAGContextEnricher", | |
| ] | |
Xet Storage Details
- Size:
- 4.1 kB
- Xet hash:
- add9381d1823931b4e163a660968afe53d8cd260c8f7738b8c624a1724b29f2e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.