Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocialOrganism MVP implementation #232

Open
lucksus opened this issue Feb 6, 2023 · 0 comments · May be fixed by #233
Open

SocialOrganism MVP implementation #232

lucksus opened this issue Feb 6, 2023 · 0 comments · May be fixed by #233

Comments

@lucksus
Copy link
Member

lucksus commented Feb 6, 2023

The core benefit of the Social Organism implementation is for Expressions (of any Language - we will mostly use it for LinkExpressions I guess) to be spoken on behalf of a Social Organism. Since there is no intermediary nor objective DB/back-end/smart-contract executing the Social Organism as an entity, expressions of the SO can only be created by member agents. So Expressions that the SO creates need to be authored by some agent speaking on behalf of the SO.

The main question and problem to solve is this: "Is this expression that is claimed to be an expression of the SO actually in coherence with the (internal/private) state of the SO and its Social DNA?"

SO Expressions

With the SO implementation in AD4M, there should be an automatic process within AD4M that:

  1. Flags an Expression as something a particular SO says
  2. Shows (to any agent, especially those outside of the SO) if that expression is coherent

For that we add two fields to the generic Expression class:

socialOrganismSource?: string

to ExpressionClass itself, which just signals that this Expression (though authored by an atomic agent) is spoken on behalf of the given Social Organism - if this field is not null.

And second:

socialOrganismCoherence?: number

which gets added to ExpressionProof and is, similar to valid/invalid, a virtual property that the AD4M executor calculates and adds to the response sent to clients/UIs.

The number is understood as a percentage with 0 meaning not coherent (yet) at all and 1 meaning 100% coherent.

SO Coherence

What does this number mean? What is SO coherence?

When an SO Expression gets created, which means, somebody claims to speak on behalf of the whole, all other agents in this SO will get notified by that event, ultimately executed by the agent creating the expression since they want to get their expression to reach a high coherence number soon. When those other members get notified of a new SO Expression, they will retrieve that Expression and check if it is something the SO is allowed to say by running the Organisms Social DNA action on it. If that Social DNA action/query returns true, they will add their signature to that Expression.

So ultimately, the Expression's SO-coherence-number is just the ratio of member agents that have signed the Expression. (number of signatures) / (number of member agents in the SO)

SO Bootstrap Language

To make this work, we add another bootstrap Language for Social Organisms, which

  1. stores expressions that represent SOs, similar to the Neighbourhood language. Installing it in AD4M with an alias introduces an SO schema for global addressing of SOs: so://<hash based unique address>
  2. stores the member signatures of Expressions spoken on behalf of SOs

For the latter, we introduce a new Language interface:

export interface SocialOrganismAdapter {
    create(organismAddress: string, messageURI: string)
    concur(organismAddress: string, messageURI: string)
    reject(organismAddress: string, messageURI: string)

    signatures(organismAddress: string, messageURI: string): Promise<string[]>
    members(organismAddress: string): Promise<string[]>

    vouchForNewMember(organismAddress: string, newMemberDid: string)
    rejectNewMember(organismAddress: string, newMemberDid: string)

    newExpressionCallback()
    newMemberCallback()   
}

SO Social DNA actions

We need to define a Social DNA / Prolog interface (prediactes) which needs to be implemented by a SO's Social DNA:

  1. Output Expression predicate (taking in an Expression claimed to be spoken on behalf of the SO - true if something the SO is allowed to say)
  2. Membrane / member change (taking in a DID, return true if that agent shall be added to the member list)

These Social DNA predicates will be queried automatically by the executor to implement the described process.

UI/Client functions

We need a new section in Ad4mClient for social organisms with the following functions:

let soURI = await ad4m.so.create(socialOrganism: SocialOrganismInput): string // returns URI so://Qm343w5r3
await ad4m.so.speak(soURI, new Link({source: ...}), <language address>)
//using above functions with Links needs the planned, but currently not yet implemented, global link addresses (i.e. our LinkLanguage implementing the ExpressionAdapter

let soMembers = await ad4m.so.members(soURI)
await ad4m.so.suggestMemberAddition(soURI, newMemberDID)
await ad4m.so.suggestMemberRemoval(soURI, memberDID)
@lucksus lucksus converted this from a draft issue Feb 6, 2023
@lucksus lucksus linked a pull request Feb 6, 2023 that will close this issue
@lucksus lucksus moved this from Backlog to In Progress in AD4M development Feb 6, 2023
@lucksus lucksus moved this from In Progress to Backlog in AD4M development Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

2 participants