[Bounty proposal] Harden backend/database/live_owner_continuity.py against invalid IDs, non-finite continuity values, and malformed snapshots ($50 proposed)
What's wrong
In ackend/database/live_owner_continuity.py:
- Unsanitized identifiers (uid, conversation_id, segment_id): Empty/whitespace-only strings, path separators (/, , ..), control characters, and overly long identifiers are passed directly into Firestore document paths without validation.
- Malformed snapshot payloads (snapshot.to_dict()): When snapshot.to_dict() returns None or a non-dict object, field reads raise uncaught AttributeError.
- Non-finite numeric fields (NaN, inf, booleans): Continuity timestamps, durations, confidence scores, and counters accept ool, NaN, or inf, corrupting stored continuity state.
- Transient store failure fragility & lack of client injection seam: Direct global client lookups without error boundaries or optional irestore_client injection prevent graceful degradation and hermetic unit testing.
Proposed Fix
- Validate and sanitize identifiers (uid, conversation_id, segment_id) against empty strings, path traversal tokens, and control characters.
- Guard snapshot.to_dict() against None/non-dict payloads and wrap Firestore read/write operations in safe error boundaries.
- Normalize and validate numeric continuity fields against ool, NaN, and inf.
- Add optional irestore_client injection across public functions and add 51 hermetic unit tests in ackend/tests/unit/test_live_owner_continuity_resilience.py.
Proposed Bounty
$50
Bounty settlement address (Base Mainnet USDC): 0xb9f3765aeb1974c27a193463f655a1a57b3aec94
Implemented in #22901: id/token/revision validation, snapshot shape guards, fail-closed reads, client seam, 167 hermetic tests
Bounty settlement address (Base Mainnet USDC): 0x93c0d4e7100bc6b59e28e074f30a1ac37244b6af
Hi! I'm interested in contributing to this bounty. I noticed that PR #22901 has already been mentioned for this issue. Is the bounty still open for additional contributions, or has the existing PR already covered all the requirements? I'd like to confirm before starting work. Thanks!
Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏