Skip to repository content53 lines · 2.5 KB · text
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T00:31:21.789Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
omega-visual-proof
1#!/usr/bin/env bash
2#
3# Omega's rendered proof for the agent surfaces. omega#76, #77, #78.
4#
5# Draws the real widget tree through Metal in this process and writes each frame
6# to a PNG, then compares it against the committed baseline at the runner's
7# stated threshold (99% of pixels). Nothing here synthesizes a system keystroke,
8# so nothing here can type into another application's window by mistake.
9#
10# script/omega-visual-proof compare against the baselines
11# script/omega-visual-proof --update rewrite the baselines
12#
13# Two processes, not one. The first captures the front door, the typing path and
14# the executor line on three thread kinds, then leaves on disk what a relaunch
15# would find: the correlation journal in its production schema at its production
16# path, plus the thread ids and agent id that `ZED_STATELESS=1` deliberately
17# keeps out of a database. The second process is a genuinely cold one — empty
18# statics, no threads, no panel — and photographs the executor line it derives
19# for a `codex-acp`-class thread and an engine-lane thread from that disk state
20# alone. omega#77 asks for those two "after restart", and a second phase of the
21# same process could not answer it.
22#
23# Baselines live in crates/zed/test_fixtures/visual_tests/ and were generated on
24# Apple Silicon with the Metal renderer. A materially different GPU may need
25# --update and a human looking at the result before the new baselines are
26# trusted.
27set -euo pipefail
28
29if [[ "${1:-}" == "--update" ]]; then
30 export UPDATE_BASELINE=1
31fi
32
33export OMEGA_VISUAL_ONLY=1
34
35# One data directory, shared by both processes and by neither the developer's
36# Omega installation nor a previous run of this script. A stale directory would
37# let the restart phase read a handoff the recording phase did not write, which
38# is the one way this proof could pass without a restart having happened.
39OMEGA_VISUAL_DATA_DIR="$(mktemp -d "${TMPDIR:-/tmp}/omega-visual-proof.XXXXXX")"
40export OMEGA_VISUAL_DATA_DIR
41trap 'rm -rf "${OMEGA_VISUAL_DATA_DIR}"' EXIT
42
43cargo build --release -p zed --bin zed_visual_test_runner --features visual-tests
44runner="$(cargo metadata --format-version 1 --no-deps | \
45 python3 -c 'import json,sys; print(json.load(sys.stdin)["target_directory"])')/release/zed_visual_test_runner"
46
47echo "==> phase 1: the surfaces, and the disk state a relaunch would find"
48"${runner}"
49
50echo
51echo "==> phase 2: a cold process, disclosing from that disk state"
52OMEGA_VISUAL_PHASE=restart "${runner}"
53