Skip to content

fix(package): verify ASAR integrity and investigate Electron startup (#44) - #51

Draft
man612 wants to merge 83 commits into
mainfrom
fix/issue44-startup-trace-20261021
Draft

man612 wants to merge 83 commits into
mainfrom
fix/issue44-startup-trace-20261021

Conversation

@man612

@man612 man612 commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Purpose

Investigate intermittent Windows Electron startup / renderer readiness in #44 with opt-in, privacy-limited instrumentation and a reproducible Windows cold-start harness. This PR is diagnostic tooling, not a claimed fix. It is intentionally separate from the ten UX improvements in PR #50.

Changes

  • src/main/startupTrace.ts: append JSONL lifecycle events only if WIREBOUND_QA_STARTUP_TRACE is explicitly set to an absolute file path. Fixed event names, times, status flags/codes and React root child count only; never capture DOM text, device IDs, paths, URLs, settings, traffic or IPC payloads.
  • src/main/window.ts: track window creation/show, page load initiation/completion/rejection, did-fail-load, render-process-gone, dom-ready, ready-to-show, and a QA-only delayed React-root probe. No automatic reload.
  • src/main/index.ts: track Electron readiness, bootstrap/window/tray/IPC/ADB milestones, runtime-path and settings-load durations; report previously unobserved bootstrap rejection.
  • src/main/appPaths.ts: trace synchronous bundled ADB fingerprint/verification/cache-copy phases (only milestone timings and number of files copied, never paths or device data). Slow disk access is a hypothesis, not a confirmed root cause.
  • scripts/qa/electron-cold-start.ps1: repeat cold-starts with fresh isolated APPDATA/LOCALAPPDATA, no remote debugging, and stop only the executable it launched after checking its path. The wait-time range is now 5–120 seconds.
  • Four unit tests for tracing disabled by default, disallowing relative trace paths, minimized trace data and failure-safe logging.
  • Full dated investigation, measurements and safe reproduction steps.

Windows QA: distinguish observed timeouts from persistent failures

Windows 11 Pro (build 26100), locally packaged Electron 44.4.1, unsigned QA installers; real VPN never started.

Scenario Result
UX PR #50 + startup trace, unpacked cold starts 3/3 pass; the slowest first mount was ~9.2s
Same UX+trace installer, initial installed NSIS QA 0/3 ready within 30s, processes were deliberately stopped at timeout; stages varied from window creation to page loading
Exact same UX+trace installer, later newly installed QA retest 2/2 pass under 65s limit, both mounted React within 4s
Baseline main + identical trace, separately built and installed NSIS 2/2 pass, both mounted React within 4s
Baseline installed app.asar vs its unpacked counterpart SHA-256 identical
Silent QA installs and uninstalls Exit 0; QA executable removed; user’s normal install path untouched

An intermediate QA retry rejected -WaitSeconds 65 due to a former 60-second parameter limit; this was a harness error before any app startup, now fixed. The timeouts are intermittent and not consistently reproducible. They do not prove a permanent renderer crash, an NSIS defect, or a regression caused by PR #50. ADB was unavailable during one successful unpacked startup, so an ADB causal link is also unproven.

Validation

  • Local Windows Node 24 npm run typecheck: PASS
  • npm test: 50/50 PASS, including 4 new tracing tests
  • npm run build: PASS
  • npm run lint: 0 errors, 54 warnings; warning cleanup not in scope
  • Windows Electron Builder: local unpacked and NSIS builds with trace PASS; test installers NotSigned and never published.
  • Hosted Windows CI on latest head 8449d8d: SUCCESS (workflow run 39708440953). Local PowerShell syntax checks and 8/8 sequence tests also passed.

Decisions / remaining investigation

Keep issue #44 open. Before attributing a cause or changing the app, collect safe OS scheduling, disk latency and Windows Defender/App Control evidence (without disabling security), and investigate the latest genuine 45-second installed renderer-not-ready observation, alongside the reproducible QA-tool false-negative case, across comparable conditions. Official Electron documentation distinguishes ready-to-show (first paint) from loadFile() and dom-ready (navigation/DOM readiness).

No dependency upgrades, external releases, hardware VPN actions, speculative reload loops or merge to main in this PR.

2026-10-21 follow-up — fixing QA false negatives and preserving genuine timeouts

A second local Windows investigation found two defects in the test harness, not in the Wirebound VPN service:

  1. A populated React root can be recorded while the window is still hidden, then window-shown can occur later. The earlier runner only accepted visible: true at the time of the single root probe, wrongly timing out if window show happened afterward. One UX run had React mounted at 4.034s and window shown at 12.693s, but the old runner called it a failure after 45 seconds.
  2. QA-initiated taskkill /T /F may append render-process-gone: killed after a successful startup; analyzing every event irrespective of order erroneously marks that launch failed.

Fix: a chronological, independently tested state machine now requires both a populated React root and a window-shown event in either order before a fatal event. The report and new optional process/Defender resource-sampling harness are included in commit 34e93c5. All 8/8 PowerShell readiness tests pass, and the trace summarizer was run over actual stored QA timelines.

Local installed-NSIS series Trace-based result
Baseline main + trace, 6 starts 6/6 reached React + visible window (slowest mount ~15.6s)
UX PR #50 + trace, 6 starts 6/6 reached React + visible window (one erroneously reported as failed by old harness)
UX PR #50 + trace, 3 new starts with corrected runner 2/3 pass, 1 real timeout at 45s: window-created at 16.5s, did-start-loading at 20.6s, no dom-ready/show/root by cutoff

Windows Defender was not disabled. Numeric sampled Defender CPU increased more during some longer startup windows, but comparisons use unequal observation durations, and the corrected timeout window had 0 Defender operational event IDs recorded. No causal Defender or Windows disk claim can be made. Do not suggest antivirus exclusions or an unconditional renderer reload.

This PR remains a draft instrumentation/QA correction, not a final fix of issue #44. Keep the issue open; dependency upgrades remain deferred.

2026-10-22 — diagnosed local ASAR corruption; added a strict packaging gate

During an instrumented local unpacked build, Electron Builder exited 0, yet the packaged application exited 1 before main-module startup. Independent inspection revealed an actual inconsistent app.asar payload/header: the packed QA report entry declared 16,612 bytes while its source had grown to 16,974 bytes during packaging; accounting for ASAR's fixed 8-byte prefix, later payload offsets were displaced by the same 362 bytes. The archive's extracted package.json contained part of renderer HTML/CSP, not valid JSON. This is strong evidence of packaging from changing input files, separate from other intermittent startup stalls.

A new scripts/qa/verify-packaged-asar.cjs verifies every embedded SHA-256-protected payload, not only the archive header or a few files, and checks the manifest plus compiled Electron entrypoints. It correctly rejects the corrupted archive (3,969 inspected; 12 failures) and accepts a known-good prior build (3,967; 0 failures). A separate Node.js synthetic corruption test passes (valid archive accepted, one-byte-tampered archive rejected).

Prevention in commit c98ddd6: electron-builder.yml excludes docs/**, which do not belong in runtime packaging. package:check runs the validator's regression test before packing and scans the actual built archive after packing. build:unpack and build:win also fail if ASAR integrity is invalid. No dependencies or network security settings changed.

Frozen clean worktree QA: Windows npm run package:check exit 0; 3,960 ASAR payloads valid / 0 mismatches, QA docs confirmed absent and main module/manifest present. The verified unpacked app then passed 3/3 isolated cold starts with no manual reload or DevTools flag: React root probes at 11.014s, 2.619s, 2.564s respectively. Typecheck, 50/50 Vitest, Node corruption test, 8/8 PowerShell readiness tests, and local lint (0 errors, 54 warnings) also passed. Details recorded in 8449d8d.

Boundary: This addresses the distinct malformed local ASAR but does not establish a full fix for #44, because other previously healthy archives experienced intermittent BrowserWindow and renderer loading delays. The first integrity-guard commit was validated initially on unpacked Electron only. A subsequent same-code locally rebuilt NSIS installer has now been tested as described below; physical Android VPN validation on this branch remains outstanding. No release or merge was done. Keep this PR in draft and keep issue #44 open.

2026-10-22 — Installed NSIS QA and mandatory GitHub Actions ASAR gate

Commit 7cf476a closes an important CI coverage gap: the prior hosted Windows workflow invoked npx electron-builder --win --dir directly, bypassing npm run qa:asar despite the latter being part of local package:check. The workflow now executes npm run qa:asar:test before packaging and npm run qa:asar after packaging. A green CI result will now actually assert the embedded ASAR's payload hashes. No dependency changes.

The same commit adds scripts/qa/nsis-installed-smoke.ps1, a manual safety-guarded Windows installer test. It refuses to touch a machine with an existing default/registered Wirebound installation or running Wirebound process, silently installs to an isolated directory, compares installed and unpacked ASAR SHA-256 values, checks every embedded SHA-256-protected file, invokes the existing chronological cold-start harness with fresh settings profiles, then silently uninstalls its own QA installation. It reports a nonzero status if install, integrity, startup or cleanup fails. This manual GUI test is not claimed as a headless CI test.

Exact Windows evidence: npm run build:win exit 0 (unsigned local NSIS, SHA-256 B5CC8A6A69682E65AECD7E36A6C0B4D9140911085191E44FB6FE972D62C2365E, not a public GitHub asset checksum); embedded ASAR guard 3,960 checked, 0 mismatches. The installed ASAR SHA-256 equaled the unpacked reference from the same build.

  • Existing isolated QA installer harness: 6/6 cold starts passed at 60s deadline. BrowserWindow shown at 0.598–1.890s and React root probed at 2.679–3.884s, all six with no manual reload or DevTools.
  • New in-repo nsis-installed-smoke.ps1: an additional 2/2 cold starts passed, full installed ASAR hash verification, NSIS uninstall exit 0, no residual executable or modification to default user install.
  • Local PowerShell script parse check 0 errors, Node ASAR corruption regression PASS, ASAR integrity 3,960/3,960 PASS, chronological readiness 8/8 PASS, CI YAML step ordering parsed and validated, git diff --check clean.

Hosted GitHub Actions verification: run 39710391308 on this exact commit PASSED. Job verify-windows separately confirmed ASAR corruption regression PASS, Electron Builder package smoke PASS, and packaged ASAR payload integrity PASS, plus typecheck and all unit tests.

These 8/8 successful installed trials increase confidence in the guarded build and manual installer procedure, but do not establish a permanent resolution of intermittent Electron startup #44. Some previous valid builds timed out, so this PR stays DRAFT with no merge, dependency upgrade, antivirus modification, real Android VPN retest or publication.

Complete dated investigation and reproduction steps.

2026-10-22 — Intermittent startup measured even on valid ASAR; QA-only event-loop heartbeat

Important update to #44: A clean, SHA-256-verified Windows unpacked build (3,960/3,960 ASAR entries valid) completed 8/8 fresh-profile 70-second startup tests, yet one showed its window only after 24.716s, vs 0.576–2.147s for the other seven. That outlier spent 5.275s creating BrowserWindow and 11.209s loading the renderer. This confirms slow startup persists independently of the separate malformed-ASAR packaging failure.

New commit 8585767 implements opt-in QA-only main-process heartbeat, triggered only when the absolute WIREBOUND_QA_STARTUP_TRACE file setting is present. It records numeric timer lateness, never user/device/path content, unrefs its interval, and self-stops after two minutes. It does not change normal startup or add reload loops. Commit cb48e26 updates the phase summarizer and evidence document.

Rebuilt Windows unpacked executable with integrity verification again passed 3,960/3,960 files, then 8/8 more cold starts succeeded. This time one outlier needed 20.144s until the window showed (other seven 0.598–0.894s). The event-loop heartbeat on that outlier recorded 2,053ms, 7,642ms, and 945ms delayed ticks, during which native icon/window setup and renderer navigation were also slow. This demonstrates main-process timer starvation or OS scheduling delay; it does not prove the exact cause. Renderer dom-ready occurred 1.739s before ADB server readiness in that trial, so ADB readiness cannot be assumed to block rendering.

Quality gates on the previous cb48e26 head: TypeScript typecheck, 52/52 Vitest unit tests, full Windows unpacked build, 3,960 verified ASAR payloads, local lint 0 errors (56 warnings), PowerShell script syntax and trace re-analysis pass. Windows hosted CI #39714854505 SUCCESS, including unit tests, package smoke, ASAR regression and payload integrity steps. QA process cleanup confirmed; Git checkout clean.

Status: still DRAFT; keep issue #44 OPEN. Valid archives can still have 20–25-second startups even when eventual readiness tests pass. No signing, merge, release, dependency upgrades, antivirus changes, unconditional reloads or physical device VPN test on this branch. Detailed chronology.

2026-10-23 — counterbalanced same-binary Windows icon A/B: 48/48 starts pass, no end-to-end benefit

Goal: determine whether synchronously decoding the frameless BrowserWindow icon is a necessary contributor to #44's 20–25-second intermittent startup, before making any visible/production UX change.

Commit 3d588b8 added strictly opt-in QA-only WIREBOUND_QA_SKIP_WINDOW_ICON=1, accepted only if an explicit absolute WIREBOUND_QA_STARTUP_TRACE file path is set. Normal application launches still decode and display the icon exactly as before. The cold-start harness accepts -SkipWindowIcon, records the mode, and the new scripts/qa/compare-window-icon-startup.ps1 executes balanced runs using one identical unpacked Windows executable. This is diagnostic code, not an icon removal or a GPU flag change.

Experimental setup: Windows 11 QA host YASMAN; npm run build:unpack passed from frozen 3d588b8 source, with 3,960/3,960 embedded ASAR SHA-256 payloads valid. ASAR SHA-256: 86E1BC55A90A4373C7A0ABD030B4766813110BD693D9803C8E07A66337FD360C. No physical Android VPN, antivirus setting or user install was touched. Each launch used a distinct APPDATA/LOCALAPPDATA, 70-second readiness cutoff, no manual reload.

The first 24 launches alternated normal → skip → skip → normal for six balanced blocks. The second 24 reversed the order (skip → normal → normal → skip). All 48/48 starts passed (24/24 per mode), with an independently verified visible window and populated React root.

Combined statistic Normal icon (24) QA skips icon (24)
Median time to window-shown 638.5ms 648.5ms
90th percentile time to window 865ms 1,279ms
Slowest window 4,181ms 2,816ms
Median icon decode 5.0ms 0.0ms
Median native new BrowserWindow() 92.5ms 32.5ms
Median renderer navigation 297.5ms 333.5ms

The first trial of the normal-first series was slow (4.181s, heartbeat 2.173s late), and the first trial of the skip-first series was also slow (2.816s, heartbeat 0.931s late). Hence slow initial startup can occur even when icon decoding is completely bypassed. Skipping the icon saves ~60ms in the constructor's median, but there was no overall median window-show improvement; the skip mode actually had a slightly worse p90 in this modest sample. Neither group reproduced the earlier 20–25s rare outlier, so there is no statistical or causal claim of permanent #44 resolution.

Decision: retain the normal Wirebound icon and keep #44 OPEN. The experiment rules down native icon decoding as a necessary explanation for the long tail, but does not identify OS scheduling, module load, GPU or native window implementation as the sole cause.

Commit 47aa9b4 adds the reversed-run switch, another default-on-icon safeguard test, and a complete reproducible report. Local Windows validation on these changes: 55/55 Vitest, typecheck, npm run build:unpack, ASAR payload integrity 3,960/3,960, PowerShell parser, git diff --check all PASS; lint 0 errors / 54 warnings on the same code before the last test-only addition. Hosted Windows CI run #39887635308 on exact latest commit 47aa9b4 is SUCCESS, with separately verified lint, typecheck, unit tests, renderer/main build, ASAR corruption regression, Windows packaging smoke, and packaged ASAR SHA-256 integrity steps.

No merge, dependency upgrade, production icon alteration, network/security exception, GPU flag, Android VPN action, signed installer or release.

Full report and exact A/B commands.

2026-10-23 — QA profile isolation corrected; trace overhead and launch-gap long tail

New observation: On a SHA-256-verified unpacked Windows executable, a controlled launch-gap investigation with a 2-second vs 20-second delay between starts showed no consistent improvement from waiting. Unscored warm-up 55.257s to window, six 2s-delay starts 6/6 eventually visible (one 51.232s outlier, median 751.5ms), and six 20s-delay starts 5/6 visible by 70s (one still lacked dom-ready, median among five passes 710ms). On the timeout trial Electron's main module started at 60ms, window-created at 336ms, and renderer loading began at 376ms, but there was no dom-ready or window show before the 70s QA cutoff. The heartbeat was initially delayed 17.626s yet later resumed near-normal ticks for tens of seconds. This further establishes an intermittent renderer/navigation hang-like timeout without proving a permanent hang or its root cause.

Instrumented vs uninstrumented, externally measured: Added a Windows API IsWindowVisible probe so the same executable can be tested with WIREBOUND_QA_STARTUP_TRACE completely off. In an initial, not-yet-fully-profile-isolated A/B series, trace-first starts showed 5/6 visible within 70s, trace-off 6/6, while the reversed series showed 6/6 both modes. An untraced warm-up took 57.071s, demonstrating that severe long-tail startup can occur without our trace writes. The original A/B runner also wrongly treated a missing late React probe as a failure in one externally visible trace-on launch; fixed to score external visibility equivalently for both modes. Neither this nor the limited timing difference proves tracing has no overhead or is itself causal.

Important correction to earlier QA safety claims: Windows Electron/Chromium subprocesses were found to use the ordinary roaming Wirebound userData directory despite our earlier harness changing APPDATA/LOCALAPPDATA. The purported temporary roaming appdata directory was empty. Consequently, older descriptions of fully isolated fresh profiles were inaccurate, and those timing results may share Chromium caches/settings. We inspected only directory metadata, not user content, and did not delete or reset the existing roaming profile. This is a methodological and safety correction, not a claim that prior user-data writes can be reversed.

Fix in 1a0e2cf: Strictly QA-only WIREBOUND_QA_PROFILE_ISOLATION=1 and absolute WIREBOUND_QA_PROFILE_DIR override Electron app.setPath('userData') and sessionData before app ready, independent of whether tracing is enabled. Invalid explicit QA paths fail closed; ordinary app startup is unchanged. Updated cold-start runner and newly committed balanced launch-gap / trace A/B tools use this verified isolation.

Windows verification on this commit: typecheck PASS, 58/58 Vitest PASS (three QA profile gate tests added), lint 0 errors / 54 warnings, npm run build:unpack PASS, embedded ASAR integrity 3,960/3,960 payload hashes match. An explicit QA smoke verified profile created with 16 entries, renderer and all four Chromium subprocesses used the QA path, no process remained. Updated electron-cold-start.ps1 2/2 PASS, both created separate populated QA profiles. With corrected independent userData isolation, an 8 scored trial trace-on/off A/B (two counterbalanced blocks, external window detection) showed 4/4 visible with tracing and 4/4 visible without, median external show 1,069ms trace-on vs 1,209ms trace-off, no 50–70s outlier. Too few trials to infer equivalence or eliminate intermittent #44.

Evidence/docs in 32dfa67: full dated QA report. This is unpacked-only QA, not a fresh installed NSIS or physical Motorola VPN retest on this head. No dependency upgrade, security changes, public release, merge or normal-user feature changes. Issue #44 remains OPEN; PR remains DRAFT. Hosted Windows CI on exact latest head `32dfa67` SUCCESS, workflow #39926342753, with individually verified Lint, Typecheck, Unit tests, Build renderer/main, ASAR corruption guard test, Package smoke and packaged ASAR SHA-256 integrity steps.

@man612 man612 changed the title test(electron): trace Windows cold starts and investigate stalled renderer (#44) fix(package): verify ASAR integrity and investigate Electron startup (#44) Oct 22, 2026

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

2026-10-24 — low-risk synchronous ADB cache I/O reduction

What changed on this DRAFT branch (latest commit 171d640):

  • Extracted a pure, testable adbCacheFingerprint.ts module from appPaths.ts.
  • The original getRuntimePaths() → prepareAdbCache() runs synchronously in the Electron main process before createMainWindow(). This was identified as a plausible HDD startup bottleneck, not an established explanation of issue Investigate intermittent blank renderer on local Windows Electron preview #44's long-tail delays.
  • Previously, the bundled ADB files were read once to compute the combined 16-character SHA-256 fingerprint and again while verifying the cache. Now per-file bundled-source hashes are retained from that first read. The cached destination files are still hashed, and invalid copies are still replaced. The fingerprint byte algorithm, cache folder naming, fallback behavior and user data remain unchanged.
  • Bundled ADB adb.exe alone is 8,273,560 bytes in the Windows QA build. This change eliminates one full repeated read of each of the 3 bundled ADB runtime files on cache-hit starts; it does not remove full hash verification.

Real Windows validation (D:\Projects\wirebound-ux-review-20261021, fast-forwarded cleanly to 171d640):

  • vitest run src/main/adbCacheFingerprint.test.ts: 3/3 passed; tests cover historical fingerprint compatibility, no-op on intact cache, repairing tampered destination bytes, changed/missing source.
  • npm run typecheck:node: exit 0.
  • npm run build: exit 0, including both Node/web typechecks and main, preload, React/Vite production bundles (renderer 1,752 modules).
  • Build artifacts are QA-only; no NSIS installer was built or installed, no source dependencies upgraded.

Limitations: These are functional and source-I/O improvements, not a measured startup latency regression fix. Most cache work is still synchronous before the first window. No new slow-start trace has yet pinned the duration to this stage. Do not close issue #44 or merge this draft based on this optimization alone. Prior HDD crossover benchmark failed in preflight without valid app timing; it cannot supply evidence for this change.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

2026-10-24: gated A/B experiment and newly measured pre-window I/O

Two new trace-on, isolated-userData starts using the prior packaged QA binary showed an 11,060ms window on the first attempt vs 888ms on the second. ADB fingerprint took 4,095ms vs 28ms; native BrowserWindow construction 1,299ms vs 75ms; renderer did-start-loading→dom-ready 3,984ms vs 566ms. Both showed populated React roots and no QA process leaks. These phase timings show a real startup I/O hotspot but also unrelated simultaneous slowdowns. No claim that cache is the unique cause of #44.

Added QA-ONLY, explicitly gated WIREBOUND_QA_SKIP_ADB_CACHE=1 support to startupTrace.ts/appPaths.ts for the next causal normal/skip ABBA test. It only bypasses cache preparation when an absolute trace file and WIREBOUND_QA_PROFILE_ISOLATION=1 are also present. Normal installed launches remain unchanged. Recorded trace marker adb-cache-skipped-qa makes the effective condition auditable. Updated unit tests ensure no skip for ordinary launches.

Commit 2e19607, Windows QA checkout fast-forwarded cleanly; vitest run src/main/startupTrace.test.ts src/main/adbCacheFingerprint.test.ts 14/14 passed, exit 0. Previous production bundle npm run build on prior commit 171d640 passed. A packaged A/B on the new commit is not yet confirmed complete; do not infer speedup or release readiness from these tests. Full QA trace data remains under F:\Wirebound-Lab\benchmarks\issue44-trace-recheck-20261024-v1. DRAFT/issue OPEN.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

QA checkpoint: packaged ABBA test deferred due unresponsive Windows packager (2026-10-24)

Source change on fix/issue44-startup-trace-20261021 2e19607 was fast-forwarded into the isolated Windows QA checkout. On that host the targeted startupTrace.test.ts (11 tests) and adbCacheFingerprint.test.ts (3 tests) passed 14/14, exit 0. Vite/Electron production source compilation plus Node/web typechecks passed as part of npm run build:unpack. Its runtime:prepare reused already prepared runtimes.

However packaging did not complete:

  • Full npm run build:unpack reached electron-builder but became very slow during its native rebuild/module packing work; the exact QA builder child was deliberately terminated to preserve usability of the HDD computer.
  • A QA-only second packaging invocation passed the wrong CLI override (-c.npmRebuild=false, interpreted as a nonexistent config filename), exit 1. This is a QA command mistake, not an application build error.
  • A corrected invocation electron-builder --win --dir --config.npmRebuild=false confirmed npmRebuild skipped and Electron was downloaded, but again remained unresponsive while preparing the directory package. Only its verified QA electron-builder child PID 14392 was terminated. No installed Wirebound or global ADB was intentionally touched.

No current ASAR verifier pass exists for this new commit, and no normal-vs-skip ADB-cache startup A/B has been run. The interrupted dist\win-unpacked must be considered potentially incomplete; do not use it as a valid new QA executable. Preserve older successful source build and the two old-binary traces described earlier, but never conflate them with packaged results on 2e19607.

Logs at F:\Wirebound-Lab\logs\issue44-adb-ab-qa-package.log, issue44-adb-ab-package-skip-native-rebuild.log, issue44-adb-ab-package-v3.log. ABBA harness staged locally at F:\Wirebound-Lab\run-qa-adb-cache-abba.ps1, deliberately not executed. PR stays draft; issue #44 remains open. Next QA: isolate electron-builder module scan/HDD bottleneck, only reattempt packaging when Windows is responsive, validate ASAR before launching; do not merge/release on the new test flag.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

2026-10-24 — 8/8 isolated ADB-cache A/B starts; no production change proposed yet

Completed a counterbalanced ABBA sequence (first 2, brief safety-harness interruption, then last 2) and a reversed BAAB sequence on the same Windows HDD QA host. All eight trials achieved window-shown and a populated React root, with the expected explicit adb-cache-skipped-qa trace marker in skip mode and its absence in normal mode. Distinct QA userData/sessionData, APPDATA/LOCALAPPDATA and startup trace were used for every run. 4/4 normal and 4/4 skip passed. No Wirebound processes remained.

  • Normal (4): 21,301 / 1,237 / 1,030 / 722 ms until shown; median 1,133.5ms.
  • QA cache skip (4): 1,628 / 586 / 360 / 384 ms; median 485ms.
  • Outlier normal run, 21,301ms: ADB fingerprint 664ms, cache verify 48ms, BrowserWindow constructor 3,393ms, renderer start→DOM 7,663ms, max event-loop heartbeat lateness 7,230ms. Thus the rare severe stall is not explained by ADB fingerprint alone.

Critical package qualifier: The standard electron-builder directory packaging repeatedly stalled on the HDD after Node/web typecheck and Vite main/preload/renderer builds. Rather than use incomplete dist, created a manually assembled QA-only executable in F:\Wirebound-Lab\qa-packages\issue44-adb-ab-manual-v1\win-unpacked: known prior v1.2 Electron executable/runtime tree copied intact; ASAR freshly made from current compiled out/main, out/preload, React renderer and required @electron-toolkit/utils dependency. Verified 15/15 ASAR files by SHA-256, embedded new QA marker, manifest v1.2.0, and external ADB/Gnirehtet resources. Not a normal electron-builder distribution; NEVER release it or treat it as full installer QA.

Interpretation: Skip mode was faster in this small, uncontrolled sample, but OS disk-cache/warm-up, mode order, and ADB path differences confound causation. Even the 21s outlier spent most time outside ADB fingerprinting. Do not remove production ADB integrity validation. A safer potential production design is making UI window/renderer readiness independent of synchronous ADB-runtime preparation, while gating all ADB-dependent IPC until runtime preparation completes; this needs dedicated tests and installed-NSIS QA before merge.

Raw CSV summaries: F:\Wirebound-Lab\benchmarks\issue44-cache-ab-8trials-summary.csv and three constituent trial folders. A source-controlled reproducible harness now exists at scripts/qa/compare-adb-cache-startup.ps1; detailed analysis docs/qa/ADB_CACHE_AB_2026-10-24.md. The earlier 14/14 Windows unit test pass on QA gating/cache is retained. PR remains DRAFT, #44 OPEN, no dependency upgrades, no normal profile touched, no public release.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

CPU-heartbeat v7: packaged Windows validation completed (2026-10-24)

Commit bfd15fc (main-process cpuUserMs / cpuSystemMs added to existing QA heartbeat) has now been built and tested on the actual Windows host. Full Vitest 82/82 PASS; TypeScript and Electron/Vite production bundles exit 0; QA manual v7 ASAR integrity 16/16 SHA-256 entries verified, assembly exit 0.

Eight isolated sequential normal-icon starts: 8/8 PASS, no leftovers, shown-window uptime in ms: 1117, 1034, 1035, 1114, 1047, 545, 1255, 552 (range 545–1255ms, conventional median 1041ms). All started too quickly to record a periodic CPU heartbeat. Initial local summary printed an incorrect 1047ms "median" by selecting the upper middle element; corrected the F: reporting script.

To verify actual packaged CPU-field emission, used an isolated copy of the existing QA harness (not the repository harness), keeping one ready QA instance open six extra seconds. 1/1 PASS; zero leftover v7 processes. Trace: main-loop-heartbeat tick 5 (process uptime 5210ms, lag 0ms, CPU user/system 0/0ms) and tick 10 (uptime 10250ms, lag 4ms, CPU user/system 16/0ms). These are expected idle ready-app readings and not a reproduced 15–57s stall. CPU was not measured during the earlier genuine 18,284ms v6 outlier; please do not infer it retroactively.

Evidence saved under F:\Wirebound-Lab\STATUS-2026-10-24.md, logs\issue44-cpu-heartbeat-v7-*.log, benchmarks\issue44-cpu-heartbeat-v7-20261024.csv, and benchmarks\issue44-cpu-heartbeat-v7-hold-20261024\attempt-1\startup.jsonl. Source-controlled QA chronology. No production startup fix is claimed. No NSIS/real Android USB parity. Keep this PR Draft.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

#44 QA follow-up (2026-10-24): 12 more valid Windows starts; CPU-correlated trace reports verified

Same frozen/manual v7 binary and normal icon, 12/12 sequential fresh-profile launches PASS (harness exit 0), 0 invalid JSONL records and 0 orphaned QA executables. Native window-shown process uptime: 1105, 1294, 1129, 1097, 1034, 1180, 946, 1096, 1058, 1089, 1084, 1093ms (min 946ms, conventional median 1094.5ms, max 1294ms). This is another fast series, not a reproduction of the historical 18.284s stall; fast QA cleanup meant zero heartbeat events, so no new CPU inference about a slow launch is possible.

Draft PR #51 adds CPU-correlated columns to the Node-only phase CSV analyzer: heartbeatSamples, maxHeartbeatDelayMs, cpuUserMsAtMaxLag, cpuSystemMsAtMaxLag, and cpuSampledHeartbeats. Test suite 7/7 PASS on Windows. Verified against 18 actual traces (six v6 and twelve v7): the earlier v6 18,284ms launch has four heartbeat records, maximum lag 5,899ms, but no CPU readings because those fields did not exist then. The analyzer correctly leaves its CPU values blank instead of falsely saying zero. CPU values refer only to Electron's main process, not renderer or GPU CPU.

The QA checkout fast-forwarded cleanly to the analyzer commits de46e8e and 62b4f57; updated renderer documentation. All raw trace and CSV evidence remains on isolated F:\Wirebound-Lab, notably benchmarks\issue44-v6-v7-heartbeat-correlated-20261024.csv and logs\issue44-v7-cpu-phase-analyzer-nodecheck.log. No new production build, NSIS or USB test, dependency change or release. Issue #44 still has no proven root cause; PR #51 stays Draft.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

2026-10-24 offline-safe agent handoff (documentation only)

Windows device YASMAN was offline at the latest check. The maintainer expects to resume access around Tuesday 2026-10-27 09:00 WIB, but availability is not guaranteed.

New persistent handoff: https://github.com/man612/wirebound/blob/fix/issue44-startup-trace-20261021/docs/qa/ISSUE44_RESUME_CHECKPOINT_2026-10-24.md
Root AGENTS.md on Draft PR #51's diagnostic branch now links to the handoff and sets safety instructions for future agents.

The pre-handoff runtime/code baseline was 800714c; this documentation-only update moved the PR branch head to c27923a. No application code, QA executable, NSIS installer, local Windows checkout, global ADB, release, merge, or real USB test was changed/performed.

Critical evidence: The 18,284-ms v6 startup outlier had a 5,899-ms heartbeat delay but no CPU fields. Subsequent 12/12 v7 starts were fast and produced no CPU heartbeat records before cleanup. Root cause UNKNOWN. Do not repeat fast-series testing without purpose or equate main-process CPU with all Electron processes.

When access returns: check Desktop Commander/session/process state once, inspect Windows HEAD and clean working tree (last verified 62b4f57; later fast-forward completion unknown), verify F:\Wirebound-Lab\STATUS-2026-10-24.md, and fast-forward only if safe. Keep #44 OPEN and #51 DRAFT. Source/history and raw QA evidence outrank conversation memory.

This is a handoff note, not a readiness claim or merge request.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Offline QA correctness follow-up — 2026-10-24 (no Windows access)

A source-level, deterministic multi-navigation fixture exposed a false-positive reporting risk in scripts/qa/startup-mark-deltas.cjs. Before the fix, after navigation #2 produced ESM/React marks but no UI-ready mark or FCP, the CSV incorrectly carried forward navigation #1's valid UI-ready/FCP values. This is a QA analyzer issue; it does not prove a new application startup failure.

QA-only change on Draft PR #51:

  • 83313ea — scope renderer milestone probes and renderer-load-to-DOM measurement to the latest did-start-loading navigation; retain empty/unavailable values if the latest navigation never became ready. No src/ or production lifecycle changes.
  • 9a6d8f2 — two native Node regression cases for cross-navigation stale marks and unfinished second navigation.
  • a0b2aa5 — update the persistent agent handoff.

Verification: Running the actual fetched analyzer and test functions in a separate JS sandbox with emulated Node module dependencies produced 9/9 passing logical cases. NOT YET TESTED: native node --test on repo checkout, Vitest, full build, official NSIS, Windows Electron, or real Android USB/Gnirehtet for these new commits. Do not relabel this sandbox exercise as platform validation.

Open edge: the separate PowerShell startup-phase-report.ps1 may still mix first events/marks across navigations; not modified without PowerShell validation. Investigate independently if multi-navigation traces become relevant.

Existing v6 18,284ms stall still has no CPU fields. The startup long-tail root cause remains unknown, and PR #51 remains DRAFT / issue #44 OPEN. No Windows remote calls, merge, release, installs, or benchmark runs occurred.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

2026-10-24 cross-PR integration audit (GitHub-only; no merge)

Compared PR #50 daf7c6b, PR #51 a0b2aa5, and main 188751e. Exactly three changed-file paths overlap: src/main/ipc.ts, src/renderer/src/App.tsx, AGENTS.md. Each PR is individually mergeable against main, but this does not verify their combined tree or functional behavior.

P0 risk #1 — IPC: PR #51 adds asynchronous getServices()/trustedServices() readiness gating and sender revalidation. PR #50 adds app:copy-support-report backed by Electron's clipboard + preload type/renderer UI. Selecting either file wholesale can break one feature or the startup security/lifecycle safeguards.

P0 risk #2 — React App: preserve PR #51's renderer marks + lazy Settings and PR #50's language prop to Dashboard and theme effect guard settings.onboardingCompleted. Otherwise onboarding Light preview can be overwritten, locales broken, or startup milestones lost.

P1 risk #3 — agent notes: retain both independent QA handoffs in AGENTS.md.

Full source-grounded preservation plan and target verification gates: https://github.com/man612/wirebound/blob/fix/ux-audit-10-items-20261020/docs/qa/PR50_PR51_INTEGRATION_CONTRACT_2026-10-24.md

Status: Documentation only in PR #50 branch; no cross-branch merge/rebase, production source edit, Node/Windows/browser test, NSIS build, or USB test was carried out. Keep #50/#51 Draft, #44/#48 Open. The planned Tue Oct 27 Windows restart is not confirmed availability.

man612 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Cross-workstream heads-up only (no changes on PR #51): source-level Gnirehtet lifecycle races were reproduced using fake ADB/process dependencies and tracked separately at #53 and documentation-only Draft PR #54 . The gnirehtetService.ts blob is currently identical on main/PR #50/PR #51; these risks are not demonstrated as the cause of issue #44's 15–57s startup stalls. Preserve startup investigation isolation and do not merge/claim fixed without native and single-phone regression verification.

man612 commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

2026-10-25 merge-readiness audit: exact HEAD CI is RED (real lint error)

Rechecked current Draft PR HEAD a0b2aa586d34ffa0a08a6b79c1c792caf7868f3f and Windows CI run 40094684856, job 120874352825. This is not GitHub quota exhaustion: hosted Windows installed dependencies and reached lint, which failed at src/main/rendererQaProbes.test.ts:11:32:

'_event' is defined but never used @typescript-eslint/no-unused-vars

Exact source: const probe = vi.fn(async (_event: string) => true). Remove the unused argument (e.g. vi.fn(async () => true)) while preserving the callback contract. CI skipped typecheck, tests, build, ASAR integrity and packaging afterward. An older startup branch run 39926342753 was green, but does not validate current HEAD. Re-run CI after any fix; don't infer source is working from past runs. Independently, issue #44's long-tail 15–57s startup delays remain unexplained and Windows native startup QA is pending.

Recommendation: keep this PR Draft/unmerged until real lint is fixed, all head checks pass, and representative Windows startup evidence is collected. No branch code or host machine was touched by this review.

man612 commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

2026-10-28 CI blocker patch and QA boundary (unmerged)

Addressed the exact previous hosted-Windows lint failure in src/main/rendererQaProbes.test.ts at HEAD 5534d00de08afed581dfab37c1f1db76cf5f04e6. The vi.fn(async (_event: string) => true) stub now uses vi.fn(async (event: string) => event.length > 0), preserving the typed event argument and successful result for both nonempty QA probe event names. Only the test file was edited; startup/ADB/Electron production code was not touched.

No new GitHub Actions run/check is currently associated with the updated SHA. The maintainer's Windows PC was reachable, so an isolated F:\Wirebound-Lab\qa-pr-blockers-20261028 checkout was created at this exact HEAD. npm ci --ignore-scripts in that disposable QA directory was stopped after prolonged silence to avoid stressing a slow PC. A subsequent focused local lint → typecheck:node → focused Vitest attempt using existing QA dependencies through a folder junction was stopped after ~100 seconds without any test output. It produced NO valid lint/typecheck/Vitest result. Both QA tool sessions were explicitly terminated. The ordinary Wirebound install/user profile and global ADB/Gnirehtet were never touched.

Thus lint blocker is patched in source but NOT yet demonstrated green. PR remains Draft; root cause of issue #44 (15–57-second startup tail) and physical startup QA remain open. Recheck actual CI on current HEAD; do not claim older run 39926342753 validates this commit or merge based on this note. Current main has progressed after #57/#61/#62, so preserve AGENTS.md and resolve cross-PR conflicts separately.

man612 commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Exact-head hosted Windows CI verifier PASS — 2026-10-28

The corrected startup branch HEAD 5534d00de08afed581dfab37c1f1db76cf5f04e6 was verified through temporary QA PR #64 targeting the original pinned main baseline (188751e5); this avoids the separate AGENTS.md merge conflict with modern main while testing the exact source code. Hosted Windows CI run #40624866615 finished SUCCESS with lint, typecheck, 82/82 Vitest tests over 15 files (including 4 rendererQaProbes.test.ts cases), main/renderer build, corrupt-ASAR guard, unpacked package smoke, and packaged ASAR SHA-256 integrity (verified=3961, skipped=0, failed=0). This confirms the original _event unused-variable lint blocker is fixed on current head.

The temporary verifier PR #64 is being closed without merge; the original startup PR #51 remains Draft/UNMERGED and currently dirty vs latest main, and issue #44's long-tail 15–57 s Electron startup delay remains unresolved. Real native packaged startup timing and one-device USB/VPN checks are still needed; no claim that hosted CI measured the observed startup slowdown. The maintainer's slow Windows PC was not used for this CI. Preserve current main's ADB issue #56/audit issue #53 AGENTS.md content during any later conflict resolution.

man612 commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

2026-11-10 integration checkpoint: The independently useful ASAR payload verification and packaging-input exclusion originally developed in this startup-investigation branch were extracted into focused PR #69, whose Windows CI (including deliberate byte-corruption detection and package smoke) passed; #69 was squash-merged into main at 5081398afed282b5ceb8c3aeaaae70d0d0281c3e. This does not resolve intermittent startup issue #44 or merge the QA-only tracing/UI-first experiments in this PR. Future rebasing/integration of #51 must avoid reintroducing duplicate ASAR scripts, package commands, or workflow steps; compare current main first. Keep the issue open until startup root cause and representative Windows results are supported by repeatable evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant