-
READ COMPREHENSIVE HANDOVER FIRST:
cat COMPREHENSIVE_HANDOVER_2025_08_01_1831_EEST.md
-
READ UPDATED MASTER PLAN:
cat RESEARCHPROCESS_GPS_MASTER_PLAN_v3.8_2025_08_01_1831_EEST.md
-
PAY SPECIAL ATTENTION TO:
- CRITICAL BUILD REQUIREMENTS section in master plan
- ALWAYS use CARGO_BUILD_JOBS=1 for ALL cargo commands
- Use extended timeouts (600000ms for builds, 300000ms for tests)
Context: FFI architecture is now implemented and working! Native modules use message-based communication. No more segfaults!
Priority Tasks:
-
Align WASM Module Message Format (Quick Win)
- Update WASM modules to use same JSON protocol as native
- Ensure consistent message structure
- Test both module types can use same interface
-
Create Module SDK
- Implement message builder utilities
- Add response parsing helpers
- Create macros for common patterns
- Location:
crates/rp-module-sdk/
-
Update ModuleLoader
- Remove trait object handling code
- Implement message routing layer
- Add unified module interface
-
Write Module Developer Documentation
- Create FFI pattern guide
- Document message protocol
- Provide example module template
- Use test-minimal as reference
-
Memory Sanitizer Testing
- Run tests with ASAN/MSAN
- Verify no memory leaks
- Test edge cases
# ALWAYS set before ANY cargo command
export CARGO_BUILD_JOBS=1
# Build commands
CARGO_BUILD_JOBS=1 cargo build --release
# Test commands
CARGO_BUILD_JOBS=1 cargo test --test test_name -- --nocapture
# Timeouts
# Builds: 600000ms (10 minutes)
# Tests: 300000ms (5 minutes)- Native modules: Use C-compatible FFI with JSON messages ✅
- WASM modules: Use C-style exports (needs alignment)
- Protocol: Unified JSON message format
- No trait objects across FFI boundaries!
- Test module:
modules/test-minimal/src/lib.rs - Research Log:
modules/research-log/src/lib.rs(updated) - Tests:
crates/rp-modules/tests/*_ffi_test.rs
- Libraries build to:
target/release/lib*.so - NOT in module directories (workspace precedence)
-
Start with WASM alignment:
cd /home/greg/ResearchProcess-GPS # Check current WASM module implementation cat modules/research-log-wasm/src/lib.rs
-
Update to match native protocol:
- Same message types (init, command, query, mutation, event)
- Same response format
- Remove any trait dependencies
-
Test both module types:
CARGO_BUILD_JOBS=1 cargo test --package rp-modules -
Begin SDK implementation:
- Start with basic message builders
- Add serialization helpers
- Create convenience macros
- NO_FALLBACK_POLICY: Zero tolerance for silent failures
- Build Performance: Expect 5-10 minute builds, this is NORMAL
- Xorg CPU: High usage is X11 forwarding, not actual load
- Always use: CARGO_BUILD_JOBS=1 (no exceptions!)
- ✅ FFI architecture completely redesigned
- ✅ Native modules working without segfaults!
- ✅ Message-based protocol implemented
- ✅ Comprehensive tests passing
- ✅ Build requirements documented
The hard part is DONE! Now it's mostly alignment and documentation work.
Remember: The module system is 85% complete. Focus on WASM alignment first, then SDK, then documentation.