Skip to content

v0.3.0: Late-Binding Architecture & Deterministic Inception

Choose a tag to compare

@JacksonFergusonDev JacksonFergusonDev released this 01 Mar 02:45
· 755 commits to main since this release

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 BootstrapModule subclasses. They evaluate their activation state contextually and drop their specific configuration payloads and cache ignores into the EnvironmentManifest.
  • Dynamic Pre-Commit Generation: Introduced the --pre-commit flag. Instead of hardcoding a monolithic YAML file, language and tooling modules blindly push their specific pre-commit hooks to the manifest. The new PreCommitModule acts as a gatekeeper, concatenating the payloads and executing git init and pre-commit install during the serialization phase.
  • Token Interpolation: The Orchestrator now features an _append_files() phase that evaluates late-binding tokens. For example, it extracts the requires-python string from pyproject.toml to 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 init now runs with --bare and --python-pin, completely preventing the generation of deletable boilerplate like hello.py or default README.md files, while dropping a .python-version pin into the workspace.
  • Explicit Versioning: You can now explicitly define the target Python version via the --python-version CLI flag or globally in config.toml.
  • Dynamic Docker Context: To prevent container-side interpreter resolution conflicts, the orchestrator now dynamically evaluates the system_tasks queue. If uv init was used, it automatically appends the host-bound .python-version file 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 --direnv flag (or global config toggle) auto-generates a .envrc file, dynamically routing between uv sync or python3 -m venv depending on your global configuration.
  • Fail Loud: Enforces a strict pre-flight check, hard-aborting the scaffolding process if the direnv binary is missing from your $PATH.
  • Generalized File Injections: Hardcoded _write_envrc methods were refactored out in favor of a new file_injections dictionary in the EnvironmentManifest, 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 using uv add --dev (while retaining a unified fallback for pip install + pip freeze).
  • Contextual Subprocess Errors: Upgraded run_quiet() in the system layer to catch and parse specific uv subprocess failures. If uv fails due to restrictive global config rules (e.g., python-downloads = "never"), it now raises a highly contextual RuntimeError instead of an ambiguous non-zero exit code.
  • Config Inversions: Added support for toggles like no-ruff to cleanly opt-out of default scaffolding behaviors.
  • Testing: Expanded pytest coverage using pytest-mock to verify config merging, CLI flag dispatching, regex extraction, and deterministic side-effect generation without polluting the host disk.