@@ -1,312 +1,147 @@
3=* dude dude:gall
2=* dude dude:gall
5−+$ pike
4+:: $snap: kiln snapshot
6− $: sync=(unit [=ship =desk])
12−+$ pikes (map desk pike)
6++$ snap (map desk arak)
13−:: $jump: changes to update source change requests
7+:: $diff: subscription update
16− $% [%all all=(map dock dock)] :: pending requests
10+ $% [%block =desk =arak =weft blockers=(set desk)]
17− [%add old=dock new=dock] :: new request
11+ [%reset =desk =arak]
18− [%yea old=dock new=dock] :: approved
12+ [%commit =desk =arak]
19− [%nay old=dock new=dock] :: denied
13+ [%merge-sunk =desk =arak =tang]
14+ [%merge-fail =desk =arak =tang]
15+ [%suspend =desk =arak]
16+ [%revive =desk =arak]
21−:: $rung: reference to upstream commit
18+:: $arak: foreign vat tracker
23−+$ rung [=aeon =weft]
20+:: .rail: upstream tracking state, if any
24−:: #sync-record: source and destination of a kiln sync
21+:: .rein: configuration for agents
26−+$ sync-record ::
23++$ arak
27− $: syd=desk :: local desk
24+ $: rail=(unit rail)
28− her=ship :: foreign ship
25+ =rein
29− sud=desk :: foreign desk
27+:: $rail: upstream tracking state
32−+$ sync-state ::
29+:: .publisher: Ship that originally published desk, if available
33− $: nun=@ta :: nonce
30+:: .paused: is tracking paused? or live
34− kid=(unit desk) :: has kids desk too?
31+:: .ship: upstream ship (could be .our)
35− let=@ud :: next revision
32+:: .desk: name of upstream desk
36− nit=(unit ?) :: automerge or default
33+:: .aeon: next aeon to pull from upstream
37− hav=(unit @ud) :: update available
34+:: .next: list of pending commits with future kelvins
38− yea=? :: update approved
41−+$ sync-update
36++$ rail
42− $% [%new for=sync-record rev=@ud]
37+ $: publisher=(unit ship)
43− [%done for=sync-record rev=@ud]
38+ paused=?
44− [%drop for=sync-record rev=@ud]
39+ =ship
45− [%pending pending=(set [for=sync-record rev=@ud])]
40+ =desk
44+:: $rung: reference to upstream commit
48−+$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud])
46++$ rung [=aeon =weft]
49−:: +truncate-hash: get last 5 digits of hash and convert to tape
47+:: $rein: diff from desk manifest
51−++ truncate-hash
49+:: .liv: suspended? if suspended, no agents should run
52− |= hash=@uv
50+:: .add: agents not in manifest that should be running
53− ^- tape
51+:: .sub: agents in manifest that should not be running
54− (slag 2 <`@uv`(mod hash 0v1.00000)>)
55−:: +report-prep: get data required for reports
57−++ report-prep
53++$ rein
58− |= [our=@p now=@da]
54+ $: liv=_&
59− =/ ego (scot %p our)
55+ add=(set dude)
60− =/ wen (scot %da now)
56+ sub=(set dude)
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]
68:: +report-vats: report on all desk installations
60:: +report-vats: report on all desk installations
70++ report-vats
62++ report-vats
71− |= [our=@p now=@da desks=(list desk) filt=@tas verb=?]
63+ |= [our=@p now=@da]
73− =/ ego (scot %p our)
65+ =+ .^ raz=(list vat)
74− =/ wen (scot %da now)
66+ %gx /(scot %p our)/hood/(scot %da now)/kiln/vats/noun
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)
156− ::
68+ :- (report-kids our now)
160− ?~ got=(~(get by cone.prep) our syd)
164− |=([syd=desk *] (report-vat prep our now syd verb))
69+ (turn raz |=(v=vat (report-vat our now v)))
165:: +report-vat: report on a single desk installation
70:: +report-vat: report on a single desk installation
167++ report-vat
72++ report-vat
168− |= $: $: tyr=rock:tire =cone sor=(map desk (pair ship desk))
169− zyn=(map [desk ship desk] sync-state)
171− our=ship now=@da syd=desk verb=?
73+ |= [our=ship now=@da vat]
173− |^ ^- tang
75+ ?: =(ud.cass 0)
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)
179− ~[(cat 3 'desk does not yet exist: %' syd)]
76+ leaf+"desk does not yet exist: {<desk>}"
180− =/ hash .^(@uv %cz /[ego]/[syd]/[wen])
182− ~[(cat 3 '%kids %cz hash: ' (scot %uv hash))]
183− =/ kel-path /[ego]/[syd]/[wen]/sys/kelvin
77+ =/ kel-path
78+ /(scot %p our)/[desk]/(scot %da now)/sys/kelvin
184 ?. .^(? %cu kel-path)
79 ?. .^(? %cu kel-path)
185− ~[(cat 3 'bad desk: %' syd)]
80+ leaf+"bad desk: {<desk>}"
186− =+ .^(=waft %cx kel-path)
81+ =+ .^(=weft %cx kel-path)
82+ :+ %rose ["" "{<desk>}" "::"]
188− =/ =sink
84+ =/ meb (mergebase-hashes our desk now arak)
189− ?~ s=(~(get by sor) syd)
85+ =/ poz
190− ~
86+ ?~ rail.arak "local"
191− ?~ z=(~(get by zyn) syd u.s)
87+ ?:(paused.u.rail.arak "paused" "tracking")
192− ~
88+ =/ sat ?:(liv.rein.arak "running" "suspended")
193− `[p.u.s q.u.s [kid let]:u.z]
89+ =/ pen
194− =/ meb=(list @uv)
90+ ?~ rail.arak "~"
195− ?~ sink ~[hash]
91+ <(turn next.u.rail.arak |=([@ lal=@tas num=@] [lal num]))>
196− %+ turn
92+ :~ leaf/"/sys/kelvin: {<[lal num]:weft>}"
197− .^ (list tako) %cs
93+ leaf/"base hash: {?.(=(1 (lent meb)) <meb> <(head meb)>)}"
198− /[ego]/[syd]/[wen]/base/(scot %p her.u.sink)/[sud.u.sink]
94+ leaf/"%cz hash: {<hash>}"
200− |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
96+ leaf/"app status: {sat}"
201− =/ dek (~(got by tyr) syd)
97+ leaf/"force on: {?:(=(~ add.rein.arak) "~" <add.rein.arak>)}"
202− =/ sat
98+ leaf/"force off: {?:(=(~ sub.rein.arak) "~" <sub.rein.arak>)}"
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'))
244− %^ cat 3 ' publishing ship: ' ?~ got=(get-publisher our syd now)
100+ leaf/"publishing ship: {?~(rail.arak <~> <publisher.u.rail.arak>)}"
245− '~'
101+ leaf/"updates: {poz}"
246− (scot %p u.got)
102+ leaf/"source ship: {?~(rail.arak <~> <ship.u.rail.arak>)}"
247− ::
103+ leaf/"source desk: {?~(rail.arak <~> <desk.u.rail.arak>)}"
248− (cat 3 ' force off: ' (print-agents of))
104+ leaf/"source aeon: {?~(rail.arak <~> <aeon.u.rail.arak>)}"
249− (cat 3 ' force on: ' (print-agents on))
105+ leaf/"pending updates: {pen}"
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 ~)
298:: +report-kids: non-vat cz hash report for kids desk
107:: +report-kids: non-vat cz hash report for kids desk
300++ report-kids
109++ report-kids
301 |= [our=ship now=@da]
110 |= [our=ship now=@da]
303− =/ syd %kids
112+ =/ dek %kids
304 =/ ego (scot %p our)
113 =/ ego (scot %p our)
305 =/ wen (scot %da now)
114 =/ wen (scot %da now)
306− ?. (~(has in .^((set desk) %cd /[ego]//[wen])) syd)
115+ ?. (~(has in .^((set desk) %cd /[ego]//[wen])) dek)
307− 'no %kids desk'
116+ leaf/"no %kids desk"
308− =+ .^(hash=@uv %cz /[ego]/[syd]/[wen])
117+ =+ .^(hash=@uv %cz /[ego]/[dek]/[wen])
309− (cat 3 '%kids %cz hash: ' (scot %uv hash))
118+ leaf/"%kids %cz hash: {<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)
310:: +read-bill-foreign: read /desk/bill from a foreign desk
145:: +read-bill-foreign: read /desk/bill from a foreign desk
312++ read-bill-foreign
147++ read-bill-foreign
@@ -317,7 +152,7 @@
317 =/ syd (scot %tas desk)
152 =/ syd (scot %tas desk)
318 =/ yon (scot %ud aeon)
153 =/ yon (scot %ud aeon)
320− =/ dom .^(domo cv/~[her syd yon])
155+ =/ dom .^(dome cv/~[her syd yon])
321 =/ tak ~| aeons=~(key by hit.dom)
156 =/ tak ~| aeons=~(key by hit.dom)
322 (scot %uv (~(got by hit.dom) aeon))
157 (scot %uv (~(got by hit.dom) aeon))
323 =/ yak .^(yaki cs/~[her syd yon %yaki tak])
158 =/ yak .^(yaki cs/~[her syd yon %yaki tak])
@@ -334,6 +169,21 @@
334 ?. .^(? cu/pax)
169 ?. .^(? cu/pax)
335 *(list dude)
170 *(list dude)
336 .^((list dude) cx/pax)
171 .^((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)))]
338++ get-remote-diff
188++ get-remote-diff
339 |= [our=ship here=desk now=@da her=ship there=desk when=aeon]
189 |= [our=ship here=desk now=@da her=ship there=desk when=aeon]
@@ -359,19 +209,39 @@
359 |= [our=ship =desk now=@da]
209 |= [our=ship =desk now=@da]
360 ^- (list [=dude live=?])
210 ^- (list [=dude live=?])
361 %~ tap in
211 %~ tap in
362− .^((set [=dude live=?]) ge+/(scot %p our)/[desk]/(scot %da now)/$)
212+ .^((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))))
364++ mergebase-hashes
224++ mergebase-hashes
365− |= [our=@p syd=desk now=@da her=ship sud=desk]
225+ |= [our=@p =desk now=@da =arak]
366− =/ her (scot %p her)
228+ =/ her (scot %p ship.u.rail.arak)
367 =/ ego (scot %p our)
229 =/ ego (scot %p our)
368 =/ wen (scot %da now)
230 =/ wen (scot %da now)
369− %+ turn .^((list tako) %cs /[ego]/[syd]/[wen]/base/[her]/[sud])
231+ %+ turn .^((list tako) %cs ~[ego desk wen %base her desk.u.rail.arak])
370− |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
232+ |=(=tako .^(@uv %cs ~[ego desk wen %hash (scot %uv tako)]))
373 =, enjs:format
235 =, enjs:format
@@ -384,6 +254,15 @@
384 da+(tim da.c)
254 da+(tim da.c)
261+ hash+s+(scot %uv hash.v)
388 |= w=^weft
267 |= w=^weft
@@ -397,5 +276,30 @@
397 :~ aeon+(numb aeon.r)
276 :~ aeon+(numb aeon.r)
398 weft+(weft weft.r)
277 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)