diff --git a/app/hall.hoon b/app/hall.hoon index 0aaf4202c..123a40df9 100644 --- a/app/hall.hoon +++ b/app/hall.hoon @@ -12,88 +12,91 @@ :: presence when we sub to someplace, and remove that when we unsub, but :: don't make the target source do that. :: -/- hall ::< structures -/+ hall, hall-legacy ::< libraries +/- hall :: structures +/+ hall, hall-legacy :: libraries /= seed /~ !>(.) :: :::: :: =, hall -=> ::> || - ::> || %arch - ::> || - ::> data structures +=> :> # + :> # %arch + :> # + :> data structures :: |% - ::> || %state :: - ::> state data structures :: - ++ state ::> application state - $: stories/(map naem story) ::< conversations - outbox/(map serial tracking) ::< sent messages - log/(map naem @ud) ::< logged to clay - nicks/(map ship nick) ::< local nicknames - binds/(jug char audience) ::< circle glyph lookup - public/(set circle) ::< publicly member of - rir/wire ::< current rumor wire + :> # %state + :> state data structures + +| + ++ state :> application state + $: stories/(map naem story) :< conversations + outbox/(map serial tracking) :< sent messages + log/(map naem @ud) :< logged to clay + nicks/(map ship nick) :< local nicknames + binds/(jug char audience) :< circle glyph lookup + public/(set circle) :< publicly member of + rir/wire :< current rumor wire == :: - ++ story ::> wire content - $: count/@ud ::< (lent grams) - grams/(list telegram) ::< all messages - known/(map serial @ud) ::< messages heard - sourced/(map circle (list @ud)) ::< messages by circle - sequence/(map circle @ud) ::< last-heard p circle - locals/group ::< local status - remotes/(map circle group) ::< remote status - shape/config ::< configuration - mirrors/(map circle config) ::< remote config - peers/(jar ship query) ::< subscribers - inherited/_| ::< from parent? + ++ story :> wire content + $: count/@ud :< (lent grams) + grams/(list telegram) :< all messages + known/(map serial @ud) :< messages heard + sourced/(map circle (list @ud)) :< messages by circle + sequence/(map circle @ud) :< last-heard p circle + locals/group :< local status + remotes/(map circle group) :< remote status + shape/config :< configuration + mirrors/(map circle config) :< remote config + peers/(jar ship query) :< subscribers + inherited/_| :< from parent? == :: - ::> || %deltas :: - ::> changes to state :: + :> # %deltas + :> changes to state + +| ++ delta :: $% :: public state :: - {$public add/? cir/circle} ::< show/hide membership + {$public add/? cir/circle} :< show/hide membership :: messaging state :: - {$out cir/circle out/(list thought)} ::< send msgs to circle - $: $done ::> set delivery state + {$out cir/circle out/(list thought)} :< send msgs to circle + $: $done :> set delivery state cir/circle :: ses/(list serial) :: res/delivery :: == :: :: shared ui state :: - {$glyph diff-glyph} ::< un/bound glyph - {$nick diff-nick} ::< changed nickname + {$glyph diff-glyph} :< un/bound glyph + {$nick diff-nick} :< changed nickname :: story state :: - {$story nom/naem det/delta-story} ::< change to story + {$story nom/naem det/delta-story} :< change to story :: side-effects :: - {$init $~} ::< initialize - {$observe who/ship} ::< watch burden bearer - $: $present ::> send %present cmd + {$init $~} :< initialize + {$observe who/ship} :< watch burden bearer + $: $present :> send %present cmd hos/ship :: nos/(set naem) :: dif/diff-status :: == :: == :: - ++ delta-story ::> story delta - $? diff-story ::< both in & outward - $% {$inherited ihr/?} ::< inherited flag - {$follow sub/? srs/(set source)} ::< un/subscribe - {$sequent cir/circle num/@ud} ::< update last-heard - {$gram src/circle gam/telegram} ::< new/changed msgs + ++ delta-story :> story delta + $? diff-story :< both in & outward + $% {$inherited ihr/?} :< inherited flag + {$follow sub/? srs/(set source)} :< un/subscribe + {$sequent cir/circle num/@ud} :< update last-heard + {$gram src/circle gam/telegram} :< new/changed msgs == == :: - ::> || %out :: - ::> outgoing data :: - ++ move (pair bone card) ::< all actions - ++ lime ::> diff fruit + :> # %out + :> outgoing data + +| + ++ move (pair bone card) :< all actions + ++ lime :> diff fruit $% {$hall-prize prize} :: {$hall-rumor rumor} :: == :: - ++ pear ::> poke fruit + ++ pear :> poke fruit $% {$hall-command command} :: {$hall-action action} ::TODO see ++gentle-quit == :: - ++ card ::> general card + ++ card :> general card $% {$diff lime} :: {$info wire ship term nori:clay} :: {$peer wire dock path} :: @@ -101,21 +104,24 @@ {$pull wire dock $~} :: {$quit $~} :: == :: - ++ weir ::> parsed wire - $% {$repeat cir/circle ses/(list serial)} ::< messaging wire - {$circle nom/naem src/source} ::< subscription wire + ++ weir :> parsed wire + $% {$repeat cir/circle ses/(list serial)} :< messaging wire + {$circle nom/naem src/source} :< subscription wire == :: -- :: -::> || -::> || %work -::> || -::> functional cores and arms. +:> # +:> # %work +:> # +:> functional cores and arms. :: |_ {bol/bowl:gall state} :: -++ prep ::< prepare state - ::> adapts state. +:> # %transition +:> prep transition ++| +++ prep + :> adapts state. :: |= old/(unit state) ^- (quip move _..prep) @@ -128,76 +134,80 @@ s(count (lent grams.s)) [~ ..prep(+<+ u.old)] :: -::> || -::> || %engines -::> || -::> main cores. -::+| +:> # %engines +:> main cores. ++| :: -++ ta ::< per transaction - ::> thinker core, used for processing pokes into - ::> deltas. +++ ta + :> thinker core, used for processing pokes into deltas. :: - |_ ::> deltas: deltas created by core operations. + |_ :> deltas: deltas created by core operations. :: deltas/(list delta) + :> # %resolve + +| :: - ++ ta-done ::< resolve core - ::> produces the moves stored in ++ta's moves. - ::> they are produced in reverse order because - ::> ++ta-emil and ++ta-emit add them to the head of - ::> the {moves}. - ::> we don't produce any new state, because ++ta - ::> doesn't make any changes to it itself. + ++ ta-done + :> resolve core + :> + :> produces the moves stored in ++ta's moves. + :> they are produced in reverse order because + :> ++ta-emil and ++ta-emit add them to the head of + :> the {moves}. + :> + :> we don't produce any new state, because ++ta + :> doesn't make any changes to it itself. :: ^- (list delta) (flop deltas) :: - ::> || - ::> || %emitters - ::> || - ::> arms that create outward changes. - ::+| + :> # + :> # %emitters + :> # + :> arms that create outward changes. + +| :: - ++ ta-delta ::< emit a delta - ::> adds a delta to the head of {deltas}. + ++ ta-delta + :> adds a delta to the head of {deltas}. :: |= det/delta %_(+> deltas [det deltas]) :: - ++ ta-deltas ::< emit delta list - ::> adds multiple deltas to the head of {deltas}. - ::> flops to stay consistent with ++ta-delta. + ++ ta-deltas + :> adds multiple deltas to the head of {deltas}. + :> + :> flops to stay consistent with ++ta-delta. :: |= des/(list delta) %_(+> deltas (welp (flop des) deltas)) :: - ++ ta-note ::< tell user - ::> sends {msg} as an %app message to the user's - ::> inbox. + ++ ta-note + :> sends {msg} as an %app message to the user's inbox. :: |= msg/tape %+ ta-action %phrase :- [[our.bol %inbox] ~ ~] [%app dap.bol %lin | (crip msg)]~ :: - ++ ta-evil ::< emit error - ::> tracing printf and crash. + ++ ta-evil + :> tracing printf and crash. :: |= msg/cord ~| [%hall-ta-evil msg] !! :: - ::> || - ::> || %data - ::> || - ::> utility functions for data retrieval. - ::+| + :> # + :> # %data + :> # + :> utility functions for data retrieval. + +| :: - ++ ta-know ::< story monad - ::> produces a gill that takes a gate. - ::> if the story {nom} exists, calls the gate with - ::> a story core. if it doesn't, does nothing. + ++ ta-know + :> story monad + :> + :> produces a gill that takes a gate. if the story + :> {nom} exists, calls the gate with a story core. + :> if it doesn't, does nothing. :: |= nom/naem |= fun/$-(_so _ta) @@ -208,15 +218,16 @@ (crip "no story '{(trip nom)}'") (fun ~(. so nom ~ u.pur)) :: - ::> || - ::> || %interaction-events - ::> || - ::> arms that apply events we received. - ::+| + :> # + :> # %interaction-events + :> # + :> arms that apply events we received. + +| :: - ++ ta-init ::< initialize app - ::> populate state on first boot. - ::> creates our default mailbox and journal. + ++ ta-init + :> initialize app + :> + :> populate state on first boot. creates our default mailbox and journal. :: :: create default circles. => %+ roll @@ -236,8 +247,8 @@ ~ [%init ~]~ :: - ++ ta-apply ::< apply command - ::> applies the command sent by {src}. + ++ ta-apply + :> applies the command sent by {src}. :: |= {src/ship cod/command} ^+ +> @@ -254,9 +265,11 @@ $bearing (ta-observe src) ::TODO isn't this redundant with ta-subscribe? == :: - ++ ta-present ::< update a status - ::> sets status for the indicated stories, - ::> but only if they have write permission there. + ++ ta-present + :> update a status + :> + :> sets status for the indicated stories, + :> but only if they have write permission there. :: |= {who/ship nos/(set naem) dif/diff-status} ^+ +> @@ -269,24 +282,24 @@ so-done:(~(so-present so i.nol ~ soy) who dif) $(nol t.nol) :: - ++ ta-action ::< apply client action - ::> performs action sent by a client. + ++ ta-action + :> performs action sent by a client. :: |= act/action ^+ +> =< work - ::> || - ::> || %actions - ::> || - ::> action processing core - ::> - ::> ++work calls the appropriate action processing - ::> arm. most use ++affect to retrieve the affected - ::> story, crashing if it doesn't exist. + :> # + :> # %actions + :> # + :> action processing core + :> + :> ++work calls the appropriate action processing + :> arm. most use ++affect to retrieve the affected + :> story, crashing if it doesn't exist. |% - :: || %utility - ::+| - ++ work ::< perform action + :> # %utility + +| + ++ work :< perform action ^+ ..ta-action ?- -.act :: circle configuration @@ -309,23 +322,27 @@ $public (action-public +.act) == :: - ++ affect ::< delta to story - ::> store a delta about a story. if the story - ::> does not exist, crash. + ++ affect + :> delta to story + :> + :> store a delta about a story. if the story + :> does not exist, crash. :: |= {nom/naem det/delta-story} ?: (~(has by stories) nom) (impact nom det) (ta-evil (crip "no story {(trip nom)}")) :: - ++ impact ::< delta for story - ::> Store a delta about a story. + ++ impact + :> delta for story + :> + :> Store a delta about a story. :: |= {nom/naem det/delta-story} (ta-delta %story nom det) :: - ++ present ::< send status update - ::> + ++ present + :> send status update :: |= {aud/audience dif/diff-status} ^+ ..ta-action @@ -345,10 +362,10 @@ :_ l [%present h s dif] :: - ::> || %circle-configuration - ::+| - ++ action-create ::< create story - ::> creates a story with the specified parameters. + :> # %circle-configuration + +| + ++ action-create + :> creates a story with the specified parameters. :: |= {nom/naem des/cord typ/security} ^+ ..ta-action @@ -363,9 +380,11 @@ == (ta-evil (crip "{(trip nom)}: already exists")) :: - ++ action-delete ::< delete + announce - ::> delete story {nom}, optionally announcing the - ::> event with message {mes}. + ++ action-delete + :> delete + announce + :> + :> delete story {nom}, optionally announcing the + :> event with message {mes}. :: |= {nom/naem mes/(unit cord)} ^+ ..ta-action @@ -375,21 +394,23 @@ [%lin | u.mes]~ (affect nom %remove ~) :: - ++ action-depict ::< change description - ::> change description of story {nom} to {des}. + ++ action-depict + :> change description of story {nom} to {des}. :: |= {nom/naem cap/cord} (affect nom %config [our.bol nom] %caption cap) :: - ++ action-filter ::< change message rules - ::> replaces the story's current filter with the - ::> specified one. + ++ action-filter + :> change message rules + :> + :> replaces the story's current filter with the + :> specified one. :: |= {nom/naem fit/filter} (affect nom %config [our.bol nom] %filter fit) :: - ++ action-permit ::< invite/banish - ::> invite to/banish from story {nom} all {sis}. + ++ action-permit + :> invite to/banish from story {nom} all {sis}. :: |= {nom/naem inv/? sis/(set ship)} =+ soy=(~(get by stories) nom) @@ -397,8 +418,8 @@ (ta-evil (crip "no story {(trip nom)}")) so-done:(~(so-permit so nom ~ u.soy) inv sis) :: - ++ action-source ::< un/sub p to/from r - ::> add/remove {pos} as sources for story {nom}. + ++ action-source + :> add/remove {pos} as sources for story {nom}. :: |= {nom/naem sub/? srs/(set source)} =+ soy=(~(get by stories) nom) @@ -406,18 +427,22 @@ (ta-evil (crip "no story {(trip nom)}")) so-done:(~(so-sources so nom ~ u.soy) sub srs) :: - ::> || %messaging - ::+| - ++ action-convey ::< post exact - ::> sends the messages provided in the action. + :> # %messaging + +| + ++ action-convey + :> post exact + :> + :> sends the messages provided in the action. :: |= tos/(list thought) (ta-think & our.bol tos) :: - ++ action-phrase ::< post easy - ::> sends the message contents provided in the - ::> action generating a serial and setting a - ::> timestamp. + ++ action-phrase + :> post easy + :> + :> sends the message contents provided in the + :> action generating a serial and setting a + :> timestamp. :: |= {aud/audience ses/(list speech)} ^+ ..ta-action @@ -428,58 +453,65 @@ :_ $(ses t.ses) [sir aud [now.bol i.ses]] :: - ::> || %personal-metadata - ::+| + :> # %personal-metadata + +| :: - ++ action-notify ::< our presence update - ::> notify the audience of our new presence state, - ::> or tell them to remove us if {pes} is ~. + ++ action-notify + :> our presence update + :> + :> notify the audience of our new presence state, + :> or tell them to remove us if {pes} is ~. :: |= {aud/audience pes/(unit presence)} ^+ ..ta-action ?~ pes (present aud %remove ~) (present aud %presence u.pes) :: - ++ action-naming ::< our name update - ::> + ++ action-naming + :> our name update :: |= {aud/audience man/human} ^+ ..ta-action (present aud %human %full man) :: - ::> || %changing-shared-ui - ::+| - ++ action-nick ::< new identity - ::> assigns a new local identity ("nickname") to the - ::> target ship. + :> # %changing-shared-ui + +| + ++ action-nick + :> new identity + :> + :> assigns a new local identity ("nickname") to the + :> target ship. :: |= {who/ship nic/nick} ^+ ..ta-action - ?. =((~(get by nicks) who) `nic) ..ta-action ::< no change + ?. =((~(get by nicks) who) `nic) ..ta-action :: no change (ta-delta %nick who nic) :: - ++ action-glyph ::< bind a glyph - ::> un/bind glyph {lif} to audience {aud}. + ++ action-glyph + :> un/bind glyph {lif} to audience {aud}. :: |= {lif/char aud/audience bin/?} (ta-delta %glyph bin lif aud) :: - ++ action-public ::< show/hide membership - ::> add or remove a circle from the public - ::> membership list. + ++ action-public + :> show/hide membership + :> + :> add or remove a circle from the public membership list. :: |= {add/? cir/circle} (ta-delta %public add cir) -- :: - ::> || - ::> || %subscription-events - ::> || - ::> arms that react to subscription events. - ::+| + :> # + :> # %subscription-events + :> # + :> arms that react to subscription events. + +| :: - ++ ta-observe ::< watch burden bearer - ::> subscribe to a child who is bearing our burden. + ++ ta-observe + :> watch burden bearer + :> + :> subscribe to a child who is bearing our burden. ::TODO everyone should be able to bear if they so desire. :: |= who/ship @@ -488,8 +520,10 @@ ~&([%not-our-bearer who] +>) (ta-delta %observe who) :: - ++ ta-subscribe ::< listen to - ::> reaction to incoming subscriptions. + ++ ta-subscribe + :> listen to + :> + :> reaction to incoming subscriptions. :: |= {her/ship qer/query} ^+ +> @@ -499,25 +533,31 @@ [nom.qer %peer & her qer] == :: - ++ ta-greet ::< subscription success - ::> store a started subscription as source. + ++ ta-greet + :> subscription success + :> + :> store a started subscription as source. :: |= {nom/naem src/source} %- (ta-know nom) |= sor/_so =< so-done (so-greet:sor src) :: - ++ ta-leave ::< subscription failed - ::> removes {src} from story {nom}'s sources. + ++ ta-leave + :> subscription failed + :> + :> removes {src} from story {nom}'s sources. :: |= {nom/naem src/source} %- (ta-know nom) |= sor/_so =< so-done (so-leave:sor src) :: - ++ ta-take ::< apply prize - ::> for a %burden prize, bear the burden in a new - ::> or existing story. - ::> for a %circle prize, use ++so to accept it. - ::> for a %report prize, silently ignore. + ++ ta-take + :> apply prize + :> + :> for a %burden prize, bear the burden in a new + :> or existing story. + :> for a %circle prize, use ++so to accept it. + :> for a %report prize, silently ignore. :: |= {wir/wire piz/prize} ^+ +> @@ -551,11 +591,13 @@ (so-take:sor cir.src.wer +.piz) == :: - ++ ta-hear ::< apply rumor - ::> apply changes from a rumor to our state. - ::> for %burden, authoratively apply the story - ::> diff. if it's a new one, bear it. - ::> for %circle, apply the story diff normally. + ++ ta-hear + :> apply rumor + :> + :> apply changes from a rumor to our state. + :> for %burden, authoratively apply the story + :> diff. if it's a new one, bear it. + :> for %circle, apply the story diff normally. :: |= {wir/wire rum/rumor} ^+ +> @@ -591,9 +633,11 @@ (so-hear:sor | cir.src.wer rum.rum) == :: - ++ ta-repeat ::< message delivered - ::> message got delivered. if an error was returned - ::> mark the message as rejected. if not, received. + ++ ta-repeat + :> message delivered + :> + :> message got delivered. if an error was returned + :> mark the message as rejected. if not, received. :: |= {who/circle ses/(list serial) fal/(unit tang)} ^+ +> @@ -602,31 +646,37 @@ ?~ fal %accepted ~>(%slog.[0 u.fal] %rejected) :: - ++ ta-resub ::< subscription dropped - ::> when a subscription gets dropped by gall, we - ::> resubscribe. + ++ ta-resub + :> subscription dropped + :> + :> when a subscription gets dropped by gall, we + :> resubscribe. :: |= {nom/naem src/source} ^+ +> %- (ta-know nom) |= sor/_so =< so-done (so-resub:sor src) :: - ::> || - ::> || %messaging - ::> || - ::> arms for sending and processing messages. - ::+| + :> # + :> # %messaging + :> # + :> arms for sending and processing messages. + +| :: - ++ ta-think ::< publish or review - ::> consumes each thought. + ++ ta-think + :> publish or review + :> + :> consumes each thought. :: |= {pub/? aut/ship tos/(list thought)} ^+ +> ?~ tos +> $(tos t.tos, +> (ta-consume pub aut i.tos)) :: - ++ ta-consume ::< to each audience - ::> conducts thought {tot} to each circle in its audience. + ++ ta-consume + :> to each audience + :> + :> conducts thought {tot} to each circle in its audience. :: |= {pub/? aut/ship tot/thought} =+ aud=~(tap in aud.tot) @@ -634,8 +684,10 @@ ?~ aud +>.^$ $(aud t.aud, +>.^$ (ta-conduct pub aut i.aud tot)) :: - ++ ta-conduct ::< thought to circle - ::> either publishes or records a thought. + ++ ta-conduct + :> thought to circle + :> + :> either publishes or records a thought. :: |= {pub/? aut/ship cir/circle tot/thought} ^+ +> @@ -652,40 +704,44 @@ ?. =(our.bol hos.cir) +> (ta-record nom.cir aut tot) :: - ++ ta-record ::< add to story - ::> add or update telegram {gam} in story {nom}. + ++ ta-record + :> add to story + :> + :> add or update telegram {gam} in story {nom}. :: |= {nom/naem gam/telegram} %- (ta-know nom) |= sor/_so =< so-done (so-learn:sor [our.bol nom] gam) :: - ++ ta-transmit ::< send message - ::> sends thought {tot} to {cir}. + ++ ta-transmit + :> sends thought {tot} to {cir}. :: |= {cir/circle tot/thought} ^+ +> (ta-delta %out cir tot ~) :: - ::> || - ::> || %stories - ::> || - ::> arms for modifying stories. - ::+| + :> # + :> # %stories + :> # + :> arms for modifying stories. + +| :: - ++ so ::< story core - ::> story core, used for doing work on a story. + ++ so + :> story core, used for doing work on a story. :: - |_ ::> nom: story name in {stories}. - ::> acs: hall actions issued due to changes. - ::> story is faceless to ease data access. + |_ :> nom: story name in {stories}. + :> acs: hall actions issued due to changes. + :: story is faceless to ease data access. :: $: nom/naem acs/(list action) story == :: - ++ so-done ::< apply changes - ::> apply actions generated by story operations. + :> # %resolve + +| + ++ so-done + :> apply actions generated by story operations. ::TODO maybe produce list of actions, apply in ++ta :: ^+ +> @@ -695,22 +751,21 @@ =. +>+ (ta-action i.acs) $(acs t.acs) :: - ::> || - ::> || %emitters - ::> || - ::> arms that create outward changes. - ::+| + :> # + :> # %emitters + :> # + :> arms that create outward changes. + +| :: - ++ so-act ::< send action - ::> stores a hall action. + ++ so-act + :> stores a hall action. :: |= act/action ^+ +> +>(acs [act acs]) :: - ++ so-note ::< tell user - ::> sends {msg} as an %app message to the user's - ::> inbox. + ++ so-note + :> sends {msg} as an %app message to the user's inbox. :: |= msg/cord ^+ +> @@ -718,28 +773,28 @@ :- [[our.bol %inbox] ~ ~] [%app dap.bol %lin | msg]~ :: - ++ so-delta ::< send delta - ::> store delta in ++ta core. + ++ so-delta + :> store delta in ++ta core. :: |= det/delta ^+ +> +>(deltas [det deltas]) :: - ++ so-deltas ::< send delta list - ::> store multiple deltas in ++ta core. + ++ so-deltas + :> store multiple deltas in ++ta core. :: |= des/(list delta) %_(+> deltas (welp (flop des) deltas)) :: - ++ so-delta-our ::< send delta of us - ::> adds a delta about this story. + ++ so-delta-our + :> adds a delta about this story. :: |= det/delta-story ^+ +> (so-delta %story nom det) :: - ++ so-deltas-our ::< send deltas of us - ::> adds multiple deltas about this story. + ++ so-deltas-our + :> adds multiple deltas about this story. :: |= des/(list delta-story) ^+ +> @@ -748,22 +803,22 @@ |= d/delta-story [%story nom d] :: - ::> || - ::> || %data - ::> || - ::> utility functions for data retrieval. - ::+| + :> # + :> # %data + :> # + :> utility functions for data retrieval. + +| :: - ++ so-cir [our.bol nom] ::< us as circle + ++ so-cir [our.bol nom] :< us as circle :: - ::> || - ::> || %interaction-events - ::> || - ::> arms that apply events we received. - ::+| + :> # + :> # %interaction-events + :> # + :> arms that apply events we received. + +| :: - ++ so-take ::< accept circle prize - ::> apply the prize as if it were rumors. + ++ so-take + :> apply the prize as if it were rumors. :: |= {src/circle nes/(list envelope) cos/lobby pes/crowd} ^+ +> @@ -782,14 +837,14 @@ ::(so-hear | src %status src w %full s) (so-unpack src nes) :: - ++ so-hear ::< accept circle rumor - ::> apply changes from a rumor to this story. + ++ so-hear + :> apply changes from a rumor to this story. :: |= {bur/? src/circle rum/rumor-story} ::TODO tall-form gate comments like this for everything? - ::|= $: ::> bur: whether the story is inherited - :: ::> src: story to change - :: ::> rum: change to this story + ::|= $: :> bur: whether the story is inherited + :: :> src: story to change + :: :> rum: change to this story :: :: :: bur/? :: src/circle @@ -844,10 +899,12 @@ (so-delta-our rum) == :: - ++ so-bear ::< accept burden - ::> add what was pushed down from above to our - ::> state. in case of conflict, existing data is - ::> overwritten. + ++ so-bear + :> accept burden + :> + :> add what was pushed down from above to our + :> state. in case of conflict, existing data is + :> overwritten. :: |= {gaz/(list telegram) cos/lobby pes/crowd} ^+ +> @@ -934,13 +991,14 @@ ::TODO runtime error ::(so-delta-our %inherited &) :: - ::> || - ::> || %changes - ::> || - ::> arms that make miscellaneous changes to this story. - ::+| + :> # + :> # %changes + :> # + :> arms that make miscellaneous changes to this story. + +| :: - ++ so-present ::< accept status diff + ++ so-present + :> accept status diff |= {who/ship dif/diff-status} ^+ +> :: only have presence if you have write permission. @@ -955,9 +1013,11 @@ +> (so-delta-our %status so-cir who dif) :: - ++ so-config-full ::< split full config - ::> split a %full config delta up into multiple - ::> smaller ones, for easier application. + ++ so-config-full + :> split full config + :> + :> split a %full config delta up into multiple + :> smaller ones, for easier application. :: |= {old/(unit config) cof/config} ^+ +> @@ -982,9 +1042,11 @@ |= d/delta-story [%story nom d] :: - ++ so-sources ::< change source - ::> adds or removes {srs} from our sources, - ::> skipping over ones we already (don't) have. + ++ so-sources + :> change source + :> + :> adds or removes {srs} from our sources, + :> skipping over ones we already (don't) have. :: |= {add/? srs/(set source)} ^+ +> @@ -1008,54 +1070,66 @@ ?~ sus +>.$ (so-delta-our %follow add sus) :: - ++ so-depict ::< change description - ::> modifies our caption. + ++ so-depict + :> change description + :> + :> modifies our caption. :: |= cap/cord ^+ +> ?: =(cap cap.shape) +> (so-delta-our %config so-cir %caption cap) :: - ++ so-filter ::< change message rules - ::> modifies our filter. + ++ so-filter + :> change message rules + :> + :> modifies our filter. :: |= fit/filter ^+ +> ?: =(fit fit.shape) +> (so-delta-our %config so-cir %filter fit) :: - ++ so-delete ::< delete story - ::> deletes this story. removes it from {stories} - ::> and unsubscribes from all src. + ++ so-delete + :> delete story + :> + :> deletes this story. removes it from {stories} + :> and unsubscribes from all src. :: (so-delta-our %remove ~) :: - ::> || - ::> || %subscriptions - ::> || - ::> arms for starting and ending subscriptions - ::+| + :> # + :> # %subscriptions + :> # + :> arms for starting and ending subscriptions + +| :: - ++ so-greet ::< subscription started - ::> store a started subscription as source. + ++ so-greet + :> subscription started + :> + :> store a started subscription as source. :: |= src/source ^+ +> ?: (~(has in src.shape) src) +> (so-delta-our %config so-cir %source & src) :: - ++ so-leave ::< subscription ended - ::> delete {src} from our sources. + ++ so-leave + :> subscription ended + :> + :> delete {src} from our sources. :: |= src/source ^+ +> ?. (~(has in src.shape) src) +> (so-delta-our %config so-cir %source | src) :: - ++ so-resub ::< subscription revived - ::> re-subscribe to a dropped subscription. - ::> if it was already active, we continue where - ::> we left off. + ++ so-resub + :> subscription revived + :> + :> re-subscribe to a dropped subscription. + :> if it was already active, we continue where + :> we left off. :: |= src/source ^+ +> @@ -1079,8 +1153,10 @@ ?~ ran.src ~ tal.u.ran.src :: - ++ so-first-grams ::< beginning of stream - ::> find all grams that fall within the range. + ++ so-first-grams + :> beginning of stream + :> + :> find all grams that fall within the range. :: |= ran/range ^- (list telegram) @@ -1110,10 +1186,12 @@ :: if in the river, add this gram and continue. $(num +(num), gaz t.gaz, zeg [i.gaz zeg]) :: - ++ so-in-range ::< place in range? - ::> produces two booleans: whether we're - ::> currently in the range, and whether the range - ::> has passed. + ++ so-in-range + :> place in range? + :> + :> produces two booleans: whether we're + :> currently in the range, and whether the range + :> has passed. ::TODO to deal with changed messages, we'll want :: to be able to pass in a num. :: @@ -1133,14 +1211,14 @@ $da (gte +.u.tal.u.ran now.bol) == :: - ::> || - ::> || %messaging - ::> || - ::> arms for adding to this story's messages. - ::+| + :> # + :> # %messaging + :> # + :> arms for adding to this story's messages. + +| :: - ++ so-sane ::< sanitize - ::> sanitize %lin speech according to our settings. + ++ so-sane + :> sanitize %lin speech according to our settings. :: |= sep/speech ^- speech @@ -1168,9 +1246,11 @@ a == :: - ++ so-unpack ::< process envelopes - ::> learn telegrams from list of envelopes and - ::> update the sequence of the source if needed. + ++ so-unpack + :> process envelopes + :> + :> learn telegrams from list of envelopes and + :> update the sequence of the source if needed. :: |= {src/circle nes/(list envelope)} ^+ +> @@ -1183,9 +1263,11 @@ +>.$ (so-delta-our %sequent src num) :: - ++ so-open ::< process envelope - ::> learn telegram from envelope and update the - ::> sequence of the source if needed. + ++ so-open + :> process envelope + :> + :> learn telegram from envelope and update the + :> sequence of the source if needed. :: |= {src/circle nev/envelope} ^+ +> @@ -1194,17 +1276,19 @@ +> (so-delta-our %sequent src num.nev) :: - ++ so-lesson ::< learn messages - ::> learn all telegrams in a list. + ++ so-lesson + :> learn all telegrams in a list. :: |= {src/circle gaz/(list telegram)} ^+ +> ?~ gaz +> $(gaz t.gaz, +> (so-learn src i.gaz)) :: - ++ so-learn ::< save/update message - ::> store an incoming telegram, updating if it - ::> already exists. + ++ so-learn + :> save/update message + :> + :> store an incoming telegram, updating if it + :> already exists. :: |= {src/circle gam/telegram} ^+ +> @@ -1214,19 +1298,21 @@ =. sep.gam (so-sane sep.gam) (so-delta-our %gram src gam) :: - ::> || - ::> || %permissions - ::> || - ::> arms relating to story permissions. - ::+| + :> # + :> # %permissions + :> # + :> arms relating to story permissions. + +| :: - ++ so-permit ::< invite/banish - ::> update config to dis/allow ships permission. + ++ so-permit + :> invite/banish + :> + :> update config to dis/allow ships permission. :: |= {inv/? sis/(set ship)} ^+ +> - ::> wyt: whitelist? - ::> add: add to list? + :> wyt: whitelist? + :> add: add to list? =/ wyt/? ?=(?($village $journal) sec.con.shape) =/ add/? =(inv wyt) =/ sus/(set ship) @@ -1250,73 +1336,85 @@ [s %remove ~] (so-delta-our %config so-cir %permit [add sus]) :: - ++ so-admire ::< accept from - ::> checks {her} write permissions. + ++ so-admire + :> accept from + :> + :> checks {her} write permissions. :: |= her/ship ^- ? ?- sec.con.shape - $channel !(~(has in sis.con.shape) her) ::< blacklist - $village (~(has in sis.con.shape) her) ::< whitelist - $journal (~(has in sis.con.shape) her) ::< author whitelist - $mailbox !(~(has in sis.con.shape) her) ::< author blacklist + $channel !(~(has in sis.con.shape) her) :< blacklist + $village (~(has in sis.con.shape) her) :< whitelist + $journal (~(has in sis.con.shape) her) :< author whitelist + $mailbox !(~(has in sis.con.shape) her) :< author blacklist == :: - ++ so-visible ::< display to - ::> checks {her} read permissions. + ++ so-visible + :> checks {her} read permissions. :: |= her/ship ^- ? ?- sec.con.shape - $channel !(~(has in sis.con.shape) her) ::< blacklist - $village (~(has in sis.con.shape) her) ::< whitelist - $journal & ::< all - $mailbox (team:title our.bol her) ::< our team + $channel !(~(has in sis.con.shape) her) :< blacklist + $village (~(has in sis.con.shape) her) :< whitelist + $journal & :< all + $mailbox (team:title our.bol her) :< our team == -- -- :: -++ da ::< delta application - ::> core for doing things, mostly applying deltas to - ::> application state, but also dealing with events - ::> that aren't pokes. - ::> where appropriate, creates moves. those get - ::> produced when finalizing with ++da-done. +++ da + :> delta application + :> + :> core for doing things, mostly applying deltas to + :> application state, but also dealing with events + :> that aren't pokes. + :> where appropriate, creates moves. those get + :> produced when finalizing with ++da-done. :: - |_ ::> moves: moves created by core operations. + |_ :> moves: moves created by core operations. :: moves/(list move) + :> # %resolve + +| :: - ++ da-done ::< resolve core - ::> produces the moves stored in ++da's moves. - ::> they are produced in reverse order because - ::> ++da-emil and ++da-emit add them to the head of - ::> the {moves}. + ++ da-done + :> resolve core + :> + :> produces the moves stored in ++da's moves. + :> they are produced in reverse order because + :> ++da-emil and ++da-emit add them to the head of + :> the {moves}. :: ^- (quip move _+>) [(flop moves) +>] :: - ::> || - ::> || %emitters - ::> || - ::> arms that create outward changes. - ::+| + :> # + :> # %emitters + :> # + :> arms that create outward changes. + +| :: - ++ da-emil ::< emit move list - ::> adds multiple moves to the head of {moves}. - ::> flops to stay consistent with ++ta-emit. + ++ da-emil + :> emit move list + :> + :> adds multiple moves to the head of {moves}. + :> flops to stay consistent with ++ta-emit. :: |= mol/(list move) %_(+> moves (welp (flop mol) moves)) :: - ++ da-emit ::< emit a move - ::> adds a move to the head of {moves}. + ++ da-emit + :> emit a move + :> + :> adds a move to the head of {moves}. :: |= mov/move %_(+> moves [mov moves]) :: - ++ da-present ::< send %present cmd - ::> + ++ da-present + :> send %present cmd :: |= {hos/ship nos/(set naem) dif/diff-status} ^+ +> @@ -1328,15 +1426,17 @@ [%hall-command %present nos dif] == :: - ::> || - ::> || %change-application - ::> || - ::> arms that change the application state. - ::+| + :> # + :> # %change-application + :> # + :> arms that change the application state. + +| :: - ++ da-change ::< apply delta - ::> modifies application state according to the - ::> change specified in {dif}. + ++ da-change + :> apply delta + :> + :> modifies application state according to the + :> change specified in {dif}. :: |= det/delta ^+ +> @@ -1352,22 +1452,28 @@ $present (da-present +.det) == :: - ++ da-init ::< startup side-effects - ::> apply %init delta, querying the /burden of the - ::> ship above us. + ++ da-init + :> startup side-effects + :> + :> apply %init delta, querying the /burden of the + :> ship above us. :: (da-emit (wire-to-peer /burden)) :: - ++ da-observe ::< watch burden bearer - ::> apply %observe delta, querying the /report of - ::> {who} below us. + ++ da-observe + :> watch burden bearer + :> + :> apply %observe delta, querying the /report of + :> {who} below us. :: |= who/ship (da-emit (wire-to-peer /report/(scot %p who))) :: - ++ da-change-public ::< show/hide membership - ::> add/remove a circle to/from the public - ::> membership list. + ++ da-change-public + :> show/hide membership + :> + :> add/remove a circle to/from the public + :> membership list. :: |= {add/? cir/circle} ^+ +> @@ -1375,8 +1481,10 @@ ?: add (~(put in public) cir) (~(del in public) cir) :: - ++ da-change-out ::< outgoing messages - ::> apply an %out delta, sending a message. + ++ da-change-out + :> outgoing messages + :> + :> apply an %out delta, sending a message. :: |= {cir/circle out/(list thought)} ^+ +> @@ -1396,9 +1504,11 @@ [%hall-command %publish out] == :: - ++ da-change-done ::< delivered messages - ::> apply a %done delta, setting new delivery state - ::> for messages. + ++ da-change-done + :> delivered messages + :> + :> apply a %done delta, setting new delivery state + :> for messages. :: |= {cir/circle ses/(list serial) res/delivery} ^+ +> @@ -1413,9 +1523,11 @@ cir res == :: - ++ da-change-glyph ::< un/bound glyph - ::> apply a %glyph delta, un/binding a glyph to/from - ::> an audience. + ++ da-change-glyph + :> un/bound glyph + :> + :> apply a %glyph delta, un/binding a glyph to/from + :> an audience. :: |= {bin/? gyf/char aud/audience} ^+ +> @@ -1433,25 +1545,29 @@ ole t.ole == :: - ++ da-change-nick ::< changed nickname - ::> apply a %nick delta, setting a nickname for a - ::> ship. + ++ da-change-nick + :> changed nickname + :> + :> apply a %nick delta, setting a nickname for a + :> ship. :: |= {who/ship nic/nick} ^+ +> +>(nicks (change-nicks nicks who nic)) :: - ::> || - ::> || %stories - ::> || - ::> arms for modifying stories. - ::+| + :> # + :> # %stories + :> # + :> arms for modifying stories. + +| :: - ++ da-change-story ::< apply circle delta - ::> apply a %story delta, redirecting the delta - ::> itself to ++sa-change. - ::> in case of a new or deleted story, specialized - ::> arms are called. + ++ da-change-story + :> apply circle delta + :> + :> apply a %story delta, redirecting the delta + :> itself to ++sa-change. + :> in case of a new or deleted story, specialized + :> arms are called. :: |= {nom/naem det/delta-story} ^+ +> @@ -1466,8 +1582,10 @@ $remove (da-delete nom) == :: - ++ da-create ::< configure story - ::> creates story {nom} with config {con}. + ++ da-create + :> configure story + :> + :> creates story {nom} with config {con}. :: |= {nom/naem cof/config} ^+ +> @@ -1475,8 +1593,10 @@ %- ~(sa-change sa nom *story) [%config [our.bol nom] %full cof] :: - ++ da-delete ::< delete story - ::> calls the story core to delete story {nom}. + ++ da-delete + :> delete story + :> + :> calls the story core to delete story {nom}. :: |= nom/naem ^+ +> @@ -1485,72 +1605,86 @@ ~(sa-delete sa nom (~(got by stories) nom)) +>(stories (~(del by stories) nom)) :: - ++ sa ::< story delta core - ::> story core, used for doing work on a story. + ++ sa + :> story delta core + :> + :> story core, used for doing work on a story. :: - |_ ::> nom: story name in {stories}. - ::> story is faceless to ease data access. + |_ :> nom: story name in {stories}. + :: story is faceless to ease data access. :: $: nom/naem story == + :> # %resolve + +| :: - ++ sa-done ::< apply changes - ::> put changed story back into the map. + ++ sa-done + :> apply changes + :> + :> put changed story back into the map. :: +>(stories (~(put by stories) nom +<+)) :: - ::> || - ::> || %emitters - ::> || - ::> arms that create outward changes. - ::+| + :> # + :> # %emitters + :> # + :> arms that create outward changes. + +| :: - ++ sa-emil ::< emit move list - ::> adds multiple moves to the head of {moves}. - ::> flops to stay consistent with ++ta-emit. + ++ sa-emil + :> emit move list + :> + :> adds multiple moves to the head of {moves}. + :> flops to stay consistent with ++ta-emit. :: |= mol/(list move) %_(+> moves (welp (flop mol) moves)) :: - ++ sa-emit ::< emit a move - ::> adds a move to the head of {moves}. + ++ sa-emit + :> emit a move + :> + :> adds a move to the head of {moves}. :: |= mov/move %_(+> moves [mov moves]) :: - ++ sa-sauce ::< play cards - ::> cards to moves. + ++ sa-sauce + :> cards to moves. :: |= {ost/bone cub/(list card)} ^- (list move) (flop (turn cub |=(a/card [ost a]))) :: - ::> || - ::> || %data - ::> || - ::> utility functions for data retrieval. - ::+| + :> # + :> # %data + :> # + :> utility functions for data retrieval. + +| :: ++ sa-cir [our.bol nom] :: - ::> || - ::> || %delta-application - ::> || - ::> arms for applying deltas. - ::+| + :> # + :> # %delta-application + :> # + :> arms for applying deltas. + +| :: - ++ sa-delete ::< deletion of story - ::> apply a %remove story delta, unsubscribing - ::> this story from all its active sources. + ++ sa-delete + :> deletion of story + :> + :> apply a %remove story delta, unsubscribing + :> this story from all its active sources. :: %+ weld (sa-abjure src.shape) (sa-eject ~(key by peers)) :: - ++ sa-change ::< apply circle delta - ::> figure out whether to apply a %story delta to - ::> local or remote data. + ++ sa-change + :> apply circle delta + :> + :> figure out whether to apply a %story delta to + :> local or remote data. :: |= det/delta-story ^+ +> @@ -1561,8 +1695,10 @@ sa-change-remote sa-change-local :: - ++ sa-change-local ::< apply our delta - ::> apply a %story delta to local data. + ++ sa-change-local + :> apply our delta + :> + :> apply a %story delta to local data. :: |= det/delta-story ^+ +> @@ -1610,9 +1746,11 @@ == == :: - ++ sa-change-gram ::< save/update message - ::> apply a %gram delta, either appending or - ::> updating a message. + ++ sa-change-gram + :> save/update message + :> + :> apply a %gram delta, either appending or + :> updating a message. :: |= {src/circle gam/telegram} ^+ +> @@ -1640,8 +1778,10 @@ [gam (slag u.old grams)] == :: - ++ sa-change-remote ::< apply remote's delta - ::> apply a story diff to remote data. + ++ sa-change-remote + :> apply remote's delta + :> + :> apply a story diff to remote data. :: |= det/delta-story ^+ +> @@ -1668,8 +1808,8 @@ == == :: - ++ sa-config-effects ::< config side-effects - ::> apply side-effects for a %config delta. + ++ sa-config-effects + :> apply side-effects for a %config delta. :: |= {old/config dif/diff-config} ^- (list move) @@ -1679,19 +1819,23 @@ :: necessary %permit deltas alongside it. == :: - ++ sa-follow-effects ::< un/subscribe - ::> apply side-effects for a %follow delta, - ::> un/subscribing this story to/from {cos}. + ++ sa-follow-effects + :> un/subscribe + :> + :> apply side-effects for a %follow delta, + :> un/subscribing this story to/from {cos}. :: |= {sub/? srs/(set source)} ^- (list move) %. srs ?:(sub sa-acquire sa-abjure) :: - ++ sa-permit-effects ::< notify permitted - ::> apply side-effects for a %permit delta, - ::> kicking the subscriptions of {sis} if they - ::> are being banished. + ++ sa-permit-effects + :> notify permitted + :> + :> apply side-effects for a %permit delta, + :> kicking the subscriptions of {sis} if they + :> are being banished. :: |= {sec/security old/(set ship) add/? sis/(set ship)} ^- (list move) @@ -1703,14 +1847,14 @@ ?:(add ~(dif in sis) ~(int in sis)) (sa-eject sus) :: - ::> || - ::> || %subscriptions - ::> || - ::> arms for starting and ending subscriptions - ::+| + :> # + :> # %subscriptions + :> # + :> arms for starting and ending subscriptions + +| :: - ++ sa-acquire ::< subscribe us - ::> subscribes this story to each circle. + ++ sa-acquire + :> subscribes this story to each circle. :: |= srs/(set source) =- (murn - same) @@ -1721,8 +1865,8 @@ =+ wat=~[%grams %config-l %group-l] `(wire-to-peer (circle-wire nom wat cir ran)) :: - ++ sa-abjure ::< unsubscribe us - ::> unsubscribes this story from each circle. + ++ sa-abjure + :> unsubscribes this story from each circle. :: |= srs/(set source) ^- (list move) @@ -1735,8 +1879,8 @@ [cir ran] [0 %pull wir [hos.cir dap.bol] ~] :: - ++ sa-eject ::< unsubscribe ships - ::> removes ships {sis} from {followers}. + ++ sa-eject + :> removes ships {sis} from {followers}. :: |= sis/(set ship) ^- (list move) @@ -1751,9 +1895,11 @@ ~ (gentle-quit b s (path-to-query p)) :: - ++ sa-unearth ::< ships' bones - ::> find the bones in {sup.bol} that belong to - ::> a ship in {sis}. + ++ sa-unearth + :> ships' bones + :> + :> find the bones in {sup.bol} that belong to + :> a ship in {sis}. :: |= sis/(set ship) ^- (set bone) @@ -1769,14 +1915,16 @@ -- :: :: -::> || -::> || %wire-utility -::> || -::+| +:> # +:> # %wire-utility +:> # ++| :: -++ circle-wire ::< /circle peer wire - ::> constructs a /circle %peer path for subscribing - ::> {nom} to a source. +++ circle-wire + :> /circle peer wire + :> + :> constructs a /circle %peer path for subscribing + :> {nom} to a source. :: |= {nom/naem wat/(list circle-data) source} ^- wire @@ -1786,17 +1934,21 @@ (range-to-path ran) == :: -++ wire-to-peer ::< peer move from wire - ::> builds the peer move associated with the wire. +++ wire-to-peer + :> peer move from wire + :> + :> builds the peer move associated with the wire. :: |= wir/wire ^- move =+ tar=(wire-to-target wir) [0 %peer wir [p.tar dap.bol] q.tar] :: -++ wire-to-target ::< ship+path from wire - ::> parses {wir} to obtain the target ship and the - ::> query path. +++ wire-to-target + :> ship+path from wire + :> + :> parses {wir} to obtain the target ship and the + :> query path. :: |= wir/wire ^- (pair ship path) @@ -1814,10 +1966,12 @@ /report == :: -++ etch ::< parse wire - ::> parses {wir} to obtain either %circle with story - ::> and circle or %repeat with message number, source - ::> ship, story and serials. +++ etch + :> parse wire + :> + :> parses {wir} to obtain either %circle with story + :> and circle or %repeat with message number, source + :> ship, story and serials. :: |= wir/wire ^- weir @@ -1835,9 +1989,11 @@ ((list serial) (cue (slav %ud i.t.t.t.wir))) == :: -++ etch-circle ::< parse /circle wire - ::> parses a /circle wire, call a gate with the - ::> result. +++ etch-circle + :> parse /circle wire + :> + :> parses a /circle wire, call a gate with the + :> result. :: |= $: wir/wire $= fun @@ -1847,8 +2003,8 @@ =+ wer=(etch wir) ?>(?=($circle -.wer) (fun nom.wer src.wer)) :: -++ etch-repeat ::< parse /repeat wire - ::> parses a /repeat wire, call gate with the result. +++ etch-repeat + :> parses a /repeat wire, call gate with the result. :: |= $: wir/wire $= fun @@ -1858,14 +2014,16 @@ =+ wer=(etch wir) ?>(?=($repeat -.wer) (fun cir.wer ses.wer)) :: -++ gentle-quit ::< quit other, pull us - ::> we want to gently pull our own subscriptions, - ::> rather than quitting them, so that we may - ::> differentiate between a gall/ames quit and a - ::> foreign quit. but since wex.bol isn't filled, - ::> we'll have to just guess at what the correct wire - ::> wire is. this is truly terrible, but will have to - ::> do for now. +++ gentle-quit + :> quit other, pull us + :> + :> we want to gently pull our own subscriptions, + :> rather than quitting them, so that we may + :> differentiate between a gall/ames quit and a + :> foreign quit. but since wex.bol isn't filled, + :> we'll have to just guess at what the correct wire + :> wire is. this is truly terrible, but will have to + :> do for now. ::TODO get rid of this once gall improves. :: it needs to tell us the difference between :: an app-caused quit and a queue-caused one. @@ -1890,20 +2048,22 @@ [[our.bol dap.bol] ~] == :: -::> || -::> || %new-events -::> || -::+| -++ bake ::< apply state delta - ::> applies a change to the application state, - ::> producing side-effects. +:> # +:> # %new-events +:> # ++| +++ bake + :> apply state delta + :> + :> applies a change to the application state, + :> producing side-effects. :: |= det/delta ^- (quip move _+>) da-done:(da-change:da det) :: -++ pre-bake ::< apply more deltas - ::> bake a list of deltas. +++ pre-bake + :> apply more deltas :: |= des/(list delta) ^- (quip move _+>) @@ -1918,8 +2078,10 @@ ::=^ mos +>.^$ (bake d) ::[:(welp m mos (affection d)) +>.^$] :: -++ peek ::< query on state - ::> find the result (if any) for a given query. +++ peek + :> query on state + :> + :> find the result (if any) for a given query. :: |= qer/query ^- (unit (unit prize)) @@ -1988,15 +2150,17 @@ remotes.u.soy == :: -++ dedicate ::< rumor-story to theirs - ::> modify a %story diff to make it about their ship - ::> instead of ours. +++ dedicate + :> rumor-story to theirs + :> + :> modify a %story diff to make it about their ship + :> instead of ours. :: |= {who/ship nom/naem det/delta-story} ^- rumor-story ?+ -.det det :: - ::> internal-only changes. + :: internal-only changes. $follow !! $inherited !! $sequent !! @@ -2026,10 +2190,12 @@ det(cir [who nom]) == :: -++ gram-to-envelope ::< wrap gram with nr - ::> deduce the initial msg number from a telegram - ::> for a given story. assumes both story and - ::> telegram are known. +++ gram-to-envelope + :> wrap gram with nr + :> + :> deduce the initial msg number from a telegram + :> for a given story. assumes both story and + :> telegram are known. :: |= {nom/naem gam/telegram} ^- envelope @@ -2037,8 +2203,7 @@ %. uid.gam ~(got by known:(~(got by stories) nom)) :: -++ circle-feel-story ::< - ::> +++ circle-feel-story :: |= $: wer/(unit circle) wat/(set circle-data) @@ -2066,9 +2231,11 @@ == == :: -++ feel ::< delta to rumor - ::> if the given delta changes the result of the given - ::> query, produce the relevant rumor. +++ feel + :> delta to rumor + :> + :> if the given delta changes the result of the given + :> query, produce the relevant rumor. :: |= {qer/query det/delta} ^- (unit rumor) @@ -2151,9 +2318,11 @@ == == :: -++ affection ::< rumors to interested - ::> for a given delta, send rumors to all queries it - ::> affects. +++ affection + :> rumors to interested + :> + :> for a given delta, send rumors to all queries it + :> affects. :: |= det/delta ^- (list move) @@ -2181,9 +2350,11 @@ =- ~(so-in-range so:ta nom.qer ~ -) (~(got by stories) nom.qer) :: -++ path-to-query ::< path, coins, query - ::> parse a path into a (list coin), then parse that - ::> into a query structure. +++ path-to-query + :> path, coins, query + :> + :> parse a path into a (list coin), then parse that + :> into a query structure. :: |= pax/path ?. ?=({$circle @tas *} pax) @@ -2219,8 +2390,10 @@ == == :: -++ path-to-coins ::< path to coin list - ::> parse a path into a list of coins. +++ path-to-coins + :> path to coin list + :> + :> parse a path into a list of coins. :: |= pax/path ^- (list coin) @@ -2228,8 +2401,10 @@ |= a/@ta (need (slay a)) :: -++ coins-to-query ::< coin list to query - ::> parse a list of coins into a query structure. +++ coins-to-query + :> coin list to query + :> + :> parse a list of coins into a query structure. :: ^- $-((list coin) query) => depa @@ -2245,9 +2420,11 @@ ++ plac (or %da %ud) -- :: -++ leak ::< visible to - ::> determine if the given query is visible to the - ::> ship. +++ leak + :> visible to + :> + :> determine if the given query is visible to the + :> ship. :: |= {who/ship qer/query} ^- ? @@ -2267,13 +2444,15 @@ ~(so-visible so:ta nom.qer ~ (~(got by stories) nom.qer)) == :: -::> || -::> || %poke-events -::> || -::+| +:> # +:> # %poke-events +:> # ++| :: -++ poke-hall-command ::< accept command - ::> incoming hall command. process it and update logs. +++ poke-hall-command + :> accept command + :> + :> incoming hall command. process it and update logs. :: |= cod/command ^- (quip move _+>) @@ -2284,8 +2463,10 @@ log-all-to-file [(welp mos mow) +>.$] :: -++ poke-hall-action ::< accept action - ::> incoming hall action. process it. +++ poke-hall-action + :> accept action + :> + :> incoming hall action. process it. :: |= act/action ^- (quip move _+>) @@ -2301,13 +2482,15 @@ log-all-to-file [(welp mos mow) +>.$] :: -::> || -::> || %subscription-events -::> || -::+| +:> # +:> # %subscription-events +:> # ++| :: -++ diff-hall-prize ::< accept prize - ::> accept a query result. +++ diff-hall-prize + :> accept prize + :> + :> accept a query result. :: |= {wir/wire piz/prize} ^- (quip move _+>) @@ -2322,8 +2505,10 @@ log-all-to-file [(welp mos mow) +>.$] :: -++ diff-hall-rumor ::< accept rumor - ::> accept a query result change. +++ diff-hall-rumor + :> accept rumor + :> + :> accept a query result change. :: |= {wir/wire rum/rumor} ^- (quip move _+>) @@ -2345,8 +2530,10 @@ log-all-to-file [(welp mos mow) +>.$] :: -++ peer ::< accept subscription - ::> incoming subscription on {pax}. +++ peer + :> accept subscription + :> + :> incoming subscription on {pax}. :: |= pax/path ^- (quip move _+>) @@ -2363,15 +2550,15 @@ :_ mos [ost.bol %diff %hall-prize u.u.piz] :: -++ pull ::< unsubscribe - ::> unsubscribes. +++ pull + :> unsubscribes. :: |= pax/path ^- (quip move _+>) [~ +>] :: -++ pull-circle ::< circle unsubscribe - ::> someone ends a /circle subscription. +++ pull-circle + :> someone ends a /circle subscription. :: |= pax/path ^- (quip move _+>) @@ -2382,8 +2569,10 @@ :+ %story nom.qer [%peer | src.bol qer] :: -++ reap ::< subscription n/ack - ::> update state to reflect subscription success +++ reap + :> subscription n/ack + :> + :> update state to reflect subscription success :: |= {wir/wire fal/(unit tang)} ^- (quip move _+>) @@ -2401,8 +2590,10 @@ %- pre-bake ta-done:(ta-leave:ta nom src) :: -++ quit ::< dropped subscription - ::> gall dropped out subscription. resubscribe. +++ quit + :> dropped subscription + :> + :> gall dropped out subscription. resubscribe. :: |= wir/wire ^- (quip move _+>) @@ -2410,8 +2601,10 @@ ?. =(src.bol our.bol) ~ [(wire-to-peer wir) ~] :: -++ quit-circle ::< dropped circle sub - ::> gall dropped our subscription. resubscribe. +++ quit-circle + :> dropped circle sub + :> + :> gall dropped our subscription. resubscribe. :: |= wir/wire ^- (quip move _+>) @@ -2423,9 +2616,11 @@ ta-done:(ta-action:ta %source nom | [src ~ ~]) ta-done:(ta-resub:ta nom src) :: -++ coup-repeat ::< message n/ack - ::> ack from ++ta-transmit. mark the message as - ::> received or rejected. +++ coup-repeat + :> message n/ack + :> + :> ack from ++ta-transmit. mark the message as + :> received or rejected. :: |= {wir/wire fal/(unit tang)} ^- (quip move _+>) @@ -2434,14 +2629,16 @@ %- pre-bake ta-done:(ta-repeat:ta cir ses fal) :: -::> || -::> || %logging -::> || -::+| +:> # +:> # %logging +:> # ++| :: -++ poke-hall-save ::< save as log - ::> stores the telegrams of story {nom} in a log file, - ::> to be re-loaded by ++poke-hall-load. +++ poke-hall-save + :> save as log + :> + :> stores the telegrams of story {nom} in a log file, + :> to be re-loaded by ++poke-hall-load. ::TODO maybe update to also store sourced list. :: |= nom/naem @@ -2458,8 +2655,8 @@ (foal:space:userlib paf [%hall-telegrams !>(-)]) == :: -++ poke-load-legacy ::< load legacy grams - ::> loads legacy messages into the story {nom}. +++ poke-load-legacy + :> loads legacy messages into the story {nom}. :: |= nom/naem ^- (quip move _+>) @@ -2475,9 +2672,11 @@ |= t/telegram [%story nom %gram [our.bol nom] t] :: -++ poke-hall-load ::< load from log - ::> loads the telegrams of story {nom} into our state, - ::> as saved in ++poke-hall-save. +++ poke-hall-load + :> load from log + :> + :> loads the telegrams of story {nom} into our state, + :> as saved in ++poke-hall-save. :: |= nom/naem ^- (quip move _+>) @@ -2491,8 +2690,8 @@ |= t/telegram [%story nom %gram [our.bol nom] t] :: -++ poke-hall-log ::< start logging - ::> starts logging story {nom}'s messages. +++ poke-hall-log + :> starts logging story {nom}'s messages. :: |= nom/naem ^- (quip move _+>) @@ -2503,17 +2702,19 @@ count:(~(got by stories) nom) == :: -++ poke-hall-unlog ::< stop logging - ::> stops logging story {nom}'s messages. +++ poke-hall-unlog + :> stops logging story {nom}'s messages. :: |= nom/naem ^- (quip move _+>) :- ~ +>.$(log (~(del by log) nom)) :: -++ log-all-to-file ::< update stories logs - ::> for every story we're logging, (over)writes all - ::> their grams to log files if new ones have arrived. +++ log-all-to-file + :> update stories logs + :> + :> for every story we're logging, (over)writes all + :> their grams to log files if new ones have arrived. :: ^- (quip move _.) :_ %_ . @@ -2529,8 +2730,8 @@ ~ `(log-to-file nom) :: -++ log-to-file ::< update story log - ::> logs all grams of story {nom} to a file. +++ log-to-file + :> logs all grams of story {nom} to a file. :: |= nom/naem ^- move diff --git a/lib/hall.hoon b/lib/hall.hoon index dbde94209..69cc0c6d2 100644 --- a/lib/hall.hoon +++ b/lib/hall.hoon @@ -44,9 +44,11 @@ ^- {serial _eny.bol} [(shaf %serial eny.bol) (shax eny.bol)] :: -++ range-to-path ::< msg range to path - ::> turns a range structure into a path used for - ::> subscriptions. +++ range-to-path + :> msg range to path + :> + :> turns a range structure into a path used for + :> subscriptions. :: |= ran/range ^- path @@ -56,9 +58,11 @@ ?~ tal.u.ran ~ /(scot -.u.tal.u.ran +.u.tal.u.ran) :: -++ path-to-range ::< path to msg range - ::> turns the tail of a subscription path into a - ::> range structure, skipping over non-range terms. +++ path-to-range + :> path to msg range + :> + :> turns the tail of a subscription path into a + :> range structure, skipping over non-range terms. :: |= pax/path ^- range @@ -76,8 +80,7 @@ ?^ tal [%da u.tal] [%ud (slav %ud i.t.pax)] :: -++ change-glyphs ::< ... - ::> +++ change-glyphs :< ... :: |= {gys/(jug char audience) bin/? gyf/char aud/audience} ^+ gys @@ -88,9 +91,11 @@ :: unbind single. (~(del ju gys) gyf aud) :: -++ change-nicks ::< change nick map - ::> changes a nickname in a map, adding if it doesn't - ::> yet exist, removing if the nickname is empty. +++ change-nicks + :> change nick map + :> + :> changes a nickname in a map, adding if it doesn't + :> yet exist, removing if the nickname is empty. :: |= {nis/(map ship cord) who/ship nic/cord} ^+ nis @@ -98,8 +103,8 @@ (~(del by nis) who) (~(put by nis) who nic) :: -++ change-config ::< apply config diff - ::> applies a config diff to the given config. +++ change-config + :> applies a config diff to the given config. :: |= {cof/config dif/diff-config} ^+ cof @@ -140,8 +145,8 @@ == == :: -++ change-status ::< apply status diff - ::> applies a status diff to the given status. +++ change-status + :> applies a status diff to the given status. :: |= {sat/status dif/diff-status} ^+ sat @@ -179,7 +184,7 @@ |* typ/{@tas (pole @tas)} =+ [i-typ t-typ]=typ |= wer/weir - ^- (tup:dray:wired i-typ t-typ) ::< ie, (tup %p %tas ~) is {@p @tas} + ^- (tup:dray:wired i-typ t-typ) :: ie, (tup %p %tas ~) is {@p @tas} ?~ wer !! ?~ t-typ ?^ t.wer !!