Skip to content

test(desktop): fail packaged first launch on unhandled rejections and cover activated enterprise boot - #4727

Merged
yomgui merged 4 commits into
devfrom
test/first-launch-gate-tighten
Sep 10, 2026
Merged

yomgui merged 4 commits into
devfrom
test/first-launch-gate-tighten

Conversation

@yomgui

@yomgui yomgui commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

Tightens the packaged first-launch journey and adds the already-activated enterprise boot path (what existing customers hit after an update).

  • Rejections gate now. packaged-first-launch used to exempt every Uncaught (in promise) exception. It now allows only exactly-matched messages from KNOWN_LAUNCH_REJECTIONS (documented as tracked debt) and prints any other unhandled rejection in full. Render crashes and the recovery heading (/OpenWork hit an unexpected error/) still fail fast; the allowlisted count lands in evidence.
  • Allowlist is empty. The only known rejection (Error invoking remote method 'openwork:desktop': ... OpenWork must be activated ..., 2× on a fresh enterprise launch) came from two boot-time fire-and-forget window-chrome IPCs the enterprise shell refuses before activation: syncNativeTheme (apps/app/src/app/theme.ts, __setNativeTheme, via bootstrapTheme() in index.react.tsx) and the module-level syncApplicationMenuVisible (apps/app/src/react-app/shell/ui-state-store.ts, __setApplicationMenuVisible). Both are void-ed cosmetic calls; each now gets a one-line .catch(() => undefined). The pre-activation command allowlist in desktop-distribution.mjs is untouched.
  • New journey packaged-activated-launch (own spec + shared world): boots the enterprise binary with a bootstrap seeded as activated (baseUrl/apiBaseUrl/enterpriseActivation.denBaseUrl on a freshly allocated, closed local port). Asserts #root is non-empty, no render crash, no recovery heading, the activation gate heading is not shown, and the sign-in surface heading (Welcome to OpenWork) is shown — deterministic offline, no Den needed.
  • packaged-smoke.mjs: one additive phase, desktop-boot-enterprise-activated, reusing the already-packaged enterprise binary. Catalog entry with placement: 'local'.

Verification (local lane, macOS arm64 packaged builds from this tree)

Daytona was not used: this journey needs the packaged binaries built here (placement: 'local' in the catalog).

pnpm --filter openwork-server build && node apps/desktop/scripts/electron-build.mjs --server-built
CSC_IDENTITY_AUTO_DISCOVERY=false pnpm --dir apps/desktop exec electron-builder --config electron-builder.enterprise.yml --mac --dir --publish never --config.directories.output=/tmp/ow-gate/fixed
CSC_IDENTITY_AUTO_DISCOVERY=false pnpm --dir apps/desktop exec electron-builder --config electron-builder.cloud.yml --mac --dir --publish never --config.directories.output=/tmp/ow-gate/fixed-cloud

With OPENWORK_EVAL_ELECTRON_RESOURCES_PREPARED=1 OPENWORK_EVAL_ENGINE=v1 OPENWORK_EVAL_SURFACES_DIR=/tmp/ow-gate/profiles:

Spec Binary Command Result
packaged-first-launch enterprise (this tree) pnpm evals:e2e packaged-first-launch --local exit 0, 1 passed / 0 failed / 0 skipped — 0 allowlisted, 0 unexpected rejections
packaged-first-launch cloud (this tree) same exit 0, 1 passed / 0 failed / 0 skipped
packaged-activated-launch enterprise (this tree) pnpm evals:e2e packaged-activated-launch --local exit 0, 1 passed / 0 failed / 0 skipped
packaged-first-launch enterprise, this tree before the guard same exit 1, fails by name: an unhandled promise rejection outside KNOWN_LAUNCH_REJECTIONS (0 allowed) during enterprise first launch listing the 2 openwork:desktop activation rejections in full
packaged-first-launch released 0.18.44 enterprise (negative control) same exit 1, fails by name: a provider context was missing during first launch (Local context is missing)

Static checks: node --test evals/scripts/journey-ci.test.mjs 13/13 pass; pnpm --filter @openwork/app typecheck clean; evals tsc -p . reports 0 errors in the touched files (pre-existing errors elsewhere on dev unchanged); lint:layers 39 violations before and after (none in these files); spec-channel-ratchet / spec-boundary-ratchet add no violations from these files (pre-existing dev debt unchanged).

Warden (pnpm warden:check, bare, on HEAD d4be556 vs origin/dev c744e2d, exit 0): diff-security-review, confidentiality-review, spec-provenance-review, desktop-den-sync-review all completed — no findings.

… cover activated enterprise boot

- packaged-first-launch: replace the blanket "Uncaught (in promise)" exemption
  with an exactly-matched allowlist (KNOWN_LAUNCH_REJECTIONS, empty) and print
  any other unhandled rejection in full; render crashes and the recovery
  heading still fail fast, allowlisted counts land in evidence.
- Guard the two boot-time fire-and-forget window-chrome IPCs (__setNativeTheme,
  __setApplicationMenuVisible) that the enterprise shell refuses before
  activation, so the fresh enterprise launch no longer rejects at all.
- packaged-activated-launch: boot the enterprise artifact with an activated
  bootstrap pointing at a closed local port and assert it reaches the sign-in
  surface, never the activation gate, without a crash or recovery screen.
- packaged-smoke: add the desktop-boot-enterprise-activated phase on the
  already-packaged enterprise binary.
@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 10, 2026 3:04am UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Ignored Ignored Preview Sep 10, 2026 3:04am UTC
openwork-diagnostics Ignored Ignored Preview Sep 10, 2026 3:04am UTC
openwork-landing Ignored Ignored Preview Sep 10, 2026 3:04am UTC

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Passed · 6/6 tests · 7/7 assertions · 5 images

Commit 0545df6e0f2c0c47caa12d4c3edc6fe452994b02 · 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: 1. 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 (86076 ms), confidentiality-review (76731 ms), spec-provenance-review (133499 ms), desktop-den-sync-review (80190 ms).

Blockers

  • None.

Advisories

  • R82-22S · medium · spec-provenance-review · evals/specs/packaged-first-launch.e2e.test.ts:66

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 3
  • Distinct heads in retained window: 3
  • 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: 3/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[bot]
diff-warden Bot previously approved these changes Sep 10, 2026

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

…ckaged launch

Xvfb CI runners (and some VDI desktops) offer no WebGL, so the decorative
Dithering background on the activation gate and sign-in surface rejects while
the page still mounts. Track it as the one exactly-matched known rejection.
diff-warden[bot]
diff-warden Bot previously approved these changes Sep 10, 2026

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

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

This branch was successfully deployed

4 active (3 outdated) deployments
Preview – openwork-app — 0545df6e Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-landing — d4be5567 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-den — d4be5567 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-diagnostics — d4be5567 Deployed Sep 10, 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