Skip to content

test(evals): fail the packaged first-launch gate on late caught crashes and unhealthy final UI - #4814

Merged
yomgui merged 2 commits into
devfrom
test/startup-final-health-586
Sep 11, 2026
Merged

yomgui merged 2 commits into
devfrom
test/startup-final-health-586

Conversation

@yomgui

@yomgui yomgui commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

packaged-first-launch and packaged-activated-launch are the only specs that boot the packaged cloud/enterprise artifacts on a fresh profile. After the screenshot they wait a 3 s settle window and then re-read renderer exceptions only. A React error caught by the root AppErrorBoundary in a production build emits no Runtime.exceptionThrown, so a launch whose gate was replaced by the "OpenWork hit an unexpected error" recovery screen during that window — or whose controls vanished — still passed. The premise still holds on dev (2ed12f72d).

This makes the gate re-observe the actual surface after the last wait:

  • evals/worlds/packaged-first-launch.ts: new world.health() takes one fresh observation — the exception witness must still be attached, the Electron process alive (kill -0), and it returns #root text plus every input/button with visible/enabled state. exceptions() also asserts the witness is still attached, so a lost observer can no longer heal into a green run. A missing OPENWORK_EVAL_ELECTRON_BINARY is now an error, not a SkipError (a named spec that skipped already exited 2 via evals:e2e; the journey report treats both as "not tested").
  • Both specs: after the settle, assert the final #root does not match the recovery heading (now also OpenWork couldn't start), still contains the expected gate heading, and that the gate's controls (organization-server-input / organization-server-continue, or Sign in to OpenWork / Paste sign-in code) remain visible and enabled. The assertion evidence now records the final state and controls instead of the pre-screenshot DOM.

No product code changes. +66/−13 across the three files.

Verification (head aece4bdb2, rebased on dev 2ed12f72d)

Lane: local (macOS arm64). The packaged journeys are catalog placement local and need a packaged binary the Daytona lane does not provision; the original investigation of this false positive ran on Daytona against Linux packages built in-sandbox (baseline 2/2 red → patched 4/0, plus fresh enterprise / activated / cloud 1/0/0 each with WebGL unavailable) on 586c4100f.

Enterprise build from this head: node apps/desktop/scripts/electron-build.mjs && CSC_IDENTITY_AUTO_DISCOVERY=false pnpm --dir apps/desktop exec electron-builder --config electron-builder.enterprise.yml --mac --dir --publish never (both exit 0). Every spec run used OPENWORK_EVAL_ELECTRON_RESOURCES_PREPARED=1 OPENWORK_EVAL_ENGINE=v1 and an isolated OPENWORK_EVAL_SURFACES_DIR, with OPENWORK_EVAL_ELECTRON_BINARY pointing at the built .app.

Check Command Result
Fresh enterprise first launch (this gate) pnpm evals:e2e packaged-first-launch --local exit 0 — 1 passed / 0 failed / 0 skipped
Seeded-activated enterprise launch (this gate) pnpm evals:e2e packaged-activated-launch --local exit 0 — 1 passed / 0 failed / 0 skipped
Scoped typecheck of the three files (tsconfig.primitives.json) pnpm --dir evals exec tsc -p <scoped tsconfig> exit 0
pnpm --dir evals run check:browser exit 0 (839 callbacks)
git diff --check origin/dev HEAD exit 0

pnpm --dir evals run typecheck (tsc -p .) reports 400 pre-existing errors, all under ../apps/app and ../packages/email, none in the changed files. evals/scripts/spec-channel-ratchet.mjs is red on dev for unrelated specs (same failure reproduced in a clean dev worktree).

CI on this head (openwork-tests-build → packaged-smoke, Linux/xvfb, no WebGL) ran the new gate against the packaged artifacts it builds: desktop-boot-enterprise (packaged-first-launch, enterprise), desktop-boot-cloud (packaged-first-launch, cloud) and desktop-boot-enterprise-activated (packaged-activated-launch) all exit 0 — run 34505357196.

Negative control: the old gate passes a late caught crash, the new gate fails it

A throwaway enterprise build (never committed) adds a child inside the unchanged AppErrorBoundary that throws during render N ms after the gate heading mounts — after the spec's notSee observation(s) and screenshot, inside the 3 s settle window. Same head, same commands, only the binary and the gate files differ:

Build Gate files Spec Result
fault @ heading+4.5 s origin/dev packaged-first-launch exit 0 — 1 passed (false positive)
fault @ heading+4.5 s this PR packaged-first-launch exit 1 — 1 failed: startup recovery appeared during settle: expected 'OpenWork hit an unexpected error…' not to match …
fault @ heading+7.5 s origin/dev packaged-activated-launch exit 0 — 1 passed (false positive)
fault @ heading+7.5 s this PR packaged-activated-launch exit 1 — 1 failed: startup recovery appeared during settle

(A fault fired earlier, at heading+1.2 s or +4.5 s on the activated surface, is caught by both gates' notSee observation — the false positive is specific to the settle window after the screenshot.)

Not included

The Daytona fixture used for the original investigation (followup-startup-*.live.test.ts, evals/fixtures/followup-startup-health/) is bound to one sandbox id and the 586c4100f source pin and mocks @openwork/testkit; it stays as investigation evidence rather than repo tooling.

…es and unhealthy final UI

The packaged first-launch and activated-launch specs re-read renderer
exceptions after the settle window but not the surface itself. A React
error caught by the root boundary after the screenshot emits no Runtime
exception, so a launch whose gate was replaced by the recovery screen, or
whose controls vanished, still passed.

After the settle wait the world now takes one fresh observation
(`world.health()`): the exception witness must still be attached, the
Electron process alive, and the final #root must show the expected gate
heading with its controls visible and enabled, never the recovery
heading. A lost observer or a missing binary is an error, not a skip.
@vercel

vercel Bot commented Sep 10, 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:10pm UTC
openwork-den Ready Ready Preview Sep 11, 2026 7:10pm UTC
openwork-diagnostics Ready Ready Preview Sep 11, 2026 7:10pm UTC
openwork-landing Ready Ready Preview, v0 Sep 11, 2026 7:10pm UTC

@yomgui

yomgui commented Sep 10, 2026 •

Copy link
Copy Markdown
Member Author

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

Commit 13ea80fd9ec839313fcbe2673bded1502224d916 · selected evidence

Open review report

@github-actions

github-actions Bot commented Sep 10, 2026 •

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 (15846 ms), confidentiality-review (25639 ms), spec-provenance-review (49271 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • 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: 2/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 (aece4bdb2d7dcc9023be4de7f0f1c25d76ae947b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui

yomgui commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

Test evidence — a packaged flavor renders its first-launch gate without a render crash — ✅ passed

SHA aece4bd · engine v1

✅ 0/1 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending

Dry run: screenshots were not attached.

[probe] eventually(packaged distribution flavor) · eventually(enterprise first-launch gate mounted in #root)
[user] see(text=Link this app to your organization) · notSee(text=/OpenWork hit an unexpected error|OpenWork couldn't start/) · screenshot
verdict passed · 3 user observations (see ×1, notSee ×1, screenshot ×1) · 2 probes · steps 0/0

ℹ️ ASSERTION — 1. The enterprise desktop mounts "Link this app to your organization" on first launch without a render crash or an unexpected unhandled rejection

Final #root after 3000 ms: "OpenWork Enterprise\nLink this app to your organization\n\nEnter your workspace address — the page where you downloaded this app. Sign-in finishes in your browser and returns here.\n\nWorkspace address\nCon"; visible enabled controls: [{"tag":"input","text":"","testId":"organization-server-input","visible":true,"enabled":true},{"tag":"button","text":"Continue","testId":"organization-server-continue","visible":true,"enabled":true}]; render crashes: 0; allowlisted rejections: 0 of 0 known; unexpected rejections: 0

  • ✅ PASS The enterprise desktop mounts "Link this app to your organization" on first launch without a render crash or an unexpected unhandled rejection — Final #root after 3000 ms: "OpenWork Enterprise\nLink this app to your organization\n\nEnter your workspace address — the page where you downloaded this app. Sign-in finishes in your browser and returns here.\n\nWorkspace address\nCon"; visible enabled controls: [{"tag":"input","text":"","testId":"organization-server-input","visible":true,"enabled":true},{"tag":"button","text":"Continue","testId":"organization-server-continue","visible":true,"enabled":true}]; render crashes: 0; allowlisted rejections: 0 of 0 known; unexpected rejections: 0

⚪ UNVALIDATED — 2. a packaged flavor renders its first-launch gate without a render crash artifact 1

  • ⚪ UNVALIDATED — no visual expectations recorded.

Test run created 2026-09-10T16:48:49.557Z · Source: evals/results/test-runs/2026-09-10T16-48-49-556Z-a-packaged-flavor-renders-its-first-launch-gate-without-a-render-crash/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4814 --test-run 2026-09-10T16-48-49-556Z-a-packaged-flavor-renders-its-first-launch-gate-without-a-render-crash

Companion to the sticky test-evidence comment (which holds packaged-activated-launch for the same head). The single-run publisher replaces the sticky comment, and the review-app multi-run path (--all) is not usable from this machine (the available blob token targets a public store; the publisher requires private access), so this run is posted verbatim from --dry-run. Screenshot: 01-...-artifact-.png in the source test run below; no visual claim is made.

Pick up #4888 so ci-tests.yml's packaged Fast module step finds its test file.

Signed-off-by: Guillaume Loret <[email protected]>
@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: 13ea80f
Status:🚫  Build failed.

View logs

@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 (13ea80fd9ec839313fcbe2673bded1502224d916). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui
yomgui merged commit 081f35f into dev Sep 11, 2026
28 of 29 checks passed
@yomgui
yomgui deleted the test/startup-final-health-586 branch September 11, 2026 19:27
yomgui added a commit that referenced this pull request Sep 11, 2026
…ocker

#4814 (merged after #4849 was written) turned the packaged-launch world's
missing-binary SkipError into a plain Error. The catalog/spec/world parity
test only recognised SkipError guards, so packaged-first-launch and
packaged-activated-launch looked like drift although the lane still cannot
run them. Recognise `throw new Error` in the same guard window, with a unit
case.

Signed-off-by: Guillaume Loret <[email protected]>
yomgui added a commit that referenced this pull request Sep 11, 2026
…ourney failures (split of #4849, no workflow change) (#4901)

* ci(evals): report packaged and macOS-only journeys as not applicable in the CI lane

The scheduled Full regression selected six packaged enterprise journeys and
computer-use-window-scope as local jobs, but no job in daytona-e2e.yml builds
a packaged desktop binary or runs on macOS, so each one threw SkipError,
recorded 'not tested', and turned red on every run. The lane could neither
confirm nor refute changes to activation, updater or quit paths.

Journeys now declare what they need beyond placement (an env var or a
platform) in the catalog. The planner compares those needs with what the lane
provides, excludes journeys it cannot satisfy from the matrix, and lists them
in the plan and the verdict as 'not applicable' with the missing need. They no
longer count toward passed, failed or not tested, so red means red.

The packaged journeys stay covered against a real enterprise build by
apps/desktop/scripts/packaged-smoke.mjs in ci-tests.yml on every PR and push.
Building that binary inside the nightly is a follow-up.

The 'only' dispatch input accepts a comma-separated list so a targeted run can
name several journeys.

* ci(evals): declare every lane prerequisite a journey guards and refuse delimiter-only filters

Second-opinion review of #4849 (9ce91b0), §4 "Requirements and scope":

- journey-catalog.mjs:26 declared only OPENWORK_EVAL_ELECTRON_BINARY for
  released-enterprise-activated, but the spec's update case also requires
  OPENWORK_EVAL_RELEASED_BASELINE_BINARY (released-enterprise-activated
  .e2e.test.ts:18-20). A lane providing only the main binary would have
  scheduled it and skipped. The catalog now names both.
- TestNeeds (evals/packages/env/src/needs.ts:3-10) had no `platform`, so the
  catalog's `needs: { platform }` was planner-only vocabulary. `platform` now
  lives in TestNeeds and unmetNeeds checks it, and computer-use-window-scope
  declares `needs: { platform: "darwin" }` alongside its world guard
  (evals/worlds/computer-use.ts:73), so specs and catalog share one vocabulary.
- Parity guard: for every catalog entry with `needs`, journey-ci.test.mjs
  statically scans the spec and the worlds it imports for `needs: { env,
  platform }` declarations and for `process.env.OPENWORK_EVAL_*` /
  `process.platform` checks leading to `throw new SkipError`, and fails on
  drift in either direction (spec-only addition -> red; catalog-only
  addition -> silently dropped coverage). Scoped to declared journeys because
  shared worlds (first-run.ts:582,725) carry scenario-specific guards;
  per-scenario world plans remain #4771's job.
- selectJourneys (journey-catalog.mjs:76-78) treated `only=", ,"` as "run
  everything". Nonblank delimiter-only input now throws a clear error; blank
  input still selects everything. Unit-tested.

node --test evals/scripts/journey-ci.test.mjs: 16 pass, 0 fail.

* ci(evals): report unschedulable journeys as "skipped: lane cannot satisfy prerequisites" in every run

Second-opinion review of #4849 (9ce91b0), §3 "Framing and downstream
effects": unqualified "not applicable" makes an infrastructure omission
sound intentional. The state is a coverage gap and is now named as one.

- plan.json / journey-report.json field renamed `notApplicable` -> `excluded`
  (the only consumers are plan-journeys.mjs, journey-report.mjs and
  notify-journeys.mjs in the same workflow; nothing external reads it).
- Human label everywhere: "skipped: lane cannot satisfy prerequisites"
  (journey-report.mjs EXCLUDED_LABEL).
- The plan step summary and the Full regression verdict summary both print
  `N journeys skipped (prerequisites unmet)` followed by the list with each
  journey's unmet need, on every run — not only inside the artifact. The
  count line reads `P passed · F failed · N not tested · X skipped
  (prerequisites unmet)`.
- Excluded journeys still count toward neither passed, failed nor not tested,
  a stray result for one cannot count as coverage, and an all-excluded
  selection still fails the plan job (now with the new wording).

node --test evals/scripts/journey-ci.test.mjs: 16 pass, 0 fail.

* ci(evals): alert on reclassified journeys as reclassified, never as recovered

Second-opinion review of #4849 (9ce91b0), §3 "Must fix":
notify-journeys.mjs:7-14 dropped the excluded journeys when validating the
report, and :20-28 built incident state from executed entries only, so a
journey that went failed -> excluded disappeared from `failures` and the next
scheduled run would have announced "Recovered — all selected checks passed"
without that journey ever passing.

- validateReport keeps `excluded` (spec, name, reason; capped, no overlap
  with executed results) next to `entries` and `counts`.
- Incident state gains `excluded: [spec]`. State written before this field
  existed reads as "nothing excluded".
- A previously failing journey that is now excluded is reported as
  "reclassified: prerequisite unsatisfied (needs: ...)" with the summary
  "Executed checks passed — not a recovery"; "Recovered" is only said when
  nothing was reclassified. Failure alerts carry the excluded count in their
  count line and list excluded journeys with reasons. Healthy runs with
  persisting exclusions stay quiet; excluded -> passed is a healthy run.
- Transition tests in evals/scripts/notify-journeys.test.mjs: failed ->
  excluded (reclassified, not Recovered), genuine recovery, excluded persists,
  excluded -> passed, payload counts/reasons, untrusted reasons escaped.
- ci-tests.yml `openwork-tests-core` runs the new file alongside
  journey-ci.test.mjs and flake-report.test.mjs (evals `pnpm test` already
  globs scripts/*.test.mjs).

node --test evals/scripts/journey-ci.test.mjs evals/scripts/flake-report.test.mjs evals/scripts/notify-journeys.test.mjs: 27 pass, 0 fail.

* ci(evals): catalog needs mean whole-file blockers; keep released baseline a case-level need

Second-opinion review of #4849 (comment 5628206745, §4) and the audit
correction (comment 5628261660): "Do not union prerequisites across a file:
that would suppress its runnable launch world." 18d26d6 had declared
OPENWORK_EVAL_RELEASED_BASELINE_BINARY as a journey-level need for
released-enterprise-activated; only its update case needs it
(released-enterprise-activated.e2e.test.ts:18-20), the launch case runs with
the main binary alone.

- The catalog declares the main binary only again and documents that `needs`
  means a whole-file blocker; case-level prerequisites stay in that case's
  own `needs` and skip with their own reason (the verdict counts such a skip
  as not tested, so the lane that runs this journey must provide both
  binaries to pass it — #4848).
- The parity guard now computes whole-file blockers explicitly: the
  intersection of every `needs: { env }` declaration in the spec, plus env
  reads / platform checks leading to `throw new SkipError` in imported world
  bodies (which every case runs). Mixed-world unit test: a need one case
  declares is never promoted to the file; world-body guards always are; an
  optional env read without a SkipError is not a blocker.
- `needs` vocabulary stays TestNeeds (needs.ts); no third authority. Per-
  scenario world plans remain #4771/#4762.

node --test evals/scripts/journey-ci.test.mjs: 17 pass, 0 fail.

* ci(evals): announce a selection change (newly skipped journey) once, quietly thereafter

Second-opinion review of #4849 (comment 5628206745, §3): "propagate
count/reasons and selection changes through Slack/state". 31131a4 carried
excluded journeys in state and distinguished reclassification from recovery,
but a journey that moved from passing to excluded (a lane or catalog change
removing coverage) stayed silent.

- When prior state exists, journeys excluded now but not in
  `previous.excluded` (and not reclassified failures) are announced once as
  "Executed checks passed — coverage changed: N journey(s) newly skipped
  (prerequisites unmet)" with each journey's need; the next run with the
  same exclusions is quiet. State from before the field existed announces
  the current exclusions once. No prior state at all stays quiet.
- Failure alerts already list every excluded journey with reasons and are
  unchanged.

node --test evals/scripts/journey-ci.test.mjs evals/scripts/flake-report.test.mjs evals/scripts/notify-journeys.test.mjs: 29 pass, 0 fail.

* ci(evals): distinguish unsatisfied lane prerequisites from executed journey failures, without workflow edits

Split of #4849: every behavioural change lives in evals/scripts (planner,
report, alert), evals/packages/env (TestNeeds.platform) and one spec's
needs declaration. The two one-line .github/workflows edits (the `only`
input description in daytona-e2e.yml and the explicit notify-journeys test
in ci-tests.yml's core job) are dropped here so Warden can self-clear this
PR; they stay in #4849, stacked on this branch, for a human review.

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

* test(evals): count a hard-error prerequisite guard as a whole-file blocker

#4814 (merged after #4849 was written) turned the packaged-launch world's
missing-binary SkipError into a plain Error. The catalog/spec/world parity
test only recognised SkipError guards, so packaged-first-launch and
packaged-activated-launch looked like drift although the lane still cannot
run them. Recognise `throw new Error` in the same guard window, with a unit
case.

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

---------

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

This branch was successfully deployed

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