hashgraph / hashgraph/guardian

Isolated dry-run of policy calculations sections linked to FLDs/FCBs

Open
#5,576 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
146
Forks
186
Avg merge
2d 20h
Merged PRs (30d)
126

Description

### Problem description
[Formular Linked Definitions (FLDs)](https://guardian.hedera.com/methodology-digitization/methodology-digitization-handbook/part-5/chapter-19) and [Formula Calculation Blocks (FCBs)](https://github.com/hashgraph/guardian/issues/4535) enable non-technical users to view Guardian Policy calculations expressed in mathematical notation familiar to most subject-matter experts. Each FLD/FCB represents a section of the policy workflow, its inputs, and the transformation of those inputs into outputs according to the defined formula. In the case of FLDs, the formula is implemented as JavaScript or Python code, while for FCBs the formula is directly executable with no corresponding source code.

Currently, Policy users can independently verify the correctness of FLD/FCB calculations only by following a heavyweight procedure consisting of the following steps in the Guardian UI:

- Importing the policy
- Switching it to dry-run mode
- Running test cases against its workflow

This process could be simplified so that users can run isolated tests of individual formulas. In other words, Guardian could provide a “dry-run” execution step associated with the FLDs and FCBs of published policies whenever users are viewing them.

### Requirements

1. Introduce a UI element on FLD/FCB viewing pages in Guardian and Indexer that triggers a “dry-run” mode, allowing users to provide inputs, run the calculations, and review the resulting outputs.
2. Provide the ability to input data both manually and via files for batch execution. The results of batch executions must be generated as downloadable files that users can review locally.
3. Provide a corresponding API so that testing can be fully automated and integrated with existing test automation workflows.

### Definition of done

- Functionality to test FLD/FCB is implemented as described above
- Documentation exists
- Sample test data sets for published PROD policies are made available

### Acceptance criteria
Any user looking at the FLD/FCB and data produced by the corresponding policy is able to re-run (dry-run) the calculations with the original data, and modify or try to use different data without importing policy etc

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.