⚠️ IMPORTANT: contribution `work` events record the project creator, not the contributor

Aperta
#78 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
8/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
graphql, typescript
Ambito
api, authorization

Direzione di ricerca

This needs a product decision before any code, so start by reading the three options in the issue and the addContributor path in hooks/useProjectCRUD.ts (GUI repo), which calls resources.contributeToResource. Work out why the signer's provider and receiver end up as the creator, and check how the authorization rules in #71–#73 constrain it. Done means a chosen option is recorded on the issue, with follow-up SDK and GUI tasks split out. Don't implement a fix until that decision exists.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug workstream:authz-integration

Important, needs a design decision before release. Found during the authorization workstream (#74). It doesn't block the RBAC PRs, but it means the economic record of who contributed is wrong today, and the authorization rules now make the obvious fix impossible from the GUI alone.

What happens

When a project is created with contributors, the GUI (hooks/useProjectCRUD.ts, addContributor) calls the SDK's resources.contributeToResource(processId, designSpec), which sends:

createEconomicEvent(event: {
  action: "work" inputOf: $process provider: $agent receiver: $agent   # $agent = the signer, i.e. the project creator
  resourceConformsTo: $conformsTo effortQuantity: { hasNumericalValue: 1 hasUnit: $unitOne }
})

The contributor never appears in the event. Their id only reaches the inbox notification ("you have been added as a contributor") and the contributors list in the project's metadata. Each "contribution" is a work event in which the creator worked for themselves, repeated once per contributor.

Why it matters

  • ValueFlows attribution is wrong. In VF, provider of a work event is the agent who did the work. Traces, DPP history and anything that reads events will credit the creator, not the contributor.
  • Economics/reputation. Strengths/idea points use the contributor id separately, so the events and the points already disagree.
  • Metadata vs. record. metadata.contributors (editable, unauthenticated as a claim) is the only place the contributor is named, and metadata is not a control or provenance fact.

Why the GUI can't simply fix it

With the authorization stack (#71–#73), the signer must act for the event's provider or receiver. So the creator cannot create a work event with provider: <contributor>. That is correct: otherwise anyone could attribute work to anyone, or impersonate them.

Options (to discuss)

  1. Contributor confirms (recommended direction): the creator publishes an intent (work, provider = contributor, inputOf the creation process). The contributor accepts it from their inbox, and that creates the work event signed by them, satisfying the intent. This is VF-native and fits the existing invited-party rule. It needs a small GUI flow on the contributor's side.
  2. Receiver-side record: the creator records a work event with receiver: creator and the contributor as provider, allowed by a new policy rule. This weakens "you can't attribute work to someone else" and is not recommended.
  3. Keep attribution out of economic events: drop the self-work events and treat metadata.contributors as an unverified list until (1) exists.

Scope

Backend policy is fine as is. The fix is a product/flow decision, then SDK and GUI work. Until then, any report on "who contributed" should be read from neither the events nor the metadata as authoritative.

Refs #74. Evidence: real signed probe and code paths described in interfacerproject/interfacer-gui#919.

Lingua principale
Elixir
Stelle
18
Fork
4
Merge medio
22g 17h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di interfacerproject/zenflows

Tutte le issue di interfacerproject/zenflows

Issue simili

Altre issue su Elixir

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.