Changeset 67c1f24 in Klonkt for src/config/database.js


Ignore:
Timestamp:
07/17/2026 12:38:54 AM (8 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
92a2c46
Parents:
3778ddb
git-author:
Robin <roboburr@…> (07/17/2026 12:38:34 AM)
git-committer:
Robin <roboburr@…> (07/17/2026 12:38:54 AM)
Message:

Feature: owner moderation of incoming replies (remove + tombstone + report)

The site owner could not remove an incoming reply, and thread-filling would
re-fetch a locally deleted one (crawlThread seeds its dedup set from
ap_interactions). New ap_rejected_objects table: rejectInteraction() (tenancy-
scoped to the owner's site) deletes the row and tombstones the object URI;
handleInbox and crawlThread skip tombstoned URIs, so a removed reply never
returns via re-delivery or thread-filling. A report action feeds sendReport
from the locally stored object/actor URIs, so flagging also works for private
notes that authorize_interaction cannot fetch (401/404). Thread nodes get
owner-only report + remove buttons (confirm via the global data-confirm
handler); i18n NL/EN/DE. Covered by test/reply-moderation.test.js (59 tests
green); full flow verified in a browser: buttons render for the logged-in
owner, remove deletes the reply and writes the tombstone. Beads: klonkt-demo-qul.

Co-Authored-By: Claude Opus 4.8 <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    r3778ddb r67c1f24  
    272272    );
    273273    CREATE INDEX IF NOT EXISTS idx_ap_inter_post ON ap_interactions(post_id, kind);
     274    -- Moderation tombstones: object URIs the site owner removed. Checked at ingest
     275    -- (handleInbox) AND by the thread-crawler, so a removed reply never comes back
     276    -- via thread-filling. Private notes can't be flagged via authorize_interaction
     277    -- (their fetch 401s), so owner moderation acts on the locally stored copy.
     278    CREATE TABLE IF NOT EXISTS ap_rejected_objects (
     279      object_uri TEXT PRIMARY KEY,
     280      post_id TEXT,
     281      reason TEXT,
     282      created_at DATETIME DEFAULT CURRENT_TIMESTAMP
     283    );
    274284    CREATE TABLE IF NOT EXISTS ap_outbox (
    275285      id TEXT PRIMARY KEY,            -- note path segment (uuid) → /ap/notes/<id>
Note: See TracChangeset for help on using the changeset viewer.