You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reader follow-ups for execution-graph: Codex session_meta fork/continuation, Claude system-event tool-result capture, Claude line-level fork/continuation #137
PR #126 ("Complete passive execution graph coverage", recommended for close) attempted three pieces beyond what those granular PRs landed. This issue tracks porting those three pieces.
Proposal
A. Codex: fork / continuation rows from `session_meta`
In `packages/reader/src/codex.ts`, read `session_meta.payload` for:
`forkSessionId` → emit a `SessionRelationshipRecord` with `relationshipType: 'fork'` and `relatedSessionId` set.
`continuedFromSessionId` → emit a `SessionRelationshipRecord` with `relationshipType: 'continuation'` and `relatedSessionId` set.
PR #121 only emitted `root` + `subagent` for Codex. The `session_meta` payload is the only evidence channel Codex exposes for fork/continuation.
B. Claude: system-event tool-result capture
In `packages/reader/src/claude.ts`, capture `type: 'system'` records carrying `subagent_session_id` / `agent_id` / `parent_tool_use_id` as additional `ToolResultEventRecord` rows with `eventSource: 'subagent_notification'` (or similar — match the existing event-source vocabulary from PR #77).
PR #122 only handled `system` records for compaction boundaries and `/resume` markers — subagent system events were skipped.
C. Claude: line-level explicit fork / continuation
In `packages/reader/src/claude.ts`, in addition to the existing `parentUuid` cross-file detection + `/resume` markers from PR #122, read explicit `forkSessionId` / `continuedFromSessionId` fields from per-line user/assistant records (where present in the JSONL) and emit the corresponding `fork` / `continuation` rows directly. Should compose cleanly with the existing `reconcileClaudeSessionRelationships` pass.
Acceptance criteria
Codex fixtures with `session_meta.payload.forkSessionId` / `continuedFromSessionId` produce `fork` / `continuation` rows; `sourceVersion` is populated from `cli_version`.
Claude fixtures with `type: 'system'` records carrying subagent identifiers produce additional `ToolResultEventRecord`s without disturbing existing compaction / `/resume` handling.
Claude fixtures with explicit `forkSessionId` / `continuedFromSessionId` line-level fields produce the corresponding rows; reconciliation with cross-file inference stays idempotent.
Tests in `packages/reader/src/codex.test.ts` and `packages/reader/src/claude.test.ts` cover each path.
Context
PR #77 landed the execution-graph substrate (#42). Subsequent granular PRs populated it:
PR #126 ("Complete passive execution graph coverage", recommended for close) attempted three pieces beyond what those granular PRs landed. This issue tracks porting those three pieces.
Proposal
A. Codex: fork / continuation rows from `session_meta`
In `packages/reader/src/codex.ts`, read `session_meta.payload` for:
PR #121 only emitted `root` + `subagent` for Codex. The `session_meta` payload is the only evidence channel Codex exposes for fork/continuation.
B. Claude: system-event tool-result capture
In `packages/reader/src/claude.ts`, capture `type: 'system'` records carrying `subagent_session_id` / `agent_id` / `parent_tool_use_id` as additional `ToolResultEventRecord` rows with `eventSource: 'subagent_notification'` (or similar — match the existing event-source vocabulary from PR #77).
PR #122 only handled `system` records for compaction boundaries and `/resume` markers — subagent system events were skipped.
C. Claude: line-level explicit fork / continuation
In `packages/reader/src/claude.ts`, in addition to the existing `parentUuid` cross-file detection + `/resume` markers from PR #122, read explicit `forkSessionId` / `continuedFromSessionId` fields from per-line user/assistant records (where present in the JSONL) and emit the corresponding `fork` / `continuation` rows directly. Should compose cleanly with the existing `reconcileClaudeSessionRelationships` pass.
Acceptance criteria
Out of scope
Refs