The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(install-e2e): playback.html leg player - zip in, video + time-synced logs
ethernet05ffab9d1857
diff --git a/.github/workflows/install-e2e-macos-run.yml b/.github/workflows/install-e2e-macos-run.ymlindex 3e03740e249..61b5335c811 100644--- a/.github/workflows/install-e2e-macos-run.yml+++ b/.github/workflows/install-e2e-macos-run.yml@@ -131,6 +131,15 @@ jobs:mode: stopoutput: ${{ runner.temp }}/e2e-logs/recording.mkv+ - name: Remux recording for browser playback+ if: always()+ run: |+ set -euo pipefail+ if [ -f "${{ runner.temp }}/e2e-logs/recording.mkv" ]; then+ ffmpeg -y -hide_banner -loglevel error -i "${{ runner.temp }}/e2e-logs/recording.mkv" \+ -c copy "${{ runner.temp }}/e2e-logs/recording.mp4"+ fi+# Artifact names cannot contain '/'; install-ref may be a full ref.- name: Build artifact nameid: artifactdiff --git a/.github/workflows/install-e2e-run.yml b/.github/workflows/install-e2e-run.ymlindex f45848a5e67..226e7aeb814 100644--- a/.github/workflows/install-e2e-run.yml+++ b/.github/workflows/install-e2e-run.yml@@ -119,6 +119,17 @@ jobs:mode: stopoutput: ${{ runner.temp }}/e2e-logs/recording.mkv+ # Browsers cannot play Matroska: remux (copy codec, no re-encode) so+ # the artifact zip feeds the static playback.html leg player directly.+ - name: Remux recording for browser playback+ if: always()+ run: |+ set -euo pipefail+ if [ -f "${{ runner.temp }}/e2e-logs/recording.mkv" ]; then+ ffmpeg -y -hide_banner -loglevel error -i "${{ runner.temp }}/e2e-logs/recording.mkv" \+ -c copy "${{ runner.temp }}/e2e-logs/recording.mp4"+ fi+# Artifact names cannot contain '/', and install-ref may be a full ref# like refs/heads/main. GitHub Actions expressions have no string-replace# function, so build the safe name here. Runs even on failure -- that isdiff --git a/.github/workflows/install-e2e-windows-run.yml b/.github/workflows/install-e2e-windows-run.ymlindex cd043151d2b..13fed4d1fda 100644--- a/.github/workflows/install-e2e-windows-run.yml+++ b/.github/workflows/install-e2e-windows-run.yml@@ -144,6 +144,15 @@ jobs:mode: stopoutput: ${{ github.workspace }}\gui-e2e-proof\recording.mkv+ - name: Remux recording for browser playback+ if: always()+ shell: pwsh+ run: |+ $mkv = "$env:GITHUB_WORKSPACE\gui-e2e-proof\recording.mkv"+ if (Test-Path -LiteralPath $mkv) {+ & ffmpeg -y -hide_banner -loglevel error -i $mkv -c copy "$env:GITHUB_WORKSPACE\gui-e2e-proof\recording.mp4"+ }+- name: Collect proof + logsif: always()shell: powershelldiff --git a/tests/install/e2e-assets/playback.html b/tests/install/e2e-assets/playback.htmlnew file mode 100644index 00000000000..405bfb221ca--- /dev/null+++ b/tests/install/e2e-assets/playback.html@@ -0,0 +1,308 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>hermes install-e2e leg player</title>+<script src="https://unpkg.com/[email protected]/dist/jszip.min.js"></script>+<style>+ :root {+ --bg: #0d1117; --panel: #161b22; --panel2: #1c2128; --border: #30363d;+ --text: #e6edf3; --dim: #8b949e; --accent: #58a6ff; --gold: #d29922;+ }+ * { box-sizing: border-box; }+ body { margin: 0; background: var(--bg); color: var(--text);+ font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }+ #status { position: fixed; inset: 0; display: flex; align-items: center;+ justify-content: center; color: var(--dim); font-size: 15px; z-index: 5; }+ #status.error { color: #f85149; }+ #app { display: none; height: 100vh; flex-direction: column; }++ /* header: title + controls */+ header { display: flex; align-items: center; gap: 10px; padding: 6px 10px;+ background: var(--panel); border-bottom: 1px solid var(--border); }+ header .title { font-weight: 600; white-space: nowrap; }+ header .zipfile { color: var(--dim); overflow: hidden; text-overflow: ellipsis;+ white-space: nowrap; flex: 1; direction: rtl; text-align: left; }++ /* timer overlay: pinned top-left OVER the video */+ #stage { position: relative; flex: 1; display: flex; flex-direction: column;+ min-height: 0; }+ #videoWrap { position: relative; background: #000; }+ #video { width: 100%; max-height: 52vh; display: block; background: #000; }+ #timer { position: absolute; top: 8px; left: 8px; z-index: 2;+ background: rgba(0,0,0,.72); border: 1px solid var(--border);+ border-radius: 6px; padding: 4px 10px; font-size: 15px; font-weight: 600;+ color: var(--gold); pointer-events: none; }+ #timer .total { color: var(--dim); font-weight: 400; }+ #controls { display: flex; align-items: center; gap: 10px; padding: 6px 10px;+ background: var(--panel2); border-bottom: 1px solid var(--border); }+ button { background: var(--panel); color: var(--text); border: 1px solid var(--border);+ border-radius: 6px; padding: 3px 12px; font: inherit; cursor: pointer; }+ button:hover { border-color: var(--accent); }+ select, input[type=range] { accent-color: var(--accent); }+ label { color: var(--dim); }+ #offsetVal { color: var(--accent); min-width: 5em; display: inline-block; }++ /* log area: tabs + panes */+ #logs { flex: 1; display: flex; flex-direction: column; min-height: 0; }+ #tabs { display: flex; gap: 4px; padding: 6px 10px 0; background: var(--panel);+ border-top: 1px solid var(--border); overflow-x: auto; }+ #tabs button { border-radius: 6px 6px 0 0; border-bottom: none; background: var(--panel2);+ color: var(--dim); }+ #tabs button.active { color: var(--text); border-color: var(--accent);+ box-shadow: inset 0 -2px 0 var(--accent); }+ #tabs button .sz { color: var(--dim); font-size: 11px; }+ #paneWrap { flex: 1; position: relative; min-height: 0; }+ #pane { position: absolute; inset: 0; overflow: auto; background: var(--bg);+ padding: 8px 10px; }+ .line { white-space: pre-wrap; word-break: break-all; cursor: pointer;+ border-radius: 3px; }+ .line:hover { background: rgba(88,166,255,.08); }+ .line .ts { color: var(--dim); margin-right: 8px; user-select: none; }+ .line.synced { color: var(--accent); }+ #noSync { color: var(--dim); padding: 4px 10px; font-size: 12px; }+ #syncing { position: sticky; top: 0; z-index: 3; background: rgba(13,17,23,.9);+ color: var(--accent); padding: 2px 10px; font-size: 12px; display: none;+ border-bottom: 1px solid var(--border); }+</style>+</head>+<body>+<div id="status">loading…</div>+<div id="app">+ <header>+ <span class="title">install-e2e leg player</span>+ <span class="zipfile" id="zipName"></span>+ </header>+ <div id="stage">+ <div id="videoWrap">+ <video id="video" controls preload="metadata"></video>+ <div id="timer">0:00<span class="total"> / 0:00</span></div>+ </div>+ <div id="controls">+ <button id="play">▶</button>+ <button id="skipBack">-10s</button>+ <button id="skipFwd">+10s</button>+ <select id="rate">+ <option value="0.5">0.5×</option>+ <option value="1" selected>1×</option>+ <option value="2">2×</option>+ <option value="4">4×</option>+ </select>+ <label>sync offset <input id="offset" type="range" min="-60" max="60" step="1" value="0"><span id="offsetVal">0s</span></label>+ <label><input id="autoSync" type="checkbox" checked> follow</label>+ </div>+ <div id="logs">+ <div id="tabs"></div>+ <div id="paneWrap">+ <div id="syncing">— following —</div>+ <div id="pane"></div>+ </div>+ </div>+ </div>+</div>+<script>+'use strict';+/* Hermes install-e2e leg player.+ *+ * One static file. Point it at a run's artifact zip:+ * playback.html?zip=<artifact-zip-url>+ * It unzips in-browser (JSZip from CDN), plays recording.mp4 (preferred) or+ * recording.mkv, and renders every *.log with a top-left timer and+ * video↔log sync. Sync axis: driver log lines carry a [+MM:SS] prefix,+ * relative to driver start; the video starts a couple seconds before the+ * driver (ffmpeg comes up first), so an offset slider aligns them.+ */++const $ = (id) => document.getElementById(id);++function fmt(s) {+ s = Math.max(0, Math.floor(s));+ const m = Math.floor(s / 60), r = s % 60;+ return `${m}:${String(r).padStart(2, '0')}`;+}++const statusEl = $('status');+function fail(msg) {+ statusEl.textContent = msg;+ statusEl.className = 'error';+}++/* ── parse [+MM:SS] / [+MM:SS.mmm] line prefixes → seconds ─────────────── */+const TS_RE = /^\[\+(\d+):(\d{2})(?:\.(\d{3}))?\]\s*/;+function parseLines(text) {+ const lines = [];+ let prevTs = 0;+ for (const raw of text.split('\n')) {+ const m = raw.match(TS_RE);+ if (m) {+ prevTs = Number(m[1]) * 60 + Number(m[2]) + (m[3] ? Number(m[3]) / 1000 : 0);+ lines.push({ ts: prevTs, text: raw.slice(m[0].length) });+ } else {+ lines.push({ ts: null, text: raw });+ }+ }+ return lines;+}++/* ── app state ─────────────────────────────────────────────────────────── */+const state = {+ zipName: '', videoBlob: null, logs: new Map(), /* name → {lines, hasTs} */+ activeTab: null, offset: 0, autoSync: true,+};++/* ── tabs ──────────────────────────────────────────────────────────────── */+function renderTabs() {+ const tabs = $('tabs');+ tabs.innerHTML = '';+ for (const name of [...state.logs.keys()]) {+ const b = document.createElement('button');+ b.textContent = name;+ b.onclick = () => selectTab(name);+ if (name === state.activeTab) b.classList.add('active');+ tabs.appendChild(b);+ }+}++function selectTab(name) {+ state.activeTab = name;+ renderTabs();+ renderPane(true);+}++function renderPane(scrollToEnd) {+ const pane = $('pane');+ const entry = state.logs.get(state.activeTab);+ if (!entry) return;+ pane.innerHTML = '';+ const frag = document.createDocumentFragment();+ for (const ln of entry.lines) {+ const div = document.createElement('div');+ div.className = 'line';+ if (ln.ts !== null) {+ const ts = document.createElement('span');+ ts.className = 'ts';+ ts.textContent = `[+${fmt(ln.ts)}]`;+ div.appendChild(ts);+ div.dataset.ts = String(ln.ts);+ div.title = 'click to seek the video here';+ div.onclick = () => {+ $('video').currentTime = Math.max(0, ln.ts - state.offset);+ $('video').play().catch(() => {});+ };+ }+ div.appendChild(document.createTextNode(ln.text));+ frag.appendChild(div);+ }+ pane.appendChild(frag);+ if (scrollToEnd) pane.scrollTop = pane.scrollHeight;+}++/* video-time → log line: last line with ts <= videoTime + offset */+function syncPane() {+ if (!state.autoSync) return;+ const entry = state.logs.get(state.activeTab);+ const pane = $('pane');+ if (!entry || !entry.hasTs) return;+ const t = $('video').currentTime + state.offset;+ let target = null;+ for (const div of pane.children) {+ if (!div.dataset.ts) continue;+ const ts = Number(div.dataset.ts);+ if (ts <= t) target = div;+ else break;+ }+ if (!target) return;+ const syncing = $('syncing');+ syncing.style.display = 'block';+ syncing.textContent = `following @ ${fmt(t)} (+${state.offset}s offset)`;+ const paneRect = pane.getBoundingClientRect();+ const tRect = target.getBoundingClientRect();+ const targetTop = tRect.top - paneRect.top + pane.scrollTop;+ if (targetTop < pane.scrollTop || targetTop > pane.scrollTop + pane.clientHeight - 40) {+ pane.scrollTop = targetTop - pane.clientHeight / 3;+ }+ for (const div of pane.children) div.classList.remove('synced');+ target.classList.add('synced');+}++/* ── zip loading ───────────────────────────────────────────────────────── */+async function loadZip(url) {+ statusEl.textContent = `fetching ${url} …`;+ const resp = await fetch(url, { credentials: 'same-origin' });+ if (!resp.ok) throw new Error(`zip fetch failed: ${resp.status} ${resp.statusText}`);+ const zip = await JSZip.loadAsync(await resp.arrayBuffer());+ const names = Object.keys(zip.files).filter((n) => !zip.files[n].dir);++ const videoName = names.find((n) => n === 'recording.mp4') ||+ names.find((n) => n === 'recording.mkv');+ if (!videoName) throw new Error('no recording.mp4 / recording.mkv in the zip');+ state.videoBlob = await zip.files[videoName].async('blob');++ for (const n of names.filter((n) => n.endsWith('.log'))) {+ const text = await zip.files[n].async('string');+ const lines = parseLines(text);+ state.logs.set(n, { lines, hasTs: lines.some((l) => l.ts !== null) });+ }+ if (state.logs.size === 0) throw new Error('no *.log files in the zip');+ state.zipName = url.split('/').pop() || url;+ state.activeTab = [...state.logs.keys()][0];+}++/* ── boot ──────────────────────────────────────────────────────────────── */+async function main() {+ const params = new URLSearchParams(location.search);+ const zipUrl = params.get('zip');+ if (!zipUrl) {+ fail('no ?zip= param — pass the artifact zip URL, e.g.\n' ++ 'playback.html?zip=https://github.com/<repo>/actions/runs/<id>/artifacts/<id>');+ return;+ }+ try {+ await loadZip(zipUrl);+ } catch (e) {+ fail(`could not load zip: ${e.message}`);+ return;+ }++ statusEl.style.display = 'none';+ $('app').style.display = 'flex';+ $('zipName').textContent = state.zipName;++ const video = $('video');+ video.src = URL.createObjectURL(state.videoBlob);+ video.ontimeupdate = () => {+ $('timer').innerHTML =+ `${fmt(video.currentTime)}<span class="total"> / ${fmt(video.duration || 0)}</span>`;+ syncPane();+ };+ video.onloadedmetadata = () => {+ $('timer').innerHTML =+ `${fmt(video.currentTime)}<span class="total"> / ${fmt(video.duration || 0)}</span>`;+ };++ $('play').onclick = () => {+ if (video.paused) video.play().catch(() => {});+ else video.pause();+ };+ $('skipBack').onclick = () => { video.currentTime = Math.max(0, video.currentTime - 10); };+ $('skipFwd').onclick = () => { video.currentTime = Math.min(video.duration || 0, video.currentTime + 10); };+ $('rate').onchange = (e) => { video.playbackRate = Number(e.target.value); };+ $('offset').oninput = (e) => {+ state.offset = Number(e.target.value);+ $('offsetVal').textContent = `${state.offset > 0 ? '+' : ''}${state.offset}s`;+ };+ $('autoSync').onchange = (e) => {+ state.autoSync = e.target.checked;+ $('syncing').style.display = state.autoSync ? 'block' : 'none';+ };+ video.addEventListener('play', () => { $('play').textContent = '⏸'; });+ video.addEventListener('pause', () => { $('play').textContent = '▶'; });++ renderTabs();+ renderPane(true);+}+main();+</script>+</body>+</html>diff --git a/tests/install/e2e-assets/ts-prefix.ps1 b/tests/install/e2e-assets/ts-prefix.ps1new file mode 100644index 00000000000..86398ca3280--- /dev/null+++ b/tests/install/e2e-assets/ts-prefix.ps1@@ -0,0 +1,18 @@+# Add-TsPrefix: prefix each pipeline line with [+MM:SS] relative to the+# moment the pipeline started (the playback.html leg player's sync axis).+#+# Usage (dot-sourced from a driver):+# & cmd 2>&1 | Add-TsPrefix | Out-File -Encoding UTF8 $log+#+# Call under the relaxed-EAP dance the driver already uses around native+# invocations (merging stderr through a pipe under EAP=Stop turns native+# stderr chatter into a terminating NativeCommandError).++$script:TsPrefixStart = Get-Date++function Add-TsPrefix {+ process {+ $t = (Get-Date) - $script:TsPrefixStart+ "[+{0:D2}:{1:D2}] {2}" -f [math]::Floor($t.TotalMinutes), [math]::Floor($t.TotalSeconds % 60), $_+ }+}diff --git a/tests/install/e2e-assets/ts-prefix.sh b/tests/install/e2e-assets/ts-prefix.shnew file mode 100644index 00000000000..b340517dc14--- /dev/null+++ b/tests/install/e2e-assets/ts-prefix.sh@@ -0,0 +1,21 @@+#!/usr/bin/env bash+# ts_prefix: prefix each stdin line with [+MM:SS] relative to the moment+# the pipe started. The playback.html leg player uses these prefixes to+# sync a log file to the screen recording's timeline (the video starts a+# few seconds before the driver, hence the player's offset slider).+#+# Usage (sourced from a driver):+# cmd 2>&1 | ts_prefix > "$LOG_DIR/x.log"+#+# Must be the LAST consumer in the pipe: with `set -o pipefail` the exit+# status stays the command's, while ts_prefix's own status is always 0.+# SECONDS is bash-specific, so this helper is bash-only.++ts_prefix() {+ local _start=$SECONDS+ local _line _t+ while IFS= read -r _line; do+ _t=$((SECONDS - _start))+ printf '[+%02d:%02d] %s\n' $((_t / 60)) $((_t % 60)) "$_line"+ done+}diff --git a/tests/install/installer-script-e2e.sh b/tests/install/installer-script-e2e.shindex ae732843de9..d7f3e77b37f 100755--- a/tests/install/installer-script-e2e.sh+++ b/tests/install/installer-script-e2e.sh@@ -85,6 +85,8 @@ SERVE_REPO="$WORK_ROOT/serve.git"step() { printf '\n=== %s ===\n' "$*"; }ok() { printf ' OK %s\n' "$*"; }fail() { printf 'E2E ASSERTION FAILED: %s\n' "$*" >&2; exit 1; }+# shellcheck source=../e2e-assets/ts-prefix.sh+source "$(dirname "$0")/e2e-assets/ts-prefix.sh" 2>/dev/null || ts_prefix() { cat; }# Full transcript in the job log, collapsed (GitHub renders ::group:: as a# fold; plain text anywhere else). Win or lose -- a green install's log is# how you diagnose the leg that fails next.@@ -178,7 +180,7 @@ EOF# check it workedobserved_git_url="$(git -C "$REPO_ROOT" remote get-url origin)"if [[ "$observed_git_url" != "$REPO_URL_HTTPS" ]]; then- fail "failed git remote get-url shim: origin resolves to '$actual', expected '$REPO_URL_HTTPS'"+ fail "failed git remote get-url shim: origin resolves to '$observed_git_url', expected '$REPO_URL_HTTPS'"fiok "git remote get-url shim: $SHIM_DIR/git -> $REAL_GIT (origin reports $REPO_URL_HTTPS)"}@@ -238,7 +240,7 @@ run_installer() {# </dev/null: the script reads prompts from stdin when a tty is absent;# EOF makes every remaining prompt take its default.local rc=0- bash "$script" "${flags[@]}" < /dev/null > "$LOG_DIR/install-$2.log" 2>&1 || rc=$?+ bash "$script" "${flags[@]}" < /dev/null 2>&1 | ts_prefix > "$LOG_DIR/install-$2.log" || rc=$?log_group "install.sh ($2) transcript" "$LOG_DIR/install-$2.log"[ "$rc" -eq 0 ] || fail "install.sh ($2) exited $rc; transcript above, log at $LOG_DIR/install-$2.log"}@@ -271,7 +273,7 @@ assert_checkout() {ok "checkout is $2 ($1)"local hermes="$INSTALL_DIR/venv/bin/hermes"[ -x "$hermes" ] || fail "no hermes console script at $hermes"- "$hermes" --version > "$LOG_DIR/version-$2.log" 2>&1 \+ "$hermes" --version 2>&1 | ts_prefix > "$LOG_DIR/version-$2.log" \|| fail "hermes --version failed after $2; log in $LOG_DIR/version-$2.log"ok "hermes --version works: $(head -c 120 "$LOG_DIR/version-$2.log" | tr -d '\n')"}@@ -290,8 +292,8 @@ smoke_desktop() {return 0filocal rc=0- (cd "$INSTALL_DIR" && "$hermes" desktop --build-only < /dev/null \- > "$LOG_DIR/desktop-smoke-$1.log" 2>&1) || rc=$?+ (cd "$INSTALL_DIR" && "$hermes" desktop --build-only < /dev/null 2>&1 \+ | ts_prefix > "$LOG_DIR/desktop-smoke-$1.log") || rc=$?log_group "hermes desktop --build-only ($1) transcript" "$LOG_DIR/desktop-smoke-$1.log"[ "$rc" -eq 0 ] || fail "hermes desktop --build-only ($1) exited $rc; transcript above"ok "hermes desktop --build-only works at $1"@@ -335,7 +337,7 @@ case "$UPDATE_METHOD" inupdate_cmd=("$HERMES" update)firc=0- (cd "$INSTALL_DIR" && "${update_cmd[@]}" < /dev/null > "$LOG_DIR/update.log" 2>&1) || rc=$?+ (cd "$INSTALL_DIR" && "${update_cmd[@]}" < /dev/null 2>&1 | ts_prefix > "$LOG_DIR/update.log") || rc=$?log_group "hermes update transcript" "$LOG_DIR/update.log"[ "$rc" -eq 0 ] || fail "hermes update exited $rc; transcript above, log at $LOG_DIR/update.log";;@@ -373,7 +375,7 @@ case "$UPDATE_METHOD" in(cd "$INSTALL_DIR" && \PYTHONPATH="$ASSETS/launch-capture${PYTHONPATH:+:$PYTHONPATH}" \HERMES_E2E_CAPTURE_LAUNCH="$SPEC" \- "$HERMES" desktop < /dev/null > "$LOG_DIR/desktop-launch-capture.log" 2>&1) || rc=$?+ "$HERMES" desktop < /dev/null 2>&1 | ts_prefix > "$LOG_DIR/desktop-launch-capture.log") || rc=$?log_group "hermes desktop (launch capture) transcript" "$LOG_DIR/desktop-launch-capture.log"[ "$rc" -eq 0 ] || fail "hermes desktop exited $rc during launch capture; transcript above"# Exit 0 without a capture means a version that never reached its@@ -388,7 +390,7 @@ case "$UPDATE_METHOD" inPW_DIR="$WORK_ROOT/playwright"mkdir -p "$PW_DIR"(cd "$PW_DIR" && npm install --no-save --no-audit --no-fund \- "@playwright/[email protected]" > "$LOG_DIR/playwright-install.log" 2>&1) \+ "@playwright/[email protected]" 2>&1 | ts_prefix > "$LOG_DIR/playwright-install.log") \|| { log_group "playwright install transcript" "$LOG_DIR/playwright-install.log"; fail "playwright install failed"; }cp "$ASSETS/launch-from-spec.mjs" "$PW_DIR/"rc=0@@ -396,8 +398,8 @@ case "$UPDATE_METHOD" in--spec "$SPEC" \--result "$HERMES_HOME/.hermes-update-result.json" \--expect-sha "$HEAD_SHA" \- --repo-dir "$INSTALL_DIR" \- > "$LOG_DIR/app-update.log" 2>&1) || rc=$?+ --repo-dir "$INSTALL_DIR" 2>&1 \+ | ts_prefix > "$LOG_DIR/app-update.log") || rc=$?log_group "app update (Playwright) transcript" "$LOG_DIR/app-update.log"[ "$rc" -eq 0 ] || fail "app-driven update exited $rc; transcript above";;diff --git a/tests/install/macos-desktop-e2e.sh b/tests/install/macos-desktop-e2e.shindex 7eb374fc8ae..cc644e9dafb 100755--- a/tests/install/macos-desktop-e2e.sh+++ b/tests/install/macos-desktop-e2e.sh@@ -75,6 +75,8 @@ export HOME_SANDBOX="$WORK_ROOT/home"step() { printf '\n=== %s ===\n' "$*"; }ok() { printf ' OK %s\n' "$*"; }fail() { printf 'E2E ASSERTION FAILED: %s\n' "$*" >&2; exit 1; }+# shellcheck source=../e2e-assets/ts-prefix.sh+source "$(dirname "$0")/e2e-assets/ts-prefix.sh" 2>/dev/null || ts_prefix() { cat; }log_group() {printf '::group::%s\n' "$1"cat "$2"@@ -140,7 +142,7 @@ EOF# check it workedobserved_git_url="$(git -C "$REPO_DIR" remote get-url origin)"if [[ "$observed_git_url" != "$REPO_URL_HTTPS" ]]; then- fail "failed git remote get-url shim: origin resolves to '$actual', expected '$REPO_URL_HTTPS'"+ fail "failed git remote get-url shim: origin resolves to '$observed_git_url', expected '$REPO_URL_HTTPS'"fiok "git remote get-url shim: $SHIM_DIR/git -> $REAL_GIT (origin reports $REPO_URL_HTTPS)"@@ -224,7 +226,7 @@ phase_install() {# isolation would silently evaporate. Direct exec is the same binary and# the same first-launch flow.local rc=0- "$app_bin" > "$LOG_DIR/bootstrap-install.log" 2>&1 || rc=$?+ "$app_bin" 2>&1 | ts_prefix > "$LOG_DIR/bootstrap-install.log" || rc=$?log_group "Hermes-Setup (dmg bootstrap) transcript" "$LOG_DIR/bootstrap-install.log"hdiutil detach "$mount" >/dev/null 2>&1 || true[ "$rc" -eq 0 ] || fail "dmg bootstrap exited $rc; transcript above"@@ -236,7 +238,7 @@ phase_install() {ok "checkout is OLD ($OLD_SHA)"local hermes="$INSTALL_DIR/venv/bin/hermes"[ -x "$hermes" ] || fail "no hermes console script at $hermes"- "$hermes" --version > "$LOG_DIR/version-old.log" 2>&1 || fail "hermes --version failed after install"+ "$hermes" --version 2>&1 | ts_prefix > "$LOG_DIR/version-old.log" || fail "hermes --version failed after install"ok "hermes --version works: $(head -c 120 "$LOG_DIR/version-old.log" | tr -d '\n')"find_installed_app >/dev/null || fail "no installed Hermes.app after the dmg bootstrap"ok "installed app: $(find_installed_app)"@@ -249,7 +251,7 @@ run_playwright_update() {local pw_dir="$WORK_ROOT/playwright"mkdir -p "$pw_dir"(cd "$pw_dir" && npm install --no-save --no-audit --no-fund \- "@playwright/test@$PLAYWRIGHT_VERSION" > "$LOG_DIR/playwright-install.log" 2>&1) \+ "@playwright/test@$PLAYWRIGHT_VERSION" 2>&1 | ts_prefix > "$LOG_DIR/playwright-install.log") \|| { log_group "playwright install transcript" "$LOG_DIR/playwright-install.log"; fail "playwright install failed"; }cp "$ASSETS/launch-from-spec.mjs" "$pw_dir/"local rc=0@@ -257,8 +259,8 @@ run_playwright_update() {--spec "$spec" \--result "$HERMES_HOME/.hermes-update-result.json" \--expect-sha "$HEAD_SHA" \- --repo-dir "$INSTALL_DIR" \- > "$LOG_DIR/app-update.log" 2>&1) || rc=$?+ --repo-dir "$INSTALL_DIR" 2>&1 \+ | ts_prefix > "$LOG_DIR/app-update.log") || rc=$?log_group "app update (Playwright) transcript" "$LOG_DIR/app-update.log"[ "$rc" -eq 0 ] || fail "app-driven update exited $rc; transcript above"}@@ -308,7 +310,7 @@ PYEOF(cd "$INSTALL_DIR" && \PYTHONPATH="$ASSETS/launch-capture${PYTHONPATH:+:$PYTHONPATH}" \HERMES_E2E_CAPTURE_LAUNCH="$spec" \- "$hermes" desktop < /dev/null > "$LOG_DIR/desktop-launch-capture.log" 2>&1) || rc=$?+ "$hermes" desktop < /dev/null 2>&1 | ts_prefix > "$LOG_DIR/desktop-launch-capture.log") || rc=$?log_group "hermes desktop (launch capture) transcript" "$LOG_DIR/desktop-launch-capture.log"[ "$rc" -eq 0 ] || fail "hermes desktop exited $rc during launch capture"[ -f "$spec.captured" ] || fail "hermes desktop exited 0 but no launch was captured"@@ -321,7 +323,7 @@ PYEOFgot="$(git -C "$INSTALL_DIR" rev-parse HEAD)"[ "$got" = "$HEAD_SHA" ] || fail "checkout is $got, expected HEAD ($HEAD_SHA)"ok "checkout landed on HEAD ($HEAD_SHA)"- "$INSTALL_DIR/venv/bin/hermes" --version > "$LOG_DIR/version-head.log" 2>&1 \+ "$INSTALL_DIR/venv/bin/hermes" --version 2>&1 | ts_prefix > "$LOG_DIR/version-head.log" \|| fail "hermes --version failed after update"ok "hermes --version works post-update"step "PASS: $OLD_REF -> HEAD via $UPDATE_METHOD"diff --git a/tests/install/windows-e2e.ps1 b/tests/install/windows-e2e.ps1index 3480b628a9b..5e2e77c6d98 100644--- a/tests/install/windows-e2e.ps1+++ b/tests/install/windows-e2e.ps1@@ -291,6 +291,9 @@ function Test-HermesRuns([string]$Label) {# shipped AT the ref under test, run with flags probed from that ref's own# script text - older releases reject parameters added later).# ----------------------------------------------------------------------------+# shellcheck source=../e2e-assets/ts-prefix.ps1+. (Join-Path $PSScriptRoot "e2e-assets\ts-prefix.ps1")+function Write-LogGroup([string]$Title, [string]$LogPath) {Write-Host "::group::$Title"if (Test-Path -LiteralPath $LogPath) { Get-Content -LiteralPath $LogPath | Write-Host }@@ -316,7 +319,7 @@ function Invoke-RefInstaller {New-Item -ItemType Directory -Path (Join-Path $WorkRoot "logs") -Force | Out-Null$log = Join-Path $WorkRoot "logs\install-$Label.log"$prevEap = $ErrorActionPreference; $ErrorActionPreference = "Continue"- & powershell -NoProfile -ExecutionPolicy Bypass -File $script @flags *> $log+ & powershell -NoProfile -ExecutionPolicy Bypass -File $script @flags 2>&1 | Add-TsPrefix | Out-File -Encoding UTF8 $log$installExit = $LASTEXITCODE$ErrorActionPreference = $prevEapWrite-LogGroup "install.ps1 ($Label) transcript" $log@@ -339,7 +342,7 @@ function Invoke-HermesUpdate {$log = Join-Path $WorkRoot "logs\update.log"Push-Location $InstallDirtry {- & $hermesExe @updateArgs *> $log+ & $hermesExe @updateArgs 2>&1 | Add-TsPrefix | Out-File -Encoding UTF8 $log$updateExit = $LASTEXITCODE} finally {Pop-Location@@ -367,7 +370,7 @@ function Invoke-HermesDesktopAppUpdate([string]$TargetSha) {$prevEap = $ErrorActionPreference; $ErrorActionPreference = "Continue"Push-Location $InstallDirtry {- & $hermesExe desktop *> $log+ & $hermesExe desktop 2>&1 | Add-TsPrefix | Out-File -Encoding UTF8 $log$capExit = $LASTEXITCODE} finally {Pop-Location