Skip to content

[bench] audit follow-up: shared fixtures, meta constant, unpinned viewer assertions#9

Merged
dburks-svg merged 5 commits into
mainfrom
bench/audit-cleanup
Jul 12, 2026
Merged

[bench] audit follow-up: shared fixtures, meta constant, unpinned viewer assertions#9
dburks-svg merged 5 commits into
mainfrom
bench/audit-cleanup

Conversation

@dburks-svg

@dburks-svg dburks-svg commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up cleanup from the repo-wide audit session, applying the three findings its four-reviewer cleanup pass (reuse, simplification, efficiency, altitude) marked as apply:

  • ledger: promote _META_FILENAME to public META_FILENAME in ledger/chain.py and import it in ledger/verify.py, so the writer and the independent verifier cannot drift on the meta-anchor filename.
  • tests: extract the duplicated synthetic chain builder from test_verify.py and test_viewer.py into a shared tests/_ledger_fixtures.py (single source of truth for the entry shape; underscore prefix keeps unittest discovery from collecting it).
  • tests: unpin test_viewer.py banner assertions from HTML template markup (2 <span class="pct">(66.7%)</span>) to computed values ((66.7%), embedded "status": "VALID"), so restyling the viewer no longer breaks value-correct tests.
  • tests: remove unused imports flagged by ruff.
  • ledger: record the governance entries generated while making these changes (every edit in this PR passed the Bench challenger/defender/oracle pipeline).

Reviewer findings deliberately skipped, with reasons recorded in the audit session: api.py provider-wrapper dedup (two provider-specific bodies, extraction would abstract two lines), runner defensive guards (deliberate in governance paths), verify tuple cosmetics, and a tmpdir mixin (too small to justify).

Test plan

  • python -m unittest discover -s tests -p test_viewer.py (5 tests) ✅
  • python -m unittest discover -s tests -p test_verify.py (23 tests) ✅
  • python -m unittest discover -s tests -p test_chain.py (28 tests) ✅
  • ruff check ledger tests clean ✅
  • python -m cli verify reports the chain VALID with meta anchor verified ✅

dburks-svg and others added 4 commits July 12, 2026 12:57
typing.Any in five test modules and unittest.mock.call in test_runner
were imported but never used.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ssertions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 321e098b6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/test_verify.py Outdated
Codex review on PR #9: the bare `from _ledger_fixtures import ...` only
resolved under discovery-style runs, breaking the repo's established
`python -m unittest tests.test_x -v` style. Import via
`tests._ledger_fixtures` instead, and add tests/__init__.py so the
package resolves to this repo even when an unrelated `tests` package
exists on sys.path (regular packages outrank namespace portions).
Includes the governance ledger entries for these edits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dburks-svg
dburks-svg merged commit 14b1f39 into main Jul 12, 2026
3 checks passed
@dburks-svg
dburks-svg deleted the bench/audit-cleanup branch July 12, 2026 21:51
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.

1 participant