feat: resolve diff feedback via commit attribution#697
Conversation
Capture signed Agents-Attribution trailers from push commits and use them as the first exact attribution path for PR diff-line feedback. Persist PR review comment ancestry fields on self-improvement feedback and document the commit-artifact resolver mode. Agents-Run: 2ac77a42276b77f1 Agents-Agent: coder Agents-Attribution: eyJ2IjoxLCJpbnN0YW5jZV9pZCI6InRzLWxvbmVzdGFyIiwid29ya3NwYWNlIjoiZGVmYXVsdCIsInJlcG8iOiJlbG95bHAvYWdlbnRzIiwic3Bhbl9pZCI6IjJhYzc3YTQyMjc2Yjc3ZjEiLCJhZ2VudF9pZCI6ImFnZW50XzBmYjgyZDFmZTM0ZTQ1NDA4YmQyZmVlMTUzZjcwMDNkIiwiYWdlbnRfbmFtZSI6ImNvZGVyIiwic2lnIjoiMGQwOHY5ZFZxVWFkdXZZZHFLUHFicFlycTVhUWpHYXpPUmVWR3NlR1RrYyJ9
PR Review — pr-reviewerVerdict: REQUEST_CHANGES Findings
SummaryThe commit-artifact resolver path and unsigned-commit fail-closed behavior look covered, but the PR review comment persistence contract from #696 is not satisfied yet. Verification: |
Keep pull_request_review_comment feedback identity on github_review_comment_id and stop surfacing PR review comment IDs through github_comment_id. Add redelivery handling keyed by the review comment identity. Agents-Run: 2968f6edc83c68aa Agents-Agent: coder Agents-Attribution: eyJ2IjoxLCJpbnN0YW5jZV9pZCI6InRzLWxvbmVzdGFyIiwid29ya3NwYWNlIjoiZGVmYXVsdCIsInJlcG8iOiJlbG95bHAvYWdlbnRzIiwic3Bhbl9pZCI6IjI5NjhmNmVkYzgzYzY4YWEiLCJhZ2VudF9pZCI6ImFnZW50XzBmYjgyZDFmZTM0ZTQ1NDA4YmQyZmVlMTUzZjcwMDNkIiwiYWdlbnRfbmFtZSI6ImNvZGVyIiwic2lnIjoiempKUXg5Vjk0U29Ud3N0OWY4Q0xXa1FGY19oMjdDbEZuRjlkR0k5OGxOUSJ9
|
Addressed the review finding in 4fb07bb. PR review-comment feedback now keeps Verification: |
PR Review — pr-reviewerVerdict: APPROVE Findings
SummaryThe prior request-changes finding is addressed: PR review-comment feedback now keeps Verification: |
|
Please tighten the data model before we merge. The feature direction is right, but there is still implementation drift in the persistence layer that keeps fields non-orthogonal. Blocking cleanup requested:
Expected invariant after cleanup:
Please add or adjust tests so they inspect the stored DB row semantics, not only the normalized API struct. The goal is that tables are orthogonal and every field has exactly one meaning, without compatibility shims or hidden normalization. |
PR Review — pr-reviewerVerdict: REQUEST_CHANGES Findings
SummaryThe feature remains directionally correct, but the maintainer's blocking cleanup request is still outstanding at |
PR review-comment feedback now stores and upserts by github_review_comment_id without mapping that identity into github_review_id. The feedback table migration replaces the legacy table-level unique constraint with partial identity indexes so multiple review comments can keep zero legacy IDs. Agents-Run: cfebe974245cb101 Agents-Agent: coder Agents-Attribution: eyJ2IjoxLCJpbnN0YW5jZV9pZCI6InRzLWxvbmVzdGFyIiwid29ya3NwYWNlIjoiZGVmYXVsdCIsInJlcG8iOiJlbG95bHAvYWdlbnRzIiwic3Bhbl9pZCI6ImNmZWJlOTc0MjQ1Y2IxMDEiLCJhZ2VudF9pZCI6ImFnZW50XzBmYjgyZDFmZTM0ZTQ1NDA4YmQyZmVlMTUzZjcwMDNkIiwiYWdlbnRfbmFtZSI6ImNvZGVyIiwic2lnIjoiOUV4cDN1UmlkeHpBSnF1R180M3NWWXltVTBmLUxmdV93R2EyNnJyNHB0YyJ9
|
Addressed the blocking data-model cleanup in Changes made:
Verification:
|
PR Review — pr-reviewerVerdict: REQUEST_CHANGES Findings
SummaryThe review-comment write path now stores Verification: |
Run migration 058 outside the standard transaction so SQLite applies foreign_keys=OFF before the feedback table rebuild. Add a regression test that reruns the migration with an existing recommendation row and verifies the FK remains valid. Agents-Run: dcf1e26a1053dc09 Agents-Agent: coder Agents-Attribution: eyJ2IjoxLCJpbnN0YW5jZV9pZCI6InRzLWxvbmVzdGFyIiwid29ya3NwYWNlIjoiZGVmYXVsdCIsInJlcG8iOiJlbG95bHAvYWdlbnRzIiwic3Bhbl9pZCI6ImRjZjFlMjZhMTA1M2RjMDkiLCJhZ2VudF9pZCI6ImFnZW50XzBmYjgyZDFmZTM0ZTQ1NDA4YmQyZmVlMTUzZjcwMDNkIiwiYWdlbnRfbmFtZSI6ImNvZGVyIiwic2lnIjoiUGtCSW5scWhwbFRXMkZYT29SZU9BWHBNcDlaaWJzWXhCVWRCdlR6WHJvOCJ9
|
Addressed the migration-safety review finding in Changes made:
Verification:
|
PR Review — pr-reviewerVerdict: APPROVE Findings
SummaryThe migration 058 blocker is addressed: the non-transactional marker is narrowly applied by the migration runner, the SQLite rebuild now runs with Verification: |
Summary
Agents-Attributiontrailers from push commit messages as commit attribution artifacts/agents improvefeedback through the commented commit SHA before ancestry fallbacksVerification
go test ./internal/store ./internal/observe ./internal/webhook ./internal/workflowgo test ./...go test ./internal/store -run "TestRunAttributionArtifactUpsertAndLookups|TestSelfImprovementFeedbackUpsertAndList" -racego test ./internal/store ./internal/observe ./internal/webhook -racetimed out in existing store auth migration/bcrypt tests after observe and webhook passed under race; no race report was emitted.Closes #696