Repository navigation
Commit 711246a
refactor(context): derive execution_source via model_validator
Move derivation out of with_defaults into a model_validator so it fires
on the plain-constructor path too (e.g. dev/init), and never assign None
for unmapped commands so the field stays absent under
model_dump(exclude_unset=True). with_defaults re-applies it since it
mutates command via setattr after construction.
Addresses Copilot review feedback on PR #132.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 9b2abc6 commit 711246a
2 files changed
Lines changed: 50 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| |||
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 42 | + | |
50 | 43 | | |
51 | 44 | | |
52 | 45 | | |
| |||
113 | 106 | | |
114 | 107 | | |
115 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
116 | 131 | | |
117 | 132 | | |
118 | 133 | | |
| |||
362 | 377 | | |
363 | 378 | | |
364 | 379 | | |
365 | | - | |
366 | | - | |
367 | | - | |
| 380 | + | |
| 381 | + | |
368 | 382 | | |
369 | 383 | | |
370 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
332 | 346 | | |
333 | 347 | | |
334 | 348 | | |
335 | | - | |
| 349 | + | |
336 | 350 | | |
337 | 351 | | |
338 | 352 | | |
339 | 353 | | |
340 | 354 | | |
341 | 355 | | |
342 | 356 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
| 357 | + | |
| 358 | + | |
348 | 359 | | |
349 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
350 | 364 | | |
351 | 365 | | |
| 366 | + | |
352 | 367 | | |
353 | 368 | | |
354 | | - | |
355 | | - | |
356 | | - | |
| 369 | + | |
357 | 370 | | |
358 | | - | |
359 | | - | |
360 | | - | |
| 371 | + | |
361 | 372 | | |
362 | 373 | | |
0 commit comments