The Guardian is an innovative open-source platform that streamlines the creation, management, and verification of digital environmental assets. It leverages a customizable Policy Workflow Engine and Web3 technology to ensure transparent and fraud-proof operations, making it a key tool for transforming sustainability practices and carbon markets.
Currently when defining a chunk of a source code in, for example, the calculate block policy authors often find it difficult to detect logical or even syntax errors as there is no facility to debug, test run, view or at least print-out the values of the variables in the block. The only method of debugging provided by Guardian currently is to run the policy end-to-end, and try to identify issues from the logs/error codes. This is too time consuming and labor intensive.
Requirements
Introduce the 'Test' button to all places where source or math code can be inputted in Guardian policy which would trigger the 'in place' execution of the code based on the execution context and defined inputs/outputs of the block. This tool could prompt the user for input data when required.
Add ability to 'print' (i.e. log) data and variable values somewhere when test-running policy (e.g. in Dry-run mode). This way policy authors would be able to examine the data structures passed into the functions and identify unexpected behaviour in this area.
Add recommendations to the documentation wrt running this code in an separate developer environment, i.e. all the needed execution context such as imported libraries etc so those developers who prefer to use their code editors can replicate the execution of the code there.
Definition of done
Functionality introduced as described above
Documentation updated
Acceptance criteria
Policy authors are able to run tests on the Guardian policy code embeddings without the need to execute the entire policy end-to-end.
Problem description
Currently when defining a chunk of a source code in, for example, the calculate block policy authors often find it difficult to detect logical or even syntax errors as there is no facility to debug, test run, view or at least print-out the values of the variables in the block. The only method of debugging provided by Guardian currently is to run the policy end-to-end, and try to identify issues from the logs/error codes. This is too time consuming and labor intensive.
Requirements
Definition of done
Acceptance criteria