|
| 1 | +# TASK-194 — Real-World Application Simulation Tests |
| 2 | + |
| 3 | +## Goal |
| 4 | +Simulate realistic application patterns to invalidate "Zig parity is complete". |
| 5 | + |
| 6 | +## Status |
| 7 | +- State: triage |
| 8 | +- Priority: HIGH (tests real usage, not contrived scenarios) |
| 9 | +- Discovered: 2025-12-23 (hypothesis invalidation request) |
| 10 | + |
| 11 | +## Hypothesis to Invalidate |
| 12 | +"Zig behaves correctly under realistic application workloads." |
| 13 | + |
| 14 | +## Test Scenarios |
| 15 | + |
| 16 | +### 1. Todo App Sync |
| 17 | +- Create tasks with nested subtasks |
| 18 | +- Mark complete/incomplete in different order on two devices |
| 19 | +- Sync and verify convergence |
| 20 | + |
| 21 | +### 2. Chat/Notes App |
| 22 | +- Long-running conversation with edits |
| 23 | +- Offline edits on multiple devices |
| 24 | +- Reconnect and merge |
| 25 | + |
| 26 | +### 3. Shopping Cart |
| 27 | +- Add/remove items rapidly |
| 28 | +- Update quantities concurrently |
| 29 | +- Apply discount codes (triggers) |
| 30 | + |
| 31 | +### 4. Collaborative Document |
| 32 | +- Multiple users editing same "document" (row with text blob) |
| 33 | +- Concurrent field updates |
| 34 | +- History/versioning queries |
| 35 | + |
| 36 | +### 5. Inventory Management |
| 37 | +- Stock count adjustments |
| 38 | +- Transfer between locations |
| 39 | +- Audit trail preservation |
| 40 | + |
| 41 | +## Test Approach |
| 42 | +1. **Script realistic operation sequences** |
| 43 | +2. **Simulate multi-device with separate DBs** |
| 44 | +3. **Sync via crsql_changes protocol** |
| 45 | +4. **Verify final state matches on all "devices"** |
| 46 | +5. **Compare Zig vs Rust/C behavior** |
| 47 | + |
| 48 | +## Files to Create |
| 49 | +- `zig/harness/test-app-todo.sh` (new) |
| 50 | +- `zig/harness/test-app-chat.sh` (new) |
| 51 | +- `zig/harness/test-app-inventory.sh` (new) |
| 52 | + |
| 53 | +## Acceptance Criteria |
| 54 | +1. Each app simulation runs without error |
| 55 | +2. All "devices" converge to same state |
| 56 | +3. Zig and Rust/C produce identical final state |
| 57 | +4. Either find divergence OR confirm real-world readiness |
| 58 | + |
| 59 | +## Parent Docs / Cross-links |
| 60 | +- Existing realistic tests: `test-realistic-sync.sh`, `test-realistic-offline.sh`, `test-realistic-collab.sh` |
| 61 | +- Gap backlog: `research/zig-cr/92-gap-backlog.md` |
| 62 | + |
| 63 | +## Progress Log |
| 64 | +- 2025-12-23: Created from hypothesis invalidation request. |
| 65 | + |
| 66 | +## Completion Notes |
| 67 | +(Empty until done.) |
0 commit comments