feat(mods): enable Project Anatole (ruflo-protector) by default (#5046)

ruflo init and ruflo mods install now enable ruflo-protector@ruflo with
the other ruflo mods (MOD_PLUGINS). It starts in learn mode, graduates
only to notify, and never enables enforce by itself. An explicit false
in enabledPlugins is preserved. ADR-453 §14.1 amended; protector 0.1.3.

Co-authored-by: r <r@x>
This commit is contained in:
rUvandr authored and GitHub committed 2026-11-19 15:02:49 -05:00
1 parent 839c3b96d7
commit d9213d356c
16 files changed
+35 -27

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@
{
"name": "ruflo-protector",
"source": "./plugins/ruflo-protector",
"description": "Project Anatole: an optional, learning watchdog for unattended agents (OWASP-mapped rules, a per-project baseline, learn / notify / enforce modes). Default off."
"description": "Project Anatole: an optional, learning watchdog for unattended agents (OWASP-mapped rules, a per-project baseline, learn / notify / enforce modes). Enabled by ruflo init in learn mode."
},
{
"name": "ruflo-browser",
+2 -1
View File
@@ -285,7 +285,8 @@
"enabledPlugins": {
"ruflo-mods@ruflo": true,
"ruflo-swarm@ruflo": true,
"ruflo-console@ruflo": true
"ruflo-console@ruflo": true,
"ruflo-protector@ruflo": true
},
"extraKnownMarketplaces": {
"ruflo": { "source": { "source": "github", "repo": "ruvnet/ruflo" } }
+1 -1
View File
@@ -50,7 +50,7 @@ claude $(ls -d plugins/ruflo-*/ | sed 's|^|--plugin-dir |' | tr '\n' ' ')
|--------|-------------|
| [ruflo-security-audit](ruflo-security-audit/) | CVE scanning, dependency vulnerability checks |
| [ruflo-aidefence](ruflo-aidefence/) | Prompt injection detection, PII scanning |
| [ruflo-protector](ruflo-protector/) | Project Anatole: optional learning watchdog for unattended agents (default off) |
| [ruflo-protector](ruflo-protector/) | Project Anatole: optional learning watchdog for unattended agents (enabled by `ruflo init`, learn mode) |
| [ruflo-testgen](ruflo-testgen/) | Test gap detection, TDD London School workflow |
| [ruflo-browser](ruflo-browser/) | Playwright browser automation and testing |
| [agentic-qe-fleet](https://github.com/proffesor-for-testing/agentic-qe/tree/v3.15.17/plugins/agentic-qe-fleet) | External ([Agentic QE](https://github.com/proffesor-for-testing/agentic-qe), pinned in the marketplace): QE agents, coverage, chaos, TDD skills, `agentic-qe` MCP server. Install with `/plugin install agentic-qe-fleet@ruflo`; not in this folder, so `--plugin-dir` does not load it. Install it from one marketplace only (`agentic-qe` or `ruflo`), not both: enabled from both, its mod and commands load twice |
@@ -1,7 +1,7 @@
{
"name": "ruflo-protector",
"description": "Project Anatole: an optional, learning watchdog for unattended agents. Deterministic OWASP-mapped rules, a per-project behavioural baseline, four modes (off, learn, notify, enforce), alerts you can read later.",
"version": "0.1.2",
"version": "0.1.3",
"repository": "https://github.com/ruvnet/ruflo",
"author": {
"name": "ruvnet",
+3
View File
@@ -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; this is the whole history.
## 0.1.3 — 2026-11-19
- feat: Project Anatole is on by default: ruflo 3.79.0 adds it to the mod bundle, so `ruflo init` and `ruflo mods install` enable it in `learn` mode (ADR-453 §14.1 amendment); an explicit `false` in `enabledPlugins` is kept
## 0.1.2 — 2026-10-12
- fix: the shared text screen now catches `.env` and e-mailed credentials, no longer flags a model's token talk (`--max-tokens`, `/oauth/token`, "token usage"), and no longer flags values that only name where a secret lives (`./service-account.json`, `--set-secrets=NAME=NAME:latest`); every rule stays linear (#4094, thanks @proffesor-for-testing)
+1 -1
View File
@@ -1,6 +1,6 @@
# ruflo-protector: Project Anatole
**Project Anatole** is an optional, learning watchdog for unattended agents (`/loop` ticks, headless `claude -p` workers, overnight swarms). It is a mod ([ADR-404](../../v3/docs/adr/ADR-404-ruflo-as-a-mod.md) pattern) that watches what the agent does, applies a small set of deterministic, OWASP-mapped rules, remembers what is normal for the project, and leaves a record you can read when you come back. Design and threat model: [ADR-453](../../v3/docs/adr/ADR-453-project-anatole.md). Version 0.1.1, **default off** (not in any install bundle).
**Project Anatole** is an optional, learning watchdog for unattended agents (`/loop` ticks, headless `claude -p` workers, overnight swarms). It is a mod ([ADR-404](../../v3/docs/adr/ADR-404-ruflo-as-a-mod.md) pattern) that watches what the agent does, applies a small set of deterministic, OWASP-mapped rules, remembers what is normal for the project, and leaves a record you can read when you come back. Design and threat model: [ADR-453](../../v3/docs/adr/ADR-453-project-anatole.md). Version 0.1.3. **On by default since ruflo 3.79.0**: `ruflo init` and `ruflo mods install` enable it with the other ruflo mods, in `learn` mode, so it watches silently until its baseline matures and then only notifies. It never turns on `enforce` by itself. To turn it off, run `/protector mode off`, or set `"ruflo-protector@ruflo": false` in `enabledPlugins` (ruflo keeps that choice on later installs).
> The technical id stays `ruflo-protector` (command `/protector`, files `.claude-flow/protector-mod/`, rule ids `PR-001..013`). "Project Anatole" is what a person sees.
+1 -1
View File
@@ -1,5 +1,5 @@
{
"description": "Project Anatole as a mod (ADR-453): a learning watchdog for unattended agents. Deterministic OWASP-mapped rules (the only thing that can block), a per-project baseline (notify only), /protector, and status.json, alerts.jsonl, baseline.json under .claude-flow/protector-mod/. Default off in every bundle; default mode learn once installed.",
"description": "Project Anatole as a mod (ADR-453): a learning watchdog for unattended agents. Deterministic OWASP-mapped rules (the only thing that can block), a per-project baseline (notify only), /protector, and status.json, alerts.jsonl, baseline.json under .claude-flow/protector-mod/. Enabled by ruflo init and ruflo mods install since ruflo 3.79.0; default mode learn, graduates to notify, never to enforce.",
"modules": [
"./register.ts"
]
+3 -3
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Structural smoke test for ruflo-protector v0.1.2, Project Anatole (ADR-453).
# Structural smoke test for ruflo-protector v0.1.3, Project Anatole (ADR-453).
set -u
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
PASS=0
@@ -8,9 +8,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-protector 0.1.2 and names Project Anatole"
step "1. plugin.json declares ruflo-protector 0.1.3 and names Project Anatole"
grep -q '"name": "ruflo-protector"' "$ROOT/.claude-plugin/plugin.json" \
&& grep -q '"version": "0.1.2"' "$ROOT/.claude-plugin/plugin.json" \
&& grep -q '"version": "0.1.3"' "$ROOT/.claude-plugin/plugin.json" \
&& grep -q 'Project Anatole' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version/description"
step "2. hooks.json names register.ts and every hook file is present and under 500 lines"
@@ -26,8 +26,8 @@ const BAD_HOOKS = JSON.stringify({ hooks: { SessionStart: [{ hooks: [{ type: 'co
/** A ruflo marketplace clone carrying the three mod plugins, registered in a temp Claude config dir. */
function clone(badSwarm: boolean): string {
const at = join(tmp, 'clone');
write('clone/.claude-plugin/marketplace.json', JSON.stringify({ name: 'ruflo', plugins: ['ruflo-mods', 'ruflo-swarm', 'ruflo-console'].map((name) => ({ name, source: `./plugins/${name}` })) }));
for (const name of ['ruflo-mods', 'ruflo-swarm', 'ruflo-console']) write(`clone/plugins/${name}/.claude-plugin/plugin.json`, JSON.stringify({ name }));
write('clone/.claude-plugin/marketplace.json', JSON.stringify({ name: 'ruflo', plugins: ['ruflo-mods', 'ruflo-swarm', 'ruflo-console', 'ruflo-protector'].map((name) => ({ name, source: `./plugins/${name}` })) }));
for (const name of ['ruflo-mods', 'ruflo-swarm', 'ruflo-console', 'ruflo-protector']) write(`clone/plugins/${name}/.claude-plugin/plugin.json`, JSON.stringify({ name }));
if (badSwarm) write('clone/plugins/ruflo-swarm/hooks/hooks.json', BAD_HOOKS);
write('cfg/plugins/known_marketplaces.json', JSON.stringify({ ruflo: { installLocation: at, source: { source: 'github', repo: 'ruvnet/ruflo' } } }));
return at;
@@ -53,7 +53,7 @@ describe.skipIf(!CLI_BUILT)('ADR-404 mods through the built CLI', () => {
expect(out).toContain('claude plugin install ruflo-mods@ruflo --scope project');
expect(out).toContain('with them off, or the rollout switch off, they do nothing and the classic hooks keep every event');
const shared = JSON.parse(readFileSync(join(t.cwd, '.claude', 'settings.json'), 'utf8'));
for (const id of ['ruflo-mods@ruflo', 'ruflo-swarm@ruflo', 'ruflo-console@ruflo']) expect(shared.enabledPlugins[id]).toBe(true);
for (const id of ['ruflo-mods@ruflo', 'ruflo-swarm@ruflo', 'ruflo-console@ruflo', 'ruflo-protector@ruflo']) expect(shared.enabledPlugins[id]).toBe(true);
expect(shared.extraKnownMarketplaces.ruflo.source).toEqual({ source: 'github', repo: 'ruvnet/ruflo' });
expect(shared.env.CLAUDE_CODE_ENABLE_FUNCTION_HOOKS).toBe('1');
// Classic hooks are untouched: still the default and the fallback.
@@ -35,7 +35,7 @@ describe('ADR-404 mods install / uninstall', () => {
const r = installMod(root, 'local');
const s = read(join(root, '.claude', 'settings.local.json'));
for (const id of MOD_PLUGIN_IDS) expect(s.enabledPlugins[id]).toBe(true);
expect(MOD_PLUGIN_IDS).toEqual(['ruflo-mods@ruflo', 'ruflo-swarm@ruflo', 'ruflo-console@ruflo']);
expect(MOD_PLUGIN_IDS).toEqual(['ruflo-mods@ruflo', 'ruflo-swarm@ruflo', 'ruflo-console@ruflo', 'ruflo-protector@ruflo']);
expect(s.extraKnownMarketplaces.ruflo.source).toEqual({ source: 'github', repo: 'ruvnet/ruflo' });
expect(s.env[ENABLE_ENV]).toBe('1');
expect(r.added).toEqual({ plugins: [...MOD_PLUGIN_IDS], marketplace: true, env: true });
@@ -53,7 +53,7 @@ describe('ADR-404 mods install / uninstall', () => {
writeFileSync(file, JSON.stringify(before));
const r = installMod(root, 'project');
expect(r.backup && existsSync(r.backup)).toBe(true);
expect(r.added).toEqual({ plugins: ['ruflo-mods@ruflo', 'ruflo-console@ruflo'], marketplace: false, env: false });
expect(r.added).toEqual({ plugins: ['ruflo-mods@ruflo', 'ruflo-console@ruflo', 'ruflo-protector@ruflo'], marketplace: false, env: false });
const after = read(file);
expect(after.extraKnownMarketplaces.ruflo.source.source).toBe('directory'); // never replaced
expect(after.enabledPlugins['ruflo-swarm@ruflo']).toBe(false); // their decision
@@ -42,7 +42,7 @@ const status = (all: Finding[], name: string) => all.find((f) => f.name === name
/**
* A stand-in claude. `marketplace add|update` leaves a clone carrying
* ruflo-mods, ruflo-swarm and ruflo-console, or, with
* ruflo-mods, ruflo-swarm, ruflo-console and ruflo-protector, or, with
* mode 'stale', a clone without any of them; `install <id>` records it the
* way Claude Code does. Every argv is logged.
*/
@@ -60,7 +60,7 @@ if (argv[1] === 'marketplace' && argv[3] && argv[3].startsWith('/')) {
} else if (argv[1] === 'marketplace') {
const clone = path.join(cfg, 'marketplaces', 'ruflo');
fs.mkdirSync(path.join(clone, 'plugins'), { recursive: true });
if (${JSON.stringify(mode)} === 'ok') for (const p of ['ruflo-mods', 'ruflo-swarm', 'ruflo-console']) {
if (${JSON.stringify(mode)} === 'ok') for (const p of ['ruflo-mods', 'ruflo-swarm', 'ruflo-console', 'ruflo-protector']) {
fs.mkdirSync(path.join(clone, 'plugins', p, '.claude-plugin'), { recursive: true });
fs.writeFileSync(path.join(clone, 'plugins', p, '.claude-plugin', 'plugin.json'), '{}');
}
@@ -109,14 +109,16 @@ describe('ADR-404 ruflo mods install (standalone)', () => {
'plugin install ruflo-mods@ruflo --scope local',
'plugin install ruflo-swarm@ruflo --scope local',
'plugin install ruflo-console@ruflo --scope local',
'plugin install ruflo-protector@ruflo --scope local',
]);
const all = await findings();
expect(status(all, 'plugin ruflo-mods@ruflo')).toBe('pass');
expect(status(all, 'plugin ruflo-swarm@ruflo')).toBe('pass');
expect(status(all, 'plugin ruflo-console@ruflo')).toBe('pass');
expect(status(all, 'plugin ruflo-protector@ruflo')).toBe('pass');
// A re-run: the marketplace is known now, so it is updated, not re-added.
await sub(modsCommand, 'install').action!(ctx());
expect(calls()[4]).toBe('plugin marketplace update ruflo');
expect(calls()[5]).toBe('plugin marketplace update ruflo');
});
it('the reported bug: a stale clone fails doctor; install refreshes it and doctor passes', async () => {
@@ -154,10 +156,10 @@ describe('ADR-404 mods uninstall: claude plugin uninstall exactly what ruflo ins
mkdirSync(join(cfg, 'cache', 'pre'), { recursive: true });
writeFileSync(join(cfg, 'installed_plugins.json'), JSON.stringify({ version: 2, plugins: { 'ruflo-swarm@ruflo': [{ scope: 'local', installPath: join(cfg, 'cache', 'pre'), projectPath: root }] } }));
await sub(modsCommand, 'install').action!(ctx());
expect(read(join(root, '.claude-flow', 'mods', 'install.json')).files[join(root, '.claude', 'settings.local.json')].claudeInstalled).toEqual(['ruflo-mods@ruflo', 'ruflo-console@ruflo']);
expect(read(join(root, '.claude-flow', 'mods', 'install.json')).files[join(root, '.claude', 'settings.local.json')].claudeInstalled).toEqual(['ruflo-mods@ruflo', 'ruflo-console@ruflo', 'ruflo-protector@ruflo']);
const r = await sub(modsCommand, 'uninstall').action!(ctx());
expect(r.success).toBe(true);
expect(calls().filter((c) => c.includes(' uninstall '))).toEqual(['plugin uninstall ruflo-mods@ruflo --scope local', 'plugin uninstall ruflo-console@ruflo --scope local']);
expect(calls().filter((c) => c.includes(' uninstall '))).toEqual(['plugin uninstall ruflo-mods@ruflo --scope local', 'plugin uninstall ruflo-console@ruflo --scope local', 'plugin uninstall ruflo-protector@ruflo --scope local']);
expect(Object.keys(read(join(cfg, 'installed_plugins.json')).plugins)).toEqual(['ruflo-swarm@ruflo']);
expect(read(join(root, '.claude', 'settings.local.json'))).toEqual({});
});
@@ -166,7 +168,7 @@ describe('ADR-404 mods uninstall: claude plugin uninstall exactly what ruflo ins
describe('ADR-404 mods install --source local (dogfooding)', () => {
const checkout = () => {
const dir = join(home, 'ruflo-checkout');
for (const p of ['ruflo-mods', 'ruflo-swarm', 'ruflo-console']) {
for (const p of ['ruflo-mods', 'ruflo-swarm', 'ruflo-console', 'ruflo-protector']) {
mkdirSync(join(dir, 'plugins', p, '.claude-plugin'), { recursive: true });
writeFileSync(join(dir, 'plugins', p, '.claude-plugin', 'plugin.json'), '{}');
}
@@ -229,7 +231,7 @@ describe('ADR-404 amendment: ruflo init upgrade --mods', () => {
expect(after.hooks).toEqual(userSettings.hooks);
expect(after.permissions).toEqual(userSettings.permissions);
expect(after.env).toEqual({ MY_VAR: 'keep', CLAUDE_CODE_ENABLE_FUNCTION_HOOKS: '1' });
expect(after.enabledPlugins).toEqual({ 'mine@elsewhere': true, 'ruflo-swarm@ruflo': false, 'ruflo-mods@ruflo': true, 'ruflo-console@ruflo': true });
expect(after.enabledPlugins).toEqual({ 'mine@elsewhere': true, 'ruflo-swarm@ruflo': false, 'ruflo-mods@ruflo': true, 'ruflo-console@ruflo': true, 'ruflo-protector@ruflo': true });
expect(after.extraKnownMarketplaces.ruflo.source).toEqual({ source: 'github', repo: 'ruvnet/ruflo' });
expect(calls()).toContain('plugin install ruflo-mods@ruflo --scope project');
// A plugin the user set to false is never installed (claude plugin install would flip it on).
@@ -37,7 +37,7 @@ function fakeFs(files: Record<string, unknown>, dirs: string[] = []): ReadFs {
}
const known = { [join(CFG, 'plugins', 'known_marketplaces.json')]: { ruflo: { source: { source: 'github', repo: 'ruvnet/ruflo' }, installLocation: CLONE } } };
const fresh = { [manifest('ruflo-mods')]: '{}', [manifest('ruflo-swarm')]: '{}', [manifest('ruflo-console')]: '{}' };
const fresh = { [manifest('ruflo-mods')]: '{}', [manifest('ruflo-swarm')]: '{}', [manifest('ruflo-console')]: '{}', [manifest('ruflo-protector')]: '{}' };
const staleOnlySwarm = { [manifest('ruflo-swarm')]: '{}' };
const installedHere = (entry: Record<string, unknown> = {}) => ({
[join(CFG, 'plugins', 'installed_plugins.json')]: { version: 2, plugins: { 'ruflo-mods@ruflo': [{ scope: 'local', installPath: CACHE, projectPath: ROOT, ...entry }] } },
@@ -81,7 +81,7 @@ describe('ADR-404 plugin resolution: findings', () => {
it('the reported bug: a stale clone and no cached install FAILS with the exact commands', () => {
const f = byName(resolveFindings(ROOT, 'local', CFG, fakeFs({ ...known, ...staleOnlySwarm }, [CLONE])));
expect(f['plugin ruflo-mods@ruflo']).toMatchObject({ status: 'fail', message: expect.stringContaining('/ruflo-mods is an unknown command') });
expect(f['plugin ruflo-mods@ruflo']!.fix).toBe(`cd "${ROOT}" && claude plugin marketplace update ruflo && claude plugin install ruflo-mods@ruflo --scope local && claude plugin install ruflo-swarm@ruflo --scope local && claude plugin install ruflo-console@ruflo --scope local`);
expect(f['plugin ruflo-mods@ruflo']!.fix).toBe(`cd "${ROOT}" && claude plugin marketplace update ruflo && claude plugin install ruflo-mods@ruflo --scope local && claude plugin install ruflo-swarm@ruflo --scope local && claude plugin install ruflo-console@ruflo --scope local && claude plugin install ruflo-protector@ruflo --scope local`);
expect(f['plugin ruflo-swarm@ruflo']!.status).toBe('pass');
});
@@ -166,6 +166,7 @@ describe('ADR-404 repair', () => {
['plugin install ruflo-mods@ruflo --scope project', ROOT, INSTALL_TIMEOUT_MS],
['plugin install ruflo-swarm@ruflo --scope project', ROOT, INSTALL_TIMEOUT_MS],
['plugin install ruflo-console@ruflo --scope project', ROOT, INSTALL_TIMEOUT_MS],
['plugin install ruflo-protector@ruflo --scope project', ROOT, INSTALL_TIMEOUT_MS],
]);
expect(calls.flatMap((c) => c.args)).not.toContain('-y');
});
@@ -185,7 +186,7 @@ describe('ADR-404 repair', () => {
const second = harness([0, 1, 0], { ...known, ...fresh });
const collected = await repairPluginInstall({ projectRoot: ROOT, scope: 'local', configDir: CFG, claude: '/bin/claude', exec: second.exec, env: {}, fs: second.fs });
expect(collected.ok).toBe(false);
expect(second.calls).toHaveLength(4);
expect(second.calls).toHaveLength(5);
});
it('an exec that throws is a failed step, not a crash', async () => {
+1 -1
View File
@@ -55,7 +55,7 @@ const rootOption = { name: 'project-root', description: 'Project root (default:
const installSub: Command = {
name: 'install',
description: 'Enable the ruflo mod plugins (ruflo-mods, ruflo-swarm, ruflo-console) for this project; classic hooks stay as fallback',
description: 'Enable the ruflo mod plugins (ruflo-mods, ruflo-swarm, ruflo-console, ruflo-protector) for this project; classic hooks stay as fallback',
options: [
rootOption,
{ name: 'scope', description: 'local (.claude/settings.local.json, default) | project (.claude/settings.json)', type: 'string', default: 'local' },
+1
View File
@@ -44,6 +44,7 @@ export const MOD_PLUGINS: readonly ModPlugin[] = [
{ id: MOD_PLUGIN_ID, required: true },
{ id: 'ruflo-swarm@ruflo', required: true },
{ id: 'ruflo-console@ruflo', required: true },
{ id: 'ruflo-protector@ruflo', required: true },
];
export const MOD_PLUGIN_IDS: readonly string[] = MOD_PLUGINS.map((p) => p.id);
+2 -2
View File
@@ -1,6 +1,6 @@
# ADR 453: Project Anatole: an optional, learning watchdog for unattended agents
Status: Proposed (default off; nothing here is built when this is merged)
Status: Proposed (default off; nothing here is built when this is merged). Amended 2026-11-19: on by default from ruflo 3.79.0 (see §14.1).
Date: 2026-10-05
@@ -179,6 +179,6 @@ The console reads `status.json`, `rules.json` and the tail of `alerts.jsonl` thr
## 14. Rollout and open items
1. Ship `ruflo-protector` default-off (not in any install bundle), default mode `learn` once installed, `autoGraduate` to `notify` on maturity, never to `enforce`.
1. Ship `ruflo-protector` default-off (not in any install bundle), default mode `learn` once installed, `autoGraduate` to `notify` on maturity, never to `enforce`. **Amended 2026-11-19 (ruflo 3.79.0):** the protector is now in the mod bundle (`MOD_PLUGINS`), so `ruflo init` and `ruflo mods install` enable it with the other mods. Everything else in this item stands: it starts in `learn`, graduates only to `notify`, and never enables `enforce` by itself. An explicit `"ruflo-protector@ruflo": false` in a settings file is kept on later installs, and `/protector mode off` turns it off per project. Why: an unattended agent is the case the protector exists for, and a watchdog nobody installed watches nothing. The 24 benign-trace corpus gate and the fail-open design keep the default quiet.
2. After a week of `notify` on real projects, review the acked share per rule and decide which rules deserve `block` by default.
3. Open: whether to offer an organisation-wide baseline (a shared allow list) without sharing values; whether the protector should also watch the other mods' status files for tampering (T11); and how to reach a person off-machine for a critical alert on a long unattended run (a channel outside the mod sandbox, which mods deliberately do not have).