minor rearchitecting

This commit is contained in:
Philip C Monk 2015-08-26 18:21:21 -04:00
parent 5cbb62d5e8
commit 764b199a99
6 changed files with 130 additions and 117 deletions

View File

@ -1679,7 +1679,7 @@
"[{(trip p.sep)}]: {(trip q.sep)}" "[{(trip p.sep)}]: {(trip q.sep)}"
:: ::
%tax %tax
" {<sep>}" " {<sen>}: {<sep>}"
== ==
-- --
:: ::

View File

@ -2,13 +2,20 @@
:: it can't :: it can't
:: maybe look into storing a "following" set :: maybe look into storing a "following" set
:: make most updates not rely on knowing about task (all but claim?) :: 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 :: station
:: ::
:: pretty-print in command-line interface :: pretty-print in command-line interface
:: serialize %lax to json :: serialize %lax to json
:: bring up ~dozbud to test :: 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 /? 314
@ -31,7 +38,11 @@
!: !:
:::: ::::
:: ::
|_ [bowl client connected=_|] |_ $: bowl
client
connected=_|
unordered=(map ,[@uvH @u] (pair ship flesh:work-stuff:talk))
==
++ at ++ at
|= client-task |= client-task
=| moves=(list move) =| moves=(list move)
@ -72,34 +83,35 @@
|= action=duty:work-stuff:talk |= action=duty:work-stuff:talk
(send-audience audience action) (send-audience audience action)
:: ::
++ claim
(send-audience(claiming &) [[owner.tax (main owner.tax)] ~ ~] %claim id.tax)
::
++ send-archive ++ send-archive
|= to=(set station:talk) |= to=(set station:talk)
(send-audience to %archive id.tax) (send-audience to %archive id.tax)
:: ::
++ send-create (send %create tax) ++ send-create (send %create tax)
++ send-change |* *
%+ send-audience
[[creator.tax (main creator.tax)] ~ ~]
[%change id.tax +<]
++ send-update |*(* (send %update 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 ++ process-update
|= [vers=@u up=update] |= up=update
^+ +> ^+ +>
?- -.up ?- -.up
%add ?>(?=(%comment +<.up) (send-update vers %add-comment +>.up)) %add ?>(?=(%comment +<.up) (send-change %add-comment +>.up))
%own %own
?- +<.up ?- +<.up
%announce (send-update vers %announce ~) %announce (send-change %set-doer ~)
%claim claim %claim (send-change %set-doer `our)
== ==
::
%set %set
?- +<.up ?- +<.up
%date-due (send-update vers %set-date-due +>.up) %doer (send-change %set-doer +>.up)
%title (send-update vers %set-title +>.up) %date-due (send-change %set-date-due +>.up)
%description (send-update vers %set-description +>.up) %title (send-change %set-title +>.up)
%tags (send-update vers %set-tags +>.up) %description (send-change %set-description +>.up)
%done (send-update vers %set-done +>.up) %tags (send-change %set-tags +>.up)
%done (send-change %set-done +>.up)
== ==
== ==
++ process-audience ++ process-audience
@ -111,7 +123,14 @@
-- --
:: ::
++ prep ++ prep
|= [old=(unit (pair client ,_|))] |= $= old
$_
=< $
%- unit
$: client
_|
(map ,[@uvH @u] (pair ship flesh:work-stuff:talk))
==
^- [(list move) _+>.$] ^- [(list move) _+>.$]
initialize(+<+ ?~(old +<+.+>.$ u.old)) initialize(+<+ ?~(old +<+.+>.$ u.old))
:: ::
@ -142,8 +161,8 @@
existing-task=u.existing-task existing-task=u.existing-task
== ==
[~ +>.$] [~ +>.$]
?. |(=(her owner.tax.action) =(%released status.tax.action)) ?. =(her creator.tax.action)
~& :* %created-with-bad-owner ~& :* %created-with-bad-creator
her=her her=her
from=from from=from
new-task=tax.action new-task=tax.action
@ -152,22 +171,11 @@
[~ +>.$] [~ +>.$]
=. tasks =. tasks
%^ ~(put by tasks) id.tax.action | %^ ~(put by tasks) id.tax.action |
:- | :_ tax.action :_ tax.action
?~ existing-task from ?~ existing-task from
(~(uni in audience.u.existing-task) from) (~(uni in audience.u.existing-task) from)
=. sort ?^(existing-task sort [id.tax.action sort]) =. 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 %archive
=+ tax=(~(get by tasks) id.action) =+ tax=(~(get by tasks) id.action)
@ -178,8 +186,8 @@
action=action action=action
== ==
[~ +>.$] [~ +>.$]
?: !=(her owner.tax.u.tax) ?: !=(her creator.tax.u.tax)
~& :* %archiver-not-owner ~& :* %archiver-not-creator
her=her her=her
from=from from=from
action=action action=action
@ -188,12 +196,30 @@
[~ +>.$] [~ +>.$]
=. tasks =. tasks
%+ ~(put by tasks) id.action %+ ~(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) (~(dif in audience.u.tax) from)
tax.u.tax 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 %update
=+ tax=(~(get by tasks) id.action) =+ tax=(~(get by tasks) id.action)
@ -204,6 +230,14 @@
action=action action=action
== ==
[~ +>.$] [~ +>.$]
?: !=(her creator.tax.u.tax)
~& :* %her-not-creator
her=her
from=from
action=action
tax=tax
==
[~ +>.$]
?. =(version.action +(version.tax.u.tax)) ?. =(version.action +(version.tax.u.tax))
~& :* %update-bad-version ~& :* %update-bad-version
her her
@ -211,49 +245,40 @@
action=action action=action
tax=tax tax=tax
== ==
[~ +>.$] :- ~
?: ?& ?=(?(%announce %release %accept) -.meat.action) %_ +>.$
!=(her owner.tax.u.tax) unordered
== %+ ~(put by unordered)
~& :* %not-owner [id.action version.action]
her=her [her.action meat.action]
from=from ==
action=action |-
tax=tax
==
[~ +>.$]
=. tasks =. tasks
%+ ~(put by tasks) id.action %+ ~(put by tasks) id.action
:* ?: ?=(%release -.meat.action) :+ archived.u.tax
| (~(uni in audience.u.tax) from)
claiming.u.tax =. version.tax.u.tax version.action
:: =. date-modified.tax.u.tax when
archived.u.tax ?- -.meat.action
:: %set-doer tax.u.tax(doer her.meat.action)
(~(uni in audience.u.tax) from) %set-date-due tax.u.tax(date-due wen.meat.action)
:: %set-tags tax.u.tax(tags tag.meat.action)
=. version.tax.u.tax version.action %set-title tax.u.tax(title til.meat.action)
=. date-modified.tax.u.tax when %set-description tax.u.tax(description des.meat.action)
?- -.meat.action %set-done tax.u.tax(done ?.(don.meat.action ~ `when))
%announce tax.u.tax(status %announced) %add-comment
%release tax.u.tax(owner her.meat.action, status %released) %= tax.u.tax
%accept tax.u.tax(status %accepted) discussion [[when her com.meat.action] discussion.tax.u.tax]
%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) =+ ooo=(~(get by unordered) id.action +(version.action))
claiming.u.tax ?~ ooo
== [~ +>.^$]
abet:(accept:(at (~(got by tasks) id.action)) +(+(version.tax.u.tax))) %= $
[~ +>.$] version.action +(version.action)
her.action p.u.ooo
meat.action q.u.ooo
==
== ==
:: ::
++ mirror-to-web ++ mirror-to-web
@ -292,10 +317,10 @@
[(welp mov mow) +>.$] [(welp mov mow) +>.$]
%old %old
=+ (at (~(got by tasks) id.cod)) =+ (at (~(got by tasks) id.cod))
abet:(process-update:- version.cod dif.cod) abet:(process-update:- dif.cod)
%new %new
=. +>.cod +>.cod(date-created now, version 0, date-modified now) =. +>.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 :: XX maybe need to check that we haven't received this message before

View File

@ -51,7 +51,7 @@
++ ship (su fed:ag) ++ ship (su fed:ag)
++ coma ++ coma
%- of :~ %- 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 ~) sort/(ar id) audience/(ot id/id to/audi ~)
== ==
++ task ++ task
@ -59,7 +59,7 @@
audience/audi audience/audi
id/id 'date_created'^di id/id 'date_created'^di
version/ni 'date_modified'^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) tags/(as so) 'date_due'^(mu di)
done/(mu di) title/so done/(mu di) title/so
description/so discussion/(ar (ot date/di ship/ship body/so ~)) description/so discussion/(ar (ot date/di ship/ship body/so ~))
@ -91,8 +91,7 @@
:: date-created:1440011611215, :: date-created:1440011611215,
:: version:1, :: version:1,
:: date-modified:1440011611215, :: date-modified:1440011611215,
:: owner:'fyr', :: creator:'fyr',
:: status:'gave',
:: tags:['tag'], :: tags:['tag'],
:: date-due:null, :: date-due:null,
:: done:false, :: done:false,

View File

@ -52,12 +52,11 @@
=+ [-.b `date-due=(unit ,@da)`+.b] =+ [-.b `date-due=(unit ,@da)`+.b]
=^ tags a (undent a ~(gas in *(set cord))) =^ tags a (undent a ~(gas in *(set cord)))
=^ title a ?~(a !! a) =^ title a ?~(a !! a)
=^ b a (advance a (parse owner=%p "." status=%tas ~)) =^ b a (advance a (parse creator=%p "." ~)) :: XX doer
?> ?=(status.task status.b)
=+ b =+ b
=^ description a (undent a role) =^ description a (undent a role)
:* id date-created version date-modified owner :* id date-created version date-modified creator
status tags date-due ~ title description :: XX done ~ tags date-due ~ title description :: XX done
|- ^- (list comment) |- ^- (list comment)
?: =(~ a) ~ ?: =(~ a) ~
=^ b a (advance a (parse ship=%p " " date=%da ~)) =^ 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) :- (rend uv/id '_' da/date-created ' ' ud/version da/date-modified due)
%+ welp (indent (sort (~(tap in tags)) aor)) %+ welp (indent (sort (~(tap in tags)) aor))
:- title :- title
:- (rend p/owner '.' tas/status ~) :- (rend p/creator ~)
%- zing ^- (list wain) %- zing ^- (list wain)
:- (indent (lore description)) :- (indent (lore description))
%+ turn discussion %+ turn discussion
@ -90,7 +89,7 @@
:: {tag2} :: {tag2}
:: ... :: ...
:: {title} :: {title}
:: {owner}.{status} :: {creator}
:: {description} :: {description}
:: {more description} :: {more description}
:: {ship1} {date} :: {ship1} {date}

View File

@ -82,31 +82,26 @@
|% :: |% ::
++ duty :: ++ duty ::
$% [%create tax=task] :: create new task $% [%create tax=task] :: create new task
[%claim id=@uvH] :: claim task
[%archive id=@uvH] :: archive task [%archive id=@uvH] :: archive task
$: %update :: operate on task [%change id=@uvH meat=flesh] :: request change
id=@uvH :: which task [%update id=@uvH version=@u her=ship meat=flesh]:: broadcast change
version=@u :: version == ::
$= meat :: ++ flesh ::
$% [%announce ~] :: make available $% [%set-doer her=(unit ,@p)] :: set doer
[%release her=ship] :: pass to new owner [%set-date-due wen=(unit ,@da)] :: set due date
[%accept ~] :: accept pass [%set-tags tag=(set ,@t)] :: set tags
[%set-date-due wen=(unit ,@da)] :: set due date [%set-title til=@t] :: set title
[%set-tags tag=(set ,@t)] :: set tags [%set-description des=@t] :: set description
[%set-title til=@t] :: set title [%set-done don=?] :: set done
[%set-description des=@t] :: set description [%add-comment com=@t] :: add comment
[%set-done don=?] :: set done
[%add-comment com=@t] :: add comment
== ::
== ::
== :: == ::
++ task :: ++ task ::
$: id=@uvH :: $: id=@uvH ::
date-created=@da :: date-created=@da ::
version=@u :: version=@u ::
date-modified=@da :: date-modified=@da ::
owner=@p :: creator=@p ::
status=status :: doer=(unit ,@p) ::
tags=(set ,@t) :: tags=(set ,@t) ::
date-due=(unit ,@da) :: date-due=(unit ,@da) ::
done=(unit ,@da) :: done=(unit ,@da) ::
@ -119,9 +114,5 @@
ship=@p :: ship=@p ::
body=@t :: body=@t ::
== :: == ::
++ status ?(%announced %released %accepted) ::
-- --
:: markdown
:: image
:: mime object
-- --

View File

@ -5,8 +5,7 @@
sort=(list ,@uvH) sort=(list ,@uvH)
== ==
++ client-task ++ client-task
$: claiming=_| $: archived=_|
archived=_|
audience=(set station:talk) audience=(set station:talk)
tax=task tax=task
== ==
@ -15,8 +14,8 @@
date-created=@da date-created=@da
version=@u version=@u
date-modified=@da date-modified=@da
owner=@p creator=@p
status=status doer=(unit ,@p)
tags=(set ,@t) tags=(set ,@t)
date-due=(unit ,@da) date-due=(unit ,@da)
done=(unit ,@da) done=(unit ,@da)
@ -29,16 +28,16 @@
ship=@p ship=@p
body=@t body=@t
== ==
++ status ?(%announced %released %accepted) ++ command
++ command
$% [%new audience=(set station:talk) task] $% [%new audience=(set station:talk) task]
[%old id=@uvH version=@u dif=update] [%old id=@uvH dif=update]
[%sort p=(list ,@uvH)] [%sort p=(list ,@uvH)]
[%audience id=@uvH to=(set station:talk)] [%audience id=@uvH to=(set station:talk)]
== ==
++ update ++ update
$% $: %set $% $: %set
$% [%date-due p=(unit ,@da)] $% [%doer p=(unit ,@p)]
[%date-due p=(unit ,@da)]
[%title p=@t] [%title p=@t]
[%description p=@t] [%description p=@t]
[%tags p=(set ,@t)] [%tags p=(set ,@t)]