--- name: client-feature-qa-handoff description: Use when a PM delegates, verifies or ships a client feature. version: 1.0.0 author: HamaratLabs license: MIT metadata: hermes: tags: - pm - qa - fake-gateway - android - wingwire - delegation - evidence --- # Client feature: QA prep → worker brief → verify → report For product-owner (PM) agents adding a screen to a client app (Android/iOS/web) that talks to a Hermes dashboard plugin API (kanban, cron, gallery...). PM does NOT write the screen code; PM owns the API contract, test fixtures, brief, verification and RAPOR.md. ## When to Use A new client screen/feature needs a fake-data test environment, a delegated implementation (mobile or web developer agent) and PM-side verification + report. Not for the PM writing the code itself. ## Always-on rules - Never touch the real dashboards/ports or real personal data; screenshots contain ONLY fake QA data the PM created ("Test görevi 1", "QA kanıtı"...). - Never print/commit session or Bearer tokens. Print only `${#TOK}` (length) and prove absence by grepping the evidence file for a token prefix (expect 0 matches; `grep -c` exits 1 on 0 matches — that is success). - Stay in the feature worktree; commit only there. No push/PR/merge/delete, even when the user orders it: measure and hand off to the orchestrator (see store-release-prep "After the upload"). Do not touch out-of-scope platforms/repos the user excluded for this sprint. - User-facing reports: Turkish, short, separate progress vs result, open questions at the end under **Sorular** (write "Yok" if none). ## Procedure 1. Confirm MVP scope with the user (in/out list) before any fixture work; out-of-scope endpoints become explicit 404s in the fake gateway and a "Kapsam DIŞI" section in the brief. 2. Isolated real dashboard: isolated `HOME` AND `HERMES_HOME` under the PM scratch dir, started via a guarded launcher (`env -i`, forbidden-port check, profile/path validation, auto-kill on leak, IZOLE-OK evidence — see `references/isolated-hermes-qa-copy.md`) on a non-real port. Only `HERMES_HOME` with the real `$HOME` lets the copy reach the user's real profiles; workers must never start a copy any other way. Seed fake boards/items with an idempotent repo script (`QA/seed__qa.sh`) and a launcher (`QA/run__qa_dashboard.sh `). Include edge data: empty board, long title, Turkish chars, linked/blocked items. 3. Derive the schema from that isolated dashboard's REAL responses (top-level keys, auth behavior, error codes) — not from guesses. Save a token-free evidence file with a repo script (`QA/evidence__dashboard.sh > docs/qa//dashboard--kanit.txt`); it should refuse real ports and record the listening process's HERMES_HOME (masked `$HOME`→`~`). 4. Write `QA/fake_gateway.py` in the client repo (see `references/fake-gateway-pattern.md`): loopback only, refuses real ports, auth required, modes `demo|empty|error|missing|slow`. 5. Smoke-test it with a repo script `QA/test_fake_gateway_.sh` (start → curl checks → stop by PID), run as `bash QA/test_...sh`. A checked-in script is readable, reviewable and becomes reusable evidence. If the environment's command policy asks for approval, ask the user; do not reshape the command to avoid the check. 6. Read the existing analogous screen/API (e.g. CronApi/CronScreen, app container wiring, tab enum) so the brief names concrete patterns; write `docs/qa//WORKER-BRIEF.md` using `templates/worker-brief.md`. Before writing it, check each planned item against the base branch (`git grep -n main`, `git show main: | sed -n a,bp`). Plans written from memory often list features that already exist (e.g. rename/archive/pin) or name the wrong server API (RPC vs REST). Narrow the scope to the real gap. Put an "Ön durum (PM gördü, sen doğrula)" section with file:line hints and the rule "önce ölç, sonra yalnız eksikleri kapat; var olanı yeniden yazma" in the brief. 7. Commit PM prep (QA scripts, evidence, brief) BEFORE dispatch so the worker starts on a clean tree. 8. Dispatch the worker in the background, from the worktree: `hermes -p chat --query-file $TMPDIR/.txt --oneshot -Q --max-turns 200 > /.out 2>&1` (terminal background=true, notify=true). Always name the profile with `-p`, including the orchestrator's profile: without it the run silently uses the current PM profile. Query file: brief path, worktree/branch, forbidden actions, required final message (commit hashes, test counts, screenshot paths). Do not add an approval-bypass flag (`--yolo`) by default: a worker that cannot ask anyone should get a task that needs no risky commands. Use it only in an isolated worktree with no access to real data, with the user's explicit approval for that run, and say in the report that it was used and why. When a terminal result comes back near-empty/truncated, redirect the commands to a scratch file (`{ ...; } > $TMPDIR/x.txt 2>&1`) and `read_file` it instead of re-running variants. `process wait` is clamped (~180s): after one wait, end the turn with a status; completion is notified. If the dispatch exits 1 with `Gateway disconnected; turn outcome is unknown`, the worker is usually still running: confirm new `API call #` lines for its session id with `hermes -p logs agent --session `, then start `scripts/wait-worker-idle.sh ` with background=true, notify=true and end the turn. The id in agent.log is not always the printed one: the first turn may log under one id and resumed turns under the printed resume id. Take the id from the newest `API call #` lines (`hermes -p logs agent -n 3`), and start the watcher only after the new turn has logged a call (sleep 30-60s first); otherwise an older `Turn ended` for the same id makes it report "tur bitti" at once. Collect the final message of a finished turn WITHOUT resuming (a resume starts a new turn): `hermes -p sessions export $TMPDIR/s.jsonl --format jsonl --session-id `, then read the last `role: assistant` message with a small script file. Write every resume query file as an explicit order from the requester (" (iş veren) olarak açık talimat: ..." + numbered steps + brief path). A bare "devam et" can be read by the worker as a system notification; it then stops and asks "devam edeyim mi?", wasting a turn. A user correction that arrives while the worker is mid-turn: write it as a query file and queue it so it starts when the turn ends (`while kill -0 ; do sleep 30; done; hermes -p chat --resume --query-file --oneshot -Q --in ; sleep 30; `, background + notify). Never resume a live session to inject it. Resume rules: `--resume ` refuses creation overrides, so drop `--max-turns`/`--run-budget` (keep `--query-file --oneshot -Q --in`). After a Hermes restart the first resume may print "Execution outcome unknown ... /discard "; just run the same resume again before discarding. Background watchers die with a gateway/host restart and never notify: when the user asks for status, re-check the worker log first; last activity hours old with no `Turn ended` means the turn was lost, so resume it with a short "kaldığın yerden devam" query file and re-arm the watcher. A provider usage-limit stop looks the same (watcher says "durdu", no `Turn ended`): grep the worker's agent.log for `usage limits` / `ERROR` / `RateLimitError` on that session id. A 429 whose fallback provider also fails ends as `Turn ended: reason=pending_tool_result` after a few calls; the `Rate-limit backoff ... cooldown N s` line gives the reset time, so resume once it has passed. Read every chain/watcher notification before assuming the job runs: `fatal: cannot change to '.worktrees/'` at the end means the worker died before even creating its worktree. All workers of a profile share its credential, so when one stops this way check EVERY running worker of that profile at once and resume them together with one shared resume file ("oturum sınır hatasıyla kesildi; `git status` ile bak, hiçbir şeyi silme, commit'lenmemişi commit'le, eksik kabul ölçütlerini bitir"); tell the user how long the work sat idle. A stop with `Turn ended: reason=session_persistence_failed` / `pending_tool_result` and `Session DB append_message failed: unable to open database file` means the disk is full (`df -h /System/Volumes/Data`): the worker cannot save its session, its edits sit uncommitted. Commit the WIP in the worktree yourself (`git add -A `, message says why), measure the biggest consumers with `du -sh` (worktree `build/` dirs, CoreSimulator, `~/.gradle`, `~/Library/Caches`), and ask the user ONE question: may the agent responsible for deletions (with the user's approval) free space. Resume the same session only after free space is back. Two jobs for the same specialist that both record emulator/simulator video must not overlap (recordings and installs collide): queue the second with a background chain that waits for the first's watcher and `while pgrep -f "hermes -p chat" >/dev/null; do sleep 30; done` before dispatching, and tell the user the order. 9. Write RAPOR.md with PM deliverables now and a " sonucu (bekleniyor)" section; do NOT commit it while the worker commits in the same worktree (index races). End the turn; don't poll. 10. On completion verify independently, in this order: worker RAPOR, log tail, `git log ..HEAD` + `git diff ..HEAD --stat`, grep the diff for `session\.close|`, isolation (`lsof -nP -iTCP: -sTCP:LISTEN` must be empty after stop), `adb devices`, then your own `./gradlew --max-workers=2 :app:testDebugUnitTest --rerun :app:assembleDebug` (JDK 21). A "BUILD SUCCESSFUL" in under ~1s is a cache hit — tests did not run; without `--rerun` it proves nothing. Count results from `app/build/test-results/testDebugUnitTest/*.xml` with grep (`grep -ho 'tests="[0-9]*"' *.xml | tr -dc '0-9\n' | paste -sd+ - | bc`, same for failures/errors). Open every screenshot (vision) and check it shows only fake QA data and matches its filename claim, check ACs one by one, then fill and commit RAPOR.md. For bug fixes, stitch the worker's before/after screenshots into one side-by-side image (Pillow, script file) and send it with the report; the user judges the fix from that single picture. ## Waiting on a worker (terminal limits) - The terminal tool hard-stops at ~420s regardless of `timeout`: keep wait loops under ~380s total (e.g. `for i in $(seq 1 12); do sleep 30; ps -p >/dev/null || break; done; `); for a build use `grep -qE "BUILD (SUCCESSFUL|FAILED)" && break` as the exit test. - Prefer simple grep/awk pipelines or a reviewed script file in the repo for monitoring; if a command needs approval, ask the user rather than rewriting it to avoid the check. - Check the worker log for repeated "Session compressed N times" warnings (`tail -c 1500 | tr -d '\033'`). Dozens of compactions mean accuracy may have degraded: tell the user, and review that worker's diff item by item instead of trusting its summary. - Sprint plans may live in the PM's own workspace (`/plans/`), not the repo — look there before concluding a plan note is missing; record independent-bug outcomes in the plan's "bağımsız iş" section. ## Independent bug fix (outside the sprint) When the user reports a bug on a live screen and asks for a separate job: main-based worktree + `fix/` branch, dispatched like a feature, never folded into the sprint branch without approval. Brief requirements, evidence layout and report shape: `references/independent-bugfix-perf.md`. ## Discovery budget (PM side) - Cap discovery at a handful of targeted commands, then act (create branch/worktrees, write briefs). Long re-reading loops burn the context and get compacted away without progress. - Keep each discovery output small (`| cut -c1-200 | head`, `sed -n a,bp`) or write it to a scratch file and `read_file` it; large terminal outputs are the first thing lost in compaction. ## Sprint wave: several workers in parallel For a sprint with several independent items dispatched at once (one worktree per item), follow `references/parallel-wave-dispatch.md`. It covers the integration branch base, worktree setup, per-worker resource allocation, a shared rules file plus per-item briefs, dispatch commands, progress monitoring and The user report. Hermes session-management API notes are in `references/hermes-sessions-api.md`. ## Worktree base - First find the line that actually ships: `git for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short)' refs/heads | head` and `git log --oneline --graph --all --decorate -40`. In mobile repos the store build often comes from a release branch (e.g. `release/*` on top of `feat/magaza-*`) far ahead of a stale `main`; work based on `main` then cannot merge and has to be ported (different screens/data). Base anything meant to ship on the release line and say so in the brief; base throwaway spikes wherever, but note the port cost. - Run `git rev-parse main origin/main` before writing the worktree command into a brief. If local `main` has unpushed commits, base on local `main` (the template's `origin/main` would drop them); never touch uncommitted changes in the main checkout. - When a spike is accepted for a release, brief it as a port onto the release branch: separate commits per bug fix and per feature (revertable), commit order noted when they touch the same files. ## Shipping to the stores Release push (security check, readiness probes, user steps, prep brief, signing pitfalls): `references/store-release-prep.md`. Always-on: during a release push give the user ONE action or ONE yes/no question per message and verify it before the next; run everything else in parallel meanwhile. ## New platform capability (Siri/Gemini/OS beta) Feasibility answer, toolchain inventory, spike scoping and assistant content-safety rules: `references/platform-capability-spike.md`. Framework/SDK release review ("Flutter X'te neler gelmiş"): `references/framework-release-research.md`; never relay a research worker's "critical" items or numbers without checking them against the official page and the repo. ## New UX flow (onboarding, first-run, new screen family) Research (named profile) -> requirements note -> verified report copied to the notes vault -> 4+ genuinely different motion-prototype directions recorded as video -> comparison video -> user picks or merges: `references/design-exploration.md`. ## Whole-app UX / UI analysis Specialist evidence pack (inventory, screenshots, task flows, measurements; no proposals) -> agy UX analysis -> PM verification (URLs, screenshots, code) -> agy UI analysis -> merged priority list in packages (quick fixes / structural / visual directions) -> user approves Paket 1 -> measurable brief: `references/ux-ui-audit.md`. ## Small product change from user feedback (screenshot + "bu mantıksız") - Before proposing, read the code behind the element and tell the user in one line what it really does (e.g. a "from the archive" list that is just the first N records in source order); the complaint is usually that the label promises meaning the logic lacks. - Name replacements by what the app can actually know: "recently viewed", not "visited" (knowing visits needs background location, which the privacy line forbids). Default the privacy shape: stored on device only, excluded from OS backup, section hidden when empty, clear option in Settings, one line in the privacy policy, store data-form answer unchanged. - Read the user's screenshot for build clues: an icon or label changed in a later build means the phone runs an old version; say so and send the new test build link with the result. - "Remove X everywhere" (e.g. attribution text): grep every occurrence (code + ARB + store texts), keep the places the user named plus the project-rule minimum (one small source line per record with record id and single-source marker), and state that minimum as a vetoable default instead of asking. - Answer the specialist's low-stakes closing questions yourself (keep/remove a settings row, backup exclusion, store-note wording), resume the same session with an explicit order, and give the user one line per decision. Do not bounce them to the user. ## Status after a gap ("Ne durumdayız") - Before reporting, check what others did meanwhile: `git reflog --date=iso -5`, `git branch -vv`, `git worktree list` (the orchestrator may have merged and removed worktrees with the user's approval), confirm git-ignored assets survived (`ls assets/ | wc -l`), and run analyze + tests on the new main yourself. Report merged / not pushed / not yet built separately, then one next-step question. ## Extending an existing screen with writes (create/move) - Branch a fresh worktree from main (`git worktree add .worktrees/ -b feature/ main`) after confirming the earlier feature is merged (`git merge-base --is-ancestor feature/ main`); name any parallel feature worktree as DO-NOT-TOUCH in the brief. - Read the server's write path end to end (body model → db create → initial-state resolver → transition table) before promising UI behavior; requested UX like "create in the selected column" often maps to 2 calls or is impossible for some states. Put the mapping + fallback in the brief and the trade-off in **Sorular**. Hermes kanban specifics: `references/hermes-kanban-write-api.md`. - Write E2E only against the isolated dashboard; forbid writes to the user's real board. Require independent proof per created item (curl GET by id with token masked, or sqlite SELECT on the isolated db) saved to `docs/qa//e2e-kanit.txt`, plus prefixed titles (e.g. `QA-ekle-`) for cleanup. - Before dispatch, check the isolated port answers (curl `-w %{http_code}`) and list `adb devices`; with several emulators tell the worker to pin one via `adb -s` so a parallel worker's session isn't disturbed. - "Add a view" requests (e.g. list vs board toggle) are additive: brief must say the old view stays unchanged and the choice persists (rememberSaveable / existing prefs, no new deps). ## Files - `references/hermes-kanban-write-api.md` — kanban create/PATCH semantics and the column-picker decision. - `references/fake-gateway-pattern.md` — fake gateway design + smoke-test script skeleton. - `templates/worker-brief.md` — brief skeleton (scope, contract, ACs, QA env, deliverables). - `references/parallel-wave-dispatch.md` — parallel sprint wave: branches, resources, dispatch, monitoring. - `references/hermes-sessions-api.md` — where Hermes session rename/archive/pin/delete live and how they behave. - `references/isolated-hermes-qa-copy.md` — guarded copy-Hermes launcher, reliable stop, brief isolation rules, pre-seeding. - `references/independent-bugfix-perf.md` — slow/empty-screen bug: brief must-haves, evidence layout, before/after report. - `references/platform-capability-spike.md` — "can we integrate ?": answer, toolchain check, spike brief; home-screen widget mock → implementation stages and the widget look rules the user set. - `references/framework-release-research.md` — "what do the latest Flutter/Dart (SDK) releases bring us?": baseline, agy research, PM verification against official pages + repo, report shape. - `references/store-release-prep.md` — release push: one-step-at-a-time user flow, probes, follow-up build after a store warning, post-release merge/cleanup handoff (git-ignored assets lost on worktree removal), getting a big test build to the user's phone, update-channel / store-hosted asset decision notes, signing pitfalls. - `references/design-exploration.md` — UX research brief (research agent), requirements note, research verification, motion-prototype directions, comparison video, merge picks, full-res zoom rule; adopting a platform visual style (e.g. Liquid Glass bar): research order, native-vs-drawn options, decider's device, contrast/solid-fallback gates. - `references/ux-ui-audit.md` — whole-app UX then UI audit: evidence-pack brief, agy prompts and wrapper, per-model quota fallback, PM verification of sources/findings, the notes vault note shape. - `scripts/wait-worker-idle.sh` — notify-on-idle watcher for a worker whose dispatch client disconnected. - `scripts/serve-test-build.py` — time-limited download link for a test build too big for Telegram (see store-release-prep "Getting a test build to the user").