Skip to content

Apizr 0.2.0 engineering baseline

Recorded on 2026-09-20 against unmodified commit f9e88a6991add6513c66c6e36ba55985eece7306, before foundation changes.

Pipeline and behavior

The apizr CLI loads configuration, creates Context instances, and registers ordered steps with AutomationEngine. NotebookTransformr exports notebook code through nbconvert and formats it with the runtime Black API. CodeAnalyzr parses Python AST into JSON metadata and copies local imports without executing them. FastApizr renders a FastAPI application. RequirementsAnalyzr infers dependencies from imports and installed distribution metadata, or accepts explicit requirements. Dockerizr renders a Dockerfile, startup script and ignore file.

Supported targets are Python 3.8–3.14. Discovery includes top-level synchronous and asynchronous functions, defaults and positional/keyword-only arguments. Classes are not exposed as routes; variadic arguments are rejected. Generated applications import the source module at startup, validate requests with Pydantic, and expose a health endpoint. Uploaded inputs are size-limited and processed in temporary directories; the main HTTP API returns an archive. Generation does not execute supplied code; running generated applications requires trusted source.

Unchanged baseline results

Gate Recorded result
pytest 52 passed on each of Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
Ruff check / format Passed; 76 files already formatted
Wheel and sdist Both built successfully
Installed wheel, outside checkout Fresh Python 3.11 environment; apizr --help and pricing notebook generation passed
Docker Python 3.8 target built and ran; health 200, POST total = 36, non-root UID
MkDocs Strict build passed
Coverage Python 3.11, coverage.py 7.16.1, branch measurement; see below

Coverage includes every application module, including legacy code: 1,528 statements, 656 missing statements, 336 branches and 50 partially covered branches. Combined statement/branch coverage is 55.90% (rounded terminal report: 56%). CLI subprocesses and generated temporary API modules are not part of this measurement. Their behavior is exercised by subprocess and TestClient tests, so a zero on a standalone CLI module does not mean the CLI was never run.

Selected branch-aware module coverage: AST analyzer 95%, function nodes 98%, annotation nodes 73%, AutomationEngine 93%, Context 76%, pipeline steps 85–100%, FastAPI app generator 86%, requirements inference 88%, Dockerfile generator 77%. Interactive prompts and the old FastAPI import/service generators have zero measured coverage; legacy Gunicorn generation has 48%.

Commands used (test interpreters were existing isolated environments):

<python-3.8-through-3.14> -m pytest -q
.venv/bin/ruff check src tests scripts
.venv/bin/ruff format --check src tests scripts
UV_CACHE_DIR=/tmp/apizr-uv-cache uv build --offline --out-dir /tmp/apizr-foundation-baseline/dist
/tmp/apizr-py311/bin/mkdocs build --strict
COVERAGE_FILE=/tmp/apizr-foundation-baseline/.coverage /tmp/apizr-py311/bin/python -m coverage run --branch --source=src -m pytest -q
COVERAGE_FILE=/tmp/apizr-foundation-baseline/.coverage /tmp/apizr-py311/bin/python -m coverage report -m
.venv/bin/python scripts/smoke_container.py --python-version 3.8
uv venv --python /tmp/apizr-py311/bin/python /tmp/apizr-foundation-baseline/wheel-env
uv pip install --python /tmp/apizr-foundation-baseline/wheel-env/bin/python /tmp/apizr-foundation-baseline/dist/outerspace_apizr-0.2.0-py3-none-any.whl
# From /tmp, using the absolute path of examples/pricing.ipynb:
/tmp/apizr-foundation-baseline/wheel-env/bin/apizr --help
/tmp/apizr-foundation-baseline/wheel-env/bin/apizr --notebook <checkout>/examples/pricing.ipynb --output-dir /tmp/apizr-foundation-baseline/wheel-project --force

Structural debt at this commit

The installed namespace is src, and developer documentation explicitly calls it supported. The normalization PR intentionally migrates that documented path to apizr; no src compatibility shim will be shipped because the package must not expose that generic namespace. This requires updates to downstream imports and Uvicorn/module commands, while the apizr executable remains unchanged.

Historical fixtures are in test/ separately from executable tests/. The license page contains a GPL notice rather than the full canonical license. Context and step results use loosely typed mutable state; the AST metadata and legacy generators have heterogeneous structures and limited typing. Production code, prompts and legacy generators coexist. Packaging data is located relative to module files. Dependency inference depends on the installed environment. Analysis has no network calls, but generated applications execute user modules.

Existing gates are Ruff's E4/E7/E9/F/I rules, pytest, wheel smoke tests, Docker smoke tests and strict docs. CI repeats lint/build per interpreter. There is no Pyright gate, coverage gate, dependency audit or repository-owned CodeQL workflow at this baseline. GitHub default CodeQL setup is already enabled for Python and Actions (confirmed through the repository settings API during this PR). The foundation PR must preserve these runtime semantics rather than redesigning analysis, route generation, dependency inference or orchestration.