Repository navigation
v0.5.0: AST-Aware Configuration, Collision Safety, & Rich CLI Overhaul
·
732 commits
to main
since this release
Summary
This release fundamentally rebuilds Protostar's state evaluation engine to guarantee safe, idempotent execution—especially critical when scaffolding tooling into existing Python data analysis pipelines or complex project topologies. By migrating to a fully AST-aware TOML pipeline and introducing interactive collision mitigation, v0.5.0 ensures existing scripts and workspace configurations remain uncorrupted. The CLI has also been entirely redesigned with rich, utilizing lazy-evaluation proxies to maintain sub-3ms initialization latency.
🛡️ Non-Destructive Collision Safety
- Interactive TUI Intercept: Before executing Phase 4 disk I/O, the orchestrator evaluates the workspace against module-specific
collision_markers. If a conflict is detected, execution pauses to prompt for aMERGE,OVERWRITE, orABORTstrategy. - Strict Headless Boundaries: In non-interactive environments (such as CI/CD pipelines), Protostar now strictly defaults to
ABORTto prevent silent data loss. This safety boundary can be explicitly bypassed using the new-f/--forceflag. - Target File Guards: Addressed silent overwrite vulnerabilities. Pre-existing
requirements.txtfiles are now guarded againstpip freezesteamrolling, and IDE settings injection safely aborts if VS Codesettings.jsoncontains JSONC (comments) that the standard library cannot parse.
⚙️ AST-Exclusive Configuration Engine
- Semantic TOML Merging: Legacy heuristic string-appending has been replaced with
tomlkit. Injected configurations are deeply merged directly into the Abstract Syntax Tree (AST), preserving existing formatting, comments, and non-colliding leaf tables (e.g., updating[tool.ruff]without nuking sibling[tool.mypy]blocks). - Pre-Execution Validation: The orchestrator now utilizes the C-optimized
tomllibto validate the syntax of existing workspace files before mutations begin, preventing environment fragmentation caused by attempting to merge into malformed target files. - Advanced Global Overrides: The
ProtostarConfigengine was rewritten using dynamicdataclasses.fieldsevaluation to support complex nested overrides. You can now inject raw multi-line TOML payloads ([dev.pyproject]), globally map dev dependencies ([dev]), or completely override specific preset dependencies and directories via~/.config/protostar/config.toml.
🪐 Domain Presets & Astrophysics Refinements
- Refined Astrophysics & Scientific Scaffolding: To better support observational data pipelines, the
--astropreset was tightened to focus on core optical and spectral reduction (photutils,specutils). The--scientificpreset traded domain-biased modules for foundational numerical and statistical libraries (scikit-learn). - New Topology Presets: Added
--mlfor deep learning workflows (configured to strictly ignore heavy serialized weights and telemetry bloat),--apifor REST backends, and--clifor terminal applications.
💄 Rich CLI & Performance Telemetry
- Render-Time Lazy Evaluation: Migrated to
rich-argparseto output bordered, highly readable subcommand matrices. To protect the sub-3ms fast-path execution latency,richcomponents are heavily decoupled usingLazyTargetHelpandGenerateEpilogTableproxies, deferring string interpolation and AST evaluation until the exact moment of rendering. - Automated Benchmarking: Deployed a
pytest-benchmarksuite to GitHub Pages to track fast-path and TUI execution latency, empirically validating Protostar's sub-50ms performance budget and generating dynamiclatency-badge.jsonendpoints. - Codecov & Renovate: Integrated Codecov for strict branch coverage tracking (decoupled from the fast local
make testexecution loop) and configured Renovate with a 2-week age gate for low-noise, batched dependency updates.