From 3ba3c09cc7307d262535db2cafca873c19fbc12c Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Sat, 11 Mar 2023 16:50:51 -0600 Subject: [PATCH] lull,gall: %grow compiles --- pkg/arvo/sys/lull.hoon | 3 +++ pkg/arvo/sys/vane/gall.hoon | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 358a42a744..b265a4d994 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -1827,6 +1827,9 @@ [%nuke =dude] :: delete agent [%doff dude=(unit dude) ship=(unit ship)] :: kill subscriptions [%rake dude=(unit dude) all=?] :: reclaim old subs + [%grow =path =noun] :: bind scry path + [%tomb =path] :: replace with hash + [%cull =path] :: delete older $>(%init vane-task) :: set owner $>(%trim vane-task) :: trim state $>(%vega vane-task) :: report upgrade diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 8ce10c6552..4af0004ad1 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -27,6 +27,9 @@ same (slog print) :: +++ scrub-case |=(=path (snap path 5 '')) +++ snag-case |=(=path (slav %ud (snag 5 path))) +:: :: $bug: debug printing configuration :: :: veb: verbosity toggles @@ -60,8 +63,14 @@ contacts=(set ship) yokes=(map term yoke) blocked=(map term (qeu blocked-move)) + sky=(map path path-state) =bug == +:: ++$ path-state + $: bob=(unit @ud) + fan=(map @ud (each noun @uvI)) + == :: $routes: new cuff; TODO: document :: +$ routes @@ -155,6 +164,7 @@ contacts=(set ship) eggs=(map term egg) blocked=(map term (qeu blocked-move)) + sky=(map path path-state) =bug == :: $egg: migratory agent state; $yoke with .old-state instead of .agent @@ -253,6 +263,42 @@ ?~ apps mo-core =/ ap-core (ap-yoke:ap p.i.apps [~ our] q.i.apps) $(apps t.apps, mo-core ap-abet:(ap-rake:ap-core all)) + :: + ++ mo-grow + |= [=path =noun] + ^+ mo-core + =/ pit (scrub-case path) + =/ yon (snag-case path) + =/ old (~(get by sky.state) pit) + ?~ old :: insert binding at new path + =. sky.state + %+ ~(put by sky.state) pit + `(~(put by fan:*path-state) yon [%& noun]) + mo-core + =/ val (~(get by fan.u.old) yon) + ?~ val :: insert binding at new case + =. sky.state + %+ ~(put by sky.state) pit + u.old(fan (~(put by fan.u.old) yon [%& noun])) + mo-core + ?- -.u.val + %& ?> =(p.u.val noun) :: re-bind same value or die + mo-core + %| ?> =(p.u.val (shax (jam noun))) :: reinflate tombstoned case + =. sky.state + %+ ~(put by sky.state) pit + u.old(fan (~(put by fan.u.old) yon [%& noun])) + mo-core + == + :: + ++ mo-tomb + |= =path + ^+ mo-core + !! + ++ mo-cull + |= =path + ^+ mo-core + !! :: +mo-receive-core: receives an app core built by %ford. :: :: Presuming we receive a good core, we first check to see if the agent @@ -1752,6 +1798,9 @@ %nuke mo-abet:(mo-nuke:mo-core dude.task) %doff mo-abet:(mo-doff:mo-core +.task) %rake mo-abet:(mo-rake:mo-core +.task) + %grow mo-abet:(mo-grow:mo-core +.task) + %tomb mo-abet:(mo-tomb:mo-core +.task) + %cull mo-abet:(mo-cull:mo-core +.task) %spew mo-abet:(mo-spew:mo-core veb.task) %sift mo-abet:(mo-sift:mo-core dudes.task) %trim [~ gall-payload] @@ -1887,6 +1936,7 @@ ^- spore %= old - %11 + bug [*(map path path-state) bug.old] eggs %- ~(urn by eggs.old) |= [a=term e=egg-10]