Commit 4459cb7
fix(server): let the review write its own opening, and read as one message
A review comment opened with one of a small set of server-authored lines —
"Nice work …" for a clean change, "Worth keeping: …" for a strength beside a
problem — chosen from a curated slug-to-phrase map. The same sentence opened
every review that fell in the same bucket, and a change with a critical finding
could still open on praise.
The opening now comes from the review itself. A report_summary tool carries one
or two sentences out in the feedback envelope as `lead`, and the note opens on
them. Nothing stands in for a missing one: with no lead the note opens on its
first finding.
The note also stops working against itself. It no longer states its issue count
twice, a strength and its next step no longer run together unpunctuated, the
footer no longer carries the run's duration, and a defect found by opening a
file is quoted from the diff so the note lands beside the code.
The opening is model prose in the position a reader trusts most, so it is held
to a narrower contract than a finding body. The runner sends an over-long lead
back to be rewritten rather than cutting it mid-word; the parser takes it only
when it is a string; the composer scrubs it, clamps it at a sentence boundary,
and drops it whole if it reaches for markup that could restructure the comment
around it, for a link, or for a verdict on merging — which the composer is never
told and so could only invent. That last one was previously guaranteed by the
fixed phrasing rather than checked, and a two-sentence orientation has no
legitimate use for any of them.
Exactly one comment may open on the lead. The auto-posted note is composed
first and takes it; an approved proposal takes it only when there is no such
note, which is the all-approval workspace where the proposal is the only
comment the developer sees.
Code fences are now balanced at egress rather than in the composer, because the
length cut that runs there can reopen a block that was balanced upstream, and
everything below an open fence renders as code — including the AI-generated
disclosure the comment carries. Counting fences was not enough either: a block
ends only on a fence of the same character and at least the opening length
carrying no info string, so a quoted block inside a quote left the count even
and the document broken. Quoted evidence is now wrapped in a fence that outruns
any run of backticks inside it.
Two holes in that egress sanitizer went with it: an unterminated comment opener
matched nothing and reached the provider intact, and mentions were escaped only
after bracket-like characters, so `cc,@name` shipped live.
Approved proposals now go through that sanitizer, which they were bypassing
entirely, and are suppressed rather than posted when they sanitize to nothing —
the provider rejects an empty comment, and that exception would escape the
listener and strand the approval with nothing to retry it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LK2yxSEfNL5Q5xwbAqAMWr1 parent efbd269 commit 4459cb7
20 files changed
Lines changed: 669 additions & 446 deletions
File tree
- .changeset
- server/src
- main
- java/de/tum/cit/aet/hephaestus/agent/handler
- composition
- resources/agent
- test/java/de/tum/cit/aet/hephaestus/agent/handler
- composition
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
server/src/main/java/de/tum/cit/aet/hephaestus/agent/handler/ApprovedFeedbackDeliveryListener.java
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
98 | 109 | | |
99 | | - | |
| 110 | + | |
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
| |||
Lines changed: 80 additions & 174 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | | - | |
| 270 | + | |
266 | 271 | | |
267 | 272 | | |
268 | | - | |
| 273 | + | |
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
| |||
server/src/main/java/de/tum/cit/aet/hephaestus/agent/handler/PracticeFeedbackCommentFormatter.java
Lines changed: 1 addition & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 58 | + | |
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
| |||
72 | 66 | | |
73 | 67 | | |
74 | 68 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 69 | | |
Lines changed: 50 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
409 | 411 | | |
410 | 412 | | |
411 | 413 | | |
| |||
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | | - | |
442 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
443 | 452 | | |
444 | 453 | | |
445 | 454 | | |
446 | 455 | | |
447 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
448 | 495 | | |
449 | 496 | | |
450 | 497 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
339 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
340 | 345 | | |
341 | 346 | | |
342 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
343 | 355 | | |
344 | 356 | | |
345 | | - | |
346 | 357 | | |
347 | | - | |
| 358 | + | |
348 | 359 | | |
349 | 360 | | |
350 | 361 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
273 | 282 | | |
274 | 283 | | |
275 | 284 | | |
| |||
0 commit comments