Skip to main content

PythonPlugin

Struct PythonPlugin 

Source
pub struct PythonPlugin;
Expand description

Python language plugin (uses ty via uvx)

Trait Implementations§

Source§

impl LanguagePlugin for PythonPlugin

Source§

fn run_command_for_dir(&self, path: &Path) -> String

Detect the package name from pyproject.toml or src layout and return an appropriate run command.

Source§

fn name(&self) -> &str

Name of the language
Source§

fn extensions(&self) -> &[&str]

File extensions this plugin handles
Source§

fn key_files(&self) -> &[&str]

Key files that identify this language (e.g., Cargo.toml, pyproject.toml)
Source§

fn required_binaries(&self) -> Vec<(&str, &str, &str)>

Required host binaries for this plugin, grouped by role. Read more
Source§

fn get_lsp_config(&self) -> LspConfig

Get the LSP configuration for this language
Source§

fn get_init_action(&self, opts: &InitOptions) -> ProjectAction

Get the action to initialize a new project (greenfield)
Source§

fn check_tooling_action(&self, path: &Path) -> ProjectAction

Check if an existing project needs tooling sync (e.g., uv sync, cargo fetch)
Source§

fn init_command(&self, opts: &InitOptions) -> String

Get the command to initialize a new project DEPRECATED: Use get_init_action instead
Source§

fn test_command(&self) -> String

Get the command to run tests
Source§

fn test_command_with_filter(&self, filter: Option<&str>) -> String

The test command narrowed to an already-sanitized name filter. The default ignores the filter; plugins with a native filter form override it. Acceptance gates always use the unfiltered test_command — only interactive run_test calls narrow.
Source§

fn run_command(&self) -> String

Get the command to run the project (for verification)
Source§

fn syntax_check_command(&self) -> Option<String>

Get the syntax/type check command (e.g., cargo check, uvx ty check .) Read more
Source§

fn lint_command(&self) -> Option<String>

Get the lint command (e.g., cargo clippy -- -D warnings) Read more
Source§

fn file_ownership_patterns(&self) -> &[&str]

File glob patterns this plugin owns (e.g., ["*.rs", "Cargo.toml"]) Read more
Source§

fn is_test_file(&self, path: &str) -> bool

Whether an existing file contributes executable test-oracle semantics. The governed candidate runs a second verifier pass with source pre-images restored whenever one of these files is modified.
Source§

fn host_tool_available(&self) -> bool

Check if the host has the required build tools available Read more
Source§

fn format_command(&self) -> Option<String>

The governed formatter command (run_formatter; e.g. cargo fmt).
Source§

fn format_check_command(&self) -> Option<String>

The formatter’s non-mutating check form (e.g. cargo fmt --check), declared as the format verifier stage when present.
Source§

fn lsp_fallback(&self) -> Option<LspConfig>

Get fallback LSP config when primary is unavailable
Source§

fn verifier_profile(&self) -> VerifierProfile

Build a complete verifier profile by probing each capability. Read more
Source§

fn legal_support_files(&self) -> &[&str]

Legal support files that the LLM is allowed to create beyond declared output_files (e.g., Cargo.toml for Rust, __init__.py for Python). Read more
Source§

fn dependency_commands( &self, action: DependencyAction, packages: &[String], dev: bool, ) -> Vec<String>

The command sequence realizing a governed dependency action, or empty when this plugin does not support dependency mutation. Every returned command must itself satisfy dependency_command_policy, and the handler re-checks it (fail closed).
Source§

fn dependency_files(&self) -> Vec<String>

Workspace-relative manifest and lockfile paths a dependency command may mutate — the promotable footprint of mutate_dependencies.
Source§

fn dependency_command_policy(&self, command: &str) -> CommandPolicyDecision

Policy for dependency-management commands emitted by the LLM. Read more
Source§

fn test_file_patterns(&self) -> &[&str]

Glob patterns that identify test files for this language. Read more
Source§

fn detect(&self, path: &Path) -> bool

Detect if this plugin should handle the given project directory
Source§

fn build_command(&self) -> Option<String>

Get the build command (e.g., cargo build, npm run build) Read more
Source§

fn owns_file(&self, path: &str) -> bool

PSP-5 Phase 2: Check if a file path belongs to this plugin’s ownership domain Read more
Source§

fn manifest_mutation_policy( &self, _manifest_path: &str, ) -> ManifestMutationPolicy

Policy for manifest file mutations produced by the LLM. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more