Skip to content

[spike] Can graphify replace or slim the hand-kept architecture map? #2160

Done

Description

@yw0nam

Uncertainty / question

Can graphify (Graphify-Labs/graphify, PyPI graphifyy), a tool that builds a queryable knowledge graph from the code, replace or slim the hand-kept architecture map (docs/agent-guide/architecture/map.js) for agents that look for the exchanges between modules?

Measured today (main a3c12d7): map.js is 255,094 bytes and 7,213 lines (wc -lc); its 442 edges take 125,754 bytes of it, 54,911 in carries (node over YUI_MAP.edges); 40 commits since 2026-11-20 edited it (git log --since=2026-11-20 --oneline -- docs/agent-guide/architecture/map.js | wc -l). D-81 (#2156) kept the map, slimmed, because its exchange list has no other home.

Why verify now

The map's upkeep cost comes up on every feature PR, and #2157 (Character menu window) is the next change that rewrites its character-menu-* exchanges. The owner asked for this spike on 2026-11-27.

Related issues

Part of #2142

Verification method

  • web / context7 cross-check (README, docs.graphify.com: code extraction is local tree-sitter, graphify extract . --code-only needs no model; .css is not a code extension; .html is a document)
  • Measure directly: run graphify code-only on an export of main in a scratch folder (no graphify install, no hooks, no CLAUDE.md edit, run through uvx), then measure
    1. build time, output size, node and edge counts;
    2. recall against the map: for each of the 442 edges, whether the graph links a file under the from part's paths to a file under the to part's paths (directly or within 2 hops), split by edge kind (call, callback, bridge, tauri-command, tauri-event, storage, http, ...);
    3. the [feature] Character menu draws in its own window, so opening it never resizes the pet window #2157 case: what graphify query / affected return for the Character menu, against the 10 character-menu-* and chip-column-menu edges;
    4. what it writes and what upkeep it needs (graphify update cost after one commit).
  • Decision that needs user confirmation: adopt (replace or complement the map), or reject

Definition of Done

  • Conclusion reached — the closing comment states the decision and the rejected option
  • Document the conclusion in the relevant docs/ file
  • Related OPEN/Assumption items marked resolved

References

Activity

  1. added
    spike
    on Nov 27, 2026
  2. yw0nam commented on Nov 27, 2026

    @yw0nam
    OwnerAuthor

    Measurements (2026-11-27, graphify 0.9.121, --code-only, export of main a3c12d7)

    Run: git archive a3c12d74 into a scratch folder, uvx --from graphifyy graphify extract . --code-only with no LLM keys set. No graphify install, no hooks; the repo checkout and ~/.graphify stayed untouched.

    Build. 1,790 code files, 49 s wall time. graph.json 17 MB (graphify-out/ 26 MB): 14,478 nodes, 41,817 edges (39,885 EXTRACTED, 1,932 INFERRED); top relations calls 9,648, contains 9,546, imports 8,746, imports_from 8,329. 162 files yielded no symbols (including map.js). No .css file is in the graph. graphify update . after a one-line edit took 49 s as well.

    Recall against the map's 442 edges. An edge counts as found when the graph links a file under the from part's paths to a file under the to part's paths (file level, either direction).

    Edge kind Edges Direct link in graph Only through a shared file (2 hops) None
    call 160 136 24 0
    callback 165 109 56 0
    storage 13 13 0 0
    bridge 37 16 21 0
    tauri-command 26 0 0 26
    tauri-event 14 0 0 14
    http, websocket, stdio, user 27 (outside parts: no paths)

    Baseline: of 1,000 random part pairs the map does not link, 133 have a direct link and 772 more connect within 2 hops. A 2-hop connection is therefore no evidence; only the direct column counts (map edges 274 of 415 with paths = 66 %, unlinked pairs 13 %).

    What the graph cannot carry.

    • Bridge channels: emit<Key>/on<Key> are generated by createChannelMethods (src/io/bridge/core/channel-table.ts), so emitThreadsOpenRequest and onThreadsOpenRequest have no node. A bridge edge shows up only as two files importing settings-bridge.ts.
    • Tauri: 0 of 40 command and event edges. threads_order_front() exists as a Rust node, with no edge from the JS invoke("threads_order_front").
    • CSS: the chip column's fade through surfaces.css's :has rule (the exchange [spike] Is the architecture map worth its upkeep #2156 named as easy to miss) has no node.
    • What an exchange carries (carries) and where it is wired: the graph has relation names, not payloads.

    The #2157 case. Of the 10 character-menu-* / chip-column-menu edges, 4 have a direct link at the map's part level; character-menu-vrm, -voice, -listen, -reset, -threads, -threads-request do not (the actions reach them through deps injected in bootstrap-configured.ts, and the threads request is a bridge channel). graphify explain "createCharacterMenuPorts" lists 6 calls (resetConversation, select, flip, options, effectiveChatApi, quickControlsConfigDefaults); the calls on injected deps (swapVrm, summonInput, threadsWindow.open, emitThreadsOpenRequest, petWindows.close) are missing. graphify query "which modules does the character menu exchange data with" returned 383 nodes, mostly the menu's own files plus unrelated keyword hits (data_dir() in mcp_host/launch.rs, a Hermes desire docstring, verbatimModuleSyntax).

    Conclusion pending the owner's decision.

  3. yw0nam commented on Nov 27, 2026

    @yw0nam
    OwnerAuthor

    Conclusion (owner, 2026-11-27): graphify is not adopted. It finds plain imports and calls (direct link for 258 of the map's 338 call, callback and storage edges), which the language server already answers, and misses what the map exists for: bridge channels by name (their emit/on methods are generated, so they have no node), all 40 Tauri command and event edges, CSS couplings such as the chip column's :has fade, and what each exchange carries. Its update after a one-line edit costs the same 49 s as a full build. The map stays (D-81) and gets lighter in #2161 (a cap on carries, one record per line).

    Rejected: replacing the map with graphify; adding graphify beside it as an agent search tool (it duplicates the language server and adds a Python tool, a 17 MB generated graph, and a search-intercepting hook). No docs/ change: the map's docs are unchanged until #2161.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    spike

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions