Skip to content

test: type integration workflow contracts - #293

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

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

Conversation

@Sinity

@Sinity Sinity commented Apr 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • removes explicit dynamic typing from the integration test suite
  • gives health-repair database helpers concrete SQLite connection types
  • types integration fixtures, JSON payloads, CLI machine-contract decoding, and schema patch context managers

Problem

The integration tests still used explicit Any annotations across health repair workflows, facade ingestion flows, end-to-end workflow tests, timestamp chaos tests, schema operator workflow tests, and CLI machine-contract tests. That left the highest-level contract tests less precise than the code paths they exercise.

Ref #281

Solution

Replace dynamic fixture and helper annotations with concrete Path, pytest.MonkeyPatch, Source, JSONDocument, sqlite3.Connection, and workflow-specific type aliases/protocols. Where JSON mutation was previously path-dependent through nested dynamic dictionaries, rebuild the typed JSON payload explicitly.

Touched files:

  • tests/integration/test_chronology_extremes.py
  • tests/integration/test_cli_machine_contract.py
  • tests/integration/test_facade.py
  • tests/integration/test_health.py
  • tests/integration/test_schema_operator_workflow.py
  • tests/integration/test_workflows.py

Verification

  • rg -n "\bAny\b|cast(Any|typing import .Any" tests/integration -g ".py"
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff check --fix tests/integration
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff format tests/integration
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH mypy tests/integration
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH pytest -q tests/integration/test_health.py tests/integration/test_facade.py tests/integration/test_workflows.py tests/integration/test_chronology_extremes.py tests/integration/test_cli_machine_contract.py tests/integration/test_schema_operator_workflow.py
  • PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH git push --force-with-lease -u origin feature/refactor/integration-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 46 minutes and 36 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 46 minutes and 36 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: 346310c7-7ae7-4621-b3de-1ccf9602726c

📥 Commits

Reviewing files that changed from the base of the PR and between 9f3cfbe and 85e266b.

📒 Files selected for processing (6)
  • tests/integration/test_chronology_extremes.py
  • tests/integration/test_cli_machine_contract.py
  • tests/integration/test_facade.py
  • tests/integration/test_health.py
  • tests/integration/test_schema_operator_workflow.py
  • tests/integration/test_workflows.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/integration-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 9ed2bd3 into master Apr 21, 2026
13 checks passed
@Sinity
Sinity deleted the feature/refactor/integration-test-contracts branch April 21, 2026 12:13
Sinity added a commit that referenced this pull request Apr 22, 2026
## Summary
- removes explicit dynamic typing from the integration test suite
- gives health-repair database helpers concrete SQLite connection types
- types integration fixtures, JSON payloads, CLI machine-contract decoding, and schema patch context managers

## Problem
The integration tests still used explicit Any annotations across health repair workflows, facade ingestion flows, end-to-end workflow tests, timestamp chaos tests, schema operator workflow tests, and CLI machine-contract tests. That left the highest-level contract tests less precise than the code paths they exercise.

Ref #281

## Solution
Replace dynamic fixture and helper annotations with concrete Path, pytest.MonkeyPatch, Source, JSONDocument, sqlite3.Connection, and workflow-specific type aliases/protocols. Where JSON mutation was previously path-dependent through nested dynamic dictionaries, rebuild the typed JSON payload explicitly.

Touched files:
- tests/integration/test_chronology_extremes.py
- tests/integration/test_cli_machine_contract.py
- tests/integration/test_facade.py
- tests/integration/test_health.py
- tests/integration/test_schema_operator_workflow.py
- tests/integration/test_workflows.py

## Verification
- rg -n "\bAny\b|cast\(Any|typing import .*Any" tests/integration -g "*.py"
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff check --fix tests/integration
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff format tests/integration
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH mypy tests/integration
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH pytest -q tests/integration/test_health.py tests/integration/test_facade.py tests/integration/test_workflows.py tests/integration/test_chronology_extremes.py tests/integration/test_cli_machine_contract.py tests/integration/test_schema_operator_workflow.py
- PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH git push --force-with-lease -u origin feature/refactor/integration-test-contracts
Sinity added a commit that referenced this pull request Apr 22, 2026
Integration tests still used explicit `Any` annotations across
health repair workflows, facade ingestion flows, end-to-end
workflow tests, timestamp chaos tests, schema operator workflow
tests, and CLI machine-contract tests. The highest-level contract
tests were less precise than the code paths they exercise.

Replaces dynamic fixture and helper annotations with concrete
`Path`, `pytest.MonkeyPatch`, `Source`, `JSONDocument`,
`sqlite3.Connection`, and workflow-specific type aliases / protocols.
Where JSON mutation was previously path-dependent through nested
dynamic dictionaries, rebuilds the typed JSON payload explicitly.
Gives health-repair database helpers concrete SQLite connection
types. Types integration fixtures, JSON payloads, CLI
machine-contract decoding, and schema patch context managers.

Touched: `test_chronology_extremes.py`, `test_cli_machine_contract.py`,
`test_facade.py`, `test_health.py`, `test_schema_operator_workflow.py`,
`test_workflows.py`.

Verification: ruff + mypy + pytest over the touched integration
tests; devtools verify green.

Ref #281
Sinity added a commit that referenced this pull request Apr 22, 2026
Integration tests still used explicit `Any` annotations across
health repair workflows, facade ingestion flows, end-to-end
workflow tests, timestamp chaos tests, schema operator workflow
tests, and CLI machine-contract tests. The highest-level contract
tests were less precise than the code paths they exercise.

Replaces dynamic fixture and helper annotations with concrete
`Path`, `pytest.MonkeyPatch`, `Source`, `JSONDocument`,
`sqlite3.Connection`, and workflow-specific type aliases / protocols.
Where JSON mutation was previously path-dependent through nested
dynamic dictionaries, rebuilds the typed JSON payload explicitly.
Gives health-repair database helpers concrete SQLite connection
types. Types integration fixtures, JSON payloads, CLI
machine-contract decoding, and schema patch context managers.

Touched: `test_chronology_extremes.py`, `test_cli_machine_contract.py`,
`test_facade.py`, `test_health.py`, `test_schema_operator_workflow.py`,
`test_workflows.py`.

Verification: ruff + mypy + pytest over the touched integration
tests; devtools verify green.

Ref #281
Sinity added a commit that referenced this pull request Apr 22, 2026
Integration tests still used explicit `Any` annotations across
health repair workflows, facade ingestion flows, end-to-end
workflow tests, timestamp chaos tests, schema operator workflow
tests, and CLI machine-contract tests. The highest-level contract
tests were less precise than the code paths they exercise.

Replaces dynamic fixture and helper annotations with concrete
`Path`, `pytest.MonkeyPatch`, `Source`, `JSONDocument`,
`sqlite3.Connection`, and workflow-specific type aliases / protocols.
Where JSON mutation was previously path-dependent through nested
dynamic dictionaries, rebuilds the typed JSON payload explicitly.
Gives health-repair database helpers concrete SQLite connection
types. Types integration fixtures, JSON payloads, CLI
machine-contract decoding, and schema patch context managers.

Touched: `test_chronology_extremes.py`, `test_cli_machine_contract.py`,
`test_facade.py`, `test_health.py`, `test_schema_operator_workflow.py`,
`test_workflows.py`.

Verification: ruff + mypy + pytest over the touched integration
tests; devtools verify 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. Bravo.

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

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants