lull,gall: switch to per-agent scry bindings

This commit is contained in:
Ted Blackman 2023-03-11 18:35:55 -06:00 committed by ~wicrum-wicrun
parent fc14b21815
commit c69e71e83f
2 changed files with 123 additions and 65 deletions

View File

@ -2866,9 +2866,9 @@
[%nuke =dude] :: delete agent [%nuke =dude] :: delete agent
[%doff dude=(unit dude) ship=(unit ship)] :: kill subscriptions [%doff dude=(unit dude) ship=(unit ship)] :: kill subscriptions
[%rake dude=(unit dude) all=?] :: reclaim old subs [%rake dude=(unit dude) all=?] :: reclaim old subs
[%grow =path =noun] :: bind scry path [%grow =dude =case =spur =noun] :: bind scry path
[%tomb =path] :: replace with hash [%tomb =dude =case =spur] :: replace with hash
[%cull =path] :: delete older [%cull =dude =case =spur] :: delete older
$>(%init vane-task) :: set owner $>(%init vane-task) :: set owner
$>(%trim vane-task) :: trim state $>(%trim vane-task) :: trim state
$>(%vega vane-task) :: report upgrade $>(%vega vane-task) :: report upgrade
@ -2906,6 +2906,9 @@
$% [%arvo =note-arvo] $% [%arvo =note-arvo]
[%agent [=ship name=term] =deal] [%agent [=ship name=term] =deal]
[%pyre =tang] [%pyre =tang]
[%grow =case =spur =noun]
[%tomb =case =spur]
[%cull =case =spur]
== ==
+$ deal +$ deal
$% [%raw-poke =mark =noun] $% [%raw-poke =mark =noun]
@ -2930,6 +2933,10 @@
$% [%agent [=ship name=term] =task] $% [%agent [=ship name=term] =task]
[%arvo note-arvo] [%arvo note-arvo]
[%pyre =tang] [%pyre =tang]
::
[%grow =case =spur =noun]
[%tomb =case =spur]
[%cull =case =spur]
== ==
+$ task +$ task
$% [%watch =path] $% [%watch =path]

View File

@ -45,9 +45,9 @@
:: $move: Arvo-level move :: $move: Arvo-level move
:: ::
+$ move [=duct move=(wind note-arvo gift-arvo)] +$ move [=duct move=(wind note-arvo gift-arvo)]
:: $state-11: overall gall state, versioned :: $state-12: overall gall state, versioned
:: ::
+$ state-11 [%11 state] +$ state-12 [%12 state]
:: $state: overall gall state :: $state: overall gall state
:: ::
:: system-duct: TODO document :: system-duct: TODO document
@ -63,16 +63,8 @@
contacts=(set ship) contacts=(set ship)
yokes=(map term yoke) yokes=(map term yoke)
blocked=(map term (qeu blocked-move)) blocked=(map term (qeu blocked-move))
sky=(map path path-state)
=bug =bug
== ==
::
+$ path-state
$: bob=(unit @ud)
fan=((mop @ud (each noun @uvI)) lte)
==
::
++ on-path ((on @ud (each noun @uvI)) lte)
:: $routes: new cuff; TODO: document :: $routes: new cuff; TODO: document
:: ::
+$ routes +$ routes
@ -92,6 +84,7 @@
:: agent: agent core :: agent: agent core
:: beak: compilation source :: beak: compilation source
:: marks: mark conversion requests :: marks: mark conversion requests
:: sky: scry bindings
:: ::
+$ yoke +$ yoke
$: control-duct=duct $: control-duct=duct
@ -105,7 +98,15 @@
agent=(each agent vase) agent=(each agent vase)
=beak =beak
marks=(map duct mark) marks=(map duct mark)
sky=(map spur path-state)
== ==
::
+$ path-state
$: bob=(unit @ud)
fan=((mop @ud (each noun @uvI)) lte)
==
::
++ on-path ((on @ud (each noun @uvI)) lte)
:: $blocked-move: enqueued move to an agent :: $blocked-move: enqueued move to an agent
:: ::
+$ blocked-move [=duct =routes move=(each deal unto)] +$ blocked-move [=duct =routes move=(each deal unto)]
@ -160,13 +161,12 @@
:: $spore: structures for update, produced by +stay :: $spore: structures for update, produced by +stay
:: ::
+$ spore +$ spore
$: %11 $: %12
system-duct=duct system-duct=duct
outstanding=(map [wire duct] (qeu remote-request)) outstanding=(map [wire duct] (qeu remote-request))
contacts=(set ship) contacts=(set ship)
eggs=(map term egg) eggs=(map term egg)
blocked=(map term (qeu blocked-move)) blocked=(map term (qeu blocked-move))
sky=(map path path-state)
=bug =bug
== ==
:: $egg: migratory agent state; $yoke with .old-state instead of .agent :: $egg: migratory agent state; $yoke with .old-state instead of .agent
@ -183,11 +183,12 @@
old-state=[%| vase] old-state=[%| vase]
=beak =beak
marks=(map duct mark) marks=(map duct mark)
sky=(map spur path-state)
== ==
-- --
:: adult gall vane interface, for type compatibility with pupa :: adult gall vane interface, for type compatibility with pupa
:: ::
=| state=state-11 =| state=state-12
|= [now=@da eny=@uvJ rof=roof] |= [now=@da eny=@uvJ rof=roof]
=* gall-payload . =* gall-payload .
~% %gall-top ..part ~ ~% %gall-top ..part ~
@ -267,22 +268,20 @@
$(apps t.apps, mo-core ap-abet:(ap-rake:ap-core all)) $(apps t.apps, mo-core ap-abet:(ap-rake:ap-core all))
:: ::
++ mo-grow ++ mo-grow
|= [=path =noun] |= [=dude =case =spur =noun]
^+ mo-core ^+ mo-core
:: TODO check if path makes any sense :: TODO check if path makes any sense
:: - from our ship (or signed by other ship?)
:: - not claiming to be another vane (or agent?)
:: - has a numeric case
:: - up only? :: - up only?
:: - enforce no skipped aeons? :: - enforce no skipped aeons?
=/ pit (scrub-case path) =/ yoke (~(got by yokes.state) dude)
=/ yon (snag-case path) =- mo-core(yokes.state (~(put by yokes.state) dude yoke(sky -)))
=/ old (~(get by sky.state) pit) =/ sky sky.yoke
^+ sky
=/ yon ?>(?=(%ud -.case) p.case)
=/ old (~(get by sky) spur)
?~ old :: insert binding at new path ?~ old :: insert binding at new path
=. sky.state %+ ~(put by sky) spur
%+ ~(put by sky.state) pit `(put:on-path fan:*path-state yon [%& noun])
`(put:on-path fan:*path-state yon [%& noun])
mo-core
=> ?~ bob.u.old => ?~ bob.u.old
. .
~| gall-grow-bob+[path actual=yon max=u.bob.u.old] ~| gall-grow-bob+[path actual=yon max=u.bob.u.old]
@ -290,52 +289,49 @@
. .
=/ val (get:on-path fan.u.old yon) =/ val (get:on-path fan.u.old yon)
?~ val :: insert binding at new case ?~ val :: insert binding at new case
=. sky.state %+ ~(put by sky) spur
%+ ~(put by sky.state) pit u.old(fan (put:on-path fan.u.old yon [%& noun]))
u.old(fan (put:on-path fan.u.old yon [%& noun]))
mo-core
?- -.u.val ?- -.u.val
%& ?> =(p.u.val noun) :: re-bind same value or die %& ?> =(p.u.val noun) :: re-bind same value or die
mo-core sky
%| ?> =(p.u.val (shax (jam noun))) :: reinflate tombstoned case %| ?> =(p.u.val (shax (jam noun))) :: reinflate tombstoned case
=. sky.state %+ ~(put by sky) spur
%+ ~(put by sky.state) pit u.old(fan (put:on-path fan.u.old yon [%& noun]))
u.old(fan (put:on-path fan.u.old yon [%& noun]))
mo-core
== ==
:: ::
++ mo-tomb ++ mo-tomb
|= =path |= [=dude =case =spur]
^+ mo-core ^+ mo-core
=/ pit (scrub-case path) =/ yoke (~(got by yokes.state) dude)
=/ yon (snag-case path) =- mo-core(yokes.state (~(put by yokes.state) dude yoke(sky -)))
=/ old (~(get by sky.state) pit) =/ sky sky.yoke
=/ yon ?>(?=(%ud -.case) p.case)
=/ old (~(get by sky) spur)
?~ old :: no-op if nonexistent ?~ old :: no-op if nonexistent
mo-core :: TODO trace sky :: TODO trace
=/ val (get:on-path fan.u.old yon) =/ val (get:on-path fan.u.old yon)
?~ val :: no-op if nonexistent ?~ val :: no-op if nonexistent
mo-core :: TODO trace sky :: TODO trace
?- -.u.val ?- -.u.val
%| mo-core :: already tombstoned %| sky :: already tombstoned
%& %&
=. sky.state :: replace with hash %+ ~(put by sky) spur :: replace with hash
%+ ~(put by sky.state) pit u.old(fan (put:on-path fan.u.old yon [%| (shax (jam p.u.val))]))
u.old(fan (put:on-path fan.u.old yon [%| (shax (jam p.u.val))]))
mo-core
== ==
:: ::
++ mo-cull ++ mo-cull
|= =path |= [=dude =case =spur]
^+ mo-core ^+ mo-core
=/ pit (scrub-case path) =/ yoke (~(got by yokes.state) dude)
=/ yon (snag-case path) =- mo-core(yokes.state (~(put by yokes.state) dude yoke(sky -)))
=/ old (~(get by sky.state) pit) =/ sky sky:(~(got by yokes.state) dude)
^+ sky
=/ yon ?>(?=(%ud -.case) p.case)
=/ old (~(get by sky) spur)
?~ old :: no-op if nonexistent ?~ old :: no-op if nonexistent
mo-core :: TODO trace sky :: TODO trace
=. sky.state :: delete all older paths %+ ~(put by sky) spur :: delete all older paths
%+ ~(put by sky.state) pit [`yon (lot:on-path fan.u.old `+(yon) ~)]
[`yon (lot:on-path fan.u.old `+(yon) ~)]
mo-core
:: +mo-receive-core: receives an app core built by %ford. :: +mo-receive-core: receives an app core built by %ford.
:: ::
:: Presuming we receive a good core, we first check to see if the agent :: Presuming we receive a good core, we first check to see if the agent
@ -1108,10 +1104,11 @@
== ==
=. wire =. wire
:^ %use agent-name run-nonce.yoke :^ %use agent-name run-nonce.yoke
?- -.neet ?- -.neet
%agent [%out (scot %p ship.neet) name.neet wire] %agent [%out (scot %p ship.neet) name.neet wire]
%huck [%out (scot %p ship.neet) name.neet wire] %huck [%out (scot %p ship.neet) name.neet wire]
%arvo [(scot %p attributing.agent-routes) wire] ?(%arvo %grow %tomb %cull)
[(scot %p attributing.agent-routes) wire]
== ==
:: ::
=/ =note-arvo =/ =note-arvo
@ -1119,6 +1116,9 @@
%arvo note-arvo.neet %arvo note-arvo.neet
%huck note-arvo.neet %huck note-arvo.neet
%agent [%g %deal [our ship.neet] [name deal]:neet] %agent [%g %deal [our ship.neet] [name deal]:neet]
%grow [%g %grow agent-name [case spur noun]:neet]
%tomb [%g %tomb agent-name [case spur]:neet]
%cull [%g %cull agent-name [case spur]:neet]
== ==
[duct %pass wire note-arvo]~ [duct %pass wire note-arvo]~
== ==
@ -1851,10 +1851,33 @@
=? old ?=(%8 -.old) (spore-8-to-9 old) =? old ?=(%8 -.old) (spore-8-to-9 old)
=? old ?=(%9 -.old) (spore-9-to-10 old) =? old ?=(%9 -.old) (spore-9-to-10 old)
=? old ?=(%10 -.old) (spore-10-to-11 old) =? old ?=(%10 -.old) (spore-10-to-11 old)
?> ?=(%11 -.old) =? old ?=(%11 -.old) (spore-11-to-12 old)
?> ?=(%12 -.old)
gall-payload(state old) gall-payload(state old)
:: ::
+$ spore-any $%(spore spore-7 spore-8 spore-9 spore-10) +$ spore-any $%(spore spore-7 spore-8 spore-9 spore-10 spore-11)
+$ spore-11
$: %11
system-duct=duct
outstanding=(map [wire duct] (qeu remote-request))
contacts=(set ship)
eggs=(map term egg-11)
blocked=(map term (qeu blocked-move))
=bug
==
+$ egg-11
$: control-duct=duct
run-nonce=@t
sub-nonce=@
=stats
=bitt
=boat
=boar
code=~
old-state=[%| vase]
=beak
marks=(map duct mark)
==
+$ spore-10 +$ spore-10
$: %10 $: %10
system-duct=duct system-duct=duct
@ -1964,20 +1987,33 @@
%+ murn ~(tap to q) %+ murn ~(tap to q)
|=(r=remote-request-9 ?:(?=(%cork r) ~ `r)) |=(r=remote-request-9 ?:(?=(%cork r) ~ `r))
:: ::
:: added sky
::
++ spore-11-to-12
|= old=spore-11
^- spore
%= old
- %12
eggs
%- ~(urn by eggs.old)
|= [a=term e=egg-11]
^- egg
e(marks [marks.e sky:*egg])
==
::
:: removed live :: removed live
:: changed old-state from (each vase vase) to [%| vase] :: changed old-state from (each vase vase) to [%| vase]
:: added code :: added code
:: ::
++ spore-10-to-11 ++ spore-10-to-11
|= old=spore-10 |= old=spore-10
^- spore ^- spore-11
%= old %= old
- %11 - %11
bug [*(map path path-state) bug.old]
eggs eggs
%- ~(urn by eggs.old) %- ~(urn by eggs.old)
|= [a=term e=egg-10] |= [a=term e=egg-10]
^- egg ^- egg-11
e(|3 |4.e(|4 `|8.e(old-state [%| p.old-state.e]))) e(|3 |4.e(|4 `|8.e(old-state [%| p.old-state.e])))
== ==
-- --
@ -1993,6 +2029,21 @@
=/ =coin $/r.bem =/ =coin $/r.bem
=* path s.bem =* path s.bem
:: ::
?: ?=(%a care)
?. =(p.bem our) ~
=/ yok (~(get by yokes.state) q.bem)
?~ yok ~
=/ ski (~(get by sky.u.yok) s.bem)
?~ ski ~
?. ?=(%ud -.r.bem) ~
=/ res (get:on-path fan.u.ski p.r.bem)
?~ res ~
?- -.u.res
%| ~
%& ``[%noun %noun p.u.res]
==
:: TODO new care to ask for hash of a sky binding
::
?. ?=(%.y -.shop) ?. ?=(%.y -.shop)
~ ~
=/ =ship p.shop =/ =ship p.shop