You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The http-adapter-surrealdb.test.ts integration test suite has 42 failing tests when the dev server is running. These tests were previously skipped (no SurrealDB server running) but now fail when executed.
AssertionError: expected [Function] to throw error matching /Version conflict/ but got 'HTTP 404: Not Found'
Various CRUD operations failing with unexpected error types
Context
These failures surfaced while fixing issue #484. The baseline test run (without dev server) skipped these 42 tests. When the dev server was started to verify the #484 fix, these previously-hidden failures appeared.
Root Cause
Likely related to the SurrealDB migration (PR #501) where the HTTP adapter implementation may have diverged from expected behavior or the tests weren't updated to match the new architecture.
Acceptance Criteria
All 42 tests in http-adapter-surrealdb.test.ts pass
Tests properly validate HttpAdapter behavior with SurrealDB backend
adapter.surrealQuery method either implemented or tests updated
Priority
Medium - These are integration tests that were previously skipped. The core functionality works (1538 other tests pass), but we need proper test coverage for the SurrealDB HTTP adapter.
Total Tests: 1638 tests (1538 passed, 42 failed, 58 skipped)
Failed Test File:http-adapter-surrealdb.test.ts (42 failures)
Failure Pattern:
All 42 failures are due to HTTP 404 responses from the dev-proxy server at http://localhost:8000/api/nodes.
Key Errors:
40 tests:NodeOperationError: HTTP 404: Not Found - Basic CRUD operations failing
1 test:TypeError: adapter.surrealQuery is not a function - Missing method
1 test: Expected "Version conflict" error but got "HTTP 404: Not Found"
Root Cause Hypothesis:
The dev-proxy server routes at http://localhost:8000/api/* are not configured or the server isn't handling SurrealDB requests properly after PR #501.
Analysis Update: Backend Bugs Found, Not Test Issues
After further investigation, the remaining 20 test failures are critical backend bugs in dev-proxy/NodeService, not test issues or "transition period" problems.
Cannot proceed with backend fixes due to pre-existing compilation errors on main branch.
Build Errors:
error[E0277]: the trait bound `fn(...) -> ... {handle_streamable_http_request}: Handler<_, _>` is not satisfied
--> packages/core/src/mcp/server.rs:241:29
The MCP server module has Axum handler trait issues that prevent compilation of:
Updated tests to use port 3001 (dev-proxy) instead of port 8000
Removed obsolete surrealQuery test
Results: 21 tests now pass (vs 0 before)
Root Cause Analysis:
All 20 remaining failures are backend bugs in SurrealStore, not test issues. The graph-native architecture stores parent_id as edges, not fields, but get_node() doesn't populate it from the graph.
🔴 Backend Fix Blocked by MCP Compilation Errors
Attempted Fix:
Added code to SurrealStore::get_node() to query has_child edges and populate parent_id (packages/core/src/db/surreal_store.rs:1025-1037)
Blocker:
Cannot build due to pre-existing MCP server compilation errors on main:
error[E0277]: Handler<_, _> not satisfied for handle_streamable_http_request
Decision:
PR #519 provides value (fixes 50% of tests) and should merge. Backend fixes require MCP errors to be resolved first.
Goal: All 41 tests passing - complete the graph-native migration.
The foundation work is done, backend fixes are designed and partially implemented. Just need to get past the MCP blocker and execute the remaining fixes.
Activity
malibio commentedon Nov 16, 2025
Test Baseline Documented
Current Status:
http-adapter-surrealdb.test.ts(42 failures)Failure Pattern:
All 42 failures are due to HTTP 404 responses from the dev-proxy server at
http://localhost:8000/api/nodes.Key Errors:
NodeOperationError: HTTP 404: Not Found- Basic CRUD operations failingTypeError: adapter.surrealQuery is not a function- Missing methodRoot Cause Hypothesis:
The dev-proxy server routes at
http://localhost:8000/api/*are not configured or the server isn't handling SurrealDB requests properly after PR #501.Starting work on fixing these integration tests.
malibio commentedon Nov 16, 2025
Progress Update: 50% Test Pass Rate Achieved
Primary 404 Issue Resolved: Tests now connect to dev-proxy on port 3001. Reduced failures from 42 to 20 (21 tests now passing).
Remaining 20 failures reveal deeper issues with dev-proxy backend behavior (not test bugs):
These suggest backend bugs in NodeService/dev-proxy that need fixing before tests can pass. Continuing investigation...
Fix: Update http-adapter-surrealdb tests for dev-proxy architecture (…
malibio commentedon Nov 16, 2025
Analysis Update: Backend Bugs Found, Not Test Issues
After further investigation, the remaining 20 test failures are critical backend bugs in dev-proxy/NodeService, not test issues or "transition period" problems.
Critical Bugs Identified:
parentIdreturns null after creation (line 734)containerNodeIdThese are NOT cosmetic issues - they indicate the migration to dev-proxy is incomplete. Core functionality doesn't work.
Recommendation:
The tests are correct - they're revealing that dev-proxy doesn't implement the required functionality.
malibio commentedon Nov 16, 2025
CRITICAL BLOCKER: Main Branch Doesn't Compile
Cannot proceed with backend fixes due to pre-existing compilation errors on main branch.
Build Errors:
The MCP server module has Axum handler trait issues that prevent compilation of:
Impact:
Recommendation:
The test fixes in PR #519 are valid and can merge, but full fix requires compilable codebase.
malibio commentedon Nov 16, 2025
Final Status: Partial Fix Complete, Backend Work Blocked
✅ Completed Work (PR #519)
Test Configuration Fix:
surrealQuerytestRoot Cause Analysis:
All 20 remaining failures are backend bugs in SurrealStore, not test issues. The graph-native architecture stores
parent_idas edges, not fields, butget_node()doesn't populate it from the graph.🔴 Backend Fix Blocked by MCP Compilation Errors
Attempted Fix:
Added code to
SurrealStore::get_node()to queryhas_childedges and populateparent_id(packages/core/src/db/surreal_store.rs:1025-1037)Blocker:
Cannot build due to pre-existing MCP server compilation errors on main:
Decision:
PR #519 provides value (fixes 50% of tests) and should merge. Backend fixes require MCP errors to be resolved first.
Next Steps:
Fix: Update http-adapter-surrealdb tests for dev-proxy architecture (…
malibio commentedon Nov 16, 2025
🔄 Session Handoff: Ready for Option 2 Completion
Work Completed This Session
✅ Test Configuration Fixes (PR #519 - Committed and Pushed)
surrealQuerytest✅ Root Cause Analysis Complete
All 20 remaining failures traced to incomplete graph-native migration:
parent_idstored ashas_childedges ✅ (working)parent_idretrieval from edges ❌ (missing - THIS IS THE BUG)✅ Backend Fix Designed
Solution identified and code ready (see Phase 5 below)
Critical Blocker Identified
MCP Module Compilation Errors prevent building dev-proxy:
This is a pre-existing error on main (not caused by this work).
Next Session: Complete Option 2
Step 1: Fix MCP Compilation Errors (CRITICAL BLOCKER)
Location:
packages/core/src/mcp/server.rsInvestigation Tips:
Diagnostic Commands:
Step 2: Apply Backend Fixes (After MCP Fixed)
Fix 1: parent_id Population (Highest Impact - ~5 tests)
File:
packages/core/src/db/surreal_store.rsLocation: After line 1024, inside the
if let Some(ref mut node) = node_optblockAdd this code:
Fix 2: containerNodeId HTTP 500 (1 test)
should correctly map containerNodeIdcontainerNodeIdis setFix 3: Embedding Vector HTTP 422 (2 tests)
should correctly map embeddingVector,should handle null embeddingVectorFix 4: Property Persistence (14 tests)
Fix 5: Schema Version in Properties (2 tests)
_schema_versionto properties objectStep 3: Rebuild and Test
Step 4: Commit and Update PR
git add -A git commit -m "Fix: Complete HttpAdapter integration tests - all 41 tests passing" git push origin feature/issue-505-fix-http-adapter-surrealdb-testsFiles to Focus On
Primary:
packages/core/src/mcp/server.rs- Fix compilation errors FIRSTpackages/core/src/db/surreal_store.rs- Add parent_id populationpackages/core/src/services/node_service.rs- Container/property/embedding fixesReference:
packages/desktop-app/src-tauri/src/bin/dev-proxy.rs- Working Axum handler examplespackages/desktop-app/src/tests/integration/http-adapter-surrealdb.test.ts- Test expectationsSuccess Criteria
cargo build -p nodespace-coresucceeds (no MCP errors)Current Branch:
feature/issue-505-fix-http-adapter-surrealdb-testsPR: #519 (will be updated with complete fix)
WIP: Backend fixes designed, MCP parameter ordering attempted
malibio commentedon Nov 17, 2025
📦 WIP Commit Pushed - Ready for Next Session
Commit:
8686baa- "WIP: Backend fixes designed, MCP parameter ordering attempted"Branch:
feature/issue-505-fix-http-adapter-surrealdb-testsWhat's in the WIP Commit
✅ parent_id population fix (packages/core/src/db/surreal_store.rs)
For the Next AI Agent
Pull the branch and continue from the WIP commit:
Priority 1: Fix MCP compilation (see detailed instructions in previous comment)
Priority 2: Test parent_id fix (should fix ~5 tests immediately)
Priority 3: Apply remaining backend fixes (containerNodeId, properties, embedding vectors)
Goal: All 41 tests passing - complete the graph-native migration.
The foundation work is done, backend fixes are designed and partially implemented. Just need to get past the MCP blocker and execute the remaining fixes.
malibio commentedon Nov 17, 2025
Status Update
Issue #505 is blocked by MCP server compilation errors that affect the entire main branch (not specific to this issue).
Root Cause:
packages/core/src/mcp/server.rshandle_streamable_http_requestandhandle_http_mcp_requestcargo clean && cargo buildCurrent Status:
Work Completed on This Branch:
Next Steps:
20 remaining items
Merge branch 'main' into feature/issue-505-fix-http-adapter-surrealdb…
Fix: Update http-adapter-surrealdb tests for dev-proxy architecture (…
WIP: Code review addressed, 19 backend bugs remaining for full test pass
WIP: Partial progress on Issue #505 - 22+ tests passing, backend fixe…
WIP: Code review addressed, 15 backend bugs remaining for full test pass
Fix: Complete Issue #505 - All http-adapter-surrealdb tests passing (…
Update Tests for Graph-Native Hierarchy Architecture (82 test failure…
Merge branch 'main' into feature/issue-505-fix-http-adapter-surrealdb…
Fix: Update http-adapter-surrealdb tests for dev-proxy architecture (…
WIP: Code review addressed, 19 backend bugs remaining for full test pass
WIP: Partial progress on Issue #505 - 22+ tests passing, backend fixe…
WIP: Code review addressed, 15 backend bugs remaining for full test pass
Fix: Complete Issue #505 - All http-adapter-surrealdb tests passing (…
Update Tests for Graph-Native Hierarchy Architecture (82 test failure…
Merge branch 'main' into feature/issue-505-fix-http-adapter-surrealdb…