Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: expose in-flight app quality checks on status card

[._.]/ Adam Eivy85d6a7c4d70e
diff --git a/client/src/components/apps/AppQuality.jsx b/client/src/components/apps/AppQuality.jsx
index abda9e8b7d..1dc707223d 100644
--- a/client/src/components/apps/AppQuality.jsx
+++ b/client/src/components/apps/AppQuality.jsx
@@ -101,14 +101,14 @@ export default function AppQuality({ app, detail = false }) {
];
const federation = quality?.federation;
return (
- <AppQualityRunner key={app.id} app={app}>{(runner, activeRuns) => <section aria-label="App quality" className="space-y-4">
- <div className="bg-port-card border border-port-border rounded-lg p-4 flex flex-wrap items-center justify-between gap-3">
+ <AppQualityRunner key={app.id} app={app}>{(runner, runStatus) => <section aria-label="App quality" className="space-y-4">
+ <section aria-label="Quality status" className="bg-port-card border border-port-border rounded-lg p-4 flex flex-wrap items-center justify-between gap-3">
<div className="flex items-center gap-4 min-w-0">
<div className="text-4xl font-semibold tabular-nums text-white" aria-hidden="true">
{score ?? '—'}<span className="text-base font-normal text-gray-500">/100</span>
</div>
<div className="min-w-0">
- <h3 className="flex items-center gap-1.5 font-semibold text-white">
+ <h3 className="flex flex-wrap items-center gap-1.5 font-semibold text-white">
{label}
<InfoTooltip label="How the quality score works" placement="below" align="start" width={320}>
<p>Equal-weight mean of the category scores. Each category score is the confidence-weighted mean of its last five qualifying runs from the last 30 days (broad signal coverage, medium/high confidence, scored); one run’s slice pick no longer swings the figure. Missing, partial, low-confidence and stale runs are excluded, not counted as perfect. Assessments describe the code before fixes.</p>
@@ -126,7 +126,6 @@ export default function AppQuality({ app, detail = false }) {
<div className="flex flex-wrap items-center gap-2">
<Link to={panelLink('run')} className="inline-flex items-center gap-1.5 rounded bg-port-accent px-3 py-1.5 text-xs font-medium text-port-bg hover:opacity-90">
<Play size={14} aria-hidden="true" />Run checks
- {activeRuns > 0 && <span className="rounded-full bg-port-bg/30 px-1.5">{activeRuns} running</span>}
</Link>
<Link to={panelLink('schedule')} className="inline-flex items-center gap-1.5 rounded border border-port-border bg-port-bg/60 px-3 py-1.5 text-xs font-medium text-gray-200 hover:border-port-accent hover:text-white">
<CalendarClock size={14} aria-hidden="true" />Schedule
@@ -139,7 +138,8 @@ export default function AppQuality({ app, detail = false }) {
{score == null && !quality?.unavailable && <p className="basis-full text-sm text-gray-400">
{hasAssessments ? 'Saved assessments do not qualify for an overall score yet. See the breakdown for coverage, confidence and age.' : 'No audit assessment saved yet. Run checks to collect one.'}
</p>}
- </div>
+ {runStatus}
+ </section>
<div className="grid grid-cols-1 xl:grid-cols-2 gap-4 items-start">
<AppQualityHistory appId={app.id} categories={quality?.categories} />
{!!quality?.categories?.length && (
diff --git a/client/src/components/apps/AppQualityRunner.jsx b/client/src/components/apps/AppQualityRunner.jsx
index 8a5228e4e2..3867c04118 100644
--- a/client/src/components/apps/AppQualityRunner.jsx
+++ b/client/src/components/apps/AppQualityRunner.jsx
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from 'react';
import { Link, useSearchParams } from 'react-router';
import ProviderModelSelector from '../ProviderModelSelector';
-import MaintenanceRunStatus from '../cos/tabs/schedule/MaintenanceRunStatus';
+import MaintenanceRunStatus, { maintenanceRunProgress } from '../cos/tabs/schedule/MaintenanceRunStatus';
import useProviderModels from '../../hooks/useProviderModels';
import { useSocketResource } from '../../hooks/useSocketResource';
import { formatCount } from '../../utils/formatters';
@@ -155,6 +155,46 @@ export default function AppQualityRunner({ app, children }) {
{run.status === 'running' && <button type="button" className="text-xs text-port-accent" disabled={busy} onClick={() => stop(run.id)}>Stop remaining checks</button>}
</div>)}
</section>;
- const activeRuns = runs.filter(run => run.status === 'running').length;
- return children ? children(controls, activeRuns) : controls;
+ const status = <QualityRunStatus runs={runs} categories={categories} loading={loading} loadError={loadError}
+ error={error} busy={busy} onStop={stop} onRetry={loadRuns} />;
+ return children ? children(controls, status) : controls;
+}
+
+function QualityRunStatus({ runs, categories, loading, loadError, error, busy, onStop, onRetry }) {
+ const batches = runs.filter(run => run.status === 'running').map(run => {
+ const { done, total, step } = maintenanceRunProgress(run);
+ const active = ['running', 'in_progress'].includes(run.active?.status) ? 1 : 0;
+ const pending = Math.max(0, total - done - active);
+ const state = active ? 'Active' : run.active?.status === 'blocked' ? 'Blocked' : run.active ? 'Queued' : 'Waiting';
+ const label = categories.find(category => category.id === step)?.label || step || 'Quality checks';
+ return { run, done, total, active, pending, state, label };
+ });
+ const active = batches.reduce((sum, batch) => sum + batch.active, 0);
+ const pending = batches.reduce((sum, batch) => sum + batch.pending, 0);
+ return <section aria-label="Checks in flight" className="basis-full min-w-0 w-full border-t border-port-border pt-3 space-y-2 text-xs">
+ <div className="flex flex-wrap items-center justify-between gap-2">
+ <h4 className="font-medium">Checks in flight</h4>
+ {batches.length > 0 && <p role="status" className="tabular-nums">{formatCount(active)} active · {formatCount(pending)} pending</p>}
+ </div>
+ {(loading || loadError) && <p role="status">
+ {loadError ? 'Runner status is unavailable.' : 'Loading runner status…'}{' '}
+ <button type="button" className="text-port-accent min-h-[44px] px-2" onClick={onRetry}>Retry</button>
+ </p>}
+ {error && <p role="alert" className="text-port-error">{error}</p>}
+ {!loading && !loadError && batches.length === 0 && <p className="text-gray-400">No checks in flight.</p>}
+ {batches.length > 0 && <>
+ <ul className="space-y-2" aria-label="Check batches">
+ {batches.map(({ run, done, total, pending: remaining, state, label }) => <li key={run.id} className="flex flex-wrap items-center justify-between gap-x-3 gap-y-1">
+ <div className="flex-1 min-w-0 basis-48 space-y-1">
+ <p className="break-words"><span className="font-medium">{label}</span> · {state} · {formatCount(done)}/{formatCount(total)} complete · {formatCount(remaining)} pending</p>
+ {run.reason && <p className="text-gray-400 break-words">{run.reason}</p>}
+ {run.active?.agentId && <Link className="text-port-accent underline" to={`/cos/agents/${encodeURIComponent(run.active.agentId)}`}>View active agent</Link>}
+ </div>
+ <button type="button" disabled={busy} onClick={() => onStop(run.id)}
+ className="min-h-[44px] rounded border border-port-border px-3 text-port-accent hover:border-port-accent disabled:opacity-50">Stop remaining checks</button>
+ </li>)}
+ </ul>
+ <p className="text-gray-400">Stopping prevents later checks. Work already queued or running can still finish.</p>
+ </>}
+ </section>;
}
diff --git a/client/src/components/apps/AppQualityRunner.test.jsx b/client/src/components/apps/AppQualityRunner.test.jsx
index 0f22ab650a..fad3bc7de0 100644
--- a/client/src/components/apps/AppQualityRunner.test.jsx
+++ b/client/src/components/apps/AppQualityRunner.test.jsx
@@ -1,4 +1,4 @@
-import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
import { MemoryRouter } from 'react-router';
const socket = vi.hoisted(() => {
const handlers = new Map();
@@ -108,6 +108,8 @@ it('preserves run overrides when reopening the drawer for one category', async (
{ appId: 'app-1', providerId: 'codex', model: 'gpt-5', effort: 'high', mode: 'fix', prCompletion: 'inherit', claimBetweenAudits: false, taskTypes: ['security'], explicitCheck: true },
{ silent: true }
));
+ fireEvent.click(screen.getByRole('button', { name: 'Close' }));
+ expect(within(screen.getByRole('region', { name: 'Quality status' })).getByRole('button', { name: 'Stop remaining checks' })).toBeInTheDocument();
});
it('launches alongside pending runners and stops each run independently', async () => {
@@ -185,6 +187,62 @@ it('leaves audits that cannot apply to this repository out of batch runs, but ru
await waitFor(() => expect(startMaintenanceRun).toHaveBeenLastCalledWith(expect.objectContaining({ taskTypes: ['accessibility'], explicitCheck: true }), { silent: true }));
});
+it('shows active, queued and held checks on the status card and stops only the selected batch', async () => {
+ const running = { id: 'active', appId: app.id, status: 'running',
+ steps: ['done', 'security', 'ux'].map(id => ({ id, taskRef: { taskType: id } })),
+ completed: { done: '2026-10-01T00:00:00Z' }, active: { stepId: 'security', taskType: 'security', status: 'in_progress', agentId: 'agent-example' } };
+ const queued = { id: 'queued', appId: app.id, status: 'running',
+ steps: ['performance', 'security'].map(id => ({ id, taskRef: { taskType: id } })),
+ active: { stepId: 'performance', taskType: 'performance', status: 'queued' }, reason: 'Waiting for capacity' };
+ const held = { id: 'held', appId: app.id, status: 'running',
+ steps: [{ id: 'ux', taskRef: { taskType: 'ux' } }], reason: 'Enable UX in Schedule' };
+ getMaintenanceRuns.mockResolvedValue({ runs: [running, queued, held,
+ { ...queued, id: 'completed', status: 'completed' },
+ { ...running, id: 'another-app', appId: 'app-2' },
+ ] });
+ let resolveStop;
+ stopMaintenanceRun.mockImplementation(() => new Promise(resolve => { resolveStop = resolve; }));
+ render(<MemoryRouter><AppQuality app={app} detail /></MemoryRouter>);
+ const card = within(screen.getByRole('region', { name: 'Quality status' }));
+ await card.findByText('1 active · 4 pending');
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ const batches = card.getAllByRole('listitem');
+ expect(batches[0]).toHaveTextContent('Security · Active · 1/3 complete · 1 pending');
+ expect(batches[1]).toHaveTextContent('Performance · Queued · 0/2 complete · 2 pending');
+ expect(batches[2]).toHaveTextContent('UX · Waiting · 0/1 complete · 1 pending');
+ expect(card.getByText('Waiting for capacity')).toBeInTheDocument();
+ expect(card.getByRole('link', { name: 'View active agent' })).toHaveAttribute('href', '/cos/agents/agent-example');
+ expect(card.getAllByRole('listitem')).toHaveLength(3);
+
+ fireEvent.click(within(card.getAllByRole('listitem')[1]).getByRole('button', { name: 'Stop remaining checks' }));
+ expect(stopMaintenanceRun).toHaveBeenCalledExactlyOnceWith('queued', { silent: true });
+ expect(card.getAllByRole('button', { name: 'Stop remaining checks' }).every(button => button.disabled)).toBe(true);
+ await act(async () => resolveStop({ run: { ...queued, status: 'stopped' } }));
+ expect(card.getByText('1 active · 2 pending')).toBeInTheDocument();
+ expect(card.getAllByRole('listitem')).toHaveLength(2);
+ expect(card.queryByText('Waiting for capacity')).not.toBeInTheDocument();
+ expect(getMaintenanceRuns).toHaveBeenCalledTimes(1);
+ expect(startMaintenanceRun).not.toHaveBeenCalled();
+});
+
+it('shows status and stop failures on the top card without hiding outstanding checks', async () => {
+ getMaintenanceRuns.mockRejectedValueOnce(new Error('Status unavailable'));
+ render(<MemoryRouter><AppQuality app={app} detail /></MemoryRouter>);
+ const card = within(screen.getByRole('region', { name: 'Quality status' }));
+ await card.findByText('Runner status is unavailable.');
+ expect(card.queryByText('No checks in flight.')).not.toBeInTheDocument();
+ const run = { id: 'pending', appId: app.id, status: 'running', steps: [{ id: 'security', taskRef: { taskType: 'security' } }] };
+ getMaintenanceRuns.mockResolvedValue({ runs: [run] });
+ fireEvent.click(card.getByRole('button', { name: 'Retry' }));
+ await card.findByText('0 active · 1 pending');
+ stopMaintenanceRun.mockRejectedValueOnce(new Error('Could not stop checks'));
+ fireEvent.click(card.getByRole('button', { name: 'Stop remaining checks' }));
+ expect(await card.findByRole('alert')).toHaveTextContent('Could not stop checks');
+ expect(card.getByRole('button', { name: 'Stop remaining checks' })).toBeEnabled();
+ expect(card.getByText('0 active · 1 pending')).toBeInTheDocument();
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+});
+
it('offers every enabled process provider regardless of subscription family, and hides disabled ones', async () => {
render(<MemoryRouter><AppQualityRunner app={app} /></MemoryRouter>);
await waitFor(() => expect(useProviderModels).toHaveBeenCalled());
@@ -197,21 +255,27 @@ it('offers every enabled process provider regardless of subscription family, and
it('refreshes matching maintenance events and recovers once per reconnect/reshow without polling', async () => {
vi.useFakeTimers();
vi.spyOn(document, 'visibilityState', 'get').mockReturnValue('visible');
- const view = render(<MemoryRouter><AppQualityRunner app={app} /></MemoryRouter>);
+ const view = render(<MemoryRouter><AppQuality app={app} detail /></MemoryRouter>);
await act(async () => {});
+ const card = within(screen.getByRole('region', { name: 'Quality status' }));
+ expect(card.getByText('No checks in flight.')).toBeInTheDocument();
expect(getMaintenanceRuns).toHaveBeenCalledTimes(1);
await act(async () => { await vi.advanceTimersByTimeAsync(45_000); });
expect(getMaintenanceRuns).toHaveBeenCalledTimes(1);
- getMaintenanceRuns.mockResolvedValue({ runs: [{ id: 'run-push', appId: app.id, status: 'running', steps: [] }] });
+ getMaintenanceRuns.mockResolvedValue({ runs: [{ id: 'run-push', appId: app.id, status: 'running',
+ steps: [{ id: 'security', taskRef: { taskType: 'security' } }], active: { stepId: 'security', taskType: 'security', status: 'running' } }] });
await act(async () => socket.fire('cos:maintenance:updated', { appId: 'another-app' }));
expect(getMaintenanceRuns).toHaveBeenCalledTimes(1);
await act(async () => socket.fire('cos:maintenance:updated', { appId: app.id }));
expect(screen.getByRole('button', { name: 'Stop remaining checks' })).toBeInTheDocument();
+ expect(card.getByText('1 active · 0 pending')).toBeInTheDocument();
expect(getMaintenanceRuns).toHaveBeenCalledTimes(2);
+ getMaintenanceRuns.mockResolvedValue({ runs: [] });
await act(async () => socket.fire('connect'));
expect(getMaintenanceRuns).toHaveBeenCalledTimes(3);
+ expect(card.getByText('No checks in flight.')).toBeInTheDocument();
vi.spyOn(document, 'visibilityState', 'get').mockReturnValue('hidden');
await act(async () => {
document.dispatchEvent(new Event('visibilitychange'));
diff --git a/docs/features/app-quality.md b/docs/features/app-quality.md
index 6edeb24d96..3fbb5b1cc8 100644
--- a/docs/features/app-quality.md
+++ b/docs/features/app-quality.md
@@ -8,6 +8,14 @@ Nothing calls an AI provider when a page loads or when the server starts.
The browser explicitly requests `includeQuality=true` on app reads; bare
`/api/apps` peer probes retain their existing response without assessment prose.
+The Quality tab's top status card shows active and pending check counts, each
+batch's current check and progress, and any reason it is waiting. Stop remaining
+checks is available on each batch without opening Run checks. Stopping prevents
+later checks from starting; work already queued or running can still finish.
+Status updates arrive through the existing maintenance events, including after
+reconnecting or returning to the tab. Loading and failed reads are shown beside
+a retry action rather than reported as an empty queue.
+
Every scheduled audit category first inventory first-party source roots, scan
for their category's signals, rank the top five candidates (or all if fewer),
and validate the strongest candidates before selecting a bounded investigation.