#4277 fixed the bundle drift and made the build start on Windows by
running `npx esbuild` with `shell: true` when process.platform is
win32. That branch ignores ESBUILD, so a Windows --check doesn't use
the esbuild version CI pins, and it hands the file paths to cmd.exe
unquoted.
Replace the branch with one path for every OS: ESBUILD, when set, is
still run directly as an executable (CI, the plugin READMEs and
codex-mod-hooks.test.mjs rely on it); without it the repo's own
esbuild is loaded through its JS API (buildSync), as
plugins/ruflo-console/scripts/build-tui.mjs already does. No shell,
no .bin shim. Bundles are unchanged.
Co-Authored-By: RuFlo <ruv@ruv.net>
Review of #4276:
- The offer listed every mission behind one "adopt them here" button, and
the old key mixes missions from several projects, so the natural click
took other projects' missions and removed their offers. Each offered
mission now has its own adopt / not here; "none of these" dismisses all.
Dismissals are saved per mission id (`legacyDismissed: string[]`; the
earlier `true` still covers what was offered then).
- A failed project-key write still pruned the shared key. writeLedger now
returns the ids it saved (null on failure), and loadLedger's claim and
adoptLegacy prune only ids that were saved.
- An offer held only in the project's own key (a 0.44.3 copy) vanished on
the next save. Such offers are written back under `offered` until adopted.
- Adopting a mission older than the 20 the project keeps now returns
'full' instead of pruning it from the shared key and dropping it.
- Moving to another directory also clears goal, plan, guidance and screen.
Co-Authored-By: RuFlo <ruv@ruv.net>
#4242 keyed the mission ledger by project, but a project with no ledger of
its own still took in every mission from the old shared key that had no cwd
(all of them, since cwd was only recorded from #4237 on), and the first save
copied them into the project's own key.
- Missions with no project are offered in Mission Control (adopt here / not
this project) instead of taken in; until adopted they are not picked,
handed to Claude or put in the prompt.
- Adopt stamps the project's cwd and removes them from the shared key;
dismiss is remembered per project.
- A shared-key mission recorded for this project is taken in and pruned.
- A 0.44.3 copy with no project in a project key is offered the same way.
- loadLedger clears missions and active when the State's cwd changes
(session.start reuses the State).
- Ledger storage moves to hooks/mission-ledger.ts (mission-control.ts would
pass 500 lines); mission-control.ts re-exports it unchanged.
- Console 0.44.4: #4242 shipped under 0.44.3, so plugin update never
offered it.
Co-Authored-By: RuFlo <ruv@ruv.net>
* dream(security): denylist gaps in validateEnv() for git/perl/ruby/java env-var hijack family
DENYLISTED_ENV_NAMES (v3/@claude-flow/cli-core/src/mcp-tools/validate-input.ts)
covered loader-hijack and the 2026-09-21 search-path-family fix, but missed
credential/arbitrary-command vars in the same git family (GIT_ASKPASS,
GIT_PROXY_COMMAND), interpreter-flag-injection vars for Perl/Ruby/Java
(PERL5OPT/RUBYOPT/JAVA_TOOL_OPTIONS/_JAVA_OPTIONS/JDK_JAVA_OPTIONS), two more
search-path vars (PYTHONHOME, CLASSPATH), and git's numbered
GIT_CONFIG_KEY_<n>/VALUE_<n>/COUNT runtime-config-injection family (added via
a new regex, not a fixed name — strictly broader than any single name).
PYTHONSTARTUP included for defense-in-depth with an honest caveat (interactive-
REPL-only, not live-exploitable through today's non-interactive execSync path).
Researched and explicitly rejected: PYTHONEXECUTABLE (cosmetic, macOS-only),
PSModulePath (single-source, Grade C evidence only).
18 new discriminating tests added to validate-input-env.test.ts, matching the
file's existing pattern. Stash-isolated: 18/18 fail against baseline, 51/51
pass on candidate. Full @claude-flow/cli suite: byte-identical 60-failure set
baseline vs candidate (zero regressions). tsc --noEmit: 0 errors.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01S1h1otMCeN5gSX8S5gC17H
* dream(security): fix-forward post-critique — correct test counts, document GIT_CONFIG_NOSYSTEM/PYTHONSTARTUP caveats
Independent adversarial critic caught: (1) an arithmetic error in this
session's own evaluation writeup (32 pre-existing tests, not 33; 19 new
tests of which 18 discriminate, not 18 flat); (2) GIT_CONFIG_NOSYSTEM's
denylist rationale was undocumented despite guidance/mod-sources.ts's git()
helper setting that same var defensively elsewhere in this repo; (3) the
PYTHONSTARTUP comment overclaimed that execSync's non-interactive child
"cannot enter" Python's interactive mode — a caller-supplied `python3 -i`
can still trigger it. All three addressed: gist corrected, source comments
now document the real rationale for both. Net security conclusion for
PYTHONSTARTUP unchanged (defense-in-depth, no new capability — the caller
already controls the full command string). Re-verified: 51/51 tests,
tsc --noEmit clean.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01S1h1otMCeN5gSX8S5gC17H
* dream(security): update LEDGER.md for 2026-10-16 (#4229/#4230)
Appends tonight's row, confirms #4053/#3977 merged via GitHub MCP tools,
confirms no run-gap for 10-12..10-15, and flags that 10-11's own PR cited
a CVE-2026-25725 that does not resolve in NVD/MITRE.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01S1h1otMCeN5gSX8S5gC17H
* dream(security): fix CI — bump @claude-flow/cli-core 3.7.3->3.7.4 (leaf-package-publish audit)
The "Plugin package install-safety" CI check's audit-leaf-package-publish.mjs
caught that this PR's source change to v3/@claude-flow/cli-core (not bundled
into the release tarballs, resolved from the registry at the version
v3/@claude-flow/cli/package.json pins) left the leaf's own package.json
version unchanged — per CLAUDE.md's "Publishing Rules" (ruvnet/ruflo#3335,
#3390), that means a release would ship the OLD registry copy and this
fix would reach nobody. PATCH bump per repo semver policy (bug fix, no API
change): 3.7.3 -> 3.7.4. Updated the three places that need to agree:
cli-core's own package.json, @claude-flow/cli's dependency pin, and
v3/pnpm-lock.yaml's specifier for that workspace link.
Re-verified: audit-leaf-package-publish.mjs clean, tsc --noEmit 0 errors,
51/51 tests pass.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01S1h1otMCeN5gSX8S5gC17H
* dream(security): fix CI — bump root claude-flow's @claude-flow/cli-core range 3.7.3->3.7.4
audit-wrapper-dep-ranges.mjs (ruvnet/ruflo#2127) caught that the root
claude-flow umbrella's own declared dependency range for the just-bumped
@claude-flow/cli-core leaf (3.7.3) no longer includes the workspace's actual
version (3.7.4) after the prior commit's bump. package-lock.json's resolved
node_modules/@claude-flow/cli-core record intentionally left untouched (still
3.7.3, with its real registry integrity hash) since 3.7.4 has not actually
been published yet — see the PR comment on the structural publish blocker.
Re-verified all 5 install-safety audit scripts locally: clean.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01S1h1otMCeN5gSX8S5gC17H
* Revert "dream(security): fix CI — bump root claude-flow's @claude-flow/cli-core range 3.7.3->3.7.4"
This reverts commit 9dae077cb3.
* dream(security): resolve CI blocker — @claude-flow/cli-core@3.7.4 is now published
A maintainer's 3.57.0 release (main advanced from 1882006a0 to b93144803
while this PR sat open) published @claude-flow/cli-core@3.7.4 to the real
npm registry, containing this exact fix (verified via `npm pack` + diff
against the source on this branch). That resolves the structural blocker
described in this PR's comment: the root claude-flow umbrella's own
dependency range can now safely bump to match, since 3.7.4 genuinely
exists — unlike three days ago, this no longer breaks root `npm ci`/
`npm install` for the rest of the CI matrix.
Re-verified for real this time (not just the static audits): ran
`node scripts/smoke-cli-npx-install.mjs` directly — packs the real CLI
tarball and does a genuine `npm install` into a scratch project — and it
now succeeds end-to-end (previously failed with ETARGET). All 5 install-
safety audit scripts clean. 51/51 tests, tsc --noEmit 0 errors.
Note: main's own source tree (v3/@claude-flow/cli-core/src/mcp-tools/
validate-input.ts) is still at the pre-fix 3.7.3 content as of this
commit — only the npm registry got the fix early, via whatever process
published 3.7.4. Merging this PR is what reconciles main's source with
what's already shipped to real users.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01S1h1otMCeN5gSX8S5gC17H
---------
Co-authored-by: Claude <noreply@anthropic.com>
recordTrajectory() saved stats.json synchronously but left the
ReasoningBank save to its 100 ms debounce timer. The one-shot bins call
process.exit(0) as soon as the command resolves, so the timer never
fired: patternsLearned went up while patterns.json was never written.
Flush the bank next to savePersistedStats() so the counter is never
persisted for a pattern that wasn't.
The leaf-package-publish audit requires a version bump when publishable
memory source changes. Same shape as #4152: memory/package.json, both CLI
dependency entries, and the CLI importer's specifier in v3/pnpm-lock.yaml.
Co-Authored-By: RuFlo <ruv@ruv.net>
tryNativeInit() called an instance open() that the @ruvector/rvf SDK
doesn't have (it only has the static RvfDatabase.create/open), so init
always threw, the catch swallowed it, and every install ran pure-TS.
Correcting only that call would turn a silent fallback into silent data
loss: initialize() skipped loadFromDisk() on the native path, while store,
search and persist still went through the in-memory map, so the next
persistToDisk() would overwrite databasePath with only the new entries.
The SDK is a vector index (u64 ids, {id, distance} results, no payloads),
so it can't be the store for MemoryEntry records. Remove the branch and
keep the pure-TS backend that already runs everywhere. healthCheck() no
longer recommends installing @ruvector/rvf.
Adds rvf-backend.test.ts: reopen reloads and keeps the snapshot even when
an @ruvector/rvf whose factories succeed is importable. It fails against
main and against the open()-only fix.
Fixes#4279
Co-Authored-By: RuFlo <ruv@ruv.net>
The tree resolved @ruvector/rvf 0.1.9 through ruvector@0.2.27 (^0.1.0)
and 0.2.3 through agentdb. 0.1.9 loses string ids on reopen: a query
returns label "0" instead of the stored id. 0.3.4 keeps them through
the .idmap.json sidecar, and its API only adds to 0.1.9's and 0.2.3's.
- overrides in package.json and ruflo/package.json (root overrides do
not reach the published wrapper, #2112) and pnpm.overrides in
v3/package.json
- lockfiles regenerated with npm and the pinned pnpm@8.15.0; in v3,
cli's ruvector ^0.2.27 now resolves to 0.2.41 (agentdb's copy), and
the root lockfile catches up with five workspace versions as any
npm install on main does
Co-Authored-By: RuFlo <ruv@ruv.net>
`worker' is not a top-level command in 3.57.0, so the two examples in
docs/USERGUIDE.md exit 1 with "Unknown command: worker" when copied.
The command lives under `hooks worker', which the same guide already uses
further down.
Review found the state.lock invariant has a gap with mixed versions: released
versions before the dead-owner fix take over any lock older than 30 s, even a
live owner's, so a writer suspended mid-write (e.g. a sleeping laptop) could
have its temp removed by a newer holder. Keep a temp while its writer pid is
alive on this host, and until it is 10 minutes old.
Tests: live-writer temps and 5-minute-old temps are kept, verify removes
orphans on its own, and the directory case is named for what it checks.
Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_011Qe66m38aobVEJGHAbFVzv
A writer killed between creating <file>.<pid>.<uuid>.tmp and renaming it
(SIGKILL from a caller's timeout, OOM) never reaches writeJsonAtomic's
cleanup, so a full-size copy of state.json or ledger-anchors.json stays in
the policy directory forever. On a mature ledger each copy is ~250 MB; one
host had 13 of them (1.9 GB).
Every writer of state.json, ledger-anchors.json, state.anchor.json and
ledger-anchor-head.json holds the project's state.lock, so a transaction
or verify that holds the lock removes temp files of exactly those names.
Only regular files that match <name>.<pid>.<uuid>.tmp and are at least 60 s
old are removed; symlinks, directories, fresh temps and other files' temps
are left alone, and a failure never fails the caller.
Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_011Qe66m38aobVEJGHAbFVzv
assignTaskToDomain() can leave two AgentState owners after retargeting (#4245 keeps the previous owner busy until a terminal report). The terminal handlers only cleared the reporting or assignedTo agent, leaving the other owner busy with currentTask === taskId forever. Clear and release every remaining owner once the task is completed, terminally failed or cancelled.
unregisterAgent()/terminateAgent() removed an agent from state/topology/bus/consensus but left it in AgentPool and agentDomainMap. A later assignTaskToDomain() could return that removed id, while getAgent() was undefined and its task_complete was dropped. Detach from the domain pool before cancellation so release cannot hand the agent new work, and stop deleting agentDomainMap before unregisterAgent().
memory_import returns { error } for a missing or invalid file and
{ success: false, error, imported } when some writes fail. The CLI read
result.imported unconditionally, so a bad file printed "Imported from
undefined" and then died on a TypeError, and a partial import was reported
as a success. Check the result before printing, mirroring memory export.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
The package.json bin for this CLI is registered as claude-flow-codex,
but the package itself publishes under the scoped name @claude-flow/codex.
Several usage examples told a reader to run 'npx claude-flow-codex ...',
which resolves to a different (nonexistent) unscoped package rather than
this one.
Co-Authored-By: RuFlo <ruv@ruv.net>