Skip to content

fix(ui): derive completeness fields and scores from scoring payload - #97

Open
jonathanjasare wants to merge 1 commit into
GenAI-Security-Project:mainfrom
jonathanjasare:bugfix/24-dynamic-completeness-results
Open

fix(ui): derive completeness fields and scores from scoring payload#97
jonathanjasare wants to merge 1 commit into
GenAI-Security-Project:mainfrom
jonathanjasare:bugfix/24-dynamic-completeness-results

Conversation

@jonathanjasare

Copy link
Copy Markdown

Fixes #24.

Summary

  • Render all five field-checklist categories from completeness_score.category_fields_list instead of keeping template-owned field lists.
  • Render category and overall score maxima from the scoring payload instead of hard-coded point totals.
  • Normalise the total-score progress display against the payload's summed category maxima.
  • Add a Jinja render regression using unique fields and maxima for every category.

Why

The scoring model already builds category_fields_list, category_details.*.max_points, and max_scores. The results template duplicated parts of that data, so schema or scoring changes could update backend totals while leaving stale field rows or point totals in the UI.

Verification

  • python -m unittest -v tests.test_result_template: 2 passed.
  • python -m pytest -q -k 'not TestFixtureEndToEnd': 180 applicable tests passed; 3 Torch-dependent fixture tests excluded.
  • ruff check tests/test_result_template.py: passed.
  • python -m compileall -q src tests/test_result_template.py: passed.
  • git diff --check: passed.

Scope

Changed only:

  • src/templates/result.html
  • tests/test_result_template.py

No scoring algorithm, schema, dependency, configuration, documentation, or unrelated refactor is included.

Known limitation

Three TestFixtureEndToEnd tests were excluded from the applicable suite because they exercise Torch-dependent fixture processing rather than the changed template path.

@jonathanjasare
jonathanjasare marked this pull request as ready for review August 6, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: New fields don’t automatically update completeness scoring UI

1 participant