-
Notifications
You must be signed in to change notification settings - Fork 5
Intents #3
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
Intents #3
Conversation
67040fd to
dab17e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces intent support throughout the GOOSE AVM stack, allowing intents to be defined, translated into resources, and checked both on intent resource consumption and on consuming objects to create intents.
- Adds a polymorphic
UUnittype and updatesTypeRepand list helpers to support intent parameters - Defines
IntentandIntent.ResourceDatainAVM/Intent.leanand implements translation to AVM actions/transactions inAVM/Intent/Translation.lean - Extends class labels, app data, object translation, and class‐member logic to include
IntentIdand intent checks
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Prelude/UUnit.lean | Introduces UUnit for intent-member argument defaults. |
| AVM/Intent.lean | Defines Intent struct and its resource data format. |
| AVM/Intent/Translation.lean | Implements intent logic and action/transaction emission. |
| AVM/Class/Label.lean | Extends Label with IntentId and parsing helpers. |
| AVM/Class/Translation.lean | Integrates intent member logic into class translation. |
| Anoma/Resource.lean | Adjusts Resource universes to align value/label types. |
| Apps/UniversalCounter.lean | Registers empty Intents in the example counter class. |
| Apps/OwnedCounter.lean | Registers empty Intents and fixes binding in fromObject. |
Comments suppressed due to low confidence (2)
Anoma/Resource.lean:17
- The universes for
ValandLabelwere swapped, reversing the original parameters; this will misalign resources that expect the first parameter to be the value type. Please restoreVal : SomeType.{u}andLabel : SomeType.{v}.
Val : SomeType.{v}
AVM/Class/Translation.lean:146
- The record literal is indented under
o.toResource, making the compiler parse it as an argument totoResource. Wrap the record in parentheses or adjust indentation so thatlet res := o.toResourceis separate from theCreatedObjectconstruction.
{ object := o.object
| @@ -0,0 +1,10 @@ | |||
|
|
|||
| import Prelude.TypeRep | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that when building a prelude it is convenient to have most of the definitions in the same file. Otherwise we might run quickly into mutual dependencies between different files.
You don't need to revert this change, I just wanted to provide some context about my original decision
Example intent from the Kudos app: