Skip to content

feat(recovery): inspect isolated restore application readiness - #296

Draft
seonghobae wants to merge 18 commits into
fix/recovery-evidence-weakref-coverage-b84f0c9from
feat/postgres-restore-application-readiness-b84f0c9
Draft

feat(recovery): inspect isolated restore application readiness#296
seonghobae wants to merge 18 commits into
fix/recovery-evidence-weakref-coverage-b84f0c9from
feat/postgres-restore-application-readiness-b84f0c9

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Buyer-visible recovery acceptance slice

Protected main@b84f0c94154043a3473939c01bb6471de5a129ae authenticates bounded restore catalog/RLS shape but does not prove that an already-connected isolated restore target satisfies the minimum database-side prerequisites needed by this package. This Draft adds a separate observation-only seam for that bounded gap without promoting it into end-to-end application or DR readiness.

Exact stack / writer boundary — refreshed from live refs

  • protected main: b84f0c94154043a3473939c01bb6471de5a129ae;
  • exact predecessor/base: #233@5951b7a4d779903b8924abaef2a387cae50b7f54;
  • head branch: feat/postgres-restore-application-readiness-b84f0c9;
  • exact current head: 754459739c98dcc3fb418338eed4bbcfd8b13c06;
  • live PR metadata reports 18 commits and three changed files; and
  • fresh targeted branch inventory returns exactly one application-readiness branch.

Fresh formal-review and inline-thread inventories are empty. Targeted no-PR writer probes performed before the current source/test sequence found the separate health/CLI, checkpoint, JSONL and orchestrator-lifecycle branches do not contain this new restore-readiness production path. Canonical documentation remains separately occupied and is not changed here.

RED -> narrow GREEN -> live negative acceptance lineage

  • RED 066b2af8dcbe8a1ca90f5fdf9cb0c4ded22b64a2: fixed content-free readiness contract imported the intentionally absent production module.
  • GREEN 8bbb65154f451fc426ac3fc962b026a00081269d: initial catalog-only implementation.
  • Follow-up passes tightened current-role authority, tokenizer extension ownership/callability, live integration shape, and evidence snapshot/provenance handling.
  • Test-first RED 6648b32dae64684576dc6a870284d520a420786c exposed that same-name/current-schema/zero-arg/callable health-function checks could accept a callable impostor with a different packaged result contract. Exact CI 32476667314 failed that intended contract on Python 3.10/3.12/3.14.
  • Narrow production fix ed664f803f7ba0f9a4c1816fa8b121deb6eaa23e authenticates the packaged health catalog identity without invoking it: set-returning record, exact TABLE(component TEXT, is_ready BOOLEAN, detail TEXT) output types/modes/names, and non-security-definer identity, in addition to the existing current-schema/zero-input/function-kind/count/callability predicates.
  • Current test-only 754459739c98dcc3fb418338eed4bbcfd8b13c06 adds live PostgreSQL negative acceptance for both a callable same-name wrong-result-contract function and an exact-result-shape SECURITY DEFINER impostor. Each replacement exists only inside the test transaction and is rolled back; production source is unchanged by this final commit.

Protected pg_llm_batch/schema.sql remains the source authority for pg_llm_batch_health_check() RETURNS TABLE(component TEXT, is_ready BOOLEAN, detail TEXT) with ordinary non-security-definer behavior.

Bounded product / security contract

The candidate performs one fixed catalog-qualified read-only query on a caller-owned already-connected isolated target and accepts only exact primitive evidence for:

  • current database reachability;
  • installed pg_tiktoken extension;
  • search-path-resolved, extension-owned and current-role-callable tiktoken_count(text,text);
  • search-path-resolved, extension-owned and current-role-callable tiktoken_encode(text,text);
  • current-schema ordinary com_config table reachable via schema USAGE and table SELECT; and
  • exactly one zero-argument current-schema pg_llm_batch_health_check function callable via schema USAGE plus function EXECUTE, with the exact packaged result/catalog identity above.

It does not invoke the health function, open another connection, inspect/accept a DSN, install extensions, grant privileges, alter search paths, mutate the target outside test-owned rollback transactions, start/resume/promote recovery, or reflect database diagnostics/schema names/relation contents/provider content/credentials in public evidence or errors.

This slice does not prove endpoint/provider credentials or connectivity, Fernet/TLS/key custody, exact PITR stop semantics, target promotion, end-user traffic readiness, achieved RPO/RTO, HA/DR, CSAP, SOC 2, or certification.

Exact-head hosted validation — current head remains non-passing as a complete gate set

Fresh commit-scoped workflow inventory for exact unchanged head 754459739c98dcc3fb418338eed4bbcfd8b13c06 now shows:

  • CI 32499001130: completed / success;
  • Release Acceptance 32499000978: completed / success;
  • exact-current-head Security Scan / SAST Semgrep: absent from the returned commit-scoped inventory; and
  • current-head formal review: absent; current-head inline review threads: none.

The two exact-head successes prove only their own checkout. Absent Security/SAST and absent formal review remain non-passing, and prior RED or predecessor-green evidence does not transfer. Keep the head stable unless a new exact current defect is proven.

Dependency / governance boundary

Keep this PR Draft. #233 must integrate first through live governance, and #233 itself remains blocked by its current independent-review/control-plane prerequisite tracked in #244. Focused defect/RCA truth for this lane is tracked in #295.

After #233 reaches protected main, reconcile/retarget this candidate against then-current protected main and reacquire every exact-final-head/current-base quality, supported-Python including 3.14, exact 100% owned production statement/branch coverage, public-docstring, security/SAST, package/SBOM/provenance/release, formal-review, thread-resolution and then-live governance gate.

Merge only an unchanged final head with zero valid findings and any qualifying non-author current-last-push approval required by live policy. No queued, pending, cancelled, skipped-required, absent, neutral, stale, predecessor, status-only, synthetic, author-only, rate-limited, infrastructure-failed, dismissed, or conclusion-null evidence transfers.

Refs #295, #204, #223, #233, #244.

Make this recovery-readiness lane an explicit non-destructive descendant of #233 while preserving the exact #233 tree. The branch was created from protected main first; no protected ref is modified.
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a4805e0-3a90-490c-92fb-29446d4a23ab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

Fresh hardening delta for exact head a25010df9354b81e74ff5073ca6829e76927aa89 (protected main remains b84f0c94154043a3473939c01bb6471de5a129ae; predecessor/base remains #233 5951b7a4d779903b8924abaef2a387cae50b7f54).

A current-branch review found a data-integrity gap in the candidate evidence boundary: the prior public PostgresRestoreApplicationReadinessEvidence dataclass could be constructed with all-success values and serialized without a live database inspection. Test-first commit 0158617a7b7a9c0cb8a0b9eabfcf5d067c54e53d makes that fabrication path RED; 4e2cb7c0c74a20600b8cdba14d3603c72ebb895e binds serialization to the exact package-observed object and immutable behavior-bearing field snapshot; 74725232e00406324452d85b5b8245ce94c366da covers subclass/type provenance; a25010df9354b81e74ff5073ca6829e76927aa89 keeps the predicate explicit for exact branch-coverage accounting. Public construction, dataclasses.replace() copies, subclasses, and post-construction field mutation now fail closed rather than masquerading as observed readiness.

The relative surface is still only the same three recovery-specific source/test files; fresh targeted branch inventory still finds no competing application-readiness branch. Issue #295 has been updated so this provenance requirement is part of the bounded acceptance contract rather than an implementation-only assumption.

Exact-head hosted evidence is still non-passing as a complete set: CI 32457650426 queued; Security Scan 32457650520 queued; SAST Semgrep 32457650387 queued; Release Acceptance 32457650455 pending. Fresh formal review inventory is empty. Keep this Draft stable pending terminal exact-head validation; queued/pending evidence and absence of review are not merge authority.

@opencode-agent opencode-agent Bot added area: operations Operability, observability, readiness, SLO, backup, or retention priority: medium Normal-priority or P2 work scope: research Research, statistical validation, or scientific evidence status: draft Draft pull request type: feature New or expanded product capability labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: operations Operability, observability, readiness, SLO, backup, or retention priority: medium Normal-priority or P2 work scope: research Research, statistical validation, or scientific evidence status: draft Draft pull request type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant