refactor notes

This commit is contained in:
Alexander Kiselev
2026-01-20 16:19:44 -08:00
parent 35a864bd2f
commit 759dda6c2a
+20 -16
View File
@@ -48,17 +48,20 @@ The `debugger-cli` project at `~/git/debugger-cli` provides a good pattern for d
- `BridgeResponse<T>` typed response handling - `BridgeResponse<T>` typed response handling
- Embeds bridge.py via `include_str!` macro - Embeds bridge.py via `include_str!` macro
### Phase 5: Daemon Update 🚧 ### Phase 5: Daemon Update
- Status: Not yet wired up - Created `src/daemon/handler.rs` - routes IPC commands to bridge
- Remaining: Refactor daemon to use new IPC layer and bridge - Created `src/daemon/ipc_server.rs` - local socket IPC server
- Refactored `src/daemon/mod.rs` to manage `GhidraBridge` and IPC server
- Daemon now starts both IPC server (port 18701) and legacy TCP RPC
### Phase 6: Typed Responses ⚙️ ### Phase 6: Typed Responses
- `BridgeResponse<T>` created in `bridge.rs` - `BridgeResponse<T>` created in `bridge.rs` for typed deserialization
- Remaining: Update all response handling - IPC `Response` uses `serde_json::Value` for flexibility
- Handler deserializes bridge responses into typed structures
### Phase 7: GUI Integration (Optional) ### Phase 7: GUI Integration (Optional)
- Status: Not started - Status: Not started
- Future work - Future work: `goto`, `highlight` commands
--- ---
@@ -72,30 +75,31 @@ The `debugger-cli` project at `~/git/debugger-cli` provides a good pattern for d
- `src/ipc/transport.rs` - Socket transport layer - `src/ipc/transport.rs` - Socket transport layer
- `src/ipc/client.rs` - Daemon client - `src/ipc/client.rs` - Daemon client
- `src/daemon/handler.rs` - IPC command handler
- `src/daemon/ipc_server.rs` - Local socket IPC server
### Modified Files ### Modified Files
- `Cargo.toml` - Added `interprocess` crate - `Cargo.toml` - Added `interprocess` crate
- `src/main.rs` - Added `mod ipc` - `src/main.rs` - Added `mod ipc`, updated daemon config
- `src/ghidra/mod.rs` - Added `mod bridge`, `#[derive(Debug)]` on `GhidraClient` - `src/ghidra/mod.rs` - Added `mod bridge`, `#[derive(Debug)]` on `GhidraClient`
- `src/ghidra/scripts.rs` - All scripts now have output markers - `src/ghidra/scripts.rs` - All scripts now have output markers
- `src/ghidra/headless.rs` - Marker-based JSON extraction - `src/ghidra/headless.rs` - Marker-based JSON extraction
- `src/daemon/mod.rs` - Integrated bridge and IPC server
--- ---
## Remaining Work ## Remaining Work
To complete the refactoring: 1. **Manual testing** - Test with actual Ghidra installation
2. **GUI Integration (Phase 7)** - Optional `goto`, `highlight` commands
1. **Wire up bridge to daemon** - Modify `daemon/mod.rs` to hold `GhidraBridge` 3. **Cleanup** - Remove unused transport functions, fix warnings
2. **Route commands through bridge** - Update `daemon/queue.rs` to use bridge instead of spawning headless
3. **Switch to IPC layer** - Replace TCP RPC with local socket IPC
4. **Remove one-shot execution** - Clean up legacy headless spawning code
5. **Manual testing** - Test with actual Ghidra installation
--- ---
## Build Status ## Build Status
``` ```
✅ cargo check - PASSED ✅ cargo build --release - PASSED
✅ cargo test - 30 passed, 1 pre-existing failure (test_parse_hex) ✅ cargo test - 30 passed, 1 pre-existing failure (test_parse_hex)
⚠️ 48 warnings (mostly unused code, can be cleaned up)
``` ```