Parser mismatches: wrong entry type names, SubAgentMetadataParser requires missing field #41
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/claude-code-query#41
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Three related parsing bugs discovered when running transcript analysis on real Claude Code conversation logs (PROC-272, 18 sessions with sub-agents).
Bug 1: Entry type name mismatches
ConversationLogParser.parsePayloaduses type names that don't match the actual JSONL format:"human""user"numTurnsalways 0"file_history_snapshot""file-history-snapshot"RawLogEntry"queue_operation""queue-operation"RawLogEntryAdditionally, these types are not handled at all:
"permission-mode"— carriespermissionModeandsessionId"attachment"— observed in real transcriptsEvidence from a real session (
08acd9a6):File:
core/src/works/iterative/claude/core/log/parsing/ConversationLogParser.scala, lines 68-78.Bug 2: SubAgentMetadataParser requires
agentIdfield that doesn't exist in.meta.jsonSubAgentMetadataParser.parsedoes:But actual
.meta.jsonfiles contain only:There is no
agentIdfield — the agent ID comes from the filename (e.g.agent-a27a237ab9050d9ef.meta.json). The parser should deriveagentIdfrom the filename or receive it as a parameter.Impact:
parsereturnsNonefor every sub-agent → downstream consumers get empty sub-agent lists → no role classification, no role attribution in transcript analysis.File:
core/src/works/iterative/claude/core/log/parsing/SubAgentMetadataParser.scala, lines 11-13.Bug 3: Entries without
uuidare silently droppedparseLogEntryrequiresuuidin the for-comprehension:But some entry types (e.g.
permission-mode,file-history-snapshot) don't carry auuid. These entries are silently dropped. This may be acceptable for metrics purposes, but should be documented as intentional behavior.Impact on downstream consumers
numTurnsis always 0 (noUserLogEntrypayloads parsed)subAgentCountByRoleis always empty (no sub-agents parsed)segmentRoleAttributionis always empty (consequence of above)findingsgeneration may be impaired (relies on complete entry data)Suggested fixes
"user"→UserLogEntry,"file-history-snapshot"→FileHistorySnapshotLogEntry,"queue-operation"→QueueOperationLogEntry"permission-mode"and"attachment"typesSubAgentMetadataParser.parse: deriveagentIdfrom the transcript filename instead of requiring it in JSON, since the.meta.jsonformat doesn't include itRelated