SHEET 14 OF 49
/
- PART:
- 03 DOCUMENTATION
- CIRCULATION:
- PUBLIC
- SOURCE:
- pages/
Protocol.astro - AS OF:
- 2026-12-03
ONE CONTRACT, TWO SERVICES, AND EVERY FIELD ON THE WIRE
LAYOUT READING
- GIVES:
- RAIL MEASURE MARGIN
- FOR:
- THE CONTRACT
- TRACKS:
- RAIL MEASURE
# READING_16
- a rail (the document's own contents, or the set it belongs to)
- a measure (72-88ch of prose, or `full` for a page that also carries grids)
- a margin (the notes, the facts, the aside) - or nothing, and then the measure takes the rail's side
LAND / FIELD RECORD / TECHNICAL
ONE CONTRACT, EVERY SERVICE
The Vine contract as a lookup register: which method to call, what it carries, and what it answers with.
PROTOCOLVINE
- SERVICES:
- 2 MountainService and CocoonService, one port each
- METHODS:
- 124 4 on the host, 120 on the extension host
- MESSAGES:
- 182 one per concept, in one package
- STREAMING:
- 2 the two `OpenChannel*` methods, one per direction
- TRANSPORT:
- GRPC protobuf over h2, bound to `[::1]`
- LICENCE:
- CC0
LAND:
READ THE CONTRACT
/THE CONTRACT
One file, every service
Vine is not a library an element links against; it is a `.proto` file two processes compile their own side of. The crate owns it, the host keeps a byte-identical copy, and every message this page prints is a declaration in that file rather than a description of one.
/THE CONTRACT
SERVICES:
2
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO
METHODS:
124 RPC
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO
STREAMING:
2 METHODS
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO
MESSAGES:
182
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO
ENUMS:
3
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO
MAX MESSAGE:
4 MB
SOURCE: LAND/ELEMENT/VINE/SOURCE/SERVER/CONSTANTS.RS
PROTOCOL:
1
SOURCE: LAND/ELEMENT/VINE/SOURCE/LIBRARY.RS
The 7 figures this page can count from the contract file and the two constants modules beside it. A figure the file does not state is not printed, which is why there is no request-rate, no latency and no payload average here.
- PACKAGE:
-
Vinethe protobuf package every message in the file is namespaced under - SYNTAX:
-
proto3 - CONTRACT:
-
LAND/ELEMENT/VINE/PROTO/VINE.PROTOthe crate's own copy, and the file both services are generated from - COPY:
-
LAND/ELEMENT/MOUNTAIN/PROTO/VINE.PROTObyte-identical to the contract - a copy, not a second version - BINDS:
-
[::1]loopback only; `DefaultMountainAddress`, `DefaultCocoonAddress` and `DefaultAirAddress` are the three literals - MAX SIZE:
-
4194304`MAX_MESSAGE_SIZE`, 4 MB - applied per service wrapper before `add_service` - TIMEOUT:
-
30`CONNECTION_TIMEOUT`, in seconds - the bind helper's own connect budget
THE TWO PROTO FILES ARE BYTE-IDENTICAL A COUNT ON THIS PAGE IS THE FILE'S OWN NO METHOD IS PRINTED THAT THE CONTRACT DOES NOT DECLARE
/THE TWO SERVICES
Who answers, and on which port
Two services, one per direction, each hosted by the process that owns the capability. `MountainService` is the host's own surface and it is four methods wide; `CocoonService` is the extension host's and it is a hundred and twenty, because everything an extension can ask the editor for is a method on it.
| SERVICE | HOSTED BY | PORT | METHODS | STREAMS |
|---|---|---|---|---|
| MountainService | Mountain | 50051 | 4 | 1 |
| CocoonService | Cocoon | 50052 | 120 | 1 |
| TOTAL | 2 HOSTS | 2 PORTS | 124 | 2 |
- ProcessCocoonRequest:
-
GenericRequest → GenericResponsethe unary path - one round trip, one answer or one `RPCError` - SendCocoonNotification:
-
GenericNotification → Emptyfire-and-forget; the answer carries no payload - CancelOperation:
-
CancelOperationRequest → Emptyasks the host to abort one in-flight request by its identifier - OpenChannelFromCocoon:
-
stream Envelope → stream Envelopethe multiplexed channel; every notification, request and response shares one h2 stream - MIRROR:
-
OpenChannelFromMountainthe same four methods exist on `CocoonService` in the other direction, so either side can open the stream
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO PORTS FROM LAND/ELEMENT/VINE/SOURCE/SERVER/CONSTANTS.RS A METHOD COUNT IS A COUNT OF `rpc` DECLARATIONS
/THE ENVELOPE
What a call is made of
Six messages carry every one of the 124 methods. A request is an identifier, a method name and a JSON byte array; a response is the identifier back, a result or an error; a notification is the same shape without an identifier because nothing answers it. The field numbers are the wire identity and are printed as the file writes them.
message Envelope {
oneof payload {
GenericNotification notification = 1;
GenericRequest request = 2;
GenericResponse response = 3;
CancelOperationRequest cancel = 4;
}
uint64 ChannelId = 5;
} Each side keeps a `HashMap<u64, oneshot::Sender>` of pending requests keyed by `correlation_id`; a Response frame is routed into the matching sender, and a Notification fans out to a `broadcast` channel.
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO THE `Envelope` MESSAGE, VERBATIM
| FIELD | NO. | TYPE | CARRIES |
|---|---|---|---|
| Envelope | |||
| payload | 1-4 | oneof | exactly one of the four arms below |
| ChannelId | 5 | uint64 | the registry id of the stream; `0` when unassigned |
| GenericRequest | |||
| RequestIdentifier | 1 | uint64 | the id a response must carry back |
| Method | 2 | string | the handler name, e.g. `Workspace.FindTextInFiles` |
| Parameter | 3 | bytes | JSON-serialised arguments |
| GenericResponse | |||
| RequestIdentifier | 1 | uint64 | the request's id, verbatim |
| Result | 2 | bytes | JSON-serialised result |
| error | 3 | RPCError | optional - present only when the call failed |
| GenericNotification | |||
| Method | 1 | string | the handler name |
| Parameter | 2 | bytes | JSON-serialised arguments |
| RPCError | - | message | the failure, shaped as a JSON-RPC error object |
| CancelOperationRequest | |||
| RequestIdentifierToCancel | 1 | uint64 | the id of the request to abort |
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO A FIELD NUMBER IS THE WIRE CONTRACT, NOT A SEQUENCE THE `Envelope` WELL IS THE MESSAGE VERBATIM
/THE FAMILIES
A hundred and twenty methods, in the file's own order
The extension host's service is too wide to print method by method, and it is already grouped: `Vine.proto` prints a banner comment before every run. So the family is the file's grouping, the count is the file's own, and the third column names three methods per run so a reader can find the section and read the rest there.
| RUN | METHODS | FIRST DECLARED |
|---|---|---|
| MountainService | ||
| The channel | 4 | ProcessCocoonRequest, SendCocoonNotification, CancelOperation, OpenChannelFromCocoon |
| CocoonService | ||
| The channel | 4 | ProcessMountainRequest, SendMountainNotification, CancelOperation, OpenChannelFromMountain |
| Initialization | 2 | InitialHandshake, InitExtensionHost |
| Commands | 3 | RegisterCommand, ExecuteContributedCommand, UnregisterCommand |
| Language Features | 10 | RegisterHoverProvider, ProvideHover, RegisterCompletionItemProvider |
| Language Features (Extended) | 36 | RegisterDocumentHighlightProvider, ProvideDocumentHighlights, RegisterDocumentSymbolProvider |
| Window Operations | 9 | ShowTextDocument, ShowInformationMessage, ShowWarningMessage |
| Window Operations (Extended) | 7 | ShowQuickPick, ShowInputBox, ShowProgress |
| File System | 5 | ReadFile, WriteFile, Stat |
| File System (Extended) | 4 | DeleteFile, RenameFile, CopyFile |
| Workspace Operations | 7 | FindFiles, FindTextInFiles, OpenDocument |
| Terminal | 7 | OpenTerminal, TerminalInput, CloseTerminal |
| Terminal (Extended) | 1 | ResizeTerminal |
| Output Channels | 5 | CreateOutputChannel, AppendOutput, ClearOutput |
| Tasks | 3 | RegisterTaskProvider, ExecuteTask, TerminateTask |
| Authentication | 2 | GetAuthenticationSession, RegisterAuthenticationProvider |
| Secret Storage | 3 | GetSecret, StoreSecret, DeleteSecret |
| SCM | 3 | RegisterSCMProvider, UpdateSCMGroup, GitExec |
| Tree View | 2 | RegisterTreeViewProvider, GetTreeChildren |
| Debug | 2 | RegisterDebugAdapter, StartDebugging |
| Debug (Extended) | 1 | StopDebugging |
| Extensions | 2 | GetExtension, GetAllExtensions |
| Configuration (Extended) | 1 | GetConfiguration |
| Save Participants | 1 | ParticipateInSave |
| TOTAL | 124 | 22 named runs plus the two channel runs |
# TRACE / /THE CONTRACT 04 STEPS
- 01
Land/Element/Vine/Proto/Vine.protoEVERY SERVICE, MESSAGE AND FIELD ON THIS PAGE - 02
Land/Element/Vine/Source/Server/Constants.rsTHE THREE PORTS, THE 4 MB CAP, THE 30 S CONNECT BUDGET - 03
Land/Element/Vine/Source/Error.rsTHE FOURTEEN VARIANTS A CALLER HAS TO HANDLE - 04
Land/Element/Vine/Source/Library.rsPROTOCOL VERSION, DEFAULT ADDRESSES, MESSAGE-SIZE CONSTANT
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO LAND/ELEMENT/VINE/SOURCE/ERROR.RS A PATH IS A FILE IN THIS CHECKOUT
SOURCE: LAND/ELEMENT/VINE/PROTO/VINE.PROTO FAMILY NAMES ARE THE FILE'S SECTION HEADERS A RUN OF ONE IS STILL A RUN
NEXT: /BLOG 04 BLOG
NOTES FROM THE BUILD, NEWEST FIRST
〈14〉 /