@@ -61,7 +61,7 @@
61 ?+ flow=(~(get by sub) which) `0/sub
61 ?+ flow=(~(get by sub) which) `0/sub
62 ~ [~[(pine which)] 0/(~(put by sub) which ~)]
62 ~ [~[(pine which)] 0/(~(put by sub) which ~)]
63 [~ ~] [~[(pine which)] 0/sub]
63 [~ ~] [~[(pine which)] 0/sub]
64− [~ ~ [* %& * *]] [~[(scry `+(aeon.u.u.flow) which)] 0/sub]
64+ [~ ~ [* %& * *]] [~[(pine which)] 0/sub]
66 ++ quit (corl (lead %0) ~(del by sub)) :: Unsub from [ship dude path].
66 ++ quit (corl (lead %0) ~(del by sub)) :: Unsub from [ship dude path].
67 ++ read :: See current subscribed states.
67 ++ read :: See current subscribed states.
@@ -95,7 +95,7 @@
96 =. stale.u.u.flow &
96 =. stale.u.u.flow &
97 :_ 0/(~(put by sub) current u.flow)
97 :_ 0/(~(put by sub) current u.flow)
98− ~[(on-rock-poke current u.u.flow ~)]
98+ ~[(on-rock-poke fake=& current u.u.flow ~)]
101 :_ 0/(~(del by sub) current) :_ ~
101 :_ 0/(~(del by sub) current) :_ ~
@@ -105,77 +105,53 @@
105 [path ship dude]:current
105 [path ship dude]:current
108− :: :: Check if we're still interested
109− :: :: in a wave. If no, no-op.
111− ++ behn :: (See https://gist.github.com/belisarius222/7f8452bfea9b199c0ed717ab1778f35b)
112− |= [ship=term =dude aeon=term path=paths]
113− ^- (list card:agent:gall)
114− %- fall :_ ~ %- mole |.
115− =/ ship (slav %p ship)
116− =/ aeon (slav %ud aeon)
117− ?: (lte aeon aeon:(fall (~(got by sub) ship dude path) *flow)) ~
118− ~[(scry `aeon ship dude path)]
120 ++ apply :: Handle response from publisher.
108 ++ apply :: Handle response from publisher.
121 |= res=(response:poke lake paths)
109 |= res=(response:poke lake paths)
122 ^- (quip card:agent:gall subs)
110 ^- (quip card:agent:gall subs)
123− %- fall :_ `0/sub %- mole |.
124 =* current [src.bowl dude.res path.res]
111 =* current [src.bowl dude.res path.res]
125 =/ old=flow (fall (~(got by sub) current) *flow)
112 =/ old=flow (fall (~(got by sub) current) *flow)
126− ?- type.res
113+ ?: ?=(%tomb what.res)
128 =/ =flow old(stale &)
114 =/ =flow old(stale &)
129 :_ 0/(~(put by sub) current `flow) :_ ~
115 :_ 0/(~(put by sub) current `flow) :_ ~
130− (on-rock-poke current flow ~)
116+ (on-rock-poke fake=& current flow ~)
134− (pine src.bowl dude.res path.res)
138− (behn-s25 [dude aeon path]:res)
141− =/ [wave=(unit wave:lake) =flow]
118+ =/ [wave=(unit wave:lake) new=(unit flow)]
142− ?- what.res
119+ ?- what.res
143− %rock ?> (gte aeon.res aeon.old)
120+ %rock ?: (lte aeon.res aeon.old) [~ ~]
144− [~ [aeon.res | | rock.res]]
121+ [~ `[aeon.res | | rock.res]]
122+ %wave ?: (lte aeon.res aeon.old) [~ ~]
145− %wave ?> =(aeon.res +(aeon.old))
123+ ?> =(aeon.res +(aeon.old))
146− [`wave.res [aeon.res | | (wash:lake rock.old wave.res)]]
124+ [`wave.res `[aeon.res | | (wash:lake rock.old wave.res)]]
148− :_ 0/(~(put by sub) current `flow)
149− :~ (on-rock-poke current flow wave)
150− (scry `+(aeon.res) src.bowl dude.res path.res)
152− ==
126+ ?~ new `0/sub
127+ :_ 0/(~(put by sub) current new) :_ ~
128+ (on-rock-poke fake=& current u.new wave)
130+ ++ handle-fake-on-rock
131+ |= =(on-rock:poke lake paths)
132+ ^- (list card:agent:gall)
133+ ?~ flow=(~(get by sub) [src from path]:on-rock) ~
135+ ?. =([stale fail rock]:u.u.flow [stale fail rock]:on-rock) ~
136+ ~[(on-rock-poke fake=| [src from path]:on-rock u.u.flow wave.on-rock)]
154 :: Non-public facing arms below
138 :: Non-public facing arms below
156− ++ behn-s25
140+ ++ pine
157− |= [=dude =aeon path=noun]
141+ |= [who=ship which=dude where=paths]
158 ^- card:agent:gall
142 ^- card:agent:gall
159− :* %pass (zoom behn/(scot %p src.bowl)^dude^(scot %ud aeon)^path)
160− %arvo %b %wait (add ~s25 now.bowl)
162− ++ pine |= [ship dude paths] (scry ~ +<)
164− |= [when=(unit aeon) who=ship which=dude where=paths]
166− =/ when ?~ when ~ (scot %ud u.when)
167− :* %pass (zoom scry-request/(scot %p who)^which^when^where)
143+ :* %pass (zoom scry-request/(scot %p who)^which^where)
168 %agent [who which]
144 %agent [who which]
169− %poke %sss-to-pub :- result-type ^- result
145+ %poke sss-to-pub/[result-type `result`[where dap.bowl]]
170− [where dap.bowl ^when]
172 ++ on-rock-poke
147 ++ on-rock-poke
173− |= [[=ship =dude path=paths] flow wave=(unit wave:lake)]
148+ |= [fake=? [=ship =dude path=paths] flow wave=(unit wave:lake)]
174 ^- card:agent:gall
149 ^- card:agent:gall
150+ :* %pass %+ zoom ?:(fake %fake %on-rock)
175− :* %pass (zoom on-rock/(scot %ud aeon)^(scot %p ship)^dude^path)
151+ (scot %ud aeon)^(scot %p ship)^dude^path
176 %agent [our dap]:bowl
152 %agent [our dap]:bowl
177− %poke %sss-on-rock on-rock-type ^- from
153+ %poke ?:(fake %sss-fake-on-rock %sss-on-rock)
178− [path ship dude stale fail rock wave]
154+ on-rock-type `from`[path ship dude stale fail rock wave]
181++ du :: Manage publications.
157++ du :: Manage publications.
@@ -184,28 +160,78 @@
185 +$ into (request:poke paths)
161 +$ into (request:poke paths)
186 +$ result (response:poke lake paths)
162 +$ result (response:poke lake paths)
187− +$ rule [rocks=_1 waves=_5] :: Retention policy
164+ [horizon=(unit @ud) frequency=@ud] :: Retention policy
189 $: rok=((mop aeon rock:lake) gte)
166 $: rok=((mop aeon rock:lake) gte)
190 wav=((mop aeon wave:lake) lte)
167 wav=((mop aeon wave:lake) lte)
192− mem=(mip ship dude @da)
169+ mem=(jug ship dude)
195 $: tid=$~(*tide $@(aeon tide))
172 $: tid=$~(*tide $@(aeon tide))
196 alo=(unit (set ship))
173 alo=(unit (set ship))
185+ %- ~(run by +.versioned)
186+ |= =buoy-0:^versioned
190+ ?@ tid.buoy-0 tid.buoy-0
194+ ?: =(waves.rul.tid.buoy-0 0) ~
195+ `(mul [+(rocks) waves]:rul.tid.buoy-0)
199+ %- ~(run by mem.tid.buoy-0)
198− +$ pubs [%0 (map paths buoy)]
207+ =< $% [%0 (map paths buoy-0)]
208+ [%1 (map paths buoy)]
212+ $: tid=$~(*tide-0 $@(aeon tide-0))
213+ alo=(unit (set ship))
216+ $: rok=((mop aeon rock:lake) gte)
217+ wav=((mop aeon wave:lake) lte)
218+ rul=[rocks=@ud waves=@ud]
219+ mem=(mip ship dude @da)
200− |= [pub=pubs =bowl:gall result-type=type]
224+ |= [pub=versioned:pubs =bowl:gall result-type=type]
201− => .(pub +.pub)
225+ => .(pub +:(update:pubs pub))
202 =* rok ((on aeon rock:lake) gte)
226 =* rok ((on aeon rock:lake) gte)
203 =* wav ((on aeon wave:lake) lte)
227 =* wav ((on aeon wave:lake) lte)
205 ++ rule :: Set new retention policy.
229 ++ rule :: Set new retention policy.
206 |= [path=paths =^rule]
230 |= [path=paths =^rule]
233+ %- fall :_ (~(put by pub) path %*(. *$<(aeon buoy) rul.tid rule))
209 %+ ~(jab by pub) path
235 %+ ~(jab by pub) path
211 ?@ tid.buoy buoy
237 ?@ tid.buoy buoy
@@ -214,11 +240,11 @@
214 ++ wipe :: Create new rock and wipe rest.
240 ++ wipe :: Create new rock and wipe rest.
215 |= path=paths
241 |= path=paths
218 %+ ~(jab by pub) path
244 %+ ~(jab by pub) path
220 ?@ tid.buoy buoy
246 ?@ tid.buoy buoy
221− %* . buoy(tid (form tid.buoy(rul [0 1])))
247+ %* . buoy(tid (form tid.buoy(rul [`0 1])))
222 rul.tid rul.tid.buoy
248 rul.tid rul.tid.buoy
223 wav.tid ~
249 wav.tid ~
@@ -232,29 +258,31 @@
232 ?> ?=(^ tid.buoy)
258 ?> ?=(^ tid.buoy)
233 =* tide tid.buoy
259 =* tide tid.buoy
234 =/ next=aeon +((latest tide))
260 =/ next=aeon +((latest tide))
235− :- %+ murn ~(tap bi mem.tide)
262+ %+ turn ~(tap by mem.tide)
236− |= [=ship =dude =@da]
263+ |= [=ship =(set dude)]
237− ?: (lth da now.bowl) ~
264+ %+ turn ~(tap in set)
238− `(send scry/wave/wave ship dude next path)
266+ (send wave/[next wave] ship dude path)
240 %+ ~(put by pub) path
268 %+ ~(put by pub) path
241 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
269 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
242 =. wav.tide (put:wav wav.tide next wave)
270 =. wav.tide (put:wav wav.tide next wave)
243 =. mem.tide ~
271 =. mem.tide ~
244− ?. =(next (add aeon.last waves.rul.tide)) buoy
272+ ?. =(next (add aeon.last frequency.rul.tide)) buoy
245 buoy(tid (form tide))
273 buoy(tid (form tide))
247 ++ fork :: Fork a pub into an empty path.
275 ++ fork :: Fork a pub into an empty path.
248 |= [from=paths to=paths]
276 |= [from=paths to=paths]
251 ?< (~(has by pub) to)
279 ?< (~(has by pub) to)
252 (~(put by pub) to (~(got by pub) from))
280 (~(put by pub) to (~(got by pub) from))
254 ++ copy :: Fork a sub into an empty path.
282 ++ copy :: Fork a sub into an empty path.
255 |= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
283 |= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
258 ?< (~(has by pub) to)
286 ?< (~(has by pub) to)
259 %+ ~(put by pub) to
287 %+ ~(put by pub) to
260 %* . *$<(aeon buoy)
288 %* . *$<(aeon buoy)
@@ -263,7 +291,7 @@
264 ++ perm :: Change permissions with gate.
292 ++ perm :: Change permissions with gate.
265 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
293 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
266− ^- pubs
294+ ^- (quip card:agent:gall pubs)
267 %+ edit where
295 %+ edit where
269 =/ new=_alo.buoy (diff alo.buoy)
297 =/ new=_alo.buoy (diff alo.buoy)
@@ -272,21 +300,21 @@
273 mem.tid ?~ new mem.tid.buoy
301 mem.tid ?~ new mem.tid.buoy
274 %. mem.tid.buoy
302 %. mem.tid.buoy
275− ~(int by (malt (turn ~(tap in u.new) (late *(map @ @)))))
303+ ~(int by (malt (turn ~(tap in u.new) (late *(set @)))))
277 ++ public (curr perm _~) :: Make list of paths public.
305 ++ public (curr perm _~) :: Make list of paths public.
278 ++ secret (curr perm _`~) :: Make list of paths secret.
306 ++ secret (curr perm _`~) :: Make list of paths secret.
279 :: :: Block ships from paths.
307 :: :: Block ships from paths.
280 ++ block :: No-ops on public paths.
308 ++ block :: No-ops on public paths.
281 |= [who=(list ship) whence=(list paths)]
309 |= [who=(list ship) whence=(list paths)]
282− ^- pubs
310+ ^- (quip card:agent:gall pubs)
283 %+ perm whence
311 %+ perm whence
284 |= old=(unit (set ship))
312 |= old=(unit (set ship))
285 ?~ old ~ `(~(dif in u.old) (sy who))
313 ?~ old ~ `(~(dif in u.old) (sy who))
286 :: :: Allow ships to paths.
314 :: :: Allow ships to paths.
287 ++ allow :: Any public paths will no-op.
315 ++ allow :: Any public paths will no-op.
288 |= [who=(list ship) where=(list paths)]
316 |= [who=(list ship) where=(list paths)]
289− ^- pubs
317+ ^- (quip card:agent:gall pubs)
290 %+ perm where
318 %+ perm where
291 |= old=(unit (set ship))
319 |= old=(unit (set ship))
292 ?~ old ~ `(~(gas in u.old) who)
320 ?~ old ~ `(~(gas in u.old) who)
@@ -313,37 +341,51 @@
313 =/ =buoy (~(gut by pub) path.req *buoy)
341 =/ =buoy (~(gut by pub) path.req *buoy)
314 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
342 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
315 ?@ tid.buoy
343 ?@ tid.buoy
316− :_ 0/pub :_ ~
344+ :_ 1/pub :_ ~
317− (send tomb/~ src.bowl dude.req tid.buoy path.req)
345+ (send tomb/~ src.bowl dude.req path.req)
318− ?~ when.req
346+ :_ 1/pub :_ ~
319− =/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
347+ =/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
348+ (send rock/last src.bowl dude.req path.req)
351+ |= [[ship=term =dude aeon=term path=paths] =sign:agent:gall]
352+ ^- (quip card:agent:gall pubs)
353+ ?> ?=(%poke-ack -.sign)
355+ =/ =buoy (~(gut by pub) path *buoy)
356+ ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
320− :_ 0/pub :_ ~
358+ :_ 1/pub :_ ~
321− (send scry/rock/val.last src.bowl dude.req key.last path.req)
359+ (send tomb/~ src.bowl dude path)
361+ => .(aeon +((slav %ud aeon)))
322− ?^ dat=(get:wav wav.tid.buoy u.when.req)
362+ ?^ dat=(get:wav wav.tid.buoy aeon)
323− :_ 0/pub :_ ~
363+ :_ 1/pub :_ ~
324− (send scry/wave/u.dat src.bowl [dude u.when path]:req)
364+ (send wave/[aeon u.dat] src.bowl dude path)
325− ?: %+ lte u.when.req
365+ =/ last (fall (pry:rok rok.tid.buoy) [=key =val]:rok)
326− key::(fall (ram:wav wav.tid.buoy) (pry:rok rok.tid.buoy) [=key val]:wav)
366+ ?: (lte aeon key.last)
327− :_ 0/pub :_ ~
367+ :_ 1/pub :_ ~
328− (send yore/~ src.bowl [dude u.when path]:req)
368+ (send rock/last src.bowl dude path)
329− ?> =(u.when.req +((latest tid.buoy)))
369+ :- ~
330− :- ~[(send nigh/~ src.bowl [dude u.when path]:req)]
370+ :- %1
332− %+ ~(put by pub) path.req
371+ %+ ~(put by pub) path
334− mem.tid (~(put bi mem.tid.buoy) src.bowl dude.req (add ~s25 now.bowl))
373+ mem.tid (~(put ju mem.tid.buoy) src.bowl dude)
337 :: Non-public facing arms below
376 :: Non-public facing arms below
340− |= [payload=_|3:*(response:poke lake paths) =ship =dude =aeon path=paths]
379+ |= [payload=_|2:*(response:poke lake paths) =ship =dude path=paths]
341 ^- card:agent:gall
380 ^- card:agent:gall
342 =* mark (cat 3 %sss- name:lake)
381 =* mark (cat 3 %sss- name:lake)
383+ ?: ?=(%tomb what.payload) (zoom tomb-response/(scot %p ship)^dude^path)
343− :* %pass (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon)^path)
384+ (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon.payload)^path)
344 %agent [ship dude]
386 %agent [ship dude]
345 %poke mark result-type ^- (response:poke lake paths)
387 %poke mark result-type ^- (response:poke lake paths)
346− [path dap.bowl aeon payload]
388+ [path dap.bowl payload]
348 ++ latest
390 ++ latest
349 |= =$@(aeon tide)
391 |= =$@(aeon tide)
@@ -354,31 +396,49 @@
356 |= [ps=(list paths) edit=$-(buoy buoy)]
398 |= [ps=(list paths) edit=$-(buoy buoy)]
357− ^- pubs
399+ ^- (quip card:agent:gall pubs)
359 %- ~(rep in (sy ps))
400 %- ~(rep in (sy ps))
360− |= [path=paths =_pub]
401+ |= [path=paths caz=(list card:agent:gall) %1 =_pub]
361− %- fall :_ pub %- mole |.
362− (~(jab by pub) path edit)
402+ ?~ old=(~(get by pub) path) [caz 1/pub]
403+ =/ new=buoy (edit u.old)
404+ :_ 1/(~(put by pub) path new)
406+ ^- (list card:agent:gall)
410+ %+ turn ~(tap by mem.tid.u.old)
411+ |= [=ship =(set dude)]
412+ (turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
414+ =/ new-alo=(jug ship dude)
415+ (malt (turn ~(tap in u.alo.new) (late *(set @))))
417+ %+ turn ~(tap by (~(dif by mem.tid.u.old) new-alo))
418+ |= [=ship =(set dude)]
419+ (turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
367 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
424 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
368 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
425 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
369− =. rok.tide
426+ =? rok.tide :: Create new rock.
370− %+ gas:rok +<-:gas:rok
371− %- tab:rok :_ [~ +(rocks.rul.tide)]
372− ?: ?| =(waves.rul.tide 0)
427+ ?& !=(frequency.rul.tide 0)
373− (lth max-wave (add aeon.max-rock waves.rul.tide))
428+ (gte max-wave (add aeon.max-rock frequency.rul.tide))
376 %+ put:rok rok.tide
430 %+ put:rok rok.tide
377 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
431 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
378 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
432 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
379 ~| %aeon-awry
433 ~| %aeon-awry
380 ?> =(now +(prev))
434 ?> =(now +(prev))
381 [now (wash:lake rock wave)]
435 [now (wash:lake rock wave)]
437+ ?~ horizon.rul.tide :: Only keep genesis and latest.
438+ (gas:rok ~ (murn ~[(ram:rok rok.tide) (pry:rok rok.tide)] same))
439+ %^ lot:rok rok.tide :: Delete beyond horizon.
441+ (mole |.((sub max-wave (max [u.horizon frequency]:rul.tide))))
382 ~| %rock-zero
442 ~| %rock-zero
383 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))
443 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))