Skip to content

security: reject timeout-policy subclasses on the current policy stack - #220

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

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

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

Reconstruct the unique exact EgressTimeoutPolicy type boundary from stale/diverged Draft #158 on the current policy stack without transferring historical merge evidence.

This PR is intentionally stacked on #204 because both lanes modify src/egressweave/policy.py. Serializing them avoids parallel writers and lets the timeout boundary inherit the exact HTTP-method integrity tree rather than racing it.

Exact stack identity

Test-first evidence

The RED-only head added two regressions requiring both public policy constructors to reject an EgressTimeoutPolicy subclass before a later transport can dynamically dispatch an overridden as_httpcore_timeout() implementation.

Hosted CI run 31783324371 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,032 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 EgressTimeoutPolicy dataclass type during trusted EgressPolicy construction;
  • reject subclass-controlled timeout exporters before transport dispatch;
  • preserve exact instances, defaults, normalized authority and method policy, finite resource limits, deterministic evidence, and all public builder signatures;
  • document that applications using subclasses must migrate to exact declarative instances;
  • make no claim to sandbox arbitrary trusted Python code executing in the host process.

Exact-head verification

Exact head: b0e9b43d4b3c8701e8b6af7a93f1e82a0e9030c7

  • CI succeeded on Python 3.10, 3.11, 3.12, 3.13, and 3.14.
  • Python 3.14.6 lane: 1,035 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 security: reconstruct exact HTTP method strings on protected main #204 integration and retargeting to protected main.

Merge contract

Keep Draft behind #204. Historical #158 checks, reviews, base identity, and mergeability are not acceptance evidence for this branch. Do not merge until:

  1. security: reconstruct exact HTTP method strings on protected main #204 is integrated on an accepted protected tree;
  2. this PR 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 review findings are addressed and threads resolved;
  5. independent approvals satisfy protected-branch policy; and
  6. exact head/base/ancestry are revalidated immediately before merge.

Progresses #113. Supersedes #158 only after dependent #182 is safely retargeted to this replacement and #158 is closed as historical predecessor.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e707795-3242-4658-ab1f-3342836b7e19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 b0e9b43d4b3c8701e8b6af7a93f1e82a0e9030c7, including the hosted RED failure on a460ca5927c19ae593d70e508e7829dd772252ec, the minimal exact-type GREEN change, migration documentation, and current 100% statement/branch coverage.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Please perform a fresh exact-head semantic review of b0e9b43d4b3c8701e8b6af7a93f1e82a0e9030c7. Validate the RED→GREEN lineage, exact-type threat model, compatibility/migration documentation, and the stacked-base merge contract. Submit a formal current-head verdict; do not treat the successful CI wrapper as a substitute for review.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 6 minutes and 1 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review

Please independently review exact head b0e9b43d4b3c8701e8b6af7a93f1e82a0e9030c7 after a qualifying current-head OpenCode verdict. Confirm the exact-type restriction is proportionate, documented, and does not regress the public exact-instance policy path.

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