@@ -1,147 +1,312 @@
2=* dude dude:gall
3=* dude dude:gall
4−:: $snap: kiln snapshot
5++$ pike
6+ $: sync=(unit [=ship =desk])
6−+$ snap (map desk arak)
12++$ pikes (map desk pike)
7−:: $diff: subscription update
13+:: $jump: changes to update source change requests
10− $% [%block =desk =arak =weft blockers=(set desk)]
16+ $% [%all all=(map dock dock)] :: pending requests
11− [%reset =desk =arak]
17+ [%add old=dock new=dock] :: new request
12− [%commit =desk =arak]
18+ [%yea old=dock new=dock] :: approved
13− [%merge-sunk =desk =arak =tang]
19+ [%nay old=dock new=dock] :: denied
14− [%merge-fail =desk =arak =tang]
15− [%suspend =desk =arak]
16− [%revive =desk =arak]
18−:: $arak: foreign vat tracker
21+:: $rung: reference to upstream commit
20−:: .rail: upstream tracking state, if any
23++$ rung [=aeon =weft]
21−:: .rein: configuration for agents
24+:: #sync-record: source and destination of a kiln sync
23−+$ arak
26++$ sync-record ::
24− $: rail=(unit rail)
27+ $: syd=desk :: local desk
25− =rein
28+ her=ship :: foreign ship
29+ sud=desk :: foreign desk
27−:: $rail: upstream tracking state
29−:: .publisher: Ship that originally published desk, if available
32++$ sync-state ::
30−:: .paused: is tracking paused? or live
33+ $: nun=@ta :: nonce
31−:: .ship: upstream ship (could be .our)
34+ kid=(unit desk) :: has kids desk too?
32−:: .desk: name of upstream desk
35+ let=@ud :: next revision
33−:: .aeon: next aeon to pull from upstream
36+ nit=(unit ?) :: automerge or default
34−:: .next: list of pending commits with future kelvins
37+ hav=(unit @ud) :: update available
38+ yea=? :: update approved
36−+$ rail
41++$ sync-update
37− $: publisher=(unit ship)
42+ $% [%new for=sync-record rev=@ud]
38− paused=?
43+ [%done for=sync-record rev=@ud]
39− =ship
44+ [%drop for=sync-record rev=@ud]
40− =desk
45+ [%pending pending=(set [for=sync-record rev=@ud])]
44−:: $rung: reference to upstream commit
46−+$ rung [=aeon =weft]
48++$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud])
47−:: $rein: diff from desk manifest
49+:: +truncate-hash: get last 5 digits of hash and convert to tape
49−:: .liv: suspended? if suspended, no agents should run
51+++ truncate-hash
50−:: .add: agents not in manifest that should be running
52+ |= hash=@uv
51−:: .sub: agents in manifest that should not be running
53+ ^- tape
54+ (slag 2 <`@uv`(mod hash 0v1.00000)>)
55+:: +report-prep: get data required for reports
53−+$ rein
57+++ report-prep
54− $: liv=_&
58+ |= [our=@p now=@da]
55− add=(set dude)
59+ =/ ego (scot %p our)
56− sub=(set dude)
60+ =/ wen (scot %da now)
61+ :* .^(rock:tire %cx /[ego]//[wen]/tire)
62+ .^(cone %cx /[ego]//[wen]/domes)
63+ .^((map desk [ship desk]) %gx /[ego]/hood/[wen]/kiln/sources/noun)
64+ .^ (map [desk ship desk] sync-state) %gx
65+ /[ego]/hood/[wen]/kiln/syncs/noun
59−+$ vat [=desk hash=@uv =cass =arak]
60:: +report-vats: report on all desk installations
68:: +report-vats: report on all desk installations
62++ report-vats
70++ report-vats
63− |= [our=@p now=@da]
71+ |= [our=@p now=@da desks=(list desk) filt=@tas verb=?]
65− =+ .^ raz=(list vat)
73+ =/ ego (scot %p our)
66− %gx /(scot %p our)/hood/(scot %da now)/kiln/vats/noun
74+ =/ wen (scot %da now)
75+ =+ prep=[tyr cone sor zyn]=(report-prep our now)
81+ %+ sort ~(tap in ~(key by tyr.prep))
83+ ?: |(=(a %kids) =(b %base)) &
84+ ?: |(=(a %base) =(b %kids)) |
86+ |=(syd=@tas (report-vat prep our now syd verb))
87+ =/ deks=(list [=desk =zest wic=(set weft)])
89+ %+ sort ~(tap by tyr.prep)
90+ |= [[a=desk *] [b=desk *]]
91+ ?: |(=(a %kids) =(b %base)) &
92+ ?: |(=(a %base) =(b %kids)) |
96+ ^- (unit [=desk =zest wic=(set weft)])
97+ ?~ got=(~(get by tyr.prep) des)
100+ ?: =(filt %blocking)
101+ =/ base-weft=(unit weft)
102+ %- ~(rep in wic:(~(got by tyr.prep) %base))
103+ |= [=weft out=(unit weft)]
106+ ?: (lth num.weft num.u.out)
109+ ?~ base-weft ~['%base already up-to-date']
110+ =/ blockers=(list desk)
114+ |= [=desk =zest wic=(set weft)]
118+ ?: (~(has in wic) u.base-weft)
122+ ?~ blockers ~['No desks blocking upgrade']
126+ :~ 'These desks are blocking upgrade to [%zuse '
127+ (scot %ud num.u.base-weft)
131+ |=(syd=desk (report-vat prep our now syd verb))
139+ ?~ got=(~(get by cone.prep) our syd)
145+ |=([* [zest=@tas *]] =(zest %live))
149+ |= [syd=@tas [zest=@tas *]]
152+ ?~ got=(~(get by cone.prep) our syd)
68− :- (report-kids our now)
156+ ::
160+ ?~ got=(~(get by cone.prep) our syd)
69− (turn raz |=(v=vat (report-vat our now v)))
164+ |=([syd=desk *] (report-vat prep our now syd verb))
70:: +report-vat: report on a single desk installation
165:: +report-vat: report on a single desk installation
72++ report-vat
167++ report-vat
168+ |= $: $: tyr=rock:tire =cone sor=(map desk (pair ship desk))
169+ zyn=(map [desk ship desk] sync-state)
73− |= [our=ship now=@da vat]
171+ our=ship now=@da syd=desk verb=?
75− ?: =(ud.cass 0)
173+ |^ ^- tang
174+ =/ ego (scot %p our)
175+ =/ wen (scot %da now)
176+ ?. ((sane %tas) syd)
177+ ~[(cat 3 'insane desk: %' syd)]
178+ ?. (~(has by cone) our syd)
76− leaf+"desk does not yet exist: {<desk>}"
179+ ~[(cat 3 'desk does not yet exist: %' syd)]
180+ =/ hash .^(@uv %cz /[ego]/[syd]/[wen])
182+ ~[(cat 3 '%kids %cz hash: ' (scot %uv hash))]
77− =/ kel-path
183+ =/ kel-path /[ego]/[syd]/[wen]/sys/kelvin
78− /(scot %p our)/[desk]/(scot %da now)/sys/kelvin
79 ?. .^(? %cu kel-path)
184 ?. .^(? %cu kel-path)
80− leaf+"bad desk: {<desk>}"
185+ ~[(cat 3 'bad desk: %' syd)]
81− =+ .^(=weft %cx kel-path)
186+ =+ .^(=waft %cx kel-path)
82− :+ %rose ["" "{<desk>}" "::"]
84− =/ meb (mergebase-hashes our desk now arak)
188+ =/ =sink
85− =/ poz
189+ ?~ s=(~(get by sor) syd)
86− ?~ rail.arak "local"
190+ ~
87− ?:(paused.u.rail.arak "paused" "tracking")
191+ ?~ z=(~(get by zyn) syd u.s)
88− =/ sat ?:(liv.rein.arak "running" "suspended")
192+ ~
89− =/ pen
193+ `[p.u.s q.u.s [kid let]:u.z]
90− ?~ rail.arak "~"
194+ =/ meb=(list @uv)
91− <(turn next.u.rail.arak |=([@ lal=@tas num=@] [lal num]))>
195+ ?~ sink ~[hash]
92− :~ leaf/"/sys/kelvin: {<[lal num]:weft>}"
196+ %+ turn
93− leaf/"base hash: {?.(=(1 (lent meb)) <meb> <(head meb)>)}"
197+ .^ (list tako) %cs
94− leaf/"%cz hash: {<hash>}"
198+ /[ego]/[syd]/[wen]/base/(scot %p her.u.sink)/[sud.u.sink]
96− leaf/"app status: {sat}"
200+ |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
97− leaf/"force on: {?:(=(~ add.rein.arak) "~" <add.rein.arak>)}"
201+ =/ dek (~(got by tyr) syd)
98− leaf/"force off: {?:(=(~ sub.rein.arak) "~" <sub.rein.arak>)}"
202+ =/ sat
206+ %held 'suspended until next update'
208+ =/ kul=cord (print-wefts (waft-to-wefts waft))
210+ ?:(.^(? %cx /[ego]//[wen]/esse/[syd]) 'yes' 'no')
211+ =/ pax=path /(scot %p our)/[syd]/(scot %da now)
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)))
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)]
234+ [(sort on aor) (sort of aor)]
236+ (cat 3 ' pending updates: ' (print-wefts wic.dek))
237+ %^ cat 3 ' kids desk: ' ?~ 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'))
100− leaf/"publishing ship: {?~(rail.arak <~> <publisher.u.rail.arak>)}"
244+ %^ cat 3 ' publishing ship: ' ?~ got=(get-publisher our syd now)
101− leaf/"updates: {poz}"
245+ '~'
102− leaf/"source ship: {?~(rail.arak <~> <ship.u.rail.arak>)}"
246+ (scot %p u.got)
103− leaf/"source desk: {?~(rail.arak <~> <desk.u.rail.arak>)}"
247+ ::
104− leaf/"source aeon: {?~(rail.arak <~> <aeon.u.rail.arak>)}"
248+ (cat 3 ' force off: ' (print-agents of))
105− leaf/"pending updates: {pen}"
249+ (cat 3 ' force on: ' (print-agents on))
250+ (cat 3 ' app status: ' sat)
251+ (cat 3 ' essential desk: ' ese)
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)))
263+ %+ roll (sort ~(tap in wefts) aor)
266+ (rap 3 '[%' lal.weft ' ' (scot %ud num.weft) ']' ~)
267+ (rap 3 out ' [%' lal.weft ' ' (scot %ud num.weft) ']' ~)
272+ (crip ((v-co:co 5) (end [0 25] hash)))
275+ |= hashes=(list @uv)
281+ %+ roll `(list @uv)`hashes
282+ |= [hash=@uv out=@t]
284+ (print-shorthash hash)
285+ (rap 3 out ' ' (print-shorthash hash) ~)
288+ |= agents=(list @tas)
292+ %+ roll `(list @tas)`agents
293+ |= [agent=@tas out=@tas]
296+ (rap 3 out ' %' agent ~)
107:: +report-kids: non-vat cz hash report for kids desk
298:: +report-kids: non-vat cz hash report for kids desk
109++ report-kids
300++ report-kids
110 |= [our=ship now=@da]
301 |= [our=ship now=@da]
112− =/ dek %kids
303+ =/ syd %kids
113 =/ ego (scot %p our)
304 =/ ego (scot %p our)
114 =/ wen (scot %da now)
305 =/ wen (scot %da now)
115− ?. (~(has in .^((set desk) %cd /[ego]//[wen])) dek)
306+ ?. (~(has in .^((set desk) %cd /[ego]//[wen])) syd)
116− leaf/"no %kids desk"
307+ 'no %kids desk'
117− =+ .^(hash=@uv %cz /[ego]/[dek]/[wen])
308+ =+ .^(hash=@uv %cz /[ego]/[syd]/[wen])
118− leaf/"%kids %cz hash: {<hash>}"
309+ (cat 3 '%kids %cz hash: ' (scot %uv hash))
119−:: +read-kelvin-foreign: read /sys/kelvin from a foreign desk
121−++ read-kelvin-foreign
122− |= [=ship =desk =aeon]
124− ~| read-foreign-kelvin/+<
125− =/ her (scot %p ship)
126− =/ syd (scot %tas desk)
127− =/ yon (scot %ud aeon)
129− =/ dom .^(dome cv/~[her syd yon])
130− =/ tak (scot %uv (~(got by hit.dom) let.dom))
131− =/ yak .^(yaki cs/~[her syd yon %yaki tak])
132− =/ lob (scot %uv (~(got by q.yak) /sys/kelvin))
133− =/ peg .^(page cs/~[her syd yon %blob lob])
135−:: +read-kelvin-local: read /sys/kelvin from a local desk
138− |= [our=ship =desk now=@da]
140− ~| read-kelvin-local+desk
141− =/ pax (en-beam [our desk da+now] /sys/kelvin)
145:: +read-bill-foreign: read /desk/bill from a foreign desk
310:: +read-bill-foreign: read /desk/bill from a foreign desk
147++ read-bill-foreign
312++ read-bill-foreign
@@ -152,7 +317,7 @@
152 =/ syd (scot %tas desk)
317 =/ syd (scot %tas desk)
153 =/ yon (scot %ud aeon)
318 =/ yon (scot %ud aeon)
155− =/ dom .^(dome cv/~[her syd yon])
320+ =/ dom .^(domo cv/~[her syd yon])
156 =/ tak ~| aeons=~(key by hit.dom)
321 =/ tak ~| aeons=~(key by hit.dom)
157 (scot %uv (~(got by hit.dom) aeon))
322 (scot %uv (~(got by hit.dom) aeon))
158 =/ yak .^(yaki cs/~[her syd yon %yaki tak])
323 =/ yak .^(yaki cs/~[her syd yon %yaki tak])
@@ -169,21 +334,6 @@
169 ?. .^(? cu/pax)
334 ?. .^(? cu/pax)
170 *(list dude)
335 *(list dude)
171 .^((list dude) cx/pax)
336 .^((list dude) cx/pax)
172−:: +adjust-dudes: which agents should be started and stopped
174−:: Will ask Gall to start agents that it's already running
175−:: but that should be ok, and might be safer in case other
176−:: unprocessed moves would have turned them off.
179− |= $: local=[our=ship =desk now=@da]
182− ^- [jolt=(list dude) idle=(list dude)]
183− =/ all=(list dude) (read-bill local)
184− =/ want (get-apps-want local all rein)
185− =/ have (get-apps-live local)
186− [want (skip have ~(has in (sy want)))]
188++ get-remote-diff
338++ get-remote-diff
189 |= [our=ship here=desk now=@da her=ship there=desk when=aeon]
339 |= [our=ship here=desk now=@da her=ship there=desk when=aeon]
@@ -209,39 +359,19 @@
209 |= [our=ship =desk now=@da]
359 |= [our=ship =desk now=@da]
210 ^- (list [=dude live=?])
360 ^- (list [=dude live=?])
211 %~ tap in
361 %~ tap in
212− .^((set [=dude live=?]) ge+/(scot %p our)/[desk]/(scot %da now))
362+ .^((set [=dude live=?]) ge+/(scot %p our)/[desk]/(scot %da now)/$)
213−:: +get-apps-want: find which apps should be running on a desk
216− |= [local=[our=ship =desk now=@da] duz=(list dude) =rein]
219− ?. |(=(`zuse+zuse (read-kelvin-local local)) =(%base desk.local)) ~
220− =. duz (skip duz ~(has in sub.rein))
221− =. duz (weld duz (skip ~(tap in add.rein) ~(has in (sy duz))))
224++ mergebase-hashes
364++ mergebase-hashes
225− |= [our=@p =desk now=@da =arak]
365+ |= [our=@p syd=desk now=@da her=ship sud=desk]
228− =/ her (scot %p ship.u.rail.arak)
366+ =/ her (scot %p her)
229 =/ ego (scot %p our)
367 =/ ego (scot %p our)
230 =/ wen (scot %da now)
368 =/ wen (scot %da now)
231− %+ turn .^((list tako) %cs ~[ego desk wen %base her desk.u.rail.arak])
369+ %+ turn .^((list tako) %cs /[ego]/[syd]/[wen]/base/[her]/[sud])
232− |=(=tako .^(@uv %cs ~[ego desk wen %hash (scot %uv tako)]))
370+ |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
235 =, enjs:format
373 =, enjs:format
@@ -254,15 +384,6 @@
254 da+(tim da.c)
384 da+(tim da.c)
261− hash+s+(scot %uv hash.v)
267 |= w=^weft
388 |= w=^weft
@@ -276,30 +397,5 @@
276 :~ aeon+(numb aeon.r)
397 :~ aeon+(numb aeon.r)
277 weft+(weft weft.r)
398 weft+(weft weft.r)
283− :~ add+a+(turn ~(tap in add.r) (lead %s))
284− sub+a+(turn ~(tap in sub.r) (lead %s))
290− :~ rail+?~(rail.a ~ (rail u.rail.a))
297− :~ ship+s+(scot %p ship.r)
298− publisher+?~(publisher.r ~ s+(scot %p u.publisher.r))
302− next+a+(turn next.r rung)