Skip to content

Commit 7034cec

Browse files
tasks updated
1 parent cf7d8ba commit 7034cec

File tree

7 files changed

+197
-31
lines changed

7 files changed

+197
-31
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# TASK-048: Global Mesh — Protocol schema reuse alignment
2+
3+
## Status
4+
- [x] Planned
5+
- [ ] Assigned
6+
- [ ] In Progress
7+
- [ ] Blocked (reason: ...)
8+
- [ ] Complete
9+
10+
## Priority
11+
high
12+
13+
## Assigned To
14+
subagent (general)
15+
16+
## Parent Docs / Cross-links
17+
- Spec rules: `effect-native/.specs/AGENTS.md`
18+
- Protocol Phase 1: `effect-native/.specs/crsql-mesh-protocol/instructions.md`
19+
- Protocol Phase 2: `effect-native/.specs/crsql-mesh-protocol/requirements.md`
20+
- Protocol Phase 3: `effect-native/.specs/crsql-mesh-protocol/design.md`
21+
- Protocol Phase 4: `effect-native/.specs/crsql-mesh-protocol/plan.md`
22+
- Gap backlog: `research/zig-cr/92-gap-backlog.md`
23+
24+
## Description
25+
Align `@effect-native/crsql-mesh-protocol` implementation with Phase 2 requirement **FR-PROTO-001** (schema reuse): reuse schema definitions from `@effect-native/crsql/CrSqlSchema` instead of re-declaring near-identical schemas.
26+
27+
This is about tightening the single-source-of-truth boundary at the DB/IO boundary.
28+
29+
## Files to Modify
30+
- `effect-native/packages-native/crsql-mesh-protocol/src/Messages.ts`
31+
- `effect-native/packages-native/crsql-mesh-protocol/src/index.ts` (if exports change)
32+
- `effect-native/packages-native/crsql-mesh-protocol/test/*`
33+
34+
## Acceptance Criteria
35+
- [ ] `SiteIdHex`, `VersionString`, `ChangeRowSerialized`, and any other shared schema types are imported/re-exported from `@effect-native/crsql/CrSqlSchema`.
36+
- [ ] No duplicate “copy” schemas remain in `crsql-mesh-protocol` for types that already exist in `@effect-native/crsql`.
37+
- [ ] Existing protocol encode/decode tests still pass.
38+
- [ ] Add/adjust tests (if needed) to prove the protocol uses the crsql schemas (not structurally-identical copies).
39+
40+
## Progress Log
41+
### 2025-12-15
42+
- Task created during “Update tasks” reconciliation.
43+
44+
## Completion Notes
45+
[fill in when done]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# TASK-049: Global Mesh — Mesh engine Phase 4 completion
2+
3+
## Status
4+
- [x] Planned
5+
- [ ] Assigned
6+
- [ ] In Progress
7+
- [ ] Blocked (reason: ...)
8+
- [ ] Complete
9+
10+
## Priority
11+
high
12+
13+
## Assigned To
14+
subagent (general)
15+
16+
## Parent Docs / Cross-links
17+
- Spec rules: `effect-native/.specs/AGENTS.md`
18+
- Mesh Phase 1: `effect-native/.specs/crsql-mesh/instructions.md`
19+
- Mesh Phase 2: `effect-native/.specs/crsql-mesh/requirements.md`
20+
- Mesh Phase 3: `effect-native/.specs/crsql-mesh/design.md`
21+
- Mesh Phase 4: `effect-native/.specs/crsql-mesh/plan.md`
22+
- Protocol requirements: `effect-native/.specs/crsql-mesh-protocol/requirements.md`
23+
- Transport requirements: `effect-native/.specs/crsql-mesh-transport/requirements.md`
24+
- Gap backlog: `research/zig-cr/92-gap-backlog.md`
25+
26+
## Description
27+
Complete the Phase 4 plan for `@effect-native/crsql-mesh` so it satisfies the Phase 2 requirements:
28+
29+
- receive routing + protocol decode
30+
- per-peer periodic summary exchange
31+
- diff request/response loop
32+
- transactional apply via `crsql_changes`
33+
- in-memory version vector updates only after successful apply
34+
- progress observation surface
35+
36+
Keep the scope within the `crsql-mesh` package (no new transport implementations beyond in-memory).
37+
38+
## Files to Modify
39+
- `effect-native/packages-native/crsql-mesh/src/**`
40+
- `effect-native/packages-native/crsql-mesh/test/**`
41+
42+
## Acceptance Criteria
43+
- [ ] `Mesh.run` runs fibers owned by scope (not `Effect.never`).
44+
- [ ] Invalid incoming messages are dropped with typed `ProtocolError` handling.
45+
- [ ] Two peers converge using `InMemoryTransport` and a real CR-SQLite DB integration test (or a clearly-scoped interim harness if real DB is not yet available in CI).
46+
- [ ] Version vector updates only after successful transactional apply.
47+
- [ ] `observeProgress` emits after apply-driven db_version advances.
48+
- [ ] `pnpm -C effect-native vitest packages-native/crsql-mesh` passes.
49+
50+
## Progress Log
51+
### 2025-12-15
52+
- Task created during “Update tasks” reconciliation.
53+
54+
## Completion Notes
55+
[fill in when done]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# TASK-050: Global Mesh — Node runtime Phase 4 completion
2+
3+
## Status
4+
- [x] Planned
5+
- [ ] Assigned
6+
- [ ] In Progress
7+
- [ ] Blocked (reason: ...)
8+
- [ ] Complete
9+
10+
## Priority
11+
high
12+
13+
## Assigned To
14+
subagent (general)
15+
16+
## Parent Docs / Cross-links
17+
- Spec rules: `effect-native/.specs/AGENTS.md`
18+
- Runtime Phase 1: `effect-native/.specs/crsql-mesh-runtime/instructions.md`
19+
- Runtime Phase 2: `effect-native/.specs/crsql-mesh-runtime/requirements.md`
20+
- Runtime Phase 3 (node): `effect-native/.specs/crsql-mesh-runtime/design.md`
21+
- Runtime Phase 4: `effect-native/.specs/crsql-mesh-runtime/plan.md`
22+
- Protocol requirements: `effect-native/.specs/crsql-mesh-protocol/requirements.md`
23+
- Gap backlog: `research/zig-cr/92-gap-backlog.md`
24+
25+
## Description
26+
Complete the Phase 4 plan for `@effect-native/crsql-mesh-runtime-node`:
27+
28+
- validate and prepare `databasePath`
29+
- open SQLite database at `databasePath`
30+
- load the CR-SQLite extension
31+
- ensure protocol layer init runs (fail-fast on `UnhexUnavailable`)
32+
- wire process lifecycle hooks (SIGINT/SIGTERM) for graceful shutdown within `shutdownTimeout`
33+
34+
## Files to Modify
35+
- `effect-native/packages-native/crsql-mesh-runtime-node/src/**`
36+
- `effect-native/packages-native/crsql-mesh-runtime-node/test/**`
37+
38+
## Acceptance Criteria
39+
- [ ] `NodeRuntimeLive` actually opens the database and loads CR-SQLite.
40+
- [ ] Protocol layer initialization happens during layer acquisition.
41+
- [ ] `UnhexUnavailable` fails runtime without fallback.
42+
- [ ] SIGINT/SIGTERM triggers bounded shutdown.
43+
- [ ] `pnpm -C effect-native vitest packages-native/crsql-mesh-runtime-node` passes.
44+
45+
## Progress Log
46+
### 2025-12-15
47+
- Task created during “Update tasks” reconciliation.
48+
49+
## Completion Notes
50+
[fill in when done]

.wishes/done/effect-native.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,22 @@ we follow the spec-first workflow defined in effect-native/.specs/AGENTS.md
1313
let's start planning a set of new packages for all this stuff
1414
especially research/zig-cr/102-proposal-crsqlite-global-mesh.md
1515

16-
Tracking:
17-
- Submodules + TS-work rule: [`.tasks/backlog/TASK-038-add-effect-native-submodules.md`](../.tasks/backlog/TASK-038-add-effect-native-submodules.md)
18-
- Global mesh package-map spec (Phase 1): [`.tasks/backlog/TASK-039-spec-global-mesh-package-map.md`](../.tasks/backlog/TASK-039-spec-global-mesh-package-map.md)
19-
- Protocol spec: [`.tasks/backlog/TASK-040-spec-crsql-mesh-protocol.md`](../.tasks/backlog/TASK-040-spec-crsql-mesh-protocol.md)
20-
- Core engine spec: [`.tasks/backlog/TASK-041-spec-crsql-mesh-core.md`](../.tasks/backlog/TASK-041-spec-crsql-mesh-core.md)
21-
- Transport interface spec: [`.tasks/backlog/TASK-042-spec-crsql-mesh-transport.md`](../.tasks/backlog/TASK-042-spec-crsql-mesh-transport.md)
22-
- `@effect-native/crsql` integration spec: [`.tasks/backlog/TASK-043-spec-crsql-mesh-integration.md`](../.tasks/backlog/TASK-043-spec-crsql-mesh-integration.md)
23-
- `@effect-native/libcrsql` changes spec: [`.tasks/backlog/TASK-044-spec-libcrsql-next.md`](../.tasks/backlog/TASK-044-spec-libcrsql-next.md)
24-
- Runtime adapters spec: [`.tasks/backlog/TASK-045-spec-crsql-mesh-runtime.md`](../.tasks/backlog/TASK-045-spec-crsql-mesh-runtime.md)
16+
---
17+
18+
## Completed: 2025-12-15
19+
20+
- Reference submodules added: `.refs/effect/`, `.refs/effect-smol/`
21+
- Work submodule added: `effect-native/`
22+
- Repo rule added: all TS work lives in `effect-native/` and follows `effect-native/.specs/AGENTS.md`
23+
- Global mesh planning/specs created under `effect-native/.specs/`
24+
25+
Tracking (historical):
26+
- Submodules + TS-work rule: [`.tasks/done/TASK-038-add-effect-native-submodules.md`](../../.tasks/done/TASK-038-add-effect-native-submodules.md)
27+
- Global mesh package-map spec (Phase 1): [`.tasks/done/TASK-039-spec-global-mesh-package-map.md`](../../.tasks/done/TASK-039-spec-global-mesh-package-map.md)
28+
- Protocol spec: [`.tasks/done/TASK-040-spec-crsql-mesh-protocol.md`](../../.tasks/done/TASK-040-spec-crsql-mesh-protocol.md)
29+
- Core engine spec: [`.tasks/done/TASK-041-spec-crsql-mesh-core.md`](../../.tasks/done/TASK-041-spec-crsql-mesh-core.md)
30+
- Transport interface spec: [`.tasks/done/TASK-042-spec-crsql-mesh-transport.md`](../../.tasks/done/TASK-042-spec-crsql-mesh-transport.md)
31+
- `@effect-native/crsql` integration spec: [`.tasks/done/TASK-043-spec-crsql-mesh-integration.md`](../../.tasks/done/TASK-043-spec-crsql-mesh-integration.md)
32+
- `@effect-native/libcrsql` changes spec: [`.tasks/done/TASK-044-spec-libcrsql-next.md`](../../.tasks/done/TASK-044-spec-libcrsql-next.md)
33+
- Runtime adapters spec: [`.tasks/done/TASK-045-spec-crsql-mesh-runtime.md`](../../.tasks/done/TASK-045-spec-crsql-mesh-runtime.md)
34+
- Phase 2 requirements (node-first slice): [`.tasks/done/TASK-046-phase2-requirements-crsql-mesh.md`](../../.tasks/done/TASK-046-phase2-requirements-crsql-mesh.md)

.wishes/done/release-planning.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ e.g. nix, npm, ???
2121
- Docs: In-repo, near code (README.md updates, browser-dist/README.md)
2222

2323
**Next engineering tasks identified:**
24-
- TASK-037: Publish browser package to npm beta
25-
- TASK-038: Set up Zig Linux CI builds
26-
- TASK-039: Create platform-specific npm packages
24+
- zig-sqlite upstream feedback capture: `.tasks/backlog/TASK-037-zig-sqlite-upstream-feedback-blocked.md`
25+
- Release engineering gaps: (create new `.tasks/backlog/` cards as needed; see `research/zig-cr/92-gap-backlog.md` Release section)

.wishes/start-here.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ If you’re asking “what’s left?” start here:
1111

1212
## Next parallel work (curated)
1313

14-
- Mesh Phase 2 (approved by Tom):
15-
- `.tasks/backlog/TASK-046-phase2-requirements-crsql-mesh.md`
16-
- `.tasks/backlog/TASK-047-phase1-react-native-runtime-specs.md`
14+
- Global mesh (TS, Phase 4 implementation gaps):
15+
- `.tasks/backlog/TASK-048-crsql-mesh-protocol-schema-reuse.md`
16+
- `.tasks/backlog/TASK-049-crsql-mesh-engine-phase4.md`
17+
- `.tasks/backlog/TASK-050-crsql-mesh-runtime-node-phase4.md`
1718
- Web phase 2 (TS, spec-gated):
1819
- `.tasks/backlog/TASK-031-web-service-worker-fallback.md`
1920
- `.tasks/backlog/TASK-032-web-reactive-subscriptions.md`
20-
- Mobile embedding guide (docs): `.tasks/backlog/TASK-033-mobile-static-embedding-guide.md`
2121
- Upstream feedback capture (blocked): `.tasks/backlog/TASK-037-zig-sqlite-upstream-feedback-blocked.md`
2222

2323
## Rules of the game (thing-golf)

research/zig-cr/92-gap-backlog.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 92-gap-backlog
22

3-
> Last updated: 2025-12-14 (Round 30)
3+
> Last updated: 2025-12-15 (Round 31)
44
55
## Status
66

@@ -15,19 +15,20 @@ Pick disjoint tasks from `.tasks/backlog/`:
1515
- Web phase 2 (TS, blocked until Phase 2 specs exist for browser runtime)
1616
- Service Worker fallback: `.tasks/backlog/TASK-031-web-service-worker-fallback.md`
1717
- Reactive subscriptions: `.tasks/backlog/TASK-032-web-reactive-subscriptions.md`
18-
- Global mesh implementation (TS, ✅ Phase 4 complete, ready for Phase 5 integration)
19-
- All 4 packages implemented: protocol, transport, mesh, runtime-node
20-
- 69 tests passing across packages
18+
- Global mesh implementation (TS, Phase 4 plans exist; implementation gaps remain)
19+
- Protocol schema reuse alignment: `.tasks/backlog/TASK-048-crsql-mesh-protocol-schema-reuse.md`
20+
- Mesh engine Phase 4 completion: `.tasks/backlog/TASK-049-crsql-mesh-engine-phase4.md`
21+
- Node runtime Phase 4 completion: `.tasks/backlog/TASK-050-crsql-mesh-runtime-node-phase4.md`
2122
- Upstream goodwill (blocked on Tom)
2223
- zig-sqlite feedback cards: `.tasks/backlog/TASK-037-zig-sqlite-upstream-feedback-blocked.md`
2324

2425
## Done (recent)
2526

26-
- **Mesh Phase 4 implementation (all packages)**: 4 packages implemented with 69 tests (2025-12-14)
27-
- `@effect-native/crsql-mesh-protocol`message schemas, decode helpers, unhex() check
28-
- `@effect-native/crsql-mesh-transport`Transport tag, InMemoryTransport for tests
29-
- `@effect-native/crsql-mesh`Mesh service, receive routing, version vectors, apply pipeline
30-
- `@effect-native/crsql-mesh-runtime-node`Node runtime layer, config validation, lifecycle
27+
- **Mesh packages (Phase 4 scaffolding + partial implementation)** (2025-12-14)
28+
- `@effect-native/crsql-mesh-transport`Transport tag + deterministic InMemoryTransport (good)
29+
- `@effect-native/crsql-mesh-protocol`unhex() check wired, but schema reuse vs `@effect-native/crsql/CrSqlSchema` needs alignment
30+
- `@effect-native/crsql-mesh`internal modules exist + unit-style tests, but `Mesh.run` orchestration is not implemented yet
31+
- `@effect-native/crsql-mesh-runtime-node`config validation exists; DB open/extension load/lifecycle hooks not implemented yet
3132
- **Mesh Phase 2 requirements (node-first)**: `.tasks/done/TASK-046-phase2-requirements-crsql-mesh.md` (2025-12-14)
3233
- **Mesh Phase 3 designs + Phase 4 RGRTDD plans**: `effect-native/.specs/crsql-mesh/plan.md` (2025-12-15)
3334
- **Mesh protocol Phase 4 RGRTDD plan**: `effect-native/.specs/crsql-mesh-protocol/plan.md` (2025-12-15)
@@ -52,15 +53,21 @@ Source: `research/zig-cr/96-proposal-multitab-wasm-sqlite-crsqlite.md`
5253

5354
Note: TS work is spec-gated under `effect-native/.specs/AGENTS.md`.
5455

55-
### Global mesh (Phase 4 ✅ complete, Phase 5 next)
56+
### Global mesh (Phase 4 plans exist; implementation work is pending)
5657

5758
Source: `research/zig-cr/102-proposal-crsqlite-global-mesh.md` and `effect-native/.specs/crsqlite-global-mesh-packages/instructions.md`
5859

59-
- [x] `@effect-native/crsql-mesh` Phase 4 plan → implemented (2025-12-14)
60-
- [x] `@effect-native/crsql-mesh-protocol` Phase 4 plan → implemented (2025-12-14)
61-
- [x] `@effect-native/crsql-mesh-transport` Phase 4 plan → implemented (2025-12-14)
62-
- [x] `@effect-native/crsql-mesh-runtime-node` Phase 4 plan → implemented (2025-12-14)
63-
- [ ] Phase 5: Real SQLite integration tests + production transport implementations
60+
Spec artifacts:
61+
- [x] Phase 1 instructions: `.tasks/done/TASK-039-spec-global-mesh-package-map.md`
62+
- [x] Phase 2 requirements: `.tasks/done/TASK-046-phase2-requirements-crsql-mesh.md`
63+
- [x] Phase 3 designs: `effect-native/.specs/crsql-mesh*/design.md`
64+
- [x] Phase 4 plans: `effect-native/.specs/crsql-mesh*/plan.md`
65+
66+
Implementation gaps tracked as tasks:
67+
- [ ] Protocol: ensure schema reuse from `@effect-native/crsql/CrSqlSchema` (FR-PROTO-001) → `.tasks/backlog/TASK-048-crsql-mesh-protocol-schema-reuse.md`
68+
- [ ] Mesh engine: implement anti-entropy loop + transactional apply per Phase 4 plan → `.tasks/backlog/TASK-049-crsql-mesh-engine-phase4.md`
69+
- [ ] Node runtime: implement DB open + CR-SQLite extension load + lifecycle hooks → `.tasks/backlog/TASK-050-crsql-mesh-runtime-node-phase4.md`
70+
- [ ] Phase 5: real SQLite integration + production transports (separate task once Phase 4 complete)
6471

6572
### Mobile static embedding docs
6673

0 commit comments

Comments
 (0)