Repository navigation
feat(zcode): enrich parser with new DB tables (quotes, session_input, tool_usage, turn_usage) - #53
Merged
Merged
Conversation
added 5 commits
November 12, 2026 14:04
…ol_usage and turn_usage data - Message gains a parser-specific extra bag (not in equality contract) - message.data.metadata.inputIntent: conversationQuotes + inputOrigin → Message.extra; turn-level error object → Message.extra.error - quotes preset: structured conversationQuotes take priority over the verbatim heuristic (source_kind=structured, no invented source event) - session_input: unpromoted (cancelled/discarded) inputs and backgroundNotifications (task-id/tool-use-id/status/summary parsed) → read_session extras - tool_usage join by tool_call_id: approval_status, destructive, cancelled_by_user, exit_code, duration_ms on tool_use entries - turn_usage rollup in read_token_usage: turns, model_retry_count, context_exceeded, turn_duration_ms, turn_error_types - fail-soft on legacy schemas (new tables absent → fields just absent) - docstring fix: file parts ARE observed (tool-result artifacts, 2026-11) Agent: zcode
…oc, quotes fall-through - session_input: include admitted-but-never-promoted rows in unpromoted_inputs (4 such rows exist in the live DB; docstring now matches the code) - read_token_usage: document the contract — turns>0 with zero message tokens returns the zeroed token block with turn stats, not None - quotes: when conversationQuotes is non-empty but EVERY record is invalid, fall through to the verbatim heuristic instead of dropping the turn (edge test added) Agent: zcode
… zcode fixture SQLite only parses underscored numeric literals from 3.46.0; the CI wheels bundle older sqlite and failed with 'unrecognized token'. The two session INSERT statements now use plain digits (parameter values outside SQL strings are unaffected). Agent: zcode
The mixed-literal stats dict inferred as dict[str, object], making the in-loop += and error_types indexing 'object' operands. Accumulate in typed locals (int counters + Dict[str, int]) and assemble the returned Dict[str, Any] once at the end. Agent: zcode
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.
Extracts data the zcode parser was silently dropping: structural conversationQuotes annotations (quotes preset now prefers structured source over the verbatim heuristic), unpromoted/cancelled user inputs, backgroundNotifications (task_id/tool_use_id), tool_usage join (approval_status, destructive, cancelled_by_user, exit_code, duration_ms), turn_usage rollup (retries, context_exceeded, durations), message.data.error. Fail-soft on legacy schemas (all readers covered by a legacy fixture test); includes assimilated legacy-compat CLI fix (ac57129). Reviewed: APPROVE with 3 minors, all closed in 9754fe0.