Discord: bounded metadata-only moderation audit substrate #485

Open
nsaspy wants to merge 0 commits from rage/28-discord-moderation-audit into main
Owner

Advances #28.

Adds the moderation audit substrate that can be consumed once #32 has a canonical Zara tool-registration hook:

  • JSONL records contain only timestamp, numeric guild/channel/message/target IDs, typed action/outcome, actor=mara, and bounded sanitized reason text
  • API deliberately accepts no raw message body, username/display-name, attachment, token, or model transcript fields
  • validates non-negative Discord IDs and a closed action/outcome vocabulary
  • defaults mutable audit state to XDG state ($XDG_STATE_HOME or ~/.local/state), never the Nix store
  • directory mode 0700, files 0600, fsync on append
  • rotates to a bounded number of bounded-size files

RED-first tests prove schema exclusion, sanitization/bounds, permissions, rotation, and rejection of unsupported actions/outcomes/IDs.

This PR does not invent a moderation tool runtime. Wiring audit records to actual moderation actions remains dependent on the canonical Zara Core plugin tool-registration handoff recorded on #32.

Advances #28. Adds the moderation audit substrate that can be consumed once #32 has a canonical Zara tool-registration hook: - JSONL records contain only timestamp, numeric guild/channel/message/target IDs, typed action/outcome, actor=`mara`, and bounded sanitized reason text - API deliberately accepts no raw message body, username/display-name, attachment, token, or model transcript fields - validates non-negative Discord IDs and a closed action/outcome vocabulary - defaults mutable audit state to XDG state (`$XDG_STATE_HOME` or `~/.local/state`), never the Nix store - directory mode 0700, files 0600, fsync on append - rotates to a bounded number of bounded-size files RED-first tests prove schema exclusion, sanitization/bounds, permissions, rotation, and rejection of unsupported actions/outcomes/IDs. This PR does not invent a moderation tool runtime. Wiring audit records to actual moderation actions remains dependent on the canonical Zara Core plugin tool-registration handoff recorded on #32.
Some checks failed
CI / test (pull_request) Failing after 18s
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin rage/28-discord-moderation-audit:rage/28-discord-moderation-audit
git switch rage/28-discord-moderation-audit

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff rage/28-discord-moderation-audit
git switch rage/28-discord-moderation-audit
git rebase main
git switch main
git merge --ff-only rage/28-discord-moderation-audit
git switch rage/28-discord-moderation-audit
git rebase main
git switch main
git merge --no-ff rage/28-discord-moderation-audit
git switch main
git merge --squash rage/28-discord-moderation-audit
git switch main
git merge --ff-only rage/28-discord-moderation-audit
git switch main
git merge rage/28-discord-moderation-audit
git push origin main
Sign in to join this conversation.
No description provided.