Repository navigation
fix(backend): share strict Firestore transaction fixture - #9850
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Monitor run summaryNo actionable review comments or PR-specific check failures found. CI status: Backend unit suite is the only failing check. The failure is Review threads: None unresolved. |
|
@cursor fix failing tests |
|
Fixed the failing backend unit test. Root cause: Fix: Moved staged-task API methods ( Verification: cd backend && .venv/bin/pytest -q tests/unit/test_desktop_rest_inventory.py
# 9 passedPushed in commit Note: The PR description should include |
|
@cursor fix failing check |
|
Fixed the failing Hygiene check. Root cause: After rebasing onto latest Fix: That desktop extraction was no longer needed —
Verification: cd backend && .venv/bin/pytest -q tests/unit/test_strict_firestore_transaction.py \
tests/unit/test_memory_ledger.py tests/unit/test_candidate_lifecycle.py \
tests/unit/test_desktop_rest_inventory.py
# 98 passed
# Local hygiene simulation
python3 .github/scripts/run_checks.py --lane ci --base origin/main --head HEAD ...
# product-file-line-count-ratchet PASS, failure-class-protocol PASS, product-invariants PASSPushed as |
Closes #9840. Consolidate ledger and candidate-lifecycle Firestore transaction fakes into StrictFirestore, enforce read-before-write after set/update, reject cross-store references, and fail explicitly on unsupported fake APIs. Record FC-6 and document when to use the fixture versus the Firestore emulator. Verification: - cd backend && .venv/bin/pytest -q tests/unit/test_strict_firestore_transaction.py tests/unit/test_memory_ledger.py tests/unit/test_candidate_lifecycle.py tests/unit/test_desktop_rest_inventory.py — 98 passed Co-authored-by: David Zhang <[email protected]>
c9617b5 to
7db0ff6
Compare


Summary
Closes #9840.
setandupdate.StrictFirestoreinstances as fixture-integrity policy, preventing accidental mixing of unrelated in-memory stores.Root cause and durable guard
The prior ledger fake permitted a transaction-bound document read after a staged write, although Firestore rejects that ordering. The shared fixture defaults to rejecting it, so both source suites now exercise the same production constraint.
The fixture intentionally does not model query results, deletes, commit/rollback visibility, atomicity, retries, or contention. It rejects those operations explicitly; incidents in those areas require emulator coverage before a targeted fixture extension. Same-instance enforcement is a fake-integrity policy, not a claim about Firestore client identity.
Verification
cd backend && .venv/bin/pytest -q tests/unit/test_strict_firestore_transaction.py tests/unit/test_memory_ledger.py tests/unit/test_candidate_lifecycle.py— 89 passedcd backend && .venv/bin/pyright -p pyrightconfig.json --pythonpath .venv/bin/python— 0 errors (2,236 existing repository warnings)make preflight— 16 checks passedFull-suite note
cd backend && ./test.shpreviously encountered an unrelated fast-test timing threshold intest_activate_task_intelligence_dogfood_user.py::test_missing_control_plans_explicit_read_at_default_generation(0.13s vs 0.12s). Its isolated rerun passed; this PR does not alter that test or timing configuration.