Skip to content

docs: reconcile the units RFC with what #204 actually shipped - #212

Merged
pcarrier merged 2 commits into
design/unitsfrom
eng/units-rfc-reconcile
Aug 6, 2026
Merged

docs: reconcile the units RFC with what #204 actually shipped#212
pcarrier merged 2 commits into
design/unitsfrom
eng/units-rfc-reconcile

Conversation

@pcarrier

@pcarrier pcarrier commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

#204 landed the RFC's primitives (delivery items 1-3, tracked as #181). Two of them landed differently from what the RFC proposed, and the RFC now contradicts the shipped protocol in ways that would mislead whoever implements the unit layer on top.

RFC said Shipped Why
S2C_LEASE [0x10] must move to 0x11 0x10 was free when written; #204 put S2C_CREATE_FAILED there
S2C_CREATE_FAILED [0x11][nonce:2][reason:1] [0x10][nonce:2][status:1][detail:N] common status registry rather than a message-local byte, matching #167's protocol.md
max_ptys gets a real default kept 0 #188 landed the env var meanwhile and argued unlimited is right
FEATURE_UNITS bit 11 bit 17 11-13 reserved for extension/channel/process, 14-16 shipped with #204
C2S_KILL flags arm at len >= 7 >= 8 7 is the existing message length — arming there reads a byte that isn't present

Also worth knowing for the layer above: the refusal is opt-in per request. A client sets CREATE2_WANT_STATUS (bit 3) after seeing FEATURE_CREATE_STATUS (HELLO bit 14), so CREATE, CREATE_AT, CREATE_N and unflagged CREATE2 keep their success-only contract and a legacy client can't read a refusal as PTY zero.

Delivery now marks 1-3 shipped and narrows item 2 to what's actually left: the lease family, and the timed C2S_CLOSE escalation. That second one needs CLOSE to hold the entry in a "closing" state, which tangles with the retention path #204 added — it was deliberately out of scope for #181 and is still open.

No changes to the unit layer itself; how the primitives landed doesn't affect it.

The primitives section proposed wire that has since landed, and in two
places landed differently. Left as written it now contradicts the
protocol.

  - `S2C_LEASE` moves to `0x11`. `0x10` was free when this was written;
    #204 shipped `S2C_CREATE_FAILED` there.

  - `S2C_CREATE_FAILED` is `[0x10][nonce:2][status:1][detail:N]`, not
    `[0x11][nonce:2][reason:1]` — the common status registry rather than
    a message-local reason byte, matching what #167's protocol.md had
    already allocated. It is also opt-in per request via
    `CREATE2_WANT_STATUS`, so a legacy client cannot read a refusal as
    PTY zero.

  - `max_ptys` kept its `0` default rather than gaining a real one.
    #188 landed the env var in the meantime and argued unlimited is
    right, and that argument holds: a client that can open a terminal
    can already spend the machine from inside it.

  - `FEATURE_UNITS` moves to bit 17. 11-13 are reserved for the
    extension, channel, and process families; 14-16 shipped with #204.

  - The `C2S_KILL` flags arm is `data.len() >= 8`, not `>= 7`. Seven is
    the existing message length, so arming there reads a byte that is
    not there.

Delivery marks 1-3 shipped and narrows 2 to what is actually left: the
lease family, and the timed `C2S_CLOSE` escalation, which needs `CLOSE`
to hold a "closing" state and tangles with the retention path.
@indent

indent Bot commented Aug 6, 2026

Copy link
Copy Markdown
PR Summary

Docs-focused change to docs/design/units.md, targeting the design/units PR branch (#94) rather than main. It reconciles the units RFC with what #204 actually shipped for delivery items 1-3 (the primitives the unit layer sits on), correcting five places where the shipped protocol diverged from the RFC's original proposal. A follow-up commit also prettier-reformats five js/ui files (formatting only, no behavior change) to unblock the lint gate.

Issues

1 potential issue found:

View session

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 69.7% (698/1002) 72.0% (54/75) 71.7% (1050/1464)
browser 0.0% (0/807) 0.0% (0/65) 0.0% (0/1370)
cli 17.3% (1521/8803) 28.1% (200/711) 20.2% (2730/13540)
compositor 1.0% (93/9248) 2.0% (8/400) 1.2% (146/12403)
fonts 81.4% (721/886) 88.6% (70/79) 83.0% (1427/1719)
fssync 92.5% (4880/5274) 94.1% (445/473) 92.5% (8926/9647)
gateway 26.1% (375/1437) 29.9% (38/127) 19.9% (470/2360)
git 87.4% (4169/4771) 88.2% (328/372) 87.0% (6600/7582)
lsp 76.0% (2503/3295) 78.2% (248/317) 73.8% (3886/5266)
proxy 19.3% (172/892) 20.5% (26/127) 21.2% (293/1381)
remote 90.0% (8545/9497) 92.7% (614/662) 87.7% (14147/16134)
sd-notify 73.9% (68/92) 100.0% (6/6) 83.2% (109/131)
server 36.2% (6164/17050) 49.5% (592/1195) 38.8% (10516/27087)
ssh 1.9% (7/374) 3.2% (1/31) 0.7% (4/613)
upsidedown 31.4% (391/1247) 27.8% (55/198) 34.8% (797/2287)
webrtc-forwarder 2.7% (72/2624) 2.1% (4/187) 1.2% (50/4335)
webserver 59.8% (1032/1726) 64.6% (155/240) 62.8% (1782/2836)
Total 45.5% (31411/69025) 54.0% (2844/5265) 48.1% (52933/110155)

Formatting only, no behaviour change. These fail `prettier --check`
on this branch and pass on `main`, which has reformatted them since;
lint is red here purely because of that drift, so the RFC change this
branch carries cannot go green on its own.

They will be replaced wholesale when #94 rebases on main — this is to
unblock CI in the meantime, not a claim about the right content.
@pcarrier
pcarrier merged commit 60e4d1e into design/units Aug 6, 2026
11 checks passed
@pcarrier
pcarrier deleted the eng/units-rfc-reconcile branch August 6, 2026 03:15
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.

1 participant