Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.14.2] - 2026-08-28
Changed
- Skills:
zodiac-docsnow auto-activates for version-matched docs, source, and tests when adding or changing ZodiacCore-backed APIs, and when the user asks how to use, migrate, troubleshoot, or verify ZodiacCore behavior. It requires resolving the target version and reading the matching source-map rows before editing code, so agents implement from version-matched documentation instead of memory. - Docs: README, the skills guide, and skill authoring notes now describe
zodiac-docsas a look-up-before-writing-API preflight, and itsagents/openai.yamlUI copy matches that scope.
[0.14.1] - 2026-08-25
Added
- CLI: Add
zodiac skills installandzodiac skills uninstallto link the packaged developer skills into a service project. Defaults to Codex (.agents/skills);--agentselects Claude, Cursor, Copilot, Gemini, or all. Unix creates a directory symlink; Windows creates a directory junction. Packagedzodiac-*skills are gitignored.zodiac newprintsuv run zodiac skills installafteruv sync --extra devand does not auto-install. - Packaging: Ship
zodiac-docsandzodiac-core-integration-summaryin thezodiac-corewheel so installed skills follow the project's locked version instead of a copied tree.
Changed
- Templates: Document
uv run zodiac skills install(Codex by default; pass--agentfor other clients) in generatedAGENTS.mdandREADME.md. - Documentation: Document skill install, uninstall, agent directories, and the
uv syncthenuv runflow in the CLI, getting-started, and skills guides.
Fixed
- CLI: Walk up to
pyproject.tomlso install/uninstall run from a subdirectory still target the service root. Retarget stale packaged-skill links without--force; use--forceonly for copied directories. Preflight copied destinations before install so a conflict cannot leave a partial un-gitignored link. Match gitignore patterns on exact lines.
[0.14.0] - 2026-08-24
Added
- CLI: Add
zodiac checkto AST-scan services that depend onzodiac-corefor high-confidence wiring anti-patterns (FastAPIAPIRouter,HTTPException,partial(get_session), baresession_dependency, raw httpx, layer imports, and bootstrap). Findings are grouped by rule withcontract/change/docsprinted once;--format jsonexposes per-rule counts for tools. Identity is azodiac-coredependency; 3-tier, sub-application, and generic layouts are classified afterwards. Unused FastAPIAPIRouterimports are warnings; constructing FastAPI's router is an error. Publiczodiac_corere-exports ofsetup_loguruandregister_*count as the same bootstrap calls as submodule imports. - Skills:
zodiac-core-integration-summaryrunsuv run zodiac check --format jsonfor mechanical wiring evidence and applies each error rule'schangewhen the user asks to fix those cells. If the installedzodiac-corelackszodiac check, prompt the user to upgrade and addzodiac-core[zodiac]to dev dependencies instead of running the latest CLI fromuvxagainst an older lock. - Templates: Generate
AGENTS.mdforstandard-3tierprojects. Both templates point atuv run zodiac checkas the wiring contract and keep the judgment rules the CLI cannot enforce (thin routers, DI, session ownership, request-derived database names, named resource lifecycle).
Changed
- Templates: Include
zodiac-core[zodiac]in thestandard-3tierdevelopment extra so generated projects can runuv run zodiac check. - CLI: Print
uv run zodiac checkinzodiac newnext steps. - Documentation: Document
zodiac checkin the CLI and getting-started guides. Route adoption audits and wiring-fix loops throughzodiac-core-integration-summary. A green report certifies mechanical wiring, including import-layer anti-patterns, not architecture.
[0.13.0] - 2026-08-07
Added
- Database: Add
session_dependency(name)for FastAPI dependencies that are bound to a named database without exposing the database name as a request parameter. - Routing: Support FastAPI-native synchronous and asynchronous yield streaming, including JSONL, binary streams, SSE, callable objects, and wrapped generator endpoints when supported by the installed FastAPI version.
Changed
- Routing: Infer omitted response models from endpoint return annotations, preserve an untyped Zodiac envelope for unannotated payloads, and leave raw responses and bodyless status codes outside the envelope.
- Cache: Require serializers used with cached
Nonevalues to restoreNonelosslessly and reject incompatible serializers during decorator setup. - Documentation: Define database-session ownership for dependencies, repositories, services, jobs, and mounted sub-applications, and clarify the existing upstream HTTP error translation contract.
Fixed
- Database: Prevent request input and unsafe partial dependencies from overriding server-selected database names while preserving dependency overrides, caching, cleanup, and introspection.
- Cache: Preserve cached
Nonevalues across JSON and other compatible serializer boundaries without leaking the internal sentinel. - Validation: Encode validation errors with FastAPI's native
jsonable_encoderbehavior before placing them in Zodiac's HTTP 422 envelope. - Routing: Avoid invalid response models and runtime wrapping for raw,
Annotated, bodyless, and streaming endpoints across supported FastAPI versions. - Datetimes: Preserve PostgreSQL
timestamptzdefaults in non-UTC sessions and normalize parsed datetime strings to aware UTC values.
[0.12.0] - 2026-07-23
Added
- Cache: Add a keyword-only
leaseoption to@cachedfor overriding the default two-second RedLock lease. - Codex Skills: Add the repository-hosted
zodiac-docsskill for version-aware framework guidance based on matching documentation, source code, tests, and generated templates.
Changed
- Standard Template: Load logging level, JSON format, and service name from application configuration.
- Generated Tests: Add an isolated testing profile with
pytest-env, in-memory SQLite, a test-specific cache prefix, and reduced log output. - Sub-applications: Decouple application services from API schemas by passing validated resource fields from routers.
- Generated Projects: Use
--no-access-login Uvicorn commands to prevent duplicate request logs from Uvicorn and ZodiacCore middleware. - Codex Skills: Document project-level skill installation under
.agents/skills/.
Fixed
- Logging: Preserve supplied exception tracebacks in text and JSON logs, including structured exception metadata and
record.extra.exception_traceback. - Templates: Use receiver-aware cache keys for generated
GitHubServiceinstance methods so equivalent dependency-injection instances share cached results correctly.
[0.11.1] - 2026-07-14
Added
- CLI: Add
zodiac add sub-app NAMEto generate a mountable service and contract tests inside an existingsub-applicationsproject, with configurable resources, automatic regular and irregular pluralization, explicit plural overrides, package detection, and printed wiring instructions. - Templates: Add a reusable parameterized sub-application scaffold with ZodiacCore routing, schemas, dependency injection, SQLModel persistence, pagination, filtering, sorting, and API contract tests.
- Codex Skills: Add the repository-hosted
zodiac-core-integration-summaryskill and installation guidance for auditing ZodiacCore adoption in downstream services.
Changed
- Sub-applications: Generate the built-in
usersandordersexamples from the reusable scaffold and standardize them on a minimal name-based CRUD contract. - Generated Projects: Include
zodiac-core[zodiac]in the development extra and reset shared database state around generated-project tests.
Removed
- Templates: Remove the generated
usersandordersservice metadata endpoints and their cache demonstration code from new sub-application projects.
Fixed
- Scaffolding Safety: Reject unsafe project names and destinations that escape the requested output root through absolute paths, traversal, or symbolic links, preventing
--forcefrom overwriting files outside the project. - Template Rendering: Validate template context strictly, preflight destination conflicts, and restore overwritten or newly created paths after write failures to avoid partial scaffolds.
[0.11.0] - 2026-07-07
Added
- Templates: Add a
sub-applicationsscaffold for a parent FastAPI server with mountedusersandordersservices, shared parent-owned database/cache lifecycle, scoped middleware/logging, exception handlers, and generated contract tests. - CLI: Support
zodiac new PROJECT_NAME --tpl sub-applications -o OUTPUT_DIRfor generating multi-app service projects. - Docs: Add a sub-applications guide for FastAPI mounts, sub-app lifespan handling, process-global logging, shared or named database/cache resources, and shutdown ownership.
- Templates: Include keyword filtering, whitelisted sorting, ZodiacCore schema bases, in-memory testing configuration, and Codex project guidance in the generated sub-applications project.
Changed
- Repositories: Return clearer unsupported-sort errors with the rejected field and supported sort fields in response metadata.
[0.10.0] - 2026-07-02
Added
- Pagination: Add reusable multi-column sorting query models (
SortParams,PageSortParams) andSortSpecfor explicit repository sort whitelists and default ordering. - Repositories: Add validated sorting support to
BaseSQLRepository.paginate(),paginate_query(), andapply_sorting(). - Middleware: Add
exclude_pathssupport to skip noisy HTTP access logs such as health checks.
Changed
- Pagination: Use repeated query parameters such as
?sort=created_at:desc&sort=name:ascfor multi-column sorting. - Repositories: Use
SortSpecas the only repository sorting configuration API. - Templates: Update generated repository, service, router, and middleware setup code to use
PageSortParams, repository-levelSortSpec, and health-check access-log exclusion. - Docs: Document multi-column sorting,
SortSpec, repository sorting helpers, service-name middleware, and access-log path exclusions.
[0.9.1] - 2026-06-02
Added
- HTTP: Log translated upstream HTTP errors with structured context, including service, error type, request method, upstream URL, status code, and capped upstream response body details.
- Exceptions: Include upstream status and response body details in
UpstreamRequestExceptionresponses for upstream HTTP 400/422 failures.
Fixed
- HTTP: Handle
httpx.RequestErrorinstances without request metadata without raising a secondary exception during upstream error translation. - Exception Handlers: Log inbound request context when returning standardized upstream error responses.
- Docs: Document upstream error logging fields and 400/422 response details.
[0.9.0] - 2026-04-29
Added
- HTTP: Add
translate_upstream_errors(service)to converthttpxupstream status and request failures into standardized ZodiacCore exceptions for both async and sync functions. - Exceptions: Add
UpstreamServiceExceptionandUpstreamRequestExceptionfor explicit upstream service failures, including service name and upstream error classification. - Exception Handlers: Register a dedicated upstream exception handler that returns standardized HTTP 400 responses for translated upstream failures.
- Templates: Update the
standard-3tierexternal client example to useZodiacClientwithtranslate_upstream_errors. - Docs: Document upstream error translation, manual upstream business-error mapping, and the new upstream exception types in the exceptions API guide.
- Tests: Add coverage for upstream exception behavior, handler registration, async/sync HTTP translation, and template usage.
[0.8.1] - 2026-04-26
Fixed
- Exceptions: Respect
http_codedeclared on directZodiacExceptionsubclasses when converting them to HTTP responses, while preserving fixed HTTP statuses for built-in exception families.
Changed
- Docs: Clarify the distinction between HTTP status codes and business error codes, including how built-in exception families and direct
ZodiacExceptionsubclasses should be used.
[0.8.0] - 2026-04-14
Added
- CLI:
--package-nameoption forzodiac newcommand to customize the generated Python package name (defaults toapp). - Middleware:
ServiceNameMiddlewarefor scoping service names in request context, allowing per-app log attribution in multi-app deployments. - Context:
service_name_scopeandget_service_namefor managing service-level context inzodiac_core.context. - Logging: Loguru patcher now prefers
service_namefrom context if available, enabling accurate service tagging in shared logging sinks. - Templates:
standard-3tiertemplate now fully supports dynamic package names and includesServiceNameMiddlewareregistration by default. - Tests: Comprehensive multi-app integration tests (
tests/multi_app/dual_full_apps/) using real Uvicorn servers to validate isolation and shared resources.
Changed
- CLI:
zodiac newnow validates package names against Python identifiers and reserved names (main,config,tests). - Middleware:
register_middlewarenow accepts an optionalservice_nameto automatically enableServiceNameMiddleware. - Docs: Documentation updated with
--package-nameusage and architectural details for multi-app setups.
[0.7.0] - 2026-03-31
Added
- Database:
get_session()accepts an optionalnameparameter for multi-database support; defaults to the default database for backward compatibility. - Config:
StrictConfigbase model (extra='forbid',frozen=True) for configuration section Pydantic models — rejects typo keys and prevents mutation after creation. - Utils:
strtobool()as a Python 3.13+ compatible drop-in replacement for the removeddistutils.util.strtobool, returningboolinstead ofint. - Docs: Best practices guide for
dependency-injectorConfiguration (strict mode, required files, type conversion pitfalls, environment variable interpolation). - Docs: API reference page for the
zodiac_core.utilsmodule. - Tests: Integration tests for
dependency-injectorstrict=True+required=True+as_(strtobool)andStrictConfigconstraints;dependency-injectoradded as dev dependency.
Changed
- Template: Generated projects use
providers.Configuration(strict=True)andfrom_ini(path, required=True)for fail-fast configuration loading. - Template: Config models (
DbConfig,CacheConfig) inheritStrictConfiginstead ofBaseModel; type conversion uses Pydantic models viaConfigManagement.provide_config()instead of manualas_()calls. - Docs: All code examples across config, context, architecture, and getting-started guides updated to use
strict=True,required=True, andstrtoboolimports fromzodiac_core.utils.
Fixed
- Config: Replace
as_(bool)/as_=boolwithas_(strtobool)for boolean config values —bool("false")evaluates toTrue, causing silent misconfiguration. - Tests: Force reinstall
zodiac-corein generated project quality test to prevent staleuvcache from masking template breakage.
[0.6.1] - 2026-03-27
Added
- Cache: Optional
include_clsandinclude_selfon@cachedso the default key builder can fold receiver class identity into the key forclassmethods (cls) and instance methods (self), gated by conventional first-parameter names; document thatinclude_selfis class-scoped (not per-instance) and that inheritance changes cache partitioning when enabled. - Tests: Expand
@cachedcoverage for customkey_builder,include_clswith base/derived classes,include_selfsharing across instances of the same class, parent/child class separation, and instance methods that still require an explicitkey_builderwhen receiver-aware keys are omitted.
Changed
- Docs: Add a “Receiver-aware default keys” section to the cache API guide (constraints, warnings, and examples for class vs instance methods).
[0.6.0] - 2026-03-26
Added
- HTTP: Add
init_http_client()as a lifecycle helper for creating and closing a sharedZodiacClientwithin an application or DI resource. - Database: Add scoped shutdown support via
db.shutdown(name="...")so a single named database can be released without disposing all registered engines. - Cache: Add scoped shutdown support via
cache.shutdown(name="...")so a single named cache can be released without clearing all registered caches. - Tests: Add coverage for named database/cache shutdown and for
init_db_resource()cleaning up only its own database name.
Changed
- Database: Make
DatabaseManager.setup()deterministic by allowing repeated setup only for the same effective configuration and raisingRuntimeErrorfor conflicting configuration on an existing name. - Database: Make
init_db_resource()release only the database registered under its ownname, preserving other shared database resources in the same process. - Template: Manage the shared HTTP client as an application resource in the standard 3-tier template and initialize app resources through
AsyncExitStack. - Template: Align generated project configuration loading with
APPLICATION_ENVIRONMENTand default the template fallback environment todevelop. - CLI: Clarify that
zodiac new --forceallows generation into an existing directory without removing unrelated files. - Docs: Update database, cache, config, context, architecture, CLI, and getting-started documentation to reflect the scoped resource lifecycle and template conventions.
Fixed
- Template: Ensure generated projects use resource lifecycle management for shared HTTP clients instead of relying on unmanaged singleton client instances.
[0.5.4] - 2026-03-23
Changed
- Cache: Restrict the default
@cachedkey builder to stable immutable parameters and require an explicitkey_builderfor complex arguments instead of falling back to unstable automatic keys. - Cache: Make
cache.setup(...)deterministic by allowing repeated setup only for identical effective configuration and raisingRuntimeErrorfor conflicting settings. - Docs: Clarify cache setup idempotency rules and document the supported/default key-builder constraints for
@cached.
Fixed
- Cache: Decode the internal cached-
Nonesentinel in publicget()while preserving correctget_or_set()hit detection under lock rechecks. - Cache: Preserve
default_ttlwhen rebuilding aZodiacCachewrapper from an existing aiocache alias.
Added
- Tests: Expand cache coverage for tuple-based default keys, deterministic setup behavior, wrapper rebuild state, public
get()after cachedNone, and the cached-Nonelock recheck path.
[0.5.3] - 2026-03-17
Fixed
- Logging: When
json_format=True, use empty"text"in serialized JSON so the message appears only inrecord.message, avoiding duplication and reducing log size (loguru#594).
Changed
- Logging: Unify console and file sink defaults in
setup_loguru()via shared_sink_defaultsand_apply_sink_defaults(); document empty-text behavior and override viaconsole_options/file_optionsin docstring.
[0.5.2] - 2026-03-09
Fixed
- HTTP: Use
HTTP_422_UNPROCESSABLE_CONTENT(RFC 9110) instead of deprecatedHTTP_422_UNPROCESSABLE_ENTITYinUnprocessableEntityExceptionandresponse_unprocessable_entity(), resolving Starlette deprecation warnings.
Changed
- Dependencies: Require
starlette>=0.48.0so the RFC 9110 status constant is available.
[0.5.1] - 2026-03-06
Added
- Cache: Support for synchronous functions in the
@cacheddecorator. The decorated function becomes asynchronous and must be awaited by the caller, allowing cache reuse for both async and sync business logic. - Template: Integrated cache support into the
standard-3tierproject template, including optional dependency, configuration, initialization inmain.py, and README usage notes. - Tests: Test cases for sync function support in the
@cacheddecorator.
Changed
- Docs: Cache API docs clarify that
@cachedsupports both async and sync functions; add usage examples and note that caller must always await.
[0.5.0] - 2026-03-04
Added
- Cache: Unified cache layer on aiocache (optional extra
zodiac-core[cache]).CacheManagersingleton withsetup(prefix, ...)/get_cache(name)/shutdown();ZodiacCachewithget/set/delete/existsandget_or_set(RedLock stampede protection, optionalskip_cache_func).@cached(ttl, key_builder, name, skip_cache_func)decorator for async functions; default key builder hashes fn + args (pickle with repr fallback for unpicklable args). Namespacezodiac_cache:{prefix}; multi-cache vianameparameter. - Docs: Cache API documentation (
docs/api/cache.md) for setup, decorator, get_or_set, and named caches. - Tests: Cache test suite (decorator key/name/skip_cache_func, manager setup/get_cache/shutdown, ZodiacCache get_or_set/RedLock/skip_cache_func); integration test for optional
[cache]extra.
[0.4.0] - 2026-03-03
Added
- Middleware: WebSocket support for
TraceIDMiddlewareandAccessLogMiddleware. Request ID is read from the WebSocket upgrade request headers (or generated), set in context for the connection lifetime, and reset on close. Access log recordsWEBSOCKET {path} - 101 - {latency}ms. Lifespan scope is passed through without request_id or access log. - Context:
request_id_scope(request_id)context manager to set and reset request ID on exit (used internally by middleware; available for custom ASGI apps that need the same semantics).
Changed
- Middleware: Replace
BaseHTTPMiddlewarewith Pure ASGI implementation forTraceIDMiddlewareandAccessLogMiddleware. Request handling usesscope/receive/senddirectly, improving latency and stability under load. Module docstring links to ASGI spec for scope types (http,websocket,lifespan). - Makefile:
make bench-comparesupports an optional run ID (e.g.make bench-compare ID=0002); default remains0001. - Docs: Clarify uv usage and scaffold flow in installation and getting-started; reduce redundancy in CLI and scaffold docs.
- Template: Use async httpx client in standard-3tier generated tests.
Other
- Tests: Add middleware tests for WebSocket and lifespan behavior; add coverage for response helpers, HTTP client hooks, and schemas
ensure_utc.
[0.3.0] - 2026-02-25
Added
- Exceptions:
UnprocessableEntityException(HTTP 422) for business/semantic validation errors when the request is well-formed but not processable. Exception definitions, handlers, exports, and docs are ordered by HTTP status code (400–422). - CI & coverage: Upload coverage reports to Codecov in CI and enable XML coverage reports (
--cov-report=xml) for tooling integration. - Database tests: Add an async integration test for
DatabaseManager.verify()to ensure database connectivity can be checked reliably.
Changed
- README: Replace badge layout with concise shields, adding direct links to documentation, PyPI, and Codecov status.
- Tooling: Update ignore rules to keep generated coverage artifacts (
coverage.xml) out of version control, while keeping docs changelog managed through the docs site.
[0.2.1] - 2026-02-11
Fixed
- Dependency Isolation: Fixed an issue where
zodiac_core.dbsubmodules forcedsqlalchemyimports. Now optionally loads and provides clear installation guidance whenzodiac-core[sql]is missing.
[0.2.0] - 2026-02-06
Added
- zodiac CLI:
zodiac new PROJECT_NAME --tpl standard-3tier -o OUTPUT_DIRto scaffold projects (optional extrazodiac-core[zodiac]). - standard-3tier template: Full FastAPI project with 3-tier architecture (API / Application / Infrastructure), dependency-injector, file-based config (
.ini), andContainer.initialize()that auto-wires all*_routermodules. - Config:
ConfigManagement.provide_config(config, model)— optional Pydantic model for type-safe, validated config (backward compatible with SimpleNamespace). - Database:
BaseSQLRepository.paginate()andpaginate_query()for standardized pagination with count and optional schema transformation. - Documentation: Architecture guide (layered design, DI, wiring), CLI guide, pagination API (repository methods), and getting-started aligned with template.
[0.1.0] - 2026-02-02
Added
- Routing:
ZodiacAPIRouterwith automaticResponse[T]wrapping using Pydantic v2 native generics - Response: Standard API response model
Response[T]withcode,data,messagefields - Exceptions:
ZodiacExceptionhierarchy (NotFoundException,BadRequestException,ForbiddenException,UnauthorizedException,ConflictException) - Exception Handlers: Centralized handlers for
ZodiacException,RequestValidationError, and generic exceptions - Middleware:
TraceIDMiddlewarefor request tracing,AccessLogMiddlewarefor structured access logging - Logging:
setup_loguru()with JSON format support and Trace ID injection - Context:
trace_idcontext variable for cross-cutting request tracing - Config:
BaseAppSettingswith environment-based configuration using Pydantic Settings - Database:
DatabaseManagersingleton for async SQLAlchemy engine/session managementBaseSQLRepositorywith session context manager- SQLModel mixins:
IntIDMixin,UUIDMixin,SQLDateTimeMixin - HTTP:
HttpClientasync wrapper around httpx with automatic Trace ID propagation - Pagination:
PageParamsrequest model andPagedResponse[T]response model - Schemas: Pydantic mixins:
IntIDSchemaMixin,UUIDSchemaMixin,DateTimeSchemaMixin - Benchmarks: Performance benchmarks for routing overhead and internal operations
- Documentation: MkDocs-based API reference and user guide