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): the Missions list shows one line a mission, attention first, and flags a stale record (ADR 425, 0.26.0)

ruvddb39aca1857
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index 0e850cc3ae..30eff9f975 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; no network by default.",
- "version": "0.25.0",
+ "version": "0.26.0",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --git a/plugins/ruflo-console/hooks/mission-list.ts b/plugins/ruflo-console/hooks/mission-list.ts
new file mode 100644
index 0000000000..bde58f3644
--- /dev/null
+++ b/plugins/ruflo-console/hooks/mission-list.ts
@@ -0,0 +1,101 @@
+/**
+ * The Missions list, pure and view-free (the view that draws it is views/missions.ts): which missions need attention first, how
+ * old the observation is, what one mission spells on one line, and which rows a window of the list shows around the cursor. Tested
+ * in tests/mission-list.spec.ts, so the list's behaviour is checked without the Claude Code test kit.
+ */
+import { money, type Mission } from './data/missions'
+
+/** The observation is older than this and the view says so: the daemon writes it after each change, so a long gap means it has stopped. */
+export const STALE_AFTER_MS = 10 * 60_000
+
+/** How many missions the list shows at once; the rest scroll with j and k. */
+export const LIST_WINDOW = 10
+
+export type Freshness = 'fresh' | 'stale' | 'undated'
+
+/** Blocked and failed first, then the work in motion, then what is waiting or paused, then what has finished. */
+export function missionRank(mission: Mission): number {
+ switch (mission.state) {
+ case 'blocked':
+ case 'failed':
+ return 0
+ case 'running':
+ case 'verifying':
+ case 'pauseRequested':
+ case 'cancelRequested':
+ return 1
+ case 'completed':
+ case 'cancelled':
+ return 3
+ default:
+ return 2
+ }
+}
+
+/** Ranked by rank, then the most recently updated first; equal keys keep the order the record gave. */
+export function sortMissions(missions: readonly Mission[]): Mission[] {
+ return [...missions].sort((a, b) => missionRank(a) - missionRank(b) || (b.updatedAtMs ?? 0) - (a.updatedAtMs ?? 0))
+}
+
+export function freshnessOf(observedAtMs: number | null, nowMs: number): Freshness {
+ if (observedAtMs === null) return 'undated'
+
+ return nowMs - observedAtMs > STALE_AFTER_MS ? 'stale' : 'fresh'
+}
+
+/** Tasks the runtime has recorded as done, out of the plan. A '+' marks a plan the record cut short, so the count is a floor. */
+export function taskProgress(mission: Mission): string {
+ const done = mission.plan.tasks.filter(task => task.status === 'recorded-done').length
+ const partial = mission.plan.taskCount > mission.plan.tasks.length ? '+' : ''
+
+ return `${done}${partial}/${mission.plan.taskCount}`
+}
+
+/** The budget in one short phrase: settled of the ceiling, or that there is none. */
+export function budgetShort(mission: Mission): string {
+ const budget = mission.budget
+
+ if (budget === null) return 'no budget'
+ if (budget.ceilingMinor === undefined) return `${money(budget.settledMinor ?? 0, budget.currency)} settled`
+
+ return `${money(budget.settledMinor ?? 0, budget.currency)} of ${money(budget.ceilingMinor, budget.currency)}`
+}
+
+const GLYPH: Record<string, string> = { running: '◐', verifying: '◐', completed: '●', failed: '✖', blocked: '✖', cancelled: '–' }
+
+/** The one-line row: a state glyph, the objective cut to fit, then the state, tasks, evidence and budget. */
+export function missionRow(mission: Mission, maxObjective = 36): string {
+ const objective = mission.objective === '' ? '(no objective)' : mission.objective
+ const cut = objective.length > maxObjective ? `${objective.slice(0, maxObjective - 1)}…` : objective
+
+ return `${GLYPH[mission.state] ?? '○'} ${cut} · ${mission.state} · tasks ${taskProgress(mission)} · verified ${mission.evidence.verified}/${mission.evidence.count} · ${budgetShort(mission)}`
+}
+
+/** The cursor kept on the list: 0 for an empty list, else between the first and last mission. */
+export function clampCursor(cursor: number, total: number): number {
+ if (total <= 0) return 0
+
+ return Math.min(Math.max(0, cursor), total - 1)
+}
+
+/**
+ * The part of the list the view draws: a window of `size` missions that keeps the cursor on screen, the one-line row of each,
+ * and the cursor's mission to expand below them. `hidden` counts the missions outside the window.
+ */
+export function listLayout(missions: readonly Mission[], cursor: number, size = LIST_WINDOW): { rows: { index: number; line: string }[]; expanded: Mission | null; hidden: number } {
+ const sorted = sortMissions(missions)
+
+ if (sorted.length === 0) return { rows: [], expanded: null, hidden: 0 }
+
+ const at = clampCursor(cursor, sorted.length)
+ const start = Math.min(Math.max(0, at - Math.floor(size / 2)), Math.max(0, sorted.length - size))
+ const end = Math.min(sorted.length, start + size)
+ const rows = sorted.slice(start, end).map((mission, i) => ({ index: start + i, line: missionRow(mission) }))
+
+ return { rows, expanded: sorted[at], hidden: sorted.length - rows.length }
+}
+
+/** How many missions need attention: blocked or failed. */
+export function attentionCount(missions: readonly Mission[]): number {
+ return missions.filter(mission => missionRank(mission) === 0).length
+}
diff --git a/plugins/ruflo-console/hooks/views/missions.ts b/plugins/ruflo-console/hooks/views/missions.ts
index 19d950bfba..40c6b58e63 100644
--- a/plugins/ruflo-console/hooks/views/missions.ts
+++ b/plugins/ruflo-console/hooks/views/missions.ts
@@ -1,6 +1,7 @@
import type { RenderElement } from 'claude-code'
import { money, type Mission } from '../data/missions'
+import { attentionCount, clampCursor, freshnessOf, listLayout } from '../mission-list'
import { ago, kv, rule, text, THEME, type Ctx } from './common'
const STATE_COLOR: Record<string, string> = { running: THEME.warn, verifying: THEME.warn, completed: THEME.ok, failed: THEME.bad, blocked: THEME.bad, paused: THEME.info, queued: THEME.info }
@@ -50,12 +51,19 @@ export function observationRows(ctx: Ctx): RenderElement[] {
}
if (observation.missions.length === 0) rows.push(text(ctx, 'No missions yet.', { dimColor: true }))
+ if (freshnessOf(observation.observedAtMs, ctx.nowMs) === 'stale') rows.push(text(ctx, ` observation is stale (last written ${ago(observation.observedAtMs, ctx.nowMs)}): the daemon may have stopped`, { color: THEME.warn }))
- const ordered = [...observation.missions].sort((a, b) => (b.updatedAtMs ?? 0) - (a.updatedAtMs ?? 0))
+ const attention = attentionCount(observation.missions)
- ordered.slice(0, 6).forEach((mission, i) => rows.push(...missionRows(ctx, mission, i === 0)))
+ if (attention > 0) rows.push(text(ctx, ` ${attention} need attention (blocked or failed): listed first`, { color: THEME.bad }))
- if (ordered.length > 6) rows.push(text(ctx, `+${ordered.length - 6} more`, { dimColor: true }))
+ // One line a mission; the cursor's mission (j and k move it) is expanded below the list.
+ const cursor = clampCursor(ctx.state.select.item, observation.missions.length)
+ const layout = listLayout(observation.missions, cursor)
+
+ for (const { index, line } of layout.rows) rows.push(text(ctx, `${index === cursor ? '▸' : ' '} ${line}`, index === cursor ? { bold: true } : { dimColor: true }))
+ if (layout.hidden > 0) rows.push(text(ctx, ` ${layout.hidden} more not shown · j and k scroll`, { dimColor: true }))
+ if (layout.expanded !== null) rows.push(...missionRows(ctx, layout.expanded, true))
rows.push(kv(ctx, 'legend', '○ pending · ◐ running · ● recorded done (recorded, not verified) · ✖ failed'))
rows.push(text(ctx, 'observation only: actions go through `npx ruflo mission action` with a request id and the expected revision', { dimColor: true }))
diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh
index 5cc490abbd..ff5cc3b75c 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.25.0"
+step "1. plugin.json declares ruflo-console 0.26.0"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.25.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.26.0"' "$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-list.spec.ts b/plugins/ruflo-console/tests/mission-list.spec.ts
new file mode 100644
index 0000000000..538836621c
--- /dev/null
+++ b/plugins/ruflo-console/tests/mission-list.spec.ts
@@ -0,0 +1,144 @@
+/**
+ * The Missions list, pure: the order (attention first), the observation's age, one-line rows, and the window around the cursor.
+ * Run with
+ * npx vitest run plugins/ruflo-console/tests/mission-list.spec.ts
+ */
+import { describe, expect, it } from 'vitest'
+
+import { money, type Mission } from '../hooks/data/missions'
+import { attentionCount, budgetShort, clampCursor, freshnessOf, listLayout, LIST_WINDOW, missionRank, missionRow, sortMissions, STALE_AFTER_MS, taskProgress } from '../hooks/mission-list'
+
+const mission = (over: Partial<Mission> = {}): Mission => ({
+ id: 'm',
+ objective: 'ship it',
+ state: 'running',
+ revision: 1,
+ executionMode: 'session-bound',
+ plan: { revision: 1, taskCount: 0, tasks: [] },
+ budget: null,
+ evidence: { count: 0, verified: 0 },
+ executor: null,
+ unresolvedOperations: 0,
+ ...over,
+})
+
+describe('mission order', () => {
+ it('ranks blocked and failed first, then the work in motion, then what waits, then what has finished', () => {
+ expect(missionRank(mission({ state: 'blocked' }))).toBe(0)
+ expect(missionRank(mission({ state: 'failed' }))).toBe(0)
+ expect(missionRank(mission({ state: 'running' }))).toBe(1)
+ expect(missionRank(mission({ state: 'queued' }))).toBe(2)
+ expect(missionRank(mission({ state: 'paused' }))).toBe(2)
+ expect(missionRank(mission({ state: 'completed' }))).toBe(3)
+ })
+
+ it('puts a failure above a newer running mission, newest first within a rank, and leaves the input alone', () => {
+ const input = [
+ mission({ id: 'old-run', state: 'running', updatedAtMs: 100 }),
+ mission({ id: 'new-run', state: 'running', updatedAtMs: 300 }),
+ mission({ id: 'old-fail', state: 'failed', updatedAtMs: 50 }),
+ mission({ id: 'done', state: 'completed', updatedAtMs: 999 }),
+ ]
+
+ expect(sortMissions(input).map(entry => entry.id)).toEqual(['old-fail', 'new-run', 'old-run', 'done'])
+ expect(input.map(entry => entry.id)).toEqual(['old-run', 'new-run', 'old-fail', 'done'])
+ })
+
+ it('counts the missions that need attention', () => {
+ expect(attentionCount([mission({ state: 'blocked' }), mission({ state: 'failed' }), mission({ state: 'running' })])).toBe(2)
+ })
+})
+
+describe('observation age', () => {
+ const now = 1_000_000_000
+
+ it('is undated without a time, fresh inside the threshold, and stale past it', () => {
+ expect(freshnessOf(null, now)).toBe('undated')
+ expect(freshnessOf(now - 1000, now)).toBe('fresh')
+ expect(freshnessOf(now - STALE_AFTER_MS, now)).toBe('fresh')
+ expect(freshnessOf(now - STALE_AFTER_MS - 1, now)).toBe('stale')
+ })
+})
+
+describe('one-line row', () => {
+ it('spells the state, the tasks done of the plan, the evidence and the budget in one line', () => {
+ const line = missionRow(
+ mission({
+ state: 'running',
+ plan: {
+ revision: 1,
+ taskCount: 4,
+ tasks: [
+ { id: 'a', title: 'a', dependsOn: [], status: 'recorded-done' },
+ { id: 'b', title: 'b', dependsOn: [], status: 'running' },
+ { id: 'c', title: 'c', dependsOn: [], status: 'pending' },
+ { id: 'd', title: 'd', dependsOn: [], status: 'pending' },
+ ],
+ },
+ evidence: { count: 3, verified: 2 },
+ budget: { currency: 'USD', ceilingMinor: 1000, settledMinor: 250 },
+ }),
+ )
+
+ expect(line).toContain('running')
+ expect(line).toContain('tasks 1/4')
+ expect(line).toContain('verified 2/3')
+ expect(line).toContain(`${money(250, 'USD')} of ${money(1000, 'USD')}`)
+ expect(line.includes('\n')).toBe(false)
+ })
+
+ it('marks a plan the record cut short with a plus, so the done count reads as a floor', () => {
+ expect(taskProgress(mission({ plan: { revision: 1, taskCount: 9, tasks: [{ id: 'a', title: 'a', dependsOn: [], status: 'recorded-done' }] } }))).toBe('1+/9')
+ })
+
+ it('says when there is no budget or no ceiling', () => {
+ expect(budgetShort(mission({ budget: null }))).toBe('no budget')
+ expect(budgetShort(mission({ budget: { currency: 'USD', settledMinor: 5 } }))).toBe(`${money(5, 'USD')} settled`)
+ })
+
+ it('cuts a long objective to fit and names a missing one', () => {
+ const long = missionRow(mission({ objective: 'x'.repeat(80) }), 20)
+
+ expect(long.startsWith('◐ xxxxxxxxxxxxxxxxxxx… ·')).toBe(true)
+ expect(missionRow(mission({ objective: '' }))).toContain('(no objective)')
+ })
+})
+
+describe('cursor and window', () => {
+ it('keeps the cursor on the list', () => {
+ expect(clampCursor(3, 0)).toBe(0)
+ expect(clampCursor(-2, 5)).toBe(0)
+ expect(clampCursor(9, 5)).toBe(4)
+ })
+
+ it('shows no rows for an empty list', () => {
+ expect(listLayout([], 0)).toEqual({ rows: [], expanded: null, hidden: 0 })
+ })
+
+ it('draws one line per mission and expands only the cursor, so six missions take seven lines, not thirty', () => {
+ const six = Array.from({ length: 6 }, (_, i) => mission({ id: `m${i}`, objective: `goal ${i}`, updatedAtMs: i }))
+ const layout = listLayout(six, 0)
+
+ expect(layout.rows).toHaveLength(6)
+ expect(layout.hidden).toBe(0)
+ expect(layout.expanded?.id).toBe('m5')
+ expect(layout.rows.length + 1).toBeLessThan(six.length * 5)
+ })
+
+ it('keeps the cursor inside a window of the list and counts what is outside it', () => {
+ const many = Array.from({ length: 25 }, (_, i) => mission({ id: `m${i}`, updatedAtMs: 100 - i }))
+ const layout = listLayout(many, 20)
+
+ expect(layout.rows).toHaveLength(LIST_WINDOW)
+ expect(layout.rows.map(row => row.index)).toContain(20)
+ expect(layout.hidden).toBe(25 - LIST_WINDOW)
+ expect(layout.expanded?.id).toBe('m20')
+ })
+
+ it('starts the window at the top when the cursor is near it', () => {
+ const many = Array.from({ length: 25 }, (_, i) => mission({ id: `m${i}`, updatedAtMs: 100 - i }))
+
+ expect(listLayout(many, 0).rows[0].index).toBe(0)
+ expect(listLayout(many, 99).rows[LIST_WINDOW - 1].index).toBe(24)
+ })
+})
diff --git a/v3/docs/adr/ADR-409-console-mission-planner-and-lifecycle.md b/v3/docs/adr/ADR-409-console-mission-planner-and-lifecycle.md
index 35a58525b4..549f75c23a 100644
--- a/v3/docs/adr/ADR-409-console-mission-planner-and-lifecycle.md
+++ b/v3/docs/adr/ADR-409-console-mission-planner-and-lifecycle.md
@@ -10,6 +10,8 @@ Scope: `plugins/ruflo-console`: `hooks/goap.ts`, `hooks/mission-control.ts`, `ho
Extends: ADR 406 (mission records, the `session-bound` executor) and ADR 407 (the cockpit). Detail of ADR 408 sections 1 to 8.
+Updated by: ADR 425 (the Missions list: one line a mission, attention first, a stale record flagged). The lifecycle and the planner are unchanged.
+
## 1. Context
A person types a goal ("add a dark mode toggle to settings"). Ruflo already has a governed mission record (`mission_create`, `mission_plan`) and a task store (`task_create`), but nothing turns a sentence into a plan, and a mission that is only `planned` has no executor: ADR 406 defines `session-bound` tasks, which the primary Claude Code session carries out. The console needs to (a) plan without a model and without writing, (b) create the mission and tasks on one confirm, (c) hand work to Claude one task at a time, and (d) show progress without inventing it.
diff --git a/v3/docs/adr/ADR-425-console-missions-list-attention-and-staleness.md b/v3/docs/adr/ADR-425-console-missions-list-attention-and-staleness.md
new file mode 100644
index 0000000000..37a9b21bb0
--- /dev/null
+++ b/v3/docs/adr/ADR-425-console-missions-list-attention-and-staleness.md
@@ -0,0 +1,58 @@
+# ADR 425: The Missions list: one line a mission, attention first, and a stale record flagged
+
+Status: Accepted (ships in ruflo-console 0.26.0)
+
+Date: 2026 10 03
+
+Decision owner: Ruflo maintainers
+
+Scope: `plugins/ruflo-console`: `hooks/mission-list.ts` (new, pure), `hooks/views/missions.ts` (`observationRows`), `tests/mission-list.spec.ts` (new), `.claude-plugin/plugin.json` (0.26.0), `scripts/smoke.sh` (version check).
+
+Extends: ADR 409 (the Mission Control planner and lifecycle), ADR 407 (the cockpit), ADR 424 (the compact nav, which the Missions page is reached from).
+
+Mission record decision: the CLI (`v3/@claude-flow/cli/src/missions`) and ADR 409 cite the mission-record decision as **ADR 406**. The file numbered 406 in this tree (`ADR-406-ruflo-mod-command-compatibility.md`) is a different decision (command compatibility). The mission-record decision has no file in this tree, so the number collides and the mission record is not citable by file here. This ADR does not rename either; the collision is recorded so it can be resolved where the mission record lives.
+
+## 1. Context
+
+The Missions list shows the record `.claude-flow/missions/observation.json` writes. It drew the first six missions in the order of their last update, each as a block of four or more lines (objective, state and revision, plan, evidence and budget, plus executor and blocked lines when present), and then `+N more` with no way to reach them.
+
+Three things made it hard to act on:
+
+- A failed or blocked mission could sit below newer, healthy ones, so the thing that needed attention was the easiest to miss.
+- Six blocks took about 24 lines, and anything past six was not reachable from the list.
+- The view said when the record was observed but not whether that was recent. The daemon writes the record after each change, so an old observation usually means the daemon has stopped, and the list read as current.
+
+The read-only rule stands: the console takes no mission action from this list (ADR 409 and ADR 406 route actions through `ruflo mission action` with a request id and the expected revision).
+
+## 2. Decision
+
+- **One line a mission.** Each row is a state glyph, the objective cut to 36 characters, the state, `tasks done/planned`, `verified/evidence`, and the budget (`settled of ceiling`, `settled`, or `no budget`).
+- **Attention first.** Missions sort by rank: blocked and failed; then running, verifying, pause and cancel requested; then queued, paused, awaiting authorization, planned and draft; then completed and cancelled. Within a rank, the most recently updated first. The header counts the missions that need attention.
+- **The cursor is the expanded row.** `j` and `k` move the cursor through the list with the existing `state.select.item`, the same as the memory lab and the other lists. The cursor's mission is drawn in full (the existing detail block) below the list. No new state.
+- **A window of ten.** The list shows ten rows around the cursor; the rest are counted as `+N more not shown · j and k scroll`.
+- **A stale record is flagged.** When the observation is older than `STALE_AFTER_MS` (10 minutes), the view says so, with the age, and that the daemon may have stopped. An observation with no time is treated as undated and gets no warning.
+- **The logic is pure.** Ranking, freshness, the row text, the cursor clamp and the window live in `hooks/mission-list.ts` with no view or kit import, so `tests/mission-list.spec.ts` runs without the Claude Code test kit.
+- **A `+` marks a floor.** When the record cut the plan short (`taskCount` above the tasks it sent), the done count reads `1+/9`, not `1/9`, so the count is never presented as complete.
+
+## 3. Alternatives considered
+
+- **Keep the six blocks and add paging.** Rejected: paging hides the same five lines per mission and still makes the list long.
+- **A detail page for each mission.** Rejected: a page per mission adds a navigation step to every check, where the cursor shows the detail in place.
+- **Clickable rows.** Deferred: a `Button` per row would make the row the click target, but the live click path needs a smoke run on the Claude Code UI before it is relied on. The keyboard cursor ships first.
+- **Filtering by state.** Deferred: the attention-first order answers the common question (what is wrong) without another control. Filtering can follow if the list grows past one window.
+- **A staleness threshold from the daemon's own interval.** Rejected for now: the record does not carry the daemon's interval. A fixed ten minutes is a visible choice that can be tuned in one constant.
+- **Changing the mission actions.** Out of scope: the read-only rule is the safety boundary and stays.
+
+## 4. Consequences
+
+- **Lines, measured by the spec.** Six missions: about 24 lines before (four per mission, more with executor or blocked lines), 10 now (six rows, one expanded block of four). Twenty-five missions: 24 plus the `+19` line before, 15 now (ten rows, one hidden line, four expanded). The spec asserts the six-mission case.
+- **Attention is visible without a scan.** A failure is the first row and the header names how many there are.
+- **The threshold is a judgement.** Ten minutes suits a daemon that writes on each change and is idle for long stretches only when nothing is happening. A quiet but healthy workspace can show the stale note; the note says the daemon "may" have stopped, not that it has.
+- **The mission-record number stays ambiguous** until the owning ADR is filed under its own number. Code comments that say ADR-406 for missions are left as they are.
+
+## 5. Tests
+
+- `tests/mission-list.spec.ts` (pure, 13 tests): the rank of each group of states; the order (failure above a newer running mission, newest first within a rank, input not mutated); the attention count; the freshness boundaries (undated, fresh, exactly at the threshold, stale one millisecond past); the row (state, tasks, evidence and budget on one line; a `+` on a cut plan; the budget phrases; a cut and a missing objective); the cursor clamp; an empty list; six missions as one line each plus one expanded block; a window that keeps a cursor at index 20 on screen and counts the rest; the window at the top and at the end.
+- `tests/missions.test.ts` (kit, unchanged): its expectations are on the mission detail block and the empty state, which this change does not alter. It cannot load on a machine without the `claude-code/testing` host package; CI (ADR 413) runs it.
+- The console suite: 346 tests pass. 22 files fail to load because the `claude-code/testing` host package is absent here; each fails only on that import, and none on this change. The count is higher than on the earlier base because `origin/main` carries more kit tests.
+- Live: not yet run. The next step is a live smoke of the Missions page with a record that has a blocked mission, a stale observation and more than ten missions, checking the cursor, the window and the stale note in the real Claude Code UI.