From 764b199a99b874ca0bc2770c6a25c60893a5e4f6 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 26 Aug 2015 18:21:21 -0400 Subject: [PATCH 1/2] minor rearchitecting --- ape/talk.hoon | 2 +- ape/work.hoon | 177 ++++++++++++++++++++++++------------------ mar/work/command.hoon | 7 +- mar/work/task.hoon | 11 ++- sur/talk.hoon | 35 ++++----- sur/work.hoon | 15 ++-- 6 files changed, 130 insertions(+), 117 deletions(-) diff --git a/ape/talk.hoon b/ape/talk.hoon index 5140f61b2..75c9d2d36 100644 --- a/ape/talk.hoon +++ b/ape/talk.hoon @@ -1679,7 +1679,7 @@ "[{(trip p.sep)}]: {(trip q.sep)}" :: %tax - " {}" + " {}: {}" == -- :: diff --git a/ape/work.hoon b/ape/work.hoon index 77dac66ec..3952d484d 100644 --- a/ape/work.hoon +++ b/ape/work.hoon @@ -2,13 +2,20 @@ :: it can't :: maybe look into storing a "following" set :: make most updates not rely on knowing about task (all but claim?) -:: should let non-owners suggest that owner cross-post to another +:: should let non-creator suggest that creator cross-post to another :: station :: :: pretty-print in command-line interface :: serialize %lax to json :: bring up ~dozbud to test :: +:: save log! +:: +:: audience stuff seems messed up from talk? get extraneous stations +:: +:: first thing to do is obviously make process-duty accept stuff out +:: of order +:: :::: :: /? 314 @@ -31,7 +38,11 @@ !: :::: :: -|_ [bowl client connected=_|] +|_ $: bowl + client + connected=_| + unordered=(map ,[@uvH @u] (pair ship flesh:work-stuff:talk)) + == ++ at |= client-task =| moves=(list move) @@ -72,34 +83,35 @@ |= action=duty:work-stuff:talk (send-audience audience action) :: - ++ claim - (send-audience(claiming &) [[owner.tax (main owner.tax)] ~ ~] %claim id.tax) - :: ++ send-archive |= to=(set station:talk) (send-audience to %archive id.tax) :: ++ send-create (send %create tax) + ++ send-change |* * + %+ send-audience + [[creator.tax (main creator.tax)] ~ ~] + [%change id.tax +<] ++ send-update |*(* (send %update id.tax +<)) - ++ release |=([vers=@u her=@p] (send-update vers %release her)) - ++ accept |=(vers=@u (send-update vers %accept ~)) ++ process-update - |= [vers=@u up=update] + |= up=update ^+ +> ?- -.up - %add ?>(?=(%comment +<.up) (send-update vers %add-comment +>.up)) + %add ?>(?=(%comment +<.up) (send-change %add-comment +>.up)) %own ?- +<.up - %announce (send-update vers %announce ~) - %claim claim + %announce (send-change %set-doer ~) + %claim (send-change %set-doer `our) == + :: %set ?- +<.up - %date-due (send-update vers %set-date-due +>.up) - %title (send-update vers %set-title +>.up) - %description (send-update vers %set-description +>.up) - %tags (send-update vers %set-tags +>.up) - %done (send-update vers %set-done +>.up) + %doer (send-change %set-doer +>.up) + %date-due (send-change %set-date-due +>.up) + %title (send-change %set-title +>.up) + %description (send-change %set-description +>.up) + %tags (send-change %set-tags +>.up) + %done (send-change %set-done +>.up) == == ++ process-audience @@ -111,7 +123,14 @@ -- :: ++ prep - |= [old=(unit (pair client ,_|))] + |= $= old + $_ + =< $ + %- unit + $: client + _| + (map ,[@uvH @u] (pair ship flesh:work-stuff:talk)) + == ^- [(list move) _+>.$] initialize(+<+ ?~(old +<+.+>.$ u.old)) :: @@ -142,8 +161,8 @@ existing-task=u.existing-task == [~ +>.$] - ?. |(=(her owner.tax.action) =(%released status.tax.action)) - ~& :* %created-with-bad-owner + ?. =(her creator.tax.action) + ~& :* %created-with-bad-creator her=her from=from new-task=tax.action @@ -152,22 +171,11 @@ [~ +>.$] =. tasks %^ ~(put by tasks) id.tax.action | - :- | :_ tax.action + :_ tax.action ?~ existing-task from (~(uni in audience.u.existing-task) from) =. sort ?^(existing-task sort [id.tax.action sort]) [~ +>.$] - :: - %claim - =+ tax=(~(got by tasks) id.action) - ?. &(=(our owner.tax.tax) =(%announced status.tax.tax)) - ~& :* %bad-claim - her=her - from=from - task=tax - == - [~ +>.$] - abet:(release:(at (~(got by tasks) id.action)) +(version.tax.tax) her) :: %archive =+ tax=(~(get by tasks) id.action) @@ -178,8 +186,8 @@ action=action == [~ +>.$] - ?: !=(her owner.tax.u.tax) - ~& :* %archiver-not-owner + ?: !=(her creator.tax.u.tax) + ~& :* %archiver-not-creator her=her from=from action=action @@ -188,12 +196,30 @@ [~ +>.$] =. tasks %+ ~(put by tasks) id.action - :* claiming.u.tax - =(~ (~(dif in audience.u.tax) from)) + :* =(~ (~(dif in audience.u.tax) from)) (~(dif in audience.u.tax) from) tax.u.tax == [~ +>.$] + :: + %change + =+ tax=(~(get by tasks) id.action) + ?~ tax + ~& :* %change-for-nonexistent-task + her=her + from=from + action=action + == + [~ +>.$] + ?: !=(our creator.tax.u.tax) + ~& :* %me-not-creator + her=her + from=from + action=action + tax=tax + == + [~ +>.$] + abet:(send-update:(at u.tax) +(version.tax.u.tax) her meat.action) :: %update =+ tax=(~(get by tasks) id.action) @@ -204,6 +230,14 @@ action=action == [~ +>.$] + ?: !=(her creator.tax.u.tax) + ~& :* %her-not-creator + her=her + from=from + action=action + tax=tax + == + [~ +>.$] ?. =(version.action +(version.tax.u.tax)) ~& :* %update-bad-version her @@ -211,49 +245,40 @@ action=action tax=tax == - [~ +>.$] - ?: ?& ?=(?(%announce %release %accept) -.meat.action) - !=(her owner.tax.u.tax) - == - ~& :* %not-owner - her=her - from=from - action=action - tax=tax - == - [~ +>.$] + :- ~ + %_ +>.$ + unordered + %+ ~(put by unordered) + [id.action version.action] + [her.action meat.action] + == + |- =. tasks %+ ~(put by tasks) id.action - :* ?: ?=(%release -.meat.action) - | - claiming.u.tax - :: - archived.u.tax - :: - (~(uni in audience.u.tax) from) - :: - =. version.tax.u.tax version.action - =. date-modified.tax.u.tax when - ?- -.meat.action - %announce tax.u.tax(status %announced) - %release tax.u.tax(owner her.meat.action, status %released) - %accept tax.u.tax(status %accepted) - %set-date-due tax.u.tax(date-due wen.meat.action) - %set-tags tax.u.tax(tags tag.meat.action) - %set-title tax.u.tax(title til.meat.action) - %set-description tax.u.tax(description des.meat.action) - %set-done tax.u.tax(done ?.(don.meat.action ~ `when)) - %add-comment - %= tax.u.tax - discussion [[when her com.meat.action] discussion.tax.u.tax] - == + :+ archived.u.tax + (~(uni in audience.u.tax) from) + =. version.tax.u.tax version.action + =. date-modified.tax.u.tax when + ?- -.meat.action + %set-doer tax.u.tax(doer her.meat.action) + %set-date-due tax.u.tax(date-due wen.meat.action) + %set-tags tax.u.tax(tags tag.meat.action) + %set-title tax.u.tax(title til.meat.action) + %set-description tax.u.tax(description des.meat.action) + %set-done tax.u.tax(done ?.(don.meat.action ~ `when)) + %add-comment + %= tax.u.tax + discussion [[when her com.meat.action] discussion.tax.u.tax] == == - ?: ?& =([%release our] meat.action) - claiming.u.tax - == - abet:(accept:(at (~(got by tasks) id.action)) +(+(version.tax.u.tax))) - [~ +>.$] + =+ ooo=(~(get by unordered) id.action +(version.action)) + ?~ ooo + [~ +>.^$] + %= $ + version.action +(version.action) + her.action p.u.ooo + meat.action q.u.ooo + == == :: ++ mirror-to-web @@ -292,10 +317,10 @@ [(welp mov mow) +>.$] %old =+ (at (~(got by tasks) id.cod)) - abet:(process-update:- version.cod dif.cod) + abet:(process-update:- dif.cod) %new =. +>.cod +>.cod(date-created now, version 0, date-modified now) - abut:send-create:(at | | +.cod) + abut:send-create:(at | +.cod) == :: :: XX maybe need to check that we haven't received this message before diff --git a/mar/work/command.hoon b/mar/work/command.hoon index 2a225f8d2..5b83900ee 100644 --- a/mar/work/command.hoon +++ b/mar/work/command.hoon @@ -51,7 +51,7 @@ ++ ship (su fed:ag) ++ coma %- of :~ - new/task old/(ot id/id version/ni dif/uppd ~) + new/task old/(ot id/id dif/uppd ~) sort/(ar id) audience/(ot id/id to/audi ~) == ++ task @@ -59,7 +59,7 @@ audience/audi id/id 'date_created'^di version/ni 'date_modified'^di - owner/ship status/(ci (soft status) so) + creator/ship doer/(mu ship) tags/(as so) 'date_due'^(mu di) done/(mu di) title/so description/so discussion/(ar (ot date/di ship/ship body/so ~)) @@ -91,8 +91,7 @@ :: date-created:1440011611215, :: version:1, :: date-modified:1440011611215, -:: owner:'fyr', -:: status:'gave', +:: creator:'fyr', :: tags:['tag'], :: date-due:null, :: done:false, diff --git a/mar/work/task.hoon b/mar/work/task.hoon index 376e423e9..238690f9c 100644 --- a/mar/work/task.hoon +++ b/mar/work/task.hoon @@ -52,12 +52,11 @@ =+ [-.b `date-due=(unit ,@da)`+.b] =^ tags a (undent a ~(gas in *(set cord))) =^ title a ?~(a !! a) - =^ b a (advance a (parse owner=%p "." status=%tas ~)) - ?> ?=(status.task status.b) + =^ b a (advance a (parse creator=%p "." ~)) :: XX doer =+ b =^ description a (undent a role) - :* id date-created version date-modified owner - status tags date-due ~ title description :: XX done + :* id date-created version date-modified creator + ~ tags date-due ~ title description :: XX done |- ^- (list comment) ?: =(~ a) ~ =^ b a (advance a (parse ship=%p " " date=%da ~)) @@ -76,7 +75,7 @@ :- (rend uv/id '_' da/date-created ' ' ud/version da/date-modified due) %+ welp (indent (sort (~(tap in tags)) aor)) :- title - :- (rend p/owner '.' tas/status ~) + :- (rend p/creator ~) %- zing ^- (list wain) :- (indent (lore description)) %+ turn discussion @@ -90,7 +89,7 @@ :: {tag2} :: ... :: {title} -:: {owner}.{status} +:: {creator} :: {description} :: {more description} :: {ship1} {date} diff --git a/sur/talk.hoon b/sur/talk.hoon index 184b2412c..8940f1630 100644 --- a/sur/talk.hoon +++ b/sur/talk.hoon @@ -82,31 +82,26 @@ |% :: ++ duty :: $% [%create tax=task] :: create new task - [%claim id=@uvH] :: claim task [%archive id=@uvH] :: archive task - $: %update :: operate on task - id=@uvH :: which task - version=@u :: version - $= meat :: - $% [%announce ~] :: make available - [%release her=ship] :: pass to new owner - [%accept ~] :: accept pass - [%set-date-due wen=(unit ,@da)] :: set due date - [%set-tags tag=(set ,@t)] :: set tags - [%set-title til=@t] :: set title - [%set-description des=@t] :: set description - [%set-done don=?] :: set done - [%add-comment com=@t] :: add comment - == :: - == :: + [%change id=@uvH meat=flesh] :: request change + [%update id=@uvH version=@u her=ship meat=flesh]:: broadcast change + == :: + ++ flesh :: + $% [%set-doer her=(unit ,@p)] :: set doer + [%set-date-due wen=(unit ,@da)] :: set due date + [%set-tags tag=(set ,@t)] :: set tags + [%set-title til=@t] :: set title + [%set-description des=@t] :: set description + [%set-done don=?] :: set done + [%add-comment com=@t] :: add comment == :: ++ task :: $: id=@uvH :: date-created=@da :: version=@u :: date-modified=@da :: - owner=@p :: - status=status :: + creator=@p :: + doer=(unit ,@p) :: tags=(set ,@t) :: date-due=(unit ,@da) :: done=(unit ,@da) :: @@ -119,9 +114,5 @@ ship=@p :: body=@t :: == :: - ++ status ?(%announced %released %accepted) :: -- - :: markdown - :: image - :: mime object -- diff --git a/sur/work.hoon b/sur/work.hoon index 631469c9b..a8221454b 100644 --- a/sur/work.hoon +++ b/sur/work.hoon @@ -5,8 +5,7 @@ sort=(list ,@uvH) == ++ client-task - $: claiming=_| - archived=_| + $: archived=_| audience=(set station:talk) tax=task == @@ -15,8 +14,8 @@ date-created=@da version=@u date-modified=@da - owner=@p - status=status + creator=@p + doer=(unit ,@p) tags=(set ,@t) date-due=(unit ,@da) done=(unit ,@da) @@ -29,16 +28,16 @@ ship=@p body=@t == -++ status ?(%announced %released %accepted) -++ command +++ command $% [%new audience=(set station:talk) task] - [%old id=@uvH version=@u dif=update] + [%old id=@uvH dif=update] [%sort p=(list ,@uvH)] [%audience id=@uvH to=(set station:talk)] == ++ update $% $: %set - $% [%date-due p=(unit ,@da)] + $% [%doer p=(unit ,@p)] + [%date-due p=(unit ,@da)] [%title p=@t] [%description p=@t] [%tags p=(set ,@t)] From 8f3cc620bcc0d4e6e0020f739417af9653ccd32f Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 26 Aug 2015 18:34:26 -0400 Subject: [PATCH 2/2] remove %set %doer --- ape/work.hoon | 10 +++------- mar/work/command.hoon | 2 +- sur/work.hoon | 7 +++---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/ape/work.hoon b/ape/work.hoon index 3952d484d..01d3183f2 100644 --- a/ape/work.hoon +++ b/ape/work.hoon @@ -13,9 +13,6 @@ :: :: audience stuff seems messed up from talk? get extraneous stations :: -:: first thing to do is obviously make process-duty accept stuff out -:: of order -:: :::: :: /? 314 @@ -98,15 +95,14 @@ ^+ +> ?- -.up %add ?>(?=(%comment +<.up) (send-change %add-comment +>.up)) - %own + %doer ?- +<.up - %announce (send-change %set-doer ~) - %claim (send-change %set-doer `our) + %release (send-change %set-doer ~) + %claim (send-change %set-doer `our) == :: %set ?- +<.up - %doer (send-change %set-doer +>.up) %date-due (send-change %set-date-due +>.up) %title (send-change %set-title +>.up) %description (send-change %set-description +>.up) diff --git a/mar/work/command.hoon b/mar/work/command.hoon index 5b83900ee..3670a9013 100644 --- a/mar/work/command.hoon +++ b/mar/work/command.hoon @@ -68,7 +68,7 @@ ++ stan (su ;~((glue fas) ;~(pfix sig fed:ag) urs:ab)) ++ uppd %- of :~ - own/(of announce/ul claim/ul ~) + doer/(of release/ul claim/ul ~) add/(of comment/so ~) :- %set %- of :~ diff --git a/sur/work.hoon b/sur/work.hoon index a8221454b..80e79a1c4 100644 --- a/sur/work.hoon +++ b/sur/work.hoon @@ -36,8 +36,7 @@ == ++ update $% $: %set - $% [%doer p=(unit ,@p)] - [%date-due p=(unit ,@da)] + $% [%date-due p=(unit ,@da)] [%title p=@t] [%description p=@t] [%tags p=(set ,@t)] @@ -46,8 +45,8 @@ $: %add $% [%comment @t] == == - $: %own - $% [%announce ~] + $: %doer + $% [%release ~] [%claim ~] == == ==