Skip to content

v0.5.0: AST-Aware Configuration, Collision Safety, & Rich CLI Overhaul

Choose a tag to compare

@JacksonFergusonDev JacksonFergusonDev released this 06 Mar 23:25
· 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 a MERGE, OVERWRITE, or ABORT strategy.
  • Strict Headless Boundaries: In non-interactive environments (such as CI/CD pipelines), Protostar now strictly defaults to ABORT to prevent silent data loss. This safety boundary can be explicitly bypassed using the new -f / --force flag.
  • Target File Guards: Addressed silent overwrite vulnerabilities. Pre-existing requirements.txt files are now guarded against pip freeze steamrolling, and IDE settings injection safely aborts if VS Code settings.json contains 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 tomllib to 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 ProtostarConfig engine was rewritten using dynamic dataclasses.fields evaluation 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 --astro preset was tightened to focus on core optical and spectral reduction (photutils, specutils). The --scientific preset traded domain-biased modules for foundational numerical and statistical libraries (scikit-learn).
  • New Topology Presets: Added --ml for deep learning workflows (configured to strictly ignore heavy serialized weights and telemetry bloat), --api for REST backends, and --cli for terminal applications.

💄 Rich CLI & Performance Telemetry

  • Render-Time Lazy Evaluation: Migrated to rich-argparse to output bordered, highly readable subcommand matrices. To protect the sub-3ms fast-path execution latency, rich components are heavily decoupled using LazyTargetHelp and GenerateEpilogTable proxies, deferring string interpolation and AST evaluation until the exact moment of rendering.
  • Automated Benchmarking: Deployed a pytest-benchmark suite to GitHub Pages to track fast-path and TUI execution latency, empirically validating Protostar's sub-50ms performance budget and generating dynamic latency-badge.json endpoints.
  • Codecov & Renovate: Integrated Codecov for strict branch coverage tracking (decoupled from the fast local make test execution loop) and configured Renovate with a 2-week age gate for low-noise, batched dependency updates.