Repository navigation
Conversation
ruvnet
added a commit
that referenced
this pull request
Sep 20, 2026
Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01VWUxwsNQVofSGXi8us9dEc
This was referenced Sep 21, 2026
…g until timeout The event-driven rewrite of waitForQueuedTask()/waitForTaskCompletion() only wakes on task.completed/task.failed. shutdown() clears state.tasks without emitting a per-task event, so waits in flight at shutdown hung (holding a timer and the event loop) until taskTimeoutMs, where the old 100ms poll noticed 'not found' almost immediately. Re-check on 'swarm.stopped' and detach all three listeners on every settle path. Adds a fake-timer regression test (fails without the fix). Co-Authored-By: claude-flow <ruv@ruv.net>
Owner
Author
ruvnet
added a commit
that referenced
this pull request
Sep 26, 2026
Ships the swarm fixes merged since alpha.8 (#3357 hierarchical leader edges, #3378 event-driven UnifiedSwarmCoordinator wait, #3123, #3086, #3243, #3062). The CLI does not depend on @claude-flow/swarm, so they reach users only through this standalone publish. Publishability fixes found while preparing the tarball: - coordination/{agent-registry,task-orchestrator,swarm-hub}.ts used extensionless relative imports, so a plain `tsc` build of main throws ERR_MODULE_NOT_FOUND on `import('@claude-flow/swarm')`. Add the `.js` suffixes (the package is "type": "module"). - Restore the ADR-095 G2.2 transport re-exports on the root entry. alpha.8 was published from main@f8ab5a325 plus uncommitted work (later dacbe0e, never merged) that exported LocalTransport, FederationTransport, signMessage, etc. from the root. Without this, alpha.9 would silently drop 9 runtime exports alpha.8 users have. - Add a `files` allowlist (dist, README.md, MIGRATION.md). alpha.8 shipped src/, __tests__/, tmp.json, tsconfig.tsbuildinfo, a 1.5 MB ruvector.db and .claude-flow/ runtime state from a contributor's machine. - Record the repo version as alpha.9 (repo was stuck at alpha.7 while npm had alpha.8).
Owner
Author
|
Shipped to npm in 🤖 Generated with claude-flow |
ruvnet
added a commit
that referenced
this pull request
Sep 27, 2026
…-run-gap notes Records the 2026-09-26 batch merge clearing #3330/#3350/#3352/#3357/#3385/#3395 (GitHub-verified via pull_request_read), #3378's landing via batch PR #3443 + npm publish #3452, and a new confirmed no-run gap on 2026-09-23/25/26. Appends tonight's row (#3475/#3476, ACCEPT-scoped). Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_017NSCBLZggg81jUaa8RvZV7
This was referenced Sep 29, 2026
This was referenced Oct 6, 2026
ruvnet
added a commit
that referenced
this pull request
Oct 9, 2026
…-run-gap notes Records the 2026-09-26 batch merge clearing #3330/#3350/#3352/#3357/#3385/#3395 (GitHub-verified via pull_request_read), #3378's landing via batch PR #3443 + npm publish #3452, and a new confirmed no-run gap on 2026-09-23/25/26. Appends tonight's row (#3475/#3476, ACCEPT-scoped). Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_017NSCBLZggg81jUaa8RvZV7
This was referenced Oct 15, 2026
ruvnet
added a commit
that referenced
this pull request
Oct 17, 2026
…event-driven (evaluated, ACCEPT) (#4215) * dream(performance): #4214 RaftConsensus.awaitConsensus() busy-poll -> event-driven RaftConsensus.awaitConsensus() polled this.proposals via setInterval(...,10) even though checkConsensus() already emits 'consensus.achieved' on every accept/reject transition. Raft is Ruflo's default hive-mind consensus algorithm, reachable from production via UnifiedSwarmCoordinator.proposeConsensus(). Third instance of a busy-poll bug class already fixed twice (UnifiedSwarmCoordinator #3378, MessageBus #3563). 4 new discriminating tests, stash-isolated baseline-fails/candidate-passes (3/4, 1 correct non-discriminating control), independently reproduced by an adversarial critic. Full @claude-flow/swarm suite 281/281 (277 existing + 4 new), tsc clean both ways. Standalone wall-clock probe: 3.639ms/30 poll-timers -> 0.058ms/0 timers (N=30). Also closes a 3-night research thread (10-09/10-10/10-14) on graph-analyzer.ts's dead native-acceleration detection: direct inspection shows ruvector's real minCut/louvainCommunities exports are plain JS, not native-accelerated, so wiring them in would not be a performance win (REJECT, with evidence). Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01MFLiva2zVEXr2n9UTK5YgU * dream(performance): #4214 record PR #4215 in LEDGER.md Fill in the real PR number (was a placeholder pending PR creation) in tonight's ledger row, and note the 10-12/10-13/10-14 ledger-transcription gap per the established convention. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01MFLiva2zVEXr2n9UTK5YgU --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Hypothesis
Frozen before evaluation; not modified after seeing results.
2. Candidate
v3/@claude-flow/swarm/src/unified-coordinator.ts(~130 net lines across 2 methods + a constructor line): both wait functions now do a synchronous pre-check ofthis.state.tasks.get(taskId), then registeron('task.completed'|'task.failed', onTaskEvent)filtered bytaskId, resolving via a fresh re-read of the task's actual status (not the event name). AsetTimeoutfallback preserves the existing timeout semantics exactly. Constructor gainedthis.setMaxListeners(Math.max(EventEmitter.defaultMaxListeners, this.config.maxTasks * 2))— see caveat below.This is the exact candidate 2026-09-15's performance night (#3330) surfaced and scored 4.45/5 but deferred in favor of the MoE load-balance fix. Tonight's own independent 5-role research fan-out re-scored it 4.75/5 against 4 freshly-generated alternatives and selected it (full detail in the gist).
3. Evaluation Receipt
evaluated: accepted. Real evaluator: Vitest 4.1.8, deterministic, $0, zero LLM calls. New file
v3/@claude-flow/swarm/__tests__/unified-coordinator-event-driven-wait.test.ts(4 tests).Baseline vs. candidate, isolated via
git stashof just the source file (test file kept): 3 of 4 tests fail against real baseline (fake-timer assertion: the wait promise has not resolved after draining microtasks with zero timer advance — asetInterval(...,100)cannot have ticked yet) and pass against candidate; the 4th (timeout-fallback correctness) passes both ways, confirming it's a regression-safety check, not a discriminator.Real (non-fake-timer) wall-clock microbenchmark (N=20 task-completion cycles resolved on the next
setImmediatetick): baseline mean 100.359ms (p50 100.185ms — matches the 100ms poll interval exactly) vs. candidate mean 0.206ms (p50 0.063ms) — ~487x. Benchmark script was transient (not committed); fully reproducible from the description (register agent, submit task, resolve viahandleTaskCompleteon the nextsetImmediate, measure elapsed time).Full
@claude-flow/swarmpackage suite: 234/234 passing (230 pre-existing + 4 new), 0 regressions.tsc --noEmit: 0 errors.4. Baseline Comparison
waitForTaskCompletionresolutioncancelTask()→waitForTaskCompletionresultstatus: 'cancelled'(poll re-reads status)status: 'cancelled'(unchanged — event-driven path re-reads status too)handleTaskFail()retry branch (requeue, no event)tsc --noEmit5. Darwin Lineage
Skipped — confirmed via
npx ruvector@0.3.1 harness darwin --help: the real interface evolves routing/topology/prompt/memory/tool/tier/context/coordination genome parameters against a fitness-scored corpus (requires a JSON config +--execute). Tonight's fix is a deterministic code-correctness fix, not a parameter search. Same skip class as #3110/#3160/#3184/#3221/#3243/#3266/#3302/#3330.6. Flywheel Evidence
No
.claude-flow/flywheel/state exists in this repo (direct directory check) and no signed@metaharness/flywheelbundle applies (confirmed vianpx ruvector@0.3.1 harness flywheel --help: realverify/gateinterface exists but targets a replay bundle this fix doesn't produce). Evidence retained as the 4 discriminating tests, the gist, issue #3377, the stash-isolated comparison, the wall-clock benchmark, and the full adversarial critique transcript — consistent with every accepted dream-cycle night since 2026-08-18.7. Reward Hack Check
No standalone reward-hack CLI reachable (
npx ruvector@0.3.1 harness --help: status/route/flywheel/darwin only). Manual checklist, independently re-verified by the adversarial critic: no existing test weakened (new file only, 230 pre-existing untouched and re-verified green); no gold/expected data touched; no cherry-picking (full suite reported both ways); no seed manipulation (deterministic fake-timer + real-timer tests, no randomness); zero cost.8. Security Review
Not security-sensitive: pure in-process
EventEmitterlistener wiring on an internally-generatedtaskId(produced by the coordinator's ownsubmitTask(), never raw caller input reaching this code path); no I/O/network/credential/filesystem surface. Checked for listener leaks (every exit path — immediate resolve, event resolve, timeout resolve/reject — removes both listeners and clears the timeout) and for the retry-branch race (handleTaskFail()'s requeue path emits no event and correctly isn't matched as terminal).Independent adversarial critique (separate subagent, no authoring context): initial verdict CONFIRMED-WITH-CAVEATS. Independently re-read the diff (not the description), confirmed the synchronous pre-check makes the "terminal-before-listener-attach" race structurally impossible (no
awaitbetween check andthis.on(...)), confirmed thecancelTask/status-vs-event-name subtlety is handled correctly, confirmed the retry branch correctly leaves the wait pending, traced every exit path for cleanup (none leak), independently re-ran the full suite (234/234) and the stash-isolated comparison (3/4 fail on baseline as predicted), and confirmedtsc --noEmitclean. One real, reproduced caveat: neither function calledsetMaxListeners, and Node's default per-event-name cap is 10 — at realistic concurrency (>10 simultaneousexecuteTaskInDomain()calls, well within defaultconfig.maxTasks) this would emit spuriousMaxListenersExceededWarning(not a correctness bug — every listener still fires — but a real regression in observable behavior vs. the old poll design). Fixed same session:this.setMaxListeners(Math.max(EventEmitter.defaultMaxListeners, this.config.maxTasks * 2))added to the constructor; independently verified via a throwaway test asserting zero warnings with 30 concurrent listeners registered. Re-verified 234/234 green and clean typecheck after the fix.9. Regression Analysis
234/234 in the
@claude-flow/swarmpackage suite (230 pre-existing + 4 new), 0 regressions.tsc --noEmitclean. No existing test exercisedwaitForTaskCompletion/waitForQueuedTaskbefore tonight (confirmed via grep —__tests__/coordinator.test.tsonly exercisessubmitTask/cancelTask/getTasksByStatus, not the wait internals), so there was no legacy timing-pinned assertion to break.10. ADR
None — this is a scoped, additive rewrite of an internal wait mechanism (busy-poll → event-driven), not a new architectural decision. Matches repo convention for this class of fix (cf. #3094, #3169, #3266, #3330 — none created an ADR).
11. Research Gist
docs/dream-cycle/dream-gist-2026-09-20.md(this branch) — full SOTA report: 5-role parallel research fan-out (deep researcher, security scan, hive-mind scan, competitor analyst, architecture reviewer), competitor comparison (LangGraph, Microsoft Agent Framework, CrewAI, OpenAI Agents SDK — all four converged on async/event completion signaling, zero on timer polling), 4 additional scored candidates not selected tonight (MMR redundant-recompute fix,DualModeOrchestratorsame-pattern fix,HybridMemoryRepositorybrute-force search, MMR algorithmic rewrite), and scan findings for security (terminal_executePATH-hijack, CWE-427, grade A) and hive-mind (weighted-BFT threshold can be mathematically unwinnable).12. Issue
Closes #3377 (full 15-section report: ledger check with GitHub-verified state for the last 5+ nights, prior-gist scoring, research, evaluation receipt, adversarial critique, reward-hack check, security review, security/hive-mind scan findings, competitor comparison, witness).
13. Witness
e558f0c0fc29c1a658085f6e6f80ad27d4fe811feff14b59c1bf32bb8fc4296ee349c97051b877175c68d336a6f76c00a7ca506512f7a08e367d9c2d8d63b8a86be6becbb5f59330cbb67bcbd173c41c1bd927b6Verifier procedure: fetch
docs/dream-cycle/dream-gist-2026-09-20.mdfrom this branch, strip the witness table's three filled values back toPENDING, SHA-256 it, concatenate with the session commit above, SHA-256 again — result must equal the witness stamp.14. Merge Policy
Human review required. Do not self-merge. Do not autonomously promote Flywheel state.
🤖 Generated with RuFlo
https://claude.ai/code/session_01VWUxwsNQVofSGXi8us9dEc
Generated by Claude Code