The command catalog copy changed (#2640 command renames + catch-up
regeneration), so ruflo-console moves 0.50.0 -> 0.50.1 in plugin.json,
hooks/version.ts, scripts/smoke.sh and the CHANGELOG. The catalog is
regenerated on the merged tree (one entry changed by main) and copied to
the console again.
The single-host AGENTS.md snapshot follows main's #3153 change (#4918:
registered MCP tool names); no other line differs.
Co-Authored-By: RuFlo <ruv@ruv.net>
Adds agentdb_pattern-list (ReasoningBank.listPatterns), agentdb_skill-list
(SkillLibrary.listSkills), agentdb_skill-get (SkillLibrary.getSkill) and the
count-only agentdb_hierarchical-stats (TieredMemoryStore.getTierStats +
countPersisted). They read through the existing memory-bridge registry under
the bridge operation lease. A missing controller or method returns
success:false, code:'unsupported' naming the method, never an empty list;
native errors (page validation, graph-adapter refusal) keep their own code.
Fixes#4707
Co-Authored-By: RuFlo <ruv@ruv.net>
plugins/ruflo-{federation,intelligence}/tests/pii-guard.test.ts import
claude-code/testing and run under claude plugin test, like the other kit
tests in scripts/ci-test-excluded.txt.
Co-Authored-By: RuFlo <ruv@ruv.net>
`ruflo catalog generate` + copy to the ruflo-console catalog (their digests
must match). Picks up memory-neural, stream-chain-run and swarm-orchestrate.
The committed catalog was already stale on main (243 entries; now 290: new
mod registrations and plugins since the last regeneration), so this also
carries that drift. The host-specific engine report is left as committed.
Co-Authored-By: RuFlo <ruv@ruv.net>
The Codex integration audit forbids `@claude-flow/cli@latest` anywhere in
codex src. The shared-instructions module now takes the CLI prefix as a
parameter: codex defaults to its generators' convention (`npx @claude-flow/cli`,
unversioned, as AGENTS.md already uses), and the CLI passes its own
`@latest` form, so the single-host CLAUDE.md is byte-identical (snapshots
unchanged). finalizeDualInstructions checks AGENTS.md for the codex form.
Both copies of the module stay byte-identical.
Co-Authored-By: RuFlo <ruv@ruv.net>
With the ruflo Claude Code plugins installed (ruflo-core@ruflo installed and
not switched off in enabledPlugins), `ruflo init` copied a full shadow copy of
the agents, commands and skills those plugins ship, and registered a second,
standalone `claude-flow` MCP server next to the plugin's.
- init/plugin-dedup.ts: read-only detection via Claude Code's own records
(installed_plugins.json through mods/plugin-resolve installedState, plus
enabledPlugins in local/project/user settings). It lists the agents,
commands and skills of every installed *@ruflo plugin. A missing or
malformed record means "no plugin": today's behaviour.
- executor: skips those agents/commands/skills (per file inside category
dirs; a dir left empty is not created) and the standalone `claude-flow`
MCP entry, keeping any other server the preset asks for. The skip list is
returned as result.pluginDedup; `ruflo init` prints it with the reason and
the opt-out.
- `deferToPlugins` is on in the default/minimal presets and off in
FULL_INIT_OPTIONS, so `init --full` keeps today's full copy.
- Renamed the 3 init commands whose names collided with plugin commands:
memory/neural -> memory-neural (ruflo-intelligence), stream-chain/run ->
stream-chain-run (ruflo-ruos), swarm/swarm -> swarm-orchestrate
(ruflo-swarm).
- smoke-init-bundle-invariants: assertion 4, no init/plugin command-name
collision.
- Two existing init tests now pin CLAUDE_CONFIG_DIR so the plugins installed
on the machine running them cannot change what init writes.
Fixes#2640
Co-Authored-By: RuFlo <ruv@ruv.net>
`ruflo init --dual` (and `@claude-flow/codex init --dual`) wrote two divergent
instruction files. Now AGENTS.md carries the shared sections once plus the
Codex-only ones, and CLAUDE.md is Claude Code's `@AGENTS.md` import plus only
the Claude-specific sections.
- codex/src/generators/shared-instructions.ts: the shared sections (rules,
swarm routing, memory & learning, agents, build & test, CLI reference).
The CLI keeps a byte-identical mirror (a test compares the files) because
it resolves @claude-flow/codex from the registry at the pinned version.
- claudemd-generator.ts builds its shared sections from that module;
single-host output is byte-identical (snapshot recorded on origin/main).
New generateDualClaudeMd keeps only Claude-only sections + template extras.
- Existing CLAUDE.md is only replaced when missing, generated by init and
unedited, or under --force (backed up); otherwise kept with migration steps.
- After the Codex pass, finalizeDualInstructions keeps the import only if
AGENTS.md carries every shared section verbatim; else the full CLAUDE.md
is written back, so an older codex adapter cannot lose content.
- commands/init.ts (outside the lane's file list): pass instructionsSource and
dual to the two passes, run the finalize step, never pass --dual to a
fetched adapter of unknown version.
Fixes#2638
Co-Authored-By: RuFlo <ruv@ruv.net>
A scope is a namespace prefix in the same store:
agent-memory:<scope>:<agentId>:<namespace>. memory_store, memory_retrieve
and memory_search take an optional scope (project|local|user) plus the
agentId the memory package keys each scope by; the CLI gets matching
--scope/--agent flags. Without a scope nothing is prefixed, so existing
data and unscoped calls behave exactly as before. New read-only tool
memory_list_scopes reports each scope's agents, namespaces and counts.
Co-Authored-By: RuFlo <ruv@ruv.net>
Adds `ruflo plugins host <install|update|uninstall|enable|disable|sync|status>`.
Each host's own plugin CLI is driven via execFile with a literal argv; host
executables are resolved by a PATH/PATHEXT scan with fs.access (no `which`,
no shell). Windows npm .cmd shims are run as `node <bin.js>` only after the
owning package's name and bin are verified. Plugin names are validated
against a strict pattern before reaching any argv. Results are reported per
host; any failed host makes the exit code non-zero.
sync: union of enabled plugins, additive, never removes, keeps explicit
disables, refuses a foreign-source marketplace of the same name.
Fixes#2854
Co-Authored-By: RuFlo <ruv@ruv.net>
`read <ns> <key>` refused a key held by several entries with AMBIGUOUS_KEY
and no ids, so there was no way to see the duplicates or repair them.
- The AMBIGUOUS_KEY refusal now lists every matching id with its
createdAt and updatedAt, and names the commands below.
- `read --all <ns> <key>` returns {multiplicity, entries[]}; `read-id <id>`
returns one entry by id. Both are read-only: no package load, no
directory, no lock, no write.
- `dedupe <ns> <key> [--keep <id>] [--apply]` is a dry run by default and
reports which entry would be kept (newest updatedAt, then createdAt;
ties broken by ascending id) and which removed. With --apply it plans
again from a fresh read under the store lock, removes only the other
entries of that namespace+key through the atomic write, and verifies
the result by readback. --keep must name an entry of that key, or the
command is refused and the store is left as it was.
Co-Authored-By: RuFlo <ruv@ruv.net>
SessionStart runs auto-memory-hook.mjs directly, and the hook only found
@claude-flow/memory through the sidecar that init / upgrade / doctor write.
A fresh worktree has no sidecar (.claude-flow/ is gitignored), so imports
were DISABLED there.
The hook now tries, in order: its own sidecar; the main checkout's sidecar
when it runs in a git worktree; the in-repo dist; require.resolve from the
helper's install root and from the helper's own directory; and the CLI's
own dependencies (@claude-flow/cli, directly or under ruflo / claude-flow),
which is where recordMemoryPackagePath() resolves from. Candidates come
from MODULE_ROOT or the helper's directory only, never CLAUDE_PROJECT_DIR.
A candidate is used only if it exports AutoMemoryBridge. import and sync
record the found path in the sidecar, so the next run is fast; status
reports where it resolved but writes nothing. When nothing resolves, the
existing DISABLED warning now lists every place searched and why each
failed. No network, no install.
Co-Authored-By: RuFlo <ruv@ruv.net>
Step 0 of `start all` is now project init, using the exact path
`start quick` uses: isInitialized() (.claude-flow/config.yaml) and, only
when that is false, `init --minimal`. That init call is extracted into
runMinimalProjectInit() and shared by both subcommands, so `quick` keeps
its behaviour and `all` never re-inits an initialized project. A failed
or throwing project init stops the run with exitCode 1 and
failedStep: 'project init'.
runStartAll and its injectable StartAllDeps move to
src/commands/start-all.ts; start.ts is back to 487 lines.
Co-Authored-By: RuFlo <ruv@ruv.net>
CI runs vitest from the repo root, where @claude-flow/mcp is not
resolvable as a package, so the import failed and the file counted as a
new failure in the test ratchet.
Co-Authored-By: RuFlo <ruv@ruv.net>
CI runs vitest from the repo root, where @claude-flow/mcp is not
resolvable as a package, so the import failed and the file counted as a
new failure in the test ratchet.
Co-Authored-By: RuFlo <ruv@ruv.net>
ruflo-federation's one `guard` switch gated both the secret refusal and
the SSN/card refusal, so an operator could not make PII informational
without also dropping secret screening. Add a `piiGuard` userConfig
option (default on: behaviour unchanged) wherever `guard` is declared:
- ruflo-federation 0.4.0: verdict() takes the options; the hasPii refusal
runs only while piiGuard is on. Secrets and input too large to screen
are still refused whenever guard is on.
- ruflo-intelligence 0.5.0: the hooks_transfer EMAIL refusal is gated by
piiGuard; the secret refusal is not. piiGuard joins the status file.
- ruflo-console 0.50.0: the mission screen gets a distinct `secret`
status from the local secret screen (blocks guidance even when
AIDefence is missing); `pii` blocks only while the new piiGuard option
is on, otherwise the finding is reported in a `safe` result's detail.
New tests per plugin: default refuses PII; piiGuard off lets PII-only
text through; a secret is still refused with piiGuard off; guard off
behaves as before.
Co-Authored-By: RuFlo <ruv@ruv.net>
`embeddings init` writes { model, dimension } to .claude-flow/embeddings.json,
but memory init, the AgentDB bridge and the router task embedder all
hardcoded Xenova/all-MiniLM-L6-v2 / 384.
Add src/memory/embedding-config.ts: resolveEmbeddingConfig(root) reads that
file (same schema commands/embeddings.ts writes; bare model names get the
Xenova/ namespace), falls back to MiniLM/384, and warns once on malformed
JSON. resolveEffectiveEmbeddingConfig() additionally checks memory.db and
agentdb-memory.db: if either already holds real vectors of another
dimension, that recorded dimension is kept with one warning; nothing is
mixed or rebuilt. Resolutions are cached per root.
Used by loadLocalEmbeddingChain, fresh vector_indexes seeds, the bridge's
registry init / embedding labels / dimension stub check, and task-embedder.
Co-Authored-By: RuFlo <ruv@ruv.net>
`ruflo start all` initializes the memory database only when it is not
initialized yet (checkMemoryInitialization, then initializeMemoryDatabase
with force: false), starts the worker daemon only when it is not already
running (isDaemonAlive, then the existing `daemon start` action), and then
runs the main start action. It stops at the first failing step and
returns exitCode 1 naming that step. Existing subcommands are unchanged.
The steps are injectable (runStartAll(ctx, deps)) and the tests mock all
of them: fresh project, already-initialized project with a running
daemon, and a failure at each step.
Co-Authored-By: RuFlo <ruv@ruv.net>
agentdb_pattern-search only treated a ReasoningBank result as success when
it had hits. A healthy empty result fell through to the legacy
pattern-namespace fallback and came back degraded:true with
reason "reasoningBank-empty:reasoningBank", so callers that honour
`degraded` stopped although every read completed.
- bridgeSearchPatterns now reports read failures in-band (`error`):
a throwing controller, a non-array controller result, and a failing
reasoning_patterns substring scan. These used to become [] or null.
- The handler returns {results: [], noMatch: true, degraded: false,
controller: 'reasoningBank', searched: [...]} only when ReasoningBank ran
without error AND the legacy semantic, list and hydrate reads all
succeeded with nothing found. scanLimited is set when the namespace
holds more than the 200 entries the substring scan reads.
- A ReasoningBank error stays degraded with reason reasoningBank-error:<msg>.
Legacy list/hydrate failures are now surfaced as listError.
- Legacy hits after an empty ReasoningBank keep the existing labelling;
ReasoningBank hits are returned unchanged.
Co-Authored-By: RuFlo <ruv@ruv.net>
The default/full/enterprise AGENTS.md templates told agents to call
`task_orchestrate` and `benchmark_run`, neither of which is a registered
MCP tool. Replace them with registered tools whose schemas match the
examples: `task_create` (assign/track work), `coordination_orchestrate`
(task coordination), `performance_benchmark` (benchmarks).
Add a CLI test that renders every AGENTS.md and CLAUDE.md template,
extracts every backticked snake_case tool-like name (bare or call form,
hyphens allowed), and checks each against listMCPTools().
Co-Authored-By: RuFlo <ruv@ruv.net>
agent_spawn's input schema limited `model` to five aliases, so a client
that validates against the schema could not pass an exact model id such
as claude-opus-5-5 or openrouter/anthropic/claude-sonnet-5.5, although
the handler already passes non-alias strings through as modelId (#2962).
The enum is now a bounded string (1-256 chars) with an anchored pattern:
letters, digits and . _ : / @ + -, starting with a letter or digit. The
handler applies the same check to `model` and to `config.model` (the
`agent spawn -m` path, which the schema never sees), so whitespace and
shell metacharacters are refused before the agent is stored. Aliases
route as before; exact ids are reported back as modelId.
Co-Authored-By: RuFlo <ruv@ruv.net>
aidefence_learn treated any wasAccurate=false with no threat detected as a
false negative and recorded it as a missed prompt_injection, so marking a PII
detection as inaccurate taught the registry a fake injection. When the scan
found PII and the feedback is PII-related (no threatType, or one naming PII),
nothing is recorded now and the response says why. wasAccurate is documented
as covering threat detection only.
Adds retractKnownMiss(input, threatType, cwd), which removes exactly the
matching hash+type entry through the module's atomic write and leaves the
store untouched when nothing matches, exposed as retract=true on
aidefence_learn.
Co-Authored-By: RuFlo <ruv@ruv.net>
Compact matching dropped every \s+ from a rule and every period from the
text, so CORE-005 (you\s+are\s+now\s+(?!going|about|ready)) became
youarenow(?!...) and matched prose ending a sentence, such as
"a price that fits where you are now." followed by a new line.
- compactSource turns a trailing required \s+ (followed only by
lookarounds) into \s*(?=[^\s.!?,;:]) instead of dropping it.
- The compact text keeps one "." where a stripped run containing a
period ends a line or the text, so the sentence boundary survives.
The dotted, zero-width-joined and camel-cased multiline role switches
from the issue are still detected, as is the plain base-variant case.
Fixes#4715
Co-Authored-By: RuFlo <ruv@ruv.net>
Schema and description metadata only; validation logic and limits are unchanged.
- aidefence_scan.input (#4886): maxLength 10000, description states the
bound is 10000 UTF-16 code units (validateText default) and that JSON
Schema maxLength counts code points.
- agentdb_hierarchical-store.value (#4892): minLength 1, maxLength 10000,
same UTF-16 note. The only input that reaches the "max 100KB" error is
the empty string (validateText refuses >10000 first), so that message
now states the effective 10000-character limit.
- hooks_post-task taskId/agent/parentAgentId (#4887): a pattern
equivalent to cli-core IDENTIFIER_RE, maxLength 128, `not: {enum}` for
the CLI's reserved names, and descriptions saying these are registered
native IDs, not host paths like /root/x. agent's pattern also accepts
'' because the handler treats an empty agent as omitted and the HTTP
transport enforces pattern/minLength at runtime.
Adds __tests__/tool-schema-limits.test.ts, which checks each schema with
ajv and with @claude-flow/mcp's runtime validateSchema against the real
validators and handlers.
Co-Authored-By: RuFlo <ruv@ruv.net>
memory_search_unified:
- searchTime is now elapsed time ("12.34ms"), not a Date.now() timestamp.
- Per-namespace failures (thrown errors and success:false results such as
"Database not found") are returned as namespaceErrors with
namespacesSearched / namespacesFailed counts. success stays true for
partial coverage and is false only when every namespace failed.
- Namespaces are searched concurrently, at most 4 at a time, through a small
in-handler pool. Each search is a read of the same store with no shared
mutable state. Results are slotted by namespace position and flattened in
namespace order before the existing stable sort, so ranking and ordering
match the sequential loop.
Co-Authored-By: RuFlo <ruv@ruv.net>
LocalReasoningBank.flushToDisk() caught write errors such as ENOSPC, logged
them and left the bank dirty, but returned void, so recordTrajectory() still
returned true for patterns that only existed in memory.
- flushToDisk() now returns a boolean: true when persisted or nothing to
write, false when the write failed (state stays dirty). It still never
throws, so the debounce timer path is unchanged. The lock/merge/temp-file
+ rename algorithm is untouched.
- The last flush error and attempt time are recorded and exposed read-only
through getFlushState() and getPersistenceStatus() (dirty, lastFlushError,
lastFlushAt). A successful flush clears the error.
- recordTrajectory() and flushPatterns() return the flush result.
Co-Authored-By: RuFlo <ruv@ruv.net>
writeFileAtomic called writeSync once and ignored the returned byte count,
then fsynced and renamed the temp file over the target. A short write
(allowed by POSIX) published a truncated file and returned success.
Loop on writeSync's return value, advancing the buffer offset and file
position until every byte is written; throw if a call makes no progress.
The fsync, close, rename, chmod, directory fsync and cleanup-on-error
sequence is unchanged.
Fixes#4888
Co-Authored-By: RuFlo <ruv@ruv.net>
QueenCoordinatorConfig declared enableFailover (default true) and
maxDelegationAttempts (default 3), but selectBackupAgents() ignored both
and hardcoded a cap of 2 backups.
selectBackupAgents() now returns no backups when enableFailover is false
and caps backups at max(0, maxDelegationAttempts - 1), counting the
primary as the first attempt. The defaults give 2, so default behavior is
unchanged.
Co-Authored-By: RuFlo <ruv@ruv.net>
- @claude-flow/shared is a registry-resolved leaf of the cli
(audit-leaf-package-publish): a shared version bump has to land in the same
PR as the cli's pin, which belongs to the release lane. Its zod 4 port moves
to a separate PR, and this one leaves shared exactly as on main.
- codex exports VERSION; it now matches package.json 3.0.7
(audit-codex-integration).
- The repo-root test ratchet runs the v3 plugin tests against the root
install, which hoists zod 3. The floor tests now assert the declared range
statically, and run their runtime checks only when the resolved zod
satisfies it, so they still fail on main's source (both checks red) and
skip, rather than test the wrong library, under the root install.
Co-Authored-By: claude-flow <ruv@ruv.net>