Skip to content

refactor: extract isLoopbackBind to lib/net.mjs (#125)#127

Merged
dtzp555-max merged 1 commit into
mainfrom
fix/125-isloopback-extract
May 31, 2026
Merged

refactor: extract isLoopbackBind to lib/net.mjs (#125)#127
dtzp555-max merged 1 commit into
mainfrom
fix/125-isloopback-extract

Conversation

@dtzp555-max

Copy link
Copy Markdown
Owner

Follow-up cleanup from #115's review. isLoopbackBind was defined in server.mjs and copy-pasted into test-features.mjs ("keep in sync" mirror, because importing server.mjs runs server.listen()). Extracted to a new importable lib/net.mjs; both consumers now import the one definition.

Pure refactor — byte-identical body, TUI LAN-gate call site unchanged, the 8 truth-table tests now exercise the real shared function. 181 tests pass.

Touches server.mjs but adds/removes no operation (relocates an existing #115 helper) → cli.js citation N/A under Rule 2. Independent opus reviewer: APPROVE.

Closes #125.

🤖 Generated with Claude Code

Follow-up cleanup from #115's review. isLoopbackBind was defined in server.mjs and
copy-pasted into test-features.mjs (with a "keep in sync" comment, because importing
server.mjs would run server.listen()). Extracted to a new importable lib/net.mjs;
server.mjs and the test now import the one definition, removing the drift surface.

Pure refactor — the function body is byte-identical to the prior server.mjs version,
the TUI LAN-gate call site is unchanged, and the 8 isLoopbackBind truth-table tests now
exercise the real shared function. 181 tests pass.

ALIGNMENT.md: touches server.mjs but adds/removes no operation — it relocates an existing
(#115) helper into a module. cli.js citation N/A under Rule 2.

Independent fresh-context reviewer (opus): APPROVE (Iron Rule 10) — byte-identical body,
exactly one definition, wiring + scope correct, no test dropped, scope clean.

Closes #125.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dtzp555-max dtzp555-max merged commit 1b02f18 into main May 31, 2026
5 checks passed
@dtzp555-max dtzp555-max deleted the fix/125-isloopback-extract branch May 31, 2026 21:03
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.

[refactor] Extract isLoopbackBind to lib/, import in server.mjs + test (follow-up #115)

2 participants