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

Create a base reward for users within this plugin #31

Open
gentlementlegen opened this issue Sep 11, 2024 · 8 comments
Open

Create a base reward for users within this plugin #31

gentlementlegen opened this issue Sep 11, 2024 · 8 comments

Comments

@gentlementlegen
Copy link
Member

gentlementlegen commented Sep 11, 2024

          Yes I do agree that we should be able to chain these results. It's just that this plugin never had the capability to actually attribute rewards to a user, this was the responsibility of `conversation-rewards`. We could think of splitting this and have the logic here later on.

Originally posted by @gentlementlegen in https://github.com/ubiquibot/assistive-pricing/issues/27#issuecomment-2338184070

This plugin should output a Reward compatible output to be able to be chained with other plugins. The current shape of the rewards is as follows:
https://github.com/ubiquibot/conversation-rewards?tab=readme-ov-file#data-structure

What this plugin should output is the following section:

"userName": {
  "task": {
    "reward": 37.5,
    "multiplier": 1
  }
}

which corresponds to the current reward within the label divided by the amount of users assigned to the task. Once in the output, chained plugins could pick this up and use it for further calculations.

@gentlementlegen gentlementlegen changed the title Yes I do agree that we should be able to chain these results. It's just that this plugin never had the capability to actually attribute rewards to a user, this was the responsibility of conversation-rewards. We could think of splitting this and have the logic here later on. Create a base reward for users within this plugin Sep 11, 2024
@0x4007
Copy link
Member

0x4007 commented Sep 11, 2024

Perhaps property name changes to:

"userName": {
  "rewards": {
    "sum": 37.5,
    "multiplier": 1
  }
}

Note that subtraction and division can be performed with negative sum and fractional multiplier.

@gentlementlegen
Copy link
Member Author

Not sure how assistive-pricing can apply these kinds of calculations? It only knows about the labels and assigned users.

@0x4007
Copy link
Member

0x4007 commented Sep 11, 2024

If every plugin can output some type of standard property like rewards then the kernel can pass everything along to the permit generation, which I think is sort of a core feature of the system.

@gentlementlegen
Copy link
Member Author

I think plugins should just rely on a object output because rewards are not needed by all the plugins. We can also consider exporting types from the plugins themselves so other plugins can import them, but we should minimize coupling.

@0x4007
Copy link
Member

0x4007 commented Sep 11, 2024

I think plugins should just rely on a object output because rewards are not needed by all the plugins.

Sure but what is the schema of object? If it isn't standardized then interoperability will be a mess.

@gentlementlegen
Copy link
Member Author

Interoperability will be worse if we introduce heavy coupling.
If the kernel is responsible to define the Rewards then any change on the rewards content would imply changes on the kernel.
If the conversation-rewards is responsible to define the rewards shape, other plugins should reference this package as well.
If all plugins consider using an object then no coupling is introduced, coming with the downside of have less completion.

The last case is used by GitHub Actions for example, where output is expected to be an object but doesn't provide any typings. In our case since all plugins are optional, and order of execution is undefined, I think we should follow the same solution because we can never ensure the content or shape of the output.

@0x4007
Copy link
Member

0x4007 commented Sep 11, 2024

I think we should follow the same solution because we can never ensure the content or shape of the output.

Yes I agree I think we should model our config after GitHub Actions syntax unless we have a really good reason otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants