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

Refactors remote comms layout and API naming for clearer separation of concerns.

  • Folder split: Moves kernel-facing modules under remotes/kernel/ and transport under remotes/platform/; updates paths for RemoteManager, RemoteHandle, OcapURLManager, and remote-comms
  • File renames (kebab-case): ConnectionFactory.tsconnection-factory.ts, ReconnectionManager.tsreconnection.ts, network.tstransport.ts
  • API rename: Replaces initNetwork with initTransport and updates all usages in kernel-browser-runtime, nodejs, and kernel code; adjusts mocks accordingly
  • Exports: Updates @metamask/ocap-kernel index to export initTransport and moved types/paths
  • Tests: Updates/imports across affected tests to new locations and names (browser runtime, nodejs, kernel, platform transport/connection tests)

Written by Cursor Bugbot for commit a0f7556. 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
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 aff3bec to a0f7556 Compare January 20, 2026 23:48
@sirtimid sirtimid marked this pull request as ready for review January 21, 2026 09:53
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.

2 participants