Skip to content

fix(node-ui): canonicalize context graph layer counts#604

Merged
Jurij89 merged 1 commit into
mainfrom
codex/cgux-m6-canonical-counts
May 23, 2026
Merged

fix(node-ui): canonicalize context graph layer counts#604
Jurij89 merged 1 commit into
mainfrom
codex/cgux-m6-canonical-counts

Conversation

@Jurij89
Copy link
Copy Markdown
Contributor

@Jurij89 Jurij89 commented May 23, 2026

Summary

  • Resolves the M6 count-scope divergence by making useMemoryEntities().counts represent distinct visible entities in their current WM/SWM/VM layer, counted once by trustLevel.
  • Threads that canonical count into the MemoryStrip layer count and layer stats/action widgets so top-level count surfaces share the same source.
  • Documents and tests the promoted/multi-layer case that caused raw triple-subject counts to disagree with displayed layer entities.

Related

Files changed

File What
packages/node-ui/src/ui/hooks/useMemoryEntities.ts Computes canonical layer counts from visible entities grouped by current trustLevel.
packages/node-ui/src/ui/views/project/components.tsx Consumes canonical counts in MemoryStrip and layer stats/action surfaces.
packages/node-ui/test/use-memory-entities-counts.test.ts Adds promoted/multi-layer, duplicate-subject, and object-only URI count coverage.
packages/node-ui/test/use-memory-entities-live-updates.test.ts Tightens mock layer discrimination so SWM/VM queries do not receive WM fixtures.

Test plan

  • pnpm --filter @origintrail-official/dkg-node-ui exec vitest run test/use-memory-entities-counts.test.ts test/use-memory-entities-live-updates.test.ts test/use-memory-entities-partial.test.ts test/vm-hero-banner.test.ts test/ui-compat.test.ts
  • pnpm --filter @origintrail-official/dkg-node-ui run build
  • pnpm --filter @origintrail-official/dkg-node-ui run build:ui
  • git diff --check
  • Local PR review from pr-diff.patch: no actionable findings remain.
  • G-Q7 manual/live validation on a populated context graph with known WM/SWM/VM membership before merge.

@Jurij89 Jurij89 force-pushed the codex/cgux-m6-canonical-counts branch from 1aa234b to 2f63c70 Compare May 23, 2026 18:48
@Jurij89 Jurij89 marked this pull request as ready for review May 23, 2026 18:48
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex review completed — no issues found.

@Jurij89 Jurij89 merged commit e0f6b54 into main May 23, 2026
36 checks passed
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.

1 participant