Skip to main content

Crate arks_protocol

Crate arks_protocol 

Source
Expand description

pkt-line framing and capability string helpers (M4 claimed subset).

Contract:

  • pkt-line encode/decode, including flush, delim, and response-end
  • text lines: trailing LF on encode; one optional LF stripped on decode
  • capability advertise/parse from caller-supplied tokens only
  • offline fixture builders for G5; no live transport

Primary:

Cite: .spec/sot/arks-protocol.sot.md, .spec/research/20261108071916-git-protocols.research.md

No gix. No product-path git. No HTTP/SSH.

Enums§

Packet
One pkt-line.
ProtocolError
Failure while encoding or decoding a claimed protocol helper.

Constants§

MAX_DATA_LEN
Maximum data payload in one pkt-line.
MAX_PKT_LEN
Maximum on-wire pkt-line length, including the 4-byte length.

Functions§

advertise_capabilities
Join capability tokens with a single SP, in caller order.
decode_packet
Decode the first pkt-line in input.
decode_packets
Decode a concatenated pkt-line sequence. Trailing bytes must form complete lines.
decode_text_line
Decode a data payload as text, stripping one optional trailing LF.
encode_packet
Encode one pkt-line.
encode_packets
Encode several pkt-lines in order.
encode_text_line
Encode a non-binary line as a data pkt-line with a trailing LF.
encode_v2_capability_advertisement
Encode a v2 capability advertisement.
parse_capabilities
Split a space-separated capability trailer into opaque tokens.
parse_v1_advertisement_payload
Split a v1 advertisement payload at the first NUL.
parse_v2_capability_advertisement
Parse a v2 capability advertisement, stopping after its flush-pkt.
v1_advertisement_payload
Payload (not yet length-prefixed) of a v1 first-ref / capabilities^{} line.