Commit f9b486a
Epic 5.4: Extract confirmation logic to evolution/confirmation.py (#42)
* feat(evolution): extract confirmation logic (Epic 5.4)
Extract _llm_confirm_evolution and _parse_confirmation from evolver.py
to evolution/confirmation.py (~160 lines).
- llm_confirm_evolution: LLM-based candidate validation with recording
- parse_confirmation: JSON + keyword response parser
- _SKILL_CONTENT_MAX_CHARS constant moved to confirmation.py
- MRO preserved: calls evolver._format_analysis_context and
evolver._parse_confirmation through instance
- 28 new tests: JSON/keyword parsing, async flow, error path, MRO seams
- 1,498 total pass, 127 skipped
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(5.4): harden recording, preserve logger namespace, add edge tests
Fixes ALL findings from /8eyes + /collab review:
- SEC: Truncate recorded prompt/response to 2000 chars (data minimization)
- SEC: Remove copy.deepcopy — build truncated messages instead
- M-1: Logger uses evolver namespace for log filter compatibility
- M-2: Add delegation seam tests (real SkillEvolver path)
- L-2: Add edge case tests (conflicting keywords, JSON array, _model=None)
- L-2: Add recording truncation verification test
- L-2: Add logger namespace test
36 confirmation tests pass; 1,506 total pass, 127 skipped.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(5.4): fix parse negation bugs, harden all recording paths
Round 2+3 fixes:
- BUG FIX: parse_confirmation now handles negation patterns (not/never/don't)
'do not confirm', 'never confirm', 'don't proceed' correctly return False
- BUG FIX: JSON string 'false' no longer truthy (strict bool/string check)
- BUG FIX: Negative keywords checked FIRST (conservative fail-safe)
- SEC: All 4 recording paths in evolver.py now truncate to 2000 chars
- SEC: copy.deepcopy removed from all recording paths
- OBS: skill_id added to iteration response_metadata for correlation
- OBS: Logger namespace preserved (evolver) for filter compatibility
44 confirmation tests; 1,514 total pass, 127 skipped.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(5.4): add cannot/can't negation patterns (R3 finding)
GPT-5.4 R3 found 'cannot confirm' and 'can't confirm' bypassed negation.
Added \bcannot\b and \bcan'?t\b to negative keyword regex.
3 new tests: cannot_confirm, cant_confirm, cant_proceed_no_apostrophe.
47 confirmation tests; 1,517 total pass, 127 skipped.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Brian Krafft <bkrafft@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent fc743e1 commit f9b486a
3 files changed
Lines changed: 665 additions & 102 deletions
File tree
- openspace/skill_engine
- evolution
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | | - | |
103 | | - | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| |||
252 | 256 | | |
253 | 257 | | |
254 | 258 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
271 | 265 | | |
272 | 266 | | |
273 | | - | |
| 267 | + | |
274 | 268 | | |
275 | 269 | | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 270 | + | |
352 | 271 | | |
353 | 272 | | |
354 | 273 | | |
| |||
722 | 641 | | |
723 | 642 | | |
724 | 643 | | |
725 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
726 | 649 | | |
727 | | - | |
| 650 | + | |
728 | 651 | | |
729 | 652 | | |
730 | 653 | | |
| |||
773 | 696 | | |
774 | 697 | | |
775 | 698 | | |
776 | | - | |
| 699 | + | |
777 | 700 | | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
778 | 705 | | |
779 | 706 | | |
780 | | - | |
| 707 | + | |
781 | 708 | | |
782 | 709 | | |
783 | 710 | | |
| |||
948 | 875 | | |
949 | 876 | | |
950 | 877 | | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
951 | 882 | | |
952 | | - | |
| 883 | + | |
953 | 884 | | |
954 | 885 | | |
955 | 886 | | |
| |||
995 | 926 | | |
996 | 927 | | |
997 | 928 | | |
998 | | - | |
999 | | - | |
| 929 | + | |
| 930 | + | |
1000 | 931 | | |
1001 | 932 | | |
1002 | 933 | | |
| |||
0 commit comments