Skip to content

[Self-Improve] signalpilot/improvements-round-2026-04-03-a37d8b#62

Open
kiwi0401 wants to merge 35 commits intostagingfrom
signalpilot/improvements-round-2026-04-03-a37d8b
Open

[Self-Improve] signalpilot/improvements-round-2026-04-03-a37d8b#62
kiwi0401 wants to merge 35 commits intostagingfrom
signalpilot/improvements-round-2026-04-03-a37d8b

Conversation

@kiwi0401
Copy link
Copy Markdown
Member

@kiwi0401 kiwi0401 commented Apr 3, 2026

Self-Improvement Run

Branch: signalpilot/improvements-round-2026-04-03-a37d8b
Run ID: ab192759-83c0-4265-bf34-17f636174fa7

This PR was created by the self-improvement agent.
Review all changes carefully before merging to staging.


Generated by Self-Improve Framework

Self-Improve Bot and others added 30 commits April 3, 2026 14:59
Add both a standalone shell installer (install.sh) and a Python-based
`sp install` command that provide a beautiful, Vercel-inspired setup
experience for SignalPilot.

The installer handles:
- Platform detection (macOS, Linux, WSL2)
- Docker Desktop detection with guided installation prompts
- Docker Compose v2 plugin verification
- Git availability check
- Port availability scanning (3200, 3300, 3400, 3401, 5600)
- Interactive .env configuration with masked secret display
- Docker Compose build orchestration with progress indicators
- Service health monitoring after startup

Terminal UX follows the SignalPilot aesthetic: monochrome palette,
clean box-drawing, generous whitespace, subtle spinners, and
typography-driven layout. Credentials are written with chmod 600.

Includes 62 tests covering platform checks, Docker detection, port
scanning, UI rendering, and spinner lifecycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ification

Elevate the terminal experience to match the SignalPilot aesthetic:

- Add step counters to all section headers (e.g. "Dependencies [2/6]")
  so users always know where they are in the flow
- Show elapsed build times per service (e.g. "built 12s") instead of
  generic "waiting" indicators — signals engineering quality
- Add a Verifying section that hits health endpoints after startup,
  displaying HTTP status codes and response times (e.g. "200 OK (23ms)")
  to prove services actually work, not just started
- Update README Quick Start to feature the installer as the primary
  setup path with flag documentation
- Add 15 new tests covering Timer, step counters, verify_endpoint,
  and verify_postgres (77 total, all passing)

Both shell and Python installers have feature parity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a diagnostic command that checks the full SignalPilot stack health:

- System: Docker, Docker Compose, Git versions and daemon status
- Configuration: .env existence, file permissions (flags world-readable),
  required keys set with real values (detects placeholder patterns)
- Containers: expected services running via docker compose ps,
  detects restart loops
- Endpoints: HTTP health checks with response times for gateway and web
- Resources: Docker disk usage summary

Prints a clean summary showing pass/fail count and numbered fix
suggestions for any issues found.

Includes 17 new tests (94 total, all passing) covering DiagResult
accumulator, per-section check functions, and integration smoke tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace 741 lines of duplicated shell logic with a 115-line bootstrap
that delegates to the canonical Python installer (`sp install`).

The shell script now does exactly three things:
1. Checks for Python 3.12+ (with platform-specific install guidance)
2. Creates a temporary venv and installs the gateway package
3. Execs `sp install` with all flags forwarded

This eliminates the drift risk flagged by the reviewer — all installer
logic (dependency checks, Docker guidance, build orchestration, health
verification) lives in one place: the Python installer module.

Also adds:
- SP_NO_COLOR=1 env var support in ui.py (the --no-color flag sets
  this before delegating, and the Python UI respects it)
- Auto-clone: when `sp install` runs outside a repo, it clones
  SignalPilot to ~/.signalpilot before proceeding

All 94 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces a layered configuration system that merges defaults from
config/config.yml → ~/.signalpilot/config.yml → .signalpilot/config.yml
→ SP_* environment variables. The installer now reads ports from config
instead of hardcoded values. `sp config` shows resolved values with
source annotations so users can trace where each setting comes from.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract shared _parse_env_overrides helper to eliminate duplicated
  env var logic between load_config and resolve_with_sources
- Wire config-driven ports into _start_services, _verify_services,
  and the final banner so custom ports actually take effect
- Show YAML parse warnings on stderr instead of silent fallback
- Expand sensitive field masking in sp config (password, token, secret, api_key)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…gress

- install.sh detects piped stdin and auto-enables --non-interactive
- sp install --non-interactive skips all prompts, exits cleanly when
  Docker is missing instead of blocking on input
- _configure_env copies .env.example with chmod 600 in non-interactive mode
- Build progress now shows [n/total] prefix per service with elapsed time
  (e.g. [2/4] gateway ✓ built 14s)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify that non-interactive mode:
- Copies .env.example with chmod 600 without calling input()
- Exits with code 1 when Docker is not installed (no prompt)
- Exits with code 1 when Docker daemon is not running (no prompt)
- Skips env config when .env already exists

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use mktemp -d instead of predictable /tmp/sp-install-venv-$$ path
- Check pip install exit code instead of silently swallowing failures
- chmod 600 .env immediately after copy (no window of world-readable)
- Fix test input mock to accept zero args (lambda *a vs lambda _)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The 1207-line monolith was growing unwieldy. Split by module under test:
- test_installer_checks.py (42 tests)
- test_installer_ui.py (33 tests)
- test_installer_config.py (17 tests)
- test_installer_install.py (11 tests)
- test_installer_doctor.py (15 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shift from centered text to left-aligned typography in both the header
and completion banner — matches the Stripe/Vercel aesthetic of intentional
whitespace rather than symmetrical centering.

- Add reusable ui.box() helper for bordered content blocks
- Header now shows github.com/SignalPilot-Labs URL
- Completion banner uses structured box with service URLs
- Shell header updated to match Python layout
- 7 new tests for box rendering and layout alignment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds comprehensive reliability tests for the full install flow:

Happy path (7 tests): exercises run_install() end-to-end with all
system calls mocked at boundaries. Verifies completion banner, box
rendering, service URLs, next steps, .env creation, all 6 sections,
and dependency check reporting.

Failure paths (6 tests): git not found, port conflict, compose file
missing, build failure, docker missing, docker not running — all
assert SystemExit(1).

Edge case (1 test): _configure_env with missing .env.example in
non-interactive mode prints helpful hint without creating .env.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Health checks now show [n/total] progress counters with elapsed timers,
matching the build step's visual pattern. Each service shows its port
and timing on completion, or a clear timeout message on failure.

Add sp uninstall command that runs docker compose down -v with spinner
and elapsed time feedback. Same monochrome aesthetic as the rest of
the installer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify successful teardown shows confirmation with timing, and
compose-down failure exits with code 1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Every ui.fail() + sys.exit(1) now includes an actionable ui.hint()
telling the user what to do next. Specific improvements:
- Clone failure: distinguish network vs auth errors
- Docker Compose missing: point to Docker Desktop reinstall
- Compose file missing: suggest re-clone or run from repo root
- Build failure: tell user to fix errors and re-run
- Uninstall timeout: provide manual docker compose command
- Uninstall compose missing: same re-clone hint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When enabled, prints the full docker compose commands being executed
and shows stdout from captured compose operations. Useful for
debugging build failures and slow service startup without needing
to re-run commands manually.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ency

Paths with spaces are now properly quoted in verbose output.
Converted string concatenation to f-string for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add meets_min_version() and _parse_version() to checks.py with
  minimum version constants for Docker (24.0), Compose (2.20), Git (2.30)
- Wire version checks into install flow — old versions now fail with
  clear "requires X+" messages instead of silently proceeding
- Fix install.sh Python version check: 4.x with minor < 12 was rejected
- Fix --no-color flag: parse flags before setting ANSI variables
- Add --verbose/-v propagation from install.sh to sp install
- Handle venv creation failure with actionable error message
- Guard cursor escape codes behind TTY check
- Add 18 new tests for version parsing and comparison (157 total)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use positional parameters (set --) instead of unquoted $SP_FLAGS
  in install.sh to prevent word-splitting and glob expansion
- Fix _parse_version to extract leading integers from each segment
  so versions like "24.0.0-ubuntu" parse correctly as (24, 0, 0)
- Handle empty/None inputs explicitly with (0,) fallback
- Strengthen test assertions to be precise instead of ambiguous

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Doctor now checks Docker/Compose/Git against minimum version constants
  and reports specific "requires X+" messages when versions are too old
- Endpoint checks use config cascade for ports instead of hardcoded 3200/3300
- Update tests to pass config dict to _check_endpoints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Doctor now checks Docker socket accessibility and reports permission
  issues with fix suggestions (add to docker group / chmod)
- New 'sp version' command shows CLI version, OS, Docker, Compose,
  Git, and Python versions in clean tabular output
- Doctor endpoint checks use config cascade for ports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents spinner residue (◒ characters) from appearing in piped
output, CI logs, and non-interactive installs. The spinner thread
only starts when stdout is a TTY.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds an overall timer that starts at the beginning of install and
displays "completed in Xs" in the final success box, giving users
a sense of the total install duration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Doctor now checks all required ports (3200, 3300, 3400, 3401, 5600)
and reports which process owns a conflicting port. Ports owned by
Docker are treated as expected (container already running). Includes
fix suggestions pointing users to stop the process or change config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sp ps — quick view of running SignalPilot containers
sp logs — view container logs with --follow/-f and --tail/-n options

These save users from remembering docker compose file paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- sp ps and sp logs now propagate subprocess exit codes
- Move subprocess import to module level in cli.py
- Docker process detection uses substring match instead of brittle
  exact string matching (handles com.docker.backend, etc.)
- Spinner stop() no longer writes \r in non-TTY environments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Quick way to restart all or specific SignalPilot containers
without remembering docker compose file paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Self-Improve Bot and others added 5 commits April 3, 2026 15:59
Replace generic docs link with sp doctor and add a command cheatsheet
line showing sp ps, logs, restart, and config for discoverability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests that verbose mode completes successfully and that old Docker
(20.10) and old Compose (1.29) versions correctly exit with code 1.
Total installer tests: 165.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
run_doctor() now returns the failure count. The CLI propagates this
as exit code 1 for scripting and CI integration (e.g. sp doctor && deploy).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Security: Token values written to .env are now double-quoted with
escaped backslashes and quotes. Prevents silent truncation when a
token contains # or other shell-special characters.

Cleanup: Remove unreachable condition in _find_repo_root (second
branch was identical to first). Remove unused docker system df
--format json call in _check_resources (was dead code).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant