Skip to content

docs: validate the README + entire doc tree against the code (and fix 2 bugs it surfaced)#23

Merged
postgresql007 merged 6 commits into
mainfrom
docs/readme-tutorial-accuracy
Jul 6, 2026
Merged

docs: validate the README + entire doc tree against the code (and fix 2 bugs it surfaced)#23
postgresql007 merged 6 commits into
mainfrom
docs/readme-tutorial-accuracy

Conversation

@postgresql007

Copy link
Copy Markdown
Contributor

Validates the README and the entire documentation tree against the actual v1.0.7 binary and code — capturing real command output where examples were shown — and fixes everything that did not match. Two things came back clean throughout: 0 dead links (1580 checked) and no nonexistent top-level commands. The prose and examples were another story.

Two real code bugs the doc validation surfaced (fixed + regression-tested)

  • Restore --verify gate was broken on every normal restore. It ran pg_verifybackup <target> without -n, so it tried to parse WAL that a base-only restore (WAL fetched at recovery via restore_command) doesn't have — failing with "could not find any WAL file" and reporting Verification: failed on healthy restores. Now passes -n; a clean restore reports Verification: passed. This makes the docs' verification claims true.
  • Simple helper validated the wrong storage schemes (gs:// / azure://) instead of the registered gcs:// / azblob://.

Documentation fixes (~76 files)

Recurring false claims

  • Tier-2 plugin protocol described as hashicorp/go-plugin (gRPC over stdio) — real is one-shot stdio JSON-RPC (gRPC is the v1.1 roadmap contract).
  • Shipped features mislabeled "stub / deferred to v0.5": wal push, verify --full, repo scrub, kms rotate, kms shred, control-plane restore/verify dispatch, /metrics, PG-backed registry, repair scrub --heal.
  • A nonexistent rbac command cited in all four compliance mappings (SOC2/ISO/HIPAA/FedRAMP).
  • Unpublished-artifact claims (docker pull ghcr:v1.1 shim images, -fips image, packaged shims) — images aren't published; shims are source-only.

Wrong values — sink plugin names (datadog-events/splunk-hec/otel-events), config keys (keep_fulls, pg_connection, map-keyed deployments), schemes (gcs:///file:///local:default), error codes (restore.target_in_wal_gap exit 7, splitbrain.*, several verify.*), a fabricated --allow-cross-region flag, --mode system, Go 1.19→1.26, PG "15+"→"15–18", Rekor "by default"→roadmap, skill_version 1.0.0, and unimplemented sync-target / k8s-Job / ≥5 TB-replica / "no incremental chains" claims → roadmap or corrected.

~30 fabricated sample-output blocks (backup, list, show, restore, preview, doctor, kms inspect, repo init, deployment/sink add, notify list, rotate, approvals, residency, scrub/heal, verify, version, patroni status, export-session) → replaced with real captured output.

Validation

  • Every command/flag checked against /tmp/pghs <cmd> --help; counts checked against code registries; sample output captured from a live PostgreSQL and against the real renderers.
  • go build ./... green; the two code fixes carry regression tests (TestVerify_PassesNoParseWAL, TestValidateRepoURL_Schemes).
  • 0 dead links; no doc tells users to pull the unpublished ghcr image.

Commits

  1. fix(restore,simple) — the two code bugs + tests
  2. docs — README + basic tutorials (real captured output)
  3. docs(ops,reference,compliance)
  4. docs(explanation)
  5. docs(how-to)
  6. docs(faq,glossary,tutorials)

…ch backends

Two correctness bugs surfaced while validating the docs against the code:

- restore: the post-restore --verify gate ran `pg_verifybackup <target>`
  without -n, so it tried to parse WAL. A pg_hardstorage restore lays
  down the base backup only (WAL is fetched at recovery via the
  restore_command), so the data dir has no pg_wal yet — pg_verifybackup
  failed EVERY normal restore with "could not find any WAL file",
  reporting `Verification: failed`. It now passes -n (--no-parse-wal),
  verifying the manifest + file checksums; a clean restore reports
  `Verification: passed`.
- simple helper: validateRepoURL accepted `gs://` and `azure://` — schemes
  with no registered backend — and rejected the real `gcs://` / `azblob://`.
  It now matches the schemes the storage registry actually registers
  (file, s3, gcs, azblob, sftp, scp).

Both covered by regression tests.
…al CLI

Validated every command, flag, count, sample output, and file link in the
README and the basic tutorials against the actual binary (captured real
output from a live PostgreSQL) and fixed everything that did not match:

- README: bare `make` prints help, it does not build — use `make build`
  (and `make all-binaries` for both binaries). Dropped "no incremental
  chains to break" (the tool ships PG 17 incremental backups /
  `--incremental-from`).
- getting-started: replaced the entirely fabricated `doctor` output with
  the real sectioned report; the container section no longer tells users
  to `docker pull` an unpublished image (build from the Dockerfile);
  `hint:` not "Suggested fix:"; version-agnostic integration-test PG.
- first-backup-restore: replaced fabricated backup / list / show / restore
  output blocks with real captured output; `show` no longer claims
  encryption-envelope / verification-record rows it does not print.
- pitr: real "Restore plan (preview only …)" preview and "✓ Restore
  complete / Recovery armed" apply output; backup IDs include the hash.
- encryption: real `kms inspect` format and keyring filenames; manifest
  field is `wrapped_dek` (+`scheme`), not `wrapped_dek_b64`; a denied KMS
  Decrypt is an auth error (exit 3), not `kms.unauthorized (exit 8)`;
  `kms rotate` is not approval-gated (only `kms shred` is; shred needs
  `--repo`).
- patroni: real `patroni status` layout; real follower event ops
  (`wal.follower.leader_change` / `slot_reconciled` / `wal_gap_detected`);
  removed the unimplemented "≥5 TB prefers a replica" claim.
…version claims against the code

Fixes surfaced by validating every claim against the v1.0.7 binary:
- operator-guide: 'stub/deferred to v0.5' relabelled as shipped for
  wal push, verify --full, repo scrub, kms rotate, kms shred; config
  key keep_full_count -> keep_fulls.
- cost/slo: replaced the fabricated by_tenant[] JSON shape and wrong
  jq field names (bytes_total -> total_bytes, rpo_target ->
  rpo_target_seconds) with the real body fields.
- reference: keystore path, live metric catalogue, StoragePlugin
  Barrier method, local: KEKRef resolution, reserved-metric wording.
- compliance/runbooks: removed the nonexistent 'rbac' CLI command from
  all four control mappings; gated --fips-strict behind the FIPS build;
  marked cross-region residency enforcement (--allow-cross-region) as
  roadmap; fixed runbook flags/codes (--out not -o, --force not
  --confirm, restore.target_in_wal_gap/exit 7, splitbrain.* codes,
  repair scrub --heal); reconciled control-plane-setup v0.4/v0.5
  framing to shipped.
…t the code

- Tier-2 plugin transport is one-shot stdio JSON-RPC, not
  hashicorp/go-plugin / gRPC (that is the v1.1 roadmap contract).
- Synchronous-target mode (wal_mode: synchronous) is not implemented —
  only sync-standby detection ships; marked as roadmap.
- Real dual-slot config schema (patroni.slots {name, role}); manifest
  kek_ref local:default; comparison doc no longer claims Azure/GCS/SFTP
  are unshipped.
- Skill signing is roadmap (skills are unsigned YAML today); real
  builtin skills (ask/explain/incident/restore) and skill commands;
  audit-anchor cadence via schedule.audit_anchor; k8s-Job sandbox is
  roadmap; kms rotate/shred/repair attestation flag corrections; shims
  ship today (not v1.1).
… and config schema

Validated every recipe against the v1.0.7 binary and captured real output:
- Added required flags the examples omitted (kms shred/verify --repo
  --require-approval, hold purge-expired --yes).
- Removed false 'ghcr image carries the compat shims' claims — images
  aren't published and the shims are source-only; recipes now build
  them from cmd/pg-hardstorage-* in a builder stage.
- Corrected sink plugin names (datadog-events / splunk-hec / otel-events)
  and config keys; the config-file schema (map-keyed deployments,
  pg_connection, struct schedules, per-deployment repo, keep_fulls).
- Replaced ~25 fabricated output blocks (repo init, deployment/sink add,
  notify list, rotate, approvals, residency, scrub/heal, verify, version)
  with real captured output, and fixed ~10 wrong error codes.
- Windows: no --mode flag (UID-based), release ships only
  pg_hardstorage.exe; version is a one-line output; Go 1.26+.
…d fabricated output

- Tier-2 plugin protocol is stdio JSON-RPC, not go-plugin/gRPC (faq,
  glossary, tutorials/index).
- Storage schemes gcs:// / file:// (not gs:// / fs://); KEKRef
  local:default (not local-keyring://).
- PG 15-18 supported (18 is first-class, not allow-failure); audit
  anchoring is self-hosted today with external Rekor on the roadmap;
  builtin ask skill version 1.0.0.
- llm-incident-walkthrough: replaced fabricated wal-stream error,
  export-session output, and bundle contents with the real output and
  tar entries; added the missing incident tool.
- build-a-storage-plugin: plugin list (doctor has no plugin section),
  Barrier in the 12-method interface, mem:// steps marked aspirational,
  removed '(Agent F)' placeholders.
@postgresql007
postgresql007 merged commit 38c5b3f into main Jul 6, 2026
34 checks passed
@postgresql007
postgresql007 deleted the docs/readme-tutorial-accuracy branch July 6, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant