diff --git a/app/tool/runs_probe.mjs b/app/tool/runs_probe.mjs index 846cc110..4c2f5fcf 100644 --- a/app/tool/runs_probe.mjs +++ b/app/tool/runs_probe.mjs @@ -260,35 +260,57 @@ try { await assertBody('Original prompt'); await assertBody('Timeline'); await assertBody('build ยท visit 3'); - captures.push(await capture('i1-runs-phone-detail')); - await assertOcr(captures[5], 'fixture prompt with spaces'); + const detailCapture = await capture('i1-runs-phone-detail'); + captures.push(detailCapture); + await assertOcr(detailCapture, 'fixture prompt with spaces'); + + // The recorded Changes action opens the landed viewer for this run's steps: + // the recorded file, its rendered diff, and back to the same detail. + await clickText('Changes'); + await assertBody('1 file changed'); + await assertBody('lib/features/fixture.dart'); + captures.push(await capture('changes-phone-list')); + await clickText('lib/features/fixture.dart', { contains: true }); + await assertBody('Rendered'); + await assertBody('added fixture line'); + await assertBody('removed fixture line'); + captures.push(await capture('changes-phone-diff')); + await clickText('Close diff'); + await assertBody('lib/features/fixture.dart'); + await delay(600); + await clickText('Back', { contains: true }); + await assertBody('Original prompt'); await setSize(1280, 800); await assertBody('Original prompt'); - captures.push(await capture('i1-runs-desktop-detail')); - await assertOcr(captures[6], 'fixture prompt with spaces'); + const desktopDetail = await capture('i1-runs-desktop-detail'); + captures.push(desktopDetail); + await assertOcr(desktopDetail, 'fixture prompt with spaces'); await setSize(390, 844); await clickText('Input'); await wheel(250); await delay(300); - captures.push(await capture('i1-runs-phone-detail-input')); - await assertOcr(captures[7], 'input payload'); + const inputCapture = await capture('i1-runs-phone-detail-input'); + captures.push(inputCapture); + await assertOcr(inputCapture, 'input payload'); await scrollUntil('Output'); await clickText('Output'); await wheel(250); await delay(300); - captures.push(await capture('i1-runs-phone-detail-output')); - await assertOcr(captures[8], 'answer'); + const outputCapture = await capture('i1-runs-phone-detail-output'); + captures.push(outputCapture); + await assertOcr(outputCapture, 'answer'); await scrollUntil('Metrics'); await clickText('Metrics'); await wheel(300); await delay(300); - captures.push(await capture('i1-runs-phone-detail-metrics')); - await assertOcr(captures[9], 'Total tokens'); - await assertOcr(captures[9], 'Reported cost'); + const metricsCapture = await capture('i1-runs-phone-detail-metrics'); + captures.push(metricsCapture); + await assertOcr(metricsCapture, 'Total tokens'); + await assertOcr(metricsCapture, 'Reported cost'); // Browser Back/Forward move between the in-app routes, not out of the app. const path = () => evaluate('location.pathname'); @@ -305,8 +327,9 @@ try { async () => (await semanticText()).includes('Fixture live run'), 'browser Back to the runs list', ); - captures.push(await capture('i1-runs-phone-browser-back-list')); - await assertOcr(captures[10], 'Fixture live run'); + const backListCapture = await capture('i1-runs-phone-browser-back-list'); + captures.push(backListCapture); + await assertOcr(backListCapture, 'Fixture live run'); await evaluate('history.forward()'); await waitFor( @@ -333,8 +356,9 @@ try { if (duringDrop.includes(raw)) throw new Error(`Raw transport text shown: ${raw}`); } if ((await path()) !== '/runs/1') throw new Error(`Drop moved the URL to ${await path()}`); - captures.push(await capture('i1-reconnect-detail-retained-phone')); - await assertOcr(captures[13], 'Original prompt'); + const retainedCapture = await capture('i1-reconnect-detail-retained-phone'); + captures.push(retainedCapture); + await assertOcr(retainedCapture, 'Original prompt'); // Accepting again plus Retry restores the same detail without a remount. const accepted = await fetch(`${fixture.url}/fixture/accept`, { method: 'POST' }); @@ -359,12 +383,13 @@ try { for (const raw of ['WebSocketException', 'WebSocketChannelException', 'Failed to connect']) { if (gate.includes(raw)) throw new Error(`Gate printed raw transport text: ${raw}`); } - captures.push(await capture('i1-gate-unavailable-friendly-phone')); + const gateCapture = await capture('i1-gate-unavailable-friendly-phone'); + captures.push(gateCapture); await delay(1500); if (!(await semanticText()).includes('Pipelines server unavailable')) { throw new Error('Gate left the unavailable state while retrying'); } - await assertOcr(captures[15], 'Pipelines server unavailable'); + await assertOcr(gateCapture, 'Pipelines server unavailable'); await fetch(`${fixture.url}/fixture/accept`, { method: 'POST' }); await clickText('Retry'); diff --git a/app/tool/runs_probe_server.mjs b/app/tool/runs_probe_server.mjs index b9ece509..2ae957f1 100644 --- a/app/tool/runs_probe_server.mjs +++ b/app/tool/runs_probe_server.mjs @@ -110,6 +110,26 @@ function detail(id, live, canceled = false) { status: 'completed', outcome: 'success', target: '#success', + file_changes: { + status: 'complete', + scope: 'Git tracked and nonignored files in the run directory', + files: [ + { + path: 'lib/features/fixture.dart', + kind: 'modified', + patch: + '--- a/lib/features/fixture.dart\n' + + '+++ b/lib/features/fixture.dart\n' + + '@@ -1,2 +1,2 @@\n' + + ' context line\n' + + '-removed fixture line\n' + + '+added fixture line\n', + }, + ], + skipped: 0, + omitted: 0, + diagnostic: '', + }, }, { stage: 'test',