# Web frontend subprocess creation

The worker starts Next.js through `start_web_frontend` in `openprogram/operations/worker/web.py` and restarts it when `.next/BUILD_ID` changes. Both spawn sites pass `no_window_creation_flags()` from `openprogram.host._platform.process_ownership`, and each imports it in its own function scope.

| Case | Behaviour |
| --- | --- |
| POSIX flags | Zero |
| Windows flags | Background window |
| Initial spawn raises `OSError` | Reported; returns `None` |
| Rebuild spawn raises `OSError` | Reported; the watcher still sees the next build |
| Shutdown | Stops the latest successfully spawned child |

**Acceptance and boundaries**

- Component tests call the public startup entry with fake subprocesses and capture the production watcher callback without starting an unbounded thread. A temporary `BUILD_ID` file drives successive rebuilds.
- They check helper flags at initial and repeated spawns, latest-child shutdown and recovery after a spawn error. Process creation and port reclamation are isolated, so the running App is unaffected.
- Command construction, environment propagation, port reclamation and manifest patching are unrelated to the flags. Watcher scheduling, shutdown cancellation and other platform behaviour are out of scope.
- No dependency, API, configuration or security-boundary change.
