Skip to content

chore(loop): bootstrap autonomous desktop-feature loop infra#38

Merged
DragonnZhang merged 1 commit into
mainfrom
loop/bootstrap-autonomous-loop-infra
Jun 30, 2026
Merged

chore(loop): bootstrap autonomous desktop-feature loop infra#38
DragonnZhang merged 1 commit into
mainfrom
loop/bootstrap-autonomous-loop-infra

Conversation

@DragonnZhang

Copy link
Copy Markdown
Collaborator

What

Bootstraps the three prerequisites the unattended desktop-feature loop needs before it can run end-to-end. No product/runtime behavior changes — this is tooling + docs only.

1. e2e CDP harness (bun run e2e)

A dependency-free end-to-end harness that launches the built Electron app with the Chrome DevTools Protocol enabled, drives the real UI over CDP, and asserts on what the user would actually see.

  • e2e/cdp.ts — minimal CDP client over Bun's global WebSocket + fetch (evaluate, waitForFunction, waitForSelector, click, getText, screenshot). Zero new dependencies.
  • e2e/app.ts — launches electron apps/electron --remote-debugging-port=<port>, finds the main renderer target, attaches a session, owns teardown.
  • e2e/runner.ts — auto-discovers e2e/assertions/*.assert.ts, runs each against a fresh isolated app instance, screenshots on failure, exits non-zero if any fail (so it can gate a PR).
  • e2e/assertions/app-boots.assert.ts — example/template assertion (app boots + React mounts into #root).
  • e2e/README.md — how to run and how to add assertions.

Isolation: runs against a throwaway profile under .e2e/ (gitignored) — Electron userData, app config (~/.craft-agent), and the default conversation workspace (~/Documents/...) are all redirected, so runs never touch real OpenWork data.

Headless-aware: on a headless Linux host (no DISPLAY) the launcher runs Electron under xvfb-run with --no-sandbox, so the same harness works in CI / the cloud routine.

2. docs/loop/feature-ledger.md

Cross-run ledger with a status state machine (proposed / in-progress / pr-open / merged / rejected / blocked) and selection rules. GitHub (PRs/issues labeled loop-bot) is the source of truth; this is the loop's working memory.

3. docs/loop/capability-inventory.md

Baseline inventory of OpenWork's current desktop capabilities, grouped by area with representative file anchors, so the loop can diff candidate features against what already exists.

Verification

bun run e2e passes locally against the built app (macOS), launching the real Electron app, attaching via CDP, and asserting React mounts — clean teardown, no lingering processes, fresh isolated profile (verified no real session data leaks in).

Notes

  • Frontend/tooling only; does not touch the vendored qwen-code backend.
  • Intentionally not labeled loop-bot — this is human-initiated bootstrap, not a loop-generated feature PR, so the loop should not reconcile it as its own.

Prerequisites for the unattended desktop-feature loop:

- e2e CDP harness (`bun run e2e`): launches the built Electron app with
  remote debugging, drives the real UI over the Chrome DevTools Protocol,
  and asserts on rendered state. Zero new deps (Bun's WebSocket + fetch).
  Runs against an isolated profile (config, userData, default workspace
  redirected under .e2e/) and is headless-aware (xvfb + --no-sandbox on
  Linux). Ships an app-boot smoke assertion as the template for new ones.
- docs/loop/feature-ledger.md: cross-run ledger with a status state
  machine (proposed/in-progress/pr-open/merged/rejected/blocked).
- docs/loop/capability-inventory.md: baseline inventory of current
  desktop capabilities to diff candidate features against.
@DragonnZhang
DragonnZhang merged commit 4c8ccee into main Jun 30, 2026
1 check passed
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