# Behavior traces — python-poetry/poetry

> Canonical page: https://codevetter.com/unpack/poetry/behavior-traces

# Behavior traces — python-poetry/poetry

Scanned commit d4fd21e4711ae948f04e18a1736d9ee85b590e87 (2026-09-27). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The source walks cover startup/project initialization, dependency installation, and add/lock persistence from command input to output. Startup establishes options and plugins before command-event setup injects the environment and installer. Installation branches on lock existence, freshness, and re-resolution before executing operations and optionally installing the root. Persistence follows explicit success and dry-run conditions, with separate refresh and regeneration paths.
- Startup: main → Application().run → _run → _configure_global_options → working-directory context → _load_plugins → Cleo dispatch; project plugin paths are added before application entry points load and activate. — [src/poetry/console/application.py#L255-L268](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/application.py#L255-L268) [src/poetry/console/application.py#L630-L651](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/application.py#L630-L651) [src/poetry/plugins/plugin_manager.py#L54-L86](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/plugins/plugin_manager.py#L54-L86)
- Project initialization: Application.poetry → Factory.create_poetry → _ensure_valid_poetry_version → BaseFactory.create_poetry → Locker/Config construction → create_pool → optional generic plugin activation. — [src/poetry/console/application.py#L201-L214](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/application.py#L201-L214) [src/poetry/factory.py#L66-L110](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/factory.py#L66-L110) [src/poetry/factory.py#L123-L147](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/factory.py#L123-L147)
- Command setup: COMMAND listeners run configure_env → EnvManager.create_venv → command.set_env, then configure_installer_for_event → configure_installer_for_command → Installer → command.set_installer; existing injected objects are retained. — [src/poetry/console/application.py#L136-L140](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/application.py#L136-L140) [src/poetry/console/application.py#L563-L628](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/application.py#L563-L628)
- Install selection: InstallCommand.handle ensures project plugins unless disabled, validates incompatible options, configures extras/groups/dry-run/synchronization, then calls Installer.run; missing locks force update, while stale existing locks raise an error. — [src/poetry/console/commands/install.py#L109-L174](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/commands/install.py#L109-L174) [src/poetry/installation/installer.py#L101-L113](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/installation/installer.py#L101-L113) [src/poetry/installation/installer.py#L264-L278](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/installation/installer.py#L264-L278)
- Fresh resolution: Installer._do_install → Solver.solve → Solver._solve → resolve_version → VersionSolver.solve, whose loop propagates incompatibilities and chooses package versions; Solver then aggregates transitive metadata. — [src/poetry/installation/installer.py#L239-L253](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/installation/installer.py#L239-L253) [src/poetry/puzzle/solver.py#L175-L197](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/puzzle/solver.py#L175-L197) [src/poetry/mixology/__init__.py#L15-L18](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/mixology/__init__.py#L15-L18) [src/poetry/mixology/version_solver.py#L187-L204](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/mixology/version_solver.py#L187-L204)
- Installation output: Transaction.calculate_operations → Installer._execute → Executor.execute → source-specific _install → WheelInstaller.install; after dependency success, InstallCommand calls EditableBuilder.build unless no-root, non-package mode, or dry-run applies. — [src/poetry/installation/installer.py#L341-L380](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/installation/installer.py#L341-L380) [src/poetry/installation/executor.py#L585-L624](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/installation/executor.py#L585-L624) [src/poetry/console/commands/install.py#L174-L204](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/commands/install.py#L174-L204) [src/poetry/masonry/builders/editable.py#L53-L82](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/masonry/builders/editable.py#L53-L82)
- Add persistence: AddCommand.handle reads TOML → determines requirements → Factory.create_dependency → package.add_dependency → Locker.set_pyproject_data → installer update/whitelist/run; dependency success permits lock writing, then successful non-dry add writes pyproject.toml. — [src/poetry/console/commands/add.py#L150-L153](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/commands/add.py#L150-L153) [src/poetry/console/commands/add.py#L231-L242](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/commands/add.py#L231-L242) [src/poetry/console/commands/add.py#L310-L327](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/commands/add.py#L310-L327) [src/poetry/console/commands/add.py#L396-L415](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/commands/add.py#L396-L415)
- Lock persistence: LockCommand.handle → Installer.lock disables operations → run; an existing non-regenerated lock enters _do_refresh and re-solves directory dependencies, otherwise update resolution writes through _write_lock_file → Locker.set_lock_data → _write_lock_data. — [src/poetry/console/commands/lock.py#L41-L44](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/console/commands/lock.py#L41-L44) [src/poetry/installation/installer.py#L155-L163](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/installation/installer.py#L155-L163) [src/poetry/installation/installer.py#L184-L214](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/installation/installer.py#L184-L214) [src/poetry/packages/locker.py#L201-L209](https://github.com/python-poetry/poetry/blob/d4fd21e4711ae948f04e18a1736d9ee85b590e87/src/poetry/packages/locker.py#L201-L209)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
