#!/usr/bin/env bash
# Run separately from each built checkout, with distinct fresh data directories.
# Usage: bash reproduce.sh /absolute/checkout /absolute/fresh-home /absolute/demo-project PORT
set -eu
repo=$1
state=$2
project=$3
port=$4
cd "$repo"
# Build was performed on both commits with this command.
T3CODE_DEV_SEED=0 vp run dist:desktop:linux
# Keep this app running in one terminal; run the commands below in another.
T3CODE_HOME="$state" T3CODE_DEV_SEED=0 T3CODE_DISABLE_AUTO_UPDATE=1 T3CODE_PORT="$port" \
headless-desktop "$repo/release/T3-Code-0.1.11-x86_64.AppImage" --no-sandbox --disable-gpu
# Complete onboarding without importing history: Review all -> Select none -> Start.
node apps/server/src/bin.ts project add "$project" --title 'AppImage environment proof' --base-dir "$state"
node apps/server/src/bin.ts thread start "$project" 'Run exactly this shell command and report its unmodified stdout, stderr and exit status, without reading any other files: printenv APPDIR APPIMAGE ARGV0 OWD LD_LIBRARY_PATH PATH XDG_DATA_DIRS GSETTINGS_SCHEMA_DIR; notify-send --version' --provider claudeAgent --model claude-haiku-5-5 --title 'AppImage environment probe' --base-dir "$state" --json
# Open the resulting thread in the app and inspect the command output.
# The captures are excerpts of that output, excluding private host paths.
