Skip to content

Review agent should check git history before recommending re-addition of deliberately removed content #690

Description

@fullsend-ai-retro

What happened

On PR #5888, which restructured tracing documentation, the review agent recommended adding an ADR 0050 link to docs/guides/infrastructure/distributed-tracing.md for "discoverability per issue #5659." However, commit f058f7dd had deliberately removed that same ADR link from the infrastructure doc as a policy decision about audience separation. The human reviewer (waynesun09) caught this as a HIGH-severity finding, noting it reversed a prior deliberate decision. The author acknowledged and fixed it.

This is worse than a missed finding — the review agent's recommendation would have actively created the policy violation. The agent optimized for local consistency (the dev guide links ADR 0050, so the infra guide should too) without awareness that a prior commit established a different pattern for this specific file.

The review agent (resolved from fullsend-ai/agents@747566d) ran via dispatch run 30895237350 and subsequent iterations.

What could go better

The review agent lacks repository history awareness. It evaluates the current diff for internal consistency but has no mechanism to detect that content was previously present in a file and deliberately removed. When the agent sees a cross-reference in file A but not in file B, it recommends adding it to file B — a reasonable consistency heuristic in most cases, but harmful when file B deliberately omits that reference per a prior decision.

I am confident this is a real gap: the agent literally recommended the exact change the human identified as a policy violation. The agent's docs-review skill (skills/docs-review/SKILL.md) does not include any instruction to consult git history before recommending content additions.

Uncertainty: Implementing a full git-history check for every recommendation could be expensive and may generate false positives (content removed for cleanup, not policy reasons). The signal-to-noise ratio of git log -S results would need tuning.

Proposed change

Add a git-history awareness step to the review agent's documentation review skill (skills/docs-review/SKILL.md in fullsend-ai/agents). When the agent considers recommending additions of cross-references, links, or section content to a modified file, it should first run git log --oneline -S '<content_snippet>' -- <file_path> to check whether that content was previously present and removed. If the history shows a prior deliberate removal (especially with a descriptive commit message), the agent should note the prior removal context in its review rather than recommending re-addition.

Alternatively, a lighter-weight approach: when reviewing documentation restructuring PRs (detected by large section deletions paired with new file additions), instruct the agent to run git diff HEAD~1 -- <file> and flag any recommendation that would re-add content visible in the removal side of that diff, with a note to verify whether the removal was intentional.

Validation criteria

On the next 5 documentation PRs that modify files with prior deliberate content removals in git history, the review agent should not recommend re-adding that content. Instead, it should note the prior removal and defer to the author's judgment. Monitor for false positives where the agent incorrectly suppresses a valid consistency recommendation due to an unrelated prior removal.


Generated by retro agent from fullsend-ai/fullsend#5888

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions