valory-xyz / agent-academy-1

Valory's Agent Academy 1 - participant repo
Apache License 2.0
1 stars 1 forks source link

chore: further syncing #127

Closed DavidMinarsch closed 2 years ago

DavidMinarsch commented 2 years ago

@0xArdi currently tox -e check-abciapp-specs fails with

autonomy.analyse.abci.app_spec.DFASpecificationError: <class 'packages.elcollectooorr.skills.elcollectooorr_abci.rounds.ElcollectooorrBaseAbciApp'> ABCI App has the following issues:
 - DecisionRound: transition function events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY', 'GIB_DETAILS'} do not match referenced events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY'}.

Since you understand the code better I suggest you decide if it is safe to remove this event. Otherwise, speak to @jmoreira-valory about resolution.

0xArdi commented 2 years ago

@0xArdi currently tox -e check-abciapp-specs fails with

autonomy.analyse.abci.app_spec.DFASpecificationError: <class 'packages.elcollectooorr.skills.elcollectooorr_abci.rounds.ElcollectooorrBaseAbciApp'> ABCI App has the following issues:
 - DecisionRound: transition function events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY', 'GIB_DETAILS'} do not match referenced events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY'}.

Since you understand the code better I suggest you decide if it is safe to remove this event. Otherwise, speak to @jmoreira-valory about resolution.

@DavidMinarsch the FSM in the yaml files is outdated.

DavidMinarsch commented 2 years ago

@0xArdi currently tox -e check-abciapp-specs fails with

autonomy.analyse.abci.app_spec.DFASpecificationError: <class 'packages.elcollectooorr.skills.elcollectooorr_abci.rounds.ElcollectooorrBaseAbciApp'> ABCI App has the following issues:
 - DecisionRound: transition function events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY', 'GIB_DETAILS'} do not match referenced events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY'}.

Since you understand the code better I suggest you decide if it is safe to remove this event. Otherwise, speak to @jmoreira-valory about resolution.

@DavidMinarsch the FSM in the yaml files is outdated.

Yes, although make fix-abci-app-specs yields:

autonomy analyse abci generate-app-specs packages.elcollectooorr.skills.elcollectooorr_abci.rounds.ElcollectooorrBaseAbciApp packages/elcollectooorr/skills/elcollectooorr_abci/fsm_specification.yaml || (echo "Failed to check elcollectooorr abci consistency" && exit 1)
Error: Failed to load "packages.elcollectooorr.skills.elcollectooorr_abci.rounds". Please, verify that AbciApps and classes are correctly defined within the module. 
Failed to check elcollectooorr abci consistency

@jmoreira-valory might be able to shed some light

0xArdi commented 2 years ago

I am getting the same error as you, but I also see:

ModuleNotFoundError: No module named 'packages'
jmoreira-valory commented 2 years ago

There are 2 problems discussed in this thread:

Problem 1:

autonomy.analyse.abci.app_spec.DFASpecificationError: <class 'packages.elcollectooorr.skills.elcollectooorr_abci.rounds.ElcollectooorrBaseAbciApp'> ABCI App has the following issues:
 - DecisionRound: transition function events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY', 'GIB_DETAILS'} do not match referenced events {'DECIDED_NO', 'DECIDED_YES', 'NO_MAJORITY'}.

This problem occurs when checking unreferenced events in the transition function of the AbciApp. That is, we are indicating a transition (RoundA, EVENT) --> RoundB, but RoundA (nor its superclasses) never produces EVENT. This check does not use the fsm_specification.yaml file.

The ElcollectooorrBaseAbciApp defines the following transition under DecisionRound: https://github.com/valory-xyz/agent-academy-1/blob/c92fc51eb372c7c825bfe11b7cf429c9688dc462/packages/elcollectooorr/skills/elcollectooorr_abci/rounds.py#L510

However, upon examining the class https://github.com/valory-xyz/agent-academy-1/blob/c92fc51eb372c7c825bfe11b7cf429c9688dc462/packages/elcollectooorr/skills/elcollectooorr_abci/rounds.py#L409 it can be seen that neither DecisionRound nor its superclasses launch the event GIB_DETAILS, reason why the script is complaining.

Solution: either (1) Remove this non-existent transition from the ElcollectooorrBaseAbciApp, or (2) Return GIB_DETAILS at some part inside DecisionRound (I am not familiar with the business logic of the application, so I can't say which is better...)

Problem 2:

Yes, although make fix-abci-app-specs yields:

autonomy analyse abci generate-app-specs packages.elcollectooorr.skills.elcollectooorr_abci.rounds.ElcollectooorrBaseAbciApp packages/elcollectooorr/skills/elcollectooorr_abci/fsm_specification.yaml || (echo "Failed to check elcollectooorr abci consistency" && exit 1)
Error: Failed to load "packages.elcollectooorr.skills.elcollectooorr_abci.rounds". Please, verify that AbciApps and classes are correctly defined within the module. 
Failed to check elcollectooorr abci consistency

This is caused because .../agent-academy-1 folder is not in the Python path. To see this, try:

import sys
for path in sys.path:
      print(path)

Solution: export PYTHONPATH=${PYTHONPATH}:${PWD}

However, this will NOT solve Problem 1 above. The reason is that this command will read the AbciApp as defined in the .py file, and produce a .yaml specification file that matches that implementation. That is, it will generate an fsm_specification.yaml file containing the GIB_DETAILS event.

fix-abci-app-specs fixes the .yaml file, but if the AbciApp is incorrectly defined, it won't fix it.

In summary:

  1. First, fix in the code what to do with the GIB_DETAILS (either remove it from the transition function or return it from the corresponding round).
  2. Fix the Pythonpath and generate the correct fsm_specification.yaml file.
0xArdi commented 2 years ago

Thanks a lot @jmoreira-valory , the issue discussed above is resolved in #129 .

There is another issue when trying to generate the abci app spec for the composed abci app.

autonomy analyse abci generate-app-specs packages.elcollectooorr.skills.elcollectooorr_abci.rounds.ElcollectooorrAbciApp packages/elcollectooorr/skills/elcollectooorr_abci/fsm_composition_specification.yaml || (echo "Failed to check chained abci consistency" && exit 1)

Produces:

Error: Class "ElcollectooorrAbciApp" is not in "packages.elcollectooorr.skills.elcollectooorr_abci.rounds".
DavidMinarsch commented 2 years ago
ElcollectooorrAbciApp

I think the problem is caused by you having the composition in the same file as the to be composed fsm. We don't recommend that - although its perfectly fine to do - and apparently right now the tool does not support it. I think it fails because there are multiple AbciApps present. @jmoreira-valory we should fix that on the tool

DavidMinarsch commented 2 years ago
ElcollectooorrAbciApp

I think the problem is caused by you having the composition in the same file as the to be composed fsm. We don't recommend that - although its perfectly fine to do - and apparently right now the tool does not support it. I think it fails because there are multiple AbciApps present. @jmoreira-valory we should fix that on the tool

I was wrong, it was a good old Python path issue coupled with the error being totally uninformative here: https://github.com/valory-xyz/open-autonomy/blob/v0.2.0/autonomy/cli/analyse.py#L60-L65