Commit fcb9e32
committed
refactor(src): migrate 3 small command files to AppError pattern
Continue the ADR 0012 migration. Three small self-contained files land
together to keep the cadence brisk without bloating the PR:
1. app_core_commands.rs (4 commands: check_fts5_enabled,
check_db_integrity, get_vector_consent, set_vector_consent) — all
database-backed one-liners, now using AppError::db_lock_failed,
db_not_initialized, and db_query_failed.
2. pilot_feedback.rs (6 commands + require_pilot_logging_enabled
helper): logging-policy refusals now carry
SECURITY_PERMISSION_DENIED with retention of the env-var hint.
Added a small feedback_err helper so the three analytics commands
surface DB_QUERY_FAILED with detail, and export_pilot_data routes
validation outcomes through the matching AppError constructors
(path_traversal, invalid_path, sensitive_path).
3. decision_tree_runtime.rs (2 impls, 2 call sites in
model_commands.rs). The two Tauri wrappers list_decision_trees /
get_decision_tree in model_commands.rs migrate alongside so no
bridge calls are needed.
Verified: cargo check --all-targets clean, cargo test --lib
311 passed, 1 ignored (unchanged). AppError-typed signatures grew from
16 → 23 by the ADR methodology grep.
Remaining runway (per ADR 0012): 10 command files on Result<T, String>.
Next bites: startup_commands (3), backup.rs (4), search_api.rs (7).1 parent 5281b03 commit fcb9e32
4 files changed
Lines changed: 91 additions & 52 deletions
File tree
- src-tauri/src/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | | - | |
| 41 | + | |
37 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
390 | | - | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
40 | 58 | | |
41 | 59 | | |
42 | 60 | | |
| |||
60 | 78 | | |
61 | 79 | | |
62 | 80 | | |
63 | | - | |
| 81 | + | |
64 | 82 | | |
65 | | - | |
66 | | - | |
| 83 | + | |
| 84 | + | |
67 | 85 | | |
| 86 | + | |
68 | 87 | | |
69 | 88 | | |
70 | 89 | | |
| |||
77 | 96 | | |
78 | 97 | | |
79 | 98 | | |
80 | | - | |
| 99 | + | |
81 | 100 | | |
82 | | - | |
83 | | - | |
| 101 | + | |
| 102 | + | |
84 | 103 | | |
85 | 104 | | |
86 | 105 | | |
| |||
90 | 109 | | |
91 | 110 | | |
92 | 111 | | |
| 112 | + | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
96 | 116 | | |
97 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
98 | 120 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
102 | 124 | | |
103 | 125 | | |
104 | 126 | | |
105 | 127 | | |
106 | 128 | | |
107 | 129 | | |
108 | | - | |
| 130 | + | |
109 | 131 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
113 | 135 | | |
114 | 136 | | |
115 | 137 | | |
116 | 138 | | |
117 | | - | |
| 139 | + | |
118 | 140 | | |
119 | 141 | | |
120 | 142 | | |
| |||
124 | 146 | | |
125 | 147 | | |
126 | 148 | | |
127 | | - | |
| 149 | + | |
128 | 150 | | |
129 | 151 | | |
130 | 152 | | |
131 | | - | |
132 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
133 | 161 | | |
134 | | - | |
| 162 | + | |
135 | 163 | | |
136 | | - | |
| 164 | + | |
137 | 165 | | |
138 | 166 | | |
139 | | - | |
140 | | - | |
| 167 | + | |
| 168 | + | |
141 | 169 | | |
| 170 | + | |
142 | 171 | | |
0 commit comments