Skip to content

ci: typecheck evals in the test-framework job (gated remainder of #4828; fixes in #4899) - #4908

Open
yomgui wants to merge 23 commits into
devfrom
e2e/evals-typecheck-green
Open

yomgui wants to merge 23 commits into
devfrom
e2e/evals-typecheck-green

Conversation

@yomgui

@yomgui yomgui commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Remainder to review (head be27ef308, +5/−2 in 2 files): one Typecheck evals step (pnpm evals:typecheck, 3 lines) in the test-framework job of .github/workflows/ci-tests.yml, plus the evals/README.md sentence saying CI runs it; everything else from #4828 already landed on dev via #4899 (f31e9b839), and the branch was resynced with one signed --no-ff merge of origin/dev so the diff is now exactly this.

Reduced on 2026-09-11 to the approval-gated part. The typecheck fixes (455 → 0 errors on evals/) were split out to #4899, which Warden can self-clear, and this PR is now stacked on that branch. The original RCA, per-spec table, Daytona controls, and "noticed, not touched" notes are preserved below for history; the evidence there refers to the pre-split heads.

What is left here (needs one human approving review)

Two files, five lines:

  • .github/workflows/ci-tests.yml: one Typecheck evals step (pnpm evals:typecheck) in the existing test-framework job of the extended lane, after Run test-framework checks, same if: guard. No new workflow, no new job, no secrets.
  • evals/README.md: the sentence saying CI runs the check.

Why it is worth an approval

pnpm evals:typecheck was red for months because nothing ran it; #4899 makes it green, and without this step it will silently go red again the first time a spec drifts from the testkit. This step is the regression guard. It runs in the extended lane only (same job as pnpm test:eval-runner), so it cannot block a docs-only or model-snapshot-only PR.

Warden never self-clears a PR touching .github/ (warden-clearance.yml:100-107), so this needs @benjaminshafii or another human approver. Merge order: #4899 first, then this (GitHub retargets it to dev when #4899's branch is deleted; the step's pnpm evals:typecheck script only passes with #4899's fixes in the tree).

Head after the split: 354e31f6c (a -s ours merge of #4899's branch; tree unchanged, no history rewritten).


Original description (pre-split, evidence refers to heads 0672c27 / a1c5e53 / 1356685)

Root cause

pnpm --dir evals typecheck was red on clean dev with 399 errors and no CI job ran it (evals/README.md documented the red). Session AD's diagnosis (reports/e2e-red-2026-09-09/flake-recheck.md §B, E2E fix AD) found three independent causes:

  1. 293 errors (73 %) – evals compiled with moduleResolution: nodenext, but worlds/infra.ts imports ee/apps/den-api/src/mcp/remote-session-capabilities.js, which pulls in @openwork-ee/den-db (written for Bundler resolution, extensionless re-exports) and packages/email .tsx templates without jsx.
  2. 36 errors – evals' erasableSyntaxOnly / verbatimModuleSyntax / missing bun + vite/client types applied to apps/server and apps/app sources that specs import transitively. Those projects compile themselves with their own tsconfigs.
  3. 43 errors – genuine spec-vs-testkit drift inside evals/.

What changed

Config (1 commit, 11daadc64) – evals/tsconfig.json adopts module: preserve + moduleResolution: bundler (what Vitest uses, and what tsconfig.primitives.json already did), lib: es2024 (Promise.withResolvers), customConditions: ["development"] (@openwork/sdk resolves to source, not an unbuilt dist/), jsx, resolveJsonModule, the @/* alias. New evals/scripts/typecheck.mjs reports only diagnostics for files under evals/ or explicitly included by the config – the same scoping check:browser already applies. Nothing inside evals/ is filtered (43 → 43 before the drift fixes). pnpm evals:typecheck now delegates to it. A later commit (2112ae56f) adds allowJs so two apps/desktop/electron/*.mjs imports are typed from their JS instead of implicit any.

Testkit restorations (2 commits) – where the spec was right and the testkit was narrower than its own runtime:

  • 6438d49b7 TargetRole gains combobox | listbox | alert. The locator already matched [role="combobox"]/[role="listbox"] candidates and resolved <select> to combobox. connector-catalog asserts notSee({ role: "alert" }) against connector-catalog.tsx's <p role="alert"> error line, but alert was in neither the type nor the candidate selector, so that absence claim was vacuous; it now really looks for alerts.
  • 47ed2e139 Seed.desktop({ den }) overload returns App (it always does at runtime), so world.member.workspaceId types.

Spec drift (12 commits, one spec each) – each fixes the spec to the testkit's current API; no claim removed, no any/casts:

spec fix runtime behaviour changed?
desktop-policy-restricted-mode Target annotation; regex tested against probe.text() instead of passing a RegExp to probe.has() (it was serialized to {} in the browser, so the "rejected unadvertised call" fallback always returned false) yes
tool-tester-page timeoutMs → within (unknown key left the deadline NaN, so the route wait never timed out) yes
connector-catalog none in the spec; testkit alert candidate above makes its notSee observable yes (via testkit)
mcp-connection-external-key-upsert auth: Record<string, string> parameter type no
plugin-mcp-connector-parity, remote-session-first-use carry if-throw-narrowed ids into hoisted function helpers no
landing-pricing probe returns ?? "" so the settled value is a string (until still requires the text) no
opencode-v2-provider-hot-inject capture the started sidecar once instead of server?. in the probe closure no
browser-tabs-owned-by-thread world.readBrowserState() (never existed on that world) → probe.browserState() no
connection-action-mcp-app, connector-search-intent isRecord type guard instead of typeof narrowing to object no
packages/testkit/test/testkit.test.ts annotate throwing guard getters (DenRef, DenSession, MockMcpHandle) no
packages/env/test/litellm.test.ts await the asyncDispose PromiseLike inside assert.rejects no

Tool Tester world (a1c5e537b) – toolTesterWorld starts on /dashboard/mcp-connections/configured: since #4693 (440504bb9, after the last green dev lane) the Connectors page shows configured connections as an icon strip and the rows the spec drives (Connect, more menu, Test tools) live on the configured list, so tool-tester-page timed out on its first claim on clean dev (control below). One-line route fix, no claim changed.

Docs + CI – evals/README.md documents the check and its scope; ci-tests.yml gets one Typecheck evals step (pnpm evals:typecheck) in the existing test-framework job. No new workflow file.

Resync note (merge 2d3aa5178 of origin/dev @ 71d22ac10): the CI hook is unchanged — still the single Typecheck evals step in the existing test-framework job of ci-tests.yml; dev did not touch that workflow, so it merged clean. Post-merge conflict resolutions and the 15 new type fixes are listed in the resync comment below.

Proof (at 0672c2776, final head a1c5e537b)

  • pnpm --dir evals typecheck → Type-checked 372 evals source files: no errors. exit 0 (baseline at 2ed12f72d = origin/dev: exit 2, 399 errors; after config only: 43, all inside evals/).
  • pnpm --dir evals check:browser → Checked 838 browser callbacks… exit 0 (it shares the tsconfig).
  • node --test runner/*.test.ts packages/*/test/*.test.ts bin/*.test.mjs scripts/*.test.mjs → 309 tests, 308 pass, 1 fail: packages/labs/test/mock-google.test.ts "mock Google attributes drafts to one mailbox…" – fails identically on clean origin/dev @ 2ed12f7 (controlled in a detached worktree).
  • pnpm --dir evals test as a whole is red on clean dev independently of this PR: lint:layers exits 39 with 39 specs-use-testkit-only violations, spec-channel-ratchet and spec-boundary-ratchet both fail – all identical on origin/dev @ 2ed12f7 (diffed). Not touched here; see "Noticed".
  • Daytona E2E, one named spec at a time with OPENWORK_EVAL_REF=0672c2776… (sandbox log shows HEAD is now at 0672c277):
spec ref result notes
connector-catalog 0672c2776 passed 1/0/0 (server + desktop + web sandboxes, all deleted) exercises the new alert locator candidate via notSee({ role: "alert" })
tool-tester-page 0672c2776 failed 0/1/0 at spec line 12 (see(connection.name) on /dashboard/mcp-connections) – before the changed line control at clean origin/dev @ 2ed12f72d fails identically → pre-existing since #4693
tool-tester-page a1c5e537b passed 1/0/0 after the world route fix the bounded within: 60_000 route wait now runs
desktop-policy-restricted-mode a1c5e537b Incomplete: 1 passed / 3 failed (964 s) test 3 "managed policy evaluation bounds transient Den retries" passed. Tests 1 and 4 fail on press("Escape") not dismissing the Library add dialog (notSee({ role: "textbox", label: "App name" }) at line 108, notSee({ testId: "library-add-choices" }) at line 876) – this is triage Cluster 6 / Brief G (#4645 Library add flow), owned by the sibling e2e/library-restricted-mode-drift branch (3086f1315 fix(app): hide the Dialog popup synchronously on dismiss). Test 2 "POLICY-ROLLBACK" fails in its world with which opencode2 on the runner host (this Mac has no opencode2; that world shims local binaries) – environment, not product. My changed line (1172, the rejection-regex fallback) is inside test 4 after line 876 and was not reached; it will be exercised once Brief G lands.

All sandboxes my runs created (openwork-server-*, openwork-connector-* with runner PIDs 26570, 60889, 96490, 50824) were deleted by the runner; daytona sandbox list shows none left.

Remaining typecheck errors

None. The 36 cause-2 errors in apps/app / apps/server sources are no longer reported by this check (they belong to those projects' own typechecks); they are unchanged in number and listed in AD's report.

Noticed, not touched

  • pnpm --dir evals test (test:eval-runner in CI) is red on dev: lint:layers (39 violations across 24 specs importing @openwork/{behaviors,cdp,hosts,env,test-evidence} directly), both ratchets (stale baselines and new-layer specs with raw channel escapes), and mock-google.test.ts (draft witness returns extra draftId/messageId/mime fields the assertion does not expect). CI's Run test-framework checks step must be failing on dev today.
  • eventually's until cannot narrow ((value: T) => boolean); a type-predicate overload would remove the ?? "" style fixes in specs.
  • desktop-policy-restricted-mode test 2 (POLICY-ROLLBACK) requires opencode and opencode2 on the driver host PATH (worlds/desktop-policies.ts:64); on a Mac without opencode2 the whole test fails in world setup before any claim. It should declare that in needs() so it skips loudly.
  • Daytona CLI/API skew warning on every exec (v0.210.0 vs v0.213.0), as AD noted.

Recreated from #4828, which GitHub auto-closed when its stacked base branch was deleted after the base PR merged. Same head branch (e2e/evals-typecheck-green), same commits; base is now dev. Reviewers: see the original thread on #4828 for context and Warden discussion.

…iagnostics

`pnpm --dir evals typecheck` was red on clean dev with 399 errors, 322 of them in
apps/, ee/ and packages/ sources that specs and worlds pull in transitively:
den-db is written for bundler resolution (extensionless re-exports), email
templates need jsx, and apps/server enums/namespaces reject evals' erasable
syntax flags. Those projects compile themselves with their own tsconfigs.

Adopt module: preserve + moduleResolution: bundler (the resolution vitest
actually uses, and what tsconfig.primitives.json already does), lib es2024 for
Promise.withResolvers, customConditions development so @openwork/sdk resolves
to source instead of an unbuilt dist/, and the @/ alias for apps/app imports.
Then report only diagnostics for files under evals/ or explicitly included, the
same way check:browser already scopes its claim. Nothing inside evals/ is
silenced: the remaining 43 errors are real spec-vs-testkit drift.
The locator already matched [role="combobox"] and [role="listbox"] candidates
and resolved a <select> to combobox, but TargetRole never listed them, so
desktop-policy-restricted-mode's { role: "combobox" } targets failed to type.
connector-catalog asserts notSee({ role: "alert" }) against the catalog's
<p role="alert"> error line; alert was neither in the type nor in the candidate
selector, so that absence claim could never observe an alert. Add all three to
the type and alert to the candidates so the claim is real.
seed.desktop({ den }) always yields an App (signed in against that Den, with a
workspaceId), but the single signature returned App | DesktopHandle, so every
world.member.workspaceId read failed to type. Add the den overload to the Seed
contract and its SeedChannel implementation.

Annotate the combobox target as Target so its role literal is not widened to
string, and test the rejection regex against probe.text() instead of passing a
RegExp to probe.has(): the RegExp was serialized to {} on the way into the
browser, so the fallback branch for a rejected unadvertised call always
returned false.
…l-key-upsert

The default value narrowed auth to { "x-api-key": string }, rejecting the
reader-session and If-Match header sets the spec already passes at runtime.
…nnector-parity

createPlugin and desktopReadiness are function declarations, so the
if-throw narrowing on marketplace and plugin does not reach them. Read the ids
once after the guards and use those.
The eventually probe returned string | undefined, so the settled value could not
be recorded as assertion evidence. An absent #product now reads as "", which
the until predicate still rejects.
…er-hot-inject

server is a let that is cleared in cleanup, so its narrowing does not reach the
eventually probe closure. Capture the started server once and drop the optional
chaining that made baseline possibly undefined.
…y-thread

The background world is built on builtinBrowserWorld, which never exposed
readBrowserState; the same read is probe.browserState() and the test already
holds probe.
…n connection-action-mcp-app

typeof checks narrow unknown to object, not Record<string, unknown>; use the
world's type guard the spec already imports from.
…arch-intent

typeof checks narrow unknown to object, not Record<string, unknown>; add the
usual isRecord guard and derive record() from it.
EventuallyOptions takes within, not timeoutMs; the unknown key left the
deadline NaN, so the route wait never timed out.
…per in remote-session-first-use

Function declarations do not see the if-throw narrowing, so orgId reached
queryDenDatabase as unknown.
enterprise-tls-chain-repair and worlds/infra.ts import apps/desktop/electron
modules that ship as .mjs; without allowJs they were implicit any (TS7016).
tsconfig.primitives.json already enables allowJs for the same reason.
A getter whose body only throws infers void; annotate the guardedDen fixture
getters with the DenRef, DenSession and MockMcpHandle types the Den contract
expects.
…n litellm.test

Symbol.asyncDispose returns PromiseLike<void>, which assert.rejects does not
accept directly; await it inside an async block.
pnpm --dir evals typecheck is green on this branch; run it as its own step so a
spec that drifts from the testkit API fails by name instead of only at runtime.
…s list

Since #4693 the Connectors page shows configured connections as an icon strip
and the connection rows (Connect, more menu, Test tools) live at
/dashboard/mcp-connections/configured, so tool-tester-page timed out on its
first claim on clean dev. Start the admin browser where the rows are.
Conflicts:
- evals/packages/cdp/src/input.ts: TargetRole is the union of both sides
  (dev added alert; this branch added combobox, listbox, alert).
- evals/specs/browser-tabs-owned-by-thread.e2e.test.ts: take dev's suspend
  control assertions after release_tab; dev already reads browser state
  through probe.browserState(), which subsumes this branch's fix.

Post-merge typecheck (15 new errors from PRs merged since the base), fixed to
the current testkit API without any/casts and without dropping a claim:
- connector-search-intent: annotate the invoke table (TS7022 cycle through
  the flow-narrowed token).
- den-connector-catalog uses role "heading": the locator now knows heading
  (h1-h6 implicit role, candidates only when that role is requested).
- helpers/member-grant-fixture: typed grants accumulator (also fixes the
  downstream implicit any in scim-deprovisioned-sso-reprovision).
- library-mcp-servers-from-config: browserScript callback instead of a raw
  code string with a non-existent args option.
- new-task-draft-return: keep both draft comparisons as separate booleans.
- route-session-list: RouteWorkspace literal gains the required preset.
- worlds/saved-apps + labs mock-mcp: MockMcpTool.result declares the
  structuredContent and _meta the mock already serves verbatim.

Signed-off-by: Guillaume Loret <[email protected]>
Split of #4828: this branch keeps the evals-only typecheck fixes (tsconfig,
evals-scoped diagnostics, spec/testkit drift) and drops the 3-line
`Typecheck evals` step in .github/workflows/ci-tests.yml so Warden can
self-clear it. The CI step follows in a stacked PR that needs a human review.

Signed-off-by: Guillaume Loret <[email protected]>
… step

The typecheck fixes now live in #4899 (self-clearable by Warden). This branch
keeps only the `Typecheck evals` step in .github/workflows/ci-tests.yml and
the README sentence that says CI runs it; the tree is unchanged.

Signed-off-by: Guillaume Loret <[email protected]>
@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 11, 2026 8:06pm UTC
openwork-den Ready Ready Preview Sep 11, 2026 8:06pm UTC
openwork-diagnostics Ready Ready Preview Sep 11, 2026 8:06pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
openwork-landing Ignored Ignored Preview Sep 11, 2026 8:06pm UTC

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: be27ef3
Status:🚫  Build failed.

View logs

@github-actions

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (13390 ms), confidentiality-review (4452 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 1
  • Distinct heads in retained window: 1
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 1/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@github-actions

Copy link
Copy Markdown
Contributor

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit be27ef30806a01c76c295f124f687f5328da4416 · selected evidence

Open review report

This branch was successfully deployed

3 active deployments
Preview – openwork-app — be27ef30 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-den — be27ef30 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-diagnostics — be27ef30 Deployed Sep 11, 2026 by vercel[bot]
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