feat: add functional_connectivity to CriticalityMetrics (#66)#78
feat: add functional_connectivity to CriticalityMetrics (#66)#78
Conversation
Separate structural connectivity (who CAN talk) from functional connectivity (who IS meaningfully communicating). - New field: functional_connectivity on CriticalityMetrics (default 0.5) - Measured as ratio of actual interactions to total edges - Order parameter now blends: 60% structural + 40% functional - _measure_order_parameter accepts functional_connectivity parameter to avoid reading stale cached metrics 9 new tests in TestFunctionalConnectivity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e14512c6cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| total_interactions = int(stats.get("total_interactions", 0)) | ||
| total_edges = int(stats.get("total_edges", 0)) |
There was a problem hiding this comment.
Count only successful interactions in functional connectivity
_measure_functional_connectivity() treats total_interactions as “meaningful” communication, but TopologicalNeighborhood.get_network_stats() defines it as len(self._interactions) (hive/neighborhood.py:706), which includes failed/conflict records (record_interaction(..., success=False)). In scenarios where agents exchange many unsuccessful messages, this drives functional connectivity toward 1.0 and inflates order_parameter, masking the exact “connected but incomprehensible” failure mode this metric is meant to catch.
Useful? React with 👍 / 👎.
Summary
functional_connectivity: floatfield toCriticalityMetrics— ratio of meaningful interactions to total edges_measure_functional_connectivity()samples interaction/edge ratio from neighborhood stats_measure_order_parameter()takes explicit functional_connectivity parameter to avoid reading stale cached metricsCloses #66
Test plan
TestFunctionalConnectivityruff check+mypy— 0 errors🤖 Generated with Claude Code