Skip to content

test(evals): make evals typecheck green — bundler resolution, evals-only diagnostics, fix real spec/testkit drift (split of #4828, no CI change) - #4899

Merged
yomgui merged 21 commits into
devfrom
e2e/evals-typecheck-green-fixes
Sep 11, 2026
Merged

yomgui merged 21 commits into
devfrom
e2e/evals-typecheck-green-fixes

Conversation

@yomgui

@yomgui yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member

Split of #4828 (2026-09-11): this PR carries the typecheck fixes only so Warden can self-clear it; #4828 is reduced to the 3-line Typecheck evals CI step (.github/workflows/ci-tests.yml), stacked on this branch, and waits for a human approving review.

What this PR contains (all under evals/, plus one root package.json script line)

pnpm --dir evals typecheck was red on clean dev (455 errors at fde910387 today; 399 when #4828 was opened) and nothing ran it. Three independent causes, from #4828's RCA:

  1. ~73 % – evals compiled with moduleResolution: nodenext, but worlds/infra.ts pulls in @openwork-ee/den-db (written for Bundler resolution) 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 specs import transitively; those projects compile themselves.
  3. 43 errors – genuine spec-vs-testkit drift inside evals/.
  • Config: evals/tsconfig.json adopts module: preserve + moduleResolution: bundler (what Vitest uses), lib: es2024, customConditions: ["development"], jsx, resolveJsonModule, allowJs, the @/* alias. New evals/scripts/typecheck.mjs reports only diagnostics for files under evals/ (or explicitly included). Nothing inside evals/ is filtered. pnpm evals:typecheck delegates to it.
  • Testkit restorations: TargetRole gains combobox | listbox | alert (the connector-catalog notSee({ role: "alert" }) claim was vacuous before); Seed.desktop({ den }) overload returns App.
  • Spec drift (one commit per spec, no claim removed, no any/casts): desktop-policy-restricted-mode, tool-tester-page (timeoutMs → within: the route wait deadline was NaN), mcp-connection-external-key-upsert, plugin-mcp-connector-parity, remote-session-first-use, landing-pricing, opencode-v2-provider-hot-inject, browser-tabs-owned-by-thread, connection-action-mcp-app, connector-search-intent, testkit.test.ts, litellm.test.ts.
  • Tool Tester world starts on /dashboard/mcp-connections/configured (since Add working Gmail, Calendar, Drive, Sheets, and Microsoft 365 actions #4693 the rows the spec drives live there).
  • evals/README.md documents the check and its evals-only scope.

Full per-spec table, Daytona controls, and the "noticed, not touched" list are in #4828's body.

Not in this PR

The Typecheck evals step in ci-tests.yml (regression guard). It stays in #4828, now stacked on this branch, because Warden never self-clears a PR touching .github/ (warden-clearance.yml:100-107). Until it lands, run pnpm evals:typecheck before pushing.

Verification (head 50e4b8dff, local lane; this PR has no product surface of its own)

Command Result
pnpm evals:typecheck Type-checked 406 evals source files: no errors. exit 0 — control on clean origin/dev @ fde910387: 455 errors, exit 2
pnpm --dir evals check:browser exit 1 with 1 finding (inference-gateway-transport-security.test.ts:275, capture of count, introduced by #4358 on dev, file identical to dev) — control on clean dev: 6 findings including that one; the other 5 are fixed here
node --test packages/cdp/test/*.test.ts packages/testkit/test/testkit.test.ts packages/env/test/litellm.test.ts (evals) 45 pass / 0 fail
git diff origin/dev...HEAD -- .github empty

Daytona E2E re-runs on this head for the two specs whose runtime behaviour changed (connector-catalog via the alert locator candidate, tool-tester-page via the bounded route wait and the world route) are published in the sticky comment below when complete.

…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]>
@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 7:19pm UTC
openwork-den Ready Ready Preview Sep 11, 2026 7:19pm UTC
openwork-diagnostics Ready Ready Preview Sep 11, 2026 7:19pm UTC
openwork-landing Ready Ready Preview, v0 Sep 11, 2026 7:19pm UTC

yomgui added a commit that referenced this pull request Sep 11, 2026
… 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]>
@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 (72055 ms), confidentiality-review (136293 ms), spec-provenance-review (189948 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.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (50e4b8dffc48cbecf922a352796547aadb5a204d). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@different-ai different-ai deleted a comment from github-actions Bot Sep 11, 2026
@yomgui

yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

Test evidence — an admin reaches the Tool Tester from Connectors and can test and govern an MCP tool — ✅ passed

SHA 50e4b8d · sandbox ref 50e4b8d · engine v1

⏳ 0/2 screenshots passed · 2 pending · 0 expectations passed · 0 failed · 8 pending

[world] mock(mcp) · den(daytona) · orgConnection("Tool Tester Probe 1789155177504") · [seed] api GET /v1/me/orgs · [seed] api POST /v1/mcp/token · web(signed in)
[user] see(text=Tool Tester Probe 1789155177504, timeoutMs=60000) · Connect · click(Connect) · testId=mcp-connection-more-emc_01m28zax2geqjvcwwvqtnnk1s2 · click(testId=mcp-connection-more-emc_01m28zax2geqjvcwwvqtnnk1s2) · notSee(text=View tools) · testId=test-mcp-tools-emc_01m28zax2geqjvcwwvqtnnk1s2 · click(testId=test-mcp-tools-emc_01m28zax2geqjvcwwvqtnnk1s2)
[probe] eventually(tool tester route)
[user] see(text=/Run any tool your connections expose/, timeoutMs=60000) · see(text=Tool Tester Probe 1789155177504) · see(label=Search tools) · type(label=Search tools, "echo") · text=/mock_echo/ · click(text=/mock_echo/) · see(Form) · see(JSON) · type(label=/^text\s**?$/i, "tool-tester-1789155241207") · Run tool · click(Run tool) · see(text=/Tool completed/, timeoutMs=120000) · see(text=/OpenWork/) · see(text=/HTTP 200/) · see(text=/Tool result/) · see(text=/tool-tester-1789155241207/) · see(Result) · see(Request) · see(Response)
[probe] toolCalls(mock_echo) · toolCalls(mock_batch)
[user] see(text=/Kept in this browser for this session only.*never stores run results/i) · see(label=Tools enabled for your organization)
[vision] looks(4 expectations)
[user] text=/mock_batch/ · click(text=/mock_batch/) · see(text=/schema can't be shown as a form/i) · see(textbox) · testId=tool-policy-switch-mock_echo · click(testId=tool-policy-switch-mock_echo) · see(text=/Disabled by Sarah/, timeoutMs=60000) · text=/mock_echo/ · click(text=/mock_echo/) · see(text=/Disabled for your organization by Sarah/) · see(Enable tool)
[probe] toolCalls(mock_echo)
[vision] looks(4 expectations)
steps 1 ✅ mock_echo runs from a schema-derived form (22.8s) · 2 ✅ Nested schemas honestly fall back to JSON (0.4s) · 3 ✅ Organization policy disables discovery and execution (1.5s)
verdict passed · 24 user observations (see ×21, notSee ×1, looks ×2) · 4 probes · steps 3/3

⏳ PENDING — 1. The dedicated Tool Tester page shows a completed mock_echo run

  • ⏳ PENDING The dedicated Tool Tester page shows a completed mock_echo run — vision judgment deferred
  • ⏳ PENDING A clear trace reads OpenWork, HTTP 200, and Tool result — vision judgment deferred
  • ⏳ PENDING The result is visible with Result, Request, and Response tabs available — vision judgment deferred
  • ⏳ PENDING No error banner or crash message is visible — vision judgment deferred

The dedicated Tool Tester page shows a completed mock_echo run

⏳ PENDING — 2. The Tool Tester shows mock_echo disabled for the organization

  • ⏳ PENDING The Tool Tester shows mock_echo disabled for the organization — vision judgment deferred
  • ⏳ PENDING The disabled state visibly attributes the policy change to Sarah — vision judgment deferred
  • ⏳ PENDING Run tool is disabled and an Enable tool action is available — vision judgment deferred
  • ⏳ PENDING No generic error or crash message is visible — vision judgment deferred

The Tool Tester shows mock_echo disabled for the organization


Test run created 2026-09-11T19:31:04.218Z · Source: evals/results/test-runs/2026-09-11T19-31-04-217Z-an-admin-reaches-the-tool-tester-from-connectors-and-can-test-and-govern-an-mcp-/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4899 --test-run 2026-09-11T19-31-04-217Z-an-admin-reaches-the-tool-tester-from-connectors-and-can-test-and-govern-an-mcp-

@yomgui

yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

Daytona re-runs on head 50e4b8dff (OPENWORK_EVAL_DAYTONA=1 OPENWORK_EVAL_REF=50e4b8dff…):

Spec Result Note
tool-tester-page passed 1/0/0, refMismatch: false exercises the bounded within: 60_000 route wait and the world's /dashboard/mcp-connections/configured start route — sticky evidence comment
connector-catalog failed 0/1/0 in world setup, before any claim: Desktop control action session.create_task failed: Task creation did not return a session ID. (worlds/library.ts:1047 → connectorCatalogDiscovery) Control on clean origin/dev @ fde910387 fails identically at the same line (two attempts on this head, one on dev). Pre-existing on dev, unrelated to the alert locator candidate this PR adds (that line is never reached). Not published as green; not this PR's regression.

Verdict for what this PR contains: Passed for the typecheck (455 → 0), check:browser (6 → 1, the remaining finding is #4358's), 45 unit tests and tool-tester-page; the connector-catalog runtime claim for the alert candidate stays Incomplete until the connectorCatalogDiscovery world's session.create_task failure on dev is fixed (it was green on 0672c2776 in #4828's original run, so the world broke on dev between then and now).

@yomgui
yomgui merged commit f31e9b8 into dev Sep 11, 2026
36 checks passed
@yomgui
yomgui deleted the e2e/evals-typecheck-green-fixes branch September 11, 2026 19:56
yomgui added a commit that referenced this pull request Sep 11, 2026

This branch was successfully deployed

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