Repository navigation
Description
Problem: The Responsible AI path had one storage test and one route test, both using a four-line report that says "High", which is why a Low rating rendering as "moderate" (PR #130) went unnoticed until a manual run. Nothing tests the chain the way a user hits it: secfoo run --skill responsible-ai-compliance auto-creating an assessment, the report being parsed, the rating reaching /responsible-ai, /assessments/<id>, secfoo assessment show and secfoo assessment list, the --json document, the overview's "Responsible AI coverage" count, and the provisional → confirmed transition from the dashboard's bulk-status form as well as the CLI.
Build:
- A fixture report under
tests/fixtures/reports/responsible-ai-compliance.mdwith the real shape (summary with rating, register, six findings with### [Low] Fn:headings, coverage notes), seeded from a real run against openai/openai-quickstart-python; add Medium and High variants. - End-to-end CLI test:
CliRunnerrunssecfoo run --skill responsible-ai-compliance --agent claude --jsonwithfake_popenreturning the fixture as the agent's stdout; assert the JSON severity counts, that an assessment was auto-created with the rightresponsible_ai_risk, and thatassessment showprintsResponsible AI: low-risk (provisional). - Dashboard tests on the same store:
/responsible-ailists the assessment with the right badge class and counts;/shows coverage 1;/activities/responsible-ai-complianceshows 1 project, 1 run, 6 findings; the bulk-status POST tocompletedturns the ratingconfirmed; deleting the assessment removes it from the page and the count. - Most-recent-run semantics: two runs on one assessment (Low then High) → the badge follows the newest successful run; a failed newer run does not change it.
- Renderer test: the brief for this skill contains all seven dimensions and the severity rubric text, so a future edit of the skill file cannot silently drop one.
- Attached runs:
secfoo run --assessment <id>attaches to an existing case file and updates its badge.
Where to look: tests/test_cli.py (test_run_command_does_not_warn_when_responsible_ai_*), tests/test_web/test_assessment_routes.py (client, _create_assessment, the Responsible AI tests), tests/test_storage/test_assessments.py, tests/conftest.py (fake_popen), src/secfoo/storage/repository.py (_responsible_ai_badges), src/secfoo/web/routes/responsible_ai.py, src/secfoo/skills/definitions/responsible-ai-compliance.md.
Done when: the fixture-driven end-to-end test and the dashboard tests pass in pytest tests; coverage of web/routes/responsible_ai.py and the badge derivation is 100%; the tests would fail if the rating mapping regressed to a single tier.
Activity
Arush-Banerjee commentedon Nov 17, 2026
I'd like to take this