Repository navigation
Conversation
…ceback json.loads and yaml.safe_load raise RecursionError, not ValueError, past the interpreter's nesting limit. The user-file readers that caught only ValueError (repo compare --ledger, the batch stamp, eval and answers files, repair receipts, --resume and --jsonl rows, task source lines, skill, eval-coverage and upstream manifests, the runtime config) let it escape as a traceback. The ledger now goes through the shared reader in dokimi.files, which already refuses deep nesting; the others catch RecursionError with the handler they already have. Tests: tests/test_deep_user_inputs.py (16 cases, red on the base, green here). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…ell or ideal The readers that intel#1645 did not reach still let a RecursionError escape on deeply nested input: the native log (eval native-import), the subject descriptor (catalog show --kind subject), a SWE-bench FAIL_TO_PASS cell, and a json_match ideal. The log and the descriptor now go through the shared reader in dokimi.files, which refuses deep nesting as InputError. The cell and the ideal are not files: a cell nested too deeply is not a list, and an ideal nested too deeply is dropped with the note an ideal that is not JSON already gets. batch_stamp and answers_by_id stay as they are: both already read any unparseable file, deep or not, as a missing stamp or answers file, and tests/test_deep_user_inputs.py pins that. Tests: tests/test_deep_user_inputs.py (4 new cases, red on the base). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
The four eval native-import log rows (missing, directory, unreadable, dangling-link) exit 2 with an input error now, so the allowlist names them as known failures that pass. Rows and digest follow the list. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…oo or arms file A TOML subject descriptor nested past the parser's limit, or one that cannot be read, and an awareness arms.v1 file nested past the limit, not UTF-8 or unreadable, still let a RecursionError or a decode or OS error escape as a traceback. Each is now an InputError naming the file: the descriptor is read by a helper, the arms file is read with its JSON error still reported as before. A promptfoo code config whose node output nests past the parser's limit is refused the same way, naming the config; its other output failures keep their ValueError and exit code. A malformed TOML or arms file keeps its current error. Tests: tests/test_deep_user_inputs.py (8 new cases, 5 red on the base). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Mutation of changed linesAt cc9893d: 15 caught · 6 missed Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put
Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1666 +/- ##
==========================================
- Coverage 96.49% 96.44% -0.05%
==========================================
Files 569 585 +16
Lines 75249 76625 +1376
Branches 12980 13174 +194
==========================================
+ Hits 72611 73904 +1293
- Misses 1615 1665 +50
- Partials 1023 1056 +33
🚀 New features to boost your workflow:
|
review commits after a06b406 (the #1645 and #1650 commits are below it; merge after #1650)
Summary
Malformed TOML, malformed arms JSON and a missing descriptor keep their current errors.
Evidence
tests/test_deep_user_inputs.pyat a06b406: 7 of the 8 new cases fail (deep TOML, deep arms, deep promptfoo output, non-UTF-8 TOML and arms, unreadable TOML and arms). The eighth, the promptfoo non-UTF-8 output case, is already refused and is pinned as is.make ci-local(cc9893d): exit 2 on three gates, none from this diff's code:schema_compat: 5 BREAKING schema changes come from the stack base (a06b406 vs intel/main); this diff touches no schema file.Repeat changed tests: seed 8 failed once on a ScandirIterator ResourceWarning at pytest unconfigure; rerun ofrepeat_changed_tests.py --repeats 8passes all seeds.pip-audit: CVEs on filelock in the environment; the lock file is untouched.Merge Danger
Door: two-way. Exit codes change for three input kinds: exit 5 (traceback) becomes exit 2 with a named file. Revertible by reverting the commit.
Blast Radius:
subjects show,subjects runandsubjects listerror text and exit codes for deep, non-UTF-8 or unreadable TOML and arms files; promptfoo import for deeply nested node output. No change for valid input.🤖 Generated with Claude Code