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: run quality checks below composite score

[._.]/ Adam Eivy23cca6ed2794
diff --git a/client/src/components/apps/AppQualityRunner.jsx b/client/src/components/apps/AppQualityRunner.jsx
index 22072059a5..930160feb5 100644
--- a/client/src/components/apps/AppQualityRunner.jsx
+++ b/client/src/components/apps/AppQualityRunner.jsx
@@ -11,6 +11,7 @@ import { getMaintenanceRuns, startMaintenanceRun, stopMaintenanceRun } from '../
// the dispatch anyway, so the batch selections leave it out. Picking the one
// category by name still offers it, and the server explains the skip.
const isApplicable = category => category.applicable !== false;
+const BELOW_COMPOSITE = 'below-composite';
const needsCheck = category => {
if (!isApplicable(category)) return false;
// A stale not-applicable ruling has expired (the repo may have gained a UI), so it is re-offered.
@@ -20,9 +21,10 @@ const needsCheck = category => {
export default function AppQualityRunner({ app, children }) {
const categories = app.quality?.categories || [];
+ const compositeScore = app.quality?.score;
const [params, setParams] = useSearchParams();
const requested = params.get('qualityCheck');
- const selection = requested === 'all' || categories.some(category => category.id === requested) ? requested : 'missing';
+ const selection = requested === 'all' || requested === BELOW_COMPOSITE || categories.some(category => category.id === requested) ? requested : 'missing';
const setSelection = value => setParams(previous => {
const next = new URLSearchParams(previous);
next.set('qualityCheck', value);
@@ -36,7 +38,24 @@ export default function AppQualityRunner({ app, children }) {
const [loaded, setLoaded] = useState(false);
const revision = useRef(0);
const picker = useProviderModels({ filter: enabledProcessProviderFilter, withEffort: true });
- const taskTypes = categories.filter(category => (selection === 'all' && isApplicable(category)) || (selection === 'missing' ? needsCheck(category) : category.id === selection)).map(category => category.id);
+ const selectedCategories = categories.filter(category => {
+ if (selection === 'all') return isApplicable(category);
+ if (selection === 'missing') return needsCheck(category);
+ if (selection === BELOW_COMPOSITE) {
+ return isApplicable(category) && compositeScore != null && category.score != null
+ && category.coverage !== 'not-applicable' && category.score < compositeScore;
+ }
+ return category.id === selection;
+ });
+ const taskTypes = selectedCategories.map(category => category.id);
+ const batchSelection = selection === 'missing' || selection === 'all' || selection === BELOW_COMPOSITE;
+ const emptySelectionMessage = selection === BELOW_COMPOSITE
+ ? compositeScore == null
+ ? 'No overall composite score is available, so below-score checks cannot be selected.'
+ : `No applicable checks currently score below the overall composite score of ${compositeScore}/100.`
+ : selection === 'all'
+ ? 'No applicable checks are available.'
+ : 'No checks need evidence. Unavailable assessments and categories that do not apply to this repository are excluded.';
const loadRuns = useCallback(async () => {
const requestedRevision = revision.current;
const response = await getMaintenanceRuns({ silent: true }).catch(() => null);
@@ -53,7 +72,7 @@ export default function AppQualityRunner({ app, children }) {
effort: effort || null, mode, claimBetweenAudits: false, taskTypes,
// A category picked by name is the user's explicit choice and runs even if
// the repository scan says it cannot apply; batch selections stay gated.
- ...(selection !== 'missing' && selection !== 'all' ? { explicitCheck: true } : {}) }, { silent: true }).catch(err => { setError(err.message); return null; });
+ ...(!batchSelection ? { explicitCheck: true } : {}) }, { silent: true }).catch(err => { setError(err.message); return null; });
if (response) setRuns(previous => [response.run, ...previous.filter(entry => entry.id !== response.run.id)]);
setBusy(false);
};
@@ -69,7 +88,7 @@ export default function AppQualityRunner({ app, children }) {
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm">
<label htmlFor="quality-checks">Checks
<select id="quality-checks" className="block w-full bg-port-bg border border-port-border rounded p-2" value={selection} disabled={busy} onChange={event => setSelection(event.target.value)}>
- <option value="missing">Missing or outdated evidence</option><option value="all">All applicable categories</option>
+ <option value="missing">Missing or outdated evidence</option><option value={BELOW_COMPOSITE}>Below composite score</option><option value="all">All applicable categories</option>
{categories.map(category => <option key={category.id} value={category.id}>{category.label}</option>)}
</select>
</label>
@@ -84,7 +103,7 @@ export default function AppQualityRunner({ app, children }) {
onModelChange={picker.setSelectedModel} effort={effort} onEffortChange={setEffort} loading={picker.loading} disabled={busy}
emptyProviderOption="Select a subscription provider" emptyModelOption="Select a model" includeDefaultModel highlightToolUse />
<p className="text-xs text-gray-400">Runs sequentially; launch another batch to run in parallel. {mode === 'fix' ? 'Each audit can change code and open a PR.' : 'Findings become issues; no fixes.'}</p>
- <details className="text-xs"><summary className="cursor-pointer text-port-accent">Selected checks ({taskTypes.length})</summary><p className="mt-1">{categories.filter(category => taskTypes.includes(category.id)).map(category => category.label).join(', ') || 'No checks need evidence. Unavailable assessments and categories that do not apply to this repository are excluded.'}</p></details>
+ <details className="text-xs"><summary className="cursor-pointer text-port-accent">Selected checks ({taskTypes.length})</summary><p className="mt-1">{selectedCategories.map(category => category.label).join(', ') || emptySelectionMessage}</p></details>
<button type="button" onClick={start} disabled={busy || picker.loading || !picker.selectedProviderId || !picker.selectedModel || !taskTypes.length || app.quality?.unavailable}
className="px-3 py-2 rounded bg-port-accent text-port-bg text-sm font-medium disabled:opacity-50">{taskTypes.length === 1 ? 'Run now' : `Run ${taskTypes.length} checks now`}</button>
{!loaded && <p className="text-xs" role="status">Loading runner status… <button type="button" className="text-port-accent" onClick={loadRuns}>Retry</button></p>}
diff --git a/client/src/components/apps/AppQualityRunner.test.jsx b/client/src/components/apps/AppQualityRunner.test.jsx
index 6e0a0265dd..039cf3872a 100644
--- a/client/src/components/apps/AppQualityRunner.test.jsx
+++ b/client/src/components/apps/AppQualityRunner.test.jsx
@@ -28,6 +28,41 @@ it('launches missing checks with visible mode and effort, then exposes held runn
expect(startMaintenanceRun).toHaveBeenCalledWith({ appId: 'app-1', providerId: 'codex', model: 'gpt-5', effort: 'high', mode: 'fix', claimBetweenAudits: false, taskTypes: ['security', 'ux'] }, { silent: true });
expect(button).toBeEnabled();
});
+
+it('runs only applicable scored categories below the overall composite as a batch', async () => {
+ startMaintenanceRun.mockResolvedValue({ run: { id: 'run-below-score', status: 'running', steps: [] } });
+ const categories = [
+ { id: 'security', label: 'Security', score: 60, coverage: 'broad', confidence: 'high' },
+ { id: 'performance', label: 'Performance', score: 74, coverage: 'partial' },
+ { id: 'ux', label: 'UX', score: 75, coverage: 'broad', confidence: 'high' },
+ { id: 'privacy', label: 'Privacy', score: 90, coverage: 'broad', confidence: 'high' },
+ { id: 'unavailable', label: 'Unavailable', score: null, coverage: 'unavailable' },
+ { id: 'inapplicable', label: 'Inapplicable', score: 20, coverage: 'broad', applicable: false },
+ { id: 'not-applicable', label: 'Not applicable', score: 20, coverage: 'not-applicable' },
+ ];
+ render(<MemoryRouter initialEntries={['/apps/example/quality?qualityCheck=below-composite']}>
+ <AppQualityRunner app={{ ...app, quality: { score: 75, categories } }} />
+ </MemoryRouter>);
+
+ const button = await findEnabledByRole('button', { name: 'Run 2 checks now' });
+ fireEvent.click(button);
+ await waitFor(() => expect(startMaintenanceRun).toHaveBeenCalledWith(expect.objectContaining({
+ taskTypes: ['security', 'performance'],
+ }), { silent: true }));
+ expect(startMaintenanceRun.mock.lastCall[0]).not.toHaveProperty('explicitCheck');
+});
+
+it('explains when the composite score is unavailable for below-score selection', async () => {
+ render(<MemoryRouter initialEntries={['/apps/example/quality?qualityCheck=below-composite']}>
+ <AppQualityRunner app={{ ...app, quality: { score: null, categories: app.quality.categories } }} />
+ </MemoryRouter>);
+
+ await waitFor(() => expect(screen.queryByText('Loading runner status…')).not.toBeInTheDocument());
+ expect(screen.getByRole('button', { name: 'Run 0 checks now' })).toBeDisabled();
+ fireEvent.click(screen.getByText('Selected checks (0)'));
+ expect(screen.getByText(/No overall composite score is available/)).toBeInTheDocument();
+});
+
it('allows one category and recovers from launch failure without reporting a run', async () => {
startMaintenanceRun.mockRejectedValue(new Error('Provider unavailable'));
render(<MemoryRouter><AppQualityRunner app={app} /></MemoryRouter>);