Merge branch 'develop' into i/5788/remote-scry

This commit is contained in:
yosoyubik 2023-04-22 16:07:44 +02:00
commit 5bbd727f18
7 changed files with 126 additions and 73 deletions

View File

@ -1104,14 +1104,14 @@
== == == ==
$: %9 $: %9
$% $: %larva $% $: %larva
events=(qeu queued-event) events=(qeu queued-event-11)
state=ames-state-9 state=ames-state-9
== ==
[%adult state=ames-state-9] [%adult state=ames-state-9]
== == == ==
$: %10 $: %10
$% $: %larva $% $: %larva
events=(qeu queued-event) events=(qeu queued-event-11)
state=ames-state-10 state=ames-state-10
== ==
[%adult state=ames-state-10] [%adult state=ames-state-10]
@ -1137,7 +1137,7 @@
== ==
[%adult state=_ames-state.adult-gate] [%adult state=_ames-state.adult-gate]
== == == == == ==
?- old |^ ?- old
[%4 %adult *] [%4 %adult *]
$(old [%5 %adult (state-4-to-5:load:adult-core state.old)]) $(old [%5 %adult (state-4-to-5:load:adult-core state.old)])
:: ::
@ -1197,7 +1197,7 @@
[%9 %larva *] [%9 %larva *]
~> %slog.0^leaf/"ames: larva: load" ~> %slog.0^leaf/"ames: larva: load"
=. cached-state `[%9 state.old] =. cached-state `[%9 state.old]
=. queued-events events.old =. queued-events (event-11-to-12 events.old)
larval-gate larval-gate
:: ::
[%10 %adult *] [%10 %adult *]
@ -1208,7 +1208,7 @@
[%10 %larva *] [%10 %larva *]
~> %slog.1^leaf/"ames: larva: load" ~> %slog.1^leaf/"ames: larva: load"
=. cached-state `[%10 state.old] =. cached-state `[%10 state.old]
=. queued-events events.old =. queued-events (event-11-to-12 events.old)
larval-gate larval-gate
:: ::
[%11 %adult *] [%11 %adult *]
@ -1219,17 +1219,7 @@
[%11 %larva *] [%11 %larva *]
~> %slog.1^leaf/"ames: larva: load" ~> %slog.1^leaf/"ames: larva: load"
=. cached-state `[%11 state.old] =. cached-state `[%11 state.old]
=. queued-events =. queued-events (event-11-to-12 events.old)
:: "+rep:in on a +qeu looks strange, but works fine."
::
%- ~(rep in events.old)
|= [e=queued-event-11 q=(qeu queued-event)]
%- ~(put to q) ^- queued-event
?. ?=(%call -.e) e
=/ task=task-11 ((harden task-11) wrapped-task.e)
%= e
wrapped-task ?.(?=(%snub -.task) task [%snub %deny ships.task])
==
larval-gate larval-gate
:: ::
[%12 %adult *] [%12 %adult *]
@ -1252,6 +1242,21 @@
larval-gate larval-gate
:: ::
== ==
::
++ event-11-to-12
|= events=(qeu queued-event-11)
^- (qeu queued-event)
:: "+rep:in on a +qeu looks strange, but works fine."
::
%- ~(rep in events)
|= [e=queued-event-11 q=(qeu queued-event)]
%- ~(put to q) ^- queued-event
?. ?=(%call -.e) e
=/ task=task-11 ((harden task-11) wrapped-task.e)
%= e
wrapped-task ?.(?=(%snub -.task) task [%snub %deny ships.task])
==
--
:: +molt: re-evolve to adult-ames :: +molt: re-evolve to adult-ames
:: ::
++ molt ++ molt
@ -2469,6 +2474,14 @@
~| %dangling-bone^her^bone ~| %dangling-bone^her^bone
(~(got by by-bone.ossuary.peer-state) bone) (~(got by by-bone.ossuary.peer-state) bone)
:: ::
++ is-corked
|= =bone
?| (~(has in corked.peer-state) bone)
?& =(1 (end 0 bone))
=(1 (end 0 (rsh 0 bone)))
(~(has in corked.peer-state) (mix 0b10 bone))
== ==
::
+| %tasks +| %tasks
:: ::
++ on-heed ++ on-heed
@ -2518,8 +2531,7 @@
abet:(call:(abed:mi bone) %hear lane shut-packet ?=(~ dud)) abet:(call:(abed:mi bone) %hear lane shut-packet ?=(~ dud))
:: benign ack on corked bone :: benign ack on corked bone
:: ::
?: (~(has in corked.peer-state) bone) ?: (is-corked bone) peer-core
peer-core
:: Just try again on error, printing trace :: Just try again on error, printing trace
:: ::
:: Note this implies that vanes should never crash on %done, :: Note this implies that vanes should never crash on %done,
@ -2600,10 +2612,10 @@
=(1 current:(~(got by snd.peer-state) bone)) =(1 current:(~(got by snd.peer-state) bone))
== ==
(send-blob | her (attestation-packet [her her-life]:channel)) (send-blob | her (attestation-packet [her her-life]:channel))
?: (~(has in corked.peer-state) bone) ?: (is-corked bone)
:: if the bone was corked the flow doesn't exist anymore :: no-op if the bone (or, if a naxplanation, the reference bone)
:: TODO: clean up corked bones in the peer state when it's _safe_? :: was corked, because the flow doesn't exist anymore
:: (e.g. if this bone is N blocks behind the next one) :: TODO: clean up corked bones?
:: ::
peer-core peer-core
:: maybe resend some timed out packets :: maybe resend some timed out packets
@ -2765,21 +2777,23 @@
:: ::
++ handle-cork ++ handle-cork
|= =bone |= =bone
^+ peer-core |^ ^+ peer-core
?. (~(has in closing.peer-state) bone) peer-core ?. (~(has in closing.peer-state) bone) peer-core
=/ =message-pump-state =/ pump=message-pump-state
(~(gut by snd.peer-state) bone *message-pump-state) (~(gut by snd.peer-state) bone *message-pump-state)
=? peer-core ?=(^ next-wake.packet-pump-state.message-pump-state) =? event-core ?=(^ next-wake.packet-pump-state.pump)
=* next-wake u.next-wake.packet-pump-state.message-pump-state :: reset-timer for boons
=/ =wire (make-pump-timer-wire her bone)
:: resetting timer for boons
:: ::
(pe-emit [/ames]~ %pass wire %b %rest next-wake) (reset-timer her bone u.next-wake.packet-pump-state.pump)
=/ nax-bone=^bone (mix 0b10 bone) =/ nax-bone=^bone (mix 0b10 bone)
=? peer-core (~(has by snd.peer-state) nax-bone) =/ nax-pump=message-pump-state
%. peer-core (~(gut by snd.peer-state) nax-bone *message-pump-state)
%+ pe-trace odd.veb =? event-core ?=(^ next-wake.packet-pump-state.nax-pump)
%- %^ ev-trace odd.veb her
|.("remove naxplanation flow {<[her bone=nax-bone]>}") |.("remove naxplanation flow {<[her bone=nax-bone]>}")
:: reset timer for naxplanations
::
(reset-timer her nax-bone u.next-wake.packet-pump-state.nax-pump)
=. peer-state =. peer-state
=, peer-state =, peer-state
%_ peer-state %_ peer-state
@ -2792,6 +2806,11 @@
== ==
peer-core peer-core
:: ::
++ reset-timer
|= [=ship =^bone wake=@da]
(emit [/ames]~ %pass (make-pump-timer-wire ship bone) %b %rest wake)
--
::
+| %internals +| %internals
:: +mu: constructor for |pump message sender core :: +mu: constructor for |pump message sender core
:: ::

View File

@ -108,10 +108,9 @@
[duct card] [duct card]
=/ =tang =/ =tang
(weld u.error `tang`[leaf/"drip failed" ~]) (weld u.error `tang`[leaf/"drip failed" ~])
:: XX should be :: XX we don't know the mote due to the %wake pattern
:: [duct %hurl fail/tang card]
:: ::
[duct %pass /drip-slog %d %flog %crud %drip-fail tang] [duct %hurl fail/tang card]
:: ::
+| %tasks +| %tasks
:: ::

View File

@ -1404,7 +1404,7 @@
`[[care.mood case.mood syd] path.mood cage]:[u.res syd=syd] `[[care.mood case.mood syd] path.mood cage]:[u.res syd=syd]
?~ ref ?~ ref
[%give %writ riot] [%give %writ riot]
[%slip %b %drip !>([%writ riot])] [%pass /drip %b %drip !>([%writ riot])]
:: ::
++ case-to-date ++ case-to-date
|= =case |= =case
@ -3921,7 +3921,7 @@
(~(run in moods) |=(m=mood [care.m path.m])) (~(run in moods) |=(m=mood [care.m path.m]))
=/ gift [%wris cas res] =/ gift [%wris cas res]
?: ?=(^ ref) ?: ?=(^ ref)
[%slip %b %drip !>(gift)] [%pass /drip %b %drip !>(gift)] :: XX s/b [%behn %wris ...] in $sign?
[%give gift] [%give gift]
?> ?=([* ~ ~] res) ?> ?=([* ~ ~] res)
:_ ~ :_ ~
@ -6065,7 +6065,25 @@
|= [tea=wire hen=duct dud=(unit goof) hin=sign] |= [tea=wire hen=duct dud=(unit goof) hin=sign]
^+ [*(list move) ..^$] ^+ [*(list move) ..^$]
?^ dud ?^ dud
?+ tea
~|(%clay-take-dud (mean tang.u.dud)) ~|(%clay-take-dud (mean tang.u.dud))
::
[%drip ~]
%. [~ ..^$]
%- slog
^- tang
:* 'clay: drip fail'
[%rose [": " "" ""] 'bail' mote.u.dud ~]
tang.u.dud
==
==
::
:: pseudo %slip on %drip
::
?: ?=([%drip ~] tea)
?> ?=([?(%behn %clay) ?(%writ %wris) *] hin)
[[`move`[hen %give +.hin] ~] ..^$]
::
?: ?=([%lu %load *] tea) ?: ?=([%lu %load *] tea)
?> ?=(%unto +<.hin) ?> ?=(%unto +<.hin)
?> ?=(%poke-ack -.p.hin) ?> ?=(%poke-ack -.p.hin)
@ -6273,7 +6291,7 @@
~(tap in ducts) ~(tap in ducts)
=/ cancel-moves=(list move) =/ cancel-moves=(list move)
%+ turn cancel-ducts %+ turn cancel-ducts
|=(=duct [duct %slip %b %drip !>([%writ ~])]) |=(=duct [duct %pass /drip %b %drip !>([%writ ~])])
:: delete local state of foreign desk :: delete local state of foreign desk
:: ::
=. hoy.ruf (~(del by hoy.ruf) who) =. hoy.ruf (~(del by hoy.ruf) who)

View File

@ -1348,13 +1348,13 @@
:: ::
=/ heartbeat-time=@da (add now ~s20) =/ heartbeat-time=@da (add now ~s20)
=/ heartbeat (set-heartbeat-move channel-id heartbeat-time) =/ heartbeat (set-heartbeat-move channel-id heartbeat-time)
:: clear the event queue, record the duct for future output and :: record the duct for future output and
:: record heartbeat-time for possible future cancel :: record heartbeat-time for possible future cancel
:: ::
=. session.channel-state.state =. session.channel-state.state
%+ ~(jab by session.channel-state.state) channel-id %+ ~(jab by session.channel-state.state) channel-id
|= =channel |= =channel
channel(events ~, state [%| duct], heartbeat (some [heartbeat-time duct])) channel(state [%| duct], heartbeat (some [heartbeat-time duct]))
:: ::
[[heartbeat :(weld http-moves cancel-moves moves)] state] [[heartbeat :(weld http-moves cancel-moves moves)] state]
:: +acknowledge-events: removes events before :last-event-id on :channel-id :: +acknowledge-events: removes events before :last-event-id on :channel-id

View File

@ -26,13 +26,6 @@
&+[leaf+"OK {name}"]~ &+[leaf+"OK {name}"]~
|+(flop `tang`[leaf+"FAILED {name}" p.run]) |+(flop `tang`[leaf+"FAILED {name}" p.run])
== ==
:: +filter-tests-by-prefix: TODO document
::
++ filter-tests-by-prefix
|= [prefix=path tests=(list test)]
^+ tests
=/ prefix-length=@ud (lent prefix)
(skim tests |=([p=path *] =(prefix (scag prefix-length p))))
:: +resolve-test-paths: add test names to file paths to form full identifiers :: +resolve-test-paths: add test names to file paths to form full identifiers
:: ::
++ resolve-test-paths ++ resolve-test-paths
@ -130,15 +123,11 @@
gather-tests(fiz t.fiz, build-ok |) gather-tests(fiz t.fiz, build-ok |)
~> %slog.0^leaf+"built {(spud s.beam.i.fiz)}" ~> %slog.0^leaf+"built {(spud s.beam.i.fiz)}"
=/ arms=(list test-arm) (get-test-arms u.cor) =/ arms=(list test-arm) (get-test-arms u.cor)
:: :: if test path specified an arm prefix, filter arms to match
:: XX this logic appears to be vestigial
::
=? arms ?=(^ test.i.fiz) =? arms ?=(^ test.i.fiz)
|- ^+ arms %+ skim arms
?~ arms ~|(no-test-arm+i.fiz !!) |= test-arm
?: =(name.i.arms u.test.i.fiz) =((end [3 (met 3 u.test.i.fiz)] name) u.test.i.fiz)
[i.arms]~
$(arms t.arms)
=. test-arms (~(put by test-arms) (snip s.beam.i.fiz) arms) =. test-arms (~(put by test-arms) (snip s.beam.i.fiz) arms)
gather-tests(fiz t.fiz) gather-tests(fiz t.fiz)
%- pure:m !> ^= ok %- pure:m !> ^= ok

View File

@ -237,10 +237,27 @@
%+ ~(put by pub) path %+ ~(put by pub) path
=/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok) =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
=. wav.tide (put:wav wav.tide next wave) =. wav.tide (put:wav wav.tide next wave)
=. mem.tide (~(del by mem.tide) next) =. mem.tide ~
?. =(next (add aeon.last waves.rul.tide)) buoy ?. =(next (add aeon.last waves.rul.tide)) buoy
buoy(tid (form tide)) buoy(tid (form tide))
:: ::
++ fork :: Fork a pub into an empty path.
|= [from=paths to=paths]
^- pubs
:- %0
?< (~(has by pub) to)
(~(put by pub) to (~(got by pub) from))
::
++ copy :: Fork a sub into an empty path.
|= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
^- pubs
:- %0
?< (~(has by pub) to)
%+ ~(put by pub) to
%* . *$<(aeon buoy)
rok.tid (put:rok ~ [aeon rock]:(need (~(got by +:sub) from)))
==
::
++ perm :: Change permissions with gate. ++ perm :: Change permissions with gate.
|= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))] |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
^- pubs ^- pubs

View File

@ -31,6 +31,18 @@
++ $ ++ $
|= [? ? ? ? ?] |= [? ? ? ? ?]
(report-vats:abed +<) (report-vats:abed +<)
::
++ kel-path
|= =desk
^- path
/[ego]/[desk]/[wen]/sys/kelvin
::
++ desk-exists
|= =desk
?& !=(ud.cass 0):.^(=cass %cw /[ego]/[desk]/[wen])
.^(? %cu (kel-path desk))
==
::
++ abed ++ abed
%= ..abed %= ..abed
cone .^(^cone %cx /[ego]//[wen]/domes) cone .^(^cone %cx /[ego]//[wen]/domes)
@ -47,7 +59,7 @@
|= desk=_`desk`%base |= desk=_`desk`%base
=/ pike (~(got by pikes) desk) =/ pike (~(got by pikes) desk)
=/ zest -:(~(got by rock) desk) =/ zest -:(~(got by rock) desk)
=/ kel-path /[ego]/[desk]/[wen]/sys/kelvin =/ kel-path (kel-path desk)
=/ sink=sink =/ sink=sink
?~ s=(~(get by sor) desk) ?~ s=(~(get by sor) desk)
~ ~
@ -62,8 +74,6 @@
desk=desk desk=desk
^= running =(%live zest) ^= running =(%live zest)
^= suspended =(%dead zest) ^= suspended =(%dead zest)
^= exists !=(ud.cass 0):.^(=cass %cw /[ego]/[desk]/[wen])
^= bad-desk ?!(.^(? %cu kel-path))
^= meb :: =(list @uv) ^= meb :: =(list @uv)
?~ sink [hash]~ ?~ sink [hash]~
(mergebase-hashes our desk now her.u.sink sud.u.sink) (mergebase-hashes our desk now her.u.sink sud.u.sink)
@ -90,6 +100,7 @@
!=(%live zest.pike) !=(%live zest.pike)
!(~(has in wic.pike) kel) !(~(has in wic.pike) kel)
== == == ==
::
++ report-vats ++ report-vats
|= $: verb=? |= $: verb=?
show-suspended=? show-suspended=?
@ -97,33 +108,33 @@
show-blocking=? show-blocking=?
show-nonexistent=? show-nonexistent=?
== ==
=/ [real=(list desk) fake=(list desk)]
(skid ~(tap in desks) desk-exists)
=; reals=tang
?. show-nonexistent
reals
%+ weld reals
`tang`(turn fake |=(=desk leaf+"nonexistent desk: {<desk>}"))
%+ turn %+ turn
%+ skim %+ skim (turn real vat-info)
%+ turn ~(tap in desks)
|= =desk (vat-info desk)
|= vat-info |= vat-info
:: just unconditionally show "bad" desks, whatever that means ?| &(suspended show-suspended)
?| bad-desk
&(suspended show-suspended)
&(running show-running) &(running show-running)
&(blocking show-blocking) &(blocking show-blocking)
&(!exists show-nonexistent)
== ==
|= =vat-info |= =vat-info
^- tank
:+ %rose [" " " " "::"] :+ %rose [" " " " "::"]
:- leaf+"{<desk.vat-info>}" :- leaf+"{<desk.vat-info>}"
%- flop %- flop
%- report-vat %- report-vat
[verb vat-info] [verb vat-info]
::
++ report-vat ++ report-vat
|= [verb=? vat-info] |= [verb=? vat-info]
^- tang ^- tang
?: !exists
~[leaf+"desk does not yet exist: {<desk>}"]
?: =(%kids desk) ?: =(%kids desk)
~[leaf+"%kids %cz hash: {<hash>}"] ~[leaf+"%kids %cz hash: {<hash>}"]
?: bad-desk
~[leaf+"bad desk: {<desk>}"]
%- flop %- flop
?. verb ?. verb
:~ leaf/"/sys/kelvin: {kul}" :~ leaf/"/sys/kelvin: {kul}"