- core/cache.py: SharedCache with TTL, disk flush, cache-first reads
- core/eventbus.py: in-process pub/sub (AgentCompleted/Blocked/HumanInput/PortfolioAlert events)
- core/token_budget.py: TokenBudget + PromptBuilder per-agent token enforcement
- core/research_state.py: TokenUsageEntry dataclass, QuantState.token_log deserialization
- services/file_writer.py: cache-first reads, RAG auto-index on writes
- services/rag_service.py: index_artifact, query_artifacts, rebuild_artifact_index_from_disk
- agents/base.py: bus + token_budget attributes, _log_token_usage() helper
- agents/coordinator.py: full EventBus refactor, slash commands (/poly cache, /poly tokens), event handlers
- agents/quant/*: TokenBudget declaration + token logging on all LLM-calling agents
- agents/quant/portfoliomonitor.py: emits PortfolioAlertEvent on threshold breach
- cli/main.py: poly cache and poly tokens subcommands
- core/__init__.py: exports SharedCache, EventBus, TokenBudget, TokenUsageEntry, all event types
fix: break circular import between core and agents packages
yf176
0e9ad48
core/__init__ was eagerly importing MentionParser, which imported
agents.base, which triggered agents/__init__, which imported
CoordinatorAgent, which imported MentionParser again → circular.
Fix: remove MentionParser from core/__init__ and CoordinatorAgent
from agents/__init__. Both are only ever imported via direct module
path (polyhedra.core.mention_parser / polyhedra.agents.coordinator)
so the package-level re-exports were unnecessary.