Files
ruflo/docs
2a087924b9 dream(swarm) (evaluated): fix RaftConsensus.appendEntries() zero Log Matching Property check (#5249)
* dream(swarm): #5248 RaftConsensus.appendEntries() legacy path had zero Log Matching Property check

The production-reachable (no-transport) legacy in-process path blindly
pushed new entries onto a peer's log with no Raft §5.3 consistency check:
no prevLogIndex/prevLogTerm check, no conflict detection/truncation, no
idempotency guard. A peer with a stale entry from a prior term got new
entries appended on top of it, corrupting the log with duplicate or
conflicting indices instead of rejecting or resolving the divergence.

Disclosed 2026-11-10 (ledger), confirmed unchanged 2026-11-25. Fixed by
adding the Figure 2 AppendEntries receiver rule. 6 new tests (3
discriminating, 3 controls); full @claude-flow/swarm suite 395/395 (389
pre-existing + 6 new), 0 regressions; tsc --noEmit clean. Independently
reproduced and critiqued by a fresh-context adversarial critic
(CONFIRMED-WITH-CAVEATS, non-blocking).

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH2ssyLxmHjMLvYgJHN

* dream(swarm): #5248 add SOTA research gist for 2026-12-04

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH2ssyLxmHjMLvYgJHN

* dream(swarm): #5248 update ledger for 2026-12-04

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH2ssyLxmHjMLvYgJHN

* dream(swarm): #5248 note CI KNOWN_FAILING quarantine expiry (unrelated to tonight's candidate)

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH2ssyLxmHjMLvYgJHN

* fix(swarm): resend missing entries to a peer that refuses an append (#5248)

The Log Matching check added in this PR made a peer refuse any entry
whose prevLogIndex it doesn't hold, but nothing ever resent the missing
entries. UnifiedSwarmCoordinator adds a consensus peer for every agent it
registers, so an agent registered after the first proposal started with an
empty log, refused every later entry and never caught up; with two such
peers a 3-node cluster stopped committing (commitIndex stuck at 1).

replicateToFollowers now goes through replicateToPeer: on a refusal over
the legacy in-process path it finds the last index both logs agree on and
resends everything after it in one append (Raft's nextIndex back-off in a
single step). The transport path is unchanged.

Two new tests: late-joining peers end at [1,2,3] with commitIndex 3, and a
peer holding a stale term-1 entry is repaired on the next proposal. Both
fail without the resend. Swarm suite 397/397, tsc clean.

Bumps @claude-flow/swarm to 3.0.7 for a standalone publish (also carries
#4989 and #5113, unpublished since 3.0.6).

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: r <r@x>
2026-12-04 11:42:05 -05:00
..