unbridled-41 commented on PR #4999:
URL:
https://github.com/apache/rocketmq-dashboard/pull/4999#issuecomment-5788076436
Verification pass (from a clean checkout of `72886dc9`, not restated from
the description):
**Citations re-verified against base `1ef5d860` and the branch with `grep
-n`/`sed -n`:**
- `AgentEventProjector.java:272` (base) is exactly `new
LiveEvent.RunFinished(runId, terminal.status(), null);` — the hard-coded null.
Branch `:287` now emits `replayedDurationMs`.
- `LiveEvent.java:49` (base) is the class-level
`@JsonInclude(JsonInclude.Include.NON_NULL)`.
- `aiEvents.contract.test.ts:139` (base) is `run_finished: { type: true,
runId: true, status: true, durationMs: true }`; the live absent-field matrix
expecting `['run_finished', []]` sits at `:424-433` (the `:432` entry), and the
same file's timeline matrix separately expects `run_status` to allow only
`reason`. The description has been updated to attribute `:432` to the live
matrix explicitly.
- `web/src/api/aiEvents.ts:169` (base) — `LiveRunFinishedEvent.durationMs:
number`, non-optional. The mirror itself would compile with the field missing
(JSON has no compile step), which is precisely the drift this contract test
exists to catch.
- `docs/api-spec.md:2424` (base) documents `run_finished` fields as `runId,
status, durationMs` — no `?` marker, unlike `tool_done`'s `durationMs?` on
`:2421`. So the documentation, the TS mirror, the contract test and the
projector's own replay-equivalence doc comment
(`AgentEventProjector.java:240-243`, base) all promise the field; only the wire
behaviour broke it.
- The synthetic-terminal call in `attach`'s `!live` branch is
`AiRunService.java:284` (base) and already passed `run.getDurationMs()` —
unchanged by this PR.
**Impact precision (body updated accordingly):** the current render layer
(`foldTimeline.ts:178`, `reduceLive.ts:48-50`) maps `run_finished` to a
terminal status and does not read `durationMs` yet — that is why the defect
never surfaced as a runtime crash. The damage is to the three-layer contract
(TS mirror, contract test, api-spec) and to any future reader, which the
`number` type promises. `web/src/pages/ai/render/equivalence.test.ts:112`
already builds its scenarios with `durationMs` set, so the equivalence property
the projector doc cites assumes the field is present.
**Commands re-executed from the clean worktree (`web/node_modules`
symlinked, empty `server/target`):**
- `mvn -o -Dtest=AiRunServiceTest test` → surefire XML: `tests="21"
errors="0" skipped="0" failures="0"`.
- `npx vitest run src/api/aiEvents.contract.test.ts` → 16/16 passed.
- `npx vitest run src/pages/ai/render/equivalence.test.ts
src/api/aiEvents.optionalFields.test.ts` → 51/51 passed.
No commit added; description-only correction plus this comment.
--
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]