|
| 1 | +# Deep Audit Report: cortex-gui IDE |
| 2 | + |
| 3 | +## Executive Summary |
| 4 | + |
| 5 | +This audit identified several "Action Gaps" in the cortex-gui IDE where UI elements imply functionality that is missing, broken, or unlinked to the backend. The most significant findings are **49 missing backend commands** that are invoked from the frontend but have no corresponding Tauri command handler. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 1. Critical Failures: Buttons/Elements with No Backend Implementation |
| 10 | + |
| 11 | +### 1.1 Missing Tauri Command Handlers (49 commands) |
| 12 | + |
| 13 | +The following `invoke()` calls in the frontend have **no matching `#[tauri::command]` handler** in the backend: |
| 14 | + |
| 15 | +| Command | File Location | Impact | |
| 16 | +|---------|--------------|--------| |
| 17 | +| `ai_cancel_stream` | AIContext.tsx:636 | AI streaming cannot be cancelled | |
| 18 | +| `apply_workspace_edit` | editor/RenameWidget.tsx:527,603 | Code refactoring/rename fails silently | |
| 19 | +| `browser_create` | pages/Session.tsx:115 | Embedded browser creation fails | |
| 20 | +| `browser_destroy` | pages/Session.tsx:167 | Browser cleanup fails | |
| 21 | +| `browser_navigate` | pages/Session.tsx:185 | Browser navigation broken | |
| 22 | +| `browser_back/forward/reload` | pages/Session.tsx:203-221 | Browser controls non-functional | |
| 23 | +| `browser_set_bounds` | pages/Session.tsx:144 | Browser positioning fails | |
| 24 | +| `debug_disconnect` | DebugContext.tsx:2239 | Debug session disconnect fails | |
| 25 | +| `debug_step_into_target` | DebugContext.tsx:3822 | Step into target debugging broken | |
| 26 | +| `debug_terminate` | DebugContext.tsx:2234 | Debug termination fails | |
| 27 | +| `devcontainer_*` | RemoteContext.tsx | All DevContainer operations fail | |
| 28 | +| `download_and_install_update` | AutoUpdateContext.tsx:289 | Auto-update cannot install | |
| 29 | +| `fs_create_dir` | tasks/TasksJsonEditor.tsx:274 | Task directory creation fails | |
| 30 | +| `git_branch_rename` | MultiRepoContext.tsx:1195 | Branch renaming fails | |
| 31 | +| `git_clean` | MultiRepoContext.tsx:1245 | Git clean operation fails | |
| 32 | +| `git_create_branch_from_tag` | tauri-api.ts:1328 | Branch from tag creation fails | |
| 33 | +| `git_remote_add/remove/rename` | MultiRepoContext.tsx | Remote management fails | |
| 34 | +| `git_reset_soft` | MultiRepoContext.tsx:1181 | Soft reset fails | |
| 35 | +| `git_stage_lines` | MultiRepoContext.tsx:1213 | Line staging fails | |
| 36 | +| `git_tag_delete/push/push_all` | tauri-api.ts | Tag operations fail | |
| 37 | +| `git_unstage_lines` | MultiRepoContext.tsx:1231 | Line unstaging fails | |
| 38 | +| `notebook_*` | NotebookContext.tsx | All notebook kernel operations fail | |
| 39 | +| `profiles_save` | ProfilesContext.tsx:291 | Profile saving fails | |
| 40 | +| `remote_forward_port` | RemoteContext.tsx:603 | Port forwarding fails | |
| 41 | +| `remote_stop_forward` | RemoteContext.tsx:639 | Port forward stop fails | |
| 42 | +| `rules_save_file` | RulesLibraryContext.tsx:530 | Rules saving fails | |
| 43 | +| `search_replace_*` | SearchContext.tsx | Search & replace operations fail | |
| 44 | +| `shell_open` | TerminalLinkProvider.tsx:288 | Shell file opening fails | |
| 45 | +| `ssh_delete/save_profile` | SSHContext.tsx | SSH profile management fails | |
| 46 | +| `tasks_run_task` | DebugContext.tsx | Pre/post debug task execution fails | |
| 47 | +| `terminate_cortex_process` | ProcessExplorer.tsx:910 | Process termination fails | |
| 48 | +| `testing_stop` | TestingContext.tsx:697 | Test stopping fails | |
| 49 | +| `tunnel_close` | RemoteContext.tsx:903 | Tunnel closure fails | |
| 50 | +| `update_extension` | ExtensionsContext.tsx:858 | Extension update fails | |
| 51 | +| `vscode_execute_*` | CommandContext.tsx | VS Code command execution fails | |
| 52 | + |
| 53 | +### 1.2 Empty Action Handlers |
| 54 | + |
| 55 | +**File: DiagnosticsPanel.tsx:409** |
| 56 | +```typescript |
| 57 | +action: () => {}, // Divider item - acceptable, but should be marked |
| 58 | +``` |
| 59 | + |
| 60 | +**File: OpenWithMenu.tsx:691** |
| 61 | +```typescript |
| 62 | +action: () => {}, // Separator item - acceptable, but should be marked |
| 63 | +``` |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## 2. Broken Bridges: Frontend/Backend Signature Mismatches |
| 68 | + |
| 69 | +### 2.1 Inconsistent Command Names |
| 70 | + |
| 71 | +| Frontend Invoke | Backend Command | Issue | |
| 72 | +|-----------------|-----------------|-------| |
| 73 | +| `fs_create_dir` | `fs_create_directory` | Name mismatch | |
| 74 | +| `git_tag_delete` | `git_delete_tag` | Name mismatch | |
| 75 | +| `git_tag_push` | `git_push_tag` | Name mismatch | |
| 76 | +| `testing_stop` | `testing_stop_watch` | Incomplete implementation | |
| 77 | + |
| 78 | +### 2.2 Parameter Mismatches to Verify |
| 79 | + |
| 80 | +Several commands have similar names but may have parameter type mismatches: |
| 81 | +- `git_stage_lines` vs `git_stage_hunk` (different granularity) |
| 82 | +- `git_unstage_lines` vs `git_unstage_hunk` (different granularity) |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +## 3. UX Improvements: Missing Feedback |
| 87 | + |
| 88 | +### 3.1 Missing Loading States |
| 89 | + |
| 90 | +| Component | Issue | |
| 91 | +|-----------|-------| |
| 92 | +| `AutoUpdateContext.tsx` | `download_and_install_update` has no progress indicator | |
| 93 | +| `ExtensionsContext.tsx` | Extension installation lacks progress | |
| 94 | +| `MultiRepoContext.tsx` | Git operations (fetch, push, pull) need loading states | |
| 95 | +| `NotebookContext.tsx` | Kernel operations should show activity | |
| 96 | + |
| 97 | +### 3.2 Silent Error Handling |
| 98 | + |
| 99 | +Multiple components catch errors but don't propagate them to the user: |
| 100 | + |
| 101 | +**Pattern found in multiple files:** |
| 102 | +```typescript |
| 103 | +.catch((e) => { |
| 104 | + console.error("Operation failed:", e); |
| 105 | + // No user notification! |
| 106 | +}); |
| 107 | +``` |
| 108 | + |
| 109 | +**Files with silent failures:** |
| 110 | +- `MenuBar.tsx:294` - Window creation failure silent |
| 111 | +- `FileExplorer.tsx:1771` - Watch directory unwatch failure silent |
| 112 | +- `DebugContext.tsx:1596` - Post-debug task failure silent |
| 113 | +- `ExtensionsContext.tsx` - Multiple extension operations fail silently |
| 114 | + |
| 115 | +### 3.3 Placeholder/Unimplemented Features |
| 116 | + |
| 117 | +**CollabContext.tsx:1025-1068** - Audio/Video calls marked as placeholder: |
| 118 | +```typescript |
| 119 | +// Placeholder: In a real implementation, this would initialize WebRTC |
| 120 | +collabLogger.debug("Audio call starting - placeholder implementation"); |
| 121 | +``` |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## 4. Navigation & UI Integrity |
| 126 | + |
| 127 | +### 4.1 Activity Bar Items |
| 128 | + |
| 129 | +All activity bar items (`ActivityBar.tsx`) have proper `onClick` handlers wired to view switching. The following views are properly connected: |
| 130 | +- Explorer ✅ |
| 131 | +- Search ✅ |
| 132 | +- Source Control ✅ |
| 133 | +- Debug ✅ |
| 134 | +- Extensions ✅ |
| 135 | +- Agents ✅ |
| 136 | +- Factory ✅ |
| 137 | +- Testing ✅ |
| 138 | +- Remote ✅ |
| 139 | + |
| 140 | +### 4.2 Menu Bar Actions |
| 141 | + |
| 142 | +The `MenuBar.tsx` component has comprehensive menu items with proper actions. Notable working implementations: |
| 143 | +- File operations (Open, Save, Close) |
| 144 | +- Edit operations (Undo, Redo, Cut, Copy, Paste) |
| 145 | +- View toggles (Sidebar, Terminal, Chat) |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +## 5. Action Plan |
| 150 | + |
| 151 | +### 5.1 Critical Priority (Missing Commands) |
| 152 | + |
| 153 | +1. **Add browser commands** in `src-tauri/src/browser.rs`: |
| 154 | + ```rust |
| 155 | + #[tauri::command] |
| 156 | + async fn browser_create(...) -> Result<...> { ... } |
| 157 | + #[tauri::command] |
| 158 | + async fn browser_navigate(...) -> Result<...> { ... } |
| 159 | + // etc. |
| 160 | + ``` |
| 161 | + |
| 162 | +2. **Add search/replace commands** in `src-tauri/src/` (new module): |
| 163 | + ```rust |
| 164 | + #[tauri::command] |
| 165 | + async fn search_replace_all(...) -> Result<...> { ... } |
| 166 | + #[tauri::command] |
| 167 | + async fn search_replace_in_file(...) -> Result<...> { ... } |
| 168 | + ``` |
| 169 | + |
| 170 | +3. **Fix command name mismatches** by either: |
| 171 | + - Updating frontend to use correct backend names |
| 172 | + - Or adding aliases in backend |
| 173 | + |
| 174 | +### 5.2 High Priority (UX) |
| 175 | + |
| 176 | +1. **Add toast notifications for errors** - Create a utility: |
| 177 | + ```typescript |
| 178 | + export function showErrorToast(message: string, details?: string) { |
| 179 | + notifications.show({ type: "error", title: message, body: details }); |
| 180 | + } |
| 181 | + ``` |
| 182 | + |
| 183 | +2. **Replace silent catches** with user feedback: |
| 184 | + ```typescript |
| 185 | + .catch((e) => { |
| 186 | + showErrorToast("Operation failed", e.message); |
| 187 | + }); |
| 188 | + ``` |
| 189 | + |
| 190 | +3. **Add loading states** to long-running operations using the `ActivityIndicator` component. |
| 191 | + |
| 192 | +### 5.3 Medium Priority (Consistency) |
| 193 | + |
| 194 | +1. **Standardize command naming** - All commands should follow pattern: `{module}_{action}` |
| 195 | +2. **Add TypeScript types** for all Tauri invoke parameters |
| 196 | +3. **Document placeholder features** with clear "Coming Soon" UI indicators |
| 197 | + |
| 198 | +--- |
| 199 | + |
| 200 | +## 6. Files Requiring Immediate Attention |
| 201 | + |
| 202 | +1. **`src-tauri/src/lib.rs`** - Register missing commands |
| 203 | +2. **`src/context/SearchContext.tsx`** - Replace/search implementation |
| 204 | +3. **`src/pages/Session.tsx`** - Browser integration |
| 205 | +4. **`src/context/NotebookContext.tsx`** - Kernel management |
| 206 | +5. **`src/context/RemoteContext.tsx`** - DevContainer and tunnel support |
| 207 | + |
| 208 | +--- |
| 209 | + |
| 210 | +## Appendix: Full List of Frontend Invoke Commands |
| 211 | + |
| 212 | +Total unique invoke commands found in frontend: **214** |
| 213 | +Backend commands registered: **500+** (including internal functions) |
| 214 | +**Missing commands: 49** |
| 215 | + |
| 216 | +The audit was performed on: |
| 217 | +- Date: 2026-01-27 |
| 218 | +- Commit: 30beef7 |
| 219 | +- Branch: master |
0 commit comments