Skip to content

Commit a7ddaee

Browse files
done++
1 parent 0887da6 commit a7ddaee

22 files changed

+6469
-273
lines changed

.tasks/DELEGATE_WORK_HANDOFF.md

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,202 @@ Artifacts:
6868

6969
---
7070

71+
## Round 2025-12-22 (62) — 8 new parity test suites (8 tasks)
72+
73+
**Tasks executed**
74+
- `.tasks/done/TASK-161-resurrection-parity-suite.md`
75+
- `.tasks/done/TASK-166-sentinel-parity-suite.md`
76+
- `.tasks/done/TASK-170-fk-cascade-suite.md`
77+
- `.tasks/done/TASK-172-error-handling.md`
78+
- `.tasks/done/TASK-173-schema-mismatch.md`
79+
- `.tasks/done/TASK-174-partial-sync.md`
80+
- `.tasks/done/TASK-177-default-value-merge.md`
81+
- `.tasks/done/TASK-179-multinode-sync.md`
82+
83+
**Commits**
84+
- (pending commit)
85+
86+
**Environment**
87+
- OS: darwin (macOS ARM64)
88+
- Tooling: nix, zig (via nix), bash
89+
90+
**Commands run (exact)**
91+
```bash
92+
make -C zig build
93+
bash zig/harness/test-resurrection-parity.sh
94+
bash zig/harness/test-sentinel-parity.sh
95+
bash zig/harness/test-fk-crr.sh
96+
bash zig/harness/test-error-handling.sh
97+
bash zig/harness/test-schema-mismatch.sh
98+
bash zig/harness/test-partial-sync.sh
99+
bash zig/harness/test-default-merge.sh
100+
bash zig/harness/test-multinode-sync.sh
101+
```
102+
103+
**Outputs (paste)**
104+
105+
<details>
106+
<summary>TASK-161: Resurrection parity (4/5 pass, 1 DIVERGENCE)</summary>
107+
108+
```text
109+
Test 1: Live via sentinel - PASS (5/5 checks)
110+
Test 2: Dead via sentinel - FAIL (Zig doesn't resurrect tombstoned row)
111+
DIVERGENCE: Zig row count = 0, Rust/C = 1
112+
```
113+
114+
**Critical divergence**: When a tombstoned row (CL=2) receives a resurrection sentinel (CL=3), Zig does NOT resurrect the row. Rust/C correctly resurrects it.
115+
</details>
116+
117+
<details>
118+
<summary>TASK-166: Sentinel parity (5/6 pass, 1 DIVERGENCE)</summary>
119+
120+
```text
121+
Test 1: No sentinel on INSERT - PASS
122+
Test 2: Sentinel on DELETE - PASS
123+
Test 3: No sentinel on REPLACE - PASS
124+
Test 4: No sentinel on merge - FAIL
125+
DIVERGENCE: Zig creates 3 spurious sentinels vs Rust 0
126+
Test 5: Sentinel propagation - PASS
127+
Test 6: Sentinel structure - PASS
128+
```
129+
130+
**Divergence**: Zig incorrectly creates sentinel entries when syncing INSERT changes to a new site. Should only create sentinels on DELETE.
131+
</details>
132+
133+
<details>
134+
<summary>TASK-170: FK/CRR parity (11/11 pass)</summary>
135+
136+
```text
137+
PASSED: 11
138+
FAILED: 0
139+
SKIPPED: 0
140+
141+
Key Findings:
142+
1. CRR tables REJECT FK constraints (by design)
143+
2. Non-CRR tables CAN have FKs referencing CRR tables
144+
3. Use soft relationships (no FK) for CRR-to-CRR links
145+
4. App logic must handle orphaned rows (no CASCADE)
146+
5. Out-of-order sync works with soft relationships
147+
148+
All FK/CRR tests PASSED
149+
```
150+
</details>
151+
152+
<details>
153+
<summary>TASK-172: Error handling (10/10 pass)</summary>
154+
155+
```text
156+
PASS: 10
157+
FAIL: 0
158+
SKIP: 0
159+
DIVERGENCE: 0
160+
161+
All error handling tests PASSED (no crashes)
162+
```
163+
164+
Zig handles all malformed inputs gracefully (error, not crash). In some cases Zig is MORE robust than Rust/C.
165+
</details>
166+
167+
<details>
168+
<summary>TASK-173: Schema mismatch (11/12 pass, 1 DIVERGENCE)</summary>
169+
170+
```text
171+
PASSED: 11
172+
FAILED: 1
173+
SKIPPED: 0
174+
175+
Divergences found:
176+
- source_has_extra_column: Zig='ERROR' vs Rust='IGNORED'
177+
```
178+
179+
**Divergence**: When source has a column that destination doesn't, Zig returns ERROR while Rust/C gracefully ignores it. Both approaches have merit.
180+
</details>
181+
182+
<details>
183+
<summary>TASK-174: Partial sync (12/12 pass)</summary>
184+
185+
```text
186+
PASSED: 12
187+
FAILED: 0
188+
SKIPPED: 0
189+
DIVERGENCES: 1 (documented atomicity difference)
190+
191+
All partial sync tests PASSED
192+
```
193+
194+
Both implementations maintain atomicity. Minor divergence: Zig has stricter transaction-level atomicity.
195+
</details>
196+
197+
<details>
198+
<summary>TASK-177: Default merge (6/6 pass)</summary>
199+
200+
```text
201+
PASSED: 6
202+
FAILED: 0
203+
204+
All DEFAULT merge semantics tests PASSED
205+
```
206+
207+
Both implementations handle DEFAULT values identically. No phantom clock entries created.
208+
</details>
209+
210+
<details>
211+
<summary>TASK-179: Multinode sync (5/6 pass, 1 DIVERGENCE)</summary>
212+
213+
```text
214+
Results: 5 passed, 1 failed, 0 skipped
215+
216+
Test 1: Discord corrosion (3-node) - PASS
217+
Test 2: Extended 4-node discord - PASS
218+
Test 3: Star topology - FAIL
219+
220+
DIVERGENCE: Zig star topology fails to converge
221+
Hub and C diverged
222+
Hub and D diverged
223+
```
224+
225+
**Critical divergence**: In hub-and-spoke topology, Zig nodes fail to converge after sync through central hub. This suggests a bug in site_id filtering or change application.
226+
</details>
227+
228+
**Files created**
229+
- `zig/harness/test-resurrection-parity.sh` (new, ~700 lines)
230+
- `zig/harness/test-sentinel-parity.sh` (new, ~570 lines)
231+
- `zig/harness/test-fk-crr.sh` (new, ~615 lines)
232+
- `zig/harness/test-error-handling.sh` (new, ~350 lines)
233+
- `zig/harness/test-schema-mismatch.sh` (new, ~450 lines)
234+
- `zig/harness/test-partial-sync.sh` (new, ~230 lines)
235+
- `zig/harness/test-default-merge.sh` (new, ~350 lines)
236+
- `zig/harness/test-multinode-sync.sh` (new, ~950 lines)
237+
- `zig/harness/test-parity.sh` (modified, wired in all new tests)
238+
239+
**Reproduction steps (clean checkout)**
240+
1. `git clone <repo> && cd cr-sqlite`
241+
2. `make -C zig build` — build Zig extension
242+
3. `bash zig/harness/test-resurrection-parity.sh`
243+
4. `bash zig/harness/test-sentinel-parity.sh`
244+
5. `bash zig/harness/test-fk-crr.sh`
245+
6. `bash zig/harness/test-error-handling.sh`
246+
7. `bash zig/harness/test-schema-mismatch.sh`
247+
8. `bash zig/harness/test-partial-sync.sh`
248+
9. `bash zig/harness/test-default-merge.sh`
249+
10. `bash zig/harness/test-multinode-sync.sh`
250+
251+
**Known gaps / unverified claims**
252+
- **4 critical divergences found** requiring follow-up:
253+
1. Resurrection: Zig doesn't resurrect tombstoned rows via sentinel
254+
2. Sentinel: Zig creates spurious sentinels on merge
255+
3. Schema mismatch: Zig errors on unknown columns (Rust ignores)
256+
4. Multinode: Zig star topology fails to converge
257+
- CI integration not verified (local runs only)
258+
- No coverage captured
259+
260+
**Follow-up tasks needed (to be created in triage)**
261+
1. Fix Zig resurrection via sentinel (CL=3 should resurrect CL=2 tombstone)
262+
2. Fix Zig spurious sentinel creation during merge
263+
3. Investigate Zig star topology convergence failure
264+
265+
---
266+
71267
## Round 2025-12-21 (61) — Cross-platform compat + optimizations (3 tasks)
72268

73269
**Tasks executed**

.tasks/backlog/TASK-170-fk-cascade-suite.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

.tasks/backlog/TASK-173-schema-mismatch.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)