FE-1529: Document the local optimizer loop and make its launcher self-healing - #9394
Draft
kube wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌟 What is the purpose of this PR?
Documents
yarn dev:petrinaut-optimizationin the architecture docs and makes its launcher recover from its own leftovers. Replaces #9388 (same ticket, different stack): this version also fixes the failure where a container leaked by a hard-killed launcher holds port 4004 and every later launch exits with "port is already allocated" before Vite starts — reproduced today with a 46-minute-oldpetrinaut-opt-website-dev-71483.🔗 Related links
🔍 What does this change?
apps/petrinaut-website/scripts/optimization-dev.mjs:petrinaut-opt-website-dev) and, before starting, force-removes any container matching it — including the PID-suffixed names earlier versions leaked. A launcher that never reached its cleanup no longer blocks every later run, and the image rebuild stays meaningful: a leftover would keep serving the code it was built from.127.0.0.1:4004healthily (the compose stack's container, or a bareuvicorn), skipping Docker entirely; teardown leaves it alone. Launcher-owned leftovers never reach this check — they are removed first. (From FE-1529: Document the local optimizer loop #9388.)yarn dev:petrinaut-optimization --port 5175 --strictPortpins the website port. (From FE-1529: Document the local optimizer loop #9388.)Docs:
libs/@local/petrinaut-arch-docs/content/optimizer/running-the-loop-locally.mdx(from FE-1529: Document the local optimizer loop #9388), with the step list updated to the new leftover-sweep and scoped-reuse behaviour. The rest of the page — the/optimizationroute gate, the request path through the Vite proxy and thepetrinaut servesubprocess, and the no-Docker uvicorn flow — carries over unchanged.🐾 How to test
yarn dev:petrinaut-optimization, thenkill -9the launcher — the container survives (this is the leak).yarn dev:petrinaut-optimizationagain: it prints "Removing leftover Petrinaut Opt dev container…", rebuilds, and reaches Vite. Before this change it exited with "Bind for 127.0.0.1:4004 failed: port is already allocated".Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🤖 Generated with Claude Code