Repository navigation
v0.9.0: The Agent Interface, Declarative Templates, and Headless Architecture
🚀 Highlights
Protostar v0.9.0 is a massive structural metamorphosis. Built on the foundation of over 100 merged pull requests, this release dismantles the monolithic execution pipeline in favor of a strictly decoupled, headless scaffolding engine.
We have completely purged hardcoded Python preset modules, transitioning to a deterministic, AST-aware TOML templating ecosystem. With the introduction of the new Machine Interface (--json), a zero-latency static hook registry, and a rigorous filesystem security sandbox, Protostar is now built to be driven by both humans and AI coding agents.
✨ What's New
📄 Declarative TOML Templates & Portable Scaffolding
Python-based PresetModule definitions are dead. Protostar now uses 100% valid, JSON Schema-validated .toml blueprints for all environment scaffolding.
- Semantic AST Merging: Replaced brittle string templating with
tomlkit-powered AST deep merging. Protostar preserves your existingpyproject.tomlcomments and formatting while deterministically sorting tables and injecting visual headers. - The
[appends]API: A generalized, extension-aware injection engine that safely injects hash-delimited marker blocks into any file (Python, Rust, HTML, JS) without corrupting syntax. - Dual-Mode Resolution: The
--fromflag now accepts remote repository URLs. Protostar natively translates web UI links for GitHub, GitLab, Bitbucket, Codeberg, and Sourcehut, securely extracting.zipand.tar.gzpayloads on the fly. - Global Alias Registry: Register your organization's remote templates in
~/.config/protostar/config.tomlunder[templates]to invoke them anywhere via--template <alias>.
🤖 The Machine & Agent Interface
Protostar is now fully navigable by automated scripts, CI pipelines, and LLM coding agents.
- Strict
stdoutPurity: Passing the position-independent--jsonflag reservesstdoutexclusively for machine-readable JSON payloads. All human-readable logging, tracebacks, and spinners are routed tostderr. - Deterministic Simulation: The new
--dry-runflag executes the pureplan()phase, returning a serializedEnvironmentManifest(in JSON mode) or a dashboard summary (in Human mode) detailing exact disk mutations and dependency resolution without touching the disk. - Schema Exports: The
export-schemasubcommand dynamically generates the JSON Schema for TOML templates, enabling real-time linting in editors like VS Code.
🧱 The Engine Bulkhead
The engine has been cleaved into two mathematically distinct phases: plan() and execute().
- Headless Planning: The
plan()phase is now mathematically pure and side-effect free. It aggregates theEnvironmentManifestdomain slices (Dependencies, Filesystem, Tooling, Tasks) without invoking subprocesses or mutating disk state. - Stateful Execution: The
SystemExecutorwas dismantled from a 1,400-line monolith into seven highly cohesive, single-responsibility modules (e.g.,security.py,toml_ast.py,workflows.py). - Interactive Decoupling: All UI components (
questionary,rich) have been strictly isolated to the CLI presentation layer, preventing the engine from hanging on unexpected interactive prompts in CI.
⚡️ Zero-Latency Static Hook Registry
The slow pre-commit autoupdate network penalty has been eliminated.
- Hook revisions are now resolved via a Fastly-backed asynchronous static JSON registry.
- Hook resolution latency has dropped from several seconds to roughly ~50ms.
- Includes a hardcoded offline fallback dictionary to guarantee zero downtime in air-gapped environments.
🛡️ Security, Error Handling & Resilience
- The Remote Trust Dialog: Executing untrusted external templates containing shell tasks triggers an informed-consent security prompt. External templates registered via your global alias registry bypass this automatically.
- Filesystem Sandbox: Implemented strict Zip/Tar Slip protection during archive extraction and a Path Jail guardrail preventing templates from writing outside the target workspace.
- POSIX-Compliant Telemetry: Domain exceptions (
ConfigurationError,NetworkFetchError, etc.) now map directly to standard UNIX exit codes (e.g.,EX_CONFIG/78,EX_TEMPFAIL/75) and emit deep-linked documentation URLs in the terminal. - Graceful Interrupts: Hitting
Ctrl+Cmid-execution now raises aPartialExecutionAbortedErrorthat renders a precise ledger of which files were modified before the interrupt occurred.
🧰 Expanded Tooling Matrix
The scaffolding matrix has been drastically upgraded for modern Python development.
rumdlDefault: Replaced Node-basedmarkdownlint-cli2withrumdlas the default, hyper-fast Rust-based Markdown linter.- Docker Multi-Stage: The
--dockerflag now generates a hardened, multi-stageDockerfiletailored to the project type (API, Typer CLI, or package) alongside.dockerignore. - New Integrations: Added native scaffolding modules for
commitizen, Astral'sty, Meta'spyrefly,renovate,codecov, andreadthedocs. - Local Toolchain Hooks: Python-based pre-commit hooks (
ruff,mypy) now execute locally viauv run repo: local, eliminating redundant virtual environments and version drift.
💥 Breaking Changes
- Python Presets are Dead: The legacy
--astro,--api, and--clipreset flags have been removed. Use--template <name>instead. - Force Flags Split: The ambiguous
--forceflag has been removed. You must now explicitly declare intent using--force-mergeor--force-replace. - Global Config Updates: The
active_presetsarray is no longer valid inconfig.tomlorprotostar.toml. - Variable Interpolation Syntax: Load-time configuration variables now use the
<% VAR %>syntax instead of{{ VAR }}to disambiguate from late-binding execution tokens. - Python Baseline: The default target Python version has been bumped to
3.13.