Skip to content

test: make memory graph integration deterministic - #6898

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
bolichen97:test/make-memory-graph-integration-deterministic
Aug 30, 2026
Merged

test: make memory graph integration deterministic#6898
iamwhatever merged 1 commit into
kirodotdev:mainfrom
bolichen97:test/make-memory-graph-integration-deterministic

Conversation

@bolichen97

@bolichen97 bolichen97 commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Problem / Motivation MemoryGraphTab.integration.test.tsx passed alone but its first graph-count test timed out at 15 seconds in the 1,654-file Vitest run. The file mixed a real MSW request, a real dynamic d3 force layout, and a Sigma mock that Vitest 4 cannot construct with new. ## Why it matters A test that only passes in isolation can hide a broken renderer contract and can fail unrelated full-suite shards under load. Deterministic API, layout, constructor, and teardown boundaries make the test prove the production integration it claims to cover without extending its time budget. ## Root cause The component caught the Sigma constructor TypeError, so the tests never proved that the graph renderer initialized. At the same time, network scheduling and the real force pass made readiness depend on loaded-worker timing. The loading case also installed an MSW handler whose request promise never settled, leaking request lifecycle beyond the assertion. ## What changed - mock the api.memoryGraph boundary directly with the existing graph fixture - reset and explicitly control the API result for every test - replace d3 only at its module boundary with a synchronous fluent force contract; layout physics are not the UI-shell integration subject - replace the non-constructable Sigma function mock with a real class fake that implements every method the component uses - use one graphReady contract that waits for both API-rendered DOM and an actual Sigma mount - assert graphology received 7 nodes and 2 edges - make the loading case use a controlled deferred promise and settle it before teardown - prove Refresh performs a second API call No production, MSW server, shared setup, timeout, retry, or warning behavior changed. ## Global overlap audit All open PRs were checked across this test, MemoryGraphTab, API, setup, MSW helpers, Vite config, and dependency manifests. No pending PR owns this test or the Sigma/d3 behavior. #6895 fixes the complementary global happy-dom teardown race and its combined merge-tree is clean; #5983 changes only the backend memory handler. ## Tests - focused: 11 passed - five consecutive focused runs after the coverage assertion was added: 55/55 passed - coverage mode: 11/11 passed; MemoryGraphTab line coverage 67.62% (gate floor 66.3%) - related Memory/Overview/Knowledge matrix: 8 files, 117/117 passed - negative mutation proved the renderer assertion fails when no Sigma instance mounts - npm run typecheck - full unfiltered npm run lint: 0 errors - jscpd: 2,425 files, 0 clones - git diff --check and clean merge-tree ## Screenshot evidence Why no screenshot: This changes only headless integration-test doubles and synchronization; production rendering, layout, styles, motion, and interaction behavior are unchanged. ## Checklist - [x] One Conventional Commit - [x] No retry, sleep, timeout increase, tolerance, or warning filter - [x] No existing PR changes overwritten - [x] No secrets or generated artifacts

@bolichen97
bolichen97 requested a review from a team as a code owner August 30, 2026 02:30
@bolichen97
bolichen97 requested a review from smeyffret August 30, 2026 02:30
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Aug 30, 2026
@bolichen97
bolichen97 force-pushed the test/make-memory-graph-integration-deterministic branch from d2963e0 to 7080e27 Compare August 30, 2026 03:01
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ⚠️ could not complete

The design review did not produce a verdict for 7080e278fbc3c4a9db7b1c9aa57a82e75f3d2267 (the model call errored or returned no verdict header). See the Fork Design Review job logs. Advisory — does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — ✅ PASS

UX-level review of 7080e278fbc3c4a9db7b1c9aa57a82e75f3d2267 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

The patch touches exactly one file — a headless integration test (website/integration/MemoryGraphTab.integration.test.tsx). No production code, no user-facing strings, no rendered surface, no screenshots. Nothing a human using the product will ever see changes.

UX-Verdict: PASS

Test-only change: no production UI, strings, or rendered behavior touched — nothing a user experiences differs.

[UX-REVIEWED] 7080e27

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 7080e278fbc3c4a9db7b1c9aa57a82e75f3d2267 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 7080e27

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 7080e278fbc3c4a9db7b1c9aa57a82e75f3d2267 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 7080e27

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Aug 30, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) August 30, 2026 04:10

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: test (1 file, integration test only). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: make MemoryGraphTab.integration.test.tsx deterministic by mocking the api.memoryGraph boundary, replacing d3 at its module boundary with a synchronous force contract, and using a constructable Sigma class fake, so it stops timing out at 15s in the full 1654-file run; no production, MSW server, shared setup, timeout or retry behaviour changed. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.

@iamwhatever
iamwhatever merged commit f71d48d into kirodotdev:main Aug 30, 2026
78 of 80 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants