<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cloud9.git/src/verbs.zig, branch main</title>
<subtitle>9p for zig</subtitle>
<id>https://git.0x4200.cafe/cloud9.git/atom?h=main</id>
<link rel='self' href='https://git.0x4200.cafe/cloud9.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/cloud9.git/'/>
<updated>2026-11-17T13:06:26Z</updated>
<entry>
<title>Fsys: a deadline on every call, so a silent server is a timeout</title>
<updated>2026-11-17T13:06:26Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-17T03:59:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/cloud9.git/commit/?id=7f418a6bb3c2d5319d781a61a14aeaf15aff4c89'/>
<id>urn:sha1:7f418a6bb3c2d5319d781a61a14aeaf15aff4c89</id>
<content type='text'>
A server that accepted and then said nothing held the caller for ever:
Fsys read its socket with no limit, the version in init included, while
pardes's own client gives a call 2 s and a write that runs a command
30 s. Fsys gains one field, `timeout` (an Io.Timeout), which init sets
to `default_timeout`, 30 s, before it speaks; each call's answer is read
by operateTimeout until that long after the call is sent, and past it the
call is error.Timeout (the answer may come yet, under a tag the next call
does not expect, so the connection is to be closed). `.none` waits for
ever: verbs' follow sets it, since following an event file waits as long
as the events take; read, ls, ask and the rest keep the deadline and say
"no answer in 30000 ms; fs follow waits for ever".

Test: a held read nobody feeds, on a 100 ms timeout, is error.Timeout
after 90-5000 ms (poll counts whole milliseconds). cloud9's test 108 of
108; serve's "two clients at once" and "repeated connect/disconnect"
failed once each at load 13 and passed in the four runs after, as on the
base: they do not touch Fsys.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
</content>
</entry>
<entry>
<title>verbs: the fs verbs as a function a program calls with a dialled tree</title>
<updated>2026-11-17T13:06:26Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-11-17T03:48:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/cloud9.git/commit/?id=b44d970c121a65e1f9de04fee600a3b495fb6c96'/>
<id>urn:sha1:b44d970c121a65e1f9de04fee600a3b495fb6c96</id>
<content type='text'>
The user wants each app's binary to drive the tree it serves ("the cli
should be like a living documentation, similar to 9p"): `pardes fs read
pane/3/body`, `drat-meout fs read state/scene`. verbs.run(&amp;fsys, args,
stdin, stdout, stderr) is that command line, added in five lines (the
top of the file shows them): ls, read, write (the words and a newline, or
stdin a write a read of it, as 9p write), ask (write then read one open),
follow (ask, or read: each answer flushed as it comes), stat (Plan 9's
mode letters, length, uid, gid, mtime, name), help and complete. Exit
status 0, or 1 with the server's own words on stderr; a verb not known is
the usage.

help PATH reads the tree's /README: a line is about the file its first
word names, a path from the root with a leading or trailing slash or a
comma dropped and &lt;anything&gt; standing for one name, and about everything
under it; lines after it indented deeper go with it. pardes's
src/fs-help.txt, 9proc's and 9agents' READMEs are in that shape already;
sketchbook's control tree serves none yet and would write one so. complete
PREFIX lists the directory PREFIX ends in, the names it starts, as paths,
a trailing slash on a directory.

Tests drive run() against TestTree in process: listings, reads, stats,
completion, refusals in the server's words, stdin writes, ask, help
including the line matcher on pardes's and 9proc's shapes, follow of three
held chunks and a hangup mid-read, and the usage. Also run by hand from a
scratch program of those five lines against a 9proc-demo on a Unix socket.
</content>
</entry>
</feed>
