-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/simplify codebase #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
btucker
wants to merge
8
commits into
main
Choose a base branch
from
refactor/simplify-codebase
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Replace custom hash-based line indexing with GitPython's native repo.blame() called on each session branch. This simplifies the implementation significantly while improving accuracy. Changes: - Remove hash_line(), build_line_grep_index(), lookup_line_with_grep() - Remove dependency on separate agentgit-index branch - Add build_session_index() using native git blame per branch - Add find_earliest_session() to find oldest commit by timestamp - Add SessionBlameEntry NamedTuple for cleaner data handling - Add 15 unit tests for blame functionality The new approach uses git's Myers diff algorithm for line tracking instead of custom 3-line window hashes, eliminating index staleness issues and reducing code by ~40% (575 -> 364 lines). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The blame implementation now uses git's native blame on each session branch instead of the previously documented hash-based index approach. Updated the "How Blame Works" section to accurately describe the simpler, more git-native implementation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The blame implementation was refactored to use native git blame instead of a custom hash-based index. These tests referenced removed functions (hash_line, build_line_grep_index, lookup_line_with_grep, normalize_session_path) that no longer exist. The new tests for the native git blame approach are in tests/cmd/test_blame.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Commit message improvements: - Use contextual summary from previous assistant message as subject line - Add previous_message_text field to AssistantContext for richer context - Structure commit body with Context, Thinking, and truncated User Prompt - Update blame to prefer informative subject lines over generic ones Fix conversation rounds grouping bug: - Tool-result-only user entries no longer break conversation round chains - Previously, entries like tool_result would set current_prompt=None, orphaning all subsequent operations including file changes - Now tool-result entries are correctly added to the current round Additional improvements: - Add has_file_operations() utility for fast transcript scanning - Add agentgit_build_conversation_rounds hook to web plugin - Fix session_id extraction for web sessions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a session contains operations for files that no longer exist (deleted, renamed, etc.), catch FileNotFoundError and OSError in addition to GitCommandError when adding files to the index. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major refactoring that simplifies agentgit's git output model: - One commit per user prompt instead of per operation/scene/round - Delete old build methods (build, build_from_prompt_responses, build_from_conversation_rounds, build_from_scenes) - Delete Scene, ConversationRound, SourceCommit dataclasses - Delete old plugin hooks for scene/round building - Filter system prompts (slash commands, task notifications, command output) from becoming commits - Remove separate "Initial state (pre-session)" commits - file initial state now included in first prompt commit that edits it Also improves agit sessions command: - Stable numbering (oldest=1, newest=highest) - Display newest first while preserving stable numbers - Create session/N refs for easy checkout (git checkout session/1) Removes ~4600 lines of code while maintaining functionality. All 462 tests pass. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.