Commit 4cd08eb
amabito
fix(evaluators): budget R2 -- percent-encoding, fail-closed snapshot, dunder guard
R2 findings:
- _sanitize_scope_value: percent-encode |/= instead of replacing with _
(was causing key collisions between "a|b" and "a_b")
- max_buckets fail-closed: spent_usd/spent_tokens now 0.0/0 (not recorded,
previously reported current-call-only values misleading callers)
- _extract_by_path: narrowed guard from startswith("_") to startswith("__")
(single-underscore dict keys are legitimate data fields)
- Fixed tautological test assertion in test_scope_key_injection_pipe
- Added 3 tests: no-collision, single-underscore access, NaN/Inf cost
57 budget tests, 287 total evaluator tests passing.1 parent 8ae042f commit 4cd08eb
3 files changed
Lines changed: 38 additions & 9 deletions
File tree
- evaluators/builtin
- src/agent_control_evaluators/budget
- tests/budget
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | | - | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | | - | |
145 | | - | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
417 | 424 | | |
418 | 425 | | |
419 | 426 | | |
| 427 | + | |
420 | 428 | | |
421 | 429 | | |
422 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
423 | 433 | | |
| 434 | + | |
424 | 435 | | |
425 | 436 | | |
426 | 437 | | |
| |||
440 | 451 | | |
441 | 452 | | |
442 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
0 commit comments