Skip to content

Harden CI + finish #33: import guard (catches a 4th split regression) + e2e condition wait#2

Merged
asuramaya merged 3 commits into
mainfrom
e2e-hardening
Jun 19, 2026
Merged

Harden CI + finish #33: import guard (catches a 4th split regression) + e2e condition wait#2
asuramaya merged 3 commits into
mainfrom
e2e-hardening

Conversation

@asuramaya

Copy link
Copy Markdown
Owner

Follow-up to the audit-remediation merge — closes the last open task (#33) and hardens CI.

CI guard (the substantive part)

The two serious pipeline regressions in the last PR were missing imports after the god-file splits — invisible to `ast.parse`/`node --check` and only caught because the e2e finally ran the paths. This adds `tests/test_imports.py`, a ~1s tool-free static check that flags any name used but bound nowhere in its module. On its first run it caught a 4th, still-latent regression: `hvserver/engines.py` calls `log_subprocess_lines` (in jobs.py) without importing it, so `trace_mask_to_svg`/`trace_color_to_svg` would NameError right after the vtracer subprocess. Fixed (commit 1), and wired the guard into `ci.yml` + `release.yml` (also added the capability suite to CI).

Note: the full Playwright e2e is not added to CI on purpose — it asserts real spandrel/onnxruntime/opencv availability and runs a real denoise, needing the heavy ML toolchain the app keeps out of `requirements.txt`. The static guard covers the regression class that actually bit, cheaply.

#33 (the open task)

Adds a `settle(page, js)` helper and converts the worst fixed sleep (the 820ms colour-recents debounce) to a condition wait. Opportunistic per the task: the rest are sub-120ms post-pointer settles or the colour-undo coalesce debounce (no self-verifying condition; converting risks dropping undo) — left as-is with rationale.

Verified: e2e 371/371, test_smoke + test_capabilities + test_imports green locally.

asuramaya and others added 3 commits June 19, 2026 16:25
trace_mask_to_svg and trace_color_to_svg call log_subprocess_lines(log, lines)
right after running the vtracer subprocess, but engines.py only imported
run_subprocess from hvserver.jobs — so those two trace paths NameError'd the
moment the subprocess returned. Caught by the new import guard (tests/test_imports.py),
not by e2e (its vectorize path doesn't reach these two functions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds tests/test_imports.py: a static check that flags any bare Name(Load) used
but bound nowhere in its module — the missing-import NameError class the god-file
splits (#25/#28/#29/#30) kept introducing (pipeline.py's pixelvec_config /
resolve_capability_step, docks.js's showContextMenu, engines.py's
log_subprocess_lines), all of which shipped because ast.parse / node --check
can't see them and the early e2e stall hid the runtime paths. Uses each module's
real runtime namespace (so `import *` resolves), unions in every function/lambda
local + except/comprehension binding, and skips annotation-only names and dunders,
so attribute access and forward-ref annotations don't false-positive. ~1s, no
optional ML deps. Wired into ci.yml (+ the capability suite) and release.yml.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a settle(page, js) helper that waits for the actual end-state instead of
outlasting a debounce with a fixed sleep — fast when ready, bounded otherwise,
and a swallowed timeout means the following assertion still reports the real
state with context instead of a raw Playwright abort. Applied to the colour
recents-debounce (820ms -> condition on the swatch landing in localStorage).
Opportunistic per #33: the remaining sleeps are sub-120ms post-pointer settles
or the colour-undo coalesce debounce, which has no self-verifying next-line
condition (closing the panel early would drop the undo entry) — left as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@asuramaya asuramaya merged commit d1c2100 into main Jun 19, 2026
1 check passed
@asuramaya asuramaya deleted the e2e-hardening branch July 13, 2026 17:56
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