Merge branch 'urbit:develop' into lick

This commit is contained in:
mopfel-winrux 2023-05-17 14:54:03 -04:00 committed by GitHub
commit 7feaf4b6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 60 additions and 28 deletions

View File

@ -0,0 +1,11 @@
:: Print keys for a ship, as stored in %ames
::
:- %say
|= [[now=time @ our=ship ^] [=ship ~] ~]
=+ .^ =ship-state:ames
%ax /(scot %p our)//(scot %da now)/peers/(scot %p ship)
==
:- %noun
?. ?=(%known -.ship-state)
%ship-still-alien
[life=life rift=rift]:+.ship-state

View File

@ -10,14 +10,11 @@
=/ our p.bec
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist."
helm-pass+[%d %noop ~]
helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
=/ existing-story .^(? %cu /(scot %p our)/[desk]/(scot %da now)/story)
?: ?&(existing-story !overwrite)
~& >> "Error: /{(trip (slav %tas desk))}/story already exists."
~& >> "To forcibly overwrite, use `=overwrite %.y`"
:: XX could use a better way to noop
helm-pass+[%d %noop ~]
:- %helm-pass
[%d %flog %text "Error: /{(trip (slav %tas desk))}/story already exists. To forcibly overwrite, use `=overwrite %.y`"]
=| tale=story
:- %helm-pass
[%c [%info desk %& [/story %ins story+!>(tale)]~]]
[%c [%info desk %& [/story %ins story+!>(tale)]~]]

View File

@ -13,8 +13,7 @@
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
=? cas =(*case cas) r.bec :: use case from beak if cas not provided
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist."
helm-pass+[%d %noop ~]
helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
=/ tak=tako:clay
?: ?=([%tako tako:clay] cas)
p.cas
@ -25,12 +24,11 @@
::
=/ pax /(scot %p our)/[desk]/(scot %da now)/story
?: !.^(? %cu pax)
~& >> "Error: No story file found. Please use |story-init to create one."
helm-pass+[%d %noop ~]
helm-pass+[%d %flog %text "Error: No story file found. Please use |story-init to create one."]
=/ tale=story .^(story %cx pax)
=. tale
?: =(*prose prz)
(~(del by tale) tak)
(~(del ju tale) tak prz)
:- %helm-pass
[%c [%info desk %& [/story %ins story+!>(tale)]~]]
[%c [%info desk %& [/story %ins story+!>(tale)]~]]

View File

@ -13,8 +13,7 @@
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
=? cas =(*case cas) r.bec :: use case from beak if cas not provided
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist."
helm-pass+[%d %noop ~]
helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
=/ tak=tako:clay
?: ?=([%tako tako:clay] cas)
p.cas
@ -25,10 +24,9 @@
::
=/ pax /(scot %p our)/[desk]/(scot %da now)/story
?: !.^(? %cu pax)
~& >> "Error: No story file found. Please use |story-init to create one."
helm-pass+[%d %noop ~]
helm-pass+[%d %flog %text "Error: No story file found. Please use |story-init to create one."]
=/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story)
=/ =prose [title ?~(body '' p.body)]
=. tale (~(put ju tale) tak prose)
:- %helm-pass
[%c [%info desk %& [/story %ins story+!>(tale)]~]]
[%c [%info desk %& [/story %ins story+!>(tale)]~]]

View File

@ -2,6 +2,6 @@
:- %say
|= [[now=@da eny=@uvJ bec=beak] [syd=desk ~] verb=_&]
:* %tang
leaf+"Notice: +vat is deprecated as +vats now takes lists of one or more desks"
leaf+"Notice: +vat is deprecated. use +vats which now takes one or more desks as arguments. e.g. '+vats %base %garden'"
(report-vat (report-prep p.bec now) p.bec now syd verb)
==

View File

@ -2200,7 +2200,11 @@
=/ peer-core (abed-peer:pe her.u.res u.state)
?- -.u.res
%pump abet:(on-wake:peer-core bone.u.res error)
%fine abet:fi-abet:fi-take-wake:(abed:fi:peer-core wire.u.res)
::
%fine
?. (~(has by keens.peer-state.peer-core) wire.u.res)
event-core
abet:fi-abet:fi-take-wake:(abed:fi:peer-core wire.u.res)
==
::
=. event-core (emit duct %pass /recork %b %wait `@da`(add now ~d1))
@ -2882,6 +2886,10 @@
:: expire direct route if the peer is not responding
::
=. peer-state (update-peer-route her peer-state)
:: required so that the following +send-blob's (including
:: inside +call:mu), access up-to-date peer state
::
=. event-core abet
:: resend comet attestation packet if first message times out
::
:: The attestation packet doesn't get acked, so if we tried to
@ -4445,7 +4453,7 @@
:: if this was a re-send, don't adjust rtt or downstream state
::
?: (gth tries.packet-state 1)
metrics
metrics(rto (clamp-rto (add rtt (mul 4 rttvar))))
:: rtt-datum: new rtt measurement based on packet roundtrip
::
=/ rtt-datum=@dr (sub-safe now last-sent.packet-state)

View File

@ -714,7 +714,14 @@
=. stack.nub [~ stack.nub]
?: (~(has in cycle.nub) cast+[a b])
~|(cycle+cast+[a b]^cycle.nub !!)
?: =(a b)
%+ gain-leak cast+a^b
|= nob=state
%- (trace 4 |.("identity shortcircuit"))
=. nub nob
:_(nub vase+same.bud)
?: =([%mime %hoon] [a b])
%- (trace 4 |.("%mime -> %hoon shortcircuit"))
:_(nub [%vase =>(..zuse !>(|=(m=mime q.q.m)))])
:: try +grow; is there a +grow core with a .b arm?
::
@ -729,6 +736,7 @@
::
%+ gain-leak cast+a^b
|= nob=state
%- (trace 4 |.("{<a>} -> {<b>}: +{(trip b)}:grow:{(trip a)}"))
=. nub nob
:_ nub :- %vase
%+ slap (with-faces cor+old ~)
@ -743,18 +751,24 @@
?: &(?=(%& -.rab) ?=(^ q.p.rab))
%+ gain-leak cast+a^b
|= nob=state
%- (trace 4 |.("{<a>} -> {<b>}: +{(trip a)}:grab:{(trip b)}"))
=. nub nob
:_(nub vase+p.rab)
:: try +jump
::
=/ jum (mule |.((slap old tsgl/[limb/b limb/%jump])))
?: ?=(%& -.jum)
(compose-casts a !<(mark p.jum) b)
=/ via !<(mark p.jum)
%- (trace 4 |.("{<a>} -> {<b>}: via {<via>} per +jump:{(trip a)}"))
(compose-casts a via b)
?: ?=(%& -.rab)
(compose-casts a !<(mark p.rab) b)
=/ via !<(mark p.rab)
%- (trace 4 |.("{<a>} -> {<b>}: via {<via>} per +grab:{(trip b)}"))
(compose-casts a via b)
?: ?=(%noun b)
%+ gain-leak cast+a^b
|= nob=state
%- (trace 4 |.("{<a>} -> {<b>} default"))
=. nub nob
:_(nub vase+same.bud)
~|(no-cast-from+[a b] !!)
@ -4492,13 +4506,15 @@
++ read-at-tako :: read-at-tako:ze
|= [for=(unit ship) tak=tako mun=mood] :: seek and read
^- [(unit (unit cage)) _..park]
:: the commit must be known, and reachable from within this desk
:: non-zero commits must be known, and reachable from within this desk
::
?. ?& !=(0v0 tak)
(~(has by hut.ran) tak)
(~(has in (reachable-takos (aeon-to-tako:ze let.dom))) tak)
?. ?| =(0v0 tak)
?& (~(has by hut.ran) tak)
?| (~(any by hit.dom) |=(=tako =(tak tako))) :: fast-path
(~(has in (reachable-takos (aeon-to-tako:ze let.dom))) tak)
==
|(?=(~ for) (may-read u.for care.mun tak path.mun))
==
== ==
[~ ..park]
:: virtualize to catch and produce deterministic failures
::

View File

@ -769,6 +769,10 @@
(mo-apply-sure dap routes deal)
::
%raw-poke
:: don't validate %noun pokes, for performance
::
?: =(%noun mark.deal)
(mo-apply-sure dap routes [%poke %noun %noun noun.deal])
=/ =case da+now
=/ yok (~(got by yokes.state) dap)
=/ =desk q.beak:?>(?=(%live -.yok) yok) ::TODO acceptable assertion?
@ -973,7 +977,7 @@
++ ap-idle
^+ ap-core
?: ?=(%| -.agent.yoke) ap-core
=> [ken=ken.yoke (ap-ingest ~ |.([ap-yawn-all *agent]))]
=> [ken=ken.yoke (ap-ingest ~ |.([ap-yawn-all p.agent.yoke]))]
ap-core(ken.yoke ken, agent.yoke |+on-save:ap-agent-core)
::
++ ap-nuke