unbridled-41 commented on PR #4948:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4948#issuecomment-5777448495

   Evidence-chain audit, re-executed from a clean worktree of this branch 
(`c6c84fb1`).
   
   **Citations re-read with `grep -n` against `1ef5d860` and against this 
branch**
   
   All twelve hold: `AiRunService.java:263-264` (the single read), `:275` 
(registration after the loop), `:288` (the log line), `:253-255` (the javadoc 
claim); `AiConversationService.java:105`; 
`MybatisPlusAiEventRepository.java:59-63`; 
`AgentStreamSession.java:98,152,208`; `AgentRunRegistry.java:121-134`; 
`useActiveRunAttach.ts:58`; `web/src/api/ai.ts:407`; 
`AgentEventProjector.java:110` (`COALESCE_MAX_CHARS = 2048`). One was 
tightened: the `AiEventSink` row builder spans `:391-395`, not `:392-395` 
(`setSeq` is at `:391`).
   
   **Two description defects found and fixed**
   
   1. The `mvn -Dtest=` command listed `AgentStreamSessionTest` and 
`AiEventSinkTest`. Neither class exists in this repository, so both were silent 
no-ops. Replaced with the fifteen classes that do exist in that package; that 
command now reports **519 tests, 0 failures**.
   2. The `AiEventSink` citation span above.
   
   **Test gap found and closed** (`test(ai)` commit `c6c84fb1`)
   
   The drain loops until a short page proves the backlog is empty, and neither 
property that keeps it a drain rather than a stall had a test: the exit on an 
*empty* page, and the cursor advancing to the next page's start. Added:
   
   * `attachAtTheHeadShouldReadOneEmptyPageAndThenCloseTest` — cursor already 
at the head: exactly one read (`verify(..., times(1))`), no replay, terminal 
frame still delivered.
   * an assertion on the existing backlog test that the second read is issued 
with seq `200`, i.e. after the last row of the first page rather than the same 
cursor again.
   
   Neither can fail on the old code — the old code never issued a second read 
and had no empty-page branch — so they are guards on the new loop, not pre-fix 
evidence. The pre-fix evidence is unchanged: the backlog test still fails first 
on `to contain: "the newest block"`, and the mid-replay test on `to contain: 
"published mid-replay"`, both reproduced in this worktree.
   
   **Coverage statement**
   
   Four tests, of which two fail on the old code (the backlog drain and the 
mid-replay frame) and two guard behaviour the fix introduces (the 
detach-on-throw path, and the drain's exit plus cursor advance). All four pass 
on the branch; `AiRunServiceTest` is 24/24 and the fifteen-class package 
command is 519/519.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to