diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json index c450863358..d214669935 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 \u2192 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.49.8", + "version": "0.49.9", "author": { "name": "ruvnet", "url": "https://github.com/ruvnet" diff --git a/plugins/ruflo-console/CHANGELOG.md b/plugins/ruflo-console/CHANGELOG.md index 8d716d3f98..132614b8db 100644 --- a/plugins/ruflo-console/CHANGELOG.md +++ b/plugins/ruflo-console/CHANGELOG.md @@ -2,6 +2,10 @@ Newest first. One `## — ` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-console`. +## 0.49.9 — 2026-11-04 +- fix: Mission Control now offers to create a mission for a new goal when the active mission has one cancelled task and every other task done. 0.49.6 counted a mission as over only when the whole mission was cancelled or every task was done, so a mission with 14 tasks completed and 1 cancelled (for example a research step dropped on purpose) was never over: the NEXT STEP box still showed "Create the mission and its tasks" as done, with the old mission's id and no create button. A mission is now over when every task is done or cancelled (a mission with no tasks still is not). A task that is pending, running or failed keeps it open, a finished mission's own goal is still not offered a second time, and nothing is created unasked. +- fix: a cancelled mission no longer puts "The mission is cancelled. Do not start new work." in Claude's prompt. The active mission stays active until another is created, so after a cancel every new goal's guidance reached Claude with that stop line, before the create step could make the new mission, and Claude refused to plan it. The mission context section is now left out for a cancelled mission, as it already was for a finished one. + ## 0.49.8 — 2026-10-31 - chore: the plugin map gives the two new external marketplace plugins a home section, `agentdb` under Memory and `agentic-flow` under Learning, so their commands launch from the console (ADR-518). diff --git a/plugins/ruflo-console/hooks/mission-claude.ts b/plugins/ruflo-console/hooks/mission-claude.ts index a389ed3fed..80f8a094cf 100644 --- a/plugins/ruflo-console/hooks/mission-claude.ts +++ b/plugins/ruflo-console/hooks/mission-claude.ts @@ -38,13 +38,13 @@ function currentTask(state: State, mission: MissionRecord): { task: LedgerTask | let held: { key: string; text: string } | null = null /** - * The section `prompt.compose` adds, or null (no mission, a finished one, or the setting off). The text is rebuilt only when its key + * The section `prompt.compose` adds, or null (no mission, a finished or cancelled one, or the setting off). The text is rebuilt only when its key * changes, and the key changes only with the task: a changed system prompt makes Claude re-read the whole conversation. */ export function contextSection(state: State): { id: string; text: string; scope: 'session' } | null { const mission = activeMission(state) - if (mission === null || !contextEnabled(settingsOf(state).ai.missionContext)) return null + if (mission === null || mission.cancelled || !contextEnabled(settingsOf(state).ai.missionContext)) return null const statuses = derive(mission, state.snapshot?.tasks ?? []) diff --git a/plugins/ruflo-console/hooks/mission-control.ts b/plugins/ruflo-console/hooks/mission-control.ts index 4cb6f21c8d..2fa560e42b 100644 --- a/plugins/ruflo-console/hooks/mission-control.ts +++ b/plugins/ruflo-console/hooks/mission-control.ts @@ -107,11 +107,15 @@ export const progressOf = (mission: MissionRecord, tasks: readonly TaskRecord[]) return { done: [...status.values()].filter(value => value === 'done').length, total: mission.tasks.length } } -/** Whether the mission is over: cancelled, or every task done in the task store (a mission with no tasks is not). The record's own state is not read: it stays `planned` until the executor exists. */ +/** + * Whether the mission is over: cancelled, or every task settled in the task store, each one done or cancelled (a mission with no tasks is not). A single + * cancelled task, say a research step dropped on purpose, must not keep a mission with every other task done open for ever. A task still pending, running + * or failed keeps it open. The record's own state is not read: it stays `planned` until the executor exists. + */ export function isOver(mission: MissionRecord, tasks: readonly TaskRecord[]): boolean { - const { done, total } = progressOf(mission, tasks) + const settled = [...derive(mission, tasks).values()].every(value => value === 'done' || value === 'cancelled') - return mission.cancelled || (total > 0 && done >= total) + return mission.cancelled || (mission.tasks.length > 0 && settled) } /** diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.ts index 08a9f65206..7ca054024a 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.49.8' +export const CONSOLE_VERSION = '0.49.9' diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh index eab75f1509..972e91560f 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.49.8" +step "1. plugin.json declares ruflo-console 0.49.9" grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \ - && grep -q '"version": "0.49.8"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version" + && grep -q '"version": "0.49.9"' "$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/mission-after-finish.spec.ts b/plugins/ruflo-console/tests/mission-after-finish.spec.ts index a92e17ea00..1fdc6d2c5d 100644 --- a/plugins/ruflo-console/tests/mission-after-finish.spec.ts +++ b/plugins/ruflo-console/tests/mission-after-finish.spec.ts @@ -9,7 +9,7 @@ import { describe, expect, it } from 'vitest' import type { ActionSpec } from '../hooks/actions' import type { TaskRecord } from '../hooks/data/parse' import type { Host } from '../hooks/host' -import { activeMission, createSpec, ledgerKeyOf, mcOf, missionActions, setGoal, type MissionRecord } from '../hooks/mission-control' +import { activeMission, createSpec, isOver, ledgerKeyOf, mcOf, missionActions, setGoal, type MissionRecord } from '../hooks/mission-control' import type { Runner } from '../hooks/runner' import { newState, type State } from '../hooks/state' import type { Ctx } from '../hooks/views/common' @@ -128,6 +128,44 @@ describe('the create step after a mission that is over', () => { } }) + it('offers create when every task is settled but one was cancelled on its own (14 done + 1 cancelled), mission not cancelled', () => { + const tasks = [task('r1', 'cancelled'), task('r2', 'completed'), task('r3', 'completed')] + const create = stepOf(stateWith(tasks, NEW_GOAL), 'create') + + expect(create?.state).toBe('next') + expect(create?.action?.key).toBe('mc-create') + expect(create?.detail).not.toContain(OLD.slice(0, 16)) + }) + + it('offers create when every task was cancelled one by one', () => { + const tasks = [task('r1', 'cancelled'), task('r2', 'cancelled'), task('r3', 'cancelled')] + + expect(stepOf(stateWith(tasks, NEW_GOAL), 'create')?.action?.key).toBe('mc-create') + }) + + it('a cancelled task does not close a mission that still has a pending, running or failed one', () => { + for (const rest of ['pending', 'in_progress', 'failed']) { + const tasks = [task('r1', 'cancelled'), task('r2', 'completed'), task('r3', rest)] + + expect(stepOf(stateWith(tasks, NEW_GOAL), 'create')?.action).toBeUndefined() + } + }) + + it('the goal of a mission closed by a cancelled task is not offered again (its plan stays on screen after the create)', () => { + const tasks = [task('r1', 'cancelled'), task('r2', 'completed'), task('r3', 'completed')] + + expect(stepOf(stateWith(tasks, OLD_GOAL), 'create')?.action).toBeUndefined() + }) + + it('isOver: done and cancelled tasks only, at least one task, or the mission cancelled', () => { + const mission = missionOf(OLD, OLD_GOAL) + + expect(isOver(mission, [task('r1', 'cancelled'), task('r2', 'completed'), task('r3', 'complete')])).toBe(true) + expect(isOver(mission, [task('r1', 'cancelled'), task('r2', 'completed'), task('r3', 'pending')])).toBe(false) + expect(isOver({ ...mission, tasks: [] }, [])).toBe(false) + expect(isOver({ ...mission, cancelled: true }, OPEN)).toBe(true) + }) + it('a paused mission with open tasks is not over', () => { expect(stepOf(stateWith(OPEN, NEW_GOAL, { paused: true }), 'create')?.action).toBeUndefined() }) diff --git a/plugins/ruflo-console/tests/mission-claude.spec.ts b/plugins/ruflo-console/tests/mission-claude.spec.ts index 8f6c9d27f6..efc635eae3 100644 --- a/plugins/ruflo-console/tests/mission-claude.spec.ts +++ b/plugins/ruflo-console/tests/mission-claude.spec.ts @@ -89,6 +89,10 @@ describe('the mission in Claude\'s prompt', () => { expect(contextSection(stateWith([task('r1', 'completed', [`mission:${ID}`, 'task:t1']), task('r2', 'completed', [`mission:${ID}`, 'task:t2'])]))).toBeNull() }) + it('is absent for a cancelled mission, so a new goal is not planned under "do not start new work"', () => { + expect(contextSection(stateWith(open, { ...mission(), cancelled: true }))).toBeNull() + }) + it('names the mission and the task Claude is on, as a session section', () => { const section = contextSection(stateWith(t1Running))