touch-tcp-pool
Make changes to the TCP host-port pool or L4 bootstrap safely. Highest-risk area in the repo — PR
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Make changes to the TCP host-port pool or L4 bootstrap safely. Highest-risk area in the repo — PR
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Keep the Go tree at its ~85% line-coverage bar when new or changed code lands. Finds the packages your branch touched, measures their coverage, locates the uncovered lines, and writes table-driven tests in the package's existing style. Use before opening any PR, or when the user says "add tests", "the new code has no tests", "check coverage", "bring this up to 85%", or "why did coverage drop". Proactively suggest right after a new package/driver/handler is written and before the PR goes up.
Safely modify Service.CreateSandbox or anything it transitively calls. Walks the boot path step-by-step, enforces the failure-cleanup rules, and reminds you to document boot-latency impact in the PR. Use when the user asks to "change sandbox creation", "add this to sandbox boot", "modify CreateSandbox", or any change that lands inside internal/service/service.go near the create path. Proactively suggest as soon as a change is proposed that adds DB queries, HTTP calls, file I/O, or lock acquisitions to sandbox boot.
Add a Daytona-SDK-compatible route under /daytona/... by translating Daytona's wire shape to internal/service calls. Keeps version branching out of internal/. Use when the user asks to "support this in the Daytona facade", "add a /daytona route", "make Daytona SDK work with X", or wants to extend Daytona compatibility coverage. Proactively suggest when adding a feature that has a corresponding Daytona SDK call.
Add a new AerolVM docs page (.mdx) with synced five-language tabs and register it in the Starlight sidebar. Enforces the repo's hard rules — no raw curl, all five SDK languages, syncKey="lang" on every tab block. Use when the user asks to "add a docs page", "document this feature", "write the docs for X", or after shipping a user-facing capability that isn't documented yet. Proactively suggest after a new SDK method or top-level feature lands.
Add an E2B-SDK-compatible route under /e2b/... by mirroring the Daytona facade pattern. The /e2b package does not exist yet — copy pkg/api/daytona/ as the template. Forces the open create-idempotency design question to be answered before coding. Use when the user asks to "build the e2b facade", "add an /e2b route", "make E2B Python SDK work with X", or work on plans/sdk-compatibility/e2b/. Proactively suggest when an E2B SDK call needs server-side support.
Add an external-storage mount adapter (S3, NFS, SSHFS, rclone, etc.) under pkg/mounts/adapters/. Enforces the host-side input threat model and the per-sandbox cleanup contract. Use when the user asks to "add a mount type", "support mounting X", "add a storage adapter", or wants AerolVM sandboxes to consume a new backing storage. Proactively suggest when a feature request implies a new mount backend.
استنادا إلى تصنيف SOC المهني
| name | touch-tcp-pool |
| description | Make changes to the TCP host-port pool or L4 bootstrap safely. Highest-risk area in the repo — PR |
Highest-risk area in the repo. Read pr-review.md §7 in full before editing.
Any change to:
Store.TryReserveHostPort semantics (internal/store/store.go)exposed_ports.host_portService.allocateHostPort allocator loop (internal/service/)Service.EnsureLayer4 / Service.EnsureLayer4Ready (internal/service/service.go)l4Ready atomic.Bool latch or the l4Mu mutexallocatorRandomAttempts constant (internal/service/service.go)pkg/caddy/client.go L4 route installationTryReserveHostPort changes → internal/store/store_test.go.EnsureLayer4 / EnsureLayer4Ready / latch changes → internal/service/layer4_bootstrap_test.go.ReserveHostPortResult back into a bool. The three states (Reserved / Existing / neither) are what prevents pool walks on PK collisions. Look up the type before editing — the middle state matters.allocatorRandomAttempts = 16 random tries) then falls back to a linear scan. Removing the random phase makes p95 spike under load; removing the fallback fails near pool exhaustion.l4Mu when the latch is still false. Failure must leave the latch unset so the next caller retries. Success latches forever.pr-review.md §3 (lazy-bootstrap pattern) — canonical shape mirrored from EnsureLayer4Ready.pr-review.md §7 (this area specifically) — the rules above are summarized from here.internal/service/layer4_bootstrap_test.go — read the existing test names; they describe the invariants you must preserve.