Skip to content

Moderation actions must carry a reason code the seated charter lists (moderation teams E) #4880

Open

Description

@QuantumExplorer

Part of #4865 (decentralized moderation teams). Item E of the PR split. Wave 3: depends on H1.

Summary

In elected mode, every moderation action's reason code must be one the seated charter lists. This makes "what we moderate" machine-readable and gives voters an audit trail to judge a team.

Decisions implemented: D50 in #4865.

Current behaviour

ContractModerationReason { code: Option<u16>, text } in packages/rs-dpp/src/data_contract/config/moderation/reason.rs is stored as written; the code is not checked against anything (#4849 reserved it for this).

Scope

  • When a contract has a seated team, a ban, suspension, deletion or warning with a code that the active charter's reasonCodes does not list is refused with a new state error. A missing code is also refused in elected mode with a seated team; interim mode and the owner and appointed kinds keep today's behaviour (unchecked).
  • The check reads the active charter id from the seated team (H1) and the charter document from the system contract (C1); state reads belong in the action, not in the structure validation.
  • Book chapter updated.

Depends on

  • H1 (seated team with active charter id), C1 (charter with reasonCodes), D (warn carries a reason).

Tests

  • Listed code accepted, unlisted code refused, missing code refused with a seated team, unchecked without one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions