Skip to content

Add structured server event recorder - #314

Closed
pcarrier wants to merge 4 commits into
mainfrom
pierre/blit-events-v1
Closed

Add structured server event recorder#314
pcarrier wants to merge 4 commits into
mainfrom
pierre/blit-events-v1

Conversation

@pcarrier

Copy link
Copy Markdown
Contributor

Summary

  • add the versioned blit.events.v1 binary protocol and fixed-size server event ring
  • support runtime activation/capacity config, snapshots, bounded client streams, and server-owned file streams
  • add blit events config, dump, stream, and file commands plus startup env configuration
  • macro-gate broad server, client, request, writer, PTY, process, compositor, and surface instrumentation

The default is a 1 MiB ring with only low-rate lifecycle and error events active. High-throughput request, writer, PTY I/O, process I/O, frame, and protocol families are opt-in through the 128-bit activation mask.

Verification

  • cargo test -p blit-remote -p blit-cli (494 tests)
  • cargo test -p blit-server events (21 tests)
  • cargo clippy -p blit-remote -p blit-server -p blit-cli -- -D warnings
  • isolated real-server exercise of config read/write, PTY recording, dump, server file start/stop, and canonical file decoding
  • Prettier 3.8.3 on changed Markdown

The full blit-server suite was attempted but exceeded the 10-minute sandbox command limit; no matching test processes survived. The scoped server suite and strict compilation/clippy checks pass.

View in Indent View in Slack
Tag @indent to continue the conversation here.

@indent

indent Bot commented Aug 21, 2026

Copy link
Copy Markdown

Issues

Review closed.

CI Checks

3 CI checks failed on a9a1660.

Failing coverage
  • coverage finished with failure.
Failing e2e
  • e2e finished with failure.
Failing test
  • test finished with failure.

@blacksmith-sh

blacksmith-sh Bot commented Aug 21, 2026

Copy link
Copy Markdown

Found 16 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › tests/
mobile-keyboard.spec.ts:200:5 › a tap while the keyboard failed to rise retries instead
of hiding
View Logs
[chromium] › tests/
mobile-keyboard.spec.ts:256:5 › the switcher stays in view when the keyboard pans the v
isual viewport
View Logs
[chromium] › tests/
mobile-keyboard.spec.ts:293:5 › key-line taps cancel the touch so the keyboard stays up
View Logs
[chromium] › tests/
mobile-keyboard.spec.ts:362:5 › the icon's keyboard survives focus landing on a surface
canvas
View Logs
[chromium] › tests/
mobile-keyboard.spec.ts:455:5 › iOS hops focus through a host when the target already h
olds it
View Logs
[chromium] › tests/
mobile-keyboard.spec.ts:61:5 › keyboard rises only from the toggle and the key line tra
cks it
View Logs
[chromium] › tests/
pane-tools.spec.ts:148:7 › Pane multitool on a main-view terminal › a pane quarter prev
iews and relocates the toolbar
View Logs
[chromium] › tests/
pane-tools.spec.ts:311:7 › Parked terminal does not resurrect › closing the session tha
t displaced a parked one shows it, not an empty pane
View Logs
[chromium] › tests/
terminal.spec.ts:137:7 › Terminal › Switcher preview canvases render with non-zero dime
nsions
View Logs
[chromium] › tests/
touch-draggables.spec.ts:178:7 › Touch drag on list rows › holding a dock card drags it
into the main view
View Logs

...and 6 more test failures. View all on Blacksmith

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 75.7% (934/1234) 78.7% (74/94) 79.0% (1521/1926)
browser 0.0% (0/825) 0.0% (0/69) 0.0% (0/1404)
cli 40.3% (6387/15841) 45.4% (635/1400) 41.2% (10005/24310)
compositor 35.1% (6042/17209) 49.8% (502/1009) 34.9% (8308/23786)
desktop 78.7% (4409/5605) 71.9% (388/540) 75.4% (6119/8120)
fonts 85.3% (756/886) 89.9% (71/79) 86.4% (1485/1719)
fssync 92.5% (5512/5961) 94.4% (501/531) 92.7% (10175/10981)
gateway 35.1% (698/1990) 40.6% (69/170) 32.1% (1059/3303)
git 87.7% (4645/5295) 90.5% (379/419) 87.6% (7413/8463)
guest 82.9% (2342/2826) 80.7% (264/327) 81.5% (3905/4792)
lsp 77.2% (2688/3483) 79.4% (262/330) 74.9% (4210/5619)
proxy 19.2% (172/898) 20.5% (26/127) 21.0% (293/1392)
remote 91.9% (18339/19945) 94.4% (1292/1368) 89.6% (29603/33036)
sd-notify 73.9% (68/92) 100.0% (6/6) 83.2% (109/131)
server 58.1% (34953/60209) 65.1% (3007/4617) 59.4% (53023/89254)
ssh 32.2% (165/512) 48.2% (27/56) 31.4% (261/830)
upsidedown 31.4% (391/1247) 27.8% (55/198) 34.8% (797/2287)
webrtc-forwarder 8.5% (238/2805) 10.7% (22/205) 6.3% (289/4595)
webserver 65.1% (1288/1978) 67.6% (177/262) 67.2% (2159/3214)
Total 60.5% (90027/148841) 65.7% (7757/11807) 61.4% (140734/229162)

Comment thread crates/cli/src/events.rs
}

fn selector_ids(selector: &str) -> Option<Vec<u8>> {
if let Ok(id) = selector.parse::<u8>() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Failing Functional · CLI activation parser panics on numeric event ids 128–255

This accepts any u8 (0–255), but the event-id space is only 0–127 (the activation mask is 128 bits / 16 bytes). For ids 128–255, parse_activation then calls activation.set(id, enabled), and Activation::set (crates/remote/src/events.rs:70) indexes self.0[id as usize / 8] on a [u8; 16] — index >= 16 — which panics at runtime. So blit events config set --active 200 (or e.g. --active pty,200) aborts the CLI with a panic instead of the graceful blit: ... error. Bound this branch to id < 128 so out-of-range ids fall through to the existing "unknown event selector" error. Existing tests only use ids <= 127, so this is uncaught.

@pcarrier pcarrier closed this Aug 21, 2026
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