urbit/arvo/kahn.hoon

104 lines
3.8 KiB
Plaintext
Raw Normal View History

2014-09-23 21:11:59 +04:00
:: %kahn, social state
::
2016-02-05 06:05:37 +03:00
:::: /hoon/kahn/arvo
2014-09-23 21:11:59 +04:00
::
!? 164
::::
|= pit=vase
=> =~
:: structures
|%
++ axle :: %kahn state
$: %0 ::
2014-11-16 04:10:15 +03:00
soc=(map monk node) :: social graph
red=(map duct (set monk)) :: reverse subscribers
2014-09-23 21:11:59 +04:00
== ::
2014-11-04 21:39:56 +03:00
++ cert (each will ,*) :: urbit or other
2014-09-23 21:11:59 +04:00
++ gift :: out result <-$
2014-11-04 02:07:46 +03:00
$: [%then p=node] :: propagate change
2014-11-02 01:13:18 +03:00
== ::
2014-11-04 02:07:46 +03:00
++ node :: social identity
2014-11-04 21:39:56 +03:00
$: tin=(map monk link) :: inbound links
2014-11-04 02:07:46 +03:00
oud=(map monk link) :: outbound links
cet=cert :: certificate
2014-11-16 04:10:15 +03:00
sud=(set duct) :: subscribers
2014-09-23 21:11:59 +04:00
== ::
2014-11-16 04:10:15 +03:00
++ khan ,[p=@tas q=@ta] :: foreign identity
2014-11-04 21:39:56 +03:00
++ kiss :: social update
2014-11-12 00:49:45 +03:00
$: [%cert p=monk q=cert] :: set certificate
2014-11-16 04:10:15 +03:00
[%hear p=monk] :: watch identity
2014-11-12 00:49:45 +03:00
[%know p=monk q=(map monk link)] :: set forward links
2014-11-16 04:10:15 +03:00
[%nuke ~] :: erase subscriber
2014-09-23 21:11:59 +04:00
== ::
2014-11-04 21:39:56 +03:00
++ link (pair rank ,@da) :: trust/expiration
2014-11-16 04:10:15 +03:00
++ monk (each ship khan) :: general identity
2014-11-02 01:13:18 +03:00
++ rank :: privilege ring
2014-11-16 04:10:15 +03:00
$? %0 :: complete trust
%1 :: structural trust
%2 :: social trust
%3 :: neutral trust
%4 :: negative trust
2014-09-23 21:11:59 +04:00
== ::
-- ::
. ==
=| axle
=* lex -
|= [now=@da eny=@ ski=sled] :: activate
^? :: opaque core
|% ::
++ call :: request
|= [hen=duct hic=(hypo (hobo kiss))]
^- [p=(list move) q=_..^$]
=> .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic)))
!!
::
++ doze
|= [now=@da hen=duct]
^- (unit ,@da)
~
::
++ load :: highly forgiving
|= old=*
=+ lox=((soft axle) old)
^+ ..^$
?~ lox
2015-01-13 04:49:31 +03:00
~& %khan-reset
2014-09-23 21:11:59 +04:00
..^$
..^$(+>- u.lox)
::
++ scry
|= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path]
^- (unit (unit (pair mark ,*)))
2014-11-04 02:07:46 +03:00
?. =(big [~ who]) ~
=+ ^= yub ^- [(unit monk)
?: =(%urb syd)
?. ?=([* ~] tyl) ~
=+ goy=(slaw %p
?+ ?=([%$ %da @]
?+ lot ~
[%$ %ud @]
%+ bind
(perm who u.hun q.p.lot [syd t.tyl])
|=(a=* [%noun a])
::
?. =(now q.p.lot) ~
%+ bind
(temp who u.hun [syd t.tyl])
|=(a=* [%noun a])
==
?. ?=([%da
=+ mok ^- (unit monk)
?: =(%urb face)
(
2014-09-23 21:11:59 +04:00
::
++ stay :: save w/o cache
`axle`+>-.$
::
++ take :: response
|= [tea=wire hen=duct hin=(hypo noun)]
!!
--