2438 Commits
Author SHA1 Message Date
randRuFlo 1a6e95ff4b chore(release): 3.56.6 (Windows hooks via node -e, SessionStart risk scanner, trajectory feedback, cli-core 3.7.1 / shared 3.0.3 pins); witness regen from a full build
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 12:06:55 -04:00
rUv 8137b3d2f6 Merge pull request #4061 from ruvnet/batch/rudycelekli-fixes
fix: reviewed batch from rudycelekli (cli-core 3.7.1, shared 3.0.3, ruflo-adr 0.5.5)
2026-10-11 09:03:12 -07:00
randRuFlo 66b42ec532 fix(security): linear-time encoded-powershell match (repeated-token case was quadratic) in both scanners; re-sign helpers
Refs #4052, #4053.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 10:52:06 -04:00
r b40e8053ce Merge main into dream/2026-10-11-security 2026-10-11 10:49:55 -04:00
rUv 47ad62e5af Merge pull request #4054 from ruvnet/fix/win-hooks-4045
fix(init): Windows hooks launch through node -e, not cmd /c (#4045)
2026-10-11 07:48:54 -07:00
randRuFlo b662966540 chore: bump cli-core 3.7.1, shared 3.0.3, ruflo-adr 0.5.5 for the reviewed rudycelekli batch
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 10:46:01 -04:00
ClaudeandRuFlo 25f26f5e3e fix(security): address review — linear-time regex, drop snippet from automatic-boot stdout
Two findings from ruvnet's review on #4053:

1. The powershell/-EncodedCommand pattern (`\s+.*-e(...)`) backtracks
   quadratically on hostile input -- measured ~1.9s on 64,000 spaces with no
   match; a 1MB hook command would stall session-restore (an unconditional
   boot path) for minutes. Rewritten as a linear token-walk
   (`(?:\S+\s+)*?`), confirmed <5ms on a 1MB hostile input while still
   matching real EncodedCommand payloads. Fixed in both the CJS mirror and
   the shared TS original (settings-risk-scanner.ts), since the TS version
   is already live via init/--upgrade.

2. scanSessionStartSettingsForRisk()'s warnings included up to 120 chars of
   the matched hook-command snippet -- but session-restore's stdout is read
   back into the live Claude Code session as context, unlike init/--upgrade
   where a human reads the terminal directly. Printing attacker-controlled
   settings.json content into that context is a prompt-injection path even
   with control characters stripped. The automatic-boot path now prints
   only the scanner-generated location + reason, never the snippet;
   srFormatRiskFindingsAsWarnings (snippet included) is unchanged for
   init/--upgrade's human-facing output.

New tests: a 1MB ReDoS timing guard, a snippet-leak regression guard, and a
real-payload-still-detected check after the regex rewrite. 75/75 related
tests pass.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01HW4yuGGcrCy4CcPgQ7Q2dx
2026-10-11 13:38:47 +00:00
rUv 19c59a2a40 Merge pull request #4051 from ruvnet/fix/3662-stepful-trajectory-feedback-indexing
fix(hooks): index trajectory-end feedback even when steps were recorded (#3662)
2026-10-11 06:31:35 -07:00
randRuFlo a606b3cfeb fix(init): Windows hooks launch through node -e, not cmd /c (#4045)
Under Git Bash MSYS rewrote the /c of the generated cmd /c IF EXIST hook, so cmd
started interactively, executed the hook's stdin JSON and created zero-byte files
from text after a >. The Windows hook is now a single node -e with no cmd, no
%VAR%, and none of < > | & $ or inner double quotes. It keeps the project-first
then user-profile fallback (#1943), user scope never reads the project, and the
helper runs as a child with inherited stdio so stdin and the exit status pass
through. pinToUserHelpers recognises the new form (exact match only) as well as
the old ones.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 09:31:30 -04:00
ClaudeandRuFlo d4b77a05ad dream(security): #4052 wire settings.json risk scanner into the automatic SessionStart hook (evaluated, ACCEPT-scoped)
Closes the gap #3835 itself disclosed: the settings-risk scanner
(CVE-2025-59536-class detection, #3043) ran at init/--upgrade and (pending
#3835) the explicit hooks_session-restore MCP/CLI handler, but never on the
one path that fires automatically on every real Claude Code session boot
-- hook-handler.cjs's session-restore command, wired via .claude/settings.json's
own SessionStart hooks array. Validated against a real 2026 attack campaign
("Mini Shai-Hulud" npm worm) and a real Claude Code CVE (CVE-2026-25725),
both of which use exactly this SessionStart-hook persistence mechanism.

Ports the existing TS scanner's logic (hook-handler.cjs has no build step)
into scanSessionStartSettingsForRisk(), wired into the 'session-restore'
command handler in both the root and package copies of hook-handler.cjs
(kept byte-identical per the existing parity test). An adversarial-critic
subagent review found and this session fixed one real issue pre-commit: a
non-SyntaxError JSON.parse failure would have aborted session-restore
itself rather than degrading gracefully, since this path runs
unconditionally on every boot (unlike the opt-in MCP-tool path #3835
hardened the same way).

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01HW4yuGGcrCy4CcPgQ7Q2dx
2026-10-11 06:26:45 +00:00
ClaudeandRuFlo 68dc046a2a fix(hooks): index trajectory-end feedback even when steps were recorded (#3662)
#2351 fixed trajectory-end feedback being dropped, but only for step-less
trajectories (`!hasSteps` gate). The common start -> step -> end path that
real agents use recorded SONA state via `processTrajectoryOutcome`, but the
non-empty `feedback` string was never promoted to the `pattern` namespace,
so it was unreachable through `hooks_intelligence_pattern-search`.

Remove the `!hasSteps` restriction so feedback is promoted whenever it is
non-empty, regardless of whether steps were recorded. `patternsExtracted`
and the `feedbackDistilled` response field already handled both cases
generically, so no other call sites change behavior.

Adds a regression test driving the full trajectory-start -> step -> end ->
pattern-search path, which fails on current main and passes with this fix.

Note: this addresses only the "indexed when steps are present" half of
#3662. The issue's other claim — that `hooks_route` never consults a
persisted SONA `getRoutingSuggestion()` pattern — is real (verified:
`getSuggestion`/`getRoutingSuggestion` have no callers outside
sona-optimizer.ts) but requires an architectural decision (precedence vs.
the AgentDB/semantic routing paths, the confidence threshold, and new
response fields distinguishing "persisted" from "eligible for inference")
that is out of scope for this fix.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01QFyyphjiSXRE1TS2rRnEwU
2026-10-11 05:22:04 +00:00
randRuFlo 19fb5a71de chore(release): 3.56.5 (cli graph header sniff keeps SQLite locks, #4040/#4044); witness regen from a full build
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 21:52:14 -04:00
r 5b53336c97 Merge remote-tracking branch 'origin/main' into fix/graph-header-sniff-4040 2026-10-10 21:09:17 -04:00
r 9715c50fb7 Merge main into release/3.56.4 2026-10-10 20:30:01 -04:00
randRuFlo 41fe2242e5 fix(memory): read the RFE1 header in a bounded child so the sniff cannot drop live SQLite locks (#4040)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 18:59:36 -04:00
rUv ef13569934 Merge pull request #3999 from proffesor-for-testing/fix/security-scan-false-positives
fix(security): scan code patterns without the false positives seen on a real tree
2026-10-10 15:56:52 -07:00
randRuFlo 762400a3a4 chore(release): 3.56.4 version bumps, changelog, helpers re-signed
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 18:56:17 -04:00
rUv ebea43a793 Merge pull request #3990 from ruvnet/sec/helper-cli-from-helper-root
fix(helpers): resolve the ruflo CLI from the helper root, not the project (replaces #3953)
2026-10-10 15:54:07 -07:00
rUv 7047b8b030 Merge pull request #3949 from ruvnet/fix/helper-module-root-and-session-path
fix(helpers): resolve modules from the helper root and keep session writes in the project
2026-10-10 15:54:03 -07:00
rUv 570392602a Merge pull request #3952 from ruvnet/fix/user-settings-pin-home-helpers
fix(init): pin user-level hook and statusline commands to $HOME helpers (security review in PR comments)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 11:54:50 -07:00
rUv fce696e51e Merge pull request #3948 from ruvnet/fix/plugin-registry-trust-fail-closed
fix(plugins): fail closed when the plugin registry is not verified (security review in PR comments)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 11:54:46 -07:00
rUv 3d2c16dd23 Merge pull request #3986 from ruvnet/sec/optional-modules-own-install
fix(cli,plugins): resolve executed optional modules from the tool's own install (replaces #3954; security review in PR body)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 11:44:57 -07:00
rUv 559ccedc34 Merge pull request #3977 from ruvnet/dream/2026-10-10-performance
dream(performance): #3976 fallbackLouvain() communityTotal O(n²)→O(n·deg) incremental fix (evaluated, ACCEPT)
2026-10-10 10:20:24 -07:00
rUv c252cb676f Merge pull request #3980 from Devesh-Maheshwari/fix/status-agents-list
fix(cli): show registered agents in status agents
2026-10-10 09:19:14 -07:00
Dragan SpiridonovandRuflo & AQE 58604dabce fix(security): keep the old command-injection reach; bound the comment stripper
Adversarial review of the first commit (a Claude devil's-advocate agent and three
Codex rounds) found inputs main reports that it dropped, a ReDoS, and quadratic paths.

- Command injection is main's rule again (child_process ... exec), tested after
  comment stripping, so execSync is reported and no execFile shape is exempt: env,
  node -e, python -c, bash.exe, options variables and exec passed as a value were all
  bypasses. The execFile callback regex that backtracked catastrophically is gone.
- Carried block comments continue only through comment-looking lines; regex literals
  are read as code (bounded to 200 chars); '://' is never a comment. Lines are built
  from parts with a 12-char tail, so the stripper is linear.
- SQL placeholders: only param/placeholder names, params/values/args.length, numbers
  and loop letters, in value position, outside single- or double-quoted SQL text, in
  one left-to-right pass that skips escapes. pageNum, userIdx, req.body.length and
  quoted placeholders are reported.
- Spec: 26 tests, including every reviewer input and linear-time checks; each of ten
  source mutations fails at least one test.

Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01CGoza3gyxBjpaiMPhGHcHs
2026-10-10 18:13:04 +02:00
Dragan SpiridonovandRuflo & AQE 3b4b91fcd5 fix(security): scan code patterns without the false positives seen on a real tree
`ruflo security scan --depth deep` on a 10-repo checkout reported 10 high findings,
all false: `child_process.execFile` named in comments, numbered pg placeholders
(`$${paramCount}`) as SQL injection, and a Playwright report bundle. Mediums
included "retrieval (" read as eval and istanbul/Playwright assets.

- eval needs a word start; window.eval still matches.
- Command injection is any exec/execSync/execFile use (call, ?.(), .call/.apply/
  .bind, ['exec'], passed as a value), except execFile of a literal non-shell
  program with a literal argv and no shell or options variable. execSync, which
  `exec[^S]` skipped, is now reported.
- A counter-shaped pg placeholder where SQL takes a value, outside SQL quotes, is
  not interpolation; quoted or value-shaped `$${...}` still is. The SQL test runs in
  linear time.
- Comment text is stripped before matching (strings respected); a block comment
  carries only from a line-start opener that closes later.
- istanbul prettify/sorter/block-navigation/lcov-report next to a coverage marker,
  and Playwright trace/data next to index.html, are skipped. Folder names are looked
  up in a Map.

Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01CGoza3gyxBjpaiMPhGHcHs
2026-10-10 17:30:34 +02:00
rUv ca74bd4f79 Merge pull request #3967 from rudycelekli/fix/active100-ruflo-screen-20261010
fix(tasks): synchronize workers when task_update reassigns a task
2026-10-10 08:03:12 -07:00
randRuFlo 72d895a81d fix(helpers): never interpolate a shell-active install-root path; run the delegation smoke from a helper root
The statusline now builds shell command lines from HELPER_ROOT (the checkout's
directory, chosen by whoever made it). A directory named p$(...) was expanded
inside the double-quoted command; shell-active paths are now skipped.

The statusline-generator delegation smoke ran the generated helper from tmpdir,
so with CLI resolution moved to the helper root it fell through to the registry's
published CLI (intelligencePct null). It now writes the helper into a throwaway
helper root whose v3/@claude-flow/cli is the repo's built CLI.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 10:54:15 -04:00
Dragan Spiridonov e625b7104a fix(helpers): resolve the ruflo CLI from the helper root, not the project
A home-level helper or a user-level plugin hook serves every opened project.
hook-handler.cjs and statusline.cjs executed a CLI found under the project
(<cwd>/node_modules/{@claude-flow/cli,ruflo}, <cwd>/v3/...), and every npx
fallback ran with the project as cwd, where npx prefers the project's own
install. The plugin shims also resolved `ruflo` through relative PATH
entries, which resolve against the cwd.

- hook-handler.cjs / statusline.cjs (package and repo copies): candidates
  are built from the helper's install root; for a project-local helper that
  is the project, so its behaviour is unchanged.
- npx fallbacks pass `--prefix <helper root>` (generated hook-handler and
  ruflo-hook.cjs too) or, in the plugin shims, `--prefix <plugin data dir or
  home>`. The spawned CLI still runs with the project as its cwd.
- ruflo-hook.cjs (all four copies): relative/empty PATH entries are skipped.

Test: helper-cli-resolution-trust.test.ts (11 cases, 10 fail on main);
hook-handler-artifact-parity follows the npx args into cliSpawnArgs().

The signed helpers changed, so the helpers manifest needs re-signing.
2026-10-10 10:51:22 -04:00
Dragan Spiridonov bc249a0a50 fix(helpers): check session dir containment before creating it
start() created SESSION_DIR (mkdirSync / ensureDir) before checking that it
resolves inside the project, so a symlinked .claude-flow still got an empty
sessions/ directory created at the symlink target. assertSessionDirContained()
now resolves the deepest existing part of the path (lstat, so a symlink
counts) and start() calls it before creating anything. Applied to all five
session helper variants.

Test: session-helper-trust.test.ts gains a symlinked-.claude-flow case per
variant (5 cases, all fail without this change).
2026-10-10 16:51:20 +02:00
Dragan Spiridonov 16bd4ac948 fix(init): re-pin every legacy project-helper command form in user scope
pinToUserHelpers() only recognised the #1943 probes, the exact git-root
statusline and the git-root ESM import without argv.splice, so
`init --upgrade --settings` on the home directory left older shipped forms
that always run the opened project's helper:
- pre-#1943 `sh -c 'exec node "${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/<x>" <sub>'`
  and the Windows `cmd /c node %CLAUDE_PROJECT_DIR%/.claude/helpers/<x> <sub>`;
- ADR-059 git-root node -e forms (CJS and ESM, with argv.splice);
- relative `node .claude/helpers/<x> [sub]` hooks and statusline.

It now re-pins any command whose target is a known ruflo helper under
.claude/helpers reached through CLAUDE_PROJECT_DIR, %CLAUDE_PROJECT_DIR%,
`git rev-parse --show-toplevel` or a relative path, keeping the subcommand.
Commands with redirects/chaining, other scripts, or already pinned to HOME
are left alone.

executeUpgrade() created a missing settings.json with
generateSettings(DEFAULT_INIT_OPTIONS), whose targetDir is the module-load
cwd; it now passes the upgrade's targetDir.

Tests: one case per legacy form, a user-authored/already-pinned case, an
upgrade-merge case, and an executeUpgrade missing-settings case.
2026-10-10 16:51:20 +02:00
Dragan Spiridonov 1cf16ede91 fix(helpers): validate the session archive name in the @claude-flow/mcp dev helper
v3/@claude-flow/mcp/.claude/helpers/session.js is a repository-local copy
(the package publishes only dist) with the same `${session.id}.json`
archive path. Apply the same hardening as the shipped session helpers and
cover it in session-helper-trust.test.ts (3 of 4 cases fail without it).
2026-10-10 16:51:20 +02:00
Dragan Spiridonov d1d9df0891 fix(init): pin user-level hook and statusline commands to $HOME helpers
Settings written to ~/.claude/settings.json apply to every project the user
opens. The #1943 probe ran `$CLAUDE_PROJECT_DIR/.claude/helpers/<script>`
whenever that file existed, so in user-level settings the opened project
decided which helper code ran.

helper-commands.ts now owns the hook/statusline command forms:
- project-level settings keep the #1943 project-first probe, unchanged;
- user-level settings (init target is the home directory) get commands
  pinned to $HOME/.claude/helpers with no project lookup;
- `init --upgrade --settings` on the home directory re-pins the probe and
  git-root forms ruflo generated earlier and leaves user-authored commands.

The #1943/#1948 fix invariants now point at helper-commands.ts.

Test: settings-user-level-helpers.test.ts (8 cases).
2026-10-10 16:51:20 +02:00
Dragan Spiridonov 4cc18753f9 fix(helpers): resolve modules from the helper root and keep session writes in the project
A home-level helper can serve whatever project Claude Code opens, so
everything that project controls is untrusted input to the helper.

auto-memory-hook.mjs / learning-service.mjs: since the #3286 change every
module-resolution strategy (memory-package.json sidecar, local v3 dist,
createRequire, node_modules walk-up, agentic-flow embedder) was rooted at
CLAUDE_PROJECT_DIR, so a project could choose which JavaScript a home-level
helper imports. Add MODULE_ROOT (the helper's install root) for module
resolution; PROJECT_ROOT stays data-only, so #3286 still holds.

session.cjs: end() archived to `${session.id}.json` with the id taken from
the project's current.json, so a crafted id could write outside the session
directory, and writes followed symlinks. The archive name must now match
session-<digits>; current.json counts only as a regular file (lstat); writes
use an exclusive temp file + rename; and the project session directory must
resolve inside the project. Applied to the packaged helper, both generators
(generateSessionManager / generateCrossPlatformSessionManager) and the
repository copy.

Tests: helper-module-root-trust and session-helper-trust (16 of 21 cases
fail on main, all pass now); the #3286 test now places the mock memory
package at the helper root.

The helpers manifest is not re-signed here: auto-memory-hook.mjs changed, so
it needs `scripts/sign-helpers.mjs` with the release key.
2026-10-10 16:51:20 +02:00
Dragan Spiridonov 5bd949dfde fix(plugins): review follow-ups for registry trust fail-closed
- smoke-plugin-registry-signature.mjs: follow the verifier rename to
  registrySignatureFailure and require the fail-closed call site
  `if (failure) return this.fallbackToBuiltIn(`, keeping full #1922 coverage.
- verifyEd25519Signature verifies in RFC 8032 strict mode, and
  isPlaceholderSigningKey rejects every small-order or off-curve key, not
  only the all-zero one.
- An unverified registry claims no official plugins and no verified
  authors; MCP transfer_plugin-* results carry the registry status.
- Tests no longer assume the shipped trust anchor stays a placeholder.
- Document the strict-mode asymmetry for unlisted packages in --help.
2026-10-10 16:51:15 +02:00
Dragan Spiridonov c4c66b2c7b fix(plugins): fail closed when the plugin registry is not verified
The live plugin registry CID is unsigned, so discovery always fell back to
the built-in plugin list, whose entries all claim trustLevel "official".
`plugins install` passed that claim on as registry trust, which runs npm
lifecycle scripts and skips the permission gate (#3557) for any listed
plugin, with nothing actually verified.

- Discovery reports `verified` + `unverifiedReason`; only a registry whose
  signature verifies against the pinned key keeps its trust labels. The
  built-in fallback and a registry fetched with requireVerification off are
  reported with every entry as 'unverified'.
- A placeholder pinned key (missing, malformed, all-zero) is never used to
  verify: the all-zero key is small-order and accepts a forged signature.
- CLAUDE_FLOW_STRICT_PLUGINS=true (ADR-145): no fallback to the built-in
  list, and `plugins install` refuses unless --allow-unverified is passed.
- `plugins install` passes registry trust, permissions and checksum only
  for a verified registry entry; `plugins list`/`info` show registry status.
- PluginIntegrityVerifier (@claude-flow/security) skips placeholder anchors,
  such as the all-zero one in trust-anchors.json, and verifies in RFC 8032
  strict mode, which rejects small-order keys.
2026-10-10 16:51:15 +02:00
rUv 24774b9087 Merge pull request #3951 from ruvnet/fix/plugin-upgrade-trust-gate
fix(plugins): apply the #3557 trust policy on plugins upgrade (security review in PR comments)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 07:51:09 -07:00
rUv c75a1ed34c Merge pull request #3955 from ruvnet/fix/node24-better-sqlite3-abort
fix(memory): open AgentDB with our better-sqlite3 so Node 24 does not abort
2026-10-10 07:50:41 -07:00
rUv 2145a31f0d Merge pull request #3958 from ruvnet/fix/agentic-flow-root-import
fix(cli,integration): never import the agentic-flow root entry (it runs agentic-flow's CLI)
2026-10-10 07:50:39 -07:00
rUv 840c716115 Merge pull request #3947 from ruvnet/chore/retire-legacy-agentic-qe-plugin
chore(plugins): retire legacy agentic-qe shim and fabricated demo registry entry
2026-10-10 07:50:35 -07:00
randRuFlo eadc4adfe3 fix(cli,plugins): stop plugin-dir walk-ups at the node_modules boundary; drop embeddings hunk
A project-local install lives at <project>/node_modules/@claude-flow/cli, so the
8-level walk-up from import.meta.url used by the testgen/metaharness locators and
doctor crossed node_modules and reached <project>/plugins/ruflo-*, i.e. code the
opened repository supplies. ownInstallAncestors()/ownPluginDirs() now stop at the
first node_modules directory. Source-checkout dev layouts are unaffected.

The @claude-flow/embeddings hunk is dropped from this change: that package cannot
ship from main until its alpha branch is reconciled, so it needs its own change.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 10:45:48 -04:00
Dragan Spiridonov 4c95a6a1b6 fix(cli,plugins): resolve executed optional modules from the tool's own install
The CLI, two MCP tools and two plugin scripts imported or ran code found
relative to the cwd, which is the opened project:
- doctor (metaharness check), `metaharness` command and metaharness MCP
  tools: plugins/ruflo-metaharness/scripts under the cwd;
- testgen MCP tools: plugins/ruflo-testgen/scripts under the cwd, reached
  on every published install because that plugin is not bundled;
- init: <cwd>/node_modules/@claude-flow/codex;
- embeddings: <cwd>/node_modules, <cwd>/../node_modules and a fixed
  /workspaces/claude-flow path for agentic-flow;
- ruflo-ruos ledger: the CLI's mcp-client resolved from the cwd;
- cost-tracker compact.mjs: @claude-flow/integration resolved from the cwd.

Each now resolves from the tool's own install (module location /
createRequire(import.meta.url)), plus the user's marketplace checkout for
the plugin scripts. The project remains the data/scoring target.

Test: optional-module-resolution-trust.test.ts (10 cases, all fail on main).
2026-10-10 10:45:48 -04:00
randRuFlo 3c21c3ad1b test(cli): differential test for fallbackLouvain vs the pre-fix rebuild
Adds 1800 seeded random graphs (unit, small-integer and fractional weights,
disconnected, self-loops, parallel edges, unknown endpoints) asserting exact
equality with the frozen pre-fix implementation. Mutation-checked: dropping
the subtract-from-source update fails all three groups.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-10 10:42:10 -04:00
Rudy Celekli 02f4c87dd9 fix(tasks): validate reassignment and preserve retained worker ownership
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
2026-10-10 10:30:31 -04:00
Devesh Maheshwari 33d063de48 fix(cli): show registered agents in status agents 2026-10-10 03:18:15 -05:00
Dragan Spiridonov c536e77fda fix(memory): reroute the stale-lock retry AgentDB too; memory 3.0.4
Rebased onto main, where ControllerRegistry and AgentDBBackend build AgentDB
inside withAgentdbLockRecovery(); useHostSqliteDriver() now runs inside that
closure right after each `new AgentDB`, so the instance a stale-lock retry
creates also opens its handle with getHostSqliteDriver(). Tests drive the
retry path for both sites.

@claude-flow/memory 3.0.3 was published by 3.56.3 without the driver, so
this ships as 3.0.4 and the CLI pins 3.0.4. The #3693 memory-owner test
now reports a skip when no native addon is available instead of passing.
2026-10-10 09:49:07 +02:00
Dragan Spiridonov 197bfb7272 test(cli): shared-sqlite identity test follows the installed @claude-flow/memory
The root CI job resolves the published @claude-flow/memory 3.0.2, which does
not route AgentDB through its own driver; there the owner must stay agentdb.
2026-10-10 09:44:50 +02:00
Dragan Spiridonov d4458abdff fix(memory,cli): keep the CLI's better-sqlite3 handles on AgentDB's copy
Follow-up to the AgentDB driver change. shared-sqlite.ts (#3693/#3883)
resolved better-sqlite3 from agentdb's location so CLI handles share
AgentDB's native copy. With AgentDB now opened through
@claude-flow/memory's better-sqlite3, that put graph-edge-writer, the
memory-initializer repair paths, backup restore, distillation, tuning and
the attestation log back on agentdb's nested 11.x: `hooks post-task` still
loaded both addons (and aborted on Node 24), and mixing copies on one file
can delete the -wal/-shm sidecars under AgentDB's live handle.

- @claude-flow/memory exports getHostSqliteDriver(), the one source of the
  constructor; useHostSqliteDriver() opens AgentDB with it and reports
  whether it replaced the loader.
- shared-sqlite resolves better-sqlite3 from @claude-flow/memory when the
  installed memory carries agentdb-native-driver.js, else from agentdb as
  before, so either memory version keeps one copy per process.
- @claude-flow/memory 3.0.3, CLI pin 3.0.3 (leaf-publish gate).

Tests: identity between AgentDB's handle constructor and
loadBetterSqlite3(); #3693 owner model for the memory holder and the
pre-3.0.3 fallback; both AgentDB construction sites; routing against a
real nested copy; a drift guard on agentdb's initializeDatabase contract.
2026-10-10 09:44:50 +02:00
ClaudeandRuFlo 985bdcddac dream(performance): #3976 fix CI timeout on the new complexity-growth test
CI: "Test Suite (ubuntu-latest)" failed on 1a5c8b83 -- root-caused, fixed.

ci-test-ratchet's summary showed an opaque `Error: STACK_TRACE_ERROR` for
"scales near-linearly with node count..." Reproduced the exact CI
invocation locally (CI=1 node node_modules/vitest/vitest.mjs run ... from
repo root, the same command scripts/ci-test-ratchet.mjs spawns, after
`npm install` at root) and got the real error: the legacy O(n^2)
algorithm's warmup+3 trials at n=1600, for both algorithms at both sizes,
exceeded vitest's default 5000ms per-test timeout on this invocation path
-- the same failure class PR #3754 (2026-10-05) hit and fixed the same way.

Fix: explicit 30000ms timeout on the test, trial count 3->2 to trim real
wall-clock cost further. Re-verified against the exact CI invocation:
4/4 tests pass, ~3s total (comfortably inside the new budget). Measured
growth ratios in this run are consistent with the range already disclosed
in the gist/issue/PR -- no change to the reported evidence, only to the
test's own timeout margin.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01JL2GEEWf9ezZo1X1wQ2Ls6
2026-10-10 06:47:01 +00:00
ClaudeandRuFlo 0aa99cd5aa dream(performance): #3976 fallbackLouvain() communityTotal O(n^2)->O(n*deg) incremental fix
fallbackLouvain()'s local-moving loop rebuilt a communityTotal map via a
full scan of every node, once per node, once per pass (O(n^2) per pass),
instead of maintaining it incrementally like networkx's Stot/python-louvain's
status.degrees (O(1) per accepted move). loadRuVector() never resolves real
native acceleration against any published ruvector/@ruvector/wasm version,
so this fallback is the only community-detection path that ever runs,
reachable via the shipped `claude-flow analyze modules` command.

New test file proves byte-identical correctness against a frozen copy of
the pre-fix algorithm plus a complexity-growth regression guard; a
standalone tsx probe shows per-N speedup growing 2.1x->37.5x as N grows
8x, the signature of a complexity-class fix. Full @claude-flow/cli suite
and tsc --noEmit byte-identical to baseline outside the new test file.

Evaluated: ACCEPT. Independently adversarially reviewed: CONFIRMED, no
blocking caveats. Darwin skipped (binary correctness-preserving fix, no
tunable parameter).

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01JL2GEEWf9ezZo1X1wQ2Ls6
2026-10-10 06:28:09 +00:00