  # Changelog

  All notable changes to this project will be documented in this file.

  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- **Traffic monitor ("who's hammering you")**: Overseer's Backend modal gains a
  **Traffic** tab showing top source IPs by request volume over a rolling
  window, flagging any single source that dominates traffic (read-time
  dominance check). A `TrafficMiddleware` tallies requests per client IP
  (proxy-aware via `get_client_ip`), backed by Redis when the component is
  present (shared across the webserver/scheduler/worker processes, survives a
  restart for the bucket TTL) and an in-memory store otherwise (per-process,
  resets on restart) — the same Redis-or-dict fallback `CacheService` uses, so
  the live panel works with or without Redis. Recording is fire-and-forget so
  it never adds latency to the request path. Admin-gated `GET
  /api/v1/traffic/sources` (open on auth-less stacks, matching `/health/`).
  Tunable via `TRAFFIC_MONITOR_ENABLED`, `TRAFFIC_WINDOW_HOURS`,
  `TRAFFIC_DOMINANCE_SHARE`, `TRAFFIC_DOMINANCE_FLOOR`.

### Changed

- **Rolling deploy no longer depends on `docker-rollout`**: `aegis deploy
  --rolling` now rolls the webserver in-process, starting a second replica
  and polling its container HEALTHCHECK status (`healthy`/`unhealthy`/
  `starting`) instead of shelling out to the `docker-rollout` plugin. The
  container's own HEALTHCHECK budget (`start_period + retries x interval`)
  is the single source of truth, so a slow-but-healthy boot is never rolled
  back by a wall clock, and no extra tooling needs to be installed on the
  deploy host. `--rollout-timeout` is now only a long runaway-guard ceiling.

## [0.8.0] - 2026-06-15

### Added

- **Guided `aegis init`**: a full-screen, interactive setup is now the default
  for `aegis init`, walking through components and services with a live review
  screen before generating. `--quick` keeps the classic one-line prompts, and
  tiny terminals fall back to quick mode automatically. `--no-interactive` is
  unchanged.
- **`tasks statistics` CLI command**: report overall scheduler statistics
  (total, active, and paused tasks) straight from the project CLI, mirroring the
  data behind the admin-gated `/scheduler/statistics` endpoint.
- **Authenticated load testing**: `api-load-test run` now authenticates by
  default so auth-gated routes work without manual login. `--as-admin` mints a
  bearer token for an `ADMIN_USER_EMAILS` address, `--as-user` for a regular
  account, and `--anon` opts out.
- **`HF_TOKEN` setting**: authenticates the RAG embedding-model download from the
  Hugging Face Hub, silencing the unauthenticated-request warning and raising
  rate limits. Optional; public models still download without it.

### Changed

- **CLI brand pass**: warnings are now amber (`#F5A623`, matching the frontend)
  instead of violet; status icons are monochrome text glyphs (`✓ ⚠ ✗ ℹ`) colored
  by state instead of emoji, so they align to the terminal grid and render
  consistently everywhere; the load-test report is themed (teal progress bar,
  dim labels).
- **Quiet RAG model load**: the embedding model now loads without progress bars
  or log noise in CLI output.

### Fixed

- **gpt-5 family and o-series models in AI chat**: these reject any non-default
  `temperature` and returned a 400; temperature is now omitted for them so the
  streaming chat works.
- **`llm` CLI commands now run**: `list`, `current`, `use`, and `info` were
  declared `async def`, which Typer never awaits, so they exited without doing
  anything; they now execute correctly.
- **Deprecation warning** in the AI chat streaming path (`result.usage()` is a
  property in pydantic-ai 1.x, no longer a method).

### Documentation

- **Installation guide clarity**: explain what `uvx` is and that it ships with
  uv, distinguish `uvx` (ephemeral run) from `uv tool install` (persistent
  install), and correct the uvx version note (latest on first run, cached
  thereafter; `uvx aegis-stack@latest` to refresh). The CLI language section now
  lists all 9 supported locales (`en`, `de`, `es`, `fr`, `ja`, `ko`, `ru`, `zh`,
  `zh_Hant`) in a table instead of only Simplified Chinese.

## [0.7.0] - 2026-06-08

### Added

- **Rolling deploys**: zero-downtime, code-only `aegis deploy --rolling`. The
  webserver rolls over while still serving traffic and the worker queue is
  paused so in-flight jobs drain cleanly before workers restart.
- **Free-port auto-discovery for `make serve`**: picks an open host port instead
  of failing with "address already in use" when the default is taken.
- **CI/CD scaffolding in generated projects**: a GitHub Actions deploy workflow
  generated out of the box.
- **Scheduler**: run a scheduled job on demand from the project CLI, plus
  scheduler fixes.
- **Payment service**: Stripe-backed payment capability, with end-to-end tests.
- **Performance middleware** in generated projects.

### Changed

- **`aegis update` is now idempotent**: after a clean update it advances the
  copier baseline (`_commit` / `_template_version`) so a re-run is a no-op and
  future updates don't re-apply changes that are already present.
- `aegis update --to-version` accepts both PEP 440 (`0.7.0`) and tag (`v0.7.0`)
  forms.
- Dependency: typer bumped to 0.26.7.

### Fixed

- Rolling deploy no longer rolls back a slow-but-healthy webserver: the
  docker-rollout wait is sized to the container's own healthcheck budget
  (`-t`), not a fixed 60s wall clock.
- `make serve` port detection no longer reports a busy port as free under load
  (a timed-out probe is treated as in-use, not free).

---

## [0.4.0] - 2025-12-07

### Added

#### TaskIQ Worker Backend
- Alternative worker backend using TaskIQ: `uvx aegis-stack init my-app --components "worker[taskiq]"`
- Full feature parity with arq backend
- TaskIQ-specific pool management, registry, and queue implementations
- Load testing support for TaskIQ workers
- Health monitoring integration for TaskIQ

### Fixed

- Windows compatibility: Removed Jinja2 conditional syntax from template filenames
  - Files with `{% if %}` in names caused OS Error 123 on Windows
  - Affected: `tasks.py` and `scheduler.py` in Cookiecutter templates

### Changed

- Release workflow now creates draft releases with auto-generated notes

---

## [0.3.4] - 2025-12-03

### Changed

- Docker build optimization: only build image for one service instead of all

---

## [0.3.3] - 2025-12-03

### Changed

- Version bump and dependency updates

---

## [0.3.2] - 2025-12-03

### Changed

- Version updates

---

## [0.3.1] - 2025-12-03

### Fixed

- Fixed `make serve` command by refactoring magic string handling

---

  ## [0.3.0] - 2025-12-01

### Major Features

#### Dashboard V2 - Complete UI Overhaul
- Light and dark theme support with system preference detection
- Component modal system - detailed info panels for each component:
  - Scheduler modal: Job stats, task history, next run times, cron expressions
  - Worker modal: Queue depth, job history, worker health, Redis connection
  - Redis modal: Memory usage, connection stats, key counts
  - Database modal: Table stats, connection pool info, query metrics
  - Backend modal: Route inspection, middleware detection, request stats
  - AI modal: Provider status, model info, conversation history
  - Auth modal: User count, session stats, JWT configuration
  - Frontend modal: Component tree, render stats, routing info
- Modern card-based architecture with improved visual hierarchy
- Enhanced health check visualization

#### New CLI Features
- `aegis update` rollback support - automatically restore on failed updates
- `--template-path` flag - use local template directories for development
- `--verbose` flag - control output verbosity across all commands
- Improved error messages with actionable suggestions for generation failures

#### Comms Service (New Service Layer)
- Communication service foundation for inter-component messaging
- Event-driven architecture support
- Service discovery patterns

### Added

- Copier integration testing for template validation
- CI/CD parallelization for faster builds
- Commit badges in generated project READMEs
- Scheduler environment variable configuration
- Enhanced Overseer documentation

### Fixed

- `aegis update` now correctly targets HEAD instead of latest tag
- Template path handling with `git+file://` URL format for Copier
- Dashboard rendering edge cases with component state

---

## [0.2.1] - 2025-11-10

### Fixed

- Minor bug fixes and stability improvements
- Added verbosity flag foundation

---

## [0.2.0] - 2025-11-05

### Major Features

  #### Dynamic Component Management
  - **NEW**: `aegis add` command - Add components to existing projects post-generation
  - **NEW**: `aegis remove` command - Remove components from existing projects
  - **NEW**: `aegis update` command - Update projects with latest template changes
  - **NEW**: Copier template engine support with version tracking
  - Projects can now evolve after creation (Copier-based projects only)
  - Intelligent dependency resolution (e.g., worker auto-adds Redis, auth auto-adds database)
  - File-level component management without full project regeneration
  - Automatic dependency installation and code formatting after changes

  #### Services Architecture (Business Logic Layer)
  - **NEW**: Authentication Service (`--services auth`)
    - JWT-based authentication with access and refresh tokens
    - User registration, login, and profile management
    - Password hashing with bcrypt
    - Protected API routes with FastAPI dependency injection
    - Database migrations via Alembic
    - User management CLI commands (`create-user`, `list-users`, `delete-user`, etc.)
    - Comprehensive test suite with 52+ authentication tests
    - Automatically includes database component

  - **NEW**: AI Service (`--services ai`)
    - PydanticAI integration for type-safe AI interactions
    - Multi-provider support (OpenAI, Anthropic, Gemini, Groq)
    - Streaming chat responses with markdown rendering
    - Conversation memory and persistence to database
    - Interactive CLI chat interface with rich formatting
    - Health monitoring for AI provider connectivity
    - Environment variable configuration
    - API endpoints for chat operations

  #### Enhanced Scheduler Component
  - **NEW**: SQLite-backed persistence option (`--scheduler-backend sqlite`)
  - Automatic database backup jobs when scheduler + database combined
  - Task monitoring API endpoints
  - Interactive CLI for viewing and managing scheduled tasks
  - Enhanced health checks with task execution tracking
  - Job statistics and history

### Added

  #### CLI Commands
  - `aegis add` - Add components to existing projects
  - `aegis remove` - Remove components from projects
  - `aegis update` - Update projects with latest templates
  - `aegis services` - List available services
  - `aegis components` - Show detailed component information
  - `aegis version` - Display CLI version
  - Template engine selection via `--engine` flag (copier or cookiecutter)
  - Interactive service selection during project creation
  - Component backend selection (e.g., `--scheduler-backend sqlite`)

  #### Developer Experience
  - **uvx support** - Run without installation (`uvx aegis-stack init my-project`)
  - Enhanced dashboard with component and service health cards:
    - Auth service card (user count, health status, database connection)
    - AI service card (provider status, model info, conversation stats)
    - Scheduler card (job stats, task history, next run times)
    - Worker card (queue stats, job history, worker health)
    - FastAPI card (route inspection, middleware detection)
    - Database card (table stats, connection pool info)
    - Redis card (memory usage, connection statistics)
  - Load testing CLI with visual progress indicators
  - FastAPI middleware and route inspection utilities
  - Rich terminal formatting for AI chat (markdown, code blocks, tables)
  - Comprehensive CLI tools for component management

  #### Testing & Quality
  - Migrated from mypy to `ty` for faster type checking
  - Extensive test coverage for auth service (52+ tests)
  - Extensive test coverage for AI service
  - Template parity tests (Cookiecutter vs Copier output validation)
  - Component addition/removal integration tests
  - Auth integration tests (registration, login, JWT flows, protected routes)
  - AI conversation persistence tests
  - Middleware and route inspection tests
  - Extended test matrix for component combinations
  - Clean validation workflow for template testing

  #### Documentation
  - Complete auth service documentation (API reference, CLI commands, integration guide, examples)
  - Complete AI service documentation (provider setup, API reference, CLI commands, integration)
  - Services architecture guide and dashboard integration docs
  - "Evolving Your Stack" guide - post-generation component management philosophy
  - Scheduler persistence and CLI documentation
  - Enhanced installation guide (uvx, uv tool, pip methods)
  - Integration patterns documentation
  - Component-specific CLAUDE.md files for AI development context
  - Release process documentation with PyPI/TestPyPI workflow

  #### Infrastructure
  - GitHub Actions workflow for automated PyPI releases
  - TestPyPI pre-flight testing workflow
  - PyPI Trusted Publishing (OIDC, no API tokens)
  - Template versioning and compatibility tracking
  - Copier template infrastructure with `.copier-answers.yml`
  - Post-generation task system refactored
  - Component file management utilities
  - Service dependency resolver
  - Manual updater for Cookiecutter-based projects

### Changed

  - **Default template engine** is now Copier (Cookiecutter still fully supported via `--engine cookiecutter`)
  - Type checker migrated from mypy to `ty` for improved performance
  - Enhanced dashboard UI with modern card-based architecture
  - Improved component dependency resolution logic
  - Better error messages with actionable suggestions
  - Scheduler component refactored with service layer separation
  - Worker health check registration improved
  - Database health checks enhanced with connection pool monitoring
  - Restructured CLI command organization into separate modules
  - Dashboard rendering optimizations

### Fixed

  - Dashboard rendering bugs with component state management
  - Worker type annotations and kwargs handling
  - arq worker info retrieval issues
  - Scheduler component integration edge cases
  - Database card rendering and refactoring issues
  - Redis component card state updates
  - FastAPI middleware detection for edge cases
  - Template generation with various component combinations
  - Health check caching race conditions

### Security

  - JWT-based authentication with secure token handling
  - Password hashing with bcrypt (cost factor 12)
  - Protected API routes with dependency injection patterns
  - Secure user model implementation
  - API key handling for AI providers
  - Environment variable-based secrets management

### Performance

  - Faster type checking with `ty` replacing mypy
  - Optimized component dependency resolution
  - Improved dashboard rendering performance
  - Enhanced health check caching strategies
  - Reduced template generation time

### Statistics

  - 62 pull requests merged since v0.1.0
  - 456 files changed (72,387 insertions, 4,590 deletions)
  - 8 new CLI commands
  - 2 new services (auth, AI)
  - 13+ new documentation files
  - 100+ new test files
  - 10 weeks of development (Aug 28 - Nov 5, 2025)

### Highlights for Users

  1. **Your stack can now evolve** - Add/remove components after project creation
  2. **Authentication ready** - Production JWT auth with one command (`--services auth`)
  3. **AI-ready** - Multi-provider AI integration built-in (`--services ai`)
  4. **No installation needed** - Run with `uvx aegis-stack init my-project`
  5. **Scheduler persistence** - SQLite-backed job storage for reliability
  6. **Enhanced DX** - Rich CLI tools, better dashboard, comprehensive health monitoring

### Notes

  - Copier is now the default template engine, enabling `aegis add/remove/update` commands
  - Both Copier and Cookiecutter templates are fully supported
  - Auth service automatically includes Alembic for database migrations
  - AI service supports OpenAI, Anthropic, Gemini, and Groq providers
  - Scheduler persistence requires database component
  - Template version compatibility tracked in `.copier-answers.yml` (Copier projects)
  - Worker component still requires explicit Redis component specification

  ## [0.1.0] - 2025-08-27

  ### Added
  - Initial release of Aegis Stack CLI tool
  - Database component with SQLite/SQLModel ORM integration
  - FastAPI backend with health monitoring system
  - Flet frontend for web and desktop applications
  - Worker component with arq/Redis for background tasks
  - Scheduler component with APScheduler
  - Docker containerization support
  - Comprehensive testing infrastructure with pytest
  - Type checking with mypy and pydantic plugin
  - Auto-formatting with ruff
  - Project generation via `aegis init` command
  - Component dependency resolution system
  - Database health checks with detailed metrics
  - Transaction rollback testing fixtures
  - Template validation system

  ### Fixed
  - Database test isolation issues
  - Type checking for Pydantic models with mypy plugin
  - Template linting issues in generated projects

  ### Components
  - Backend (FastAPI) - Always included
  - Frontend (Flet) - Always included
  - Database (SQLite/SQLModel) - Optional
  - Worker (arq/Redis) - Optional
  - Scheduler (APScheduler) - Optional

[0.4.0]: https://github.com/lbedner/aegis-stack/compare/v0.3.4...v0.4.0
[0.3.4]: https://github.com/lbedner/aegis-stack/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/lbedner/aegis-stack/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/lbedner/aegis-stack/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/lbedner/aegis-stack/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/lbedner/aegis-stack/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/lbedner/aegis-stack/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/lbedner/aegis-stack/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/lbedner/aegis-stack/releases/tag/v0.1.0