diff --git a/bin/solid.pill b/bin/solid.pill index 77837f3f4b..da53eec279 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f639b862842609c64aa387f8414f9f8bcf1db5d89ae3e54e64aa1b040f21f7e0 -size 6315993 +oid sha256:4d0b09d1f033b59f626ae8727f5122db0dc03f86863f6b6b1ee02d9ec912d35e +size 6316479 diff --git a/pkg/arvo/app/aqua.hoon b/pkg/arvo/app/aqua.hoon index 748a2ee2f5..3eec9a21df 100644 --- a/pkg/arvo/app/aqua.hoon +++ b/pkg/arvo/app/aqua.hoon @@ -21,11 +21,15 @@ :: We get ++unix-event and ++pill from /-aquarium :: /- aquarium -/+ pill, default-agent +/+ pill, default-agent, aqua-azimuth, dbug, verb =, pill-lib=pill =, aquarium => $~ |% - +$ state + +$ versioned-state + $% state-0 + state-1 + == + +$ state-0 $: %0 pil=pill assembled=* @@ -33,7 +37,16 @@ fleet-snaps=(map term (map ship pier)) piers=(map ship pier) == + +$ state-1 + $: %1 + pil=pill + assembled=* + tym=@da + fleet-snaps=(map term fleet) + piers=fleet + == :: + +$ fleet [ships=(map ship pier) azi=az-state] +$ pier $: snap=* event-log=(list unix-timed-event) @@ -42,9 +55,11 @@ == -- :: -=| state -=* all-state - +=| state-1 +=* state - =< + %- agent:dbug + %+ verb | ^- agent:gall |_ =bowl:gall +* this . @@ -52,24 +67,37 @@ ac ~(. aqua-core bowl) def ~(. (default-agent this %|) bowl) ++ on-init `this - ++ on-save !>(all-state) + ++ on-save !>(state) ++ on-load - |= old-state=vase + |= old-vase=vase ^- step:agent:gall ~& prep=%aqua - =+ new=((soft state) !<(* old-state)) - ?~ new - `this - `this(all-state u.new) + =+ !<(old=versioned-state old-vase) + =| cards=(list card:agent:gall) + |- + ?- -.old + :: wipe fleets and piers rather than give them falsely nulled azimuth state + :: + %0 + %_ $ + -.old %1 + fleet-snaps.old *(map term fleet) + piers.old *fleet + == + :: + %1 + [cards this(state old)] + == :: ++ on-poke |= [=mark =vase] ^- step:agent:gall - =^ cards all-state + =^ cards state ?+ mark ~|([%aqua-bad-mark mark] !!) - %aqua-events (poke-aqua-events:ac !<((list aqua-event) vase)) - %pill (poke-pill:ac !<(pill vase)) - %noun (poke-noun:ac !<(* vase)) + %aqua-events (poke-aqua-events:ac !<((list aqua-event) vase)) + %pill (poke-pill:ac !<(pill vase)) + %noun (poke-noun:ac !<(* vase)) + %azimuth-action (poke-azimuth-action:ac !<(azimuth-action vase)) == [cards this] :: @@ -92,7 +120,18 @@ ++ on-peek peek:ac :: ++ on-agent on-agent:def - ++ on-arvo on-arvo:def + :: + ++ on-arvo + |= [=wire sign=sign-arvo] + ^- step:agent:gall + ?+ wire (on-arvo:def wire sign) + [%wait @ ~] + ?> ?=(%wake +<.sign) + =/ wen=@da (slav %da i.t.wire) + =^ cards state + (handle-wake:ac wen) + [cards this] + == ++ on-fail on-fail:def -- :: @@ -110,7 +149,7 @@ :: ++ pe |= who=ship - =+ (~(gut by piers) who *pier) + =+ (~(gut by ships.piers) who *pier) =* pier-data - |% :: @@ -118,7 +157,7 @@ :: ++ abet-pe ^+ this - =. piers (~(put by piers) who pier-data) + =. ships.piers (~(put by ships.piers) who pier-data) this :: :: Initialize new ship @@ -248,7 +287,19 @@ this :: ++ abet-aqua - ^- (quip card:agent:gall state) + ^- (quip card:agent:gall _state) + :: + :: interecept %request effects to handle azimuth subscription + :: + =. this + %- emit-cards + %- zing + %+ turn ~(tap by unix-effects) + |= [=ship ufs=(list unix-effect)] + %+ murn ufs + |= uf=unix-effect + (router:aqua-azimuth our.hid ship uf azi.piers) + :: =. this =/ =path /effect %- emit-cards @@ -300,20 +351,19 @@ =/ =path /boths/(scot %p ship) [%give %fact ~[path] %aqua-boths !>(`aqua-boths`[ship (flop bo)])] :: - [(flop cards) all-state] + [(flop cards) state] :: ++ emit-cards |= ms=(list card:agent:gall) =. cards (weld ms cards) this :: -:: :: Run all events on all ships until all queues are empty :: ++ plow-all |- ^+ this =/ who - =/ pers ~(tap by piers) + =/ pers ~(tap by ships.piers) |- ^- (unit ship) ?~ pers ~ @@ -331,7 +381,7 @@ :: ++ poke-pill |= p=pill - ^- (quip card:agent:gall state) + ^- (quip card:agent:gall _state) =. this apex-aqua =< abet-aqua =. pil p ~& lent=(met 3 (jam boot-ova.pil)) @@ -362,7 +412,7 @@ :: ++ poke-noun |= val=* - ^- (quip card:agent:gall state) + ^- (quip card:agent:gall _state) =. this apex-aqua =< abet-aqua ^+ this :: Could potentially factor out the three lines of turn-ships @@ -391,7 +441,7 @@ =/ txt .^(@ %cx (weld pax /hoon)) [/vane/[vane] [%veer v pax txt]] => .(this ^+(this this)) - =^ ms all-state (poke-pill pil) + =^ ms state (poke-pill pil) (emit-cards ms) :: [%swap-files ~] @@ -402,7 +452,7 @@ %- unix-event %- %*(. file-ovum:pill-lib directories slim-dirs) /(scot %p our.hid)/work/(scot %da now.hid) - =^ ms all-state (poke-pill pil) + =^ ms state (poke-pill pil) (emit-cards ms) :: [%wish hers=* p=@t] @@ -412,12 +462,14 @@ (wish:(pe who) p.val) :: [%unpause-events hers=*] + =. this start-azimuth-timer %+ turn-ships ((list ship) hers.val) |= [who=ship thus=_this] =. this thus start-processing-events:(pe who) :: [%pause-events hers=*] + =. this stop-azimuth-timer %+ turn-ships ((list ship) hers.val) |= [who=ship thus=_this] =. this thus @@ -428,17 +480,47 @@ this == :: +:: Make changes to azimuth state for the current fleet +:: +++ poke-azimuth-action + |= act=azimuth-action + ^- (quip card:agent:gall _state) + =. this apex-aqua =< abet-aqua + ^+ this + ?- -.act + :: + %init-azimuth + =. azi.piers *az-state + start-azimuth-timer + :: + %spawn + =. state (spawn who.act) + this + :: + %breach + :: should we remove the pier from state here? + =. state (breach who.act) + this + :: + == +:: :: Apply a list of events tagged by ship :: ++ poke-aqua-events |= events=(list aqua-event) - ^- (quip card:agent:gall state) + ^- (quip card:agent:gall _state) =. this apex-aqua =< abet-aqua %+ turn-events events |= [ae=aqua-event thus=_this] =. this thus ?- -.ae + :: %init-ship + :: XX Note that the keys that get passed in are unused. The keys field + :: should be deleted now that aqua is capable of managing azimuth state + :: internally. Its been left this way for now until all the ph tests + :: can be rewritten + =/ keys=dawn-event:able:jael (dawn who.ae) =. this abet-pe:(publish-effect:(pe who.ae) [/ %sleep ~]) =/ initted =< plow @@ -451,7 +533,7 @@ :^ //term/1 %boot & ?~ keys.ae [%fake who.ae] - [%dawn u.keys.ae] + [%dawn keys] -.userspace-ova.pil [//http-client/0v1n.2m9vh %born ~] [//http-server/0v1n.2m9vh %born ~] @@ -464,27 +546,36 @@ stop-processing-events:(pe who.ae) :: %snap-ships + =. this + %+ turn-ships (turn ~(tap by ships.piers) head) + |= [who=ship thus=_this] + =. this thus + (publish-effect:(pe who) [/ %kill ~]) =. fleet-snaps %+ ~(put by fleet-snaps) lab.ae + :_ azi.piers %- malt %+ murn hers.ae |= her=ship ^- (unit (pair ship pier)) - =+ per=(~(get by piers) her) + =+ per=(~(get by ships.piers) her) ?~ per ~ `[her u.per] + =. this stop-azimuth-timer + =. piers *fleet (pe -.hers.ae) :: %restore-snap =. this - %+ turn-ships (turn ~(tap by piers) head) + %+ turn-ships (turn ~(tap by ships.piers) head) |= [who=ship thus=_this] =. this thus - (publish-effect:(pe who) [/ %sleep ~]) - =. piers (~(uni by piers) (~(got by fleet-snaps) lab.ae)) + (publish-effect:(pe who) [/ %kill ~]) + =. piers (~(got by fleet-snaps) lab.ae) + =. this start-azimuth-timer =. this - %+ turn-ships (turn ~(tap by piers) head) + %+ turn-ships (turn ~(tap by ships.piers) head) |= [who=ship thus=_this] =. this thus (publish-effect:(pe who) [/ %restore ~]) @@ -537,18 +628,163 @@ ^- (unit (unit cage)) ?+ path ~ [%x %fleet-snap @ ~] ``noun+!>((~(has by fleet-snaps) i.t.t.path)) - [%x %ships ~] ``noun+!>((turn ~(tap by piers) head)) + [%x %fleets ~] ``noun+!>((turn ~(tap by fleet-snaps) head)) + [%x %ships ~] ``noun+!>((turn ~(tap by ships.piers) head)) [%x %pill ~] ``pill+!>(pil) [%x %i @ @ @ @ @ *] =/ who (slav %p i.t.t.path) - =/ pier (~(get by piers) who) + =/ pier (~(get by ships.piers) who) ?~ pier ~ :^ ~ ~ %noun !> (peek:(pe who) t.t.t.path) + [%x %log-info ~] + ``noun+!>([lives.azi.piers (lent logs.azi.piers) tym.azi.piers]) == :: :: Trivial scry for mock :: ++ scry |=([* *] ~) +:: +++ handle-wake + |= wen=@da + ^- (quip card:agent:gall _state) + =. this apex-aqua =< abet-aqua + ?. =(wen tym.azi.piers) + this + =. state (spam-logs 10) + start-azimuth-timer +:: +++ start-azimuth-timer + ^+ this + =? this !=(tym.azi.piers *@da) + stop-azimuth-timer + =/ until=@da (add now.hid ~s40) + =. tym.azi.piers until + %- emit-cards + [%pass /wait/(scot %da until) %arvo %b %wait until]~ +:: +++ stop-azimuth-timer + ^+ this + =* tym tym.azi.piers + ?: =(tym *@da) + this + %- emit-cards + [%pass /wait/(scot %da tym) %arvo %b %rest tym]~ +:: +++ spam-logs + |= n=@ + ^- _state + =* loop $ + ?: =(n 0) + state + =/ new-state=_state + ?. (~(has by lives.azi.piers) ~fes) + (spawn ~fes) + (cycle-keys ~fes) + =. state new-state + loop(n (dec n)) +:: +++ spawn + |= who=@p + ^- _state + ?< (~(has by lives.azi.piers) who) + =. lives.azi.piers (~(put by lives.azi.piers) who [1 0]) + =. logs.azi.piers + %+ weld logs.azi.piers + :_ ~ + %- changed-keys:lo:aqua-azimuth + :* who + (get-public:aqua-azimuth who 1 %crypt) + (get-public:aqua-azimuth who 1 %auth) + 1 + 1 + == + (spam-logs 10) +:: +++ cycle-keys + |= who=@p + ^- _state + =/ prev + ~| no-such-ship+who + (~(got by lives.azi.piers) who) + =/ lyfe +(lyfe.prev) + =. lives.azi.piers (~(put by lives.azi.piers) who [lyfe rut.prev]) + =. logs.azi.piers + %+ weld logs.azi.piers + :_ ~ + %- changed-keys:lo:aqua-azimuth + :* who + (get-public:aqua-azimuth who lyfe %crypt) + (get-public:aqua-azimuth who lyfe %auth) + 1 + lyfe + == + state +:: +++ breach + |= who=@p + ^- _state + =. state (cycle-keys who) + =/ prev (~(got by lives.azi.piers) who) + =/ rut +(rut.prev) + =. lives.azi.piers (~(put by lives.azi.piers) who [lyfe.prev rut]) + =. logs.azi.piers + %+ weld logs.azi.piers + [(broke-continuity:lo:aqua-azimuth who rut) ~] + (spam-logs 10) +:: +++ dawn + |= who=ship + ^- dawn-event:able:jael + ?> ?=(?(%czar %king %duke) (clan:title who)) + =/ spon=(list [ship point:azimuth]) + %- flop + |- ^- (list [ship point:azimuth]) + =/ =ship (^sein:title who) + =/ a-point=[^ship point:azimuth] + =/ spon-spon [& (^sein:title ship)] + =/ life-rift ~|([ship lives.azi.piers] (~(got by lives.azi.piers) ship)) + =/ =life lyfe.life-rift + =/ =rift rut.life-rift + =/ =pass + %^ pass-from-eth:azimuth + (as-octs:mimes:html (get-public:aqua-azimuth ship life %crypt)) + (as-octs:mimes:html (get-public:aqua-azimuth ship life %auth)) + 1 + :^ ship + *[address address address address]:azimuth + `[life=life pass rift spon-spon ~] + ~ + ?: ?=(%czar (clan:title ship)) + [a-point]~ + [a-point $(who ship)] + =/ =seed:able:jael + =/ life-rift (~(got by lives.azi.piers) who) + =/ =life lyfe.life-rift + [who life sec:ex:(get-keys:aqua-azimuth who life) ~] + :* seed + spon + get-czars + ~[~['arvo' 'netw' 'ork']] + 0 + `(need (de-purl:html 'http://localhost:8545')) + == +:: +:: Should only do galaxies +:: +++ get-czars + ^- (map ship [rift life pass]) + %- malt + %+ murn + ~(tap by lives.azi.piers) + |= [who=ship lyfe=life rut=rift] + ?. =(%czar (clan:title who)) + ~ + %- some + :^ who rut lyfe + %^ pass-from-eth:azimuth + (as-octs:mimes:html (get-public:aqua-azimuth who lyfe %crypt)) + (as-octs:mimes:html (get-public:aqua-azimuth who lyfe %auth)) + 1 -- diff --git a/pkg/arvo/app/contact-view.hoon b/pkg/arvo/app/contact-view.hoon index 2abbbb0f67..4350e9d439 100644 --- a/pkg/arvo/app/contact-view.hoon +++ b/pkg/arvo/app/contact-view.hoon @@ -181,22 +181,7 @@ ~[(add-pending rid ship.act)] :: %delete - =/ rid=resource - (de-path:resource path.act) - =/ group-pokes=(list card) - ?: =(our.bol entity.rid) - ~[(group-push-poke %remove rid)] - :~ (group-proxy-poke %remove-members rid (sy our.bol ~)) - (group-pull-poke %remove rid) - == - ;: weld - group-pokes - :~ (contact-hook-poke [%remove path.act]) - (group-poke [%remove-group rid ~]) - (contact-poke [%delete path.act]) - == - (delete-metadata path.act) - == + ~ :: %remove =/ rid=resource @@ -357,13 +342,6 @@ (metadata-hook-poke [%add-owned path]) == :: -++ delete-metadata - |= =path - ^- (list card) - :~ (metadata-poke [%remove path [%contacts path]]) - (metadata-hook-poke [%remove path]) - == -:: ++ all-scry ^- rolodex .^(rolodex %gx /(scot %p our.bol)/contact-store/(scot %da now.bol)/all/noun) diff --git a/pkg/arvo/app/glob.hoon b/pkg/arvo/app/glob.hoon index 472f938331..de1514d5a3 100644 --- a/pkg/arvo/app/glob.hoon +++ b/pkg/arvo/app/glob.hoon @@ -5,7 +5,7 @@ /- glob /+ default-agent, verb, dbug |% -++ hash 0v4.fpa4r.s6dtc.h8tps.62jv0.qn0fj +++ hash 0v5.0umdn.af5hq.bp84b.66eao.q0b98 +$ state-0 [%0 hash=@uv glob=(unit (each glob:glob tid=@ta))] +$ all-states $% state-0 diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 27a2c82232..fce8193bde 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -807,12 +807,14 @@ [%x %peek-update-log @ @ ~] =/ =ship (slav %p i.t.t.path) =/ =term i.t.t.t.path - =/ update-log=(unit update-log:store) (~(get by update-logs) [ship term]) - ?~ update-log [~ ~] - =/ result=(unit [time update:store]) - (peek:orm-log:store u.update-log) - ?~ result [~ ~] - ``noun+!>([~ -.u.result]) + =/ m-update-log=(unit update-log:store) (~(get by update-logs) [ship term]) + :- ~ :- ~ :- %noun + !> ^- (unit time) + %+ biff m-update-log + |= =update-log:store + =/ result=(unit [=time =update:store]) + (peek:orm-log:store update-log) + (bind result |=([=time update:store] time)) == ++ get-node-children |= [=ship =term =index:store] diff --git a/pkg/arvo/app/hark-store.hoon b/pkg/arvo/app/hark-store.hoon index 1b692a29cd..95496008f2 100644 --- a/pkg/arvo/app/hark-store.hoon +++ b/pkg/arvo/app/hark-store.hoon @@ -223,12 +223,16 @@ ?~ existing-notif notification (merge-notification:ha u.existing-notif notification) + =/ new-read=? + ?~ existing-notif + %.y + read.u.existing-notif =. read.new %.n =/ new-timebox=timebox:store (~(put by timebox) index new) :- (give:ha [/updates]~ %added current-timebox index new) %_ state - + ?~(existing-notif (upd-unreads:ha index current-timebox %.n) +.state) + + ?.(new-read +.state (upd-unreads:ha index current-timebox %.n)) notifications (put:orm notifications current-timebox new-timebox) == :: diff --git a/pkg/arvo/app/landscape/index.html b/pkg/arvo/app/landscape/index.html index a2a06dea17..bd6b1828d2 100644 --- a/pkg/arvo/app/landscape/index.html +++ b/pkg/arvo/app/landscape/index.html @@ -24,6 +24,6 @@
- +