Skip to content

test: type remaining test contracts - #294

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/remaining-test-contracts
Apr 21, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/remaining-test-contracts

Conversation

@Sinity

@Sinity Sinity commented Apr 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • removes the remaining explicit dynamic typing from tests outside the already-merged core, storage, CLI/MCP/UI, pipeline, source-parser, and integration slices
  • adds typed benchmark fixture protocols and concrete payload contracts for benchmark, fuzz, property, CLI, devtools, security, rendering, and showcase tests
  • rewrites rendering preservation property-test setup around local TypedDict payloads and shared model builders

Problem

After the previous mypy campaign PRs, the remaining test surfaces still relied on explicit Any annotations across benchmark/fuzz/property tests and several focused unit-test areas. That kept the test suite less precise than the now-typed source contracts, especially around generated rendering payloads and machine JSON envelopes.

Ref #281

Solution

Replace explicit Any annotations with concrete pytest, pathlib, JSON, SQLite, Click, protocol, and TypedDict contracts. The rendering preservation property tests now use a small typed payload model and shared builders instead of repeating untyped nested dict indexing. Benchmark tests use a local BenchmarkFixture protocol, and machine/devtools/showcase/security helpers now preserve concrete boundaries without casts to Any.

Touched areas:

  • tests/benchmarks/
  • tests/fuzz/
  • tests/property/
  • tests/unit/cli/
  • tests/unit/devtools/
  • tests/unit/rendering/
  • tests/unit/security/
  • tests/unit/showcase/

Verification

  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH rg -n "\bAny\b|cast(Any|typing import .Any" tests -g ".py"
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff check --fix tests
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff format tests
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH mypy tests
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH pytest -q tests/unit/security tests/unit/devtools tests/unit/showcase tests/unit/cli/test_machine_main.py tests/unit/cli/test_run.py tests/unit/cli/test_products.py tests/unit/cli/test_qa_requests.py tests/unit/rendering/test_html_highlighting.py tests/property/test_rendering_preservation.py tests/property/test_schema_roundtrip.py
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH devtools verify --quick
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH git push -u origin feature/refactor/remaining-test-contracts

@coderabbitai

coderabbitai Bot commented Apr 21, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 26 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 26 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6c1c5095-3e51-46ec-a5e3-5a952ec1d1e8

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed2bd3 and 7454bb2.

📒 Files selected for processing (24)
  • tests/benchmarks/helpers.py
  • tests/benchmarks/test_pipeline.py
  • tests/benchmarks/test_search_filters.py
  • tests/benchmarks/test_storage.py
  • tests/fuzz/fuzz_json_parsers.py
  • tests/fuzz/fuzz_timestamp.py
  • tests/property/test_rendering_preservation.py
  • tests/property/test_schema_roundtrip.py
  • tests/unit/cli/test_machine_main.py
  • tests/unit/cli/test_products.py
  • tests/unit/cli/test_qa_requests.py
  • tests/unit/cli/test_run.py
  • tests/unit/devtools/test_benchmark_campaigns.py
  • tests/unit/devtools/test_build_package.py
  • tests/unit/devtools/test_devtools_main.py
  • tests/unit/devtools/test_query_memory_budget.py
  • tests/unit/rendering/test_html_highlighting.py
  • tests/unit/security/test_observers_security.py
  • tests/unit/security/test_path_sanitization.py
  • tests/unit/showcase/test_qa_markdown.py
  • tests/unit/showcase/test_report.py
  • tests/unit/showcase/test_runner.py
  • tests/unit/showcase/test_verification_lane.py
  • tests/unit/showcase/test_vhs_generation.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/remaining-test-contracts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit e805b14 into master Apr 21, 2026
13 checks passed
@Sinity
Sinity deleted the feature/refactor/remaining-test-contracts branch April 21, 2026 12:32
Sinity added a commit that referenced this pull request Apr 22, 2026
## Summary
- removes the remaining explicit dynamic typing from tests outside the already-merged core, storage, CLI/MCP/UI, pipeline, source-parser, and integration slices
- adds typed benchmark fixture protocols and concrete payload contracts for benchmark, fuzz, property, CLI, devtools, security, rendering, and showcase tests
- rewrites rendering preservation property-test setup around local TypedDict payloads and shared model builders

## Problem
After the previous mypy campaign PRs, the remaining test surfaces still relied on explicit Any annotations across benchmark/fuzz/property tests and several focused unit-test areas. That kept the test suite less precise than the now-typed source contracts, especially around generated rendering payloads and machine JSON envelopes.

Ref #281

## Solution
Replace explicit Any annotations with concrete pytest, pathlib, JSON, SQLite, Click, protocol, and TypedDict contracts. The rendering preservation property tests now use a small typed payload model and shared builders instead of repeating untyped nested dict indexing. Benchmark tests use a local BenchmarkFixture protocol, and machine/devtools/showcase/security helpers now preserve concrete boundaries without casts to Any.

Touched areas:
- tests/benchmarks/
- tests/fuzz/
- tests/property/
- tests/unit/cli/
- tests/unit/devtools/
- tests/unit/rendering/
- tests/unit/security/
- tests/unit/showcase/

## Verification
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH rg -n "\bAny\b|cast\(Any|typing import .*Any" tests -g "*.py"
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff check --fix tests
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff format tests
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH mypy tests
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH pytest -q tests/unit/security tests/unit/devtools tests/unit/showcase tests/unit/cli/test_machine_main.py tests/unit/cli/test_run.py tests/unit/cli/test_products.py tests/unit/cli/test_qa_requests.py tests/unit/rendering/test_html_highlighting.py tests/property/test_rendering_preservation.py tests/property/test_schema_roundtrip.py
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH devtools verify --quick
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH git push -u origin feature/refactor/remaining-test-contracts
Sinity added a commit that referenced this pull request Apr 22, 2026
After the previous mypy PRs, the remaining test surfaces still
relied on explicit `Any` annotations across benchmark/fuzz/property
tests and several focused unit-test areas. The test suite was less
precise than the now-typed source contracts, especially around
generated rendering payloads and machine JSON envelopes.

Replaces explicit `Any` annotations with concrete pytest, pathlib,
JSON, SQLite, Click, protocol, and TypedDict contracts. Rewrites
rendering preservation property-test setup around local TypedDict
payloads and shared model builders instead of repeating untyped
nested dict indexing. Benchmark tests use a local
`BenchmarkFixture` protocol; machine/devtools/showcase/security
helpers preserve concrete boundaries without casts to `Any`.

Touched areas: `tests/benchmarks/`, `tests/fuzz/`, `tests/property/`,
`tests/unit/cli/`, `tests/unit/devtools/`, `tests/unit/rendering/`,
`tests/unit/security/`, `tests/unit/showcase/`.

Verification: ruff + mypy + pytest over the touched test trees;
devtools verify --quick green.

Ref #281
Sinity added a commit that referenced this pull request Apr 22, 2026
After the previous mypy PRs, the remaining test surfaces still
relied on explicit `Any` annotations across benchmark/fuzz/property
tests and several focused unit-test areas. The test suite was less
precise than the now-typed source contracts, especially around
generated rendering payloads and machine JSON envelopes.

Replaces explicit `Any` annotations with concrete pytest, pathlib,
JSON, SQLite, Click, protocol, and TypedDict contracts. Rewrites
rendering preservation property-test setup around local TypedDict
payloads and shared model builders instead of repeating untyped
nested dict indexing. Benchmark tests use a local
`BenchmarkFixture` protocol; machine/devtools/showcase/security
helpers preserve concrete boundaries without casts to `Any`.

Touched areas: `tests/benchmarks/`, `tests/fuzz/`, `tests/property/`,
`tests/unit/cli/`, `tests/unit/devtools/`, `tests/unit/rendering/`,
`tests/unit/security/`, `tests/unit/showcase/`.

Verification: ruff + mypy + pytest over the touched test trees;
devtools verify --quick green.

Ref #281
Sinity added a commit that referenced this pull request Apr 22, 2026
After the previous mypy PRs, the remaining test surfaces still
relied on explicit `Any` annotations across benchmark/fuzz/property
tests and several focused unit-test areas. The test suite was less
precise than the now-typed source contracts, especially around
generated rendering payloads and machine JSON envelopes.

Replaces explicit `Any` annotations with concrete pytest, pathlib,
JSON, SQLite, Click, protocol, and TypedDict contracts. Rewrites
rendering preservation property-test setup around local TypedDict
payloads and shared model builders instead of repeating untyped
nested dict indexing. Benchmark tests use a local
`BenchmarkFixture` protocol; machine/devtools/showcase/security
helpers preserve concrete boundaries without casts to `Any`.

Touched areas: `tests/benchmarks/`, `tests/fuzz/`, `tests/property/`,
`tests/unit/cli/`, `tests/unit/devtools/`, `tests/unit/rendering/`,
`tests/unit/security/`, `tests/unit/showcase/`.

Verification: ruff + mypy + pytest over the touched test trees;
devtools verify --quick green.

Ref #281
@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ 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".

@Sinity
Sinity requested a review from Copilot May 1, 2026 01:52
@Sinity
Sinity removed the request for review from Copilot May 1, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant