Skip to content

Simplify renderer tests and make daemon boundaries explicit - #637

Open
parsakhaz wants to merge 2 commits into
mainfrom
codex/audit-test-infra
Open

parsakhaz wants to merge 2 commits into
mainfrom
codex/audit-test-infra

Conversation

@parsakhaz

@parsakhaz parsakhaz commented Sep 14, 2026

Copy link
Copy Markdown
Member

Renderer tests launched Electron while exercising only mocked Chromium pages, and smoke helpers bypassed Playwright actionability. Main tests also silently replaced a production service import for every suite and asserted source spelling instead of architecture or behavior.

This PR serves Vite for mocked renderer tests, uses locator click/fill, deletes the duplicate health check and test-only daemon frame predicates, and injects the panel persistence/event dependency explicitly in the two suites that need it. Daemon import/event restrictions move into ESLint; the existing real sandboxed Electron smoke keeps testing channel routing. Vitest configuration now uses ESM, removing Vite's deprecated CJS API warning.

The comprehensive Knip gate keeps every category blocking. A separate production analysis command marks shipped entrypoints and excludes test fixtures, exposing test-facing exports for review; it is a diagnostic view, not a suppression or replacement of the current gate. The remaining report includes intentional test seams and audit helpers removed in sibling PRs, so it is not promoted to a zero-baseline CI gate in this change.

The watch contract fixture also handles socket errors when watch clients deliberately terminate after receiving their expected output. It tolerates only ECONNRESET, preserves action failures, and rethrows other socket errors after server and endpoint cleanup. Contract assertions, timeouts, and parity scenarios remain intact.

Closes #624
Closes #627
Closes #628
Closes #629
Closes #630
Closes #632
Closes #642

Validation:

  • Root lint and workspace typecheck passed.
  • 45 affected main tests passed, including 50 MB terminal persistence coverage.
  • Main build and sandboxed preload bundle verifier passed.
  • ESM Vitest configuration discovered correctly; framing suite passes without the Vite CJS warning.
  • Negative lint probes reject Electron/bootstrap imports and direct webContents sends in protected files.
  • Local browser runs exposed the separately tracked external font startup failure (Remove runtime Google Fonts import that can abort offline desktop startup #635); required GitHub CI will verify the maintained browser and real Electron suites.
  • Fixture follow-up: root lint and full workspace typecheck passed. Four focused checks using the actual helper and real Node sockets verified expected resets, unexpected EIO, preservation of action failures in both cases, and cleanup. The wrapper command passed generated-contract freshness and compilation, but local parity scenarios were blocked by the environment rejecting UNIX socket bind with listen EPERM; the existing OS/runtime wrapper CI matrix provides full parity verification.

No dependencies, supply-chain settings, production build targets, authentication, or persistence formats change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T07:40:28.243126Z f88fe3d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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