|
| 1 | +# TASK-221 — Merge Atomicity Test Alignment (Unknown Column Policy) |
| 2 | + |
| 3 | +## Goal |
| 4 | +Reconcile `zig/harness/test-merge-atomicity.sh` expectations with the current “unknown columns are ignored” sync policy, and ensure CI gating reflects the intended contract. |
| 5 | + |
| 6 | +## Status |
| 7 | +- State: triage |
| 8 | +- Priority: HIGH (blocks CI release-gate if required) |
| 9 | +- Created: 2025-12-26 |
| 10 | +- Triggered by: running `bash zig/harness/test-merge-atomicity.sh` during “Update tasks” |
| 11 | + |
| 12 | +## Context |
| 13 | +We decided/implemented lenient schema mismatch behavior (unknown columns ignored) to support rolling upgrades. |
| 14 | + |
| 15 | +`zig/harness/test-merge-atomicity.sh` currently injects an “error” by using `cid = 'NONEXISTENT_COLUMN'` in a multi-row `INSERT INTO crsql_changes ... VALUES (...), (...);`. |
| 16 | + |
| 17 | +With unknown-column rows now ignored by policy, the statement can legitimately succeed while applying the valid subset. This makes Test 2 and Test 7 fail. |
| 18 | + |
| 19 | +Observed current output: |
| 20 | +- `bash zig/harness/test-merge-atomicity.sh`: **6 passed, 2 failed** |
| 21 | + - Fails: Test 2, Test 7 |
| 22 | + |
| 23 | +## Files to Modify |
| 24 | +- `zig/harness/test-merge-atomicity.sh` |
| 25 | +- `zig/harness/test-parity.sh` (only if needed) |
| 26 | +- `.github/workflows/zig-tests.yaml` (if CI gating needs adjustment) |
| 27 | + |
| 28 | +## Acceptance Criteria |
| 29 | +1. [ ] Choose and document the intended contract: |
| 30 | + - (A) “Best-effort apply” within a statement when some rows are ignorable by policy, OR |
| 31 | + - (B) “Strict all-or-nothing” even for unknown columns |
| 32 | +2. [ ] Update `zig/harness/test-merge-atomicity.sh` so its error injection remains a hard error under the chosen policy. |
| 33 | + - Examples of “hard error” injectors: |
| 34 | + - invalid table name |
| 35 | + - invalid pk encoding / malformed pk blob |
| 36 | + - invalid site_id length (if strict validation is enforced) |
| 37 | +3. [ ] `bash zig/harness/test-merge-atomicity.sh` passes. |
| 38 | +4. [ ] CI required jobs stay green (or `test-merge-atomicity.sh` is removed from required set until fixed, explicitly documented). |
| 39 | + |
| 40 | +## Parent Docs / Cross-links |
| 41 | +- Policy wish: `.wishes/blocked-on-tom/zig-merge-atomicity-vs-lenient-schema-mismatch.md` |
| 42 | +- Lenient schema mismatch implementation: `.tasks/done/TASK-186-schema-mismatch-unknown-column-behavior.md` |
| 43 | +- CI test grouping: `.tasks/done/TASK-214-ci-oracle-strategy.md` |
| 44 | +- Release tracker: `.tasks/backlog/TASK-209-release-0.16.300-preview.md` |
| 45 | + |
| 46 | +## Progress Log |
| 47 | +- 2025-12-26: Confirmed test failures locally; filed as triage. |
| 48 | + |
| 49 | +## Completion Notes |
| 50 | +(Empty until done.) |
0 commit comments