feat(git): warn about co-change partners missing from diff and PR - #3074
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Mine bounded non-merge Git history for files that usually change with a changed file and report the ones absent from the change set on tracedecay_diff_context and tracedecay_pr_context. Bulk commits (>50 files) are ignored and single-file change sets need stronger evidence. Fixes #3015 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Co-change mining is enrichment: a failed, cancelled, or timed-out read now reports co_change_unavailable instead of refusing diff/PR context. The Git subprocess observes request cancellation and deadline, and paths stay as bytes so unrelated non-UTF-8 names do not abort the read. Also rebuild the embedded ChatGPT extension server bundle. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This branch has not been deployed
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.
Summary
tracedecay_diff_contextandtracedecay_pr_contextnow returnmissing_co_change_partners: files that Git history says usually change with a changed file but are not in the change set. For example, a schema change with no matching migration.Fixes #3015
Motivation
#3015: agents miss companion edits (migrations, fixtures, generated files) that history says go together.
Changes
crates/tracedecay-runtime-core/src/git/co_change.rs. It mines up to 1,000 non-merge commits with--no-renamesand skips bulk commits that touch more than 50 files. A partner is reported only if it still exists in the target tree. Results are ranked deterministically and capped at 20.CoChangePartnerV1 { file, partner_of, co_changes, partner_of_changes }.DiffContextResultV1and all threePrContext*V1variants (complete, symbols-unavailable, graph-pending) gain a requiredmissing_co_change_partnersfield.handlers/git/context.rs):HEAD.sdks/typescript/src/operations.tsand updated the SDK decode fixtures.Test plan
mcp_handler_test::graph_analysis_test::git_context_warns_about_co_change_partners_missing_from_the_change. The fixture repo always changes the schema and its migration together; the feature branch changes the schema without the migration. The test checks the exact partner reported bypr_contextanddiff_context, and checks thatdiff_contextreports nothing once the migration is in the change set. Before this change the field does not exist, so the test fails.git::co_change::tests::{a_change_missing_its_usual_companion_is_reported,bulk_commits_do_not_couple_files}(run viascripts/require-exact-test.sh … -- --exact)mcp_suitetests filtered oncontext(39 passed) andtracedecay-mcptests filtered oncontext(49 passed)cargo clippy -p tracedecay-runtime-core -p tracedecay-contracts -p tracedecay-mcp -p tracedecay --features tracedecay/test-transport --all-targets -- -D warningscargo fmt --all -- --check,pnpm --dir dashboard run contracts:check, SDK vitest (37 passed),python3 scripts/linux-test-partitions.py checkcargo nextest run --workspacewas not run locally; CI will run itChecklist
CHANGELOG.mdupdated (not done: release-please manages it).envfiles includedLink to Devin session: https://app.devin.ai/sessions/12af47e87dd44db6a9c72fdc845270da
Open in Devin Desktop: https://app.devin.ai/desktop/session/12af47e87dd44db6a9c72fdc845270da?variant=devin
Requested by: @ScriptedAlchemy