AGENTS.md tells contributors to convert a reserve-and-release port test whenever they touch its project #54

Closed
opened 2026-10-31 12:41:57 -04:00 by claude · 0 comments
Owner
  • Draft: BUG-33
  • Priority: low (sets the rule; the remaining files are converted over time and in #233)
  • Agent: docs-writer
  • Depends on: none
  • Decisions: Q-BUG-8

Why

GetFreeUdpPort/GetFreeTcpPort/GetFreePort bind, read and release a port, and another process can take it before the server binds. B23-13 fixed TFTP by binding port 0 and reading BoundPort. 41 test files (124 call sites) still use the pattern. The owner decided: convert a project when it is touched, plus one final dedicated pass (#233).

What changes

  • AGENTS.md "Test", the free-ports bullet: a change that touches a test project converts that project's reserve-and-release calls (start the server on port 0 and read the bound port; where the server cannot expose it, a bounded retry on AddressInUse with a comment). NinlilDnsWebApplicationFactory env-var ports stay as they are (they must be known before the host starts). Keep it to two sentences (memory feedback_docs_lean.md).
  • src/agents/coder.md (and through it the other coders) gets the same one-line rule if the role does not already point at that AGENTS.md bullet; run python3 src/script/development/sync-agent-definitions.py.

Acceptance

  • python3 src/script/development/sync-agent-definitions.py --check passes; lint passes.
  • The bullet names B23-13's pattern by file (src/dotnet/tests/Ninlil.Dhcp.Server.Tftp.Tests) as the example.

Source

b23-design.md:467 (B23-13 note: "About 69 other test files still use reserve-and-release; not changed (routed to owner)").
Owner decision 2026-10-31 (Q-BUG-8): "convert when touched, plus a final dedicated pass".

- **Draft:** BUG-33 - **Priority:** low (sets the rule; the remaining files are converted over time and in #233) - **Agent:** docs-writer - **Depends on:** none - **Decisions:** Q-BUG-8 ### Why `GetFreeUdpPort`/`GetFreeTcpPort`/`GetFreePort` bind, read and release a port, and another process can take it before the server binds. B23-13 fixed TFTP by binding port 0 and reading `BoundPort`. 41 test files (124 call sites) still use the pattern. The owner decided: convert a project when it is touched, plus one final dedicated pass (#233). ### What changes - AGENTS.md "Test", the free-ports bullet: a change that touches a test project converts that project's reserve-and-release calls (start the server on port 0 and read the bound port; where the server cannot expose it, a bounded retry on `AddressInUse` with a comment). `NinlilDnsWebApplicationFactory` env-var ports stay as they are (they must be known before the host starts). Keep it to two sentences (memory `feedback_docs_lean.md`). - `src/agents/coder.md` (and through it the other coders) gets the same one-line rule if the role does not already point at that AGENTS.md bullet; run `python3 src/script/development/sync-agent-definitions.py`. ### Acceptance - [ ] `python3 src/script/development/sync-agent-definitions.py --check` passes; lint passes. - [ ] The bullet names B23-13's pattern by file (`src/dotnet/tests/Ninlil.Dhcp.Server.Tftp.Tests`) as the example. ### Source `b23-design.md:467` (B23-13 note: "About 69 other test files still use reserve-and-release; not changed (routed to owner)"). Owner decision 2026-10-31 (Q-BUG-8): "convert when touched, plus a final dedicated pass".
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#54
No description provided.