Skip to content

Architecture WS7: depgraph report-only summaries; upstream @statelyai/graph issues #3283

Closed

Description

@thymikee

Part of #3276.

Purpose

Give the analysis that produced #3276 a permanent home in the tooling, and push the rough edges we hit back upstream.

Required behavior

  1. Report-only fields in pnpm depgraph (no gate behavior change): dominator summary for an entry file, zone-level SCC summary, and community/zone cohesion summary (the numbers the umbrella quotes: Louvain modularity of declared zones vs detected communities, per-zone cohesion).
  2. File upstream issues against the @statelyai/graph repo for the 2.4.0 rough edges:
    • getLouvainCommunities returns ids but getModularity requires node objects and throws on ids;
    • docs name toMermaid, package exports toMermaidFlowchart;
    • Mermaid output does not escape ids like (root);
    • importing /dot for toDOT requires the dotparser peer.
      Include a minimal repro in each.

Done when

  • pnpm depgraph exposes the three summaries as report-only output with tests; gates unchanged.
  • Four upstream issues filed; links recorded in this issue.

Constraints

  • Report-only: nothing in the layering gates may consume these fields until a decision issue says so.
  • Follow docs/agents/pull-requests.md (size budget, commit shape, validation).

Activity

  1. thymikee commented on Oct 7, 2026

    @thymikee
    MemberAuthor

    Deliverable 1 is done (merged via #3285, stacked on #3275 which is also merged). Deliverable 2: filed 3 of the 4 upstream issues; the 4th claim didn't survive verification — see below rather than force a weak report.

    All four claims were checked against @statelyai/graph 2.4.0 (what #3275/#3285 ship against) and the current latest, 2.5.1, to catch anything already fixed upstream.

    Filed:

    1. statelyai/graph#47 — getLouvainCommunities returns bare ids, getModularity wants Community<N> node objects. Still broken on 2.5.1, but the failure mode changed for the worse: 2.4.0 threw a TypeError; 2.5.0's "tolerates unknown ids" changelog entry made it stop throwing, but it now silently returns modularity 0 (a wrong answer, not caught) instead of raising anything.
    2. statelyai/graph#48 — toMermaidFlowchart doesn't escape node ids that collide with its own shape-delimiter grammar (e.g. (root) reads as a round-shaped node per the library's own SHAPE_OPENERS table). Unchanged on 2.5.1.
    3. statelyai/graph#49 — /dot needs the optional dotparser peer at runtime; that's documented in src/formats/dot/README.md, but that file isn't published to npm (files: ["dist", "schemas"]) and the shipped JSDoc doesn't mention it either (its own @example even imports toDOT from the wrong module). Unchanged on 2.5.1.

    Not filed — "docs name toMermaid, package exports toMermaidFlowchart": couldn't substantiate this one. I fetched the live stately.ai docs page, searched the repo's source, tests, and both the published and unpublished READMEs (including the mermaid format's own) — every reference I found already uses the correct toMermaidFlowchart/toMermaidSequence/etc. names; there's no bare toMermaid anywhere I can find to point an issue at. Rather than file a bug report I can't back up, I'm flagging it here. If you have the specific page or commit where this was seen (maybe the docs site has since been corrected, or it was a different page), point me at it and I'll re-check and file if it still holds; otherwise I'd treat this one as resolved/moot and close #3283 with 3 of 4 filed.

    Not closing #3283 myself — leaving that to you.

  2. thymikee commented on Oct 8, 2026

    @thymikee
    MemberAuthor

    Closing: both deliverables complete. (1) Report-only metrics landed via #3285 (merged, stacked on #3275). (2) Upstream follow-ups: 3 of 4 claims filed against @statelyai/graph 2.4.0 with repros (links in the earlier comment on this issue); the 4th claim was dropped after verification showed it did not hold — documented there rather than filed as a weak report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions