Skip to content

Commit e4e8661

Browse files
fix(server): compose feedback for review, profile, and chat (#1519)
1 parent 04a42a3 commit e4e8661

37 files changed

Lines changed: 1113 additions & 1277 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hephaestus": patch
3+
---
4+
5+
A review comment now stays as it was written. Where a later look at the same change used to rewrite the original comment in place — and quietly demote anything already answered on the diff — it now leaves a new comment beside the old one, the way a person would. The comment also stops repeating the notes that sit on the diff: those live on the lines they are about, and anything that could not be placed on a line falls back into the comment rather than disappearing between the two.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hephaestus": patch
3+
---
4+
5+
Notes prepared for the mentor now say where a point has already been put to the developer and whether anything has moved without help, so a conversation does not repeat feedback they have already had twice. Notes written before this carry no such record, which reads as nothing having been said rather than as nothing to say.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hephaestus": patch
3+
---
4+
5+
Review comments no longer repeat their own issue count in the opening line, no longer run a strength and its next step together into one unpunctuated sentence, and no longer report how long the run took.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hephaestus": patch
3+
---
4+
5+
A problem the review found by opening a file now arrives as a comment on the changed line, rather than as a paragraph at the bottom of the merge request.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hephaestus": patch
3+
---
4+
5+
A review comment now leads with its most serious finding and the one edit that fixes it, instead of leading with whichever finding happened to have no line number attached. Each finding says what to do before it says why it matters, and the reasoning is one sentence rather than the same paragraph on every review that touches the practice.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hephaestus": patch
3+
---
4+
5+
A review comment now opens with a sentence written about your change, instead of one of a handful of fixed lines that read the same on every review — including on reviews that opened with praise ahead of a serious problem. When the review has nothing worth opening on, it opens on its first finding.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hephaestus": patch
3+
---
4+
5+
Review comments no longer append the workspace's own wording about a practice to each note. That paragraph was identical on every review that touched the practice, and it was about the practice rather than about the change in front of you. The practice still decides what gets raised; it just doesn't get quoted back.

server/src/main/java/de/tum/cit/aet/hephaestus/agent/context/providers/mentor/PreparedConversationFeedbackContentSource.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ private static void writeNotes(ObjectNode node, String body) {
146146
notes.put("capability", brief.capability());
147147
notes.put("evidenceSummary", brief.evidenceSummary());
148148
notes.put("inConversationSignal", brief.inConversationSignal());
149+
// Absent on a brief written before the field existed, and absent when nothing has been put to them
150+
// yet. Either way the mentor is told nothing rather than told there is nothing.
151+
if (brief.alreadySaid() != null) {
152+
notes.put("alreadySaid", brief.alreadySaid());
153+
}
149154
}
150155

151156
/**

server/src/main/java/de/tum/cit/aet/hephaestus/agent/handler/ApprovedFeedbackDeliveryListener.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ public void deliver(ApprovedFeedbackReadyEvent event) {
8989
}
9090
return;
9191
}
92+
String approvedBody = feedback.getBody();
93+
String safeBody = PullRequestCommentPoster.sanitize(approvedBody);
94+
if (safeBody.isBlank()) {
95+
feedbackRepository.markApprovedSuppressed(
96+
event.workspaceId(),
97+
feedback.getId(),
98+
FeedbackSuppressionReason.EMPTY_AFTER_SANITIZE.name()
99+
);
100+
return;
101+
}
102+
if (!safeBody.equals(approvedBody)) {
103+
feedbackRepository.markApprovedSuppressed(
104+
event.workspaceId(),
105+
feedback.getId(),
106+
FeedbackSuppressionReason.APPROVAL_STALE.name()
107+
);
108+
return;
109+
}
92110
ExistingDeliveryLookup existing = commentPoster.findApprovedProposal(job, feedback.getId());
93111
if (existing.kind() == ExistingDeliveryLookup.Kind.UNKNOWN) {
94112
log.warn("Approved proposal deferred after inconclusive provider lookup: feedbackId={}", feedback.getId());

server/src/main/java/de/tum/cit/aet/hephaestus/agent/handler/DeliveryComposer.java

Lines changed: 183 additions & 296 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)