Merge commit '798fa84960837d5a65296c48b6208c06e225197f' into constitution

This commit is contained in:
Fang 2018-02-23 15:31:25 +01:00
commit b4a0a5f0e7
12 changed files with 79 additions and 217 deletions

View File

@ -549,7 +549,7 @@
$tang ;;(tang q.q.cay)
$httr
=+ hit=;;(httr:eyre q.q.cay)
=- (flop (turn `wall`- |=(a/tape leaf+(dash:us a ''))))
=- (flop (turn `wall`- |=(a/tape leaf+(dash:us a '' ~))))
:- "HTTP {<p.hit>}"
%+ weld
(turn q.hit |=({a/@t b/@t} "{(trip a)}: {(trip b)}"))

View File

@ -117,7 +117,7 @@
:> #
:> functional cores and arms.
::
|_ {bol/bowl:gall $1 state}
|_ {bol/bowl:gall $0 state}
::
:> # %transition
:> prep transition
@ -127,15 +127,7 @@
::
=> |%
++ states
?(state-0 $%({$1 s/state}))
::
++ state-0
(cork state |=(a/state a(stories (~(run by stories.a) story-0))))
++ story-0
%+ cork story
|=(a/story a(shape *config-0, mirrors (~(run by mirrors.a) config-0)))
++ config-0
{src/(set source) cap/cord fit/filter con/control}
$%({$0 s/state})
--
=| mos/(list move)
|= old/(unit states)
@ -144,15 +136,8 @@
%- pre-bake
ta-done:ta-init:ta
?- -.u.old
$1
$0
[mos ..prep(+<+ u.old)]
::
?($~ ^) :: $0
=- $(old `[%1 u.old(stories -)])
%- ~(run by stories.u.old)
|= soy/story-0
^- story
(story soy(shape [src cap ~ fit con]:shape.soy))
==
::
:> # %engines
@ -2220,9 +2205,9 @@
:: only auto-federate channels for now.
?. ?=($channel sec.con.shape.s) ~
:+ ~ n
:: share no more than 2k messages at once, for performance reasons.
:+ ?: (lte count.s 2.000) grams.s
(slag (sub count.s 2.000) grams.s)
:: share no more than the last 100, for performance reasons.
:+ ?: (lte count.s 100) grams.s
(slag (sub count.s 100) grams.s)
[shape.s mirrors.s]
[locals.s remotes.s]
::

View File

@ -29,9 +29,10 @@
|%
++ state :> application state
$: :: messaging state ::
count/@ud :< (lent grams)
grams/(list telegram) :< all history
known/(map serial @ud) :< messages heard
last/@ud :< last heard
count/@ud :< (lent grams)
sources/(set circle) :< our subscriptions
:: circle details ::
remotes/(map circle group) :< remote presences
@ -112,7 +113,7 @@
:> #
:> functional cores and arms.
::
|_ {bol/bowl:gall $1 state}
|_ {bol/bowl:gall $0 state}
::
:> # %transition
:> prep transition
@ -123,28 +124,16 @@
::
=> |%
++ states
?(state-0 $%({$1 s/state}))
::
++ state-0
(cork state |=(a/state a(mirrors (~(run by mirrors.a) config-0))))
++ config-0
{src/(set source) cap/cord fit/filter con/control}
$%({$0 s/state})
--
=| mos/(list move)
|= old/(unit states)
^- (quip move _..prep)
?~ old
ta-done:ta-init:ta
?+ -.u.old
:: $0
=+ ole=(state-0 u.old)
=- $(old `[%1 ole(mirrors -)])
%- ~(run by mirrors.ole)
|= config-0
[src cap ~ fit con]
::
$1
[mos ..prep(+<+ [%1 (state +.u.old)])]
?- -.u.old
$0
[mos ..prep(+<+ u.old)]
==
::
:> #
@ -238,7 +227,10 @@
server
::
%+ welp /circle/[inbox]/grams/config/group
?:(=(0 count) ~ [(scot %ud count) ~])
?. =(0 count)
[(scot %ud last) ~]
=+ history-days=~d5
[(scot %da (sub now.bol history-days)) ~]
==
::
:> #
@ -379,7 +371,7 @@
~&([%unexpected-circle-rumor -.rum] +>)
::
$gram
(ta-learn gam.nev.rum)
(ta-open nev.rum)
::
$config
=+ cur=(fall (~(get by mirrors) cir.rum) *config)
@ -465,15 +457,16 @@
::
|= nes/(list envelope)
^+ +>
(ta-lesson (turn nes tail))
?~ nes +>
$(nes t.nes, +> (ta-open i.nes))
::
++ ta-lesson
:> learn all telegrams in a list.
++ ta-open
:> learn message from an envelope.
::
|= gaz/(list telegram)
|= nev/envelope
^+ +>
?~ gaz +>
$(gaz t.gaz, +> (ta-learn i.gaz))
=? last (gth num.nev last) num.nev
(ta-learn gam.nev)
::
++ ta-learn
:> save/update message
@ -2470,7 +2463,7 @@
==
?: =(a 'reset')
~& 'full reset incoming, hold on to your cli...'
:_ +>(grams ~, known ~, count 0)
:_ +>(grams ~, known ~, count 0, last 0)
:~ [ost.bol %pull /server/client server ~]
[ost.bol %pull /server/inbox server ~]
peer-client

View File

@ -392,8 +392,9 @@
++ se-show :: show buffer, raw
|= lin/(pair @ud stub:dill)
^+ +>
=. p.lin (add p.lin (lent-stye:klr q.lin))
?: =(mir lin) +>
=. +> ?:(=(p.mir p.lin) +> (se-blit %hop (add p.lin (lent-stye:klr q.lin))))
=. +> ?:(=(p.mir p.lin) +> (se-blit %hop p.lin))
=. +> ?:(=(q.mir q.lin) +> (se-blit %pom q.lin))
+>(mir lin)
::
@ -401,13 +402,13 @@
|= {pom/stub:dill lin/(pair @ud (list @c))}
^+ +>
=/ pol (lent-char:klr pom)
=/ end (sub edg pol)
=/ pos (add pol p.lin)
?: (gte (div (mul pol 100) edg) 35) :: old style (long prompt)
=/ off ?:((lte p.lin end) 0 (sub p.lin end))
=/ off ?:((lte pos edg) 0 (sub pos edg))
%+ se-show
(sub pos off)
(swag:klr [off edg] (welp pom [*stye:dill q.lin]~))
=/ end (sub edg pol)
=. off ?: (gth p.lin (add end off))
(sub p.lin end)
?: (lth p.lin off)

View File

@ -80,19 +80,6 @@
{$helm-reset $~} ::
== ::
++ move (pair bone card) :: user-level move
++ riot ::tmp up-to-date riot
%- unit
$: p/{p/?($d $p $u $v $w $x $y $z) q/case r/desk}
q/path
r/cage
==
++ rite ::tmp
$% {$r red/(unit rule)}
{$w wit/(unit rule)}
{$rw red/(unit rule) wit/(unit rule)}
==
++ rule {mod/?($black $white) who/(set whom)} ::tmp
++ whom (each ship @ta) ::tmp
--
|_ moz/(list move)
++ abet :: resolve

View File

@ -277,7 +277,7 @@
:> input if it fits or a default value if it doesn't.
:>
:> examples: * @ud ,[p=time q=?(%a %b)]
_|=(* +<)
_|~(* +<)
::
++ pair
:> dual tuple
@ -9907,14 +9907,20 @@
--
|_ sut/type
++ dash
|= {mil/tape lim/char} ^- tape
:- lim
|- ^- tape
?~ mil [lim ~]
?: =(lim i.mil) ['\\' i.mil $(mil t.mil)]
?: =('\\' i.mil) ['\\' i.mil $(mil t.mil)]
?: (lte ' ' i.mil) [i.mil $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (end 2 1 i.mil)) $(mil t.mil)]
|= {mil/tape lim/char lam/tape}
^- tape
=/ esc (~(gas in *(set @tD)) lam)
:- lim
|- ^- tape
?~ mil [lim ~]
?: ?| =(lim i.mil)
=('\\' i.mil)
(~(has in esc) i.mil)
==
['\\' i.mil $(mil t.mil)]
?: (lte ' ' i.mil)
[i.mil $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (end 2 1 i.mil)) $(mil t.mil)]
::
++ deal |=(lum/* (dish dole lum))
++ dial
@ -10046,7 +10052,7 @@
[(need ^$(q.ham %yarn, lum -.lum)) $(lum +.lum)]
::
$yarn
[~ %leaf (dash (tape lum) '"')]
[~ %leaf (dash (tape lum) '"' "\{")]
::
$void
~
@ -10059,7 +10065,7 @@
?+ (rash p.q.ham ;~(sfix (cook crip (star low)) (star hig)))
~(rend co [%$ p.q.ham lum])
$$ ~(rend co [%$ %ud lum])
$t (dash (rip 3 lum) '\'')
$t (dash (rip 3 lum) '\'' ~)
$tas ['%' ?.(=(0 lum) (rip 3 lum) ['$' ~])]
==
::

View File

@ -1,9 +1,10 @@
:: :: ames (4a), networking
:: :: ames (4a), networking
::
|= pit=vase
=> =~
:: structures
=, ames
=+ protocol-version=0
|%
+= move [p=duct q=(wind note:able gift:able)] :: local move
--
@ -159,7 +160,7 @@
0w0 :: 42, ~tul, Curtis Yarvin
0w0 :: 43, ~met, Curtis Yarvin
0w0 :: 44, ~wen, Curtis Yarvin
0w0 :: 45, ~byn, Curtis Yarvin
0w0 :: 45, ~byn, Curtis Yarvin
0w0 :: 46, ~hex, James Torre
0w0 :: 47, ~feb, urbit.org
0wK.GoKEY.rMjfn.ZcvFQ.n4BmX :: 48, ~pyl, Michael Hartl (oldkey)
@ -171,7 +172,7 @@
0w0 :: 54, ~wyd, Curtis Yarvin
0w0 :: 55, ~tep, Curtis Yarvin
0w0 :: 56, ~bes, Curtis Yarvin
0w0 :: 57, ~dex, Jared Hance
0w0 :: 57, ~dex, Jared Hance
0w0 :: 58, ~sef, Owen Rescher
0w0 :: 59, ~wyc, Galen Wolfe-Pauly
0w0 :: 60, ~bur, Galen Wolfe-Pauly
@ -385,7 +386,7 @@
vix=(bex +((cut 0 [25 2] mag))) :: width of sender
tay=(cut 0 [27 5] mag) :: message type
==
?> =(7 vez)
?> =(protocol-version vez)
?> =(chk (end 0 20 (mug bod)))
:+ [(end 3 wix bod) (cut 3 [wix vix] bod)]
(kins tay)
@ -405,7 +406,7 @@
=+ tay=(ksin q.kec)
%+ mix
%+ can 0
:~ [3 7]
:~ [3 protocol-version]
[20 (mug bod)]
[2 yax]
[2 qax]
@ -975,10 +976,10 @@
|= [our=ship ger=@uw fak=?] :: instantiate emperor
^- [p=(list boon) q=fort]
=+ ^= loy
?: fak
?: fak
:: fake uses carrier number as seed
::
(pit:nu:crub:crypto 512 our)
(pit:nu:crub:crypto 512 our)
(pit:nu:crub:crypto 512 ger)
=+ fim==(fig:ex:loy (zeno our))
?: &(!fak !fim) !! :: not fake & bad fig
@ -995,7 +996,7 @@
++ gnaw :: gnaw:am
|= [kay=cape ryn=lane pac=rock] :: process packet
^- [p=(list boon) q=fort]
?. =(7 (end 0 3 pac)) [~ fox]
?. =(protocol-version (end 0 3 pac)) [~ fox]
=+ kec=(bite pac)
?: (goop p.p.kec) [~ fox]
?. (~(has by urb.ton.fox) q.p.kec)
@ -1114,7 +1115,7 @@
:: it now, since it obviously won't be processed.
::
~& [%fail-ack did.rum]
=^ gud +>.$
=^ gud +>.$
(cook ``[%dead-message ~] cha `[q.u.cun r.u.cun])
?. gud +>.$
%= +>.$
@ -1275,15 +1276,15 @@
:: or negative ack if this ship is blocked
::
=* cop ^- coop
%+ fall
(~(get by bum.rum) num)
%+ fall
(~(get by bum.rum) num)
?:(bad ~ ``[%blocked ~])
con:(cook (~(get by bum.rum) num) cha `[ryn dam])
::
:: insert this message in unprocessed set
::
=. mis.rum (~(put by mis.rum) num [kay ryn dam dut])
::
::
:: if ship is blocked, advance pointer to latest message
::
=. did.rum ?.(bad did.rum num)
@ -1552,7 +1553,7 @@
(hunt lth doz rtn.sop.bah)
::
++ load
|= old=fort
|= old=fort
~& %ames-reload
..^$(fox old)
::
@ -1613,7 +1614,7 @@
:_ fox [hen %pass pax i.q.q.bon %west p.bon t.q.q.bon r.bon]~
::
%ouzo
:: ~& [%send now p.bon `@p`(mug (shaf %flap q.bon))]
:: ~& [%send now p.bon `@p`(mug (shaf %flap q.bon))]
:_ fox
[[gad.fox [%give %send p.bon q.bon]] ~]
::
@ -1683,7 +1684,7 @@
?: ?=(%wegh -.kyz)
~& %ames-weighing
[[hen %give %mass wegh]~ +>]
=+ ^= fuy
=+ ^= fuy
^- [p=(list boon) q=fort]
?- -.kyz
%barn

View File

@ -1012,7 +1012,7 @@
|= a/cord
?: ((sane %ta) a)
[%leaf (trip a)]
[%leaf (dash:us (trip a) '\'')]
[%leaf (dash:us (trip a) '\'' ~)]
$(p.lem t.p.lem)
==
::
@ -3571,7 +3571,7 @@
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
=| :: instrument state
$: $4 :: vane version
$: $0 :: vane version
ruf/raft :: revision tree
== ::
|= {now/@da eny/@ ski/sley} :: activate
@ -3832,72 +3832,12 @@
::
++ load
=> |%
+= wove-3 rove
++ cult-3 (jug wove-3 duct)
++ dojo-3
$: qyx/cult-3
dom/dome
dok/(unit dork)
mer/(unit mery)
==
++ rede-3
$: lim/@da
ref/(unit rind)
qyx/cult-3
dom/dome
dok/(unit dork)
mer/(unit mery)
==
++ room-3 (cork room |=(a/room a(dos (~(run by dos.a) dojo-3))))
++ rung-3 (cork rung |=(a/rung a(rus (~(run by rus.a) rede-3))))
++ raft-3
$: fat/(map ship room-3)
hoy/(map ship rung-3)
ran/rang
mon/(map term beam)
hez/(unit duct)
==
++ axle $%({$3 ruf/raft-3} {$4 ruf/raft})
++ axle $%({$0 ruf/raft})
--
|= old/axle
^+ ..^$
?- -.old
$4 ..^$(ruf ruf.old)
$3 |^
=- ^$(old [%4 -])
=+ ruf.old
:* (~(run by fat) rom)
(~(run by hoy) run)
ran mon hez ~
==
::
++ wov
|= a/wove-3 ^- wove
[~ a]
::
++ cul
|= a/cult-3 ^- cult
%- ~(gas by *cult)
%+ turn ~(tap by a)
|= {p/wove-3 q/(set duct)}
[(wov p) q]
::
++ rom
|= room-3
:- hun
%- ~(urn by dos)
|= {d/desk dojo-3}
=/ n/dojo [(cul qyx) dom dok mer ~ ~]
?. =(%kids d) n
n(per [[/ %black ~] ~ ~])
::
++ run
=/ red
|= rede-3
=+ [[/ %black ~] ~ ~]
[lim ref (cul qyx) dom dok mer - -]
|=(a/rung-3 a(rus (~(run by rus.a) red)))
--
$0 ..^$(ruf ruf.old)
==
::
++ scry :: inspect
@ -3929,7 +3869,7 @@
?: ?=($& -.u.u.-) ``p.u.u.-
~
::
++ stay [%4 ruf]
++ stay [%0 ruf]
++ take :: accept response
|= {tea/wire hen/duct hin/(hypo sign)}
^+ [p=*(list move) q=..^$]

View File

@ -7,15 +7,9 @@
++ gill (pair ship term) :: general contact
-- ::
=> |% :: console protocol
++ all-axle ?(old-axle axle) ::
++ old-axle :: all dill state
$: $2 ::
ore/(unit ship) :: identity once set
hey/(unit duct) :: default duct
dug/(map duct axon) :: conversations
== ::
++ all-axle ?(axle) ::
++ axle ::
$: $3 ::
$: $0 ::
ore/(unit ship) :: identity once set
hey/(unit duct) :: default duct
dug/(map duct axon) :: conversations
@ -520,8 +514,6 @@
::
++ load :: trivial
|= old/all-axle
?: ?=($2 -.old)
$(old [%3 ore hey dug ~ ~ ~ ~ ~ ~]:old)
..^$(all old)
:: |= old=* :: diable
:: ..^$(ore.all `~zod)

View File

@ -85,7 +85,7 @@
-- ::
|% :: models
++ bolo :: eyre state
$: $6 :: version
$: $0 :: version
gub/@t :: random identity
hov/(unit ship) :: master for remote
top/beam :: ford serve prefix
@ -2025,15 +2025,10 @@
~
::
++ load :: take previous state
=+ driv-5=_=>(*driv [cor=p req=req.q])
=+ bolo-5={$5 _=+(*bolo +.-(sec (~(run by sec.-) driv-5)))}
=+ bolo-4={$4 _%*(+ *bolo-5 lyv *(map duct ^))}
::|= * %. (bolo +<)
|= old/?(bolo bolo-5 bolo-4) ^+ ..^$
|= old/?(bolo) ^+ ..^$
?- -.old
$6 ..^$(+>- old)
$5 $(old [%6 +.old(sec (~(run by sec.old) |=(driv-5 [cor & req])))])
$4 $(old [%5 +.old(lyv ~)]) :: minor leak
$0 ..^$(+>- old)
==
::
++ scry

View File

@ -33,7 +33,7 @@
-- ::
|% :: structures
++ axle :: all %ford state
$: $2 :: version for update
$: $0 :: version for update
pol/(map ship baby) ::
== ::
++ baby :: state by ship
@ -1583,7 +1583,7 @@
|= {cof/cafe dir/knot}
=+ nod=(chap(s.how [dir s.how]) cof bax hon)
?: ?=($2 -.q.nod)
(flue cof)
(flue p.nod)
(cope nod (flux some))
%- flux
|= doy/(map @ cage) ^- vase

View File

@ -31,27 +31,11 @@
-- ::
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: %gall state
::::::::::::::::::::::::::::::::::::::::::::::::::::::
++ axle-n ?(axle-1 axle-2 axle-3 axle-4) :: upgrade path
++ axle-1 {$1 pol/(map ship mast-1)} ::
++ mast-1 ::
(cork mast-2 |=(mast-2 +<(bum (~(run by bum) seat-1)))) ::
++ seat-1 ::
(cork seat-2 |=(seat-2 +<+)) ::
++ axle-2 {$2 pol/(map ship mast-2)} ::
++ mast-2 (cork mast-3 |=(mast-3 +<+)) ::
++ seat-2 seat-3 ::
++ axle-3 {$3 pol/(map ship mast-3)} ::
++ mast-3 ::
(cork mast-4 |=(mast-4 +<(bum (~(run by bum) seat-3)))) ::
++ seat-3 ::
(cork seat-4 |=(seat-4 +<+)) ::
++ axle-4 axle ::
++ mast-4 mast ::
++ seat-4 seat ::
++ axle-n ?(axle) :: upgrade path
:::::::::::::::::::::::::::::::::::::::::::::::::::::: state proper
::::::::::::::::::::::::::::::::::::::::::::::::::::::
++ axle :: all state
$: $4 :: state version
$: $0 :: state version
pol/(map ship mast) :: apps by ship
== ::
++ gest :: subscriber data
@ -1311,29 +1295,7 @@
|= old/axle-n
^+ ..^$
?- -.old
$4 ..^$(all old)
$3
%= $
old ^- axle-4
=> |=(seat-3 `seat-4`[*misvale-data +<])
=> |=(mast-3 +<(bum (~(run by bum) +>)))
old(- %4, pol (~(run by pol.old) .))
==
::
$2
%= $
old ^- axle-3
=> |=(mast-2 [*(unit duct) +<])
old(- %3, pol (~(run by pol.old) .))
==
::
$1
%= $
old ^- axle-2
=> |=(seat-1 `seat-2`[*worm +<])
=> |=(mast-1 +<(bum (~(run by bum) +>)))
old(- %2, pol (~(run by pol.old) .))
==
$0 ..^$(all old)
==
::
++ scry