Skip to content

fix(data-repo): runlog index builder reads .jsonl.gz run logs - #193

Merged
mbreiser merged 1 commit into
mainfrom
fix/runlog-index-gzip
Sep 7, 2026
Merged

fix(data-repo): runlog index builder reads .jsonl.gz run logs#193
mbreiser merged 1 commit into
mainfrom
fix/runlog-index-gzip

Conversation

@mbreiser

@mbreiser mbreiser commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #187, prerequisite for shipping #186 (Studio v0.72 commits run logs as .jsonl.gz).

Problem

scripts/build-runlog-index.py skipped *.jsonl.gz in local mode (# gz handled once behavior_v2 lands) and filtered .endswith('.jsonl') in --github mode. After #186 every new run is gzipped, so runlogs/<folder>/index.json would stop gaining entries and the dashboard catalog's Start / Duration would read "—" for every new run.

Change

  • Accept .jsonl and .jsonl.gz in both modes (is_runlog_name).
  • gzip is not seekable, so a .gz is read whole (--github: one raw download; a 1 h behavior_v2 run is ~4 MB compressed) and inflated; the existing 64 KB head / 4 KB tail parsing then applies unchanged. Plain .jsonl files still use the two Range reads — nothing changes for them.
  • file keeps the on-disk name (x.jsonl.gz) so the dashboard's per-file lookup matches; size is the committed (compressed) size, which is what the catalog shows.
  • A truncated .gz (half-written upload) still yields run_metadata + start via a streaming decompressor and never raises; end state stays null.
  • Docstring updated (the "never downloads the logs" claim now says: plain logs never; .gz whole, small).

Verification

  • No change for v1 logs: old vs new script on the local course clone (149 .jsonl in 10 folders) → every index.json byte-identical.
  • gz twins: 9 real logs gzipped alongside their originals → identical entries apart from file/size (gzip ratios 2.8–7.3×).
  • New tests/test-build-runlog-index.py (17 checks: plain vs gz twin, truncated gz, aborted run fallback, local CLI on a mixed folder, name filter) added to the pixi run test task.

Deploy

The data repo runs a copy: after merge, re-install into reiserlab/cshl-2026-course/.github/scripts/build-runlog-index.py (byte-identical) — same as #187's install step. Until then the Action ignores .gz files (no harm, just missing rows).

🤖 Generated with Claude Code

…or_v2 commit path)

scripts/build-runlog-index.py skipped *.jsonl.gz locally and filtered
.endswith('.jsonl') in --github mode, so once Arena Studio v0.72 commits
gzipped logs the per-folder index.json would stop gaining entries and the
dashboard catalog's Start/Duration would read '—' for every new run.

gzip is not seekable, so a .gz is read whole (a 1 h run is ~4 MB compressed)
and inflated; head/tail parsing is unchanged. 'file' keeps the .gz name, 'size'
is the committed (compressed) size — what the catalog shows. A truncated .gz
still yields metadata + start and never raises.

Verified: index.json byte-identical for all 149 v1 logs in the local course
clone (old vs new script); 9 gzipped twins of real logs index identically to
their originals apart from file/size. New tests/test-build-runlog-index.py
(17 checks) added to the pixi test task.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mbreiser
mbreiser merged commit 7b4e533 into main Sep 7, 2026
1 check passed
@mbreiser
mbreiser deleted the fix/runlog-index-gzip branch September 7, 2026 22:51
mbreiser added a commit that referenced this pull request Sep 7, 2026
…rebuild green

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant