Skip to content

test(recovery): preserve inbox claim deadline evidence - #177

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/bc-f8052bf5-4f9e-4146-8b5b-41daa97c2faf-14d8
Closed

test(recovery): preserve inbox claim deadline evidence#177
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/bc-f8052bf5-4f9e-4146-8b5b-41daa97c2faf-14d8

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Why

Protected-main recovery acceptance (#72) still inserts a processing inbox-consumption row without claim_deadline_at. After #81 that column is required, and maintain_inbox_claim_deadline is BEFORE UPDATE only, so the fixture fails the integration_consumption_claim_deadline_shape check. A buyer restore can also drop the wall-clock deadline and give a recovered worker a fresh lease.

This repair is intentionally not on the Created-session persist stack (#106 / #164). Those PRs should not be the landing vehicle for #72 evidence.

What this PR does

  • Seed claim_deadline_at on the processing recovery fixture.
  • Prove COPY ... FORMAT BINARY restore keeps the exact source deadline.
  • Record the schema-level restore boundary in CHANGELOG, QA-REC-01, TRACEABILITY, TEST_STRATEGY, deployment restore acceptance, risk register, and doctoring with PostgreSQL 18 COPY / backup-restore APA 7 references.
  • Keep QA-REC-01 honest: this is not a measured Hosted/Enterprise RPO/RTO drill.

Out of scope

Test plan

  • cargo test --test documentation_architecture_contract --test traceability_active_pr_contract
  • cargo test --test postgres_recovery_invariants (needs TEST_DATABASE_URL)

Do not merge until exact-head checks and independent last-push approval are satisfied. Prefer this head over burying the same repair inside #106.

Open in Web View Automation 

Processing consumption rows require claim_deadline_at after #81.
Seed the wall-clock deadline and prove binary restore keeps it.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (PR #177 @ 8a0db46 vs a763735)

This is the recovery landing vehicle. Prefer it over burying the same claim_deadline_at seed inside #109, #106, or #164.

Sound

  • After #81/0019, a processing row must carry claim_deadline_at. The trigger is BEFORE UPDATE only, so the fixture seeds the wall-clock instead of inventing an insert trigger.
  • Restore asserts exact source/restored timestamp equality. That is the buyer contract: a claimed inbox item must come back with the same deadline, not a refreshed lease.
  • QA-REC-01, TRACEABILITY, RISK, TEST_STRATEGY, and deployment restore acceptance stay honest: schema-level COPY ... FORMAT BINARY evidence, not a measured Hosted/Enterprise RPO/RTO drill.
  • Doctoring cites the current PostgreSQL 18 backup and COPY pages (APA 7). Those URLs are live official docs and define FORMAT BINARY.

Do next

  1. Move the two PostgreSQL references before Temoshok so the doctoring list stays APA 7 author order.
  2. Keep this draft off the Created-session persist stack. Do not land #109 as the recovery fix.
  3. Independent last-push approval and exact-head checks are still required. This automation does not approve or merge.

Session persist/load/start remains #180. Do not add assessment_session to the recovery table list until that persist lands on protected main.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

Comment thread tests/postgres_recovery_invariants.rs
Comment thread tests/postgres_recovery_invariants.rs
- **Stimulus:** restore supported release data into a clean recovery environment.
- **Response:** meets the profile's measured RPO/RTO, verifies immutable digests, tenant/linkage boundaries, deduplication and deletion reconciliation before service acceptance.
- **Evidence:** real restore drill governed by ADR-0017.
- **Current evidence:** `tests/postgres_recovery_invariants.rs` proves a schema-level `COPY ... FORMAT BINARY` restore of tenant-scoped outbox identity, in-flight inbox consumption fencing including `claim_deadline_at`, and immutable response-snapshot provenance. That test is not a measured Hosted/Enterprise RPO/RTO drill.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honest QA-REC-01 split. Schema-level COPY evidence is current; measured Hosted/Enterprise RPO/RTO remains missing. Do not promote this test to a GA recovery claim.


The PostgreSQL Global Development Group. (2026a). *PostgreSQL 18 documentation: Backup and restore*. https://www.postgresql.org/docs/18/backup.html

The PostgreSQL Global Development Group. (2026b). *PostgreSQL 18 documentation: COPY*. https://www.postgresql.org/docs/18/sql-copy.html

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APA 7 author sort ignores leading "The", so these PostgreSQL 18 entries belong before Temoshok and both W3C entries. The URLs are the current official PostgreSQL 18 backup and COPY pages, including FORMAT BINARY. Move the pair; do not drop them.

@seonghobae
seonghobae marked this pull request as ready for review August 16, 2026 21:22
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copy link
Copy Markdown
Contributor

Closing as already integrated on protected main. Current protected main is aac99d0b523b8f765846fc6edad834e5cf903ca8; its tests/postgres_recovery_invariants.rs now seeds claim_deadline_at, asserts it is non-null after binary COPY restore, and compares the restored deadline exactly to the source row. #247 also explicitly skipped replaying this recovery fixture because that exact invariant is already on protected main. The remaining documentation-only deltas on this old head do not justify a second landing vehicle for an implemented recovery invariant.

@seonghobae seonghobae closed this Aug 17, 2026
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.

2 participants