Commit Graph
2463 Commits
Author SHA1 Message Date
r bb7067587f Merge main into release/3.56.7 (TUI phases 2-3) 2026-10-11 18:29:21 -04:00
randRuFlo 30a2336377 chore(release): 3.56.7 (ruflo tui, MCP resources, auto-memory/purge fixes, doctor native-addon check, mods hardening, safe init --dual); codex 3.0.4 pin; witness regen from a full build
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 16:57:22 -04:00
randRuFlo 7718a142b4 feat(tui): the AI page: ask Codex (read-only, pinned) or OpenRouter, each question after a card (ADR-489 phase 3)
Page 6. Reuses harness.send and the conversation bridge's sendTo, not a second harness. Host.spawn runs only the pinned Codex 0.162.0
release (never current or PATH), read-only, from a fixed argument allow-list; Host.httpSend sends only https POST to openrouter.ai or a
convoTargets host, never follows a redirect, and a key is read by variable name and never drawn. Enter shows a card of exactly what would be
sent; a lone y answers it only while it was drawn in full (#3983); spend cap from the provider-reported cost. e2e host matrix gets a tui leg
(keyless in CI, live gated). Not in this PR: the workspace-write toggle.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 16:54:16 -04:00
rUv 87e6d32716 Merge pull request #4075 from ruvnet/feat/tui-phase2
feat(tui): Swarm, Events and Missions pages, page bar and keys, resize, no Claude-only chrome (ADR-489 phase 2)
2026-10-11 13:54:09 -07:00
rUv 741619b5bf Merge pull request #4070 from ruvnet/fix/codex-dual-safe-defaults
fix(codex): safe default .codex/config.toml; permissive mode needs --codex-trust full
2026-10-11 13:50:57 -07:00
randRuFlo ba6f9273a3 feat(tui): Swarm, Events and Missions pages, page bar and keys, resize, and no Claude-only chrome (ADR-489 phase 2)
Five pages (Overview, Cost, Swarm, Events, Missions) with keys 1-5 / o c s e m / Tab / Shift-Tab, a page bar, a key line that
shortens with the width, clear-and-redraw on resize, a position bar under 60 columns and a notice under 40. Room is left out on
purpose (a message box and Claude sessions this host does not have).

state.isStandalone is the capability flag: on this host the shared chrome is not drawn (no tab bar, footer buttons, Launch,
Ask Claude, Claude control card); a button nobody can press is not drawn, a state chip and a section title are. Missions reads
the ADR-406 record only. Under Claude Code nothing changes. Console 0.42.7.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 16:24:56 -04:00
rUv bd9119dde8 Merge pull request #4074 from ruvnet/fix/doctor-4055-pr-number
fix(doctor): cite nodejs/node#65943 (not #65946) in the native-addon warning (#4055)
2026-10-11 12:56:28 -07:00
rUv 228d578173 Merge pull request #4072 from ruvnet/fix/memory-purge-native-4057-hooklog-4056
fix(memory,hooks): keep on-disk format on sql.js write-back (#4057); command-recording off switch, redaction, expired-row cleanup (#4056)
2026-10-11 12:40:18 -07:00
rUv dd62f06485 Merge pull request #4071 from ruvnet/fix/auto-memory-hooks-4058
fix(auto-memory): hooks deliver their subcommand, sync sees learnings, worktrees share main memory dir, atomic store writes (#4058)
2026-10-11 12:36:32 -07:00
rUv f9732f1c81 Merge pull request #4073 from ruvnet/feat/mods-hardening-toast
feat(mods): doctor repairs that repair, --strict, atomic install, startup self-check (mods 0.6.0) + toast spike
2026-10-11 12:25:06 -07:00
rUv 17a8b86256 Merge pull request #4059 from ruvnet/feat/ruflo-tui-adr
feat(cli,console): ruflo tui, the console in a terminal of its own (ADR-489, phase 1)
2026-10-11 12:16:32 -07:00
randRuFlo 212e63ea22 Merge main into fix/codex-dual-safe-defaults; record the ADR-490 advisory as resolved
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 15:03:54 -04:00
rUv 7fca18f86e Merge pull request #4068 from ruvnet/feat/e2e-host-matrix
feat(e2e): three-host integration loop (Claude Code, Codex, OpenRouter) + fixes + ADR-490/491
2026-10-11 11:56:45 -07:00
randRuFlo 9c4d9be656 fix(doctor): cite the right Node PR (#65943) in the native-addon workaround text (#4055)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:55:40 -04:00
randRuFlo 3111685d37 fix(auto-memory): snapshot store ids before dedup so id-less entries are not re-added by the merge (#4058)
CI caught it: #2920 consolidate() assigns an ID to an ID-less entry in place, so the
ids captured at write time no longer matched the on-disk copy and the merge appended
it again. Capture ids when the store is read, and never treat an id-less on-disk
entry as one another writer added. Helpers re-signed.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:25:37 -04:00
randRuFlo e1c9d75590 feat(mods): doctor names each broken state with a one-line repair, --strict, atomic install with rollback
- probe: a plugin set to false is reported as disabled with 'claude plugin enable', not 'ruflo mods install' (which never flips it); installed-but-not-enabled; partial install (some mod plugins, no marketplace, record drift)
- every non-passing finding carries a one-line fix; headless -p fresh-config caveat named
- doctor --strict exits 1 on a warning too
- install writes settings and record as one operation: a failing record write restores the settings

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:07:52 -04:00
randRuFlo 11cc8cd648 feat(cli,console): ruflo tui --plain, exit 2 without a terminal, bundle staged for publish, esbuild declared (ADR-489 A-E)
- E: `ruflo tui --plain` prints one plain frame and exits 0; without a TTY and
  without --plain it prints a one-line hint on stderr and exits 2 (no frame).
  Tests for terminal, non-terminal, --plain in a terminal, no raw mode, and
  through the command with the real bundle.
- A: esbuild is a declared root devDependency (^0.27.2, already locked).
- B: v3/@claude-flow/cli/scripts/prepare-publish.mjs builds and stages
  plugins/ruflo-console/dist/tui.mjs so a registry install runs `ruflo tui`.
  Measured: +449,345 bytes on the CLI tarball.
- ADR-489: status Accepted; section 8 records decisions A-E (C: Swarm, Events,
  Missions, Room; D: Codex read-only by default, no danger-full-access, OpenRouter
  https-only to openrouter.ai + convoTargets hosts). Repairs a corrupted table row
  that had pasted copies of the file head into the ADR.
- README: a short ruflo tui section.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:07:28 -04:00
RuFlo 18ecd8ae7b fix(memory,hooks): keep the on-disk format on sql.js write-back (#4057); command-recording off switch, redaction and a cleanup that sees expired rows (#4056)
#4057: with encryption at rest on, `memory purge`'s sql.js fallback rewrote a
plaintext native SQLite store as an RFE1 blob and still printed [OK]; the
native bridge and every SQLite reader then rejected the file. Every whole-file
read-modify-write (purge, delete, get access-count, store, schema migration,
decay) now writes the image back in the format it read (plaintext -> plaintext,
RFE1 -> RFE1) via writeDbImagePreservingFormat. applyTemporalDecay also read
the raw bytes, so it failed on encrypted stores, and wrote plaintext: both
fixed.

#4056: `hooks post-command` stored every Bash command in full with no off
switch. Add CLAUDE_FLOW_HOOKS_RECORD_COMMANDS=0 / CLAUDE_FLOW_HOOKS_ENABLED=false /
hooks.recordCommands=false (nothing is stored when off), redact common secret
shapes and cap stored text at 2000 chars (bounded patterns, linear on hostile
input). `memory cleanup --expired-only` never saw expired rows because
listEntries hides them (TTL is a read-time rule): listEntries gains
includeExpired + expiresAt, and memory_cleanup uses it. ruflo-core 0.2.8: the
Bash shim stands down when recording is off.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:07:02 -04:00
randRuFlo ceed62b1b4 fix(auto-memory): hooks deliver their subcommand, sync sees learnings, worktrees share the main memory dir, writes are atomic (#4058)
- Upgrade-written import/sync hooks used `node -e "...import(file)" import`, which
  leaves the subcommand in process.argv[1]; the helper read argv[2], so both hooks
  only printed the status banner. They now use helperHookCommand like every other
  helper hook, and the helper also accepts the argv[1] shape so settings.json files
  already written keep working.
- Hook timeouts were written as 6000/8000 (and 8000/10000 from init) but Claude Code
  reads them in seconds; the auto-memory hooks now use 30.
- JsonFileBackend.query treated MemoryQuery.type (a query mode: hybrid, semantic...)
  as an entry type, so the bridge's learnings query matched nothing and sync always
  reported 0. It now treats modes as modes and honours tags, updatedAfter, key,
  keyPrefix and memoryType. The "Curated MEMORY.md index" line is no longer printed
  when the bridge emitted index:skipped.
- In a git worktree the memory dir is keyed by the main checkout (resolved with
  `git rev-parse --git-common-dir`, no shell) to match Claude Code.
- auto-memory-hook.mjs and intelligence.cjs both read-modify-write
  auto-memory-store.json: writes are atomic (temp + rename), serialised by a short
  fail-open directory lock, and keep entries another writer added since the read.
- Not changed: autoAssignOnIdle/autoAssign are false on purpose (#3031).

Helpers re-signed. Regression: __tests__/auto-memory-hooks-4058.test.ts (10 of 11
failed before; the 8-writer race kept 6 of 8 entries).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:04:41 -04:00
randRuFlo a6b563c60f fix(codex): safe default .codex/config.toml, explicit --codex-trust full opt-in
init, init --dual and @claude-flow/codex init wrote a gitignored
.codex/config.toml with sandbox_mode = danger-full-access,
approval_policy = never and web_search = live. Default is now standard
trust (workspace-write, on-request, cached); the permissive file needs
--codex-trust full (or RUFLO_CODEX_TRUST=full). init prints which level
it wrote, an existing .codex/config.toml is never rewritten (not even
with --force) and a kept permissive file is flagged. Unknown levels are
rejected on the CLI and fall back to standard from the environment.

Found by the three-host e2e run (ADR-490). @claude-flow/codex 3.0.4
(bundled: ships with the next train).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:04:07 -04:00
randRuFlo f38576e125 feat(doctor): flag better-sqlite3 copies built against Node 24.19+ headers on 24.19-24.21 (#4055)
Read-only check: reads build/config.gypi of each better-sqlite3 copy in the
resolved tree (never loads an addon), warns when a locally compiled copy used
24.19+ headers while the runtime is 24.19-24.21 (nodejs/node#65446), with the
documented workarounds. Prebuilt copies carry no config.gypi and pass.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 14:03:35 -04:00
r a5a2b1b9b9 Merge main into feat/ruflo-tui-adr 2026-10-11 14:00:53 -04:00
r b0a35764f3 Merge remote-tracking branch 'origin/main' into feat/e2e-host-matrix 2026-10-11 12:43:22 -04:00
randRuFlo 98f2eb5213 feat(e2e): three-host integration loop (Claude Code, Codex, OpenRouter); fix MCP resources capability and Codex plugin clone budget
ADR-490 (loop), ADR-491 (mods host integration, Proposed). The loop's first run found two defects, fixed test-first:
- ruflo mcp start advertised resources but answered resources/* with -32601 (3 stdio servers).
- init --dual's marketplace clone ran under a 20 s budget (17.5 s measured), swallowing the real error.

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

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 10:52:06 -04:00
r b40e8053ce Merge main into dream/2026-10-11-security 2026-10-11 10:49:55 -04:00
rUv 47ad62e5af Merge pull request #4054 from ruvnet/fix/win-hooks-4045
fix(init): Windows hooks launch through node -e, not cmd /c (#4045)
2026-10-11 07:48:54 -07:00
randRuFlo b662966540 chore: bump cli-core 3.7.1, shared 3.0.3, ruflo-adr 0.5.5 for the reviewed rudycelekli batch
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 10:46:01 -04:00
randRuFlo c11b5461f5 feat(cli,console): ruflo tui, the console in a terminal of its own (ADR-489, phase 1)
Adds a standalone host for the ruflo-console views: a Node Host adapter
(confined reads, CLI-only run, everything engine-bound refused), a zero
dependency terminal renderer that is also the escape/secret chokepoint, and
`ruflo tui [--view overview|cost]` which draws the mod's own paneView.
Read-only; headless prints one plain frame. No hooks/ file changed, no
version bump, publish path untouched (bundle staging is a decision in the ADR).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 09:47:49 -04:00
ClaudeandRuFlo 25f26f5e3e fix(security): address review — linear-time regex, drop snippet from automatic-boot stdout
Two findings from ruvnet's review on #4053:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01CGoza3gyxBjpaiMPhGHcHs
2026-10-10 18:13:04 +02:00