12 Commits

Author SHA1 Message Date
Kpa-clawbot
72161ba8fe perf: replace 169 blind sleeps with Playwright waits in coverage script
Remove all 169 waitForTimeout() calls (totaling 104.1s of blind sleeping)
from scripts/collect-frontend-coverage.js:

- Helper functions (safeClick, safeFill, safeSelect, clickAll, cycleSelect):
  removed 300-400ms waits after every interaction — Playwright's built-in
  actionability checks handle waiting for elements automatically
- Post-navigation waits: removed redundant sleeps after page.goto() calls
  that already use waitUntil: 'networkidle'
- Hash-change navigations: replaced waitForTimeout with
  waitForLoadState('networkidle') for proper SPA route settling
- Toggle/button waits: removed — event handlers execute synchronously
  before click() resolves
- Post-evaluate waits: removed — evaluate() is synchronous

Local benchmark (Windows, sparse test data):
  Before: 744.8s
  After:  484.8s (35% faster, 260s saved)

On CI runner (ARM Linux with real mesh data), savings will be
proportionally better since most elements exist and the 104s
of blind sleeping was the dominant bottleneck.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-26 23:02:03 -07:00
you
9b0c740537 revert: aggressive coverage interactions dropped score from 42% to 39%
The page.evaluate() calls corrupting localStorage and firing fake events
caused page error-reloads, losing accumulated coverage. Reverting to
the 42% version which was the actual high water mark.
2026-03-24 05:48:06 +00:00
you
556e3b19db coverage: aggressive branch coverage push — target 80%+
Add ~900 lines of deep branch-coverage interactions:
- Utility functions with all edge cases (timeAgo, truncate, escapeHtml, formatHex, etc.)
- roles.js: getHealthThresholds/getNodeStatus for all roles + edge inputs
- PacketFilter: compile+match with mock packets, all operators, bad expressions
- HopResolver/HopDisplay: init, resolve, renderPath with various inputs
- RegionFilter: onChange, getSelected, isEnabled, setRegions, render
- Customize: deep tab cycling, import/export, bad JSON, theme preview
- WebSocket reconnection trigger
- Keyboard shortcuts (Ctrl+K, Meta+K, Escape)
- Window resize (mobile/tablet/desktop) for responsive branches
- Error routes: nonexistent nodes/packets/observers/channels
- localStorage corruption to trigger catch branches
- Theme toggling (dark/light rapid switching, custom vars)
- Live page: VCR modes, timeline clicks, speed cycling, all toggles
- Audio Lab: play/stop/loop, BPM/volume sliders, voice selection
- All analytics tabs via deep-link + sort headers
- Packets: complex filter expressions, scroll-to-load, double-click
- Nodes: special char search, all sort columns, fav stars
- Channels: resize handle drag, theme observer, node tooltips
- Observers/Observer Detail: sort, tabs, day cycling
- Node Analytics: day buttons, tabs
- Home: both new/experienced flows, empty search results
- debouncedOnWS/onWS/offWS exercise
2026-03-24 05:26:22 +00:00
you
86dce6f350 coverage: massively expand frontend interaction coverage
Exercise every major code path across all frontend files:

app.js: all routes, bad routes, hashchange, theme toggle x4,
  hamburger menu, favorites dropdown, global search, Ctrl+K,
  apiPerf(), timeAgo/truncate/routeTypeName utils

nodes.js: sort every column (both directions), every role tab,
  every status filter, cycle all Last Heard options, click rows
  for side pane, navigate to detail page, copy URL, show all
  paths, node analytics day buttons (1/7/30/365), scroll target

packets.js: 12 filter expressions including bad ones, cycle all
  time windows, group by hash toggle, My Nodes toggle, observer
  menu, type filter menu, hash input, node filter, observer sort,
  column toggle menu, hex hash toggle, pause button, resize handle,
  deep-link to packet hash

map.js: all role checkboxes toggle, clusters/heatmap/neighbors/
  hash labels toggles, cycle Last Heard, status filter buttons,
  jump buttons, markers, zoom controls, dark mode tile swap

analytics.js: all 9 tabs clicked, deep-link to each tab via URL,
  observer selector on topology, navigate rows on collisions/
  subpaths, sortable headers on nodes tab, region filter

customize.js: all 5 tabs, all preset themes, branding text inputs,
  theme color inputs, node color inputs, type color inputs, reset
  buttons, home tab fields (hero, journey steps, checklist, links),
  export tab, reset preview/user theme

live.js: VCR pause/speed/missed/prompt buttons, all visualization
  toggles (heat/ghost/realistic/favorites/matrix/rain), audio
  toggle + BPM slider, timeline click, resize event

channels.js: click rows, navigate to specific channel
observers.js: click rows, navigate to detail, cycle days select
traces.js: click rows
perf.js: refresh + reset buttons
home.js: both chooser paths, search + suggest, my-node cards,
  health/packets buttons, remove buttons, toggle level, timeline

Also exercises packet-filter parser and region-filter directly.
2026-03-24 04:57:09 +00:00
you
26d4bbc39d ci: fix coverage collector — use Playwright bundled chromium on CI 2026-03-24 04:26:19 +00:00
you
5ee976055b feat(coverage): add targeted Playwright interactions for higher frontend coverage
Add redundant selectors (data-sort, data-role, data-status, data-tab,
placeholder-based search, emoji theme toggle, .cust-close, #fTimeWindow,
broader preset selectors) to exercise more frontend code paths.

All interactions wrapped in try/catch for resilience.
2026-03-24 04:19:32 +00:00
you
860d5c574e test: expanded frontend coverage collection with page interactions
367 lines of Playwright interactions covering nodes, packets, map,
analytics, customizer, channels, live, home pages.
Fixed e2e channels assertion (chList vs chResp.channels).
2026-03-24 03:43:27 +00:00
you
d7faa4d978 Add frontend code coverage via Istanbul instrumentation + Playwright
- Install nyc for Istanbul instrumentation
- Add scripts/instrument-frontend.sh to instrument public/*.js
- Add scripts/collect-frontend-coverage.js to extract window.__coverage__
- Add scripts/combined-coverage.sh for combined server+frontend coverage
- Make server.js serve public-instrumented/ when COVERAGE=1 is set
- Add test:full-coverage npm script
- Add public-instrumented/ and .nyc_output/ to .gitignore
2026-03-24 03:11:13 +00:00
you
91a6a2c525 fix: migration handles concurrent dual-write with INSERT OR IGNORE 2026-03-20 22:52:12 +00:00
you
d7e415daa7 fix: raw_hex NOT NULL in transmissions schema — deleted 4 junk test rows 2026-03-20 20:24:13 +00:00
you
2c6148fd2d Add dedup migration script (Milestone 1)
Creates transmissions and observations tables from existing packets table.
- Groups packets by hash → 1 transmission per unique hash
- Creates 1 observation per original packet row with FK to transmission
- Idempotent: drops and recreates new tables on each run
- Does NOT modify the original packets table
- Prints stats and verifies counts match

Tested on test DB: 33813 packets → 11530 transmissions (2.93x dedup ratio)
2026-03-20 20:22:30 +00:00
you
10b11106f6 ci: add pre-deploy JS validation — syntax check + undefined reference detection
Validation runs BEFORE docker build. If it fails, deployment is blocked.
No more broken code reaching production.
2026-03-20 19:24:11 +00:00