# Implementation Plan: 005-postgres-database-replacement

> For the complete documentation index, see [llms.txt](https://traderx.finos.org/llms.txt).

[Learning Guide — PostgreSQL Database Replacement](https://traderx.finos.org/docs/learning/state-005-postgres-database-replacement.md): purpose, walkthrough, and related learning states.

# Implementation Plan: 005-postgres-database-replacement

## 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`.
