on 7f41c41 help sign in
36 files changed+311−1701
since splitsnapshots
unifiedsplit
base-desk/lib/dbug.hoon+3−9 base-desk/lib/keygen.hoon+1−1 base-desk/lib/language-server/complete.hoon+2−2 base-desk/lib/language-server/easy-print.hoon+3−3 base-desk/lib/language-server/rune-snippet.hoon+2−2 base-desk/lib/ph/io.hoon+4−226 base-desk/lib/ph/util.hoon+8−21 base-desk/lib/pill.hoon+19−263 base-desk/lib/ring.hoon+36−36 base-desk/lib/shoe.hoon+19−28 base-desk/lib/strandio.hoon+6−112 base-desk/lib/test.hoon+1−22 base-desk/lib/verb.hoon+11−88 base-desk/mar/css.hoon+5−9 base-desk/mar/hoon.hoon+31−285 base-desk/mar/htm.hoon+11−2 base-desk/mar/js.hoon+4−7 base-desk/mar/noun.hoon−3 base-desk/mar/story.hoon+10−5 base-desk/mar/tang.hoon+5−5 base-desk/mar/thread-fail.hoon+1−1 base-desk/mar/txt.hoon+1 base-desk/mar/udon.hoon+4 base-desk/mar/umd.hoon+4 base-desk/mar/urb.hoon+1−1 base-desk/sources.txt+3−2 base-desk/sur/aquarium.hoon+5−8 base-desk/sur/hood.hoon+98−202 base-desk/sur/ring.hoon+1−1 base-desk/sur/spider.hoon+1−7 base-desk/sur/sss.hoon+8−4 base-desk/sur/verb.hoon+1−37 bin/make_glob.py−208 desk/sys.kelvin+2−1 flake.lock−27 flake.nix−73
base-desk/lib/dbug.hoon+3−9
@@ -4,8 +4,7 @@
44::
55|%
66+$ poke
7− $% [%skip depth=@ud =poke]
8− [%bowl ~]
7+ $% [%bowl ~]
98 [%state grab=cord]
109 [%incoming =about]
1110 [%outgoing =about]
@@ -33,13 +32,8 @@
3332 ?. ?=(%dbug mark)
3433 =^ cards agent (on-poke:ag mark vase)
3534 [cards this]
36− =/ dbug !<(poke vase)
37− =? dbug ?=([%skip %0 *] dbug) poke.dbug
38− ?: ?=(%skip -.dbug)
39− =^ cards agent
40− %+ on-poke:ag %dbug
41− !>(`poke`dbug(depth (dec depth.dbug)))
42− [cards this]
35+ =/ dbug
36+ !<(poke vase)
4337 =; =tang
4438 ((%*(. slog pri 1) tang) [~ this])
4539 ?- -.dbug
base-desk/lib/keygen.hoon+1−1
@@ -94,7 +94,7 @@
9494 |= seed=@
9595 ^- edkeys
9696 =+ =< [pub=pub:ex sec=sec:ex]
97− (pit:nu:cric:crypto 256 seed %b ~)
97+ (pit:nu:crub:crypto 256 seed)
9898 :- ^= auth
9999 :- (rsh 3 (end [3 33] pub))
100100 (rsh 3 (end [3 33] sec))
base-desk/lib/language-server/complete.hoon+2−2
@@ -43,7 +43,7 @@
4343 %+ turn ~(tap by q.r.q.ty)
4444 |= [term =tome]
4545 %+ turn
46− ~(tap by tome)
46+ ~(tap by q.tome)
4747 |= [name=term =hoon]
4848 ^- (pair term type)
4949 ~| term=term
@@ -227,7 +227,7 @@
227227 =* outer-loop $
228228 ?~ tomes
229229 ~
230− =/ arms ~(tap by q.i.tomes)
230+ =/ arms ~(tap by q.q.i.tomes)
231231 |- ^- (unit [term type])
232232 =* inner-loop $
233233 ?~ arms
base-desk/lib/language-server/easy-print.hoon+3−3
@@ -421,11 +421,11 @@
421421 ?:(?=([%plot *] q.yon) [q.hin p.q.yon] [q.hin q.yon ~])
422422 ::
423423 [%core *]
424− ?: ?=([[%$ [[%$ @ *] ~ ~]] ~ ~] q.r.q.sut)
424+ ?: ?=([[%$ * [[%$ @ *] ~ ~]] ~ ~] q.r.q.sut)
425425 =/ dad $(sut p.sut)
426426 :- p.dad
427427 ~! q.r.q.sut
428− [%gate q.n.q.n.q.r.q.sut sut(r.p.q %gold) q.dad]
428+ [%gate q.n.q.q.n.q.r.q.sut sut(r.p.q %gold) q.dad]
429429 =+ yad=$(sut p.sut)
430430 :- p.yad
431431 =+ ^= doy ^- [p=(list @ta) q=wine]
@@ -438,7 +438,7 @@
438438 %^ cat 3
439439 %~ rent co
440440 :+ %$ %ud
441− %- ~(rep by (~(run by q.r.q.sut) |=(tome ~(wyt by +<))))
441+ %- ~(rep by (~(run by q.r.q.sut) |=(tome ~(wyt by q.+<))))
442442 |=([[@ a=@u] b=@u] (add a b))
443443 %^ cat 3
444444 ?-(r.p.q.sut %gold '.', %iron '|', %lead '?', %zinc '&')
base-desk/lib/language-server/rune-snippet.hoon+2−2
@@ -509,8 +509,8 @@
509509 :- '!@'
510510 """
511511 $\{1:wing}
512− $\{2:if-not-exists}
513− $\{3:if-exists}
512+ $\{2:if-exists}
513+ $\{3:if-not-exists}
514514 """
515515 :- '!?'
516516 """
base-desk/lib/ph/io.hoon+4−226
@@ -1,5 +1,5 @@
11/- *aquarium, spider
2−/+ libstrand=strand, *strandio, util=ph-util, aqua-azimuth, vere
2+/+ libstrand=strand, *strandio, util=ph-util, aqua-azimuth
33=, strand=strand:libstrand
44|%
55++ send-events
@@ -88,6 +88,7 @@
8888 ^- form:m
8989 (pure:m ~)
9090::
91+::
9192++ init
9293 =/ m (strand ,~)
9394 ^- form:m
@@ -124,8 +125,6 @@
124125 1
125126 +(+.old-rut)
126127 ;< ~ bind:m (send-azimuth-action %breach who)
127− ;< ~ bind:m ?~ old-rut (sleep ~s20) :: XX don't wait if possible
128− (wait-for-sunk her who) :: wait only if previously talked
129128 |- ^- form:m
130129 =* loop $
131130 ;< ~ bind:m (sleep ~s10)
@@ -143,6 +142,7 @@
143142 ?> ?=(%earl (clan:title moon))
144143 ?: fake (init-ship moon &)
145144 =/ m (strand ,~)
145+ ^- form:m
146146 ;< ~ bind:m
147147 %+ dojo (^sein:title moon)
148148 =/ =pass pub:ex:(get-keys:aqua-azimuth moon 1)
@@ -150,46 +150,13 @@
150150 (init-ship moon |)
151151::
152152++ init-ship
153− =| core=?(%mesa %ames) :: XX make %mesa the default core
154153 |= [=ship fake=?]
155154 =/ m (strand ,~)
156155 ^- form:m
157156 ~& > "starting {<ship>}"
158− ;< ~ bind:m (send-events (init:util ship fake ~ core))
157+ ;< ~ bind:m (send-events (init:util ship fake))
159158 (check-ship-booted ship)
160159::
161−++ init-comet
162− =| core=?(%mesa %ames) :: XX make %mesa the default core
163− |= comet=ship
164− =/ m (strand ,~)
165− ^- form:m
166− :: hardcoded for:
167− :: ~londeg-tirlys-somlyd-poltus--pintyn-tarbyl-bicnux-marbud
168− ::
169− =/ =feed:jael
170− :* [%2 ~]
171− who=comet
172− ryf=0
173− :_ ~
174− :- lyf=1
175− key=0wfm.lBEWM.08gfy.AxYjy.8-tBQ.uq-aa.LZt9c.CVQqd.XBJIs.
176− CoG90.BNNGV.1ZmVi.ZbAhY.LuhwC.idNnU.lCVkt.Z4qug.7iY92
177− ==
178− ::
179− ?> ?=(^ (veri:dawn:vere comet feed *point:azimuth-types ~))
180− ~& > "mining comet under {<(^sein:title comet)>}"
181− ;< ~ bind:m (send-events (init:util comet fake=%.n `feed core))
182− (check-ship-booted comet)
183−::
184−:: Load network core protocol
185−::
186−++ load
187− |= [who=ship ore=?(%mesa %ames)]
188− =/ m (strand ,~)
189− ^- form:m
190− ;< ~ bind:m (send-events [%event who [/a/aqua/load %load ore]]~)
191− (pure:m ~)
192−::
193160++ check-ship-booted
194161 |= =ship
195162 =/ m (strand ,~)
@@ -226,129 +193,6 @@
226193 (pure:m ~)
227194 loop
228195::
229−++ wait-for-flub
230− |= [our=ship her=ship dap=term]
231− =/ m (strand ,~)
232− ^- form:m
233− ;< =bowl:spider bind:m get-bowl
234− |- ^- form:m
235− =* loop $
236− ;< [from=^ship =unix-effect] bind:m take-unix-effect
237− ;< now=@da bind:m get-time
238− ?. =(from our)
239− :: our sends the $boon with the halted flow number, at this point
240− :: gall has updated its state adding the app to gall's .halts map
241− :: XX search deeper in the .unix-effect?
242− ::
243− loop
244− =/ aqua-pax
245− :- %i
246− /(scot %p our)/gg/(scot %p our)//(scot %da now)/[%$]/noun
247− =+ ;; flubs=(unit (jug ship term))
248− (scry-aqua:util noun our.bowl now aqua-pax)
249− ?~ flubs loop
250− ?. (~(has ju u.flubs) her dap)
251− loop
252− (pure:m ~)
253−::
254−++ wait-for-spur
255− |= [our=ship her=ship dap=term]
256− =/ m (strand ,~)
257− ^- form:m
258− ;< =bowl:spider bind:m get-bowl
259− |- ^- form:m
260− =* loop $
261− ;< [from=ship =unix-effect] bind:m take-unix-effect
262− ;< now=@da bind:m get-time
263− ?. =(from our)
264− :: our ack to the %spur $boon is sent, at this point
265− :: gall has updated its state adding the app to gall's .flubs map
266− :: XX search deeper in the .unix-effect?
267− ::
268− loop
269− =/ aqua-pax
270− :- %i
271− /(scot %p our)/gg/(scot %p our)//(scot %da now)/[%$]/noun
272− =+ ;; flubs=(unit (jug ship term))
273− (scry-aqua:util noun our.bowl now aqua-pax)
274− ?~ flubs loop
275− ?: (~(has ju u.flubs) her dap)
276− loop
277− (pure:m ~)
278−::
279−++ wait-for-has-halt
280− |= [our=ship her=ship dap=term]
281− =/ m (strand ,~)
282− ^- form:m
283− ;< =bowl:spider bind:m get-bowl
284− |- ^- form:m
285− =* loop $
286− ;< [from=ship =unix-effect] bind:m take-unix-effect
287− ;< now=@da bind:m get-time
288− :: only %send or %push effects
289− ::
290− ?. ?=(?(%send %push) -.q.unix-effect)
291− loop
292− ~& >> from^unix-effect
293− ?. =(from our)
294− :: wait until our ack for the %flub $boon is sent, at this point
295− :: gall has updated its state adding the app to gall's .flubs map
296− :: XX search deeper in the .unix-effect?
297− ::
298− loop
299− =/ aqua-pax
300− :- %i
301− /(scot %p our)/gh/(scot %p our)//(scot %da now)/[%$]/noun
302− =+ ;; halts=(unit (jug app=term [ship =duct]))
303− (scry-aqua:util noun our.bowl now aqua-pax)
304− ?~ halts loop
305− ?. (~(has by u.halts) dap) :: XX check .her as well
306− loop
307− (pure:m ~)
308−::
309−++ wait-for-del-halt
310− |= [our=ship her=ship dap=term]
311− =/ m (strand ,~)
312− ^- form:m
313− ;< =bowl:spider bind:m get-bowl
314− |- ^- form:m
315− =* loop $
316− ;< [from=ship =unix-effect] bind:m take-unix-effect
317− ;< now=@da bind:m get-time
318− ?. =(from our)
319− :: when the %spur $boon has been sent, gall has updated its state deleting
320− :: the app from gall's .flubs map
321− :: XX search deeper in the .unix-effect?
322− ::
323− loop
324− =/ aqua-pax
325− :- %i
326− /(scot %p our)/gh/(scot %p our)//(scot %da now)/[%$]/noun
327− =+ ;; halts=(unit (jug app=term [ship =duct]))
328− (scry-aqua:util noun our.bowl now aqua-pax)
329− ?~ halts loop
330− ?: (~(has by u.halts) dap) :: XX check .her as well
331− loop
332− (pure:m ~)
333−::
334−++ wait-for-pac
335− |= [our=ship to=ship]
336− =/ m (strand ,~)
337− ^- form:m
338− ~& > "waiting for ack: {<[from=our to=to]>}"
339− |- ^- form:m
340− =* loop $
341− ;< [from=ship =unix-effect] bind:m take-unix-effect
342− ?. =(our from)
343− loop
344− :: only %send or %push effects
345− ::
346− ?. ?=(?(%send %push) -.q.unix-effect)
347− loop
348− :: XX check that this is an %ack?
349− :: XX check that this is for .to?
350− ::
351− (pure:m ~)
352196:: Send "|hi" from one ship to another
353197::
354198++ send-hi
@@ -360,64 +204,6 @@
360204::
361205:: Send "|hi" and wait for "not responding" message
362206::
363−++ wait-for-sunk
364− |= [from=@p to=@p]
365− =/ m (strand ,~)
366− (wait-for-output from "{(scow %p to)} has sunk")
367−::
368−++ wait-for-fact
369− |= [=ship =mark =wire gate=$-([mark noun] ?)]
370− =/ m (strand ,noun)
371− ^- form:m
372− ~& > "waiting for fact: {<mark>}"
373− |- ^- form:m
374− =* loop $
375− ;< [her=^ship =unix-effect] bind:m take-unix-effect
376− ?. =(her ship)
377− loop
378− ?. ?& =(wire p.unix-effect)
379− ?=([%unto %raw-fact *] q.unix-effect)
380− =(mark mark.unto.q.unix-effect)
381− (gate mark noun.unto.q.unix-effect)
382− ==
383− loop
384− (pure:m noun.unto.q.unix-effect)
385−::
386−++ wait-for-cork
387− |= [our=ship her=ship flow=(each bone:ames side:ames)]
388− =/ m (strand ,~)
389− ^- form:m
390− ;< =bowl:spider bind:m get-bowl
391− |- ^- form:m
392− =* loop $
393− ;< [from=ship =unix-effect] bind:m take-unix-effect
394− ;< now=@da bind:m get-time
395− :: only %send or %push effects
396− ::
397− ?. ?=(?(%send %push) -.q.unix-effect)
398− loop
399− :: XX check that this is an %ack?
400− ::
401− ?. =(from our)
402− :: wait until the ack for the %cork $plea is sent, at this point
403− :: the publisher has already corked the flow
404− ::
405− loop
406− =/ aqua-pax
407− %+ weld /i/(scot %p our)/ax/(scot %p our)//(scot %da now)
408− ?: ?=(%& -.flow)
409− /corked/(scot %p her)/(scot %ud +.flow)/noun
410− =/ [=bone:ames =dire:ames] +.flow
411− /corked/(scot %p her)/[dire]/(scot %ud bone)/noun
412− =+ ;; corked=(unit ?) (scry-aqua:util noun our.bowl now aqua-pax)
413− ?~ corked loop
414− ?. u.corked :: XX check .her as well
415− loop
416− ~& >> flow-is-corked/flow
417− (pure:m ~)
418−::
419−:: Send "|hi" and wait for "not responding" message
420−::
421207++ send-hi-not-responding
422208 |= [from=@p to=@p]
423209 ~& > 'sending hi not responding'
@@ -470,14 +256,6 @@
470256 ;< ~ bind:m (send-events (insert-files:util her desk [pax warped] ~))
471257 (pure:m warped)
472258::
473−++ copy-file
474− =/ m (strand ,~)
475− |= [her=ship pax=path file=@t]
476− ^- form:m
477− ;< ~ bind:m
478− (send-events (insert-files:util her %base [pax file] ~))
479− (sleep ~s1)
480−::
481259:: Check /sur/aquarium/hoon on the given has the given contents.
482260::
483261++ check-file-touched
base-desk/lib/ph/util.hoon+8−21
@@ -16,11 +16,9 @@
1616:: Start a ship (low-level; prefer +raw-ship)
1717::
1818++ init
19− |= [who=ship ake=? eed=(unit feed:jael) ore=?(%mesa %ames)]
19+ |= [who=ship fake=?]
2020 ^- (list aqua-event)
21− :~ [%init-ship who ake eed]
22− [%event who [/a/aqua/load %load ore]]
23− ==
21+ [%init-ship who fake]~
2422::
2523:: Send dojo command
2624::
@@ -64,26 +62,15 @@
6462::TODO should be rename -dill-output
6563++ is-dojo-output
6664 |= [who=ship her=ship uf=unix-effect what=tape]
67− |^
6865 ?& =(who her)
6966 ?=(%blit -.q.uf)
70− (lien p.q.uf handle-blit)
71− ==
72− ::
73− ++ handle-blit
74− |= =blit:dill
75− ^- ?
76− ?: ?=(%mor -.blit)
77− (lien p.blit handle-blit)
78− ?+ -.blit |
79− %put !=(~ (find what p.blit))
8067 ::
81− %klr
82− %+ lien p.blit
83− |= [* q=(list @c)]
84− !=(~ (find what q))
85− ==
86− --
68+ %+ lien p.q.uf
69+ |= =blit:dill
70+ ?. ?=(%put -.blit)
71+ |
72+ !=(~ (find what p.blit))
73+ ==
8774::
8875:: Test is successful if +is-dojo-output
8976::
base-desk/lib/pill.hoon+19−263
@@ -2,7 +2,6 @@
22::
33/- dice
44^?
5−=<
65|%
76::
87+$ pill
@@ -12,14 +11,6 @@
1211 boot-ova=(list)
1312 kernel-ova=(list unix-event)
1413 userspace-ova=(list unix-event)
15− ==
16− $: %cash
17− $: nam=term
18− boot-ova=(list)
19− kernel-ova=(list unix-event)
20− userspace-ova=(list unix-event)
21− ==
22− cache=(list)
2314 == ==
2415::
2516+$ unix-event
@@ -42,14 +33,14 @@
4233 [/sys/arvo hoon/arvo]
4334 ==
4435:: +dirs: filter for userspace directories to include
45−::
36+::
4637++ dirs
4738 |= [bas=path exc=(list spur)]
4839 ^- (list spur)
4940 ?~ exc ~(tap in dir:.^(arch %cy bas))
5041 %+ skim
5142 ~(tap in dir:.^(arch %cy bas))
52− |=(=spur =(~ (find ~[spur] exc)))
43+ |=(=spur =(~ (find ~[spur] exc)))
5344:: +file-ovum: userspace filesystem load
5445::
5546:: bas: full path to / directory
@@ -108,26 +99,6 @@
10899::
109100++ file-ovum2 |=(z=[path (list spur)] `unix-event`[//arvo what/(user-files z)])
110101::
111−++ get-wynn
112− |= [sys=path new-wynn=?]
113− ^- wynn
114− ?. new-wynn
115− :~ zuse+zuse
116− lull+lull
117− arvo+arvo
118− hoon+hoon-version
119− ==
120− ~> %bout.[0 %get-wynn]
121− =+ .^(zus=vase %ca (welp sys /zuse/hoon))
122− =+ .^(lul=vase %ca (welp sys /lull/hoon))
123− =+ .^(arv=vase %ca (welp sys /arvo/hoon))
124− =+ .^(hun=vase %ca (welp sys /hoon/hoon))
125− :~ [%zuse ;;(@ud q:(slap zus limb+%zuse))]
126− [%lull ;;(@ud q:(slap lul limb+%lull))]
127− [%arvo ;;(@ud q:(slap arv limb+%arvo))]
128− [%hoon ;;(@ud q:(slap hun limb+%hoon-version))]
129− ==
130−::
131102++ prep-ovum
132103 |= dez=(list path)
133104 ^- unix-event
@@ -229,7 +200,7 @@
229200 :- (boot-ovum:pill compiler-src arvo-src)
230201 %+ turn
231202 (snoc (turn dez tail) bas)
232− |= =path
203+ |= =path
233204 (file-ovum2 [path exc])
234205 .*(0 arvo-formula)
235206 |= [ovo=ovum ken=*]
@@ -263,26 +234,19 @@
263234 :+ %pill %solid
264235 :+ boot-ova ~
265236 =. dez (snoc dez [%base bas])
266− ;: weld
267− %+ turn dez
268− |= [dek=desk bas=path]
237+ %+ weld
238+ %+ turn dez
239+ |= [dek=desk bas=path]
269240 (file-ovum [dek bas exc])
270− ::
271− ?. prime ~
272− [(prep-ovum (turn dez tail))]~
273− ::
274− %+ turn dez
275− |= [dek=desk *]
276− ^- unix-event
277− [/c/essential/[dek] %esse dek %.y]
278− ==
241+ ?. prime ~
242+ [(prep-ovum (turn dez tail))]~
279243::
280244++ brass
281245 :: sys: root path to boot system, `/~me/[desk]/now/sys`
282246 :: dez: secondary desks and their root paths
283247 :: exc: list of desk folders to exclude
284248 ::
285− |= [sys=path dez=(list [desk path]) cache=? prime=? new-wynn=? exc=(list spur)]
249+ |= [sys=path dez=(list [desk path]) prime=? exc=(list spur)]
286250 ^- pill
287251 =/ bas=path (scag 3 sys)
288252 :: compiler-source: hoon source file producing compiler, `sys/hoon`
@@ -314,54 +278,20 @@
314278 compiler-source
315279 arvo-source
316280 ==
281+ :: a pill is a 3-tuple of event-lists: [boot kernel userspace]
317282 ::
318− =/ kernel-ova=(list unix-event)
283+ :+ %pill %brass
284+ :+ boot-ova
319285 :~ (boot-ovum compiler-source arvo-source)
320286 (file-ovum2 [bas exc])
321287 ==
322− ::
323− =/ userspace-ova
324− =. dez (snoc dez [%base bas])
325− ;: weld
326− %+ turn dez
327− |= [dek=desk bas=path]
328− (file-ovum [dek bas exc])
329− ::
330− ?. prime ~
331− [(prep-ovum (turn dez tail))]~
332− ::
333− %+ turn dez
334− |= [dek=desk *]
335− ^- unix-event
336− [/c/essential/[dek] %esse dek %.y]
337− ==
338− ::
339− =/ =wynn (get-wynn sys new-wynn)
340− ::
341− =/ cache=(list)
342− ?. cache ~
343− %~ tap by
344− =< +
345− %- mice
346− :_ [%2 [%0 3] %0 2]
347− ;: weld
348− boot-ova
349− ^- (list)
350− :~ [*@da //arvo %wack *@uvJ]
351− [*@da //arvo %whom *@p]
352− [*@da //arvo %wyrd [~.nonce /] wynn]
353− ==
354− `(list)`(turn kernel-ova (lead *@da))
355− `(list)`[*@da [/d/term/1 %boot & %fake *@p]]^~
356− `(list)`(turn userspace-ova (lead *@da))
357− `(list)`[*@da [/c/init-zest %zeal (turn dez |=([d=desk *] [d %live]))]]^~
358− ==
359− ::
360− ~> %slog.[0 leaf+"brass: cache entries: {<(lent cache)>}"]
361− ::
362− :- %cash
363− :_ cache
364− [%brass boot-ova kernel-ova userspace-ova]
288+ =. dez (snoc dez [%base bas])
289+ %+ weld
290+ %+ turn dez
291+ |= [dek=desk bas=path]
292+ (file-ovum [dek bas exc])
293+ ?. prime ~
294+ [(prep-ovum (turn dez tail))]~
365295::
366296++ ivory
367297 |= sys=path
@@ -444,177 +374,3 @@
444374 ==
445375 --
446376--
447−::
448−~% %non ..part ~
449−:: +mice: %memo hint caching version of mink
450−::
451−|%
452−++ mice !.
453− ~/ %mice
454− |= [subject=* formula=*]
455− =| trace=(list [@ta *])
456− =| memo=(map)
457− =; [ton=tone mem=_memo]
458− ?. ?=(%0 -.ton)
459− [ton ~]
460− [ton mem]
461− |^ ^- [tone _memo]
462− ?+ formula [[%2 trace] memo]
463− [^ *]
464− =^ head memo $(formula -.formula)
465− ?. ?=(%0 -.head) [head memo]
466− =^ tail memo $(formula +.formula)
467− :_ memo
468− ?. ?=(%0 -.tail) tail
469− [%0 product.head product.tail]
470− ::
471− [%0 axis=@]
472− :_ memo
473− =/ part (frag axis.formula subject)
474− ?~ part [%2 trace]
475− [%0 u.part]
476− ::
477− [%1 constant=*]
478− [[%0 constant.formula] memo]
479− ::
480− [%2 subject=* formula=*]
481− =^ subject memo $(formula subject.formula)
482− ?. ?=(%0 -.subject) [subject memo]
483− =^ formula memo $(formula formula.formula)
484− ?. ?=(%0 -.formula) [formula memo]
485− %= $
486− subject product.subject
487− formula product.formula
488− ==
489− ::
490− [%3 argument=*]
491− =^ argument memo $(formula argument.formula)
492− :_ memo
493− ?. ?=(%0 -.argument) argument
494− [%0 .?(product.argument)]
495− ::
496− [%4 argument=*]
497− =^ argument memo $(formula argument.formula)
498− :_ memo
499− ?. ?=(%0 -.argument) argument
500− ?^ product.argument [%2 trace]
501− [%0 .+(product.argument)]
502− ::
503− [%5 a=* b=*]
504− =^ a memo $(formula a.formula)
505− ?. ?=(%0 -.a) [a memo]
506− =^ b memo $(formula b.formula)
507− :_ memo
508− ?. ?=(%0 -.b) b
509− [%0 =(product.a product.b)]
510− ::
511− [%6 test=* yes=* no=*]
512− =^ result memo $(formula test.formula)
513− ?. ?=(%0 -.result) [result memo]
514− ?+ product.result [[%2 trace] memo]
515− %& $(formula yes.formula)
516− %| $(formula no.formula)
517− ==
518− ::
519− [%7 subject=* next=*]
520− =^ subject memo $(formula subject.formula)
521− ?. ?=(%0 -.subject) [subject memo]
522− %= $
523− subject product.subject
524− formula next.formula
525− ==
526− ::
527− [%8 head=* next=*]
528− =^ head memo $(formula head.formula)
529− ?. ?=(%0 -.head) [head memo]
530− %= $
531− subject [product.head subject]
532− formula next.formula
533− ==
534− ::
535− [%9 axis=@ core=*]
536− =^ core memo
537− $(formula core.formula)
538− ?. ?=(%0 -.core) [core memo]
539− =/ arm (frag axis.formula product.core)
540− ?~ arm [[%2 trace] memo]
541− %= $
542− subject product.core
543− formula u.arm
544− ==
545− ::
546− [%10 [axis=@ value=*] target=*]
547− ?: =(0 axis.formula) [[%2 trace] memo]
548− =^ target memo $(formula target.formula)
549− ?. ?=(%0 -.target) [target memo]
550− =^ value memo $(formula value.formula)
551− :_ memo
552− ?. ?=(%0 -.value) value
553− =/ mutant=(unit *)
554− (edit axis.formula product.target product.value)
555− ?~ mutant [%2 trace]
556− [%0 u.mutant]
557− ::
558− [%11 tag=@ next=*]
559− =^ next memo $(formula next.formula)
560− :_ memo
561− ?. ?=(%0 -.next) next
562− :- %0
563− .* subject
564− [11 tag.formula 1 product.next]
565− ::
566− [%11 [tag=@ clue=*] next=*]
567− =^ clue memo $(formula clue.formula)
568− ?. ?=(%0 -.clue) [clue memo]
569− ?: ?=(%memo tag.formula)
570− ?^ hit=(~(get by memo) subject next.formula)
571− [[%0 u.hit] memo]
572− =^ ton memo $(formula next.formula)
573− ?. ?=(%0 -.ton)
574− [ton memo]
575− ?: ?=(?(@ [%clay %ford *]) product.clue)
576− [ton memo]
577− [ton (~(put by memo) [subject next.formula] product.ton)]
578− =^ next memo
579− =? trace
580− ?=(?(%hunk %hand %lose %mean %spot) tag.formula)
581− [[tag.formula product.clue] trace]
582− $(formula next.formula)
583− :_ memo
584− ?. ?=(%0 -.next) next
585− :- %0
586− .* subject
587− [11 [tag.formula 1 product.clue] 1 product.next]
588− ==
589− ::
590− ++ frag
591− |= [axis=@ noun=*]
592− ^- (unit)
593− ?: =(0 axis) ~
594− |- ^- (unit)
595− ?: =(1 axis) `noun
596− ?@ noun ~
597− =/ pick (cap axis)
598− %= $
599− axis (mas axis)
600− noun ?-(pick %2 -.noun, %3 +.noun)
601− ==
602− ::
603− ++ edit
604− |= [axis=@ target=* value=*]
605− ^- (unit)
606− ?: =(1 axis) `value
607− ?@ target ~
608− =/ pick (cap axis)
609− =/ mutant
610− %= $
611− axis (mas axis)
612− target ?-(pick %2 -.target, %3 +.target)
613− ==
614− ?~ mutant ~
615− ?- pick
616− %2 `[u.mutant +.target]
617− %3 `[-.target u.mutant]
618− ==
619− --
620−--
base-desk/lib/ring.hoon+36−36
@@ -18,10 +18,10 @@
1818 ::
1919 ++ generate-public-linkage
2020 |= link-scope=@
21− ^- [data=@ h=@uxpoint]
21+ ^- [data=@ h=@udpoint]
2222 ::
2323 =/ data=@ (mod link-scope l:ed:crypto)
24− =/ h=@uxpoint (scalarmult-base:ed:crypto data)
24+ =/ h=@udpoint (scalarmult-base:ed:crypto data)
2525 [data h]
2626 :: +generate-linkage: linkage information from scope and private key
2727 ::
@@ -30,13 +30,13 @@
3030 :: y: y = [x] * h
3131 ++ generate-linkage
3232 |= [link-scope=(unit @) my-private-key=@]
33− ^- (unit [data=@ h=@uxpoint y=@uxpoint])
33+ ^- (unit [data=@ h=@udpoint y=@udpoint])
3434 ::
3535 ?~ link-scope
3636 ~
3737 ::
38− =+ [data=@ h=@uxpoint]=(generate-public-linkage u.link-scope)
39− =/ y=@uxpoint (scalarmult:ed:crypto my-private-key h)
38+ =+ [data=@ h=@udpoint]=(generate-public-linkage u.link-scope)
39+ =/ y=@udpoint (scalarmult:ed:crypto my-private-key h)
4040 [~ data h y]
4141 :: +generate-challenge: generate challenge from a given message
4242 ::
@@ -47,13 +47,13 @@
4747 ++ generate-challenge
4848 |= $: :: common to both linked and unlinked
4949 message=@
50− g=@uxpoint
50+ g=@udpoint
5151 :: high level universal state
5252 ::
53− link-state=(unit [data=@ h=@uxpoint y=@uxpoint])
53+ link-state=(unit [data=@ h=@udpoint y=@udpoint])
5454 :: point to include in challenge when link-state isn't ~
5555 ::
56− h=(unit @uxpoint)
56+ h=(unit @udpoint)
5757 ==
5858 ^- @
5959 :: concatenate and reduce our message down to a 512-bit hash
@@ -74,9 +74,9 @@
7474 :: +generate-challenges: generates the full list of challenges
7575 ::
7676 ++ generate-challenges
77− |= $: link-state=(unit [data=@ h=@uxpoint y=@uxpoint])
77+ |= $: link-state=(unit [data=@ h=@udpoint y=@udpoint])
7878 message=@
79− public-keys=(list @uxpoint)
79+ public-keys=(list @udpoint)
8080 ss=(list @)
8181 ::
8282 prev-k=@u
@@ -86,14 +86,14 @@
8686 ==
8787 ^- (list @)
8888 ::
89− =/ gs=@uxpoint
89+ =/ gs=@udpoint
9090 %- add-scalarmult-scalarmult-base:ed:crypto :*
9191 prev-ch
9292 (snag prev-k public-keys)
9393 prev-s
9494 ==
9595 ::
96− =/ hs=(unit @uxpoint)
96+ =/ hs=(unit @udpoint)
9797 ?~ link-state
9898 ~
9999 ::
@@ -125,8 +125,8 @@
125125 :: used to generate the (unit point) consumed by +generate-challenge.
126126 ::
127127 ++ scalarmult-h
128− |= [u=@ linkage=(unit [data=@ h=@uxpoint y=@uxpoint])]
129− ^- (unit @uxpoint)
128+ |= [u=@ linkage=(unit [data=@ h=@udpoint y=@udpoint])]
129+ ^- (unit @udpoint)
130130 ?~ linkage
131131 ~
132132 [~ (scalarmult:ed:crypto u h.u.linkage)]
@@ -143,9 +143,9 @@
143143 |= $: message=@
144144 link-scope=(unit @)
145145 ::
146− anonymity-set=(set @uxpoint)
147− my-public-key=@uxpoint
148− my-private-key=@uxscalar
146+ anonymity-set=(set @udpoint)
147+ my-public-key=@udpoint
148+ my-private-key=@udscalar
149149 ::
150150 eny=@uvJ
151151 ==
@@ -157,7 +157,7 @@
157157 (need (find [my-public-key ~] anonymity-list))
158158 :: Generate linkage information if given
159159 ::
160− =/ linkage=(unit [data=@ h=@uxpoint y=@uxpoint])
160+ =/ linkage=(unit [data=@ h=@udpoint y=@udpoint])
161161 (generate-linkage link-scope my-private-key)
162162 :: initialize our random number generator from entropy
163163 ::
@@ -237,7 +237,7 @@
237237 |= $: message=@
238238 link-scope=(unit @)
239239 ::
240− anonymity-set=(set @uxpoint)
240+ anonymity-set=(set @udpoint)
241241 signature=raw-ring-signature
242242 ==
243243 ^- ?
@@ -259,14 +259,14 @@
259259 =/ s2-to-end=(list @) t.t.s.signature
260260 :: anonymity-list: set of public keys listified in ring order
261261 ::
262− =/ anonymity-list=(list @uxpoint)
262+ =/ anonymity-list=(list @udpoint)
263263 ~(tap in anonymity-set)
264264 :: participants: length of :anonymity-list
265265 ::
266266 =/ participants=@u
267267 (lent anonymity-list)
268268 ::
269− =/ z0p=@uxpoint
269+ =/ z0p=@udpoint
270270 %- add-scalarmult-scalarmult-base:ed:crypto :*
271271 ch0.signature
272272 (head anonymity-list)
@@ -275,14 +275,14 @@
275275 :: generate the linkage using public data, and the y point from the
276276 :: signature
277277 ::
278− =/ linkage=(unit [data=@ h=@uxpoint y=@uxpoint])
278+ =/ linkage=(unit [data=@ h=@udpoint y=@udpoint])
279279 ?~ link-scope
280280 ~
281− =+ [data=@ h=@uxpoint]=(generate-public-linkage u.link-scope)
281+ =+ [data=@ h=@udpoint]=(generate-public-linkage u.link-scope)
282282 :- ~
283283 [data h (need y.signature)]
284284 ::
285− =/ z0pp=(unit @uxpoint)
285+ =/ z0pp=(unit @udpoint)
286286 ?~ linkage
287287 ~
288288 :- ~
@@ -319,7 +319,7 @@
319319 :: +seed-to-private-key-scalar: keyfile form to scalar we can multiply with
320320 ::
321321 ++ seed-to-private-key-scalar
322− |= sk=@I ^- @uxscalar
322+ |= sk=@I ^- @udscalar
323323 ?: (gth (met 3 sk) 32) !!
324324 =+ h=(shal (rsh [0 3] b:ed:crypto) sk)
325325 %+ add
@@ -347,7 +347,7 @@
347347 ::
348348 ++ ship-life-to-pubid
349349 |= [our=@p now=@da ship=@p =life]
350− ^- @uxpoint
350+ ^- @udpoint
351351 ::
352352 =/ d=[=^life =pass *]
353353 =/ scry-path=path
@@ -364,14 +364,14 @@
364364 ::
365365 =/ x=[crypt=@ auth=@] (get-public-key-from-pass pass.d)
366366 ::
367− `@uxpoint`auth.x
367+ `@udpoint`auth.x
368368 ::
369369 ++ build-signing-participants
370370 |= [our=@p now=@da invited=(list @p)]
371− ^- [(set [@p life]) (set @uxpoint)]
371+ ^- [(set [@p life]) (set @udpoint)]
372372 ::
373373 =| participants=(set [@p life])
374− =| keys=(set @uxpoint)
374+ =| keys=(set @udpoint)
375375 ::
376376 |-
377377 ?~ invited
@@ -383,7 +383,7 @@
383383 ?~ lyfe
384384 $(invited t.invited)
385385 ::
386− =/ pubkey=@uxpoint (ship-life-to-pubid our now i.invited u.lyfe)
386+ =/ pubkey=@udpoint (ship-life-to-pubid our now i.invited u.lyfe)
387387 ::
388388 =. participants (~(put in participants) [i.invited u.lyfe])
389389 =. keys (~(put in keys) pubkey)
@@ -393,15 +393,15 @@
393393 ::
394394 ++ build-verifying-participants
395395 |= [our=@p now=@da invited=(list [ship=@p =life])]
396− ^- (set @uxpoint)
396+ ^- (set @udpoint)
397397 ::
398− =| keys=(set @uxpoint)
398+ =| keys=(set @udpoint)
399399 ::
400400 |-
401401 ?~ invited
402402 keys
403403 ::
404− =/ pubkey=@uxpoint
404+ =/ pubkey=@udpoint
405405 (ship-life-to-pubid our now ship.i.invited life.i.invited)
406406 =. keys
407407 (~(put in keys) pubkey)
@@ -432,7 +432,7 @@
432432 =/ link-hash=(unit @) (bind link-scope |=(a=* (shaz (jam a))))
433433 :: get everyone's public keys
434434 ::
435− =/ p=[participants=(set [ship=@p =life]) keys=(set @uxpoint)]
435+ =/ p=[participants=(set [ship=@p =life]) keys=(set @udpoint)]
436436 (build-signing-participants:detail our now ~(tap in anonymity-set))
437437 :: get our ships' current life
438438 ::
@@ -448,7 +448,7 @@
448448 +:(get-private-key-from-ring:detail secret-ring)
449449 :: get our ships' public key
450450 ::
451− =/ public-key=@uxpoint
451+ =/ public-key=@udpoint
452452 (ship-life-to-pubid:detail our now our our-life)
453453 ::
454454 :- participants.p
@@ -467,7 +467,7 @@
467467 |= [our=@p now=@da message=* =ring-signature]
468468 ^- ?
469469 ::
470− =/ keys=(set @uxpoint)
470+ =/ keys=(set @udpoint)
471471 %^ build-verifying-participants:detail our now
472472 ~(tap in participants.ring-signature)
473473 ::
base-desk/lib/shoe.hoon+19−28
@@ -13,8 +13,8 @@
1313/- *sole
1414/+ sole, auto=language-server-complete
1515|%
16−+$ state-2
17− $: %2
16++$ state-1
17+ $: %1
1818 soles=(map sole-id sole-share)
1919 ==
2020:: $card: standard gall cards plus shoe effects
@@ -147,7 +147,7 @@
147147++ agent
148148 |* command-type=mold
149149 |= =(shoe command-type)
150− =| state-2
150+ =| state-1
151151 =* state -
152152 ^- agent:gall
153153 =>
@@ -188,7 +188,7 @@
188188 =^ cards shoe on-init:og
189189 [(deal cards) this]
190190 ::
191− ++ on-save :(slop !>(%shoe-app) on-save:og !>(state))
191+ ++ on-save !>([%shoe-app on-save:og state])
192192 ::
193193 ++ on-load
194194 |= old-state=vase
@@ -201,32 +201,23 @@
201201 ?. ?=([%shoe-app ^] q.old-state)
202202 =^ cards shoe (on-load:og old-state)
203203 [(deal cards) this]
204− |^ :: versions %0 and %1 stored the inner state double-vased.
205− :: fixing this coincided with the 408 type-of-type migration.
206− ::
207− ?: ?=([%shoe-app * ?(%0 %1) *] q.old-state)
208− =| old-outer=state-any
209− =^ old-inner old-outer
210− +:!<([%shoe-app vase:h136 state-any] old-state)
211− =^ caz shoe (on-load:og (next-vase:h136 old-inner))
212− =^ cuz old-outer
213− ?. ?=(%0 -.old-outer) [~ old-outer]
214− (state-0-to-1 old-outer)
215− =? old-outer ?=(%1 -.old-outer) (state-1-to-2 old-outer)
216− ?> ?=(%2 -.old-outer)
217− [(weld cuz (deal caz)) this(state old-outer)]
218− ::
219− =+ !<(old=state-any (slot 7 old-state))
220− ?> ?=(%2 -.old)
221− =. state old
222− ::
223− =^ caz shoe (on-load:og (slot 6 old-state))
224− [(deal caz) this]
204+ |^ =| old-outer=state-any
205+ =^ old-inner old-outer
206+ +:!<([%shoe-app vase state-any] old-state)
207+ :: ~! q.old-state
208+ :: ?+ +>.q.old-state !!
209+ :: [%0 *] +:!<([%shoe-app vase state-0] old-state)
210+ :: [%1 *] +:!<([%shoe-app vase state-1] old-state)
211+ :: ==
212+ =^ caz shoe (on-load:og old-inner)
213+ =^ cuz old-outer
214+ ?. ?=(%0 -.old-outer) [~ old-outer]
215+ (state-0-to-1 old-outer)
216+ ?> ?=(%1 -.old-outer)
217+ [(weld cuz (deal caz)) this(state old-outer)]
225218 ::
226− +$ state-any $%(state-2 state-1 state-0)
227− +$ state-1 _%*(. *state-2 - %1)
219+ +$ state-any $%(state-1 state-0)
228220 +$ state-0 [%0 soles=(map @ta sole-share)]
229− ++ state-1-to-2 |=(old=state-1 old(- %2))
230221 ++ state-0-to-1
231222 |= old=state-0
232223 ^- (quip card:agent:gall state-1)
base-desk/lib/strandio.hoon+6−112
@@ -182,49 +182,16 @@
182182 `[%done ~]
183183 `[%fail %timer-error u.error.sign-arvo.u.in.tin]
184184 ==
185−++ take-whey
186− |= =wire
187− =/ m (strand ,[spar:ames fragment-size=@ud num-fragments=@ud])
188− ^- form:m
189− |= tin=strand-input:strand
190− ?+ in.tin `[%skip ~]
191− ~ `[%wait ~]
192− ::
193− [~ %sign * %ames %sage sage=*]
194− ?. =(wire wire.u.in.tin)
195− `[%skip ~]
196− =/ =sage:mess:ames sage.sign-arvo.u.in.tin
197− :^ ~ %done spar=p.sage
198− ?~ q.sage
199− [boq=13 tot=0]
200− =< [boq tot]
201− ;;([%whey boq=@ud tot=@ud] q.sage)
202− ==
203185::
204−++ take-sage
186+++ take-tune
205187 |= =wire
206− =/ m (strand ,sage:mess:ames)
188+ =/ m (strand ,[spar:ames (unit roar:ames)])
207189 ^- form:m
208190 |= tin=strand-input:strand
209191 ?+ in.tin `[%skip ~]
210192 ~ `[%wait ~]
211193 ::
212− [~ %sign * %ames %sage sage=*]
213− ?. =(wire wire.u.in.tin)
214− `[%skip ~]
215− `[%done sage.sign-arvo.u.in.tin]
216− ==
217−:: XX deprecate in 409k
218−::
219−++ take-near
220− |= =wire
221− =/ m (strand ,[spar:ames (unit (unit page))])
222− ^- form:m
223− |= tin=strand-input:strand
224− ?+ in.tin `[%skip ~]
225− ~ `[%wait ~]
226− ::
227− [~ %sign * %ames %near ^ *]
194+ [~ %sign * %ames %tune ^ *]
228195 ?. =(wire wire.u.in.tin)
229196 `[%skip ~]
230197 `[%done +>.sign-arvo.u.in.tin]
@@ -364,77 +331,11 @@
364331 ;< ~ bind:m (send-wait until)
365332 (take-wake `until)
366333::
367−++ mass
368− =/ m (strand ,(list quac:dill))
369− ^- form:m
370− =/ =card:agent:gall [%pass /mass %arvo %d %mass ~]
371− ;< ~ bind:m (send-raw-card card)
372− ;< quz=(list quac:dill) bind:m take-meme
373− (pure:m quz)
374−::
375−++ take-meme
376− =/ m (strand ,(list quac:dill))
377− ^- form:m
378− |= tin=strand-input:strand
379− ?+ in.tin `[%skip ~]
380− ~ `[%wait ~]
381− [~ %sign [%mass ~] %dill %meme *]
382− `[%done p.sign-arvo.u.in.tin]
383− ==
384−::
385334++ keen
386− |= [=wire =spar:ames sec=(unit [@ @])]
387− =/ m (strand ,~)
388− ^- form:m
389− (send-raw-card %pass wire %arvo %a %keen sec spar)
390−::
391−++ chum
392− |= [=wire =spar:ames]
393− =/ m (strand ,~)
394− ^- form:m
395− (send-raw-card %pass wire %arvo %a %chum spar)
396−::
397−++ keen-shut
398− |= [=wire =spar:ames]
399− =/ m (strand ,~)
400− ^- form:m
401− (send-raw-card %pass wire %keen & spar)
402−::
403−++ yawn
404− |= [=wire =spar:ames]
405− =/ m (strand ,~)
406− ^- form:m
407− (send-raw-card %pass wire %arvo %a %yawn spar)
408−::
409−++ whey
410− |= [=wire boq=@ud =spar:ames]
411− =/ m (strand ,~)
412− ^- form:m
413− :: encrypted using %chum namespace
414− ::
415− ;< our=@p bind:m get-our
416− =. path.spar
417− [%a %x '1' %$ %whey (scot %ud boq) (scot %p our) path.spar]
418− (chum wire spar)
419−::
420−++ meta
421335 |= [=wire =spar:ames]
422336 =/ m (strand ,~)
423337 ^- form:m
424− ?+ path.spar !!
425− $% [%ames bone=@ %cork ~]
426− [%ames bone=@ %sent seq=@ ~]
427− [%flow bone=@ =dire:ames %cork ~]
428− [?(%ames %flow) bone=@ =dire:ames ?(%sent %loads %naxp %acked) seq=@ ~]
429− ==
430− :: encrypted using %chum namespace
431− ::
432− ;< our=@p bind:m get-our
433− %- send-raw-card
434− :* %pass wire %arvo %a %chum
435− spar(path [%a %x '1' %$ %meta (scot %p our) path.spar])
436− ==
437− ==
338+ (send-raw-card %pass wire %arvo %a %keen spar)
438339::
439340++ sleep
440341 |= for=@dr
@@ -693,14 +594,6 @@
693594 (strand-fail %list-tree >arg< ~)
694595 (pure:m !<((list path) q.r.u.riot))
695596::
696−++ list-desk
697− |= [[=ship =desk =case] =spur]
698− =* arg +<
699− =/ m (strand arch)
700− ;< =riot:clay bind:m (warp ship desk ~ %sing %y case spur)
701− ?~ riot
702− (strand-fail %list-desk >arg< ~)
703− (pure:m !<(arch q.r.u.riot))
704597:: Take Clay read result
705598::
706599++ take-writ
@@ -909,10 +802,11 @@
909802 =/ poke-vase !>(`start-args:spider`[`tid.bowl `tid byk.bowl file args])
910803 ;< ~ bind:m (watch-our /awaiting/[tid] %spider /thread-result/[tid])
911804 ;< ~ bind:m (poke-our %spider %spider-start poke-vase)
805+ ;< ~ bind:m (sleep ~s0) :: wait for thread to start
912806 ;< =cage bind:m (take-fact /awaiting/[tid])
913807 ;< ~ bind:m (take-kick /awaiting/[tid])
914808 ?+ p.cage ~|([%strange-thread-result p.cage file tid] !!)
915809 %thread-done (pure:m %& q.cage)
916− %thread-fail (pure:m %| !<([term tang] q.cage))
810+ %thread-fail (pure:m %| ;;([term tang] q.q.cage))
917811 ==
918812--
base-desk/lib/test.hoon+1−22
@@ -40,7 +40,7 @@
4040 %| ~
4141 %& ['expected failure - succeeded' ~]
4242 ==
43−:: +expect-success: kicks a trap, expecting success; returns trace on failure
43+:: +expect-runs: kicks a trap, expecting success; returns trace on failure
4444::
4545++ expect-success
4646 |= a=(trap)
@@ -50,27 +50,6 @@
5050 %& ~
5151 %| ['expected success - failed' p.b]
5252 ==
53−::
54−:: +expect-fail-message: kicks a trap, expecting crash, compares the resulting error message
55−++ expect-fail-message
56− |= [msg=@t a=(trap)]
57− ^- tang
58− =/ b (mule a)
59− ?- -.b
60− %| |^
61− =/ =tang (flatten +.b)
62− ?: ?=(^ (find (trip msg) tang))
63− ~
64− ['expected error message - not found' ~]
65− ++ flatten
66− |= tang=(list tank)
67− =| res=tape
68− |- ^- tape
69− ?~ tang res
70− $(tang t.tang, res (weld ~(ram re i.tang) res))
71− --
72− %& ['expected failure - succeeded' ~]
73− ==
7453:: $a-test-chain: a sequence of tests to be run
7554::
7655:: NB: arms shouldn't start with `test-` so that `-test % ~` runs
base-desk/lib/verb.hoon+11−88
@@ -1,6 +1,6 @@
11:: Print what your agent is doing.
22::
3−/- *verb
3+/- verb
44::
55|= [loud=? =agent:gall]
66=| bowl-print=_|
@@ -14,10 +14,7 @@
1414 ^- (quip card:agent:gall agent:gall)
1515 %- (print bowl |.("{<dap.bowl>}: on-init"))
1616 =^ cards agent on-init:ag
17− :_ this
18− :_ :_ cards
19− (emit-event %on-init ~)
20− (emit-event-plus bowl [%on-init ~] cards)
17+ [[(emit-event %on-init ~) cards] this]
2118::
2219++ on-save
2320 ^- vase
@@ -29,10 +26,7 @@
2926 ^- (quip card:agent:gall agent:gall)
3027 %- (print bowl |.("{<dap.bowl>}: on-load"))
3128 =^ cards agent (on-load:ag old-state)
32− :_ this
33− :_ :_ cards
34− (emit-event %on-load ~)
35− (emit-event-plus bowl [%on-load ~] cards)
29+ [[(emit-event %on-load ~) cards] this]
3630::
3731++ on-poke
3832 |= [=mark =vase]
@@ -44,23 +38,17 @@
4438 %bowl `this(bowl-print !bowl-print)
4539 ==
4640 =^ cards agent (on-poke:ag mark vase)
47− :_ this
48− :_ :_ cards
49− (emit-event %on-poke mark)
50− (emit-event-plus bowl [%on-poke mark (mug q.vase)] cards)
41+ [[(emit-event %on-poke mark) cards] this]
5142::
5243++ on-watch
5344 |= =path
5445 ^- (quip card:agent:gall agent:gall)
5546 %- (print bowl |.("{<dap.bowl>}: on-watch on path {<path>}"))
5647 =^ cards agent
57− ?: ?=([%verb ?(%events %events-plus) ~] path)
48+ ?: ?=([%verb %events ~] path)
5849 [~ agent]
5950 (on-watch:ag path)
60− :_ this
61− :_ :_ cards
62− (emit-event %on-watch path)
63− (emit-event-plus bowl [%on-watch path] cards)
51+ [[(emit-event %on-watch path) cards] this]
6452::
6553++ on-leave
6654 |= =path
@@ -69,10 +57,7 @@
6957 ?: ?=([%verb %event ~] path)
7058 [~ this]
7159 =^ cards agent (on-leave:ag path)
72− :_ this
73− :_ :_ cards
74− (emit-event %on-leave path)
75− (emit-event-plus bowl [%on-leave path] cards)
60+ [[(emit-event %on-leave path) cards] this]
7661::
7762++ on-peek
7863 |= =path
@@ -85,17 +70,7 @@
8570 ^- (quip card:agent:gall agent:gall)
8671 %- (print bowl |.("{<dap.bowl>}: on-agent on wire {<wire>}, {<-.sign>}"))
8772 =^ cards agent (on-agent:ag wire sign)
88− :_ this
89− :_ :_ cards
90− (emit-event %on-agent wire -.sign)
91− =; =^sign
92− (emit-event-plus bowl [%on-agent wire sign] cards)
93− ?- -.sign
94− %poke-ack [%poke-ack ?=(~ p.sign)]
95− %watch-ack [%watch-ack ?=(~ p.sign)]
96− %kick [%kick ~]
97− %fact [%fact p.cage.sign (mug q.q.cage.sign)]
98− ==
73+ [[(emit-event %on-agent wire -.sign) cards] this]
9974::
10075++ on-arvo
10176 |= [=wire =sign-arvo]
@@ -103,20 +78,14 @@
10378 %- %+ print bowl |.
10479 "{<dap.bowl>}: on-arvo on wire {<wire>}, {<[- +<]:sign-arvo>}"
10580 =^ cards agent (on-arvo:ag wire sign-arvo)
106− :_ this
107− :_ :_ cards
108− (emit-event %on-arvo wire [- +<]:sign-arvo)
109− (emit-event-plus bowl [%on-arvo wire [- +<]:sign-arvo] cards)
81+ [[(emit-event %on-arvo wire [- +<]:sign-arvo) cards] this]
11082::
11183++ on-fail
11284 |= [=term =tang]
11385 ^- (quip card:agent:gall agent:gall)
11486 %- (print bowl |.("{<dap.bowl>}: on-fail with term {<term>}"))
11587 =^ cards agent (on-fail:ag term tang)
116− :_ this
117− :_ :_ cards
118− (emit-event %on-fail term)
119− (emit-event-plus bowl [%on-fail term] cards)
88+ [[(emit-event %on-fail term) cards] this]
12089--
12190::
12291++ print
@@ -130,53 +99,7 @@
13099 same
131100::
132101++ emit-event
133− |= =event
102+ |= =event:verb
134103 ^- card:agent:gall
135104 [%give %fact ~[/verb/events] %verb-event !>(event)]
136−::
137−++ emit-event-plus
138− |= [=bowl:gall =cause cards=(list card:agent:gall)]
139− ^- card:agent:gall
140− =; event=event-plus
141− [%give %fact ~[/verb/events-plus] %verb-event-plus !>(event)]
142− =- [act.bowl now.bowl src.bowl sap.bowl cause -]
143− %+ turn cards
144− |= =card:agent:gall
145− ^- effect
146− ::TODO for %fact, %kick, could calculate how many ships affected
147− ?- card
148− [%pass * %agent * ?(%poke %poke-as) *]
149− =, q.card
150− =/ =cage ?-(-.task.q.card %poke cage.task, %poke-as [mark.task q.cage.task])
151− [%poke p.card [ship name] p.cage `@`(mug q.q.cage)]
152− ::
153− [%pass * %agent * ?(%watch %watch-as) *]
154− =, q.card
155− =/ =path ?-(-.task.q.card %watch path.task, %watch-as path.task)
156− [%watch p.card [ship name] path]
157− ::
158− [%pass * %agent * %leave *]
159− =, q.card
160− [%leave p.card [ship name]]
161− ::
162− [%give %fact *]
163− =, p.card
164− [%fact paths p.cage (mug q.q.cage)]
165− ::
166− [%give %kick *]
167− [%kick paths.p.card]
168− ::
169− [%give ?(%poke-ack %watch-ack) *]
170− ~| %explicit-ack
171− !! :: shouldn't be given explicitly
172− ::
173− [%pass * %arvo *]
174− [%arvo p.card -.q.card +<.q.card]
175− ::
176− [%pass *]
177− [%arvo p.card %$ -.q.card]
178− ::
179− [%slip *]
180− $(card [%pass //slip p.card])
181− ==
182105--
base-desk/mar/css.hoon+5−9
@@ -6,15 +6,11 @@
66=, mimes:html
77|_ mud=@t
88++ grow :: convert to
9− |%
10− ++ mime [/text/css (as-octs mud)] :: convert to %mime
11− ++ hymn :: convert to %hymn
12− |^ html
13− ++ style ;style
14− ;- (trip mud)
15− ==
16− ++ html ;html:(head:"{style}" body)
17− --
9+ |% ++ mime [/text/css (as-octs mud)] :: convert to %mime
10+ ++ elem ;style :: convert to %hymn
11+ ;- (trip mud)
12+ ==
13+ ++ hymn ;html:(head:"{elem}" body)
1814 --
1915++ grab
2016 |% :: convert from
base-desk/mar/hoon.hoon+31−285
@@ -1,295 +1,41 @@
1+:::: /hoon/hoon/mar
2+ ::
3+/? 310
4+::
5+=, eyre
16|_ own=@t
27::
38++ grow :: convert to
49 |%
510 ++ mime `^mime`[/text/x-hoon (as-octs:mimes:html own)] :: convert to %mime
11+ ++ elem :: convert to %html
12+ ;div:pre(urb_codemirror "", mode "hoon"):"{(trip own)}"
13+ :: =+ gen-id="src-{<`@ui`(mug own)>}"
14+ :: ;div
15+ :: ;textarea(id "{gen-id}"):"{(trip own)}"
16+ :: ;script:"""
17+ :: CodeMirror.fromTextArea(
18+ :: window[{<gen-id>}],
19+ :: \{lineNumbers:true, readOnly:true}
20+ :: )
21+ :: """
22+ :: ==
623 ++ hymn
7− ^- manx
8− =/ to-wall
9− |= =tape
10− ^- wall
11− %+ roll (flop tape)
12− |= [char=@tD =wall]
13− ?~ wall
14− [[char ~] ~]
15− ?: =('\0a' char)
16− [~ wall]
17− [[char i.wall] t.wall]
18− ::
19− =/ src=tape (trip own)
20− =/ count=@ud (lent (to-wall src))
21− =; [style=tape script=tape]
22− ;html
23− ;head
24− ;title: source
25− ;meta(charset "utf-8");
26− ;meta(name "viewport", content "width=device-width, initial-scale=1");
27− ;style: {style}
28− ==
29− ;body
30− ;div.viewer
31− :: ;div.viewer-bar
32− :: ;span.viewer-name: {(scow %ud count)} lines
33− :: ;button.copy-link(id "copy-link", hidden ""): copy link
34− :: ==
35− ;div.code
36− ;pre.gutter(id "gutter");
37− ;div.code-body
38− ;div(id "hl");
39− ;pre.code-pre(id "code"): {src}
40− ==
41− ==
42− ==
43− ;script: {script}
44− ==
24+ :: ;html:(head:title:"Source" "+{elem}")
25+ ;html
26+ ;head
27+ ;title:"Source"
28+ ;script@"//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js";
29+ ;script@"/lib/syntax/hoon.js";
30+ ;link(rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/".
31+ "codemirror/4.3.0/codemirror.min.css");
32+ ;link/"/lib/syntax/codemirror.css"(rel "stylesheet");
33+ ==
34+ ;body
35+ ;textarea#src:"{(trip own)}"
36+ ;script:'CodeMirror.fromTextArea(src, {lineNumbers:true, readOnly:true})'
4537 ==
46− ::
47− :-
48− ^~ ^= style
49− ^- tape
50− %- trip
51− '''
52− :root {
53− --bg: #fbfbf9;
54− --panel: #ffffff;
55− --gutter-bg: #f3f3ef;
56− --line: #e4e4dd;
57− --fg: #2b2b2b;
58− --fg-dim: #9a9a90;
59− --sel: #fff7d6;
60− --sel-edge: #f1e4a8;
61− --accent: #4a6da7;
62− --lh: 20px;
63− --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
64− "Liberation Mono", "Courier New", monospace;
65− }
66− * { box-sizing: border-box; }
67− html, body {
68− margin: 0;
69− height: 100%;
70− background: var(--bg);
71− color: var(--fg);
72− font-family: var(--mono);
73− -webkit-font-smoothing: antialiased;
74− }
75− .viewer {
76− height: 100vh;
77− display: flex;
78− flex-direction: column;
79− padding: 16px;
80− gap: 12px;
81− }
82− .viewer-bar {
83− flex: 0 0 auto;
84− display: flex;
85− align-items: center;
86− gap: 12px;
87− font-size: 13px;
88− color: var(--fg-dim);
89− }
90− .viewer-name {
91− flex: 1 1 auto;
92− min-width: 0;
93− overflow: hidden;
94− text-overflow: ellipsis;
95− white-space: nowrap;
96− color: var(--fg);
97− }
98− .copy-link {
99− flex: 0 0 auto;
100− padding: 4px 12px;
101− border: 1px solid var(--line);
102− border-radius: 6px;
103− background: var(--panel);
104− color: var(--fg-dim);
105− font: inherit;
106− font-size: 12px;
107− cursor: pointer;
108− transition: color .12s, border-color .12s;
109− }
110− .copy-link:hover { color: var(--accent); border-color: var(--accent); }
111− .copy-link[hidden] { display: none; }
112− .code {
113− flex: 1 1 auto;
114− min-height: 0;
115− display: flex;
116− align-items: flex-start;
117− overflow: auto;
118− background: var(--panel);
119− border: 1px solid var(--line);
120− border-radius: 8px;
121− }
122− .code-body {
123− position: relative;
124− flex: 1 1 auto;
125− min-width: 0;
126− width: max-content;
127− }
128− #gutter, #code {
129− margin: 0;
130− padding: 14px 0;
131− font-family: var(--mono);
132− font-size: 13px;
133− line-height: var(--lh);
134− white-space: pre;
135− tab-size: 2;
136− }
137− #gutter {
138− position: sticky;
139− left: 0;
140− z-index: 2;
141− flex: 0 0 auto;
142− padding-left: 16px;
143− padding-right: 12px;
144− text-align: right;
145− color: var(--fg-dim);
146− background: var(--gutter-bg);
147− border-right: 1px solid var(--line);
148− user-select: none;
149− -webkit-user-select: none;
150− cursor: pointer;
151− }
152− #code {
153− display: block;
154− padding-left: 14px;
155− padding-right: 18px;
156− color: var(--fg);
157− }
158− #hl {
159− position: absolute;
160− left: 0;
161− right: 0;
162− z-index: 0; /* under the text */
163− display: none;
164− background: var(--sel);
165− box-shadow: inset 2px 0 0 var(--sel-edge);
166− pointer-events: none;
167− }
168− #code { position: relative; z-index: 1; } /* text above the bar */
169− :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
170− '''
171− ^~ ^= code
172− ^- tape
173− %- trip
174− '''
175− (function () {
176− "use strict";
177− const panel = document.querySelector(".code"); // the scroll container
178− const code = document.getElementById("code");
179− const gutter = document.getElementById("gutter");
180− const hl = document.getElementById("hl");
181− if (!panel || !code || !gutter || !hl) return;
182− const text = code.textContent;
183− let lineCount = text.length ? text.split("\n").length : 1;
184− if (text.endsWith("\n")) lineCount -= 1;
185− if (lineCount < 1) lineCount = 1;
186− (function fillGutter() {
187− let s = "";
188− for (let i = 1; i <= lineCount; i++) s += i + "\n";
189− gutter.textContent = s;
190− })();
191− let lineH = 0;
192− let codeTop = 0; // code's content-box top padding, the y-origin of line 1
193− function measure() {
194− const cs = getComputedStyle(code);
195− const lh = parseFloat(cs.lineHeight);
196− lineH = isNaN(lh) ? parseFloat(cs.fontSize) * 1.55 : lh;
197− codeTop = parseFloat(cs.paddingTop) || 0;
198− positionHighlight(); // keep the bar correct after a re-measure
199− }
200− let anchor = null;
201− let selLo = 0;
202− let selHi = 0;
203− function positionHighlight() {
204− if (!selLo) { hl.style.display = "none"; return; }
205− hl.style.display = "block";
206− hl.style.top = (codeTop + (selLo - 1) * lineH) + "px";
207− hl.style.height = ((selHi - selLo + 1) * lineH) + "px";
208− }
209− function applySel(lo, hi) {
210− selLo = lo;
211− selHi = hi;
212− positionHighlight();
213− }
214− function deselect() {
215− selLo = selHi = 0;
216− anchor = null;
217− positionHighlight();
218− history.replaceState(null, "", location.pathname + location.search);
219− }
220− function parseHash(hash) {
221− const m = /^#L(\d+)(?:-L(\d+))?$/.exec(hash || "");
222− if (!m) return null;
223− let lo = parseInt(m[1], 10);
224− let hi = m[2] ? parseInt(m[2], 10) : lo;
225− if (hi < lo) { const t = lo; lo = hi; hi = t; }
226− lo = Math.max(1, Math.min(lo, lineCount));
227− hi = Math.max(1, Math.min(hi, lineCount));
228− return [lo, hi];
229− }
230− function setHash(lo, hi) {
231− const frag = lo === hi ? "L" + lo : "L" + lo + "-L" + hi;
232− history.replaceState(null, "", "#" + frag);
233− }
234− function scrollToLine(n) {
235− const y = codeTop + (n - 1) * lineH;
236− if (y < panel.scrollTop || y > panel.scrollTop + panel.clientHeight) {
237− panel.scrollTop = Math.max(0, y - panel.clientHeight / 2);
238− }
239− }
240− function selectFromHash(scroll) {
241− const r = parseHash(location.hash);
242− if (!r) return false;
243− anchor = r[0];
244− applySel(r[0], r[1]);
245− if (scroll) scrollToLine(r[0]);
246− return true;
247− }
248− function lineFromEvent(e) {
249− // y within the code content: pointer relative to the code pre's rendered
250− // top, which already accounts for scroll since getBoundingClientRect is
251− // viewport-relative and the pre moves as the panel scrolls.
252− const rect = code.getBoundingClientRect();
253− const y = e.clientY - rect.top - codeTop;
254− let n = Math.floor(y / lineH) + 1;
255− if (n < 1) n = 1;
256− if (n > lineCount) n = lineCount;
257− return n;
258− }
259− function onClick(e) {
260− const inGutter = e.target === gutter;
261− if (!inGutter && !e.shiftKey) return; // normal text interaction in code
262− const n = lineFromEvent(e);
263− if (!e.shiftKey && selLo === n && selHi === n) {
264− deselect();
265− return;
266− }
267− if (e.shiftKey && anchor !== null) {
268− applySel(Math.min(anchor, n), Math.max(anchor, n));
269− setHash(selLo, selHi);
270− } else {
271− anchor = n;
272− applySel(n, n);
273− setHash(n, n);
274− }
275− }
276− gutter.addEventListener("click", onClick);
277− code.addEventListener("click", onClick);
278− document.addEventListener("keydown", function (e) {
279− if (e.key === "Escape") deselect();
280− });
281− window.addEventListener("hashchange", function () {
282− if (!selectFromHash(true)) deselect();
283− });
284− let rz = null;
285− window.addEventListener("resize", function () {
286− clearTimeout(rz);
287− rz = setTimeout(measure, 100);
288− });
289− measure();
290− selectFromHash(true);
291− })();
292− '''
38+ ==
29339 ++ txt
29440 (to-wain:format own)
29541 --
base-desk/mar/htm.hoon+11−2
@@ -2,5 +2,14 @@
22:::: /hoon/htm/mar
33 ::
44/? 310
5−/= htm /mar/html
6−htm
5+|_ own=manx
6+::
7+++ grad %noun
8+++ grow :: convert to
9+ |%
10+ ++ noun own
11+ ++ hymn own
12+ --
13+++ grab |% :: convert from
14+ ++ noun manx :: clam from %noun
15+-- --
base-desk/mar/js.hoon+4−7
@@ -8,13 +8,10 @@
88++ grow
99 |%
1010 ++ mime [/application/javascript (as-octs:mimes:html (@t mud))]
11− ++ hymn :: convert to %hymn
12− |^ html
13− ++ script ;script
14− ;- (trip (@t mud))
15− ==
16− ++ html ;html:(head:"{script}" body)
17− --
11+ ++ elem ;script
12+ ;- (trip (@t mud))
13+ ==
14+ ++ hymn ;html:(head:"+{elem}" body)
1815 --
1916++ grab
2017 |% :: convert from
base-desk/mar/noun.hoon−3
@@ -8,9 +8,6 @@
88++ grab |%
99 ++ noun *
1010 --
11−++ grow |%
12− ++ mime [/application/x-urb-jam (as-octs:mimes:html (jam non))]
13− --
1411++ grad
1512 |%
1613 ++ form %noun
base-desk/mar/story.hoon+10−5
@@ -46,13 +46,18 @@
4646 [/text/x-urb-story (as-octs:mimes:html (of-wain:format txt))]
4747 ++ txt
4848 ^- wain
49− %- zing
50− %+ join `wain`~['---']
49+ %- snoc :_ '' :: ensures terminating newline is present
5150 %+ murn ~(tap by tale)
52− |= [=tako:clay =proses]
53− ^- (unit wain)
51+ |= [[=tako:clay =proses]]
52+ ^- (unit cord)
5453 ?~ proses ~
55− (some (chapter-to-text tako proses))
54+ %- some
55+ %- crip
56+ ;: welp
57+ (tako-to-text tako)
58+ (proses-to-text proses)
59+ "---"
60+ ==
5661 --
5762++ grab
5863 |% :: convert from
base-desk/mar/tang.hoon+5−5
@@ -16,15 +16,15 @@
1616 %& a+p.result
1717 %| a+[a+[%s '[[output rendering error]]']~]~
1818 ==
19− ++ txt
20− ^- wain
21− %+ turn (flop tan)
22− |=(=tank (crip ~(ram re tank)))
19+ ::
20+ ++ elem
21+ =- ;pre:code:"{(of-wall -)}"
22+ ^- wall %- zing ^- (list wall)
23+ (turn (flop tan) |=(a=tank (wash 0^160 a)))
2324 --
2425++ grab :: convert from
2526 |%
2627 ++ noun (list ^tank) :: clam from %noun
2728 ++ tank |=(a=^tank [a]~)
28− ++ txt |=(=wain (flop (turn wain tank)))
2929 --
3030--
base-desk/mar/thread-fail.hoon+1−1
@@ -1,4 +1,4 @@
1−|_ err=[term tang]
1+|_ err=*
22++ grab
33 |%
44 ++ noun (pair term tang)
base-desk/mar/txt.hoon+1
@@ -18,6 +18,7 @@
1818 => v=.
1919 |%
2020 ++ mime => v [/text/plain (as-octs (of-wain txt))]
21+ ++ elem => v ;pre: {(trip (of-wain txt))}
2122 --
2223++ grad
2324 |%
base-desk/mar/udon.hoon+4
@@ -9,6 +9,10 @@
99 ++ mime [/text/x-unmark (as-octs:mimes:html mud)]
1010 ++ txt
1111 (to-wain:format mud)
12+ ++ elem
13+ ^- manx
14+ =, cram
15+ elm:(static (ream mud))
1216 ++ front :: XX performance, types
1317 ^- (map term knot)
1418 %- ~(run by inf:(static:cram (ream mud)))
base-desk/mar/umd.hoon+4
@@ -9,6 +9,10 @@
99 ++ mime [/text/x-unmark (as-octs:mimes:html mud)]
1010 ++ txt
1111 (to-wain:format mud)
12+ ++ elem
13+ ^- manx
14+ =, cram
15+ elm:(static (ream mud))
1216 ++ front :: XX performance, types
1317 ^- (map term knot)
1418 %- ~(run by inf:(static:cram (ream mud)))
base-desk/mar/urb.hoon+1−1
@@ -1,5 +1,5 @@
11::
2−:::: /hoon/urb/mar
2+:::: /hoon/elem/urb/mar
33 ::
44/? 310
55=, mimes:html
base-desk/sources.txt+3−2
@@ -1,3 +1,4 @@
11urbit-src/pkg/base-dev
2−urbit-src/pkg/landscape
3−urbit-src/pkg/arvo
2+urbit-src/pkg/garden-dev
3+urbit-src/pkg/arvo/lib/naive
4+urbit-src/pkg/arvo/lib/tiny
base-desk/sur/aquarium.hoon+5−8
@@ -10,6 +10,8 @@
1010:: Short names are simply the first letter of each word plus `s` if
1111:: it's a list.
1212::
13+/+ pill
14+=, pill-lib=pill
1315|%
1416+$ az-log [topics=(lest @) data=@t]
1517+$ az-state
@@ -32,13 +34,14 @@
3234 [%verb p=(unit ?)]
3335 task-arvo
3436 ==
37++$ pill pill:pill-lib
3538::
3639+$ aqua-event
37− $% [%init-ship who=ship fake=? feed=(unit feed:jael)]
40+ $% [%init-ship who=ship fake=?]
3841 [%pause-events who=ship]
3942 [%snap-ships lab=term hers=(list ship)]
4043 [%restore-snap lab=term]
41− [%read [from=[=ship life=@ubC] =path] for=[=lane:ames life=@ubC] num=@ud]
44+ [%read [from=ship =path] [for=lane:ames num=@ud]]
4245 [%event who=ship ue=unix-event]
4346 ==
4447::
@@ -71,9 +74,6 @@
7174 %+ pair wire
7275 $% [%blit p=(list blit:dill)]
7376 [%send p=lane:ames q=@]
74− [%push p=(list lane:pact:ames) q=@]
75− [%saxo sponsors=(list ship)]
76− [%nail =ship lanes=(list lane:ames)]
7777 [%doze p=(unit @da)]
7878 [%thus p=@ud q=(unit hiss:eyre)]
7979 [%ergo p=@tas q=mode:clay]
@@ -82,8 +82,5 @@
8282 [%kill ~]
8383 [%init ~]
8484 [%request id=@ud request=request:http]
85− [%turf p=(list turf)]
86− [%unto =unto:gall] :: internal gifts to host ships
87− :: (%facts are transformed to %raw-facts)
8885 ==
8986--
base-desk/sur/hood.hoon+98−202
@@ -10,41 +10,12 @@
1010 ==
1111::
1212+$ pikes (map desk pike)
13−:: $jump: changes to update source change requests
1413::
15−+$ jump
16− $% [%all all=(map dock dock)] :: pending requests
17− [%add old=dock new=dock] :: new request
18− [%yea old=dock new=dock] :: approved
19− [%nay old=dock new=dock] :: denied
20− ==
2114:: $rung: reference to upstream commit
2215::
2316+$ rung [=aeon =weft]
24−:: #sync-record: source and destination of a kiln sync
25−::
26−+$ sync-record ::
27− $: syd=desk :: local desk
28− her=ship :: foreign ship
29− sud=desk :: foreign desk
30− ==
31−::
32−+$ sync-state ::
33− $: nun=@ta :: nonce
34− kid=(unit desk) :: has kids desk too?
35− let=@ud :: next revision
36− nit=(unit ?) :: automerge or default
37− hav=(unit @ud) :: update available
38− yea=? :: update approved
39− ==
40−::
41−+$ sync-update
42− $% [%new for=sync-record rev=@ud]
43− [%done for=sync-record rev=@ud]
44− [%drop for=sync-record rev=@ud]
45− [%pending pending=(set [for=sync-record rev=@ud])]
46− ==
4717::
18++$ sync-state [nun=@ta kid=(unit desk) let=@ud]
4819+$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud])
4920:: +truncate-hash: get last 5 digits of hash and convert to tape
5021::
@@ -59,7 +30,7 @@
5930 =/ ego (scot %p our)
6031 =/ wen (scot %da now)
6132 :* .^(rock:tire %cx /[ego]//[wen]/tire)
62− .^(cone %cx /[ego]//[wen]/domes)
33+ .^(=cone %cx /[ego]//[wen]/domes)
6334 .^((map desk [ship desk]) %gx /[ego]/hood/[wen]/kiln/sources/noun)
6435 .^ (map [desk ship desk] sync-state) %gx
6536 /[ego]/hood/[wen]/kiln/syncs/noun
@@ -72,73 +43,43 @@
7243 ^- tang
7344 =/ ego (scot %p our)
7445 =/ wen (scot %da now)
75− =+ prep=[tyr cone sor zyn]=(report-prep our now)
76− ?: =(%$ filt)
46+ =/ prep (report-prep our now)
47+ ?~ filt
7748 %- zing
78− %+ turn
79− ?^ desks
80− (flop desks)
81− %+ sort ~(tap in ~(key by tyr.prep))
82− |= [a=desk b=desk]
83− ?: |(=(a %kids) =(b %base)) &
84− ?: |(=(a %base) =(b %kids)) |
85− (aor b a)
49+ %+ turn (flop desks)
8650 |=(syd=@tas (report-vat prep our now syd verb))
87− =/ deks=(list [=desk =zest wic=(set weft)])
51+ =/ deks
8852 ?~ desks
89− %+ sort ~(tap by tyr.prep)
90− |= [[a=desk *] [b=desk *]]
91− ?: |(=(a %kids) =(b %base)) &
92− ?: |(=(a %base) =(b %kids)) |
93− (aor b a)
94− %+ murn (flop desks)
95− |= des=desk
96− ^- (unit [=desk =zest wic=(set weft)])
97− ?~ got=(~(get by tyr.prep) des)
98− ~
99− `[des u.got]
53+ %+ sort
54+ (sort ~(tap in -.prep) |=([[a=@ *] b=@ *] !(aor a b)))
55+ |=([[a=@ *] [b=@ *]] ?|(=(a %kids) =(b %base)))
56+ %+ skip ~(tap in -.prep)
57+ |=([syd=@tas *] =(~ (find ~[syd] desks)))
10058 ?: =(filt %blocking)
101− =/ base-weft=(unit weft)
102− %- ~(rep in wic:(~(got by tyr.prep) %base))
103− |= [=weft out=(unit weft)]
104− ?~ out
105− `weft
106− ?: (lth num.weft num.u.out)
107− out
108− `weft
109− ?~ base-weft ~['%base already up-to-date']
59+ =/ base-wic
60+ %+ sort ~(tap by wic:(~(got by -.prep) %base))
61+ |=([[* a=@ud] [* b=@ud]] (gth a b))
62+ ?~ base-wic ~[leaf+"%base already up-to-date"]
11063 =/ blockers=(list desk)
111− %+ sort
112− ^- (list desk)
113− %+ murn deks
114− |= [=desk =zest wic=(set weft)]
115− ^- (unit ^desk)
116− ?. =(%live zest)
117− ~
118− ?: (~(has in wic) u.base-weft)
119− ~
120− `desk
121− aor
122− ?~ blockers ~['No desks blocking upgrade']
64+ %+ turn
65+ %+ skip ~(tap in -.prep)
66+ |= [* [zest=@tas wic=(set weft)]]
67+ ?. =(zest %live) &
68+ (~(has in wic) i.base-wic)
69+ |=([syd=desk *] syd)
70+ ?~ blockers ~[leaf+"No desks blocking upgrade, run |bump to apply"]
71+ :- [%rose [" %" "To unblock upgrade run |suspend %" ""] blockers]
12372 %- zing
124− ^- (list tang)
125− :- :~ %+ rap 3
126− :~ 'These desks are blocking upgrade to [%zuse '
127− (scot %ud num.u.base-weft)
128− ']:'
129− == ==
130− %+ turn blockers
73+ %+ turn (flop blockers)
13174 |=(syd=desk (report-vat prep our now syd verb))
13275 ::
13376 %- zing
13477 %+ turn
13578 ?+ filt !!
79+ ::
13680 %exists
13781 %+ skip deks
138− |= [syd=desk *]
139− ?~ got=(~(get by cone.prep) our syd)
140− &
141− =(0 let.u.got)
82+ |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0))
14283 ::
14384 %running
14485 %+ skim deks
@@ -149,152 +90,107 @@
14990 |= [syd=@tas [zest=@tas *]]
15091 ?| =(syd %kids)
15192 =(zest %live)
152− ?~ got=(~(get by cone.prep) our syd)
153− &
154− =(0 let.u.got)
93+ =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0)
15594 ==
15695 ::
15796 %exists-not
15897 %+ skim deks
159− |= [syd=desk *]
160− ?~ got=(~(get by cone.prep) our syd)
161− |
162− =(0 let.u.got)
98+ |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0))
16399 ==
164100 |=([syd=desk *] (report-vat prep our now syd verb))
165101:: +report-vat: report on a single desk installation
166102::
167103++ report-vat
168− |= $: $: tyr=rock:tire =cone sor=(map desk (pair ship desk))
104+ |= $: $: tyr=rock:tire =cone sor=(map desk [ship desk])
169105 zyn=(map [desk ship desk] sync-state)
170106 ==
171107 our=ship now=@da syd=desk verb=?
172108 ==
173− |^ ^- tang
109+ ^- tang
110+ =- :: hack to force wrapped rendering
111+ ::
112+ :: edg=6 empirically prevents dedent
113+ ::
114+ %+ roll
115+ (~(win re -) [0 6])
116+ |=([a=tape b=(list @t)] [(crip a) b])
117+ ::
118+ ^- tank
174119 =/ ego (scot %p our)
175120 =/ wen (scot %da now)
176− ?. ((sane %tas) syd)
177− ~[(cat 3 'insane desk: %' syd)]
178− ?. (~(has by cone) our syd)
179− ~[(cat 3 'desk does not yet exist: %' syd)]
180− =/ hash .^(@uv %cz /[ego]/[syd]/[wen])
121+ =+ .^(=cass %cw /[ego]/[syd]/[wen])
122+ ?: =(ud.cass 0)
123+ leaf+"desk does not yet exist: {<syd>}"
181124 ?: =(%kids syd)
182− ~[(cat 3 '%kids %cz hash: ' (scot %uv hash))]
183− =/ kel-path /[ego]/[syd]/[wen]/sys/kelvin
125+ =+ .^(hash=@uv %cz /[ego]/[syd]/[wen])
126+ leaf+"%kids %cz hash: {<hash>}"
127+ =/ kel-path
128+ /[ego]/[syd]/[wen]/sys/kelvin
184129 ?. .^(? %cu kel-path)
185− ~[(cat 3 'bad desk: %' syd)]
130+ leaf+"bad desk: {<syd>}"
186131 =+ .^(=waft %cx kel-path)
132+ :+ %rose ["" "{<syd>}" "::"]
187133 ^- tang
134+ =/ hash .^(@uv %cz /[ego]/[syd]/[wen])
188135 =/ =sink
189136 ?~ s=(~(get by sor) syd)
190137 ~
191138 ?~ z=(~(get by zyn) syd u.s)
192139 ~
193− `[p.u.s q.u.s [kid let]:u.z]
140+ `[-.u.s +.u.s +.u.z]
194141 =/ meb=(list @uv)
195− ?~ sink ~[hash]
196− %+ turn
197− .^ (list tako) %cs
198− /[ego]/[syd]/[wen]/base/(scot %p her.u.sink)/[sud.u.sink]
199− ==
200− |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
142+ ?~ sink [hash]~
143+ (mergebase-hashes our syd now her.u.sink sud.u.sink)
201144 =/ dek (~(got by tyr) syd)
202145 =/ sat
203146 ?- zest.dek
204− %live 'running'
205− %dead 'suspended'
206− %held 'suspended until next update'
147+ %live "running"
148+ %dead "suspended"
149+ %held "suspended until next update"
207150 ==
208− =/ kul=cord (print-wefts (waft-to-wefts waft))
209− =/ ese=cord
210− ?:(.^(? %cx /[ego]//[wen]/esse/[syd]) 'yes' 'no')
211− =/ pax=path /(scot %p our)/[syd]/(scot %da now)
151+ =/ kul=tape
152+ %+ roll
153+ %+ sort
154+ ~(tap in (waft-to-wefts:clay waft))
155+ |= [a=weft b=weft]
156+ ?: =(lal.a lal.b)
157+ (lte num.a num.b)
158+ (lte lal.a lal.b)
159+ |= [=weft =tape]
160+ (welp " {<[lal num]:weft>}" tape)
212161 ?. verb
213− :~ '::'
214− =+ .^(exist=? cu+(weld pax /desk/bill))
215− ?. exist ' /desk/bill: missing'
216− =+ .^(dudes=(list dude:gall) cx+(weld pax /desk/bill))
217− (cat 3 ' /desk/bill: ' (crip "{<dudes>}"))
218− (cat 3 ' pending updates: ' (print-wefts wic.dek))
219− (cat 3 ' source ship: ' ?~(sink '~' (scot %p her.u.sink)))
220− (cat 3 ' app status: ' sat)
221− (cat 3 ' essential desk: ' ese)
222− (cat 3 ' %cz hash ends in: ' (print-shorthash hash))
223− (cat 3 ' /sys/kelvin: ' (print-wefts (waft-to-wefts waft)))
224− (cat 3 '%' syd)
162+ =/ cut=(list tape) (turn meb truncate-hash)
163+ =/ len (lent cut)
164+ =/ base-hash
165+ ?: =(0 len) "~"
166+ ?: =(1 len) (head cut)
167+ "~[{`tape`(zing (join " " `(list tape)`cut))}]"
168+ :~ leaf/"/sys/kelvin: {kul}"
169+ leaf/"base hash ends in: {base-hash}"
170+ leaf/"%cz hash ends in: {(truncate-hash hash)}"
171+ leaf/"app status: {sat}"
172+ leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}"
225173 ==
226174 ::
227− =/ [on=(list @tas) of=(list @tas)]
228− =/ [on=(list @tas) of=(list @tas)]
229− %- ~(rep by ren:(~(got by cone) our syd))
230− |= [[=dude:gall is-on=?] on=(list @tas) of=(list @tas)]
231− ?: is-on
232− [[dude on] of]
233− [on [dude of]]
234− [(sort on aor) (sort of aor)]
235− :~ '::'
236− (cat 3 ' pending updates: ' (print-wefts wic.dek))
237− %^ cat 3 ' kids desk: ' ?~ sink '~'
238− ?~ kid.u.sink '~'
239− (cat 3 '%' u.kid.u.sink)
240− (cat 3 ' source aeon: ' ?~(sink '~' (scot %ud let.u.sink)))
241− (cat 3 ' source desk: ' ?~(sink '~' (cat 3 '%' sud.u.sink)))
242− (cat 3 ' source ship: ' ?~(sink '~' (scot %p her.u.sink)))
243− (cat 3 ' updates: ' ?~(sink 'local' 'remote'))
244− %^ cat 3 ' publishing ship: ' ?~ got=(get-publisher our syd now)
245− '~'
246− (scot %p u.got)
247− ::
248− (cat 3 ' force off: ' (print-agents of))
249− (cat 3 ' force on: ' (print-agents on))
250− (cat 3 ' app status: ' sat)
251− (cat 3 ' essential desk: ' ese)
252− ::
253− (cat 3 ' %cz hash: ' (scot %uv hash))
254− (cat 3 ' base hash: ' (print-mergebases meb))
255− (cat 3 ' /sys/kelvin: ' (print-wefts (waft-to-wefts waft)))
256− (cat 3 '%' syd)
175+ =/ [on=(list [@tas ?]) of=(list [@tas ?])]
176+ =/ =dome (~(got by cone) our syd)
177+ (skid ~(tap by ren.dome) |=([* ?] +<+))
178+ :~ leaf/"/sys/kelvin: {kul}"
179+ leaf/"base hash: {?.(=(1 (lent meb)) <meb> <(head meb)>)}"
180+ leaf/"%cz hash: {<hash>}"
181+ ::
182+ leaf/"app status: {sat}"
183+ leaf/"force on: {<(sort (turn on head) aor)>}"
184+ leaf/"force off: {<(sort (turn of head) aor)>}"
185+ ::
186+ leaf/"publishing ship: {?~(sink <~> <(get-publisher our syd now)>)}"
187+ leaf/"updates: {?~(sink "local" "remote")}"
188+ leaf/"source ship: {?~(sink <~> <her.u.sink>)}"
189+ leaf/"source desk: {?~(sink <~> <sud.u.sink>)}"
190+ leaf/"source aeon: {?~(sink <~> <let.u.sink>)}"
191+ leaf/"kids desk: {?~(sink <~> ?~(kid.u.sink <~> <u.kid.u.sink>))}"
192+ leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}"
257193 ==
258− ++ print-wefts
259− |= wefts=(set weft)
260− ^- @t
261− ?: =(~ wefts)
262− '~'
263− %+ roll (sort ~(tap in wefts) aor)
264− |= [=weft out=@t]
265− ?: =('' out)
266− (rap 3 '[%' lal.weft ' ' (scot %ud num.weft) ']' ~)
267− (rap 3 out ' [%' lal.weft ' ' (scot %ud num.weft) ']' ~)
268− ::
269− ++ print-shorthash
270− |= hash=@uv
271− ^- @t
272− (crip ((v-co:co 5) (end [0 25] hash)))
273− ::
274− ++ print-mergebases
275− |= hashes=(list @uv)
276− ^- @t
277− ?~ hashes
278− '~'
279− ?~ t.hashes
280− (scot %uv i.hashes)
281− %+ roll `(list @uv)`hashes
282− |= [hash=@uv out=@t]
283− ?: =('' out)
284− (print-shorthash hash)
285− (rap 3 out ' ' (print-shorthash hash) ~)
286− ::
287− ++ print-agents
288− |= agents=(list @tas)
289− ^- @t
290− ?~ agents
291− '~'
292− %+ roll `(list @tas)`agents
293− |= [agent=@tas out=@tas]
294− ?: =('' out)
295− (cat 3 '%' agent)
296− (rap 3 out ' %' agent ~)
297− --
298194:: +report-kids: non-vat cz hash report for kids desk
299195::
300196++ report-kids
@@ -304,9 +200,9 @@
304200 =/ ego (scot %p our)
305201 =/ wen (scot %da now)
306202 ?. (~(has in .^((set desk) %cd /[ego]//[wen])) syd)
307− 'no %kids desk'
203+ leaf/"no %kids desk"
308204 =+ .^(hash=@uv %cz /[ego]/[syd]/[wen])
309− (cat 3 '%kids %cz hash: ' (scot %uv hash))
205+ leaf/"%kids %cz hash: {<hash>}"
310206:: +read-bill-foreign: read /desk/bill from a foreign desk
311207::
312208++ read-bill-foreign
@@ -366,8 +262,8 @@
366262 =/ her (scot %p her)
367263 =/ ego (scot %p our)
368264 =/ wen (scot %da now)
369− %+ turn .^((list tako) %cs /[ego]/[syd]/[wen]/base/[her]/[sud])
370− |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
265+ %+ turn .^((list tako) %cs ~[ego syd wen %base her sud])
266+ |=(=tako .^(@uv %cs ~[ego syd wen %hash (scot %uv tako)]))
371267::
372268++ enjs
373269 =, enjs:format
base-desk/sur/ring.hoon+1−1
@@ -15,7 +15,7 @@
1515 :: resistance...but if your private keys are compromised, your
1616 :: adversary can determine which signatures you made.
1717 ::
18− y=(unit @uxpoint)
18+ y=(unit @udpoint)
1919 ==
2020:: +ring-signature: higher level ring signature type
2121::
base-desk/sur/spider.hoon+1−7
@@ -1,7 +1,7 @@
11/+ libstrand=strand
22=, strand=strand:libstrand
33|%
4−+$ thread $-(vase shed:khan)
4++$ thread $-(vase _*form:(strand ,vase))
55+$ input [=tid =cage]
66+$ tid tid:strand
77+$ bowl bowl:strand
@@ -18,10 +18,4 @@
1818 file=term
1919 =vase
2020 ==
21−+$ inline-args
22− $: parent=(unit tid)
23− use=(unit tid)
24− =beak
25− =shed:khan
26− ==
2721--
base-desk/sur/sss.hoon+8−4
@@ -10,21 +10,25 @@
1010 --
1111+$ aeon @ud
1212+$ dude dude:agent:gall
13++$ what ?(%rock %wave)
1314++ poke
1415 |%
1516 ++ request
1617 |* paths=mold
1718 $: path=paths
1819 =dude
20+ when=(unit aeon)
1921 ==
2022 ++ response
2123 |* [=(lake) paths=mold]
2224 $: path=paths
2325 =dude
24− $% [what=%tomb ~]
25− [what=%rock =aeon =rock:lake]
26− [what=%wave =aeon =wave:lake]
27− == ==
26+ =aeon
27+ $% [type=?(%nigh %yore %tomb) ~]
28+ $: type=%scry
29+ $% [what=%rock =rock:lake]
30+ [what=%wave =wave:lake]
31+ == == == ==
2832 ++ on-rock
2933 |* [=(lake) paths=mold]
3034 $: path=paths
base-desk/sur/verb.hoon+1−37
@@ -9,40 +9,4 @@
99 [%on-arvo =wire vane=term sign=term]
1010 [%on-fail =term]
1111 ==
12−::
13−+$ event-plus
14− $: act=@ud
15− now=@da
16− src=@p
17− sap=path
18− =cause
19− effects=(list effect)
20− ==
21−::
22−+$ cause
23− $% [%on-init ~]
24− [%on-load ~]
25− [%on-poke =mark mug=@ux]
26− [%on-watch =path]
27− [%on-leave =path]
28− [%on-agent =wire =sign]
29− [%on-arvo =wire vane=term sign=term]
30− [%on-fail =term]
31− ==
32−::
33−+$ sign
34− $% [%poke-ack ack=?]
35− [%watch-ack ack=?]
36− [%kick ~]
37− [%fact =mark mug=@ux]
38− ==
39−::
40−+$ effect
41− $% [%poke =wire =gill:gall =mark mug=@ux]
42− [%watch =wire =gill:gall =path]
43− [%leave =wire =gill:gall]
44− [%fact paths=(list path) =mark mug=@ux]
45− [%kick paths=(list path)]
46− [%arvo =wire vane=term task=term]
47− ==
48−--
12+--
bin/make_glob.pydeleted−208
@@ -1,208 +0,0 @@
1−#!/usr/bin/env python3
2−
3−import hashlib
4−import sys
5−from pathlib import Path
6−from urllib.parse import quote
7−
8−from noun import Cell, deep, intbytes, mug
9−
10−MIME_TYPES = {
11− "css": "text/css",
12− "gif": "image/gif",
13− "html": "text/html",
14− "ico": "image/x-icon",
15− "jpeg": "image/jpeg",
16− "jpg": "image/jpeg",
17− "js": "application/javascript",
18− "json": "application/json",
19− "png": "image/png",
20− "svg": "image/svg+xml",
21− "ttf": "font/ttf",
22− "webmanifest": "application/manifest+json",
23− "woff": "font/woff",
24− "woff2": "font/woff2",
25−}
26−BASE32 = "0123456789abcdefghijklmnopqrstuv"
27−
28−
29−class BitWriter:
30− def __init__(self):
31− self.output = bytearray()
32− self.buffer = 0
33− self.used = 0
34− self.cursor = 0
35−
36− def write(self, value, count):
37− if count == 0:
38− return
39− self.buffer |= value << self.used
40− self.used += count
41− self.cursor += count
42− byte_count = self.used // 8
43− if byte_count:
44− self.output.extend(self.buffer.to_bytes((self.used + 7) // 8, "little")[:byte_count])
45− self.buffer >>= byte_count * 8
46− self.used -= byte_count * 8
47−
48− def finish(self):
49− if self.used:
50− self.output.append(self.buffer)
51− self.buffer = 0
52− self.used = 0
53− return bytes(self.output)
54−
55−
56−def jam_bytes(value):
57− writer = BitWriter()
58− references = {}
59−
60− def save(noun):
61− references[noun] = writer.cursor
62−
63− def mat(atom):
64− if atom == 0:
65− writer.write(1, 1)
66− return
67− atom_length = atom.bit_length()
68− length_size = atom_length.bit_length()
69− writer.write(1 << length_size, length_size + 1)
70− writer.write(atom_length & ((1 << (length_size - 1)) - 1), length_size - 1)
71− writer.write(atom, atom_length)
72−
73− def back(reference):
74− writer.write(3, 2)
75− mat(reference)
76−
77− def serialize(noun):
78− duplicate = references.get(noun)
79− if deep(noun):
80− if duplicate is not None:
81− back(duplicate)
82− return
83− save(noun)
84− writer.write(1, 1)
85− writer.write(0, 1)
86− serialize(noun.head)
87− serialize(noun.tail)
88− return
89− if duplicate is not None:
90− atom_size = noun.bit_length()
91− reference_size = duplicate.bit_length()
92− if atom_size >= reference_size:
93− back(duplicate)
94− return
95− save(noun)
96− writer.write(0, 1)
97− mat(noun)
98−
99− serialize(value)
100− return writer.finish()
101−
102−
103−def cord(value):
104− return int.from_bytes(value.encode(), "little")
105−
106−
107−def path_noun(parts):
108− result = 0
109− for part in reversed(parts):
110− result = Cell(cord(part), result)
111− return result
112−
113−
114−def dor(a, b):
115− if a == b:
116− return True
117− if deep(a):
118− if not deep(b):
119− return False
120− if a.head == b.head:
121− return dor(a.tail, b.tail)
122− return dor(a.head, b.head)
123− if deep(b):
124− return True
125− return a < b
126−
127−
128−def gor(a, b):
129− a_mug = mug(a)
130− b_mug = mug(b)
131− return dor(a, b) if a_mug == b_mug else a_mug < b_mug
132−
133−
134−def map_put(tree, entry):
135− if tree == 0:
136− return Cell(entry, Cell(0, 0))
137− node = tree.head
138− if entry.head == node.head:
139− return Cell(entry, tree.tail)
140− left = tree.tail.head
141− right = tree.tail.tail
142− if gor(entry.head, node.head):
143− return Cell(node, Cell(map_put(left, entry), right))
144− return Cell(node, Cell(left, map_put(right, entry)))
145−
146−
147−def shas(salt, serialized):
148− value_hash = int.from_bytes(hashlib.sha256(serialized).digest(), "little")
149− length = max(32, len(intbytes(salt)))
150− digest = hashlib.sha256((salt ^ value_hash).to_bytes(length, "little")).digest()
151− return int.from_bytes(digest, "little")
152−
153−
154−def sham(serialized):
155− hashed = shas(cord("sham"), serialized)
156− mask = (1 << 128) - 1
157− return (hashed & mask) ^ (hashed >> 128)
158−
159−
160−def scow_uv(value):
161− if value == 0:
162− return "0v0"
163− digits = []
164− while value:
165− value, digit = divmod(value, 32)
166− digits.append(BASE32[digit])
167− digits = "".join(reversed(digits))
168− first_length = (len(digits) - 1) % 5 + 1
169− groups = [digits[:first_length]]
170− groups.extend(digits[i:i + 5] for i in range(first_length, len(digits), 5))
171− return "0v" + ".".join(groups)
172−
173−
174−def file_entry(root, file_path):
175− relative = file_path.relative_to(root)
176− parts = []
177− for part in relative.parts:
178− parts.extend(quote(segment, safe="-_~") for segment in part.split("."))
179− extension = relative.suffix.removeprefix(".").lower()
180− if extension not in MIME_TYPES:
181− raise ValueError(f"no MIME type configured for {relative}")
182− data = file_path.read_bytes()
183− mime = Cell(path_noun(MIME_TYPES[extension].split("/")), Cell(len(data), int.from_bytes(data, "little")))
184− return Cell(path_noun(parts), mime)
185−
186−
187−def make_glob(source, destination):
188− root = Path(source)
189− files = sorted((path for path in root.rglob("*") if path.is_file()), key=lambda path: path.as_posix())
190− if not (root / "index.html").is_file():
191− raise ValueError("glob source must contain index.html")
192− glob = 0
193− for file_path in files:
194− glob = map_put(glob, file_entry(root, file_path))
195− serialized = jam_bytes(glob)
196− glob_hash = scow_uv(sham(serialized))
197− output = Path(destination)
198− output.mkdir(parents=True, exist_ok=True)
199− filename = f"glob-{glob_hash}.glob"
200− (output / filename).write_bytes(serialized)
201− (output / "hash").write_text(glob_hash + "\n")
202− print(filename)
203−
204−
205−if __name__ == "__main__":
206− if len(sys.argv) != 3:
207− raise SystemExit(f"usage: {sys.argv[0]} SOURCE_DIRECTORY OUTPUT_DIRECTORY")
208− make_glob(sys.argv[1], sys.argv[2])
desk/sys.kelvin+2−1
@@ -1 +1,2 @@
1−[%zuse 408]
1+[%zuse 413]
2+[%zuse 412]
flake.lockdeleted−27
@@ -1,27 +0,0 @@
1−{
2− "nodes": {
3− "nixpkgs": {
4− "locked": {
5− "lastModified": 1793341285,
6− "narHash": "sha256-Y1CiZ4SoBUjLQyQM/pY+rS2dXD3CHLPstF0lmOc73D4=",
7− "owner": "NixOS",
8− "repo": "nixpkgs",
9− "rev": "1c89083e451e891152365b799595cf7790a43325",
10− "type": "github"
11− },
12− "original": {
13− "owner": "NixOS",
14− "ref": "nixos-unstable",
15− "repo": "nixpkgs",
16− "type": "github"
17− }
18− },
19− "root": {
20− "inputs": {
21− "nixpkgs": "nixpkgs"
22− }
23− }
24− },
25− "root": "root",
26− "version": 7
27−}
flake.nixdeleted−73
@@ -1,73 +0,0 @@
1−{
2− description = "Astrolabe Urbit desk";
3−
4− inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5−
6− outputs = { self, nixpkgs }:
7− let
8− systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
9− forAllSystems = nixpkgs.lib.genAttrs systems;
10− in
11− {
12− packages = forAllSystems (system:
13− let
14− pkgs = import nixpkgs { inherit system; };
15− nounPy = pkgs.fetchurl {
16− name = "noun.py";
17− url = "https://raw.githubusercontent.com/urbit/tools/f9cda82a7699cad0c1c0f8c031a59e93f028e548/pkg/pynoun/noun.py";
18− hash = "sha256-vSKQ/UuSmGTANfW5c3I9lQcUFycvqmu5gqysFuP5SAA=";
19− };
20− ui = pkgs.buildNpmPackage {
21− pname = "astrolabe-ui";
22− version = "0.3.0";
23− src = ./ui;
24− nodejs = pkgs.nodejs_22;
25− npmDepsHash = "sha256-jCkfgNgBmq0mKjmXBbPwdpzBR/E09OgS9XD6O9hRHfw=";
26− makeCacheWritable = true;
27− npmFlags = [ "--legacy-peer-deps" ];
28− npmBuildScript = "build";
29−
30− installPhase = ''
31− runHook preInstall
32− cp -r dist $out
33− runHook postInstall
34− '';
35− };
36− in
37− rec {
38− inherit ui;
39− desk = pkgs.stdenvNoCC.mkDerivation {
40− pname = "astrolabe-desk";
41− version = "1.0.7";
42− dontUnpack = true;
43− nativeBuildInputs = [ pkgs.rsync ];
44−
45− installPhase = ''
46− runHook preInstall
47− mkdir -p $out
48− rsync -r --copy-links --exclude-from=${./config/ignore_files_on_install.txt} ${./base-desk}/ $out/
49− rsync -r --copy-links --exclude-from=${./config/ignore_files_on_install.txt} ${./docs-dev-desk}/ $out/
50− rsync -r --copy-links --exclude-from=${./config/ignore_files_on_install.txt} ${./desk}/ $out/
51− runHook postInstall
52− '';
53− };
54− glob = pkgs.stdenvNoCC.mkDerivation {
55− pname = "astrolabe-glob";
56− version = "0.3.0";
57− dontUnpack = true;
58− nativeBuildInputs = [
59− (pkgs.python3.withPackages (ps: [ ps.mmh3 ps.bitstring ]))
60− ];
61−
62− installPhase = ''
63− runHook preInstall
64− mkdir -p $TMPDIR/pynoun
65− ln -s ${nounPy} $TMPDIR/pynoun/noun.py
66− PYTHONPATH=$TMPDIR/pynoun python ${./bin/make_glob.py} ${ui} $out
67− runHook postInstall
68− '';
69− };
70− default = desk;
71− });
72− };
73−}