Files
kami ff6a512630 Reconstruct repo from Claude Code + codex transcripts
Working tree (including .git) was lost to an rm. Rebuilt by replaying Write/Edit/
Read/attachment events from 25 Claude sessions and 22 successful codex apply_patch
blocks into one timestamp-ordered timeline.

Verified against ground truth recorded in the transcripts: wc -l on 10 files and
ls -l on 5 files at 2026-07-18T13:13:44Z both match exactly; 18 files are
byte-identical to their newest ~/.claude/file-history blob.

See HANDOFF.md for sources, gaps, and how to rebuild .venv.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 02:42:41 +04:00

45 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# start_workers.sh — dev launcher. session manager first, then the stateless workers,
# each a uvicorn process in its own tmux window. production uses the systemd units in systemd/.
set -euo pipefail
cd "$(dirname "$0")"
APP_DIR="$PWD"
VENV="$APP_DIR/.venv/bin/activate"
# MIOpen (ROCm): persist tuned kernels + FAST find so identity/tts don't re-auto-tune the GPU
# on every start (that thrashed the CPU and stuttered Hyprland). FIND_ENFORCE forces exhaustive
# search even when cached -> keep it unset.
mkdir -p "$HOME/.config/miopen"
MIOPEN_ENV="export MIOPEN_USER_DB_PATH=$HOME/.config/miopen MIOPEN_SYSTEM_DB_PATH=$HOME/.config/miopen MIOPEN_FIND_MODE=2 && unset MIOPEN_FIND_ENFORCE"
SESSION="manga-workers"
# name:module:port (session_manager guards the GPU; workers wait for it to bind)
WORKERS=(
"session:session_manager:8095"
"crop:worker_crop:8000"
"vision:worker_vision:8002"
"identity:worker_identity:8003"
"scene:worker_scene:8004"
"script:worker_script:8005"
"tts:worker_tts:8006"
"layers:worker_layers:8007"
"render:worker_render:8008"
)
tmux kill-session -t "$SESSION" 2>/dev/null || true
tmux new-session -d -s "$SESSION" -n placeholder
for spec in "${WORKERS[@]}"; do
name="${spec%%:*}"; rest="${spec#*:}"; mod="${rest%%:*}"; port="${rest##*:}"
tmux new-window -t "$SESSION" -n "$name"
tmux send-keys -t "$SESSION:$name" \
"$MIOPEN_ENV && source $VENV && python -m uvicorn ${mod}:app --app-dir $APP_DIR --host 0.0.0.0 --port ${port}" C-m
if [ "$name" = "session" ]; then
# workers assume the session manager is up; wait for :8095 before launching the rest
until curl -sf http://127.0.0.1:8095/session/active >/dev/null 2>&1; do sleep 0.3; done
fi
done
tmux kill-window -t "$SESSION:placeholder" 2>/dev/null || true
echo "started ${#WORKERS[@]} processes in tmux session '$SESSION' (attach: tmux attach -t $SESSION)"