Skip to content

test: type pipeline contracts - #291

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

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

Conversation

@Sinity

@Sinity Sinity commented Apr 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • remove explicit dynamic typing from tests/unit/pipeline
  • replace loose test doubles with concrete repository, backend, parsing, validation, and payload types
  • keep pipeline behavior covered by the existing focused tests

Problem

The ongoing refactor campaign is shrinking typed-test debt by eliminating explicit Any from test areas that exercise core archive behavior. tests/unit/pipeline still had broad dynamic annotations around stage services, ingestion fakes, validation stubs, and synthetic payload helpers, which weakened the value of strict mypy coverage.

Ref #281

Solution

Typed the pipeline test contracts directly against production-facing models where practical: ConversationRepository, SQLiteBackend, ParsingService, RunResult, TransformResult, ValidationResult, RawConversationRecord, and typed synthetic payload aliases. The remaining fake objects are narrow casts to the production classes they stand in for, rather than Any escapes.

Verification

  • ruff check --fix tests/unit/pipeline
  • ruff format tests/unit/pipeline
  • mypy tests/unit/pipeline
  • pytest -q tests/unit/pipeline
  • devtools verify --quick
  • push hook reran devtools verify --quick with repo-local PATH and passed

@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 42 minutes and 17 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 42 minutes and 17 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: e773bc3b-f83a-4a6e-8582-07593be49073

📥 Commits

Reviewing files that changed from the base of the PR and between b82e640 and a309ee7.

📒 Files selected for processing (10)
  • tests/unit/pipeline/test_differential_paths.py
  • tests/unit/pipeline/test_ingest_batch.py
  • tests/unit/pipeline/test_ingestion_chaos.py
  • tests/unit/pipeline/test_observers.py
  • tests/unit/pipeline/test_prepare.py
  • tests/unit/pipeline/test_prepare_records.py
  • tests/unit/pipeline/test_render_service.py
  • tests/unit/pipeline/test_roundtrip_hydration_laws.py
  • tests/unit/pipeline/test_stage_independence.py
  • tests/unit/pipeline/test_watch.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/pipeline-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 be4f830 into master Apr 21, 2026
13 checks passed
@Sinity
Sinity deleted the feature/refactor/pipeline-test-contracts branch April 21, 2026 11:36
Sinity added a commit that referenced this pull request Apr 22, 2026
## Summary
- remove explicit dynamic typing from `tests/unit/pipeline`
- replace loose test doubles with concrete repository, backend, parsing, validation, and payload types
- keep pipeline behavior covered by the existing focused tests

## Problem
The ongoing refactor campaign is shrinking typed-test debt by eliminating explicit `Any` from test areas that exercise core archive behavior. `tests/unit/pipeline` still had broad dynamic annotations around stage services, ingestion fakes, validation stubs, and synthetic payload helpers, which weakened the value of strict mypy coverage.

Ref #281

## Solution
Typed the pipeline test contracts directly against production-facing models where practical: `ConversationRepository`, `SQLiteBackend`, `ParsingService`, `RunResult`, `TransformResult`, `ValidationResult`, `RawConversationRecord`, and typed synthetic payload aliases. The remaining fake objects are narrow casts to the production classes they stand in for, rather than `Any` escapes.

## Verification
- `ruff check --fix tests/unit/pipeline`
- `ruff format tests/unit/pipeline`
- `mypy tests/unit/pipeline`
- `pytest -q tests/unit/pipeline`
- `devtools verify --quick`
- push hook reran `devtools verify --quick` with repo-local `PATH` and passed
Sinity added a commit that referenced this pull request Apr 22, 2026
`tests/unit/pipeline` still had broad dynamic annotations around
stage services, ingestion fakes, validation stubs, and synthetic
payload helpers, which weakened the value of strict mypy coverage.

Removes explicit dynamic typing from `tests/unit/pipeline`.
Replaces loose test doubles with concrete production-facing models
where practical: `ConversationRepository`, `SQLiteBackend`,
`ParsingService`, `RunResult`, `TransformResult`, `ValidationResult`,
`RawConversationRecord`, and typed synthetic payload aliases. The
remaining fake objects are narrow casts to the production classes
they stand in for, rather than `Any` escapes.

Verification: ruff + mypy + pytest over `tests/unit/pipeline`;
devtools verify --quick green.

Ref #281
Sinity added a commit that referenced this pull request Apr 22, 2026
`tests/unit/pipeline` still had broad dynamic annotations around
stage services, ingestion fakes, validation stubs, and synthetic
payload helpers, which weakened the value of strict mypy coverage.

Removes explicit dynamic typing from `tests/unit/pipeline`.
Replaces loose test doubles with concrete production-facing models
where practical: `ConversationRepository`, `SQLiteBackend`,
`ParsingService`, `RunResult`, `TransformResult`, `ValidationResult`,
`RawConversationRecord`, and typed synthetic payload aliases. The
remaining fake objects are narrow casts to the production classes
they stand in for, rather than `Any` escapes.

Verification: ruff + mypy + pytest over `tests/unit/pipeline`;
devtools verify --quick green.

Ref #281
Sinity added a commit that referenced this pull request Apr 22, 2026
`tests/unit/pipeline` still had broad dynamic annotations around
stage services, ingestion fakes, validation stubs, and synthetic
payload helpers, which weakened the value of strict mypy coverage.

Removes explicit dynamic typing from `tests/unit/pipeline`.
Replaces loose test doubles with concrete production-facing models
where practical: `ConversationRepository`, `SQLiteBackend`,
`ParsingService`, `RunResult`, `TransformResult`, `ValidationResult`,
`RawConversationRecord`, and typed synthetic payload aliases. The
remaining fake objects are narrow casts to the production classes
they stand in for, rather than `Any` escapes.

Verification: ruff + mypy + pytest over `tests/unit/pipeline`;
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. Swish!

ℹ️ 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 review from Copilot and removed request for Copilot May 1, 2026 01:52
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