[CTX-0073] chore(test): implement live-socket fixture boundaries (#123) - #128
Merged
Merged
Conversation
Implements accepted CTX-0069 design (PX-0319). Shared tests/helpers/fake-live-socket.ts with in-memory fake plus createScratchLoopback helper. Migrates ipc-socket and client tests to the boundary. src and cli.test untouched. Independent APPROVE PX-0341. Hash dispute resolved PX-0355. Gates green: bun scoped 82/380, tsc, prettier, oxlint. Task CTX-0073 stays review.
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.
Summary
Implements the accepted live-socket fixture-boundary design (child of #72)
for
bitty-devtools: hoists the in-memory fake into a shared helper andmigrates
ipc-socket+clienttests to the declared boundary.Task / Issue
(reviewer ctx-0073-reviewer-musespark)
mislabel; working-tree blobs below ARE the reviewed content; delivery
of the current tree authorized, no re-review)
Closes #123
Scope
Exactly 3 paths (committed blobs verified at HEAD):
src/andtests/cli.test.tsuntouched (CLI loopback migration is afollow-up per task description; owned by CTX-0071/0072 lane).
Behavior
tests/helpers/fake-live-socket.ts(209 lines, no comments): in-memoryfake at
/memory/bitty/fixture.sock(never filesystem) pluscreateScratchLoopbackhelper (runtime-dir socket,mkdir0700 /chmod0600, real-uid check, explicittimeoutMswith 1..5000ceiling,
assertScratchSocketPathabsolute + Windows-refused +run-owned guards).
tests/ipc-socket.test.ts: framing suites unchanged logic; liveround-trip over scratch loopback (1000 ms, try/finally); symlink
attest + dial both fail with zero
Bun.connectdispatches.tests/client.test.ts: headlessIpcTransportstub unchangedsynthetic path; live loopback over scratch (1000 ms, try/finally);
failed-connect adds
transportOutgoingLennull zero-dispatch assert.absolute; relative/Windows-on-POSIX refused), per-step timeouts
(fake 100 ms, dial/response 5000 ceiling), run-owned cleanup in
finally, no production sockets in the unit gate,preflight-attest-dial ordering with zero dispatch on failure.
Evidence (hermetic)
bun test tests/ipc-socket.test.ts tests/client.test.ts: 82 pass /0 fail, 380 expects.
bun testfull 363 pass / 2986 expects.tsc -p tsconfig.json --noEmit: exit 0;tscbuild exit 0.inspection.tsunused warningoutside this diff).
git diff --check: clean.git status: onlyM tests/client.test.ts,M tests/ipc-socket.test.ts,A tests/helpers/fake-live-socket.ts.token=msk-live-...intests/tracing.test.ts:651(CTX-0071 contentalready on
origin/main, asserted redacted); our 3-path diff clean,no new findings.
c5556fbonctx-0073/fixture-boundary(base07ebe8d).Docs sync
No public behavior, protocol, or user-facing diagnostics change;
test-only fixture boundary. No
bitty-docssync required.Commit hook
Lefthook pre-commit + commitlint commit-msg hooks pass (no bypass, no
bunx, no installs).