Skip to content

feat(engine): summarize structurally identical entities in the published entity map #407 - #1969

Merged
nc9 merged 2 commits into
mainfrom
boat/entity-map-summarize-407
Nov 17, 2026
Merged

nc9 merged 2 commits into
mainfrom
boat/entity-map-summarize-407

Conversation

@nc9

@nc9 nc9 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Closes #407

Publish projection groups nodes by structural signature (type set, outgoing predicate set, page-local flag). Groups of 8 or more keep 3 real exemplar nodes and emit a record in a new optional EntityMap.groups array carrying the true count. Groups are never in nodes, so no consumer can render one as a single entity. Sampling stays as the fallback. Design note: packages/core-contracts/ENTITY-MAP-SUMMARIZATION.md.

Acceptance criteria

  • Design note: ENTITY-MAP-SUMMARIZATION.md (grouping key, group shape, exemplar relation)
  • True count per group: test 'a large single-type catalogue states the true count of its group' (1000 products: count 1000, 3 exemplars, under 10 nodes)
  • Distinguishable rendering: groups are a separate array with kind 'group'; markdown section renders an 'Entity groups' table (test 'the markdown section renders a group as a count'). Hosted viewer and agent tools live in the private repo and the viewer projection does not summarize: follow-up.
  • Rules read the full map: rules run before projection and the input is not mutated (test 'the full map is untouched'); entity-rules-golden passes
  • Byte budget and truncated apply: tests 'truncated still reports...' and 'the byte budget still applies...'

Gates

typecheck core-contracts, report, audit-engine, cli clean. bun test: entity-map-summarize 8, entity-map-slim 62, entity-map-markdown 10, publish-cap 64, plus builder, diff, golden, streaming, html all pass. Existing slim sampling tests now run with summarize off to keep pinning the fallback.

Agent skill: no change needed. Docs: no user-facing CLI change; CHANGELOG entry added.

@nc9
nc9 force-pushed the boat/entity-map-summarize-407 branch 2 times, most recently from 603ac1f to 4ac8872 Compare November 16, 2026 09:40
@nc9
nc9 marked this pull request as ready for review November 16, 2026 10:01
@nc9
nc9 force-pushed the boat/entity-map-summarize-407 branch 3 times, most recently from cfe802c to 9c49401 Compare November 17, 2026 05:51
@nc9
nc9 force-pushed the boat/entity-map-summarize-407 branch from 9c49401 to b5875e0 Compare November 17, 2026 05:58
@nc9
nc9 merged commit 9ed5cc6 into main Nov 17, 2026
16 checks passed
@nc9
nc9 deleted the boat/entity-map-summarize-407 branch November 17, 2026 06:47
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.

summarize the entity map instead of sampling it

1 participant