Commit Graph
7782 Commits
Author SHA1 Message Date
Rudy Celekli a09464ce46 fix(browser): surface structured CLI errors on nonzero exit 2026-09-25 14:16:52 -04:00
Rudy Celekli 5ad9ceab0c fix(agents): honor configured instructions during execution 2026-09-25 14:14:39 -04:00
Rudy Celekli 982936e2bf fix(mcp): resolve installed CLI before npx fallback 2026-09-25 14:11:04 -04:00
Rudy Celekli 72d2c10c78 fix(graph): report k-hop relation and depth limitations 2026-09-25 14:10:55 -04:00
Rudy Celekli 9ba1cfda75 fix(mcp): prevent late HTTP timeout responses 2026-09-25 14:09:58 -04:00
Rudy Celekli 0702af8158 fix(witness): fail marker-preserving hash drift in strict mode 2026-09-25 14:03:38 -04:00
Rudy Celekli ea4661f815 fix(mcp): enforce opt-in policy in shipped stdio launchers 2026-09-25 14:01:48 -04:00
Rudy Celekli c273b8fc19 fix(workflows): interpolate default step output references 2026-09-25 13:59:54 -04:00
Rudy Celekli 6fc7e9b6bf fix(daemon): bound idle clock to current process start 2026-09-25 13:59:46 -04:00
rUv 88955d9fa9 Merge pull request #3414 from ruvnet/fix/pin-memory-3392
fix(cli): pin @claude-flow/memory exactly and warn in doctor on a stale copy (#3392)
v3.45.0
2026-09-24 23:24:06 +00:00
rUv 64a3f7474f Merge pull request #3413 from ruvnet/fix/test-isolate-home-3370
test(cli): isolate HOME and stub codex in init-kebab-flags-2952 (#3370)
2026-09-24 23:24:02 +00:00
ruv aab1d6258c chore(release): re-sign helpers manifest @ 3.45.0
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-24 18:47:56 -04:00
ruv f998830bfd fix(witness): re-anchor #1825 marker for the exact memory pin and re-sign manifests
#1825 guards against a `workspace:` protocol leak in cli's optionalDependencies
by citing the literal `"@claude-flow/memory": "^3.0.0-alpha.` in
v3/@claude-flow/cli/package.json. #3392 pins that dependency exactly, so the
caret is gone and the marker drifted (witness marker drift smoke, #2021). The
marker is now `"@claude-flow/memory": "3.0.0-alpha.`, which still catches the
`workspace:` leak (that string would not match).

All three manifests were regenerated OS-aware (os field = linux/macos/windows)
with a pristine, unbuilt checkout of the release-bump commit:
- entries whose cited file exists were re-hashed and re-verified (18);
- the 99 entries citing build outputs (dist/) are carried forward unchanged,
  not re-attested, because a source checkout does not contain them: that is
  exactly the set the CI smoke reports as "file-missing (skipped, #1880)".
  The regeneration tool as shipped would mark those 99 unverified, which would
  turn 117 verified into 18 for a reason unrelated to this change.

Both witness smokes pass locally: marker-drift (18 pass, 0 drifted) and
verify-precondition.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-24 18:23:53 -04:00
ruv d921b207e4 chore(release): 3.45.0
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-24 18:22:22 -04:00
ruv a35901de80 fix(cli): make the memory version verdict a warning and the test layout-independent (#3392)
CI's root `npm ci` hoists @claude-flow/memory alpha.21 (a transitive of the
bundled workspace packages), so the loaded copy legitimately differs from the
pin there. A `fail` would make doctor's exit code depend on which copy a
package manager happened to hoist, and it broke the real-resolution test. The
issue asked for a loud warning, not a gate, so the verdict is now `warn`, and
the real-resolution test asserts only the verdict's shape; the version
comparison itself is covered by the pure-function tests.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-24 18:22:06 -04:00
ruv 6ff6fded33 fix(cli): pin @claude-flow/memory exactly and warn in doctor on a stale copy (#3392)
`npx @claude-flow/cli@latest` reuses one npx cache directory across CLI
versions, and npm keeps an already-installed dependency that still satisfies
its range. With memory declared as `^3.0.0-alpha.23`, a cached alpha.24 was
never replaced by alpha.25, so a fix that shipped in both packages (#3390)
only half-applied, with no error and `agentdb_health` still reporting healthy.

- Pin `@claude-flow/memory` to `3.0.0-alpha.25` in both `dependencies` and
  `optionalDependencies` (npm resolves the optional entry; they must agree).
  A stale copy can no longer satisfy the spec, so npm has to replace it.
- `doctor` gains a `@claude-flow/memory version` check that compares the copy
  the CLI actually loads (its own module context, not cwd) against its declared
  range and fails with a cache-clear remediation when they diverge. It runs in
  the default suite, `--component memory` and `--component memory-package`.
- v3/pnpm-lock.yaml: minimal hand edit (importer specifier/version plus one
  new registry snapshot); proven with `pnpm@8 install --frozen-lockfile`
  passing on the new lock and failing on the old one.

Verified by reproduction: with memory alpha.24 already installed, adding the
registry cli@3.44.0 (caret) leaves alpha.24; adding a tarball of this branch
upgrades it to alpha.25.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-24 18:07:54 -04:00
ruv c815ccdeed test(cli): isolate HOME and stub codex in init-kebab-flags-2952 (#3370)
The test spawned the real `init` with only cwd isolated, so a local run
appended the Ruflo block to the developer's ~/.claude/CLAUDE.md, registered
[mcp_servers.ruflo] in ~/.codex/config.toml, and started a
`codex plugin marketplace add` clone that outlived init's 20 s timeout as an
orphan.

Each spawn now gets a throwaway HOME/USERPROFILE/CODEX_HOME and a fail-fast
`codex` stub first on PATH, which init treats as a non-fatal skip.

Verified with a decoy home: before, both files' checksums change; after, both
are byte-identical and no clone process is left behind.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-24 18:04:19 -04:00
rUv abf6da6beb test(security): distinguish direct argv from shell splitting 2026-09-24 06:26:44 +00:00
rUv 2950997f3e test(security): exercise every shipped github-safe helper 2026-09-24 06:23:05 +00:00
rUv f751484900 test(security): align the shipped MCP helper with the hardened copy 2026-09-24 06:23:04 +00:00
ruv 0a96fb8857 chore(release): 3.44.0
Minor: new opt-in router embedder (CLAUDE_FLOW_ROUTER_EMBEDDER=minilm),
router.js becomes a signed critical helper.

- ADR-389: router.js refreshed on upgrade (installs get the #3401 word-boundary fix)
- ADR-390: opt-in MiniLM embedder for hooks_route; default stays hash
- ADR-391: blind 197-prompt corpus + benchmark; first run promotes nothing
- typesafe-router test (e) fixed (was red on main since #3402)

Helpers manifest re-signed @ 3.44.0 — now 5 helpers (router.js added).
No non-bundled leaf changed.

Co-Authored-By: RuFlo <ruv@ruv.net>
v3.44.0
2026-09-23 14:40:54 -04:00
rUv 82dac70fd7 feat(router): ADR-389–391 — refresh router helper, opt-in MiniLM embedder, benchmark gate (no default change) (#3410)
* docs(adr): ADR-389..391 — router: refresh the helper, use the real embedder, change defaults only on a measured win

ADR-389: add router.js to CRITICAL_HELPERS + re-sign, so installed copies get
the word-boundary fix (#3401); today they are frozen at first write.
ADR-390: hooks_route embeds patterns and tasks with the local MiniLM chain
(generateLocalEmbedding), hash embedder as the reported fallback.
ADR-391: frozen, labelled 150-200 prompt corpus; A/B/C/D (current, MiniLM,
typesafe-hash, typesafe-onnx); ADR-150-style AND-gate for promotion.

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

* feat(init): refresh router.js as a critical helper on upgrade (ADR-389, #3401)

Installed copies of .claude/helpers/router.js never received the #2257
word-boundary fix: helper-refresh only re-copies CRITICAL_HELPERS and
router.js was not on the list, so an April substring router kept routing
"sync and review latest issues" to tester.

- helper-refresh.ts: add router.js to CRITICAL_HELPERS; generator
  fallback also emits it (generateAgentRouter).
- sign-helpers.mjs / verify-helpers.mjs / executor.ts executeUpgrade /
  smoke-helper-signing-security.mjs: keep their copies of the list in sync.
- New test: stale April router.js is replaced by the package copy via the
  signed refresh path (throwaway key), after which the prompt no longer
  routes to tester.

helpers.manifest.json is NOT re-signed here. Until it is, verify-helpers
fails ("manifest has no entry for router.js") and the production refresh
is fail-closed blocked for all helpers.

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

* bench(router): ADR-391 labelled evaluation corpus (197 prompts, frozen)

Blind-labelled corpus for comparing routing candidates: 11 labels incl. none,
64 adversarial trap cases, deterministic stratified dev/test split (i%5 in
{0,2} -> dev), dependency-free validator that recomputes the split and prints
the sha256. Frozen at sha256 b0c1923b2813b61907304dff56c53d199b709797bfb9600a7c1f496cf0c0bf04.

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

* feat(hooks): ADR-390 — semantic router can use the real MiniLM embedder

hooks_route compared tasks with pattern keywords using a character hash
(generateSimpleEmbedding), which measures spelling, not meaning. This adds a
router-embedder abstraction (src/ruvector/router-embedder.ts):

- embedForRouter(texts, kind) -> { vectors, embedder: 'minilm'|'hash', reason? }
- MiniLM path uses generateLocalEmbedding ONLY (never the bridge-first
  generateEmbedding, #2312). backend !== 'onnx', a throw, or a non-384-d
  vector degrades EVERY text in the call to the hash, with a reason.
- Selection: CLAUDE_FLOW_ROUTER_EMBEDDER=minilm|hash; DEFAULT_ROUTER_EMBEDDER
  stays 'hash' until ADR-391's benchmark decides.

getSemanticRouter builds both the native VectorDb and pure-JS indexes from one
embedder, records which one actually built the index, embeds the query with
that same embedder, rebuilds when the requested embedder changes, and shares
one in-flight build between concurrent callers. If the query fails on MiniLM
after a MiniLM index was built, the index is rebuilt with the hash so the two
spaces never mix. hooks_route results gain `embedder` (+ `embedderReason` when
degraded); existing fields are unchanged.

routeTaskForBench(task, { embedder }) is an internal, bench-only entry that
runs the same local path as hooks_route (skipping the AgentDB pre-route and
the opt-in typesafe wrapper) for ADR-391.

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

* chore(audit): register CLAUDE_FLOW_ROUTER_EMBEDDER as a known env escape hatch

ADR-390's router embedder selector is process-lifetime MCP router state, like
CLAUDE_FLOW_DISABLE_NATIVE_ROUTER; the ADR-391 bench passes the embedder
explicitly rather than through a CLI flag.

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

* bench(router): ADR-391 first run — no candidate promoted; fix typesafe-router test (e)

Benchmark (run-bench.mjs) on the frozen 197-prompt corpus
(sha256 b0c1923b…), test split n=113:
  A current (hash)   25.7% acc, p95 1.06 ms
  B MiniLM (ADR-390) 36.3% acc, p95 6.21 ms   (+10.6 pts, +485% p95)
  C typesafe hash    26.5% acc, p95 1.20 ms
  D typesafe onnx    29.2% acc, p95 8.35 ms   (raw pick 44.3%, gated to 5.6%)
No candidate passes the ADR-391 AND-gate (B fails the relative latency
bound), so DEFAULT_ROUTER_EMBEDDER stays 'hash' and typesafe stays opt-in.
Receipt committed under benchmarks/router/results/. ADR-391 gains a Results
section with the findings (structural ceiling: no pattern returns
researcher/reviewer/none; latency criterion mis-specified for a ~1 ms base;
typesafe gate too tight) as owner decisions, not applied.

ADR-389 -> Implemented; ADR-390 -> Implemented as opt-in; ADR-391 -> Implemented.

typesafe-router test (e) was red on main since #3402 made the keyword
fallback word-bounded: it still asserted the old "latest"->tester fallback.
It now asserts the typesafe override and that a legacy fallback is kept.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-23 18:39:18 +00:00
ruv 025842bb0f chore(release): 3.43.0
Minor: new opt-in @ruvector/typesafe task router (CLAUDE_FLOW_ROUTER_TYPESAFE=1)
and `doctor --component typesafe`. Ships:

- #3399 @ruvector/router floor ^0.1.31 (HNSW recall@10 0.071 -> 1.000)
- #3406 opt-in typesafe router, removable, falls back to the existing router
- #3402 keyword routers match on word boundaries (#3401)
- #3403 hooks post-task reports observed learning counts (#3353)
- #3400 memory tools reject missing required query/key (#3374)
- #3407 embedder rescue reachable + no silent NULL embeddings (#3375, #3325)
- #3404 writeJsonAtomic retries transient Windows rename errors (#3398)
- #3405 graph-edge-writer releases its native WAL handle (#3397)
- capability brain classifies seraphina_/x_federation_ tools (release gate)

All changes are @claude-flow/cli source or the umbrella's own dependency
range; no non-bundled leaf (cli-core/neural/shared/memory) changed, so no
standalone publish is needed. Helpers manifest re-signed @ 3.43.0 (ADR-174).

Co-Authored-By: RuFlo <ruv@ruv.net>
v3.43.0
2026-09-23 11:00:55 -04:00
ruv c73d127cfe fix(guidance): classify seraphina_* and x_federation_* tools in the capability brain
The stable-release gate `guidance-brain.test.ts › classifies every live
registered MCP tool without duplicates` has been failing on main since the
x.ruv.io federation and Seraphina tools landed: 15 tools
(seraphina_guidance + 14 x_federation_*) only reached a domain through the
runtime-services fallback, which the gate treats as a coverage gap.

- seraphina_ -> guidance domain (it is capability guidance), owner @claude-flow/cli / ruflo-core
- x_federation_ -> AgentBBS & federation domain alongside federation_bbs_, owner @claude-flow/cli / ruflo-x-gateway

guidance-brain + mcp-client-guardrail: 12/12; x-federation + seraphina tool tests 25/25; tsc clean.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-23 11:00:22 -04:00
rUv 7d801171d5 feat(hooks): opt-in @ruvector/typesafe task router (CLAUDE_FLOW_ROUTER_TYPESAFE=1) (#3406)
* feat(hooks): opt-in @ruvector/typesafe task router (CLAUDE_FLOW_ROUTER_TYPESAFE=1)

hooks_route can now ask @ruvector/typesafe (local typed decisions over
sentence embeddings) to pick the agent. Off by default; optional peer;
removable (dynamic import, any load/decide error falls back silently).

- src/ruvector/typesafe-router.ts: adapter. Builds choice options from
  TASK_PATTERNS with not_for hints (tester/reviewer/researcher). Gates:
  abstain <= 0.30, lift (top-1 x options) >= 1.2, top-1 margin >= 0.005,
  all env-tunable. Surfaces routedBy, confidence, abstain, calibrated,
  lift; keeps the built-in pick under fallbackRoute; never copies
  uncalibrated confidence into successProbability.
- hooks-tools.ts: hooks_route handler wrapped; body untouched. With the
  flag unset the legacy result object is returned as-is.
- doctor --component typesafe: install + gate status.
- package.json: @ruvector/typesafe ^0.1.0 as an optional peer.
- USERGUIDE: routing section documents flag, gates, limitations.

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

* chore(lock): record optional peer @ruvector/typesafe in v3 pnpm lockfile

v3 sets autoInstallPeers, so the new optional peer must be recorded in
the cli importer or `pnpm install --frozen-lockfile` fails with
ERR_PNPM_OUTDATED_LOCKFILE (verified: fails without this change, passes
with it).

Minimal: only the @ruvector/typesafe importer + package entries (9 lines).
A full `pnpm install --lockfile-only` would also flip @claude-flow/memory
from the registry build to link:../memory; that changes what CI tests the
CLI against and is left out of this PR deliberately.

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

* fix(doctor): keep 'metaharness)' at the end of the --component help list (smoke 17h anchor)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-23 14:57:45 +00:00
rUv 72e17533ca fix(memory): release graph-edge-writer's native WAL handle so sql.js memory_store isn't refused (#3397) (#3405)
* fix(memory): release graph-edge-writer's native WAL handle so sql.js memory_store isn't refused (#3397)

graph-edge-writer cached its better-sqlite3 WAL handle in a module
singleton for the whole MCP server lifetime; nothing but the test-only
_resetBridgeDb ever closed it. Its -wal/-shm sidecars therefore stayed on
disk forever, and the #2735 sidecar guard (correctly) refused every later
sql.js whole-image write. On Windows, where the native AgentDB bridge is
off by default (#3024), that turned one hooks_post-task into a permanent
memory_store outage for the server.

- getBridgeDb() arms an unref'd idle timer (1s, CLAUDE_FLOW_GRAPH_EDGE_IDLE_MS)
  that checkpoints (TRUNCATE) and closes the handle; re-armed on every use.
- New releaseBridgeDb(dbPath?) is called by memory-initializer right before
  each #2735 guard, so a store immediately after an edge write works and the
  edge is checkpointed into the image sql.js rewrites.
- process 'exit' hook releases the handle so a clean shutdown does not leave
  stale sidecars for the next process. No signal handlers (would change
  Node's default termination).
- The guard itself is unchanged: an open WAL connection makes a whole-image
  write unsafe even in-process until its WAL is checkpointed.

Fixes #3397

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

* chore(audit): register CLAUDE_FLOW_GRAPH_EDGE_IDLE_MS as an env-only tuning knob (ADR-125)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-23 14:57:35 +00:00
rUv 9e71cf66d2 fix(hooks): post-task reports observed learning counts, not placeholders (#3353) (#3403)
hooks_post-task synthesized learningUpdates from the success flag:
patternsUpdated = feedbackResult?.updated || (success ? 2 : 1),
newPatterns = success ? 1 : 0, trajectoryId = traj-${Date.now()}.
With the feedback controller unavailable it still claimed "2 updated,
1 new", and the || turned an observed updated:0 into 2. The direct
recordTrajectory() result was awaited and discarded.

Now patternsUpdated is the controller's observed count (0 when feedback
was not recorded), newPatterns is null (no path reports creation),
trajectoryId is null (no real id exists), and learningUpdates gains
available + reason. A new top-level trajectory.recorded exposes the
recordTrajectory() result. All existing keys are kept. The CLI prints a
'Learning degraded' warning and shows unknown instead of invented values.
2026-09-23 14:57:24 +00:00
rUv 44883dbd1f fix(memory): make the embedder rescue reachable and stop silent NULL embeddings (#3375, #3325) (#3407)
* fix(memory): make the embedder rescue reachable and stop silent NULL embeddings (#3375, #3325)

#3375: generateLocalEmbedding() is documented as bridge-free but loaded its
model through loadEmbeddingModel(), which is bridge-first. With the bridge up,
the local state was recorded as { loaded: true, model: null }, so every call
returned the hash fallback (backend 'mock') and rescueAgentdbEmbedder()'s
backend === 'onnx' probe could never pass. Split out loadLocalEmbeddingChain()
and cache the bridge result separately; generateLocalEmbedding() now loads
only the local chain and never touches agentdb's embedder.

#3325: bridgeStoreEntry embedded only via agentdb's embedder and a bare catch
stored embedding=NULL when it was absent or threw, reporting nothing. Add
embedForBridge(): agentdb first, then the local chain (generateLocalEmbedding,
never the bridge-first generateEmbedding -- #2312), accepting only a real ONNX
vector. Used for both the write and the bridgeSearchEntries query. When no
vector can be produced the result carries embeddingError, and
bridgeStorePattern reports hasEmbedding/embeddingError. Also fix
bridgeGetEntry reporting hasEmbedding:false on every TieredCache hit.

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

* fix(memory): treat a mock-tagged agentdb embedder as no embedder; surface embeddingError in memory_store (#3325)

embedForBridge now honours the same isMock / backend==='mock' signal that
bridgeGenerateEmbedding already uses, so vectors from an embedder the
rescue could not replace are not stored as if they carried meaning; the
local chain is tried instead, and embeddingError is reported if it has no
real model either. storeEntry's type and memory_store's response carry
embeddingError through.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-23 14:52:21 +00:00
rUv 5f3f4df408 fix(policy): retry transient rename failures in writeJsonAtomic, never orphan the temp file (#3398) (#3404)
On Windows, renameSync over .claude-flow/policy/state.json fails with
EPERM/EBUSY/EACCES while another process briefly holds the destination open.
writeJsonAtomic made a single attempt with no cleanup, so the whole MCP call
failed and state.json.<pid>.<uuid>.tmp was left behind.

- Retry transient rename errors with a bounded async backoff (~1.3s total,
  inside the 5s state.lock wait; async so the MCP event loop is not blocked).
- try/finally removes the temp file on any final failure.
- A final failure still fails the call: the state carries the hash-chained
  receipt ledger and consumed approval uses; dropping the write would return
  a phantom receipt and let a one-shot approval be reused.

Fixes #3398
2026-09-23 14:26:50 +00:00
rUv 8080d872ac fix(hooks): match router keywords on word boundaries, not substrings (#3401) (#3402)
suggestAgentsForTask() in hooks-tools.ts used taskLower.includes(keyword),
so 'test' matched "latest" (tester @ 0.95), 'auth' matched "author",
'fix' matched "prefix", 'api' matched "capitalize". It backs
hooks_pre-task and the keyword fallback of hooks_route/hooks_explain.
Precompile \b-anchored matchers with simple inflections instead.

The repo-root .claude/helpers/router.cjs still carried the pre-#2257
substring table at 0.8 confidence; replace it with the word-boundary
router. Add 'testing'/'specs' tester tokens to the generator and its
snapshot copies, and guard the generated CLI block with require.main so
requiring it from hook-handler.cjs doesn't execute it.
2026-09-23 14:26:46 +00:00
rUv 7b4e97a316 fix(memory): reject a missing required query/key at the memory tool boundary (#3374) (#3400)
memory_search declares required: ['query'] but nothing enforced it, and
validateMemoryInput() is truthiness-guarded, so an omitted query passed
validation and reached generateHashEmbedding's text.toLowerCase(), coming
back as "Cannot read properties of undefined (reading 'toLowerCase')".

Add a presence check (non-empty string) at the top of memory_search and
memory_search_unified (query) and memory_store / memory_retrieve /
memory_delete (key). A violation returns the handler's normal error shape
plus code MISSING_REQUIRED_PARAM and an error naming the parameter, and the
memory layer is never called.
2026-09-23 14:24:24 +00:00
rUv b8ad7ddd2e chore(deps): raise @ruvector/router floor to ^0.1.31 (HNSW recall fix) (#3399)
@ruvector/router 0.1.30 builds its HNSW graph keeping only the nearest
candidates per node, so on clustered data no edges cross between clusters
and search returns mostly the most-recently-inserted region. 0.1.31
(ruvnet/RuVector#1005) switches to the diversity heuristic.

Measured in this repo's own install, 3,000 clustered 64-d vectors,
100 queries, recall@10 vs exact cosine:
  0.1.30 -> 0.071
  0.1.31 -> 1.000

Consumers: hooks_route's native semantic router (hooks-tools.ts
getSemanticRouter) and agentdb/agentic-flow, which dedupe to the root copy.
Their own ranges (^0.1.15 / ^0.1.25) already admit 0.1.31, so this raises
the floor and moves the lockfile; v3/pnpm-lock.yaml is left alone because
a transitive-only update there re-resolves unrelated packages.
2026-09-23 14:24:19 +00:00
ruvnetandClaude Opus 5 1116724a65 ci(guard): make the leaf-publish diff check actually run in PR CI
The guard's first real CI run passed but reported:

  NOTE: diff check NOT EXERCISED — could not diff against 'origin/main' (shallow clone?)

So only the range check ran; check 2 — the half that replays #3335/#3390 by
catching a leaf source change with no version bump — sat out entirely. The
NOT EXERCISED note is what made that visible instead of reading as a pass,
which is precisely why a skipped check must never print like a clean one.

Two causes, both fixed:

  - `git fetch --depth=1 origin $GITHUB_BASE_REF` fetches the base tip with no
    shared history, so `base...HEAD` dies with "fatal: no merge base". Now
    fetches --depth=50 with an explicit
    +refs/heads/<base>:refs/remotes/origin/<base> refspec.
  - The script only attempted three-dot. It now falls back to two-dot, which
    needs no common ancestor, and reports which mode actually ran.

Verified against the exact failing condition — an orphan branch with no merge
base against origin/main, where `git diff origin/main...HEAD` returns
"fatal: no merge base": the guard now reports "diff check ran (two-dot ...)"
rather than skipping. NC1 re-confirmed: a leaf source change without a version
bump still fails, now accompanied by "diff check ran (three-dot ...)" proving
the check executed rather than being skipped into a pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 17:20:11 -04:00
ruvnetandClaude Opus 5 f02759cd6d ci(guard): fail when a non-bundled @claude-flow/* leaf changes without a publish
Adds scripts/audit-leaf-package-publish.mjs, wired into v3-ci.yml's existing
audit job (semver is already installed there).

Only four @claude-flow/* components are bundled into the release tarballs —
INTERNAL_RUNTIME_PACKAGES in stage-internal-runtime-bundles.mjs: security,
codex, mcp, plugin-agent-federation. cli-core, neural, shared and memory
resolve from the REGISTRY at whatever v3/@claude-flow/cli/package.json pins, so
a merged source change in one of those does NOT ship with the three-package
train: the release silently carries the last published copy.

This has bitten twice. #3334 fixed RUFLO_INTELLIGENCE_MODE in
@claude-flow/memory; v3.42.1 shipped the train only and a fresh consumer
install had zero references to the fix (#3335). #3390's reasoningBank
activation spanned cli/src/memory/memory-bridge.ts AND
memory/src/controller-registry.ts — publishing only the train would have
shipped the bridge half and left the embedder half unreachable, leaving
reasoningBank exactly as inert as before. It was caught by hand and
memory@3.0.0-alpha.25 went out alongside v3.42.5.

What makes it easy to miss is that CI goes GREEN: the leaf's own package tests
run against workspace source, so the change looks verified while being
unshippable.

The audit asserts:
  1. every non-bundled leaf's workspace version is covered by the CLI's
     declared range (a miss means the release resolves to OLDER code than
     this repo's source);
  2. diff mode — if a leaf's publishable source changed vs the base ref but
     its version did not, fail with remediation.

It imports INTERNAL_RUNTIME_PACKAGES rather than restating it, so the bundled
and non-bundled sets cannot drift apart; exits non-zero if it inspects zero
leaves, so a broken classifier can't report clean; and reports a skipped diff
check as NOT EXERCISED rather than as a pass.

@claude-flow/shared is entered as a time-boxed accepted finding (expires
2026-10-21): the CLI pins 3.0.0-alpha.7 while the workspace is at
3.0.0-alpha.8, which IS published — stale, not unshippable. Raising the pin
edits v3/@claude-flow/cli deps and so forces a pnpm-lock.yaml regen in the same
change (#2540 -> #2552), which wants its own PR. An EXPIRED entry fails the
guard rather than muting it.

Negative-controlled, all four paths:
  - memory source changed, no bump      -> FAIL (replays #3390)
  - same change with a version bump     -> pass
  - test-only change in a leaf          -> pass (not publishable)
  - waiver expiry backdated             -> FAIL, "no longer honoured"

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 16:49:17 -04:00
ruvnetandClaude Opus 5 9c61c86f06 chore(release): re-sign helpers manifest for 3.42.5 (ADR-174)
scripts/verify-helpers.mjs pins the signed manifest to the package version, so
the 3.42.4 -> 3.42.5 bump invalidated it:

  [verify-helpers] manifest version 3.42.4 != package.json 3.42.5

Re-signed the 4 critical helpers (auto-memory-hook.mjs, hook-handler.cjs,
intelligence.cjs, statusline.cjs) with ruflo-helpers-signing-key from GCP
Secret Manager (ruv-dev). Verify now reports:

  [verify-helpers] ok — 4 helpers match signed manifest @ 3.42.5

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 15:42:33 -04:00
ruvnetandClaude Opus 5 9b07e5b789 fix(release): don't build workspaces in the release-audit install step
The v3.42.5 release (run 35641592705) failed at "Install root release-audit
dependencies", 9 steps before any publish. `npm ci --omit=dev --omit=optional`
triggers v3/@claude-flow/security's "prepare": "npm run build" (it is both a
root workspace and a root dependency). That package does not declare
@types/node, relying on a hoist from the root dev tree, so --omit=dev leaves
tsc with no Node types and --omit=optional removes @napi-rs/keyring:

  TS2591: Cannot find name 'crypto' / 'Buffer' / 'process'
  TS2307: Cannot find module '@napi-rs/keyring'

The step only needs `semver` for audit-umbrella-version-lockstep.mjs, so it
should not link or build workspaces. Verified locally against the tagged tree:
the current command reproduces the CI failure exactly; adding --workspaces=false
installs 175 packages and the lockstep audit passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 15:22:54 -04:00
ruvnetandClaude Opus 5 cf9aebf21e chore(release): 3.42.5 + @claude-flow/memory 3.0.0-alpha.25
Ships #3390 (#3327 Finding A). The fix spans two packages and only one of
them rides the release train, so memory is bumped and published alongside:

  - cli/src/memory/memory-bridge.ts      -> @claude-flow/cli 3.42.5 (train)
  - memory/src/controller-registry.ts    -> @claude-flow/memory 3.0.0-alpha.25

Without the memory publish the embedder half of the fix never reaches users
and reasoningBank stays inert, since @claude-flow/memory is NOT in
INTERNAL_RUNTIME_PACKAGES and resolves from the registry via ^3.0.0-alpha.23.

CLAUDE.md: correct the Publishing Rules claim that internal @claude-flow/*
components are all bundled. Only four are (security, codex, mcp,
plugin-agent-federation); cli-core, neural, shared and memory resolve from
the registry and need a standalone publish when their source changes. Adds a
semver-aware pre-tag drift check that fails loudly if it inspects zero leaves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
v3.42.5
2026-09-21 14:52:57 -04:00
rUvandClaude Opus 5 11ce88327b fix(memory): activate reasoningBank — wire the real embedder + correct the bridge contract (#3327 Finding A) (#3390)
Activates reasoningBank end-to-end (#3327 Finding A).

- memory/controller-registry.ts: hand agentdb's ReasoningBank an embedder that
  satisfies its asymmetric embedQuery/embedPassage contract; adapt agentdb's
  mock embedder rather than passing it through; flag the zero-vector stub.
- cli/memory-bridge.ts: call the real storePattern(), map agentdb's
  ReasoningPattern shape (approach/similarity) instead of content/score, and
  record the swallowed error so health can name the cause.

Verified: 77/77 controller-registry tests pass; negative control (new tests vs
main's source) fails 8/9, confirming the tests are load-bearing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 18:50:56 +00:00
rUv 75c43591a6 ci: use supported Node engines for resource admission 2026-09-21 15:01:31 +00:00
rUv 46c88e0b88 ci: run full resource admission benchmark report 2026-09-21 14:59:10 +00:00
rUv a381775b41 test(performance): report baseline and candidate resource admission benchmark 2026-09-21 14:58:56 +00:00
rUv 215e284a51 ci: use supported Node 22 engine for resource admission 2026-09-21 14:58:11 +00:00
rUv 359a49e97f ci: add resource admission validation workflow 2026-09-21 14:55:32 +00:00
rUv 8190574a0f docs: add ADR 400 task conditioned resource admission 2026-09-21 14:55:19 +00:00
rUv 92db002fbc feat(performance): export resource admission policy 2026-09-21 14:54:31 +00:00
rUv 07bf9ff0d9 test(performance): cover resource admission safety and determinism 2026-09-21 14:54:21 +00:00
rUv 3384067b4a feat(performance): add task conditioned resource admission policy 2026-09-21 14:53:46 +00:00
dependabot[bot] 7dabf48f3e chore(deps): bump agentic-flow in /v3/@claude-flow/browser
Bumps [agentic-flow](https://github.com/ruvnet/agentic-flow) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/ruvnet/agentic-flow/releases)
- [Changelog](https://github.com/ruvnet/agentic-flow/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/ruvnet/agentic-flow/commits/v2.1.3)

---
updated-dependencies:
- dependency-name: agentic-flow
  dependency-version: 2.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-21 09:17:47 +00:00
Mr. MakandClaude Opus 5 b02d936935 fix(ci): print the failing assertion, not just the filename, on a ratchet failure (#3208)
The ratchet runs vitest with `--reporter=json --outputFile=…`, so nothing
vitest prints reaches the job log and the only record of an unexpected
failure is the file name. Recovering the assertion means downloading the
`test-results-ubuntu-latest` artifact — and a rerun replaces it, so after a
rerun attempt 1's assertion is gone for good.

The failure messages are already in the report this process parsed. Printing
them costs nothing, needs no new artifact, and survives a rerun, because job
logs are per-attempt.

`formatUnexpectedFailures()` is exported and pure so it unit-tests alongside
`evaluateTestReport()`. Every field it reads is optional by design: a
file-level abort ("No test suite found in file") carries `message` and no
assertions, and a report from another reporter version may carry neither. In
both cases the filename still prints, exactly as before, and the PASS path is
untouched.

Verified against a real failing run rather than a fixture: replaying run
35521170139's `vitest.json` through this script turns

      + v3/@claude-flow/cli/__tests__/memory-search-scores-3327.test.ts

into that same line plus

      ✗ memory_search score contract (#3327 Finding B) preserves standard fallback on import failure
        AssertionError: expected [ { key: 'a', …(5) } ] to deeply equal [ { key: 'a', …(4) } ]

which is the line that would have identified the failure in #3208 without a
second run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KTedGmPKpEdArVBMMn3JaP
2026-09-20 13:49:32 -04:00
Mr. MakandClaude Opus 5 7879ce7fa6 fix(memory): don't serve cached values another process has changed (#3360)
bridgeGetEntry() consults a per-process TieredCache before the database,
and each process only invalidated that cache on its own writes. Several
MCP servers routinely share one store (Claude Code, Codex and Grok each
run `mcp start` against the same .swarm/), so once server B had read a
key, an update or delete made by server A never reached B: B kept
returning the old value (found: true) until its cache entry expired
(5-minute TTL by default, not extended by reads).

Before a cached read, check SQLite's PRAGMA data_version (prepared once
per handle), which changes only when a different connection has
committed to the file, and clear the cache when it moved. Own writes
don't trip it, so hits stay cheap (~1 us added).

Native better-sqlite3 handles only: agentdb's sql.js fallback works on a
private image that never sees other processes' commits, so there is
nothing to detect and it is skipped (isWasm / no inTransaction) rather
than probed. A handle that can't prepare the check is not probed again. A check that
cannot validate the store on one read clears the cache for that read,
leaves the baseline alone and is retried — both when it throws (e.g.
SQLITE_BUSY) and when it answers without a usable number, since neither
is evidence the store is unchanged. The check is fail-open toward the
caller: it can never break the read it guards.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KTedGmPKpEdArVBMMn3JaP
2026-09-20 12:09:15 -04:00