Repository navigation
refactor(herdr-core): split leaf modules out of the herdr and herdr-core clients - #4394
Conversation
…test-session leaves Move-only: no symbol renamed, no signature or statement changed. spawnHcConnect, its userCore guard and SERVER_ENV move from herdr-core/connection.ts to hc-connect.ts; coreSocket, its types and helpers and plainSession move from herdr-core/discovery.ts to core-socket.ts; makeLineReader moves from herdr/client.ts to herdr/line-reader.ts; the test-session helpers liveSessionsRefused and sameSocket move from herdr/client.ts to herdr/test-session.ts. The old files re-export nothing: every importer, tests included (import lines only), points at the new path. No moved function opens a socket, so the unix-connect allow-list in server/conventions.test.ts is unchanged. connection.ts now imports neither herdr/client.ts nor herdr-core/discovery.ts. Slice: 2a
Move-only: userCore leaves hc-connect.ts for core-socket.ts, a leaf, so the socket transport can share the rule that keeps a test process off the user's own core. hc-connect.ts imports it back. Slice: 2a
…f file server/herdr-core/worktrees.ts named only this type from server/herdr/client.ts, so every file that imports worktrees.ts (snapshot.ts, and through it the core model the terminal screen will use) reached the whole client. The interface moves unchanged to server/herdr/worktree-info.ts, which imports nothing; the client, worktrees.ts and the adapter import it from there. Move-only. Slice: 2a
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Merged through reviews: dori review CLEAR at 69795e2; omo gate reviewer (GPT-6 Astra) CLEAR at 69795e2; CodeRabbit reviewed |
Change
Leaf modules split out of the herdr and herdr-core clients, so code that needs one small piece (a socket path, the line reader, the test-session rules, a worktree record) can import it without the whole client. No behaviour changes.
server/herdr-core/hc-connect.ts: startinghc connectand the variables kept out of a started core (spawnHcConnect,SERVER_ENV), out ofconnection.ts.server/herdr-core/core-socket.ts: where the core of an environment listens (coreSocket,plainSession) and the user-core guard (userCore), out ofdiscovery.tsandconnection.ts.server/herdr/line-reader.ts(makeLineReader),server/herdr/test-session.ts(liveSessionsRefused,sameSocket) andserver/herdr/worktree-info.ts(theWorktreeInfotype), out ofserver/herdr/client.ts.Move-only.
git diff --color-moved=zebra --color-moved-ws=allow-indentation-change origin/main...HEAD: 386 of the 497 changed lines are moved code. The other 111 are import lines,exportonuserCore(now imported across files), the header comments and imports of the five new files, three one-line comments inside moved blocks, andmakeLineReader's doc comment, which now also says what happens to an oversized line and which test imports it.The 111 changed lines that git does not mark as moved
Validation
bun run check fastat69795e2f2, on the heavy host (hosthatch), as it runs there: exit 0. Workflow syntax, generated types, generated themes, typecheck and build ok; unit tests 21502 pass, 0 fail, 45 skip in 1097 files.bun run typecheckand the 13 unit files the change touches, one process each: 593 pass, 0 fail.server/herdr/live-guard.test.ts3 pass,server/herdr/seam.test.ts34 pass;server/runtime-move-service.contract.test.tsskips its 7 cases there (they need hc as well as herdr).e20d6967d: typecheck and unit pass at this slice and at every later one.spawnHcConnect, which the live suite uses).bun run check full; the browser lanes cover nothing this moves.Slice: 2a