Skip to content

[CTX-0073] chore(test): implement live-socket fixture boundaries (#123) - #128

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-0073/fixture-boundary
Sep 18, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-0073/fixture-boundary

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the accepted live-socket fixture-boundary design (child of #72)
for bitty-devtools: hoists the in-memory fake into a shared helper and
migrates ipc-socket + client tests to the declared boundary.

Task / Issue

  • Priority: P2
  • Area: devtools
  • Labels: chore, P2, area:devtools
  • Milestone: v0.1.0
  • Design: CTX-0069 proposal recorded as PX-0319
  • Task: CTX-0073
  • Review: independent APPROVE recorded as PX-0341
    (reviewer ctx-0073-reviewer-musespark)
  • Hash dispute: RESOLVED by commander note PX-0355 (prompt-side
    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):

File Blob
tests/helpers/fake-live-socket.ts a753c01c
tests/ipc-socket.test.ts c79ec31a
tests/client.test.ts 42039710

src/ and tests/cli.test.ts untouched (CLI loopback migration is a
follow-up per task description; owned by CTX-0071/0072 lane).

Behavior

  • tests/helpers/fake-live-socket.ts (209 lines, no comments): in-memory
    fake at /memory/bitty/fixture.sock (never filesystem) plus
    createScratchLoopback helper (runtime-dir socket, mkdir 0700 /
    chmod 0600, real-uid check, explicit timeoutMs with 1..5000
    ceiling, assertScratchSocketPath absolute + Windows-refused +
    run-owned guards).
  • tests/ipc-socket.test.ts: framing suites unchanged logic; live
    round-trip over scratch loopback (1000 ms, try/finally); symlink
    attest + dial both fail with zero Bun.connect dispatches.
  • tests/client.test.ts: headless IpcTransport stub unchanged
    synthetic path; live loopback over scratch (1000 ms, try/finally);
    failed-connect adds transportOutgoingLen null zero-dispatch assert.
  • Hermetic CI rule preserved: scratch sockets only (host-correct
    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.
  • Full gate per PX-0334: bun test full 363 pass / 2986 expects.
  • tsc -p tsconfig.json --noEmit: exit 0; tsc build exit 0.
  • Prettier 3.9.6 check: clean on all 3 paths.
  • oxlint: exit 0 (only pre-existing inspection.ts unused warning
    outside this diff).
  • git diff --check: clean.
  • git status: only M tests/client.test.ts,
    M tests/ipc-socket.test.ts, A tests/helpers/fake-live-socket.ts.
  • No comments / deps / installs / bunx for this change.
  • gitleaks pre-push: only 2 findings on synthetic redaction fixture
    token=msk-live-... in tests/tracing.test.ts:651 (CTX-0071 content
    already on origin/main, asserted redacted); our 3-path diff clean,
    no new findings.
  • Lefthook pre-commit + commitlint commit-msg hooks pass (no bypass).
  • Commit: c5556fb on ctx-0073/fixture-boundary (base 07ebe8d).

Docs sync

No public behavior, protocol, or user-facing diagnostics change;
test-only fixture boundary. No bitty-docs sync required.

Commit hook

Lefthook pre-commit + commitlint commit-msg hooks pass (no bypass, no
bunx, no installs).

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.
@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 18, 2026
@Xuepoo Xuepoo added area:devtools devtools area chore Maintenance tasks P2 Priority: medium labels Sep 18, 2026
@Xuepoo
Xuepoo merged commit 9b6586d into main Sep 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:devtools devtools area chore Maintenance tasks P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(test): define live-socket fixture boundaries

1 participant