# Implementation Plan: 005-postgres-database-replacement

> For the complete documentation index, see [llms.txt](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/llms.txt).

## Scope

*   Transition from `004-containerized-compose-runtime` to `005-postgres-database-replacement`.
*   Track focus: `architecture`.
*   Replace H2 runtime with PostgreSQL while preserving baseline functional behavior.

## Deliverables

1.  Requirement deltas in `requirements/`.
2.  Contract deltas in `contracts/`.
3.  Architecture and topology deltas in `system/`.
4.  Generation hook implementation in `pipeline/generate-state-005-postgres-database-replacement.sh`.
5.  Runtime scripts (`start/stop/status`) for generated state 005.
6.  Smoke test implementation in `scripts/test-state-005-postgres-database-replacement.sh`.
7.  ADR documenting database engine decision.

## Exit Criteria

*   Spec and tasks are complete.
*   Generation hook produces expected PostgreSQL runtime artifacts.
*   Smoke tests pass for this state.
*   State is publishable to `code/generated-state-005-postgres-database-replacement`.
