fix(readers): repair amplifier/claude-code, add codex + copilot#3
Merged
Conversation
Two existing readers had drifted out of sync with their source formats,
so nightly runs were silently producing zero signals against real data.
This restores both and adds two of the planned readers from the README.
- amplifier: walk both the legacy flat layout
(`<projects>/<sess>/transcript.jsonl`) and the current nested layout
(`<projects>/<project>/sessions/<sess>/{transcript,events}.jsonl`).
Newer Amplifier sessions write `events.jsonl` instead of
`transcript.jsonl`; the loader synthesizes Schema-B messages from
`prompt:submit` (user), `llm:response` text (assistant), and
`tool:post` (tool, with structured result preserved so detect_errors
still fires on `success: false`).
- claude-code: unwrap the `{type, message: {role, content}}` wrapper
format. Legacy flat lines continue to parse. Session-meta lines
(last-prompt, permission-mode, ai-title, attachment,
file-history-snapshot) are skipped.
- codex (new): walks `~/.codex/sessions/**/rollout-*.jsonl` and emits
user + assistant Schema-B messages from `response_item` lines whose
`payload.type` is `message`. Drops `developer` (system prompt) and
non-message response items (reasoning, function_call, custom_tool_call).
- copilot (new): walks `~/.copilot/session-state/*/events.jsonl` and
emits Schema-B messages from `user.message` and `assistant.message`
events. Session metadata (start/shutdown/turn_*/system.message) is
skipped.
Wire-up:
- jilog-review/src/readers/mod.rs: re-export CodexReader, CopilotReader.
- jilog/src/config.rs: add `type = "codex"` and `type = "copilot"`
reader variants with sensible default paths.
- README: refresh the Readers table and Quick Start example.
Tests: 6 new unit tests covering legacy + nested + events-only +
both-present amplifier layouts, the wrapped claude-code shape, codex
message vs. non-message + role filtering, and copilot message vs.
session metadata. All 83 jilog-review tests pass.
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.
Summary
Two existing readers had drifted out of sync with their source formats, so nightly runs were silently producing zero signals against real data. This PR restores both readers and adds two of the planned readers already listed in the README.
amplifier— Discover both the legacy flat layout and the current nested layout (<projects>/<project>/sessions/<sess>/{transcript,events}.jsonl). Newer Amplifier sessions writeevents.jsonlinstead oftranscript.jsonl; the loader synthesizes Schema-B messages fromprompt:submit(user),llm:responsetext blocks (assistant), andtool:post(tool, with structuredsuccess/outputpreserved sodetect_errorsstill fires onsuccess: false).claude-code— Unwrap the{type, message: {role, content}}wrapper that real Claude Code lines now use. Legacy flat{role, content}lines continue to parse. Session-meta lines (last-prompt,permission-mode,ai-title,attachment,file-history-snapshot) are skipped.codex(new) — Walks~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonland emits user + assistant messages fromresponse_itemlines whosepayload.typeismessage. Dropsdeveloper(system prompt) and non-message response items (reasoning,function_call,custom_tool_call).copilot(new) — Walks~/.copilot/session-state/<uuid>/events.jsonland emits messages fromuser.messageandassistant.messageevents. Session metadata (session.*,assistant.turn_*,system.message) is skipped.Wire-up
jilog-review/src/readers/mod.rs: re-exportCodexReader,CopilotReader.jilog/src/config.rs: addtype = "codex"andtype = "copilot"variants with sensible default paths (~/.codex/sessions,~/.copilot/session-state).README.md: refresh the Readers table and the Quick Start config example.Test plan
cargo test -p jilog-review— 83/83 pass, including 6 new unit testscargo build— clean0 sessions / 0 signalsto67 sessions / 101 signals(69 corrections, 23 errors, 8 workarounds, 1 deferral, 1 P0 alert)New tests cover:
success: false)messagefield + meta-line skippinguser.messageandassistant.messagekept, all session metadata dropped)