Merge pull request #6785 from urbit/mf/gall-backups

gall: add scry endpoint to expose agent state
This commit is contained in:
Pyry Kovanen 2023-10-09 17:30:09 +03:00 committed by GitHub
commit bc03e809f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 35 deletions

View File

@ -2727,6 +2727,33 @@
+$ bitt (map duct (pair ship path)) :: incoming subs
+$ boat (map [=wire =ship =term] [acked=? =path]) :: outgoing subs
+$ boar (map [=wire =ship =term] nonce=@) :: and their nonces
::
+$ path-state
$: bob=(unit @ud)
fan=((mop @ud (pair @da (each page @uvI))) lte)
==
+$ stats :: statistics
$: change=@ud :: processed move count
eny=@uvJ :: entropy
time=@da :: current event time
==
+$ egg :: migratory agent state
$% [%nuke sky=(map spur @ud)] :: see /sys/gall $yoke
$: %live
control-duct=duct
run-nonce=@t
sub-nonce=@
=stats
=bitt
=boat
=boar
code=~
old-state=[%| vase]
=beak
marks=(map duct mark)
sky=(map spur path-state)
ken=(jug spar:ames wire)
== ==
+$ bowl :: standard app state
$: $: our=ship :: host
src=ship :: guest

View File

@ -104,26 +104,10 @@
ken=(jug spar:ames wire)
== ==
::
+$ path-state
$: bob=(unit @ud)
fan=((mop @ud (pair @da (each page @uvI))) lte)
==
::
++ on-path ((on @ud (pair @da (each page @uvI))) lte)
:: $blocked-move: enqueued move to an agent
::
+$ blocked-move [=duct =routes move=(each deal unto)]
:: $stats: statistics
::
:: change: how many moves this agent has processed
:: eny: entropy
:: time: date of current event processing
::
+$ stats [change=@ud eny=@uvJ time=@da]
:: $ames-response: network response message (%boon)
::
:: %d: fact
:: %x: quit
::
+$ ames-response
$% [%d =mark noun=*]
@ -173,25 +157,6 @@
=bug
leaves=(unit [=duct =wire date=@da])
==
:: $egg: migratory agent state; $yoke with .old-state instead of .agent
::
+$ egg
$% [%nuke sky=(map spur @ud)]
$: %live
control-duct=duct
run-nonce=@t
sub-nonce=@
=stats
=bitt
=boat
=boar
code=~
old-state=[%| vase]
=beak
marks=(map duct mark)
sky=(map spur path-state)
ken=(jug spar:ames wire)
== ==
--
:: adult gall vane interface, for type compatibility with pupa
::
@ -2340,6 +2305,24 @@
[~ ~]
[~ ~ atom+!>(u.nonce)]
::
?: ?& =(%v care)
=([%$ %da now] coin)
=(our ship)
==
=/ yok (~(get by yokes.state) dap)
?. ?=([~ %live *] yok)
[~ ~]
=/ =egg
%= u.yok
code ~
agent
:- %|
?: ?=(%| -.agent.u.yok)
p.agent.u.yok
on-save:p.agent.u.yok
==
``noun+!>([-:*spore egg])
::
?: ?& =(%w care)
=([%$ %da now] coin)
=(our ship)