diff --git a/.agents/shared/test-loop.md b/.agents/shared/test-loop.md index 6fd6483307..ebdc3821b6 100644 --- a/.agents/shared/test-loop.md +++ b/.agents/shared/test-loop.md @@ -438,12 +438,14 @@ implementation or overlay verdict: - the same signature occurs on two launches. Before early escalation, preserve the current overlay and account, stop only the exact-path app, -run one full Xcode Debug clean followed by `BUILD` (the configured-tree clean is normally -`cmake --build out --config Debug --target clean`), and rerun the same scenario once. Record the -preceding runs as `TEST_FLAW` caused by stale generated-language objects; do not spend an -implementation attempt or re-author the overlay. If the identical signature remains after the -single clean rebuild, resume normal crash classification and early escalation. Never loop clean -rebuilds. +follow the portable-folder safety-copy procedure in `AGENTS.md`, then run one full Xcode Debug +clean followed by `BUILD` (the configured-tree clean is normally +`cmake --build out --config Debug --target clean`). Restore only portable folders missing after +the clean, never overwrite survivors, and retain the external backup through one successful +post-build launch. Rerun the same scenario once. Record the preceding runs as `TEST_FLAW` caused +by stale generated-language objects; do not spend an implementation attempt or re-author the +overlay. If the identical signature remains after the single clean rebuild, resume normal crash +classification and early escalation. Never loop clean rebuilds. ### Hangs & freezes (two layers, because they have two causes) diff --git a/AGENTS.md b/AGENTS.md index 4152b985ea..ace6539a4b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -110,16 +110,36 @@ older `kKeysCount`. The characteristic failure is: If this exact startup failure repeats twice, do not change the implementation, test overlay, or portable account. Stop only this checkout's exact Telegram -process, then perform one full Xcode Debug clean and rebuild: +process. Because Xcode's `CONFIGURATION_BUILD_DIR` is `out/Debug`, make a +safety copy of every existing portable folder outside `out/` before cleaning: + +```bash +portable_backup_root="$(mktemp -d "${TMPDIR:-/tmp}/tdesktop-portable-clean.XXXXXX")" +for portable_name in \ + TelegramForcePortable \ + test_TelegramForcePortable \ + real_TelegramForcePortable; do + if [ -d "out/Debug/$portable_name" ]; then + ditto "out/Debug/$portable_name" "$portable_backup_root/$portable_name" + fi +done +``` + +Require every expected backup copy to exist before continuing. Then perform +one full Xcode Debug clean and rebuild: ```bash cmake --build out --config Debug --target clean cmake --build out --config Debug --target Telegram ``` -Rerun the same test once. If the signature persists after that clean rebuild, -continue normal crash diagnosis or report the blocker. Do not loop clean -rebuilds. +Afterward, restore a portable folder from the backup only when its original +path is missing; never overwrite a folder that survived the clean. Verify all +three original folder names that existed before the clean are present, keep +the backup until the rebuilt app completes one successful launch, and record +its path if the run stops before verification. Then rerun the same test once. +If the signature persists after that clean rebuild, continue normal crash +diagnosis or report the blocker. Do not loop clean rebuilds. ### Build fails with PDB or EXE access errors