Skip to content

Phase 0 & 0.5: harden the template before Copier conversion#25

Merged
tomasanchez merged 6 commits into
mainfrom
chore/phase-0-hardening
Jun 12, 2026
Merged

Phase 0 & 0.5: harden the template before Copier conversion#25
tomasanchez merged 6 commits into
mainfrom
chore/phase-0-hardening

Conversation

@tomasanchez

Copy link
Copy Markdown
Owner

Phase 0 & 0.5 — harden the template before the Copier conversion

Implements the Phase 0 and Phase 0.5 work items from the conversion epic #24. All changes were engineered, then validated together on Python 3.13.5:

  • 53 tests pass, 100% branch coverage
  • Pyrefly: 0 errors · Ruff check + format: clean
  • ADR registry valid (make adr-check) · Docker build succeeds (non-root)

Highlights

  • Python 3.13 floor with a regenerated lockfile; mypy-era cruft purged (Pyrefly is the standard per ADR 0008).
  • Working docker compose up (schema auto-create, live reload, named volume) and a hardened multi-stage, non-root Dockerfile.
  • Safe security defaults: CORS driven by FASTAPI_BACKEND_CORS_ORIGINS (credentials auto-disabled on wildcard), DEBUG=False.
  • Real readiness probe that pings the database (503 + Error on failure).
  • Aggregate write-back path (identity map + merge on commit) with a DeactivateUser demo and regression test — closes a silent data-loss trap. Recorded as ADR 0016.
  • Message-bus robustness, robust in-memory SQLite detection, isolated test fixtures, dead-code removal, and a modernized CI workflow with an ADR-registry gate.

Commits

Six conventional commits grouped by concern (build/CI/refactor/security/service/entrypoint).

Closes #7
Closes #8
Closes #9
Closes #10
Closes #11
Closes #12
Closes #13
Closes #14
Closes #15
Closes #16
Closes #17
Closes #18
Closes #19

🤖 Generated with Claude Code

tomasanchez and others added 6 commits June 12, 2026 17:43
Bump the Python floor to 3.13 (regenerated uv.lock), purge mypy-era leftovers, fix the docker-compose first-run (auto-create schema, reload, named volume), harden the Dockerfile (multi-stage, non-root, EXPOSE, UV_COMPILE_BYTECODE), refresh .dockerignore, and tidy the Makefile and lint config.

Closes #7, #8, #10, #12

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop the paths filters, run push on main + pull_request on all branches, bump checkout/setup-uv, drop setup-python and the pip upgrade, fix the docker image tag, and enforce the ADR registry via make adr-check.

Closes #14

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Delete the unused BasePydanticField/PydanticModelField/PydanticModelListField/Base.model_dump helpers and BaseEnum (plus their tests), and the empty utils package.

Closes #11

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drive CORS origins from FASTAPI_BACKEND_CORS_ORIGINS (credentials auto-disabled on wildcard), default DEBUG to False, single-source the version via importlib.metadata, and reconcile README env-var docs and the clone URL.

Closes #9, #13

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tection

Add an explicit write-back path (identity map + merge on commit) with a DeactivateUser demo and regression test, raise UnhandledCommand for unregistered commands, guard event collection on un-entered units of work, and detect in-memory SQLite via make_url. Records the persistence decision as ADR 0016.

Closes #15, #16, #17

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Make /readiness ping the database (503 + Error status on failure), move the Container dependency into a shared module, and rebuild the conftest fixture to inject an in-memory container with proper lifespan and disposal.

Closes #18, #19

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomasanchez tomasanchez merged commit 3ad44c9 into main Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment