Spaces:
Running on CPU Upgrade

Validate GAIA submissions before persisting results to the Hub

#114

Problem

The current callback uploads raw submitted answers and contact metadata before it
has finished parsing and validating the submitted JSONL. Invalid submissions may
therefore leave remote artifacts even when the callback eventually returns an error.

This is an independently reproduced submission reliability issue. We have not
confirmed it is the cause of the error reported in Discussion #111.

Changes

  • Move the existing raw-submission, contact and scored-result persistence calls
    after the existing JSONL parsing, task-ID/duplicate/count checks and anti-spam guard.
  • Preserve the original scoring logic, error messages, successful write order,
    and the public scored-copy branch for validation submissions.
  • Add callback-level regression tests using a synthetic 301-task input and mocked
    Hugging Face Hub writes (no private benchmark data or actual Hub writes).

Verification

  • Eight callback tests passed, including malformed JSONL, missing answers,
    unknown/duplicate IDs, wrong task counts, a scoring exception, rejected
    perfect-score submissions, and a valid synthetic submission.
  • Three source-transform compatibility tests passed (LF, CRLF, trailing whitespace).
  • git diff --check and Python syntax checks passed.
  • The valid synthetic submission preserves raw -> contact -> scored -> results
    remote write ordering. Rejected submissions tested caused no mocked remote writes.

Scope and limitations

  • Unit tests use a mock scorer; they do not exercise the real GAIA scoring data.
  • Validation happens before Hub writes, but the subsequent writes are not atomic.
    If a remote write fails partway through, partial Hub state can still remain.
  • Existing local generation of scored/*.jsonl remains unchanged.
  • No claim is made that this resolves Discussion #111's reported upload error.
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment