Repository navigation
refactor: renew run and acquisition boundary contracts - #254
Conversation
|
Warning Rate limit exceeded
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 51 minutes and 24 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (27)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
c7085ef to
fe0fcc8
Compare
## Summary - tighten run/acquisition telemetry and stage payloads around explicit JSON and TypedDict contracts - carry those contracts through source assembly sidecars and the affected pipeline/source tests - keep the slice stacked on the schema/lib payload-boundary renewal ## Problem The run and acquisition flow still relied on loosely shaped dictionaries and ad hoc payload coercion at key boundaries. Stage observations, run-state payload emission, sidecar enrichment, and a chunk of the downstream tests were all depending on inferred `dict[str, object]` shapes rather than stable typed contracts, which left the code path-dependent and brittle at both runtime and verification time. ## Solution - add `polylogue/pipeline/payload_types.py` and thread its typed payload contracts through run execution, finalization, acquisition, parsing, ingest batching, source acquisition, and the run CLI - tighten `run_state`, `metrics`, and stage outcome models so emitted run payloads and observation summaries are explicit JSON-shaped values instead of generic dict/cast plumbing - replace loose source sidecar maps with typed Claude Code and Codex sidecar contracts, then align the pipeline/source tests with the new observation and run-json helpers ## Verification - `ruff check polylogue/pipeline/payload_types.py polylogue/pipeline/stage_models.py polylogue/pipeline/services/parsing_models.py polylogue/lib/metrics.py polylogue/pipeline/run_support.py polylogue/pipeline/run_finalization.py polylogue/pipeline/run_stages.py polylogue/pipeline/run_execution.py polylogue/pipeline/services/acquisition.py polylogue/pipeline/services/acquisition_streams.py polylogue/pipeline/services/parsing_workflow.py polylogue/pipeline/services/ingest_batch.py polylogue/sources/source_acquisition.py polylogue/cli/run_workflow.py polylogue/cli/commands/run.py` - `mypy polylogue/pipeline/payload_types.py polylogue/pipeline/stage_models.py polylogue/pipeline/services/parsing_models.py polylogue/lib/metrics.py polylogue/pipeline/run_support.py polylogue/pipeline/run_finalization.py polylogue/pipeline/run_stages.py polylogue/pipeline/run_execution.py polylogue/pipeline/services/acquisition.py polylogue/pipeline/services/acquisition_streams.py polylogue/pipeline/services/parsing_workflow.py polylogue/pipeline/services/ingest_batch.py polylogue/sources/source_acquisition.py polylogue/cli/run_workflow.py polylogue/cli/commands/run.py` - `ruff check polylogue/pipeline/services/__init__.py polylogue/pipeline/services/acquisition_records.py polylogue/sources/assembly.py polylogue/sources/assembly_claude_code.py polylogue/sources/assembly_codex.py polylogue/sources/cursor.py polylogue/sources/source_walk.py tests/unit/pipeline/test_parsing_service.py tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_assembly.py tests/unit/sources/test_source_laws.py` - `mypy polylogue/pipeline/services/__init__.py polylogue/pipeline/services/acquisition_records.py polylogue/sources/assembly.py polylogue/sources/assembly_claude_code.py polylogue/sources/assembly_codex.py polylogue/sources/cursor.py polylogue/sources/source_walk.py tests/unit/pipeline/test_parsing_service.py tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_assembly.py tests/unit/sources/test_source_laws.py` - `pytest -q tests/unit/pipeline/test_parsing_service.py tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_assembly.py tests/unit/sources/test_source_laws.py tests/unit/devtools/test_pipeline_probe.py` - `devtools verify` Ref #252
The run and acquisition flow still relied on loosely shaped dictionaries and ad hoc payload coercion at key boundaries. Stage observations, run-state payload emission, sidecar enrichment, and a chunk of the downstream tests were all depending on inferred `dict[str, object]` shapes rather than stable typed contracts, leaving the code path-dependent and brittle at runtime and verification time. Adds `pipeline/payload_types.py` and threads typed payload contracts through run execution, finalization, acquisition, parsing, ingest batching, source acquisition, and the run CLI. Tightens `run_state`, `metrics`, and stage outcome models so emitted run payloads and observation summaries are explicit JSON-shaped values instead of generic dict/cast plumbing. Replaces loose source sidecar maps with typed Claude Code and Codex sidecar contracts, then aligns the pipeline/source tests with the new observation and run-json helpers. Stacked on the schema/lib payload-boundary renewal (#253). Verification: ruff + mypy over pipeline/run/acquisition/source modules; pytest over parsing, run-sources, assembly, source-laws, and probe suites; devtools verify green. Ref #252
The run and acquisition flow still relied on loosely shaped dictionaries and ad hoc payload coercion at key boundaries. Stage observations, run-state payload emission, sidecar enrichment, and a chunk of the downstream tests were all depending on inferred `dict[str, object]` shapes rather than stable typed contracts, leaving the code path-dependent and brittle at runtime and verification time. Adds `pipeline/payload_types.py` and threads typed payload contracts through run execution, finalization, acquisition, parsing, ingest batching, source acquisition, and the run CLI. Tightens `run_state`, `metrics`, and stage outcome models so emitted run payloads and observation summaries are explicit JSON-shaped values instead of generic dict/cast plumbing. Replaces loose source sidecar maps with typed Claude Code and Codex sidecar contracts, then aligns the pipeline/source tests with the new observation and run-json helpers. Stacked on the schema/lib payload-boundary renewal (#253). Verification: ruff + mypy over pipeline/run/acquisition/source modules; pytest over parsing, run-sources, assembly, source-laws, and probe suites; devtools verify green. Ref #252
The run and acquisition flow still relied on loosely shaped dictionaries and ad hoc payload coercion at key boundaries. Stage observations, run-state payload emission, sidecar enrichment, and a chunk of the downstream tests were all depending on inferred `dict[str, object]` shapes rather than stable typed contracts, leaving the code path-dependent and brittle at runtime and verification time. Adds `pipeline/payload_types.py` and threads typed payload contracts through run execution, finalization, acquisition, parsing, ingest batching, source acquisition, and the run CLI. Tightens `run_state`, `metrics`, and stage outcome models so emitted run payloads and observation summaries are explicit JSON-shaped values instead of generic dict/cast plumbing. Replaces loose source sidecar maps with typed Claude Code and Codex sidecar contracts, then aligns the pipeline/source tests with the new observation and run-json helpers. Stacked on the schema/lib payload-boundary renewal (#253). Verification: ruff + mypy over pipeline/run/acquisition/source modules; pytest over parsing, run-sources, assembly, source-laws, and probe suites; devtools verify green. Ref #252
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Problem
The run and acquisition flow still relied on loosely shaped dictionaries and ad hoc payload coercion at key boundaries. Stage observations, run-state payload emission, sidecar enrichment, and a chunk of the downstream tests were all depending on inferred
dict[str, object]shapes rather than stable typed contracts, which left the code path-dependent and brittle at both runtime and verification time.Solution
polylogue/pipeline/payload_types.pyand thread its typed payload contracts through run execution, finalization, acquisition, parsing, ingest batching, source acquisition, and the run CLIrun_state,metrics, and stage outcome models so emitted run payloads and observation summaries are explicit JSON-shaped values instead of generic dict/cast plumbingVerification
ruff check polylogue/pipeline/payload_types.py polylogue/pipeline/stage_models.py polylogue/pipeline/services/parsing_models.py polylogue/lib/metrics.py polylogue/pipeline/run_support.py polylogue/pipeline/run_finalization.py polylogue/pipeline/run_stages.py polylogue/pipeline/run_execution.py polylogue/pipeline/services/acquisition.py polylogue/pipeline/services/acquisition_streams.py polylogue/pipeline/services/parsing_workflow.py polylogue/pipeline/services/ingest_batch.py polylogue/sources/source_acquisition.py polylogue/cli/run_workflow.py polylogue/cli/commands/run.pymypy polylogue/pipeline/payload_types.py polylogue/pipeline/stage_models.py polylogue/pipeline/services/parsing_models.py polylogue/lib/metrics.py polylogue/pipeline/run_support.py polylogue/pipeline/run_finalization.py polylogue/pipeline/run_stages.py polylogue/pipeline/run_execution.py polylogue/pipeline/services/acquisition.py polylogue/pipeline/services/acquisition_streams.py polylogue/pipeline/services/parsing_workflow.py polylogue/pipeline/services/ingest_batch.py polylogue/sources/source_acquisition.py polylogue/cli/run_workflow.py polylogue/cli/commands/run.pyruff check polylogue/pipeline/services/__init__.py polylogue/pipeline/services/acquisition_records.py polylogue/sources/assembly.py polylogue/sources/assembly_claude_code.py polylogue/sources/assembly_codex.py polylogue/sources/cursor.py polylogue/sources/source_walk.py tests/unit/pipeline/test_parsing_service.py tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_assembly.py tests/unit/sources/test_source_laws.pymypy polylogue/pipeline/services/__init__.py polylogue/pipeline/services/acquisition_records.py polylogue/sources/assembly.py polylogue/sources/assembly_claude_code.py polylogue/sources/assembly_codex.py polylogue/sources/cursor.py polylogue/sources/source_walk.py tests/unit/pipeline/test_parsing_service.py tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_assembly.py tests/unit/sources/test_source_laws.pypytest -q tests/unit/pipeline/test_parsing_service.py tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_assembly.py tests/unit/sources/test_source_laws.py tests/unit/devtools/test_pipeline_probe.pydevtools verifyRef #252