Changeset 3ffbedd in Klonkt for src/services


Ignore:
Timestamp:
07/24/2026 08:28:15 PM (7 weeks ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
fcd6964
Parents:
c502242
Message:

Guardianship: eerste guardian committeert op de enkele ward-accept

Het offer ís de instemming van de kandidaat. Een vrij account mag in één keer
een guardian aannemen: er is nog geen tweede guardian om mee te akkoorderen.
Pas als het een ward is, treedt de co-approval in werking.

Concreet: de kandidaat-accept wordt nu impliciet vastgelegd bij het offer, op
elke kopie (C2S bij het versturen, S2S bij ontvangst). Zo committeert de eerste
guardian zodra de ward accepteert; een tweede guardian erbij vereist nog steeds
dat een bestaande guardian mee-accepteert (§3.1.2). Geen aparte "voltooien"-stap
voor de kandidaat meer.

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

  • Offer legt de kandidaat-accept vast (C2S + S2S)

test/guardianship.test.js

  • eerste guardian: commit op enkele ward-accept; tweede: co-approval

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

File:
1 edited

Legend:

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

    rc502242 r3ffbedd  
    107107      wardHandle: deps.deriveHandle(rel.ward), candidateHandle: deps.deriveHandle(me),
    108108    });
     109    // The Offer IS the candidate's agreement to serve: record it as the
     110    // candidate's accept. So a FREE ward commits on its own single accept (no
     111    // second guardian to co-approve yet); once it IS a ward, adding another
     112    // guardian still needs an existing guardian to co-accept.
     113    offers.recordAccept(site.slug, offerId, me);
    109114    // Addressed to the ward AND every existing guardian (§3.1.1).
    110115    const recipients = [rel.ward, ...existing];
     
    159164      wardHandle: deps.deriveHandle(rel.ward), candidateHandle: deps.deriveHandle(rel.candidate),
    160165    });
     166    // The Offer carries the candidate's agreement (see the C2S side): record it
     167    // so this copy's tally matches — a free ward then commits on its own accept.
     168    offers.recordAccept(site.slug, idOf(activity), rel.candidate);
    161169    notify(site.slug, { kind: rel.ward === me ? 'offer_received' : 'offer_for_ward', ward: rel.ward, candidate: rel.candidate });
    162170    return true;
Note: See TracChangeset for help on using the changeset viewer.