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

feat(ruflo-console 0.33.5): per-session action budget per class and install class at full (ADR-450 T8)

ruveade0fd9dc81
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index b5fd70a74a..fa7e57baa6 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.33.4",
+ "version": "0.33.5",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --git a/plugins/ruflo-console/hooks/model-tools.ts b/plugins/ruflo-console/hooks/model-tools.ts
index 28bb7936c4..c3af8edac0 100644
--- a/plugins/ruflo-console/hooks/model-tools.ts
+++ b/plugins/ruflo-console/hooks/model-tools.ts
@@ -25,7 +25,7 @@ export const LEVELS = ['off', 'read', 'write', 'manage', 'full'] as const
export type ControlLevel = (typeof LEVELS)[number]
export type ControlConfirm = 'ask' | 'auto'
/** What an action does, read from its spec; the level it needs follows. */
-export type ActionClass = 'read' | 'write' | 'network' | 'spend' | 'delete'
+export type ActionClass = 'read' | 'write' | 'network' | 'install' | 'spend' | 'delete'
export const MAX_CALLS_PER_TURN = 40
export const MAX_TEXT = 500
@@ -34,7 +34,7 @@ export const DRIVING_MS = 60_000
const SCREEN_MAX = 3500
const LOG_MAX = 40
-const NEEDS: Record<ActionClass, ControlLevel> = { read: 'read', write: 'write', network: 'manage', spend: 'full', delete: 'full' }
+const NEEDS: Record<ActionClass, ControlLevel> = { read: 'read', write: 'write', network: 'manage', install: 'full', spend: 'full', delete: 'full' }
const rank = (level: ControlLevel): number => LEVELS.indexOf(level)
type Spec = { name: string; description: string; inputSchema: Record<string, unknown>; needs: ControlLevel }
@@ -54,6 +54,8 @@ export const TOOL_SPECS: readonly Spec[] = [
*/
const DELETE = /\b(delet|remov|kill|terminat|destr[ou]y|shut ?down|stop|reset|rollback|cancel|wip(e|ing)|purg|prun|uninstall|force|clean ?up|migrat|drop|eras|unlink|truncat|revok|discard|flush|evict|unregister|nuke|abort|shell command|runs a shell|runs your (test|code)|terminal_execute|rm -)/
const SPEND = /\$\$|billed|costs? money|may cost|model turn|starts a (claude|codex)|spends (money|tokens|credits)|\bpaid\b|may call models|calls the anthropic api|with your (anthropic |api )?key|api key|openrouter|real (model|judge)/
+/** Code that runs with Claude Code's own access, or settings and hooks that change how it behaves: plugin and marketplace changes (ADR-450 T8). */
+const INSTALL = /\b(install\w*|marketplace|claude plugin|plugin (enable|disable|update)|enabledplugins|settings(\.local)?\.json|hooks\.json)/
const NETWORK = /\b(network|publish|deploy|push|install|download|fetch|registry|github|npm|gcloud|upload|update|clone|join|federat|reaches|curl|https?:|ssh|webhook|slack|ipfs|pi\.ruv\.io|x\.ruv\.io|relay|peer|broadcast|sends?|sync)/
/** Which class an action is, from its label, command and notes; anything unclear counts as the most dangerous class. */
@@ -67,6 +69,7 @@ export function classOf(pending: Pick<Pending, 'label' | 'args' | 'note' | 'show
if (DELETE.test(text)) return 'delete'
if (SPEND.test(text)) return 'spend'
+ if (INSTALL.test(text)) return 'install'
if (NETWORK.test(text)) return 'network'
return 'write'
@@ -97,7 +100,14 @@ export function lowerOnly(saved: { level: ControlLevel; confirm: ControlConfirm
}
/** Classes whose effect leaves the machine, costs money or cannot be undone: they always wait for the person, whatever `modelConfirm` says (ADR-450 T8). */
-export const ALWAYS_ASK: readonly ActionClass[] = ['network', 'spend', 'delete']
+export const ALWAYS_ASK: readonly ActionClass[] = ['network', 'install', 'spend', 'delete']
+
+/**
+ * How many actions of each class Claude may put through the console in one session (ADR-450 T8). The per-turn cap bounds one turn; a /loop gets
+ * a fresh turn each time, so this one spans the session. Past it, a write action waits for the person's Yes even in auto, and an action of a
+ * class that always asks is refused, so the person is not asked again and again for the same kind of thing.
+ */
+export const SESSION_BUDGET: Record<Exclude<ActionClass, 'read'>, number> = { write: 20, network: 5, install: 2, spend: 3, delete: 3 }
export type ModelToolDeps = { state: State; control: Controller }
@@ -206,10 +216,23 @@ async function settlePending(deps: ModelToolDeps, tool: string, id: string, aske
return { status: 'refused', text: `"${plain(pending.label, 80)}" is a ${kind} action and control is set to "${level}" (it needs "${NEEDS[kind]}"). The person can raise it in Settings → Claude control. Nothing ran.` }
}
- if (confirmOf(ai.modelConfirm) === 'ask' || ALWAYS_ASK.includes(kind)) {
+ const budget = kind === 'read' ? Infinity : SESSION_BUDGET[kind]
+ const used = state.control.used[kind] ?? 0
+ const over = used >= budget
+
+ if (over && ALWAYS_ASK.includes(kind)) {
+ control.runner.cancel()
+ say(state, tool, `${id}: ${kind} budget used`, 'denied', pending.label)
+
+ return { status: 'refused', text: `the session budget for ${kind} actions (${budget}) is used up, so "${plain(pending.label, 80)}" was not queued. Tell the person what you wanted to do and let them do it in the console. Nothing ran.` }
+ }
+
+ state.control.used[kind] = used + 1
+
+ if (confirmOf(ai.modelConfirm) === 'ask' || ALWAYS_ASK.includes(kind) || over) {
say(state, tool, id, 'waiting', pending.label)
- return { status: 'waiting', text: `Waiting for the person to confirm in the console: "${plain(pending.label, 100)}" (${kind}). Expect: ${plain(pending.expect, 160)}. Do not repeat it; call console_state later to see the result.` }
+ return { status: 'waiting', text: `Waiting for the person to confirm in the console: "${plain(pending.label, 100)}" (${kind}${over ? `; the session budget of ${budget} auto-confirmed ${kind} actions is used up` : ''}). Expect: ${plain(pending.expect, 160)}. Do not repeat it; call console_state later to see the result.` }
}
// Mission Control reports its own actions on `last`, the rest on `outcome`: whichever moved is what happened.
diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.ts
index d3ece2173f..26243e4d84 100644
--- a/plugins/ruflo-console/hooks/state.ts
+++ b/plugins/ruflo-console/hooks/state.ts
@@ -295,7 +295,7 @@ export type State = {
timers: Map<string, Timer>
stats: { renders: number[]; refreshes: number[]; frames: number[] }
/** Claude's control of the console (ADR-444): paused by the person, the call counts, and the log the dashboard shows. */
- control: { paused: boolean; calls: number; turnCalls: number; log: ControlEntry[]; /** Until when Claude counts as driving (a tool call extends it): the console does not spend a second Claude turn on guidance meanwhile. */ drivingUntilMs: number; /** True while one of Claude's tool calls is running: a person's "always allow" answer must not let Claude's call skip the level and confirm checks (ADR-444). */ viaModel: boolean }
+ control: { paused: boolean; calls: number; turnCalls: number; /** Model-driven actions this session, by class (ADR-450 T8 budget). */ used: Record<string, number>; log: ControlEntry[]; /** Until when Claude counts as driving (a tool call extends it): the console does not spend a second Claude turn on guidance meanwhile. */ drivingUntilMs: number; /** True while one of Claude's tool calls is running: a person's "always allow" answer must not let Claude's call skip the level and confirm checks (ADR-444). */ viaModel: boolean }
}
export function newState(raw: PluginOptions | undefined): State {
@@ -363,7 +363,7 @@ export function newState(raw: PluginOptions | undefined): State {
devtools: { fields: emptyFields(), tmux: 'unknown' },
timers: new Map(),
stats: { renders: [], refreshes: [], frames: [] },
- control: { paused: false, calls: 0, turnCalls: 0, log: [], drivingUntilMs: 0, viaModel: false },
+ control: { paused: false, calls: 0, turnCalls: 0, used: {}, log: [], drivingUntilMs: 0, viaModel: false },
}
}
diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.ts
index de849e9983..cac7c25dcd 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.33.4'
+export const CONSOLE_VERSION = '0.33.5'
diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh
index bc2dbdbdd2..7c1059d132 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.33.4"
+step "1. plugin.json declares ruflo-console 0.33.5"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.33.4"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.33.5"' "$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/control-guards.spec.ts b/plugins/ruflo-console/tests/control-guards.spec.ts
index e05d7fa0b3..1142e20b77 100644
--- a/plugins/ruflo-console/tests/control-guards.spec.ts
+++ b/plugins/ruflo-console/tests/control-guards.spec.ts
@@ -8,10 +8,10 @@ import { allows, callTool, lowerOnly, parseControlEnv } from '../hooks/model-too
import { setup } from './fixtures/control-setup'
describe('what auto-confirm may never answer (ADR-450 T8)', () => {
- const ENTRIES = { read: 'mission-open', write: 'mission-create', network: 'plugin-install', spend: 'hand-task', delete: 'mission-cancel' } as const
+ const ENTRIES = { read: 'mission-open', write: 'mission-create', network: 'x-publish', install: 'plugin-install', spend: 'hand-task', delete: 'mission-cancel' } as const
const levels = ['read', 'write', 'manage', 'full'] as const
- for (const kind of ['read', 'write', 'network', 'spend', 'delete'] as const) {
+ for (const kind of ['read', 'write', 'network', 'install', 'spend', 'delete'] as const) {
for (const confirm of ['ask', 'auto'] as const) {
for (const level of levels) {
const refused = !allows(level, kind)
@@ -35,7 +35,7 @@ describe('what auto-confirm may never answer (ADR-450 T8)', () => {
it('never confirms a network, spend or delete action in auto, however many times Claude asks', async () => {
const { deps, calls } = setup('full', 'auto')
- for (const id of ['plugin-install', 'hand-task', 'mission-cancel']) {
+ for (const id of ['x-publish', 'plugin-install', 'hand-task', 'mission-cancel']) {
expect(await callTool('console_run', { id }, deps), id).toMatch(/^Waiting for the person to confirm/)
deps.state.pending = null
}
@@ -113,3 +113,57 @@ describe('the environment override may only lower control (ADR-450 T12)', () =>
})
})
+
+describe('session budget per action class and install as full (ADR-450 T8)', () => {
+ it('classes plugin and marketplace changes as install, which needs full and always asks', async () => {
+ const { classOf, allows, ALWAYS_ASK } = await import('../hooks/model-tools')
+ const make = (label: string, note?: string) => ({ label, args: [] as string[], expect: '', ...(note !== undefined && { note }) })
+
+ for (const label of ['install a plugin', 'add the ruflo marketplace to Claude Code', 'update the ruflo marketplace clone', 'claude plugin enable x']) {
+ expect(classOf(make(label)), label).toBe('install')
+ }
+ expect(allows('manage', 'install')).toBe(false)
+ expect(allows('full', 'install')).toBe(true)
+ expect(ALWAYS_ASK).toContain('install')
+ })
+
+ it('asks the person for a write action once the session budget is used, even in auto', async () => {
+ const { SESSION_BUDGET } = await import('../hooks/model-tools')
+ const { deps, calls, state } = setup('write', 'auto')
+
+ for (let i = 0; i < SESSION_BUDGET.write; i += 1) expect(await callTool('console_run', { id: 'mission-create' }, deps)).toMatch(/^(Done|Ran)/)
+ state.control.turnCalls = 0
+
+ const over = await callTool('console_run', { id: 'mission-create' }, deps)
+
+ expect(over).toMatch(/^Waiting for the person to confirm.*session budget of 20 auto-confirmed write actions is used up/)
+ expect(state.pending).not.toBeNull()
+ expect(calls.confirm).toBe(SESSION_BUDGET.write)
+ })
+
+ it('refuses a network action once its budget is used, so the person is not asked again and again', async () => {
+ const { SESSION_BUDGET } = await import('../hooks/model-tools')
+ const { deps, calls, state } = setup('manage', 'auto')
+
+ for (let i = 0; i < SESSION_BUDGET.network; i += 1) {
+ expect(await callTool('console_run', { id: 'x-publish' }, deps)).toMatch(/^Waiting/)
+ state.pending = null
+ }
+
+ const over = await callTool('console_run', { id: 'x-publish' }, deps)
+
+ expect(over).toMatch(/^Refused: the session budget for network actions \(5\) is used up/)
+ expect(state.pending).toBeNull()
+ expect(calls.cancel).toBe(1)
+ expect(state.control.used.network).toBe(SESSION_BUDGET.network)
+ })
+
+ it('counts each class on its own and not read actions', async () => {
+ const { deps, state } = setup('full', 'auto')
+
+ await callTool('console_run', { id: 'mission-open' }, deps)
+ await callTool('console_run', { id: 'mission-create' }, deps)
+ await callTool('console_run', { id: 'plugin-install' }, deps)
+ expect(state.control.used).toEqual({ write: 1, install: 1 })
+ })
+})
diff --git a/plugins/ruflo-console/tests/fixtures/control-setup.ts b/plugins/ruflo-console/tests/fixtures/control-setup.ts
index c81bcee923..91884336b9 100644
--- a/plugins/ruflo-console/tests/fixtures/control-setup.ts
+++ b/plugins/ruflo-console/tests/fixtures/control-setup.ts
@@ -13,7 +13,7 @@ export function setup(level: Level, confirm: 'ask' | 'auto' = 'ask', entries: Re
Object.assign(settingsOf(state).ai, { modelControl: level, modelConfirm: confirm })
- const catalog = { 'mission-open': { label: 'open Mission Control', readOnly: true }, 'mission-create': { label: 'create the mission and its tasks' }, 'mission-cancel': { label: 'cancel the mission and its open tasks' }, 'plugin-install': { label: 'install a plugin', note: 'network: clones it from GitHub' }, 'hand-task': { label: 'hand task t1 to Claude', note: 'Starts a Claude Code turn (billed as any turn is)' }, ...entries }
+ const catalog = { 'mission-open': { label: 'open Mission Control', readOnly: true }, 'mission-create': { label: 'create the mission and its tasks' }, 'mission-cancel': { label: 'cancel the mission and its open tasks' }, 'plugin-install': { label: 'install a plugin', note: 'network: clones it from GitHub' }, 'x-publish': { label: 'publish a note to x.ruv.io', note: 'network: sends it to the relay' }, 'hand-task': { label: 'hand task t1 to Claude', note: 'Starts a Claude Code turn (billed as any turn is)' }, ...entries }
const control = {
host: { invalidate: () => undefined, after: (_ms: number, fn: () => void) => ({ cancel: () => calls.timers.splice(calls.timers.indexOf(fn), 1), fire: fn, ...(calls.timers.push(fn) && {}) }) },
setView: (view: string) => void calls.setView.push(view),
diff --git a/plugins/ruflo-console/tests/model-tools.spec.ts b/plugins/ruflo-console/tests/model-tools.spec.ts
index 1b091cb93b..ebdfc6093e 100644
--- a/plugins/ruflo-console/tests/model-tools.spec.ts
+++ b/plugins/ruflo-console/tests/model-tools.spec.ts
@@ -20,7 +20,7 @@ function setup(level: Level, confirm: 'ask' | 'auto' = 'ask', entries: Record<st
Object.assign(settingsOf(state).ai, { modelControl: level, modelConfirm: confirm })
- const catalog = { 'mission-open': { label: 'open Mission Control', readOnly: true }, 'mission-create': { label: 'create the mission and its tasks' }, 'mission-cancel': { label: 'cancel the mission and its open tasks' }, 'plugin-install': { label: 'install a plugin', note: 'network: clones it from GitHub' }, 'hand-task': { label: 'hand task t1 to Claude', note: 'Starts a Claude Code turn (billed as any turn is)' }, ...entries }
+ const catalog = { 'mission-open': { label: 'open Mission Control', readOnly: true }, 'mission-create': { label: 'create the mission and its tasks' }, 'mission-cancel': { label: 'cancel the mission and its open tasks' }, 'plugin-install': { label: 'install a plugin', note: 'network: clones it from GitHub' }, 'x-publish': { label: 'publish a note to x.ruv.io', note: 'network: sends it to the relay' }, 'hand-task': { label: 'hand task t1 to Claude', note: 'Starts a Claude Code turn (billed as any turn is)' }, ...entries }
const control = {
host: { invalidate: () => undefined, after: (_ms: number, fn: () => void) => ({ cancel: () => calls.timers.splice(calls.timers.indexOf(fn), 1), fire: fn, ...(calls.timers.push(fn) && {}) }) },
setView: (view: string) => void calls.setView.push(view),
@@ -76,7 +76,7 @@ describe('levels, classes and the environment override', () => {
expect(classOf(make('create the mission and its tasks'))).toBe('write')
expect(classOf(make('cancel the mission and its open tasks'))).toBe('delete')
expect(classOf(make('hand task t1 to Claude', 'Starts a Claude Code turn (billed as any turn is)'))).toBe('spend')
- expect(classOf(make('install a plugin', 'network: clones it from GitHub'))).toBe('network')
+ expect(classOf(make('install a plugin', 'network: clones it from GitHub'))).toBe('install')
expect(classOf(make('terminate the agent'))).toBe('delete')
// Found by auditing every palette entry: these read as plain writes at first.
for (const label of ['stop the swarm', 'memory cleanup', 'memory migrate', 'cleanup --force']) expect(classOf(make(label)), label).toBe('delete')
@@ -327,14 +327,16 @@ describe('running an entry: ask, auto, and the level', () => {
it('refuses and cancels an action above the level, even in auto mode: nothing runs', async () => {
const { deps, calls } = setup('write', 'auto')
- for (const id of ['mission-cancel', 'plugin-install', 'hand-task']) expect(await callTool('console_run', { id }, deps), id).toMatch(/^Refused: .*needs/)
+ for (const id of ['mission-cancel', 'x-publish', 'plugin-install', 'hand-task']) expect(await callTool('console_run', { id }, deps), id).toMatch(/^Refused: .*needs/)
expect(calls.confirm).toBe(0)
- expect(calls.cancel).toBe(3)
+ expect(calls.cancel).toBe(4)
})
it('lets the same actions through at the level they need', async () => {
- expect(await callTool('console_run', { id: 'plugin-install' }, setup('manage', 'auto').deps)).toMatch(/^Waiting/)
- expect(await callTool('console_run', { id: 'plugin-install' }, setup('write', 'auto').deps)).toMatch(/^Refused/)
+ expect(await callTool('console_run', { id: 'x-publish' }, setup('manage', 'auto').deps)).toMatch(/^Waiting/)
+ expect(await callTool('console_run', { id: 'x-publish' }, setup('write', 'auto').deps)).toMatch(/^Refused/)
+ expect(await callTool('console_run', { id: 'plugin-install' }, setup('manage', 'auto').deps)).toMatch(/^Refused/)
+ expect(await callTool('console_run', { id: 'plugin-install' }, setup('full', 'auto').deps)).toMatch(/^Waiting/)
expect(await callTool('console_run', { id: 'mission-cancel' }, setup('manage', 'auto').deps)).toMatch(/^Refused/)
expect(await callTool('console_run', { id: 'mission-cancel' }, setup('full', 'auto').deps)).toMatch(/^Waiting/)
expect(await callTool('console_run', { id: 'hand-task' }, setup('full', 'auto').deps)).toMatch(/^Waiting/)
diff --git a/plugins/ruflo-console/tests/threat-model.spec.ts b/plugins/ruflo-console/tests/threat-model.spec.ts
index 6f9270b3f3..198254720a 100644
--- a/plugins/ruflo-console/tests/threat-model.spec.ts
+++ b/plugins/ruflo-console/tests/threat-model.spec.ts
@@ -15,7 +15,7 @@ import { paletteEntries } from '../hooks/palette'
import { newState } from '../hooks/state'
const make = (label: string, note?: string, args: string[] = []) => ({ label, args, expect: '', ...(note !== undefined && { note }) })
-const RANK: Record<ActionClass, number> = { read: 0, write: 1, network: 2, spend: 3, delete: 3 }
+const RANK: Record<ActionClass, number> = { read: 0, write: 1, network: 2, install: 3, spend: 3, delete: 3 }
describe('T1 classOf: words that name what an action does', () => {
const corpus: [ActionClass, string, string?][] = [
diff --git a/v3/docs/adr/ADR-450-mod-system-threat-model.md b/v3/docs/adr/ADR-450-mod-system-threat-model.md
index caedf66a79..612dc56194 100644
--- a/v3/docs/adr/ADR-450-mod-system-threat-model.md
+++ b/v3/docs/adr/ADR-450-mod-system-threat-model.md
@@ -127,6 +127,7 @@ Status: **fixed** (this change), **held** (attempted, no break), **open** (recom
- Recommended control: (1) `auto` must not apply to `network` and above: those always ask, whatever `modelConfirm` says; (2) run the `text` of every publishing/broadcast entry through the secret screen (`aidefence_has_pii` / the 9 patterns) and refuse; (3) a session-total budget of non-read actions per class (for example 5 network, 0 spend without ask); (4) `plugin-install`, `marketplace`, anything that writes settings or hooks becomes `full`; (5) default `modelConfirm` to `ask`.
- Test: not added (needs a product decision); T1 now makes the classes truthful, which is what any of these controls rests on.
- **Update (console 0.33.4): controls (1) and (2) are implemented.** `settlePending` (`model-tools.ts`) leaves `network`, `spend` and `delete` actions waiting for the person whatever `modelConfirm` is; `console_set` values and `console_run` text are refused when `hooks/screen.ts` (the shared screen) finds a secret, raw or cleaned. Tests: `tests/control-guards.spec.ts` (every class x confirm x level; a secret refused for set and run; clean text still runs). Controls (3) to (5) stay open.
+- **Update (console 0.33.5): controls (3) and (4) are implemented.** `SESSION_BUDGET` (`model-tools.ts`) caps model-driven actions per class per session (write 20, network 5, install 2, spend 3, delete 3; `state.control.used`). Past it a write action waits for the person's Yes even in `auto`; an action of an always-ask class is refused instead of queued again. A new `install` class (plugin and marketplace changes, settings and hooks files) needs `full` and always asks. Tests: `tests/control-guards.spec.ts`. Control (5), the `modelConfirm` default, stays a human decision.
### T9. Malicious or compromised plugin or mod