Skip to content

summarize the entity map instead of sampling it #407

Description

@nc9

The published entity map is a sample: a byte budget decides how many nodes survive, and the rest are dropped with a count. On a large catalogue that means the hosted copy shows a shrinking fraction of the site as the site grows, which is the wrong direction for the case the feature exists to serve.

Measured on a 1,000 page store of one Shopify catalogue: 1,660 nodes and 1,161 edges built, 617 nodes and 441 edges published, the 512 KB byte backstop binding before the 750 node cap ever engaged. The type histogram shows what the site actually is: 536 CollectionPage, 536 ItemList, 294 each of Brand, Offer and ProductGroup, 2 Organization, 9 FAQPage, 35 Question. Those large buckets are thousands of structurally identical nodes. Sampling them wastes the budget re-showing the same shape hundreds of times, and then reports that the rest was dropped.

The alternative is to aggregate rather than drop: group nodes by their structural signature (type set plus outgoing predicate set, page-local flag), keep a few exemplars per group, and emit a supernode carrying the group's count. A catalogue then publishes something like tens of entries that are complete about which shapes the site declares and how many of each, instead of hundreds of entries that are a sample of them. This is the graph summarization idea (MDL-style summaries, SNAP/k-SNAP aggregation) and it is close to bisimulation-based structural indexing, which was designed for graph-shaped document data, which is what JSON-LD is.

Two things make this tractable here:

  • The viewer already clusters. ENTITY_SCENE_BUDGET in the dashboard reduces a graph to 300 nodes by clustering rather than dropping, so the concept is proven; this moves it to publish time so every consumer gets it, including the agent-facing tools that today can only page through a sample.
  • Summarization composes with the existing caps rather than replacing them. Exemplars and supernodes are still nodes, so the byte budget and truncated stay exactly as they are.

Worth treating as a design task first: the output shape is a contract change (a node that represents a group needs to be unmistakable to every renderer and to the rules), and it needs a decision on whether the rules read the summarized map or keep reading the full one. Sampling stays as the fallback for whatever does not summarize.

Acceptance Criteria

  • A design note lands describing the grouping key, the supernode shape, and how an exemplar relates to its group
  • A large single-type catalogue publishes a map that states the true count of each structural group rather than a sample of its members
  • Every consumer (report formats, exports, hosted viewer, agent tools) renders a supernode distinguishably from a real entity, never as one entity named after many
  • Rule verdicts are unchanged by summarization: the rules keep reading the full map
  • The byte budget and truncated reporting continue to apply to whatever the projection emits

Activity

  1. added
    enhancement
    P3
    size: L
    on Sep 23, 2026
  2. added theissue type on Oct 28, 2026
  3. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Checked against main (23a34c1, v0.0.144). No criterion is met yet: there is no design note, no grouping or supernode code, and no renderer support for a summarized entity map on main.

    nik

  4. added
    engine
    on Nov 13, 2026
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

    P3engineenhancementsize: L

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions