Repository navigation
v0.3.0: Late-Binding Architecture & Deterministic Inception
Summary
This release represents a significant architectural shift in how Protostar handles dependency pipelines and configuration scaffolding. The primary focus is decoupling the tooling layer through a new late-binding architecture, alongside enforcing strict interpreter determinism for uv environments.
Major Changes
Late-Binding Tooling Architecture & Pre-commit Integration
The core PythonModule has been stripped of its hardcoded linters and formatters to prevent toolchain leakage across environments. Tooling is now managed via a late-binding payload broadcast strategy.
- Discrete Tooling Modules: Ruff, Mypy, Pytest, and MarkdownLint are now independent
BootstrapModulesubclasses. They evaluate their activation state contextually and drop their specific configuration payloads and cache ignores into theEnvironmentManifest. - Dynamic Pre-Commit Generation: Introduced the
--pre-commitflag. Instead of hardcoding a monolithic YAML file, language and tooling modules blindly push their specific pre-commit hooks to the manifest. The newPreCommitModuleacts as a gatekeeper, concatenating the payloads and executinggit initandpre-commit installduring the serialization phase. - Token Interpolation: The Orchestrator now features an
_append_files()phase that evaluates late-binding tokens. For example, it extracts therequires-pythonstring frompyproject.tomlto replace{{PYTHON_VERSION}}, and dynamically maps all project dependencies into{{MYPY_DEPENDENCIES}}to ensure strict static typing coverage inside the pre-commit hook.
Interpreter Determinism & Optimized uv Scaffolding
Environment initialization is now strictly deterministic to prevent reproducible build failures across host machines or containerized pipelines.
- Zero-Boilerplate Init:
uv initnow runs with--bareand--python-pin, completely preventing the generation of deletable boilerplate likehello.pyor defaultREADME.mdfiles, while dropping a.python-versionpin into the workspace. - Explicit Versioning: You can now explicitly define the target Python version via the
--python-versionCLI flag or globally inconfig.toml. - Dynamic Docker Context: To prevent container-side interpreter resolution conflicts, the orchestrator now dynamically evaluates the
system_tasksqueue. Ifuv initwas used, it automatically appends the host-bound.python-versionfile to the.dockerignore.
direnv Context Boundaries & Manifest Injections
To bypass the friction of manually dropping into subshells or sourcing virtual environments, Protostar now supports automatic shell binding.
- Auto-Scaffolding: The
--direnvflag (or global config toggle) auto-generates a.envrcfile, dynamically routing betweenuv syncorpython3 -m venvdepending on your global configuration. - Fail Loud: Enforces a strict pre-flight check, hard-aborting the scaffolding process if the
direnvbinary is missing from your$PATH. - Generalized File Injections: Hardcoded
_write_envrcmethods were refactored out in favor of a newfile_injectionsdictionary in theEnvironmentManifest, allowing any module to safely queue string payloads mapped to arbitrary file paths.
Minor Changes & Under-the-Hood Fixes
- Dependency Segregation: Added
dev_dependencies: set[str]to the manifest. The orchestrator now natively segregates installations usinguv add --dev(while retaining a unified fallback forpip install+pip freeze). - Contextual Subprocess Errors: Upgraded
run_quiet()in the system layer to catch and parse specificuvsubprocess failures. Ifuvfails due to restrictive global config rules (e.g.,python-downloads = "never"), it now raises a highly contextualRuntimeErrorinstead of an ambiguous non-zero exit code. - Config Inversions: Added support for toggles like
no-ruffto cleanly opt-out of default scaffolding behaviors. - Testing: Expanded
pytestcoverage usingpytest-mockto verify config merging, CLI flag dispatching, regex extraction, and deterministic side-effect generation without polluting the host disk.