Skip to content

docs(database): PostgreSQL operator guide - #174642

Merged
steipete merged 1 commit into
mainfrom
pgprep/r21a-operator-guide
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
pgprep/r21a-operator-guide

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Operators need one source-backed guide for provisioning, migrating, and recovering a PostgreSQL-backed OpenClaw installation.

User Impact

Adds a PostgreSQL operator guide covering requirements and least-privilege grants, SecretRef/TLS setup, first boot, independent Gateway topology, mixed-engine limits, forward and reverse ports, interrupted-port recovery, backups, updates, search, and diagnostics. PostgreSQL remains experimental, with pending native credential/approval and mixed-engine work called out explicitly.

Why This Change Was Made

The guide reflects current main and links the existing support matrix. It adds navigation and a title glossary entry, and corrects stale reference text that said agent port providers were unavailable even though they are registered.

The recovery instructions distinguish archive extraction from actual PostgreSQL restoration. Explicit Git global/agent scopes provide the currently exposed fresh-namespace restore path; plugin and complete archive rehydration remain limitations.

Source-audited gaps for follow-up

These findings are documented, with implementation left unchanged in this docs PR:

  • Full archive restore extracts artifacts without recreating PostgreSQL namespaces, and Git restore exposes only global/agent selectors: src/commands/backup-restore.ts, src/cli/program/register.backup.ts.
  • Git backup --all assigns additional discovered PostgreSQL stores the same generic workboard identity, allowing destination collisions: src/snapshot/git-backup.ts.
  • PostgreSQL Git capture returns before --exclude-secrets handling: src/snapshot/git-backup-codec.ts, src/snapshot/database-backup.ts. The guide treats those backups as credential-bearing.
  • Git verification restores a fresh PostgreSQL namespace and cleans only local scratch: src/snapshot/git-backup.ts. The guide explains its offline/destination requirements and server-side effect.

Evidence

Source audit against main d5f787453cb4b65907a3f6554f131d50e50e0e53, including engine admission/config, PostgreSQL driver TLS parsing, port providers, backup/restore/update owners, Doctor/status, search, and the prepared local credential owner.

Passed: docs index discovery, Markdown lint, MDX validation, config examples, page-link audit, title glossary coverage, docs formatting (including an explicit check of the new page), and git diff --check. Independent review found no actionable P0–P2 findings.

The optional anchor audit reports six pre-existing broken fragments, with no new guide-link failures:

  • cli/index.md → database-engines#port-existing-workboard-stores
  • gateway/config-tools.md → provider-examples#cerebras-glm-4-7-gpt-oss
  • gateway/protocol/rpc-talk-config-and-agents.md and releases/2026.9.2.md → cli/claws#remove-an-installed-claw
  • providers/ollama.md → ollama/troubleshooting#model-outputs-tool-json-as-text
  • releases/2026.10.1.md → openai/runtimes#agents-api-mvp

ClawHub routes were accepted from navigation; ClawHub fragments were not checked because its source checkout was not supplied.

The diff is four documentation files (+534/−8 lines), including the 518-line guide; production/test delta is zero. The guide links the existing support matrix rather than duplicating it. PostgreSQL conformance is not required for this docs-only diff; the coordinator confirmed the docs-only exception for landing.

CI on bf70774c8f7a654071f2505e0154dd88ca416c5f

Check Result
check-docs Passed (2m44s)
security-fast Passed (55s)
actionlint Passed (56s)
PR context/evidence and dependency/security review Passed
PostgreSQL conformance Skipped by docs-only path selection

Exact-head CI run. PostgreSQL conformance was correctly skipped by docs-only selection and has not been run locally. The exact-head CI watcher reports GREEN; older superseded runs are not active failures.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T20:34:13.407909Z bf70774 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: XS labels Oct 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:docs Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:docs Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds a PostgreSQL operator guide, navigation and glossary entries, and corrects outdated agent-port documentation.

Example: An operator plans recovery of a PostgreSQL installation using openclaw backup restore latest.tar.gz --target ./recovered.

  • Before: The reference describes matched PostgreSQL restores without clearly separating archive extraction from server restoration.
  • After: The guide explains that archive restore only extracts files and documents fresh-namespace Git restoration for shared state and selected agents.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, source-aligned documentation with passing scoped validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: Documentation-only change with source-checked procedures and successful exact-head documentation validation; no runtime behavior is introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Docs · Worth it: Yes · Fix scope: Complete
User problem: Operators lack one practical guide that explains PostgreSQL provisioning, migration, and recovery without overstating current support.
Reason: The maintainer-authored direction is approved, and the guide consolidates useful operating procedures while making existing limitations explicit.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides useful PostgreSQL operating guidance that is absent from current main, with no actionable findings in the introduced changes.

Priority: P3
Reviewed head: bf70774c8f7a654071f2505e0154dd88ca416c5f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The documentation connects operators to existing database configuration, offline port, backup, restore, update, and diagnostic owners; those owners manage PostgreSQL rows together with local SQLite identity anchors.

flowchart TD
  A[Operator guide] --> B[Configuration and SecretRef]
  B --> C[Gateway database owners]
  C --> D[PostgreSQL namespaces]
  C --> E[Local SQLite anchors]
  A --> F[Offline lifecycle CLI]
  F --> D
  F --> E
Loading

Technical review

Best possible solution:

Merge the source-aligned operator guide while keeping the disclosed runtime limitations in their implementation owners.

Do we have a high-confidence way to reproduce the issue?

This is documentation-only; commands and important limitations were checked against their production owners without running target code.

Is this the best way to solve the issue?

A dedicated operator guide is appropriate: it links the existing support matrix and clearly distinguishes supported procedures from incomplete recovery capabilities.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e4f73867c4eb.

Provenance checked

Security

None.

Evidence

What I checked:

  • Introduced documentation scope: The pinned introduction contains only the operator guide, its navigation and glossary entries, and reference corrections; the guide is absent from fetched main. Public docs: docs/gateway/postgresql.md. (docs/gateway/postgresql.md:1, bf70774c8f7a)
  • Agent provider correction matches implementation: The shared port-provider registry includes agentPortProvider alongside shared state and the documented plugin families. (src/infra/database-engine/port-provider.ts:24, bf70774c8f7a)
  • Recovery limitations verified: Archive restore verifies and extracts files; PostgreSQL Git restore delegates to fresh matched restoration, while Git verification invokes restoration and cleans local scratch. (src/snapshot/git-backup.ts:516, bf70774c8f7a)
  • Existing backup caveats accurately disclosed: Additional PostgreSQL stores discovered by Git --all receive a generic workboard identity, and PostgreSQL capture returns before SQLite credential-exclusion handling; the guide warns operators about both existing limitations. (src/snapshot/git-backup-codec.ts:262, bf70774c8f7a)
  • Documentation checks pass on reviewed head: GitHub reports successful check-docs and security-fast checks for the reviewed head; the read-only diff whitespace check also passes. (bf70774c8f7a)
  • Repository policy and history: Read the complete root and docs policies; no maintainer-notes directory exists. Feature history consistently routes PostgreSQL ownership to Peter Steinberger. One older provider blob was unavailable to blame and content-history searches; current source and documentation history independently establish the relevant behavior. Public docs: docs/reference/database-engines.md. (docs/reference/database-engines.md:161, e4f73867c4eb)

PR surface

Docs +526. Total +526 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 4 534 8 +526
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 534 8 +526

Labels

Label changes:

  • add P3: Documentation improves an experimental operator workflow without changing runtime behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: Documentation improves an experimental operator workflow without changing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 4:53 PM ET / 20:53 UTC.

@steipete
steipete merged commit 1e78ee6 into main Oct 16, 2026
97 of 98 checks passed
@steipete
steipete deleted the pgprep/r21a-operator-guide branch October 16, 2026 21:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant