Skip to content

test(rust): isolate acquisition visitor ownership - #557

Merged
LIghtJUNction merged 1 commit into
mainfrom
test/rust-acquisition-owner-isolation
Oct 1, 2026
Merged

LIghtJUNction merged 1 commit into
mainfrom
test/rust-acquisition-owner-isolation

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to merged Rust acquisition coverage PRs #542, #548 and #549.

Add one isolated PostgreSQL regression test for the remaining visitor ownership and consent boundary in PgAcquisitionStore::observe:

  • A consent-v2 observation without a persisted v2 consent row is rejected without creating a visitor or visit.
  • A legacy consent-v1 observation can bind an unowned visitor to its authenticated user.
  • A second, fully consented account cannot claim that visitor or persist its nonce/visit.
  • The failed owner-conflict transaction leaves the original owner and visit count unchanged.
  • After the original owner grants v2 consent, its v2 observation succeeds without changing ownership.

The acquisition real-integration inventory increases from five to six tests, and the repository inventory from 96 to 97 ignored tests across ten modules.

No production code, API, schema, frontend or Go changes.

Verification

Local:

  • cargo fmt --all --check: passed.
  • cargo clippy --locked -p lmm-api-rs --test acquisition -- -D warnings: passed.
  • cargo test --locked -p lmm-api-rs --test acquisition -- --skip postgres_: 2 passed.
  • cargo test --locked -p lmm-api-rs --test acquisition -- --ignored --list: all 6 PostgreSQL tests compiled and listed.
  • python3 tests/scripts/test-new-integration-suites.py: 7 passed.
  • bash tests/scripts/check-real-integration-gates.sh: passed; 97 ignored tests across 10 modules.
  • bash -n tests/scripts/run-real-integration-gates.sh: passed.
  • git diff --check: passed.

GitHub Actions CI run 36799563426: passed.

  • Rust formatting/lint/tests: passed.
  • PostgreSQL 18 and Valkey integration gate: passed.
  • postgres_visit_consent_and_owner_boundaries_are_atomic: passed.
  • Acquisition PostgreSQL suite: 6 passed, 0 failed.
  • CI Quality Gate: passed.

Coverage check

Targeted non-PostgreSQL acquisition coverage:

  • routes/acquisition.rs: 136/340 lines (40.00%), 15/37 functions (40.54%).
  • routes/acquisition/data.rs: 7/221 lines (3.17%), 2/26 functions (7.69%).
  • routes/acquisition/store.rs: 3/428 lines (0.70%), 1/43 functions (2.33%).

The local coverage command excludes the ignored PostgreSQL suite, so the store percentage does not credit this new database test; the CI PostgreSQL gate provides the execution evidence for the ownership/rollback path.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 00:56
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

LIghtJUNction commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Resolved in e656893. The repaired exact-head CI run 36799563426 completed successfully. The PostgreSQL 18/Valkey integration job executed postgres_visit_consent_and_owner_boundaries_are_atomic successfully; the acquisition suite reported 6 passed, 0 failed. The overall CI Quality Gate also passed.

@LIghtJUNction
LIghtJUNction force-pushed the test/rust-acquisition-owner-isolation branch from 730c891 to e656893 Compare October 1, 2026 01:07
@LIghtJUNction
LIghtJUNction merged commit 103d02b into main Oct 1, 2026
23 checks passed
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