Skip to content

Compute edge-intelligence metrics from the dish graph #91

Description

@markfreeman-dot-dev

v2 migration #100M7-lifecycle (epic #15) · Size S · Architecture

Goal

Ship petri/analysis/edge_intelligence.py: pure functions computing importance, fragility, and convergence points over the DishGraph query API, plus a typed report model.

Context

Field report #11 names three uncomputed signals: edge count as importance, edge chains as fragility, convergence points as the highest-value validation targets. With the DishGraph API landed, these are pure graph algorithms; reuse get_impact_report's DFS (propagation.py:218).

Scope

In:

  • importance(cell): total in-degree counting cross-colony edges, with the cross-colony count broken out.
  • fragility(cell): longest dependency chain through the cell plus transitive-dependent count (reuse the propagation.py:218 DFS).
  • convergence_points(dish): cells depended on by two or more distinct colonies, ranked.
  • Typed EdgeIntelligenceReport model (per-cell metrics plus dish-level ranked lists), usable as a DBOS step return and dashboard JSON.
  • tests/unit/test_edge_intelligence.py on the diamond fixture (conftest.py:278-357) extended with a second colony and cross-colony edges; document formulas with the field report #11 rationale.

Out:

  • No CLI/dashboard surfacing or queue prioritization (sibling issues).
  • No incremental/cached computation; full recompute is fine at current scale.

Acceptance criteria

  • On the extended diamond fixture, importance, fragility, and convergence-point values match hand-computed expected values.
  • A cell referenced by two colonies appears in convergence_points; removing one cross-colony edge drops it (fixture variant).
  • fragility of a leaf cell with many transitive dependents exceeds an equally connected cell with none (directionality).
  • EdgeIntelligenceReport serializes via model_dump and round-trips.
  • The module imports nothing from engine/, reasoning/, dashboard/, or DBOS (pure analysis, asserted in a test).

Pointers

  • petri/storage/edge_registry.py DishGraph API (read-only consumer)
  • petri/graph/colony.py:26-31; petri/engine/propagation.py:218 (DFS prior art)
  • tests/conftest.py:278-357 (5-cell diamond DAG fixture)

#N in this issue refers to entries in docs/field-reports.md, not issues in this repo.
To claim this issue, leave a comment. Questions welcome — see CONTRIBUTING.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerslifecycleRe-decomposition, feed, scan, analystmigration-v2Part of the v2 migration backlogsize:SRough effort: hours

    Type

    No type

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions