on master help sign in
gall-guide: apply various suggestions from poprox code review
c7f7e3atinnus-napbus
content/docs/userspace/gall-guide/1-arvo.md+12−12
@@ -66,7 +66,7 @@ Here's a brief summary of each of the vanes:
66
66
67- **Iris**: Web client vane. If you want your agent to query external web APIs and
67- **Iris**: Web client vane. If you want your agent to query external web APIs and
68 the like, it's done via Iris. Oftentimes web API interactions are
68 the like, it's done via Iris. Oftentimes web API interactions are
69− spun out into [Threads](/docs/userspace/threads/overview) to avoid
69+ spun out into [threads](/docs/userspace/threads/overview) to avoid
70 complicating the Gall agent itself, so a Gall agent would not necessary deal
70 complicating the Gall agent itself, so a Gall agent would not necessary deal
71 with Iris directly, even if it made use of external APIs.
71 with Iris directly, even if it made use of external APIs.
72- **Jael**: Key infrastructure vane. Jael keeps track of PKI data for your ship and
72- **Jael**: Key infrastructure vane. Jael keeps track of PKI data for your ship and
@@ -183,7 +183,7 @@ desk
183
183
184- `app`: Gall agents.
184- `app`: Gall agents.
185- `gen`: Generators.
185- `gen`: Generators.
186−- `lib`: Libraries - these would typically be imported with the `/+` Ford rune.
186+- `lib`: Libraries - these are imported with the `/+` Ford rune.
187- `mar`: `mark` files, which are filetype definitions.
187- `mar`: `mark` files, which are filetype definitions.
188- `sur`: Structures - these typically contain type definitions and structures,
188- `sur`: Structures - these typically contain type definitions and structures,
189 and would be imported with the `/-` Ford rune.
189 and would be imported with the `/-` Ford rune.
@@ -217,7 +217,7 @@ sys
217```
217```
218
218
219- `arvo.hoon`: Source code for Arvo itself.
219- `arvo.hoon`: Source code for Arvo itself.
220−- `hoon.hoon`: Hoon standard library.
220+- `hoon.hoon`: Hoon standard library and compiler.
221- `lull.hoon`: Mostly structures and type definitions for interacting with
221- `lull.hoon`: Mostly structures and type definitions for interacting with
222 vanes.
222 vanes.
223- `vane`: This directory contains the source code for each of the vanes.
223- `vane`: This directory contains the source code for each of the vanes.
@@ -246,18 +246,18 @@ all have these libraries available to them in their subject.
246You should now have a general idea of the different parts of Arvo, but how does
246You should now have a general idea of the different parts of Arvo, but how does
247a Gall agent interact with these things?
247a Gall agent interact with these things?
248
248
249−There are two basic ways of interacting with other parts of the system: By
249+There are two basic ways of interacting with other parts of the system: by
250scrying them, and by passing them messages and receiving messages in response.
250scrying them, and by passing them messages and receiving messages in response.
251−There are also two basic things to interact with: Vanes, and other agents.
251+There are also two basic things to interact with: vanes, and other agents.
252
252
253- Scries: The scry system allows you to access the state of other agents and
253- Scries: The scry system allows you to access the state of other agents and
254 vanes in a read-only fashion. Scries can be performed from any context with
254 vanes in a read-only fashion. Scries can be performed from any context with
255 the dotket (`.^`) rune. Each vane has "scry endpoints" which define what you
255 the dotket (`.^`) rune. Each vane has "scry endpoints" which define what you
256 can read, and these are comprehensively documented in the Scry Reference of
256 can read, and these are comprehensively documented in the Scry Reference of
257 each vane's section of the [Arvo documentation](/docs/arvo/overview). Agents
257 each vane's section of the [Arvo documentation](/docs/arvo/overview). Agents
258− can also define scry endpoints in the `+on-peek` arm of their agent core.
258+ define scry endpoints in the `+on-peek` arm of their agent core.
259− Scries can only be done on the local ship, it is not yet possible to perform
259+ Scries can only be done on the local ship; it is not yet possible to perform
260− scries over the network. There is a separate [guide to
260+ scries over the network (but this functionality is planned for the future). There is a separate [guide to
261 scries](/docs/arvo/concepts/scry) which you might like to read through for
261 scries](/docs/arvo/concepts/scry) which you might like to read through for
262 more details.
262 more details.
263- Messages:
263- Messages:
@@ -265,10 +265,10 @@ There are also two basic things to interact with: Vanes, and other agents.
265 respond with in its respective section of `lull.hoon`. These might do all
265 respond with in its respective section of `lull.hoon`. These might do all
266 manner of things, depending on the vane. For example, Iris might fetch an
266 manner of things, depending on the vane. For example, Iris might fetch an
267 external HTTP resource for you, Clay might read or build a specified file,
267 external HTTP resource for you, Clay might read or build a specified file,
268− etc. The tasks and gifts of each vane are comprehensively documented in the
268+ etc. The `task`s and `gift`s of each vane are comprehensively documented in the
269 API Reference of each vane's section of the [Arvo
269 API Reference of each vane's section of the [Arvo
270 documentation](/docs/arvo/overview).
270 documentation](/docs/arvo/overview).
271− - Agents: These can be `%poke`d with some data, and can also be `%watch`ed,
271+ - Agents: These can be `%poke`d with some data, which is a request to perform a single action. They can also be `%watch`ed,
272 which means to subscribe for updates. We'll discuss these in detail later in
272 which means to subscribe for updates. We'll discuss these in detail later in
273 the guide.
273 the guide.
274
274
@@ -283,8 +283,8 @@ meaning for now, we'll discuss them in detail later in the guide.
283Inter-agent messaging can occur over the network, so you can interact with
283Inter-agent messaging can occur over the network, so you can interact with
284agents on other ships as well as local ones. You can only talk to local vanes,
284agents on other ships as well as local ones. You can only talk to local vanes,
285but some vanes like Clay are able to make requests to other ships on your
285but some vanes like Clay are able to make requests to other ships on your
286−behalf. Note this summary is simplified - vanes don't just talk in tasks and
286+behalf. Note this summary is simplified - vanes don't just talk in `task`s and
287−gifts in all cases. For example, requests from HTTP clients through Eyre (the
287+`gift`s in all cases. For example, requests from HTTP clients through Eyre (the
288webserver vane) behave more like those from agents than vanes, and a couple of
288webserver vane) behave more like those from agents than vanes, and a couple of
289other vanes also have some different behaviours. Agent interactions are also a
289other vanes also have some different behaviours. Agent interactions are also a
290little more complicated, and we'll discuss that later, but the basic patterns
290little more complicated, and we'll discuss that later, but the basic patterns
content/docs/userspace/gall-guide/10-scry.md+6−6
@@ -79,7 +79,7 @@ specified agent is installed and running:
79A scry to Gall with a `%x` `care` will be passed to the agent for handling. Gall
79A scry to Gall with a `%x` `care` will be passed to the agent for handling. Gall
80handles `%x` specially, and expects an extra field at the end of the `path` that
80handles `%x` specially, and expects an extra field at the end of the `path` that
81specifies the `mark` to return. Gall will take the data produced by the
81specifies the `mark` to return. Gall will take the data produced by the
82−specified endpoint and try convert it to the given mark, crashing if the mark
82+specified endpoint and try to convert it to the given mark, crashing if the mark
83conversion fails. The extra field specifying the mark is not passed through to
83conversion fails. The extra field specifying the mark is not passed through to
84the agent itself. Here's a couple of examples:
84the agent itself. Here's a couple of examples:
85
85
@@ -112,7 +112,7 @@ all, and interprets `[~ ~]` to mean the endpoint exists but the requested data
112does not. In either case the dotket expression which initiated the scry will
112does not. In either case the dotket expression which initiated the scry will
113crash. The `cage` will contain the actual data to return.
113crash. The `cage` will contain the actual data to return.
114
114
115−The `on-peek` arm, therefore, begins like so:
115+An ordinary `on-peek` arm, therefore, begins like so:
116
116
117```hoon
117```hoon
118++ on-peek
118++ on-peek
@@ -123,7 +123,7 @@ The `on-peek` arm, therefore, begins like so:
123
123
124Typically, you'd handle the `path` similarly to `on-watch`, as we discussed in
124Typically, you'd handle the `path` similarly to `on-watch`, as we discussed in
125the lesson on subscriptions. You'd use something like a wutlus expression to
125the lesson on subscriptions. You'd use something like a wutlus expression to
126−test the type of the `path`, defining your scry endpoints like so:
126+test the value of the `path`, defining your scry endpoints like so:
127
127
128```hoon
128```hoon
129?+ path (on-peek:def path)
129?+ path (on-peek:def path)
@@ -334,10 +334,10 @@ crash!
334- Scries can only be performed on the local ship, not on remote ships.
334- Scries can only be performed on the local ship, not on remote ships.
335- Gall scries with an agent name in the `desk` field will be passed to that
335- Gall scries with an agent name in the `desk` field will be passed to that
336 agent's `on-peek` arm for handling.
336 agent's `on-peek` arm for handling.
337−- Gall scries with a `%x` `care` take a `mark` at the end of the scry path,
337+- Gall scries with a `%x` `care` take a `mark` at the end of the scry `path`,
338− telling gall to convert the data returned by the scry endpoint to the mark
338+ telling Gall to convert the data returned by the scry endpoint to the mark
339 specified.
339 specified.
340−- The `on-peek` arm takes a `path` with the `care` in the head and the path part
340+- The `on-peek` arm takes a `path` with the `care` in the head and the `path` part
341 of the scry in the tail, like `/x/some/path`.
341 of the scry in the tail, like `/x/some/path`.
342- The `on-peek` arm produces a `(unit (unit cage))`. The outer `unit` is null if
342- The `on-peek` arm produces a `(unit (unit cage))`. The outer `unit` is null if
343 the scry endpoint does not exist, and the inner `unit` is null if the data
343 the scry endpoint does not exist, and the inner `unit` is null if the data
content/docs/userspace/gall-guide/11-fail.md+9−7
@@ -49,12 +49,12 @@ include a message of "subscribe wire not unique", as well as the agent name, the
49`wire`, the target ship and the target agent.
49`wire`, the target ship and the target agent.
50
50
51How you might handle these cases (if you wanted to manually handle them) depends
51How you might handle these cases (if you wanted to manually handle them) depends
52−on the logic of your particular agent.
52+on the purpose of your particular agent.
53
53
54## Helper core
54## Helper core
55
55
56Back in the lesson on lustar virtual arms, we briefly mentioned a common pattern
56Back in the lesson on lustar virtual arms, we briefly mentioned a common pattern
57−is to define an alias of `hc` for a "helper core" like:
57+is to define a deferred expression for a helper core named `hc` like:
58
58
59```hoon
59```hoon
60+* this .
60+* this .
@@ -62,6 +62,8 @@ is to define an alias of `hc` for a "helper core" like:
62 hc ~(. +> bowl)
62 hc ~(. +> bowl)
63```
63```
64
64
65+The name `do` is also used frequently besides `hc`.
66+
65A helper core is a separate core composed into the subject of the agent core,
67A helper core is a separate core composed into the subject of the agent core,
66containing useful functions for use by the agent arms. Such a helper core would
68containing useful functions for use by the agent arms. Such a helper core would
67typically contain functions that would only ever be used internally by the
69typically contain functions that would only ever be used internally by the
@@ -90,14 +92,14 @@ rune directly above the agent core like:
90=<
92=<
91|_ =bowl:gall
93|_ =bowl:gall
92+* this .
94+* this .
93− def ~(. (default-agent this %|) bowl)
95+ def ~(. (default-agent this %.n) bowl)
94 hc ~(. +> bowl)
96 hc ~(. +> bowl)
95++ on-init
97++ on-init
96.....
98.....
97```
99```
98
100
99We can then add the helper core below the agent core. The helper core is most
101We can then add the helper core below the agent core. The helper core is most
100−typically a `door` like the agent core, also with the `bowl` as its sample. This
102+typically a door like the agent core, also with the `bowl` as its sample. This
101is just so any functions you define in it have ready access to the `bowl`. It
103is just so any functions you define in it have ready access to the `bowl`. It
102would look like:
104would look like:
103
105
@@ -109,7 +111,7 @@ would look like:
109--
111--
110```
112```
111
113
112−Back in the lustar virtual arm of the agent core, we give it an alias of `hc`
114+Back in the lustar virtual arm of the agent core, we give it a deferred expression name of `hc`
113and call it like so:
115and call it like so:
114
116
115```hoon
117```hoon
@@ -134,6 +136,6 @@ like `(some-function:hc ....)`.
134 of the agent core.
136 of the agent core.
135- Helper cores are typically placed below the agent core, and composed with a
137- Helper cores are typically placed below the agent core, and composed with a
136 tisgal (`=<`) rune.
138 tisgal (`=<`) rune.
137−- The helper core is typically a `door` with the `bowl` as a sample.
139+- The helper core is typically a door with the `bowl` as a sample.
138−- The helper core is typically given an alias of `hc` in the lustar virtual arm
140+- The helper core is typically given a name of `hc` or `do` in the lustar virtual arm
139 of the agent core.
141 of the agent core.
content/docs/userspace/gall-guide/2-agent.md+9−9
@@ -6,9 +6,9 @@ template = "doc.html"
6
6
7In this lesson we'll look at the basic type and structure of a Gall agent.
7In this lesson we'll look at the basic type and structure of a Gall agent.
8
8
9−A Gall agent is a `door` with exactly ten arms. Each arm is responsible for
9+A Gall agent is a [door](/docs/glossary/door) with exactly ten [arms](/docs/glossary/arm). Each arm is responsible for
10−handling certain kinds of events that Gall feeds in to the agent. A `door` is
10+handling certain kinds of events that Gall feeds in to the agent. A door is
11−just a `core` with a sample - it's made with the
11+just a [core](/docs/glossary/core) with a sample - it's made with the
12[barcab](/docs/hoon/reference/rune/bar#_-barcab) rune (`|_`) instead of the
12[barcab](/docs/hoon/reference/rune/bar#_-barcab) rune (`|_`) instead of the
13usual [barcen](/docs/hoon/reference/rune/bar#-barcen) rune (`|%`).
13usual [barcen](/docs/hoon/reference/rune/bar#-barcen) rune (`|%`).
14
14
@@ -58,7 +58,7 @@ These two arms handle responses to requests our agent previously initiated.
58
58
59## Bowl
59## Bowl
60
60
61−The sample of the `door` is a `bowl:gall`. Every time an event triggers the
61+The sample of a Gall agent door is always a `bowl:gall`. Every time an event triggers the
62agent, Gall populates the bowl with things like the current date-time, entropy,
62agent, Gall populates the bowl with things like the current date-time, entropy,
63subscription information, which ship the request came from, etc, so that all the
63subscription information, which ship the request came from, etc, so that all the
64arms of the agent have access to that data. For the exact structure and contents
64arms of the agent have access to that data. For the exact structure and contents
@@ -69,9 +69,9 @@ documentation](/docs/arvo/gall/data-types#bowl).
69
69
70If you've worked through [Hoon School](/docs/hoon/hoon-school/intro), you may
70If you've worked through [Hoon School](/docs/hoon/hoon-school/intro), you may
71recall that a core is a cell of `[battery payload]`. The battery is the core
71recall that a core is a cell of `[battery payload]`. The battery is the core
72−itself compiled to nock, and the payload is the subject which it operates on.
72+itself compiled to Nock, and the payload is the subject which it operates on.
73
73
74−For an agent, the payload will at least contain the bowl, the usual standard
74+For an agent, the payload will at least contain the bowl, the usual Hoon and `zuse` standard
75library functions, and the **state** of the agent. For example, if your agent
75library functions, and the **state** of the agent. For example, if your agent
76were for an address book app, it might keep a `map` of ships to address book
76were for an address book app, it might keep a `map` of ships to address book
77entries. It might add entries, delete entries, and modify entries. This address
77entries. It might add entries, delete entries, and modify entries. This address
@@ -135,7 +135,7 @@ This is just a dummy agent that does absolutely nothing - it has no state and
135rejects all messages by crashing. We'll get to what each of the arms do later.
135rejects all messages by crashing. We'll get to what each of the arms do later.
136For now, we'll just consider a few particular points.
136For now, we'll just consider a few particular points.
137
137
138−Firstly, note its structure - it's a `door` (created with `|_`) with a sample of
138+Firstly, note its structure - it's a door (created with `|_`) with a sample of
139`bowl:gall` and the ten arms described earlier.
139`bowl:gall` and the ten arms described earlier.
140
140
141Secondly, you'll notice some of the arms return:
141Secondly, you'll notice some of the arms return:
@@ -195,7 +195,7 @@ Now, let's have a look:
195The dojo pretty-prints cores with a format of `number-of-arms.hash`. You can see
195The dojo pretty-prints cores with a format of `number-of-arms.hash`. You can see
196the head of `skeleton` is `10.fxw` - that's the battery of the core, our 10-arm
196the head of `skeleton` is `10.fxw` - that's the battery of the core, our 10-arm
197agent. If we try printing the head of `skeleton` we'll see it's a whole lot of
197agent. If we try printing the head of `skeleton` we'll see it's a whole lot of
198−compiled `nock`:
198+compiled Nock:
199
199
200```
200```
201> -.skeleton
201> -.skeleton
@@ -279,7 +279,7 @@ If we again examine our agent core's payload by looking at the tail of
279
279
280## Summary
280## Summary
281
281
282−- A Gall agent is a `door` with ten arms and a sample of `bowl:gall`.
282+- A Gall agent is a door with exactly ten specific arms and a sample of `bowl:gall`.
283- Each of the ten arms handle different kinds of events - Gall calls the
283- Each of the ten arms handle different kinds of events - Gall calls the
284 appropriate arm for the kind event it receives.
284 appropriate arm for the kind event it receives.
285- The ten arms fit roughly into five categories:
285- The ten arms fit roughly into five categories:
content/docs/userspace/gall-guide/3-imports-and-aliases.md+22−22
@@ -40,11 +40,11 @@ imported at the beginning of an agent with the
40[faslus](/docs/arvo/ford/ford#ford-runes) (`/+`) rune.
40[faslus](/docs/arvo/ford/ford#ford-runes) (`/+`) rune.
41
41
42The library is a wet gate which takes two arguments: `agent` and `help`. The
42The library is a wet gate which takes two arguments: `agent` and `help`. The
43−first is your agent core itself, and the second is a `?`. If `help` is `%.y`, it
43+first is your agent core itself, and the second is a `?`. If `help` is `%.y` (equivalently, `%&`), it
44−will crash in all cases. If `help` is `%.n`, it will use its defaults. You would
44+will crash in all cases. If `help` is `%.n` (equivalently, `%|`), it will use its defaults. You would
45almost always have `help` as `%.n`.
45almost always have `help` as `%.n`.
46
46
47−The wet gate returns a `agent:gall` `door` with a sample of `bowl:gall` - a
47+The wet gate returns a `agent:gall` door with a sample of `bowl:gall` - a
48typical agent core. Usually you would define an alias for it in a virtual arm
48typical agent core. Usually you would define an alias for it in a virtual arm
49([explained below](#virtual-arms)) so it's simple to call.
49([explained below](#virtual-arms)) so it's simple to call.
50
50
@@ -52,7 +52,7 @@ typical agent core. Usually you would define an alias for it in a virtual arm
52
52
53The `dbug` library lets you inspect the state and `bowl` of your agent from the
53The `dbug` library lets you inspect the state and `bowl` of your agent from the
54dojo. It includes an `agent:dbug` function which wraps your whole `agent:gall`
54dojo. It includes an `agent:dbug` function which wraps your whole `agent:gall`
55−`door`, adding its extra debugging functionality while transparently passing
55+door, adding its extra debugging functionality while transparently passing
56events to your agent for handling like usual.
56events to your agent for handling like usual.
57
57
58To use it, you just import `dbug` with a
58To use it, you just import `dbug` with a
@@ -92,21 +92,21 @@ if you include a scry endpoint with a path of `/x/dbug/state`, it will use that
92instead.
92instead.
93
93
94We haven't yet covered some of the concepts described here, so don't worry if
94We haven't yet covered some of the concepts described here, so don't worry if
95−you don't fully understand `%dbug`'s functionality - you can refer back here
95+you don't fully understand `dbug`'s functionality - you can refer back here
96later.
96later.
97
97
98## Virtual arms
98## Virtual arms
99
99
100An agent core must have exactly ten arms. However, there's a special kind of
100An agent core must have exactly ten arms. However, there's a special kind of
101"virtual arm" that can be added without actually increasing the core's arm
101"virtual arm" that can be added without actually increasing the core's arm
102−count. A virtual arm is created with the
102+count, since it really just adds code to the other arms in the core. A virtual arm is created with the
103[lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune, and its purpose is
103[lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune, and its purpose is
104−to define _aliases_. It takes a list of pairs of names (aliases) and hoon
104+to define _deferred expressions_. It takes a list of pairs of names and Hoon
105−expressions. When compiled, the aliases defined in the virtual arm are
105+expressions. When compiled, the deferred expressions defined in the virtual arm are
106implicitly inserted at the beginning of every other arm of the core, so they all
106implicitly inserted at the beginning of every other arm of the core, so they all
107−have access to them.
107+have access to them. Each time a name in a `+*` is called, the associated Hoon is evaluated in its place, similar to lazy evaluation except it is re-evaluated whenever needed. See the [tistar](/docs/hoon/reference/rune/tis#-tistar) reference for more information on deferred expressions.
108
108
109−A virtual arm in an agent might look something like this:
109+A virtual arm in an agent often looks something like this:
110
110
111```hoon
111```hoon
112+* this .
112+* this .
@@ -114,8 +114,8 @@ A virtual arm in an agent might look something like this:
114 hc ~(. +> bowl)
114 hc ~(. +> bowl)
115```
115```
116
116
117−`this`, `def` and `hc` are the aliases, and next to each one is the hoon
117+`this`, `def` and `hc` are the deferred expressions, and next to each one is the Hoon
118−expresion it's aliasing. Notice that unlike most things that take _n_ arguments,
118+expression it evaluates whenever called. Notice that unlike most things that take _n_ arguments,
119a virtual arm is not terminated with a `==`. You can define as many aliases as
119a virtual arm is not terminated with a `==`. You can define as many aliases as
120you like. The three in this example are conventional ones you'd use in most
120you like. The three in this example are conventional ones you'd use in most
121agents you write. Their purposes are:
121agents you write. Their purposes are:
@@ -203,8 +203,8 @@ the build system will do that for us. In this case we've just added a single
203After that core, we call `agent:dbug` with our whole agent core as its argument.
203After that core, we call `agent:dbug` with our whole agent core as its argument.
204This allows us to use the `dbug` features described earlier.
204This allows us to use the `dbug` features described earlier.
205
205
206−Inside our agent `door`, we've added an extra virtual arm and defined a couple
206+Inside our agent door, we've added an extra virtual arm and defined a couple
207−of aliases:
207+deferred expressions:
208
208
209```hoon
209```hoon
210+* this .
210+* this .
@@ -212,9 +212,9 @@ of aliases:
212```
212```
213
213
214In most of the arms, you see we've been able to replace the dummy code with
214In most of the arms, you see we've been able to replace the dummy code with
215−simple calls to the corresponding arms of `default-agent`, which we set up and
215+simple calls to the corresponding arms of `default-agent`, which we set up as a deferred
216−aliased as `def` in the virtual arm. We've also replaced the old `..on-init`
216+expression named `def` in the virtual arm. We've also replaced the old `..on-init`
217−with our alias `this` in the `on-init` arm as an example - it makes things a bit
217+with our deferred expression named `this` in the `on-init` arm as an example - it makes things a bit
218simpler.
218simpler.
219
219
220You can save the code above in `/app/skeleton.hoon` of your `%base` desk like
220You can save the code above in `/app/skeleton.hoon` of your `%base` desk like
@@ -262,15 +262,15 @@ idea of its basic usage.
262
262
263The key takeaways are:
263The key takeaways are:
264
264
265−- Libraries can be imported with `/+`.
265+- Libraries are imported with `/+`.
266−- `default-agent` is a library that provides default behaviours for Gall agent
266+- `default-agent` is a library that provides default behaviors for Gall agent
267 arms.
267 arms.
268- `dbug` is a library that lets you inspect the state and `bowl` of an agent
268- `dbug` is a library that lets you inspect the state and `bowl` of an agent
269 from the dojo, with the `+dbug` generator.
269 from the dojo, with the `+dbug` generator.
270−- Convenient aliases for hoon expressions can be defined in a virtual arm with
270+- Convenient deferred expressions for Hoon expressions can be defined in a virtual arm with
271 the [lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune.
271 the [lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune.
272−- `this` is a conventional alias for the agent core itself.
272+- `this` is a conventional deferred expression name for the agent core itself.
273−- `def` is a conventional alias for accessing arms in the `default-agent`
273+- `def` is a conventional deferred expression name for accessing arms in the `default-agent`
274 library.
274 library.
275- Extra cores can be composed into the subject of the agent core. The
275- Extra cores can be composed into the subject of the agent core. The
276 composition is done implicitly by the build system. Typically we'd include one
276 composition is done implicitly by the build system. Typically we'd include one
content/docs/userspace/gall-guide/4-lifecycle.md+2−2
@@ -320,7 +320,7 @@ Let's try inspecting our state with `dbug`:
320
320
321```
321```
322> [%0 val=42]
322> [%0 val=42]
323−> :state-test +dbug
323+> :lifecycle +dbug
324>=
324>=
325```
325```
326
326
@@ -328,7 +328,7 @@ Let's try inspecting our state with `dbug`:
328
328
329```
329```
330> 42
330> 42
331−> :state-test +dbug [%state %val]
331+> :lifecycle +dbug [%state %val]
332>=
332>=
333```
333```
334
334
content/docs/userspace/gall-guide/5-cards.md+4−4
@@ -86,7 +86,7 @@ The type of the next field is a `note:agent:gall` (henceforth just `note`), whic
86- An `%arvo` `note` is a request to a vane. We'll discuss such requests
86- An `%arvo` `note` is a request to a vane. We'll discuss such requests
87 [below](#note-arvo).
87 [below](#note-arvo).
88- A `%pyre` `note` is used to abort an event. It's mostly used internally by
88- A `%pyre` `note` is used to abort an event. It's mostly used internally by
89− Kiln, it's unlikely you'd use it in your own agent. The `tang` contains an
89+ `kiln` (a submodule of `%hood`), it's unlikely you'd use it in your own agent. The `tang` contains an
90 error message.
90 error message.
91
91
92### `task`
92### `task`
@@ -135,11 +135,11 @@ Unlike subscriptions, these are just one-off messages.
135
135
136A `%poke` contains a `cage` of some data. A `cage` is a cell of `[mark vase]`.
136A `%poke` contains a `cage` of some data. A `cage` is a cell of `[mark vase]`.
137The `mark` is just a `@tas` like `%foo`, and corresponds to a mark file in the
137The `mark` is just a `@tas` like `%foo`, and corresponds to a mark file in the
138−`/mar` directory. We'll cover marks in greater detail later. The `vase` contains
138+`/mar` directory. We'll cover `mark`s in greater detail later. The `vase` contains
139the actual data you're sending.
139the actual data you're sending.
140
140
141−The `%poke-as` task is the same as `%poke` except Gall will convert the `cage`
141+The `%poke-as` task is the same as `%poke` except Gall will convert the `mark`
142−to the `mark` you specify before sending it off.
142+in the `cage` to the `mark` you specify before sending it off.
143
143
144**Examples**
144**Examples**
145
145
content/docs/userspace/gall-guide/7-sur-and-marks.md+9−9
@@ -183,7 +183,7 @@ corresponds to its `mark` before being delivered to the agent. If the remote
183data has no corresponding mark in `/mar` or it fails validation, it will crash
183data has no corresponding mark in `/mar` or it fails validation, it will crash
184before it touches the agent.
184before it touches the agent.
185
185
186−A mark file is a `door` with three arms. The door's sample is the data type the
186+A mark file is a door with exactly three arms. The door's sample is the data type the
187mark will handle. For example, the sample of the `%noun` mark is just `non=*`,
187mark will handle. For example, the sample of the `%noun` mark is just `non=*`,
188since it handles any noun. The three arms are as follows:
188since it handles any noun. The three arms are as follows:
189
189
@@ -221,10 +221,10 @@ Here's a very simple mark file for the `action` structure we created in the
221```
221```
222
222
223We've imported the `/sur/todo.hoon` structure library from the previous section,
223We've imported the `/sur/todo.hoon` structure library from the previous section,
224−and we've defined the sample of the `door` as `=action:todo`, since that's what
224+and we've defined the sample of the door as `=action:todo`, since that's what
225it will handle. Now let's consider the arms:
225it will handle. Now let's consider the arms:
226
226
227−- `grab`: This handles convertion methods _to_ our mark. It contains a core with
227+- `grab`: This handles conversion methods _to_ our mark. It contains a core with
228 arm names corresponding to other marks. In this case, it can only convert from
228 arm names corresponding to other marks. In this case, it can only convert from
229 a `noun` mark, so that's the core's only arm. The `noun` arm simply calls the
229 a `noun` mark, so that's the core's only arm. The `noun` arm simply calls the
230 `action` structure from our structure library. This is called "clamming" or
230 `action` structure from our structure library. This is called "clamming" or
@@ -233,7 +233,7 @@ it will handle. Now let's consider the arms:
233- `grow`: This handles conversion methods _from_ our mark. Like `grab`, it
233- `grow`: This handles conversion methods _from_ our mark. Like `grab`, it
234 contains a core with arm names corresponding to other marks. Here we've also
234 contains a core with arm names corresponding to other marks. Here we've also
235 only added an arm for a `%noun` mark. In this case, `action` data will come in
235 only added an arm for a `%noun` mark. In this case, `action` data will come in
236− as the sample of our `door`, and the `noun` arm simply returns it, since it's
236+ as the sample of our door, and the `noun` arm simply returns it, since it's
237 already a noun (as everything is in Hoon).
237 already a noun (as everything is in Hoon).
238- `grad`: This is the revision control arm, and as you can see we've simply
238- `grad`: This is the revision control arm, and as you can see we've simply
239 delegated it to the `%noun` mark.
239 delegated it to the `%noun` mark.
@@ -277,9 +277,9 @@ just contains the `@p` of the local ship. The `src` field contains the `@p` of
277the ship from which the event originated.
277the ship from which the event originated.
278
278
279When messages come in over Ames from other ships on the network, they're
279When messages come in over Ames from other ships on the network, they're
280−encrypted with our ship's public keys and signed by the ship which sent them.
280+[encrypted](/docs/arvo/ames/cryptography) with our ship's public keys and signed by the ship which sent them.
281The Ames vane decrypts and verifies the messages using keys in the Jael vane,
281The Ames vane decrypts and verifies the messages using keys in the Jael vane,
282−which are obtained from the Azimuth Ethereum contract where Urbit ID ownership
282+which are obtained from the [Azimuth Ethereum contract](/docs/azimuth/azimuth-eth) and [Layer 2 data](/docs/azimuth/l2/layer2) where Urbit ID ownership
283and keys are recorded. This means the originating `@p` of all messages are
283and keys are recorded. This means the originating `@p` of all messages are
284cryptographically validated before being passed on to Gall, so the `@p`
284cryptographically validated before being passed on to Gall, so the `@p`
285specified in the `src` field of the `bowl` can be trusted to be correct, and
285specified in the `src` field of the `bowl` can be trusted to be correct, and
@@ -328,10 +328,10 @@ Type definitions:
328- An agent's type definitions live in the `/sur` directory of a desk.
328- An agent's type definitions live in the `/sur` directory of a desk.
329- The `/sur` file is a core, typically containing a number of lusbuc (`+$`)
329- The `/sur` file is a core, typically containing a number of lusbuc (`+$`)
330 arms.
330 arms.
331−- `/sur` files can be imported with the fashep (`/-`) Ford rune at the beginning
331+- `/sur` files are imported with the fashep (`/-`) Ford rune at the beginning
332 of a file.
332 of a file.
333- Agent API types, for pokes and updates to subscribers, are commonly defined as
333- Agent API types, for pokes and updates to subscribers, are commonly defined as
334− head-tagged unions.
334+ head-tagged unions such as `[%foo bar=baz]`.
335
335
336Mark files:
336Mark files:
337
337
@@ -339,7 +339,7 @@ Mark files:
339- A `mark` like `%foo` corresponds to a file in `/mar` like `/mar/foo.hoon`
339- A `mark` like `%foo` corresponds to a file in `/mar` like `/mar/foo.hoon`
340- Marks are file types in Clay, but are also used for passing data between
340- Marks are file types in Clay, but are also used for passing data between
341 agents as well as for external data generally.
341 agents as well as for external data generally.
342−- A mark file is a `door` with a sample of the data type it handles and three
342+- A mark file is a door with a sample of the data type it handles and exactly three
343 arms: `grab`, `grow` and `grad`.
343 arms: `grab`, `grow` and `grad`.
344- `grab` and `grow` each contain a core with arm names corresponding to other marks.
344- `grab` and `grow` each contain a core with arm names corresponding to other marks.
345- `grab` and `grow` define functions for converting to and from our mark,
345- `grab` and `grow` define functions for converting to and from our mark,
content/docs/userspace/gall-guide/9-vanes.md+2
@@ -232,6 +232,8 @@ to `on-arvo`, on the `wire` we specified (`/timers`). Here's the `on-arvo` arm:
232 ==
232 ==
233```
233```
234
234
235+We remark that, just like in the case of agent-agent communication, `gift`s from Arvo are also routed `wire` before `sign-arvo`.
236+
235First we check the `wire` is `/timers`, and then we check the `sign-arvo` begins
237First we check the `wire` is `/timers`, and then we check the `sign-arvo` begins
236with `[%behn %wake ....]`. Behn's `%wake` gift has the following format:
238with `[%behn %wake ....]`. Behn's `%wake` gift has the following format:
237
239
content/docs/userspace/gall-guide/types.md+3−3
@@ -58,7 +58,7 @@ dojo:
58```
58```
59
59
60You would typically use `!>` as part of a [`cage`](#cage) when you're
60You would typically use `!>` as part of a [`cage`](#cage) when you're
61−constructing a `card` like a poke or a `%fact` gift to be sent off.
61+constructing a `card` like a poke or a `%fact` `gift` to be sent off.
62
62
63### Extract data from `vase`
63### Extract data from `vase`
64
64
@@ -90,7 +90,7 @@ Now let's try asking for a `@p` rather than `@t`:
90nest-fail
90nest-fail
91```
91```
92
92
93−As you can see, it will crash if the type does not exactly match. Note that
93+As you can see, it will crash if the type does not nest. Note that
94rather than using `!<`, you can also just clam the tail of the vase like:
94rather than using `!<`, you can also just clam the tail of the vase like:
95
95
96```
96```
@@ -156,7 +156,7 @@ a Gall agent, a `path` is most commonly a subscription path - you might
156subscribe for updates to `/foo/bar` on another agent, or another agent might
156subscribe for updates to `/foo/bar` on another agent, or another agent might
157subscribe to `/baz` on your agent.
157subscribe to `/baz` on your agent.
158
158
159−A `path` might just be a series of fixed elements like `/foo/bar`, but some
159+A `path` might just be a series of fixed `@ta` like `/foo/bar`, but some
160elements might also be variable and encode atom auras, or some other format. For
160elements might also be variable and encode atom auras, or some other format. For
161example, you might like to include a date in the path like
161example, you might like to include a date in the path like
162`/updates/~2021.10.31..07.24.27..db68`. Other agents might create the path by
162`/updates/~2021.10.31..07.24.27..db68`. Other agents might create the path by