Skip to content

feat: add functional_connectivity to CriticalityMetrics (#66)#78

Merged
4444J99 merged 1 commit intomainfrom
feat/66-functional-connectivity
Apr 15, 2026
Merged

feat: add functional_connectivity to CriticalityMetrics (#66)#78
4444J99 merged 1 commit intomainfrom
feat/66-functional-connectivity

Conversation

@4444J99
Copy link
Copy Markdown
Collaborator

@4444J99 4444J99 commented Apr 15, 2026

Summary

  • Add functional_connectivity: float field to CriticalityMetrics — ratio of meaningful interactions to total edges
  • _measure_functional_connectivity() samples interaction/edge ratio from neighborhood stats
  • Order parameter now blends 60% structural (density+clustering) + 40% functional connectivity
  • Structural/functional separation enables detecting "connected but incomprehensible" states (SWARM where agents can't decode each other)
  • _measure_order_parameter() takes explicit functional_connectivity parameter to avoid reading stale cached metrics

Closes #66

Test plan

  • 9 new tests in TestFunctionalConnectivity
  • Field defaults, construction, measurement, capping, serialization
  • Full hive suite: 185/185 passing
  • ruff check + mypy — 0 errors

🤖 Generated with Claude Code

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>
@4444J99 4444J99 merged commit d14e63a into main Apr 15, 2026
3 of 6 checks passed
@4444J99 4444J99 deleted the feat/66-functional-connectivity branch April 15, 2026 18:31
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread hive/criticality.py
Comment on lines +409 to +410
total_interactions = int(stats.get("total_interactions", 0))
total_edges = int(stats.get("total_edges", 0))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

feat: add functional_connectivity to CriticalityMetrics — separate structural from functional connectivity

1 participant