name: hermes-discord-thread-cleanup-standing
version: 1.1.0
doctrinal_basis: Standing ROE / standing authority maps to read-only Hermes/Discord thread inspection; positive identification maps to verified target parameters and Discord thread type checks; proportionality and collateral damage estimation map to single-thread scope; escalation of force maps to discord-ops human approval before thread delete or archive; restricted engagement zones map to parent channel/category/forum/media deletion, message-history deletion, private-thread export, and broad cleanup.
description: Hermes/Discord standing thread cleanup guardrails for inspecting threads and escalating verified single-thread delete/archive requests while denying broad or parent destructive operations.
rules:
  - id: deny-discord-parent-deletion
    applies_to:
      action_class:
        - discord.channel.delete
        - discord.category.delete
        - discord.forum.delete
        - discord.media.delete
        - discord.parent.delete
    decision: deny
    reasoning: Hermes/Discord cleanup ROE denies deletion of channel, category, forum, media, or parent containers; this template only covers thread cleanup.

  - id: deny-discord-message-history-destruction
    applies_to:
      action_class:
        - discord.message_history.delete
        - discord.thread.message_history.delete
        - discord.private_thread.export
    decision: deny
    reasoning: Hermes/Discord cleanup ROE denies message-history deletion and private-thread export under standing authority.

  - id: deny-discord-broad-cleanup
    applies_to:
      action_class:
        - discord.cleanup.bulk
        - discord.thread.cleanup.bulk
        - discord.thread.delete.bulk
        - discord.thread.archive.bulk
    decision: deny
    reasoning: Broad or bulk Hermes/Discord cleanup is outside standing authority and requires special ROE.

  - id: deny-discord-thread-delete-bulk-count
    applies_to:
      action_class:
        - discord.thread.delete
        - discord.thread.archive
    conditions:
      - type: blast_radius_max
        parameter: thread_count
        threshold: 1
    decision: deny
    reasoning: Requested Hermes/Discord thread cleanup affects ${thread_count} threads, exceeding the standing one-thread cap.

  - id: deny-discord-explicit-unverified-thread-mutation
    applies_to:
      action_class:
        - discord.thread.delete.unverified
        - discord.thread.archive.unverified
        - discord.thread.delete.wrong_type
        - discord.thread.archive.wrong_type
    decision: deny
    reasoning: Adapter classified this Discord thread mutation as unverified or wrong-type; standing cleanup ROE denies it.

  - id: escalate-verified-discord-thread-delete
    applies_to:
      action_class: discord.thread.delete
    conditions:
      - type: parameter_match
        parameter: target_verified
        op: equals
        value: true
      - type: parameter_match
        parameter: discord_type
        op: in
        values: [10, 11, 12]
    decision: escalate
    escalation:
      requires: human_approval
      via: discord-ops
    reasoning: Verified Hermes/Discord thread delete for type ${discord_type} requires discord-ops approval under standing ROE before execution.

  - id: escalate-verified-discord-thread-archive
    applies_to:
      action_class: discord.thread.archive
    conditions:
      - type: parameter_match
        parameter: target_verified
        op: equals
        value: true
      - type: parameter_match
        parameter: discord_type
        op: in
        values: [10, 11, 12]
    decision: escalate
    escalation:
      requires: human_approval
      via: discord-ops
    reasoning: Verified Hermes/Discord thread archive for type ${discord_type} requires discord-ops approval under standing ROE before execution.

  - id: allow-discord-thread-inspection
    applies_to:
      action_class:
        - discord.thread.read
        - discord.thread.list
        - discord.thread.lookup
        - discord.thread.verify
    decision: allow
    reasoning: Read-only Hermes/Discord thread inspection and target verification are authorized under standing cleanup ROE.
