Skip to content

security: reject connection-pool policy subclasses on the current policy stack - #221

Draft
seonghobae wants to merge 4 commits into
security/reconstruct-timeout-policy-type-on-method-7faffrom
security/reconstruct-connection-pool-type-on-timeout-7faf
Draft

security: reject connection-pool policy subclasses on the current policy stack#221
seonghobae wants to merge 4 commits into
security/reconstruct-timeout-policy-type-on-method-7faffrom
security/reconstruct-connection-pool-type-on-timeout-7faf

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

Reconstruct the unique exact EgressConnectionPoolPolicy type boundary from stale stacked Draft #182 on the current HTTP-method and timeout-policy stack without transferring historical acceptance evidence.

This PR is intentionally stacked on #220 because all three lanes modify src/egressweave/policy.py. Serializing them avoids parallel writers and preserves a reviewable policy-hardening dependency order.

Exact stack identity

Test-first evidence

The RED-only head added two regressions requiring both public policy constructors to reject an EgressConnectionPoolPolicy subclass before later dynamic attribute dispatch can replace the finite pool capacities that were reviewed and fingerprinted.

Hosted CI run 31784137903 failed on every Python 3.10–3.14 lane exactly because both new tests reported DID NOT RAISE TypeError; the Python 3.14 lane otherwise had 1,035 passing tests.

The minimal GREEN change replaces the subclass-accepting isinstance(...) check with an exact-type boundary. Follow-up commits document the pre-1.0 compatibility narrowing and add a documentation contract requiring the threat and migration path to remain explicit.

Implemented boundary

  • require the exact built-in EgressConnectionPoolPolicy dataclass type during trusted policy construction;
  • reject subclass-controlled later attribute dispatch before transport pool construction;
  • preserve exact instances, defaults, normalized authority/method/timeout policy, finite resource limits, deterministic evidence, and all public builder signatures;
  • document that integrations needing different capacities must construct an exact instance with supported finite fields;
  • make no claim to sandbox arbitrary trusted Python code executing in the host process.

Exact-head verification

Exact head: f97084256922f7085b94096f6c20e4a613fac738

  • CI succeeded on Python 3.10, 3.11, 3.12, 3.13, and 3.14.
  • Python 3.14.7 lane: 1,038 tests passed.
  • Production coverage: 1,762 / 1,762 statements and 590 / 590 branches (100%).
  • Ruff, compileall, hourly product guard self-test, wheel/sdist build, archive verification, and installed-wheel smoke test succeeded.
  • Full SAST and Security Scan workflows did not run for this stacked non-default-base PR; they remain mandatory after predecessor integration and retargeting to protected main.

Merge contract

Keep Draft behind #220 and #204. Historical #182 checks, reviews, base identity, and mergeability are not acceptance evidence. Do not merge until:

  1. security: reconstruct exact HTTP method strings on protected main #204 and security: reject timeout-policy subclasses on the current policy stack #220 are integrated on an accepted protected tree;
  2. this delta is retargeted/reconstructed on that exact tree without transferring historical evidence;
  3. full current-head CI, SAST, substantive Dependency Review, Strix, and other required checks pass;
  4. all current-head findings are addressed and review threads resolved;
  5. independent approvals satisfy protected-branch policy; and
  6. exact head/base/ancestry are revalidated immediately before merge.

Progresses #113. Supersedes #182 after the exact-count successor is reconstructed on this head and historical dependent PRs no longer require the old branch.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 78 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b825a18-d1ac-45ad-83fc-96af553eb093

📥 Commits

Reviewing files that changed from the base of the PR and between b0e9b43 and f970842.

📒 Files selected for processing (4)
  • docs/research/connection-pool-resource-limits.md
  • src/egressweave/policy.py
  • tests/test_connection_pool_policy_type_boundary.py
  • tests/test_connection_pool_policy_type_documentation.py

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head f97084256922f7085b94096f6c20e4a613fac738, including hosted RED run 31784137903, the minimal exact-type GREEN change, migration documentation, and current 100% production statement/branch coverage.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Please perform a fresh exact-head semantic review of f97084256922f7085b94096f6c20e4a613fac738. Validate the RED→GREEN lineage, subclass dispatch threat, exact-instance compatibility, migration guidance, and stacked-base merge contract. Submit a formal current-head verdict.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Please independently review exact head f97084256922f7085b94096f6c20e4a613fac738 after a qualifying current-head OpenCode verdict. Confirm the exact-type restriction is proportionate and preserves the supported exact-instance configuration path.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

@seonghobae I will review exact head f97084256922f7085b94096f6c20e4a613fac738. I will assess the requested RED-to-GREEN evidence, exact-type boundary, documentation, coverage claims, and stacked-base merge contract.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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