Ignore:
Timestamp:
07/25/2026 08:37:24 AM (7 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
2b4252c
Parents:
8f520e0
Message:

FEP-633c §2.2: shaer:hasGuardians (outbound stempelen, inbound registreren)

Objecten van een ward krijgen nu de advies-hint shaer:hasGuardians, zodat een
remote server interacties met de post naar de guardians kan routen zonder eerst
de actor op te halen. Veilig te negeren door wie geen shaer spreekt.

Outbound: elke Note die een ward publiceert wordt gestempeld (alle drie de
buildNote-paden: gewone post, paid-teaser, reply/direct), dus ook via buildCreate
in de outbox. Inbound: de hint wordt alleen GEREGISTREERD op het opgeslagen object
(ap_timeline.has_guardians / ap_mentions.has_guardians), nog geen actie. Wordt
later bekendgemaakt bij reddings-boei / escalatie-routing (Robins besluit).

Changed files:
src/services/guardianship/notes.js

  • hasGuardiansProps(slug) (stempel als de site guardians heeft) + objectHasGuardians(o)

src/services/guardianship/index.js

  • beide geexporteerd

src/services/ActivityPubService.js

  • buildNote stempelt in alle drie de return-paden; inbound zet has_guardians op timeline + mention

src/config/database.js

  • ap_timeline.has_guardians + ap_mentions.has_guardians

test/has-guardians.test.js

  • ward stempelt wel, free niet; objectHasGuardians leest de hint

remarks: npm test 170/170. Alleen ward-objecten dragen de hint; niks acteert er nog
op (register-only). Daemon heeft de constante al (dead_code); wiren kan later.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/guardianship/notes.js

    r8f520e0 raf5b79b  
    55 * on direct notes. Everyone who does not speak shaer can ignore it.
    66 */
     7import { listGuardians } from './relations.js';
     8
     9/**
     10 * shaer:hasGuardians (§2.2): an advisory OBJECT hint that the author is a ward,
     11 * so a remote server can route interactions to the guardians WITHOUT fetching
     12 * the actor. Stamped on every object a ward publishes; MUST be safely ignorable.
     13 */
     14export function hasGuardiansProps(slug) {
     15  try { return (slug && listGuardians(slug).length) ? { 'shaer:hasGuardians': true } : {}; }
     16  catch { return {}; }
     17}
     18
     19/** True when an incoming object carries the ward hint (§2.2). Register-only for
     20 *  now; acted on later at reddings-boei / escalation routing. */
     21export function objectHasGuardians(o) {
     22  return !!o && (o['shaer:hasGuardians'] === true || o.hasGuardians === true);
     23}
    724
    825/** Extra JSON-LD properties for an outgoing note built from an ap_outbox row. */
     
    3148}
    3249
    33 export default { helpRequestProps, isHelpRequest, waveProps, isWave };
     50export default { helpRequestProps, isHelpRequest, waveProps, isWave, hasGuardiansProps, objectHasGuardians };
Note: See TracChangeset for help on using the changeset viewer.