Repository: cppa-cursor-browser
Assignee: Brad @bradjin8
Points: 5
Severity: Medium
Problem
No property-based testing or fuzzing covers the blob/bubble parsing pipeline. The pipeline parses Cursor's undocumented, evolving internal format — particularly the CLI agent blob chains stored under ~/.cursor/chats/. The test suite (28 files) is strong at the boundaries (model validation, path traversal, API request/response) but the interior assembly functions that transform raw database rows into structured tabs are tested primarily through integration paths. Adversarial or generative test inputs would be the most direct way to discover schema drift scenarios that the silent failure chain will hide in production.
Acceptance Criteria
Implementation Notes
Use the hypothesis library (standard for Python property-based testing). Create a new test file tests/test_blob_parsing_fuzz.py. Define strategies for the blob input shapes: st.binary() for raw blobs, st.dictionaries(st.text(), st.one_of(st.text(), st.integers(), st.none())) for from_dict inputs. The key property to test is "the parser never crashes" — it should always return a valid result or raise a structured SchemaError. A secondary property: "parsing is idempotent" — parsing the same input twice produces the same output. Focus on the services/workspace_tabs.py bubble assembly and the Bubble.from_dict entry point. The CLI agent blob chain parsing (if implemented in services/cli_tabs.py) should also be covered.
References
- Eval finding: Test 31 (Test Depth) — part of the "Unverified Dark Path" compound (T11+T20+T30+T31)
- Related files:
services/workspace_tabs.py, models/conversation.py (Bubble), services/cli_tabs.py, tests/
Repository: cppa-cursor-browser
Assignee: Brad @bradjin8
Points: 5
Severity: Medium
Problem
No property-based testing or fuzzing covers the blob/bubble parsing pipeline. The pipeline parses Cursor's undocumented, evolving internal format — particularly the CLI agent blob chains stored under
~/.cursor/chats/. The test suite (28 files) is strong at the boundaries (model validation, path traversal, API request/response) but the interior assembly functions that transform raw database rows into structured tabs are tested primarily through integration paths. Adversarial or generative test inputs would be the most direct way to discover schema drift scenarios that the silent failure chain will hide in production.Acceptance Criteria
hypothesisis added to dev dependencies inpyproject.tomlBubble.from_dictwith arbitrary dict inputs, blob chain parsing with randomized byte sequences, and text extraction from generated conversation structures@given(st.dictionaries(...))or equivalent Hypothesis strategies to generate inputsSchemaError)Implementation Notes
Use the
hypothesislibrary (standard for Python property-based testing). Create a new test filetests/test_blob_parsing_fuzz.py. Define strategies for the blob input shapes:st.binary()for raw blobs,st.dictionaries(st.text(), st.one_of(st.text(), st.integers(), st.none()))forfrom_dictinputs. The key property to test is "the parser never crashes" — it should always return a valid result or raise a structuredSchemaError. A secondary property: "parsing is idempotent" — parsing the same input twice produces the same output. Focus on theservices/workspace_tabs.pybubble assembly and theBubble.from_dictentry point. The CLI agent blob chain parsing (if implemented inservices/cli_tabs.py) should also be covered.References
services/workspace_tabs.py,models/conversation.py(Bubble),services/cli_tabs.py,tests/