diff --git a/.github/ci/start-postgres.sh b/.github/ci/start-postgres.sh index 58865e5d3..01e05c35c 100755 --- a/.github/ci/start-postgres.sh +++ b/.github/ci/start-postgres.sh @@ -3,8 +3,8 @@ set -euo pipefail container_name="rememberstack-postgres-ci" -# POSTGRES_IMAGE runs a published image instead of building Dockerfile.postgres -# (a released engine needs the PostgreSQL it was released with). +# PostgreSQL 18 is the sole server baseline (D157). POSTGRES_IMAGE may select +# a released PG18 foundation instead of building this checkout's Dockerfile. if [ -n "${POSTGRES_IMAGE:-}" ]; then image_name="${POSTGRES_IMAGE}" docker pull "${image_name}" diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml index fc7631c08..164386f41 100644 --- a/.github/workflows/ci-nightly.yml +++ b/.github/workflows/ci-nightly.yml @@ -70,7 +70,7 @@ jobs: python-version: ["3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 - - name: Start PostgreSQL 19 with required extensions + - name: Start PostgreSQL 18 with required extensions run: .github/ci/start-postgres.sh - uses: astral-sh/setup-uv@v5 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1ed59487..a7dd44d2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test steps: - uses: actions/checkout@v4 - - name: Start PostgreSQL 19 with required extensions + - name: Start PostgreSQL 18 with required extensions run: .github/ci/start-postgres.sh - uses: astral-sh/setup-uv@v5 with: @@ -135,7 +135,7 @@ jobs: REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test steps: - uses: actions/checkout@v4 - - name: Start PostgreSQL 19 with required extensions + - name: Start PostgreSQL 18 with required extensions run: .github/ci/start-postgres.sh - uses: astral-sh/setup-uv@v5 with: @@ -164,7 +164,7 @@ jobs: REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test steps: - uses: actions/checkout@v4 - - name: Start PostgreSQL 19 with required extensions + - name: Start PostgreSQL 18 with required extensions run: .github/ci/start-postgres.sh - uses: astral-sh/setup-uv@v5 with: @@ -194,7 +194,7 @@ jobs: REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test steps: - uses: actions/checkout@v4 - - name: Start PostgreSQL 19 with required extensions + - name: Start PostgreSQL 18 with required extensions run: .github/ci/start-postgres.sh - name: Start real MinIO for D155 object contracts run: .github/ci/start-minio.sh diff --git a/.github/workflows/compatibility-matrix.yml b/.github/workflows/compatibility-matrix.yml index 4004fb8bc..89a994190 100644 --- a/.github/workflows/compatibility-matrix.yml +++ b/.github/workflows/compatibility-matrix.yml @@ -61,11 +61,10 @@ jobs: uv run pytest src/tests/surfaces/test_remember_facade.py -v uv run pytest src/tests/surfaces/test_client_connection.py -v - - name: Start PostgreSQL 19 with required extensions - # Releases up to 0.17.2 create SQL/PGQ property graphs, which only - # PostgreSQL 19 Beta 3 supports, so each runs its own released image. + - name: Start PostgreSQL 18 with required extensions + # Only engines released on the D157 PostgreSQL 18 baseline belong here. env: - POSTGRES_IMAGE: ${{ matrix.engine-version != 'candidate' && format('ghcr.io/writeitai/remember-stack-postgres:19beta3-{0}', matrix.engine-version) || '' }} + POSTGRES_IMAGE: ${{ matrix.engine-version != 'candidate' && format('ghcr.io/writeitai/remember-stack-postgres:18-{0}', matrix.engine-version) || '' }} run: .github/ci/start-postgres.sh - name: Start SeaweedFS object store diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fd38a069..98413ace7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,7 +94,7 @@ jobs: fi echo "${{ needs.prepare.outputs.source_sha }} is on main" - - name: Start PostgreSQL 19 with required extensions + - name: Start PostgreSQL 18 with required extensions run: .github/ci/start-postgres.sh - name: Install uv @@ -323,8 +323,8 @@ jobs: # Each architecture builds on its own native runner. The build runs the - # pg_textsearch regression suite, whose parallel_build test fails under QEMU - # emulation (the parallel workers do not launch in time), so arm64 is never + # pg_textsearch regression suite. Its parallel_build test has failed under + # QEMU (parallel workers did not launch in time), so arm64 is never # emulated. Each leg pushes its image by digest; publish-postgres-ghcr then # joins both into the one immutable two-architecture tag. build-postgres: @@ -362,12 +362,12 @@ jobs: with: images: ghcr.io/writeitai/remember-stack-postgres flavor: latest=false - tags: type=raw,value=19rc1-${{ needs.prepare.outputs.version }} + tags: type=raw,value=18-${{ needs.prepare.outputs.version }} - name: Skip a build whose immutable tag already exists (recovery) id: existing env: - IMAGE: ghcr.io/writeitai/remember-stack-postgres:19rc1-${{ needs.prepare.outputs.version }} + IMAGE: ghcr.io/writeitai/remember-stack-postgres:18-${{ needs.prepare.outputs.version }} run: | if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then echo 'present=true' >> "$GITHUB_OUTPUT" @@ -434,12 +434,12 @@ jobs: with: images: ghcr.io/writeitai/remember-stack-postgres flavor: latest=false - tags: type=raw,value=19rc1-${{ needs.prepare.outputs.version }} + tags: type=raw,value=18-${{ needs.prepare.outputs.version }} - name: Preserve an existing immutable foundation tag on recovery id: existing env: - IMAGE: ghcr.io/writeitai/remember-stack-postgres:19rc1-${{ needs.prepare.outputs.version }} + IMAGE: ghcr.io/writeitai/remember-stack-postgres:18-${{ needs.prepare.outputs.version }} run: | if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then docker pull --platform linux/amd64 "$IMAGE" >/dev/null diff --git a/Dockerfile.postgres b/Dockerfile.postgres index fcba3af91..95a737b03 100644 --- a/Dockerfile.postgres +++ b/Dockerfile.postgres @@ -1,11 +1,11 @@ -FROM postgres:19rc1-trixie@sha256:f6bab6213c486e940e310a88490935cbc71b88f6c19fee3cd2ab14b3b02ff65b AS pg_textsearch_builder +FROM postgres:18.6-trixie@sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4 AS pg_textsearch_builder ARG PG_TEXTSEARCH_REVISION=fa142d049d08eac45a263f5abc250c8877ae076e ARG PG_TEXTSEARCH_SOURCE_SHA256=445a546810cbc17e15d05ff8a391f1b693eab382a2ef6efbf72e1c37fa0c48d0 ARG PG_TEXTSEARCH_LICENSE_SHA256=d33de21a123ce25b41722a5d10750984cb9c844c4d9b01add9e1b31f3ff452e5 ARG PG_TEXTSEARCH_NOTICE_SHA256=ff70cf4336c579957368a71c6b6b66ee8954011deef2b3d2c7a11f931080851d -# The prerelease base can carry an older CA bundle than the PGDG archive's +# The pinned base can carry an older CA bundle than the PGDG archive's # current CloudFront chain. Debian remains usable when that source warns, so # refresh trust first and then require a clean archive update. RUN set -eux; \ @@ -27,11 +27,10 @@ RUN set -eux; \ update-ca-certificates; \ apt-get update; \ # The headers must be the base image's exact server build: the archive - # also serves newer prereleases, and an extension compiled against their - # headers fails at run time (an index access method struct changes). + # also serves newer server builds. Keep compile and runtime inputs equal. apt-get install -y --no-install-recommends \ - build-essential curl patch \ - "postgresql-server-dev-19=${PG_VERSION}" "libpq-dev=${PG_VERSION}"; \ + build-essential curl \ + "postgresql-server-dev-18=${PG_VERSION}" "libpq-dev=${PG_VERSION}"; \ curl --fail --location --show-error \ --output /tmp/pg_textsearch.tar.gz \ "https://github.com/timescale/pg_textsearch/archive/${PG_TEXTSEARCH_REVISION}.tar.gz"; \ @@ -45,47 +44,41 @@ RUN set -eux; \ echo "${PG_TEXTSEARCH_NOTICE_SHA256} /src/pg_textsearch/NOTICE" | sha256sum --check --strict; \ rm -rf /var/lib/apt/lists/* -# PostgreSQL 19 RC 1 headers no longer pull in , and v1.5.1's -# src/planner/hooks.c uses INT_MAX without including it (upstream issue -# timescale/pg_textsearch#586). Force-include the standard header on top of -# the server's own preprocessor flags, which reach both the shared object and -# the JIT bitcode compiles; the pinned source stays unmodified. RUN set -eux; \ cd /src/pg_textsearch; \ - make -j"$(nproc)" CPPFLAGS="$(pg_config --cppflags) -include limits.h"; \ + make -j"$(nproc)"; \ make install; \ { \ - sha256sum /usr/lib/postgresql/19/lib/pg_textsearch.so; \ - find /usr/share/postgresql/19/extension -maxdepth 1 \ + sha256sum /usr/lib/postgresql/18/lib/pg_textsearch.so; \ + find /usr/share/postgresql/18/extension -maxdepth 1 \ -type f -name 'pg_textsearch*' -print0 | sort -z | xargs -0 sha256sum; \ } > /tmp/pg_textsearch-artifacts.sha256 -# Local PostgreSQL 19 gate (D142, design §6): upstream supports PG19 on a -# best-effort basis, so every image build runs the extension's own regression -# suite against a throwaway cluster of this exact server build. +# Extension gate (D142/D157): every image build runs the upstream regression +# suite against a throwaway cluster of this exact PostgreSQL 18 server build. RUN set -eux; \ chown -R postgres /src/pg_textsearch; \ - su postgres -c "/usr/lib/postgresql/19/bin/initdb -D /tmp/pg_regress_data >/dev/null"; \ + su postgres -c "/usr/lib/postgresql/18/bin/initdb -D /tmp/pg_regress_data >/dev/null"; \ echo "shared_preload_libraries = 'pg_textsearch'" >> /tmp/pg_regress_data/postgresql.conf; \ - su postgres -c "/usr/lib/postgresql/19/bin/pg_ctl -D /tmp/pg_regress_data -l /tmp/pg_regress.log -w start"; \ + su postgres -c "/usr/lib/postgresql/18/bin/pg_ctl -D /tmp/pg_regress_data -l /tmp/pg_regress.log -w start"; \ if ! su postgres -c "cd /src/pg_textsearch && make installcheck"; then \ cat /src/pg_textsearch/regression.diffs 2>/dev/null || true; \ exit 1; \ fi; \ - su postgres -c "/usr/lib/postgresql/19/bin/pg_ctl -D /tmp/pg_regress_data -w stop"; \ + su postgres -c "/usr/lib/postgresql/18/bin/pg_ctl -D /tmp/pg_regress_data -w stop"; \ rm -rf /tmp/pg_regress_data /tmp/pg_regress.log -FROM postgres:19rc1-trixie@sha256:f6bab6213c486e940e310a88490935cbc71b88f6c19fee3cd2ab14b3b02ff65b +FROM postgres:18.6-trixie@sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4 # pg_textsearch uses the PostgreSQL License at the source revision pinned above -# (v1.5.1, which supports PostgreSQL 19 upstream; no local patch, D142). -COPY --from=pg_textsearch_builder /usr/lib/postgresql/19/lib/pg_textsearch.so /usr/lib/postgresql/19/lib/pg_textsearch.so -COPY --from=pg_textsearch_builder /usr/share/postgresql/19/extension/pg_textsearch* /usr/share/postgresql/19/extension/ +# (v1.5.1; no local patch or compiler workaround, D142/D157). +COPY --from=pg_textsearch_builder /usr/lib/postgresql/18/lib/pg_textsearch.so /usr/lib/postgresql/18/lib/pg_textsearch.so +COPY --from=pg_textsearch_builder /usr/share/postgresql/18/extension/pg_textsearch* /usr/share/postgresql/18/extension/ COPY --from=pg_textsearch_builder /src/pg_textsearch/LICENSE /usr/share/doc/pg_textsearch/LICENSE COPY --from=pg_textsearch_builder /src/pg_textsearch/NOTICE /usr/share/doc/pg_textsearch/NOTICE COPY --from=pg_textsearch_builder /tmp/pg_textsearch-artifacts.sha256 /usr/share/doc/pg_textsearch/artifacts.sha256 -# Refresh the prerelease base's trust bundle before the archive update; package +# Refresh the pinned base's trust bundle before the archive update; package # signatures still provide apt's normal authenticity boundary. RUN set -eux; \ for pgdg_source_file in \ @@ -106,6 +99,6 @@ RUN set -eux; \ update-ca-certificates; \ apt-get update; \ apt-get install -y --no-install-recommends \ - postgresql-19-partman=5.5.0-1.pgdg13+1 \ - postgresql-19-pgvector=0.8.6-1.pgdg13+2; \ + postgresql-18-partman=5.5.0-1.pgdg13+1 \ + postgresql-18-pgvector=0.8.6-1.pgdg13+2; \ rm -rf /var/lib/apt/lists/* diff --git a/RELEASING.md b/RELEASING.md index 968d468a7..76497cbb8 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -60,15 +60,16 @@ uv run python scripts/check_release_contract.py --tag v0.17.0 ``` That release pull request also refreshes the PostgreSQL foundation pins in -`Dockerfile.postgres`: use the reviewed PostgreSQL 19 prerelease/GA base digest, +`Dockerfile.postgres`: use the reviewed official PostgreSQL 18.x base digest (minor and image at +least two weeks old), pin the intended PGDG pgvector and pg_partman package versions, and pin the -pg_textsearch source revision plus source, compatibility-patch, license, and +pg_textsearch source revision plus source, license, and notice checksums. Build the Dockerfile for both architectures, record each embedded artifact manifest and immutable image digest, and run the extension and graph release matrix before tagging. The tag workflow then rebuilds and -publishes `ghcr.io/writeitai/remember-stack-postgres:19rc1-VERSION` for both -architectures, each built on a native runner (the build's pg_textsearch -regression suite fails under QEMU emulation), and attaches `postgres-image-digests.json` to the GitHub release; +publishes `ghcr.io/writeitai/remember-stack-postgres:18-VERSION` for both +architectures, each built on a native runner (the pg_textsearch worker-count +regression has failed under QEMU emulation), and attaches `postgres-image-digests.json` to the GitHub release; UMC consumes the recorded manifest digest, never that human-readable tag. Updating the foundation pins remains a manual, reviewable patch cadence; publishing and digest capture are mechanical and mutable database-image tags diff --git a/benchmarks/locomo/protocol.py b/benchmarks/locomo/protocol.py index 51df296bc..86a6f9760 100644 --- a/benchmarks/locomo/protocol.py +++ b/benchmarks/locomo/protocol.py @@ -48,7 +48,7 @@ """Concise adjudication projector/response-adapter generation (D121/D123).""" EXPECTED_SURFACE_MANIFEST_HASH: Final = ( - "f238bb518de2aed12db7278d274878006382aa7186baae40c3cdb7ec6b7c48c6" + "280cac8902f50aff8e6a02fe0fa39abdae6a64520e6a0b792bb8eef9c63e23e2" ) EXPECTED_PIPELINE_STAGES: Final = ( "convert", diff --git a/compose.yaml b/compose.yaml index 7ee8a24f2..eb0a1f2c0 100644 --- a/compose.yaml +++ b/compose.yaml @@ -140,7 +140,7 @@ services: build: context: . dockerfile: Dockerfile.postgres - image: ghcr.io/writeitai/remember-stack-postgres:19rc1-0.20.0 + image: ghcr.io/writeitai/remember-stack-postgres:18-0.20.0 command: - postgres - -c diff --git a/decisions.md b/decisions.md index 7046b8f21..44b693137 100644 --- a/decisions.md +++ b/decisions.md @@ -1046,6 +1046,10 @@ tool, roles, summaries, and placement hints are unchanged. `e1_chunks_design.md` ## D40. P3 — the corpus filesystem: a mountable, rebuildable projection +> **D157 reference-server amendment (2026-11-14).** P3 rebuilds from +> PostgreSQL 18 plus immutable artifacts. Its projection/publication contract +> is unchanged; see [D157](#d157-postgresql-18-is-the-reference-server). + **Status:** superseded for layout, inputs, publication and K composition by [D155](#d155-the-corpus-filesystem-is-a-mutable-tree-of-document-folders). P3 remains a read-only, derived, rebuildable consumption surface. Its current contract is actual per-document original/derivative folders in a @@ -2174,6 +2178,12 @@ application of D60's existing boundary, not a new subsystem or a retreat from co ## D61. Provider ports — the deployment substrate is pluggable; the imposed constraints become the reference deployment +> **Partially superseded by [D157](#d157-postgresql-18-is-the-reference-server) (2026-11-14).** +> PostgreSQL 18 replaces every PostgreSQL 19 runtime/image requirement in +> this entry, including prerelease upgrade policy and the RC-only compiler +> workaround. Relational live graph, search and other contracts survive. +> References to PostgreSQL 19 below record historical decisions or measurements. + > **Amended by [D155](#d155-the-corpus-filesystem-is-a-mutable-tree-of-document-folders) for corpus storage/mounts.** The existing S3 > adapter serves mountable.io, AWS S3, GCS XML/HMAC and MinIO; local FS is the dev > adapter. The port adds only streamed whole-object replacement, paginated prefix @@ -4254,6 +4264,12 @@ projection. Does not amend D9 query path or D48 hydration. ## D94. P1 search is PostgreSQL-native +> **Partially superseded by [D157](#d157-postgresql-18-is-the-reference-server) (2026-11-14).** +> PostgreSQL 18 replaces every PostgreSQL 19 runtime/image requirement in +> this entry, including prerelease upgrade policy and the RC-only compiler +> workaround. Relational live graph, search and other contracts survive. +> References to PostgreSQL 19 below record historical decisions or measurements. + > **P3 registry clause superseded by [D155](#d155-the-corpus-filesystem-is-a-mutable-tree-of-document-folders).** Mutable P3 publication > receipts replace immutable snapshot rows. D94's PostgreSQL-native P1 and other > storage/search contracts remain unchanged. @@ -4533,8 +4549,15 @@ query path, envelope grain, or hydration (D48–D49). ## D98. The graph is live PostgreSQL 19 SQL/PGQ plus work-bounded frontier traversal -**Status:** amended 2026-11-06 — SQL/PGQ was removed upstream; the one-hop -read is relational SQL over the same views (see the RC 1 amendment below). +> **Partially superseded by [D157](#d157-postgresql-18-is-the-reference-server) (2026-11-14).** +> PostgreSQL 18 replaces every PostgreSQL 19 runtime/image requirement in +> this entry, including prerelease upgrade policy and the RC-only compiler +> workaround. Relational live graph, search and other contracts survive. +> References to PostgreSQL 19 below record historical decisions or measurements. + +**Status:** amended by D157 (2026-11-14): PostgreSQL 18 is the reference +server. The 2026-11-06 RC 1 amendment had already replaced SQL/PGQ with +relational joins over the same live views; that query contract survives. > **D142 amendment (2026-10-21, proposed).** The `pg_textsearch` 1.3.1 pin > and its PG19 compatibility patch are replaced by upstream 1.5.1 or later, @@ -5643,6 +5666,12 @@ D32, D43's untyped statement, D98, D100–D105. ## D108. Single canonical PyPI distribution (`remember`), container-first engine (`remember-stack`), and platform CLI +> **Partially superseded by [D157](#d157-postgresql-18-is-the-reference-server) (2026-11-14).** +> PostgreSQL 18 replaces every PostgreSQL 19 runtime/image requirement in +> this entry, including prerelease upgrade policy and the RC-only compiler +> workaround. Relational live graph, search and other contracts survive. +> References to PostgreSQL 19 below record historical decisions or measurements. + > **Partly superseded by [D136](#d136-one-signed-key-one-shared-mcp-tool-catalogue-and-a-bridging-remember-mcp) (2026-09-23).** > In item 4, the *Authentication & Project Context* host (`https://api.remember.dev` > was never a live host; login now uses the issuer's metadata, default issuer @@ -5679,6 +5708,12 @@ D32, D43's untyped statement, D98, D100–D105. ## D109. Unified documentation architecture (the Qdrant model) and full cloud query space parity +> **Partially superseded by [D157](#d157-postgresql-18-is-the-reference-server) (2026-11-14).** +> PostgreSQL 18 replaces every PostgreSQL 19 runtime/image requirement in +> this entry, including prerelease upgrade policy and the RC-only compiler +> workaround. Relational live graph, search and other contracts survive. +> References to PostgreSQL 19 below record historical decisions or measurements. + **Context.** Prior to D109, documentation was divided across two repositories: `remember-stack` (`website/` deployed to `docs.remember.dev`) and `ultimate-memory-cloud` (`fe/src/app/(public)/docs` deployed to `remember.dev/docs`). This caused continuous maintenance drift between engine features and cloud documentation, fragmented brand SEO, and confused developers and AI agents. Concurrently, early cloud compatibility matrices marked `open_query_execute` (`POST /query/sql`, `GET /query/space`, and open-query MCP tools) as unsupported on Remember Cloud out of initial conservative scoping, creating an artificial divide where agents lost relational and graph query tools when moving from local Docker to Cloud. **Decision.** @@ -7234,6 +7269,12 @@ only through D118 adjudication. ## D142. Ranked search nominates from the index and confirms in one snapshot +> **Partially superseded by [D157](#d157-postgresql-18-is-the-reference-server) (2026-11-14).** +> PostgreSQL 18 replaces every PostgreSQL 19 runtime/image requirement in +> this entry, including prerelease upgrade policy and the RC-only compiler +> workaround. Relational live graph, search and other contracts survive. +> References to PostgreSQL 19 below record historical decisions or measurements. + **Status:** accepted (design approved by review round 3, 2026-10-21; implementation approved by review round 5 pending the latency decision, which the owner took on 2026-10-22 — amendment below); binding on merge of PR #505. Issue @@ -8376,3 +8417,42 @@ deployments. **Refines:** D134 (filters and fact evidence). **Amends:** the open query space §3.1/§3.2 contract and the D136 MCP catalogue. **Retains:** D54, D56, D80, D135, D140, D142, D153 and D74. + + +## D157. PostgreSQL 18 is the reference server + +**Decision (2026-11-14, owner).** PostgreSQL 18 is the only reference and +self-host server major. Pin an official Debian trixie 18.x image by immutable +multi-platform digest, selecting the newest minor and image at least two +weeks old. The initial pin is 18.6 from 2026-10-28: 18.7 was released only +2026-11-12 and does not meet that age floor. Keep the existing pinned +pgvector 0.8.6, pg_partman 5.5.0 and pg_textsearch 1.5.1 sources/packages, +and the bundled pg_trgm, pgcrypto, btree_gist, unaccent, fuzzystrmatch and +plpgsql extensions. Remove the RC-only forced `` include. + +**Why.** D98 adopted PostgreSQL 19 only for SQL/PGQ. Beta 4 reverted it, +and the owner's 2026-11-06 RC 1 amendment replaced graph patterns with plain +joins. No remaining capability requires 19. A prerelease server and compiler +workaround therefore add operational risk without a feature benefit. + +**Consequences.** Image builds, Compose, CI, release foundation tags +(`remember-stack-postgres:18-`), query-space manifests, +graph readiness and native storage-capture guards use 18. Migrations must +run from empty on 18; no Beta 3 cleanup or dual-major path remains. Recreate +and replay development storage. Physical PG19 storage is not PG18-compatible; +any managed data transfer needs a separately qualified operator plan. +Both architectures retain upstream extension regression and engine gates. +No paid-work reuse identity or generation changes; moving servers does not +require re-embedding or re-extraction. + +**Amends.** D98 and its RC 1 amendment, D40's projection rebuild substrate, +and the server/version clauses of D61, D94, D108, D109 and D142. Their +non-version contracts remain binding. Historical measurements stay dated +and do not become PostgreSQL 18 qualification evidence. + +**Analysis.** [PostgreSQL 18 reference server](plan/analysis/postgres18_reference_server.md). +**Current designs.** [Graph](plan/designs/p2_graph_design.md#9-postgresql-18-and-extension-posture), +[P1 search](plan/designs/postgres_p1_search_projection_design.md#6-extensions-and-supported-postgresql). + +**Rejected.** Remaining on 19 for a removed feature, supporting two server +majors, adding compatibility shims, or opening a PG19 data directory on 18. diff --git a/design/README.md b/design/README.md index e84bcaad3..c88df46c5 100644 --- a/design/README.md +++ b/design/README.md @@ -35,7 +35,7 @@ Unchosen efficiency alternative: [grouped fact adjudication](proposals/grouped_f | Claim-level E3 normalize fan-out (D88) | [`../plan/designs/e3_claim_level_normalize_fanout_design.md`](../plan/designs/e3_claim_level_normalize_fanout_design.md) | [`../plan/analysis/e3_claim_level_normalize_fanout_analysis.md`](../plan/analysis/e3_claim_level_normalize_fanout_analysis.md) | | Request-path metering + cost export (D91) | [`../plan/designs/request_path_metering_and_cost_export_design.md`](../plan/designs/request_path_metering_and_cost_export_design.md) | [`../plan/analysis/request_path_metering_and_cost_export_analysis.md`](../plan/analysis/request_path_metering_and_cost_export_analysis.md) | | PostgreSQL-native P1 search (D94) | [`../plan/designs/postgres_p1_search_projection_design.md`](../plan/designs/postgres_p1_search_projection_design.md) | [`../plan/analysis/postgres_p1_search_projection_analysis.md`](../plan/analysis/postgres_p1_search_projection_analysis.md) | -| Live PostgreSQL 19 graph (D98) | [`../plan/designs/p2_graph_design.md`](../plan/designs/p2_graph_design.md) | [`../plan/analysis/postgres19_sqlpgq_live_graph_analysis.md`](../plan/analysis/postgres19_sqlpgq_live_graph_analysis.md) | +| Live PostgreSQL 18 graph (D98/D157) | [`../plan/designs/p2_graph_design.md`](../plan/designs/p2_graph_design.md) | [`../plan/analysis/postgres19_sqlpgq_live_graph_analysis.md`](../plan/analysis/postgres19_sqlpgq_live_graph_analysis.md) | | Entity identity and retrieval (D95–D97) | [`../plan/designs/entity_identity_and_retrieval_design.md`](../plan/designs/entity_identity_and_retrieval_design.md) | [`../plan/analysis/entity_identity_and_retrieval_analysis.md`](../plan/analysis/entity_identity_and_retrieval_analysis.md) | - [D119 coherent multi-span claims with version reuse](../plan/designs/multi_span_claim_extraction_design.md) diff --git a/docker/README.md b/docker/README.md index af3032497..d0e19b804 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,72 +1,105 @@ # PostgreSQL image release evidence -`Dockerfile.postgres` is the only supported database image definition. It pins -the PostgreSQL 19 prerelease base (release candidate 1, `19rc1-trixie`) by -digest, pins PGDG extension package versions, and builds pg_textsearch from a -checksum-verified source archive (no local patch: v1.5.1 supports PostgreSQL 19 -upstream, D142). - -The RC 1 headers no longer include `` indirectly, and pg_textsearch -v1.5.1 uses `INT_MAX` without including it (upstream issue -[timescale/pg_textsearch#586](https://github.com/timescale/pg_textsearch/issues/586), -open on 2026-11-06). The build adds `-include limits.h` to the server's own -preprocessor flags instead of changing the source; drop the flag once a pinned -release includes the header itself. - -pgvector is pinned to the PGDG build `0.8.6-1.pgdg13+2`, which PGDG rebuilt -against the Beta 4 headers; that is the tested pin (PGDG also publishes -`0.8.7-1.pgdg13+1`). Between Beta 4 and RC 1 the -index access-method interface (`access/amapi.h`) is unchanged, and the one -changed index-vacuum struct (`IndexVacuumInfo`, a new `is_autovacuum` flag) -moves only fields pgvector 0.8.6 does not read (checked against the -`postgresql-server-dev-19` 19~beta4 and 19~rc1 packages and the v0.8.6 source, -2026-11-06). pg_partman's background worker uses only interfaces whose headers -are unchanged between Beta 3 and RC 1. - -Exact pgvector and pg_partman Debian versions resolve from PGDG's all-versions -`trixie-pgdg-archive` repository, not the rotating current-version index. PGDG -documents that archive as the daily-updated repository containing every -released package version; retrieved 2026-08-27 from -. - -## pg_textsearch provenance +`Dockerfile.postgres` is the only supported database image definition. +[D157](../decisions.md#d157-postgresql-18-is-the-reference-server) selects +PostgreSQL 18 as the sole reference server. Graph reads use ordinary joins +and bounded traversal; SQL/PGQ no longer justifies a prerelease dependency. + +## PostgreSQL 18 base (2026-11-14) + +The official image is `postgres:18.6-trixie`, pinned in both stages to index +`sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4`. +The server package is `18.6-1.pgdg13+2`; build headers and libpq-dev use +that exact version. The official +[2026-10-28 image record](https://github.com/docker-library/repo-info/blob/e99222a981c35f94ad85de0959a7869ea8e39b80/repos/postgres/remote/18.6-trixie.md) +records the index and both platform builds, over two weeks before selection: + +| Platform | Base child digest | +|---|---| +| linux/amd64 | `sha256:f4b419e350fd98d4a8429603295208976dea4c8fb8326d818d346d3e29f1db6f` | +| linux/arm64 | `sha256:9a74990a5c776ff210361b67616b347750c66c36ea0dfbb4f575d19fcc3d8437` | + +[18.6 was released 2026-08-13](https://www.postgresql.org/docs/release/18.6/). +[18.7 was released 2026-11-12](https://www.postgresql.org/docs/release/18.7/), +so 18.6 is the newest minor satisfying the owner's two-week age floor on +2026-11-14. Future updates select the newest eligible 18.x minor and official +image digest; no floating tag enters the build. + +## Extension pins and provenance + +The PGDG packages retain their previous pinned versions and source releases, +now built for PostgreSQL 18: + +- `postgresql-18-pgvector=0.8.6-1.pgdg13+2` +- `postgresql-18-partman=5.5.0-1.pgdg13+1` +- bundled `pg_trgm`, `pgcrypto`, `btree_gist`, `unaccent`, `fuzzystrmatch` + and `plpgsql` from the official server image (`btree_gist` is 1.8 on + PostgreSQL 18, rather than 1.9 on PostgreSQL 19) + +Exact PGDG versions resolve from the all-versions `trixie-pgdg-archive` +repository, rather than the rotating current index. PGDG describes that +archive at ; pins verified 2026-11-14. + +pg_textsearch keeps the same checksum-verified upstream 1.5.1 source: - source revision: `fa142d049d08eac45a263f5abc250c8877ae076e` (tag `v1.5.1`) - source archive SHA-256: `445a546810cbc17e15d05ff8a391f1b693eab382a2ef6efbf72e1c37fa0c48d0` -- PostgreSQL 19: supported upstream since v1.5.0 as best effort with - non-blocking CI ([README at the pinned revision](https://github.com/timescale/pg_textsearch/blob/fa142d049d08eac45a263f5abc250c8877ae076e/README.md#postgresql-version-compatibility)), - so this image's own integration suite is the PostgreSQL 19 gate; the former - local compatibility patch is retired (retrieved 2026-10-21) +- PostgreSQL 18 is supported by the + [pinned source](https://github.com/timescale/pg_textsearch/blob/fa142d049d08eac45a263f5abc250c8877ae076e/README.md#postgresql-version-compatibility). + No local patch or forced `` include is used. The former compiler + flag addressed RC 1 headers; PostgreSQL 18 builds without it. - license determination: the pinned revision's `LICENSE` identifies **The - PostgreSQL License** (`PostgreSQL` identifier), and its `NOTICE` says the - extension is licensed under that license; unchanged at v1.5.1 (same - checksums), retrieved 2026-10-21 + PostgreSQL License** (`PostgreSQL` identifier); `NOTICE` carries the same + license. Both are checksum-verified and copied to + `/usr/share/doc/pg_textsearch/` in the runtime image. - license SHA-256: `d33de21a123ce25b41722a5d10750984cb9c844c4d9b01add9e1b31f3ff452e5` - notice SHA-256: `ff70cf4336c579957368a71c6b6b66ee8954011deef2b3d2c7a11f931080851d` -- license evidence: both files are checksum-verified during the build and - copied to `/usr/share/doc/pg_textsearch/` in the runtime image -The build writes SHA-256 values for the installed shared object, control file, -and SQL migration files to -`/usr/share/doc/pg_textsearch/artifacts.sha256`. Because that file is produced -inside each build platform, it is also the per-architecture binary record. +The build writes SHA-256 values for the installed shared object, control file +and SQL migrations to `/usr/share/doc/pg_textsearch/artifacts.sha256` and +runs the complete upstream SQL regression suite against its exact server. +The manifest is produced per architecture, so it records each binary build. ## Release matrix -For each PostgreSQL beta, RC, and GA candidate, build both `linux/amd64` and -`linux/arm64`. Record the immutable image digest and the embedded artifact -manifest for each architecture, then run migrations, extension smoke tests, -the pg_textsearch regression suite, graph correctness tests, and the complete -RememberStack test suite. Managed deployment remains blocked unless amd64 -passes; self-host release remains blocked unless both architectures pass. - -The tag workflow mechanically publishes the two-platform manifest and attaches -`postgres-image-digests.json`, containing its immutable digest plus both child -digests, to the GitHub release. The release-contract checker fails if that job, -either required platform, or the digest evidence artifact disappears. +For every PostgreSQL image update, build both `linux/amd64` and `linux/arm64`. +Record immutable image digests and embedded artifact manifests; run migrations +from empty, extension smoke tests, upstream pg_textsearch regression tests, +graph correctness/repair, backup/restore and the complete RememberStack suite. +Managed deployment requires amd64 to pass; self-host releases require both. + +The release workflow builds natively on each architecture and publishes +`ghcr.io/writeitai/remember-stack-postgres:18-`. It attaches +`postgres-image-digests.json`, containing the immutable manifest and both child +digests, to the GitHub release. The release-contract checker enforces the +publisher, platforms, tag scheme and evidence artifact. Between releases, +build the checkout's image with `docker compose up --build`. + +## Local PostgreSQL 18 validation (2026-11-14) + +Both local builds passed all 82 upstream pg_textsearch SQL regression cases +without a compiler workaround. arm64 ran natively; amd64 ran under emulation +on the arm64 Docker host. Release builds still run natively on each platform. +The following local image IDs were not published: + +| Evidence | linux/amd64 | linux/arm64 | +|---|---|---| +| Local image ID | `sha256:75b001929f97a8ae5aee37bda609aa7ebc81cc1df55486eca56959839d6c0e47` | `sha256:5225e7a6ec478e5ff9b3a3efb6e9f31815453e20ff60e57a73317932d1865ac9` | +| `artifacts.sha256` file SHA-256 | `903ee32e998509c023687cb7d131d45739f91c0ab71e79c7936e59c1015ca95c` | `df7eb94fb50b7e8d08256a275a731b94470176f2b4904c3d95d232248caa70c6` | +| `pg_textsearch.so` SHA-256 | `780433ddf91aeaf4cf7c7c57eea01dd25d540a5794dd1f7a44f08ac915dfd412` | `ef09d5d682e99c503d7d0e7686a63dda3a0f894cc5ca3752e0f21ec9c848bb28` | +| Upstream regression tests | 82/82 | 82/82 | + +The [validation record and managed handoff](../docs/development/postgres18-reference-validation-2026-11-14.md) +records engine-suite and Compose results separately. These local IDs are not +registry release digests; no release was published by this change. + +## Historical PostgreSQL 19 release evidence + +The following records describe the former server. They are retained as dated +evidence and do not qualify PostgreSQL 18 or prescribe an upgrade path. ### 0.19.0 (PostgreSQL 19 RC 1), 2026-11-07 diff --git a/docs/development/postgres18-reference-validation-2026-11-14.md b/docs/development/postgres18-reference-validation-2026-11-14.md new file mode 100644 index 000000000..f5160c9d6 --- /dev/null +++ b/docs/development/postgres18-reference-validation-2026-11-14.md @@ -0,0 +1,209 @@ +# PostgreSQL 18 reference-server validation and managed handoff + +Owner decision: 2026-11-14, [D157](../../decisions.md#d157-postgresql-18-is-the-reference-server). +This record concerns the OSS engine change. It does not authorize or claim a +managed deployment, data transfer, release, or production capture qualification. + +## Selected build + +Official `postgres:18.6-trixie` index +`sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4`, +recorded by docker-library on 2026-10-28; server `18.6-1.pgdg13+2`. +18.7 was published 2026-11-12 and fails the required two-week age floor. +Base child digests and unchanged source/license pins are in +[docker/README.md](../../docker/README.md). + +## Behaviour and contract differences + +- The server-major checks in graph readiness, `memory_v1` and the native + relation guard now accept only 18. PostgreSQL 18 matches the `pglast` 8.4 + parser's grammar; no parser bypass or second server path is added. +- PG18 ships `btree_gist` **1.8**, whereas the previous PG19 image shipped + **1.9**. The native guard's complete extension set now pins 1.8. The + remaining installed versions are unchanged: fuzzystrmatch 1.2, + pg_partman 5.5.0, pg_textsearch 1.5.1, pg_trgm 1.6, pgcrypto 1.4, + plpgsql 1.0, unaccent 1.1 and vector 0.8.6. +- PG18 advisory-lock statement timeouts have SQLSTATE `57014` and no error + context. The old profile refresher required an `advisory lock` phrase and + therefore missed typed contention on 18. It now identifies the two fixed + lock statements plus SQLSTATE; unrelated statement timeouts remain database + failures. The wait bound, retry contract and paid-work reuse inputs remain + unchanged. Existing shared/exclusive contention and non-lock timeout proofs + verify the distinction. +- pg_textsearch 1.5.1 compiles without the RC-only `-include limits.h` flag. + Its archive, LICENSE and NOTICE pins are unchanged. +- PostgreSQL 18 already has `pg_constraint.contype = 'n'` for NOT NULL. + Catalog counts remain subject to the full fresh/downgrade/re-upgrade gate. +- The obsolete Beta 3 `DROP PROPERTY GRAPH` helper and its migration/repair + calls are removed. Revision `p9_44_0065` remains an explicit no-op to keep + Alembic ordering. Existing relational views and bounded helpers are retained. +- Declaring server major 18 changes the public query-space manifest hash to + `280cac8902f50aff8e6a02fe0fa39abdae6a64520e6a0b792bb8eef9c63e23e2`. + The checked-in manifest, LoCoMo expected surface and D143 default-surface + fixture are refreshed. Storage-capture synthetic source/schema/profile + digests are regenerated. Historical receipts are not rewritten. +- The legacy D153 semantic oracle triggers just-in-time (JIT) compilation of thousands of + functions on PG18 even for its tiny corpus. A read-only probe of old + `pages_live` compiled 3258 functions and took 9.898 s; with JIT off it took + 0.209 s and returned identical rows. Only this row-equivalence test disables + JIT locally on both comparison transactions; every assertion remains. + Production settings and scale/plan gates are unchanged. +- No ingestion text, prompt, chunker, extraction, embedding or reuse identity + generation changes. This server change does not require paid reprocessing. + +## Validation + +The shared disposable PostgreSQL container was recreated from the new arm64 +image at `localhost:55433`, with database/user `rememberstack` and the +requested SQLAlchemy URL. Real MinIO was started by +`.github/ci/start-minio.sh` at `127.0.0.1:59000`. + +The final complete run on runtime commit +`236557742069a8cc222add5c62cc1a101d834af1` passed: **5177 passed, 20 skipped, +2 xfailed, zero failures/errors**, in **2273.51 s (37 min 53 s)**. The entire +5199-case collection completed in one sequential pytest process against the +shared PG18 database; no other database suite ran concurrently. The command was: + +```sh +REMEMBERSTACK_DATABASE_URL='postgresql+psycopg://rememberstack:testpass@localhost:55433/rememberstack' \ +REMEMBERSTACK_TEST_MINIO_ENDPOINT_URL='http://127.0.0.1:59000' \ +uv run pytest src/tests -q --tb=short -ra --junitxml=/tmp/rs-pg18-full.xml +``` + +The seven warnings are one Starlette/httpx deprecation and six pytest +`record_property`/xunit2-format warnings. Skip and expected-failure coverage +is explained below. The final runtime commit's 18 CI checks also passed, +including unit, all three integration lanes, Compose, arm64 image, contracts, +quality, four SDK platforms and both website builds; deployment was skipped. + +Completed checks: + +- PostgreSQL image builds on native arm64 and emulated amd64: upstream + pg_textsearch **82/82 on each**, no forced header include. Server and + pgvector/pg_partman package pins match on both. Local image/artifact hashes + are in `docker/README.md`; CI/release use native runners for both platforms. +- Migration suite: **19 passed**, including fresh head, complete + downgrade/re-upgrade, mutation/no-op and graph metadata lifecycle checks. + The existing catalog constraint expectations passed unchanged. +- Real MinIO object operations, publication, lock-loss and storage-capture + suites passed in the complete run, using the helper's real object store. +- Ruff lint and formatting (`src/`, `benchmarks/`); Pyright with Python 3.13 + (**0 errors**); import contracts (**5 kept, 0 broken**); test inventory + (**180 unit + 97 integration = 277 files**); release contract. +- Generated query-space manifest, D143 default surfaces, native capture + fixture, OpenAPI (41 routes), TypeScript contracts/parity and public llms + files. Public/cloud docs truth checks; public website production build and + typecheck. +- All **40 converter checks** in the engine image with real LibreOffice, + including the four tests skipped on this macOS host. Test files were + copied into a disposable container; no converter implementation changed. +- Local Compose: healthy startup on PG18, loopback API at `18018`, exact + stamped final runtime revision `236557742069a8cc222add5c62cc1a101d834af1`, + first SQL query, all three object buckets' + round trips and conditional creation, zero-cost whitespace ingestion + (eight completed stages and no cost rows), projection/readiness, and an + empty prior-schema upgrade from `p9_31_0052` to `p9_53_0074` proving setup + finishes before API/workers restart. The CI shell payloads were reused; + the port was adjusted and the reset helper was copied rather than bind + mounted because this Colima VM does not share the worktree's `/private/tmp` + path. The Compose deployment and its volumes were removed after the checks. + +The initial no-DB unit pack completed with **3585 passed**, 11 skips and +three stale-expectation failures: the old PostgreSQL-18 prose ban, the LoCoMo +surface hash and the D143 manifest hashes. All were corrected; the focused +rerun passed **65/65**. The first full PG18/MinIO run was stopped in the legacy oracle after +2659 passes and four LibreOffice skips (1043.91 s). The measured compilation +cost above justified the test-only JIT setting. Its focused complete parity +oracle passed in 91.58 s (83.80 s in the assertion loop). + +The next complete 5199-case pass finished in 2290.71 s: **5175 passed, +2 failed, 20 skipped, 2 xfailed**. Its only failures were the two real +profile-lock timeout cases described above. The fixed complete profile +refresher module now passes **14/14**, including shared and exclusive lock +contention and the unrelated timeout negative proof. The final complete run +reported above includes this corrected module and has no failures. +The opt-in actual-LOGIN native capture +suites passed in separate empty scratch databases on the same PG18 container: +**9 guard tests** and **5 original-view tests** (5.52 s and 8.33 s). Both scratch +databases were removed after their tests. + +The 20 skips comprise four host LibreOffice tests (covered by the container +run above), 14 explicit-scratch native capture tests (all passed separately), and two +fixture-conditional query tests where this corpus has no fact ID shared by +both relation and observation kinds. The two expected failures are the +existing D122 Claimify cross-section window gaps, in normal ingestion and +claims backfill; this change leaves them explicit and unchanged. + +## Required remember.dev changes + +Read-only audit of `writeitai/ultimate-memory-cloud` local checkout +`1f80bb577` on 2026-11-14. These are changes for a separate managed migration +PR and operational plan; no files in that repository or running hosts were +changed here. Replace historical source pins only when a release from this +engine change is available; this draft supplies no published foundation digest. + +1. **Foundation and `umc-pg-01`.** Replace the PG19 foundation digest in + `infra/opentofu/umc-postgres/prod.tfvars` and the current database inventory + in `infra/prod.yaml` with the release's `remember-stack-postgres:18-` + manifest digest (amd64 child must be qualified). Change the recorded server + version to the selected 18.x minor. Rebuild `umc-postgres:pgbackrest` from + that digest with `infra/opentofu/umc-postgres/backup/Containerfile`; the host's + `/opt/umc-postgres/compose.yaml` and `x-umc-base-image` must name that base. + Preserve the TLS/HBA, PgBouncer, runtime/admin/collector roles and bounded + settings. `cloud-init.yaml.tftpl` currently preloads `pg_textsearch` only; + keep scheduled per-database partman maintenance unless explicitly selecting + and configuring `pg_partman_bgw`. +2. **Storage and backup host paths.** Provision a fresh PG18 volume or empty + host data directory; the major-specific path is `/var/lib/postgresql/18/docker`, under + the existing `/var/lib/postgresql` volume mount. Change + `backup/pgbackrest.conf`'s `pg1-path` from `/19/docker` to `/18/docker` and + install the rendered config on the host. Plan a new qualified PG18 backup + namespace (pgBackRest stanza/history) and full baseline with a restore drill; old PG19 physical + backups/WAL are not PG18 recovery inputs. Do not open the PG19 directory + on 18 or attempt a `pg_upgrade` downgrade. Inventory databases first and + choose source replay or independently tested logical transfer if anything + must survive. Coordinate the application stop/cutover with that choice. +3. **Capture schema/profile.** In + `infra/capture/native/schema-definition.json`, change `postgres_major` from + 19 to 18 and `btree_gist=1.9` to `btree_gist=1.8`; bind the actual released + schema head, complete root set and source revision. The engine-side guard + now requires 18. `scripts/generate_capture_profile.py` currently carries + `postgres_major` forward from the old schema document: update that + generator to derive/assert 18 from the pinned engine contract, so it cannot + regenerate an apparently current PG19 profile. Run the canonical + `scripts/prepare_engine_pin_update.py` workflow (after the item 4 tag-validator + change) to move the released engine + pins/locks, then regenerate `infra/capture/native/` preimages, index, + `runtime-source.json` and `run-profile.json`; run its offline check. Install + guard/catalog functions with the existing least-privilege roles in every + database, qualify the new image/source/schema and original native view, + and register the new exact profile digests before resuming capture. Keep + old dated receipts as history. Recheck clock admission on the actual host; + synthetic engine fixtures do not qualify production clocks or billing. +4. **Runtime CI, pin automation and packaged engine.** First change + `scripts/prepare_engine_pin_update.py`'s PostgreSQL receipt regex: it + currently accepts only `19`, `19beta…` or `19rc…` tags and will reject + `18-`. Require the new `18` tag family and update its test receipts. + Run it for a new released engine version; it deliberately refuses different + immutable evidence for the same version, so do not repin released 0.20.0. + It must update `infra/fleet-worker/engine-pin.json`'s foundation tag/major, + manifest and platform digests, application/source/schema pins and + `release/image-lock.yaml`. Change `.github/workflows/runtime-check.yml` + from its digest-pinned `19rc1-0.18.1` foundation to the released PG18 digest. + Advance `runtime/engine.lock`, `runtime/pyproject.toml`, the root lock and + the engine source pin through the canonical pin update command. Run the + runtime/provisioning suites against PG18, including native capture/profile + freshness, actual LOGIN privilege/timeout tests, query-space and readiness. + Rebuild runtime and provisioning images from those pins. +5. **Provisioning and dependent Compose.** Update + `infra/fleet-worker/remember-stack-compose.yaml` to the release's PG18 + foundation and matching engine. Apply the accepted image/profile inputs to + `infra/opentofu/umc-provisioning/` and `infra/opentofu/umc-business-pool/` + (`main.tf` / `prod.tfvars` load the capture run profile) and their jobs. Verify an empty + deployment creates all extensions and reaches the released Alembic head, + runtime/admin/graph/query/capture roles retain the required grants, + PgBouncer/TLS connections and per-database partman maintenance work, + capture registration binds the new digests, and health/readiness/first + ingestion succeed before routing traffic. Update the current host and + provisioning docs/inventory (including the `umc-business-pool` reference) + after readback; keep historical benchmarks and rollout receipts dated. diff --git a/docs/development/storage-capture-original-view.md b/docs/development/storage-capture-original-view.md index b4b3b1d84..32a7df9d3 100644 --- a/docs/development/storage-capture-original-view.md +++ b/docs/development/storage-capture-original-view.md @@ -143,9 +143,9 @@ The fixture owns that fresh database for this file. Use a fresh target for a separate guard-suite run; this command does not collect or execute its optional permissions case. Remove only the owned scratch container afterward. -PostgreSQL's [repeatable-read semantics](https://www.postgresql.org/docs/19/transaction-iso.html#XACT-REPEATABLE-READ) +PostgreSQL's [repeatable-read semantics](https://www.postgresql.org/docs/18/transaction-iso.html#XACT-REPEATABLE-READ) define the first non-transaction-control statement as the view boundary; -its [locking contract](https://www.postgresql.org/docs/19/explicit-locking.html#LOCKING-TABLES) +its [locking contract](https://www.postgresql.org/docs/18/explicit-locking.html#LOCKING-TABLES) distinguishes the extraction pin from writer exclusion. Both sources retrieved 2026-11-11. These semantics motivate the original-session implementation; they do not substitute for native qualification. diff --git a/plan/README.md b/plan/README.md index f14f0baa1..b11e84b9e 100644 --- a/plan/README.md +++ b/plan/README.md @@ -92,6 +92,10 @@ and its [analysis](analysis/version_effective_time_and_section_references.md); t [delivery plan](plans/effective_time_and_section_references.md) says which parts ship together. It also makes D56's version reuse hold for dated versions (text origin time). +For the sole supported server major, see [D157](../decisions.md#d157-postgresql-18-is-the-reference-server), +its [analysis](analysis/postgres18_reference_server.md) and +[graph runtime contract](designs/p2_graph_design.md#9-postgresql-18-and-extension-posture). + For why ranked search must use its indexes, how it keeps eligibility exact and reports every early stop, and how semantic recall is measured, start with [D142 in the P1 search design](designs/postgres_p1_search_projection_design.md#8-query-and-filtering-contract), its [analysis](analysis/index_driven_ranked_search.md), the unchosen diff --git a/plan/analysis/postgres18_reference_server.md b/plan/analysis/postgres18_reference_server.md new file mode 100644 index 000000000..44cd05800 --- /dev/null +++ b/plan/analysis/postgres18_reference_server.md @@ -0,0 +1,80 @@ +# PostgreSQL 18 reference server (2026-11-14) + +## Problem and owner constraints + +D98 adopted PostgreSQL 19 Beta 3 to use SQL/PGQ property graphs. Beta 4 +removed that feature; the owner's 2026-11-06 RC 1 amendment replaced the +one-hop graph query with ordinary joins. The remaining engine uses no +PostgreSQL 19 feature. Running a release candidate now buys no capability, +and pg_textsearch 1.5.1 needs a forced `` include with RC 1 headers. +The owner chooses one stable major, PostgreSQL 18, with no dual-version +support or compatibility shims. There are no user databases to preserve. + +## Alternatives and evidence + +- **Stay on 19.** Retains prerelease server/catalog risk and the compiler + workaround without providing SQL/PGQ. Rejected. +- **PostgreSQL 18.** Supports the current relational graph and extensions. + Keep pgvector 0.8.6, pg_partman 5.5.0 and pg_textsearch 1.5.1 pinned; + change only their server target. Accepted as D157. +- **Support both.** Adds guards, image and test combinations with no user + need. Rejected. Revisit a major only through a new reviewed decision. + +Primary sources retrieved 2026-11-14: + +- [PostgreSQL 18.6 release notes](https://www.postgresql.org/docs/release/18.6/) + date the release to 2026-08-13. +- [18.7 release notes](https://www.postgresql.org/docs/release/18.7/) + date it to 2026-11-12. It fails the owner's two-week minimum age. + Therefore 18.6 is the newest eligible minor, not the newest published one. +- [Official image record on 2026-10-28](https://github.com/docker-library/repo-info/blob/e99222a981c35f94ad85de0959a7869ea8e39b80/repos/postgres/remote/18.6-trixie.md) + records index `sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4` + and the amd64/arm64 builds. Both the index and children meet the age floor. +- [PGDG all-versions archive](https://apt-archive.postgresql.org/) supplies + the same pinned PG18 package versions: pgvector `0.8.6-1.pgdg13+2` and + pg_partman `5.5.0-1.pgdg13+1`. Build headers match server + `18.6-1.pgdg13+2` exactly. +- [pg_textsearch pinned source](https://github.com/timescale/pg_textsearch/tree/fa142d049d08eac45a263f5abc250c8877ae076e) + supports PG18. Its archive, license and notice checksums stay unchanged. +- [PostgreSQL 18 constraint catalog](https://www.postgresql.org/docs/18/catalog-pg-constraint.html) + already includes first-class NOT NULL constraints (`contype = 'n'`); + their presence is not a PG19 dependency. The built image exposes + `btree_gist` 1.8 rather than PG19's 1.9; the native capture guard must + use the actual PG18 version. + +## Failure, recovery and boundaries + +Fresh PostgreSQL 18 storage runs the complete existing Alembic chain. A PG19 +physical directory cannot become PG18 storage by changing its image, and +`pg_upgrade` does not downgrade. Development stores are recreated and replayed. +Any managed data-preservation plan belongs to the operator and must qualify a +logical export/import or source replay independently; this change supplies no +PG19 conversion mechanism. Graph, P1 and least-privilege capture gates keep +refusing an unexpected server major. No ingestion policy, provider prompt, +content identity, embedding key or extraction/reuse generation changes. + +Current operating contracts live in the [graph design](../designs/p2_graph_design.md) +and [P1 design](../designs/postgres_p1_search_projection_design.md). +Build and suite evidence belongs in [docker/README.md](../../docker/README.md) +and the PR, not in historical benchmark receipts. + +## Observed lock-timeout difference + +The complete PG18 run exposed a runtime dependency on server error prose in +`spine/profile_refresher.py`. A real advisory-lock timeout reports SQLSTATE +`57014`, message `canceling statement due to statement timeout`, and no error +context on 18.6. The old check also required the phrase `advisory lock`, so +both the shared identity-epoch and exclusive evidence-lock tests returned an +ordinary database failure instead of typed profile contention. + +Use SQLSTATE plus the identity of the two fixed advisory-lock statements. +Their only work is the engine-owned lock operation; a timeout there means +that bounded acquisition did not finish. The existing negative proof sends +an unrelated `pg_sleep` statement through the helper and must still receive +an ordinary database failure. Parsing localized server prose is rejected. +Switching to immediate try-locks or adding another timeout policy is also +unnecessary: keep the existing bounded wait and its retry semantics. + +This restores the current profile-publication contract on 18. It changes no +reuse input or generation. Evidence workers retain their committed fact work +and handle disposable profile contention without replaying paid inference. diff --git a/plan/analysis/postgres19_sqlpgq_live_graph_analysis.md b/plan/analysis/postgres19_sqlpgq_live_graph_analysis.md index 8a53763c9..af989ba1f 100644 --- a/plan/analysis/postgres19_sqlpgq_live_graph_analysis.md +++ b/plan/analysis/postgres19_sqlpgq_live_graph_analysis.md @@ -1,7 +1,11 @@ # Analysis: PostgreSQL 19 SQL/PGQ as the live graph -**Status:** non-binding analysis for D98; SQL/PGQ parts overtaken by §10 -(2026-11-06) +**Status:** historical, non-binding D98 analysis. SQL/PGQ was overtaken by +§10 (2026-11-06); the PostgreSQL 19 server choice is superseded by +[D157](../../decisions.md#d157-postgresql-18-is-the-reference-server) +(2026-11-14). The current reference is PostgreSQL 18; the measurements below +remain evidence for their original PG19 builds. See the +[PG18 analysis](postgres18_reference_server.md). **Date:** 2026-08-27 **Repository baseline:** `origin/main` on branch `design/postgres19-sqlpgq-live-graph` diff --git a/plan/designs/entity_identity_and_retrieval_design.md b/plan/designs/entity_identity_and_retrieval_design.md index 3f2d90c16..2630dcefd 100644 --- a/plan/designs/entity_identity_and_retrieval_design.md +++ b/plan/designs/entity_identity_and_retrieval_design.md @@ -457,10 +457,13 @@ operator can inspect or replay queued proposals. Merge and unmerge continue to refresh affected profiles through the non-recursive base refresher so a merge does not recursively trigger itself. -Profile publication has its own bounded identity/evidence lock wait. A -PostgreSQL statement timeout whose cause is specifically an advisory-lock wait -is translated to `ProfileRefreshContendedError`; it is not a generic database -failure. Evidence workers have already committed the authoritative fact change +Profile publication has its own bounded identity/evidence lock wait. SQLSTATE +`57014` while executing either fixed identity/evidence advisory-lock statement +is translated to `ProfileRefreshContendedError`. Identify those two operations +from their engine-owned statements: PostgreSQL 18 supplies no lock context in +this timeout error, so matching server error prose cannot establish the cause +(D157; [measured difference](../analysis/postgres18_reference_server.md#observed-lock-timeout-difference)). +The existing wait bound is unchanged. Evidence workers have already committed the authoritative fact change before this disposable projection step, so they record the typed contention, leave the projection fail-closed, and complete without replaying paid normalization or adjudication. A later evidence mutation owns another refresh diff --git a/plan/designs/ingest_principal_design.md b/plan/designs/ingest_principal_design.md index 029d8d4e2..3f196f35c 100644 --- a/plan/designs/ingest_principal_design.md +++ b/plan/designs/ingest_principal_design.md @@ -140,7 +140,7 @@ out). `NOT VALID` is **scan-free** (`seq_scan=0`), removing that table-size dependence. Be precise about what it is not: `NOT VALID` is **not lock-free**. -PostgreSQL 19 still takes `ShareRowExclusiveLock` for the DDL, held until +PostgreSQL 18 takes `ShareRowExclusiveLock` for the DDL, held until this atomic transaction commits, and a concurrent writer waits on it. The property gained is *bounded and brief* rather than *proportional to row count*. Nothing is skipped by it either: diff --git a/plan/designs/locomo_benchmark_design.md b/plan/designs/locomo_benchmark_design.md index 0509ee1cf..6e89890f0 100644 --- a/plan/designs/locomo_benchmark_design.md +++ b/plan/designs/locomo_benchmark_design.md @@ -431,7 +431,7 @@ compatibility form. The response contains: - its status and completion time; - exact `pipeline`, `p1`, `live_graph`, and `p3` capability members, each with `required`, `ready`, `checked_at`, and a typed non-secret reason; -- P3 version/publication evidence when P3 is required, plus PostgreSQL 19 +- P3 version/publication evidence when P3 is required, plus PostgreSQL 18 live-graph view, grant, helper-version, role-limit, and same-snapshot proven-absent-anchor execution checks when live graph is required; - an overall `ready` that is the conjunction of the requested capabilities; diff --git a/plan/designs/open_query_space_design.md b/plan/designs/open_query_space_design.md index 55ac5d038..54225824a 100644 --- a/plan/designs/open_query_space_design.md +++ b/plan/designs/open_query_space_design.md @@ -1,6 +1,6 @@ # Open query space — binding design -> **Binding D98 amendment (2026-08-27).** Public Cypher and the immutable P2 +> **Binding D98/D157 amendment (2026-11-14).** Public Cypher and the immutable P2 > graph surface are removed. `query_cypher` and `explain_cypher`, Cypher > grammar/limits/errors, `snapshot_graph`, `p2_snapshot`, generation discovery, > and P2 confirmation are not public or internal contracts. A server-owned, @@ -8,7 +8,7 @@ > replacement public bounded `graph_neighborhood`/`graph_path`/ > `graph_citation_path` SQL functions and > typed graph operations use recursive SQL for variable/shortest traversal. -> PostgreSQL 19 RC 1 has no SQL/PGQ (Beta 4 removed it; D98 RC 1 amendment), +> PostgreSQL 18 has no SQL/PGQ (D157), > so SQL/PGQ is not part of any surface. All plain-SQL, invariant > compilation, tenancy, saved-query, > discovery, result-cap, audit, and assured-operation rules below remain binding. @@ -46,7 +46,7 @@ D54, D80, and D87 remain controlling.* ## 1. Principles (binding) 1. **PostgreSQL authorizes every live result.** The live public data language IS - PostgreSQL 19 SQL over the versioned `memory_v1` schema. Physical tables, + PostgreSQL 18 SQL over the versioned `memory_v1` schema. Physical tables, raw projection tables, and operator schemas are never public. PostgreSQL views compile row-level invariants; P1 ranked scans, the fixed one-hop read, and recursive graph helpers apply those authorities in the same transaction. @@ -858,7 +858,7 @@ EXECUTE privilege for subsequent functions in this schema. ### 3.5 Graph query boundary -Public Cypher is removed. The reference server (PostgreSQL 19 RC 1 and later) +Public Cypher is removed. The reference server (PostgreSQL 18) has no SQL/PGQ, so there is no graph-pattern syntax to admit, and the default-deny `pglast` gate rejects it as well. The typed graph API and server-owned SQL use the live-graph contract in @@ -1723,7 +1723,7 @@ for the shipping surface pass before release. |---|---|---| | `lexical_facts(query, k, filters)` | D94 stores fact embeddings on natural relation/observation rows but deliberately does not expand the admitted facts lexical surface. The binding P1 contract exposes semantic facts only. | Trigger: **a pg_textsearch BM25 index and scored fact-label lexical method are designed together**. Adoption requires frozen exact-term fixtures, the same analyzer/rank/score and D142 ranked-read nomination/confirmation contract as claims/chunks, current/at/overlap/history equivalence, the facts-filter allowlist, manifest enumeration, a `facts_context` descriptor/version roll adding lexical fusion, and same-change OSS docs. | | Complete removal of the assured-operation layer | One-call typed defaults remain product value; this design does not decide their deletion | An open-only evaluation shows no material loss from removing the one-call fallback: overall success lower 95% bound ≥ -2 points versus hybrid, every critical category ≥ -5 points, zero added D41/D48/D54/security violations, median calls increase ≤1, and p95 latency/cost increase ≤20%. Removal requires a separate binding decision and, if consumers exist by then, a migration plan proportional to actual usage. | -| Public arbitrary SQL/PGQ | PostgreSQL 19 Beta 4 removed SQL/PGQ, so the reference server (RC 1 and later) cannot run it. The release exposes only the server-owned one-hop read and typed/bounded graph functions. | Adopt only if a supported PostgreSQL release ships SQL/PGQ again and the public AST gate parses its complete admitted grammar and rejects every unsupported/mutating form by structure. A separate binding proposal must define the admitted subset, tenancy rewrite, budgets, result contract, fuzz corpus, and manifest representation. | +| Public arbitrary SQL/PGQ | The reference server, PostgreSQL 18, has no SQL/PGQ. The release exposes only the server-owned one-hop read and typed/bounded graph functions. | Adopt only if a supported PostgreSQL release ships SQL/PGQ again and the public AST gate parses its complete admitted grammar and rejects every unsupported/mutating form by structure. A separate binding proposal must define the admitted subset, tenancy rewrite, budgets, result contract, fuzz corpus, and manifest representation. | | Pgvectorscale StreamingDiskANN as the default ANN index | D94 binds pgvector HNSW first; installing an additional index extension without a present need violates YAGNI | The open proposal may inform a later binding decision. D94 does not install, test, benchmark, or pre-authorize it; a future promotion changes only the private vector index, never the public query contract or storage boundary. | | Media-segment public views/SRF | The binding media row/embedding contract is not yet part of this schema | First production corpus requiring SQL composition over D65 media segments; a separate design adds typed locators/derivation and rolls the schema/hash. | | Saved-query marketplace and shared dependencies | Signing, supply-chain review, publisher liability, and fleet recall are outside customer-local registry v1 | First operator-approved cross-deployment sharing requirement, followed by a signing/install/revocation design and adversarial supply-chain suite. | diff --git a/plan/designs/overall_design.md b/plan/designs/overall_design.md index 05020fa87..f09121c30 100644 --- a/plan/designs/overall_design.md +++ b/plan/designs/overall_design.md @@ -1,7 +1,7 @@ # Overall System Design -> **Binding D98 amendment (2026-08-27).** The architecture has no LadybugDB or -> physical P2 graph projection. PostgreSQL 19 serves a live graph over +> **Binding D98/D157 amendment (2026-11-14).** The architecture has no LadybugDB or +> physical P2 graph projection. PostgreSQL 18 serves a live graph over > authority views: a fixed relational join handles one-hop neighborhoods and > bounded recursive SQL handles depth-two, variable, and shortest traversal > (SQL/PGQ served the one-hop read until PostgreSQL 19 Beta 4 removed it; D98 @@ -168,7 +168,7 @@ through ordinary engine work and retains full reconcile as repair (D155). supported by compiled cross-project pattern summaries. Only an accountable author promotes or changes a principle; citations, watches, review flags, and dispatch keep it connected to changing evidence without rewriting it. E3 remains the system's current fact state. -- **Live graph**: private live PostgreSQL 19 views over normalized authority +- **Live graph**: private live PostgreSQL 18 views over normalized authority tables are the graph's nodes and edges; a fixed relational join serves the one-hop neighborhood; deployment-scoped, work-bounded frontier traversal serves depth-two, variable, and shortest paths. There is no copied graph data, @@ -267,7 +267,7 @@ PG entity registry (D98) → GCS bytes | `entity_identity_and_retrieval_design.md` | referent identity, no entity types, profile from observations, default retrieval (D95–D97) | **current** | | `k_layers_design.md` | plane K: planner/writer/driver compile system, compiled + authored pages, K1 plus K2 purpose scopes (D45–D47, D73) | **current** | | `k3_beliefs_design.md` | *(withdrawn — D73; principles are authored K2 content)* | — | -| `p2_graph_design.md` | PostgreSQL 19 live graph, one-hop join, bounded traversal, limits, recovery | **current** | +| `p2_graph_design.md` | PostgreSQL 18 live graph, one-hop join, bounded traversal, limits, recovery | **current** | | `retrieval_design.md` | the query machine: primitives, assured operations, envelope, mounts, skill (D48–D51, D87) | **current** | | `postgres_schema_design.md` | spine schema, tables, indexes, partitioning, deletion cascade | **current** | | `postgres_p1_search_projection_design.md` | PostgreSQL-native P1 storage, retrieval indexes, readiness, rebuild, and Lance removal (D94) | **current** | diff --git a/plan/designs/p2_graph_design.md b/plan/designs/p2_graph_design.md index a31280cf0..a28decf75 100644 --- a/plan/designs/p2_graph_design.md +++ b/plan/designs/p2_graph_design.md @@ -1,6 +1,6 @@ # Live PostgreSQL Graph — Binding Design -**Status:** binding under D98 +**Status:** binding under D98 and D157 **Date:** 2026-08-27 @@ -10,6 +10,9 @@ Beta 4 removed SQL/PGQ, so the one-hop read is a plain relational join and the property graphs are gone. The graph itself is unchanged. +**Reference-server amendment:** 2026-11-14 (D157): PostgreSQL 18 is the +only supported major; the relational graph contract is unchanged. + **Analysis:** [`postgres19_sqlpgq_live_graph_analysis.md`](../analysis/postgres19_sqlpgq_live_graph_analysis.md) @@ -22,7 +25,7 @@ depend on. The former LadybugDB P2 copied that state into immutable graph generations and added an export/build/publish/download/open lifecycle. There are no compatibility consumers. The graph is therefore served directly -from PostgreSQL 19: +from PostgreSQL 18 (D157): - Private live PostgreSQL views over the authority tables are the graph's nodes and edges. Graph rows are not copied into another store. @@ -44,13 +47,11 @@ PostgreSQL authority tables +-- private live/history node and edge views -- bounded frontier traversal ``` -The cutover originally used PostgreSQL 19's SQL/PGQ (`CREATE PROPERTY GRAPH` -and `GRAPH_TABLE`, the SQL standard's graph-pattern syntax) for the one-hop -read. PostgreSQL 19 Beta 4 reverted SQL/PGQ, so release candidate 1 and the -final release cannot parse it. PG19's SQL/PGQ was only a query rewrite: a -`GRAPH_TABLE` pattern was turned into ordinary joins over the views a property -graph named. The engine now writes those joins itself, over the same views, so -results are the same and nothing about the graph's data or semantics changed. +The earlier SQL/PGQ one-hop implementation was replaced by ordinary joins +when upstream removed that feature (D98 RC 1 amendment). PostgreSQL 18 +provides those joins and all bounded traversal helpers, so retaining a +prerelease server has no capability benefit. D157 removes that dependency. +The historical experiment remains in the linked analysis. The supported capability is the **live graph**. The legacy filename is retained only to keep established corpus links stable; it is not a current plane name. @@ -507,16 +508,13 @@ its artifacts do not become graph authority. - Typed graph endpoints call only fixed SQL or the bounded functions. They do not interpolate identifiers, labels, properties, predicates, or depth. - Public Cypher is removed. -- The reference server (PostgreSQL 19 RC 1 and later) has no SQL/PGQ, so +- The reference server (PostgreSQL 18) has no SQL/PGQ, so public SQL/PGQ is not part of the surface. The exhaustive `pglast` gate also rejects that syntax; bypassing the parser or maintaining a second lexical allowlist is forbidden. -- The PostgreSQL-18 grammar gate in front of a PostgreSQL-19 server is itself - an explicit compatibility boundary. Release tests diff reserved/unreserved - keywords, admitted statement/node shapes, and callable built-ins between - majors and prove that new PG19 syntax/functions are rejected by default. - An AST accepted under the PG18 grammar may execute only through the existing - function/view allowlists; no name-resolution semantic drift is assumed safe. +- The `pglast` PostgreSQL 18 grammar matches the reference server major. + Accepted syntax still executes only through the existing function/view + allowlists; graph-pattern syntax and unlisted built-ins remain rejected. ### Surface and transport contract @@ -582,32 +580,25 @@ because it is not one of the recursive entity-expansion helpers. Measurements record hardware, cardinality, skew, and p50/p95/p99 rather than weakening correctness to a small-fixture promise. -## 9. PostgreSQL 19 and extension posture +## 9. PostgreSQL 18 and extension posture -The reference image tracks the latest PostgreSQL 19 prerelease by exact image -digest: first the Beta 3 image proven in the analysis, release candidate 1 -since 2026-11-06, and the final release when it ships. There are no user -databases to preserve. Until GA: +The reference and self-host image runs only PostgreSQL 18 (D157). It pins +an official `18.x-trixie` multi-platform digest, choosing the newest minor +and image at least two weeks old. The initial 18.6 image is recorded in +`docker/README.md`, including dated source evidence and child digests. -- no prerelease database contains irreplaceable production data; -- migrations and representative fixtures must replay from empty storage; -- every beta/RC bump rebuilds the image and runs the full migration, - pgvector/HNSW, pg_textsearch/BM25, pg_partman, one-hop, traversal, backup, - and restore gates; -- the complete extension/one-hop/traversal matrix passes on both `linux/amd64` and - `linux/arm64`, with per-architecture image/artifact digests recorded; -- prerelease-to-prerelease data-directory compatibility is not assumed; -- GA is another tested image replacement, after which ordinary supported - major/minor upgrade policy resumes. +Every image change rebuilds both `linux/amd64` and `linux/arm64`, records +per-architecture image/artifact digests, and runs migrations from empty, +pgvector/HNSW, pg_textsearch/BM25, pg_partman, one-hop, traversal, backup, +restore and the complete engine suite. There is one server target; no +PG19 compatibility or Beta 3 cleanup mechanism is maintained. The reference image pins pgvector and pg_partman packages. `pg_textsearch` is -pinned to an upstream release of 1.5.1 or later (D142), which supports -PostgreSQL 19 upstream, so the earlier 1.3.1 compatibility patch is retired and no -local patch is carried (the P1 search design §8.3 bounds the extension's +pinned to upstream 1.5.1 (D142/D157), which supports PostgreSQL 18. No +local patch or forced-header compiler workaround is carried (the P1 search design §8.3 bounds the extension's memtable-versus-segment scoring difference instead of patching it). -Upstream treats PostgreSQL 19 as best-effort with non-blocking CI, so the image -build runs the extension's upstream SQL tests on the pinned PostgreSQL 19 image -as a local gate. Its PostgreSQL License permits use, modification, and +The image build runs the extension's upstream SQL tests on the exact pinned +PostgreSQL 18 server as a local gate. Its PostgreSQL License permits use, modification, and distribution when the required notices accompany copies. OSS release engineering records source, notice, compiler/toolchain, and per-architecture binary checksums. No floating `main` branches enter the image. @@ -645,15 +636,12 @@ snapshot only until the bounded transaction ends. Migrations replace the graph views and their grants transactionally around incompatible view changes. Rollback means deploying the preceding application and replaying its schema on a compatible PostgreSQL image; it never means reviving Ladybug. -During PostgreSQL 19 prereleases, rollback is rebuild-and-restore from a -logical/known-compatible source, not reusing an unverified data directory. - -A store created on PostgreSQL 19 Beta 3 still holds the two former SQL/PGQ -property graphs. `pg_upgrade` and `pg_restore` replay their DDL, which RC 1 -cannot parse, so the store first runs migration `p9_44_0065` on Beta 3, which -drops them, and then moves to RC 1. The catalog version also changed between -Beta 3 and RC 1, so the data directory moves by `pg_upgrade` or -`pg_dump`/`pg_restore`, never by opening it directly. +A server-major change requires fresh storage and a separately verified +transfer or replay. A PG19 directory cannot be opened by PostgreSQL 18, and +`pg_upgrade` cannot downgrade it. With no user databases, this cutover +recreates development stores and replays migrations and inputs. An operator +who must preserve managed data must qualify logical export/import or source +replay separately; the engine provides no PG19 conversion path. ## 11. Observability and readiness @@ -708,7 +696,7 @@ graph path, or rebuild-ready signal. Implementation is accepted only when all of these pass: -1. fresh PostgreSQL 19 migration creates the graph views and each view's key +1. fresh PostgreSQL 18 migration creates the graph views and each view's key query proves unique; 2. one-hop tests prove tenant isolation, direction, current/as-of visibility, anchor exclusion, deduplication, deterministic @@ -727,7 +715,7 @@ Implementation is accepted only when all of these pass: graph build and that graph provenance/truncation are preserved; 6. forget and restore tests find no graph artifact inventory and prove view disappearance after commit; -7. HNSW, BM25, pg_partman, migration, PG18-parser/PG19-executor negative tests, +7. HNSW, BM25, pg_partman, migration, PG18 parser/executor negative tests, and query-space tests pass on both linux/amd64 and linux/arm64 images; 8. repository searches and dependency locks contain no active Ladybug runtime, P2 generation worker, public Cypher route, or P2 readiness contract; @@ -756,7 +744,7 @@ Rejected by this design: and its shortest-path helper does not carry the arbitrary two-clock edge predicate; - pgGraph, because its CSR artifacts reintroduce generations and its inspected - release lacks PostgreSQL 19 and the required per-edge temporal predicate; + release lacks the required per-edge temporal predicate; - SQL/PGQ as the traversal engine, because PostgreSQL 19 Beta 3 lacked quantified and shortest paths. SQL/PGQ served the one-hop read from the cutover until PostgreSQL 19 Beta 4 removed it; the relational join over the diff --git a/plan/designs/packaging_distribution_design.md b/plan/designs/packaging_distribution_design.md index 18a1d2ffe..d43f99eec 100644 --- a/plan/designs/packaging_distribution_design.md +++ b/plan/designs/packaging_distribution_design.md @@ -1,7 +1,7 @@ # Packaging & Distribution — Artifacts, Task Execution, Code Architecture (Design) -> **Binding D98 amendment (2026-08-27).** The shipped database is the pinned -> PostgreSQL 19 image with pgvector, pg_textsearch, and pg_partman (the +> **Binding D98/D157 amendment (2026-11-14).** The shipped database is the pinned +> PostgreSQL 18 image (D157) with pgvector, pg_textsearch, and pg_partman (the > server has no SQL/PGQ since the D98 RC 1 amendment). Packaging contains no Ladybug wheel, graph snapshot volume, graph > builder/reader, or public Cypher API/CLI/MCP surface. Typed live graph > operations and public bounded SQL helpers remain. Pre-D98 references to open diff --git a/plan/designs/postgres_p1_search_projection_design.md b/plan/designs/postgres_p1_search_projection_design.md index 07251df33..e91de251c 100644 --- a/plan/designs/postgres_p1_search_projection_design.md +++ b/plan/designs/postgres_p1_search_projection_design.md @@ -7,7 +7,7 @@ [postgres_p1_search_projection_analysis.md](../analysis/postgres_p1_search_projection_analysis.md) **Supersedes:** D8's LanceDB placement, D93, and the removed D93 maintenance design **Amends:** D9, D23, D37, D48, D61, D63, and D80 as recorded in D94; -PostgreSQL version/runtime amended by D98; ranked-query execution (§8–§9), +PostgreSQL version/runtime amended by D98 and D157; ranked-query execution (§8–§9), the `pg_textsearch` pin (§6) and the benchmark scope (§3) amended by [D142](../../decisions.md#d142-ranked-search-nominates-from-the-index-and-confirms-in-one-snapshot) ([analysis](../analysis/index_driven_ranked_search.md)) @@ -27,7 +27,7 @@ and functional proof that the existing retrieval contracts still hold. ## 2. Decision -P1 SHALL be implemented in PostgreSQL 19 using: +P1 SHALL be implemented in PostgreSQL 18 using: - `pgvector` for semantic vectors and HNSW indexes; - `pg_textsearch` for the admitted BM25 channels; @@ -168,20 +168,18 @@ normalized searchable copy per live chunk, not another full source document. ## 6. Extensions and supported PostgreSQL -Reference and self-host images SHALL run PostgreSQL 19. Before GA, they pin the -latest proven beta/RC image digest and replay from disposable storage; after -GA, they track the current patched 19.x minor. The image carries pinned and -tested builds of: +Reference and self-host images SHALL run only PostgreSQL 18 (D157). Pin an +official 18.x image by digest, selecting the newest minor and image at least +two weeks old. The image carries pinned and tested builds of: - `vector` (0.8 or later, for iterative index scans; the image pins 0.8.6); and - `pg_textsearch`, including its required preload configuration, at **1.5.1 - or later** (D142). 1.5.0 added upstream PostgreSQL 19 beta support, so the - D98 compatibility patch is retired; it also made post-filtered BM25 index + or later** (D142; the image pins 1.5.1). No local compatibility patch or + forced-header compiler workaround is carried. 1.5.0 made post-filtered BM25 index scans grow their internal batch until the `LIMIT` is filled or matches are exhausted and fixed silent truncation in deep scans. Releases before 1.4.0 return the index's top-k *before* filtering, which §8 must never rely on. - Upstream describes PostgreSQL 19 support as best-effort with non-blocking - CI, so compatibility on the pinned PostgreSQL 19 image is a **local gate**: + Compatibility on the pinned PostgreSQL 18 image remains a **local gate**: the image build runs the extension's upstream SQL tests and the §8.3 cursor/scoring-generation tests on that exact image. 1.5.1 scores unspilled (memtable) rows with raw document length while diff --git a/plan/designs/postgres_schema_design.md b/plan/designs/postgres_schema_design.md index 2c43d79fd..b60b0ce8d 100644 --- a/plan/designs/postgres_schema_design.md +++ b/plan/designs/postgres_schema_design.md @@ -7,7 +7,7 @@ > generation readiness, source validation, conservative conflicts, rebuild, > and hard-forget lifecycle are part of the schema contract. -> **Binding D98 amendment (2026-08-27).** PostgreSQL 19 is also the live graph +> **Binding D98/D157 amendment (2026-11-14).** PostgreSQL 18 is also the live graph > execution host. Private live views over normalized authority data are the > graph's nodes and edges; a fixed relational join reads one hop and bounded > recursive functions perform variable/shortest traversal (the SQL/PGQ @@ -182,10 +182,10 @@ CREATE EXTENSION IF NOT EXISTS vector; -- D94 PostgreSQL-native semantic CREATE EXTENSION IF NOT EXISTS pg_textsearch; -- D94 chunk/claim BM25; also required in shared_preload_libraries ``` -PostgreSQL **19** is the binding baseline under D98. Before GA the image pins -the latest proven beta/RC digest and databases are replayable; after GA it -tracks the current patched 19.x minor. The selected pg_textsearch source plus -reviewed compatibility patch must pass its upstream SQL suite on PostgreSQL 19. +PostgreSQL **18** is the binding baseline under D157. The official image +is pinned by digest to the newest minor and image at least two weeks old. +The pinned pg_textsearch source must build without a compatibility patch or +forced-header workaround and pass its upstream SQL suite on PostgreSQL 18. `vectorscale` is absent from the baseline. Pgvectorscale remains an unchosen open proposal; promoting it would require a later binding decision. Composite-FK column-list `ON DELETE SET NULL` requires 15+; this is @@ -2321,8 +2321,8 @@ reintroduce scrubbed authority. The graph schema consists of private current/history node and edge views (`rememberstack_graph_internal`), the normalized `memory_v1` hydration views, and deployment-scoped work-bounded traversal functions. There are no property -graphs: PostgreSQL 19 RC 1 has no SQL/PGQ, and migration `p9_44_0065` drops -the two a Beta 3 store held. Composite graph keys and all source/destination +graphs: PostgreSQL 18 has no SQL/PGQ. The retired cleanup revision +`p9_44_0065` is a no-op; no PG19 compatibility path remains. Composite graph keys and all source/destination references include `deployment_id`. Current views capture one `statement_timestamp()` per statement; history views expose both half-open time windows for explicit as-of filtering. The complete view shapes, diff --git a/plan/designs/shared_retrieval_eligibility_design.md b/plan/designs/shared_retrieval_eligibility_design.md index a9fce9436..3ddaaac8d 100644 --- a/plan/designs/shared_retrieval_eligibility_design.md +++ b/plan/designs/shared_retrieval_eligibility_design.md @@ -345,8 +345,8 @@ The new index adds one B-tree entry per mention, build I/O/WAL and ongoing write/storage cost. Record index bytes, WAL/build duration and peak resources; no zero-cost or customer-margin claim is made. Build/index lock qualification is required on populated data. The PostgreSQL procedure is supported by -[CREATE INDEX](https://www.postgresql.org/docs/19/sql-createindex.html), retrieved -2026-11-12; online parent creation itself is not supported, hence leaf builds. +[CREATE INDEX](https://www.postgresql.org/docs/18/sql-createindex.html), retrieved +2026-11-14; online parent creation itself is not supported, hence leaf builds. ### 4.3 Facts: one source-qualified projection, one endpoint rule diff --git a/plan/designs/unified_documentation_and_query_space_design.md b/plan/designs/unified_documentation_and_query_space_design.md index ced0ba6b8..2d6994648 100644 --- a/plan/designs/unified_documentation_and_query_space_design.md +++ b/plan/designs/unified_documentation_and_query_space_design.md @@ -58,7 +58,7 @@ Industry-leading open-core infrastructure companies (**Qdrant**, **Supabase**, * │ - Bitemporal Memory Theory │ │ [Self-Hosted OSS] │ │ - E0–E3 Pipeline Architecture│ │ - Docker Compose │ │ - Universal `remember setup`│ │ - Kubernetes / Helm │ -│ - Python SDK (`remember`) │ │ - Bare PostgreSQL 19 + S3 │ +│ - Python SDK (`remember`) │ │ - Bare PostgreSQL 18 + S3 │ │ - Dynamic MCP Server │ │ │ │ - Assured Context Retrieval │ │ [Managed Cloud] │ │ - Open SQL & Graph Space │ │ - Dedicated Private Pods │ @@ -103,9 +103,9 @@ The site navigation on `https://remember.dev/docs` is organized into five focuse - **Open Query Space (`open_query`)**: Full guide to querying the bitemporal relational graph schema (`memory_v1` views: `facts_current`, `graph_edges_current`, `contradiction_members_current`) via SQL. ### 3.4 Section 4: Self-Hosting & Operations (Open Source) -- **Docker Compose Quickstart**: Complete guide to launching the engine, PostgreSQL 19 with `pgvector`, and SeaweedFS object storage locally. +- **Docker Compose Quickstart**: Complete guide to launching the engine, PostgreSQL 18 with `pgvector`, and SeaweedFS object storage locally. - **Production Kubernetes / Helm**: Cluster deployment blueprints, persistent volume configurations, worker scaling (E0–E3), and environment variables. -- **Database Architecture**: PostgreSQL 19 schema spine, live graph queries, Lance/pgvector index maintenance, and Alembic migrations. +- **Database Architecture**: PostgreSQL 18 schema spine, live graph queries, Lance/pgvector index maintenance, and Alembic migrations. - **Backup, Restore & Disaster Recovery**: Cold storage snapshots, S3-compatible replication, and point-in-time recovery. ### 3.5 Section 5: Remember Cloud Platform (Managed Services) diff --git a/plan/designs/unified_remember_distribution_design.md b/plan/designs/unified_remember_distribution_design.md index 747ce3bd6..a241e7243 100644 --- a/plan/designs/unified_remember_distribution_design.md +++ b/plan/designs/unified_remember_distribution_design.md @@ -45,7 +45,7 @@ Prior to D108, the ecosystem maintained two packages with overlapping responsibi This split introduced fundamental developer and agent friction: - **Consumer Confusion**: Users and AI coding agents routinely questioned whether to install `remember` or `rememberstack`, frequently importing the wrong package or attempting to run server-side extras locally. - **Binary Collision**: `rememberstack` registered `[project.scripts] remember = "rememberstack.surfaces.cli:main"`. If both packages were installed into the same environment, binary resolution was non-deterministic. -- **Heavyweight Host Burden**: Self-hosting a distributed bitemporal memory system requires PostgreSQL 19, `pgvector`, S3-compatible object storage, and complex C-extensions (`pglast`, `psycopg`, `pyarrow`). Attempting to install the server directly via `pip install rememberstack[server]` on bare-metal developer machines led to compiler, header, and architecture incompatibilities. +- **Heavyweight Host Burden**: Self-hosting a distributed bitemporal memory system requires PostgreSQL 18, `pgvector`, S3-compatible object storage, and complex C-extensions (`pglast`, `psycopg`, `pyarrow`). Attempting to install the server directly via `pip install rememberstack[server]` on bare-metal developer machines led to compiler, header, and architecture incompatibilities. ### 1.2 Real-World Infrastructure Industry Alignment Modern cloud-plus-open-source developer tools (e.g. **Supabase**, **Sentry**, **PostHog**, **Temporal**) have converged on a single standard pattern: @@ -81,7 +81,7 @@ Modern cloud-plus-open-source developer tools (e.g. **Supabase**, **Sentry**, ** │ GHCR: `ghcr.io/writeitai/remember-stack:` (Docker Engine) │ │ │ │ - The complete containerized engine: FastAPI daemon + E0–E3 workers │ -│ - Orchestrated via official `docker-compose.yaml` (Postgres 19, SeaweedFS) │ +│ - Orchestrated via official `compose.yaml` (PostgreSQL 18, SeaweedFS) │ │ - Consumed by: Self-hosters, CI test harnesses, and Cloud deployment fleet │ └──────────────────────────────────────────────────────────────────────────────┘ ``` diff --git a/plan/plans/postgres19_sqlpgq_live_graph.md b/plan/plans/postgres19_sqlpgq_live_graph.md index 5777a7982..9fd604a5b 100644 --- a/plan/plans/postgres19_sqlpgq_live_graph.md +++ b/plan/plans/postgres19_sqlpgq_live_graph.md @@ -1,9 +1,12 @@ # PostgreSQL 19 SQL/PGQ Live Graph — Implementation Plan -**Status:** implementation complete; release execution gates remain open. -The SQL/PGQ parts were later replaced: PostgreSQL 19 Beta 4 removed SQL/PGQ, -so the one-hop read is a relational join and the property graphs are dropped -(D98 RC 1 amendment, 2026-11-06; migration `p9_44_0065`). +**Status:** historical delivery record of the 2026-08-27 cutover. D98's +2026-11-06 amendment replaced SQL/PGQ with joins; D157 (2026-11-14) replaces +the PostgreSQL 19 server policy with PostgreSQL 18. The former cleanup +revision `p9_44_0065` is now a no-op. Do not use the image or prerelease gates +below as current operating instructions; use the +[current graph design](../designs/p2_graph_design.md) and +[PG18 validation record](../../docs/development/postgres18-reference-validation-2026-11-14.md). **Date:** 2026-08-27 **Binding design:** [`../designs/p2_graph_design.md`](../designs/p2_graph_design.md) **Analysis:** diff --git a/plan/requirements/requirements_v3.md b/plan/requirements/requirements_v3.md index 57057ba2d..b4274b2ab 100644 --- a/plan/requirements/requirements_v3.md +++ b/plan/requirements/requirements_v3.md @@ -103,7 +103,7 @@ on** (citations), so staleness, deletion reach, and audit are mechanical, never their transcript/description happened to mention — D65; the media embedding model is per-deployment configuration, and its absence is reported as a stated capability boundary); fully rebuildable from the spine plus immutable artifacts. -- **Live graph** *(formerly physical P2/L6)*: private PostgreSQL 19 node and +- **Live graph** *(formerly physical P2/L6)*: private PostgreSQL 18 node and edge views over normalized authority views plus bounded recursive traversal; relationships are bi-temporal and support as-of queries. It copies no graph rows, has no projection generation, and becomes visible by ordinary MVCC. @@ -221,8 +221,8 @@ on** (citations), so staleness, deletion reach, and audit are mechanical, never **Fixed engine choices** — the system's identity, never abstracted behind ports: - Relational spine, derived P1 search projection, and live graph: - **PostgreSQL 19**. Before GA, pin the latest proven beta/RC image and keep - storage disposable/replayable; after GA, keep the current patched 19.x minor. + **PostgreSQL 18** (D157), the sole supported major. Pin the official + image by digest, choosing the newest minor and image at least two weeks old. Install **pgvector** (semantic indexes; reference Qwen profile fixed at 1,536 dimensions) and **pg_textsearch** (BM25). Pgvectorscale diff --git a/scripts/check_release_contract.py b/scripts/check_release_contract.py index ce525bae8..fc56d5c19 100644 --- a/scripts/check_release_contract.py +++ b/scripts/check_release_contract.py @@ -10,7 +10,7 @@ _SEMVER = re.compile(r"(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)") _IMAGE = "ghcr.io/writeitai/remember-stack" _POSTGRES_SOURCE_MARKER = re.compile( - r"^FROM postgres:(19(?:beta\d+|rc\d+|(?:\.\d+)*))-" + r"^FROM (postgres:18\.\d+-trixie@sha256:[0-9a-f]{64})(?: AS \w+)?$" ) @@ -121,16 +121,18 @@ def _validate_release_docs(*, root: Path, version: str) -> None: def _validate_postgres_release(*, root: Path, version: str) -> None: """Bind Compose to the multi-architecture immutable image publisher.""" dockerfile = (root / "Dockerfile.postgres").read_text(encoding="utf-8") - base = next( - ( - match.group(1) - for line in dockerfile.splitlines() - if (match := _POSTGRES_SOURCE_MARKER.match(line)) is not None - ), - None, - ) - if base is None: - raise ValueError("Dockerfile.postgres must pin a PostgreSQL 19 source marker") + sources = [ + _POSTGRES_SOURCE_MARKER.fullmatch(line) + for line in dockerfile.splitlines() + if line.startswith("FROM ") + ] + if len(sources) != 2 or any(match is None for match in sources): + raise ValueError( + "Dockerfile.postgres must pin both stages to PostgreSQL 18 by digest" + ) + if len({match.group(1) for match in sources if match is not None}) != 1: + raise ValueError("PostgreSQL builder and runtime must use the same base image") + base = "18" compose = (root / "compose.yaml").read_text(encoding="utf-8") if f"image: {_IMAGE}-postgres:{base}-{version}" not in compose: raise ValueError( @@ -144,8 +146,8 @@ def _validate_postgres_release(*, root: Path, version: str) -> None: if start not in workflow or end not in workflow: raise ValueError("release workflow must keep the build-postgres job") jobs = workflow.split(start, maxsplit=1)[1].split(end, maxsplit=1)[0] - # Each architecture builds natively: the image build runs the - # pg_textsearch regression suite, which fails under QEMU emulation. + # Each architecture builds natively: an earlier QEMU build failed the + # pg_textsearch worker-count regression when parallel workers did not start. for required in ( "file: Dockerfile.postgres", "runner: ubuntu-latest", diff --git a/scripts/prepare_next_release.py b/scripts/prepare_next_release.py index 3a9d7659e..a2b92f9fd 100644 --- a/scripts/prepare_next_release.py +++ b/scripts/prepare_next_release.py @@ -47,7 +47,7 @@ def _coordinate(*, version: str) -> re.Pattern[str]: Image tags, release and PyPI URLs, the checkout command and the CLI page heading move with each release; prose that names a past version (for - example "0.18.1 is the first release on 19rc1") keeps it. + example "0.18.1 introduced the former RC image") keeps it. """ prefixes = "|".join( ( diff --git a/src/rememberstack/spine/catalog_contract.py b/src/rememberstack/spine/catalog_contract.py index 195f4a19f..34cdc9103 100644 --- a/src/rememberstack/spine/catalog_contract.py +++ b/src/rememberstack/spine/catalog_contract.py @@ -379,7 +379,7 @@ def lane_is_valid(*, stage: str, lane: str | None) -> bool: # Includes saved_query_registry_state and saved_query_audit (Batch E governance). # Counts are measured against a fresh head inventory; update when the registry # migration gains or loses constraints. -# PostgreSQL 19 represents NOT NULL declarations as first-class `n` rows in +# PostgreSQL 18 represents NOT NULL declarations as first-class `n` rows in # pg_constraint. The catalog contract pins them with the other structural # constraint kinds instead of pretending the database still exposes PG16's shape. EXPECTED_CONSTRAINT_COUNTS: Final = { diff --git a/src/rememberstack/spine/fact_graph_contract.py b/src/rememberstack/spine/fact_graph_contract.py index 6fba32cab..0aa042680 100644 --- a/src/rememberstack/spine/fact_graph_contract.py +++ b/src/rememberstack/spine/fact_graph_contract.py @@ -90,7 +90,6 @@ def _rebuild( ) -> None: """Execute the drop-and-recreate sequence.""" from rememberstack.spine.migrations._helpers import _split_sql - from rememberstack.spine.migrations._helpers import DROP_PROPERTY_GRAPHS from rememberstack.spine.migrations.versions import ( p9_17_0038_postgres19_live_graph as graph, ) @@ -102,7 +101,6 @@ def _rebuild( ) statements = ( - DROP_PROPERTY_GRAPHS, "DROP FUNCTION IF EXISTS memory_v1.graph_citation_path(uuid,uuid,uuid,integer,integer,integer,integer,integer)", "DROP FUNCTION IF EXISTS memory_v1.graph_path(uuid,uuid,uuid,integer,text[],timestamptz,timestamptz,integer,integer,integer,integer)", "DROP FUNCTION IF EXISTS memory_v1.graph_neighborhood(uuid,uuid,integer,text[],timestamptz,timestamptz,integer,integer,integer,integer)", diff --git a/src/rememberstack/spine/graph_catalog.py b/src/rememberstack/spine/graph_catalog.py index 56b1b90d1..6e2ea3786 100644 --- a/src/rememberstack/spine/graph_catalog.py +++ b/src/rememberstack/spine/graph_catalog.py @@ -1,4 +1,4 @@ -"""Semantic PostgreSQL 19 live-graph catalog verification and repair (D98).""" +"""Semantic PostgreSQL 18 live-graph catalog verification and repair (D98).""" from __future__ import annotations @@ -91,9 +91,9 @@ def graph_catalog_problems(*, connection: Connection) -> tuple[str, ...]: server_version = int( connection.execute(text("SHOW server_version_num")).scalar_one() ) - if not 190000 <= server_version < 200000: + if not 180000 <= server_version < 190000: problems.append( - f"server_version_num expected PostgreSQL 19, observed {server_version}" + f"server_version_num expected PostgreSQL 18, observed {server_version}" ) return tuple(problems) diff --git a/src/rememberstack/spine/migrations/_helpers.py b/src/rememberstack/spine/migrations/_helpers.py index 925969492..ea1b1468b 100644 --- a/src/rememberstack/spine/migrations/_helpers.py +++ b/src/rememberstack/spine/migrations/_helpers.py @@ -13,28 +13,6 @@ _VIEW_COLUMN = re.compile(r"^(?P[a-z_][a-z0-9_]*),?\s*--\s*(?P.+)$") -DROP_PROPERTY_GRAPHS = r""" -DO $do$ -DECLARE - graph_name text; -BEGIN - -- Only a PostgreSQL 19 Beta 3 store can hold these SQL/PGQ property graphs - -- (relkind 'g'); Beta 4 removed SQL/PGQ, so on later servers this finds - -- nothing and the DROP is never parsed. - FOR graph_name IN - SELECT c.relname FROM pg_class AS c - JOIN pg_namespace AS n ON n.oid = c.relnamespace - WHERE n.nspname = 'memory_v1' AND c.relkind = 'g' - AND c.relname IN ('memory_current', 'memory_history') - LOOP - EXECUTE format('DROP PROPERTY GRAPH memory_v1.%I', graph_name); - END LOOP; -END -$do$; -""" -"""Drop the D98 property graphs where they exist (PostgreSQL 19 RC 1 amendment).""" - - def apply_ddl(*, sql: str) -> None: """Execute explicit DDL statements and materialize inline column comments.""" for statement in _split_sql(sql=sql): diff --git a/src/rememberstack/spine/migrations/versions/p9_17_0038_postgres19_live_graph.py b/src/rememberstack/spine/migrations/versions/p9_17_0038_postgres19_live_graph.py index b179a3d91..610a7d189 100644 --- a/src/rememberstack/spine/migrations/versions/p9_17_0038_postgres19_live_graph.py +++ b/src/rememberstack/spine/migrations/versions/p9_17_0038_postgres19_live_graph.py @@ -1,4 +1,4 @@ -"""Replace P2 snapshots with the PostgreSQL 19 live graph (D98). +"""Replace P2 snapshots with the PostgreSQL live graph (D98). revision: p9_17_0038 @@ -8,11 +8,8 @@ tenant rows and therefore need neither a generation nor a publication pointer. Variable-length traversal lives in bounded SQL helpers. -As shipped, this revision also created two SQL/PGQ property graphs -(``memory_v1.memory_current`` and ``memory_v1.memory_history``) over these -views. PostgreSQL 19 Beta 4 removed SQL/PGQ, so a later server cannot parse -that DDL; under the D98 RC 1 amendment the property graphs are no longer -created here, and p9_44_0065 drops them from Beta 3 stores that have them. +D157 runs this migration on PostgreSQL 18. Its historical filename retains +its revision identity; no SQL/PGQ DDL or PG19 compatibility path is present. The development-only downgrade restores legacy graph objects but does not widen ``memory_v1.document_crossrefs_live`` back to unresolved or tombstoned @@ -27,7 +24,6 @@ from rememberstack.spine.graph_catalog import GRAPH_HELPER_CONTRACT_VERSION from rememberstack.spine.migrations._helpers import _split_sql from rememberstack.spine.migrations._helpers import apply_ddl -from rememberstack.spine.migrations._helpers import DROP_PROPERTY_GRAPHS revision: str = "p9_17_0038" down_revision: str | None = "p9_16_0037" @@ -1242,7 +1238,6 @@ def downgrade() -> None: _V_GRAPH_ENTITIES_TYPE_CUT as type_cut_graph_entities, ) - op.execute(DROP_PROPERTY_GRAPHS) op.execute(_REVOKE_GRAPH_GUARD_GRANTS) op.execute( "DROP FUNCTION IF EXISTS memory_v1.graph_citation_path(uuid, uuid, uuid, integer, integer, integer, integer, integer)" diff --git a/src/rememberstack/spine/migrations/versions/p9_21_0042_ingest_principal.py b/src/rememberstack/spine/migrations/versions/p9_21_0042_ingest_principal.py index d6377242f..40b318600 100644 --- a/src/rememberstack/spine/migrations/versions/p9_21_0042_ingest_principal.py +++ b/src/rememberstack/spine/migrations/versions/p9_21_0042_ingest_principal.py @@ -92,7 +92,7 @@ # measured, with a concurrent UPDATE timing out. NOT VALID is scan-free # (seq_scan=0), which removes that table-size dependence. # -# It is NOT lock-free: PostgreSQL 19 still takes ShareRowExclusiveLock for +# It is NOT lock-free: PostgreSQL 18 takes ShareRowExclusiveLock for # ADD FOREIGN KEY ... NOT VALID, held until this atomic transaction commits, # and a concurrent writer will wait on it. The difference that matters is # bounded-and-brief versus proportional-to-row-count. diff --git a/src/rememberstack/spine/migrations/versions/p9_38_0059_d140_effective_time.py b/src/rememberstack/spine/migrations/versions/p9_38_0059_d140_effective_time.py index 0a7f7b427..453a4060a 100644 --- a/src/rememberstack/spine/migrations/versions/p9_38_0059_d140_effective_time.py +++ b/src/rememberstack/spine/migrations/versions/p9_38_0059_d140_effective_time.py @@ -57,7 +57,6 @@ from rememberstack.spine.migrations._helpers import apply_ddl from rememberstack.spine.migrations._helpers import apply_view_ddl -from rememberstack.spine.migrations._helpers import DROP_PROPERTY_GRAPHS from rememberstack.spine.migrations._helpers import view_column_comments revision: str = "p9_38_0059" @@ -1537,7 +1536,6 @@ def upgrade() -> None: op.execute(_FILL_VERSION_SCOPE) apply_ddl(sql=_SECTION_CHUNK_DDL) - op.execute(DROP_PROPERTY_GRAPHS) op.execute("DROP VIEW rememberstack_graph_internal.crossrefs_live") op.execute("DROP VIEW memory_v1.document_crossrefs_live") op.execute("DROP TABLE document_crossrefs") @@ -1630,7 +1628,6 @@ def downgrade() -> None: op.execute("DROP FUNCTION " + _FUNCTION_SIGNATURES[1]) op.execute("DROP FUNCTION " + _FUNCTION_SIGNATURES[0]) - op.execute(DROP_PROPERTY_GRAPHS) op.execute("DROP VIEW rememberstack_graph_internal.crossrefs_live") op.execute("DROP VIEW memory_v1.document_crossrefs_live") op.execute("DROP VIEW memory_v1.document_effective_periods_live") diff --git a/src/rememberstack/spine/migrations/versions/p9_40_0061_citation_path_projection.py b/src/rememberstack/spine/migrations/versions/p9_40_0061_citation_path_projection.py index f3d1ea86f..4f14f9a6d 100644 --- a/src/rememberstack/spine/migrations/versions/p9_40_0061_citation_path_projection.py +++ b/src/rememberstack/spine/migrations/versions/p9_40_0061_citation_path_projection.py @@ -34,7 +34,6 @@ from alembic import op from rememberstack.spine.migrations._helpers import apply_ddl -from rememberstack.spine.migrations._helpers import DROP_PROPERTY_GRAPHS from rememberstack.spine.postgres_graph_sql import _replace_exact revision: str = "p9_40_0061" @@ -143,7 +142,6 @@ def downgrade() -> None: ) op.execute(_replaceable(sql=graph._CITATION_PATH_HELPER)) - op.execute(DROP_PROPERTY_GRAPHS) op.execute("DROP VIEW rememberstack_graph_internal.crossrefs_live") apply_ddl(sql=GRAPH_CROSSREFS_SOURCE_DDL) op.execute(QUERY_ROLE_GRANTS) diff --git a/src/rememberstack/spine/migrations/versions/p9_44_0065_drop_property_graphs.py b/src/rememberstack/spine/migrations/versions/p9_44_0065_drop_property_graphs.py index 65bd37dc7..a1f002143 100644 --- a/src/rememberstack/spine/migrations/versions/p9_44_0065_drop_property_graphs.py +++ b/src/rememberstack/spine/migrations/versions/p9_44_0065_drop_property_graphs.py @@ -1,29 +1,11 @@ -"""Drop the SQL/PGQ property graphs (D98, PostgreSQL 19 RC 1 amendment). +"""Retired SQL/PGQ cleanup revision, retained for migration ordering. -PostgreSQL 19 Beta 4 reverted SQL/PGQ, so RC 1 and the final release have no -``CREATE PROPERTY GRAPH`` or ``GRAPH_TABLE``. The live graph stays: its nodes -and edges are the private ``rememberstack_graph_internal`` views, and the -one-hop read is now a plain join over them. Only the two property graphs -(``memory_v1.memory_current`` and ``memory_v1.memory_history``), which were -catalog metadata over those views, go away. - -A Beta 3 store at the prior head still holds them, and they would block its -move to RC 1: ``pg_upgrade`` and ``pg_restore`` replay their DDL, which RC 1 -cannot parse. This revision drops them where they exist, so the upgrade order -is: run this migration on Beta 3, then move the data to RC 1. On RC 1 there is -nothing to drop and the revision is a no-op. - -The downgrade is a no-op. It does not recreate them, because the reference -server (RC 1 and later) cannot parse their DDL; nothing in this repository -reads them any more. +D157 uses PostgreSQL 18, which has no property graphs. Fresh migrations and +catalog repair create only relational views; no PG19 upgrade path is supported. """ from collections.abc import Sequence -from alembic import op - -from rememberstack.spine.migrations._helpers import DROP_PROPERTY_GRAPHS - revision: str = "p9_44_0065" down_revision: str | None = "p9_43_0064" branch_labels: str | Sequence[str] | None = None @@ -31,9 +13,8 @@ def upgrade() -> None: - """Drop the two property graphs where a Beta 3 store still has them.""" - op.execute(DROP_PROPERTY_GRAPHS) + """No objects to remove on the PostgreSQL 18 reference server.""" def downgrade() -> None: - """Nothing to restore: PostgreSQL 19 RC 1 and later have no property graphs.""" + """No property graphs to restore on PostgreSQL 18.""" diff --git a/src/rememberstack/spine/profile_refresher.py b/src/rememberstack/spine/profile_refresher.py index 7e3862ef2..f6cd55425 100644 --- a/src/rememberstack/spine/profile_refresher.py +++ b/src/rememberstack/spine/profile_refresher.py @@ -557,9 +557,8 @@ def _acquire_profile_lock( connection.execute(statement, {"key": key}) except OperationalError as exc: cause = exc.orig - if ( - getattr(cause, "sqlstate", None) == "57014" - and "advisory lock" in str(cause).lower() + if getattr(cause, "sqlstate", None) == "57014" and ( + statement is _LOCK_IDENTITY_SHARED or statement is _LOCK_ENTITY ): raise ProfileRefreshContendedError( f"entity profile lock remained busy: {key}" diff --git a/src/rememberstack/spine/query_space/catalog.py b/src/rememberstack/spine/query_space/catalog.py index 9bbfa5dca..c79a9b742 100644 --- a/src/rememberstack/spine/query_space/catalog.py +++ b/src/rememberstack/spine/query_space/catalog.py @@ -44,7 +44,7 @@ #: a manifest field and therefore a hash input; the minor version deliberately #: is not, because the surface must not change when the server is patched. The #: schema gate asserts the running server reports this major. -POSTGRESQL_MAJOR: Final = 19 +POSTGRESQL_MAJOR: Final = 18 #: Finite vocabularies shared by several views, bound once. _DOCUMENT_STATUS: Final = ( diff --git a/src/rememberstack/spine/query_space/memory_v1_manifest.json b/src/rememberstack/spine/query_space/memory_v1_manifest.json index 16ecb88f1..23811756c 100644 --- a/src/rememberstack/spine/query_space/memory_v1_manifest.json +++ b/src/rememberstack/spine/query_space/memory_v1_manifest.json @@ -19682,7 +19682,7 @@ } ], "definition_ast_serializer": "memory_v1.pglast_ast/1", - "postgresql_major": 19, + "postgresql_major": 18, "schema": "memory_v1", "schema_major": 1, "views": [ @@ -49024,5 +49024,5 @@ } }, "manifest_contract": "memory_v1.manifest/2", - "surface_manifest_hash": "f238bb518de2aed12db7278d274878006382aa7186baae40c3cdb7ec6b7c48c6" + "surface_manifest_hash": "280cac8902f50aff8e6a02fe0fa39abdae6a64520e6a0b792bb8eef9c63e23e2" } diff --git a/src/rememberstack/spine/storage_capture_guard.py b/src/rememberstack/spine/storage_capture_guard.py index 056bd0313..074b462b3 100644 --- a/src/rememberstack/spine/storage_capture_guard.py +++ b/src/rememberstack/spine/storage_capture_guard.py @@ -1,6 +1,6 @@ """Fixed native relation exclusion and in-guard allocation sampling for D152. -This is a PG19 / p9_53_0074 primitive, not a complete capture, clock witness, +This is a PG18 / p9_53_0074 primitive, not a complete capture, clock witness, classification or billable quantity. Installation uses trusted operator authority; the existing collector LOGIN receives only the fixed operation. The caller retains this original transaction and rolls it back after its @@ -40,7 +40,7 @@ ) ) _EXTENSIONS = ( - "btree_gist=1.9", + "btree_gist=1.8", "fuzzystrmatch=1.2", "pg_partman=5.5.0", "pg_textsearch=1.5.1", @@ -132,7 +132,7 @@ class NativeRelationGuardRefused(RuntimeError): OR current_setting('lock_timeout')::interval > interval '250 milliseconds' THEN RAISE EXCEPTION USING ERRCODE='22023', MESSAGE='native_guard_native_bounds'; END IF; - IF current_setting('server_version_num')::integer/10000 <> 19 THEN + IF current_setting('server_version_num')::integer/10000 <> 18 THEN RAISE EXCEPTION USING ERRCODE='55000', MESSAGE='native_guard_server'; END IF; IF NOT pg_try_advisory_xact_lock(152, (SELECT oid::integer FROM pg_database diff --git a/src/tests/fixtures/storage_capture/live_corpus_profile.json b/src/tests/fixtures/storage_capture/live_corpus_profile.json index a0a0ee327..c4e8c4840 100644 --- a/src/tests/fixtures/storage_capture/live_corpus_profile.json +++ b/src/tests/fixtures/storage_capture/live_corpus_profile.json @@ -523,13 +523,13 @@ "purpose": "truth_provenance" } ], - "schema_profile_digest": "c0d73e05e47907c5297e8bd625149f7df3b94460b9ee2c830fd147c1b4a35c9a", - "source_digest": "a5bf0196bd28adf558a25c29ca423dce32cce35bc90872b680afea0d6e167255" + "schema_profile_digest": "6e23bbaf452f931748b45c1afcded6d78512ac47c045d9fc613118814232fe5d", + "source_digest": "91b49f015a9825142e8d0af1f88c7a7cbd90727e3ea75c9552473af6f3dc8119" }, "contract": "rememberstack.managed_storage_profile.v1", "managed_runtime_source_digest": "6666666666666666666666666666666666666666666666666666666666666666", "mapping": { - "classification_digest": "1f35aa4ead6330b9c02792ace7db9cfbdc60c328a91289e6e9ef16081da8d310", + "classification_digest": "500a7fc768b12689090f37a7821e5619a439a68fee9f92573a0160964485a147", "contract": "rememberstack.storage_mapping.v1", "rules": [ { @@ -1168,24 +1168,24 @@ "native": { "clock_error_us": "1000", "clock_profile_digest": "5555555555555555555555555555555555555555555555555555555555555555", - "profile_digest": "41a3fcfca04d017cf8bb9cde7081da521e5145212ecda60e282a5588087517fb", + "profile_digest": "6b5b45659736a9393c518931eadf32b1dbaf4feddc66b6b639d6b172b9aeb274", "release_margin_us": 500000, - "schema_digest": "ad67ca0c8a5d7c8b2468eb6790457ee4af7857fc3ce835bb3f865b44d4e38004", - "schema_profile_digest": "c0d73e05e47907c5297e8bd625149f7df3b94460b9ee2c830fd147c1b4a35c9a", - "source_digest": "a5bf0196bd28adf558a25c29ca423dce32cce35bc90872b680afea0d6e167255", + "schema_digest": "0385d36f91ae8f3616b8ece61a28840443acdfacb3e26c1059bdf1726850d543", + "schema_profile_digest": "6e23bbaf452f931748b45c1afcded6d78512ac47c045d9fc613118814232fe5d", + "source_digest": "91b49f015a9825142e8d0af1f88c7a7cbd90727e3ea75c9552473af6f3dc8119", "view_lifetime_ms": 30000 }, "provider_clock_profile_digest": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "provider_profile_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "request": { - "classification_digest": "1f35aa4ead6330b9c02792ace7db9cfbdc60c328a91289e6e9ef16081da8d310", + "classification_digest": "500a7fc768b12689090f37a7821e5619a439a68fee9f92573a0160964485a147", "contract": "rememberstack.storage_capture_request.v1", "cut_at_unix_us": "1800000000000000", "deployment_id": "00000000000000000000000000000001", - "native_capture_profile_digest": "41a3fcfca04d017cf8bb9cde7081da521e5145212ecda60e282a5588087517fb", - "operator_mapping_digest": "bd6de5b3c20ebb3e188c27fd5413b5186325c8312c6d048e1d053ec0dc03eadf", - "schema_profile_digest": "c0d73e05e47907c5297e8bd625149f7df3b94460b9ee2c830fd147c1b4a35c9a", + "native_capture_profile_digest": "6b5b45659736a9393c518931eadf32b1dbaf4feddc66b6b639d6b172b9aeb274", + "operator_mapping_digest": "734d98914cfee9b6b3c327df2c642592997ee942f7a6d6f21e40e6b34dbb2aca", + "schema_profile_digest": "6e23bbaf452f931748b45c1afcded6d78512ac47c045d9fc613118814232fe5d", "store_binding_digest": "e65a24fea35f132abbafaee8eb0f7421577234c011f86c911bcc1b0bf0c029ae" }, "schema": { @@ -1515,7 +1515,7 @@ ] }, "extensions": [ - "btree_gist=1.9", + "btree_gist=1.8", "fuzzystrmatch=1.2", "pg_partman=5.5.0", "pg_textsearch=1.5.1", @@ -1667,11 +1667,11 @@ "p9_14_0035_drop_entity_type.py": "b419e64cffd372fa8f1ac4cf8d0300c4d8764ae174d7301d52338e8e573c532a", "p9_15_0036_global_resolution_eval.py": "f17ad5a8221c382f859de4b2ee7c8b37cf8aeb50d8dde5b21358a9ad9e9706c0", "p9_16_0037_entity_profile_projection.py": "66cb76281aeb6525a77b5c2919acb566f9310a6bbd6ba2b53d6ad11d7062abcf", - "p9_17_0038_postgres19_live_graph.py": "34606b43a7a04a23b8ecda04aa6ab4572e33177014f4b212e3e09fac731650f3", + "p9_17_0038_postgres19_live_graph.py": "43447f4252ae49424f3c7eab3864a6a524112160fced2bc8c62e0fbb690d0513", "p9_18_0039_graph_entity_provenance_plan.py": "9a15d3dc20738416cd568664f9e1787f51e9195a54a7b10a7d53306ce8ac7cb4", "p9_19_0040_graph_tenant_planner_settings.py": "b0edb0d7e3242396feda06e5ab9111f1b168563409c837902420328df6ed9784", "p9_20_0041_resolution_uncertainty.py": "0b851abd7b8eb4ae1c321ec30c114641c63674bbe5c1842c6d23e7d48827a533", - "p9_21_0042_ingest_principal.py": "b09b93758a6fbb7ae7d97703ccabf8345061f6df562ade3c42f18bf9be468826", + "p9_21_0042_ingest_principal.py": "0db8df390e2e12b90425c76b73960b413c4b2467e76a7886ca639128ddfe5736", "p9_22_0043_document_entity_bindings.py": "76d23b26645f412a1a243c0c096c9dcf543e3ff5fa23ebb32ac78b09d4302576", "p9_23_0044_drop_generic_identifier_guard.py": "474148f337353e834debba9e9723201e14906c99ff8acc2efb8ede4ba69bb672", "p9_24_0045_managed_text_metering.py": "d1f29f87c1bfc85858fd8cd3a8debb84e5001c8b40f68a8aafd1bc4d990d0dd8", @@ -1688,13 +1688,13 @@ "p9_35_0056_document_metadata.py": "1d848699e8fdc9f47dd75404f8df56ee3397d3f0b6b63955073c3c31661b83d2", "p9_36_0057_own_document_name_span.py": "342a1050b7a01c8e42717310b841907c05388140f7f45ad6d9b676a3fba2cafc", "p9_37_0058_extraction_eligibility.py": "fe8ea5cf632ebcd153fbe05698b4c364a839932eb336e731c74e9632a0959f46", - "p9_38_0059_d140_effective_time.py": "00dabcd91a8807240a2f6b2692d588a8675ba1cc624a5557343cce60be76354b", + "p9_38_0059_d140_effective_time.py": "b14474970d59ee05c88302bb975faecc14396bf15daa51a31a276726a4592045", "p9_39_0060_d140_period_window_review.py": "e2b7ebe89097aca3da748139da05e9b63ca497adfc88de544a0d5fc73b70eb6d", - "p9_40_0061_citation_path_projection.py": "1cc76784bf2ef1cc69a5bfe710b54c83beaae92cef61a70957a404b62e9ffc52", + "p9_40_0061_citation_path_projection.py": "e83a77ecd72e118565df2d810475bacb1f27f46694ccd46d70c7c06daab11aa4", "p9_41_0062_processing_layers.py": "d07fc0409b2a202b7e6c7ff293ac4802ac0f17dbb3eebf68332625e7fe008979", "p9_42_0063_entity_counts_demand.py": "1e8a0dfb4dcc4018d0ca9f8d35fae0f1bb81957ee179126d3f6229ec23f78109", "p9_43_0064_claim_leases.py": "921e84fd940b0050cfca6af71d6570f049a38a5beaed9ca93b7586113a3e7b88", - "p9_44_0065_drop_property_graphs.py": "b1e93ee583d1780f9b77752154d38495ac2402fb20cb0757c79e2a5b64c4b69b", + "p9_44_0065_drop_property_graphs.py": "e3f2b1448aadb34f22e148575061842858513804d0a7980c68459c5e8fbb0b52", "p9_45_0066_fact_counts_demand.py": "34bc365f01b18f76fd061c48b53f40499f6a0c9b952f384272024f16059f2a71", "p9_46_0067_generic_meter.py": "b04141b59c33d519ea7527bcb775d6b435507445c1fb4c0b3741804ecd2a2636", "p9_47_0068_mention_chunk_lookup.py": "ff3bc78538b3cdb1b32b4136f2c9add72cb172302ef0c7ba3103aebecbbc19c1", diff --git a/src/tests/packaging/test_release_contract.py b/src/tests/packaging/test_release_contract.py index 034f5662f..4a9696116 100644 --- a/src/tests/packaging/test_release_contract.py +++ b/src/tests/packaging/test_release_contract.py @@ -425,6 +425,22 @@ def test_compose_pulls_the_published_postgres_image(tmp_path: Path) -> None: with pytest.raises(ValueError, match="published PostgreSQL image"): _validate_postgres_release(root=tmp_path, version="0.0.0") + dockerfile = tmp_path / "Dockerfile.postgres" + source = dockerfile.read_text(encoding="utf-8") + for before, after in ( + ("18.6-trixie@", "19rc1-trixie@"), + ("@sha256:", "@unpinned:"), + ): + dockerfile.write_text(source.replace(before, after), encoding="utf-8") + with pytest.raises(ValueError, match="PostgreSQL 18 by digest"): + _validate_postgres_release(root=tmp_path, version=version) + dockerfile.write_text( + source.replace("18.6-trixie@", "18.7-trixie@", 1), encoding="utf-8" + ) + with pytest.raises(ValueError, match="same base image"): + _validate_postgres_release(root=tmp_path, version=version) + dockerfile.write_text(source, encoding="utf-8") + workflow = tmp_path / ".github/workflows/release.yml" workflow.write_text( workflow.read_text(encoding="utf-8").replace( diff --git a/src/tests/spine/test_d153_eligibility_pg.py b/src/tests/spine/test_d153_eligibility_pg.py index 47c884f31..36b6b190d 100644 --- a/src/tests/spine/test_d153_eligibility_pg.py +++ b/src/tests/spine/test_d153_eligibility_pg.py @@ -268,6 +268,10 @@ def test_complete_old_head_parity_across_visibility_mutations(pair: _Pair) -> No ) for statement, parameters in changes: with pair.reference.connect() as old, pair.target.connect() as new: + # Keep this semantic oracle focused on row equivalence: old views + # can JIT thousands of functions even for this tiny corpus. + old.exec_driver_sql("SET LOCAL jit=off") + new.exec_driver_sql("SET LOCAL jit=off") old.execute(text(statement), parameters) new.execute(text(statement), parameters) assert _snapshot(connection=old) == _snapshot(connection=new), ( diff --git a/src/tests/spine/test_migrations.py b/src/tests/spine/test_migrations.py index 4d8e818bd..597503f00 100644 --- a/src/tests/spine/test_migrations.py +++ b/src/tests/spine/test_migrations.py @@ -661,7 +661,7 @@ def test_d79_migration_backfills_existing_tree_as_legacy_generation() -> None: def test_postgresql_fresh_downgrade_reupgrade_mutation_and_noop_lifecycle() -> None: - """Exercise the complete PostgreSQL 19 lifecycle and negative catalog proof.""" + """Exercise the complete PostgreSQL 18 lifecycle and negative catalog proof.""" database_url = _database_url() config = _alembic_config(database_url=database_url) @@ -1280,9 +1280,9 @@ def metadata() -> dict[str, tuple[str, str | None, str]]: def test_fresh_setup_runs_on_a_server_without_sql_pgq() -> None: - """A fresh install reaches head on PostgreSQL 19 RC 1 or later (D98 amendment). + """A fresh install reaches head on PostgreSQL 18 (D157). - Beta 4 removed SQL/PGQ, so the test first proves the server has none: it + The reference server has no SQL/PGQ, so the test first proves it rejects ``CREATE PROPERTY GRAPH``. The migrations then create no property graph, and the live-graph catalog check passes. """ @@ -1299,7 +1299,8 @@ def test_fresh_setup_runs_on_a_server_without_sql_pgq() -> None: with engine.connect() as connection: assert ( int(connection.execute(text("SHOW server_version_num")).scalar_one()) - >= 190000 + // 10000 + == 18 ) with pytest.raises(ProgrammingError, match="syntax error"): connection.exec_driver_sql( diff --git a/src/tests/surfaces/fixtures/d143_defaults.json b/src/tests/surfaces/fixtures/d143_defaults.json index 15a092a15..c63fa3478 100644 --- a/src/tests/surfaces/fixtures/d143_defaults.json +++ b/src/tests/surfaces/fixtures/d143_defaults.json @@ -13901,9 +13901,9 @@ } ], "query_surface_manifest": { - "built_manifest_sha256": "bc7e135599cb93bf54d17faf5caf1d46edf637b6f5c5bf28b76ce90c483da64d", - "checked_in_manifest_sha256": "bc7e135599cb93bf54d17faf5caf1d46edf637b6f5c5bf28b76ce90c483da64d", - "surface_manifest_hash": "f238bb518de2aed12db7278d274878006382aa7186baae40c3cdb7ec6b7c48c6" + "built_manifest_sha256": "f31e63a89418afcb68d145d3660a2a22bad72fed098c8347577db2690ef02e2a", + "checked_in_manifest_sha256": "f31e63a89418afcb68d145d3660a2a22bad72fed098c8347577db2690ef02e2a", + "surface_manifest_hash": "280cac8902f50aff8e6a02fe0fa39abdae6a64520e6a0b792bb8eef9c63e23e2" }, "readiness_expected_components": [ [ diff --git a/src/tests/surfaces/test_d143_defaults_unchanged.py b/src/tests/surfaces/test_d143_defaults_unchanged.py index 9424c7c21..98079b50e 100644 --- a/src/tests/surfaces/test_d143_defaults_unchanged.py +++ b/src/tests/surfaces/test_d143_defaults_unchanged.py @@ -9,7 +9,7 @@ taken on the pre-D143 base (fbcd489bd); refreshed for the p9_42/p9_45/D153 view optimization and again for D154's pagination rename (browse ``limit`` / ``next_cursor``, MCP tool schemas), and for D156 document tags (five tag -tools, ``ingest`` ``tags`` at ``tool_version`` 3, two tag views). The current branch, composed the way the +tools, ``ingest`` ``tags`` at ``tool_version`` 3, two tag views), and D157's PostgreSQL 18 manifest declaration. The current branch, composed the way the self-host profile composes it (layers port included, reporting no configuration), must reproduce every byte. """ diff --git a/src/tests/surfaces/test_graph_queries.py b/src/tests/surfaces/test_graph_queries.py index f16c6215b..f6b54616b 100644 --- a/src/tests/surfaces/test_graph_queries.py +++ b/src/tests/surfaces/test_graph_queries.py @@ -1,4 +1,4 @@ -"""Acceptance proofs for live PostgreSQL 19 graph queries. +"""Acceptance proofs for live PostgreSQL 18 graph queries. The corpus is authority data only: there is no graph export, rebuild, snapshot, or cache. One-hop reads exercise the relational one-hop statement; deeper @@ -58,7 +58,7 @@ def _walk_plan_nodes(node: dict[str, Any]) -> Iterator[dict[str, Any]]: @pytest.fixture(scope="module") def database_engine() -> Iterator[Engine]: - """Apply structural head and expose a PostgreSQL 19 engine.""" + """Apply structural head and expose a PostgreSQL 18 engine.""" try: database_url = load_database_settings().sqlalchemy_url() except ValidationError: diff --git a/src/tests/surfaces/test_open_query_batch_f.py b/src/tests/surfaces/test_open_query_batch_f.py index 40ed3a5e1..e4b744c32 100644 --- a/src/tests/surfaces/test_open_query_batch_f.py +++ b/src/tests/surfaces/test_open_query_batch_f.py @@ -954,7 +954,7 @@ def test_core_prose_is_authority_for_live_graph_and_claims_verbatim() -> None: assert "memory_v1.graph_neighborhood" in graph_entry["example"] assert ( load_manifest()["surface_manifest_hash"] - == "f238bb518de2aed12db7278d274878006382aa7186baae40c3cdb7ec6b7c48c6" + == "280cac8902f50aff8e6a02fe0fa39abdae6a64520e6a0b792bb8eef9c63e23e2" ) diff --git a/src/tests/surfaces/test_query_sandbox_batch_b.py b/src/tests/surfaces/test_query_sandbox_batch_b.py index 90301845a..2cf2de43a 100644 --- a/src/tests/surfaces/test_query_sandbox_batch_b.py +++ b/src/tests/surfaces/test_query_sandbox_batch_b.py @@ -697,7 +697,7 @@ def test_parameters_execute_end_to_end(migrated: str) -> None: def test_server_and_public_executor_both_reject_pgq(migrated: str) -> None: - """PostgreSQL 19 RC 1 has no SQL/PGQ, and the public AST gate rejects it.""" + """PostgreSQL 18 has no SQL/PGQ, and the public AST gate rejects it.""" sql = ( "SELECT * FROM GRAPH_TABLE (memory_v1.memory_current " "MATCH (x IS entity) COLUMNS (x.entity_id AS entity_id)) AS g LIMIT 0" diff --git a/src/tests/test_d98_removal_audit.py b/src/tests/test_d98_removal_audit.py index df182c01c..4cfc9dba7 100644 --- a/src/tests/test_d98_removal_audit.py +++ b/src/tests/test_d98_removal_audit.py @@ -22,7 +22,6 @@ "P2 graph", "graph built_at", "graph generation", - "PostgreSQL 18", "topic/community pages", "community pages", "full-v13", @@ -93,9 +92,9 @@ def test_current_locomo_code_has_no_retired_protocol_identity() -> None: def test_postgres_image_verifies_extension_source_and_license() -> None: - """The prerelease image binds pg_textsearch inputs and redistributes notices. + """The reference image binds pg_textsearch inputs and redistributes notices. - D142: v1.5.1 supports PostgreSQL 19 upstream, so no local patch is applied. + D142: v1.5.1 supports PostgreSQL 18 upstream, so no local patch is applied. """ dockerfile = (_ROOT / "Dockerfile.postgres").read_text(encoding="utf-8") assert f"PG_TEXTSEARCH_REVISION={_PG_TEXTSEARCH_REVISION}" in dockerfile @@ -120,13 +119,13 @@ def test_postgres_image_verifies_extension_source_and_license() -> None: == 2 ) assert dockerfile.count("update-ca-certificates") == 2 - runtime_stage = dockerfile.split("FROM postgres:19rc1-trixie@", maxsplit=2)[2] + runtime_stage = dockerfile.rsplit("\nFROM ", maxsplit=1)[1] assert "apt-archive.postgresql.org/pub/repos/apt" in runtime_stage assert runtime_stage.index("update-ca-certificates") < runtime_stage.rindex( "apt-get update" ) assert runtime_stage.index("trixie-pgdg-archive") < runtime_stage.index( - "postgresql-19-partman=" + "postgresql-18-partman=" ) assert not (_ROOT / "docker" / "pg_textsearch-pg19.patch").exists() diff --git a/website/public/llms-full.txt b/website/public/llms-full.txt index 1b9cd26ce..2057edbb1 100644 --- a/website/public/llms-full.txt +++ b/website/public/llms-full.txt @@ -7074,31 +7074,29 @@ Graviton, Ampere) runs them natively, without emulation: | Image | Used by | |---|---| | `ghcr.io/writeitai/remember-stack:0.20.0` | The API, the workers and `setup` | -| `ghcr.io/writeitai/remember-stack-postgres:19rc1-0.20.0` | PostgreSQL | +| `ghcr.io/writeitai/remember-stack-postgres:18-0.20.0` | PostgreSQL | Compose pulls both from GitHub Container Registry. It builds an image from source (`Dockerfile` or `Dockerfile.postgres`) only when the pull fails, or -when you pass `--build`. Version 0.18.1 is the first release on the `19rc1` -image; releases up to 0.17.2 ran Beta 3 (`19beta3`), and moving an existing -Beta 3 deployment needs the steps in -[Upgrades](https://remember.dev/docs/self-hosting/upgrades#postgresql-prerelease-versions). -Building PostgreSQL compiles one extension and takes a few minutes. The third image, SeaweedFS, is also published for both -architectures. +when you pass `--build`. Between releases, use `--build` with a main checkout +so both engine and database come from the same source revision. Building +PostgreSQL compiles one extension and takes a few minutes. SeaweedFS is also +published for both architectures. -## PostgreSQL 19 (release candidate) +## PostgreSQL 18 -RememberStack requires **PostgreSQL 19, which is not yet a final release**. -The Compose file pins release candidate 1 (`postgres:19rc1`). +RememberStack requires **PostgreSQL 18**, the sole supported server major. +`Dockerfile.postgres` pins the official `18.6-trixie` image by digest. It is +the newest minor and image satisfying the two-week minimum age at selection +on 2026-11-14; 18.7 was released on 2026-11-12. -It needs 19 because the engine is built and tested only against -PostgreSQL 19, and the graph's readiness check refuses any other major -version. Entity neighbourhoods and paths run live, as ordinary SQL over the -same database that holds the facts, with no separate graph store to build or -keep in sync. +Entity neighbourhoods and paths run live as ordinary SQL over the database +that holds the facts. They need no separate graph store and no prerelease +property-graph feature. Readiness refuses a different server major. -Running a prerelease has a consequence you should plan for: there is no -promise that a data directory created by one PostgreSQL 19 prerelease opens -under a later one or under the final release. See [Upgrades and migrations](https://remember.dev/docs/self-hosting/upgrades). +Existing prerelease development data must be recreated and replayed into +fresh PostgreSQL 18 storage. Replacing the image cannot open a PostgreSQL 19 +data directory on 18. See [Upgrades and migrations](https://remember.dev/docs/self-hosting/upgrades#postgresql-server-versions). ### Extensions @@ -7115,11 +7113,12 @@ The migrations create these extensions: | `unaccent` | contrib | Accent folding of names | | `btree_gist` | contrib | The time-range exclusion constraint on relations | -`pg_textsearch` has no PostgreSQL 19 package yet. `Dockerfile.postgres` -downloads the pinned `v1.5.1` source revision from `timescale/pg_textsearch` -(which supports PostgreSQL 19 upstream) and compiles it. `pgvector` and `pg_partman` come from the PostgreSQL apt -archive at the exact versions above. `remember ops graph-catalog ensure` -checks these three versions (see [Operating the pipeline](https://remember.dev/docs/self-hosting/operating)). +`Dockerfile.postgres` compiles `pg_textsearch` from the same checksum-verified +`v1.5.1` source revision used by the preceding image, without a local patch or +compiler workaround. `pgvector` and `pg_partman` come from the PostgreSQL apt +archive at the exact versions above, built for PostgreSQL 18. The server also +includes `plpgsql`. `remember ops graph-catalog ensure` checks the three +external extension versions (see [Operating the pipeline](https://remember.dev/docs/self-hosting/operating)). ### Server settings @@ -7136,7 +7135,7 @@ Everything else stays at the image defaults. Running the engine against a PostgreSQL server you manage yourself is not a documented path. If you try it, the server must match everything on this -page: version 19, the extensions at those versions, and the preload +page: version 18, the extensions at those versions, and the preload settings. The one exception is `pg_partman_bgw`: instead of the background worker you may run `CALL run_maintenance_proc();` in the database on a schedule (see [Upgrades and migrations](https://remember.dev/docs/self-hosting/upgrades)). @@ -7334,7 +7333,7 @@ RememberStack image, and starts everything in dependency order: | Service | Command | Role | |---|---|---| -| `postgres` | `postgres` | PostgreSQL 19 prerelease with the extensions RememberStack needs. It holds every document, version, claim, fact and entity, and the work queue. | +| `postgres` | `postgres` | PostgreSQL 18 with the extensions RememberStack needs. It holds every document, version, claim, fact and entity, and the work queue. | | `object-store` | `server -s3` | [SeaweedFS](https://github.com/seaweedfs/seaweedfs), S3-compatible storage for original files, converted Markdown and the live corpus. Reachable only by the other containers; no host port is published. | | `setup` | `setup` | One-shot: migrations, buckets, the deployment row, seed data. Runs again, harmlessly, on every `up`. | | `api` | `api` | The HTTP API on port 8000 inside the container, published on `127.0.0.1:REMEMBERSTACK_SELFHOST_API_PORT`. | @@ -9739,33 +9738,25 @@ Three things are shared across the server, so keep them in mind: ample for monthly partitions). RememberStack does not depend on the background worker itself. -## PostgreSQL prerelease versions +## PostgreSQL server versions -RememberStack runs on a PostgreSQL 19 prerelease, release candidate 1 -(`19rc1`); releases up to v0.17.2 ran Beta 3 (`19beta3`). A PostgreSQL -prerelease does not promise that its data directory opens under the next -prerelease or the final release. The Beta 3 to RC 1 step changes the -catalog version, so a Beta 3 data directory does not open under RC 1. +PostgreSQL 18 is the reference server. Compose builds the pinned official +18.x base with the project's extensions. PostgreSQL 19 was adopted for +SQL/PGQ property graphs, but upstream removed that feature and the engine +uses ordinary joins, so a prerelease server is no longer needed. -Beta 3 also had SQL/PGQ property graphs, which RC 1 removed, and a Beta 3 -database still holds two of them. `pg_upgrade` and `pg_restore` would replay -their definitions, which RC 1 cannot parse. To move a Beta 3 deployment: +This is a major-version change. A PostgreSQL 19 data directory cannot be +opened by PostgreSQL 18, and `pg_upgrade` cannot downgrade it. With no user +databases, the supported development path is fresh PostgreSQL 18 storage, +`setup`, and replaying the source documents. To remove only the database +volume, stop the stack, identify its `postgres-data` volume with +`docker volume ls`, and remove that volume before starting with `--build`. +Keep object-store and other volumes when their contents must survive. -1. Upgrade RememberStack while it still runs on the Beta 3 PostgreSQL image. - `setup` runs migration `p9_44_0065`, which drops the two property graphs. -2. Move the data into a new RC 1 volume with `pg_upgrade`, or with a logical - dump and restore (below). - -The logical path was tested for this release: after step 1, take the roles -file and the `pg_dump` described under [A logical backup](#a-logical-backup) -from the Beta 3 database, create the roles in the new RC 1 server (skip the -superuser that already exists), `pg_restore` the dump into its empty -database, then run `setup` and `remember ops graph-catalog ensure`. -`pg_upgrade` was not tested. Starting a new deployment and sending your -documents again also works. - -If a release changes the PostgreSQL image, its release notes are the place -to look. +If you must preserve data, qualify a logical export/import or source replay +in a separate operator migration plan before replacing the server. This +release provides no automatic PG19 conversion or dual-version runtime. +Release notes record subsequent PostgreSQL 18 minor image changes. ## The deployment id is permanent @@ -21547,7 +21538,7 @@ existing deployment. A 0.17 deployment upgrades in place: its data is kept and 2. Dump the database and restore it into a new RC 1 volume. The order matters: a dump taken before step 1 holds definitions RC 1 cannot - restore. [Upgrades](https://remember.dev/docs/self-hosting/upgrades#postgresql-prerelease-versions) + restore. [Upgrades](https://remember.dev/docs/self-hosting/upgrades#postgresql-server-versions) has the commands. - The graph no longer uses SQL/PGQ, which RC 1 removed. One-hop neighbourhoods are plain joins over the same views, and they return the same results. @@ -22290,7 +22281,7 @@ You need: - [uv](https://docs.astral.sh/uv/) version **0.12.6** exactly (the project pins it); - Python 3.12 or newer (CI uses 3.13); -- Docker, for the PostgreSQL 19 database most tests need. +- Docker, for the PostgreSQL 18 database most tests need. ```bash git clone https://github.com/writeitai/remember-stack.git @@ -22321,7 +22312,7 @@ Two rules the linters enforce: ### Tests and the database Tests live in `src/tests/`. Unit tests run without a database. Integration -tests need PostgreSQL 19 with the project's extensions, built from +tests need PostgreSQL 18 with the project's extensions, built from `Dockerfile.postgres`. The CI script starts one on port 5432: ```bash @@ -22370,7 +22361,7 @@ updates or supersedes its entry. | `src/tests/` | The test suite, mirroring the layers above. | | `benchmarks/` | LoCoMo and BEAM harnesses; see [Benchmarks](https://remember.dev/docs/project/benchmarks). | | `packages/` | The deprecated forwarding package; see the [changelog](https://remember.dev/docs/project/changelog). | -| `Dockerfile`, `Dockerfile.postgres`, `docker/` | The engine image and the PostgreSQL 19 image with extensions. | +| `Dockerfile`, `Dockerfile.postgres`, `docker/` | The engine image and the PostgreSQL 18 image with extensions. | | `compose.yaml`, `.env.example` | The Docker Compose deployment. | | `alembic.ini` | Database migration configuration. | | `openapi.json` | The HTTP API schema, generated by `scripts/export_openapi.py`. | diff --git a/website/public/llms.txt b/website/public/llms.txt index 234c69880..c52846263 100644 --- a/website/public/llms.txt +++ b/website/public/llms.txt @@ -47,7 +47,7 @@ Agents: resolve entities first (`resolve_entity`), then ask for facts (`facts_co ## Self-hosting -- [Requirements](https://remember.dev/docs/self-hosting/requirements): What you need to run RememberStack yourself — PostgreSQL 19, S3-compatible storage, Docker, a model key — and how to size disk and database connections. +- [Requirements](https://remember.dev/docs/self-hosting/requirements): What you need to run RememberStack yourself — PostgreSQL 18, S3-compatible storage, Docker, a model key — and how to size disk and database connections. - [Install with Docker Compose](https://remember.dev/docs/self-hosting/install): Start a self-hosted RememberStack with Docker Compose, check that it is healthy, send a first document, and stop, restart or reset it. - [Configuration](https://remember.dev/docs/self-hosting/configuration): How a self-hosted RememberStack reads its settings, how they reach the containers, which ones you need to change, and which are fixed after the first start. - [Models and providers](https://remember.dev/docs/self-hosting/models): Which model each pipeline step uses, how to change it, how RememberStack routes calls through OpenRouter, and what changing the embedding model does. diff --git a/website/src/app/docs/cloud/overview/page.cloud.mdx b/website/src/app/docs/cloud/overview/page.cloud.mdx index ade812bdd..158bde618 100644 --- a/website/src/app/docs/cloud/overview/page.cloud.mdx +++ b/website/src/app/docs/cloud/overview/page.cloud.mdx @@ -28,7 +28,7 @@ remember.dev you do none of it. | Work | Self-hosted | remember.dev | |---|---|---| -| Database | Run PostgreSQL 19 with the `pgvector`, `pg_partman` and `pg_textsearch` extensions, size it, keep it healthy | One PostgreSQL instance per project, provisioned and run for you | +| Database | Run PostgreSQL 18 with the `pgvector`, `pg_partman` and `pg_textsearch` extensions, size it, keep it healthy | One PostgreSQL instance per project, provisioned and run for you | | Pipeline | Run the API plus a worker for every pipeline stage (conversion, structuring, chunking, embedding, claim extraction, relation labelling, adjudication and the rest) and the projection process, and restart them when they fail | The API, the workers and projections run on remember.dev hosts | | Object storage | Run SeaweedFS or another S3 store for source files and derived artifacts | Per-project buckets on remember.dev storage | | Model access | Hold model provider keys, pick models, watch provider spend | remember.dev supplies model access through OpenRouter, with a separate provider key for each project | diff --git a/website/src/app/docs/project/changelog/page.mdx b/website/src/app/docs/project/changelog/page.mdx index 4dc44a08d..f5b4e05ad 100644 --- a/website/src/app/docs/project/changelog/page.mdx +++ b/website/src/app/docs/project/changelog/page.mdx @@ -250,7 +250,7 @@ existing deployment. A 0.17 deployment upgrades in place: its data is kept and 2. Dump the database and restore it into a new RC 1 volume. The order matters: a dump taken before step 1 holds definitions RC 1 cannot - restore. [Upgrades](/docs/self-hosting/upgrades#postgresql-prerelease-versions) + restore. [Upgrades](/docs/self-hosting/upgrades#postgresql-server-versions) has the commands. - The graph no longer uses SQL/PGQ, which RC 1 removed. One-hop neighbourhoods are plain joins over the same views, and they return the same results. diff --git a/website/src/app/docs/project/contributing/page.mdx b/website/src/app/docs/project/contributing/page.mdx index 2e9ed06de..a5a399d14 100644 --- a/website/src/app/docs/project/contributing/page.mdx +++ b/website/src/app/docs/project/contributing/page.mdx @@ -57,7 +57,7 @@ You need: - [uv](https://docs.astral.sh/uv/) version **0.12.6** exactly (the project pins it); - Python 3.12 or newer (CI uses 3.13); -- Docker, for the PostgreSQL 19 database most tests need. +- Docker, for the PostgreSQL 18 database most tests need. ```bash git clone https://github.com/writeitai/remember-stack.git @@ -88,7 +88,7 @@ Two rules the linters enforce: ### Tests and the database Tests live in `src/tests/`. Unit tests run without a database. Integration -tests need PostgreSQL 19 with the project's extensions, built from +tests need PostgreSQL 18 with the project's extensions, built from `Dockerfile.postgres`. The CI script starts one on port 5432: ```bash @@ -137,7 +137,7 @@ updates or supersedes its entry. | `src/tests/` | The test suite, mirroring the layers above. | | `benchmarks/` | LoCoMo and BEAM harnesses; see [Benchmarks](/docs/project/benchmarks). | | `packages/` | The deprecated forwarding package; see the [changelog](/docs/project/changelog). | -| `Dockerfile`, `Dockerfile.postgres`, `docker/` | The engine image and the PostgreSQL 19 image with extensions. | +| `Dockerfile`, `Dockerfile.postgres`, `docker/` | The engine image and the PostgreSQL 18 image with extensions. | | `compose.yaml`, `.env.example` | The Docker Compose deployment. | | `alembic.ini` | Database migration configuration. | | `openapi.json` | The HTTP API schema, generated by `scripts/export_openapi.py`. | diff --git a/website/src/app/docs/self-hosting/install/page.mdx b/website/src/app/docs/self-hosting/install/page.mdx index 58470baff..415544562 100644 --- a/website/src/app/docs/self-hosting/install/page.mdx +++ b/website/src/app/docs/self-hosting/install/page.mdx @@ -88,7 +88,7 @@ RememberStack image, and starts everything in dependency order: | Service | Command | Role | |---|---|---| -| `postgres` | `postgres` | PostgreSQL 19 prerelease with the extensions RememberStack needs. It holds every document, version, claim, fact and entity, and the work queue. | +| `postgres` | `postgres` | PostgreSQL 18 with the extensions RememberStack needs. It holds every document, version, claim, fact and entity, and the work queue. | | `object-store` | `server -s3` | [SeaweedFS](https://github.com/seaweedfs/seaweedfs), S3-compatible storage for original files, converted Markdown and the live corpus. Reachable only by the other containers; no host port is published. | | `setup` | `setup` | One-shot: migrations, buckets, the deployment row, seed data. Runs again, harmlessly, on every `up`. | | `api` | `api` | The HTTP API on port 8000 inside the container, published on `127.0.0.1:REMEMBERSTACK_SELFHOST_API_PORT`. | diff --git a/website/src/app/docs/self-hosting/requirements/page.mdx b/website/src/app/docs/self-hosting/requirements/page.mdx index 6b0d7d6b8..7768931f5 100644 --- a/website/src/app/docs/self-hosting/requirements/page.mdx +++ b/website/src/app/docs/self-hosting/requirements/page.mdx @@ -1,6 +1,6 @@ export const metadata = { title: "Requirements", - description: "What you need to run RememberStack yourself \u2014 PostgreSQL 19, S3-compatible storage, Docker, a model key \u2014 and how to size disk and database connections.", + description: "What you need to run RememberStack yourself \u2014 PostgreSQL 18, S3-compatible storage, Docker, a model key \u2014 and how to size disk and database connections.", }; # Requirements @@ -42,31 +42,29 @@ Graviton, Ampere) runs them natively, without emulation: | Image | Used by | |---|---| | `ghcr.io/writeitai/remember-stack:0.20.0` | The API, the workers and `setup` | -| `ghcr.io/writeitai/remember-stack-postgres:19rc1-0.20.0` | PostgreSQL | +| `ghcr.io/writeitai/remember-stack-postgres:18-0.20.0` | PostgreSQL | Compose pulls both from GitHub Container Registry. It builds an image from source (`Dockerfile` or `Dockerfile.postgres`) only when the pull fails, or -when you pass `--build`. Version 0.18.1 is the first release on the `19rc1` -image; releases up to 0.17.2 ran Beta 3 (`19beta3`), and moving an existing -Beta 3 deployment needs the steps in -[Upgrades](/docs/self-hosting/upgrades#postgresql-prerelease-versions). -Building PostgreSQL compiles one extension and takes a few minutes. The third image, SeaweedFS, is also published for both -architectures. +when you pass `--build`. Between releases, use `--build` with a main checkout +so both engine and database come from the same source revision. Building +PostgreSQL compiles one extension and takes a few minutes. SeaweedFS is also +published for both architectures. -## PostgreSQL 19 (release candidate) +## PostgreSQL 18 -RememberStack requires **PostgreSQL 19, which is not yet a final release**. -The Compose file pins release candidate 1 (`postgres:19rc1`). +RememberStack requires **PostgreSQL 18**, the sole supported server major. +`Dockerfile.postgres` pins the official `18.6-trixie` image by digest. It is +the newest minor and image satisfying the two-week minimum age at selection +on 2026-11-14; 18.7 was released on 2026-11-12. -It needs 19 because the engine is built and tested only against -PostgreSQL 19, and the graph's readiness check refuses any other major -version. Entity neighbourhoods and paths run live, as ordinary SQL over the -same database that holds the facts, with no separate graph store to build or -keep in sync. +Entity neighbourhoods and paths run live as ordinary SQL over the database +that holds the facts. They need no separate graph store and no prerelease +property-graph feature. Readiness refuses a different server major. -Running a prerelease has a consequence you should plan for: there is no -promise that a data directory created by one PostgreSQL 19 prerelease opens -under a later one or under the final release. See [Upgrades and migrations](/docs/self-hosting/upgrades). +Existing prerelease development data must be recreated and replayed into +fresh PostgreSQL 18 storage. Replacing the image cannot open a PostgreSQL 19 +data directory on 18. See [Upgrades and migrations](/docs/self-hosting/upgrades#postgresql-server-versions). ### Extensions @@ -83,11 +81,12 @@ The migrations create these extensions: | `unaccent` | contrib | Accent folding of names | | `btree_gist` | contrib | The time-range exclusion constraint on relations | -`pg_textsearch` has no PostgreSQL 19 package yet. `Dockerfile.postgres` -downloads the pinned `v1.5.1` source revision from `timescale/pg_textsearch` -(which supports PostgreSQL 19 upstream) and compiles it. `pgvector` and `pg_partman` come from the PostgreSQL apt -archive at the exact versions above. `remember ops graph-catalog ensure` -checks these three versions (see [Operating the pipeline](/docs/self-hosting/operating)). +`Dockerfile.postgres` compiles `pg_textsearch` from the same checksum-verified +`v1.5.1` source revision used by the preceding image, without a local patch or +compiler workaround. `pgvector` and `pg_partman` come from the PostgreSQL apt +archive at the exact versions above, built for PostgreSQL 18. The server also +includes `plpgsql`. `remember ops graph-catalog ensure` checks the three +external extension versions (see [Operating the pipeline](/docs/self-hosting/operating)). ### Server settings @@ -104,7 +103,7 @@ Everything else stays at the image defaults. Running the engine against a PostgreSQL server you manage yourself is not a documented path. If you try it, the server must match everything on this -page: version 19, the extensions at those versions, and the preload +page: version 18, the extensions at those versions, and the preload settings. The one exception is `pg_partman_bgw`: instead of the background worker you may run `CALL run_maintenance_proc();` in the database on a schedule (see [Upgrades and migrations](/docs/self-hosting/upgrades)). diff --git a/website/src/app/docs/self-hosting/upgrades/page.mdx b/website/src/app/docs/self-hosting/upgrades/page.mdx index 2f41ff75a..4241058bf 100644 --- a/website/src/app/docs/self-hosting/upgrades/page.mdx +++ b/website/src/app/docs/self-hosting/upgrades/page.mdx @@ -160,33 +160,25 @@ Three things are shared across the server, so keep them in mind: ample for monthly partitions). RememberStack does not depend on the background worker itself. -## PostgreSQL prerelease versions - -RememberStack runs on a PostgreSQL 19 prerelease, release candidate 1 -(`19rc1`); releases up to v0.17.2 ran Beta 3 (`19beta3`). A PostgreSQL -prerelease does not promise that its data directory opens under the next -prerelease or the final release. The Beta 3 to RC 1 step changes the -catalog version, so a Beta 3 data directory does not open under RC 1. - -Beta 3 also had SQL/PGQ property graphs, which RC 1 removed, and a Beta 3 -database still holds two of them. `pg_upgrade` and `pg_restore` would replay -their definitions, which RC 1 cannot parse. To move a Beta 3 deployment: - -1. Upgrade RememberStack while it still runs on the Beta 3 PostgreSQL image. - `setup` runs migration `p9_44_0065`, which drops the two property graphs. -2. Move the data into a new RC 1 volume with `pg_upgrade`, or with a logical - dump and restore (below). - -The logical path was tested for this release: after step 1, take the roles -file and the `pg_dump` described under [A logical backup](#a-logical-backup) -from the Beta 3 database, create the roles in the new RC 1 server (skip the -superuser that already exists), `pg_restore` the dump into its empty -database, then run `setup` and `remember ops graph-catalog ensure`. -`pg_upgrade` was not tested. Starting a new deployment and sending your -documents again also works. - -If a release changes the PostgreSQL image, its release notes are the place -to look. +## PostgreSQL server versions + +PostgreSQL 18 is the reference server. Compose builds the pinned official +18.x base with the project's extensions. PostgreSQL 19 was adopted for +SQL/PGQ property graphs, but upstream removed that feature and the engine +uses ordinary joins, so a prerelease server is no longer needed. + +This is a major-version change. A PostgreSQL 19 data directory cannot be +opened by PostgreSQL 18, and `pg_upgrade` cannot downgrade it. With no user +databases, the supported development path is fresh PostgreSQL 18 storage, +`setup`, and replaying the source documents. To remove only the database +volume, stop the stack, identify its `postgres-data` volume with +`docker volume ls`, and remove that volume before starting with `--build`. +Keep object-store and other volumes when their contents must survive. + +If you must preserve data, qualify a logical export/import or source replay +in a separate operator migration plan before replacing the server. This +release provides no automatic PG19 conversion or dual-version runtime. +Release notes record subsequent PostgreSQL 18 minor image changes. ## The deployment id is permanent diff --git a/website/src/app/docs/start/choose/page.cloud.mdx b/website/src/app/docs/start/choose/page.cloud.mdx index 90c458562..68284528f 100644 --- a/website/src/app/docs/start/choose/page.cloud.mdx +++ b/website/src/app/docs/start/choose/page.cloud.mdx @@ -17,7 +17,7 @@ about who operates it, not about how well it remembers. | | Self-hosted | remember.dev | |---|---|---| | **Memory engine** | RememberStack, Apache-2.0 | RememberStack, one isolated deployment per project | -| **What you run** | PostgreSQL 19 with eight extensions, S3-compatible object storage, the API and thirteen pipeline workers | Nothing. You install the `remember` client. | +| **What you run** | PostgreSQL 18 with eight extensions, S3-compatible object storage, the API and thirteen pipeline workers | Nothing. You install the `remember` client. | | **File formats** | Markdown, plain text, HTML, Word, PowerPoint and Excel by default; PDFs and images once you configure an OCR converter | UTF-8 Markdown and plain text, up to 10,000,000 bytes per document | | **Model inference for the pipeline** | Your own OpenRouter account, plus a Mistral key for PDFs and images | Included in the processing charge | | **Endpoint** | Wherever you run it | `https://.dp.remember.dev`, over TLS, straight to your deployment | @@ -30,8 +30,7 @@ about who operates it, not about how well it remembers. ## What self-hosting takes Self-hosting is a real option, and the full engine is yours to run. It is -also real work. The engine uses PostgreSQL 19, which is still a release -candidate, not a final release. It needs the pgvector, pg_textsearch, pg_partman, pg_trgm, fuzzystrmatch, +also real work. The engine uses stable PostgreSQL 18. It needs the pgvector, pg_textsearch, pg_partman, pg_trgm, fuzzystrmatch, unaccent, btree_gist and pgcrypto extensions. The Compose file builds that database for you.