SSVC icon indicating copy to clipboard operation
SSVC copied to clipboard

Policy Generator (Python) has problems

Open ahouseholder opened this issue 3 months ago • 3 comments

[!NOTE] In the original version of this issue, I mistakenly referred to policy_explorer when I meant policy_generator. The corrected version appears below.

Describe the bug

policy_generator.py is reporting an error

Traceback (most recent call last):
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/policy_generator.py", line 388, in <module>
    main()
    ~~~~^^
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/policy_generator.py", line 382, in main
    imp = csv_analyzer.drop_col_feature_importance(df, "outcome")
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/csv_analyzer.py", line 306, in drop_col_feature_importance
    X2, y = _prepare_data(df, target)
            ~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/csv_analyzer.py", line 277, in _prepare_data
    raise KeyError(f"Column '{target}' not found in {list(df.columns)}")
KeyError: "Column 'outcome' not found in ['ssvc_e_1_0_0', 'ssvc_exp_1_0_1', 'ssvc_a_2_0_0', 'ssvc_hi_2_0_0', 'ssvc_dsoi_1_0_0']"

To Reproduce Steps to reproduce the behavior:

  1. Run policy_generator.py
  2. Witness error

Expected behavior

Should run without errors.

Additional context

It's unclear whether we really still need policy_generator.py now that we have the DecisionTable class. So the first decision to make here is whether to just get rid of it entirely, or maybe refactor it to use the more recent DecisionTable class.

A second decision is what to rename this since we're trying to avoid confusion on the use of the term "policy" (so probably rename to Decision Table Generator or somesuch).

ahouseholder avatar Oct 01 '25 20:10 ahouseholder

Image The graph view cuts off at the bottom. In this instance, my screen is vertically oriented.

This is for the Deployer Patch Application table.

sei-renae avatar Oct 08 '25 20:10 sei-renae

To be clear - this is specific to Javascript Explorer and NOT the Python policy explorer. There is a little zoom control on the top left corner that may help. But we can also do a Javascript post displayed div mutation to adjust div height. I will split this into a new issue.

sei-vsarvepalli avatar Oct 08 '25 20:10 sei-vsarvepalli

Apologies, I typed explorer when I meant generator in the original description. Corrected that now.

ahouseholder avatar Oct 09 '25 12:10 ahouseholder