Skip to content

fix(benchmark): bound HTML report history - #240

Merged
IkarusAILabs merged 2 commits into
IkarusAILabs:mainfrom
Golden007-prog:fix/benchmark-html-history-limit
Oct 18, 2026
Merged

IkarusAILabs merged 2 commits into
IkarusAILabs:mainfrom
Golden007-prog:fix/benchmark-html-history-limit

Conversation

@Golden007-prog

Copy link
Copy Markdown
Contributor

What does this PR do?

Follow up on the requested history limit and adversarial-input coverage in the review of #239, which has now merged.

HTML benchmark reports accept at most 20 historical evaluations, preserving their explicit order. Excess history raises ValueError before any brief is rendered. The writer renders before opening its destination, so a rejected history neither truncates an existing report nor creates an empty one. The limit is documented as a count of historical briefs, not a byte limit on an individual evaluation.

Tests cover the 20/21 boundary, preserving existing or absent output files on rejection, and inert handling of script/style breakouts, SVG event handlers, iframe/image payloads, JavaScript links, and encoded HTML across history labels and metrics. Existing numeric-meter restrictions, Markdown parity, and input immutability are also checked.

How was this tested?

  • The two excess-history regression cases failed before the guard.
  • python -m pytest tests/test_authority_canonical.py tests/test_authority_benchmark.py -q: 66 passed.
  • python -m pytest tests/ -q: 1,328 passed, 3 skipped.
  • ruff check safeai/ tests/: passed.
  • git diff --check: passed.

The repository-wide ruff check . additionally reports three existing findings in examples/crewai_example.py and two fuzz harnesses; those files are unchanged. The merged main tree was verified identical to the tested parent tree before this follow-up was based on it.

Checklist

  • Tests pass locally (python -m pytest tests/ -q)
  • Lint passes (ruff check safeai/ tests/)

AI-assistance disclosure: implementation and verification assisted by OpenAI Codex.

Golden007-prog and others added 2 commits October 18, 2026 18:22
Signed-off-by: Oikantik Basu <140976895+Golden007-prog@users.noreply.github.com>

@IkarusAILabs IkarusAILabs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a solid follow-up to PR #239 that addresses the DoS concern

@IkarusAILabs
IkarusAILabs merged commit e23aede into IkarusAILabs:main Oct 18, 2026
10 checks passed
IkarusAILabs added a commit that referenced this pull request Oct 18, 2026
…esentation (#243)

- PR #239: Offline HTML authority evidence reports with trend views
- PR #240: Hard limit (20) on HTML history with ValueError before render
- Added to README.md Community Contributors table
- Added to GOOD_FIRST_ISSUES.md Completed Issues table (issue #224)

Signed-off-by: Ikarus Career Tech <ikaruscareer@gmail.com>
IkarusAILabs added a commit that referenced this pull request Oct 18, 2026
…dencies alerts (#244)

* docs: credit @Golden007-prog for Authority Evidence Benchmark HTML presentation

- PR #239: Offline HTML authority evidence reports with trend views
- PR #240: Hard limit (20) on HTML history with ValueError before render
- Added to README.md Community Contributors table
- Added to GOOD_FIRST_ISSUES.md Completed Issues table (issue #224)

Signed-off-by: Ikarus Career Tech <ikaruscareer@gmail.com>

* ci: pin CodeQL actions by SHA (v4.39.0) to fix Scorecard Pinned-Dependencies alerts

All github/codeql-action steps (init, autobuild, analyze, upload-sarif)
now pinned to commit 48870fdd6b42ee6474ec4207209ff87609271a5e (v4.39.0)
instead of version tag. This resolves 5 open Scorecard Pinned-Dependencies
code scanning alerts.

Signed-off-by: Ikarus Career Tech <ikaruscareer@gmail.com>

---------

Signed-off-by: Ikarus Career Tech <ikaruscareer@gmail.com>
WintersCoder pushed a commit that referenced this pull request Oct 25, 2026
…257-#260 (#261)

- README and CONTRIBUTING contributor tables: add @therealestbenji
  (#219), @tyza66 (#257, #258, #260) and @HectorGuerilla (#259);
  extend @ARAVIND281 with #220. CONTRIBUTING also gains
  @Golden007-prog (#239, #240), already credited in the README.
- CHANGELOG [Unreleased]: "Thanks to" lines on the #257, #258 and #260
  entries, plus a new entry for the #259 docs change.
- GOOD_FIRST_ISSUES: mark #182 and #196 complete with their
  contributors; record #197 as in progress.

Signed-off-by: Ikarus Career Tech <ikaruscareer@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants