patch: Propagate optional session IDs through parsed touched lines#51
Draft
stefanskoricdev wants to merge 4 commits into
Draft
patch: Propagate optional session IDs through parsed touched lines#51stefanskoricdev wants to merge 4 commits into
stefanskoricdev wants to merge 4 commits into
Conversation
Add session_id: Option<String> to TouchedLine for traceability. Extend parse_patch(input, session_id) and hunk parsing to stamp each added/removed touched line with the provided session ID. Update patch parser consumers and tests to pass explicit None where no session context exists, and session IDs where available. Keep patch/domain docs in sync with the parser and model contract. Co-authored-by: SCE <sce@crocoder.dev>
Convert intersect_patches from .filter().cloned() to .filter_map() so that when a post-commit hunk line matches an available line, the resulting overlapping line inherits the session_id from the matched entry in the first patch (a). This ensures session provenance is preserved through intersection, matching the existing model_id inheritance pattern. Co-authored-by: SCE <sce@crocoder.dev>
- Introduce ConversationRelated with schema-aligned fields (type, url) and add optional Conversation.related to the conversation payload model - Omit related when absent via skip_serializing_if = "Option::is_none" and initialize new entries with related: None in trace construction - Update context/sce/agent-trace-minimal-generator.md to reflect the current payload/type shape Co-authored-by: SCE <sce@crocoder.dev>
…sion_id provenance Conversation.related was always None despite the ConversationRelated domain type existing in the schema. Downstream consumers need session provenance to trace which sessions contributed to each AI-authored conversation. Extract non-empty session_id values from touched lines on the matched intersection_patch hunk, deduplicate with deterministic BTreeSet ordering, and emit conversation.related as session link entries. The related field is omitted (None) when no included lines provide session_id values. Co-authored-by: SCE <sce@crocoder.dev>
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.
No description provided.