mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Adds crates/python-bridge/src/architecture.rs, a source-scan test in the spirit of workspace_crate_allowlist.rs: layering rules that currently live only in AGENTS.md become executable. Rules on production code (text before each file's trailing #[cfg(test)] module): - GIL attach/detach and block_on appear in python-bridge only in execution.rs; scattered interpreter calls are how GIL-ordering deadlocks and per-handoff contention creep in. - Tokio runtime construction appears only in execution.rs and the #[pymodule] init site in lib.rs; one shared runtime per process. - SendWrapper is banned in both PyO3 crates; it converts !Send Python values into cross-thread panics on Tokio workers. - python-interop stays domain-neutral and never blocks on futures or builds runtimes. Deletes the dead routes/runtime.rs: an undeclared byte-for-byte duplicate of execution.rs whose Python::attach/block_on usage would violate the new boundary (also deleted independently in #39577; both sides delete the same file, so the merge is trivial). AGENTS.md gains the enforcement note, mirroring the crate-allowlist convention. |
||
|---|---|---|
| .. | ||
| ai-gateway | ||
| CODING_STANDARDS | ||
| core | ||
| python-bridge | ||
| python-interop | ||