Skip to content

A platform for community discussion. Free, open, simple.

DEV: Record DSA facts and ground when reviewable actions succeed (#44616)

Alan Guo Xiang Tan8cf6af56be77
diff --git a/app/models/reviewable.rb b/app/models/reviewable.rb
index a6ce86d6375..c196aabfd9d 100644
--- a/app/models/reviewable.rb
+++ b/app/models/reviewable.rb
@@ -458,6 +458,7 @@ class Reviewable < ActiveRecord::Base
application_date: Date.current.iso8601,
territorial_scope: DsaStatementOfRecord::TERRITORIAL_SCOPE,
source_type: "SOURCE_VOLUNTARY",
+ decision_ground: "DECISION_GROUND_INCOMPATIBLE_CONTENT",
),
)
end
@@ -1046,7 +1047,11 @@ class Reviewable < ActiveRecord::Base
# Failure to save the statement rolls back the transaction.
#
# Keys must be symbols. Each hash must include :content_type, :content_date,
- # :automated_detection, :automated_decision, and at least one decision field.
+ # :automated_detection, :automated_decision, :decision_facts, and at least one
+ # decision field.
+ #
+ # * :decision_facts [String] Required. Facts and circumstances known when the action
+ # succeeds. Maximum 5000 characters. Core actions use fixed English wording.
#
# Decision fields:
#
@@ -1112,9 +1117,10 @@ class Reviewable < ActiveRecord::Base
# * AUTOMATED_DECISION_NOT_AUTOMATED
#
# Multiple decision fields may describe the same action. Reviewable#perform
- # supplies :application_date, :territorial_scope, and :source_type.
- # Pending statements receive their grounds, category, and supporting explanation
- # during human classification.
+ # supplies :application_date, :territorial_scope, :source_type, and :decision_ground.
+ # The decision ground is DECISION_GROUND_INCOMPATIBLE_CONTENT.
+ # Pending statements receive their contractual ground, category, and supporting
+ # explanation during human classification.
#
# @param action_id [Symbol] Requested action ID, before alias resolution.
# @param result [Reviewable::PerformResult] Successful action result, including
@@ -1130,6 +1136,7 @@ class Reviewable < ActiveRecord::Base
# {
# decision_visibility: ["DECISION_VISIBILITY_OTHER"],
# decision_visibility_other: "Content edited",
+ # decision_facts: "The flagged post was edited.",
# content_type: ["CONTENT_TYPE_TEXT"],
# content_date: post.created_at.to_date.iso8601,
# automated_detection:,
diff --git a/app/models/reviewable_flagged_post.rb b/app/models/reviewable_flagged_post.rb
index 726d06267cc..a2a7bb50953 100644
--- a/app/models/reviewable_flagged_post.rb
+++ b/app/models/reviewable_flagged_post.rb
@@ -419,6 +419,7 @@ class ReviewableFlaggedPost < Reviewable
case action_id
when :agree_and_edit
{
+ decision_facts: "The flagged post was edited.",
decision_visibility: ["DECISION_VISIBILITY_OTHER"],
decision_visibility_other: "Content edited",
content_type: ["CONTENT_TYPE_TEXT"],
@@ -428,6 +429,7 @@ class ReviewableFlaggedPost < Reviewable
}
when :agree_and_hide, :agree_and_keep_hidden
{
+ decision_facts: "Access to the flagged post was disabled.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_DISABLED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -437,6 +439,7 @@ class ReviewableFlaggedPost < Reviewable
when :delete_and_agree, :delete_and_ignore, :delete_and_agree_replies,
:delete_and_ignore_replies, :agree_and_keep_deleted
{
+ decision_facts: "The flagged post was removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -447,6 +450,7 @@ class ReviewableFlaggedPost < Reviewable
user = target_created_by.reload
{
+ decision_facts: "The author of the flagged post was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -460,6 +464,8 @@ class ReviewableFlaggedPost < Reviewable
user = target_created_by.reload
{
+ decision_facts:
+ "The author of the flagged post had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -473,6 +479,7 @@ class ReviewableFlaggedPost < Reviewable
user = target_created_by
{
+ decision_facts: "The author of the flagged post had their account deleted.",
decision_account: "DECISION_ACCOUNT_TERMINATED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/app/models/reviewable_post.rb b/app/models/reviewable_post.rb
index f9bf3083216..a962cc9457a 100644
--- a/app/models/reviewable_post.rb
+++ b/app/models/reviewable_post.rb
@@ -130,6 +130,7 @@ class ReviewablePost < Reviewable
case action_id
when :reject_and_delete, :reject_and_keep_deleted
{
+ decision_facts: "The post was rejected and removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -140,6 +141,7 @@ class ReviewablePost < Reviewable
user = target_created_by.reload
{
+ decision_facts: "The author of the rejected post was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -153,6 +155,8 @@ class ReviewablePost < Reviewable
user = target_created_by.reload
{
+ decision_facts:
+ "The author of the rejected post had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/app/models/reviewable_queued_post.rb b/app/models/reviewable_queued_post.rb
index 40c0aece92a..d6b7fba5f6b 100644
--- a/app/models/reviewable_queued_post.rb
+++ b/app/models/reviewable_queued_post.rb
@@ -252,6 +252,7 @@ class ReviewableQueuedPost < Reviewable
case action_id
when :reject_post, :revise_and_reject_post, :discard_post
{
+ decision_facts: "The post was held for approval and rejected before publication.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_DISABLED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: created_at.to_date.iso8601,
@@ -262,6 +263,7 @@ class ReviewableQueuedPost < Reviewable
user = target_created_by.reload
{
+ decision_facts: "The author of a post held for approval was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -275,6 +277,8 @@ class ReviewableQueuedPost < Reviewable
user = target_created_by.reload
{
+ decision_facts:
+ "The author of a post held for approval had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -288,6 +292,7 @@ class ReviewableQueuedPost < Reviewable
user = result.deleted_user
{
+ decision_facts: "The author of a post held for approval had their account deleted.",
decision_account: "DECISION_ACCOUNT_TERMINATED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/app/models/reviewable_user.rb b/app/models/reviewable_user.rb
index 7e203bc6216..f35844deba3 100644
--- a/app/models/reviewable_user.rb
+++ b/app/models/reviewable_user.rb
@@ -223,6 +223,7 @@ class ReviewableUser < Reviewable
user = target.reload
{
+ decision_facts: "The reviewed account was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -236,6 +237,7 @@ class ReviewableUser < Reviewable
user = target.reload
{
+ decision_facts: "The reviewed account had its ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -250,6 +252,7 @@ class ReviewableUser < Reviewable
return unless user&.destroyed?
{
+ decision_facts: "The reviewed account was deleted.",
decision_account: "DECISION_ACCOUNT_TERMINATED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -259,6 +262,7 @@ class ReviewableUser < Reviewable
}
when :remove_avatar
{
+ decision_facts: "The reviewed account's avatar was removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_IMAGE"],
content_date: result.removed_avatar.created_at.to_date.iso8601,
diff --git a/plugins/chat/app/models/chat/reviewable_message.rb b/plugins/chat/app/models/chat/reviewable_message.rb
index f81644956ee..822f91a4b97 100644
--- a/plugins/chat/app/models/chat/reviewable_message.rb
+++ b/plugins/chat/app/models/chat/reviewable_message.rb
@@ -191,6 +191,7 @@ module Chat
when :agree_and_delete, :delete_and_agree, :delete_and_ignore, :agree_and_keep_deleted,
:agree_and_keep_hidden
{
+ decision_facts: "The flagged chat message was removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: chat_message.created_at.to_date.iso8601,
@@ -201,6 +202,7 @@ module Chat
user = target_created_by.reload
{
+ decision_facts: "The author of the flagged chat message was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -214,6 +216,8 @@ module Chat
user = target_created_by.reload
{
+ decision_facts:
+ "The author of the flagged chat message had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/plugins/chat/spec/models/chat/reviewable_chat_message_spec.rb b/plugins/chat/spec/models/chat/reviewable_chat_message_spec.rb
index 3bf923f1fdb..852d5ff3507 100644
--- a/plugins/chat/spec/models/chat/reviewable_chat_message_spec.rb
+++ b/plugins/chat/spec/models/chat/reviewable_chat_message_spec.rb
@@ -90,7 +90,9 @@ RSpec.describe Chat::ReviewableMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged chat message was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -111,7 +113,9 @@ RSpec.describe Chat::ReviewableMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged chat message was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -134,7 +138,9 @@ RSpec.describe Chat::ReviewableMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged chat message was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -189,7 +195,9 @@ RSpec.describe Chat::ReviewableMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged chat message was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -216,7 +224,10 @@ RSpec.describe Chat::ReviewableMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of the flagged chat message had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
diff --git a/plugins/discourse-ai/app/models/reviewable_ai_chat_message.rb b/plugins/discourse-ai/app/models/reviewable_ai_chat_message.rb
index c2654c8a193..3e15c676e03 100644
--- a/plugins/discourse-ai/app/models/reviewable_ai_chat_message.rb
+++ b/plugins/discourse-ai/app/models/reviewable_ai_chat_message.rb
@@ -139,6 +139,7 @@ class ReviewableAiChatMessage < Reviewable
when :agree_and_delete, :delete_and_agree, :delete_and_ignore, :agree_and_keep_deleted,
:agree_and_keep_hidden
{
+ decision_facts: "The chat message was flagged by an automated system and removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: chat_message.created_at.to_date.iso8601,
@@ -149,6 +150,8 @@ class ReviewableAiChatMessage < Reviewable
user = target_created_by.reload
{
+ decision_facts:
+ "The author of a chat message flagged by an automated system was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -162,6 +165,8 @@ class ReviewableAiChatMessage < Reviewable
user = target_created_by.reload
{
+ decision_facts:
+ "The author of a chat message flagged by an automated system had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/plugins/discourse-ai/app/models/reviewable_ai_post.rb b/plugins/discourse-ai/app/models/reviewable_ai_post.rb
index 2540a1072c4..8f074d11b58 100644
--- a/plugins/discourse-ai/app/models/reviewable_ai_post.rb
+++ b/plugins/discourse-ai/app/models/reviewable_ai_post.rb
@@ -185,6 +185,8 @@ class ReviewableAiPost < Reviewable
case action_id
when :agree_and_hide, :agree_and_keep_hidden
{
+ decision_facts:
+ "The post was flagged by an automated system and access to it was disabled.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_DISABLED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -194,6 +196,7 @@ class ReviewableAiPost < Reviewable
when :delete_and_agree, :delete_and_ignore, :delete_and_agree_replies,
:delete_and_ignore_replies
{
+ decision_facts: "The post was flagged by an automated system and removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -204,6 +207,7 @@ class ReviewableAiPost < Reviewable
user = post.user.reload
{
+ decision_facts: "The author of a post flagged by an automated system was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -217,6 +221,8 @@ class ReviewableAiPost < Reviewable
user = post.user.reload
{
+ decision_facts:
+ "The author of a post flagged by an automated system had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -230,6 +236,8 @@ class ReviewableAiPost < Reviewable
user = post.user
{
+ decision_facts:
+ "The author of a post flagged by an automated system had their account deleted.",
decision_account: "DECISION_ACCOUNT_TERMINATED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/plugins/discourse-ai/app/models/reviewable_ai_tool_action.rb b/plugins/discourse-ai/app/models/reviewable_ai_tool_action.rb
index 4653423feac..5f2c616f76e 100644
--- a/plugins/discourse-ai/app/models/reviewable_ai_tool_action.rb
+++ b/plugins/discourse-ai/app/models/reviewable_ai_tool_action.rb
@@ -91,6 +91,7 @@ class ReviewableAiToolAction < Reviewable
post = Post.with_deleted.find_by!(topic_id: parameters["topic_id"], post_number: 1)
{
+ decision_facts: "The topic was closed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_INTERACTION_RESTRICTED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -103,6 +104,7 @@ class ReviewableAiToolAction < Reviewable
post = Post.with_deleted.find_by!(topic_id: parameters["topic_id"], post_number: 1)
{
+ decision_facts: "The topic was unlisted.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_DEMOTED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -115,6 +117,7 @@ class ReviewableAiToolAction < Reviewable
post = Post.with_deleted.find_by!(topic_id: parameters["topic_id"], post_number: 1)
{
+ decision_facts: "The topic was removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -127,6 +130,7 @@ class ReviewableAiToolAction < Reviewable
post = Post.with_deleted.find(parameters["post_id"])
{
+ decision_facts: "The post was locked.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_INTERACTION_RESTRICTED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -139,6 +143,7 @@ class ReviewableAiToolAction < Reviewable
post = Post.with_deleted.find_by!(topic_id: parameters["topic_id"], post_number: 1)
{
+ decision_facts: "The topic was placed in slow mode, limiting how often users can reply.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_INTERACTION_RESTRICTED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: post.created_at.to_date.iso8601,
@@ -149,6 +154,7 @@ class ReviewableAiToolAction < Reviewable
post = Post.with_deleted.find(parameters["post_id"])
{
+ decision_facts: "The post was edited.",
decision_visibility: ["DECISION_VISIBILITY_OTHER"],
decision_visibility_other: "Content edited",
content_type: ["CONTENT_TYPE_TEXT"],
@@ -160,6 +166,7 @@ class ReviewableAiToolAction < Reviewable
user = User.find_by_username(parameters["username"])
{
+ decision_facts: "The account was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -173,6 +180,7 @@ class ReviewableAiToolAction < Reviewable
user = User.find_by_username(parameters["username"])
{
+ decision_facts: "The account had its ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/plugins/discourse-ai/spec/models/reviewable_ai_chat_message_spec.rb b/plugins/discourse-ai/spec/models/reviewable_ai_chat_message_spec.rb
index 5d3665f7f24..2b653f24bd1 100644
--- a/plugins/discourse-ai/spec/models/reviewable_ai_chat_message_spec.rb
+++ b/plugins/discourse-ai/spec/models/reviewable_ai_chat_message_spec.rb
@@ -62,7 +62,9 @@ RSpec.describe ReviewableAiChatMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The chat message was flagged by an automated system and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => chat_message.created_at.to_date.iso8601,
@@ -83,7 +85,9 @@ RSpec.describe ReviewableAiChatMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The chat message was flagged by an automated system and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => chat_message.created_at.to_date.iso8601,
@@ -106,7 +110,9 @@ RSpec.describe ReviewableAiChatMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The chat message was flagged by an automated system and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => chat_message.created_at.to_date.iso8601,
@@ -161,7 +167,10 @@ RSpec.describe ReviewableAiChatMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of a chat message flagged by an automated system was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_type_other" => "User account",
@@ -188,7 +197,10 @@ RSpec.describe ReviewableAiChatMessage, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of a chat message flagged by an automated system had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_type_other" => "User account",
diff --git a/plugins/discourse-ai/spec/models/reviewable_ai_post_spec.rb b/plugins/discourse-ai/spec/models/reviewable_ai_post_spec.rb
index 87f4d03b442..45b3608988a 100644
--- a/plugins/discourse-ai/spec/models/reviewable_ai_post_spec.rb
+++ b/plugins/discourse-ai/spec/models/reviewable_ai_post_spec.rb
@@ -300,7 +300,10 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The post was flagged by an automated system and access to it was disabled.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => target.created_at.to_date.iso8601,
@@ -323,7 +326,10 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The post was flagged by an automated system and access to it was disabled.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => target.created_at.to_date.iso8601,
@@ -374,7 +380,9 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was flagged by an automated system and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => target.created_at.to_date.iso8601,
@@ -395,7 +403,9 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was flagged by an automated system and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => target.created_at.to_date.iso8601,
@@ -420,7 +430,9 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of a post flagged by an automated system was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_date" => target.user.created_at.to_date.iso8601,
@@ -447,7 +459,10 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of a post flagged by an automated system had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_date" => target.user.created_at.to_date.iso8601,
@@ -472,7 +487,10 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of a post flagged by an automated system had their account deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_date" => content_date,
@@ -496,7 +514,10 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of a post flagged by an automated system had their account deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_date" => content_date,
@@ -528,7 +549,9 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was flagged by an automated system and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => target.created_at.to_date.iso8601,
@@ -559,7 +582,9 @@ describe ReviewableAiPost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was flagged by an automated system and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => target.created_at.to_date.iso8601,
diff --git a/plugins/discourse-ai/spec/models/reviewable_ai_tool_action_spec.rb b/plugins/discourse-ai/spec/models/reviewable_ai_tool_action_spec.rb
index 16e1c60487b..ce51ab8f70e 100644
--- a/plugins/discourse-ai/spec/models/reviewable_ai_tool_action_spec.rb
+++ b/plugins/discourse-ai/spec/models/reviewable_ai_tool_action_spec.rb
@@ -545,7 +545,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The topic was closed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => post.created_at.to_date.iso8601,
@@ -595,7 +597,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The topic was unlisted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => post.created_at.to_date.iso8601,
@@ -645,7 +649,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The topic was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => post.created_at.to_date.iso8601,
@@ -695,7 +701,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was locked.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => post.created_at.to_date.iso8601,
@@ -744,7 +752,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "Access to the flagged post was disabled.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_PARTIALLY",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -774,7 +784,10 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The topic was placed in slow mode, limiting how often users can reply.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => post.created_at.to_date.iso8601,
@@ -824,7 +837,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was edited.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_TEXT"],
"content_date" => post.created_at.to_date.iso8601,
@@ -855,7 +870,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The account was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_date" => user.created_at.to_date.iso8601,
@@ -887,7 +904,9 @@ RSpec.describe ReviewableAiToolAction do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The account had its ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"content_type" => ["CONTENT_TYPE_OTHER"],
"content_date" => user.created_at.to_date.iso8601,
diff --git a/plugins/discourse-ai/spec/models/reviewable_flagged_post_spec.rb b/plugins/discourse-ai/spec/models/reviewable_flagged_post_spec.rb
index 38bfe714e6e..a29fc35014d 100644
--- a/plugins/discourse-ai/spec/models/reviewable_flagged_post_spec.rb
+++ b/plugins/discourse-ai/spec/models/reviewable_flagged_post_spec.rb
@@ -26,7 +26,9 @@ RSpec.describe ReviewableFlaggedPost do
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged post was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
diff --git a/plugins/discourse-ai/spec/models/reviewable_post_spec.rb b/plugins/discourse-ai/spec/models/reviewable_post_spec.rb
index 8a80a1e1c4d..5cbe2b00ef7 100644
--- a/plugins/discourse-ai/spec/models/reviewable_post_spec.rb
+++ b/plugins/discourse-ai/spec/models/reviewable_post_spec.rb
@@ -31,7 +31,9 @@ RSpec.describe ReviewablePost do
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was rejected and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
diff --git a/plugins/discourse-post-voting/app/models/reviewable_post_voting_comment.rb b/plugins/discourse-post-voting/app/models/reviewable_post_voting_comment.rb
index f21e983c296..32ef1dce08d 100644
--- a/plugins/discourse-post-voting/app/models/reviewable_post_voting_comment.rb
+++ b/plugins/discourse-post-voting/app/models/reviewable_post_voting_comment.rb
@@ -136,6 +136,7 @@ class ReviewablePostVotingComment < Reviewable
when :agree_and_delete, :delete_and_agree, :delete_and_ignore, :agree_and_keep_deleted,
:agree_and_keep_hidden
{
+ decision_facts: "The flagged voting comment was removed.",
decision_visibility: ["DECISION_VISIBILITY_CONTENT_REMOVED"],
content_type: ["CONTENT_TYPE_TEXT"],
content_date: comment.created_at.to_date.iso8601,
@@ -146,6 +147,7 @@ class ReviewablePostVotingComment < Reviewable
user = target_created_by.reload
{
+ decision_facts: "The author of the flagged voting comment was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -159,6 +161,8 @@ class ReviewablePostVotingComment < Reviewable
user = target_created_by.reload
{
+ decision_facts:
+ "The author of the flagged voting comment had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/plugins/discourse-post-voting/spec/models/reviewable_post_voting_comment_spec.rb b/plugins/discourse-post-voting/spec/models/reviewable_post_voting_comment_spec.rb
index ec965911802..936ec18098d 100644
--- a/plugins/discourse-post-voting/spec/models/reviewable_post_voting_comment_spec.rb
+++ b/plugins/discourse-post-voting/spec/models/reviewable_post_voting_comment_spec.rb
@@ -76,7 +76,9 @@ RSpec.describe ReviewablePostVotingComment, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged voting comment was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -97,7 +99,9 @@ RSpec.describe ReviewablePostVotingComment, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged voting comment was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -120,7 +124,9 @@ RSpec.describe ReviewablePostVotingComment, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged voting comment was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -175,7 +181,9 @@ RSpec.describe ReviewablePostVotingComment, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged voting comment was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -202,7 +210,10 @@ RSpec.describe ReviewablePostVotingComment, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of the flagged voting comment had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
diff --git a/plugins/voice/app/models/reviewable_voice_user.rb b/plugins/voice/app/models/reviewable_voice_user.rb
index fb2050a44b5..4f257b574a5 100644
--- a/plugins/voice/app/models/reviewable_voice_user.rb
+++ b/plugins/voice/app/models/reviewable_voice_user.rb
@@ -94,6 +94,7 @@ class ReviewableVoiceUser < Reviewable
user = target_created_by.reload
{
+ decision_facts: "The user reported during a voice call was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -107,6 +108,8 @@ class ReviewableVoiceUser < Reviewable
user = target_created_by.reload
{
+ decision_facts:
+ "The user reported during a voice call had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/plugins/voice/spec/models/reviewable_voice_user_spec.rb b/plugins/voice/spec/models/reviewable_voice_user_spec.rb
index 61b95677835..2bdbe1e05b9 100644
--- a/plugins/voice/spec/models/reviewable_voice_user_spec.rb
+++ b/plugins/voice/spec/models/reviewable_voice_user_spec.rb
@@ -153,7 +153,9 @@ RSpec.describe ReviewableVoiceUser do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The user reported during a voice call was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -180,7 +182,10 @@ RSpec.describe ReviewableVoiceUser do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The user reported during a voice call had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
diff --git a/spec/models/reviewable_flagged_post_spec.rb b/spec/models/reviewable_flagged_post_spec.rb
index 9278bca60c0..e314ec50e8c 100644
--- a/spec/models/reviewable_flagged_post_spec.rb
+++ b/spec/models/reviewable_flagged_post_spec.rb
@@ -639,7 +639,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "Access to the flagged post was disabled.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -661,7 +663,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "Access to the flagged post was disabled.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_FULLY",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -685,7 +689,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged post was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -710,7 +716,10 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of the flagged post had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -734,7 +743,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "Access to the flagged post was disabled.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -757,7 +768,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged post was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -822,7 +835,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged post was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -843,7 +858,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged post was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -865,7 +882,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged post was edited.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -901,7 +920,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged post was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -928,7 +949,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged post was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -957,7 +980,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged post was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -984,7 +1009,10 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of the flagged post had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -1013,7 +1041,10 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of the flagged post had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -1038,7 +1069,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged post had their account deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -1062,7 +1095,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the flagged post had their account deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -1094,7 +1129,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged post was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -1125,7 +1162,9 @@ RSpec.describe ReviewableFlaggedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The flagged post was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
diff --git a/spec/models/reviewable_post_spec.rb b/spec/models/reviewable_post_spec.rb
index e92dbb6ebfc..7e710712a4c 100644
--- a/spec/models/reviewable_post_spec.rb
+++ b/spec/models/reviewable_post_spec.rb
@@ -206,7 +206,9 @@ RSpec.describe ReviewablePost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was rejected and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -229,7 +231,9 @@ RSpec.describe ReviewablePost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was rejected and removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -270,7 +274,9 @@ RSpec.describe ReviewablePost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of the rejected post was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -297,7 +303,10 @@ RSpec.describe ReviewablePost do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of the rejected post had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
diff --git a/spec/models/reviewable_queued_post_spec.rb b/spec/models/reviewable_queued_post_spec.rb
index 39071c0f61a..b0888034f01 100644
--- a/spec/models/reviewable_queued_post_spec.rb
+++ b/spec/models/reviewable_queued_post_spec.rb
@@ -657,7 +657,9 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was held for approval and rejected before publication.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -682,7 +684,9 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was held for approval and rejected before publication.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -722,7 +726,9 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of a post held for approval was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -749,7 +755,10 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" =>
+ "The author of a post held for approval had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -778,7 +787,9 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of a post held for approval had their account deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -797,7 +808,9 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(post_statement).to be_pending
expect(post_statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was held for approval and rejected before publication.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
@@ -824,7 +837,9 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The author of a post held for approval had their account deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -843,7 +858,9 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(post_statement).to be_pending
expect(post_statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The post was held for approval and rejected before publication.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_TEXT"],
diff --git a/spec/models/reviewable_user_spec.rb b/spec/models/reviewable_user_spec.rb
index f0fee6e3cbb..fb929df6b9c 100644
--- a/spec/models/reviewable_user_spec.rb
+++ b/spec/models/reviewable_user_spec.rb
@@ -539,7 +539,9 @@ RSpec.describe ReviewableUser, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The reviewed account was deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -563,7 +565,9 @@ RSpec.describe ReviewableUser, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The reviewed account was deleted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -584,7 +588,9 @@ RSpec.describe ReviewableUser, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The reviewed account had its ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -606,7 +612,9 @@ RSpec.describe ReviewableUser, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The reviewed account was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_OTHER"],
@@ -632,7 +640,9 @@ RSpec.describe ReviewableUser, type: :model do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
+ "decision_facts" => "The reviewed account's avatar was removed.",
"source_type" => "SOURCE_VOLUNTARY",
+ "decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "Yes",
"automated_decision" => "AUTOMATED_DECISION_NOT_AUTOMATED",
"content_type" => ["CONTENT_TYPE_IMAGE"],