# Store release prep ("yeni sürüm hazırsa yayınlayalım") Use when the user wants a verified branch shipped to App Store / Play. PM coordinates; merge, push and store uploads stay with the main session / the user. ## Talking to the user during a release push - One step per message: say what is ready in one line, give the user exactly ONE action (or one yes/no question), wait for "tamam", verify it, then give the next. A full blocker list + four questions at once reads as noise when the user is trying to move fast; keep the full list in your notes, not the reply. - Start everything that needs no user input in parallel BEFORE asking (security check, readiness probes), so the user's single step is never blocking idle work. ## Order 1. Pre-release security check right away (it is required anyway and is read-only): the security reviewer gets context only (release type, branch, commit range, changed native files, store targets, user data / location / forms, report path). Dispatch like any worker; read its report file, not just the summary. 2. Readiness probes (no user action needed): - Xcode account: `defaults read com.apple.dt.Xcode DVTDeveloperAccountManagerAppleIDLists` (empty `IDE.Identifiers.Prod = ()` means no account; upload/export fails with "No Accounts"). - Repo's release script pre-check, if any (Kitabe: `bash tool/ios_yayin.sh kontrol` in the worktree). - Burned build numbers file (Kitabe: `ios/yuklenen-yapilar.txt`); never reuse a build number. - Store state you cannot see (Play Console tracks, used versionCodes): with the user's permission, search the orchestrator's session history (e.g. "Play Console "); it has often seen the user's console screenshots (track name, last versionCode, tester count). Ask the user only what the history does not show; never log in. - Play uploads are done by the orchestrator on the user's instruction: hand it the signed AAB path, track name and release notes after the security check; the PM does not upload to Play. 3. User actions, one at a time (e.g. Xcode › Settings › Accounts › + › Apple Account), each verified by re-running the probe. 4. Apply security "non-blocking" items that App Review is likely to hit (e.g. location purpose string must mention every feature that uses location, review note must give test steps for new features) together with the version bump, after a single yes/no from the user. 5. Worker brief for prep: purpose strings, review note, version bump, `analyze`/`test`, release script `kontrol` → `arsiv` → `kuru` (local signed IPA, NO upload). Forbid upload/ASC/Play actions. ## Follow-up build after an upload (store warning, small fix) - Fix the warning in the release worktree WITHOUT bumping the version (the uploaded build stays testable), then ship it as build N+1. Example: ITMS-90683 (missing `NSLocationAlwaysAndWhenInUseUsageDescription`) arrives after upload when a plugin such as geolocator contains `requestAlwaysAuthorization` code, even if the app only asks when-in-use. Fix = add the key with the SAME text as the when-in-use string in Info.plist and every `.lproj/InfoPlist.strings`; alternative for a later release is compiling geolocator_apple with `BYPASS_PERMISSION_LOCATION_ALWAYS=1` (worker's call). - On the user's "gönderelim": dispatch the prep worker (bump only + analyze/test + `kontrol` → `arsiv` → `kuru`, no upload) and the security reviewer's delta check (`..HEAD`) in parallel; the security check is read-only, so they cannot collide. Ask the worker for in-IPA proof of the fix (`unzip -p 'Payload/*.app/Info.plist' | plutil -p -`), not only the source diff. - KOŞULLU GEÇTİ with a mechanical condition (e.g. "the bump commit may change only the version line") is verified by the PM with `git diff ..HEAD` before upload; only a condition that needs a product decision goes to the user as one question. - Upload is run by the PM after the user's explicit yes + a passed check (Kitabe: `KITABE_YUKLE_ONAY=evet bash tool/ios_yayin.sh yukle` in the worktree; the script appends the build to `ios/yuklenen-yapilar.txt`, commit that line in the worktree). ## After the upload: merge + worktree cleanup PM roles may not merge or delete even when the user orders it; measure, write a handoff, give it to the orchestrator, and tell the user so in one line. Send the handoff only after the release commits (bump, burned-build line) exist, so main receives the shipped state. Measure (read-only): - `git rev-list --count ..` for every local branch: 0 means `` is fully contained and becomes deletable (`git branch -d`, never `-D`) once the release branch is merged. - `git rev-list --count main..` and the reverse: commits only on main must survive the merge. - `git merge-tree --write-tree --name-only main ` (rc=0 = conflict-free) instead of a trial merge in the user's checkout. - `git status --short` on main: uncommitted changes (often Xcode noise in `project.pbxproj`/`Info.plist`) must be stashed, not discarded, before merging. - `git status --short --ignored` inside each worktree to be removed: `git worktree remove` also deletes git-ignored files, and release worktrees often hold the only local copy of git-ignored runtime assets (Kitabe: `assets/oi_foto/*.webp`, ~9k files; main has only `.gitkeep`, so tests that check bundled photos fail on main after the merge). Before removal: find the durable copy (repo docs/README name it; Kitabe: an archived worktree-artifacts folder outside the repo), prove it identical (`ls -A | wc -l` on both + `for f in *; do cmp -s "$f" "$W/$f" || n=$((n+1)); done`), copy the set into main's ignored folder, rerun main's tests, then remove. Put this in the handoff up front; `build/` alone is not the only thing that disappears. Classify: merge (the shipped line), remove worktree but keep branch (spikes whose work was redone on the release line), leave untouched (branches with unique unmerged commits, e.g. content/translation batches). When the user then says "merge everything": a leftover branch is merged only if `merge-tree` is clean AND `git diff --stat main... | grep -v /` shows no app code/asset change (data/tool/doc-only branches are safe); a spike that conflicts with the shipped redo is still NOT merged (it would mix old code into the new) and the reply says why in one line. Stash leftovers: never restore a file with `git checkout stash@{0} -- `; the stash sits on an older base and the whole-file checkout drops newer lines (e.g. a merged branch's `.gitignore` entries). Re-add only the needed lines by hand as a separate commit; keep the stash (dropping it is a deletion). Push is NOT implied by "merge"; it needs its own approval. Measure `gh repo view --json visibility` first: a PRIVATE repo push is not a release (no security gate); a PUBLIC one is. Prove it with `git rev-list --left-right --count main...origin/main` = `0 0` after `git fetch`. Dispatch: `hermes -p default chat --query-file --oneshot -Q --max-turns 50 --run-budget 1800 --in ` (background, notify). Always pass `-p default`: plain `hermes chat` runs in the CURRENT (PM) profile, which only re-measures and refuses the merge. When the orchestrator stops with questions the PM can answer from evidence (e.g. where an asset's durable copy lives), answer in a query file and resume the same session (`hermes -p default chat --resume --query-file --oneshot -Q --in `); afterwards verify yourself: `git log --oneline -3 main`, `git worktree list`, `git branch -vv`, `git stash list`, `git merge-base --is-ancestor main`. ## Getting a test build to the user - "APK'yı at": find the newest build of the requested line and prove it is current: the build file's mtime vs `git log --format='%h %ad' ..HEAD -- lib ios android pubspec.yaml assets` (only docs after the build = current). Report version/versionCode (`aapt2 dump badging | head -1`) and the signer (`apksigner verify --print-certs`): a worktree build is debug-signed (no key.properties there), fine for sideloading but not for Play; later builds must keep the same debug key so they install over the previous one. - Builds over the Telegram bot cap (50 MB) cannot go as MEDIA. Copy the file into its own folder and serve it with `scripts/serve-test-build.py` bound to the Tailscale IP (a private overlay-network link works anywhere; a LAN link only on a trusted home network), 3 h expiry, `curl -sI` the URL before sending. Tell the user: open on the phone with Tailscale on, allow "unknown sources" for the browser, uninstall a differently signed copy. - When a later message repeats an earlier link, recompute its expiry from the serve start time and `curl -sI` it first; never quote an expiry that has already passed (restart the server instead). - "Linki açamadım": first compare now with the serve time; past the 3 h expiry the server is gone. Restart it (it picks a NEW port; the log's first URL is just the folder's first file), `curl -sI` the exact file URL, check the user's phone is online in `tailscale status`, and resend the new link. Re-copy the newest build into the served folder first if the worker rebuilt after the last copy. - Repeated full-size sideload downloads are the signal to propose a store test channel (Play internal testing / TestFlight): store updates are patched, not re-downloaded whole. ## Update channel and large bundled assets (decision notes) - An in-app "update" button (WingWire-style) still downloads the full APK each time and needs a server hosting the APK; Play policy forbids a Play-distributed app from updating itself outside Play (https://support.google.com/googleplay/android-developer/answer/16559646), so it can only live in a separate sideload flavor (WingWire: `src/sideload/` with `REQUEST_INSTALL_PACKAGES`, absent from the Play flavor). - Moving big bundled media out of the binary without our own server: Android Play Asset Delivery (on-demand pack, user-triggered from Settings); iOS Apple-hosted Background Assets need min iOS 26, On-Demand Resources is deprecated from iOS 27 (Apple ASC help "On-demand resources size limits"). Both work only for store installs, so testing needs Play internal testing / bundletool `--local-testing` and TestFlight. Copyright-restricted media (e.g. photos used under a pending permission) must not be put on a public web host as the alternative; say so when presenting options. - First time for such a change: dispatch a PLAN-only worker job (options per platform, empty-state behaviour of every screen/widget using the media, test path, size estimate with method, store/privacy effects, phased plan, open questions) before any code; decide low-stakes UX questions yourself and bring the user only the one that blocks (usually a store account step or a min-OS bump). ## Pitfalls - Android release signing config (`android/key.properties` + keystore) is git-ignored, so it exists only in the main checkout, not in `.worktrees/*`. A release AAB built in a worktree silently falls back to debug signing when the gradle config allows it, and Play rejects it. Build the signed AAB where the key config exists (main session's job) and verify with `jarsigner -verify` / `apksigner verify` before upload. Never read or copy the key files into a worktree. - A "güncelleme" request may actually be the first public release: check whether any store version is live; if not, store listing gaps (privacy policy URL, screenshots) become blockers too.