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

Open
#78 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
8/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
graphql, typescript
Domain
api, authorization

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Elixir
Stars
18
Forks
4
Avg merge
22d 17h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from interfacerproject/zenflows

All issues in interfacerproject/zenflows

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.