Commit 576fd4f
feat(trace): TraceReader API + ariaDiff in run_code
Move artifact-on-disk reading from mcp-server.js into a TraceReader class
in lib/utils/trace.js. Python-style indexing via first / last / nth, kept
generic across kinds (aria / html / screenshot / console / storage). Sort
by filename — aiTrace's zero-padded step prefix means a lexical sort is
chronological.
run_code uses it to diff ARIA between the last aiTrace capture and the
new one produced by the steps inside this call:
const reader = new TraceReader(currentAiTraceDir)
const before = reader.last('aria')
// run code, aiTrace captures per step
const after = reader.last('aria')
if (before !== after) result.ariaDiff = ariaDiff(before, after)
initCodecept now force-enables aiTrace whenever the MCP server initializes
the container — it's the canonical per-step capture, no point in MCP doing
its own grabAriaSnapshot.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 13650e1 commit 576fd4f
4 files changed
Lines changed: 550 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
430 | 440 | | |
431 | 441 | | |
432 | 442 | | |
433 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
434 | 447 | | |
435 | 448 | | |
436 | 449 | | |
| |||
691 | 704 | | |
692 | 705 | | |
693 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
694 | 712 | | |
695 | 713 | | |
696 | 714 | | |
| |||
753 | 771 | | |
754 | 772 | | |
755 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
756 | 782 | | |
757 | 783 | | |
758 | 784 | | |
| |||
0 commit comments