|
| 1 | +{ |
| 2 | + "cases": [ |
| 3 | + { |
| 4 | + "id": "stdlib_refactor", |
| 5 | + "should_trigger": true, |
| 6 | + "fixtures": [ |
| 7 | + "plugins/python-structured-logging/skills/python-structured-logging/examples/stdlib/bad.py" |
| 8 | + ], |
| 9 | + "prompt": "Improve logging in bad.py using the existing stdlib stack. Preserve its signature and business behavior. Demonstrate fields in rendered output with a test formatter.", |
| 10 | + "criteria": [ |
| 11 | + "No structlog dependency or arbitrary keyword fields are introduced.", |
| 12 | + "Success returns None; negative amount raises PaymentGatewayError with the original message.", |
| 13 | + "Rendered output contains invoice and request IDs; the failure has one traceback record.", |
| 14 | + "No module-level handler installation or global logging reconfiguration is introduced." |
| 15 | + ] |
| 16 | + }, |
| 17 | + { |
| 18 | + "id": "structlog_refactor", |
| 19 | + "should_trigger": true, |
| 20 | + "fixtures": [ |
| 21 | + "plugins/python-structured-logging/skills/python-structured-logging/examples/structlog/bad.py" |
| 22 | + ], |
| 23 | + "prompt": "Improve logging in bad.py while preserving the current stack, function signature, and exception behavior.", |
| 24 | + "criteria": [ |
| 25 | + "A stable event and structured fields replace interpolated variable event names.", |
| 26 | + "Successful input returns None and negative input still raises PaymentGatewayError.", |
| 27 | + "A failure produces one record with traceback; negative input is not marked retryable." |
| 28 | + ] |
| 29 | + }, |
| 30 | + { |
| 31 | + "id": "review_only", |
| 32 | + "should_trigger": true, |
| 33 | + "fixtures": [ |
| 34 | + "plugins/python-structured-logging/skills/python-structured-logging/examples/stdlib/bad.py" |
| 35 | + ], |
| 36 | + "prompt": "Review the logging in bad.py. Report issues and concrete effects. Do not modify files.", |
| 37 | + "criteria": [ |
| 38 | + "Fixture checksums are unchanged and no new project files appear.", |
| 39 | + "Findings identify dynamic events and missing traceback with file locations.", |
| 40 | + "No migration or code edit is performed." |
| 41 | + ] |
| 42 | + }, |
| 43 | + { |
| 44 | + "id": "event_contract", |
| 45 | + "should_trigger": true, |
| 46 | + "fixtures": [ |
| 47 | + "evals/fixtures/service.py" |
| 48 | + ], |
| 49 | + "prompt": "Add amount_cents to the success log in service.py. Existing dotted event names are consumed by production alerts and must remain unchanged.", |
| 50 | + "criteria": [ |
| 51 | + "Both dotted event names remain unchanged.", |
| 52 | + "The success LogRecord contains amount_cents.", |
| 53 | + "Function signatures, return values and exception behavior remain unchanged." |
| 54 | + ] |
| 55 | + }, |
| 56 | + { |
| 57 | + "id": "exception_owner", |
| 58 | + "should_trigger": true, |
| 59 | + "fixtures": [ |
| 60 | + "evals/fixtures/service.py" |
| 61 | + ], |
| 62 | + "prompt": "Review exception logging across charge and handle_invoice. Change it only if necessary to prevent duplicate failure records.", |
| 63 | + "criteria": [ |
| 64 | + "One call with negative input produces exactly one failure record with traceback.", |
| 65 | + "The ValueError still propagates.", |
| 66 | + "No failure log is added to charge; leaving correct logging unchanged is acceptable." |
| 67 | + ] |
| 68 | + }, |
| 69 | + { |
| 70 | + "id": "context_lifecycle", |
| 71 | + "should_trigger": true, |
| 72 | + "fixtures": [ |
| 73 | + "evals/fixtures/async_jobs.py" |
| 74 | + ], |
| 75 | + "prompt": "Fix job context leaking into worker_idle in async_jobs.py. Preserve event names and ensure overlapping jobs retain their own IDs.", |
| 76 | + "criteria": [ |
| 77 | + "Run the program and decode every JSON line.", |
| 78 | + "Each job_processed event has its own job_id: one, two, three.", |
| 79 | + "worker_idle has no job_id.", |
| 80 | + "Cleanup also executes if processing raises; demonstrate that path with a focused test." |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + "id": "unrelated_cli", |
| 85 | + "should_trigger": false, |
| 86 | + "fixtures": [ |
| 87 | + "evals/fixtures/cli.py" |
| 88 | + ], |
| 89 | + "prompt": "Change render_total to include currency USD in its JSON output. Preserve stdout as the result stream.", |
| 90 | + "criteria": [ |
| 91 | + "The logging skill is not implicitly selected.", |
| 92 | + "JSON on stdout contains amount_cents and currency USD.", |
| 93 | + "No logging dependency, configuration, or conversion of print to logging is introduced." |
| 94 | + ] |
| 95 | + }, |
| 96 | + { |
| 97 | + "id": "sensitive_output", |
| 98 | + "should_trigger": true, |
| 99 | + "fixtures": [ |
| 100 | + "evals/fixtures/sensitive.py" |
| 101 | + ], |
| 102 | + "prompt": "Make logging in sensitive.py safe for payloads containing synthetic credentials. Preserve exception propagation. Verify the rendered failure output.", |
| 103 | + "criteria": [ |
| 104 | + "Neither the synthetic marker nor payload credentials occur anywhere in rendered logs.", |
| 105 | + "The original ValueError still propagates with its original message.", |
| 106 | + "The solution checks exception text as well as structured fields.", |
| 107 | + "The record retains enough operation and error-type information to diagnose the failure." |
| 108 | + ] |
| 109 | + } |
| 110 | + ] |
| 111 | +} |
0 commit comments