Skip to content

Conversation

@sirtimid
Copy link
Contributor

@sirtimid sirtimid commented Jan 14, 2026

Summary

Refactors the remotes/ folder to improve code organization and separation of concerns:

  • Split into platform/ and kernel/ subfolders:

    • platform/ - Low-level transport infrastructure (connection management, reconnection)
    • kernel/ - Kernel-level modules that interact with KernelStore, KernelQueue, and krefs
  • Renamed files to kebab-case:

    • ConnectionFactory.tsconnection-factory.ts
    • ReconnectionManager.tsreconnection.ts
    • network.tstransport.ts
  • Renamed initNetwork to initTransport for consistency with the file rename

New folder structure

remotes/
├── kernel/
│   ├── OcapURLManager.ts       # OCAP URL issuing and redemption
│   ├── RemoteHandle.ts         # Remote endpoint communication (includes seq/ack)
│   ├── RemoteManager.ts        # Manages remote kernel connections
│   └── remote-comms.ts         # Remote comms initialization
├── platform/
│   ├── connection-factory.ts   # libp2p connection management
│   ├── reconnection.ts         # Reconnection state and backoff
│   └── transport.ts            # Network transport layer
└── types.ts                    # Shared types

Test plan

  • All existing tests pass (1531 tests)
  • Linting passes
  • Updated all import paths across the codebase
  • Updated external packages (nodejs, kernel-browser-runtime)

🤖 Generated with Claude Code


Note

Restructures remote comms and transport layers and updates public API naming.

  • Folder split: Moves kernel-facing modules to remotes/kernel/ and transport infrastructure to remotes/platform/; converts filenames to kebab-case (e.g., connection-factory.ts, reconnection.ts, transport.ts)
  • API rename: Replaces initNetwork with initTransport and updates the export in index.ts
  • Callers updated: Browser runtime (PlatformServicesServer), Node.js runtime (PlatformServices), and kernel now import/use initTransport; mocks and assertions updated accordingly
  • Kernel path updates: Adjusts imports for RemoteManager, RemoteHandle, OcapURLManager, and related test utilities to new kernel/ paths
  • Tests aligned: All affected tests revised to new filenames/modules and API name (initTransport)

Written by Cursor Bugbot for commit 3b19e9b. This will update automatically on new commits. Configure here.

@sirtimid sirtimid force-pushed the sirtimid/refactor-remotes-folder-structure branch from e89d9b5 to 6642221 Compare January 14, 2026 16:08
@sirtimid sirtimid marked this pull request as ready for review January 14, 2026 16:46
@sirtimid sirtimid requested a review from a team as a code owner January 14, 2026 16:46
@sirtimid sirtimid marked this pull request as draft January 20, 2026 11:28
@sirtimid sirtimid force-pushed the sirtimid/refactor-remotes-folder-structure branch from aff3bec to a0f7556 Compare January 20, 2026 23:48
@sirtimid sirtimid marked this pull request as ready for review January 21, 2026 09:53
Refactors the remotes/ folder to improve code organization and separation of concerns:

- Split into platform/ and kernel/ subfolders:
  - platform/ - Low-level transport infrastructure (connection management, reconnection)
  - kernel/ - Kernel-level modules that interact with KernelStore, KernelQueue, and krefs

- Renamed files to kebab-case:
  - ConnectionFactory.ts -> connection-factory.ts
  - ReconnectionManager.ts -> reconnection.ts
  - network.ts -> transport.ts

- Renamed initNetwork to initTransport for consistency

New folder structure:
```
remotes/
├── kernel/
│   ├── OcapURLManager.ts
│   ├── RemoteHandle.ts
│   ├── RemoteManager.ts
│   └── remote-comms.ts
├── platform/
│   ├── connection-factory.ts
│   ├── reconnection.ts
│   └── transport.ts
└── types.ts
```

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sirtimid sirtimid force-pushed the sirtimid/refactor-remotes-folder-structure branch from a0f7556 to 3b19e9b Compare January 22, 2026 13:51
@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 88.37%
🟰 ±0%
5557 / 6288
🔵 Statements 88.24%
🟰 ±0%
5647 / 6399
🔵 Functions 87.5%
🟰 ±0%
1436 / 1641
🔵 Branches 84.43%
🟰 ±0%
2023 / 2396
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/kernel-browser-runtime/src/PlatformServicesServer.ts 95.23%
🟰 ±0%
88.88%
🟰 ±0%
80.95%
🟰 ±0%
95.23%
🟰 ±0%
140, 163, 194, 404
packages/nodejs/src/kernel/PlatformServices.ts 93.97%
🟰 ±0%
90.47%
🟰 ±0%
88.23%
🟰 ±0%
93.97%
🟰 ±0%
143-146, 184, 211-216
packages/ocap-kernel/src/Kernel.ts 94.66%
🟰 ±0%
87.5%
🟰 ±0%
92.3%
🟰 ±0%
94.66%
🟰 ±0%
110, 216-219, 400, 470
packages/ocap-kernel/src/index.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #3275 for commit 3b19e9b by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

@sirtimid sirtimid enabled auto-merge January 22, 2026 14:05
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g2g

@sirtimid sirtimid added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit 1570e95 Jan 22, 2026
29 checks passed
@sirtimid sirtimid deleted the sirtimid/refactor-remotes-folder-structure branch January 22, 2026 18:31
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.

3 participants