Commit Graph
7782 Commits
Author SHA1 Message Date
rUvandClaude 0e50fe7f57 dream(security): #3043 advisory scanner for untrusted settings.json hooks/allow-rules (evaluated, ACCEPT) (#3044)
* dream(security): #3043 advisory scanner for untrusted settings.json hooks/allow-rules carried forward by ruflo init/--upgrade

mergeSettingsForUpgrade() and writeSettings() both read a target
project's pre-existing .claude/settings.json and spread its hooks /
permissions.allow entries into the merged output verbatim — the same
trust shape as CVE-2025-59536 (settings.json hook payload achieving
command execution with no review step), reached via ruflo init's own
merge logic rather than Claude Code's loader. Neither of last night's
flagged CVEs (2025-59536, 2025-6514) applies to Ruflo's own hook
dispatch or OAuth client directly, but this distinct gap in the same
family was genuinely unaddressed.

Adds a static, advisory-only (non-blocking) scanner that inspects
hook commands and Bash allow-rules for known-dangerous patterns
before the merge and surfaces findings as CLI warnings. Merge/write
behavior itself is completely unchanged. Hardened after an
independent adversarial-critic pass found 6 concrete bypasses
(intermediate-pipe-stage downloads, two-step download+exec,
eval-wrapped base64, interpreter-mediated dangerous commands,
absolute-path-prefixed commands, whitespace-evasive allow rules) —
all fixed and pinned as a held-out regression set. Also fixes an
ANSI/control-character injection risk in the warning output itself,
self-identified during review.

87/87 relevant tests green (1 pre-existing environmental failure
elsewhere in the package, unrelated — unbuilt sibling package).

Dream Cycle 2026-08-16, security surface. Full research, evaluation
receipts, and adversarial critique: issue #3043 and
docs/dream-cycle/dream-gist-2026-08-16.md.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01NVdeUqt73Bv7vnPxYpZy7i

* docs(dream-cycle): update ledger — backfill 2026-08-14/2026-08-15, add 2026-08-16

2026-08-14 (swarm, REJECT) and 2026-08-15 (performance, REJECT) both had
fully-run pipelines whose live ledger rows never reached main (every
dream-cycle PR to date is unmerged, so branch-local ledger commits never
merge forward) — verified via git ls-remote / search_pull_requests before
backfilling, not assumed.

2026-08-16 (security, ACCEPT): advisory scanner for untrusted settings.json
hooks/allow-rules carried forward by ruflo init/--upgrade. Issue #3043,
PR #3044.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01NVdeUqt73Bv7vnPxYpZy7i

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-21 10:39:22 -04:00
Wu Shuwen 02eae9c117 fix(hooks): persist real session-end state (#3077) 2026-08-21 10:39:19 -04:00
Wu Shuwen f7aab68602 fix: resolve Claude Code launches on Windows (#3076)
* fix: launch Claude Code from Windows npm installs

* test: use Windows path semantics in resolver
2026-08-21 10:39:15 -04:00
Wu Shuwen 3a1b2257fb fix(cli): honor MCP tool selection when listing (#3060) 2026-08-21 10:39:12 -04:00
rUv 703e7741d7 fix(memory): #3051 memory_store tags lost via write-through cache (3.38.14) (#3079)
Root cause: bridgeStoreEntry's post-write cache set stored only a partial
entry shape — { id, key, namespace, content, embedding } — with no `tags`,
no timestamps, no metadata, no access_count. The DB row itself had the
tags JSON-serialized correctly. But any subsequent bridgeGetEntry hit the
cache first and returned `tags: cached.tags || []` = `[]`, so
`memory_store({ tags })` → `memory_retrieve()` looked like it silently
dropped tags.

Fix: replace the partial write-through with cache invalidation. The next
read then re-fetches the row via the DB reader (which correctly parses
the tags JSON column) and repopulates the cache from the full shape.
Cleaner than expanding the write-through payload — future entry-shape
fields don't need to remember to update the cache-write signature.

Regression test verifies: store {tags:[a,b,c]} → get returns {tags:[a,b,c]}.
Proven to catch the bug: pre-fix the test fails (tags: [] returned);
post-fix it passes.

The same defect would have caused reads to see access_count stuck at 0
and drifted createdAt/updatedAt timestamps from the moment the cache
was first populated until eviction; cache invalidation fixes those too.

Release
- Bumps @claude-flow/cli, claude-flow, ruflo: 3.38.13 → 3.38.14 (PATCH).


Claude-Session: https://claude.ai/code/session_0118jMsYhwHD5dx2vStENsEB
v3.38.14
2026-08-21 10:30:08 -04:00
rUv 0f3c45101b fix: address #3045 #3064 #3065 + new ruflo-deepseek-harness plugin (3.38.13) (#3078)
Bug fixes
- #3045 statusline.cjs: getGitInfo() runs the 5-command git chain per render;
  on large repos with concurrent Claude Code sessions this queued subprocesses
  faster than they finished (reporter observed hundreds of orphan children +
  load-avg in the hundreds). Added a per-cwd tmp file cache with 5s TTL —
  dirty status still feels live, pileup is bounded.

- #3064 hooks post-task: the narrow ad-hoc regex /^[a-zA-Z0-9_-]+$/ silently
  dropped every colon-namespaced plugin agent (ruflo-core:reviewer,
  feature-dev:code-explorer, ...) — i.e. every Claude Code plugin agent. The
  canonical validateIdentifier() upstream already allows ':' and '.', so the
  redundant regex is removed. Regression test locks in 4 agent-shape cases,
  proven to catch the bug: 2 pass / 2 fail on revert, 4 pass with fix.

- #3065 harness-gepa SKILL.md: unquoted colon in `description` broke YAML
  parsing in `npx skills add`. Quoted the description; rephrased the bare
  "(default:" to avoid the leading colon.

New plugin: ruflo-deepseek-harness
- plugins/ruflo-deepseek-harness/: sibling to ruflo-metaharness (ADR-150
  shape). Two skills: `deepseek-chat` (non-reasoning) and `deepseek-reason`
  (surfaces reasoning_content separately). Reads DEEPSEEK_API_KEY from env;
  degrades gracefully (exit 0 with `{status: 'degraded', reason, hint}`)
  when the key is missing or the API is unreachable. `--alert-on-error`
  flag opts into hard exit 1 for CI gates. Smoke-tested locally.

Release
- Bump @claude-flow/cli, claude-flow, ruflo: 3.38.12 → 3.38.13 (PATCH:
  bug fixes; the new plugin is scaffolding under plugins/ and not part of
  the npm-published CLI packages).

Not fixed
- #3051 memory_store tags: current source's memory_store handler passes
  tags straight through to storeEntry; a maintainer already verified live
  round-trip works on fa13ee4ad. Reporter has not yet supplied the
  ruflo/@claude-flow/cli version that hosted the affected MCP server,
  so the affected release path is unknown. Left as-is pending that reply.


Claude-Session: https://claude.ai/code/session_0118jMsYhwHD5dx2vStENsEB
v3.38.13
2026-08-21 10:10:13 -04:00
rUv df0c982198 Merge pull request #3067 from ruvnet/feat/pir-322c-contract-spec
docs(spec): witness/receipt contract extracted from ADR-322C (PIR, ruflo#3066)
2026-08-20 08:38:01 -04:00
ruv 34f11dbd46 docs(spec): bound signatureBase64 to the exact Ed25519 base64 length
The receipt and anchor-record schemas accepted any length of base64
(^[A-Za-z0-9+/]+={0,2}$), so oversized garbage passed structural
validation. An Ed25519 signature is exactly 64 bytes — 88 base64
characters with two padding chars — so the pattern is now
^[A-Za-z0-9+/]{86}==$, consistent with the fixed-width contentId and
seedHex patterns elsewhere in the schemas. The promotion-commit schema
carries no signature field (commits are unsigned in ADR-322C) and is
unchanged.

All four example fixtures re-validated against the tightened schemas
with Ajv 2020 strict; a 4KB-garbage-signature negative control is now
rejected.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012Jib2gQyJpqCoo2xYAbb4X
2026-08-20 08:37:26 -04:00
rUv e43f8b9750 Merge pull request #3073 from ruvnet/fix/322c-receipt-roundtrip
fix(flywheel): compute receipt statistics from encoded scale-12 values — honest receipts no longer fail their own verifier (ruflo#3072)
2026-08-20 08:33:49 -04:00
rUv 15a4aac1f2 Merge pull request #3070 from ruvnet/fix/322c-reject-unknown-fields
fix(flywheel): reject unknown fields in receipt and commit verification (ruflo#3068)
2026-08-20 08:33:08 -04:00
ruv a38647e1f9 fix(flywheel): compute receipt statistics from encoded scale-12 values (ruflo#3072)
createFlywheelReceipt ran the bootstrap over full-precision score/delta
doubles while the payload stored them as scale-12 decimal strings, and
verifyFlywheelReceipt recomputes from those strings — the only values a
verifier ever has. Any input that does not terminate within twelve
decimals (e.g. a corpus mean of 0.7687083333333332, stored as
"0.768708333333") shifted relativeLift by one ULP on re-decode, so an
honest, correctly signed receipt failed its own verification with
"statistical decision does not recompute" — indistinguishable from
tampering.

Encode baselineScore, candidateScore, heldOutDeltas, and
frozenAnchorRegression first and feed the decoded encoded values into
computePromotionStatistics, making producer and verifier bit-identical
by construction. This implements the ADR-322C amendment in #3067: the
statistical decision is computed from the encoded values of record.

Regression test at the reproduction mean fails against the previous
producer and passes with the fix.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012Jib2gQyJpqCoo2xYAbb4X
2026-08-20 08:24:06 -04:00
ruvandclaude-flow 7d0bb9c53b fix(flywheel): reject unknown fields in receipt and commit verification
ADR-322C requires that unknown fields fail verification for a given schema
version. verifyFlywheelReceipt did not enforce it: a signature is valid
over whatever the producer canonicalized, so a producer-emitted field the
contract never defined verified cleanly. Enforcement lived only in
out-of-band JSON Schema validation, which is a step a consumer may or may
not run, while verifyFlywheelReceipt is what every consumer calls.

This matters now because rvm#35 and autogenous#10 are about to anchor
promotion receipts into a witness chain and verify them across repo
boundaries; a permissive verifier makes the anchor silently permissive too.

Closes the class, not just the instance. verifyFlywheelLedger had the same
weakness - a commit hashes consistently over whatever fields it carries, so
an undefined field chained cleanly - and now runs the same check.

Contract-open objects stay open, with a test pinning that: candidatePolicy
is owned by policySchemaVersion, gates is a caller-named term map, and
evidence.verification / evidence.canary carry evidence-specific payloads.

Errors read "unknown field: <path>" so a caller can tell an unrecognized
field from a tampered one, per the issue's triage requirement.

Both regression tests were confirmed to fail with the checks disabled and
pass with them enabled. Full flywheel suite: 37 passed (receipt 10,
transaction 11, proposer 6, sequential-evidence 10).

Strictness is versioned: a v1 verifier will reject a future receipt that
adds fields. That is correct fail-closed behavior for a security property,
and is now stated in ADR-322C's Update section (see #3069, PR #3067) so
consumers plan for it rather than discover it.

Refs #3068

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-08-19 22:07:22 -04:00
ruvandclaude-flow 66fbe7ce12 docs(adr): make ADR-322C recomputation reproducible from the spec alone
Closes the gap raised by ruflo#3069: ADR-322C required independent
statistical recomputation but specified only the bootstrap seed, not the
generator it drives. A verifier could not reproduce a receipt's statistics
from the document - the only way to recompute correctly was to read
flywheel-receipt.ts, which is a copy rather than an independent check.

Appends an "Update (2026-08-19)" section per this repo's ADR convention
(ADR-380) rather than editing the text above. It makes normative: the LCG
and its constants, the seeding rule and exact byte slice, the resampling
procedure and draw order, the quantile rule, tie/edge cases, and the
scale-12 decimal encoding the statistics must reproduce byte-for-byte. It
also records the ledger divergence (flat unsigned commits[] on main vs the
content-addressed segments and signed head the ADR describes, with
flywheel-ledger-head/v1 unused), the disabled projection path, and that
strictness is versioned.

Acceptance is demonstrated, not asserted: conformance/recompute_reference.py
is written only from the amendment prose, in a different language from the
reference implementation, and reproduces the fixture exactly.

Adds receipt-bootstrap-reference.example.json because the existing example
turned out not to discriminate - its deltas take two distinct values, so a
wrong seed slice, wrong byte order, or entirely different LCG constants all
yield the same 2.5th percentile. The new fixture has heterogeneous deltas
and separates all three.

Records one defect found while building it (gap G5): createFlywheelReceipt
computes statistics from full-precision means while storing scale-12
strings, so a receipt whose mean needs more than twelve decimals fails its
own verifyFlywheelReceipt. Reproduced at mean 0.7687083333333332. Existing
fixtures use exactly-representable means, which is why it was not caught.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-08-19 22:01:21 -04:00
ruvandclaude-flow a914ebdc69 docs(spec): witness/receipt contract extracted from ADR-322C
Makes ADR-322C's verification protocol consumable as a cross-repo
witness/promotion contract without reading ruflo source, for
ruvnet/rvm#35, ruvnet/autogenous#10, and ruvnet/RuVector#840.

Extraction only - no new decisions. Every normative statement cites
ADR-322/322A/322C/381 or the implementing source. Adds:

- v3/docs/spec/witness-receipt-contract.md: record types, JCS
  canonicalization, identity derivation, signature construction with
  domain prefixes byte-exact, evidence grades, step-by-step verification,
  versioning, and the per-epoch alpha-ledger caveat.
- v3/docs/spec/schemas/: draft 2020-12 schemas for the receipt and
  promotion commit, plus a PROPOSED-EXTENSION anchor record.
- v3/docs/spec/examples/: fixtures generated by running
  flywheel-receipt.ts itself, so the signature and content IDs are real.
- v3/docs/spec/conformance-checklist.md: testable criteria for consumers.

Four gaps between ADR-322C and main are recorded rather than papered over:
the bootstrap PRNG lives only in source (G1); the signed ledger head under
ruflo/flywheel-ledger-head/v1 is specified but unimplemented, the chain is
an unsigned SHA-256 chain (G2); verifyFlywheelReceipt has no unknown-field
whitelist, so a producer-emitted unknown field verifies - the schemas'
additionalProperties:false is the only enforcement (G3); and Flywheel
projection stays disabled (G4).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-08-19 21:37:11 -04:00
rUv fa13ee4ad6 feat(watermark): add browser/Deno ESM entry (@claude-flow/watermark 0.2.0) (#3041)
Adds a `@claude-flow/watermark/web` ESM entry (wasm-pack `--target web`) so the
package works in browsers, Deno, and bundlers — not just Node. Instantiate once
with `await init()` (auto-fetches the wasm in a browser; accepts bytes/URL/
Response), then the same ergonomic API (Watermarker, detect, detectSelfSync,
detectExact) as the Node build.

- package.json: conditional exports (`.` = Node CJS/ESM, `./web` = browser ESM,
  `./package.json` re-exported); web/ marked ESM via a nested package.json.
- build:wasm now builds both nodejs and web targets.
- Added test/smoke-web.mjs; `npm test` runs Node + web. Both verified, plus a
  fresh dual-entry tarball install (node z=64.7, web z=64.7).

Bumps to 0.2.0 (new capability, backward-compatible). No removal tooling.


Claude-Session: https://claude.ai/code/session_01VYDa3Hah5VJLS2ceEuTLKz
2026-08-15 19:18:24 -04:00
rUv 72fb129397 feat(watermark): @claude-flow/watermark npm package (WASM bindings) (#3040)
Widens the ruflo-watermark WASM surface (src/wasm.rs) to select schemes by
name ("tournament" | "tournament_nd" | "gumbel") and adds the indel-robust
self-sync and exact-Gamma short-text detectors to the bindings.

Adds v3/@claude-flow/watermark: a Node (CommonJS) npm package wrapping the
wasm-pack-generated bindings behind an ergonomic API (Watermarker, detect,
detectSelfSync, detectExact), with a clean .d.ts, a committed 37KB .wasm so
`npm install` needs no Rust toolchain, a regenerate script (build:wasm), a
README, and a smoke test. Verified: all 3 schemes generate+detect, wrong-key
and null streams rejected, and the specialized detectors fire — both in-repo
and from a fresh tarball install.

No watermark-removal tooling is exposed.


Claude-Session: https://claude.ai/code/session_01VYDa3Hah5VJLS2ceEuTLKz
2026-08-15 17:23:30 -04:00
rUv f7d27c3627 feat(watermark): SynthID-Text-style LLM text watermarking crate (Rust/WASM) (#3039)
Adds v3/crates/ruflo-watermark: a self-contained, model-agnostic crate for
LLM text watermarking (generation + detection) in the SynthID-Text / Aaronson
family, plus a robustness-evaluation harness and a governed un-marked path.

Schemes (all keyed on token id so detection needs no candidate set):
- Tournament (SynthID-Text, Nature 2024) — strong, mildly distortionary.
- TournamentNd — key-averaged non-distortionary (measured <0.3% drift).
- Gumbel (Aaronson/Kuditipudi exponential-min) — per-instance distortion-free.

Detection: closed-form (Binomial/Gamma) z/p with a stable erfc + log10 tail;
plus bayes.rs (exact Gamma-tail + Higher Criticism for short/sparse texts);
plus align.rs self-sync detector that closes the indel-robustness gap (the real
failure was repeated-context masking desync in low-entropy text, not the
position lock — measured, documented honestly).

evolve.rs: a Darwin/flywheel-methodology tuner (bounded gens x children, frozen
fitness, retained lineage, no auto-promotion) for the alignment detector, with
held-out re-evaluation to de-bias the winner's-curse in the promotion check
(a fix prompted by ADR-384's own adversarial review).

robustness.rs: substitution/deletion/insertion/paraphrase attacks + an adaptive
worst-case attack (proven to beat uniform editing at equal budget). Measurement
only — reports detection statistics, never laundered text.

unmarked.rs: authorized un-marked GENERATION (never post-hoc stripping) — an
unforgeable authorization MAC, mandatory provenance disclosure to finish, and a
loud audit record on undisclosed abandonment. Structurally cannot target
third-party marked text.

WASM bindings (--features wasm), criterion benches, 46 tests. Deliberately does
NOT include a watermark-removal/laundering tool.

Docs: ADR-383 (this crate) and ADR-384 (generalized bounded-evolution
methodology with error-control proof, from a multi-agent design workflow).


Claude-Session: https://claude.ai/code/session_01VYDa3Hah5VJLS2ceEuTLKz
2026-08-15 16:52:47 -04:00
rUv 44b9dad1fe fix(release): enforce CI and idle assignment safety (#3037)
Closes #3030 and #3031.
v3.38.12
2026-08-15 11:33:50 -04:00
ruv 693385eab0 test(ci): keep safety guard root-compatible 2026-08-15 11:23:26 -04:00
ruv 13cbd697db fix(release): enforce CI and idle assignment safety 2026-08-15 11:14:06 -04:00
rUv 45e65b5dae release: align bundled runtime metadata for 3.38.11 (#3032)
release: align bundled runtime metadata for 3.38.11
v3.38.11
2026-08-14 19:30:39 -04:00
ruv 21f7c0adb8 fix(release): align bundled runtime metadata 2026-08-14 19:21:33 -04:00
rUv 4384c0f3a3 release: prepare stable 3.38.10 train (#3029)
release: prepare stable 3.38.10 train
v3.38.10
2026-08-14 19:13:48 -04:00
ruv 392e71912e fix(mcp): rate-limit authenticated HTTP routes 2026-08-14 19:04:54 -04:00
ruv 2ec82b0cd1 chore(release): prepare stable 3.38.10 train 2026-08-14 17:35:47 -04:00
ruv b9a5077292 test(cli): model atomic fs operations in MCP suite 2026-08-14 17:35:36 -04:00
ruv 3f285bfb26 fix(memory): disable unsafe native bridge on Windows (#3024) 2026-08-14 17:16:05 -04:00
dajiaohuang 5c676fe242 fix(doctor): report missing native sqlite bindings 2026-08-14 17:10:34 -04:00
dajiaohuang 40affb83fe fix(ruvocal): keep hidden-tab streams responsive 2026-08-14 17:10:34 -04:00
dajiaohuang 6b8f0d0b5a fix(mcp): share state across HTTP transports 2026-08-14 17:10:34 -04:00
dajiaohuang 2dbb790a0b fix(mcp): restore HTTP protocol and CLI tools 2026-08-14 17:10:34 -04:00
dajiaohuang fa11ee8c24 fix(cli): honor helper refresh opt-out before locking 2026-08-14 17:10:34 -04:00
dajiaohuang 0c73bab4d0 fix(cli): serialize helper refreshes across processes 2026-08-14 17:10:34 -04:00
rUv 4dcff48348 fix: correct CLAUDECODE env detection and neural-tools source label (#3028)
doctor.ts's API-key health check tested process.env.CLAUDE_CODE, but
Claude Code actually sets CLAUDECODE (no underscore) — the check could
never detect a real Claude Code session via that variable. Add the
correct CLAUDECODE check alongside the existing fallbacks (#3023).

getNeuralStoreStats() in neural-tools.ts always reads/writes
.claude-flow/neural/models.json but self-reported its source as
patterns.json — a separate file owned by the ReasoningBank store in
memory/intelligence.ts. Corrected the label and removed the unused
PATTERNS_FILE constant that caused the confusion (#3025).

Fixes #3023, Fixes #3025
2026-08-14 11:39:43 -04:00
ruflo-bot 01bece31c8 chore(data): clone snapshot #12 — 0 clones (14d)
Auto-generated by .github/workflows/clone-tracker.yml.
Source: GitHub Traffic API (14-day rolling window).

Co-Authored-By: ruflo-bot <ruflo-bot@users.noreply.github.com>
2026-08-14 06:47:20 +00:00
Dragan SpiridonovandRuFlo 3030924f22 fix(security): compare candidate and prefix in the same canonical form (#3011)
* fix(security): compare candidate and prefix in the same canonical form (#3010)

`validate()` resolved the candidate with `fs.realpath` but the allowed
prefixes were only `path.resolve()`d, so the two sides were compared in
different forms and nothing under a prefix reached through a symlink could
ever match. On macOS that is every temp directory — `os.tmpdir()` is
`/var/folders/...` and `/var` is a symlink to `/private/var` — so
`ruflo proxy install` rejected the binary it had just signature-verified.
Linux is unaffected because `/tmp` is real, which is why CI stayed green.

Keep both forms of every prefix and compare against the one matching how
the candidate was resolved. Canonicalizing the prefixes outright would have
broken `validateSync()` / `isWithinAllowed()`, which are documented as
lexical-only, in the mirror direction.

When the candidate's leaf does not exist, canonicalize its longest existing
ancestor instead of falling back to the lexical path — otherwise
`allowNonExistent` (the default) would regress under a symlinked prefix.
That also closes a hole this exposed: `<allowed>/escape/not-written-yet`,
where `escape` symlinks outside the prefix, was previously accepted because
`realpath` threw ENOENT on the missing leaf.

Escapes stay blocked, and the regression tests construct the symlink
explicitly rather than relying on the macOS quirk, so they hold on every
platform. 3 of the 6 fail without this change.

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

* fix(security): keep root prefixes usable and leave strict results untouched

Three defects found by an adversarial review of the previous commit.

`allowNonExistent: false` was still canonicalizing the candidate on ENOENT.
The call already fails, so the only effect was rewriting the `resolvedPath`
and `matchedPrefix` reported back — a silent shape change for any caller
reading those off a rejected result. Canonicalize only when non-existent
paths are actually allowed.

A root prefix (`/`, `C:\`, a UNC share root) already ends in a separator, so
anchoring the boundary as `prefix + path.sep` searched for `//` and rejected
every descendant. Pre-existing at all three comparison sites — this change
only widened how a prefix can end up being a root, since one can now
canonicalize to it. Extracted `isWithinPrefix`, which keeps the boundary
anchored so `/srv/app-secrets` is still outside `/srv/app`.

The guarded symlink tests returned early instead of skipping, so they
reported as passed on a host that cannot create links, and the flag was
never reset between cases. They now skip properly and reset per case.

Also documents that prefixes are canonicalized once, at construction: the
allowlist keeps denoting what it named when configured, rather than handing
whoever can rewrite a link the ability to redirect it later.

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

---------

Co-authored-by: RuFlo <ruv@ruv.net>
2026-08-13 17:02:17 -04:00
dependabot[bot] 761dfcaa6d chore(deps): bump agentic-flow in /v3/@claude-flow/browser (#2907)
Bumps [agentic-flow](https://github.com/ruvnet/agentic-flow) from 2.0.13 to 2.1.2.
- [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)

---
updated-dependencies:
- dependency-name: agentic-flow
  dependency-version: 2.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-13 17:02:07 -04:00
rUv abf26ab097 docs(dream-cycle): seed LEDGER.md with backfilled history + v2 routine update (#3018)
The Ruflo Nightly Dream Cycle cloud routine (trig_01HpEqAcEP7wzrxy3TzakrQ2)
was updated to v2: parallel research via the Task tool, claude-sonnet-5,
expanded toolset (TodoWrite/Skill/MultiEdit/BashOutput/KillBash), and a new
STEP 3.5 that attempts a real Flywheel evaluation (metaharness bench/evolve)
for harness-shaped findings instead of always stopping at a docs-only PR.

This file is the durable cross-night memory the new STEP 1 reads before
touching gh at all -- a fresh cloud checkout otherwise has zero continuity
beyond a gh issue list grep, which is what v1 relied on for 80 nights.

Backfilled from the full issue history: 4 shipped (5%), 1 rejected, 75
(94%) never touched, some >2.5 months stale. v2 uses this to bias toward
attempting evaluation over another research-only proposal when the
trailing merge rate is 0.
2026-08-13 10:20:46 -04:00
ruv cc5d9c5fe7 chore(release): bump to 3.38.9 — path-validator symlinked-prefix fix v3.38.9 2026-08-13 08:41:11 -04:00
rUv c1e8e0c41f fix(security): realpath allowed prefixes so a symlinked prefix isn't rejected (#3010) (#3013)
PathValidator.validate() canonicalizes the candidate path through
fs.realpath (when resolveSymlinks is on, the default), but the constructor
only ever path.resolve()d the allowed prefixes — never realpath'd them. On
any platform where a prefix is itself reached through a symlink (e.g.
macOS os.tmpdir() under /var, itself a symlink to /private/var), the
realpath'd candidate can never match the non-realpath'd prefix, and every
path under that prefix — including the prefix's own contents — is
rejected as "outside allowed directories".

This broke `ruflo proxy install` on macOS: the download and Ed25519
signature verification both succeed, then the defense-in-depth path check
in proxy/install.ts fails on the extracted binary, which lives under a
workDir created via os.tmpdir().

Fix: realpath the prefixes at construction time too, with the same
ENOENT-tolerant fallback to path.resolve() that validate() already uses
for candidates (a prefix directory that doesn't exist yet degrades
gracefully instead of throwing).
2026-08-13 08:36:25 -04:00
ruv 5efd5937e5 chore(release): bump to 3.38.8 — provider/model config propagation fix (#2962)
Co-Authored-By: RuFlo <ruv@ruv.net>
v3.38.8
2026-08-12 18:30:46 -04:00
rUv 1e24bb8878 fix(agent): propagate explicit provider/model config into agent execution (#2962) (#3007)
* fix(agent): propagate explicit provider/model config into agent execution (#2962)

`providers configure` and `agent spawn --provider/--model` persisted user
intent but the execution path (callAnthropicMessages, executeAgentTask,
determineAgentModel) only ever consulted env vars and a 5-alias model list,
silently discarding both. A local Ollama/OpenRouter setup with explicit
config would either fail closed or fall back to whatever provider the
env vars happened to select.

- determineAgentModel(): treat any non-alias config.model string as an
  explicit selection via the existing modelId fast-path, instead of
  falling through to task-based routing / agent-type defaults.
- agent_spawn: forward config.provider to the stored (and returned) agent
  record when it's an unambiguous explicit choice ('ollama'/'openrouter';
  'anthropic' is excluded since the CLI silently defaults to it when
  --provider isn't passed).
- callAnthropicMessages(): accept an optional provider param and consult
  the persisted `agents.providers` config for baseUrl/apiKey/model when
  env vars are absent. A self-hosted Ollama baseUrl no longer requires
  the undocumented OLLAMA_API_KEY='local' sentinel.
- executeAgentTask(): forward agent.provider into the first dispatch call.

Precedence: explicit per-agent flag > env vars > persisted config >
key-presence inference (unchanged, last resort).

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

* fix(ci): update #2042 smoke to match the widened OpenRouter branch shape

The #2042 regression smoke statically matched the literal token sequence
`useOpenRouter && openrouterKey`. #2962 widened that condition to
`if (useOpenRouter) { const apiKey = openrouterKey || persistedOpenRouter?.apiKey; ... }`
so a persisted `agents.providers` config can supply the key when no env
var is set — the smoke's ordering guarantee (OpenRouter branch reachable
before the Anthropic-key early-return) still holds, only the literal
pattern needed updating.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-08-12 18:28:25 -04:00
ruv 0d9a4f7e85 chore(release): bump to 3.38.7 — HNSW status honesty fix, cache-fingerprint follow-up v3.38.7 2026-08-12 17:48:11 -04:00
rUv 57c0fcba98 fix(memory): stop misreporting bridge brute-force search as HNSW-accelerated (#3006)
* fix(intelligence): stamp contentFingerprint in consolidate()'s graph write too

consolidate() (the session-end path) rebuilt graph-state.json unconditionally
per the #2920 fix in v3.38.6, but its write never included the
contentFingerprint field that init()'s cache-hit gate checks — only init()'s
own write set it. So every init() immediately following a consolidate saw
nodeCount match but contentFingerprint undefined !== a real hash, missed the
cache, and did a full rebuild even with zero content changes. Fail direction
was safe (extra rebuilds, never stale data) so it didn't block the v3.38.6
release, but it meant the 60s graph cache never actually fired across a
consolidate/restart boundary.

* fix(memory): stop misreporting bridge brute-force search as HNSW-accelerated (#2922)

getHNSWStatus() reported `available: true` whenever the AgentDB v3 bridge
was loaded, on the theory that "AgentDB v3 is HNSW-equivalent" — but the
bridge's actual default search path is a full-table SELECT + brute-force
cosine similarity loop over every embedding row. It never touches
@ruvector/core or an HNSW index, regardless of whether ruvector-core is
installed and resolvable. Same issue in bridgeGetHNSWStatus (unconditional
available: true) and in three misleadingly-named functions that do no HNSW
work at all: bridgeSearchHNSW, bridgeAddToHNSW, bridgeGetHNSWStatus.

- getHNSWStatus(): available=false + new algorithm field
  ('hnsw' | 'brute-force-cosine') when the bridge is the active path,
  instead of a blanket available=true that implied acceleration that
  was never in the request path.
- memory-bridge.ts: bridgeGetHNSWStatus -> bridgeGetVectorSearchStatus
  (adds algorithm: 'brute-force-cosine' to its return shape),
  bridgeSearchHNSW -> bridgeSearchBruteForceCosine,
  bridgeAddToHNSW -> bridgeAddEmbedding. No behavior change — call sites
  updated in memory-initializer.ts, no other source callers existed.
- memory-tools.ts: the `backend: 'sql.js + HNSW'` field on 7 MCP tool
  responses (memory_store, memory_retrieve, memory_search, etc.) was a
  hardcoded literal regardless of which path actually ran. Replaced with
  describeBackend(), which reports the real algorithm via the fixed
  getHNSWStatus() probe.

Actually wiring AgentDBBackend's HNSW into the bridge's default search
path (the issue's broader architectural question) is out of scope here —
this fixes the status/naming layer lying about what's already true, not
the search path itself.
2026-08-12 17:40:19 -04:00
rUv c0c3ab071a fix(intelligence): stamp contentFingerprint in consolidate()'s graph write too (#3003)
consolidate() (the session-end path) rebuilt graph-state.json unconditionally
per the #2920 fix in v3.38.6, but its write never included the
contentFingerprint field that init()'s cache-hit gate checks — only init()'s
own write set it. So every init() immediately following a consolidate saw
nodeCount match but contentFingerprint undefined !== a real hash, missed the
cache, and did a full rebuild even with zero content changes. Fail direction
was safe (extra rebuilds, never stale data) so it didn't block the v3.38.6
release, but it meant the 60s graph cache never actually fired across a
consolidate/restart boundary.
2026-08-12 17:23:59 -04:00
ruv c76bbdcb16 chore(release): bump to 3.38.6 — codex stdin fix, intelligence cache staleness fix, daemon config restore fix v3.38.6 2026-08-12 16:49:23 -04:00
rUv f7672a104a ci: extend npm-ci-retry coverage to the OS-conditional fallback blocks (#3001)
#2998 wrapped 15 plain npm ci call sites with the retry composite
action but deliberately left ci.yml and verification-pipeline.yml's
two Linux/non-Linux --omit=optional fallback blocks untouched, on the
assumption they were a separate concern. That gap was real: PR #2999's
Test Verification (ubuntu-latest, Node 20) job hit the exact same
sharp/libvips "socket hang up" flake on the untouched Linux branch of
this exact block within hours of #2998 merging.

These two steps can't call the composite action directly — they need
the OS branch to choose between a plain npm ci and the
--omit=optional/--force fallback chain — so this wraps the existing
logic in the same 3-attempt/15s-backoff retry inline instead.
2026-08-12 16:44:25 -04:00
rUv 35a6ad3697 fix(daemon): config.json resourceThresholds overrides were lost to stale daemon-state.json (#2935) (#3000)
initializeWorkerStates()'s restoration guard only checked
`originalConfig` (the constructor arg) before restoring
resourceThresholds from a saved daemon-state.json — a value explicitly
set via .claude-flow/config.json (e.g. minFreeMemoryPercent: 0, a
workaround for Darwin's os.freemem() undercounting reclaimable memory)
was not covered by that guard, so a stale daemon-state.json from
before the override existed kept winning on every restart. Same bug
class as #2661 (aiWorkersEnabled), which already documents the
"deliberately not restored from stale state" pattern this now follows
for resourceThresholds too — per-field, so an unrelated field with no
explicit source can still legitimately restore from saved state.

Also fixes a secondary diagnostic bug reported in the same issue:
readDaemonConfigFromFile() logged "Daemon config loaded from ..." via
this.log(), but runs from the constructor before this.config (and
therefore this.config.logDir) is assigned — the log() call threw
inside its own try/catch and the line never reached daemon.log,
making "is the config file even being read?" impossible to answer
from the log alone. The chosen path (or a YAML-parser-unavailable
warning) is now returned and logged once this.config exists.

Does not address this issue's primary Darwin os.freemem() memory-gate
bug — that needs vm_stat/memory_pressure-based measurement, a larger,
platform-specific change left for a follow-up.
2026-08-12 16:43:21 -04:00
rUv 9039e2bb33 fix(intelligence): same-ID content edits were cached/dropped instead of refreshed (#2920) (#2999)
* fix(intelligence): same-ID content edits were cached/dropped instead of refreshed (#2920)

Two related staleness bugs in the intelligence helper's graph/store
caching, both keyed on entry count instead of content:

- init()'s graph-cache-hit gate compared only graphState.nodeCount to
  the deduped store length. Hand-editing a MEMORY.md section's body
  while its heading (and therefore generated ID) stays the same
  changes neither the count nor the ID set, so the stale cache kept
  being served and ranked-context.json was never refreshed.

- consolidate()'s STORE_PATH persist gate
  (`newEntries > 0 || store.length < preDedupCount`) only fired on
  insight creation or a dedup-driven shrink. Any other in-memory
  content change — e.g. assigning an id to a previously id-less entry
  while building the graph — left entry count and the dedup outcome
  unchanged, so the update was silently never written back to disk.

Fix: add a `storeFingerprint()` helper that folds every entry's own
content fingerprint into one aggregate value, used to (1) gate the
init() cache hit alongside nodeCount, and (2) make consolidate()
always persist the store — trivial cost given GRAPH_PATH and
RANKED_PATH are already rewritten unconditionally on every call.

Regenerated and re-signed helpers.manifest.json (ADR-174) for the
changed intelligence.cjs content via scripts/sign-helpers.mjs.

* fix(intelligence): re-sign helpers manifest with the correct auto-memory-hook.mjs hash

The previous commit's manifest captured a transient, incorrect hash for
auto-memory-hook.mjs — a file this change never touches — because a
concurrent Claude Code session briefly overwrote it with stale content
at the exact moment sign-helpers.mjs ran (the known helper-drift race
documented in CLAUDE.md). Re-signed with a before/after git-status
check bracketing the signing step to confirm no file changed underneath
it this time.
2026-08-12 16:38:25 -04:00
rUv 130193a376 ci: retry npm ci to absorb sharp/libvips transient download flakes (#2998)
Confirmed across at least 8 unrelated PRs this session (#2988, #2989,
#2991, #2994, #2995, #2996, #2997, and this one): npm ci intermittently
fails during sharp's postinstall with "socket hang up" fetching a
prebuilt libvips binary from GitHub Releases. It's a direct HTTPS
download outside npm's own package cache, so actions/setup-node's
npm cache doesn't help — every occurrence required a manual
`gh run rerun --failed`.

Add a local composite action (.github/actions/npm-ci-retry) that
retries npm ci up to 3 times with a 15s backoff, and switch every
plain `npm ci --legacy-peer-deps` / `npm ci --no-audit --no-fund
--legacy-peer-deps` call site (15 of them, across ci.yml,
integration-tests.yml, verification-pipeline.yml, v3-ci.yml) to use it.

Left untouched: the three rollback-manager.yml invocations (separate,
low-traffic rollback-validation path) and the two existing
Linux/non-Linux --omit=optional fallback blocks in ci.yml and
verification-pipeline.yml, which already have their own resilience
logic for a different failure mode (optional native deps on
macOS/Windows) — not this flake.
2026-08-12 16:14:40 -04:00