@@ -10,12 +10,41 @@
1010 ==
1111::
1212+$ pikes (map desk pike)
13+:: $jump: changes to update source change requests
1314::
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+ ==
1421:: $rung: reference to upstream commit
1522::
1623+$ 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+ ==
1747::
18−+$ sync-state [nun=@ta kid=(unit desk) let=@ud]
1948+$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud])
2049:: +truncate-hash: get last 5 digits of hash and convert to tape
2150::
@@ -30,7 +59,7 @@
3059 =/ ego (scot %p our)
3160 =/ wen (scot %da now)
3261 :* .^(rock:tire %cx /[ego]//[wen]/tire)
33− .^(=cone %cx /[ego]//[wen]/domes)
62+ .^(cone %cx /[ego]//[wen]/domes)
3463 .^((map desk [ship desk]) %gx /[ego]/hood/[wen]/kiln/sources/noun)
3564 .^ (map [desk ship desk] sync-state) %gx
3665 /[ego]/hood/[wen]/kiln/syncs/noun
@@ -43,43 +72,73 @@
4372 ^- tang
4473 =/ ego (scot %p our)
4574 =/ wen (scot %da now)
46− =/ prep (report-prep our now)
47− ?~ filt
75+ =+ prep=[tyr cone sor zyn]=(report-prep our now)
76+ ?: =(%$ filt)
4877 %- zing
49− %+ turn (flop desks)
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)
5086 |=(syd=@tas (report-vat prep our now syd verb))
51− =/ deks
87+ =/ deks=(list [=desk =zest wic=(set weft)])
5288 ?~ desks
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)))
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]
58100 ?: =(filt %blocking)
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"]
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']
63110 =/ blockers=(list desk)
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]
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']
72123 %- zing
73− %+ turn (flop blockers)
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
74131 |=(syd=desk (report-vat prep our now syd verb))
75132 ::
76133 %- zing
77134 %+ turn
78135 ?+ filt !!
79− ::
80136 %exists
81137 %+ skip deks
82− |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0))
138+ |= [syd=desk *]
139+ ?~ got=(~(get by cone.prep) our syd)
140+ &
141+ =(0 let.u.got)
83142 ::
84143 %running
85144 %+ skim deks
@@ -90,107 +149,152 @@
90149 |= [syd=@tas [zest=@tas *]]
91150 ?| =(syd %kids)
92151 =(zest %live)
93− =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0)
152+ ?~ got=(~(get by cone.prep) our syd)
153+ &
154+ =(0 let.u.got)
94155 ==
95156 ::
96157 %exists-not
97158 %+ skim deks
98− |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0))
159+ |= [syd=desk *]
160+ ?~ got=(~(get by cone.prep) our syd)
161+ |
162+ =(0 let.u.got)
99163 ==
100164 |=([syd=desk *] (report-vat prep our now syd verb))
101165:: +report-vat: report on a single desk installation
102166::
103167++ report-vat
104− |= $: $: tyr=rock:tire =cone sor=(map desk [ship desk])
168+ |= $: $: tyr=rock:tire =cone sor=(map desk (pair ship desk))
105169 zyn=(map [desk ship desk] sync-state)
106170 ==
107171 our=ship now=@da syd=desk verb=?
108172 ==
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
173+ |^ ^- tang
119174 =/ ego (scot %p our)
120175 =/ wen (scot %da now)
121− =+ .^(=cass %cw /[ego]/[syd]/[wen])
122− ?: =(ud.cass 0)
123− leaf+"desk does not yet exist: {<syd>}"
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])
124181 ?: =(%kids syd)
125− =+ .^(hash=@uv %cz /[ego]/[syd]/[wen])
126− leaf+"%kids %cz hash: {<hash>}"
127− =/ kel-path
128− /[ego]/[syd]/[wen]/sys/kelvin
182+ ~[(cat 3 '%kids %cz hash: ' (scot %uv hash))]
183+ =/ kel-path /[ego]/[syd]/[wen]/sys/kelvin
129184 ?. .^(? %cu kel-path)
130− leaf+"bad desk: {<syd>}"
185+ ~[(cat 3 'bad desk: %' syd)]
131186 =+ .^(=waft %cx kel-path)
132− :+ %rose ["" "{<syd>}" "::"]
133187 ^- tang
134− =/ hash .^(@uv %cz /[ego]/[syd]/[wen])
135188 =/ =sink
136189 ?~ s=(~(get by sor) syd)
137190 ~
138191 ?~ z=(~(get by zyn) syd u.s)
139192 ~
140− `[-.u.s +.u.s +.u.z]
193+ `[p.u.s q.u.s [kid let]:u.z]
141194 =/ meb=(list @uv)
142− ?~ sink [hash]~
143− (mergebase-hashes our syd now her.u.sink sud.u.sink)
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)))
144201 =/ dek (~(got by tyr) syd)
145202 =/ sat
146203 ?- zest.dek
147− %live "running"
148− %dead "suspended"
149− %held "suspended until next update"
204+ %live 'running'
205+ %dead 'suspended'
206+ %held 'suspended until next update'
150207 ==
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)
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)
161212 ?. verb
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)>}"
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)
173225 ==
174226 ::
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)>}"
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)
193257 ==
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+ --
194298:: +report-kids: non-vat cz hash report for kids desk
195299::
196300++ report-kids
@@ -200,9 +304,9 @@
200304 =/ ego (scot %p our)
201305 =/ wen (scot %da now)
202306 ?. (~(has in .^((set desk) %cd /[ego]//[wen])) syd)
203− leaf/"no %kids desk"
307+ 'no %kids desk'
204308 =+ .^(hash=@uv %cz /[ego]/[syd]/[wen])
205− leaf/"%kids %cz hash: {<hash>}"
309+ (cat 3 '%kids %cz hash: ' (scot %uv hash))
206310:: +read-bill-foreign: read /desk/bill from a foreign desk
207311::
208312++ read-bill-foreign
@@ -262,8 +366,8 @@
262366 =/ her (scot %p her)
263367 =/ ego (scot %p our)
264368 =/ wen (scot %da now)
265− %+ turn .^((list tako) %cs ~[ego syd wen %base her sud])
266− |=(=tako .^(@uv %cs ~[ego syd wen %hash (scot %uv tako)]))
369+ %+ turn .^((list tako) %cs /[ego]/[syd]/[wen]/base/[her]/[sud])
370+ |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
267371::
268372++ enjs
269373 =, enjs:format