CRITICAL: Read these documents IN THIS ORDER before starting any work:
-
Comprehensive Handover:
cat COMPREHENSIVE_HANDOVER_2025_08_01_1321_EEST.md
Key points: Build times are NORMAL, module system is sound, tests compile
-
Master Plan:
cat RESEARCHPROCESS_GPS_MASTER_PLAN_v3.2_2025_08_01_1321_EEST.md
Note: Phase 4 is 47% complete and UNBLOCKED
-
Build Performance Guide:
cat docs/development/BUILD_PERFORMANCE_GUIDE_2025_08_01_1230_EEST.md
Remember: 5-10 minute builds are NORMAL
# Navigate to WASM module
cd /home/greg/ResearchProcess-GPS/modules/research-log-wasm
# Build for WASM target
cargo build --target wasm32-wasip1 --release
# Verify output exists
ls -la ../../target/wasm32-wasip1/release/research_log_wasm.wasm# Return to project root
cd /home/greg/ResearchProcess-GPS
# Run WASM-specific tests
cargo test --package rp-modules wasm_module_test -- --nocapture
# Also run simple WASM test
cargo test --package rp-modules simple_wasm_test -- --nocaptureIf tests fail:
- Check WASM module exports/imports
- Verify host function bindings
- Ensure resource limits are reasonable
- Check for missing WASI imports
# Create new crate
cd crates
cargo new rp-module-sdk --lib
# Add to workspace
# Edit /home/greg/ResearchProcess-GPS/Cargo.tomlSDK should include:
- Module trait with derive macros
- Message passing helpers
- Capability checking utilities
- Resource limit helpers
- WASM-specific utilities
- Working Directory:
/home/greg/ResearchProcess-GPS - Database: PostgreSQL on port 15432 (if needed)
- Build Mode: Use longer timeouts, single-threaded if needed
- Module system:
crates/rp-modules/src/ - Native module:
modules/research-log/src/lib.rs - WASM module:
modules/research-log-wasm/src/lib.rs - Tests:
crates/rp-modules/tests/
# Normal compilation times:
cargo check: 30-60 seconds
cargo build: 3-5 minutes
cargo test: 5-10 minutes
# If builds seem slow:
export CARGO_BUILD_JOBS=1 # Single-threaded- ✅ 5-10 minute build times
- ✅ High CPU during compilation
- ✅ Swap usage during builds
- ✅ Xorg CPU usage (display rendering)
- ❌ "Resource exhaustion" - it's just compilation
- ❌ "Infinite loops" - tests run fine
- ❌ "Architecture flaws" - design is sound
- ❌ "Module system broken" - it works correctly
- ALWAYS handle errors explicitly
- NO silent failures
- NO workarounds
- Fix issues properly
You'll know the session is successful when:
- WASM Module Loads: Tests pass showing WASM module can be loaded
- Communication Works: Module can send/receive messages
- Resource Limits Enforced: Limits are applied correctly
- SDK Started: Basic structure for module SDK created
If time permits after main tasks:
-
Module Documentation
- How to create a module
- Module lifecycle
- Security model
- Best practices
-
Helper Macros
#[derive(ResearchModule)]- Message handling macros
- Capability checking macros
-
Additional Tests
- Error cases
- Resource exhaustion
- Multiple module instances
# Check system resources
free -h
ps aux | grep cargo
# Build with timeout
timeout 600 cargo build
# Run specific test
cargo test --package rp-modules test_name
# Check WASM module info
wasm-objdump -x target/wasm32-wasip1/release/research_log_wasm.wasmReady to continue Phase 4 development. Focus on WASM module testing first, then SDK development.