Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .tasks/backlog/TASK-057-fix-github-actions-test-failures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# TASK-057: Fix GitHub Actions Test Failures

## Status
- [x] Planned
- [ ] Assigned
- [ ] In Progress
- [ ] Blocked (reason: ...)
- [ ] Complete

## Priority
high

## Assigned To
subagent (general)

## Parent Docs / Cross-links
- Gap backlog: `research/zig-cr/92-gap-backlog.md`
- GitHub Actions workflows: `.github/workflows/`
- Zig tests workflow: `.github/workflows/zig-tests.yaml`
- Test infrastructure: `zig/harness/`

## Description
GitHub Actions tests are consistently failing on the main branch. The `zig-tests` workflow has been failing since at least December 14, 2025 (run #20210398182 and subsequent runs through #20238288233).

This task investigates and fixes the root cause of these test failures to restore CI health.

## Files to Modify
- `.github/workflows/zig-tests.yaml` (if workflow configuration is the issue)
- `zig/` (if Zig implementation has issues)
- `zig/harness/` (if test harness setup is the issue)
- Any other files identified during investigation

## Acceptance Criteria
- [ ] Identify the root cause of the GitHub Actions test failures
- [ ] Document the root cause in the `Progress Log`
- [ ] Implement fixes to resolve the failures
- [ ] All GitHub Actions workflows pass on the main branch
- [ ] CI remains green after the fix
- [ ] Document the fix and verification steps in `Completion Notes`

## Progress Log
### 2025-12-17
- Task created to address ongoing CI failures
- GitHub Actions runs show `zig-tests` workflow failing consistently
- Latest failing run: #20238288233 (2025-12-15)

## Completion Notes
[fill in when done]
57 changes: 57 additions & 0 deletions .tasks/backlog/TASK-058-ensure-zig-functionality-complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# TASK-058: Ensure All Zig Functionality is Fully Implemented

## Status
- [x] Planned
- [ ] Assigned
- [ ] In Progress
- [ ] Blocked (reason: ...)
- [ ] Complete

## Priority
high

## Assigned To
subagent (general)

## Parent Docs / Cross-links
- Feature matrix: `research/zig-cr/90-feature-matrix.md`
- MVP roadmap: `research/zig-cr/91-mvp-roadmap.md`
- Gap backlog: `research/zig-cr/92-gap-backlog.md`
- Phased execution proposal: `research/zig-cr/93-phased-execution-proposal.md`
- Zig implementation: `zig/`
- Core C implementation (reference): `core/`

## Description
Systematically verify that all cr-sqlite functionality documented in the feature matrix and research docs is fully implemented in the Zig port. This includes:

1. All core replication surfaces (init, as_crr/as_table, write capture, crsql_changes vtab, merge semantics)
2. Serialization and wire formats (PK blob format, pack_columns)
3. All SQLite extension APIs (UDFs, writable virtual tables, hooks, triggers)
4. Clock versioning and ordering semantics
5. Fractindex support (currently stubbed: crsql_fract_as_ordered)
6. Any other functionality identified in the feature matrix

Cross-reference the Zig implementation against the C/Rust reference implementation to identify any missing or incomplete features.

## Files to Modify
- `zig/src/` (implement missing functionality)
- `research/zig-cr/90-feature-matrix.md` (update status)
- `research/zig-cr/92-gap-backlog.md` (update completion status)

## Acceptance Criteria
- [ ] Complete audit of all features in `research/zig-cr/90-feature-matrix.md` against Zig implementation
- [ ] Identify all missing or incomplete features
- [ ] Implement missing functionality or create separate task cards for complex features
- [ ] All core replication features are fully functional
- [ ] All C oracle tests pass (including fract suite if implemented)
- [ ] Documentation updated to reflect implementation status
- [ ] Completion notes include a comprehensive list of what was implemented or deferred

## Progress Log
### 2025-12-17
- Task created to ensure Zig parity with C/Rust implementation
- Known gap: crsql_fract_as_ordered is currently a stub (causes 1/20 C oracle tests to fail)
- Reference: Round 20 notes indicate 153/154 tests passing (99.4%)

## Completion Notes
[fill in when done]
65 changes: 65 additions & 0 deletions .tasks/backlog/TASK-059-design-tests-expose-unimplemented-zig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# TASK-059: Design and Add Tests to Expose Unimplemented Zig Functionality

## Status
- [x] Planned
- [ ] Assigned
- [ ] In Progress
- [ ] Blocked (reason: ...)
- [ ] Complete

## Priority
medium

## Assigned To
subagent (general)

## Parent Docs / Cross-links
- Test oracle design: `research/zig-cr/10-test-oracle.md`
- Feature matrix: `research/zig-cr/90-feature-matrix.md`
- Gap backlog: `research/zig-cr/92-gap-backlog.md`
- Existing test harnesses: `zig/harness/`
- C oracle tests: `core/c/`

## Description
Design and implement additional tests to systematically expose any gaps in the Zig implementation that aren't caught by existing test suites.

Focus areas:
1. **Edge cases and error conditions**: Test boundary conditions, error handling, and failure modes
2. **Multi-table scenarios**: Complex interactions between multiple CRR tables
3. **Merge conflict resolution**: All tie-breaker paths (cl/col_version/value/site_id)
4. **Clock semantics**: dbVersion/pendingDbVersion/seq invariants across transactions
5. **Serialization formats**: PK blob packing/unpacking edge cases
6. **Virtual table operations**: xUpdate paths, transaction boundaries, best-index scenarios
7. **Hook chaining**: Commit/rollback hook interactions with other extensions
8. **Schema evolution**: as_crr/as_table with different table configurations
9. **Performance characteristics**: Large UNION query scaling, statement cache effectiveness

Each test should:
- Be deterministic and reproducible
- Have clear pass/fail criteria
- Document what functionality it's validating
- Run quickly (avoid long-running stress tests in CI)

## Files to Modify
- `zig/harness/` (new test scripts or extensions to existing ones)
- `zig/src/` (add unit tests in relevant modules)
- `research/zig-cr/92-gap-backlog.md` (document test coverage improvements)

## Acceptance Criteria
- [ ] Identify at least 5-10 additional test scenarios not covered by existing tests
- [ ] Document the test design in the `Progress Log` with rationale
- [ ] Implement the new tests
- [ ] Tests successfully expose at least one previously undetected gap (if any exist)
- [ ] All new tests pass (or are marked as expected failures with task cards created for fixes)
- [ ] Test documentation explains what each test validates and why it's important
- [ ] Tests are integrated into existing test harness (make test-* targets)

## Progress Log
### 2025-12-17
- Task created to improve test coverage and expose implementation gaps
- Current test status: 154/154 MVP tests passing per gap backlog
- C oracle harness: 19/20 tests pass (fract_as_ordered stub causes 1 failure)
- Need to design tests that go beyond existing coverage

## Completion Notes
[fill in when done]
20 changes: 15 additions & 5 deletions research/zig-cr/92-gap-backlog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 92-gap-backlog

> Last updated: 2025-12-15 (Round 34 — Zig parity fixed, browser tests green)
> Last updated: 2025-12-17 (Added CI health + Zig completeness tasks)

## Status

Expand All @@ -12,9 +12,11 @@

Pick disjoint tasks from `.tasks/backlog/`:

- **Tests now green**
- Zig parity: 52/52 passing (TASK-051 done)
- Browser tests: 18/18 passing (TASK-052 done — was port conflict, not code bug)
- **CI and Zig implementation health**
- Fix GitHub Actions test failures: `.tasks/backlog/TASK-057-fix-github-actions-test-failures.md`
- Ensure all Zig functionality fully implemented: `.tasks/backlog/TASK-058-ensure-zig-functionality-complete.md`
- Design tests to expose unimplemented Zig functionality: `.tasks/backlog/TASK-059-design-tests-expose-unimplemented-zig.md`
- *(Note: Local tests passing - 154/154 MVP, 52/52 parity, but CI is red)*

- **Unblock browser specs (to unblock TS work)**
- Tom decision: browser spec naming + package boundary: `.tasks/backlog/TASK-056-tom-browser-spec-naming.md`
Expand Down Expand Up @@ -55,7 +57,15 @@ Pick disjoint tasks from `.tasks/backlog/`:

## Gaps (only what’s still open)

### Test infrastructure (resolved)
### CI and Zig implementation gaps

Source: GitHub Actions workflow failures + feature matrix audit

- [ ] Fix GitHub Actions test failures → `.tasks/backlog/TASK-057-fix-github-actions-test-failures.md` (2025-12-17)
- [ ] Ensure all Zig functionality fully implemented → `.tasks/backlog/TASK-058-ensure-zig-functionality-complete.md` (2025-12-17)
- [ ] Design tests to expose unimplemented Zig functionality → `.tasks/backlog/TASK-059-design-tests-expose-unimplemented-zig.md` (2025-12-17)

### Test infrastructure (previously resolved)

Source: `.tasks/DELEGATE_WORK_HANDOFF.md` (Round 34)

Expand Down