Repository navigation
fix: name the archive and member when an Inspect .eval log has a malformed header.json or sample - #98
Merged
noteflowai merged 1 commit intoNov 10, 2026
Conversation
…ormed header.json or sample
noteflowai
deleted the
automation/feature-2026-11-09-evalarc-134115048228
branch
November 10, 2026 13:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An engineer gating with an Inspect .eval archive gets an unexplained error when a member of the archive is unreadable. The gate already refuses the input with exit 2, so missing evidence cannot pass. The message, however, is either a bare JSON decoder position or a Python TypeError such as 'list indices must be integers or slices, not str'. Neither tells the reviewer which file or member is broken, or what to do. EA-02 asks that malformed records be explained, not just rejected. The JSON-log path already does this; the .eval path does not. The roadmap is stale (updated 2026-09-29), so this work is limited to an existing input path and adds no capability.
Scope: only the zip (.eval) branch of _inspect_document in src/evalarc/results_diff.py, plus a short note in docs/ci-gate.md. JSON-format Inspect logs, promptfoo, JUnit, diff classification, the schema and all output files are unchanged.
Member display: every member name in these messages is formatted with the existing _shown_id helper, which the existing sample-id errors use for untrusted values. Its truncation length was not inspected, so the plan relies only on the property the tests check: no raw control character from a member name reaches stderr. The archive name stays path.name, unescaped, like the existing archive errors. It comes from the user's own command-line argument. Member content never appears in a message.
Parsing: a small helper reads each decoded member (header.json and each samples/*.json) and calls json.loads. On json.JSONDecodeError or UnicodeDecodeError it raises ValueError: "{archive} member {member} is not valid JSON: {decoder message}. Re-export the log from Inspect (inspect log dump LOG.eval > LOG.json) or rerun the evaluation instead of editing the archive." The helper does not catch NotImplementedError or BadZipFile, so the existing zstd guidance and BadZipFile message still apply.
Header type: if the parsed header.json is not a JSON object, the code raises ValueError before the samples are assigned: "{archive} member header.json must be a JSON object (got {type}): the archive is not a usable Inspect log. Re-export it from Inspect or rerun the evaluation." {type} comes from the existing _json_type helper.
Sample members that parse as JSON but are not objects keep the existing 'sample at position N is not an object' error from _inspect.
Unchanged: the declared-size bomb check, the missing header.json message, member ordering and how samples are collected.
CLI contract: when either input to evalarc diff BASELINE CURRENT [--output DIR] [--markdown FILE] [--json] has one of these defects, the command prints 'evalarc: ' to stderr, writes nothing to stdout, exits 2, creates no --output folder and appends no Markdown. Valid archives produce the same cases and exit codes as before.
Documentation: docs/ci-gate.md gets a short paragraph directly after the existing 'Exit codes' paragraph. It shows one example message for an invalid member and one for a non-object header.json, and gives the recovery step (inspect log dump LOG.eval > LOG.json, or rerun the evaluation).
Acceptance:
One specialist feature. Behavioral acceptance fails on the base and passes on the implementation; project checks and independent model review passed. GPU results are included only when actually executed. Automatically developed and reviewed; no human review is claimed.