|
24 | 24 | ;; prefixed line (`:syntax` key + optional `:param`). |
25 | 25 | ;; |
26 | 26 | ;; :scope values: |
27 | | -;; :user -- anyone |
| 27 | +;; :user -- anyone. The default everywhere: updates |
| 28 | +;; are auditable (each records the email |
| 29 | +;; that posed it) and reversible, and |
| 30 | +;; sources that are not self-moderating |
| 31 | +;; channels can tighten commands via the |
| 32 | +;; per-command :scope override. Role |
| 33 | +;; controls (Add maintainer: ...) are gated |
| 34 | +;; separately, in bone.roles. |
28 | 35 | ;; :maintainer -- any maintainer |
29 | 36 | ;; :setter-or-maintainer -- the address that set the attribute, plus |
30 | 37 | ;; any maintainer. Only meaningful for unset |
31 | 38 | ;; commands whose target has a recoverable |
32 | 39 | ;; setter (`setter-ref-attrs` / |
33 | 40 | ;; `setter-scoped-command-ids`). |
| 41 | +;; No default entry uses the last two anymore; they remain available to |
| 42 | +;; sources that tighten a command via the per-command :scope override |
| 43 | +;; (config.edn `:commands {<cmd-id> {:scope ...}}`). |
34 | 44 | ;; --------------------------------------------------------------------------- |
35 | 45 |
|
36 | 46 | (def commands |
|
41 | 51 | {:id :owned :kind :trigger :action :set :attr :report/owned :scope :user |
42 | 52 | :words :owned :report-types #{:bug :patch :request}} |
43 | 53 | {:id :closed :kind :trigger :action :set :attr :report/closed :scope :user :words :closed} |
44 | | - ;; -by lines (maintainer credits a third party) |
45 | | - {:id :acked-by :kind :trigger :action :set :attr :report/acked :scope :maintainer |
46 | | - :syntax "Acked-by" :param :email-address :report-types #{:bug :patch :request}} |
47 | | - {:id :owned-by :kind :trigger :action :set :attr :report/owned :scope :maintainer |
| 54 | + ;; -by lines (credit the update to a third party) |
| 55 | + ;; Reviewed-by is the kernel-style strong-review line, accepted as |
| 56 | + ;; a plain syntax synonym: BONE's acked state is the strong |
| 57 | + ;; approval (Confirmed, Approved, Reviewed-by:). Any participant's |
| 58 | + ;; Reviewed-by both acks the report and is collected as a review |
| 59 | + ;; trailer (:report/trailers); on a source that tightens :acked-by |
| 60 | + ;; via a :scope override, denied lines are still collected as |
| 61 | + ;; trailers. |
| 62 | + {:id :acked-by :kind :trigger :action :set :attr :report/acked :scope :user |
| 63 | + :syntax "Acked-by" :syntaxes ["Acked-by" "Reviewed-by"] |
| 64 | + :param :email-address :report-types #{:bug :patch :request}} |
| 65 | + {:id :owned-by :kind :trigger :action :set :attr :report/owned :scope :user |
48 | 66 | :syntax "Owned-by" :param :email-address :report-types #{:bug :patch :request}} |
49 | | - {:id :closed-by :kind :trigger :action :set :attr :report/closed :scope :maintainer |
| 67 | + {:id :closed-by :kind :trigger :action :set :attr :report/closed :scope :user |
50 | 68 | :syntax "Closed-by" :param :email-address} |
51 | | - ;; Unset lines |
52 | | - {:id :unacked :kind :trigger :action :unset :attr :report/acked :scope :setter-or-maintainer |
53 | | - :syntax "Not acked" :report-types #{:bug :patch :request}} |
54 | | - {:id :unowned :kind :trigger :action :unset :attr :report/owned :scope :setter-or-maintainer |
55 | | - :syntax "Not owned" :report-types #{:bug :patch :request}} |
56 | | - {:id :unclosed :kind :trigger :action :unset :attr :report/closed :scope :setter-or-maintainer |
| 69 | + ;; Unset lines. :not-words derives the accepted syntaxes from the |
| 70 | + ;; state's resolved vocabulary -- every word that can set the state |
| 71 | + ;; (defaults and per-source synonyms alike) gets its "Not <word>" |
| 72 | + ;; negation; :syntax remains the canonical form for display. |
| 73 | + {:id :unacked :kind :trigger :action :unset :attr :report/acked :scope :user |
| 74 | + :syntax "Not acked" :not-words :acked :report-types #{:bug :patch :request}} |
| 75 | + {:id :unowned :kind :trigger :action :unset :attr :report/owned :scope :user |
| 76 | + :syntax "Not owned" :not-words :owned :report-types #{:bug :patch :request}} |
| 77 | + ;; Deliberately no :not-words here: closing words carry a close |
| 78 | + ;; reason ("Not canceled"/"Not fixed" would not), and in loose mode |
| 79 | + ;; a prose "Not fixed." would reopen reports. "Not closed" is the |
| 80 | + ;; only reopening form. |
| 81 | + {:id :unclosed :kind :trigger :action :unset :attr :report/closed :scope :user |
57 | 82 | :syntax "Not closed"} |
58 | 83 | ;; Closure relations -- backed by :rel/supersedes / :rel/duplicates; |
59 | 84 | ;; :attr kept for registry shape. |
|
64 | 89 | ;; pull-map key must distinguish them. |
65 | 90 | {:id :superseded-by :kind :trigger :action :set-superseded :attr :rel/supersedes :scope :user |
66 | 91 | :syntax "Superseded-by" :param :message-id :report-types #{:bug :patch :request}} |
67 | | - {:id :unsuperseded-by :kind :trigger :action :unset-superseded :attr :rel/supersedes-from :scope :setter-or-maintainer |
| 92 | + {:id :unsuperseded-by :kind :trigger :action :unset-superseded :attr :rel/supersedes-from :scope :user |
68 | 93 | :syntax "Not superseded-by" :param :message-id :report-types #{:bug :patch :request}} |
69 | 94 | {:id :duplicate-of :kind :trigger :action :set-duplicate :attr :rel/duplicates :scope :user |
70 | 95 | :syntax "Duplicate-of" :param :message-id :report-types #{:bug :patch :request}} |
71 | | - {:id :unduplicate-of :kind :trigger :action :unset-duplicate :attr :rel/duplicates-from :scope :setter-or-maintainer |
| 96 | + {:id :unduplicate-of :kind :trigger :action :unset-duplicate :attr :rel/duplicates-from :scope :user |
72 | 97 | :syntax "Not duplicate-of" :param :message-id :report-types #{:bug :patch :request}} |
73 | 98 |
|
74 | 99 | ;; --- Annotations: property-set ------------------------------------------- |
75 | 100 | ;; Bareword |
76 | 101 | {:id :urgent :kind :annotation :action :set :attr :report/urgent :scope :user :words :urgent} |
77 | 102 | {:id :important :kind :annotation :action :set :attr :report/important :scope :user :words :important} |
78 | 103 | ;; Unset lines for bareword annotations |
79 | | - {:id :unurgent :kind :annotation :action :unset :attr :report/urgent :scope :setter-or-maintainer |
80 | | - :syntax "Not urgent"} |
81 | | - {:id :unimportant :kind :annotation :action :unset :attr :report/important :scope :setter-or-maintainer |
82 | | - :syntax "Not important"} |
| 104 | + {:id :unurgent :kind :annotation :action :unset :attr :report/urgent :scope :user |
| 105 | + :syntax "Not urgent" :not-words :urgent} |
| 106 | + {:id :unimportant :kind :annotation :action :unset :attr :report/important :scope :user |
| 107 | + :syntax "Not important" :not-words :important} |
83 | 108 | ;; Deadline / expiry / topic |
84 | 109 | {:id :deadline :kind :annotation :action :set-deadline :attr :report/deadline :scope :user |
85 | 110 | :syntax "Deadline" :param :date-or-duration :report-types #{:bug :patch :request}} |
86 | | - {:id :undeadline :kind :annotation :action :unset-deadline :attr :report/deadline :scope :setter-or-maintainer |
| 111 | + {:id :undeadline :kind :annotation :action :unset-deadline :attr :report/deadline :scope :user |
87 | 112 | :syntax "No deadline" :report-types #{:bug :patch :request}} |
88 | 113 | {:id :expiry :kind :annotation :action :set-expiry :attr :report/expiry :scope :user |
89 | 114 | :syntax "Expiry" :param :date-or-duration} |
90 | | - {:id :unexpiry :kind :annotation :action :unset-expiry :attr :report/expiry :scope :setter-or-maintainer |
| 115 | + {:id :unexpiry :kind :annotation :action :unset-expiry :attr :report/expiry :scope :user |
91 | 116 | :syntax "No expiry"} |
92 | 117 | {:id :topic :kind :annotation :action :set-topic :attr :report/topic :scope :user |
93 | 118 | :syntax "Topic" :param :word} |
94 | | - {:id :untopic :kind :annotation :action :unset-topic :attr :report/topic :scope :setter-or-maintainer |
| 119 | + {:id :untopic :kind :annotation :action :unset-topic :attr :report/topic :scope :user |
95 | 120 | :syntax "No topic"} |
96 | 121 | ;; Supersedes -- inverse role of Superseded-by (posed on the replacement; |
97 | 122 | ;; current = :rel/to, target = :rel/from = the closed report). |
98 | 123 | {:id :supersedes :kind :annotation :action :set-supersedes :attr :rel/supersedes :scope :user |
99 | 124 | :syntax "Supersedes" :param :message-id :report-types #{:bug :patch :request}} |
100 | | - {:id :unsupersedes :kind :annotation :action :unset-supersedes :attr :rel/supersedes-to :scope :setter-or-maintainer |
| 125 | + {:id :unsupersedes :kind :annotation :action :unset-supersedes :attr :rel/supersedes-to :scope :user |
101 | 126 | :syntax "Not supersedes" :param :message-id :report-types #{:bug :patch :request}} |
102 | 127 | ;; Related-to -- neutral cross-reference (no closure, multi-target, |
103 | 128 | ;; symmetric canonicalised by :rel/id). Multi-target makes a clean |
|
175 | 200 | :report/deadline :report/deadline-value |
176 | 201 | :report/expiry :report/expiry-value}) |
177 | 202 |
|
178 | | -;; Commands accepting :scope :setter-or-maintainer: |
| 203 | +;; Commands that support a :setter-or-maintainer scope override: |
179 | 204 | ;; - unset lines keyed on a setter-ref attribute, plus |
180 | 205 | ;; - explicit relation-backed unsets (:unsuperseded-by, :unsupersedes, |
181 | 206 | ;; :unduplicate-of). |
| 207 | +;; All of them default to :scope :user; this set only matters when a |
| 208 | +;; source tightens one back via config. |
182 | 209 | (def setter-scoped-command-ids |
183 | 210 | (into #{:unsuperseded-by :unsupersedes :unduplicate-of} |
184 | 211 | (comp (filter #(str/starts-with? (name (:action %)) "unset")) |
|
0 commit comments