ZaStoGram_desktop/Telegram/SourceFiles/test/docs/diagnostics.md
John Preston eae93e174c [ai] Place several chat-list messages in or out of view
Task: 2026/10/27/show-or-scroll-off-several-chat-list-messages-and-prove-they-stayed-in-the-harness
2026-11-05 17:12:55 +04:00

138 lines
203 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Failure diagnosis
[Harness guide](../README.md) · [Helper index](helpers/README.md)
Search for the observed symptom or named helper and read the matching row.
Do not read this entire history for an unrelated scenario. Each row retains
its measured cause, repair and limits; a different failure needs evidence.
| Symptom | Likely harness cause | Repair |
| --- | --- | --- |
| Run exits with no `TEST_COMPLETE` and no `SCENARIO_RESULT` | `TDESKTOP_TEST_WATCHDOG` is seconds; a millisecond-shaped value (for example `600000`) used to arm a multi-day timer that `test-run --deadline` always outruns, so the watchdog never wrote the markers. | Override is seconds in 1..600; implausible values fall back to 120s and the armed duration is logged next to `SCENARIO_START`. Use a value in that range, or omit the variable. |
| The run's only FAIL is `TEST_RESULT: FAIL: fixture gate: session gate - case=non-test-primary: the primary window shows an authorized account on the Production environment (index=0 primary=1 session=1 active=1), ...`, written before any `TEST_STEP`; every stage reads `TEST_RESULT: N/A: <stage> - fixture gate: session gate refused the scenario (case=non-test-primary)`, then come `SCENARIO_RESULT: FAIL (failures: 1, skipped: <every stage>)` and `TEST_COMPLETE`; the `NOTE: SESSION_GATE: account ...` rows show that account as `authorized=1 environment=Production primary=1` beside the Test account | Not the product: the marked live copy holds an authorized account on a non-Test environment beside the Test account, and the primary window opens on it (it was the active account when the copy last quit). `ApplySessionGate` (`test_session_gate.cpp`), called by `Runner::start()`, refuses because every stage and every shared helper that reads `Core::App().domain().active()` or `Core::App().activePrimaryWindow()` would act as that account. The sibling cases: `non-test-active` is the same hazard through `domain().active()` alone; `selection-unreadable` is a primary window whose account and shown session are missing or disagree; `domain-not-started` is a passcode-locked copy whose accounts cannot be read; `invalid-declaration` is a production-leg declaration with an empty or multi-line label, made twice or for another runner. A scenario using the Test-session helper reads one of its own cases instead: `no-test-account` (the copy holds no authorized Test account), `helper-selection-split` or `helper-original-unauthorized` (the original selection could not be restored as a whole, so nothing was switched), `switch-not-applied` (the read-back did not prove the switch; the finish backstop switches back), `helper-with-declaration` or `invalid-helper` (a misused request). | Make the stages run on a Test session, never around the gate. Repair 1, the default: `const auto session = Test::UseTestSession(runner);` in `SetupScenario` and `Test::AppendTestSessionRestore(runner, session);` as the scenario's last stage - the gate then switches the primary window to the lowest-index authorized Test account through the product's own switch and proves it by read-back before any stage, and the last stage switches back and proves the restore; the switch carries the product's presence updates and persists the active index locally (see the [session-gate contract](helpers/test_session_gate.md)). Repair 2, only when the task explicitly authorizes legs on that account: `Test::DeclareProductionLegs(runner, { .task = <task id>, .legs = <legs> })` in `SetupScenario` instead of the helper, never beside it. Never edit or bypass the gate, never log out, reset, re-copy or re-authorize any account, and never reach the account by another route. Confirm the gate with `AppendSessionGateSelfTest`. |
| A stage waiting for another account's controller, or for a just-created separate window's, times out or reports no ready controller while that window is open, registered and visible - the own-QR importer route "could not resolve a ready matching Test controller" - and the overlay searched `Core::App().windowStack()`, `activeWindow()`, `activePrimaryWindow()` or `windowFor()` | Activation history is not the registry. `windowStack()` changes only in `setLastActiveWindow`, mostly when the OS reports a window active (`windowActivated`), which a background launch may never do for a new window, while `ensureSeparateWindowFor` registers it at once; `windowFor()` falls back to the active primary window, which may show another account. Run 1 of `2026/10/17/open-ones-own-qr-box-without-a-username-with-temporary-only-codes` searched `windowStack()` right after creating the importer's window. | Resolve with `Test::ResolveController` / act with `Test::ActOnController` ([test_controller_ready](helpers/test_controller_ready.md)); the reading's `activation=absent` records the omission, and `no-registered-window` names a truly absent controller. Never activate or switch accounts in the readiness poll. Confirm with `AppendControllerReadySelfTest`. |
| A fixture gate finds no `ChatWidget` / `ListWidget` of a chat in the separate window `Core::App().ensureSeparateWindowFor` opened for it, while that window is open and shows the chat - `the bot chat in a separate window - list=0 bottom=1 pending=0` | `use-modern-chat-view` was off when the window was constructed (the option is now on by default), so `MainWidget::showHistory` built the window's legacy `HistoryWidget` / `HistoryInner` instead. Run 1 of `2026/10/26/deliver-bot-state-edits-and-poll-watched-shared-state-to-running-widgets` lost every two-host check this way. | Read the option, set it on for exactly the `ensureSeparateWindowFor` call and restore the value found right after it, before any other navigation; then resolve the list inside that window ([chat-list resolution](chat-lists.md#a-chats-separate-window)). A legacy list there is not a second host of a chat another legacy list shows; the same section says why. |
| Timeout before the task fixture exists | Generic account/chats preamble or unrelated navigation. | Remove unused startup gates; inject the fixture or publish the production object at its real seam. |
| Assertion/crash in a stage action | `.run` dereferenced an async object or a raw pointer outlived its owner. | Use `actOnWidget`, `QPointer`, or live publication. |
| Wrong custom widget/button found | Unsafe Qt typed search or ambiguous descendant order. | Use the RTTI finders; for repeated/layer-owned controls publish the exact object/action. |
| Expected mismatch reported as timeout | Product outcome was put in `until`. | Wait only for propagation/generation; assert and log the outcome in `then`/`captureAndInspect`. |
| A stage times out at exactly the length of a product deadline it was waiting through - `stage timed out: ... - waited 60000 ms` on a stage whose `until` awaits an outcome the product bounds with its own timer - while the product's own fail row, which that `until` already accepts, would have arrived a moment later | The stage timeout coincides with the product's deadline, so the harness ends the stage before the product decides and the run records an instrument timeout where a decided negative existed. The row above is the neighbouring fault: there the outcome was put in `until`; here it is in `then` already, but the wait was not given room to reach it. | Make a stage that waits through a product timer outlast it by a clear margin - 75 s over a 60 s deadline - accept the product's own fail row as the decided negative, and keep the outcome assertion in `then`. |
| A request never answers although the server did: no `.done()`, no `.fail()`, no product row, the stage waits until its timeout, while the application Debug log repeats `RPC Info: error received, code 500, type <T>` for the same request | `Instance::Private::onErrorDefault` auto-resends every code-500 and negative-code `rpc_error` after a doubling delay and never calls a product callback for it, so nothing a scenario can read ever changes. | Read the `rpc retry code=<code> type=<type> request=<constructor>` rows the permanent seam records into `Test::RpcRetryProbe()` (`test_rpc_retry.h`), through a `mark()` taken immediately before the action, and decide from those rows plus the product's own fail row - never from the stage timeout. `<constructor>` is the boxed body constructor id in hex, compared against the `mtpc_*` constant the scenario cares about. The Debug log's lines stay the fallback for a reader without the harness log. |
| A controlled success fixture never reaches `.done()`, or a later valid answer looks like a stale/missing callback, while the application Debug log shows `RESPONSE_PARSE_FAILED` / `Response parse failed` | A bare TL constructor factory or an incomplete buffer was written into `MTP::Response::reply` and handed to `processCallback`. `MakeDoneHandler` calls `senderRequestHandled` before `Result::read`, returns false on a missing constructor word or truncated body, and `processCallback` then unregisters the request, so the fixture mistake is consumed as a local parse failure. | Deliver through `test_rpc_fixture.h`: typed success takes the boxed `Request::ResponseType`, `DiagnoseControlledRpcResult` refuses empty/truncated/trailing/wrong-constructor buffers **before** `processCallback`, and explicit error/stale routes are separate. Confirm with `AppendControlledRpcSelfTest`. |
| Post-state rows read after a network turn - a chats-list row, a count, a tab strip, a late capture - show the entity that a mocked destructive answer removed, while the readings taken in the answer's own turn passed; a restore stage then reports nothing to restore, and a `Test::DiscriminatingScan` whose control was that restore's request reads a zero control and fails `discriminates` | The overlay answered a server-destructive request locally - the `mock-api` strategy - so the server still holds the data, and a later ordinary product read loads it again and re-creates the local entity the mocked answer removed. It is a fixture artifact, not a product defect: a real deletion would empty the server side. The fixture must not block that read, because the product's later server reads are legitimate behaviour. Observed in `2026/10/12/switch-channel-direct-messages-to-all-after-deleting-the-open-chat` (`work/test.md`, Attempt 1, Run 1): the overlay suppressed `messages.deleteSavedHistory` and answered it with `messages.affectedHistory` through `Test::DeliverControlledRpcSuccess`, which ran the product's deletion synchronously (`Data::SavedMessages::applySublistDeleted()` fired once), and every reading taken in that turn passed. Inside the same delivery the view the product showed after the deletion formed its own `messages.getHistory`; the server answered it about 250 ms after the mocked answer was parsed, still holding the deleted user's message, and `HistoryItem::savedSublist()` with `Data::SavedSublist::applyMaybeLast()` re-created that user's sublist and chats-list row. The after-refresh rows `shows All plus one tab per remaining chat` and `no chats-list row for CJ` (CJ being the deleted user) then failed (`rows=2`, the deleted peer listed again), the late capture showed the deleted tab back, the restore read `nothing to restore: the sublists are present` and sent no `messages.getSavedDialogsByID`, and because that request was the scan's control, the scan's `discriminates` row and its subject row failed with `subject=0 control=0`: four FAIL rows, a recovery leaf and a second run, although the product claim had read positively in the answer's turn. This differs from the controlled-success row above, where the answer never reached `.done()`: here it did, and the product applied it. It differs from the `Test::DiscriminatingScan` row below as well: there the enumeration cannot reach the subject; here the walk could, and the control it was given never happened. | Three steps, for any destructive request answered locally. (1) Read and capture in the stage that delivers the controlled answer, right after `DeliverControlledRpcSuccess` returns and before any network turn. (2) Gate every later post-state reading on a named re-sync reading - whether the entity exists again and holds a server message: when it does, the rows a re-creation can change are `TEST_RESULT: N/A` with a `fixture gate:` reason, and otherwise they are judged as designed. (3) Take the scan's control from a request known to be present in the same window - there, the shown view's own `messages.getHistory` - never from a restore that may have nothing to restore. Never suppress the product's later reads to keep the entity gone. Repaired that way in Run 2 of the same task: no FAIL row, `SCENARIO_RESULT: PASS`. |
| Blank or partial screenshot | Wrong paint owner, animation cache, or viewport clipping. | Use prepared capture, `PanelShowSettled`, the owning ancestor, or `CaptureMappedRect`; for a box inside a layer, `Test::PaintingLayerRoot`; for a `Ui::PopupMenu`, `Test::CapturePopupMenu`. Gate a visible mapped card/row on `Test::MappedTargetReady` / `prepare(owner, origin, rect)` so origin-local containment cannot pass a target that is still clipped. |
| A mapped capture is refused after readiness passed, or a HistoryInner-local (or other origin-local) rectangle was treated as visible while part of it sat outside the painted owner or scroll | Readiness checked the origin widget's own rect, which still contains a child that a negative scroll offset has moved outside `HistoryWidget` / `Ui::ElasticScroll`. `ElasticScroll::viewport()` returns the inner content, so using it as the clipper recreates the same pass. `PaintingLayerRoot` does not name a chat paint owner. | Use `Test::ReadMappedTarget(owner, origin, localRect)`: whole-rect containment in the painted owner and the relevant clipper (`ElasticScroll` itself, or `QAbstractScrollArea::viewport()`). Do not intersect or reframe. `CaptureMappedTarget` refuses an unready reading; `CaptureMappedRect` still refuses a rect that is not fully inside the grabbed widget. Confirm with `test_mapped_target.h`. |
| A full-row or band crop cut out of a full-owner grab comes back non-null but shorter than requested, the saved frame cuts the row behind a bottom hint, or a typed `Ui::SeparatePanel` sizing gate refuses an ordinary active panel reading `state=8`, or on macOS refuses a shown fixed-size panel nothing maximized as `size mode maximized: state=2 (maximized)` (10 when active), or a restore of such a panel reads `state=0` where it froze `state=2` | `Test::Crop` intersects with the image on purpose, so a crop reaching past its owner is silently shortened; owner-local containment, or a mapped reading with the owner itself as origin, never walks the row's scroll ancestry and misses a row cut by a viewport shortened above a bottom overlay; the panel was too short because its first `setInnerSize` took `initGeometry`, which clamps to the screen's available height; and `windowState() == Qt::WindowNoState` is not "normal": `Qt::WindowActive` (0x8) is independent of the minimized, maximized and fullscreen size modes, and `showAndActivate()` sets it. On macOS a raw maximized bit is not a size mode either: Qt cocoa reports `NSWindow.zoomed` as `Qt::WindowMaximized` (`QCocoaWindow::windowState()` in `qcocoawindow.mm`), and AppKit reads a window whose minimum equals its maximum as zoomed, so a shown fixed-size frameless panel reads 2 (10 when active) and can read 0 after a programmatic resize or move, including the sizing's own `setInnerSize`; the bit is derived from the frame and the constraints. Observed in `2026/10/19/qualify-full-owner-captures-and-bind-mapped-rectangles-to-their-owner` (`work/test.md`, Run 1): the self-test's shown, never activated panel at `222x284` with min = max = `222x284` was refused as `state=2 (maximized)` before any `setInnerSize`, and a Qt 6.11.2 probe read 2 right after `show()`, 0 after `setFixedSize` to another size and back plus `move`, and 2 again only after `showMaximized()`. Observed in `2026/10/18/tighten-money-tabs-without-moving-the-transactions-title` (`work/test.md`): in Run 3, at interface scale 200, Content was 784x828 while its first row ended at 862, the requested band/strip/full-row crop extended 34 px past Content and the Transactions bottom hint also clipped the scroll viewport; in Run 4 a sizing prerequisite of `state==WindowNoState` refused state 8 and never resized the panel. | Crop only through `PreparedWidgetCapture::prepareCrop(owner, descendant, crop)` (`test_capture.h`), which certifies the descendant whole in the owner and its actual viewport and the crop whole in the owner before it renders, refuses an owner-as-origin substitution by name and keeps the entire device extent. When the fixture is too short, grow it through `Test::GrowPanelInnerHeight` (`test_panel.h`) on the typed panel, whose later `setInnerSize` takes `updateGeometry` with no clamp; it refuses size modes only, of the effective state `PanelSizeModeStates`, which on macOS clears the maximized bit of a fixed-size panel at its fixed size and nothing else, records the full raw state, never activates; wait for `PanelSizingApplied`, and restore with `RestorePanelSizing` from a recovery stage and `Runner::onFinish`. Apply and restore compare exact geometry, request and constraints and the effective state (size mode plus Active), and `PanelSizingText` prints the raw `state=` beside `effective=`. Never shrink or intersect the crop, change the interface scale or style, require an empty window state, compare the raw macOS zoom bit, or call `showMaximized()` / `showNormal()` to recreate or clear it. Confirm with `AppendFullOwnerCaptureSelfTest` group C. |
| A mapped capture of a child lands at its correct position plus the child's own `pos()` - for example mapped y 736 for a frame at y 397 inside a child placed at y 339 - and is refused outside the owner, or, where the doubled rect still fits, is accepted at the wrong pixels | A parent-relative frame - `geometry()`, or an accessor such as `Ui::PeerQrPill::pillGeometry()` that translates the child's frame by `pos()` - was handed with the child itself as origin. The untyped `ReadMappedTarget(owner, origin, rect)` checks containment only, so the position is applied twice and nothing ties the rect to its coordinate space. Observed in `2026/10/17/open-ones-own-qr-box-without-a-username-with-temporary-only-codes` (`work/test.md`, Run 4: mapped y 736 = 397 + 339, both pill captures failed); Run 5 mapped the frame from the real parent, compared it with an independent pill-local mapping and kept the doubled pairing as a wrong-coordinate negative. | Bind the rect to its coordinate owner: `Test::MappedRect::InParent(child, child->geometry())` (or the frame accessor) for a parent-relative frame, `MappedRect::Local(child, child->rect())` for the child's own rect, and read it with the typed `ReadMappedTarget(owner, target)` / `PreparedWidgetCapture::prepare(owner, target)` / `CaptureMappedTarget(owner, target, name)`. The wrong pairing is refused as `coordinate mismatch: requested=... space=... origin=... painted=... bounds=... owner=... would map to ...`, before any frame is accepted. Confirm with `AppendMappedTargetSelfTest`'s typed stages. |
| Old palette/colour sampled | Style had not settled or moved between reference and target. | Use `StyleSettled` and `StyleBaseline`. |
| A night or day variant is identical to the default - every "other palette" capture repeats the palette the run started in - or a toggle's own reading shows nothing changed, `night before=1 now=1` after `Window::Theme::ToggleNightMode()`, with no error and no log line | The theme follows the system dark mode, and the change is refused. `Core::Settings` starts `_systemDarkModeEnabled` true, so following is the default, and the sandbox of the first source below, a fresh copy of the golden portable folder, followed the system. `ChatBackground::nightModeChangeAllowed()` (`window/themes/window_theme.cpp`) takes the mode allowed after a change as `systemDarkMode().value_or(!_nightMode)` while `systemDarkModeEnabled()` holds and as `!_nightMode` otherwise, and allows the change only when that differs from `_nightMode`, so while the platform reports a system mode any change away from it is refused. `Window::Theme::ToggleNightMode()` reaches it through `ChatBackground::toggleNightMode()` and `ChatBackground::reapplyWithNightMode()`, which returns with no change and no log when `_nightMode != newNightMode && !nightModeChangeAllowed()`, and `ToggleNightMode()` returns nothing, so the caller is not told. `Window::Theme::IsNightMode()` does not decide it either: a toggle applies the palette at once, but `_nightMode` is committed only in `Window::Theme::KeepApplied()`, which runs the keep `reapplyWithNightMode()` set up. The product's own route is `Window::Theme::ToggleNightModeWithConfirmation()`, whose confirmation box turns following off (`setSystemDarkModeEnabled(false)`, `saveSettingsDelayed()`) before the toggle; and re-enabling following runs `Core::Application::checkSystemDarkMode()` through `startSystemDarkModeViewer()`, which switches back to the reported mode at once. Observed in `2026/10/12/recognize-tgw-widget-documents` (`work/test.md`, Test 22 in Runs 1-3; the recovery-plan rows "T22 palette" of Runs 1 and 2): Run 1's sandbox was already in night mode (`T22 night mode=1`, `restored=0`), so the day palette was never exercised; Run 2 flipped with a bare toggle and read `T22 palette flip: night before=1 now=1`, and the `A_T22_flipped_palette_*` frames were night frames again; Run 3 paused following, toggled, kept and restored both - `T22 palette flip requested: night before=1 now=0 systemDarkModeEnabled before=1 now=0`, `painted bubble background #effdde`, `T22 night mode restored to 1 (was 1)`. Earlier in `2026/10/08/paint-the-ton-connect-card-balance-like-the-money-card` (`work/test.md`, Attempt 1, Run 2), on another checkout and branch: `S0 fixture: the run starts in the day theme - night=1`, the app following the Windows dark mode, the toggle refused and every capture night; its recovery paused `systemDarkModeEnabled` before each toggle and restored it after the theme restore, with overlay-local helpers. | Switch with `Test::AppendPaletteSwitch` and put it back with `Test::AppendPaletteRestore` (`test_palette.h`), never with a bare `ToggleNightMode()` or a settings snapshot written by hand. The switch takes the confirmation's route without the box - following paused only when `nightModeChangeAllowed()` reads false, then `ToggleNightMode()` and `KeepApplied()` - and decides `applied` from a live palette sample taken after it settled, which must differ from the sample before; a probe that reads the same in both palettes is refused `sample-unchanged`, and a request for the palette already committed is a no-op that succeeds. Treat a refusal as a fixture gate. Capture the variant in later stages and restore in a stage before teardown: the restore toggles the night mode back first, with following paused if it prevents the change, then restores the follow flag and saves the settings, and compares the settled sample, the night mode and the follow flag with the ones the switch found; the module's `Runner::onFinish` restores what a skipped stage left, without waiting for the palette (the `d->allThreads.isEmpty()` row below). Never synthesize the platform's reported mode or change the OS appearance. Confirm with `AppendPaletteSwitchSelfTest`, whose premise arm reaches the refusal - following on, a reported system mode, `nightModeChangeAllowed()` false and `windowBg` unchanged after a bare toggle - before its switch reads the other palette's shipped `windowBg` and its restore the starting one. |
| A colour check on a widget inside the Wallet window fails on pixels that are correct: the measured colour matches none of the expected `st::` values but is the Wallet palette's value of that very key - a focused import field's line measured `#32aaff` where the check expected `#6396cb` - while a colour read beside it, such as the error red, passes; unlike the settling row above, the reading is stable and repeats run after run | `Core::Sandbox::notify` (`core/sandbox.cpp`) wraps every `QEvent::Paint` of a widget in `style::main_palette::Override(Ui::WindowPaletteFor(widget))` while any window palette is registered (`Ui::HasWindowPalettes`), and `Ui::WindowPaletteFor` (`ui/window_palette.cpp`) answers the palette of the nearest window registered with `Ui::SetWindowPalette`. The registry is generic; the Wallet window is its only registrant today, through `Wallet::UseWindowPalette` (`wallet/wallet_palette.cpp`, called from `Wallet::ShowWallet` in `wallet/wallet_panel.cpp`), which gives each Wallet window its own `Wallet::WindowPalette` owner. Under an embedded theme everything in that window paints with its owner's palette, while a scenario that reads an `st::` colour outside a paint event gets the main palette's value of the same key; under a non-embedded theme the owner resolves no palette and the two agree. Observed in `2026/09/29/keep-the-focused-word-field-in-view-when-importing-a-wallet` (`work/test.md`, Run 1, Test 12, the T11 control): in the night theme the oracle demanded equality with `st::walletImportField.borderFgActive` read in the scenario, the main palette's `activeLineFg` `#6396cb`, while the live line was `#32aaff`, the Wallet palette's active line, so a correct non-error line failed; `activeLineFgError` `#ef5959` is the same in both palettes, which is why the RED rows beside it passed. | Resolve every expected `st::` colour inside `Wallet::WindowPaletteScope(widget)` - the product's own expression, generically `style::main_palette::Override(Ui::WindowPaletteFor(widget))` - before comparing it or handing it to a harness colour reader, and print both palettes' values in the details so a mismatch names the palette the pixels match. Copy each expected value as a `QColor` (`->c`) while the scope is open: `style::main_palette::Override` (`lib_ui/ui/style/style_core_palette.cpp`) swaps colours into the main palette's slots in place and its destructor swaps them back, so a `style::color` held past the scope reads the main palette again. Where the check is "not X", deciding by distance from the painted X rather than by equality with one other colour also keeps it palette-proof. The source task's Run 2 (`work/test.md`, Test 12 rerun of the control) repaired its control this way and passed, with details `paint(windowPalette=1): error=#ef5959 active=#32aaff ... main(windowPalette=0): error=#ef5959 active=#6396cb`. |
| A clicked button's measured fill matches no style constant, or `DeriveBand` returns `ok=0` with no rows for a widget plainly on screen | The reading was taken while the widget was still hovered by an earlier synthetic click, so it painted `textBgOver` where the check named `textBg`; before the input helpers delivered a leave this latched for the whole process. | Take the reading through helpers that leave the target pointerless (`Click`/`Drag` deliver a `QEvent::Leave`), and when a hovered reading is what is wanted, set the hover deliberately and name the fill the state actually implies. Confirm the instrument with the `test_hover.h` self-test. |
| Press-feedback frames after a harness press read zero changed pixels inside a ripple button - `changedPixels=[0,0]` in clocked frames about 40 and 120 ms after a `Test::Click` on a `Ui::RippleButton` - or show an arc entering from the button's edge instead of a disc around the press point | `Ui::RippleButton::onStateChanged` (`lib_ui/ui/widgets/buttons.cpp`) starts the press ripple at `prepareRippleStartPosition()`, which every class computes as the real `QCursor::pos()` mapped into the button plus its own offset, not at the point the harness pressed. The harness has no pointer, so the ripple starts where the owner's mouse happens to be, usually hundreds of pixels outside the button: its `anim::easeOutQuint` radius over `showDuration` has not reached the button's mask in those frames, or reaches it only as an arc, or the class's guard (`Ui::IconButton`'s ripple area) refuses the point and starts no ripple at all. Found in `2026/10/20/replace-sell-with-card-and-color-actions-on-the-wallet-gift-cover` (`work/test.md`, Run 2: two clocked frames on a 107x56 button read `changedPixels=[0,0]` in both themes; Run 3 repaired it only in its disposable overlay, with an `#ifdef _DEBUG` override of that button's `prepareRippleStartPosition()`); `2026/08/03/redesign-add-funds-and-buy-grams` and `2026/08/10/correct-streamed-draft-stop-colour-and-lookups` hit the same flaw earlier and moved the real cursor instead. | Press with `Test::ClickWithPressOrigin` ([input helpers](helpers/test_widgets.md#input-helpers)): it moves only the pressed button for the synchronous press, so the class's own `prepareRippleStartPosition()` reads the press point, with its own offset and guard, and the real cursor is only read. Read the returned `PressOrigin` with `PressOriginDetails` - `refusal=none`, `originSeen` equal to the point, `restored=1`, `cursorStable=1` - and treat a refusal as a fixture gate. Never move the real cursor with `QCursor::setPos` or a platform equivalent (it changes hover on the owner's desktop), and never override `prepareRippleStartPosition()` in an overlay. Expect the ripple without the hover highlight: the closing leave cancels it before it paints. Confirm with `AppendPressOriginSelfTest` (`test_press_origin.h`). |
| Every in-flight band reading reports `derivedOk=0 inkPixels=0` on a footer button while a restored or control band still measures | `st::defaultBoxButton` derives from `defaultLightButton`, whose `textBg` is `lightButtonBg`, and `lightButtonBg: windowBg` (`ui/colors.palette`) — the box's own background. `DeriveBand`'s premise is a row whose modal is the requested fill, so on that style the fill cannot be separated from the image outside the candidate. The old answer was the same empty `ok=0` as the hovered-fill row above, or as "no row of the recovered box has the pill fill as its own background". | Read `DeriveBand.reason`: when the fill is the surroundings it now says `the requested fill is the image's background outside the candidate, so no band can be derived`, distinct from the no-rows refusal. `MeasurePaintedInk.report` carries the same reason instead of a bare zero. Confirm with `AppendDeriveBandSelfTest`. Do not repair this as latched hover. |
| Emoji split or custom entity absent | UTF-16 code units or the wrong editor event route were synthesized. | Use grapheme-safe `TypeText` or one `CommitText` on the raw editor. |
| Drag/wheel/cancel has no effect | Wrapper received an event owned by a child, presentation, or viewport. | For drag and keys, target the real event owner. For a wheel, `Test::Wheel` now climbs to the consuming ancestor (the viewport, not the `QAbstractScrollArea`); if it still does nothing, read `WheelDelivery.refusal` instead of retargeting by hand. Confirm a wheel with `test_wheel.h`. |
| A wheel-delta oracle reads identical values before and after, on a widget plainly inside a scroll area | `Test::Wheel` sent a non-spontaneous `QWheelEvent` that Qt 6 does not propagate; a covering button ignores it and the scroll area never sees it. Delivering to the `QAbstractScrollArea` itself is the neighbouring trap: `event()` returns false without ignoring, so an acceptance check certifies a no-op. | Use the repaired `Test::Wheel`, which replays Qt's parent ladder or refuses by name. Do not treat `isAccepted()` on a scroll area as success. Confirm with the `test_wheel.h` self-test. |
| A drag out of a message list driven by `Test::Drag` starts no drag: `Window::MainWindow::launchDrag()` is never called and no mime data is formed, with no error and no refusal, although the press landed on a draggable item or selection and the moves went past `QApplication::startDragDistance()` | `HistoryInner::mouseActionUpdate()` (`history/history_inner_widget.cpp`) and `HistoryView::ListWidget::mouseActionUpdate()` (`history/view/history_view_list_widget.cpp`) turn `MouseAction::PrepareDrag` into `MouseAction::Dragging` once the pointer leaves the pressed item or passes the drag distance, and queue `performDrag()` with `InvokeQueued`, a Qt queued metacall. `Test::Drag` delivers the press, the moves, the release and its `QEvent::Leave` in one synchronous call and drains only `Ui::PostponeCall`s, so the release reaches `mouseActionFinish()`, which resets the action to `MouseAction::None`, before the queued call runs; `prepareDrag()` returns null unless the action is still `Dragging`, and `performDrag()` does nothing. `Info::Media::ListWidget::mouseActionUpdate()` (shared media) and `Dialogs::InnerWidget::mouseMoveEvent()` (dragging a chat onto a folder) queue their `performDrag()` the same way, and their releases clear the state it checks. This differs from the drag/wheel/cancel row above: there a wrapper received an event its child owns; here the event owner received every event and queued the drag's start past the release. Found in `2026/10/12/keep-the-forwarded-from-line-in-copied-message-selections` (`work/test.md`, Attempt 1, Run 1, the reconciliation item "T11 instrument"): its convergence note had assumed that settling after each move would run `performDrag()` during the moves, which is false, and the run drove T11's drag by hand. | Drive the drag with `Test::AppendQueuedStartDrag` (`test_queued_drag.h`): one stage that delivers the press and the moves exactly as `Test::Drag` does, waits, bounded, until an `InvokeQueued` marker posted to the target and a `crl::on_main` marker have run - so every queued call posted while the press and moves were handled, the queued `performDrag()` included, has run - and only then delivers the release and the same `QEvent::Leave`; read the returned `QueuedStartDrag` from a later stage and treat a `no-target`, `target-destroyed` or `bound-expired` refusal as a fixture gate. The helper intercepts nothing, so before any launch hook, in the overlay and as its first statement, the function whose `QDrag::exec()` the queued start reaches. For these lists that is `Window::MainWindow::launchDrag()` (reached from `ListWidget` through `WindowListDelegate::listLaunchDrag()`): record the mime data, run `ClickHandler::unpressed()` and the callback, and return before `QDrag::exec()`, as the source run's hook did. For a label's own link or selection drag it is `Ui::FlatLabel::executeDrag()` (`lib_ui/ui/widgets/labels.cpp`), which builds its own `QDrag`: record the mime data, run `ClickHandler::unpressed()` and return before `QDrag::exec()`. This is a safety rule for every queued start that reaches `QDrag::exec()`: without the hook that call starts a real platform drag. In Qt 6.11.2's sources, on Windows OLE's modal `DoDragDrop` loop asks `QWindowsOleDropSource::QueryContinueDrag`, which reads the real mouse buttons, not the synthetic release, so the loop runs until the release of the next real click and then drops the data at the real cursor, into whatever window is there; on macOS `QCocoaDrag::drag()` returns at once only while no real mouse event has reached the app (`QCocoaDrag::setLastInputEvent` never ran) and otherwise starts a real AppKit drag that follows the real pointer. Inside `QDrag::exec()` the event loop keeps turning, and `Runner::tick` has no re-entrancy guard, so the helper's release and every later stage would run inside it. No hover is needed before the press: both lists' `mousePressEvent()` sets `_mouseActive` before `mouseActionStart()` runs `mouseActionUpdate()`, so the `!_mouseActive && !window()->isActiveWindow()` gate does not stop it. The legacy list still clamps the points (the text-selection drag row below), so scroll them into its viewport first. The source run drove the same order by hand - a hover, then the press and six moves in one stage, a queued marker, the release and the leave once it ran - and T11 passed in both stacks (`marker=1 calls=1`). `Test::Drag` is unchanged and stays right for a drag whose effect is synchronous. Confirm with `AppendQueuedStartDragSelfTest`, whose `Test::Drag` control reads the release first. |
| A gesture on a widget that grabs the mouse on its press - `CollectiblesGrid`'s square drag, the reorder drag of `Info::PeerGifts::InnerWidget` - never starts or never ends: driven by `Test::Drag` or `Test::Click` the grabbing widget gets no move, the gesture ends at once or its release is treated as lost; or, driven by an overlay's raw `QWindowSystemInterface::handleMouseEvent`, every event was delivered and the item followed the pointer, but the animation the release starts completes only at teardown, when closing the window finishes it | `Test::Click`, `Test::Drag` and `Test::AppendQueuedStartDrag` send each event straight to the named widget with `QApplication::sendEvent`, so they bypass Qt's window-level routing: `QWidgetWindow::handleMouseEvent` records the pressed widget (`qt_button_down`), and `QApplicationPrivate::pickMouseReceiver` sends every held move and the release to `QWidget::mouseGrabber()`, else to the pressed widget. `CollectiblesGrid::mousePressEvent` (`wallet/wallet_collectibles.cpp`) grabs for a draggable square, and the squares forward only their press and release to the grid, so moves sent to a square never reach it; its `mouseMoveEvent` ends the gesture when the expected grab is not held, and its `mouseReleaseEvent` treats a release without it as lost. The raw-delivery signature is Run 1 of `2026/10/20/keep-wallet-gift-frames-sharp-on-high-dpi-screens` (`work/test.md`, Attempt 1): 38 events delivered with `handleMouseEvent<SynchronousDelivery>` on the Money panel's `QWindow`, then a bare `SettlePostponedCalls()` and a fixed 1200 ms wait; the 185 ms `DraggedGift` return the release started never completed, the square was restored only when closing the window ran `finishTravel()`, and no reading said whether the release reached the grid. Its Run 2 delivered every event inside `Test::Settle` and waited for an `InvokeQueued` and a `crl::on_main` marker before the release, and the return completed in 186 ms with 23 ticks; the two changes were applied together, so neither was isolated there. In both launches of task `2026/10/20/shield-console-input-and-drive-mouse-grabbing-widgets-through-qpa` (default and `QT_SCALE_FACTOR=2`) the self-test's probe completed its 200 ms release-started animation in 202-208 ms with 24-25 ticks on every leg - raw (no settle, no wait), settle only, wait only and both - so it did not reproduce Run 1's stall, establishes no cause and shows neither ingredient to be required. The helper keeps both, which cost nothing and match Run 2, without a claim that either was necessary. Each such overlay also wrote its own native-coordinate conversion, which lands off where Qt's conversion factor is not 1: on Windows it is the screen's DPI / 96, on macOS only `QT_SCALE_FACTOR`, whatever the Retina `devicePixelRatio()`. On that task's macOS Retina host the default launch read `devicePixelRatio()` 2 with factor 1, an identity on which the unconverted control lands on the requested point too and decides nothing; the `QT_SCALE_FACTOR=2` launch read DPR 4 and factor 2, and the helper's press and release landed exactly on the requested point P (0 px error, local and global) while the unconverted control landed 47 px from it on the larger axis, at P / factor. | Drive the gesture with `Test::AppendQpaMouseDrag` (`test_qpa_mouse.h`): one stage that delivers a left press, interpolated held moves (optionally paced) and the release through `QWindowSystemInterface::handleMouseEvent<SynchronousDelivery>` to the target's top-level `QWindow`, from points in the target's logical coordinates converted to native ones, each inside `Test::Settle`, waits, bounded, for the queued-work markers posted after the moves before it releases, and ends with no button, grab or hover; for single deliveries use `Test::QpaMouseSequence` and call its `end()`, from `Runner::onFinish` too. Read the returned `QpaMouseDrag` (the `QPA_MOUSE_DRAG` row) from a later stage: `pressReceiver`, `grabber` and `releaseReceiver` say where Qt routed the gesture, and a refusal - `no-window-handle`, `window-hidden`, `active-popup`, `blocked-by-modal`, `target-destroyed`, `bound-expired` or `unsupported` - is a fixture gate, never a pass. Wait for the animation the release starts in a later stage's pure `until`, with its own bound, and assert it in `then`: neither the settle nor the marker wait covers its timer. The helper never activates a window; call `ForceWindowActive` first, outside `Settle`, only when the widget's handlers need an active window. Its events are spontaneous and pass an armed console shield because they are delivered inside `Settle`. A gesture that reaches `QDrag::exec()` needs the hook the row above describes. Confirm with `AppendQpaMouseSelfTest` ([reference](helpers/test_qpa_mouse.md)). |
| Test reaches a real external action, or a fuse row prints a credential-bearing launch argument (a token URL) in full | Missing expectation/fuse or mock seam; a public `Test::ExpectBlockedLaunch` prints its argument in every fuse row. | Declare the exact blocked launch, mock the transport/payment boundary, and assert zero real calls. Declare an argument that carries a credential with `Test::ExpectPrivateBlockedLaunch(argument, label)`: it matches exactly and every fuse row prints only `private:<label> <scheme://host>` (see [private expectations](helpers/test_launch_fuse.md#private-expectations)); never patch the fuse in an overlay. |
| Pixel probe misses only on Retina or at 125/150% | Logical rect indexed into the device-pixel grab, or a 100% literal reused at another interface scale. | Multiply by the image `devicePixelRatio()` once at the sampling boundary; derive expectations from the live scaled tokens. |
| Geometry oracle fails on plausible-looking rects | Rects from different widgets compared without a shared origin. | Map both through one declared frame (`Ui::MapFrom`, `mapToGlobal`) and log the mapped values in the failure details. |
| Process dies after `TEST_COMPLETE`, with no assertion line and often a 0-byte dump | Overlay teardown, not the product: a leaked scenario `State` still holds `rpl` subscriptions to session-owned streams while `~Main::Session` destroys them. | Destroy the scenario's lifetimes, release its watchers and null every raw cross-stage pointer from `Runner::onFinish` — a teardown stage is not enough, because a timed-out stage or the watchdog skips every stage after it. |
| `Telegram finished, result: 0` then `QObject::~QObject: Timers cannot be stopped from another thread`, with or without a fresh dump or a nonzero exit after it | An armed timer outlived the application: Qt's `QObjectPrivate::~QObjectPrivate` prints this warning for a `base::Timer` destroyed while still running after `QApplication` died, for example during static destruction after `main` returned. Sources include the product's accessibility focus manager - the function-static `FocusManager` behind `Ui::Accessible::Manager()` in `ui_accessible_widget.cpp`, whose cleanup timer is armed for five seconds after an accessible widget with a focus policy registers - and a scenario-owned `base::Timer` in a static or leaked `State`. The warning names no object, so its text alone does not tell which timer it was. `base::Integration` now clears its registration when `Core::Launcher` destroys it, so the later `base::LogWriteMain` call from the `Core::Launcher::initQtMessageLogging` handler skips the message instead of reaching the destroyed integration, while Qt's default output (stderr with `QT_FORCE_STDERR_LOGGING=1`, otherwise the debugger output on Windows) can still show the warning. | Judge the run by its exit, not by the warning: a normal zero exit with no death signal is not a crash merely because of this warning. A fresh dump, a nonzero exit or a forced termination needs its actual stack or report. When the scenario owns a timer, still cancel it (and destroy lifetimes / null cross-stage pointers) from `Runner::onFinish`; do not rely on a teardown stage, which timeout and the watchdog skip. |
| `SCENARIO_RESULT` and `TEST_COMPLETE` are written, then the process dies: `test-run` reports `died-after-complete` (exit `-11`), the crash report reads `Assertion: Unexpected: Qt FATAL message was generated!`, `QtFatal: ASSERT: "d->allThreads.isEmpty()" in file .../qthreadpool.cpp, line 462` and `Caught signal 11 (SIGSEGV)`, and the Crashpad dump has the main thread in `QThreadPool::~QThreadPool` under `QGuiApplication::~QGuiApplication` while a `crl` thread waits in `QPainter::drawImage` under `Ui::CacheBackgroundByRequest` | A main-window geometry change made just before quit - from `Runner::onFinish`, or from the last stage, after whose `then` `Runner::completeStage()` calls `finish()` at once (`test_runner.cpp`) - on a chat background that is not a plain colour. The next chat paint at the new size hands that area to `Ui::ChatTheme::backgroundState()` (`Window::SectionWidget::PaintBackground` in `section_widget.cpp`), which schedules a re-cache 200 ms later (`kCacheBackgroundFastTimeout` in `ui/chat/chat_theme.cpp`); `cacheBackgroundAsync()` runs `CacheBackgroundByRequest()` on a `crl::async` thread, one `QPainter::drawImage` per tile (its `drawTile` lambda), and Qt 6.11.2's `QT_THREAD_PARALLEL_FILLS` (`qdrawhelper.cpp`) splits each large blend from a thread outside Qt Gui's thread pool into tasks on that pool, waiting on a `QLatch`. `Runner::finish()` quits `kFinishDrainDelay` (500 ms, `test_runner.cpp`) after its `onFinish` callbacks. `~QGuiApplication` waits for and deletes the pool (`qguiapplication.cpp`); `~QThreadPool` waits again and asserts `d->allThreads.isEmpty()` (`qthreadpool.cpp`), but `waitForDone()` waits only until the pool was idle once (Qt's comment there: “New jobs might have started during reset”), and the painting thread's next blend refills it. `Q_ASSERT` is compiled out under `QT_NO_DEBUG` (`qassert.h`), so it is the Debug build's Qt that asserts. The two rows above and the “Scenario teardown before quit” rule are about releases, which `onFinish` must own; a geometry change releases nothing and starts asynchronous painting, which `onFinish` must not start, because `finish()` quits only `kFinishDrainDelay` later. Unlike the first of those rows, this death names an assertion and leaves a real dump. The row names the scenario's late geometry change as the trigger and neither claims nor rules out a product quit-time race. Observed in `2026/10/06/fit-the-rich-article-width-and-last-line-to-the-bubble` (`work/test.md`, the A-only launches of Runs 1 and 2; stack in `evidence/run-1-2-aonly-shutdown-stack.txt`). | Make the change in a teardown stage while the runner is still stepping: `run` sets the geometry (in the source run, back to the start geometry) and `until` waits until the window has it plus 1.5 s; keep releases in `onFinish`, as the two rows above require. Like every teardown stage it is skipped after a stage timeout or the watchdog, and that path was not exercised. Repaired that way from Run 2's B-only launch of the same campaign: without it 2 of 5 launches died this way (both A-only launches, not Run 1's FINAL and B-only or Run 2's FINAL), and with it both launches exited 0 (Run 2's B-only and Run 3's FINAL); 1.5 s is what held there, not a measured bound. The stack, not the launch count, ties the death to the late geometry change. |
| Media reading frozen at position `0`, with the length equal to the document's declared duration | Undecodable fixture document — often a synthetic upload left on the shared test account — accepted on metadata alone; the app debug log shows `Streaming Error: Error in avformat_open_input`. | Select the fixture with the playability probe: play each candidate and accept only one whose position strictly advances, then reuse that document everywhere. |
| A premise fails against a row its own fixture had to create, or a check passes without ever reaching its subject | The oracle read the probe's whole history, or bracketed a slice by wall time, so rows from an earlier stage or a slow neighbouring surface answered it. | Record through `Test::Probe`, take `mark()` immediately before the action, and query only `...Since(mark)`; there is no whole-history accessor to fall back to. |
| A sweep reports a confident `found=0` that no repair ever changes | The enumeration structurally cannot reach the subject, so the zero was guaranteed before the run started and measures nothing. | Count through `Test::DiscriminatingScan` and feed it a known-present control; `report()` refuses to certify a zero the walk cannot tell from absence. |
| A wallet settle that "completed" while nothing was refreshed, read later as a stamp age equal to the observation's own timestamp | `Wallet::Session::refreshHistory(done)`'s callback says nothing about the server's wallet state: it runs at once when the presence is not `Ready` or the lane is paged, and otherwise queues on `_historyDone`, which `finishHistoryWaiters()` drains when the `wallet.getTransactions` it issued answers or fails — a transaction-history round trip that stamps `_historyRefreshedAt`, never `_stateRefreshedAt`, which only the state lane writes — `applyState()`, and `applyEngineUpdate()`, which cannot run while the engine holds no client. The queued callback is not even guaranteed a round trip of its own: `requestTransactions()` issues nothing while one is already in flight, so the drain then comes from that other request, and `setPresence()` drains the same queue with no round trip at all on any transition away from `Ready`. So a completion certifies no wallet-state freshness stamp; an unwritten stamp then reads `crl::now() - 0`. | Gate on the state, not the callback: `Test::WalletRefreshSettled` over `Test::ReadWalletRefresh`, which reports a never-written stamp as `unstamped` and never as ready. A refusal there is a fixture gate — a harness or environment `TEST_FLAW`, never a product `FAIL` — unless the diff under test touches the wallet state lane itself, which is exactly `refreshState()` / `requestState()` / `applyState()` / `applyUpdate()` / `clearNetworkState()` and nothing wider, in which case the readiness condition is the behavior under test and the refusal is a product `FAIL`. |
| A funded-wallet leg gated off by `signingIsServed=0` (the fixture's phrase does not sign for the served key) while the device's current custody record signs for the served key and the address gate passed | The golden `test_gram_account.txt` predates later rotations of the golden wallet: a campaign rotated the key and was cut off before `RewriteGramAccountWords`, or the file was restored from an older copy. The fixture is stale, not the product. | Run the P0 helper right after the address gate - `Test::AppendGramReconcile` / `Test::ReconcileGramAccount` (`test_gram_reconcile.h`) - and gate the funded legs on `GramReconcileResult::reconciled()`; it rewrites the file from the local reveal (case (b)) or refuses by a named gate. Never hand-roll the reveal. |
| A Money-window controlled send's press stage times out with `send-job-queued` and no `send-job-entered`, the engine worker reading `started > finished` (`worker=[queued=4 started=11 finished=10]`), while the Debug log shows a registered `toncenter.performApiRequest` that is never answered and is cancelled exactly when its 15 s timeout expires; or, at teardown, `wallet.sendTransfer data_normal` followed by `adding request to toSendMap`, answered 400 `WALLET_TRANSFER_SEND_FAILED` | Suppressed, unanswered provider calls each hold the single engine worker in `StatuslessHost::execute_statusless` until their 15 s timeout - the send box's comment-recipient resolution and its three retries 1 s apart, the fee preview, and the fixture's first collectibles poll (`refresh_nfts`) - so a later press queues behind all of them. The teardown case is a fixture that disarmed before the queued send's routed `wallet.sendTransfer` was issued on main, so nothing intercepted it. Observed in `2026/10/02/keep-the-sending-row-one-stable-row-until-the-final-row` (`work/test.md`, Run 1), after four gram-wallet campaigns had each repaired the stall by hand, differently. | Use `test_wallet_intercept.h`: `AppendWalletEngineDrain` before every send box (it leaves the release on through the box and the press), `CheckNoEarlierProviderCallHeld` at the press, `teardown()` (seal first) from the teardown stage and again from `Runner::onFinish`, and the fixture route fixed when the send is queued. Never wait the provider timeouts out; that is the forbidden technique. Confirm the instrument with `AppendWalletInterceptSelfTest`. |
| A hand-rolled secrecy scan reports a confident zero while it read no app log and no `DebugLogs` part, or reports "leaks" of short secrets or phrase words that the client never wrote; or `CheckSecrecy` fails `no client-written fixture secret` on a plain-line short-secret hit that is a value the product computed and logged itself | Four traps: (1) selecting logs "modified since the scenario started" picked no app log or `DebugLogs` part on Windows, because a file the running process holds open keeps its old last-write time; (2) matching a short secret as a plain substring over the very large number of lines in a campaign's MTP dumps gives coincidental hits inside longer, unrelated values; (3) even a bounded match inside a dump can be content that the server sent (`Recv`), not anything the client wrote; (4) a value the product computes and formats into its own diagnostic line can equal the short secret, which a bounded count alone cannot tell from a leak. `Test::CheckSecrecy` and its checks for (1)-(3) come from `2026/09/25/add-fixture-reconciliation-and-secrecy-scan-helpers-to-the-harness`, its plain-line site report and declared computed fields for (4) come from `2026/09/27/report-the-site-of-short-secret-hits-in-the-secrecy-scan`, and its carried transport lines for (4) come from `2026/10/13/keep-the-secrecy-scan-from-counting-a-coincidental-transport-number`. | Call `Test::CheckSecrecy` (`test_secrecy_scan.h`): it selects by identity (the part's day index, `Logs::full()`), counts only bounded occurrences of a short secret, decides on plain lines and `Send` entries only and reports `Recv` hits by schema site and every plain-line short-secret hit at its `<file>\|<head>\|<field>` site, and refuses an undecided class. For (4) on a line with `name=` fields, confirm from the site row and the product source that the field is formatted from a value the product computes, never from fixture input, and declare that head and field in `SecrecyScanArgs::computedFields`: the hit moves to `SECRECY_COMPUTED` and no longer decides. For (4) on a product line with no `name=` field, nothing can be declared: the scan already reports an exact hit on a carried transport line's computed number in `SECRECY_COMPUTED`, and any other such hit follows the next row. Never settle it by reading the matched line. Confirm the instrument with `Test::AppendSecrecyScanSelfTest`. |
| `<what>: no client-written fixture secret` fails with a `plainSites` entry in a `DebugLogs/log_HH_MM.txt` part on a product diagnostic line with no `name=` field: the withheld `DebugLogs/log_HH_MM.txt\|?\|?`, or a carried transport line's `<file>\|<head>\|-` or `<file>\|<head>\|<slot>` | Such a line has no site a campaign could declare. The scan carries the MTProto transport's integer-only `DEBUG_LOG` lines itself (**Plain-line sites**, **Declared computed fields**), so an exact hit on one of their computed numbers is already in `SECRECY_COMPUTED` and does not decide. A hit that still decides is one the rule does not exempt: part of a value (the digits under a minus), the line's head or other text, the suffix's line number, a number read from the server, or a line the scan does not carry or whose shape differs from its format. | The FAIL stands: the harness has no sanctioned way to call it a coincidence. A deciding `<head>\|-` or `<head>\|<slot>` site on a carried line is not an exact hit on a computed number. A withheld site does not say why it was withheld - the line may not be carried, its shape may differ from its format, or its head and slot name would have printed a given secret - so it never proves that the line is missing from the carried table. Carrying another product line is harness work decided from the product source alone, never from a matched line: its exact format, source file and function, and the source reason each of its numbers is computed, added to `TransportLines()` in `test_secrecy_scan.cpp`, with synthetic cases in the `secrecy_self_transport` stage of `Test::AppendSecrecyScanSelfTest`; a number whose origin is uncertain, or that is read from the server's bytes, stays deciding. **Forbidden:** a `computedFields` declaration for such a line (it matches no printed site), rewriting a product line into `name=` form or moving product lines out of the scanned logs, carrying a harness-written or overlay row (its numbers take `Test::TelemetryNumber` and `Test::RequestTelemetryNumbers()`, the two rows below), and settling the hit by reading the matched line. Confirm the classification with the `secrecy_self_transport` stage. |
| `<what>: no client-written fixture secret` fails with a `plainSites` entry in the test log - `SECRECY_CLASS: TestLog ... plainSites=[test_log.txt\|NOTE: <head>\|- x<n>]` - on the overlay's own row head, with field `-` (or that field's name when the number is a field's whole value; a row with no `name=` field shows the withheld `test_log.txt\|?\|?` instead) | A bounded digit run inside a number the overlay formatted equals a short secret by coincidence. An ordinary decimal leaves every digit run bounded by `=`, `-`, `.` or a blank - in `value=-4821.75` both `4821` and `75` are bounded - so any of them can equal a short secret, and the more values a run prints, the likelier that is. The hit is part of a value, so its field is `-`. A declared computed field cannot exempt it: overlay telemetry is not a value the product computes, and a hit in part of a value still decides (**Declared computed fields**). | Print every number the overlay measured or computed into a scanned log with `Test::TelemetryNumber(value, decimals)` (`test_log.h`), the rule from `2026/10/08/give-overlay-telemetry-a-number-format-the-secrecy-scan-cannot-count`: a `p` for the point, so every digit run touches a letter - `-4821.75` prints `-4821p75` and `42` prints `42p` - and no digit run is ever bounded. Choose `decimals` per quantity, never from a secret; a judge script reads a value with `float(v.replace('p', '.'))`. A `TelemetryNumber` is a word to the phrase matcher - it ends a word run where a bare number is neutral - so never print one as a list index or between words copied from product or fixture text; keep such text out of telemetry rows. Within those limits, changing only how measured numbers are formatted cannot remove a real short-secret leak at that site, so a scan that passes after only the format changed, with its word-run and token counts unchanged, has told a coincidence from a leak. Never exempt the hit (a `computedFields` declaration for the overlay's own row, or a filter), move telemetry out of the scanned logs, choose a format from a secret, pass a fixture secret or a number read from one through `TelemetryNumber`, or settle the hit by reading the matched line. Confirm the rule with the `secrecy_self_telemetry` stage of `Test::AppendSecrecyScanSelfTest`. |
| `<what>: no client-written fixture secret` fails with a `plainSites` entry in the test log on a shared helper's row rather than on the overlay's own: a `GEOMETRY: <name>:` head (from `LogGeometry`, a capture helper or a saved `PreparedWidgetCapture`), a `NOTE: <name>:` head of a `kind=post`, `kind=stop`, `kind=frame` or `examined=` row, a probe check's details, a clocked gate or refusal row, or the withheld `test_log.txt\|?\|?` of a row with no `name=` field, such as a `CheckNear` verdict | A bounded digit run inside a number the helper measured, counted or timed equals a short secret by coincidence, exactly as in overlay telemetry: the helper printed ordinary decimals because the run did not ask for the telemetry format or because the helper is not converted. The overlay cannot reformat the row without reimplementing the helper, which the reuse rule forbids (an overlay that reimplements a shared facility is a test flaw), and a declared computed field cannot exempt it: a helper's number is not a value the product computes, and a hit in part of a value still decides (**Declared computed fields**). | **Converted helper, run did not ask** - the row is one the `test_log.h` (`TelemetryNumber`, `RequestTelemetryNumbers`) catalog row lists, and no `TELEMETRY_NUMBERS: requested` line precedes it: call `Test::RequestTelemetryNumbers()` (`test_log.h`) unconditionally at the campaign's first stage and re-run. Changing only the number format cannot remove a real short-secret leak at that site, so a scan that passes after only that change, with its word-run and token counts unchanged, has told a coincidence from a leak. When the run asked and the hit is still on a converted row, it lies in caller text (a probe row, a check's `what`, a scan detail), which the caller formats like its own telemetry, or in a text the helper formatted before the ask, such as a kept `RoundTrip::observation`; ask at the first stage. **Helper not converted** - for example `PostPaintSampler::details()`, `test_capture`'s own readings, `test_runner`'s rows or any other module's rows: convert that helper the same way, as harness work - a pure formatter taking a `NumberFormat` that its logging path calls with `HelperNumberFormat()`, its case in the `secrecy_self_helper_numbers` stage of `Test::AppendSecrecyScanSelfTest`, and its README grammar in both formats. A local copy of the helper is never the repair. **Forbidden:** everything the overlay-telemetry row forbids - exempting the hit (a `computedFields` declaration for the helper's row, or a filter), moving telemetry out of the scanned logs, choosing a format from a secret, passing a fixture secret or a number read from one through `TelemetryNumber`, and settling the hit by reading the matched line - plus a local re-implementation of the helper, and asking for the format under a condition or from code that read a fixture secret. **Caller numbers:** `CheckNear`'s `actual`, `expected` and `tolerance`, `Probe::checkCountSince`'s `expected` and `RunClockedFrames`' `elapsed` and `animationEnd` print in the requested format too, which hides digits from the scan, so they must never be a fixture secret or a number read from one. Confirm the route with the `secrecy_self_helper_numbers` stage of `Test::AppendSecrecyScanSelfTest`. |
| A green log that does not say what its checks were made against, so a passing run cannot be audited after the fact | The reading was handed to `Test::Check` as `details` back when `details` was written only on the failing branch, or worked around by folding it into `what` or by emitting a `Note` beside the check that a reader then has to re-correlate by position. | Pass the reading as `Check`'s third argument: it is printed on the passing verdict too, as `TEST_RESULT: PASS: <what> - <details>`. Keep only failure-only text behind `ok ? QString() : ...`, which still prints the bare passing line. |
| A round trip reported as a negative or otherwise impossible number, or a pair count that does not match the issue count | Two lists were related by position - an issue list against an answer list, or a row list against a parallel `crl::time` vector indexed at `mark + i` - so one extra or missing element on either side paired a row with another row's time, and the reading was emitted as a `Note` that failed nothing. | Record both sides into one `Test::Probe` with `recordIssue`/`recordAnswer` and read them through `checkRoundTripSince(mark, key)`: it pairs by key, discards and names every answer not strictly later than its issue, and refuses as a FAIL carrying the tallies rather than reporting an interval it did not positively pair. Read a bare time through `timedRowsSince`, which carries each plain row's own time. |
| A capture or `captureWidget` stage times out and its details carry `render root paints no background of its own: ... - grab N...BoxLayerWidget... instead (unpainted 0/1000)` | The render root was the box, and that box had cleared `Qt::WA_OpaquePaintEvent`. `Ui::BoxContent`'s constructor sets that attribute, so a plain box paints its own background and is accepted - but `setNoContentMargin(true)`, which 53 product call sites use, clears it again, and then the box paints no background of its own and `PreparedWidgetCapture::prepare()` refuses every frame it is offered; the poll can only end in a timeout. | Resolve the root with `Test::PaintingLayerRoot(box)` and capture the `Ui::BoxLayerWidget` it answers — `Test::CaptureBoxLayer(box, name)` is that whole-shell grab, including `_title` and the `addButton` footer row parented onto the shell — or use `Test::CaptureInLayerRoot(box, name)` for a frame cropped to the box content (it composes `CaptureMappedRect`, so a box that maps outside its layer is still a named FAIL). The refusal is naming the right widget - do not widen it. |
| A menu capture times out with `showingContent=0` in its last state, or the popup vanishes mid-stage; or, on a locked Windows console, `capture painted widget: <name>` times out with `last state: target is not visible: class Ui::PopupMenu ...` right after the stage that opened the menu passed | The readiness waited on the inner `Ui::Menu`'s visibility. `Ui::PopupMenu::startShowAnimation()` calls `hideChildren()`, and the children come back only from the final `paintEvent`'s `Ui::PostponeCall` - a side effect no `-testagent` run is guaranteed to reach - so the wait can last until the popup dies of a focus-out. A one-shot grab in the turn that opened the menu is the opposite failure: it lands on a show-animation frame with nothing drawn. A locked Windows console is a diagnosed cause of its own: the app is deactivated, so Qt closes a shown `Ui::PopupMenu` before the next turn - `QApplication::notify` closes every open popup on `QEvent::ApplicationDeactivate` (Qt 5.15.19 `closeAllPopups()` in `qapplication.cpp`) - and `CapturePopupMenu`, which needs the menu open across turns, times out on `target is not visible`; `Test::OpenContextMenu` still reads the menu in the turn that built it. Observed in `2026/10/07/add-a-same-turn-context-menu-reader-and-a-retried-clipboard-round-trip-to-the-test-harness` (`work/test.md`, Attempt 1): in Run 1 `popup menu self-test: open` passed 6/6 and `capture painted widget: popup_menu_open` timed out, which ended the scenario before the self-test's five later stages, while the reader's positive arm read `appState=active` at build and `visible=0 hidden=1 activePopup=none ... appState=inactive` one turn later and the reader's self-test passed 22/22; Run 2, the popup-capture self-test alone on the same locked console, reproduced the timeout; Run 3, unlocked, passed both frames. | Capture with `Test::CapturePopupMenu`: its readiness carries content identity only - the menu exists, is visible, has non-empty geometry and carries actions - and the prepared capture's own blank-frame refusal decides when the frame is good. `showingContent` belongs in the details, never in the gate. Do not use `Test::PaintingLayerRoot` on a popup: it sets `Qt::WA_NoSystemBackground`, so the blank-root refusal never applies, and it is its own window. On a locked Windows console, read the console with `Test::ReadConsoleLock()` (`test_console_lock.h`) and gate the stages that need the menu open across turns through `CapturePopupMenu`'s `skipReason` (`[] { return Test::ConsoleLockGate(Test::ReadConsoleLock()); }`). `AppendPopupMenuCaptureSelfTest` does exactly that: its `open` stage Notes the `CONSOLE_LOCK` row it read right before it popped the menu; the `popup_menu_open` capture, `close`, and the `popup_menu_reopened` opener and capture are `TEST_RESULT: N/A` naming the lock and printing the reading, read when each begins and kept once locked, because a menu popped or held while the console was locked is already closed; and `open` (decided from the opening turn), `refusal text` and the teardown run and decide, so the scenario continues past it. The rule: for these arms a locked console is a scheduling condition - rerun them on an unlocked console. This applies to Windows: on macOS a packed launch with `CGSSessionScreenIsLocked` true ran `AppendPopupMenuCaptureSelfTest` with 0 FAIL (`2026/10/06/add-a-post-paint-capture-sampler-to-the-harness`, `work/test.md`, Test 2) - a locked macOS console does not close the popup - so `Test::ConsoleLockGate` answers only in a Windows build: on macOS the probe reads the lock and the `open` stage prints it, and no gate fires there. The gated rows are `skipReason` N/A rows rather than a hard `fixture gate:` `Check` like this self-test's translucency premise (the `AppendSeparatePanelWalkSelfTest` row below): a host without translucent windows can never certify that premise, so a skip there would withdraw a certification the host can never give, while a locked console is a scheduling condition on a host that certifies the capture once unlocked (Run 3); the harness already skips `AppendMainWindowNotMarkingReadSelfTest`'s deciding half when its control cannot read `markingAsRead` true on a locked console the same way; a `Check` could not stop the next stage from timing out; and an N/A row never counts as a pass, is counted in `SCENARIO_RESULT`'s skipped clause and names the lock and the probe reading. |
| A context menu is never observed: an overlay delivers a `QContextMenuEvent` and polls on later event-loop turns for a visible, ready `Ui::PopupMenu`, and finds none for any target, the controls included - `popup=0 actions=[]` on `HistoryInner`, `HistoryView::ListWidget` and `Iv::Markdown::MarkdownDocumentWidget` alike, `elapsedMs~3020` per chat-list leg, for an ordinary keyboard URL button and a plain paragraph as well | Observed in `2026/10/07/show-url-tooltips-and-copy-link-on-rich-message-url-buttons` (`work/test.md`, Attempt 1 Run 1, Tests 2-4); its app log showed the main window re-activated once per menu leg. Each product handler builds its menu synchronously, inside the event, as a child of the widget that received it - `HistoryInner::showContextMenu` (`base::make_unique_q<Ui::PopupMenu>(this, ...)`), `ListWidget::showContextMenu` through `FillContextMenu(this, ...)` (`base::make_unique_q<Ui::PopupMenu>(list, ...)`) and `MarkdownDocumentWidget::contextMenuEvent` (`_contextMenu = base::make_unique_q<Ui::PopupMenu>(this, ...)`) - so the menu exists in the turn of the event; on that unattended console it was gone before the first poll, and the run did not diagnose why. Nothing guarantees that a popup outlives its turn: `Ui::PopupMenu::focusOutEvent` hides it once focus leaves its focus chain, `QApplication::notify` closes every open popup on `QEvent::ApplicationDeactivate`, and a menu left at `deleteOnHide(true)` then `deleteLater()`s from `hideEvent` - candidate routes, not a diagnosis. | Read the menu in the turn that built it with `Test::OpenContextMenu(receiver, point)` (`test_menu.h`): it snapshots every live `Ui::PopupMenu` in the application, sends the event inside `Test::Settle` and, in that same call, takes the one new menu - its ordered action texts and its lifecycle at build and after the postponed calls settled - or refuses by name (`no-menu`, `several-menus`, `receiver-gone`); trigger an entry with `Test::TriggerContextMenuAction`, which delivers its queued `Ui::Menu::CreateAction` callback before it returns. Run 2 of the same campaign decided every menu leg on four surfaces by reading in the building turn, `built=1 fresh=1` and `ready=1` at build. A `no-menu` reading counts as a product result only beside a positive control that the same helper built in the same widget - the source run's ordinary URL button and plain paragraph on the chat lists, and its Docs button in the window and the box (`a window / box no-menu reading is N/A by name unless the Docs control was built in the same widget`). A frame stays with `Test::CapturePopupMenu`, a supplementary leg taken only while the menu is still open. Confirm the instrument with `AppendContextMenuReaderSelfTest`. |
| A chat-list context menu read with `Test::OpenContextMenu` belongs to another message: readings for different target messages carry identical action lists, each `built=1` with no refusal, built with `atBuild={... appState=inactive activeWindow=none}`; or a "Select" triggered from such a reading selects another message - `selectedCount=1` while the target's own selection circle is empty | `HistoryInner::showContextMenu` and `HistoryView::ListWidget::showContextMenu` resolve a Mouse-reason event's point with `mouseActionUpdate(e->globalPos())`, and both lists' `mouseActionUpdate()` (`history/history_inner_widget.cpp`, `history/view/history_view_list_widget.cpp`) returns at once while `!_mouseActive && !window()->isActiveWindow()` - `HistoryInner`'s also while `hasPendingResizedItems()`, for its history or the migrated one. `_mouseActive` starts false, and only `enterEventHook`, a press or a move whose global position really changed sets it. So with the mouse not in the list and its window inactive, the menu is built from what the last successful update left: on `HistoryInner` `Element::Moused()`, `Element::Hovered()`, `Element::HoveredLink()`, the active click handler and `_dragStateItem` (its plain branch takes Hovered, else HoveredLink, and with neither still adds "Select" for `Element::Moused()`); on the `ListWidget` `_overElement` and `_overItemExact`. A leave does not drop that stale target: `HistoryInner::leaveEventHook()` clears `Element::Hovered()`, the active click handler (`ClickHandler::clearActive()`) and `_mouseActive`, and keeps `Element::Moused()` and `_dragStateItem`; `ListWidget::leaveEventHook()` clears the active click handler and `_mouseActive` and marks `_overState.pointState` `Outside`, and keeps `_overElement` and `_overItemExact`. `Test::OpenContextMenu` compares nothing with the target and neither refuses nor flags a menu built in an inactive window, so the wrong reading has the same texts, `built=1` and no refusal as a valid one. Observed in `2026/10/12/recognize-tgw-widget-documents` (`work/test.md`, Test 25 in Runs 1-3 and the selected-state leg of Test 22 in Runs 1-3; the recovery-plan rows "T25 menus" of Run 1, added after Run 2, and "T25 / T22 selected" of Run 2), on Windows: in Runs 1 and 2 the `bad`, `ask-cold`, `notes.txt` and own `widget` file menus on `HistoryInner` were built with `appState=inactive` and read the same action list as the earlier `cold-small` target, while the uploading, `cold-small` and `ListWidget` readings, built with `appState=active`, stood; Run 1's Test 25 was first written as a PASS and re-assessed only while Run 2 was assessed; and the "Select" from the own `widget` file menu selected another message (`selectedCount=1` while the card's own selection circle in Run 2's `A_T22_selected_widget.png` is empty). Run 3 called `Test::ForceWindowActive` in the same synchronous block as `OpenContextMenu` and checked `Element::Moused()` against the target: every reading read equal ids (`moused=762303:122213 target=762303:122213` for the first) and "Select" selected exactly the target (`selected=[762303:122197] target=762303:122197`). | Read a chat-list menu with `Test::OpenChatListContextMenu(list, target, point)` (`test_chat_menu.h`) and trigger only from a reading whose `built()` is true, in the same turn. It opens the gate for its own call with a `QEnterEvent` rather than by activating the window - activation runs `Window::MainWindow::handleActiveChanged`, which can mark the shown messages read (`Histories::readInboxTill` aborts on a harness-injected regular item whose id is no server id: the `markingAsRead=1` row below) and requests an online-status update - delivers through `Test::OpenContextMenu` with an at-build observer, always ends with a `QEvent::Leave`, and accepts the menu only when the gate was open at delivery, the view the list resolved at build is its own view of the target, every candidate a menu entry takes its message from names the target or nothing, and the menu is the list's own `_menu`. Anything else is a named refusal - `wrong-target` names the message the list resolved - whose menu is hidden and whose `TriggerContextMenuAction` refuses `menu-gone`. Do not read `Element::Moused()` or `_overElement` as hover after the leave: they keep the last resolved view. `Test::OpenContextMenu` stays the reader for every other widget. Confirm with `AppendChatListMenuSelfTest`, whose premise arm reaches the failing shape on both lists - A resolved last, the mouse outside the list, the window inactive through `Test::ClearWindowActive`, and an unprotected `OpenContextMenu` at B's point that the list resolved to A or to none - before its protected reading for B and the "Select" from it leave exactly B selected. |
| `TriggerContextMenuAction` refuses `no-such-action` for a row the menu plainly shows - its reason lists the menu's texts with an empty entry where that row sits - or a lookup by the row's visible label finds nothing | Not the product: the row is a custom `Ui::Menu::ItemBase` that keeps its label and callback on itself. `AboutAction` (`ui/boxes/peer_qr_box.cpp`) owns a dummy `QAction` with no text, paints its text and about line itself, answers `accessibilityName()` with `<text>, <about>`, and connects its callback to that dummy action with `ItemBase::setActionTriggered`. `TriggerContextMenuAction` matches `QAction::text()` only, so the refusal is correct. Retrying with an empty text is no repair: beside another such row it is ambiguous, and otherwise it triggers the dummy action directly instead of through the row; an index or a prefix of the name is no identity either. Observed in `2026/10/17/open-contact-links-with-payment-free-codes` (`work/test.md`, the Run 9 refusal and the Run 10 recovery through a disposable typed lookup and bounded Down/Return keys). | Read the row with `Test::ReadMenuItem(popup, fullName)` - for a context menu `reading.menu.data()` from `OpenContextMenu` is the popup - by its whole accessible name, and activate it with `Test::ActivateMenuItem(reading)` in the same turn. It sends real `Qt::Key_Down` and one `Qt::Key_Return` through `Test::PressKey` to that exact popup and refuses `menu-gone`, `menu-replaced`, `item-gone`, `item-stale`, `several-items`, `item-disabled` or `not-selected` instead of binding a same-named replacement. `activated()` says only that Return was sent: assert the product outcome itself in a later `then` or bounded wait. Keep `TriggerContextMenuAction` for ordinary entries. Confirm with `AppendMenuItemActivationSelfTest` ([accessible custom rows](helpers/test_menu.md#accessible-custom-rows)). |
| A stage times out although its own details show every precondition met and the action already fired - for example `box=1 toggle=1 popups=0` after a click on a control in a freshly shown layer | One synthesized click on a control in a layer that is still settling intermittently does not land, and nothing observes that until the stage's 10-second timeout ends the whole scenario. The input helpers are not at fault: `Test::Click` and `Test::Drag` deliver press, release and a `QEvent::Leave` synchronously and drain every `Ui::PostponeCall` before returning. | Make the click self-correcting in the scenario, not in the helper: read the effect, click the same `QPointer`-guarded widget once more if it did not appear, and `Note` which attempt worked so the flake rate stays visible. Establish first, from the production callback, that a repeat is provably a no-op - the details-menu toggle's first statement is `if (*menu) { return; }`. |
| A focus-routed affordance produces nothing at all — a submit that formed no request, a field that never took focus, `focused=0` / `isActiveWindow=0` — with no error and no event, especially on a locked console or on macOS after a default `test-run` launch, which does not activate the client there | The platform window is not active - which is what makes `QWidget::isActiveWindow()` false, because it falls back to `QPlatformWindow::isActive()` (`qwidget.cpp`) - so `QWidget::setFocus()` never promotes the target to `QApplication::focusWidget()`; clearing only the QPA focus window does not reproduce it where the OS window is still active. `Window::Controller::activate()` asks the window manager, which on a locked console does not comply. | Assert it with `Test::ForceWindowActive()` before the action. A one-shot activation expected to survive across polled turns is a forbidden technique, because the platform de-activates asynchronously between event-loop turns: re-assert it on every poll of the bounded wait, where the helper caps its note to about every tenth call and reports the attempt count at pass time. This is the one documented exception to the `until` purity rule above — it mutates only which window Qt considers focused, is idempotent, and encodes no expected product result. Confirm the instrument with the `test_activation.h` self-test. The other side of this fact is a window that is active and exposed and marks messages read: that is the `KeepMainWindowNotMarkingRead` row below, not another use of `ForceWindowActive`. |
| An injected or fixture message is read the moment its chat is shown, an injected incoming item's notification never appears, or `HistoryInner::checkActivation` aborts on `IsServerMsgId`, next to `markingAsRead=1`, with `screenLocked=0` on an unlocked console or `screenLocked=1` on a locked one | The main window is exposed and either active in Qt's sense - `Test::ForceWindowActive`, the scenario's `Window::Controller::activate()` or another product flow, a `test-run --activate` launch, or the owner's click - or under `auto-scroll-inactive-chat`, so `MainWindow::markingAsRead()` is true. It reads no lock state, so a locked console marks read the same way while those terms hold, and a window shown behind the lock screen keeps a stale `isExposed()`; `screenLocked` is `Test::ReadConsoleLock()`'s reading of the console itself (on macOS the session's `CGSSessionScreenIsLocked`, which also sees a lock taken before the launch, unlike `Core::App().screenIsLocked()`), so `screenLocked=0` no longer hides a console locked before the launch. On macOS a default `test-run` launch no longer activates it. Clearing the QPA focus window does not help while `auto-scroll-inactive-chat` is on, and `QWidget::hide()` makes `CaptureWidget` refuse the window. This is the other side of the activation row above: there the window is not active, here it is and it marks messages read. | Call `Test::KeepMainWindowNotMarkingRead`, and call it again after `Window::Controller::activate()` or any non-background `showHistory`. Confirm with `AppendMainWindowNotMarkingReadSelfTest`. |
| A window reads `isExposed()` false (`exposed=0`) and gets no product paints - a `Test::PostPaintSampler` with no rows, a paint-stamped product timer that never starts, a frame that never advances - while another application is frontmost (`test-run`'s `frontmost_app`), with or without input during the run (`input_during_run`), the screen not locked | On macOS `test-run`'s default background launch does not activate the client (`launch_activation: "suppressed"`, `launch_method: "background"`), so its windows open behind the frontmost application's. A window covered from the moment it is shown keeps reading `isExposed()` true until the window server first reports an occlusion change for it - for example when `RestoreWindowExposure` drops it back behind, or when the owner rearranges windows - so `exposed=1` is no proof that it is on screen. Once the window server reports a covered window occluded, Qt's cocoa plugin delivers an empty expose (`QCocoaWindow::windowDidChangeOcclusionState` calls `handleExposeEvent(QRegion())`, `qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm`), so `isExposed()` turns false and the widgets' repaints are held - their dirty regions kept, not painted - until the window is exposed again. Observed, before that default, in `2026/10/07/animate-the-sending-row-for-a-collectible-transfer` (`work/test.md`, Attempt 1). Run 1 launched without `--wait-idle` while the console was in use (`input_during_run=true`, idle 0.19 s before the launch and 0.01 s after, frontmost `cmux` both times, screen not locked): its fixture gate `the Money window shows the controlled head page in an exposed window` read `pages=1 exposed=0`, and every later stage was `N/A`. Run 2 launched with `--wait-idle 20 --wait-idle-max 120`, which was not met after 120 s, and input arrived again (`input_during_run=true`); its overlay set `Qt::WindowStaysOnTopHint` on the panel's `QWindow` right after showing it, activating nothing, and waited for `isExposed()` in a pure `until`: the gate read `exposed=1` and the leg ran end to end (50 in-process PASS). | Call `Test::KeepWindowExposed` on the window right after it is shown, then wait for `isExposed()` (`ReadWindowExposure(...).exposed`) in a pure `until`; call it whatever the window reads before it, since a window covered from the moment it is shown can read `exposed=1` there. Undo with `RestoreWindowExposure` before teardown and before reading anything the product derives from the hint, such as the call window's pin (`Calls::Window::pinnedOnTop()` reads its `QWindow`'s flags); while applied the window floats above every application's ordinary windows, so keep it no longer than the paints are needed. Never activate the app or take focus (`Window::Controller::activate()`, `activateWindow()`, `raise()`, `requestActivate()`, `Ui::SeparatePanel::showAndActivate()`) - the owner's keystrokes would go into the test client - and never `QWidget::setWindowFlag` on a shown widget, which re-parents and hides it. Launch with `test-run --activate` instead only when OS activation is itself the subject. The `--wait-idle` gate does not change the occlusion. A minimized window is refused by name, since stacking cannot expose it. Marking read: `isExposed()` is one term of `MainWindow::markingAsRead()` (see `test_marking_read.h`), so on an unlocked console exposing the primary window with `auto-scroll-inactive-chat` on can make it mark messages read. Confirm with `AppendKeepWindowExposedSelfTest`. |
| A test window or its session disappears mid-run - a primary window closed and another account made active, a box gone with its window, every later leg finding no window for its session - with a `Shortcut event caught: Ctrl+W` row in the app log (the launch's only shortcut event) or a close the scenario did not cause, and `input_during_run: true` in the `test-run` report | Console input reached the client. A default macOS background launch does not activate it, but the scenario's own activation (`DeepLinks::Router::tryHandle` calls `controller->window().activate()`) or a window `KeepWindowExposed` floats above the owner's applications lets a keystroke or click at the console land in a test window. Cmd+W is `Command::Close` (`core/shortcuts.cpp`): `Application::closeActiveWindow`, then `MainWindow::closeEvent`, and `Application::closeNonLastAsync` closes, rather than hides, a primary window while another primary window has a session, so `Application::closeWindow` destroys its `SessionController` and activates the other account. Found in `2026/10/17/start-qr-box-colors-from-black-and-show-controls-only-where-savable` (`work/test.md`, Run 2); its Run 3 repaired only its own overlay with a disposable application filter (`consoleVetoes=15`). `--wait-idle` makes console input less likely; it does not prevent it. | Arm `Test::ArmConsoleShield(runner, label)` in a stage after `launch_finished` and release it with `Test::ReleaseConsoleShield(by)` in the first teardown stage, before any stage that closes windows or switches accounts; its `Runner::onFinish` registration releases it on every other finish path. Armed, it vetoes and counts spontaneous key, pointer, wheel, touch, context-menu and widget-close input and every shortcut, input-method and drop event, except what is delivered inside `Test::Settle` at that loop level: every input helper passes, and so does an overlay's own raw `sendEvent` or `QWindowSystemInterface` delivery wrapped in `Settle`. Product and scenario closes and quits pass with no pass-through. A `CONSOLE_SHIELD: vetoed class=...` row during the overlay's own action means that input was delivered outside `Settle` or inside a nested loop it entered; wrap it in `Settle`, and call `ForceWindowActive` outside `Settle`, since its flush inside the scope would let queued console input through. The `CONSOLE_SHIELD: released ... counts=[...]` row says what the console sent; no row carries key text. Never arm it in a campaign whose subject is real OS input. It cannot stop native menu key equivalents, the macOS popup monitor, OS activation, a console quit, `FileOpen` or a second instance's command, closes of windows that belong to no widget, or input that reaches a product application filter installed after the arm before the next re-front ([limits](helpers/test_console_shield.md#preconditions-and-limits)). Confirm with `AppendConsoleShieldSelfTest`. |
| On macOS a covered-window premise fails under another process's opaque titled window: the cover's window-list bounds contain the target and its row is above the target's - `coverRow=... bounds=16,33 1396x864 contained=1 above=1` - but the target keeps the visible bit of `[NSWindow occlusionState]` (`NSWindowOcclusionStateVisible`, printed by the overlay as `occlusionVisible=1`) and reads Qt-exposed (`exposed=1` in the equivalent `ReadWindowExposure` reading, `test_window_exposure.cpp`), while another window under the same cover's content area reads occluded and unexposed | The cover's title bar lay over the target's top. Its window-list bounds included that title bar, whereas its opaque content did not cover the whole target frame after the cover's frame was pushed below the menu bar. This is window-server behaviour, not a product defect. Observed in `2026/10/21/pause-widgets-while-telegram-is-hidden-with-macos-hide` (`work/test.md`, Run 2 result, "Failure signature" and "Recovery plan", judged `TEST_FLAW`), once on one macOS 27 host: C5's main window read covered (`occlusionVisible=0`, Qt unexposed), but the separate chat window's frame began at y=41, inside the cover's title-bar band y=33..65, and kept `occlusionVisible=1` and Qt exposure. C5's covered leg was `N/A` by its premise gate. | Place the cover so its content area, not its whole frame, contains every target's frame; put targets below its title bar and leave a margin. Read the cover's real bounds back from the window list before deciding the premise. Whole-frame `contained=1` is insufficient; the readiness line's `frame=` echoes the requested content rect, not the settled frame. The working cover is the same task's `evidence/cover.js`: the disposable overlay launched it through `QProcess` as `/usr/bin/osascript -l JavaScript <cover.js> x y w h seconds`, without a shell. This JXA script sets the accessory activation policy, creates an `NSWindowStyleMaskTitled` window with an opaque background and `opaque=true`, sets `NSFloatingWindowLevel` and shows it with `orderFrontRegardless`, without activating Telegram or itself. Its test design included no Accessibility or Automation permission grant. `x y w h` specify the content rect in Cocoa screen coordinates, with a bottom-left origin and the title bar added above; for its primary-screen targets the overlay kept x and used the height of `CGDisplayBounds(CGMainDisplayID())` minus (the Qt rect's y + height) for Cocoa y. It prints `COVER_READY pid=<pid> window=<number> frame=<x>,<y> <w>x<h>` and, on normal expiry after `seconds`, orders the window out and prints `COVER_DONE`; the campaign passed 20 s and stopped the process just after the covered interval. Before covering, call `Test::RestoreWindowExposure` on each saved `Test::KeepWindowExposed` reading (`test_window_exposure.h`, `test_window_exposure.cpp`) and let the windows settle (1 s there): that helper's `Qt::WindowStaysOnTopHint` uses `NSModalPanelWindowLevel`, above the cover's floating level. The recorded sequence was a bounded `COVER_READY` fixture gate (8 s), then a pure bounded `until` (3 s) for every target's visible bit to clear and Qt exposure to become false (the same value `ReadWindowExposure(...).exposed` reads). That stage's premise decision then matched the cover's reported PID and window number, required a PID other than Telegram's, alpha at least 0.999 (logged as `alpha=1.00` in Run 3), whole-frame bounds containing each target's listed bounds, front-to-back order above each target, and Telegram unhidden and inactive. That historical geometry check used whole frames; apply the content-area placement rule above when reusing the idiom. A coverage miss writes a `premise:` FAIL and gates the covered leg to named `N/A` checks, never a pass; a readiness miss also gates the leg. Both native readers - `[NSWindow occlusionState] & NSWindowOcclusionStateVisible`, printed as `occlusionVisible=`, and owner PID, bounds, alpha and order from `CGWindowListCopyWindowInfo` - live only in that campaign's disposable overlay (`work/test-overlay.patch`), not in harness helpers. `BuildCover()` (`test_window_exposure.cpp`) belongs to the test process and sets its client geometry to the target's frame plus margins; it cannot supply another application's cover. Repaired placement in Run 3 of the same campaign put the separate window from the main window's target rect rather than its settled geometry, so both frames started at y=73. The cover read back as `16,33 1396x832`; both windows read covered after `waited=50` (ms) and in all 152 samples of the three-second covered interval (`evidence/run-3-test_log.txt`, C5 rows). |
| A preview-dependent check measures a message with no link preview: a `fixture gate:` or premise row reads the injected item's media as not displayed (`media=0`), the bubble is only as large as its text, items drawn as outgoing fail like incoming ones, and the same item may show its preview later in the launch | The item's `out()` is false and its chat's bar settings are not known yet. `HistoryItem::hideLinks()` is `!out() && history()->peer->hideLinks()` (`history_item.cpp`); `PeerData::hideLinks()` holds while `barSettings()` is unknown or has `ReportSpam` (`data_peer.cpp`). `MediaWebPage::createView()` then makes no view and calls `setHasHiddenLinks(true)` (`data_media_types.cpp`), and `HistoryItem::translatedTextWithLocalEntities()` drops the text's `Mention`, `Hashtag`, `Cashtag`, `Url` and `CustomUrl` entities (its `isUrl` filter in `history_item.cpp`), so a link hit test on the text misses too. It keys on the flag, not on the bubble's side: `NewMessageFlags()` leaves `MessageFlag::Outgoing` off for a self peer (`history_item_helpers.cpp`), while `Message::hasOutLayout()` draws every non-forwarded Saved Messages item as outgoing (`history_view_message.cpp`), so there every item injected with `NewMessageFlags()` loses its preview while the settings are unknown. When the settings arrive, `PeerData::setBarSettings()` queues `History::refreshHiddenLinksItems()` (`data_peer.cpp`, `history.cpp`), which rebuilds the marked items' views, so a reading can flip mid-run. A user's settings come from `ApiWrap::requestPeerSettings()`, the full-user answer or `updatePeerSettings`; `ApiWrap::requestFullPeer()` requests them separately only for a non-user (`apiwrap.cpp`). Unlike the `markingAsRead=1` row above, where the active window marks an injected incoming item read, no window state is involved here: the item keeps its text but loses its preview and its text links. Observed in `2026/10/06/fit-the-rich-article-width-and-last-line-to-the-bubble` (`work/test.md`, Run 1, the B-only launch): both preview gates read `rich media=0 plain media=0`, and the same twins showed their previews in later stages. | Before injecting, request the settings when `barSettings()` is unknown (`ApiWrap::requestPeerSettings`, a read) and wait for them in `until`, bounded at 30 s, in a stage whose `timeout` is above that bound (the source run used 50 s; the default `kDefaultStageTimeout` of 10 s would end the run as a stage timeout before the gate is written); add a `fixture gate:` row that they are known and the peer's `hideLinks()` is false; and make every preview-dependent row first assert that its media is displayed, writing it N/A through `Test::Skipped` otherwise (see “Media fixtures and fixture gates”). Repaired that way from Run 2 of the same campaign: the gate passed in all four later launches (`barSettings known=1 hideLinks=0` after 66-101 ms), but the chats list loaded within 4 s in each, so none re-created Run 1's condition and the request was not measured without a loaded chats list. The gate is what keeps an oracle off a text-only bubble: opening a chat in `HistoryWidget` already requests its settings (`ContactStatus`, `PaysStatus`), and `requestPeerSettings` keeps one request per peer in flight. |
| A notification check finds nothing delivered although the item was injected or received - no toast, no native row, `NativeManager::doShowNotification` never runs - the notification system skips the item (`System::schedule` returns at its `skipNotification` reading, `SkipState::Skip`), and the chat reads muted (`isMuted=1`, `history->muted()=1`) with no `mute_until` of its own | Not the product and not the window: the golden test account's default user notify settings are served `mute_until=2147483647`, which 777000 and every private chat without a mute value of its own inherit, so `Data::NotifySettings::isMuted` reads true and `System::computeSkipState` answers `Skip`. Observed in `2026/10/04/show-hidden-sender-gram-transfers-in-the-service-chat` (`work/test.md`: Run 1 recorded its delivered-notification leg `N/A` by `fixture gate G-notify: 777000 muted`; Run 2 reached it through a hand-written local unmute in its overlay). Distinct from the `markingAsRead` row above, where the window reads the item the moment its chat is shown; here the chat itself reads muted. | Override the chat locally with `Test::OverrideNotify(runner, peer)` (`test_notify_override.h`; the default `UnmutedSilentNotify` is unmuted with no sound), restore at the window's end and again in teardown (the module's own `Runner::onFinish` restores or verifies once more), treat a `settings-unknown` refusal as a fixture gate, paste the `InterceptNotifyRequest` hook into the overlay and prove locality with `Test::AppendNotifyLocalityCheck`. Never unmute through `Data::NotifySettings::update`, `resetToDefault`, `defaultUpdate` or `clearExceptions`: each reaches `ApiWrap::updateNotifySettingsDelayed`, which sends `account.updateNotifySettings` after `kNotifySettingSaveTimeout` (1 s) and changes the shared test account's served settings for every later run on every checkout. Confirm the instrument with `AppendNotifyOverrideSelfTest`. |
| A native macOS notification is never delivered while usernoted logs `Legacy client <id> connecting to modern client` and `Denying message 7` | Not the product: the legacy `NSUserNotification` backend posted under a bundle id that an earlier `UserNotifications` launch made a modern client, and usernoted refuses every legacy post from it. Observed in `2026/10/28/keep-peer-and-message-ids-out-of-macos-notification-identifiers` (`work/test.md`, Run 3). | A fixture gate, not a product FAIL: rerun the leg under a legacy-only id ([choosing a bundle id](macos-notifications.md#choosing-a-bundle-id)). |
| A stage times out while the button it aims at is plainly on screen, and `FindAll<Ui::RoundButton>(<box content>)` reports zero buttons | `Ui::BoxLayerWidget::addButton` re-parents the button onto the shell (`box_layer_widget.cpp`), so a footer button is a direct child of the shell and not a descendant of the published box content. | Click it with `Test::ClickBoxButton(box, label)`, which roots the search at `Test::PaintingLayerRoot(box)`: gate on `Test::BoxButtonReady` in `until` and click in `then`, and pair it with the self-correcting repeat of the settling-layer row above. A label no shell button carries is a named refusal listing every label seen, never a silent no-op. |
| `ReadBoxButtons` / `BoxButtonReady` / `ClickBoxButton` in the turn the box was resolved names every shell button `(hidden)`, or `BoxButtonReady` is false, while the box is plainly being shown and a later stage reads and clicks the same button | `LayerStackWidget::prepareForAnimation()` calls `layer->hide()` on the current layer (`ui/layers/layer_widget.cpp`) and `animationDone()` calls `layer->show()` again. The stack's `BackgroundWidget` paints the animation from cached pixmaps while that hide holds, so every descendant of the `Ui::BoxLayerWidget` — the `_title` label, the content, and the re-parented footer buttons — answers `QWidget::isVisible()` false. `ReadBoxButtons` records that as `(hidden)` (a merely disabled footer included, because `!visible` wins over `isDisabled()`), and `BoxButtonReady` / `ClickBoxButton` are correct to refuse: a click then really would be the silent no-op those helpers exist to remove. `anim::type::instant` skips this hide; the product default `anim::type::normal` does not. | Take the judgement on a bounded readiness wait in `until` (`Test::BoxButtonReady`) rather than as an assertion in the turn the box is resolved. Do not relax `BoxButtonReady`'s visible-and-enabled requirement. Confirm with the `test_box_button.h` self-test. Distinguish this whole-layer hide from a product-hidden or disabled footer (`BoxButtonHidden` / `BoxButtonDisabled` after the layer has shown). |
| Every busy reading reports no matched button (`matched=0` / `buttonFound=false`) while the footer button is plainly on screen and other clicks in the same run work | `ReadBoxButtons` refuses to *match* a disabled or hidden shell button on purpose — a click on one is the silent no-op the helper exists to remove — so `matched()` is false and `ClickBoxButton` Fails. The only previous answer was a formatted `labels` entry `"Save (disabled)"` / `"Save (hidden)"`, which a caller either string-matched or read as "the button is not there". | Read `present` / `disabled` / `hidden` on the same `BoxShellButtons` reading, or `BoxButtonDisabled` / `BoxButtonHidden` beside `BoxButtonReady`. `matched()` stays false and `ClickBoxButton` still Fails. Confirm with the `test_box_button.h` self-test. Do not parse `labels` for a boolean and do not treat `matched()==false` as absent. |
| An `isEnabled()` readiness or assertion is wrong about a button the product blocked: `isVisible() && isEnabled()` reads it ready, or a "button is blocked" clause fails on a correctly blocked one with `isEnabled=1` in its details | `Ui::AbstractButton::setDisabled` (`ui/abstract_button.cpp`) sets the button's own `StateFlag::Disabled`, which only `isDisabled()` reads back; `QWidget::isEnabled()` stays true. It hides `QWidget::setDisabled` rather than overriding it, so through a `QWidget*` the Qt slot runs instead, moving `isEnabled()` and leaving the own flag clear. Observed in `2026/10/15/move-wallet-held-gifts-to-my-gifts-through-the-send-core` (`work/test.md`, Attempt 2 Run 1, recovery item a), whose Move button is blocked with `setDisabled(busy \|\| !pressable)`. | Read `Test::ReadButtonState(widget)` (`test_widgets.h`): gate on `usable()`, assert `disabled` with `isEnabled` printed beside it through `ButtonStateDetails`, and drive the button through its own static type. A shell footer button is read the same way by `BoxButtonDisabled`. Confirm with `AppendButtonStateSelfTest` (`test_box_button.h`). |
| A capture of a visible widget is blank or refused at perfectly sane geometry — `target grab still looks blank` or `render root paints no background of its own` — and the target is a toast or another fade-in wrapper | `Ui::Toast::internal::Widget::paintEvent` (`toast_widget.cpp`) draws its whole frame into a transparent proxy at the fade-in opacity, so the grab holds the harness base and nothing else. | For a **toast**, capture with `Test::CaptureToastSubtree(toast, name)` (`test_toast_capture.h`) gated on `Test::ToastSubtreeReady` — its settled-show term is this module's own answer to the same blankness, and its frame cannot compose the surface beneath; never `Test::CaptureViaWindow`, which would (see the row below). For another fade-in wrapper that is a child widget - a `Ui::ImportantTooltip` is one: `RpWidget(parent)`, painting its cached frame at the animation opacity - capture with `Test::CaptureViaWindow(widget, name)`, which grabs the widget's window cropped to the widget's rect mapped into it. A blank mid-fade frame is a `Note` and never a FAIL, because the decisive oracle is the joined `accessibilityName` of the toast's `Ui::FlatLabel`s and the capture is corroboration. Second fact for the same target: only inside a synchronously drained input helper, which starves `hideAnimated()`, a toast's fade-out never completes, so toasts persist far past `Ui::Toast::kDefaultDuration` (1500 ms) — a harness-environment effect of that drained helper, never a product defect to “fix”. Across the runner's real event-loop ticks the manager's own hide timer still fires and takes an ordinary toast down; see the live-toast walk row below. A `Ui::Tooltip` is not a fade-in wrapper, and `CaptureViaWindow` refuses it: it is constructed as `RpWidget(nullptr)` (`Telegram/lib_ui/ui/widgets/tooltip.cpp`), its own top-level `Qt::ToolTip` window, so `ReadViaWindow` answers `target is its own window, so there is no opaque window behind it to grab`. Find it in `QApplication::topLevelWidgets()` with `dynamic_cast<Ui::Tooltip*>`, keeping only a visible one (`Tooltip::Hide()` hides the instance and deletes it from a queued `deleteLater()`, so a hidden one can linger in the walk), with the main window as the walk's known-present control; read its text from the public `accessibilityName()` (`_text.toString()`, the full text `Tooltip::popup()` sets, which it paints elided); and capture it with `Test::CaptureWidget`: it sets `Qt::WA_NoSystemBackground`, which exempts it from the blank-root refusal, and paints its own `textBg` background and its text with no fade animation. Observed in `2026/10/07/show-url-tooltips-and-copy-link-on-rich-message-url-buttons` (`work/test.md`, Attempt 1 Run 1), whose test log read that refusal for `class Ui::Tooltip 878,549 703x60` and saved the tooltip through `CaptureWidget`. Settledness is a background term: a settled toast frame can still lack its text and link, so save a frame meant as visual proof as the background-only toast frame row below says. |
| A toast capture is perfectly legible and shows the sheet, box or row underneath it: words, a hint or a row the toast is not about, readable through the toast, and its four corners holding whatever was behind them | `Test::CaptureViaWindow` grabs the toast's **window** cropped to the toast's rect, and `st::toastBg` is `#2c3033e5` (`ui/colors.palette`) — alpha `0xE5`, about 90% opaque — so about a tenth of every pixel the product painted underneath composes into the frame. The corners are worse: the rounded background is `_roundRect.paint(p, rect())` (`Widget::paintBackground` → `Ui::DrawRoundedRect` → `Images::PrepareCornersMask`), whose corner mask is transparent outside the arc, so the rect's four corners are not covered at all and the surface beneath shows there unblended. | Capture with `Test::CaptureToastSubtree(toast, name)` (`test_toast_capture.h`), which grabs the toast subtree itself — `Ui::GrabWidgetToImage` fills every pixel the toast leaves uncovered with `st::windowBg->c`, so the frame holds the harness base and never the product surface. Gate on `Test::ToastSubtreeReady` and read the phrase through `Test::CheckToastReads`. A root that is not the live toast, or a rect outside its geometry, is a named FAIL quoting both rects — never a silent reframe and never a quiet no-op. Resolve the toast with `Test::FindLiveToast()`; `Ui::Toast::internal::Manager` enumerates nothing. |
| A check read `Test::FindLiveToast()` as null and concluded no toast was raised, or a reading taken after a longer settle found an empty walk and treated that as a confident absence | `Test::FindLiveToast()` is `return (all.size() == 1) ? all.front() : nullptr` (`test_toast_capture.cpp`), so one `nullptr` answers both zero live toasts and more than one — a null-versus-non-null assertion cannot tell "no toast was raised" from "two toasts were". Separately, the persist fact in the fade-in row above holds only inside a synchronously drained helper; across the runner's real event-loop ticks `Ui::Toast::internal::Manager` still arms `_hideTimer` for `_hideAt`, `hideByTimer` calls `Instance::hideAnimated()`, and the completed fade reaches `Instance::hide()`, so a reading taken on a longer settle finds an empty walk and reads as a confident absence of a toast that was raised correctly. | Record `Test::FindLiveToasts().size()` and every live toast's text (`Test::ReadToastText`) in the check's own `details`, which print on the passing verdict too. Take the reading inside the toast's lifetime on `Test::ToastSubtreeReady` rather than on a longer settle. Do not treat `FindLiveToast()`'s `nullptr` as "no toast" without that count and those texts. A toast that `hideAnimated()` is fading is live in that walk as well; read shown, hiding and gone apart as the next row says. |
| A reading taken after a toast's own action - a View or Undo button that hides it - still counts the toast live (`live=1`), and a "the toast went away" clause fails although the product hid it correctly | `Test::FindLiveToasts()` counts every visible `Ui::Toast::internal::Widget`, and `Instance::hideAnimated()` only starts the fade: the widget stays visible until `Instance::hide()` at its end (`durationFadeOut`, 1000 ms for `st::defaultToast`). Observed in `2026/10/15/move-wallet-held-gifts-to-my-gifts-through-the-send-core` (`work/test.md`, Attempt 2 Run 1, recovery item d), whose toast's View button hides it with `hideAnimated()`. | Start a `Test::ReadToastState` chain while the toast is shown, continue it with `RereadToastState`, and wait for gone with `Test::ReadToastGoneWait` from `until`, bounded by `durationFadeOut * anim::SlowMultiplier() + kToastGoneMargin` after the action; at the bound it refuses `toast-not-gone` naming the toast and listing the live ones. `FindLiveToasts()` keeps its meaning. Confirm with `AppendToastStateSelfTest` (`test_toast_capture.h`). |
| A saved toast frame shows only the settled rounded background - no text, icon or link - while the same turn's `ReadToastText` matches the whole phrase and `ToastSubtreeReady` was true; reported on repeated toasts | The children-paint lifecycle (`toast_widget.cpp`): a paint or grab below full shown level runs `paintEvent`'s proxy branch, whose `disableChildrenPaintOnce()` sets `Qt::WA_UpdatesDisabled` on the toast's direct children until a `Ui::PostponeCall` restore, and `QWidget::render`, which every toast-rooted grab uses, skips such children. A full-level grab before the restore holds the background alone, which `ToastSubtreeReady` (background settledness) and `ReadToastText` (model state) cannot see. Reported by `2026/10/17/lock-qr-box-emoji-sets-without-premium`, but its retained PNGs, `discovery-repeated-toast-background-only.png` included, are all painted (byte-identical to its painted controls); `AppendToastContentCaptureSelfTest` reproduces the signature instead. | Save a toast meant as visual proof through `Test::ReadToastContent` polled from `until` on `decided()` and `Test::CaptureToastContent` on that accepted frame: it requires content ink in every labelled `Ui::FlatLabel` and the expected pens in the grab it saves, and a frame that never paints ends in `content-wait-expired`. A settled `content-not-painted` frame with `childrenPaintDisabled>0` is a pending restore: read again on the next tick, or `Test::SettlePostponedCalls()` first. Keep `CaptureToastSubtree` for corroborating the textual oracle. Confirm with `AppendToastContentCaptureSelfTest` ([painted-content captures](helpers/test_toast_capture.md#painted-content-captures)). |
| A window driven to full screen reads taller than its screen (`0,0 2560x1476` on a `2560x1440` screen), a normal round trip restores a shorter window than it started from (`960x580` to `960x544`), or a maximized window reads `Qt::WindowNoState` at that taller geometry after `showFullScreen()` and keeps it after `showNormal()`, readings that look like product behaviour | The overlay called `showFullScreen()`, `showNormal()` or another of the six `Ui::RpWindow` members named in “Exact objects and actions” through a `QWidget*` or `QPointer<QWidget>`. They are declared without `virtual` and only hide the non-virtual `QWidget` members of the same names, so the static type picks the function and the call never reaches the window's `Ui::Platform::BasicWindowHelper` — the mechanism of the `focused=0` row below, on another class. On Windows it skips `WindowHelper::showFullScreen()` (`ui_window_win.cpp`), which sets `_isFullScreen` so that `WindowHelper::updateMargins()` drops the custom title margins before `QWidget::showFullScreen()` runs; without it Qt lays the screen-sized frame out with the normal margins still set, and `QWindowsGeometryHint::handleCalculateSize` (`qwindowswindow.cpp`) adds them to the client rectangle on `WM_NCCALCSIZE`, extending the client above the frame. `2026/10/12/keep-the-full-screen-state-when-a-maximized-window-goes-full-screen-on-windows` measured it (`work/context.md`, diagnostic run 2, on a `2560x1440` screen at 240 DPI with device pixel ratio 2, and a probe `Ui::RpWindow` starting at `960x580` whose normal custom margins are `(0,-72,0,0)` physical): in leg `bypass-control`, `QWidget::showFullScreen()` read `0,0 2560x1476` (native `5120x2952`, 72 physical px taller than the screen) and `QWidget::showNormal()` restored `960x544`; in leg `bypass-qtmax`, from the maximized state, the widget read `Qt::WindowNoState` at `0,0 2560x1476` and `showNormal()` left it there; in leg `helper-run2`, `Ui::RpWindow::showFullScreen()` and `showNormal()` from the normal state read `0,0 2560x1440` and restored `960x580` exactly. Every platform's helper overrides some of the six, `setGeometry()` among them, so the skip is not Windows-only, but only this Windows consequence has been measured. | Make the call through a `Ui::RpWindow` static type, as “Exact objects and actions” says: the product accessor's `not_null<Ui::RpWindow*>`, held across stages as `QPointer<Ui::RpWindow>`, or a `dynamic_cast<Ui::RpWindow*>` of a found window. A reading taken after a transition driven through a `QWidget*` is a harness artifact: repeat the transition through `Ui::RpWindow` before recording it as product behaviour. |
| `focused=0` for a field that is plainly focused, often beside `focusWindowSet=1 focusWidget=QTextEdit` | `Ui::InputField` declares its own non-virtual `bool hasFocus() const` returning `_inner->hasFocus()` (`input_field.cpp`), and `QWidget::hasFocus()` is non-virtual too, so a read through the `QWidget*` a generic finder returns answers for the wrapper, not for the inner editor that holds the focus. | `dynamic_cast<Ui::InputField*>` the resolved widget and call its own `hasFocus()`, or test `QApplication::focusWidget()` for descendancy of the field. `Ui::PasswordInput` is a `QLineEdit` subclass with no wrapper, so a direct read there is already right. |
| A passcode / cloud-password box accepted Enter and produced no request: no SRP computed, no API call, no error | `PasscodeBox::submit()` (`passcode_box.cpp`) is five per-field `hasFocus()` branches and nothing else; in a Qt-inactive window every branch reads false, Enter falls through and `save()` never runs. | Submit through the box's own shell button with `Test::ClickBoxButton` — `lng_passcode_submit` when a caller set `customSubmitButton`, otherwise `lng_settings_save` or `lng_passcode_remove_button` — whose handler calls `save()` with no focus dependency; assert activation first, per the activation row above. Two of those branches are irreversible on a live account: `lng_passcode_remove_button` is the turning-off submit that disables the cloud password (`PasscodeBox::prepare`), and a `customSubmitButton` is `tr::lng_theme_delete()` on the account self-destruction flow (`AddDeleteAccount` in `self_destruction_box.cpp`). Place that click last in the scenario, per step 3 of Building one reliable packed scenario above. `PressKey(Qt::Key_Enter)` is a last resort only, and log which path submitted (`submittedVia=`) so a fallback stays visible. |
| `descriptionRead=0` for a `PasscodeBox` whose description the product plainly shows, while the same run's title read-back answers `titleLabelRead=1` | `PasscodeBox` renders `CloudFields::customDescription` (`passcode_box.h`) into `Ui::Text::String _about` (`passcode_box.h`, set in `PasscodeBox::prepare`) and draws it from the box's own `paintEvent` (`_about.drawLeft(...)`). No `FlatLabel` exists for it, so every label and accessibility read-back returns nothing on a correct product. The title is different: `BoxContent::setTitle` reaches `Ui::BoxLayerWidget`, which creates an `object_ptr<Ui::FlatLabel> _title` (`box_layer_widget.h`, `Ui::BoxLayerWidget::setTitle`), so a title read-back does work. | Decide it in process from the box's own construction seam: publish the comparison of `fields.customDescription` against the expected `tr::` phrase through `Test::CheckTextReads` and record the boolean as a row (`descriptionIsRestore=1 descriptionIsPhrase=0`), keeping the label read-back as a detail only. The row is about the **description** alone; a title read-back needs no such repair. |
| Text was typed and nothing was inserted: the field's own text stays empty and `changes()` never fires, even with `focused=1 focusWidget=QTextEdit` | The events were aimed at the `Ui::InputField` wrapper, which does not override `keyPressEvent` (`input_field.h`), and Qt propagates an ignored key event up the parent chain and never down into a child - the `QEvent::KeyPress` case of `QApplication::notify` re-delivers it to `w->parentWidget()` until it is accepted or a window is reached - so the keys reach the wrapper's ancestors right up to the primary window and never the inner `QTextEdit` that owns the text. | Type into `dynamic_cast<Ui::InputField*>(widget)->rawTextEdit()`, fall back to `Test::CommitText` on that same editor when the text stays empty, and prove insertion by reading the field's own `getLastText()` afterwards. |
| A text oracle fails on a date, time or number whose two sides read identically in the details | The formatter's U+202F or U+00A0 against the read-back's U+0020. `Ui::Text::String`'s block parser maps every space-class character except U+00A0 to U+0020 (`text_block_parser.cpp`, `replaceWithSpace`), so a `Ui::FlatLabel` fed `langDateTime()`'s narrow no-break space before AM/PM reads back a plain space through `accessibilityName()`, while a U+00A0 survives the parse. | Compare through `Test::CheckTextReads` / `Test::NormalizeSpaces` (`test_text_reads.h`): they map U+202F and U+00A0 to U+0020 on both sides and print both raw strings' distinct `U+XXXX` whitespace tokens on the passing verdict as well as the failing one. Never loosen digits, month or AM/PM. |
| A check is missing from the log with no PASS and no FAIL | The stage's gate read false and it ran as a hand-rolled no-op - `run` and `then` skipped, `until` answered true - so it wrote nothing at all. Distinct from the stages a timed-out stage or the watchdog skips (see “Scenario teardown before quit” above), which leave the timeout's own FAIL behind them. | Give the stage a `skipReason` (`test_runner.h`): a non-empty return emits `TEST_RESULT: N/A: <stage> - <reason>` in the turn that begins it, counts in `SCENARIO_RESULT`'s skipped clause and in the `test-run` report's skipped list, and never waits or times out. Confirm the instrument with the `test_gated_stage.h` self-test. |
| After a `fixture gate:` FAIL - a refused fixture write, an unmet premise - the overlay's own gated stages read `TEST_RESULT: N/A`, but a later `act on widget: <name>` or `capture painted widget: <name>` stage of the same leg times out with `last state: target does not exist` (or a readiness reason), `finish()` skips every remaining stage, and the restoration stages never run | A per-stage `skipReason` reaches only the stage it is set on: `actOnWidget` and `captureWidget` take none, and a helper that appends its own stages (`CapturePopupMenu`, any `Append*`) applies its own parameter or none, so those stages resolved and waited on the failed fixture. A hand-rolled gate kept as a plain string was also overwritten by later stages, so the first refusal was lost. The dependent timeout, not the fixture, ended the run before restoration. Observed in `2026/10/17/open-ones-own-qr-box-without-a-username-with-temporary-only-codes` (`work/test.md`, Run 2 assessment). | Compose every stage that depends on the prerequisite inside `Runner::addGated(gate, compose)`: every stage appended while `compose` runs, helper stages included, inherits the gate, read when the stage begins, and the group keeps its first non-empty answer, so each writes `TEST_RESULT: N/A: <stage> - <first reason>` before resolving anything. Settle the prerequisite in an earlier stage's `until`. Declare restoration with `Runner::addRecovery` (only its own `skipReason`) inside the group, or append it after the group. See [gated groups and recovery stages](helpers/test_runner.md#gated-groups-and-recovery-stages); `Test::AppendStageGroupGateSelfTest` measures it. |
| A server fixture write fails `FLOOD_WAIT_<n>` (a privacy save `FLOOD_WAIT_13`) after a series of identical writes that changed nothing; or a restoration is retried at once, written without a fresh read, or skipped, and the account keeps the mutated state into the next launch | Every requested write was sent whether or not the canonical state already equalled it, so redundant saves spent the server's rate allowance; a hand-rolled retry then ignored the server-directed wait or gave up and dropped the original. A request sent without `.handleFloodErrors()` never sees the FLOOD_WAIT at all: `MTP::Instance` resends it by itself after the wait, a write with no fresh read. Observed in the same task's Run 2, where a restoration-only launch then recovered the exact originals. | Route the fixture through `Test::OpenFixtureTransaction` ([fixture transaction](helpers/test_fixture_transaction.md)) with `.handleFloodErrors()` requests: a fresh read before any write and no write when equal, the original persisted pending in the live copy's `test_fixture_obligations/<label>.json` before the write, the server's deadline recorded and waited once (bounded by `maxWait`) before one fresh-read retry. On `rate-retry-exhausted` or `deadline-beyond-bound` the record stays pending: resume the restoration in a later launch, which waits the recorded deadline; `transition()` refuses `pending-restoration` until it is restored. |
| A language-restore check reports `PASS` against the wrong language: after the “restore” the fixture's synthetic text is still live through the product's own accessor, or an already-painted reactive label still shows it, and the row written to observe the restore passed anyway | Two independent halves. `Lang::Instance::fillFromSerialized` (`lang_instance.cpp`) never clears `_values` or `_nonDefaultValues` and re-applies only the pairs that were **non-default** in the serialized snapshot (its closing `applyValue` loop), so a key that was *default* before the install is absent from that set and keeps the fixture's value. And neither it (which fires `_idChanges` only) nor `switchToId` on an ordinary id (its `_updated.fire` sits inside the `#TEST_X` / `#TEST_0` branch) fires `Lang::Updated()`, the only signal `Lang::details::Value` (`lang_instance.cpp`) re-reads on and the producer every `tr::` phrase funnels into (`Producer<>::Combine` in `lang_values.h`), so an already-painted `Ui::FlatLabel` keeps the fixture text. The vacuous PASS is the consequence rather than a second fault: an expectation rebuilt from the live producers at read time matches a restore that did nothing, so the check reports `PASS` against the wrong language — three rows did exactly that in run 27 of `2026/09/07/prepare-gasless-gram-transfers-for-server-selection`, and only an unrelated post-teardown control caught it. | Install and remove through `Test::InstallLangPack` / `LangPackFixture::remove()` (`test_lang_pack.h`), whose removal is `switchToId` + `fillFromSerialized` **plus** one empty `MTP_langPackDifference` for the instance's own lang code and version, which applies and resets nothing and exists only to fire the `_updated` notification at the end of `Lang::Instance::applyDifferenceToMe`. Freeze the expectation **before** the install through `frozen(key)` and never rebuild it from the live producers afterwards; `checkRestored` compares against those frozen bytes and against the key's frozen non-default state, so “was default before, is default again” is proved rather than “reads the same string”. Confirm the instrument with `AppendLangPackSelfTest`, whose `LangRestoreFault::LeaveOneInstalled` and `::SuppressNotification` arms fail exactly the restore row and the read-back rows. |
| A language-pack scenario or self-test writes nothing but `TEST_RESULT: N/A` rows, every stage gated with “no candidate language key resolves in the generated table” and every candidate quoted as already overridden (`nonDefault="Cancel"` beside `value="Cancel"`), and widening the candidate list changes nothing | The cached cloud language pack overrides **every** key the generated table knows, so a currently-default key does not exist to be found. The client's own log states the count: `Lang Info: Loaded cached, keys: 10993`, which `Lang::Instance::fillFromSerialized` writes from `nonDefaultValuesCount` (`lang_instance.cpp`), against `kKeysCount = 10948` (`lang_auto_counts.h`) — two counts over different sets, since `applyValue` writes `_nonDefaultValues` unconditionally and so counts cloud keys the generated table does not know. That holds on any client that has ever downloaded a cloud pack, which is every real client and every `-testagent` run against a real account. The property is universal over the key table rather than specific to the candidates tried, which is why a longer candidate list cannot help and why the gate is permanent rather than flaky. | Arrange the precondition instead of searching for it. Freeze the live pack FIRST — an outer `Test::InstallLangPack` fixture does exactly that, and its `remove()` restores it — then call `Lang::Instance::switchToId` with the identity read from the instance itself: `reset` (`lang_instance.cpp`) rewrites every `_values[i]` from `GetOriginalValue(i)`, clears `_nonDefaultValues`, zeroes `_nonDefaultSet` and sets `_version` to 0, so every key is default by construction, and on an ordinary id it fires `_idChanges` only and never `_updated`. Assert that premise with a check of its own — `Test::AppendLangPackSelfTest`'s first stage is that whole arrangement, and its `both keys are default after the live pack was held and reset` row FAILs if the reset did not take. One ordering trap for anyone reproducing the leftover-value half by hand: the snapshot to restore to must be taken **after** that reset, or `fillFromSerialized` re-applies the cloud override and the half does not reproduce. |
| A scenario dies inside its own ink scan: `SIGABRT` with no `TEST_COMPLETE` after a long run of `PASS` rows and saved screenshots, the dump pointing at `std::vector::operator[]`; or, with no crash at all, a candidate count read back as a plausible `0` from a reading that classified nothing | `ScanInk`’s refusing paths returned before `result.candidates = std::move(candidates)` and `result.counts.assign(...)`, so a refused reading carried `ok=0` with **both vectors empty** and no reason of any kind. `scan.counts[i]`, `front()` or `back()` on that reading is a read past the end the hardened Debug `std::vector` aborts, and the hand-rolled `counts.empty() ? 0 : counts[0]` guard three campaigns wrote instead of crashing turns the same refused reading into a number a log reader cannot tell from a measurement. `MeasurePaintedInk` compounded it: when the derivation succeeded and the scan then refused, neither branch of its report chain ran and `report` stayed the empty string. | Read a count only through `Test::InkScan::countAt(i)`, which names the candidate and answers a named refusal for an index the reading does not have, for a reading that classified nothing and for candidates that do not separate; branch on `InkScan::state` and `reason`, never on an empty vector. Print the reading through `Test::FormatInkScan`, which carries the candidate colours, the counts, the collision and the five thresholds on the passing verdict too, so a palette whose references do not separate is readable without re-running the campaign. The refusing paths now fill both vectors, so they are always the same length, and `MeasurePaintedInk` writes a non-empty `report` on every path. Confirm the instrument with `AppendDeriveBandSelfTest`. Do not read this as the latched-hover row or the light-footer-fill row above: those are `DeriveBand` refusing to derive a band at all, this is a scan that ran and could not classify what it scanned. |
| A `Classified` reading with `reason=none`, every candidate count zero and `ambiguous` equal to `inkPixels`, on pixels that are demonstrably painted | The candidates separate from each other and from the fill by the shipped thresholds, but one candidate lies on the segment from the measured background to another, so the classifier's margin never lets a pixel of it win. The app's dim text is this triple: `windowSubTextFg` `#999999` on the segment from `windowBgOver` `#f1f1f1` to `windowFg` `#000000` (`ui/colors.palette`). Observed in `2026/09/21/ui-show-the-recipient-in-the-gram-send-box`, whose day-theme arms failed on correct pixels. | The scan answers `background-collinear` instead of `classified`, and its `reason` names the unreachable candidate, the candidate whose segment swallows it, and the measured background. `countAt` refuses with `count=none`. Confirm with `AppendDeriveBandSelfTest`. `candidates-collide` and `no-ink` keep their own texts. |
| A "this surface paints a coloured glyph" claim decided by counting pixels that are neither the pen colour nor the fill, passing and failing on totals only about 2% apart | Subpixel text rendering puts chromatic fringes on ordinary glyphs, so that count cannot separate a coloured mark from plain text. The diagnosing run saw 794 such pixels (mean `#888988`) for an ASCII name against 813 (mean `#c94840`) for an emoji. Density does separate them: the emoji filled about 70% of a near-square window, the fringes about 26% of a wide smear. | Read `ReadChromaticRaster` (`test_ink.h`). It reports the densest chromatic window and the measured mean of the pixels it matched, and refuses by name as `no-chromatic` or `below-density` instead of handing back an empty box. Confirm with the chromatic arm of `AppendDeriveBandSelfTest`. |
| A "text is not link-coloured" (or "text is pen X") check fails on correct neutral text because `ScanInk` answers `classified` with a non-zero `countAt` for a chromatic candidate, in both themes | Subpixel antialiasing puts chromatic fringes on the glyph. `ScanInk` attributes each ink pixel to the candidate segment nearest it, so those fringes go to the link pen even when the solid cores are the neutral pen. A zero on `countAt(chromatic)` is not reachable, and no threshold on the non-zero count is principled. `ReadChromaticRaster` does not repair it either: it is a mark-density reading, not a pen reading, and its `below-density` refusal is no proof that the text is not a chromatic pen. | Read `ReadGlyphCore` (`test_ink.h`). It reports the modal colour of the solid cores and each named pen's solid-core count, and refuses by name as `no-paint` or `no-solid-core` instead of handing back a fringe colour. Confirm with the glyph-core arm of `AppendDeriveBandSelfTest`. |
| `ReadGlyphCore` on text over a gradient or pattern reads `bg=` equal to the expected pen, a background colour as the modal, and a large `strongest` (202-207) | Band mode takes the band's most frequent exact colour as the background. Over a gradient with a pattern no wallpaper colour repeats as often as the solid text pen, so the pen becomes the background, the wallpaper becomes the ink and its per-channel extreme the core. Observed in `2026/10/15/redesign-the-qr-code-box-as-an-animated-share-card` (`work/test.md`, Run 1 Test 4): `bg=#003a24` with modals `#c7d28b`, `#cdd6b4` and `#c8d28b` on the default wallpaper's four-colour gradient with its doodle pattern. | Read with `GlyphBackground::Surround` (`test_ink.h`), which measures each pixel's background from strips above and below the band, and choose a band whose strips are the text's background surface; check `bgSource=surround` in `FormatGlyphCore`. A strip outside the image refuses `core-no-background`. Confirm with the glyph-core surround arms of `AppendDeriveBandSelfTest`. |
| A capital or advance-cell metric - bounds, cap height, centre - is off by a few pixels against the renderer's metric, and the cell's ink reaches its last column | The union of every ink pixel in a renderer advance cell takes in the following glyph's overhang, a descender or arm reaching back into the cell. Observed in `2026/10/18/align-the-gift-move-confirmations-and-recipient-section` (`work/evidence-assessment-1.md`, "M isolation"): the night/200 capital M's union read centre 26 against the complete M's 23 (renderer 23.008) because of the following y's descender, in four repeated readings. | Read `Test::ReadIsolatedGlyph(image, band)` (`test_ink.h`): it keeps the one 8-connected component that touches no band edge, lists the overhang as `interior=0` fragments, and refuses `glyph-clipped` or `glyph-ambiguous` rather than produce a metric; keep the metric assertion in the caller. Confirm with the isolated-glyph arms of `AppendDeriveBandSelfTest`. |
| A panel reading that changed by one and was attributed to the panel the scenario expected, or a zero recorded as "no panel opened" by a walk that was never shown to reach a panel it could see | A count is not a difference: one panel closing while another opens reads as no change, and a count cannot name which pointer is new — and an `isVisible()` / `!isHidden()` filter counts a `Ui::SeparatePanel` that is still painting its show-animation cache, so the panel such a reading names may be the wrong one. A bare zero from a walk with no control cannot be told from an enumeration that structurally could not see a panel. Distinct from the `Test::DiscriminatingScan` row above, which is a sweep whose enumeration cannot reach its subject at all: here the walk reached the right widgets and read the wrong statistic out of them. | Take a `Test::PanelList` mark before the action and read `Test::WalkPanels(&scan, { .before = mark })`'s `added` — pointers, not a count — under the default `Settled` liveness, which `ReadPanelShowState` decides; certify the zero with `scan.report()`, and read `PanelWalkText` / `PanelWalk::refusal` where a pure reading safe to poll from `until` is wanted; refuse an ambiguous identity ask with `Test::PickPanel` instead of taking the front of the list. Confirm the instrument with `Test::AppendSeparatePanelWalkSelfTest`. |
| Exactly two `FAIL` rows in the first stage of `Test::AppendSeparatePanelWalkSelfTest` — the `fixture gate:` premise row reading `state=live translucentWindows=0` where `show_cache` was expected, and the settled reading holding the same panel it was expected to exclude — while every other row in the run passes, including the `!isHidden()` control in that same stage, the `panel_walk_show_cache discriminates` scan report, and all of the settle, exclusion and teardown stages | Not a harness fault but a host precondition. `Ui::SeparatePanel` builds its show-animation cache only inside `if (_useTransparency)` (`SeparatePanel::toggleOpacityAnimation` in `ui/widgets/separate_panel.cpp`), and `_useTransparency` is `Ui::Platform::TranslucentWindowsSupported()` latched once in `initGeometry` — an inline `return true` on macOS and Windows (`ui/platform/mac/ui_utility_mac.h`, `ui/platform/win/ui_utility_win.h`) and the display server's answer everywhere else (`ui/platform/linux/ui_utility_linux.cpp`: true on Wayland, the `_NET_WM_CM_S0` selection owner on X11, false otherwise). With no cache `hideChildren()` never runs, so the panel's children are never all hidden at once, `ReadPanelShowState` answers `live` in the turn the panel was shown, and the `Settled` walk keeps it. `Ui::PopupMenu` carries the same precondition on the same predicate and states it in `test_menu.h`. | Tell it from an instrument fault in one glance: the failing premise row names itself `fixture gate:`, and an instrument fault takes the controls down with it — the scan's `discriminates` row and the `!isHidden()` control would fail too, and so would the settle and difference stages; here both controls pass and only the two cache rows fail. Nothing in the harness is to be repaired: read the pair as the host precondition, keep the rest of the run's verdict, and prove the cache-versus-settled distinction on a host whose display server supports translucent windows. Do not convert it to a `skipReason`: the `popup menu self-test: open` stage of `Test::AppendPopupMenuCaptureSelfTest` (`test_menu.cpp`) answers this same predicate with a named hard `Check` (its translucency `fixture gate:`) rather than a skip, and `test_panel.h`'s doc block records why this module follows it — a skip would withdraw the cache-versus-settled certification on exactly the hosts that cannot perform it, instead of reporting it. The same self-test's locked-console gate is a skip, for the reason in the menu-capture row above: a lock passes, a host's missing translucency does not. This is a host property the run cannot arrange, so it is not a fixture gate in the “Media fixtures and fixture gates” sense above either. |
| A click check reads no effect in the very tick that clicked - for example `detailCount=0 before=0 id= via=handler guard=[]` after a tap that plainly reached a handler - and the stages that depend on that click read their `skipReason` in the same tick and skip as `N/A`, so whether the click worked is never read | `ActivateClickHandler` (`Telegram/lib_ui/ui/click_handler.cpp`) does not call `onClick` itself: it posts `strong->onClick(context)` through `crl::on_main(guard, ...)`, so the handler runs in a later main-queue turn. The production `HistoryInner` release path (`Telegram/SourceFiles/history/history_inner_widget.cpp`, the `mouseActionCancel()` followed by `ActivateClickHandler(window(), activated, prepareClickContext(...))`) and a direct call from a scenario defer alike. This differs from the settling-layer row above: there the synthesized click intermittently does not land at all; here the click landed and the handler ran, one tick later than the reading. Observed in `2026/09/17/open-the-chat-after-sending-grams-from-a-profile` (`work/test.md`, Run 3). | Click, then wait a bounded tick for the effect in `until` (the details count grew, or 2.5 s), and only then assert in `then`; a `skipReason` that depends on a click's effect is read after that wait, never in the tick that clicked. Repaired that way from Run 4 of the same campaign. |
| A tap on a service message that also displays a media activates the wrong link: the guard rows name a registered handler that is not the media's (`guard=[registered id=... constructor=...]`, no media guard row) and an unrelated request such as `payments.getSavedStarGifts` registers right after it - the recipient's profile opened instead of the media's own action | `HistoryView::Service::textState` (`Telegram/SourceFiles/history/view/history_view_service_message.cpp`) lays the service text above a displayed media: with the media displayed it shrinks the text geometry by `st::msgServiceMargin.top() + media->height()`, computes `mediaTop` below that geometry, and hands the point to `media->textState` only in its `mediaDisplayed && point.y() >= mediaTop` branch. A link scan that walks the element from its top therefore meets the text's own links first - for a transfer card that is the recipient-name peer link - and never reaches the media's link. Observed in `2026/09/17/open-the-chat-after-sending-grams-from-a-profile` (`work/test.md`, Run 4). | Scan only the media rows: from the element's bottom up to `height - media->height()`, and print `mediaTop` and `mediaHeight` in the details so a miss names the geometry it searched. Repaired that way from Run 5 of the same campaign, which found the link at `mediaTop=47 mediaHeight=196`. |
| A `QWidget::childAt` identity check on a grid of gift buttons answers the neighbouring button at a point inside the expected square's ink - next to its top or bottom edge, or anywhere in a one-row sliver that a clip leaves of it - while the probes at square centres pass: `G18 childAt hit targets - measured=16 expectAfter=22 ... k100 visible part@76,537:gift:k100=gift:k200!` | Adjacent `Info::PeerGifts::GiftButton` widgets overlap. `GiftButton::setGeometry(inner, extend)` (`Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp`) sets the widget to the square plus `extend`. The Money grid and the profile list pass `GiftButtonDelegate::buttonExtend()`, implemented by `Info::PeerGifts::Delegate::buttonExtend()`, which returns `st::defaultDropdownMenu.wrap.shadow.extend`, and `Ui::MakeGiftsList` (`Telegram/SourceFiles/boxes/star_gift_box.cpp`) reads that extend directly: `defaultInnerDropdown`'s `roundShadowRadius8px`, `margins(10px, 10px, 10px, 10px)` (`Telegram/lib_ui/ui/widgets/widgets.style`). At the Money grid's regular pitch, the squares are `st::giftBoxGiftSkip` apart, `point(10px, 8px)` (`Telegram/SourceFiles/ui/effects/credits.style`). So vertically adjacent widgets overlap by 12 px across the 8 px gap, and the two ink rows of a square nearest each vertical neighbour (four at 200 %) also lie inside that neighbour's widget; horizontally they overlap only inside the 10 px gap and cover no ink. Where widgets overlap, `QWidget::childAt` descends through the highest eligible sibling in the stacking order - `QWidgetPrivate::childAtRecursiveHelper` (Qt's `qwidget.cpp`) walks the children from the last one down, skipping hidden and `Qt::WA_TransparentForMouseEvents` children such as the grid's thumbnail buttons - which is creation order unless something restacks. The Money window's `CollectiblesGrid` (anonymous namespace, `Telegram/SourceFiles/wallet/wallet_collectibles.cpp`) creates its missing buttons in index order in `CollectiblesGrid::refreshSquares()`, keeps the live ones by address and never calls `raise()`, `lower()` or `stackUnder()`, so higher indices are on top when all buttons are newly created in one pass. Retained buttons keep their previous stacking order: a newly created earlier row can be above a retained later row after scrolling up, and scrolling down does not reset that retained order. The profile list (`Info::PeerGifts::InnerWidget::validateButtons()`, `Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp`) and `MakeGiftsList` have the same 12 px vertical widget overlap at rest, from the same vertical gap `giftBoxGiftSkip.y()` and shadow extend, and recycle buttons; the profile list raises a dragged one. Each layout's vertical pitch is still its own button height plus that gap: `Info::PeerGifts::Delegate::buttonSize()` picks the height by `GiftButtonMode`, `st::giftBoxGiftSmall` (108 px) for the Money grid's `Minimal` and the profile list's `Minimal` or `Selection`, and `st::giftBoxGiftHeight` (164 px) for the `Full` mode that `MakeGiftsList` uses for its default `GiftsListMode::Send`, so the pitch is 116 px in the Money grid and the profile list but 172 px in the default send list at 100 %. `MakeGiftsList` right-aligns the last column, so its last horizontal gap can exceed `giftBoxGiftSkip.x()`; do not assume every horizontal gap is exactly 10 px. The grid's own press handling is unaffected: `CollectiblesGrid::createGiftButton` takes the button's `GiftButton::mouseEvents()`, and `CollectiblesGrid::mousePressEvent` / `mouseReleaseEvent` resolve the global point by square rects with `CollectiblesGrid::squareAt`; its context menu, `GiftButton::contextMenuRequests()` into `CollectiblesGrid::showCardMenu`, goes by the receiving button, as `childAt` does. This differs from the service-message row above: there a link scan walking the element from its top met the text's own links before the media's; here the probe point is right, Qt answers the button on top, and the instrument's one-owner assumption is wrong. Observed in `2026/10/20/start-collectibles-at-the-transactions-top-skip` (`work/test.md`, Attempt 1, Run A1, judged `TEST_FLAW`): four G18 rows of the source's disposable overlay (`work/test-overlay.patch`) failed. The bottom two ink rows can lie under the next row's widget even at rest (the B2 Test 3 geometry gives k100 ink `[441,549)` and k200 widget start 547 at 100 %), and the grid, revealed in place, was clipped to a one-row sliver of k100 at clip top 537, which lay wholly inside k200's widget, on top there. | Expect a square's own button only at points that no other button's widget rect contains. For shown, mouse-eligible gift buttons, build each probe's owner set from live geometry - every button whose widget rect, its square plus the extend, contains the point - and require the square's own button where that set holds it alone. Move a visible-part probe whose centre is shared to the middle of the longest exclusive run of rows at that x, and accept any button of the set only where the part has no exclusive point (a sliver wholly inside a neighbour's overlap), saying so in the probe's name, as the source overlay's `(exclusive rows)` and `(inside a neighbour's shadow overlap)` probes do. Respect Qt's hidden/transparent exclusions when applying this to another grid. Clip-boundary positives take the same set rule; keep the clipped negatives - the pixel beyond a clip edge hits no gift - as they were. **Forbidden:** dropping the identity checks at exclusive points, dropping the clipped negatives, accepting any gift at a point only one button's widget covers, and assuming which neighbour is on top. The G18 check and these probe names belong to the source's disposable overlay (`work/test-overlay.patch`), not the permanent harness. Repaired that way for Runs A2 and A3 of the same campaign, which both passed: every G18 probe was correct, with two A2 frames using the set rule at y 537 and none needed at 200 %. |
| A readiness gate on a served one-page history times out with the list resting at its bottom - `scrollTop=5055 scrollTopMax=5055`, the card resolved and mapped whole inside its owner - and every later stage is skipped | The legacy `HistoryWidget` requests its older page only from `HistoryWidget::preloadHistoryByScroll` (`Telegram/SourceFiles/history/history_widget.cpp`), which calls `loadMessages()` only while `scrollTop <= kPreloadHeightsCount * scrollHeight` (`kPreloadHeightsCount` is 3 screens). A served history shown at its bottom never issues that request, so `historyLoadedAtTop()` stays false while `historyLoadedAtBottom()` is already true, and a gate that requires both edges before the first scroll can never turn true. Observed in `2026/09/17/open-the-chat-after-sending-grams-from-a-profile` (`work/test.md`, Run 1). | Gate an at-bottom reading on the bottom edge only (`historyLoadedAtBottom()`), which is the edge the claim is about, and print `loadedTop`, `loadedBottom` and the scroll movement in the readout so a timeout names its failing term. Repaired that way from Run 2 of the same campaign. |
| A "the box stays open after the refusal" check reads `isVisible()` false on a box that plainly exists - `Ui::GenericBox 0,48 364x176`, later closed by `closeBox` - and the same tick's Info layer readout says `(visible 0)` where a passing leg of the same check says `(visible 1)` | The sibling of the layer-hide row above: `LayerStackWidget::prepareForAnimation()` (`Telegram/lib_ui/ui/layers/layer_widget.cpp`) hides the current layer while a show or hide animation paints from cached pixmaps, so a refusal that lands inside the box's own show animation is read while the whole layer, the box included, answers `QWidget::isVisible()` false. That row covers the shell buttons reading `(hidden)` in the turn the box was resolved; this one covers a synchronous `isVisible()` read on the box itself, taken in the tick a controlled refusal arrived, on a box that is being shown rather than resolved. Observed in `2026/09/17/open-the-chat-after-sending-grams-from-a-profile` (`work/test.md`, Run 4, C5b and C5c). | Read the box after a bounded settle (visible, or 1.5 s) and print `visible`, `hidden` and `layerShown` so the row shows which term answered. Repaired that way from Run 5 of the same campaign, whose settles measured 152 ms and 37 ms. |
| A check on `Dialogs::Widget` or another `MainWidget` child reads it hidden - `isVisible()` false, for example `dialogs=... visible=0` - while its geometry and contents are right and the next stage's capture shows it painted, in the turn the window's session content became ready after the intro (the Add Account intro left with Back), a passcode lock or the setup-email lock | `MainWidget::showAnimated()` (`mainwidget.cpp`) calls `showAll()`, grabs the new content into a pixmap, then calls `hideAll()` - hiding the chats-list column, the history and section widgets, both shadows, the player and the call top bar - and starts `_showAnimation`, a `Window::SlideAnimation` painted from the old and new pixmaps. The slide shows those children again only in its finished callback, `MainWidget::showFinished()`, which clears `_showAnimation` and calls `showAll()`. In `mainwindow.cpp`, `MainWindow::setupMain()` starts it only when the window held the intro, the setup-email lock or a passcode lock the app is no longer locked by, and no passcode lock still holds, so a switch between two signed-in accounts with no intro or lock showing does not slide; `MainWindow::clearPasscodeLock()` and `MainWindow::clearSetupEmailLock()` start it when the removed lock uncovers the main widget. The slide is intended product behaviour, not a product defect; this is the main-widget sibling of the two `LayerStackWidget::prepareForAnimation()` rows above. Observed in `2026/10/20/tear-down-news-cleanly-on-an-account-switch-and-a-quit` (`work/test.md`, Run 1, A4, both launches, judged `TEST_FLAW`). | Wait in a pure bounded `until` for a non-null `MainWindow::sessionContent()` that reads `!isHidden()` and `!MainWidget::animatingShow()` - behind a passcode or setup-email lock the main widget can exist hidden, its slide not yet started - then assert visibility, geometry and contents in `then`. Keep any same-turn reading only as a diagnostic note, and never treat a same-turn `isVisible()` false as a product result. Repaired that way from Run 2 of the same campaign, bounded at 3 s, whose disposable overlay read `_showAnimation` through a private-member accessor (the state `animatingShow()` returns): the same-turn note read `mainShowAnimation=1 hidden=1 visible=0`, and the unchanged check then passed in both launches (L1 `hidden=0 visible=1`). |
| A visible-range or row-window oracle read on a construction or reopen turn, before its window is shown, finds an empty on-screen clip and expects only the top preload rows, while the product reports the window of its logical scroll range - `IL100 E3 reopen construction turn G17 square window - measured=0-5/15 expectBefore=0-5/15 expectAfter=0-2/6 ... clamp=0,254 actual=0,0` | The oracle gated its clip on `QWidget::isVisible()`, which every widget of a hierarchy not shown yet answers false, while visible ranges are forwarded by geometry alone. `Content::updateVisibleArea()` (`Telegram/SourceFiles/wallet/wallet_content.cpp`, anonymous namespace) hands its column the range from `_scroll->scrollTop()` to that plus `_scroll->height()`; `RpWidget::setVisibleTopBottom` (`Telegram/lib_ui/ui/rp_widget.h`) only clamps a range to `[0, height()]` before calling `visibleTopBottomUpdated`; `RpWidget::setChildVisibleTopBottom` shifts it by the child's `y()`; `VerticalLayout::visibleTopBottomUpdated` (`Telegram/lib_ui/ui/wrap/vertical_layout.cpp`) forwards it to every row and the `Ui::Wrap` override (`Telegram/lib_ui/ui/wrap/wrap.h`) to the wrapped widget; none of them tests visibility. `Wallet::CollectiblesViewport::visibleTopBottomUpdated` (`Telegram/SourceFiles/wallet/wallet_collectibles_viewport.cpp`) passes on its page's intersection with the range, or `0, 0` when there is none, and `CollectiblesGrid::visibleTopBottomUpdated` (`Telegram/SourceFiles/wallet/wallet_collectibles.cpp`) stores it and calls `refreshWindows()`, whose `refreshSquares()` uses `rowsRange(_visibleTop, _visibleBottom, kPreloadRows)` to include two preload rows on each side, clamped to the available rows. So a hierarchy not shown yet still preloads its logical window. Geometric forwarding while unshown also occurred before the source task; the new viewport preserves that property. The unshown preload is not a defect. Like the box-visibility row above, every widget of the hierarchy answers `isVisible()` false; unlike it, the reading is about what the product does on that very turn, so waiting for the show does not repair it. Observed in `2026/10/20/start-collectibles-at-the-transactions-top-skip` (`work/test.md`, Attempt 1, Run A1, judged `TEST_FLAW`): the source overlay's G17 check ran while the Money window's `Content` was not shown on the reopen construction turn, so the overlay's visibility-gated clip was empty (`actual=0,0`) and its oracle expected `0-2/6`, while the product preloaded `0-5/15` from the logical range `0,254`, equal to the BEFORE clamp-chain oracle and to the BEFORE v2 measurement of the same row; the first visible frame then read `0-5/15` on both oracles. | While the owner is not visible, take the expected range from the geometric intersection of the widget with every ancestor up to the owner and with the scroll viewport, without the visibility gate - the source overlay's `LogicalClip`, beside its visibility-gated `ActualClip` (`work/test-overlay.patch`) - and print which oracle decided in the trace row, as that overlay's `range=logical-unshown` does. Keep the visibility-gated clip, unchanged, for every shown frame. **Forbidden:** reporting the unshown turn's preload as a product fault or adding a visibility test to the product for it, dropping the row, judging a shown frame by the logical range, and changing a paired BEFORE oracle (the source's clamp chain). G17, `LogicalClip`, `ActualClip` and the trace label are that source overlay's identifiers, not permanent harness symbols. Repaired that way for Runs A2 and A3 of the same campaign, which both passed: the reopen construction turn read `0-5/15` on the logical range at 100 % and `0-4/12` on `0,263` at 200 %, both equal to BEFORE. |
| A web-document leg that expected an `upload.getWebFile` finds no request - the held or counted request never appears, or its canned answer names an unregistered request id (`request is not registered`) - while the loaded entry reports its bytes anyway (`state=5 bytes=227`) and paints | The document was served from the persistent local cache, not the network. `Data::WebDocumentCacheKey` (`data/data_types.cpp`) is the SHA-256 of the URL alone, not of its `access_hash`, and every `-testagent` run reuses the marked live portable folder with its caches. So a canned or fabricated URL an earlier run (or an earlier leg of this one) loaded is found by `FileLoader::loadLocal` in `session->data().cache()` and finished locally, and no request is issued. The same trap fakes a pass: a "no request was issued" check, or a zero on a network counter, reads true on a cache hit. Observed in `2026/09/29/load-collectible-media-only-through-upload-get-web-file` (`work/test.md`, Run 2, Test C6). | Remove the key before the leg that must reach the network: `Test::RemoveWebDocumentCache(session, url)` (`test_web_cache.h`) in a stage's `run`, `finished()` in its bounded `until`, `Check(ok())` in `then`. It clears both `cache()` and `cacheBigFile()` and reports finished only after both answered. Repaired that way in Run 3 of the same campaign. A "no request" or zero-count check on such a document is not certified until its key has been removed in that run. Confirm the instrument with `AppendWebDocumentCacheSelfTest`. |
| A paste check never pastes: the clipboard reads back empty right after `QGuiApplication::clipboard()->setText` (`formats=0`, text length 0, often already empty at the start), so the Paste accessory is never clicked or Ctrl+V inserts nothing, and every paste row stays undecided; or a single round trip fails on a transient lock - the app log reads `OleSetClipboard: Failed to set mime data (text/plain) on clipboard: COM error 0x800401d0 (OpenClipboard Failed)`, then Qt's own `Retrying to obtain clipboard.` / `Unable to obtain clipboard.` for about 0.9 s - and the clipboard reads back again within about a second | The agent-launched `-testagent` process could not read the system clipboard back on that host. Observed in `2026/09/29/keep-the-focused-word-field-in-view-when-importing-a-wallet` (`work/test.md`, Run 1, Tests 9 and 10) on a Windows host: `CLIPBOARD saved formats=0`, `clipboardTextLength=0` right after `setText`, eight paste rows undecided, `TEST_FLAW`. The cause is host-level and not diagnosed: earlier campaigns on other hosts, Windows included, wrote and read the clipboard. A save and restore does not protect the owner either: restoring a clipboard that read back empty writes the empty reading back, which clears it. The transient lock is a distinct case, observed in `2026/10/07/show-url-tooltips-and-copy-link-on-rich-message-url-buttons` (`work/test.md`, Attempt 1 Run 1, Test 0): `OpenClipboard` failed at that moment, the run did not identify what held the clipboard, a later `Get-Clipboard` read fine and `GetOpenClipboardWindow()` was 0, and that run's single, un-retried round trip left every clipboard oracle undecided. Qt's own retries are short and sleep the main thread: `OleSetClipboard` three times 100 ms apart on `CLIPBRD_E_CANT_OPEN`, `OleGetClipboard` three times 50 ms apart (`qwindowsclipboard.cpp`). A locked Windows console is a diagnosed cause of the persistent shape: no process on the console's desktop can open the clipboard while it is locked, so every write fails `OpenClipboard` and the round trip ends in `read-empty` after the whole bound. Qt does not retry `OleSetClipboard` while `QWindowsContext::isSessionLocked()` - the same `WTSSessionInfoEx` `SessionFlags` reading `Test::ReadConsoleLock()` takes, but of the active console session - answers locked (`QWindowsClipboard::setMimeData` in `qwindowsclipboard.cpp`), so a locked console's writes return at once (`writeMs` 0-26 in Run 1 below), while a retried write on an unlocked console sleeps 100 ms per retry. Observed in `2026/10/07/add-a-same-turn-context-menu-reader-and-a-retried-clipboard-round-trip-to-the-test-harness` (`work/test.md`, Attempt 1 Runs 1 and 2): Run 1's live arm logged 10 attempts, each `read=empty owns=0`, and ended in `read-empty`, beside ten `OleSetClipboard ... 0x800401d0 (OpenClipboard Failed)` lines in the app log, and an independent PowerShell reading right after it found `LogonUI.exe` in session 1, `GetForegroundWindow()` 0 and `OpenClipboard(NULL)` failing with `GetLastError` 5 while Telegram was not running; Run 2, the popup-capture self-test alone, launched with `LogonUI.exe` still present; Run 3, unlocked, read the sentinel back at attempt 1. The 2026-09-29 run did not record whether its console was locked, so a locked console is a candidate cause for that case, not its diagnosis. | For checks about what a field does with pasted text, use `Test::DropText(field, text)` (`test_widgets.h`), which never reads or writes the clipboard, and judge its `TextDrop` (`delivered`, or the named refusal) before the product result. Run 2 of the same campaign repaired it this way in its overlay. Do not save or restore the clipboard around it. The helper does not exercise the Paste accessory's or Ctrl+V's own clipboard read: a check whose subject is that read still needs a host where the clipboard reads back, and it refuses by name rather than FAILing when it does not. Confirm the instrument with `AppendTextDropSelfTest`. Tell the transient lock from the persistent case with `Test::AppendClipboardRoundTrip` (`test_clipboard.h`): a caller-labelled sentinel written and read back up to 10 times 300 ms apart, yielding to the event loop between attempts instead of sleeping, each attempt logged as a `CLIPBOARD_ROUND_TRIP_ATTEMPT` row. A transient lock reads its sentinel back at a later attempt; the persistent case ends in the named refusal `read-empty`, `read-stale-sentinel` or `read-foreign`, which never prints text the harness did not write. Run 2 of `2026/10/07/show-url-tooltips-and-copy-link-on-rich-message-url-buttons` decided every clipboard leg behind a bounded retry of the same size, written by hand with a main-thread sleep between attempts, and its premise read `ok:1 attempts:1`. Judge a product copy with `Test::ReadClipboard`. Confirm with `AppendClipboardRoundTripSelfTest`. On a locked Windows console, read the console with `Test::ReadConsoleLock()` (`test_console_lock.h`): a refused round trip's reason already ends with it (`; console at refusal: CONSOLE_LOCK: state=...`), so a campaign's own refusal names a locked console with no wiring, and `AppendClipboardRoundTripSelfTest`'s live arm is `TEST_RESULT: N/A` naming the lock - the probe row, the refusal and its attempts - instead of failing `read-empty`, only when the probe reads locked as its judging stage begins and the round trip did not read back, so a round trip that read back is never withdrawn; its injected-accessor arms and its foreign-text scan still run and decide. A campaign gates its own clipboard leg the same way, through its judging stage's `skipReason`. The rule: for these arms a locked console is a scheduling condition - rerun them on an unlocked console. This applies to Windows; `Test::ConsoleLockGate` answers only in a Windows build, so no gate fires elsewhere, while a refusal on macOS still prints the session's lock reading (the macOS observation is in the menu-capture row above). |
| A check that samples an effect through a driven sequence reads it unchanged at every sample although the drive itself acted - for example `E6_SWIPE build=before samples=58 preShown=15.0000 maxTurn=0.0000` with `shownMoves=0 centreMoves=0` beside `minShift=-40` and a passing "the swipe moved the card on screen" control - while the product's own pending flag, wherever a sample reads it, stays set. The build or leg that must show the effect reads it unchanged as well, so a "nothing changed" check on the other build passes vacuously | The product applies the effect in a callback it posted with `crl::on_main`, and the sampler never returned to the event loop between samples, so that callback could not run until the sequence was over. `crl::on_main` never runs its callback inline: `Telegram/lib_crl/crl/crl_on_main.h` picks `crl/dispatch/crl_dispatch_on_main.h` when `CRL_USE_DISPATCH` is defined without `CRL_FORCE_COMMON_QUEUE` (`Telegram/lib_crl/CMakeLists.txt`; that is macOS outside the Mac Store build), whose `on_main` is a `dispatch_async_f` onto `dispatch_get_main_queue()` (`crl/dispatch/crl_dispatch_async.cpp`), and `crl/common/crl_common_on_main.h` otherwise, whose `on_main` pushes onto a `crl::queue` (`crl/common/crl_common_queue.h`) that wakes `PushToMainQueueGeneric` in `Telegram/lib_ui/ui/main_queue_processor.cpp`, which only posts a `QEvent` to `Ui::MainQueueProcessor`. The queued callback then runs on a later event-loop turn, or when a `QEvent::UpdateRequest` reaches `Core::Sandbox::notify` (`Telegram/SourceFiles/core/sandbox.cpp`), whose `widgetUpdateRequests()` stream makes `Ui::MainQueueProcessor` drain the queue (`Platform::DrainMainQueue()` or `DrainMainQueueGeneric()`): `QWidget::repaint()` can send one synchronously, while `QWidget::update()` only schedules one and an offscreen frame through `Ui::GrabWidgetToImage` or `Test::ForceWindowActive`, which flushes only window-system events, sends none. The observed sampler was the `Script` sequencer of the run's saved overlay (`work/test-overlay.patch` of the task below): `Script::advance()` is a `while` loop that stamps `_lastRun` before each step's action and arms its timer only for a step not yet due, so a step whose action outlasts the next step's delay runs that next step inline. The campaign's saved CSVs (`evidence/swipe-before.csv` from Run 3, `evidence/swipe-after.csv` from Run 4, whose build never pumped) put consecutive samples' `at` 22-40 ms apart against a 16 ms delay, so each next step was already due and all 58 samples ran inside one `advance()` call. Observed in `2026/10/02/turn-gram-cards-only-by-visible-angle-steps` (`work/test.md`, Run 2): the card-angle tracker's follow, posted through `crl::on_main`, never ran during the 58-sample drive of about 1.5 s, so the build before the change showed no turn and the after build's earlier pass decided nothing. This differs from the `ActivateClickHandler` deferral row above: there the click landed and the handler ran one main-queue turn after a reading taken in the clicking tick, and a bounded `until` wait repairs it; here the sampler does not return to the event loop between samples, so the posted callback does not run during the sequence at all, and no wait after the sequence repairs samples already taken. | After each driven frame, pump `QCoreApplication::processEvents()` with the window re-activated before each pass (`Test::ForceWindowActive`), bounded to at most 5 passes, until the product's own pending flag clears; record the pass count and the flag after the pump in the sample's row, and only then read the effect. Never judge an effect from samples taken before the posted callback could run. Keep a control build or leg that must show the effect, so a callback that never ran fails it instead of passing silently. Repaired that way from Run 3 of the same campaign: the posted follow ran within 2 passes on each of the 20 samples that had scheduled one, and the before build turned 4.8204 deg and sprang back. |
| A decisive bracket spans a sample gap far above the sampler's cadence while the measured surface paints back to back, and the product's own timers report similar lateness - for example a 16 ms timer sampler whose grab 25 (`hi` 44159) and grab 26 (`lo` 44211) are 52 ms apart across product frames 44159, 44173 and 44193, beside the product's `arrive due=44159 late=52`, so `vstart(B2).hi - turn` read 75 against 50 and stayed undecided | A timer-driven sampler is not synchronized with the paints it measures: whatever runs between two of its ticks falls into one gap, and the tick itself can fire late. Observed in `2026/10/05/play-gram-card-read-animations-one-after-another` (`work/test.md`, Attempt 1 Run 1, Test 2), which read that lateness as back-to-back product paints starving the timer queue without measuring it. Four launches of `AppendPostPaintSamplerSelfTest` (task `2026/10/06/add-a-post-paint-capture-sampler-to-the-harness`: a calibration launch, one with every self-test, and two whose mutated sampler left the control unchanged) measured it on its 18 ms synthetic owner, whose every paint requests the next. In every one the event loop started product paints while the 16 ms control's tick was already overdue (`overdueStartsTotal` 11, 22, 11 and 8 in that order), and each launch's latest tick had such paints in its overdue interval (`lateMax` 87, 34, 107 and 74 ms, with `overdueStarts` 1-2 and 36-54 ms of overlapping paint, less than the lateness in all but the launch with every self-test). Ticks with no fixture paint in their overdue interval were at most 2 and 4 ms late in the two mutated launches, did not occur in the launch with every self-test, and reached 36 ms in the calibration launch (`lateNoPaintMax`); the median tick was 2-32 ms late (`lateMedian`). So the measured lateness is consistent with back-to-back product paints holding an overdue timer, with something besides fixture paints adding to it, and the product's own timers can wait the same way. In the launch with every self-test the control's largest gap was `gapMax=50`, with `missed=22/45` product paints that no sample followed, while the post-paint sampler on the same owner read `gapMax=20` and `missed=0/41`, its largest delay from a paint's return to the covering sample `delayMax=2` within `bound=36` (one product paint plus one grab). That is a measurement of these launches on one host, not a general law. | Sample the owner with `Test::PostPaintSampler` (`test_post_paint.h`) over sampling windows around the transition, with grab-free windows wherever the product's own paint must not be preceded by a grab, and gate each decisive bracket on its distance to the previous sample, recording a bracket that still spans a gap as undecided. Repaired that way from Run 2 of the same campaign: 9 post-paint grabs in `[turn - 100, turn + 300]`, the bracket 20 ms after the previous sample (its `G-sample` gate, bound 34 ms), and the bound read 46, decided. Confirm with `AppendPostPaintSamplerSelfTest`. |
| Coordinated `Test::PostPaintSampler`s on children of one composite owner, each action grabbing the whole composite, report product paints and samples no product update caused, and keep queueing samples of each other while the window is open | Each sampler's recursion guard covers its own action only. A composite grab one sampler's action takes paints every child synchronously through `QWidget::render`, so the other children's samplers classify those harness paints as product paints and post samples whose grabs paint the first child again. Observed in `2026/10/18/tighten-money-tabs-without-moving-the-transactions-title` (`work/test.md`, "Independent discovered harness follow-up"); its disposable recovery shared a capture flag and published each paint's receipt through owner properties. | Hand every such sampler one `std::make_shared<Test::PostPaintCaptureScope>()` (`test_post_paint.h`): a paint any member receives while any member's action runs is then a `Capture` receipt (`ignored=`), never sampled, while a later paint that a capture paint requested is still a product paint and is sampled. Reconcile the overlay's own paint records to `receiptsSince(mark)` by receipt index, and prove a first paint with one `update()` and `firstReceiptSince(mark)`, never with visibility or time. Samplers that share no scope keep the instance-local guard. Confirm with `AppendFullOwnerCaptureSelfTest` group A, whose arm A3 shows the defect with unscoped samplers. |
| A containment or compare row on a top-right or bottom corner patch names a media colour as the background, or counts every "background" pixel changed while the capture shows the arc intact - for example `right background #e0189c: 1046 of 1046 background pixels changed` beside `left background #ffffff: 0 of 191` | The background was read at patch pixel (0, 0) for every patch. That pixel lies beyond the arc only in a top-left patch; in a top-right or bottom patch it is a media pixel, so the "background" mask was the media, and any slide, spoiler or frame change inside it counted as a changed background pixel. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 1, failed assumption 9: 14 FAIL rows). | Read the background with `Test::ReadCornerBackground` (`test_corner_patch.h`) and the patch's `PatchCorner`: it reads the patch's own corner-most pixel (`CornerMostPixel`), keeps only the component of that colour connected to it, and refuses `media-at-corner` instead of returning a media colour; `ReadCornerContainment`, `CompareCornerCoverage` and `GateCornerChrome` take their background from it. Run 2 of the same campaign repaired its rows by reading each patch's own corner. Confirm with `AppendCornerPatchSelfTest`. |
| A pixel-identity or "within N of the media colour" corner compare fails between twins whose media colours legitimately differ - letterbox fill, map tiles, another media kind - with the differences only at the arc's ends, or a tiny channel delta on nearly every pixel: `shape sets 1048 vs 1046 pixels, only-a=2 ... a(31,0) a(0,31)`, `1273/1296 maxChannelDelta=3` | An arc pixel is a blend of the media colour over the background, so its colour moves with the media colour: a device-exact compare differs wherever the media differs at all, and a fixed-colour set such as "within 2 of the media colour" gains or loses the arc-end pixels with the contrast. The source run's recomputation of those patches by coverage found the same arcs (largest deltas 0.0034-0.047). This differs from the (0, 0) background row above: there the wrong pixel was taken for the background; here the background is right and the colour model is wrong. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 1, failed assumption 3: 3 FAIL rows). | Compare by coverage with `Test::CompareCornerCoverage` (`test_corner_patch.h`): each pixel's media share over the reference background, on the channel where they contrast most, within `kCoverageSameKind` (0.03) for one media kind or `kCoverageCrossKind` (0.06) across kinds, with each twin's media colour sampled inside its media away from the arc and from chrome. Colour twins with the same arc compare equal, while another radius, a square corner or a one-pixel arc shift moves pixels by 0.3-1.0. Repaired that way from Run 2 of the same campaign. Confirm with `AppendCornerPatchSelfTest`. |
| A corner compare reports hundreds of differing pixels, all inside one compact shape within the media and none outside it - `mismatching device pixels=742/1296` - or one side's containment mask holds a few more "background" pixels than the other, and they change in every frame (`right corner TR background #ffffff: 6 of 197` beside `left corner TL background #ffffff: 0 of 191`); or a media colour sampled at a corner inset reads a badge's text or fill (`#e1edf0`) | Chrome is painted inside the patch, over the media. A video or GIF draws its corner-status badge at the top left (`Gif::drawCornerStatus()` -> `PaintVideoCornerStatus()`, `st::msgDateImgDelta` in from the media's corner). `HistoryView::Photo` draws its enlarge badge at `Photo::enlargeRect()`, `st::historyPageEnlargeSkip` in from the top right, when `_showEnlarge` is set: `Photo::countCurrentSize()` sets it for a photo that is not its message's own media, on a message that is not sponsored and whose media has a web page that `suggestEnlargePhoto()` (a site name, a title or a description), with the photo at least `2 * st::historyPageEnlargeSkip + st::historyPageEnlargeSize` in both dimensions, and `Photo::draw()` paints it only once the photo is loaded. Its white glyph equals a white background exactly, so a mask of "every pixel of the background colour" takes it in. This differs from the colour-twin row above: there the arc pixels move with the media colour; here the arc matches and the difference is a shape inside the media that the twin does not draw. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 5: all 8 FAIL rows, from the enlarge badge in the top-right patch; Run 1: 5 FAIL rows from colours sampled inside the corner-status badge). | Exclude the chrome's exact shape, built from the product geometry and grown by a device pixel, only through `Test::GateCornerChrome` (`test_corner_patch.h`) on a twin or reference that does not draw it - it refuses a region touching an arc or background pixel there (`chrome-touches-arc`, `chrome-touches-background`) - and pass the accepted chrome to `CompareCornerCoverage` / `ReadCornerContainment`, which refuse one the gate did not accept. `ReadCornerBackground`'s corner-connected mask keeps an enclosed glyph out of the background on its own. Sample media colours away from badges. Repaired that way in Run 6 (the badge's shape excluded behind a twin gate) and Run 2 (badge-free colour sampling) of the same campaign. Confirm with `AppendCornerPatchSelfTest`. |
| A same-state strict comparison of two captured frames fails on about a thousand pixels of a static gradient, mostly one channel by one level, while geometry, content and every settled control agree - for example `outside1046`, all inside a `QLinearGradient` avatar | The two arms took different render paths: one rendered the full owner and cropped, the other rendered the shifted region directly (`GrabRect(owner, rect)`, or `prepare(owner, origin, rect)`). Qt's raster gradient fetch (`qt_fetch_linear_gradient_template`, `qdrawhelper.cpp`) steps a truncated fixed-point increment from each span start, so a span starting at the crop's left edge reads another stop-table entry than one starting at the gradient child's edge. Observed in `2026/10/18/tighten-money-tabs-without-moving-the-transactions-title` (`work/test.md`, Run 1, "Two reverse samples outside1046"): all 1046 differences inside the avatar gradient, mostly one channel by one, the endpoints full-owner renders and the samples direct-region renders. | Render both arms with `Test::RenderStrict(owner, owner->rect(), crop)` and the same predeclared crop, and compare with `Test::CompareStrict` (`test_capture.h`), which refuses `render-path-differs` and every decode-metadata mismatch before it can support equality and has no tolerance or mask. Never accept one-level differences, exclude or mask the gradient, translate or rescale. Confirm with `AppendFullOwnerCaptureSelfTest` group B. |
| A transition or reveal of a few hundred milliseconds is always captured already finished - only the destination slide or the fully revealed state, `Cm1=0 Cs2=72364` - or a clocked stage's frames all read the state from before a clicked effect: `media centre #9f116f (hidden #9f116f, previous frame #9f116f, ...); one animation-manager tick 41 ms after the click`, and the same at 100 and 160 ms | A `Ui::Animations` value changes only on an animation-manager tick (`Simple::value()` returns what the last tick stored), and the manager ticks from the event loop; the runner reads a stage every 50 ms, so a 200 ms animation is often over by the next reading, and a minimized window gives no paint to wait for. A stage that ticks the manager itself still reads nothing if the click went through `ActivateClickHandler()` (`Telegram/lib_ui/ui/click_handler.cpp`): it posts `onClick(context)` with `crl::on_main`, and `Test::Settle` drains only `Ui::PostponeCall`, so the handler runs only after the synchronous stage has returned, after every frame. This differs from the `ActivateClickHandler` row above: there the handler ran one main-queue turn after a reading taken in the clicking tick, and a bounded `until` wait repairs it; here the clocked stage never returns to the event loop before its frames, so no wait inside it helps. It differs from the `crl::on_main` sampler row above as well: there the product's own posted callback needs pumping between samples; here the harness's own click must not be posted at all. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 2, failed assumption 2: 12 transition premises; Run 3, failed assumption 1: three reveal premises). | Clock the frames with `Test::RunClockedFrames` (`test_animation_clock.h`): it calls the handler's `onClick(context)` inside `Test::Settle`, drains the postponed calls, waits on the main thread until each requested elapsed time, ticks `Core::App().animationManager().update()` once with a probe proving the tick, renders synchronously, prints each frame's reached elapsed bounds and reports a time past the declared end as `N/A`. Keep each render cheap: a grab, no save. Repaired that way in Runs 3-5 of the same campaign: Run 3 decided every clocked transition, Run 4's direct `onClick` decided the reveal, and Run 5, grabbing only the subject's strip between ticks, took all three reveal frames at 41, 100 and 160 ms. Confirm with `AppendAnimationClockSelfTest`. |
| Every normal-speed clocked frame or sampler row of a switch is `N/A` with no visible subject - `RunClockedFrames` frames, timer samples or `PostPaintSampler` samples, each with an empty clip and item list (`clip=[0,0 0x0] squares=[]`) - while the switch itself acted and its first state was read | The incoming section is a tall `Ui::SlideWrap` that covers or pushes out the subject by the first captured animation tick. `Ui::SlideWrap<RpWidget>::toggle` (`Telegram/lib_ui/ui/wrap/slide_wrap.cpp`) starts its `Ui::Animations::Simple` (`Telegram/lib_ui/ui/wrap/slide_wrap.h`) with `anim::linear` over `st::slideWrapDuration` (150 ms, `Telegram/lib_ui/ui/basic.style`) unless `setDuration` changed it, so at normal speed a section thousands of pixels tall grows by its whole height in those 150 ms. The subject's visible window can end within milliseconds, leaving nothing for the first clocked frame or later sample to judge. `Ui::Animations::Simple::startPrepared` (`Telegram/lib_ui/ui/effects/animations.h`) multiplies the duration by `anim::SlowMultiplier()` (`Telegram/lib_ui/ui/effects/animation_value.{h,cpp}`) once, when the animation starts, so changing `anim::SetSlowMultiplier` does not alter a running `Simple`'s stored duration. `Ui::Animations::Basic` has no duration or built-in slowing; its owner may scale its own times, as `Slowing()` in `Telegram/SourceFiles/boxes/star_gift_craft_animation.cpp` does. The multiplier is process-global; nothing under `Telegram/SourceFiles/test/` sets it, and a Debug build's `MainWindow::eventFilter` (`Telegram/SourceFiles/mainwindow.cpp`) toggles it with Ctrl+F11 (×10) and Ctrl+F12 (×50). This differs from the clocked-animation row above: there the frames read a finished or untouched state because nothing ticked at the chosen times; here a tick is proved but its subject is already gone. Observed in `2026/10/20/start-collectibles-at-the-transactions-top-skip` (`work/test.md`, Baseline B0, Run B1, Test 2, judged `TEST_FLAW`): switching the Money window from Collectibles to Transactions, the 30-row incoming list (2326 px) grew about 15.5 px/ms and pushed the grid below the viewport end (513) within about 13 ms; the first captured tick reached `[4,16]`, so all five normal-speed reverse frames and the real-click timer samples were N/A (`clip=[0,0 0x0] squares=[]`); its `work/evidence-before-result.md` ("Harness gaps and findings", item 1) gives about 7 ms at 200 %. | Slow one switch and judge it on what it reached. Read and print `anim::SlowMultiplier()` and register restoration in `Test::Runner::onFinish` (`Telegram/SourceFiles/test/test_runner.h`) first, then call `anim::SetSlowMultiplier(k)` before the action that starts the switch - in the `run` that calls `Test::RunClockedFrames` (`Telegram/SourceFiles/test/test_animation_clock.h`), or before the `Test::Click` that a `Test::PostPaintSampler` (`Telegram/SourceFiles/test/test_post_paint.h`) window watches - never after it. Scale the requested `elapsed` times and `animationEnd` by `k`, as the animation-clock paragraph under “Capture and visual assertions” asks ("scale times by `anim::SlowMultiplier()`"), keep its `anim::Disabled()` gate, and judge each frame at both ends of its printed `reached=[<lo>,<hi>]` against the scaled duration. Restore the value read first right after the leg, on every refusal or gate path that set it, and again from `Test::Runner::onFinish`, which a stage timeout or the watchdog does not skip. Slow one switch, not the scenario: every `Simple` started while the multiplier is set is slowed too. A slowed leg can still lack coverage: write each frame or sample with no visible subject as a named `TEST_RESULT: N/A`, and a sampled leg with too few decided samples (the source's rule: fewer than 3, or an empty third of the window) as a named N/A for insufficient coverage, never a pass. **Forbidden:** counting a vacuous frame or sample as proof (the source's recovery plan forbade "treating vacuous N/A frames as mechanism proof"), and setting the multiplier after the switch started. The slowed clocked leg recovered coverage in Run B2 of the same campaign (Test 4): a ×10 reverse leg reached `[0,23]` to `[77,100]` with squares visible in frames 1-5, while frames 6-9 were N/A again; and in Attempt 1, Run A2, Test 5, the ×10 real-paint reverse leg stayed a named N/A (3 decided samples, thirds 0/2/1), the list covering the first square within about 76 ms. |
| A tail-presence or other edge-shape reading of an incoming bubble in the default theme reads nothing on every twin, including the control that must show a tail - `tail present - ... 0 of 240 device pixels differ` - so every "no tail on either twin" row beside it passes vacuously, and the saved list capture shows white bubbles on white with only their one-pixel shadow line | In the default palette `msgInBg` is `windowBg` (`#ffffff`, `Telegram/lib_ui/ui/colors.palette`), and `Test::GrabWidget` / `Test::GrabRect` hand `st::windowBg` to `Ui::GrabWidgetToImage`, which fills the image of a target without `Qt::WA_OpaquePaintEvent` with it before rendering, so every pixel beyond the bubble reads `#ffffff` whether a white tail covers it or not. This differs from the `lightButtonBg: windowBg` row above: there the requested fill is the box's own background and `DeriveBand` names that refusal; here the subject's own colour equals the capture base, nothing refuses, and a present and an absent tail read the same. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 2, failed assumption 1: 2 FAIL rows, and five "no tail" rows vacuous in Runs 1 and 2). | Render the tail area directly - `Element::draw()` with the list's own paint context (`HistoryInner::preparePaintContext()` for the legacy history, `ListDelegate::listPreparePaintContext()` for a `HistoryView::ListWidget`) - into an image filled first with a mid grey (`#808080`), for both twins, and keep a twin that must show the tail as the positive control in the same render. Repaired that way from Run 3 of the same campaign: the tail-present controls read 105 of 240 and every no-tail row 0 of 240 on both twins. |
| A twin row on a message drawn without a bubble - a map or a photo with no caption - compares the wrong pixels because its media rect, built from `mediaTopLeft()`, lies outside the element's bubble geometry: `twin media x 0..320 bubble 132..452`, `mediaTop-G=-6` | `HistoryView::Message` overrides `Element::mediaTopLeft()`, which answers `innerGeometry().topLeft()`, with `_lastMediaPosition`, and the only writer of that member is the `paintMedia` lambda inside the `if (bubble)` branch of `Message::draw()` (`history/view/history_view_message.cpp`). A media-only message has `Message::drawBubble()` false - no visible text, and media that does not `needsBubble()`, such as a map whose `Location::needsBubble()` finds no title, description, comments, reply, forward, sender name, via bot or topic button - so the bubble-less `else if (media && media->isDisplayed())` branch draws it and never writes the member: the accessor answers its default `(0, 0)`, the element's own top-left, or a position an earlier bubble paint of that element stored. This differs from the geometry-oracle row above: there rects of different widgets were compared without a shared origin; here one element's own accessor answers a position from another paint, or none. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 1, failed assumption 2: 3 FAIL rows). | For a message with no visible text (`hasVisibleText()` false) whose `mediaTopLeft()` falls outside its bubble geometry, take the media rect from that geometry - left `innerGeometry().x()`, top the element's top plus `marginTop()` - with the media's own width and height, and print which source the rect came from. Repaired that way from Run 2 of the same campaign. |
| A synthesized text-selection drag over the legacy chat history selects nothing - `drag 439,36695 -> 78,36407 selected text ""` - although its press, moves and release all reached `HistoryInner` | The press (`mouseActionStart()`), every move and the release (`mouseActionFinish()`) go through `HistoryInner::mouseActionUpdate()`, which maps the pointer and passes it through `HistoryWidget::clampMousePosition()`: x is clamped into `[0, scroll width)` and y into `[scrollTop, scrollTop + scroll height)`. A drag whose points lie in list coordinates outside the visible area therefore lands on the viewport's edge row and selects nothing there. This differs from the drag/wheel/cancel row above: there a wrapper received an event that its child, presentation or viewport owns; here the event owner received every event and clamped its point. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 2, failed assumption 5; Run 1 had blamed a press past the glyphs). | Scroll both drag points into the viewport first, and gate the drag on a premise row that prints both points, `scrollTop` and the viewport height. Repaired that way from Run 3 of the same campaign: `drag rows [36407,36695] scrollTop=36294 viewport=514`, then the same drag selected the text. |
| A selection-paint mask over a horizontally scrolled block of an `Iv::Markdown::MarkdownArticle` fails on a selected glyph cell at the scroll viewport's left or right edge: the cell reads zero changed pixels while its selected neighbours change - `25:sel:0.00:0` - although selection and copy are right, and cells only partly at the edge pass on a reduced share (0.57-0.75). Or a painted extent read at that edge, such as an inline pill's painted run, is short by one or two whole indicator widths - `394` for `400`. The grabs show a uniform column in the owner's accent colour there (3 logical px in the recorded chat run), the same in the plain and selected frames | The scroll owner paints overflow-indicator strips over the content it scrolls. `PaintHorizontalOverflowIndicators()` (`iv_markdown_article_paint.cpp`) does nothing while `horizontalScrollMax <= 0` or the passed viewport is empty; otherwise it fills a left strip while `horizontalScrollLeft > 0` and a right strip while `HorizontalRightEdgeHidden()` (`horizontalScrollLeft < horizontalScrollMax`), each `OverflowIndicatorWidth()` wide - the layout style's `displayMath.overflowWidth` for display math and `table.overflowWidth` for every other owner, clamped to `[1, viewport width]`: 3 logical px in the source run's in-chat `st::messageMarkdown` (`iv.style`), not a fixed width for every scale - in `ScrollOwnerAccentColor()`, the paint style's colour for the owner's kind: `supplementaryTextColor` for a Details, `table.overflowFg` for a table, list or flow text, and the kind's own accent for display math, code, a quote or an EmbedPost. It intersects the painter's existing clip with the viewport its caller passes (and any supplied shape clip), which differs by owner: `LaidOutBlock::scrollViewportRect` (`iv_markdown_article_layout_blocks.h`) for a Details, quote, EmbedPost, list or list item; `visibleTableRect`, inside the table's shape clip path, for a table (`PaintWholeTable()`, `PaintTableRowBand()`); `scrollViewportRect`, or when that is empty `visibleFormulaRect` for display math and `contentRect` for a code block; `FlowTextViewportRect()` (`scrollViewportRect`, or `outer` when that is empty) for a paragraph, heading or thinking block. The indicator calls follow the scrolled text or children when those are drawn, nested owners included. An EmbedPost paints its author and date labels and children before its own call, and its caption after; an enclosing owner's later strips can still cover that caption. `HorizontalOverflowContentClip()` (declared in `iv_markdown_article_paint.h`), which a table clips its cell text to, returns the rectangular viewport minus its edge strips; it does not apply the shape clip. For strips proved opaque and unchanged on the measured line, selection or text changes beneath them cannot alter the grabbed pixels: these strips are intended product paint, identical in both versions of the paired run, not a product defect. Observed in `2026/10/19/make-embed-post-labels-selectable-in-the-right-details-padding` (`work/test.md`, Run 1, the base half, judged `TEST_FLAW`): its only two FAIL rows, `A3.S_rdate.dateB.{forward,reverse} (base): selection paint …`, read `25:sel:0.00:0` for glyph 25, a U+202F in an EmbedPost date at article x `[382,385)` with the Details scrolled to 12, wholly under the right strip, while glyph 43 at 0.67 and glyphs near the left strip at 0.70, 0.67 and 0.71 passed only because enough of them stayed visible. `2026/10/17/make-scrolled-details-captions-selectable-in-the-body-padding` (`work/test.md`, Runs 2, 3, 6 and 7) passed glyphs partly under the Details strip at shares of 0.57 to 0.75 the same way. Before the current paint code, `2026/08/04/bound-nested-inline-pill-by-its-band` (`work/test.md`, Run 2 identification, Run 7 Test 19 accounting) found an enclosing blockquote's two 3 px indicators over a pill's caps and later accounted for them as `394 + 3 + 3 = 400` (a 400 px run painted as 394 at `scroll=7/14`), and `2026/08/10/verify-pill-band-rebuild-and-translate-quote-toggle` (`work/test.md`, Group P1, Test 7 oracle used in the recorded runs) names a painted number short by one or two `overflowWidth` units as this overdraw. This differs from the text-selection drag row above: there the drag selected nothing; here selection and copy are right and the strips hide the pixels. | Four steps, from the source's "Recovery plan after Run 1". (1) Derive the strips from the owner's own laid-out fields (`horizontalScrollLeft`, `horizontalScrollMax`) and the viewport its paint passes, with the paint's width, clamp, conditions and clipping, and print them and the expected colour in a premise row. (2) Prove them with a pixel control on the measured line: every strip pixel is the opaque expected colour in the plain frame and unchanged in the selected frame, and where the highlight spans a strip, a strip-wide flank on each side of it changes. A failed control is a `TEST_FLAW` gate, never a product result. (3) Exclude only the proven strip pixels from each glyph cell: a wholly covered selected cell reads occluded and gets no share; a partly covered cell is judged on its visible remainder with the share threshold unchanged; the mask requires at least one visible selected cell; the changed, outside-highlight and outside-clip counts still cover the whole line. (4) Forbidden: judging a glyph cell on pixels hidden by an opaque strip; lowering the selected-share threshold or widening the mask inflation; dropping the occluded glyph from the plan or the copy literal; moving the drag endpoints or picking another scroll state to dodge the strip. For a painted extent, account for each strip actually drawn over that measured run by name from the same derivation, as in the recorded `394 + 3 + 3 = 400`, instead of widening a tolerance. No helper under `Telegram/SourceFiles/test/` reads selection masks: the source's `ReadOccluders()`, `ReadOcclusionControl()`, `ReadMask()` and `MaskCoherent()` live only in its disposable overlay (`work/test-overlay.patch`). Repaired that way in Run 2 of the same campaign, which repeated the base half: `occluded=[25]`, neighbours 24 and 26 changed, flanks `left=192 right=192`; Run 3 then ran the candidate half against it and was approved. |
| A paint-cost bound written as a ratio of Debug timings fails by about 2x on a frame whose paint is one or two full-frame blits - `median ms edge=31.28 control=16.31 (bound: <= 2x and <= +4 ms)` - or a timing delta between two different views lies far above the added work's own cost (`delta 53.87` against `0.98 ms`) | This macOS checkout's Debug build links Qt's Debug-configuration static library: `Qt6GuiTargets-debug.cmake` imports `libQt6Gui_debug.a` as `IMPORTED_LOCATION_DEBUG`, and the generated Xcode project links the `Telegram` target's Debug configuration with it and its other configurations with `libQt6Gui.a` (on another platform, read its own link line). In the source run's standalone probe, built against the same Qt prefix, one 792x594 SourceOver blit cost about 14-15 ms in `libQt6Gui_debug.a` against about 0.14 ms in `libQt6Gui.a`, so a Debug paint timing is mostly unoptimised Qt raster time: one more full-frame composite doubles it whatever the code around it costs, and two different views also differ in unrelated work. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 1, failed assumption 13; Run 2, failed assumption 8: a cross-view delta against a transparent-layer replica). | Decompose in one binary: time one view in both arms (Run 3 switched only the arm under test, on the same view) beside the added raster operations timed alone on an opaque replica, bound `delta <= 1.25 x replica + 1 ms`, and add a narrow-band case whose delta must stay below the full frame's; take the absolute cost from a standalone probe built against the optimised Qt (`evidence/p1-probe/` of the source task: +0.166 ms per full frame). Repaired that way from Run 3 of the same campaign; Run 2's cross-view delta is not a repair. For a whole-widget cost, record the real owner with `test_paint_stream.h` and replay it with the shared recipe in `.agents/shared/evidence/paint-replay.md`; never add a Debug baseline to an optimized field replay (`2026/10/15/choose-a-unique-gift-for-the-qr-box`, `work/test.md`, Run 2). |
| An inline video or GIF in a chat stays on one frame across samples seconds apart - `fixture gate: autoplay advancing (...) - media centre colour per sample: [#a88615, #a88615, #a88615]`, a GIF moving only from its thumbnail to its first decoded frame - and a check that needs its progress line reads `inside the frame 0, outside 0`, while the window is minimized or not exposed (`isMinimized=1 ... exposed=0`) | `Gif::startStreamedPlayer()` starts the inline player with `waitForMarkAsShown = true`, so `Media::Streaming::Player::renderFrame()` holds each next frame until `Player::markFrameShown()`, and in the view only a paint calls that: `Gif::draw()` and `Gif::drawGrouped()` mark the drawn frame shown unless the paint is paused, and a paint context is paused while `SessionController::isGifPausedAtLeastFor()` holds, which includes an inactive window. A window that gets no compositor paint never presents the next frame: its GIFs stop after the first decoded frame and a video never leaves its first. Read the AutoPlayVideo limit before blaming it: Run 1 did, and Run 2 read it as already 50 MB (`AutoPlayVideo limit 67108864 (was 52428800)`). This differs from the undecodable-fixture row above: there the document cannot be decoded; here it decodes and its inline player exists, but no frame after the first is presented. `Test::KeepMainWindowNotMarkingRead` minimizes the primary window, which is exactly what stops such players: a scenario that uses it gets no inline playback without a pump. It differs from the clocked-animation row above too: `Test::RunClockedFrames` ticks `Ui::Animations::Manager`, which a streamed player does not use (it paces frames with its own `base::Timer`), so a clocked stage does not advance it, minimized or not. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Run 2, failed assumptions 3 and 4: 4 video gates and 3 progress-line rows). | A frame pump: render the target media rect directly every 30 ms (`Element::draw()` with the list's own paint context, the paint a compositor paint would run), re-asserting `Test::ForceWindowActive` on each pass so the context is not paused, until each twin's frame visibly advanced, and log the playback facts (`canBePlayed`, `loaded`, `inappPlaybackFailed`, `ShouldAutoPlay`, window exposure, `isGifPausedAtLeastFor`) at every gate. Repaired that way from Run 3 of the same campaign: 8 pump gates decided, at three playback positions per twin. Its proven scope is "the frame advanced": reading a playing video's progress line through the pump stalled in Runs 3 and 4, and the campaign retired "pump until the video plays" (`work/test.md`, Run 4 "Forbidden repeated techniques"); for a line, see the next row. |
| A check that needs an inline video's progress line has nothing to read: no line appears until the playback position passes 200 ms, and pumped playback stalls in the player's waiting state - `pump ticks=46 in 15227 ms; ... moved=0 line=0 (max 0)`, or eight stalled activations with FFmpeg decode errors on the fixture in the app's stderr | `Gif::paintTimestampMark()` returns while `_videoTimestamp <= 0` and `_videoPosition` is below 200 ms; otherwise it calls `PaintVideoTimestampMark()` at `_videoPosition`, or at `_videoTimestamp * 1000` while the position is 0 - on the static frame too, with no player at all - and `PaintVideoTimestampMark()` draws nothing for a position past the video's duration. Every `HistoryView::Gif` reads `_videoTimestamp` once, in its constructor, from `Media::View::ExtractVideoTimestamp()`: the media's own `videoTimestamp()`, else its web page's `extractVideoTimestamp()`, which parses the `t=` parameter of the link preview's URL. With video autoplay allowed, such a video still gets a player on an item that `isSending()`, as the source run's injected local items were: `Gif::draw()` stops a timestamped video only while `underCursor()` is false, and `underCursor()` compares `ClickHandler::getActive()` with `currentVideoLink()`, which is null because `currentAction()` is `Action::None` for a sending item, so with no active click handler the two nulls are equal and `playAnimation()` runs whenever autoplay is eligible. Observed in `2026/10/06/round-rich-message-edge-media-like-ordinary-media` (`work/test.md`, Runs 3 and 4, and Run 4's failed assumption 4: the line does not need playback). | A fixture whose link preview URL carries `?t=<seconds>` within the video's duration, with the in-memory AutoPlayVideo limit set to 0 for the leg (`Data::AutoDownload::Full::setBytesLimit(source, Type::AutoPlayVideo, 0)` on the session's `autoDownload()` settings), restored after it and again in teardown, and a premise row reading `Data::AutoDownload::ShouldAutoPlay()` false for the document (a per-peer `ForceAllow` override falls back to the default limit when the limit is 0), so that no inline player is created; every paint then draws the line at the timestamp. Repaired that way in Runs 5 and 6 of the same campaign (`ExtractVideoTimestamp(item)=7 s ... AutoPlayVideo limit 0, ShouldAutoPlay=0`). This differs from the inline-player row above: there the pump makes frames advance; here no playback is needed when only the line is read. A link preview with a site name, title or description also turns on the enlarge badge of the message's other photos: see the corner-chrome row above. |
| A deadline or cutoff check passes while its own details print an epoch-sized negative remaining time (for example `remainingMs=-1791001355050`), a clock-update control compares `0==0`, or later boundary actions replay at a bogus time and duplicate earlier outputs | The overlay read the expiry from an untyped dynamic property (a missing value became 0), accepted a fractional-gap premise without a positive expiry, compared two zero values as its clock control, and kept one mutable cutoff that later actions overwrote and sampled. Found in `2026/10/17/open-ones-own-qr-box-without-a-username-with-temporary-only-codes` (`work/test.md`, "Run 3 assessment"). | Record the served value as a `Test::ExpiryObservation`, read the product's typed value into a separate `Test::ExpiryReading`, and freeze one `Test::ExpiryWindow` per output with `Test::FreezeExpiryWindow`, treating its named refusal as a fixture gate. Wait only through a `Test::ExpiryBoundaryWatch` polled with `Test::ReadServerClock()`. Confirm with `AppendExpiryWindowSelfTest` ([test_expiry_window](helpers/test_expiry_window.md)). |
| An off-screen gate fails although the carriers are off screen by geometry and absent from `Tgw::Runtime::WatchingOnScreen()`: they read `runtimeVisible=1` (`_visible=1`) - `fixture gate: B4: every carrier is scrolled off` failed so in `diag-real-1`, the first diagnostic launch of recovery 2 of `2026/10/26/deliver-bot-state-edits-and-poll-watched-shared-state-to-running-widgets` (its `work/test.md`), after the product had released those carriers' runtimes off screen | The overlay read the cache `Tgw::Runtime::_visible`. `Runtime::RefreshVisibility()` (`Telegram/SourceFiles/tgw/tgw_runtime.cpp`), run from the posted `Runtime::Check()`, flips it only for runtimes that are `heavy()`, `stopped()`, painted or display-deferred. `HistoryInner::visibleAreaUpdated()` unloads the heavy parts of views more than `kUnloadHeavyPartsPages` (2) visible-area heights away synchronously, inside the scroll handler and before the posted check; `Runtime::unload()` clears the painted flag, so `RefreshVisibility()` skips that runtime and its `_visible` keeps its last value. `Runtime::queryVisible()` answers fresh, and so does `WatchingOnScreen()` for off, because it also requires `queryVisible()`. | Place the carriers with `Test::AppendPlaceInChatList` and prove the window with `Test::AppendStayedInChatList` ([test_chat_show_place](helpers/test_chat_show_place.md)), passing a fresh reading: `queryVisible()` through the file-private accessor idiom, or membership in `WatchingOnScreen()`. Print `_visible` only as a diagnostic, never judge it. |
Classify a sound assertion against changed behavior as an implementation bug,
not a test flaw. Classify a wrong fixture, target, readiness model, event
route, capture owner, or oracle as a test flaw. Preserve everything a failed
run proved, repair all visible harness faults together, and rerun the packed
scenario rather than fragmenting it into isolated launches.
When a flaw's cause is the instrument idiom rather than this task's fixture,
repair it here as well as in the overlay: add the missing helper, tighten an
existing contract, or add its row to the table above, in the same run that
diagnosed it. A diagnosis that stays in one task's notes is rediscovered by
the next task, which is how the `Test::Probe` window row and the
`Test::DiscriminatingScan` row above cost four runs each before they were
written down.