From b71a513c367b9d2716ad869fa5b204bd4c34b069 Mon Sep 17 00:00:00 2001 From: nvaldez Date: Wed, 18 Nov 2026 21:13:57 +0100 Subject: [PATCH] daedalus 0.1.0: scriptman spec update ported - categories, new listing format with colors, run_python_script child entry, daedalus_logging, daedalus. namespace imports; SPEC rewritten with stable item numbers Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- AGENTS.md | 40 +- CHANGELOG.md | 27 + INSTALL.md | 39 +- README.md | 14 +- SPEC.md | 600 ++++++++++++++++++----- daedalus/__init__.py | 37 +- daedalus/cli.py | 132 ++++- daedalus/daedalus_logging/__init__.py | 91 ++++ daedalus/registry.py | 53 +- daedalus/run_python_script.py | 62 +++ daedalus/runners.py | 12 +- daedalus/tests/test_cli.py | 202 +++++++- daedalus/tests/test_init.py | 81 +++ daedalus/tests/test_logging.py | 164 +++++++ daedalus/tests/test_packaging.py | 13 +- daedalus/tests/test_registry.py | 77 ++- daedalus/tests/test_run_python_script.py | 126 +++++ daedalus/tests/test_runners.py | 33 +- pyproject.toml | 5 +- 19 files changed, 1606 insertions(+), 202 deletions(-) create mode 100644 daedalus/daedalus_logging/__init__.py create mode 100644 daedalus/run_python_script.py create mode 100644 daedalus/tests/test_init.py create mode 100644 daedalus/tests/test_logging.py create mode 100644 daedalus/tests/test_run_python_script.py diff --git a/AGENTS.md b/AGENTS.md index d1f098f..cf130ee 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,9 +1,9 @@ --- name: daedalus-agent-rules -version: 1.0.0 +version: 1.1.0 type: summary created: 2026-11-11 -updated: 2026-11-11 +updated: 2026-11-18 tags: [agents, rules, scripts, cli] --- @@ -116,7 +116,8 @@ pip install -e . # daedalus command runs the checkout ```text daedalus/ ├── bin/ # Launchers: daedalus (bash), daedalus.bat -├── daedalus/ # CLI package: cli.py, registry.py, runners.py, tests/ +├── daedalus/ # CLI package: cli.py, registry.py, runners.py, +│ # run_python_script.py, daedalus_logging/, tests/ ├── python/ │ ├── src// # One folder per Python script │ └── tests/ # pytest tests for python/src (and .ps1/.bat scripts) @@ -148,6 +149,9 @@ Before writing anything, know: - The type: Python, bash, PowerShell, or batch. Prefer Python when the script must run on both Windows and Linux. - A one-line description for `daedalus --list`. +- The categories the script belongs to. The default is `general`; pick + labels that say where the script fits (`media`, `linux`, ...). A label + may never equal a script name. Ask the user only when the name or the type cannot be inferred. Track the work with this checklist: @@ -157,6 +161,7 @@ work with this checklist: - [ ] Entry added to SCRIPTS in daedalus/registry.py - [ ] README row and usage section - [ ] Tests written and passing +- [ ] daedalus. entry in pyproject.toml (Python scripts) - [ ] version bumped in pyproject.toml - [ ] python autotest.py passes - [ ] daedalus --help works @@ -175,6 +180,7 @@ marked "test". | Name matches `^[a-z][a-z0-9_-]*$` | Registry test | | `path` is repo-relative with forward slashes | Registry test | | `description` is one non-empty line | Registry test | +| `categories` are non-empty labels, none equal to a script name | Registry test | | File suffix has a runner (`.py`, `.sh`, `.ps1`, `.bat`) | Registry test | | A row for the name in the README "Available scripts" table | Registry test | | Own tests for the script's logic | Review, coverage | @@ -185,7 +191,7 @@ marked "test". | Type | Location | Runner | | --- | --- | --- | -| Python | `python/src//.py` | Current Python, `python/src` on `PYTHONPATH` | +| Python | `python/src//.py` | `DAEDALUS_PYTHON` or current Python, via `run_python_script.py` | | bash | `bash/.sh` | `DAEDALUS_BASH`, Git Bash, then `bash` | | PowerShell | `powershell/.ps1` | `pwsh`, then `powershell` | | Batch | `batch/.bat` | `cmd /c`, Windows only | @@ -242,7 +248,13 @@ if __name__ == "__main__": - `prog=""` makes `--help` show the daedalus command name. - Shared helpers go in their own package under `python/src/`; scripts - import them directly because `python/src` is on `PYTHONPATH`. + import them as `daedalus.` (SPEC section 10). The child gets + `REPO_ROOT` on `PYTHONPATH`, so the import works in a checkout and an + install alike. +- Python scripts run through `run_python_script.py` and get the + `daedalus_logging` setup (file `~/.daedalus/debug.log` + stderr, + `DAEDALUS_LOGLEVEL`, `DAEDALUS_NO_LOGGING`) unless they configure + logging themselves. - Standard library only. Lazy `%` logging. Type hints in every docstring. bash template: @@ -290,16 +302,23 @@ sorted: "": Script( path="python/src//.py", description="", + categories="