🌊 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
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
fix(console): worktree removal, status and diff no longer run a repository's filter drivers (console 0.43.2)
RuFlo241d7a943855
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex a91951dc3c..2c699eb7c7 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.43.1",+ "version": "0.43.2","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/CHANGELOG.md b/plugins/ruflo-console/CHANGELOG.mdindex e5d0b3e4d8..6a39e7c4a1 100644--- a/plugins/ruflo-console/CHANGELOG.md+++ b/plugins/ruflo-console/CHANGELOG.md@@ -2,6 +2,10 @@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.43.2 — 2026-10-12+- fix: removing a worktree no longer runs the repository's own programs, and no longer deletes unsaved files: `git worktree remove` runs its own status, which ran `core.fsmonitor` and the `post-index-change` hook, and with `status.showUntrackedFiles=no` it read a worktree holding new files as clean and deleted them. The removal, the worktree status probe, the changed-files read and `describe --dirty` now switch the fsmonitor (and for removal and describe, hooks) off, and list untracked files whatever the setting says (#4090, thanks @proffesor-for-testing, #4092)+- fix: a `filter.<name>.clean`, `.smudge` or `.process` command in a repository's config no longer runs when the console compares a worktree with HEAD: before the removal, the worktree status and the diff drill-down, it lists the configured drivers (a config read) and blanks each one on the command line; a driver name it cannot blank exactly refuses the probe instead of running it+## 0.43.1 — 2026-10-12- fix: `ruflo tui` marks the page on screen in the page bar: on the AI page it kept the previous page lit (`5 Missions`, or `1 Overview` after a number key) because the bar was painted from the console view the session last showed and the AI page is not one; it is now drawn from the page itself, through Tab, Shift-Tab, letters, digits and resize- fix: `ruflo tui --help` and the console README list the page keys as `1-6` and `o c s e m a` (they said `1-5`); a test holds the help textdiff --git a/plugins/ruflo-console/hooks/data/git-filters.ts b/plugins/ruflo-console/hooks/data/git-filters.tsnew file mode 100644index 0000000000..d176b86e44--- /dev/null+++ b/plugins/ruflo-console/hooks/data/git-filters.ts@@ -0,0 +1,52 @@+/**+ * Filter drivers named by a repository's own config (filter.<name>.clean, .smudge, .process) are programs git runs while it compares a work tree+ * with HEAD: status, diff and `worktree remove` all do. The console reads and removes worktrees of projects it did not make, so before such a+ * command it lists the configured drivers (a config read; nothing runs) and blanks each one on the command line, where it outranks the+ * repository's config. A driver name it cannot blank exactly stops the command (null) rather than letting the driver run.+ */+export type GitRun = (argv: readonly string[], timeoutMs: number) => Promise<{ stdout: string; exitCode?: number | null }>++/** The listing. `git config --get-regexp` exits 1 when nothing matches, which is the usual case and not a failure. */+export const FILTER_KEYS_ARGV = (dir: string): readonly string[] => ['git', '-C', dir, '--no-optional-locks', 'config', '--name-only', '--get-regexp', '^filter\\..*\\.(clean|smudge|process)$']++/** Letters, digits, dot, underscore and dash only: anything else (an equals sign, a space, a control character) cannot be written as one exact -c key. */+const KEY = /^filter\.([A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*)\.(clean|smudge|process)$/++/** The -c overrides that blank every listed driver, or null when a listed key is not one it can blank exactly. */+export function filterOverrides(listing: string): string[] | null {+ const out: string[] = []+ const seen = new Set<string>()++ for (const line of listing.split('\n')) {+ const key = line.trim()++ if (key === '') continue++ if (!KEY.test(key)) return null++ if (seen.has(key)) continue++ seen.add(key)+ out.push('-c', `${key}=`)+ }++ return out+}++/**+ * `argv` with the overrides right after `git`, or null: the argv does not start with git, the listing failed or threw, or a driver name cannot be+ * blanked exactly. Callers treat null as "this probe is refused", the same as any other probe that could not be made safe.+ */+export async function filterGuarded(run: GitRun, dir: string, argv: readonly string[]): Promise<string[] | null> {+ if (argv[0] !== 'git') return null++ const listed = await run(FILTER_KEYS_ARGV(dir), 15_000).catch(() => null)++ if (listed === null) return null++ if (listed.exitCode !== 0 && !(listed.exitCode === 1 && listed.stdout.trim() === '')) return null++ const overrides = filterOverrides(listed.stdout)++ return overrides === null ? null : ['git', ...overrides, ...argv.slice(1)]+}diff --git a/plugins/ruflo-console/hooks/data/wf-drill-io.ts b/plugins/ruflo-console/hooks/data/wf-drill-io.tsindex 9b4d8de804..af45fbf240 100644--- a/plugins/ruflo-console/hooks/data/wf-drill-io.ts+++ b/plugins/ruflo-console/hooks/data/wf-drill-io.ts@@ -11,6 +11,7 @@* A refusal, a missing file or a file too large is a stated reason, never an empty success.*/import { readBounded, type ReadCache } from './files'+import { filterGuarded } from './git-filters'import { cleanLine, cleanPath, journalResult, type Capped, type Parsed } from './wf-activity'import { activityOf, parsedStats, PARSED_BUDGET_CHARS, resetStore } from './wf-incr-store'import { TAIL_BYTES, TRANSCRIPT_CAP, type WorkflowFs } from './workflows-read'@@ -253,8 +254,8 @@ export const diffOf = (agent: WfAgent): { files: Diff; extra: number } | undefin/*** The fixed argv of the one process this module runs: no shell, the path is its own argument after `-C`, no external diff driver, no text- * conversion, no fsmonitor hook and no optional lock. A `filter.*.clean` command in the worktree's own config can still run when git compares- * the working tree with HEAD; that is why only a worktree inside this project's folder is read.+ * conversion, no fsmonitor hook and no optional lock. A `filter.*.clean` command in the worktree's own config would run when git compares the+ * working tree with HEAD, so loadDiff blanks every configured driver first (git-filters.ts); and only a worktree inside this project's folder is read.*/export const diffArgv = (worktree: string): string[] => ['git', '--no-optional-locks', '-c', 'core.fsmonitor=false', '-C', worktree, 'diff', '--numstat', '--no-renames', '--no-color', '--no-ext-diff', '--no-textconv', 'HEAD', '--']@@ -279,7 +280,8 @@ export async function loadDiff(agent: WfAgent): Promise<void> {if (stat === undefined) notes.set(path, { phase: 'none', why: 'the worktree folder no longer exists' })else {- const result = await b.host.run(diffArgv(path), 8000)+ const guarded = await filterGuarded(b.host.run, path, diffArgv(path))+ const result = guarded === null ? { stdout: '', stderr: "a filter driver in the repository's config could not be switched off", exitCode: 1 } : await b.host.run(guarded, 8000)if (result.exitCode !== 0) notes.set(path, { phase: 'failed', why: cleanLine(result.stderr ?? `git exited ${result.exitCode}`, 100) || `git exited ${result.exitCode}` })else {diff --git a/plugins/ruflo-console/hooks/data/wf-worktrees.ts b/plugins/ruflo-console/hooks/data/wf-worktrees.tsindex d5d860ff1a..df066ca1f7 100644--- a/plugins/ruflo-console/hooks/data/wf-worktrees.ts+++ b/plugins/ruflo-console/hooks/data/wf-worktrees.ts@@ -12,6 +12,7 @@* find /proc ... -printf '%p\t%l\n' what every process has as cwd, exe and open fd (own processes only)* The one write, `git -C <main> worktree remove <path>` with no --force, lives in views/wf-worktrees.ts behind the confirm card.*/+import { filterGuarded } from './git-filters'import { plain } from './parse'import { cleanText } from './wf-clean'import type { WfRun } from './workflows'@@ -183,12 +184,19 @@ const oneLine = async (io: WtIo, argv: readonly string[], timeoutMs: number): Pr/** Whether `cwd` is this worktree or inside it: the one a session is working in. */export const isCurrentDir = (cwd: string, path: string): boolean => cwd === path || cwd.startsWith(`${path}/`)+/** A probe that compares the work tree with HEAD can run a filter driver from the repository's config (git-filters.ts): it runs with them blanked, or is an unknown. */+const guardedLine = async (io: WtIo, dir: string, argv: readonly string[], timeoutMs: number): Promise<string | null> => {+ const guarded = await filterGuarded(io.run, dir, argv)++ return guarded === null ? null : oneLine(io, guarded, timeoutMs)+}+async function probeOne(io: WtIo, entry: WtEntry, cwd: string, runs: readonly WfRun[]): Promise<WtRow> {const base: WtRow = { ...entry, dirty: null, ignoredSecrets: null, ahead: null, behind: null, createdMs: null, maker: makerOf(entry, runs), isCurrent: isCurrentDir(cwd, entry.path) }if (!entry.isSafe || entry.isBare || entry.isPrunable) return base- const [status, counts, ignored, link] = await Promise.all([oneLine(io, STATUS_ARGV(entry.path), 30_000), oneLine(io, AHEAD_ARGV(entry.path), 15_000), oneLine(io, IGNORED_ARGV(entry.path), 30_000), io.stat(`${entry.path}/.git`).catch(() => undefined)])+ const [status, counts, ignored, link] = await Promise.all([guardedLine(io, entry.path, STATUS_ARGV(entry.path), 30_000), oneLine(io, AHEAD_ARGV(entry.path), 15_000), oneLine(io, IGNORED_ARGV(entry.path), 30_000), io.stat(`${entry.path}/.git`).catch(() => undefined)])const pair = counts === null ? null : /^(\d+)\s+(\d+)\s*$/.exec(counts)return {diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.tsindex dd0b099a7d..0b07bf245e 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.43.1'+export const CONSOLE_VERSION = '0.43.2'diff --git a/plugins/ruflo-console/hooks/views/wf-worktrees.ts b/plugins/ruflo-console/hooks/views/wf-worktrees.tsindex bff362258c..9e77f4ffe9 100644--- a/plugins/ruflo-console/hooks/views/wf-worktrees.ts+++ b/plugins/ruflo-console/hooks/views/wf-worktrees.ts@@ -12,6 +12,7 @@import type { RenderElement } from 'claude-code'import type { ActionSpec } from '../actions'+import { filterGuarded } from '../data/git-filters'import { plain } from '../data/parse'import { cleanText } from '../data/wf-clean'import { checkProcs, failureOf, inUseOf, planRemoval, readSummary, readWorktrees, REMOVE_ARGV, REMOVE_MAX, whyKept, type ProcCheck, type WtIo, type WtRead, type WtRow } from '../data/wf-worktrees'@@ -180,7 +181,15 @@ export function removalSpec(env: SlotEnv): ActionSpec | null {continue}- const result = await host.run(REMOVE_ARGV(root, path), 60_000)+ // git worktree remove runs its own status on the worktree, which can run a filter driver from the repository's config: blank them first+ const guarded = await filterGuarded(host.run, path, REMOVE_ARGV(root, path))++ if (guarded === null) {+ skipped.push(`${label}: could not make git safe to run here (a filter driver in the repository's config could not be switched off)`)+ continue+ }++ const result = await host.run(guarded, 60_000)if (result.exitCode === 0) gone.push(label)else skipped.push(`${label}: git said ${cleanText(plain(result.stderr || result.stdout, 100)) || `exit ${result.exitCode}`}`)diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex 85e94c4e3f..ff9695e981 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.43.1"+step "1. plugin.json declares ruflo-console 0.43.2"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.43.1"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.43.2"' "$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/fixtures/wf-git.ts b/plugins/ruflo-console/tests/fixtures/wf-git.tsindex 2c6160a0c8..4145b82525 100644--- a/plugins/ruflo-console/tests/fixtures/wf-git.ts+++ b/plugins/ruflo-console/tests/fixtures/wf-git.ts@@ -1,6 +1,7 @@/*** A stand-in for git and /proc for the worktree specs: a fixed list, per-path dirty and ahead counts, ages and a process listing.*/+import { FILTER_KEYS_ARGV } from '../../hooks/data/git-filters'import { AHEAD_ARGV, IGNORED_ARGV, LIST_ARGV, parseProcs, PROCS_ARGV, REF_ARGV, REMOVE_ARGV, STATUS_ARGV, type WtIo, type WtRead, type WtRow } from '../../hooks/data/wf-worktrees'import type { Kit } from '../../hooks/views/common'@@ -63,6 +64,8 @@ export function ioOf(w: World): WtIo {const dir = argv[2] ?? ''const key = argv.join(' ')+ // the filter-driver listing (git config --get-regexp): a repository with none exits 1 and prints nothing+ if (key === FILTER_KEYS_ARGV(dir).join(' ')) return { stdout: '', stderr: '', exitCode: 1 }if (key === PROCS_ARGV.join(' ')) return { stdout: w.procs, stderr: 'find: Permission denied', exitCode: 1 }if (key === LIST_ARGV(dir).join(' ')) return { stdout: w.list, stderr: '', exitCode: 0 }if (key === REF_ARGV(dir).join(' ')) return w.hasRef ? { stdout: `${Math.floor((NOW - 2 * 3_600_000) / 1000)}\n`, stderr: '', exitCode: 0 } : { stdout: '', stderr: 'unknown revision', exitCode: 128 }diff --git a/plugins/ruflo-console/tests/git-config-exec.spec.ts b/plugins/ruflo-console/tests/git-config-exec.spec.tsindex fae53c4d4f..2b910f0399 100644--- a/plugins/ruflo-console/tests/git-config-exec.spec.ts+++ b/plugins/ruflo-console/tests/git-config-exec.spec.ts@@ -5,7 +5,7 @@* status.showUntrackedFiles says, so a worktree holding new files is never read as clean and deleted. Each real-git case has a positive control:* the same config does its harm under the plain command, so a marker that stays absent means the guard held, not that the probe could not see it.*- * Not covered here: filter.<driver>.clean/.process commands, lazy fetches in a partial clone, changes hidden by index flags (assume-unchanged,+ * Filter drivers are covered in git-filter-guard.spec.ts. Not covered here: lazy fetches in a partial clone, changes hidden by index flags (assume-unchanged,* skip-worktree, core.ignoreStat), and commands the person configures themselves (mission gates).*/import { execFile, spawn } from 'node:child_process'diff --git a/plugins/ruflo-console/tests/git-filter-guard.spec.ts b/plugins/ruflo-console/tests/git-filter-guard.spec.tsnew file mode 100644index 0000000000..fb7ffe83d5--- /dev/null+++ b/plugins/ruflo-console/tests/git-filter-guard.spec.ts@@ -0,0 +1,190 @@+/**+ * #4090 follow-up: a repository's own config can name a filter driver (filter.<name>.clean, .smudge, .process) that git runs while it compares+ * a work tree with HEAD, so status, diff and `worktree remove` execute it. The console reads and removes worktrees of projects it did not make,+ * so it lists the configured drivers (a config read, nothing runs) and blanks each one on the command line before the git command that would+ * run it. Every real-git case has a positive control: the same config runs the program under the plain command.+ */+import { execFile } from 'node:child_process'+import { chmod, mkdtemp, rm, utimes, writeFile, readFile } from 'node:fs/promises'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import { promisify } from 'node:util'++import { afterAll, beforeAll, describe, expect, it } from 'vitest'++import { diffArgv } from '../hooks/data/wf-drill-io'+import { FILTER_KEYS_ARGV, filterGuarded, filterOverrides } from '../hooks/data/git-filters'+import { REMOVE_ARGV, STATUS_ARGV } from '../hooks/data/wf-worktrees'++const sh = promisify(execFile)+const isWin = process.platform === 'win32'+const ENV = { ...process.env, GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_SYSTEM: '/dev/null', GIT_CONFIG_NOSYSTEM: '1' }++const run = async (argv: readonly string[]): Promise<{ stdout: string; stderr: string; exitCode: number }> => {+ try {+ const out = await sh(argv[0] as string, argv.slice(1) as string[], { env: ENV, timeout: 20_000 })++ return { stdout: out.stdout, stderr: out.stderr, exitCode: 0 }+ } catch (error) {+ const e = error as { stdout?: string; stderr?: string; code?: number }++ return { stdout: e.stdout ?? '', stderr: e.stderr ?? '', exitCode: typeof e.code === 'number' ? e.code : 1 }+ }+}++describe('filterOverrides: the drivers git lists become empty command-line overrides', () => {+ it('blanks clean, smudge and process for every driver, dotted names included, once each', () => {+ const overrides = filterOverrides('filter.evil.clean\nfilter.evil.smudge\nfilter.a.b.process\nfilter.evil.process\n')++ expect(overrides).toEqual(['-c', 'filter.evil.clean=', '-c', 'filter.evil.smudge=', '-c', 'filter.a.b.process=', '-c', 'filter.evil.process='])+ })++ it('is empty when no driver is configured', () => {+ expect(filterOverrides('')).toEqual([])+ expect(filterOverrides('\n')).toEqual([])+ })++ it('fails closed (null) on a name it cannot override exactly: an equals sign, a space, a control character or an odd key', () => {+ for (const text of ['filter.a=b.clean\n', 'filter.a b.clean\n', 'filter.a\u0001.clean\n', 'filter..clean\n', 'filter.x.clean.extra\n', 'other.x.clean\n']) {+ expect(filterOverrides(text), JSON.stringify(text)).toBeNull()+ }+ })++ it('the listing is a config read with a fixed argv', () => {+ const argv = FILTER_KEYS_ARGV('/x')++ expect(argv.slice(0, 3)).toEqual(['git', '-C', '/x'])+ expect(argv).toContain('config')+ expect(argv).toContain('--get-regexp')+ expect(argv.join(' ')).not.toMatch(/\s(-c|status|diff|remove)\s/)+ })+})++describe('filterGuarded: the argv gains the overrides, or the command is refused', () => {+ const ok = (stdout: string, exitCode = 0) => async () => ({ stdout, stderr: '', exitCode })++ it('puts the overrides right after git and leaves every other word in place', async () => {+ const argv = await filterGuarded(ok('filter.evil.clean\n'), '/wt', ['git', '-C', '/wt', 'status'])++ expect(argv).toEqual(['git', '-c', 'filter.evil.clean=', '-C', '/wt', 'status'])+ })++ it('returns the argv unchanged when git finds no driver (exit 1, nothing printed)', async () => {+ const argv = await filterGuarded(ok('', 1), '/wt', ['git', '-C', '/wt', 'status'])++ expect(argv).toEqual(['git', '-C', '/wt', 'status'])+ })++ it('refuses (null) when the listing fails, throws, or names something it cannot blank', async () => {+ expect(await filterGuarded(ok('', 128), '/wt', ['git', 'status'])).toBeNull()+ expect(await filterGuarded(async () => { throw new Error('boom') }, '/wt', ['git', 'status'])).toBeNull()+ expect(await filterGuarded(ok('filter.a b.clean\n'), '/wt', ['git', 'status'])).toBeNull()+ })++ it('refuses an argv that does not start with git', async () => {+ expect(await filterGuarded(ok(''), '/wt', ['rm', '-rf', '/'])).toBeNull()+ })+})++describe.skipIf(isWin)('real git: a configured filter driver does not run', () => {+ let dir = ''+ let mark = ''++ const setup = async (name: string, kind: 'clean' | 'process' | 'smudge', driver: string): Promise<{ main: string; wt: string }> => {+ const main = join(dir, name)++ await sh('git', ['init', '-q', main], { env: ENV })+ await sh('git', ['-C', main, 'config', 'user.email', '[email protected]'], { env: ENV })+ await sh('git', ['-C', main, 'config', 'user.name', 't'], { env: ENV })+ await writeFile(join(main, 'a'), 'a\n')+ await writeFile(join(main, 'f.txt'), 'hi\n')+ await writeFile(join(main, '.gitattributes'), `*.txt filter=${driver}\n`)+ await sh('git', ['-C', main, 'add', '.'], { env: ENV })+ await sh('git', ['-C', main, 'commit', '-qm', 'c'], { env: ENV })+ await sh('git', ['-C', main, 'worktree', 'add', '-q', join(main, '.git-worktrees', 'w1'), '-b', 'w1'], { env: ENV })++ const script = join(dir, `${name}.sh`)++ await writeFile(script, `#!/bin/sh\necho ran >> ${mark}\ncat\n`)+ await chmod(script, 0o755)+ await sh('git', ['-C', main, 'config', `filter.${driver}.${kind}`, script], { env: ENV })++ const wt = join(main, '.git-worktrees', 'w1')++ // a stale mtime makes git compare content, which is when it runs the clean filter+ await utimes(join(wt, 'f.txt'), new Date('2001-01-01'), new Date('2001-01-01'))++ return { main, wt }+ }++ const ran = async (): Promise<boolean> => (await readFile(mark, 'utf8').catch(() => '')).includes('ran')+ const reset = async (): Promise<void> => { await rm(mark, { force: true }) }++ beforeAll(async () => {+ dir = await mkdtemp(join(tmpdir(), 'rfc-filter-'))+ mark = join(dir, 'MARK')+ })++ afterAll(async () => {+ await rm(dir, { recursive: true, force: true })+ })++ it('status: the plain probe runs the driver (control), the guarded one does not', async () => {+ const { wt } = await setup('s', 'clean', 'evil')++ await reset()+ await run(STATUS_ARGV(wt))+ expect(await ran(), 'positive control: the unguarded probe runs the driver').toBe(true)++ await reset()+ const guarded = await filterGuarded(run, wt, STATUS_ARGV(wt))++ expect(guarded).not.toBeNull()+ await run(guarded as string[])+ expect(await ran()).toBe(false)+ })++ it('diff: the guarded numstat does not run a clean driver', async () => {+ const { wt } = await setup('d', 'clean', 'evil')++ await reset()+ await run(diffArgv(wt))+ expect(await ran(), 'positive control').toBe(true)++ await reset()+ await run((await filterGuarded(run, wt, diffArgv(wt))) as string[])+ expect(await ran()).toBe(false)+ })++ it('removal: the guarded git worktree remove does not run the driver and still removes a clean worktree', async () => {+ const { main, wt } = await setup('r', 'clean', 'evil')++ await reset()+ const guarded = await filterGuarded(run, wt, REMOVE_ARGV(main, wt))++ expect(guarded).not.toBeNull()+ await run(guarded as string[])+ expect(await ran()).toBe(false)+ expect((await run(['git', '-C', main, 'worktree', 'list', '--porcelain'])).stdout).not.toContain('.git-worktrees/w1')+ })++ it('a dotted driver name and a process driver are blanked too', async () => {+ const { wt } = await setup('p', 'process', 'evil.dotted')++ await reset()+ await run(STATUS_ARGV(wt))+ expect(await ran(), 'positive control: process drivers run under status').toBe(true)++ await reset()+ await run((await filterGuarded(run, wt, STATUS_ARGV(wt))) as string[])+ expect(await ran()).toBe(false)+ })++ it('a driver name the console cannot blank exactly stops the probe (null) instead of running it', async () => {+ const { wt } = await setup('x', 'clean', 'with space')++ await reset()+ expect(await filterGuarded(run, wt, STATUS_ARGV(wt))).toBeNull()+ expect(await ran()).toBe(false)+ })+})diff --git a/plugins/ruflo-console/tests/wf-drill-read.spec.ts b/plugins/ruflo-console/tests/wf-drill-read.spec.tsindex 0849433206..0ef0d2080c 100644--- a/plugins/ruflo-console/tests/wf-drill-read.spec.ts+++ b/plugins/ruflo-console/tests/wf-drill-read.spec.ts@@ -5,7 +5,11 @@*/import { describe, expect, it } from 'vitest'+import { FILTER_KEYS_ARGV } from '../hooks/data/git-filters'import { diffArgv, isProjectDir, isRunFile, parseNumstat } from '../hooks/data/wf-drill-io'++/** The repository lists no filter driver: git config --get-regexp exits 1 and prints nothing. */+const NO_FILTERS = { exitCode: 1, stdout: '' }import { bindWorkflowDrill } from '../hooks/wf-drill'import { drillOf } from '../hooks/views/wf-detail'import { back, line, sample, SECRET, use } from './fixtures/wf-drill'@@ -30,15 +34,16 @@ describe('Files and Result', () => {})it('reads the worktree diff stat through one fixed argv when bound, and joins it to the named files', async () => {- const world = await worldOf(liveFiles(), {}, async () => ({ exitCode: 0, stdout: '3\t1\ta.ts\n-\t-\timg.png\nnot a numstat line\n' }))+ const world = await worldOf(liveFiles(), {}, async argv => (argv.includes('--get-regexp') ? NO_FILTERS : { exitCode: 0, stdout: '3\t1\ta.ts\n-\t-\timg.png\nnot a numstat line\n' }))+bindWorkflowDrill(world.state, world.host as never)toAgent(world)click(frame(world).tree, 'wf-sub-files')await flush()- expect(world.spied.runs).toEqual([diffArgv(WT)])- expect(world.spied.runs[0]).toEqual(['git', '--no-optional-locks', '-c', 'core.fsmonitor=false', '-C', WT, 'diff', '--numstat', '--no-renames', '--no-color', '--no-ext-diff', '--no-textconv', 'HEAD', '--'])+ expect(world.spied.runs).toEqual([[...FILTER_KEYS_ARGV(WT)], diffArgv(WT)])+ expect(world.spied.runs[1]).toEqual(['git', '--no-optional-locks', '-c', 'core.fsmonitor=false', '-C', WT, 'diff', '--numstat', '--no-renames', '--no-color', '--no-ext-diff', '--no-textconv', 'HEAD', '--'])const text = screen(world)@@ -52,7 +57,7 @@ describe('Files and Result', () => {const hash = 'a'.repeat(40)const path = `${WT}/node_modules/.pnpm/[email protected]_${hash}/index.ts`const text = [line('assistant', 1, [use('t1', 'Edit', { file_path: path, old_string: 'a', new_string: 'b' })]), line('user', 2, [back('t1', 'ok')])].join('\n')- const world = await worldOf(liveFiles({ [`${RUN}/agent-a1.jsonl`]: text }), {}, async () => ({ exitCode: 0, stdout: `5\t2\tnode_modules/.pnpm/[email protected]_${hash}/index.ts\n` }))+ const world = await worldOf(liveFiles({ [`${RUN}/agent-a1.jsonl`]: text }), {}, async argv => (argv.includes('--get-regexp') ? NO_FILTERS : { exitCode: 0, stdout: `5\t2\tnode_modules/.pnpm/[email protected]_${hash}/index.ts\n` }))bindWorkflowDrill(world.state, world.host as never)toAgent(world)