feat(recovery): bind bounded PostgreSQL restore command - #246
Draft
seonghobae wants to merge 7 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
changed the base branch from
main
to
fix/recovery-evidence-weakref-coverage-b84f0c9
August 19, 2026 00:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounded archive-recovery configuration slice — ACTIVE DRAFT / EXPLICIT #233 CHILD
This work originated from exact protected
main@b84f0c94154043a3473939c01bb6471de5a129aeon explicit non-default branchfeat/postgres-restore-command-b84f0c9. To validate the already-proven restore-command repair with the exact inherited coverage fix instead of duplicating that fix, it is now an explicit Draft child of #233.Exact stack boundary
fix/recovery-evidence-weakref-coverage-b84f0c95951b7a4d779903b8924abaef2a387cae50b7f54e75da8678c5834164333e3a33821c08f7fc2ac68pg_llm_batch/postgres_restore_command.pyplustests/test_postgres_restore_command.py.The stack commit is a non-destructive merge retaining both histories. It did not mutate #233, protected main, canonical docs, or adjacent recovery branches.
Product contract
This Draft closes one narrow #204 configuration gap without claiming physical PITR completion: bind one reviewed absolute helper executable token to PostgreSQL's required
restore_commandplaceholders as a deterministic server setting. The package does not accept caller-supplied shell command text, archive paths, credentials, arbitrary arguments, or alternate placeholder ordering.The current source accepts only an exact built-in
strhelper path; requires a bounded canonical absolute POSIX executable token; rejects relative/dot segments, duplicate/trailing separators, whitespace, control/non-ASCII bytes, percent placeholders, quotes, backslashes and shell-active metacharacters; revalidates stored helper authority immediately before export; fixes%fthen%pordering and shell-quotes both server-supplied placeholders; and uses one content-free validation diagnostic.Actual helper deployment/ownership/integrity, WAL archive custody, segment validation/copy semantics, PostgreSQL startup/replay, recovery-target binding, promotion, application acceptance, and achieved RPO/RTO remain outside this seam. This branch is not complete physical PITR.
RED → narrow repair
Prior exact test-only head
ba1dcaa6a491434541e1e69a1d637ef33bf6d26fproved the shell-token defect on hosted CI run32125096577: Python 3.10, 3.12 and 3.14 all failed the same realistic assertions, showing<helper> %f %pinstead of required shell-safe<helper> "%f" "%p".Pre-stack GREEN head
ebf4c6611cec1172cf61c1e9181483becc3820c5applied the narrow production fix:server_setting()renders fixed%fthen%pplaceholders as<helper> "%f" "%p"without widening accepted helper authority.CI
32127282546checked out that exact head with persisted credentials disabled. Python 3.10/3.12/3.14 unit jobs and PostgreSQL/container smokes succeeded; compile, Ruff and exact 100% public-docstring coverage succeeded;1361 passed, 5 deselected; andpostgres_restore_command.pywas exact 100% statement/branch covered. Its sole aggregate failure was protected-main 99.96% coverage from the two weakref arcs owned by #233. Security Scan32127282527, SAST Semgrep32127282609, and Release Acceptance32127282559were terminal-success.That pre-stack evidence proves the causal repair but is not transferred as current-head gate evidence.
Fresh writer/review safety
Fresh targeted branch inventory still finds this as the only
postgres-restore-commandbranch. Fresh formal-review and inline-thread inventories are empty. Draft #229 remains the separate canonical-documentation writer and was untouched. Exact head/base, protected main and writer evidence were re-read immediately before this metadata refresh; no competing actor moved this lane.Current exact-head validation
The genuinely new repository-local validation set on exact stacked head
e75da8678c5834164333e3a33821c08f7fc2ac68is now terminal-success:32200407730: success;32200407739: success;32200407876: success; and32200407903: success.CI independently checked out and verified exact
e75da8678c5834164333e3a33821c08f7fc2ac68with persisted checkout credentials disabled. Python 3.10/3.12/3.14 unit jobs and PostgreSQL/container smokes succeeded; compile and Ruff succeeded; public-docstring coverage was exactly 100%; repository production statement/branch coverage was exactly 100.00% (3665statements,1014branches, zero misses/partials); lock freshness succeeded; anduv build --no-sourcesproduced both sdist and wheel. The Python 3.14.7 coverage run completed1363 passed, 5 deselected, 5 warnings.Those five warnings are inherited test-harness hygiene defects outside this restore-command diff: four schema-evidence finalizer warnings owned by Draft #251 and one compose/runpy warning owned by Draft #252. They are not suppressed here. #251 and #252 separately prove their bounded fixes on exact stacked heads, but their evidence does not transfer to this PR.
Fresh formal-review and inline-thread inventories remain empty; absence of review is not approval. Keep this PR Draft because #233 must integrate first and final review/revalidation must be reacquired after retargeting.
Integration boundary
#233 is the exact predecessor and must integrate first through current governance. Its pg-local quality/security/release evidence is terminal-success, but its current-head independent review remains non-passing because the review-evidence control plane is owned by read-only central
.github. This child neither duplicates nor bypasses that blocker.After #233 integrates, retarget this PR to then-current protected main, prove the reconciled descendant diff remains only this restore-command slice, and reacquire every exact-final-head quality/security/coverage/package/SBOM/provenance/release/review gate. No predecessor, pre-stack, infrastructure-failed, status-only, author-only, or other-branch evidence transfers.
Refs #204, #233, #244, #250, #251, #252.