source: Klonkt/src/services/guardianship/index.js@ 5c373b8

main
Last change on this file since 5c373b8 was 5c373b8, checked in by Robin <roboburr@…>, 7 weeks ago

Guardian 2: follow-goedkeuring (FEP-633c §5.3)

Een Follow op een ward wordt niet meer automatisch geaccepteerd: hij wacht op
goedkeuring van de guardians. Afgebakend zoals de spec: gating geldt ALLEEN voor
ward-actors (die guardians hebben); een gewone site zonder guardians accepteert
als vanouds, geen gedragswijziging. Een gecommitte guardian die zelf volgt wordt
wel meteen geaccepteerd (Barts regel: die heeft geen gate nodig, en zo werkt het
meekijken). Quorum per ward: 'any' (default, één volstaat), 'all' of 'none'; een
enkele reject weigert.

De guardian ziet de verzoeken in /guardian2 (ward en guardian zitten op dezelfde
familie-Klonkt, dus lokaal leesbaar) en tikt Accept/Deny. Bij goedkeuring stuurt
Klonkt de Accept(Follow) en legt de follower vast, zodat bezorging (ook
followers-only) begint. Cross-instance federatie van de goedkeuring is een latere
verfijning (de daemon heeft het patroon).

Changed files:
src/services/ActivityPubService.js

  • inbound Follow: gate voor ward-actors; acceptGatedFollow/rejectGatedFollow

src/config/database.js

  • ap_pending_follows + ap_pending_follow_approvals

src/services/guardianship/index.js

  • follows-module geexporteerd

src/routes/guardian2.js

  • GET /api/follow-requests, POST /api/follow/:id (guardian-gecheckt)

src/views/pages/guardian2.ejs, src/assets/js/guardian2.js

src/services/i18n.js

  • guardian2 follow_title/follow_sub (nl/en/de)

New file:
src/services/guardianship/follows.js

  • de gating-store + quorum-beslissing (any/all), pure en testbaar

test/follow-gating.test.js

  • any/all-quorum en single-reject

remarks: npm test 167/167. v1 /guardian en niet-ward-sites onaangeraakt.

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

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[6b5d7da]1/**
2 * Guardianship (FEP-633c "Guardians") — the module.
3 *
4 * Klonkt's kid-safety feature as one cohesive unit:
5 * - context.js: the shaer JSON-LD namespace + Relationship vocabulary
[780a7c6]6 * - offers.js: the multi-party handshake state (a port of the Shaer daemon)
7 * - relations.js: the COMMITTED ward ↔ guardian relations + actor props
[6b5d7da]8 * - handshake.js: the adoption Offer/Accept/Reject over C2S and S2S
9 * - queues.js: the owner-only dashboard collections (offers/follows/wards)
10 * - notes.js: the shaer:helpRequest flag on direct notes
11 * - delivery.js: the direct-note leg a ward's call-for-help rides
12 *
[780a7c6]13 * The shared blocklist (Shaer's "in Orbit") lives NEXT TO this module in
14 * BlocklistService. ActivityPubService wires the AP helpers in once and
15 * delegates; nothing here imports ActivityPubService back.
[6b5d7da]16 */
17export { SHAER_CONTEXT, GUARDIAN_RELATIONSHIP, GUARDIAN_RELATIONSHIP_COMPACT, isGuardianRelationship } from './context.js';
18export { helpRequestProps, isHelpRequest } from './notes.js';
19export { wireDelivery, c2sVisibility, deliverDirectNote } from './delivery.js';
20export { wireHandshake, handleOutbox as handleGuardianshipOutbox, handleInbox as handleGuardianshipInbox, parseRelationship } from './handshake.js';
21export { offersCollection, followsCollection, wardsCollection } from './queues.js';
[5c373b8]22export * as follows from './follows.js';
[780a7c6]23export { listForParty as listOffersForParty, getOffer, findOfferAnywhere } from './offers.js';
[6b5d7da]24export {
[780a7c6]25 listGuardians, listWards, isGuardian, getRelation, removeRelation,
26 actorProps as guardianshipActorProps,
[6b5d7da]27} from './relations.js';
Note: See TracBrowser for help on using the repository browser.