Repository navigation
v0.2.0: The Polymorphic Update
Summary
This release transitions the Protostar CLI from a procedural, flat-argument script into a fully decoupled, polymorphic architecture. We’ve enforced a strict "manifest-first, side-effects-last" design philosophy. The execution phase is now entirely declarative, preventing I/O side-effects from mutating the global state before the orchestrator is ready to build.
Less time fighting boilerplate, more time actually running the data analysis pipelines.
🚀 Major Highlights
Core Architecture: O(1) Dispatch & Declarative State
We’ve completely rewritten the internal dependency injection and routing mechanisms.
- Modular Subcommands:
argparsenamespace saturation is gone. We've moved to a standardgit-style subcommand architecture (proto init,proto generate). - TargetGenerator ABC: Imperative scaffolding functions have been modularized into the
generators/package. The orchestrator now uses an O(1) dynamic dictionary dispatch to evaluate targets rather than rigidif/elifblocks. - Manifest State Separation: The overloaded
ignored_pathsattribute inEnvironmentManifestis dead. It’s been split intovcs_ignores(for.gitignore) andworkspace_hides(for IDE visualization), stopping version control and IDE settings from clobbering each other. - Cascading Configs: Added an immutable merge cascade for workspace-specific
.protostar.tomloverrides. You can now override global presets locally without destroying unmentioned keys.
Domain-Specific Pipeline Presets
We've migrated the rigid --scientific flag out of the cli.py monkey-patch and into a dedicated PresetModule registry, bringing three new specialized environments with it:
--astro: Built for observational and theoretical pipelines. Drops inastropyandgwpy, and scaffoldsdata/fits/structures. It's perfectly tuned for crunching final-year thesis data at UVic without having to reinvent the directory wheel.--dsp: Scaffolds audio analysis and signal processing pipelines (librosa,mido,data/raw_audio). Ideal for dissecting frequencies when building out mixing tools for the next DnB or garage set.--embedded: Preps host-side hardware telemetry (pyserial,esptool).--scientific: Now automatically generates a standard analytical tree (data/,notebooks/,src/) and aggressively.gitignores massive binary formats (*.csv,*.parquet,*.nc).
The Generator Engine (proto generate)
The new generate subcommand handles domain-specific boilerplate independently of the global orchestrator lifecycle, ensuring CLI atomicity.
- Hardware & IoT (
circuitpython,pio): PlatformIO targets now infer architecture strings natively. The CircuitPython generator drops a non-blockingtime.monotonic()state machine by default. This avoids standardtime.sleep()bottlenecks when soldering up sensors or custom event lighting rigs. - C++ (
cmake,cpp-class): Thecmakegenerator statically scans the local directory via Python to write.cppfilenames directly into theadd_executabledirective, officially bypassing the CMake globbing cache anti-pattern. - LaTeX (
tex): Generates modular.textemplates with dynamically cascading preambles (science macros, biblatex) based on your active preset.
🔧 The Fine Print (QoL, Tooling, & Chores)
- Rich TUI & Help System: Replaced the ugly
argparsetext wrap with a responsiverich.table.TableTUI. Executingproto help generatenow dynamically reads registry docstrings and prints a clean, rounded-box grid that respects terminal width. - POSIX
pipFallback: Added apython_package_managerconfig option. Ifuvisn't available, Protostar falls back to standard POSIXpip, dynamically generating.venvandrequirements.txtstates. - Docker Context Optimization: The new
--dockerflag dynamically merges your manifest'svcs_ignoreswith standard daemon context bloat to generate an optimized.dockerignore. - POSIX Short Flags: Added single-character shorthands (
-pfor--python,-rfor--rust) for better terminal ergonomics. - Global XDG Config:
proto configautomatically resolves~/.config/protostar/config.tomland spawns a subprocess to open it in$EDITOR. - Strict Typing & Linting: Enforced Google-style docstrings across the codebase via
ruff'sDruleset and added explicit return types to squash allmypyviolations. - Documentation: Shipped a formal
CONTRIBUTING.mdenforcing the sandboxed disk I/O testing mandates.