Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(console): find the project folder on Windows for ADRs, exports and transcript save (#4358)

rUv98c3808276ee
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index 08b0649147..1e7921950f 100644
--- a/plugins/ruflo-console/.claude-plugin/plugin.json
+++ b/plugins/ruflo-console/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "ruflo-console",
"description": "ruflo's cockpit inside Claude Code and the one /ruflo command for every ruflo mod (function hooks, early access). Views: overview with health alerts, swarm topology graph, claims flow with TTL rings, federation map, plugin health matrix, learning curve and pipeline, MetaHarness radar and audit trend, memory, cost gauge, agent timeline, approvals queue, event stream, a main menu, an x.ruv.io federation board, an AI terminal (codex, claude or both in remembered sessions, streamed), Skills (npx skills), a Hive-Mind view, a MetaHarness lab, agent drill-down; a command palette for confirm-gated actions through the ruflo CLI; a band above the prompt. Reads ruflo's files and the CLI's local JSON; anything not measured reads n/a. The one network call it makes by itself is a daily read of the published plugin.json at github.com/ruvnet/ruflo to offer an update (Settings β†’ Updates: ask, auto, or off); it installs only through Claude Code's own claude plugin update, and never a new major version without asking.",
- "version": "0.44.6",
+ "version": "0.44.7",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --git a/plugins/ruflo-console/CHANGELOG.md b/plugins/ruflo-console/CHANGELOG.md
index af6b013e1b..5c26f86ba3 100644
--- a/plugins/ruflo-console/CHANGELOG.md
+++ b/plugins/ruflo-console/CHANGELOG.md
@@ -2,6 +2,9 @@
Newest first. One `## <version> β€” <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-console`.
+## 0.44.7 β€” 2026-10-21
+- fix: the ADRs page, the Events/Timeline export and the AI terminal's "save transcript" now work on Windows (#4356, thanks @marioja). All three hardcoded a leading-`/` check as their "is the project folder known" guard; on Windows `state.cwd` is a drive path (`C:\Users\...`), so every one of them refused with "no project folder is known" regardless of settings. They now use the existing `isAbsolutePath` helper (already fixed for register.ts in #4175). Also fixed a second, independent bug on the transcript-save path: it pre-joined `state.cwd` into the string handed to `resolveExportPath`, which refuses any backslash in its input β€” so even after the first fix, a Windows transcript save still failed; it now passes the relative file name only, same as the Events/Timeline export already did.
+
## 0.44.6 β€” 2026-10-20
- feat: the compact nav's menu, groups, search and page tabs are now separated by a dim `β”‚` bar instead of just a gap, so a row of chips and tabs reads as distinct items rather than running together (#3664).
diff --git a/plugins/ruflo-console/hooks/adr.ts b/plugins/ruflo-console/hooks/adr.ts
index 8741da84a2..626416a467 100644
--- a/plugins/ruflo-console/hooks/adr.ts
+++ b/plugins/ruflo-console/hooks/adr.ts
@@ -13,6 +13,7 @@ import { adrDirText, detectStyle, draftFromMission, fileNameFor, initialRecord,
import { record as recordEvents } from './data/events'
import { readBounded, type ReadCache } from './data/files'
import { plain } from './data/parse'
+import { isAbsolutePath } from './data/abs-path'
import { checkNoLinks, dirOf, newFileArgv, replaceFileArgv } from './data/wf-file'
import { writeFlavorReady } from './data/write-flavor'
import type { Host } from './host'
@@ -81,7 +82,7 @@ export async function discover(host: Pick<Host, 'fs'>, cwd: string, setting: str
const tries = named !== null && named !== '' ? [named] : ADR_FOLDERS
let refused = ''
- if (base === '' || !base.startsWith('/')) return { dir: null, why: 'no project folder is known' }
+ if (base === '' || !isAbsolutePath(base)) return { dir: null, why: 'no project folder is known' }
for (const candidate of tries) {
const stat = await host.fs.stat(`${base}/${candidate}`).catch(() => undefined)
diff --git a/plugins/ruflo-console/hooks/data/event-export.ts b/plugins/ruflo-console/hooks/data/event-export.ts
index 4f82f892eb..189a3c8364 100644
--- a/plugins/ruflo-console/hooks/data/event-export.ts
+++ b/plugins/ruflo-console/hooks/data/event-export.ts
@@ -3,6 +3,7 @@
* target is a name under `.claude-flow/console/exports/` or a path inside the project; `..`, a link on the way, a bad extension and an
* existing file are all refused, and the text is washed and capped before it is built. The write itself is a confirm-gated fixed argv.
*/
+import { isAbsolutePath } from './abs-path'
import { isoOf } from './safe'
import type { ActionSpec } from '../actions'
import { levelOf } from './event-severity'
@@ -35,11 +36,13 @@ export function resolveTarget(input: string, cwd: string, allowed: readonly Form
if (/[\u0000-\u001f\u007f-\u009f\\]/.test(raw)) return { ok: false, why: 'a path with control characters or a backslash is refused' }
if (raw.startsWith('~')) return { ok: false, why: 'write the path out: ~ is not expanded here' }
if (raw.split('/').includes('..')) return { ok: false, why: 'a path with .. is refused: name a file inside the project' }
- if (root === '' || !root.startsWith('/')) return { ok: false, why: 'no project folder is known, so the path cannot be placed' }
+ if (root === '' || !isAbsolutePath(root)) return { ok: false, why: 'no project folder is known, so the path cannot be placed' }
const absolute = raw.startsWith('/') ? raw : raw.includes('/') ? `${root}/${raw}` : `${root}/${EXPORT_DIR}/${raw}`
const parts = absolute.split('/').filter(part => part !== '' && part !== '.')
- const path = `/${parts.join('/')}`
+ // A Windows drive (`C:\x`) or UNC (`\\server\share`) root keeps its own prefix as the
+ // first `parts` entry (it contains no `/`); only a POSIX root needs the leading `/` back.
+ const path = absolute.startsWith('/') ? `/${parts.join('/')}` : parts.join('/')
const name = parts[parts.length - 1] ?? ''
const format = formatOf(name)
diff --git a/plugins/ruflo-console/hooks/data/wf-file.ts b/plugins/ruflo-console/hooks/data/wf-file.ts
index 2241f42aaf..af40a8b997 100644
--- a/plugins/ruflo-console/hooks/data/wf-file.ts
+++ b/plugins/ruflo-console/hooks/data/wf-file.ts
@@ -9,6 +9,7 @@
* A path is accepted only if, after normalising, it sits under an allowed root (the project, or the scratchpad where one is known)
* with no `..`, no link on the way down to it and, for a summary, no file already there to overwrite.
*/
+import { isAbsolutePath } from './abs-path'
import type { ReaderFs } from './files'
import { posixCopyExclusive, posixCreateExclusive, posixCreateExclusiveWithDirs, posixReplace, posixReplaceWithDirs, type WriteFlavor } from './write-flavor'
@@ -36,13 +37,15 @@ export function resolveExportPath(input: string, roots: Roots): PathCheck {
const base = trimRoot(roots.cwd)
- if (base === '' || !base.startsWith('/')) return { ok: false, why: 'no project folder is known, so a relative path cannot be placed' }
+ if (base === '' || !isAbsolutePath(base)) return { ok: false, why: 'no project folder is known, so a relative path cannot be placed' }
const absolute = raw.startsWith('/') ? raw : `${base}/${raw}`
const parts = absolute.split('/').filter(part => part !== '' && part !== '.')
- const path = `/${parts.join('/')}`
+ // A Windows drive (`C:\x`) or UNC (`\\server\share`) root keeps its own prefix as the
+ // first `parts` entry (it contains no `/`); only a POSIX root needs the leading `/` back.
+ const path = absolute.startsWith('/') ? `/${parts.join('/')}` : parts.join('/')
const name = parts[parts.length - 1] ?? ''
- const inside = [roots.cwd, roots.scratch ?? ''].map(trimRoot).filter(root => root.startsWith('/') && root.length > 1).find(root => path.startsWith(`${root}/`))
+ const inside = [roots.cwd, roots.scratch ?? ''].map(trimRoot).filter(root => isAbsolutePath(root) && root.length > 1).find(root => path.startsWith(`${root}/`))
if (!NAME.test(name)) return { ok: false, why: 'the file name must be letters, digits, dots, dashes, underscores or spaces, and end in .md' }
if (inside === undefined) return { ok: false, why: `outside the project${roots.scratch === undefined || roots.scratch === null ? '' : ' and the scratchpad'}: only paths under ${trimRoot(roots.cwd)}${roots.scratch === undefined || roots.scratch === null ? '' : ` or ${trimRoot(roots.scratch)}`} are written` }
diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.ts
index 69282d0b15..44dac6b6e7 100644
--- a/plugins/ruflo-console/hooks/version.ts
+++ b/plugins/ruflo-console/hooks/version.ts
@@ -2,4 +2,4 @@
* The console's version, shown on the header so a person can tell which build is running. Kept equal to the plugin's manifest
* (`.claude-plugin/plugin.json`); tests/version.spec.ts fails if the two drift.
*/
-export const CONSOLE_VERSION = '0.44.6'
+export const CONSOLE_VERSION = '0.44.7'
diff --git a/plugins/ruflo-console/hooks/wf-convo-live.ts b/plugins/ruflo-console/hooks/wf-convo-live.ts
index 9e48d04521..ace3627746 100644
--- a/plugins/ruflo-console/hooks/wf-convo-live.ts
+++ b/plugins/ruflo-console/hooks/wf-convo-live.ts
@@ -251,7 +251,10 @@ export async function saveTranscript(state: State, target: Target, ask: (spec: A
if (host === undefined || thread === undefined || thread.msgs.length === 0) return ask(null, 'this thread has nothing to save yet')
const roots = { cwd: state.cwd, scratch: null }
- const wanted = resolveExportPath(`${state.cwd.replace(/\/+$/, '')}/${EXPORT_DIR}/${transcriptName(target.id, Date.now())}`, roots)
+ // #4356: pass the relative name and let resolveExportPath join it onto roots.cwd itself β€”
+ // pre-joining here produced a Windows drive cwd (`C:\...`) inside `input`, which the
+ // function's own backslash guard then refused outright.
+ const wanted = resolveExportPath(`${EXPORT_DIR}/${transcriptName(target.id, Date.now())}`, roots)
if (!wanted.ok) return ask(null, wanted.why)
diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh
index bedff6355c..25c09f2335 100755
--- a/plugins/ruflo-console/scripts/smoke.sh
+++ b/plugins/ruflo-console/scripts/smoke.sh
@@ -11,9 +11,9 @@ step() { printf "β†’ %s ... " "$1"; }
ok() { printf "PASS\n"; PASS=$((PASS+1)); }
bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
-step "1. plugin.json declares ruflo-console 0.44.6"
+step "1. plugin.json declares ruflo-console 0.44.7"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.44.6"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.44.7"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
step "2. hooks.json names exactly one module and no classic hook commands"
grep -q '"modules": \["./register.ts"\]' "$HOOKS/hooks.json" && ! grep -q '"command"' "$HOOKS/hooks.json" \
diff --git a/plugins/ruflo-console/tests/windows-drive-path-sites.spec.ts b/plugins/ruflo-console/tests/windows-drive-path-sites.spec.ts
new file mode 100644
index 0000000000..35a7812fa8
--- /dev/null
+++ b/plugins/ruflo-console/tests/windows-drive-path-sites.spec.ts
@@ -0,0 +1,84 @@
+import { describe, expect, it } from 'vitest'
+import { discover } from '../hooks/adr'
+import { resolveTarget } from '../hooks/data/event-export'
+import { resolveExportPath } from '../hooks/data/wf-file'
+import type { ReaderFs } from '../hooks/data/files'
+
+// #4356: on Windows `state.cwd` is a drive path (`C:\Users\...`), not `/...`. Each of these
+// three sites hardcoded `base.startsWith('/')` (or `root.startsWith('/')`) as its "do we know
+// the project folder" guard, so all three fail closed on Windows regardless of settings β€”
+// matching the already-fixed #4175 bug in register.ts (see abs-path.spec.ts).
+
+const WIN_CWD = 'C:\\Users\\dev\\project'
+
+function fsWithDir(dirPath: string): Pick<ReaderFs, 'stat' | 'list' | 'read'> {
+ return {
+ stat: async (path: string) => (path === dirPath ? { kind: 'dir' } : undefined),
+ list: async () => [],
+ read: async () => '',
+ }
+}
+
+describe('adr.ts discover() finds a Windows project folder (#4356)', () => {
+ it('reads the configured ADR folder when cwd is a Windows drive path', async () => {
+ const dir = `${WIN_CWD}/docs`
+ const result = await discover({ fs: fsWithDir(dir) }, WIN_CWD, 'docs')
+
+ expect(result).toEqual({ dir: 'docs', why: '' })
+ })
+
+ it('still reports "no project folder is known" for a genuinely empty cwd', async () => {
+ const result = await discover({ fs: fsWithDir('/anything') }, '', 'docs')
+
+ expect(result.dir).toBeNull()
+ expect(result.why).toBe('no project folder is known')
+ })
+})
+
+describe('event-export.ts resolveTarget() on a Windows drive path (#4356)', () => {
+ it('resolves a bare file name under the exports folder, preserving the drive prefix', () => {
+ const result = resolveTarget('summary.md', WIN_CWD, ['md'])
+
+ expect(result.ok).toBe(true)
+ if (result.ok) {
+ expect(result.path.startsWith('C:')).toBe(true)
+ expect(result.path).not.toMatch(/^\/C:/)
+ expect(result.path.endsWith('/summary.md')).toBe(true)
+ }
+ })
+
+ it('refuses a target outside the Windows project root', () => {
+ const result = resolveTarget('../../escape.md', WIN_CWD, ['md'])
+
+ expect(result.ok).toBe(false)
+ })
+})
+
+describe('wf-file.ts resolveExportPath() on a Windows drive path (#4356)', () => {
+ it('resolves a relative transcript name under the project, preserving the drive prefix', () => {
+ const result = resolveExportPath('.claude-flow/console/exports/transcript.md', { cwd: WIN_CWD })
+
+ expect(result.ok).toBe(true)
+ if (result.ok) {
+ expect(result.path.startsWith('C:')).toBe(true)
+ expect(result.path).not.toMatch(/^\/C:/)
+ expect(result.path.endsWith('/transcript.md')).toBe(true)
+ }
+ })
+
+ it('refuses a pre-joined absolute Windows path as input, same as the backslash rule always did', () => {
+ const result = resolveExportPath(`${WIN_CWD}/.claude-flow/console/exports/transcript.md`, { cwd: WIN_CWD })
+
+ expect(result.ok).toBe(false)
+ })
+})
+
+describe('wf-convo-live.ts calls resolveExportPath with a relative name, not a pre-joined cwd (#4356)', () => {
+ it('saveTranscript no longer prefixes state.cwd onto the resolveExportPath input', async () => {
+ const { readFileSync } = await import('node:fs')
+ const source = readFileSync(new URL('../hooks/wf-convo-live.ts', import.meta.url), 'utf8')
+
+ expect(source).toContain('resolveExportPath(`${EXPORT_DIR}/${transcriptName(target.id, Date.now())}`, roots)')
+ expect(source).not.toMatch(/resolveExportPath\(`\$\{state\.cwd/)
+ })
+})