From 3914c0c0dda9774da945232a243949c3c0a64509 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 17 Jun 2020 23:31:37 -0400 Subject: [PATCH] ota: works on my machine --- pkg/arvo/app/hood.hoon | 16 ++++++------ pkg/arvo/app/spider.hoon | 50 +++++++++++++++++++++++++++++++------ pkg/arvo/lib/hood/drum.hoon | 15 +++-------- pkg/arvo/lib/hood/helm.hoon | 2 +- pkg/arvo/lib/hood/kiln.hoon | 2 +- pkg/arvo/sys/vane/gall.hoon | 5 +++- 6 files changed, 60 insertions(+), 30 deletions(-) diff --git a/pkg/arvo/app/hood.hoon b/pkg/arvo/app/hood.hoon index 8af890b537..e85a03e0a2 100644 --- a/pkg/arvo/app/hood.hoon +++ b/pkg/arvo/app/hood.hoon @@ -53,10 +53,9 @@ =-(?>(?=(%kiln -<) ->) (~(got by lac.old) %kiln)) == == - =/ ver -.state - =^ d drum.state (on-load:drum-core ver drum.tup) - =^ h helm.state (on-load:helm-core ver helm.tup) - =^ k kiln.state (on-load:kiln-core ver kiln.tup) + =^ d drum.state (on-load:drum-core -.old drum.tup) + =^ h helm.state (on-load:helm-core -.old helm.tup) + =^ k kiln.state (on-load:kiln-core -.old kiln.tup) [:(weld d h k) this] :: ++ on-poke @@ -95,13 +94,14 @@ [%helm *] =^(c helm.state (take-agent:helm-core +<) [c this]) [%kiln *] =^(c kiln.state (take-agent:kiln-core +<) [c this]) == +:: TODO: symmetry between adding and stripping wire prefixes :: ++ on-arvo - |= [=wire =sign-arvo] + |= [=wire syn=sign-arvo] ^- step:agent:gall ?+ wire ~|([%hood-bad-wire wire] !!) - [%drum *] =^(c drum.state (take-arvo:drum-core +<) [c this]) - [%helm *] =^(c helm.state (take-arvo:helm-core +<) [c this]) - [%kiln *] =^(c kiln.state (take-arvo:kiln-core +<) [c this]) + [%drum *] =^(c drum.state (take-arvo:drum-core t.wire syn) [c this]) + [%helm *] =^(c helm.state (take-arvo:helm-core t.wire syn) [c this]) + [%kiln *] =^(c kiln.state (take-arvo:kiln-core t.wire syn) [c this]) == -- diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index ece6fe71dd..a6286ba8cb 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -19,8 +19,27 @@ tid=(map tid yarn) == :: ++$ clean-slate-any + $^ clean-slate-ket + $% clean-slate-sig + clean-slate + == +:: +$ clean-slate - $: starting=(map yarn [=trying =vase]) + $: %1 + starting=(map yarn [=trying =vase]) + running=(list yarn) + tid=(map tid yarn) + == +:: ++$ clean-slate-ket + $: starting=(map yarn [trying=?(%build %find %none) =vase]) + running=(list yarn) + tid=(map tid yarn) + == +:: ++$ clean-slate-sig + $: starting=~ running=(list yarn) tid=(map tid yarn) == @@ -117,12 +136,17 @@ ++ on-init on-init:def ++ on-save clean-state:sc ++ on-load + |^ |= old-state=vase - =+ !<(=clean-slate old-state) - =. tid.state tid.clean-slate + =+ !<(any=clean-slate-any old-state) + =? any ?=(^ -.any) (old-to-1 any) + =? any ?=(~ -.any) (old-to-1 any) + ?> ?=(%1 -.any) + :: + =. tid.state tid.any =/ yarns=(list yarn) - %+ welp running.clean-slate - ~(tap in ~(key by starting.clean-slate)) + %+ welp running.any + ~(tap in ~(key by starting.any)) |- ^- (quip card _this) ?~ yarns `this @@ -131,6 +155,12 @@ =^ cards-2 this $(yarns t.yarns) [(weld cards-1 cards-2) this] + :: + ++ old-to-1 + |= old=clean-slate-ket + ^- clean-slate + 1+old(starting (~(run by starting.old) |=([* v=vase] none+v))) + -- :: ++ on-poke |= [=mark =vase] @@ -350,9 +380,13 @@ :: ++ thread-fail-not-running |= [=tid =term =tang] + ^- (quip card ^state) =/ =yarn (~(got by tid.state) tid) - :- (thread-say-fail tid term tang) - state(starting (~(del by starting.state) yarn)) + :_ state(starting (~(del by starting.state) yarn)) + =/ moz (thread-say-fail tid term tang) + ?. ?=([~ %build *] (~(get by starting.state) yarn)) + moz + :_(moz [%pass /build/[tid] %arvo %c %warp our.bowl %home ~]) :: ++ thread-say-fail |= [=tid =term =tang] @@ -440,5 +474,5 @@ :: ++ clean-state !> ^- clean-slate - state(running (turn (tap-yarn running.state) head)) + 1+state(running (turn (tap-yarn running.state) head)) -- diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index 23fcc812b7..9080f130db 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -1,17 +1,9 @@ /- *sole /+ sole |% -+$ any-state $%(state [%1 pith-1]) ++$ any-state $%(state) +$ state [%2 pith-2] :: -++ pith-1 - %+ cork pith-2 :: - |:($:pith-2 +<(bin ((map bone source-1)))) :: -:: :: -++ source-1 :: - %+ cork source :: - |:($:source +<(mir ((pair @ud (list @c))))) :: style-less mir -:: :: ++ pith-2 :: $: eel/(set gill:gall) :: connect to ray/(set well:gall) :: @@ -212,9 +204,10 @@ == :: ++ on-load - |= [hood-version=?(%7) old=any-state] + |= [hood-version=?(%1 %2 %3 %4 %5 %6 %7) old=any-state] =< se-abet =< se-view - =. ..on-load + =. sat old + =? ..on-load (lte hood-version %4) =< (se-born | %home %goad) =< (se-born | %home %metadata-store) =< (se-born | %home %metadata-hook) diff --git a/pkg/arvo/lib/hood/helm.hoon b/pkg/arvo/lib/hood/helm.hoon index 5bca6778c6..c742effce9 100644 --- a/pkg/arvo/lib/hood/helm.hoon +++ b/pkg/arvo/lib/hood/helm.hoon @@ -35,7 +35,7 @@ ?~(caz this $(caz t.caz, this (emit i.caz))) :: ++ on-load - |= [hood-version=?(%7) old=any-state] + |= [hood-version=?(%1 %2 %3 %4 %5 %6 %7) old=any-state] =< abet =? old ?=(%0 -.old) (state-0-to-1 old) ?> ?=(%1 -.old) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 40d3396a49..466312264f 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -77,7 +77,7 @@ ~[leaf+"from {}" leaf+"on {}" leaf+"to {}"] :: ++ on-load - |= [hood-version=?(%7) old=any-state] + |= [hood-version=?(%1 %2 %3 %4 %5 %6 %7) old=any-state] =< abet =? . ?=(%0 -.old) =/ recognized-ota=(unit [syd=desk her=ship sud=desk]) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index eeea1970d1..892750bb1a 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -150,6 +150,9 @@ ^- [(list move) _adult-gate] ~> %slog.[0 leaf+"gall: molting"] ~< %slog.[0 leaf+"gall: molted"] + :: +molt should never notify its client about agent changes + :: + =- [(skip -< |=(move ?=([* %give %onto *] +<))) ->] =/ adult adult-core =. state.adult [%6 system-duct outstanding contacts yokes=~ blocked]:spore @@ -1277,7 +1280,7 @@ (ap-install(agent.current-agent agent) `old-state) ?~ error ap-core - (ap-error %load-failed u.error) + (mean >%load-failed< u.error) :: +ap-subscribe-as: apply %watch-as. :: ++ ap-subscribe-as